endset_three_editor 0.4.3 → 0.4.5

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.
@@ -1,11 +1,11 @@
1
1
  var _n = Object.defineProperty;
2
2
  var $n = (r, e, t) => e in r ? _n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var Re = (r, e, t) => $n(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { toRaw as xt, defineComponent as be, ref as j, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as se, withModifiers as jt, unref as ss, toDisplayString as ie, Fragment as ve, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as Me, withDirectives as E, vModelText as N, withKeys as He, vModelCheckbox as is, toRef as os, provide as rs, createVNode as Dt, vShow as De, shallowRef as $t, onMounted as as, onBeforeUnmount as ls } from "vue";
4
+ import { toRaw as xt, defineComponent as Ie, ref as L, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as ie, withModifiers as jt, unref as ss, toDisplayString as _, Fragment as Me, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as de, withDirectives as E, vModelText as H, withKeys as He, vModelCheckbox as is, toRef as os, provide as rs, createVNode as Dt, vShow as De, shallowRef as $t, onMounted as as, onBeforeUnmount as ls } from "vue";
5
5
  import * as P from "three";
6
- import { Controls as On, Vector3 as M, MOUSE as Ne, TOUCH as Le, Quaternion as K, Spherical as en, Vector2 as Y, Ray as cs, Plane as us, MathUtils as En, Raycaster as As, Object3D as ke, MeshBasicMaterial as Pe, LineBasicMaterial as Ze, CylinderGeometry as U, BoxGeometry as q, BufferGeometry as We, Float32BufferAttribute as pe, Mesh as v, OctahedronGeometry as lt, Line as ue, TorusGeometry as Ge, SphereGeometry as ds, Euler as hs, Matrix4 as me, PlaneGeometry as fs, DoubleSide as Rn, Loader as Yt, FileLoader as tt, Color as de, SRGBColorSpace as Ae, Group as ft, Material as Qe, PointsMaterial as Ue, MeshPhongMaterial as ps, LineSegments as Wt, Points as pt, TrianglesDrawMode as ms, TriangleFanDrawMode as zt, TriangleStripDrawMode as Sn, LoaderUtils as Je, MeshPhysicalMaterial as le, LinearSRGBColorSpace as ae, SpotLight as gs, PointLight as bs, DirectionalLight as Is, InstancedMesh as ys, InstancedBufferAttribute as Cs, TextureLoader as xs, ImageBitmapLoader as ws, BufferAttribute as _e, InterleavedBuffer as Hn, InterleavedBufferAttribute as Ln, LinearMipmapLinearFilter as Nn, NearestMipmapLinearFilter as vs, LinearMipmapNearestFilter as Ms, NearestMipmapNearestFilter as Ds, LinearFilter as Gt, NearestFilter as jn, RepeatWrapping as Ft, MirroredRepeatWrapping as Ps, ClampToEdgeWrapping as Ts, MeshStandardMaterial as kn, PropertyBinding as Os, SkinnedMesh as Es, LineLoop as Rs, PerspectiveCamera as Ss, OrthographicCamera as Hs, Skeleton as Ls, AnimationClip as Ns, Bone as js, InterpolateDiscrete as ks, InterpolateLinear as Wn, Texture as tn, VectorKeyframeTrack as nn, NumberKeyframeTrack as sn, QuaternionKeyframeTrack as on, ColorManagement as qt, FrontSide as Ws, Interpolant as zs, Box3 as Gs, Sphere as Fs } from "three";
6
+ import { Controls as On, Vector3 as M, MOUSE as Ne, TOUCH as Le, Quaternion as K, Spherical as en, Vector2 as Y, Ray as cs, Plane as us, MathUtils as En, Raycaster as ds, Object3D as ke, MeshBasicMaterial as Pe, LineBasicMaterial as Ze, CylinderGeometry as U, BoxGeometry as q, BufferGeometry as We, Float32BufferAttribute as me, Mesh as v, OctahedronGeometry as lt, Line as ue, TorusGeometry as Ge, SphereGeometry as As, Euler as hs, Matrix4 as ge, PlaneGeometry as fs, DoubleSide as Rn, Loader as Yt, FileLoader as tt, Color as he, SRGBColorSpace as Ae, Group as ft, Material as Qe, PointsMaterial as Ue, MeshPhongMaterial as ps, LineSegments as Wt, Points as pt, TrianglesDrawMode as ms, TriangleFanDrawMode as zt, TriangleStripDrawMode as Sn, LoaderUtils as Je, MeshPhysicalMaterial as le, LinearSRGBColorSpace as ae, SpotLight as gs, PointLight as bs, DirectionalLight as Is, InstancedMesh as ys, InstancedBufferAttribute as Cs, TextureLoader as xs, ImageBitmapLoader as ws, BufferAttribute as _e, InterleavedBuffer as Hn, InterleavedBufferAttribute as Ln, LinearMipmapLinearFilter as Nn, NearestMipmapLinearFilter as vs, LinearMipmapNearestFilter as Ms, NearestMipmapNearestFilter as Ds, LinearFilter as Gt, NearestFilter as jn, RepeatWrapping as Ft, MirroredRepeatWrapping as Ps, ClampToEdgeWrapping as Ts, MeshStandardMaterial as kn, PropertyBinding as Os, SkinnedMesh as Es, LineLoop as Rs, PerspectiveCamera as Ss, OrthographicCamera as Hs, Skeleton as Ls, AnimationClip as Ns, Bone as js, InterpolateDiscrete as ks, InterpolateLinear as Wn, Texture as tn, VectorKeyframeTrack as nn, NumberKeyframeTrack as sn, QuaternionKeyframeTrack as on, ColorManagement as qt, FrontSide as Ws, Interpolant as zs, Box3 as Gs, Sphere as Fs } from "three";
7
7
  import nt from "@tweenjs/tween.js";
8
- const rn = { type: "change" }, Kt = { type: "start" }, zn = { type: "end" }, ct = new cs(), an = new us(), qs = Math.cos(70 * En.DEG2RAD), G = new M(), V = 2 * Math.PI, H = {
8
+ const rn = { type: "change" }, Kt = { type: "start" }, zn = { type: "end" }, ct = new cs(), an = new us(), qs = Math.cos(70 * En.DEG2RAD), G = new M(), V = 2 * Math.PI, N = {
9
9
  NONE: -1,
10
10
  ROTATE: 0,
11
11
  DOLLY: 1,
@@ -23,7 +23,7 @@ class Xs extends On {
23
23
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
24
24
  */
25
25
  constructor(e, t = null) {
26
- super(e, t), this.state = H.NONE, this.target = new M(), this.cursor = new M(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new en(), this._sphericalDelta = new en(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new Y(), this._rotateEnd = new Y(), this._rotateDelta = new Y(), this._panStart = new Y(), this._panEnd = new Y(), this._panDelta = new Y(), this._dollyStart = new Y(), this._dollyEnd = new Y(), this._dollyDelta = new Y(), this._dollyDirection = new M(), this._mouse = new Y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Us.bind(this), this._onPointerDown = Bs.bind(this), this._onPointerUp = Vs.bind(this), this._onContextMenu = $s.bind(this), this._onMouseWheel = Zs.bind(this), this._onKeyDown = Qs.bind(this), this._onTouchStart = Js.bind(this), this._onTouchMove = _s.bind(this), this._onMouseDown = Ys.bind(this), this._onMouseMove = Ks.bind(this), this._interceptControlDown = ei.bind(this), this._interceptControlUp = ti.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
26
+ super(e, t), this.state = N.NONE, this.target = new M(), this.cursor = new M(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new en(), this._sphericalDelta = new en(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new Y(), this._rotateEnd = new Y(), this._rotateDelta = new Y(), this._panStart = new Y(), this._panEnd = new Y(), this._panDelta = new Y(), this._dollyStart = new Y(), this._dollyEnd = new Y(), this._dollyDelta = new Y(), this._dollyDirection = new M(), this._mouse = new Y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Us.bind(this), this._onPointerDown = Bs.bind(this), this._onPointerUp = Vs.bind(this), this._onContextMenu = $s.bind(this), this._onMouseWheel = Zs.bind(this), this._onKeyDown = Qs.bind(this), this._onTouchStart = Js.bind(this), this._onTouchMove = _s.bind(this), this._onMouseDown = Ys.bind(this), this._onMouseMove = Ks.bind(this), this._interceptControlDown = ei.bind(this), this._interceptControlUp = ti.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
27
27
  }
28
28
  /**
29
29
  * Defines the visual representation of the cursor.
@@ -96,7 +96,7 @@ class Xs extends On {
96
96
  * was called, or the initial state.
97
97
  */
98
98
  reset() {
99
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(rn), this.update(), this.state = H.NONE;
99
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(rn), this.update(), this.state = N.NONE;
100
100
  }
101
101
  /**
102
102
  * Programmatically pan the camera.
@@ -141,7 +141,7 @@ class Xs extends On {
141
141
  }
142
142
  update(e = null) {
143
143
  const t = this.object.position;
144
- G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state === H.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
144
+ G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state === N.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
145
145
  let s = this.minAzimuthAngle, n = this.maxAzimuthAngle;
146
146
  isFinite(s) && isFinite(n) && (s < -Math.PI ? s += V : s > Math.PI && (s -= V), n < -Math.PI ? n += V : n > Math.PI && (n -= V), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
147
147
  let i = !1;
@@ -373,7 +373,7 @@ function Us(r) {
373
373
  function Vs(r) {
374
374
  switch (this._removePointer(r), this._pointers.length) {
375
375
  case 0:
376
- this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state = H.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
376
+ this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state = N.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
377
377
  break;
378
378
  case 1:
379
379
  const e = this._pointers[0], t = this._pointerPositions[e];
@@ -399,49 +399,49 @@ function Ys(r) {
399
399
  switch (e) {
400
400
  case Ne.DOLLY:
401
401
  if (this.enableZoom === !1) return;
402
- this._handleMouseDownDolly(r), this.state = H.DOLLY;
402
+ this._handleMouseDownDolly(r), this.state = N.DOLLY;
403
403
  break;
404
404
  case Ne.ROTATE:
405
405
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
406
406
  if (this.enablePan === !1) return;
407
- this._handleMouseDownPan(r), this.state = H.PAN;
407
+ this._handleMouseDownPan(r), this.state = N.PAN;
408
408
  } else {
409
409
  if (this.enableRotate === !1) return;
410
- this._handleMouseDownRotate(r), this.state = H.ROTATE;
410
+ this._handleMouseDownRotate(r), this.state = N.ROTATE;
411
411
  }
412
412
  break;
413
413
  case Ne.PAN:
414
414
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
415
415
  if (this.enableRotate === !1) return;
416
- this._handleMouseDownRotate(r), this.state = H.ROTATE;
416
+ this._handleMouseDownRotate(r), this.state = N.ROTATE;
417
417
  } else {
418
418
  if (this.enablePan === !1) return;
419
- this._handleMouseDownPan(r), this.state = H.PAN;
419
+ this._handleMouseDownPan(r), this.state = N.PAN;
420
420
  }
421
421
  break;
422
422
  default:
423
- this.state = H.NONE;
423
+ this.state = N.NONE;
424
424
  }
425
- this.state !== H.NONE && this.dispatchEvent(Kt);
425
+ this.state !== N.NONE && this.dispatchEvent(Kt);
426
426
  }
427
427
  function Ks(r) {
428
428
  switch (this.state) {
429
- case H.ROTATE:
429
+ case N.ROTATE:
430
430
  if (this.enableRotate === !1) return;
431
431
  this._handleMouseMoveRotate(r);
432
432
  break;
433
- case H.DOLLY:
433
+ case N.DOLLY:
434
434
  if (this.enableZoom === !1) return;
435
435
  this._handleMouseMoveDolly(r);
436
436
  break;
437
- case H.PAN:
437
+ case N.PAN:
438
438
  if (this.enablePan === !1) return;
439
439
  this._handleMouseMovePan(r);
440
440
  break;
441
441
  }
442
442
  }
443
443
  function Zs(r) {
444
- this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (r.preventDefault(), this.dispatchEvent(Kt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(zn));
444
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== N.NONE || (r.preventDefault(), this.dispatchEvent(Kt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(zn));
445
445
  }
446
446
  function Qs(r) {
447
447
  this.enabled !== !1 && this._handleKeyDown(r);
@@ -452,55 +452,55 @@ function Js(r) {
452
452
  switch (this.touches.ONE) {
453
453
  case Le.ROTATE:
454
454
  if (this.enableRotate === !1) return;
455
- this._handleTouchStartRotate(r), this.state = H.TOUCH_ROTATE;
455
+ this._handleTouchStartRotate(r), this.state = N.TOUCH_ROTATE;
456
456
  break;
457
457
  case Le.PAN:
458
458
  if (this.enablePan === !1) return;
459
- this._handleTouchStartPan(r), this.state = H.TOUCH_PAN;
459
+ this._handleTouchStartPan(r), this.state = N.TOUCH_PAN;
460
460
  break;
461
461
  default:
462
- this.state = H.NONE;
462
+ this.state = N.NONE;
463
463
  }
464
464
  break;
465
465
  case 2:
466
466
  switch (this.touches.TWO) {
467
467
  case Le.DOLLY_PAN:
468
468
  if (this.enableZoom === !1 && this.enablePan === !1) return;
469
- this._handleTouchStartDollyPan(r), this.state = H.TOUCH_DOLLY_PAN;
469
+ this._handleTouchStartDollyPan(r), this.state = N.TOUCH_DOLLY_PAN;
470
470
  break;
471
471
  case Le.DOLLY_ROTATE:
472
472
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
473
- this._handleTouchStartDollyRotate(r), this.state = H.TOUCH_DOLLY_ROTATE;
473
+ this._handleTouchStartDollyRotate(r), this.state = N.TOUCH_DOLLY_ROTATE;
474
474
  break;
475
475
  default:
476
- this.state = H.NONE;
476
+ this.state = N.NONE;
477
477
  }
478
478
  break;
479
479
  default:
480
- this.state = H.NONE;
480
+ this.state = N.NONE;
481
481
  }
482
- this.state !== H.NONE && this.dispatchEvent(Kt);
482
+ this.state !== N.NONE && this.dispatchEvent(Kt);
483
483
  }
484
484
  function _s(r) {
485
485
  switch (this._trackPointer(r), this.state) {
486
- case H.TOUCH_ROTATE:
486
+ case N.TOUCH_ROTATE:
487
487
  if (this.enableRotate === !1) return;
488
488
  this._handleTouchMoveRotate(r), this.update();
489
489
  break;
490
- case H.TOUCH_PAN:
490
+ case N.TOUCH_PAN:
491
491
  if (this.enablePan === !1) return;
492
492
  this._handleTouchMovePan(r), this.update();
493
493
  break;
494
- case H.TOUCH_DOLLY_PAN:
494
+ case N.TOUCH_DOLLY_PAN:
495
495
  if (this.enableZoom === !1 && this.enablePan === !1) return;
496
496
  this._handleTouchMoveDollyPan(r), this.update();
497
497
  break;
498
- case H.TOUCH_DOLLY_ROTATE:
498
+ case N.TOUCH_DOLLY_ROTATE:
499
499
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
500
500
  this._handleTouchMoveDollyRotate(r), this.update();
501
501
  break;
502
502
  default:
503
- this.state = H.NONE;
503
+ this.state = N.NONE;
504
504
  }
505
505
  }
506
506
  function $s(r) {
@@ -512,11 +512,11 @@ function ei(r) {
512
512
  function ti(r) {
513
513
  r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
514
514
  }
515
- const Ce = new As(), F = new M(), he = new M(), k = new K(), ln = {
515
+ const xe = new ds(), F = new M(), fe = new M(), k = new K(), ln = {
516
516
  X: new M(1, 0, 0),
517
517
  Y: new M(0, 1, 0),
518
518
  Z: new M(0, 0, 1)
519
- }, Tt = { type: "change" }, cn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null }, An = { type: "objectChange" };
519
+ }, Tt = { type: "change" }, cn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null }, dn = { type: "objectChange" };
520
520
  class ni extends On {
521
521
  /**
522
522
  * Constructs a new controls instance.
@@ -533,20 +533,20 @@ class ni extends On {
533
533
  const i = new ui();
534
534
  this._plane = i, s.add(i);
535
535
  const o = this;
536
- function a(C, y) {
537
- let w = y;
536
+ function a(C, x) {
537
+ let w = x;
538
538
  Object.defineProperty(o, C, {
539
539
  get: function() {
540
- return w !== void 0 ? w : y;
540
+ return w !== void 0 ? w : x;
541
541
  },
542
542
  set: function(D) {
543
543
  w !== D && (w = D, i[C] = D, n[C] = D, o.dispatchEvent({ type: C + "-changed", value: D }), o.dispatchEvent(Tt));
544
544
  }
545
- }), o[C] = y, i[C] = y, n[C] = y;
545
+ }), o[C] = x, i[C] = x, n[C] = x;
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 M(), c = new M(), A = new K(), u = new K(), h = new M(), d = new K(), p = new M(), m = new M(), f = new M(), g = 0, x = new M();
549
- a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart", p), a("pointEnd", m), a("rotationAxis", f), a("rotationAngle", g), a("eye", x), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = si.bind(this), this._onPointerDown = oi.bind(this), this._onPointerHover = ii.bind(this), this._onPointerMove = ri.bind(this), this._onPointerUp = ai.bind(this), t !== null && this.connect(t);
548
+ const l = new M(), c = new M(), d = new K(), u = new K(), h = new M(), A = new K(), f = new M(), p = new M(), m = new M(), g = 0, y = new M();
549
+ a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", A), a("pointStart", f), a("pointEnd", p), a("rotationAxis", m), a("rotationAngle", g), a("eye", y), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = si.bind(this), this._onPointerDown = oi.bind(this), this._onPointerHover = ii.bind(this), this._onPointerMove = ri.bind(this), this._onPointerUp = ai.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";
@@ -565,14 +565,14 @@ class ni extends On {
565
565
  }
566
566
  pointerHover(e) {
567
567
  if (this.object === void 0 || this.dragging === !0) return;
568
- e !== null && Ce.setFromCamera(e, this.camera);
569
- const t = Ot(this._gizmo.picker[this.mode], Ce);
568
+ e !== null && xe.setFromCamera(e, this.camera);
569
+ const t = Ot(this._gizmo.picker[this.mode], xe);
570
570
  t ? this.axis = t.object.name : this.axis = null;
571
571
  }
572
572
  pointerDown(e) {
573
573
  if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
574
- e !== null && Ce.setFromCamera(e, this.camera);
575
- const t = Ot(this._plane, Ce, !0);
574
+ e !== null && xe.setFromCamera(e, this.camera);
575
+ const t = Ot(this._plane, xe, !0);
576
576
  t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, cn.mode = this.mode, this.dispatchEvent(cn);
577
577
  }
578
578
  }
@@ -580,25 +580,25 @@ class ni extends On {
580
580
  const t = this.axis, s = this.mode, n = this.object;
581
581
  let i = this.space;
582
582
  if (s === "scale" ? i = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (i = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
583
- e !== null && Ce.setFromCamera(e, this.camera);
584
- const o = Ot(this._plane, Ce, !0);
583
+ e !== null && xe.setFromCamera(e, this.camera);
584
+ const o = Ot(this._plane, xe, !0);
585
585
  if (o) {
586
586
  if (this.pointEnd.copy(o.point).sub(this.worldPositionStart), s === "translate")
587
587
  this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (n.position.applyQuaternion(k.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), i === "world" && (n.parent && n.position.add(F.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(F.setFromMatrixPosition(n.parent.matrixWorld)))), n.position.x = Math.max(this.minX, Math.min(this.maxX, n.position.x)), n.position.y = Math.max(this.minY, Math.min(this.maxY, n.position.y)), n.position.z = Math.max(this.minZ, Math.min(this.maxZ, n.position.z));
588
588
  else if (s === "scale") {
589
589
  if (t.search("XYZ") !== -1) {
590
590
  let a = this.pointEnd.length() / this.pointStart.length();
591
- this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), he.set(a, a, a);
591
+ this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), fe.set(a, a, a);
592
592
  } else
593
- F.copy(this.pointStart), he.copy(this.pointEnd), F.applyQuaternion(this._worldQuaternionInv), he.applyQuaternion(this._worldQuaternionInv), he.divide(F), t.search("X") === -1 && (he.x = 1), t.search("Y") === -1 && (he.y = 1), t.search("Z") === -1 && (he.z = 1);
594
- n.scale.copy(this._scaleStart).multiply(he), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
593
+ F.copy(this.pointStart), fe.copy(this.pointEnd), F.applyQuaternion(this._worldQuaternionInv), fe.applyQuaternion(this._worldQuaternionInv), fe.divide(F), t.search("X") === -1 && (fe.x = 1), t.search("Y") === -1 && (fe.y = 1), t.search("Z") === -1 && (fe.z = 1);
594
+ n.scale.copy(this._scaleStart).multiply(fe), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
595
595
  } else if (s === "rotate") {
596
596
  this._offset.copy(this.pointEnd).sub(this.pointStart);
597
597
  const a = 20 / this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld));
598
598
  let l = !1;
599
599
  t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(F.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(ln[t]), F.copy(ln[t]), i === "local" && F.applyQuaternion(this.worldQuaternion), F.cross(this.eye), F.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(F.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(k.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(k.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
600
600
  }
601
- this.dispatchEvent(Tt), this.dispatchEvent(An);
601
+ this.dispatchEvent(Tt), this.dispatchEvent(dn);
602
602
  }
603
603
  }
604
604
  pointerUp(e) {
@@ -628,7 +628,7 @@ class ni extends On {
628
628
  * Resets the object's position, rotation and scale to when the current transform began.
629
629
  */
630
630
  reset() {
631
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Tt), this.dispatchEvent(An), this.pointStart.copy(this.pointEnd));
631
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Tt), this.dispatchEvent(dn), this.pointStart.copy(this.pointEnd));
632
632
  }
633
633
  /**
634
634
  * Returns the raycaster that is used for user interaction. This object is shared between all
@@ -637,7 +637,7 @@ class ni extends On {
637
637
  * @returns {Raycaster} The internal raycaster.
638
638
  */
639
639
  getRaycaster() {
640
- return Ce;
640
+ return xe;
641
641
  }
642
642
  /**
643
643
  * Returns the transformation mode.
@@ -749,7 +749,7 @@ function Ot(r, e, t) {
749
749
  return s[n];
750
750
  return !1;
751
751
  }
752
- const ut = new hs(), L = new M(0, 1, 0), dn = new M(0, 0, 0), hn = new me(), At = new K(), mt = new K(), oe = new M(), fn = new me(), Ve = new M(1, 0, 0), we = new M(0, 1, 0), Ye = new M(0, 0, 1), dt = new M(), Fe = new M(), qe = new M();
752
+ const ut = new hs(), j = new M(0, 1, 0), An = new M(0, 0, 0), hn = new ge(), dt = new K(), mt = new K(), oe = new M(), fn = new ge(), Ve = new M(1, 0, 0), ve = new M(0, 1, 0), Ye = new M(0, 0, 1), At = new M(), Fe = new M(), qe = new M();
753
753
  class li extends ke {
754
754
  constructor(e) {
755
755
  super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
@@ -794,62 +794,62 @@ class ci extends ke {
794
794
  l.color.setHex(16711680), l.opacity = 0.5;
795
795
  const c = e.clone();
796
796
  c.color.setHex(65280), c.opacity = 0.5;
797
- const A = e.clone();
798
- A.color.setHex(255), A.opacity = 0.5;
797
+ const d = e.clone();
798
+ d.color.setHex(255), d.opacity = 0.5;
799
799
  const u = e.clone();
800
800
  u.opacity = 0.25;
801
801
  const h = e.clone();
802
802
  h.color.setHex(16776960), h.opacity = 0.25;
803
- const d = e.clone();
804
- d.color.setHex(16776960);
805
- const p = e.clone();
806
- p.color.setHex(7895160), this.materialLib = {
803
+ const A = e.clone();
804
+ A.color.setHex(16776960);
805
+ const f = e.clone();
806
+ f.color.setHex(7895160), this.materialLib = {
807
807
  xAxis: i,
808
808
  yAxis: o,
809
809
  zAxis: a,
810
- active: d,
810
+ active: A,
811
811
  xAxisTransparent: l,
812
812
  yAxisTransparent: c,
813
- zAxisTransparent: A,
813
+ zAxisTransparent: d,
814
814
  activeTransparent: h
815
815
  };
816
- const m = new U(0, 0.04, 0.1, 12);
817
- m.translate(0, 0.05, 0);
818
- const f = new q(0.08, 0.08, 0.08);
819
- f.translate(0, 0.04, 0);
816
+ const p = new U(0, 0.04, 0.1, 12);
817
+ p.translate(0, 0.05, 0);
818
+ const m = new q(0.08, 0.08, 0.08);
819
+ m.translate(0, 0.04, 0);
820
820
  const g = new We();
821
- g.setAttribute("position", new pe([0, 0, 0, 1, 0, 0], 3));
822
- const x = new U(75e-4, 75e-4, 0.5, 3);
823
- x.translate(0, 0.25, 0);
824
- function C($, it) {
825
- const ne = new Ge($, 75e-4, 3, 64, it * Math.PI * 2);
826
- return ne.rotateY(Math.PI / 2), ne.rotateX(Math.PI / 2), ne;
821
+ g.setAttribute("position", new me([0, 0, 0, 1, 0, 0], 3));
822
+ const y = new U(75e-4, 75e-4, 0.5, 3);
823
+ y.translate(0, 0.25, 0);
824
+ function C(ee, it) {
825
+ const se = new Ge(ee, 75e-4, 3, 64, it * Math.PI * 2);
826
+ return se.rotateY(Math.PI / 2), se.rotateX(Math.PI / 2), se;
827
827
  }
828
- function y() {
829
- const $ = new We();
830
- return $.setAttribute("position", new pe([0, 0, 0, 1, 1, 1], 3)), $;
828
+ function x() {
829
+ const ee = new We();
830
+ return ee.setAttribute("position", new me([0, 0, 0, 1, 1, 1], 3)), ee;
831
831
  }
832
832
  const w = {
833
833
  X: [
834
- [new v(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
835
- [new v(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
836
- [new v(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
834
+ [new v(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
835
+ [new v(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
836
+ [new v(y, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
837
837
  ],
838
838
  Y: [
839
- [new v(m, o), [0, 0.5, 0]],
840
- [new v(m, o), [0, -0.5, 0], [Math.PI, 0, 0]],
841
- [new v(x, o)]
839
+ [new v(p, o), [0, 0.5, 0]],
840
+ [new v(p, o), [0, -0.5, 0], [Math.PI, 0, 0]],
841
+ [new v(y, o)]
842
842
  ],
843
843
  Z: [
844
- [new v(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
845
- [new v(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
846
- [new v(x, a), null, [Math.PI / 2, 0, 0]]
844
+ [new v(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
845
+ [new v(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
846
+ [new v(y, a), null, [Math.PI / 2, 0, 0]]
847
847
  ],
848
848
  XYZ: [
849
849
  [new v(new lt(0.1, 0), u), [0, 0, 0]]
850
850
  ],
851
851
  XY: [
852
- [new v(new q(0.15, 0.15, 0.01), A), [0.15, 0.15, 0]]
852
+ [new v(new q(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
853
853
  ],
854
854
  YZ: [
855
855
  [new v(new q(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
@@ -890,7 +890,7 @@ class ci extends ke {
890
890
  [new v(new lt(0.01, 2), n), null, null, null, "helper"]
891
891
  ],
892
892
  DELTA: [
893
- [new ue(y(), n), null, null, null, "helper"]
893
+ [new ue(x(), n), null, null, null, "helper"]
894
894
  ],
895
895
  X: [
896
896
  [new ue(g, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
@@ -903,7 +903,7 @@ class ci extends ke {
903
903
  ]
904
904
  }, Z = {
905
905
  XYZE: [
906
- [new v(C(0.5, 1), p), null, [0, Math.PI / 2, 0]]
906
+ [new v(C(0.5, 1), f), null, [0, Math.PI / 2, 0]]
907
907
  ],
908
908
  X: [
909
909
  [new v(C(0.5, 0.5), i)]
@@ -917,13 +917,13 @@ class ci extends ke {
917
917
  E: [
918
918
  [new v(C(0.75, 1), h), null, [0, Math.PI / 2, 0]]
919
919
  ]
920
- }, _ = {
920
+ }, $ = {
921
921
  AXIS: [
922
922
  [new ue(g, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
923
923
  ]
924
924
  }, Q = {
925
925
  XYZE: [
926
- [new v(new ds(0.25, 10, 8), s)]
926
+ [new v(new As(0.25, 10, 8), s)]
927
927
  ],
928
928
  X: [
929
929
  [new v(new Ge(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
@@ -937,24 +937,24 @@ class ci extends ke {
937
937
  E: [
938
938
  [new v(new Ge(0.75, 0.1, 2, 24), s)]
939
939
  ]
940
- }, ye = {
940
+ }, Ce = {
941
941
  X: [
942
- [new v(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
943
- [new v(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
944
- [new v(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
942
+ [new v(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
943
+ [new v(y, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
944
+ [new v(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
945
945
  ],
946
946
  Y: [
947
- [new v(f, o), [0, 0.5, 0]],
948
- [new v(x, o)],
949
- [new v(f, o), [0, -0.5, 0], [0, 0, Math.PI]]
947
+ [new v(m, o), [0, 0.5, 0]],
948
+ [new v(y, o)],
949
+ [new v(m, o), [0, -0.5, 0], [0, 0, Math.PI]]
950
950
  ],
951
951
  Z: [
952
- [new v(f, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
953
- [new v(x, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
954
- [new v(f, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
952
+ [new v(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
953
+ [new v(y, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
954
+ [new v(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
955
955
  ],
956
956
  XY: [
957
- [new v(new q(0.15, 0.15, 0.01), A), [0.15, 0.15, 0]]
957
+ [new v(new q(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
958
958
  ],
959
959
  YZ: [
960
960
  [new v(new q(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
@@ -1001,18 +1001,18 @@ class ci extends ke {
1001
1001
  [new ue(g, n), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
1002
1002
  ]
1003
1003
  };
1004
- function ce($) {
1004
+ function ce(ee) {
1005
1005
  const it = new ke();
1006
- for (const ne in $)
1007
- for (let Ee = $[ne].length; Ee--; ) {
1008
- const B = $[ne][Ee][0].clone(), ot = $[ne][Ee][1], rt = $[ne][Ee][2], at = $[ne][Ee][3], Jn = $[ne][Ee][4];
1009
- B.name = ne, B.tag = Jn, ot && B.position.set(ot[0], ot[1], ot[2]), rt && B.rotation.set(rt[0], rt[1], rt[2]), at && B.scale.set(at[0], at[1], at[2]), B.updateMatrix();
1006
+ for (const se in ee)
1007
+ for (let Ee = ee[se].length; Ee--; ) {
1008
+ const B = ee[se][Ee][0].clone(), ot = ee[se][Ee][1], rt = ee[se][Ee][2], at = ee[se][Ee][3], Jn = ee[se][Ee][4];
1009
+ B.name = se, B.tag = Jn, ot && B.position.set(ot[0], ot[1], ot[2]), rt && B.rotation.set(rt[0], rt[1], rt[2]), at && B.scale.set(at[0], at[1], at[2]), B.updateMatrix();
1010
1010
  const _t = B.geometry.clone();
1011
1011
  _t.applyMatrix4(B.matrix), B.geometry = _t, B.renderOrder = 1 / 0, B.position.set(0, 0, 0), B.rotation.set(0, 0, 0), B.scale.set(1, 1, 1), it.add(B);
1012
1012
  }
1013
1013
  return it;
1014
1014
  }
1015
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ce(w)), this.add(this.gizmo.rotate = ce(Z)), this.add(this.gizmo.scale = ce(ye)), this.add(this.picker.translate = ce(D)), this.add(this.picker.rotate = ce(Q)), this.add(this.picker.scale = ce(Mt)), this.add(this.helper.translate = ce(S)), this.add(this.helper.rotate = ce(_)), this.add(this.helper.scale = ce(Qn)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1015
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ce(w)), this.add(this.gizmo.rotate = ce(Z)), this.add(this.gizmo.scale = ce(Ce)), this.add(this.picker.translate = ce(D)), this.add(this.picker.rotate = ce(Q)), this.add(this.picker.scale = ce(Mt)), this.add(this.helper.translate = ce(S)), this.add(this.helper.rotate = ce($)), this.add(this.helper.scale = ce(Qn)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1016
1016
  }
1017
1017
  // updateMatrixWorld will update transformations and appearance of individual handles
1018
1018
  updateMatrixWorld(e) {
@@ -1025,10 +1025,10 @@ class ci extends ke {
1025
1025
  o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
1026
1026
  let a;
1027
1027
  if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
1028
- o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (k.setFromEuler(ut.set(0, 0, 0)), o.quaternion.copy(s).multiply(k), Math.abs(L.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (k.setFromEuler(ut.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(k), Math.abs(L.copy(we).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(k), Math.abs(L.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(hn.lookAt(dn, L, we)), o.quaternion.multiply(k), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), F.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), F.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(F), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
1028
+ o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (k.setFromEuler(ut.set(0, 0, 0)), o.quaternion.copy(s).multiply(k), Math.abs(j.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (k.setFromEuler(ut.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(k), Math.abs(j.copy(ve).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(k), Math.abs(j.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), j.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(hn.lookAt(An, j, ve)), o.quaternion.multiply(k), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), F.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), F.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(F), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
1029
1029
  continue;
1030
1030
  }
1031
- o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(we).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(Ve).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(we).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (At.copy(s), L.copy(this.eye).applyQuaternion(k.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(hn.lookAt(this.eye, dn, we)), o.name === "X" && (k.setFromAxisAngle(Ve, Math.atan2(-L.y, L.z)), k.multiplyQuaternions(At, k), o.quaternion.copy(k)), o.name === "Y" && (k.setFromAxisAngle(we, Math.atan2(L.x, L.z)), k.multiplyQuaternions(At, k), o.quaternion.copy(k)), o.name === "Z" && (k.setFromAxisAngle(Ye, Math.atan2(L.y, L.x)), k.multiplyQuaternions(At, k), o.quaternion.copy(k))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
1031
+ o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(j.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(j.copy(ve).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(j.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(j.copy(Ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(j.copy(Ve).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(j.copy(ve).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (dt.copy(s), j.copy(this.eye).applyQuaternion(k.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(hn.lookAt(this.eye, An, ve)), o.name === "X" && (k.setFromAxisAngle(Ve, Math.atan2(-j.y, j.z)), k.multiplyQuaternions(dt, k), o.quaternion.copy(k)), o.name === "Y" && (k.setFromAxisAngle(ve, Math.atan2(j.x, j.z)), k.multiplyQuaternions(dt, k), o.quaternion.copy(k)), o.name === "Z" && (k.setFromAxisAngle(Ye, Math.atan2(j.y, j.x)), k.multiplyQuaternions(dt, k), o.quaternion.copy(k))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
1032
1032
  return o.name === l;
1033
1033
  }) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
1034
1034
  }
@@ -1044,27 +1044,27 @@ class ui extends v {
1044
1044
  }
1045
1045
  updateMatrixWorld(e) {
1046
1046
  let t = this.space;
1047
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), dt.copy(Ve).applyQuaternion(t === "local" ? this.worldQuaternion : mt), Fe.copy(we).applyQuaternion(t === "local" ? this.worldQuaternion : mt), qe.copy(Ye).applyQuaternion(t === "local" ? this.worldQuaternion : mt), L.copy(Fe), this.mode) {
1047
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), At.copy(Ve).applyQuaternion(t === "local" ? this.worldQuaternion : mt), Fe.copy(ve).applyQuaternion(t === "local" ? this.worldQuaternion : mt), qe.copy(Ye).applyQuaternion(t === "local" ? this.worldQuaternion : mt), j.copy(Fe), this.mode) {
1048
1048
  case "translate":
1049
1049
  case "scale":
1050
1050
  switch (this.axis) {
1051
1051
  case "X":
1052
- L.copy(this.eye).cross(dt), oe.copy(dt).cross(L);
1052
+ j.copy(this.eye).cross(At), oe.copy(At).cross(j);
1053
1053
  break;
1054
1054
  case "Y":
1055
- L.copy(this.eye).cross(Fe), oe.copy(Fe).cross(L);
1055
+ j.copy(this.eye).cross(Fe), oe.copy(Fe).cross(j);
1056
1056
  break;
1057
1057
  case "Z":
1058
- L.copy(this.eye).cross(qe), oe.copy(qe).cross(L);
1058
+ j.copy(this.eye).cross(qe), oe.copy(qe).cross(j);
1059
1059
  break;
1060
1060
  case "XY":
1061
1061
  oe.copy(qe);
1062
1062
  break;
1063
1063
  case "YZ":
1064
- oe.copy(dt);
1064
+ oe.copy(At);
1065
1065
  break;
1066
1066
  case "XZ":
1067
- L.copy(qe), oe.copy(Fe);
1067
+ j.copy(qe), oe.copy(Fe);
1068
1068
  break;
1069
1069
  case "XYZ":
1070
1070
  case "E":
@@ -1076,10 +1076,10 @@ class ui extends v {
1076
1076
  default:
1077
1077
  oe.set(0, 0, 0);
1078
1078
  }
1079
- oe.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (fn.lookAt(F.set(0, 0, 0), oe, L), this.quaternion.setFromRotationMatrix(fn)), super.updateMatrixWorld(e);
1079
+ oe.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (fn.lookAt(F.set(0, 0, 0), oe, j), this.quaternion.setFromRotationMatrix(fn)), super.updateMatrixWorld(e);
1080
1080
  }
1081
1081
  }
1082
- class Ai extends ke {
1082
+ class di extends ke {
1083
1083
  /**
1084
1084
  * Constructs a new CSS2D object.
1085
1085
  *
@@ -1096,8 +1096,8 @@ class Ai extends ke {
1096
1096
  return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
1097
1097
  }
1098
1098
  }
1099
- const Se = new M(), pn = new me(), mn = new me(), gn = new M(), bn = new M();
1100
- class di {
1099
+ const Se = new M(), pn = new ge(), mn = new ge(), gn = new M(), bn = new M();
1100
+ class Ai {
1101
1101
  /**
1102
1102
  * Constructs a new CSS2D renderer.
1103
1103
  *
@@ -1114,51 +1114,51 @@ class di {
1114
1114
  width: s,
1115
1115
  height: n
1116
1116
  };
1117
- }, this.render = function(p, m) {
1118
- p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), pn.copy(m.matrixWorldInverse), mn.multiplyMatrices(m.projectionMatrix, pn), A(p, p, m), this.sortObjects && d(p);
1119
- }, this.setSize = function(p, m) {
1120
- s = p, n = m, i = s / 2, o = n / 2, l.style.width = p + "px", l.style.height = m + "px";
1117
+ }, this.render = function(f, p) {
1118
+ f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), p.parent === null && p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), pn.copy(p.matrixWorldInverse), mn.multiplyMatrices(p.projectionMatrix, pn), d(f, f, p), this.sortObjects && A(f);
1119
+ }, this.setSize = function(f, p) {
1120
+ s = f, n = p, i = s / 2, o = n / 2, l.style.width = f + "px", l.style.height = p + "px";
1121
1121
  };
1122
- function c(p) {
1123
- p.isCSS2DObject && (p.element.style.display = "none");
1124
- for (let m = 0, f = p.children.length; m < f; m++)
1125
- c(p.children[m]);
1122
+ function c(f) {
1123
+ f.isCSS2DObject && (f.element.style.display = "none");
1124
+ for (let p = 0, m = f.children.length; p < m; p++)
1125
+ c(f.children[p]);
1126
1126
  }
1127
- function A(p, m, f) {
1128
- if (p.visible === !1) {
1129
- c(p);
1127
+ function d(f, p, m) {
1128
+ if (f.visible === !1) {
1129
+ c(f);
1130
1130
  return;
1131
1131
  }
1132
- if (p.isCSS2DObject) {
1133
- Se.setFromMatrixPosition(p.matrixWorld), Se.applyMatrix4(mn);
1134
- const g = Se.z >= -1 && Se.z <= 1 && p.layers.test(f.layers) === !0, x = p.element;
1135
- x.style.display = g === !0 ? "" : "none", g === !0 && (p.onBeforeRender(t, m, f), x.style.transform = "translate(" + -100 * p.center.x + "%," + -100 * p.center.y + "%)translate(" + (Se.x * i + i) + "px," + (-Se.y * o + o) + "px)", x.parentNode !== l && l.appendChild(x), p.onAfterRender(t, m, f));
1132
+ if (f.isCSS2DObject) {
1133
+ Se.setFromMatrixPosition(f.matrixWorld), Se.applyMatrix4(mn);
1134
+ const g = Se.z >= -1 && Se.z <= 1 && f.layers.test(m.layers) === !0, y = f.element;
1135
+ y.style.display = g === !0 ? "" : "none", g === !0 && (f.onBeforeRender(t, p, m), y.style.transform = "translate(" + -100 * f.center.x + "%," + -100 * f.center.y + "%)translate(" + (Se.x * i + i) + "px," + (-Se.y * o + o) + "px)", y.parentNode !== l && l.appendChild(y), f.onAfterRender(t, p, m));
1136
1136
  const C = {
1137
- distanceToCameraSquared: u(f, p)
1137
+ distanceToCameraSquared: u(m, f)
1138
1138
  };
1139
- a.objects.set(p, C);
1139
+ a.objects.set(f, C);
1140
1140
  }
1141
- for (let g = 0, x = p.children.length; g < x; g++)
1142
- A(p.children[g], m, f);
1141
+ for (let g = 0, y = f.children.length; g < y; g++)
1142
+ d(f.children[g], p, m);
1143
1143
  }
1144
- function u(p, m) {
1145
- return gn.setFromMatrixPosition(p.matrixWorld), bn.setFromMatrixPosition(m.matrixWorld), gn.distanceToSquared(bn);
1144
+ function u(f, p) {
1145
+ return gn.setFromMatrixPosition(f.matrixWorld), bn.setFromMatrixPosition(p.matrixWorld), gn.distanceToSquared(bn);
1146
1146
  }
1147
- function h(p) {
1148
- const m = [];
1149
- return p.traverseVisible(function(f) {
1150
- f.isCSS2DObject && m.push(f);
1151
- }), m;
1147
+ function h(f) {
1148
+ const p = [];
1149
+ return f.traverseVisible(function(m) {
1150
+ m.isCSS2DObject && p.push(m);
1151
+ }), p;
1152
1152
  }
1153
- function d(p) {
1154
- const m = h(p).sort(function(g, x) {
1155
- if (g.renderOrder !== x.renderOrder)
1156
- return x.renderOrder - g.renderOrder;
1157
- const C = a.objects.get(g).distanceToCameraSquared, y = a.objects.get(x).distanceToCameraSquared;
1158
- return C - y;
1159
- }), f = m.length;
1160
- for (let g = 0, x = m.length; g < x; g++)
1161
- m[g].element.style.zIndex = f - g;
1153
+ function A(f) {
1154
+ const p = h(f).sort(function(g, y) {
1155
+ if (g.renderOrder !== y.renderOrder)
1156
+ return y.renderOrder - g.renderOrder;
1157
+ const C = a.objects.get(g).distanceToCameraSquared, x = a.objects.get(y).distanceToCameraSquared;
1158
+ return C - x;
1159
+ }), m = p.length;
1160
+ for (let g = 0, y = p.length; g < y; g++)
1161
+ p[g].element.style.zIndex = m - g;
1162
1162
  }
1163
1163
  }
1164
1164
  }
@@ -1261,7 +1261,7 @@ class Gn {
1261
1261
  const t = new P.Box3().setFromObject(e), s = new P.Vector3();
1262
1262
  t.getSize(s);
1263
1263
  const n = s.y / 2 + this.options.offsetY;
1264
- this.css2dObject || (this.css2dObject = new Ai(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(0, n, 0), e.add(this.css2dObject), this.attachedObject = e;
1264
+ this.css2dObject || (this.css2dObject = new di(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(0, n, 0), e.add(this.css2dObject), this.attachedObject = e;
1265
1265
  }
1266
1266
  /**
1267
1267
  * 从附着的物体上移除面板
@@ -1366,6 +1366,26 @@ class Gn {
1366
1366
  t.getSize(s), this.css2dObject.position.set(0, s.y / 2 + e, 0);
1367
1367
  }
1368
1368
  }
1369
+ /** 获取面板宽度 */
1370
+ getWidth() {
1371
+ return this.options.width || "200px";
1372
+ }
1373
+ /** 获取面板字体大小 */
1374
+ getFontSize() {
1375
+ return this.options.fontSize || "13px";
1376
+ }
1377
+ /** 设置面板宽度(轻量,不重建 DOM) */
1378
+ setWidth(e) {
1379
+ this.options.width = e, this.container && (this.container.style.width = e);
1380
+ }
1381
+ /** 设置面板字体大小(轻量,不重建 DOM) */
1382
+ setFontSize(e) {
1383
+ if (this.options.fontSize = e, this.container) {
1384
+ this.container.style.fontSize = e;
1385
+ const t = this.container.querySelector("[data-panel-title]");
1386
+ t && (t.style.fontSize = `calc(${e} + 2px)`);
1387
+ }
1388
+ }
1369
1389
  /** 获取面板 DOM 元素(用于外部样式自定义) */
1370
1390
  getElement() {
1371
1391
  return this.container;
@@ -1390,9 +1410,9 @@ function hi(r) {
1390
1410
  }
1391
1411
  let W = null;
1392
1412
  function fi(r) {
1393
- return W ? (W.domElement.parentNode !== r && r.appendChild(W.domElement), W) : (W = new di(), W.setSize(r.clientWidth, r.clientHeight), W.domElement.style.position = "absolute", W.domElement.style.top = "0", W.domElement.style.left = "0", W.domElement.style.pointerEvents = "none", r.appendChild(W.domElement), W);
1413
+ return W ? (W.domElement.parentNode !== r && r.appendChild(W.domElement), W) : (W = new Ai(), W.setSize(r.clientWidth, r.clientHeight), W.domElement.style.position = "absolute", W.domElement.style.top = "0", W.domElement.style.left = "0", W.domElement.style.pointerEvents = "none", r.appendChild(W.domElement), W);
1394
1414
  }
1395
- function Ta() {
1415
+ function La() {
1396
1416
  return W;
1397
1417
  }
1398
1418
  function pi(r, e) {
@@ -1430,7 +1450,7 @@ const I = {
1430
1450
  };
1431
1451
  let gt = !1, Oe = !1, Xt = [];
1432
1452
  const bi = 16755200;
1433
- let Te = null, Bt = null, bt = null, ge = [];
1453
+ let Te = null, Bt = null, bt = null, be = [];
1434
1454
  const st = /* @__PURE__ */ new Map();
1435
1455
  let Ct, It = null, $e = null, et = null;
1436
1456
  function Ii(r, e = "edit", t) {
@@ -1631,7 +1651,7 @@ function Si(r) {
1631
1651
  return r;
1632
1652
  }
1633
1653
  function Hi(r, e = 500) {
1634
- var d;
1654
+ var A;
1635
1655
  if (!I.camera || !I.orbitControls) {
1636
1656
  console.warn(
1637
1657
  "[focusOnObject] 编辑器尚未初始化或已销毁,无法执行聚焦操作。请确保已调用 initEditor()"
@@ -1639,8 +1659,8 @@ function Hi(r, e = 500) {
1639
1659
  return;
1640
1660
  }
1641
1661
  let t = null;
1642
- if ((d = I.scene) == null || d.traverse((p) => {
1643
- p.userData.id == r && (t = p);
1662
+ if ((A = I.scene) == null || A.traverse((f) => {
1663
+ f.userData.id == r && (t = f);
1644
1664
  }), !t) {
1645
1665
  console.warn(
1646
1666
  `[focusOnObject] 在场景中未找到 userData.id 为 "${r}" 的物体。请确认:1) 物体已被正确添加到场景(addModel);2) 物体的 userData.id 与传入的 objectId 一致;3) 传入的 objectId 不为空`
@@ -1653,7 +1673,7 @@ function Hi(r, e = 500) {
1653
1673
  t.getWorldPosition(n);
1654
1674
  const o = new P.Box3().setFromObject(t).getSize(new P.Vector3()), a = Math.max(o.x, o.y, o.z) * 0.5, l = Math.max(a * 3.5, 5), c = new P.Vector3().copy(I.camera.position).sub(n).normalize();
1655
1675
  c.lengthSq() < 1e-3 && c.set(0, 0, 1);
1656
- const A = n.clone().add(c.multiplyScalar(l)), u = I.camera.position.clone(), h = I.orbitControls.target.clone();
1676
+ const d = n.clone().add(c.multiplyScalar(l)), u = I.camera.position.clone(), h = I.orbitControls.target.clone();
1657
1677
  try {
1658
1678
  new nt.Tween({
1659
1679
  x: u.x,
@@ -1664,21 +1684,21 @@ function Hi(r, e = 500) {
1664
1684
  tz: h.z
1665
1685
  }).to(
1666
1686
  {
1667
- x: s ? s.x : A.x,
1668
- y: s ? s.y : A.y,
1669
- z: s ? s.z : A.z,
1687
+ x: s ? s.x : d.x,
1688
+ y: s ? s.y : d.y,
1689
+ z: s ? s.z : d.z,
1670
1690
  tx: n.x,
1671
1691
  ty: n.y,
1672
1692
  tz: n.z
1673
1693
  },
1674
1694
  e
1675
- ).easing(nt.Easing.Quadratic.InOut).onUpdate((p) => {
1676
- I.camera.position.set(p.x, p.y, p.z), I.orbitControls.target.set(p.tx, p.ty, p.tz), I.orbitControls.update();
1695
+ ).easing(nt.Easing.Quadratic.InOut).onUpdate((f) => {
1696
+ I.camera.position.set(f.x, f.y, f.z), I.orbitControls.target.set(f.tx, f.ty, f.tz), I.orbitControls.update();
1677
1697
  }).start();
1678
- } catch (p) {
1698
+ } catch (f) {
1679
1699
  console.error(
1680
1700
  "[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
1681
- p
1701
+ f
1682
1702
  );
1683
1703
  }
1684
1704
  }
@@ -1707,20 +1727,20 @@ function Wi(r) {
1707
1727
  e && ki(e);
1708
1728
  }
1709
1729
  function zi(r) {
1710
- r.userData.isMovable && r.parent === I.scene && (ge.includes(r) || ge.push(r));
1730
+ r.userData.isMovable && r.parent === I.scene && (be.includes(r) || be.push(r));
1711
1731
  }
1712
1732
  function Gi(r) {
1713
- const e = ge.indexOf(r);
1714
- e !== -1 && ge.splice(e, 1);
1733
+ const e = be.indexOf(r);
1734
+ e !== -1 && be.splice(e, 1);
1715
1735
  }
1716
1736
  function Fi() {
1717
1737
  const r = [];
1718
1738
  I.scene.children.forEach((e) => {
1719
1739
  e.userData.isMovable && r.push(e);
1720
- }), ge = r, vt();
1740
+ }), be = r, vt();
1721
1741
  }
1722
1742
  function vt() {
1723
- bt == null || bt([...ge]);
1743
+ bt == null || bt([...be]);
1724
1744
  }
1725
1745
  function qi(r) {
1726
1746
  Te = r;
@@ -1732,12 +1752,12 @@ function Bi(r) {
1732
1752
  bt = r;
1733
1753
  }
1734
1754
  function Ui() {
1735
- return ge;
1755
+ return be;
1736
1756
  }
1737
1757
  function Vi() {
1738
1758
  return I.selectedObject;
1739
1759
  }
1740
- function Oa(r, e, t) {
1760
+ function Na(r, e, t) {
1741
1761
  if (!I.scene) return;
1742
1762
  const s = st.get(r);
1743
1763
  if (s) {
@@ -1745,48 +1765,53 @@ function Oa(r, e, t) {
1745
1765
  n && n.updateItemByCode(e, t);
1746
1766
  }
1747
1767
  }
1748
- function Ea() {
1768
+ function ja() {
1749
1769
  return I.scene;
1750
1770
  }
1751
1771
  function Yi() {
1752
1772
  return I.camera;
1753
1773
  }
1754
- function Ra() {
1774
+ function ka() {
1755
1775
  return I.renderer;
1756
1776
  }
1757
1777
  async function Ki() {
1758
- var c, A, u;
1778
+ var c, d, u;
1759
1779
  J == null || J(!0), await new Promise((h) => setTimeout(h, 50)), Jt();
1760
1780
  const r = I.scene;
1761
1781
  if (!r)
1762
1782
  return J == null || J(!1), "{}";
1763
1783
  const e = [], t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1764
1784
  r.traverse((h) => {
1765
- var d;
1785
+ var A;
1766
1786
  if (h.userData.type === "lightHelper" && e.push(h), h.type === "DirectionalLight" && h.userData.helper && (t.set(h, h.userData.helper), h.userData.helper = void 0), h.name && h.name.startsWith("DataPanel_")) {
1767
- const p = h;
1768
- if (p.element) {
1769
- const m = p.element.querySelector(
1787
+ const f = h;
1788
+ if (f.element) {
1789
+ const p = f.element.querySelector(
1770
1790
  "[data-panel-title]"
1771
- ), f = [];
1772
- p.element.querySelectorAll(
1791
+ ), m = [];
1792
+ if (f.element.querySelectorAll(
1773
1793
  ".css2d-data-panel-item"
1774
- ).forEach((x) => {
1794
+ ).forEach((y) => {
1775
1795
  var w, D, S;
1776
- const C = x.querySelector(".item-label"), y = x.querySelector(".item-value");
1777
- if (C && y) {
1778
- const Z = (C.textContent || "").trim(), _ = ((D = (w = y.childNodes[0]) == null ? void 0 : w.textContent) == null ? void 0 : D.trim()) || "", Q = y.querySelector(
1796
+ const C = y.querySelector(".item-label"), x = y.querySelector(".item-value");
1797
+ if (C && x) {
1798
+ const Z = (C.textContent || "").trim(), $ = ((D = (w = x.childNodes[0]) == null ? void 0 : w.textContent) == null ? void 0 : D.trim()) || "", Q = x.querySelector(
1779
1799
  "span"
1780
- ), ye = Q ? (Q.textContent || "").trim() : void 0, Mt = ((S = x.getAttribute("data-item-code")) == null ? void 0 : S.trim()) || void 0;
1781
- f.push({ label: Z, value: _, unit: ye, code: Mt });
1800
+ ), Ce = Q ? (Q.textContent || "").trim() : void 0, Mt = ((S = y.getAttribute("data-item-code")) == null ? void 0 : S.trim()) || void 0;
1801
+ m.push({ label: Z, value: $, unit: Ce, code: Mt });
1782
1802
  }
1783
- }), h.parent && s.set(
1784
- h.parent.userData.id ? h.parent.userData.id : h.parent.uuid,
1785
- {
1786
- title: ((d = m == null ? void 0 : m.textContent) == null ? void 0 : d.trim()) || "",
1787
- items: f
1788
- }
1789
- );
1803
+ }), h.parent) {
1804
+ const y = f.element.style.width || "", C = f.element.style.fontSize || "";
1805
+ s.set(
1806
+ h.parent.userData.id ? h.parent.userData.id : h.parent.uuid,
1807
+ {
1808
+ title: ((A = p == null ? void 0 : p.textContent) == null ? void 0 : A.trim()) || "",
1809
+ items: m,
1810
+ width: y,
1811
+ fontSize: C
1812
+ }
1813
+ );
1814
+ }
1790
1815
  }
1791
1816
  }
1792
1817
  }), e.forEach((h) => r.remove(h));
@@ -1797,16 +1822,16 @@ async function Ki() {
1797
1822
  h.name && h.name.startsWith("DataPanel_") && h.parent && h.parent.remove(h);
1798
1823
  });
1799
1824
  const i = n.toJSON();
1800
- e.forEach((h) => r.add(h)), t.forEach((h, d) => {
1801
- d.userData.helper = h;
1825
+ e.forEach((h) => r.add(h)), t.forEach((h, A) => {
1826
+ A.userData.helper = h;
1802
1827
  });
1803
1828
  const o = {
1804
1829
  position: (c = I.camera) == null ? void 0 : c.position.toArray(),
1805
- rotation: (A = I.camera) == null ? void 0 : A.rotation.toArray(),
1830
+ rotation: (d = I.camera) == null ? void 0 : d.rotation.toArray(),
1806
1831
  target: ((u = I.orbitControls) == null ? void 0 : u.target.toArray()) || [0, 0, 0]
1807
1832
  }, a = {};
1808
- s.forEach((h, d) => {
1809
- a[d] = h;
1833
+ s.forEach((h, A) => {
1834
+ a[A] = h;
1810
1835
  });
1811
1836
  const l = JSON.stringify({
1812
1837
  scene: i,
@@ -1820,22 +1845,22 @@ function Zi(r, e = "edit", t) {
1820
1845
  var o, a, l;
1821
1846
  const s = typeof r == "string" ? JSON.parse(r) : r, i = new P.ObjectLoader().parse(s);
1822
1847
  i.type === "Scene" ? I.scene = i : (o = I.scene) == null || o.add(i), t && ((a = I.scene) == null || a.traverse((c) => {
1823
- const A = c.userData.id || c.uuid, u = t[A];
1848
+ const d = c.userData.id || c.uuid, u = t[d];
1824
1849
  if (u && c.userData.isMovable) {
1825
1850
  Li(c);
1826
1851
  const h = new Gn({
1827
1852
  title: u.title,
1828
1853
  items: u.items
1829
1854
  });
1830
- h.attachTo(c), h.visible = !1, console.log("panel", h), Fn(c, h);
1855
+ h.attachTo(c), h.visible = !1, u.width && h.setWidth(u.width), u.fontSize && h.setFontSize(u.fontSize), Fn(c, h);
1831
1856
  }
1832
1857
  })), e === "edit" && ((l = I.scene) == null || l.traverse((c) => {
1833
- var A;
1858
+ var d;
1834
1859
  if (c.type === "DirectionalLight") {
1835
1860
  const u = c;
1836
1861
  if (!u.userData.helper) {
1837
1862
  const h = new P.DirectionalLightHelper(u, 1);
1838
- h.userData.type = "lightHelper", u.userData.helper = h, (A = I.scene) == null || A.add(h);
1863
+ h.userData.type = "lightHelper", u.userData.helper = h, (d = I.scene) == null || d.add(h);
1839
1864
  }
1840
1865
  }
1841
1866
  }));
@@ -1853,9 +1878,9 @@ function Vn(r) {
1853
1878
  Vn(t);
1854
1879
  }
1855
1880
  function Qi() {
1856
- It !== null && (cancelAnimationFrame(It), It = null), $e && I.container && (I.container.removeEventListener("click", $e), $e = null), et && (window.removeEventListener("resize", et), et = null), I.orbitControls && (I.orbitControls.dispose(), I.orbitControls = null), I.transformControls && (I.transformControls.dispose(), I.transformControls = null), I.scene && (Vn(I.scene), I.scene = null), I.renderer && (I.renderer.dispose(), I.renderer.domElement && I.container && I.container.removeChild(I.renderer.domElement), I.renderer = null), gi(), I.camera = null, I.gridHelper = null, I.selectedObject = null, I.container = null, I.mode = "", ge = [], st.clear(), vt(), gt = !1, Oe = !1;
1881
+ It !== null && (cancelAnimationFrame(It), It = null), $e && I.container && (I.container.removeEventListener("click", $e), $e = null), et && (window.removeEventListener("resize", et), et = null), I.orbitControls && (I.orbitControls.dispose(), I.orbitControls = null), I.transformControls && (I.transformControls.dispose(), I.transformControls = null), I.scene && (Vn(I.scene), I.scene = null), I.renderer && (I.renderer.dispose(), I.renderer.domElement && I.container && I.container.removeChild(I.renderer.domElement), I.renderer = null), gi(), I.camera = null, I.gridHelper = null, I.selectedObject = null, I.container = null, I.mode = "", be = [], st.clear(), vt(), gt = !1, Oe = !1;
1857
1882
  }
1858
- const Ji = /^[og]\s*(.+)?/, _i = /^mtllib /, $i = /^usemtl /, eo = /^usemap /, In = /\s+/, yn = new M(), Rt = new M(), Cn = new M(), xn = new M(), ee = new M(), ht = new de();
1883
+ const Ji = /^[og]\s*(.+)?/, _i = /^mtllib /, $i = /^usemtl /, eo = /^usemap /, In = /\s+/, yn = new M(), Rt = new M(), Cn = new M(), xn = new M(), te = new M(), ht = new he();
1859
1884
  function to() {
1860
1885
  const r = {
1861
1886
  objects: [],
@@ -1965,7 +1990,7 @@ function to() {
1965
1990
  },
1966
1991
  addFaceNormal: function(e, t, s) {
1967
1992
  const n = this.vertices, i = this.object.geometry.normals;
1968
- yn.fromArray(n, e), Rt.fromArray(n, t), Cn.fromArray(n, s), ee.subVectors(Cn, Rt), xn.subVectors(yn, Rt), ee.cross(xn), ee.normalize(), i.push(ee.x, ee.y, ee.z), i.push(ee.x, ee.y, ee.z), i.push(ee.x, ee.y, ee.z);
1993
+ yn.fromArray(n, e), Rt.fromArray(n, t), Cn.fromArray(n, s), te.subVectors(Cn, Rt), xn.subVectors(yn, Rt), te.cross(xn), te.normalize(), i.push(te.x, te.y, te.z), i.push(te.x, te.y, te.z), i.push(te.x, te.y, te.z);
1969
1994
  },
1970
1995
  addColor: function(e, t, s) {
1971
1996
  const n = this.colors, i = this.object.geometry.colors;
@@ -1984,16 +2009,16 @@ function to() {
1984
2009
  this.object.geometry.uvs.push(t[e + 0], t[e + 1]);
1985
2010
  },
1986
2011
  addFace: function(e, t, s, n, i, o, a, l, c) {
1987
- const A = this.vertices.length;
1988
- let u = this.parseVertexIndex(e, A), h = this.parseVertexIndex(t, A), d = this.parseVertexIndex(s, A);
1989
- if (this.addVertex(u, h, d), this.addColor(u, h, d), a !== void 0 && a !== "") {
1990
- const p = this.normals.length;
1991
- u = this.parseNormalIndex(a, p), h = this.parseNormalIndex(l, p), d = this.parseNormalIndex(c, p), this.addNormal(u, h, d);
2012
+ const d = this.vertices.length;
2013
+ let u = this.parseVertexIndex(e, d), h = this.parseVertexIndex(t, d), A = this.parseVertexIndex(s, d);
2014
+ if (this.addVertex(u, h, A), this.addColor(u, h, A), a !== void 0 && a !== "") {
2015
+ const f = this.normals.length;
2016
+ u = this.parseNormalIndex(a, f), h = this.parseNormalIndex(l, f), A = this.parseNormalIndex(c, f), this.addNormal(u, h, A);
1992
2017
  } else
1993
- this.addFaceNormal(u, h, d);
2018
+ this.addFaceNormal(u, h, A);
1994
2019
  if (n !== void 0 && n !== "") {
1995
- const p = this.uvs.length;
1996
- u = this.parseUVIndex(n, p), h = this.parseUVIndex(i, p), d = this.parseUVIndex(o, p), this.addUV(u, h, d), this.object.geometry.hasUVIndices = !0;
2020
+ const f = this.uvs.length;
2021
+ u = this.parseUVIndex(n, f), h = this.parseUVIndex(i, f), A = this.parseUVIndex(o, f), this.addUV(u, h, A), this.object.geometry.hasUVIndices = !0;
1997
2022
  } else
1998
2023
  this.addDefaultUV();
1999
2024
  },
@@ -2071,9 +2096,9 @@ class no extends Yt {
2071
2096
  for (let a = 0, l = s.length; a < l; a++) {
2072
2097
  const c = s[a].trimStart();
2073
2098
  if (c.length === 0) continue;
2074
- const A = c.charAt(0);
2075
- if (A !== "#")
2076
- if (A === "v") {
2099
+ const d = c.charAt(0);
2100
+ if (d !== "#")
2101
+ if (d === "v") {
2077
2102
  const u = c.split(In);
2078
2103
  switch (u[0]) {
2079
2104
  case "v":
@@ -2102,43 +2127,43 @@ class no extends Yt {
2102
2127
  );
2103
2128
  break;
2104
2129
  }
2105
- } else if (A === "f") {
2106
- const h = c.slice(1).trim().split(In), d = [];
2107
- for (let m = 0, f = h.length; m < f; m++) {
2108
- const g = h[m];
2130
+ } else if (d === "f") {
2131
+ const h = c.slice(1).trim().split(In), A = [];
2132
+ for (let p = 0, m = h.length; p < m; p++) {
2133
+ const g = h[p];
2109
2134
  if (g.length > 0) {
2110
- const x = g.split("/");
2111
- d.push(x);
2135
+ const y = g.split("/");
2136
+ A.push(y);
2112
2137
  }
2113
2138
  }
2114
- const p = d[0];
2115
- for (let m = 1, f = d.length - 1; m < f; m++) {
2116
- const g = d[m], x = d[m + 1];
2139
+ const f = A[0];
2140
+ for (let p = 1, m = A.length - 1; p < m; p++) {
2141
+ const g = A[p], y = A[p + 1];
2117
2142
  t.addFace(
2118
- p[0],
2143
+ f[0],
2119
2144
  g[0],
2120
- x[0],
2121
- p[1],
2145
+ y[0],
2146
+ f[1],
2122
2147
  g[1],
2123
- x[1],
2124
- p[2],
2148
+ y[1],
2149
+ f[2],
2125
2150
  g[2],
2126
- x[2]
2151
+ y[2]
2127
2152
  );
2128
2153
  }
2129
- } else if (A === "l") {
2154
+ } else if (d === "l") {
2130
2155
  const u = c.substring(1).trim().split(" ");
2131
2156
  let h = [];
2132
- const d = [];
2157
+ const A = [];
2133
2158
  if (c.indexOf("/") === -1)
2134
2159
  h = u;
2135
2160
  else
2136
- for (let p = 0, m = u.length; p < m; p++) {
2137
- const f = u[p].split("/");
2138
- f[0] !== "" && h.push(f[0]), f[1] !== "" && d.push(f[1]);
2161
+ for (let f = 0, p = u.length; f < p; f++) {
2162
+ const m = u[f].split("/");
2163
+ m[0] !== "" && h.push(m[0]), m[1] !== "" && A.push(m[1]);
2139
2164
  }
2140
- t.addLineGeometry(h, d);
2141
- } else if (A === "p") {
2165
+ t.addLineGeometry(h, A);
2166
+ } else if (d === "p") {
2142
2167
  const h = c.slice(1).trim().split(" ");
2143
2168
  t.addPointGeometry(h);
2144
2169
  } else if ((n = Ji.exec(c)) !== null) {
@@ -2150,7 +2175,7 @@ class no extends Yt {
2150
2175
  t.materialLibraries.push(c.substring(7).trim());
2151
2176
  else if (eo.test(c))
2152
2177
  console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
2153
- else if (A === "s") {
2178
+ else if (d === "s") {
2154
2179
  if (n = c.split(" "), n.length > 1) {
2155
2180
  const h = n[1].trim().toLowerCase();
2156
2181
  t.object.smooth = h !== "0" && h !== "off";
@@ -2167,40 +2192,40 @@ class no extends Yt {
2167
2192
  const i = new ft();
2168
2193
  if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
2169
2194
  for (let a = 0, l = t.objects.length; a < l; a++) {
2170
- const c = t.objects[a], A = c.geometry, u = c.materials, h = A.type === "Line", d = A.type === "Points";
2171
- let p = !1;
2172
- if (A.vertices.length === 0) continue;
2173
- const m = new We();
2174
- m.setAttribute("position", new pe(A.vertices, 3)), A.normals.length > 0 && m.setAttribute("normal", new pe(A.normals, 3)), A.colors.length > 0 && (p = !0, m.setAttribute("color", new pe(A.colors, 3))), A.hasUVIndices === !0 && m.setAttribute("uv", new pe(A.uvs, 2));
2175
- const f = [];
2176
- for (let x = 0, C = u.length; x < C; x++) {
2177
- const y = u[x], w = y.name + "_" + y.smooth + "_" + p;
2195
+ const c = t.objects[a], d = c.geometry, u = c.materials, h = d.type === "Line", A = d.type === "Points";
2196
+ let f = !1;
2197
+ if (d.vertices.length === 0) continue;
2198
+ const p = new We();
2199
+ p.setAttribute("position", new me(d.vertices, 3)), d.normals.length > 0 && p.setAttribute("normal", new me(d.normals, 3)), d.colors.length > 0 && (f = !0, p.setAttribute("color", new me(d.colors, 3))), d.hasUVIndices === !0 && p.setAttribute("uv", new me(d.uvs, 2));
2200
+ const m = [];
2201
+ for (let y = 0, C = u.length; y < C; y++) {
2202
+ const x = u[y], w = x.name + "_" + x.smooth + "_" + f;
2178
2203
  let D = t.materials[w];
2179
2204
  if (this.materials !== null) {
2180
- if (D = this.materials.create(y.name), h && D && !(D instanceof Ze)) {
2205
+ if (D = this.materials.create(x.name), h && D && !(D instanceof Ze)) {
2181
2206
  const S = new Ze();
2182
2207
  Qe.prototype.copy.call(S, D), S.color.copy(D.color), D = S;
2183
- } else if (d && D && !(D instanceof Ue)) {
2208
+ } else if (A && D && !(D instanceof Ue)) {
2184
2209
  const S = new Ue({ size: 10, sizeAttenuation: !1 });
2185
2210
  Qe.prototype.copy.call(S, D), S.color.copy(D.color), S.map = D.map, D = S;
2186
2211
  }
2187
2212
  }
2188
- D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors = p, t.materials[w] = D), f.push(D);
2213
+ D === void 0 && (h ? D = new Ze() : A ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = x.name, D.flatShading = !x.smooth, D.vertexColors = f, t.materials[w] = D), m.push(D);
2189
2214
  }
2190
2215
  let g;
2191
- if (f.length > 1) {
2192
- for (let x = 0, C = u.length; x < C; x++) {
2193
- const y = u[x];
2194
- m.addGroup(y.groupStart, y.groupCount, x);
2216
+ if (m.length > 1) {
2217
+ for (let y = 0, C = u.length; y < C; y++) {
2218
+ const x = u[y];
2219
+ p.addGroup(x.groupStart, x.groupCount, y);
2195
2220
  }
2196
- h ? g = new Wt(m, f) : d ? g = new pt(m, f) : g = new v(m, f);
2221
+ h ? g = new Wt(p, m) : A ? g = new pt(p, m) : g = new v(p, m);
2197
2222
  } else
2198
- h ? g = new Wt(m, f[0]) : d ? g = new pt(m, f[0]) : g = new v(m, f[0]);
2223
+ h ? g = new Wt(p, m[0]) : A ? g = new pt(p, m[0]) : g = new v(p, m[0]);
2199
2224
  g.name = c.name, i.add(g);
2200
2225
  }
2201
2226
  else if (t.vertices.length > 0) {
2202
2227
  const a = new Ue({ size: 1, sizeAttenuation: !1 }), l = new We();
2203
- l.setAttribute("position", new pe(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new pe(t.colors, 3)), a.vertexColors = !0);
2228
+ l.setAttribute("position", new me(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new me(t.colors, 3)), a.vertexColors = !0);
2204
2229
  const c = new pt(l, a);
2205
2230
  i.add(c);
2206
2231
  }
@@ -2321,11 +2346,11 @@ class io extends Yt {
2321
2346
  }, l = new tt(this.manager);
2322
2347
  l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(c) {
2323
2348
  try {
2324
- i.parse(c, o, function(A) {
2325
- t(A), i.manager.itemEnd(e);
2349
+ i.parse(c, o, function(d) {
2350
+ t(d), i.manager.itemEnd(e);
2326
2351
  }, a);
2327
- } catch (A) {
2328
- a(A);
2352
+ } catch (d) {
2353
+ a(d);
2329
2354
  }
2330
2355
  }, s, a);
2331
2356
  }
@@ -2418,13 +2443,13 @@ class io extends Yt {
2418
2443
  meshoptDecoder: this.meshoptDecoder
2419
2444
  });
2420
2445
  c.fileLoader.setRequestHeader(this.requestHeader);
2421
- for (let A = 0; A < this.pluginCallbacks.length; A++) {
2422
- const u = this.pluginCallbacks[A](c);
2446
+ for (let d = 0; d < this.pluginCallbacks.length; d++) {
2447
+ const u = this.pluginCallbacks[d](c);
2423
2448
  u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[u.name] = u, o[u.name] = !0;
2424
2449
  }
2425
2450
  if (i.extensionsUsed)
2426
- for (let A = 0; A < i.extensionsUsed.length; ++A) {
2427
- const u = i.extensionsUsed[A], h = i.extensionsRequired || [];
2451
+ for (let d = 0; d < i.extensionsUsed.length; ++d) {
2452
+ const u = i.extensionsUsed[d], h = i.extensionsRequired || [];
2428
2453
  switch (u) {
2429
2454
  case O.KHR_MATERIALS_UNLIT:
2430
2455
  o[u] = new ao();
@@ -2522,18 +2547,18 @@ class ro {
2522
2547
  if (n) return n;
2523
2548
  const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
2524
2549
  let c;
2525
- const A = new de(16777215);
2526
- l.color !== void 0 && A.setRGB(l.color[0], l.color[1], l.color[2], ae);
2550
+ const d = new he(16777215);
2551
+ l.color !== void 0 && d.setRGB(l.color[0], l.color[1], l.color[2], ae);
2527
2552
  const u = l.range !== void 0 ? l.range : 0;
2528
2553
  switch (l.type) {
2529
2554
  case "directional":
2530
- c = new Is(A), c.target.position.set(0, 0, -1), c.add(c.target);
2555
+ c = new Is(d), c.target.position.set(0, 0, -1), c.add(c.target);
2531
2556
  break;
2532
2557
  case "point":
2533
- c = new bs(A), c.distance = u;
2558
+ c = new bs(d), c.distance = u;
2534
2559
  break;
2535
2560
  case "spot":
2536
- c = new gs(A), c.distance = u, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, c.angle = l.spot.outerConeAngle, c.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
2561
+ c = new gs(d), c.distance = u, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, c.angle = l.spot.outerConeAngle, c.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
2537
2562
  break;
2538
2563
  default:
2539
2564
  throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
@@ -2560,7 +2585,7 @@ class ao {
2560
2585
  }
2561
2586
  extendParams(e, t, s) {
2562
2587
  const n = [];
2563
- e.color = new de(1, 1, 1), e.opacity = 1;
2588
+ e.color = new he(1, 1, 1), e.opacity = 1;
2564
2589
  const i = t.pbrMetallicRoughness;
2565
2590
  if (i) {
2566
2591
  if (Array.isArray(i.baseColorFactor)) {
@@ -2636,7 +2661,7 @@ class ho {
2636
2661
  const s = z(this.parser, e, this.name);
2637
2662
  if (s === null) return Promise.resolve();
2638
2663
  const n = [];
2639
- if (t.sheenColor = new de(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
2664
+ if (t.sheenColor = new he(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
2640
2665
  const i = s.sheenColorFactor;
2641
2666
  t.sheenColor.setRGB(i[0], i[1], i[2], ae);
2642
2667
  }
@@ -2670,7 +2695,7 @@ class po {
2670
2695
  const n = [];
2671
2696
  t.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "thicknessMap", s.thicknessTexture)), t.attenuationDistance = s.attenuationDistance || 1 / 0;
2672
2697
  const i = s.attenuationColor || [1, 1, 1];
2673
- return t.attenuationColor = new de().setRGB(i[0], i[1], i[2], ae), Promise.all(n);
2698
+ return t.attenuationColor = new he().setRGB(i[0], i[1], i[2], ae), Promise.all(n);
2674
2699
  }
2675
2700
  }
2676
2701
  class mo {
@@ -2698,7 +2723,7 @@ class go {
2698
2723
  const n = [];
2699
2724
  t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
2700
2725
  const i = s.specularColorFactor || [1, 1, 1];
2701
- return t.specularColor = new de().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
2726
+ return t.specularColor = new he().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
2702
2727
  }
2703
2728
  }
2704
2729
  class bo {
@@ -2794,12 +2819,12 @@ class vn {
2794
2819
  return null;
2795
2820
  }
2796
2821
  return i.then(function(a) {
2797
- const l = n.byteOffset || 0, c = n.byteLength || 0, A = n.count, u = n.byteStride, h = new Uint8Array(a, l, c);
2798
- return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(A, u, h, n.mode, n.filter).then(function(d) {
2799
- return d.buffer;
2822
+ const l = n.byteOffset || 0, c = n.byteLength || 0, d = n.count, u = n.byteStride, h = new Uint8Array(a, l, c);
2823
+ return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, h, n.mode, n.filter).then(function(A) {
2824
+ return A.buffer;
2800
2825
  }) : o.ready.then(function() {
2801
- const d = new ArrayBuffer(A * u);
2802
- return o.decodeGltfBuffer(new Uint8Array(d), A, u, h, n.mode, n.filter), d;
2826
+ const A = new ArrayBuffer(d * u);
2827
+ return o.decodeGltfBuffer(new Uint8Array(A), d, u, h, n.mode, n.filter), A;
2803
2828
  });
2804
2829
  });
2805
2830
  } else
@@ -2816,25 +2841,25 @@ class wo {
2816
2841
  return null;
2817
2842
  const n = t.meshes[s.mesh];
2818
2843
  for (const c of n.primitives)
2819
- if (c.mode !== te.TRIANGLES && c.mode !== te.TRIANGLE_STRIP && c.mode !== te.TRIANGLE_FAN && c.mode !== void 0)
2844
+ if (c.mode !== ne.TRIANGLES && c.mode !== ne.TRIANGLE_STRIP && c.mode !== ne.TRIANGLE_FAN && c.mode !== void 0)
2820
2845
  return null;
2821
2846
  const o = s.extensions[this.name].attributes, a = [], l = {};
2822
2847
  for (const c in o)
2823
- a.push(this.parser.getDependency("accessor", o[c]).then((A) => (l[c] = A, l[c])));
2848
+ a.push(this.parser.getDependency("accessor", o[c]).then((d) => (l[c] = d, l[c])));
2824
2849
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
2825
- const A = c.pop(), u = A.isGroup ? A.children : [A], h = c[0].count, d = [];
2826
- for (const p of u) {
2827
- const m = new me(), f = new M(), g = new K(), x = new M(1, 1, 1), C = new ys(p.geometry, p.material, h);
2828
- for (let y = 0; y < h; y++)
2829
- l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y, m.compose(f, g, x));
2830
- for (const y in l)
2831
- if (y === "_COLOR_0") {
2832
- const w = l[y];
2850
+ const d = c.pop(), u = d.isGroup ? d.children : [d], h = c[0].count, A = [];
2851
+ for (const f of u) {
2852
+ const p = new ge(), m = new M(), g = new K(), y = new M(1, 1, 1), C = new ys(f.geometry, f.material, h);
2853
+ for (let x = 0; x < h; x++)
2854
+ l.TRANSLATION && m.fromBufferAttribute(l.TRANSLATION, x), l.ROTATION && g.fromBufferAttribute(l.ROTATION, x), l.SCALE && y.fromBufferAttribute(l.SCALE, x), C.setMatrixAt(x, p.compose(m, g, y));
2855
+ for (const x in l)
2856
+ if (x === "_COLOR_0") {
2857
+ const w = l[x];
2833
2858
  C.instanceColor = new Cs(w.array, w.itemSize, w.normalized);
2834
- } else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" && p.geometry.setAttribute(y, l[y]);
2835
- ke.prototype.copy.call(C, p), this.parser.assignFinalMaterial(C), d.push(C);
2859
+ } else x !== "TRANSLATION" && x !== "ROTATION" && x !== "SCALE" && f.geometry.setAttribute(x, l[x]);
2860
+ ke.prototype.copy.call(C, f), this.parser.assignFinalMaterial(C), A.push(C);
2836
2861
  }
2837
- return A.isGroup ? (A.clear(), A.add(...d), A) : d[0];
2862
+ return d.isGroup ? (d.clear(), d.add(...A), d) : A[0];
2838
2863
  }));
2839
2864
  }
2840
2865
  }
@@ -2878,25 +2903,25 @@ class Mo {
2878
2903
  }
2879
2904
  decodePrimitive(e, t) {
2880
2905
  const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, c = {};
2881
- for (const A in o) {
2882
- const u = Ut[A] || A.toLowerCase();
2883
- a[u] = o[A];
2906
+ for (const d in o) {
2907
+ const u = Ut[d] || d.toLowerCase();
2908
+ a[u] = o[d];
2884
2909
  }
2885
- for (const A in e.attributes) {
2886
- const u = Ut[A] || A.toLowerCase();
2887
- if (o[A] !== void 0) {
2888
- const h = s.accessors[e.attributes[A]], d = je[h.componentType];
2889
- c[u] = d.name, l[u] = h.normalized === !0;
2910
+ for (const d in e.attributes) {
2911
+ const u = Ut[d] || d.toLowerCase();
2912
+ if (o[d] !== void 0) {
2913
+ const h = s.accessors[e.attributes[d]], A = je[h.componentType];
2914
+ c[u] = A.name, l[u] = h.normalized === !0;
2890
2915
  }
2891
2916
  }
2892
- return t.getDependency("bufferView", i).then(function(A) {
2917
+ return t.getDependency("bufferView", i).then(function(d) {
2893
2918
  return new Promise(function(u, h) {
2894
- n.decodeDracoFile(A, function(d) {
2895
- for (const p in d.attributes) {
2896
- const m = d.attributes[p], f = l[p];
2897
- f !== void 0 && (m.normalized = f);
2919
+ n.decodeDracoFile(d, function(A) {
2920
+ for (const f in A.attributes) {
2921
+ const p = A.attributes[f], m = l[f];
2922
+ m !== void 0 && (p.normalized = m);
2898
2923
  }
2899
- u(d);
2924
+ u(A);
2900
2925
  }, a, c, ae, h);
2901
2926
  });
2902
2927
  });
@@ -2926,10 +2951,10 @@ class Zn extends zs {
2926
2951
  return t;
2927
2952
  }
2928
2953
  interpolate_(e, t, s, n) {
2929
- const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u, p = e * c, m = p - c, f = -2 * d + 3 * h, g = d - h, x = 1 - f, C = g - h + u;
2930
- for (let y = 0; y !== a; y++) {
2931
- const w = o[m + y + a], D = o[m + y + l] * A, S = o[p + y + a], Z = o[p + y] * A;
2932
- i[y] = x * w + C * D + f * S + g * Z;
2954
+ const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = n - t, u = (s - t) / d, h = u * u, A = h * u, f = e * c, p = f - c, m = -2 * A + 3 * h, g = A - h, y = 1 - m, C = g - h + u;
2955
+ for (let x = 0; x !== a; x++) {
2956
+ const w = o[p + x + a], D = o[p + x + l] * d, S = o[f + x + a], Z = o[f + x] * d;
2957
+ i[x] = y * w + C * D + m * S + g * Z;
2933
2958
  }
2934
2959
  return i;
2935
2960
  }
@@ -2941,7 +2966,7 @@ class Oo extends Zn {
2941
2966
  return To.fromArray(i).normalize().toArray(i), i;
2942
2967
  }
2943
2968
  }
2944
- const te = {
2969
+ const ne = {
2945
2970
  POINTS: 0,
2946
2971
  LINES: 1,
2947
2972
  LINE_LOOP: 2,
@@ -2986,7 +3011,7 @@ const te = {
2986
3011
  COLOR_0: "color",
2987
3012
  WEIGHTS_0: "skinWeight",
2988
3013
  JOINTS_0: "skinIndex"
2989
- }, fe = {
3014
+ }, pe = {
2990
3015
  scale: "scale",
2991
3016
  translation: "position",
2992
3017
  rotation: "quaternion",
@@ -3013,7 +3038,7 @@ function Ro(r) {
3013
3038
  side: Ws
3014
3039
  })), r.DefaultMaterial;
3015
3040
  }
3016
- function xe(r, e, t) {
3041
+ function we(r, e, t) {
3017
3042
  for (const s in t.extensions)
3018
3043
  r[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
3019
3044
  }
@@ -3022,13 +3047,13 @@ function re(r, e) {
3022
3047
  }
3023
3048
  function So(r, e, t) {
3024
3049
  let s = !1, n = !1, i = !1;
3025
- for (let c = 0, A = e.length; c < A; c++) {
3050
+ for (let c = 0, d = e.length; c < d; c++) {
3026
3051
  const u = e[c];
3027
3052
  if (u.POSITION !== void 0 && (s = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (i = !0), s && n && i) break;
3028
3053
  }
3029
3054
  if (!s && !n && !i) return Promise.resolve(r);
3030
3055
  const o = [], a = [], l = [];
3031
- for (let c = 0, A = e.length; c < A; c++) {
3056
+ for (let c = 0, d = e.length; c < d; c++) {
3032
3057
  const u = e[c];
3033
3058
  if (s) {
3034
3059
  const h = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : r.attributes.position;
@@ -3048,8 +3073,8 @@ function So(r, e, t) {
3048
3073
  Promise.all(a),
3049
3074
  Promise.all(l)
3050
3075
  ]).then(function(c) {
3051
- const A = c[0], u = c[1], h = c[2];
3052
- return s && (r.morphAttributes.position = A), n && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
3076
+ const d = c[0], u = c[1], h = c[2];
3077
+ return s && (r.morphAttributes.position = d), n && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
3053
3078
  });
3054
3079
  }
3055
3080
  function Ho(r, e) {
@@ -3098,7 +3123,7 @@ function Vt(r) {
3098
3123
  function No(r) {
3099
3124
  return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
3100
3125
  }
3101
- const jo = new me();
3126
+ const jo = new ge();
3102
3127
  class ko {
3103
3128
  constructor(e = {}, t = {}) {
3104
3129
  this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new oo(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
@@ -3139,7 +3164,7 @@ class ko {
3139
3164
  parser: s,
3140
3165
  userData: {}
3141
3166
  };
3142
- return xe(i, a, n), re(a, n), Promise.all(s._invokeAll(function(l) {
3167
+ return we(i, a, n), re(a, n), Promise.all(s._invokeAll(function(l) {
3143
3168
  return l.afterRoot && l.afterRoot(a);
3144
3169
  })).then(function() {
3145
3170
  for (const l of a.scenes)
@@ -3195,8 +3220,8 @@ class ko {
3195
3220
  const n = s.clone(), i = (o, a) => {
3196
3221
  const l = this.associations.get(o);
3197
3222
  l != null && this.associations.set(a, l);
3198
- for (const [c, A] of o.children.entries())
3199
- i(A, a.children[c]);
3223
+ for (const [c, d] of o.children.entries())
3224
+ i(d, a.children[c]);
3200
3225
  };
3201
3226
  return i(s, n), n.name += "_instance_" + e.uses[t]++, n;
3202
3227
  }
@@ -3354,24 +3379,24 @@ class ko {
3354
3379
  }
3355
3380
  const i = [];
3356
3381
  return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(o) {
3357
- const a = o[0], l = St[n.type], c = je[n.componentType], A = c.BYTES_PER_ELEMENT, u = A * l, h = n.byteOffset || 0, d = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, p = n.normalized === !0;
3358
- let m, f;
3359
- if (d && d !== u) {
3360
- const g = Math.floor(h / d), x = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count;
3361
- let C = t.cache.get(x);
3362
- C || (m = new c(a, g * d, n.count * d / A), C = new Hn(m, d / A), t.cache.add(x, C)), f = new Ln(C, l, h % d / A, p);
3382
+ const a = o[0], l = St[n.type], c = je[n.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, h = n.byteOffset || 0, A = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, f = n.normalized === !0;
3383
+ let p, m;
3384
+ if (A && A !== u) {
3385
+ const g = Math.floor(h / A), y = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count;
3386
+ let C = t.cache.get(y);
3387
+ C || (p = new c(a, g * A, n.count * A / d), C = new Hn(p, A / d), t.cache.add(y, C)), m = new Ln(C, l, h % A / d, f);
3363
3388
  } else
3364
- a === null ? m = new c(n.count * l) : m = new c(a, h, n.count * l), f = new _e(m, l, p);
3389
+ a === null ? p = new c(n.count * l) : p = new c(a, h, n.count * l), m = new _e(p, l, f);
3365
3390
  if (n.sparse !== void 0) {
3366
- const g = St.SCALAR, x = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, y = n.sparse.values.byteOffset || 0, w = new x(o[1], C, n.sparse.count * g), D = new c(o[2], y, n.sparse.count * l);
3367
- a !== null && (f = new _e(f.array.slice(), f.itemSize, f.normalized)), f.normalized = !1;
3391
+ const g = St.SCALAR, y = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, x = n.sparse.values.byteOffset || 0, w = new y(o[1], C, n.sparse.count * g), D = new c(o[2], x, n.sparse.count * l);
3392
+ a !== null && (m = new _e(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
3368
3393
  for (let S = 0, Z = w.length; S < Z; S++) {
3369
- const _ = w[S];
3370
- if (f.setX(_, D[S * l]), l >= 2 && f.setY(_, D[S * l + 1]), l >= 3 && f.setZ(_, D[S * l + 2]), l >= 4 && f.setW(_, D[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
3394
+ const $ = w[S];
3395
+ if (m.setX($, D[S * l]), l >= 2 && m.setY($, D[S * l + 1]), l >= 3 && m.setZ($, D[S * l + 2]), l >= 4 && m.setW($, D[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
3371
3396
  }
3372
- f.normalized = p;
3397
+ m.normalized = f;
3373
3398
  }
3374
- return f;
3399
+ return m;
3375
3400
  });
3376
3401
  }
3377
3402
  /**
@@ -3394,10 +3419,10 @@ class ko {
3394
3419
  const n = this, i = this.json, o = i.textures[e], a = i.images[t], l = (a.uri || a.bufferView) + ":" + o.sampler;
3395
3420
  if (this.textureCache[l])
3396
3421
  return this.textureCache[l];
3397
- const c = this.loadImageSource(t, s).then(function(A) {
3398
- A.flipY = !1, A.name = o.name || a.name || "", A.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (A.name = a.uri);
3422
+ const c = this.loadImageSource(t, s).then(function(d) {
3423
+ d.flipY = !1, d.name = o.name || a.name || "", d.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (d.name = a.uri);
3399
3424
  const h = (i.samplers || {})[o.sampler] || {};
3400
- return A.magFilter = Dn[h.magFilter] || Gt, A.minFilter = Dn[h.minFilter] || Nn, A.wrapS = Pn[h.wrapS] || Ft, A.wrapT = Pn[h.wrapT] || Ft, A.generateMipmaps = !A.isCompressedTexture && A.minFilter !== jn && A.minFilter !== Gt, n.associations.set(A, { textures: e }), A;
3425
+ return d.magFilter = Dn[h.magFilter] || Gt, d.minFilter = Dn[h.minFilter] || Nn, d.wrapS = Pn[h.wrapS] || Ft, d.wrapT = Pn[h.wrapT] || Ft, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== jn && d.minFilter !== Gt, n.associations.set(d, { textures: e }), d;
3401
3426
  }).catch(function() {
3402
3427
  return null;
3403
3428
  });
@@ -3417,20 +3442,20 @@ class ko {
3417
3442
  });
3418
3443
  else if (o.uri === void 0)
3419
3444
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
3420
- const A = Promise.resolve(l).then(function(u) {
3421
- return new Promise(function(h, d) {
3422
- let p = h;
3423
- t.isImageBitmapLoader === !0 && (p = function(m) {
3424
- const f = new tn(m);
3425
- f.needsUpdate = !0, h(f);
3426
- }), t.load(Je.resolveURL(u, i.path), p, void 0, d);
3445
+ const d = Promise.resolve(l).then(function(u) {
3446
+ return new Promise(function(h, A) {
3447
+ let f = h;
3448
+ t.isImageBitmapLoader === !0 && (f = function(p) {
3449
+ const m = new tn(p);
3450
+ m.needsUpdate = !0, h(m);
3451
+ }), t.load(Je.resolveURL(u, i.path), f, void 0, A);
3427
3452
  });
3428
3453
  }).then(function(u) {
3429
3454
  return c === !0 && a.revokeObjectURL(l), re(u, o), u.userData.mimeType = o.mimeType || No(o.uri), u;
3430
3455
  }).catch(function(u) {
3431
3456
  throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u;
3432
3457
  });
3433
- return this.sourceCache[e] = A, A;
3458
+ return this.sourceCache[e] = d, d;
3434
3459
  }
3435
3460
  /**
3436
3461
  * Asynchronously assigns a texture to the given material parameters.
@@ -3506,7 +3531,7 @@ class ko {
3506
3531
  o = u.getMaterialType(), c.push(u.extendParams(a, i, t));
3507
3532
  } else {
3508
3533
  const u = i.pbrMetallicRoughness || {};
3509
- if (a.color = new de(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
3534
+ if (a.color = new he(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
3510
3535
  const h = u.baseColorFactor;
3511
3536
  a.color.setRGB(h[0], h[1], h[2], ae), a.opacity = h[3];
3512
3537
  }
@@ -3517,18 +3542,18 @@ class ko {
3517
3542
  })));
3518
3543
  }
3519
3544
  i.doubleSided === !0 && (a.side = Rn);
3520
- const A = i.alphaMode || Ht.OPAQUE;
3521
- if (A === Ht.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, A === Ht.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Y(1, 1), i.normalTexture.scale !== void 0)) {
3545
+ const d = i.alphaMode || Ht.OPAQUE;
3546
+ if (d === Ht.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === Ht.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Y(1, 1), i.normalTexture.scale !== void 0)) {
3522
3547
  const u = i.normalTexture.scale;
3523
3548
  a.normalScale.set(u, u);
3524
3549
  }
3525
3550
  if (i.occlusionTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== Pe) {
3526
3551
  const u = i.emissiveFactor;
3527
- a.emissive = new de().setRGB(u[0], u[1], u[2], ae);
3552
+ a.emissive = new he().setRGB(u[0], u[1], u[2], ae);
3528
3553
  }
3529
3554
  return i.emissiveTexture !== void 0 && o !== Pe && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(c).then(function() {
3530
3555
  const u = new o(a);
3531
- return i.name && (u.name = i.name), re(u, i), t.associations.set(u, { materials: e }), i.extensions && xe(n, u, i), u;
3556
+ return i.name && (u.name = i.name), re(u, i), t.associations.set(u, { materials: e }), i.extensions && we(n, u, i), u;
3532
3557
  });
3533
3558
  }
3534
3559
  /**
@@ -3560,12 +3585,12 @@ class ko {
3560
3585
  }
3561
3586
  const o = [];
3562
3587
  for (let a = 0, l = e.length; a < l; a++) {
3563
- const c = e[a], A = Lo(c), u = n[A];
3588
+ const c = e[a], d = Lo(c), u = n[d];
3564
3589
  if (u)
3565
3590
  o.push(u.promise);
3566
3591
  else {
3567
3592
  let h;
3568
- c.extensions && c.extensions[O.KHR_DRACO_MESH_COMPRESSION] ? h = i(c) : h = Tn(new We(), c, t), n[A] = { primitive: c, promise: h }, o.push(h);
3593
+ c.extensions && c.extensions[O.KHR_DRACO_MESH_COMPRESSION] ? h = i(c) : h = Tn(new We(), c, t), n[d] = { primitive: c, promise: h }, o.push(h);
3569
3594
  }
3570
3595
  }
3571
3596
  return Promise.all(o);
@@ -3580,40 +3605,40 @@ class ko {
3580
3605
  loadMesh(e) {
3581
3606
  const t = this, s = this.json, n = this.extensions, i = s.meshes[e], o = i.primitives, a = [];
3582
3607
  for (let l = 0, c = o.length; l < c; l++) {
3583
- const A = o[l].material === void 0 ? Ro(this.cache) : this.getDependency("material", o[l].material);
3584
- a.push(A);
3608
+ const d = o[l].material === void 0 ? Ro(this.cache) : this.getDependency("material", o[l].material);
3609
+ a.push(d);
3585
3610
  }
3586
3611
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
3587
- const c = l.slice(0, l.length - 1), A = l[l.length - 1], u = [];
3588
- for (let d = 0, p = A.length; d < p; d++) {
3589
- const m = A[d], f = o[d];
3612
+ const c = l.slice(0, l.length - 1), d = l[l.length - 1], u = [];
3613
+ for (let A = 0, f = d.length; A < f; A++) {
3614
+ const p = d[A], m = o[A];
3590
3615
  let g;
3591
- const x = c[d];
3592
- if (f.mode === te.TRIANGLES || f.mode === te.TRIANGLE_STRIP || f.mode === te.TRIANGLE_FAN || f.mode === void 0)
3593
- g = i.isSkinnedMesh === !0 ? new Es(m, x) : new v(m, x), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), f.mode === te.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Sn) : f.mode === te.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
3594
- else if (f.mode === te.LINES)
3595
- g = new Wt(m, x);
3596
- else if (f.mode === te.LINE_STRIP)
3597
- g = new ue(m, x);
3598
- else if (f.mode === te.LINE_LOOP)
3599
- g = new Rs(m, x);
3600
- else if (f.mode === te.POINTS)
3601
- g = new pt(m, x);
3616
+ const y = c[A];
3617
+ if (m.mode === ne.TRIANGLES || m.mode === ne.TRIANGLE_STRIP || m.mode === ne.TRIANGLE_FAN || m.mode === void 0)
3618
+ g = i.isSkinnedMesh === !0 ? new Es(p, y) : new v(p, y), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === ne.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Sn) : m.mode === ne.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
3619
+ else if (m.mode === ne.LINES)
3620
+ g = new Wt(p, y);
3621
+ else if (m.mode === ne.LINE_STRIP)
3622
+ g = new ue(p, y);
3623
+ else if (m.mode === ne.LINE_LOOP)
3624
+ g = new Rs(p, y);
3625
+ else if (m.mode === ne.POINTS)
3626
+ g = new pt(p, y);
3602
3627
  else
3603
- throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + f.mode);
3604
- Object.keys(g.geometry.morphAttributes).length > 0 && Ho(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), f.extensions && xe(n, g, f), t.assignFinalMaterial(g), u.push(g);
3628
+ throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
3629
+ Object.keys(g.geometry.morphAttributes).length > 0 && Ho(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), m.extensions && we(n, g, m), t.assignFinalMaterial(g), u.push(g);
3605
3630
  }
3606
- for (let d = 0, p = u.length; d < p; d++)
3607
- t.associations.set(u[d], {
3631
+ for (let A = 0, f = u.length; A < f; A++)
3632
+ t.associations.set(u[A], {
3608
3633
  meshes: e,
3609
- primitives: d
3634
+ primitives: A
3610
3635
  });
3611
3636
  if (u.length === 1)
3612
- return i.extensions && xe(n, u[0], i), u[0];
3637
+ return i.extensions && we(n, u[0], i), u[0];
3613
3638
  const h = new ft();
3614
- i.extensions && xe(n, h, i), t.associations.set(h, { meshes: e });
3615
- for (let d = 0, p = u.length; d < p; d++)
3616
- h.add(u[d]);
3639
+ i.extensions && we(n, h, i), t.associations.set(h, { meshes: e });
3640
+ for (let A = 0, f = u.length; A < f; A++)
3641
+ h.add(u[A]);
3617
3642
  return h;
3618
3643
  });
3619
3644
  }
@@ -3646,11 +3671,11 @@ class ko {
3646
3671
  s.push(this._loadNodeShallow(t.joints[n]));
3647
3672
  return t.inverseBindMatrices !== void 0 ? s.push(this.getDependency("accessor", t.inverseBindMatrices)) : s.push(null), Promise.all(s).then(function(n) {
3648
3673
  const i = n.pop(), o = n, a = [], l = [];
3649
- for (let c = 0, A = o.length; c < A; c++) {
3674
+ for (let c = 0, d = o.length; c < d; c++) {
3650
3675
  const u = o[c];
3651
3676
  if (u) {
3652
3677
  a.push(u);
3653
- const h = new me();
3678
+ const h = new ge();
3654
3679
  i !== null && h.fromArray(i.array, c * 16), l.push(h);
3655
3680
  } else
3656
3681
  console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
@@ -3666,30 +3691,30 @@ class ko {
3666
3691
  * @return {Promise<AnimationClip>}
3667
3692
  */
3668
3693
  loadAnimation(e) {
3669
- const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], A = [];
3694
+ const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], d = [];
3670
3695
  for (let u = 0, h = n.channels.length; u < h; u++) {
3671
- const d = n.channels[u], p = n.samplers[d.sampler], m = d.target, f = m.node, g = n.parameters !== void 0 ? n.parameters[p.input] : p.input, x = n.parameters !== void 0 ? n.parameters[p.output] : p.output;
3672
- m.node !== void 0 && (o.push(this.getDependency("node", f)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", x)), c.push(p), A.push(m));
3696
+ const A = n.channels[u], f = n.samplers[A.sampler], p = A.target, m = p.node, g = n.parameters !== void 0 ? n.parameters[f.input] : f.input, y = n.parameters !== void 0 ? n.parameters[f.output] : f.output;
3697
+ p.node !== void 0 && (o.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", y)), c.push(f), d.push(p));
3673
3698
  }
3674
3699
  return Promise.all([
3675
3700
  Promise.all(o),
3676
3701
  Promise.all(a),
3677
3702
  Promise.all(l),
3678
3703
  Promise.all(c),
3679
- Promise.all(A)
3704
+ Promise.all(d)
3680
3705
  ]).then(function(u) {
3681
- const h = u[0], d = u[1], p = u[2], m = u[3], f = u[4], g = [];
3682
- for (let C = 0, y = h.length; C < y; C++) {
3683
- const w = h[C], D = d[C], S = p[C], Z = m[C], _ = f[C];
3706
+ const h = u[0], A = u[1], f = u[2], p = u[3], m = u[4], g = [];
3707
+ for (let C = 0, x = h.length; C < x; C++) {
3708
+ const w = h[C], D = A[C], S = f[C], Z = p[C], $ = m[C];
3684
3709
  if (w === void 0) continue;
3685
3710
  w.updateMatrix && w.updateMatrix();
3686
- const Q = s._createAnimationTracks(w, D, S, Z, _);
3711
+ const Q = s._createAnimationTracks(w, D, S, Z, $);
3687
3712
  if (Q)
3688
- for (let ye = 0; ye < Q.length; ye++)
3689
- g.push(Q[ye]);
3713
+ for (let Ce = 0; Ce < Q.length; Ce++)
3714
+ g.push(Q[Ce]);
3690
3715
  }
3691
- const x = new Ns(i, void 0, g);
3692
- return re(x, n), x;
3716
+ const y = new Ns(i, void 0, g);
3717
+ return re(y, n), y;
3693
3718
  });
3694
3719
  }
3695
3720
  createNodeMesh(e) {
@@ -3712,7 +3737,7 @@ class ko {
3712
3737
  */
3713
3738
  loadNode(e) {
3714
3739
  const t = this.json, s = this, n = t.nodes[e], i = s._loadNodeShallow(e), o = [], a = n.children || [];
3715
- for (let c = 0, A = a.length; c < A; c++)
3740
+ for (let c = 0, d = a.length; c < d; c++)
3716
3741
  o.push(s.getDependency("node", a[c]));
3717
3742
  const l = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
3718
3743
  return Promise.all([
@@ -3720,17 +3745,17 @@ class ko {
3720
3745
  Promise.all(o),
3721
3746
  l
3722
3747
  ]).then(function(c) {
3723
- const A = c[0], u = c[1], h = c[2];
3724
- h !== null && A.traverse(function(d) {
3725
- d.isSkinnedMesh && d.bind(h, jo);
3748
+ const d = c[0], u = c[1], h = c[2];
3749
+ h !== null && d.traverse(function(A) {
3750
+ A.isSkinnedMesh && A.bind(h, jo);
3726
3751
  });
3727
- for (let d = 0, p = u.length; d < p; d++)
3728
- A.add(u[d]);
3729
- if (A.userData.pivot !== void 0 && u.length > 0) {
3730
- const d = A.userData.pivot, p = u[0];
3731
- A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2], p.position.set(0, 0, 0), delete A.userData.pivot;
3752
+ for (let A = 0, f = u.length; A < f; A++)
3753
+ d.add(u[A]);
3754
+ if (d.userData.pivot !== void 0 && u.length > 0) {
3755
+ const A = d.userData.pivot, f = u[0];
3756
+ d.pivot = new M().fromArray(A), d.position.x -= A[0], d.position.y -= A[1], d.position.z -= A[2], f.position.set(0, 0, 0), delete d.userData.pivot;
3732
3757
  }
3733
- return A;
3758
+ return d;
3734
3759
  });
3735
3760
  }
3736
3761
  // ._loadNodeShallow() parses a single node.
@@ -3749,22 +3774,22 @@ class ko {
3749
3774
  }).forEach(function(c) {
3750
3775
  a.push(c);
3751
3776
  }), this.nodeCache[e] = Promise.all(a).then(function(c) {
3752
- let A;
3753
- if (i.isBone === !0 ? A = new js() : c.length > 1 ? A = new ft() : c.length === 1 ? A = c[0] : A = new ke(), A !== c[0])
3777
+ let d;
3778
+ if (i.isBone === !0 ? d = new js() : c.length > 1 ? d = new ft() : c.length === 1 ? d = c[0] : d = new ke(), d !== c[0])
3754
3779
  for (let u = 0, h = c.length; u < h; u++)
3755
- A.add(c[u]);
3756
- if (i.name && (A.userData.name = i.name, A.name = o), re(A, i), i.extensions && xe(s, A, i), i.matrix !== void 0) {
3757
- const u = new me();
3758
- u.fromArray(i.matrix), A.applyMatrix4(u);
3780
+ d.add(c[u]);
3781
+ if (i.name && (d.userData.name = i.name, d.name = o), re(d, i), i.extensions && we(s, d, i), i.matrix !== void 0) {
3782
+ const u = new ge();
3783
+ u.fromArray(i.matrix), d.applyMatrix4(u);
3759
3784
  } else
3760
- i.translation !== void 0 && A.position.fromArray(i.translation), i.rotation !== void 0 && A.quaternion.fromArray(i.rotation), i.scale !== void 0 && A.scale.fromArray(i.scale);
3761
- if (!n.associations.has(A))
3762
- n.associations.set(A, {});
3785
+ i.translation !== void 0 && d.position.fromArray(i.translation), i.rotation !== void 0 && d.quaternion.fromArray(i.rotation), i.scale !== void 0 && d.scale.fromArray(i.scale);
3786
+ if (!n.associations.has(d))
3787
+ n.associations.set(d, {});
3763
3788
  else if (i.mesh !== void 0 && n.meshCache.refs[i.mesh] > 1) {
3764
- const u = n.associations.get(A);
3765
- n.associations.set(A, { ...u });
3789
+ const u = n.associations.get(d);
3790
+ n.associations.set(d, { ...u });
3766
3791
  }
3767
- return n.associations.get(A).nodes = e, A;
3792
+ return n.associations.get(d).nodes = e, d;
3768
3793
  }), this.nodeCache[e];
3769
3794
  }
3770
3795
  /**
@@ -3776,22 +3801,22 @@ class ko {
3776
3801
  */
3777
3802
  loadScene(e) {
3778
3803
  const t = this.extensions, s = this.json.scenes[e], n = this, i = new ft();
3779
- s.name && (i.name = n.createUniqueName(s.name)), re(i, s), s.extensions && xe(t, i, s);
3804
+ s.name && (i.name = n.createUniqueName(s.name)), re(i, s), s.extensions && we(t, i, s);
3780
3805
  const o = s.nodes || [], a = [];
3781
3806
  for (let l = 0, c = o.length; l < c; l++)
3782
3807
  a.push(n.getDependency("node", o[l]));
3783
3808
  return Promise.all(a).then(function(l) {
3784
- for (let A = 0, u = l.length; A < u; A++) {
3785
- const h = l[A];
3809
+ for (let d = 0, u = l.length; d < u; d++) {
3810
+ const h = l[d];
3786
3811
  h.parent !== null ? i.add(so(h)) : i.add(h);
3787
3812
  }
3788
- const c = (A) => {
3813
+ const c = (d) => {
3789
3814
  const u = /* @__PURE__ */ new Map();
3790
- for (const [h, d] of n.associations)
3791
- (h instanceof Qe || h instanceof tn) && u.set(h, d);
3792
- return A.traverse((h) => {
3793
- const d = n.associations.get(h);
3794
- d != null && u.set(h, d);
3815
+ for (const [h, A] of n.associations)
3816
+ (h instanceof Qe || h instanceof tn) && u.set(h, A);
3817
+ return d.traverse((h) => {
3818
+ const A = n.associations.get(h);
3819
+ A != null && u.set(h, A);
3795
3820
  }), u;
3796
3821
  };
3797
3822
  return n.associations = c(i), i;
@@ -3799,44 +3824,44 @@ class ko {
3799
3824
  }
3800
3825
  _createAnimationTracks(e, t, s, n, i) {
3801
3826
  const o = [], a = e.name ? e.name : e.uuid, l = [];
3802
- function c(d) {
3803
- d.morphTargetInfluences && l.push(d.name ? d.name : d.uuid);
3827
+ function c(A) {
3828
+ A.morphTargetInfluences && l.push(A.name ? A.name : A.uuid);
3804
3829
  }
3805
- fe[i.path] === fe.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
3806
- let A;
3807
- switch (fe[i.path]) {
3808
- case fe.weights:
3809
- A = sn;
3830
+ pe[i.path] === pe.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
3831
+ let d;
3832
+ switch (pe[i.path]) {
3833
+ case pe.weights:
3834
+ d = sn;
3810
3835
  break;
3811
- case fe.rotation:
3812
- A = on;
3836
+ case pe.rotation:
3837
+ d = on;
3813
3838
  break;
3814
- case fe.translation:
3815
- case fe.scale:
3816
- A = nn;
3839
+ case pe.translation:
3840
+ case pe.scale:
3841
+ d = nn;
3817
3842
  break;
3818
3843
  default:
3819
3844
  switch (s.itemSize) {
3820
3845
  case 1:
3821
- A = sn;
3846
+ d = sn;
3822
3847
  break;
3823
3848
  case 2:
3824
3849
  case 3:
3825
3850
  default:
3826
- A = nn;
3851
+ d = nn;
3827
3852
  break;
3828
3853
  }
3829
3854
  break;
3830
3855
  }
3831
3856
  const u = n.interpolation !== void 0 ? Eo[n.interpolation] : Wn, h = this._getArrayFromAccessor(s);
3832
- for (let d = 0, p = l.length; d < p; d++) {
3833
- const m = new A(
3834
- l[d] + "." + fe[i.path],
3857
+ for (let A = 0, f = l.length; A < f; A++) {
3858
+ const p = new d(
3859
+ l[A] + "." + pe[i.path],
3835
3860
  t.array,
3836
3861
  h,
3837
3862
  u
3838
3863
  );
3839
- n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(m), o.push(m);
3864
+ n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p);
3840
3865
  }
3841
3866
  return o;
3842
3867
  }
@@ -3866,8 +3891,8 @@ function Wo(r, e, t) {
3866
3891
  new M(l[0], l[1], l[2]),
3867
3892
  new M(c[0], c[1], c[2])
3868
3893
  ), a.normalized) {
3869
- const A = Vt(je[a.componentType]);
3870
- n.min.multiplyScalar(A), n.max.multiplyScalar(A);
3894
+ const d = Vt(je[a.componentType]);
3895
+ n.min.multiplyScalar(d), n.max.multiplyScalar(d);
3871
3896
  }
3872
3897
  } else {
3873
3898
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
@@ -3878,14 +3903,14 @@ function Wo(r, e, t) {
3878
3903
  const i = e.targets;
3879
3904
  if (i !== void 0) {
3880
3905
  const a = new M(), l = new M();
3881
- for (let c = 0, A = i.length; c < A; c++) {
3906
+ for (let c = 0, d = i.length; c < d; c++) {
3882
3907
  const u = i[c];
3883
3908
  if (u.POSITION !== void 0) {
3884
- const h = t.json.accessors[u.POSITION], d = h.min, p = h.max;
3885
- if (d !== void 0 && p !== void 0) {
3886
- if (l.setX(Math.max(Math.abs(d[0]), Math.abs(p[0]))), l.setY(Math.max(Math.abs(d[1]), Math.abs(p[1]))), l.setZ(Math.max(Math.abs(d[2]), Math.abs(p[2]))), h.normalized) {
3887
- const m = Vt(je[h.componentType]);
3888
- l.multiplyScalar(m);
3909
+ const h = t.json.accessors[u.POSITION], A = h.min, f = h.max;
3910
+ if (A !== void 0 && f !== void 0) {
3911
+ if (l.setX(Math.max(Math.abs(A[0]), Math.abs(f[0]))), l.setY(Math.max(Math.abs(A[1]), Math.abs(f[1]))), l.setZ(Math.max(Math.abs(A[2]), Math.abs(f[2]))), h.normalized) {
3912
+ const p = Vt(je[h.componentType]);
3913
+ l.multiplyScalar(p);
3889
3914
  }
3890
3915
  a.max(l);
3891
3916
  } else
@@ -4016,8 +4041,8 @@ class zo extends Yt {
4016
4041
  );
4017
4042
  }
4018
4043
  let n;
4019
- const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (n = l, new Promise((c, A) => {
4020
- n._callbacks[i] = { resolve: c, reject: A }, n.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
4044
+ const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (n = l, new Promise((c, d) => {
4045
+ n._callbacks[i] = { resolve: c, reject: d }, n.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
4021
4046
  }))).then((l) => this._createGeometry(l.geometry));
4022
4047
  return a.catch(() => !0).then(() => {
4023
4048
  n && i && this._releaseTask(n, i);
@@ -4035,8 +4060,8 @@ class zo extends Yt {
4035
4060
  if (o === a)
4036
4061
  c = new _e(i, o);
4037
4062
  else {
4038
- const A = new Hn(i, a);
4039
- c = new Ln(A, o, 0);
4063
+ const d = new Hn(i, a);
4064
+ c = new Ln(d, o, 0);
4040
4065
  }
4041
4066
  n === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(n, c);
4042
4067
  }
@@ -4044,7 +4069,7 @@ class zo extends Yt {
4044
4069
  }
4045
4070
  _assignVertexColorSpace(e, t) {
4046
4071
  if (t !== Ae) return;
4047
- const s = new de();
4072
+ const s = new he();
4048
4073
  for (let n = 0, i = e.count; n < i; n++)
4049
4074
  s.fromBufferAttribute(e, n), qt.colorSpaceToWorking(s, Ae), e.setXYZ(n, s.r, s.g, s.b);
4050
4075
  }
@@ -4117,21 +4142,21 @@ function Go() {
4117
4142
  const a = o.data;
4118
4143
  switch (a.type) {
4119
4144
  case "init":
4120
- r = a.decoderConfig, e = new Promise(function(A) {
4145
+ r = a.decoderConfig, e = new Promise(function(d) {
4121
4146
  r.onModuleLoaded = function(u) {
4122
- A({ draco: u });
4147
+ d({ draco: u });
4123
4148
  }, DracoDecoderModule(r);
4124
4149
  });
4125
4150
  break;
4126
4151
  case "decode":
4127
4152
  const l = a.buffer, c = a.taskConfig;
4128
- e.then((A) => {
4129
- const u = A.draco, h = new u.Decoder();
4153
+ e.then((d) => {
4154
+ const u = d.draco, h = new u.Decoder();
4130
4155
  try {
4131
- const d = t(u, h, new Int8Array(l), c), p = d.attributes.map((m) => m.array.buffer);
4132
- d.index && p.push(d.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: d }, p);
4133
- } catch (d) {
4134
- console.error(d), self.postMessage({ type: "error", id: a.id, error: d.message });
4156
+ const A = t(u, h, new Int8Array(l), c), f = A.attributes.map((p) => p.array.buffer);
4157
+ A.index && f.push(A.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: A }, f);
4158
+ } catch (A) {
4159
+ console.error(A), self.postMessage({ type: "error", id: a.id, error: A.message });
4135
4160
  } finally {
4136
4161
  u.destroy(h);
4137
4162
  }
@@ -4140,58 +4165,58 @@ function Go() {
4140
4165
  }
4141
4166
  };
4142
4167
  function t(o, a, l, c) {
4143
- const A = c.attributeIDs, u = c.attributeTypes;
4144
- let h, d;
4145
- const p = a.GetEncodedGeometryType(l);
4146
- if (p === o.TRIANGULAR_MESH)
4147
- h = new o.Mesh(), d = a.DecodeArrayToMesh(l, l.byteLength, h);
4148
- else if (p === o.POINT_CLOUD)
4149
- h = new o.PointCloud(), d = a.DecodeArrayToPointCloud(l, l.byteLength, h);
4168
+ const d = c.attributeIDs, u = c.attributeTypes;
4169
+ let h, A;
4170
+ const f = a.GetEncodedGeometryType(l);
4171
+ if (f === o.TRIANGULAR_MESH)
4172
+ h = new o.Mesh(), A = a.DecodeArrayToMesh(l, l.byteLength, h);
4173
+ else if (f === o.POINT_CLOUD)
4174
+ h = new o.PointCloud(), A = a.DecodeArrayToPointCloud(l, l.byteLength, h);
4150
4175
  else
4151
4176
  throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
4152
- if (!d.ok() || h.ptr === 0)
4153
- throw new Error("THREE.DRACOLoader: Decoding failed: " + d.error_msg());
4154
- const m = { index: null, attributes: [] };
4155
- for (const f in A) {
4156
- const g = self[u[f]];
4157
- let x, C;
4177
+ if (!A.ok() || h.ptr === 0)
4178
+ throw new Error("THREE.DRACOLoader: Decoding failed: " + A.error_msg());
4179
+ const p = { index: null, attributes: [] };
4180
+ for (const m in d) {
4181
+ const g = self[u[m]];
4182
+ let y, C;
4158
4183
  if (c.useUniqueIDs)
4159
- C = A[f], x = a.GetAttributeByUniqueId(h, C);
4184
+ C = d[m], y = a.GetAttributeByUniqueId(h, C);
4160
4185
  else {
4161
- if (C = a.GetAttributeId(h, o[A[f]]), C === -1) continue;
4162
- x = a.GetAttribute(h, C);
4186
+ if (C = a.GetAttributeId(h, o[d[m]]), C === -1) continue;
4187
+ y = a.GetAttribute(h, C);
4163
4188
  }
4164
- const y = n(o, a, h, f, g, x);
4165
- f === "color" && (y.vertexColorSpace = c.vertexColorSpace), m.attributes.push(y);
4189
+ const x = n(o, a, h, m, g, y);
4190
+ m === "color" && (x.vertexColorSpace = c.vertexColorSpace), p.attributes.push(x);
4166
4191
  }
4167
- return p === o.TRIANGULAR_MESH && (m.index = s(o, a, h)), o.destroy(h), m;
4192
+ return f === o.TRIANGULAR_MESH && (p.index = s(o, a, h)), o.destroy(h), p;
4168
4193
  }
4169
4194
  function s(o, a, l) {
4170
- const A = l.num_faces() * 3, u = A * 4, h = o._malloc(u);
4195
+ const d = l.num_faces() * 3, u = d * 4, h = o._malloc(u);
4171
4196
  a.GetTrianglesUInt32Array(l, u, h);
4172
- const d = new Uint32Array(o.HEAPF32.buffer, h, A).slice();
4173
- return o._free(h), { array: d, itemSize: 1 };
4197
+ const A = new Uint32Array(o.HEAPF32.buffer, h, d).slice();
4198
+ return o._free(h), { array: A, itemSize: 1 };
4174
4199
  }
4175
- function n(o, a, l, c, A, u) {
4176
- const h = l.num_points(), d = u.num_components(), p = i(o, A), m = d * A.BYTES_PER_ELEMENT, f = Math.ceil(m / 4) * 4, g = f / A.BYTES_PER_ELEMENT, x = h * m, C = h * f, y = o._malloc(x);
4177
- a.GetAttributeDataArrayForAllPoints(l, u, p, x, y);
4178
- const w = new A(o.HEAPF32.buffer, y, x / A.BYTES_PER_ELEMENT);
4200
+ function n(o, a, l, c, d, u) {
4201
+ const h = l.num_points(), A = u.num_components(), f = i(o, d), p = A * d.BYTES_PER_ELEMENT, m = Math.ceil(p / 4) * 4, g = m / d.BYTES_PER_ELEMENT, y = h * p, C = h * m, x = o._malloc(y);
4202
+ a.GetAttributeDataArrayForAllPoints(l, u, f, y, x);
4203
+ const w = new d(o.HEAPF32.buffer, x, y / d.BYTES_PER_ELEMENT);
4179
4204
  let D;
4180
- if (m === f)
4205
+ if (p === m)
4181
4206
  D = w.slice();
4182
4207
  else {
4183
- D = new A(C / A.BYTES_PER_ELEMENT);
4208
+ D = new d(C / d.BYTES_PER_ELEMENT);
4184
4209
  let S = 0;
4185
- for (let Z = 0, _ = w.length; Z < _; Z++) {
4186
- for (let Q = 0; Q < d; Q++)
4187
- D[S + Q] = w[Z * d + Q];
4210
+ for (let Z = 0, $ = w.length; Z < $; Z++) {
4211
+ for (let Q = 0; Q < A; Q++)
4212
+ D[S + Q] = w[Z * A + Q];
4188
4213
  S += g;
4189
4214
  }
4190
4215
  }
4191
- return o._free(y), {
4216
+ return o._free(x), {
4192
4217
  name: c,
4193
4218
  count: h,
4194
- itemSize: d,
4219
+ itemSize: A,
4195
4220
  array: D,
4196
4221
  stride: g
4197
4222
  };
@@ -4243,21 +4268,21 @@ function Uo(r) {
4243
4268
  repeatX: a = 4,
4244
4269
  repeatY: l = 4,
4245
4270
  speedX: c = 5e-4,
4246
- speedY: A = 5e-4
4247
- } = r || {}, u = new P.PlaneGeometry(e, t), d = new P.TextureLoader().load(Fo, (f) => {
4248
- f.wrapS = f.wrapT = P.RepeatWrapping, f.repeat.set(a, l), f.generateMipmaps = !1, f.minFilter = P.LinearFilter, f.magFilter = P.LinearFilter;
4249
- }), p = new P.MeshStandardMaterial({
4271
+ speedY: d = 5e-4
4272
+ } = r || {}, u = new P.PlaneGeometry(e, t), A = new P.TextureLoader().load(Fo, (m) => {
4273
+ m.wrapS = m.wrapT = P.RepeatWrapping, m.repeat.set(a, l), m.generateMipmaps = !1, m.minFilter = P.LinearFilter, m.magFilter = P.LinearFilter;
4274
+ }), f = new P.MeshStandardMaterial({
4250
4275
  color: s,
4251
4276
  roughness: n,
4252
4277
  metalness: i,
4253
- normalMap: d,
4278
+ normalMap: A,
4254
4279
  normalScale: new P.Vector2(o, o),
4255
4280
  side: P.DoubleSide,
4256
4281
  // 双面渲染,避免从侧面或底部看到黑色
4257
4282
  transparent: !0,
4258
4283
  opacity: 0.6
4259
- }), m = new P.Mesh(u, p);
4260
- m.rotation.x = -Math.PI / 2, m.position.y = 0, m.name = "水面(标准材质)", m.userData.isWater = !0, m.userData.isMovable = !0, m.userData.waterSpeed = { x: c, y: A }, ze(m);
4284
+ }), p = new P.Mesh(u, f);
4285
+ p.rotation.x = -Math.PI / 2, p.position.y = 0, p.name = "水面(标准材质)", p.userData.isWater = !0, p.userData.isMovable = !0, p.userData.waterSpeed = { x: c, y: d }, ze(p);
4261
4286
  }
4262
4287
  function Vo(r) {
4263
4288
  return Et(!0), new Promise((e, t) => {
@@ -4285,8 +4310,8 @@ function Vo(r) {
4285
4310
  var h;
4286
4311
  u.userData.isMovable = !0, u.name || (u.name = u.type), u.type === "Mesh" && (u.frustumCulled = !0, (h = u.geometry) == null || h.computeVertexNormals(), u.castShadow = !0, u.receiveShadow = !0);
4287
4312
  });
4288
- const A = new P.Box3().setFromObject(l).getCenter(new P.Vector3());
4289
- l.position.sub(A), ze(l, !0), Et(!1), e(l);
4313
+ const d = new P.Box3().setFromObject(l).getCenter(new P.Vector3());
4314
+ l.position.sub(d), ze(l, !0), Et(!1), e(l);
4290
4315
  },
4291
4316
  void 0,
4292
4317
  (a) => {
@@ -4320,28 +4345,16 @@ function Ko(r) {
4320
4345
  return console.warn("请先选中一个模型,再添加数据面板"), null;
4321
4346
  const t = Zt(e);
4322
4347
  t && (t.dispose(), hi(e));
4323
- const s = Math.min(window.innerWidth, 7e3), n = 1920, i = 200, o = Math.max(
4324
- 150,
4325
- // 最小宽度 150px(小屏设备)
4326
- Math.round(s / n * i)
4327
- ), l = Math.max(
4328
- 12,
4329
- Math.min(
4330
- 20,
4331
- Math.round(o / i * 13)
4332
- )
4333
- ), c = [
4348
+ const s = [
4334
4349
  { label: "温度", value: "30", unit: "℃" },
4335
4350
  { label: "湿度", value: "65", unit: "%" },
4336
4351
  { label: "压力", value: "101.3", unit: "kPa" },
4337
4352
  { label: "名称", value: e.name || "未命名" }
4338
- ], A = new Gn({
4353
+ ], n = new Gn({
4339
4354
  title: (r == null ? void 0 : r.title) || "数据面板",
4340
- items: (r == null ? void 0 : r.items) || c,
4341
- width: `${o}px`,
4342
- fontSize: `${l}px`
4355
+ items: (r == null ? void 0 : r.items) || s
4343
4356
  });
4344
- return A.attachTo(e), Fn(e, A), A;
4357
+ return n.attachTo(e), Fn(e, n), n;
4345
4358
  }
4346
4359
  const Zo = {
4347
4360
  key: 1,
@@ -4349,7 +4362,7 @@ const Zo = {
4349
4362
  }, Qo = { class: "tree-icon" }, Jo = { class: "tree-name" }, _o = {
4350
4363
  key: 0,
4351
4364
  class: "tree-children"
4352
- }, $o = /* @__PURE__ */ be({
4365
+ }, $o = /* @__PURE__ */ Ie({
4353
4366
  __name: "TreeItem",
4354
4367
  props: {
4355
4368
  node: {},
@@ -4358,17 +4371,17 @@ const Zo = {
4358
4371
  },
4359
4372
  emits: ["select", "delete"],
4360
4373
  setup(r, { emit: e }) {
4361
- const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((m) => m.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
4362
- (m) => m.userData.isMovable === !0
4363
- ))), A = Be(
4374
+ const t = r, s = e, n = L(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((p) => p.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
4375
+ (p) => p.userData.isMovable === !0
4376
+ ))), d = Be(
4364
4377
  () => {
4365
- var m;
4366
- return ((m = t.selectedObject) == null ? void 0 : m.uuid) === t.node.uuid;
4378
+ var p;
4379
+ return ((p = t.selectedObject) == null ? void 0 : p.uuid) === t.node.uuid;
4367
4380
  }
4368
4381
  );
4369
4382
  ts(
4370
4383
  () => {
4371
- A.value && n.value && n.value.scrollIntoView({
4384
+ d.value && n.value && n.value.scrollIntoView({
4372
4385
  block: "nearest",
4373
4386
  // 仅当元素不在可视区域时才滚动
4374
4387
  behavior: "smooth"
@@ -4377,12 +4390,12 @@ const Zo = {
4377
4390
  },
4378
4391
  { flush: "post" }
4379
4392
  );
4380
- const u = (m) => {
4381
- m.stopPropagation(), s("select", t.node);
4382
- }, h = (m) => {
4383
- m.stopPropagation(), s("delete", t.node);
4384
- }, d = (m) => m.type === "Mesh" || m.type === "Sprite" ? "🟦" : m.type === "Light" ? "💡" : "📦", p = (m) => m.name || `${m.type} (${m.id})`;
4385
- return (m, f) => {
4393
+ const u = (p) => {
4394
+ p.stopPropagation(), s("select", t.node);
4395
+ }, h = (p) => {
4396
+ p.stopPropagation(), s("delete", t.node);
4397
+ }, A = (p) => p.type === "Mesh" || p.type === "Sprite" ? "🟦" : p.type === "Light" ? "💡" : "📦", f = (p) => p.name || `${p.type} (${p.id})`;
4398
+ return (p, m) => {
4386
4399
  const g = ns("TreeItem", !0);
4387
4400
  return T(), R("div", {
4388
4401
  class: "tree-node",
@@ -4390,49 +4403,49 @@ const Zo = {
4390
4403
  ref: n
4391
4404
  }, [
4392
4405
  b("div", {
4393
- class: se(["tree-item", { selected: A.value }]),
4406
+ class: ie(["tree-item", { selected: d.value }]),
4394
4407
  onClick: u
4395
4408
  }, [
4396
4409
  l.value ? (T(), R("span", {
4397
4410
  key: 0,
4398
4411
  class: "toggle-icon",
4399
- onClick: f[0] || (f[0] = jt((x) => ss(o)(r.node.uuid), ["stop"]))
4400
- }, ie(a.value ? "▼" : "▶"), 1)) : (T(), R("span", Zo)),
4401
- b("span", Qo, ie(d(r.node)), 1),
4402
- b("span", Jo, ie(p(r.node)), 1),
4412
+ onClick: m[0] || (m[0] = jt((y) => ss(o)(r.node.uuid), ["stop"]))
4413
+ }, _(a.value ? "▼" : "▶"), 1)) : (T(), R("span", Zo)),
4414
+ b("span", Qo, _(A(r.node)), 1),
4415
+ b("span", Jo, _(f(r.node)), 1),
4403
4416
  b("button", {
4404
4417
  class: "tree-delete",
4405
4418
  onClick: jt(h, ["stop"])
4406
4419
  }, "×")
4407
4420
  ], 2),
4408
4421
  a.value && l.value ? (T(), R("div", _o, [
4409
- (T(!0), R(ve, null, wt(c.value, (x) => (T(), Ke(g, {
4410
- key: x.uuid,
4411
- node: x,
4422
+ (T(!0), R(Me, null, wt(c.value, (y) => (T(), Ke(g, {
4423
+ key: y.uuid,
4424
+ node: y,
4412
4425
  "selected-object": r.selectedObject,
4413
4426
  version: r.version,
4414
- onSelect: f[1] || (f[1] = (C) => s("select", C)),
4415
- onDelete: f[2] || (f[2] = (C) => s("delete", C))
4427
+ onSelect: m[1] || (m[1] = (C) => s("select", C)),
4428
+ onDelete: m[2] || (m[2] = (C) => s("delete", C))
4416
4429
  }, null, 8, ["node", "selected-object", "version"]))), 128))
4417
4430
  ])) : X("", !0)
4418
4431
  ], 512);
4419
4432
  };
4420
4433
  }
4421
- }), Ie = (r, e) => {
4434
+ }), ye = (r, e) => {
4422
4435
  const t = r.__vccOpts || r;
4423
4436
  for (const [s, n] of e)
4424
4437
  t[s] = n;
4425
4438
  return t;
4426
- }, er = /* @__PURE__ */ Ie($o, [["__scopeId", "data-v-5ad9c842"]]), tr = { class: "property-group" }, nr = { class: "row" }, sr = { class: "property-group" }, ir = { class: "row" }, or = { class: "property-group" }, rr = { class: "row" }, ar = {
4439
+ }, er = /* @__PURE__ */ ye($o, [["__scopeId", "data-v-5ad9c842"]]), tr = { class: "property-group" }, nr = { class: "row" }, sr = { class: "property-group" }, ir = { class: "row" }, or = { class: "property-group" }, rr = { class: "row" }, ar = {
4427
4440
  key: 0,
4428
4441
  class: "property-group light-group"
4429
4442
  }, lr = { class: "slider-row" }, cr = {
4430
4443
  key: 1,
4431
4444
  class: "property-group material-group"
4432
- }, ur = { class: "slider-row" }, Ar = { class: "slider-value" }, dr = { class: "slider-row" }, hr = { class: "slider-value" }, fr = { class: "slider-row" }, pr = { class: "slider-value" }, mr = {
4445
+ }, ur = { class: "slider-row" }, dr = { class: "slider-value" }, Ar = { class: "slider-row" }, hr = { class: "slider-value" }, fr = { class: "slider-row" }, pr = { class: "slider-value" }, mr = {
4433
4446
  key: 0,
4434
4447
  class: "material-hint"
4435
- }, gr = /* @__PURE__ */ be({
4448
+ }, gr = /* @__PURE__ */ Ie({
4436
4449
  __name: "TransformTab",
4437
4450
  props: {
4438
4451
  transform: {},
@@ -4444,43 +4457,43 @@ const Zo = {
4444
4457
  metalness: 0,
4445
4458
  roughness: 0.5,
4446
4459
  opacity: 1
4447
- }), o = j(!1), a = kt({
4460
+ }), o = L(!1), a = kt({
4448
4461
  intensity: 1
4449
4462
  });
4450
4463
  function l() {
4451
4464
  t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = a.intensity);
4452
4465
  }
4453
4466
  function c(h) {
4454
- let d = null;
4455
- return h.traverse((p) => {
4456
- if (p.type === "Mesh" && !d) {
4457
- const m = p, f = Array.isArray(m.material) ? m.material : [m.material];
4458
- for (const g of f)
4467
+ let A = null;
4468
+ return h.traverse((f) => {
4469
+ if (f.type === "Mesh" && !A) {
4470
+ const p = f, m = Array.isArray(p.material) ? p.material : [p.material];
4471
+ for (const g of m)
4459
4472
  if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
4460
- const x = g;
4461
- d = {
4462
- metalness: x.metalness ?? 0,
4463
- roughness: x.roughness ?? 0.5,
4473
+ const y = g;
4474
+ A = {
4475
+ metalness: y.metalness ?? 0,
4476
+ roughness: y.roughness ?? 0.5,
4464
4477
  opacity: g.opacity ?? 1
4465
4478
  };
4466
4479
  break;
4467
4480
  }
4468
4481
  }
4469
- }), d;
4482
+ }), A;
4470
4483
  }
4471
- function A(h, d) {
4472
- let p = !1;
4473
- return h.traverse((m) => {
4474
- if (m.type === "Mesh") {
4475
- const f = m, g = Array.isArray(f.material) ? f.material : [f.material];
4476
- for (const x of g)
4477
- x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0, p = !0);
4484
+ function d(h, A) {
4485
+ let f = !1;
4486
+ return h.traverse((p) => {
4487
+ if (p.type === "Mesh") {
4488
+ const m = p, g = Array.isArray(m.material) ? m.material : [m.material];
4489
+ for (const y of g)
4490
+ y && (y.type === "MeshStandardMaterial" || y.type === "MeshPhongMaterial") && (A.metalness !== void 0 && (y.metalness = A.metalness), A.roughness !== void 0 && (y.roughness = A.roughness), A.opacity !== void 0 && (y.opacity = A.opacity, y.transparent = A.opacity < 1), y.needsUpdate = !0, f = !0);
4478
4491
  }
4479
- }), p;
4492
+ }), f;
4480
4493
  }
4481
4494
  function u() {
4482
4495
  if (t.selectedObject) {
4483
- const h = A(t.selectedObject, {
4496
+ const h = d(t.selectedObject, {
4484
4497
  metalness: i.metalness,
4485
4498
  roughness: i.roughness,
4486
4499
  opacity: i.opacity
@@ -4488,57 +4501,57 @@ const Zo = {
4488
4501
  o.value = h;
4489
4502
  }
4490
4503
  }
4491
- return Me(
4504
+ return de(
4492
4505
  () => t.selectedObject,
4493
4506
  (h) => {
4494
4507
  if (h) {
4495
- const d = c(h);
4496
- d ? (i.metalness = d.metalness, i.roughness = d.roughness, i.opacity = d.opacity, o.value = !0) : (i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1), h.type === "DirectionalLight" && (a.intensity = h.intensity ?? 1);
4508
+ const A = c(h);
4509
+ A ? (i.metalness = A.metalness, i.roughness = A.roughness, i.opacity = A.opacity, o.value = !0) : (i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1), h.type === "DirectionalLight" && (a.intensity = h.intensity ?? 1);
4497
4510
  } else
4498
4511
  i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1;
4499
4512
  },
4500
4513
  { immediate: !0 }
4501
- ), (h, d) => (T(), R("div", null, [
4514
+ ), (h, A) => (T(), R("div", null, [
4502
4515
  b("div", tr, [
4503
- d[17] || (d[17] = b("label", null, "位置", -1)),
4516
+ A[17] || (A[17] = b("label", null, "位置", -1)),
4504
4517
  b("div", nr, [
4505
- d[14] || (d[14] = b("span", null, "X:", -1)),
4518
+ A[14] || (A[14] = b("span", null, "X:", -1)),
4506
4519
  E(b("input", {
4507
4520
  type: "number",
4508
- "onUpdate:modelValue": d[0] || (d[0] = (p) => r.transform.position.x = p),
4521
+ "onUpdate:modelValue": A[0] || (A[0] = (f) => r.transform.position.x = f),
4509
4522
  step: "0.01",
4510
4523
  onInput: n
4511
4524
  }, null, 544), [
4512
4525
  [
4513
- N,
4526
+ H,
4514
4527
  r.transform.position.x,
4515
4528
  void 0,
4516
4529
  { number: !0 }
4517
4530
  ]
4518
4531
  ]),
4519
- d[15] || (d[15] = b("span", null, "Y:", -1)),
4532
+ A[15] || (A[15] = b("span", null, "Y:", -1)),
4520
4533
  E(b("input", {
4521
4534
  type: "number",
4522
- "onUpdate:modelValue": d[1] || (d[1] = (p) => r.transform.position.y = p),
4535
+ "onUpdate:modelValue": A[1] || (A[1] = (f) => r.transform.position.y = f),
4523
4536
  step: "0.01",
4524
4537
  onInput: n
4525
4538
  }, null, 544), [
4526
4539
  [
4527
- N,
4540
+ H,
4528
4541
  r.transform.position.y,
4529
4542
  void 0,
4530
4543
  { number: !0 }
4531
4544
  ]
4532
4545
  ]),
4533
- d[16] || (d[16] = b("span", null, "Z:", -1)),
4546
+ A[16] || (A[16] = b("span", null, "Z:", -1)),
4534
4547
  E(b("input", {
4535
4548
  type: "number",
4536
- "onUpdate:modelValue": d[2] || (d[2] = (p) => r.transform.position.z = p),
4549
+ "onUpdate:modelValue": A[2] || (A[2] = (f) => r.transform.position.z = f),
4537
4550
  step: "0.01",
4538
4551
  onInput: n
4539
4552
  }, null, 544), [
4540
4553
  [
4541
- N,
4554
+ H,
4542
4555
  r.transform.position.z,
4543
4556
  void 0,
4544
4557
  { number: !0 }
@@ -4547,45 +4560,45 @@ const Zo = {
4547
4560
  ])
4548
4561
  ]),
4549
4562
  b("div", sr, [
4550
- d[21] || (d[21] = b("label", null, "旋转 (弧度)", -1)),
4563
+ A[21] || (A[21] = b("label", null, "旋转 (弧度)", -1)),
4551
4564
  b("div", ir, [
4552
- d[18] || (d[18] = b("span", null, "X:", -1)),
4565
+ A[18] || (A[18] = b("span", null, "X:", -1)),
4553
4566
  E(b("input", {
4554
4567
  type: "number",
4555
- "onUpdate:modelValue": d[3] || (d[3] = (p) => r.transform.rotation.x = p),
4568
+ "onUpdate:modelValue": A[3] || (A[3] = (f) => r.transform.rotation.x = f),
4556
4569
  step: "0.01",
4557
4570
  onInput: n
4558
4571
  }, null, 544), [
4559
4572
  [
4560
- N,
4573
+ H,
4561
4574
  r.transform.rotation.x,
4562
4575
  void 0,
4563
4576
  { number: !0 }
4564
4577
  ]
4565
4578
  ]),
4566
- d[19] || (d[19] = b("span", null, "Y:", -1)),
4579
+ A[19] || (A[19] = b("span", null, "Y:", -1)),
4567
4580
  E(b("input", {
4568
4581
  type: "number",
4569
- "onUpdate:modelValue": d[4] || (d[4] = (p) => r.transform.rotation.y = p),
4582
+ "onUpdate:modelValue": A[4] || (A[4] = (f) => r.transform.rotation.y = f),
4570
4583
  step: "0.01",
4571
4584
  onInput: n
4572
4585
  }, null, 544), [
4573
4586
  [
4574
- N,
4587
+ H,
4575
4588
  r.transform.rotation.y,
4576
4589
  void 0,
4577
4590
  { number: !0 }
4578
4591
  ]
4579
4592
  ]),
4580
- d[20] || (d[20] = b("span", null, "Z:", -1)),
4593
+ A[20] || (A[20] = b("span", null, "Z:", -1)),
4581
4594
  E(b("input", {
4582
4595
  type: "number",
4583
- "onUpdate:modelValue": d[5] || (d[5] = (p) => r.transform.rotation.z = p),
4596
+ "onUpdate:modelValue": A[5] || (A[5] = (f) => r.transform.rotation.z = f),
4584
4597
  step: "0.01",
4585
4598
  onInput: n
4586
4599
  }, null, 544), [
4587
4600
  [
4588
- N,
4601
+ H,
4589
4602
  r.transform.rotation.z,
4590
4603
  void 0,
4591
4604
  { number: !0 }
@@ -4594,45 +4607,45 @@ const Zo = {
4594
4607
  ])
4595
4608
  ]),
4596
4609
  b("div", or, [
4597
- d[25] || (d[25] = b("label", null, "缩放", -1)),
4610
+ A[25] || (A[25] = b("label", null, "缩放", -1)),
4598
4611
  b("div", rr, [
4599
- d[22] || (d[22] = b("span", null, "X:", -1)),
4612
+ A[22] || (A[22] = b("span", null, "X:", -1)),
4600
4613
  E(b("input", {
4601
4614
  type: "number",
4602
- "onUpdate:modelValue": d[6] || (d[6] = (p) => r.transform.scale.x = p),
4615
+ "onUpdate:modelValue": A[6] || (A[6] = (f) => r.transform.scale.x = f),
4603
4616
  step: "0.01",
4604
4617
  onInput: n
4605
4618
  }, null, 544), [
4606
4619
  [
4607
- N,
4620
+ H,
4608
4621
  r.transform.scale.x,
4609
4622
  void 0,
4610
4623
  { number: !0 }
4611
4624
  ]
4612
4625
  ]),
4613
- d[23] || (d[23] = b("span", null, "Y:", -1)),
4626
+ A[23] || (A[23] = b("span", null, "Y:", -1)),
4614
4627
  E(b("input", {
4615
4628
  type: "number",
4616
- "onUpdate:modelValue": d[7] || (d[7] = (p) => r.transform.scale.y = p),
4629
+ "onUpdate:modelValue": A[7] || (A[7] = (f) => r.transform.scale.y = f),
4617
4630
  step: "0.01",
4618
4631
  onInput: n
4619
4632
  }, null, 544), [
4620
4633
  [
4621
- N,
4634
+ H,
4622
4635
  r.transform.scale.y,
4623
4636
  void 0,
4624
4637
  { number: !0 }
4625
4638
  ]
4626
4639
  ]),
4627
- d[24] || (d[24] = b("span", null, "Z:", -1)),
4640
+ A[24] || (A[24] = b("span", null, "Z:", -1)),
4628
4641
  E(b("input", {
4629
4642
  type: "number",
4630
- "onUpdate:modelValue": d[8] || (d[8] = (p) => r.transform.scale.z = p),
4643
+ "onUpdate:modelValue": A[8] || (A[8] = (f) => r.transform.scale.z = f),
4631
4644
  step: "0.01",
4632
4645
  onInput: n
4633
4646
  }, null, 544), [
4634
4647
  [
4635
- N,
4648
+ H,
4636
4649
  r.transform.scale.z,
4637
4650
  void 0,
4638
4651
  { number: !0 }
@@ -4641,19 +4654,19 @@ const Zo = {
4641
4654
  ])
4642
4655
  ]),
4643
4656
  r.selectedObject && r.selectedObject.type === "DirectionalLight" ? (T(), R("div", ar, [
4644
- d[27] || (d[27] = b("label", null, "光源属性", -1)),
4657
+ A[27] || (A[27] = b("label", null, "光源属性", -1)),
4645
4658
  b("div", lr, [
4646
- d[26] || (d[26] = b("span", { class: "slider-label" }, "强度", -1)),
4659
+ A[26] || (A[26] = b("span", { class: "slider-label" }, "强度", -1)),
4647
4660
  E(b("input", {
4648
4661
  type: "range",
4649
4662
  min: "0",
4650
4663
  max: "10",
4651
4664
  step: "0.1",
4652
- "onUpdate:modelValue": d[9] || (d[9] = (p) => a.intensity = p),
4665
+ "onUpdate:modelValue": A[9] || (A[9] = (f) => a.intensity = f),
4653
4666
  onInput: l
4654
4667
  }, null, 544), [
4655
4668
  [
4656
- N,
4669
+ H,
4657
4670
  a.intensity,
4658
4671
  void 0,
4659
4672
  { number: !0 }
@@ -4664,12 +4677,12 @@ const Zo = {
4664
4677
  min: "0",
4665
4678
  max: "100",
4666
4679
  step: "0.1",
4667
- "onUpdate:modelValue": d[10] || (d[10] = (p) => a.intensity = p),
4680
+ "onUpdate:modelValue": A[10] || (A[10] = (f) => a.intensity = f),
4668
4681
  class: "intensity-input",
4669
4682
  onInput: l
4670
4683
  }, null, 544), [
4671
4684
  [
4672
- N,
4685
+ H,
4673
4686
  a.intensity,
4674
4687
  void 0,
4675
4688
  { number: !0 }
@@ -4678,69 +4691,69 @@ const Zo = {
4678
4691
  ])
4679
4692
  ])) : X("", !0),
4680
4693
  r.selectedObject ? (T(), R("div", cr, [
4681
- d[31] || (d[31] = b("label", null, "材质", -1)),
4694
+ A[31] || (A[31] = b("label", null, "材质", -1)),
4682
4695
  b("div", ur, [
4683
- d[28] || (d[28] = b("span", { class: "slider-label" }, "金属度", -1)),
4696
+ A[28] || (A[28] = b("span", { class: "slider-label" }, "金属度", -1)),
4684
4697
  E(b("input", {
4685
4698
  type: "range",
4686
4699
  min: "0",
4687
4700
  max: "1",
4688
4701
  step: "0.01",
4689
- "onUpdate:modelValue": d[11] || (d[11] = (p) => i.metalness = p),
4702
+ "onUpdate:modelValue": A[11] || (A[11] = (f) => i.metalness = f),
4690
4703
  onInput: u
4691
4704
  }, null, 544), [
4692
4705
  [
4693
- N,
4706
+ H,
4694
4707
  i.metalness,
4695
4708
  void 0,
4696
4709
  { number: !0 }
4697
4710
  ]
4698
4711
  ]),
4699
- b("span", Ar, ie(i.metalness.toFixed(2)), 1)
4712
+ b("span", dr, _(i.metalness.toFixed(2)), 1)
4700
4713
  ]),
4701
- b("div", dr, [
4702
- d[29] || (d[29] = b("span", { class: "slider-label" }, "粗糙度", -1)),
4714
+ b("div", Ar, [
4715
+ A[29] || (A[29] = b("span", { class: "slider-label" }, "粗糙度", -1)),
4703
4716
  E(b("input", {
4704
4717
  type: "range",
4705
4718
  min: "0",
4706
4719
  max: "1",
4707
4720
  step: "0.01",
4708
- "onUpdate:modelValue": d[12] || (d[12] = (p) => i.roughness = p),
4721
+ "onUpdate:modelValue": A[12] || (A[12] = (f) => i.roughness = f),
4709
4722
  onInput: u
4710
4723
  }, null, 544), [
4711
4724
  [
4712
- N,
4725
+ H,
4713
4726
  i.roughness,
4714
4727
  void 0,
4715
4728
  { number: !0 }
4716
4729
  ]
4717
4730
  ]),
4718
- b("span", hr, ie(i.roughness.toFixed(2)), 1)
4731
+ b("span", hr, _(i.roughness.toFixed(2)), 1)
4719
4732
  ]),
4720
4733
  b("div", fr, [
4721
- d[30] || (d[30] = b("span", { class: "slider-label" }, "透明度", -1)),
4734
+ A[30] || (A[30] = b("span", { class: "slider-label" }, "透明度", -1)),
4722
4735
  E(b("input", {
4723
4736
  type: "range",
4724
4737
  min: "0",
4725
4738
  max: "1",
4726
4739
  step: "0.01",
4727
- "onUpdate:modelValue": d[13] || (d[13] = (p) => i.opacity = p),
4740
+ "onUpdate:modelValue": A[13] || (A[13] = (f) => i.opacity = f),
4728
4741
  onInput: u
4729
4742
  }, null, 544), [
4730
4743
  [
4731
- N,
4744
+ H,
4732
4745
  i.opacity,
4733
4746
  void 0,
4734
4747
  { number: !0 }
4735
4748
  ]
4736
4749
  ]),
4737
- b("span", pr, ie(i.opacity.toFixed(2)), 1)
4750
+ b("span", pr, _(i.opacity.toFixed(2)), 1)
4738
4751
  ]),
4739
4752
  o.value ? X("", !0) : (T(), R("div", mr, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
4740
4753
  ])) : X("", !0)
4741
4754
  ]));
4742
4755
  }
4743
- }), br = /* @__PURE__ */ Ie(gr, [["__scopeId", "data-v-4cecf018"]]), Ir = { class: "userdata-tab" }, yr = { class: "property-group userdata-group" }, Cr = { class: "userdata-add-row" }, xr = ["onKeyup"], wr = {
4756
+ }), br = /* @__PURE__ */ ye(gr, [["__scopeId", "data-v-4cecf018"]]), Ir = { class: "userdata-tab" }, yr = { class: "property-group userdata-group" }, Cr = { class: "userdata-add-row" }, xr = ["onKeyup"], wr = {
4744
4757
  key: 0,
4745
4758
  class: "userdata-list"
4746
4759
  }, vr = { class: "ud-key" }, Mr = {
@@ -4753,46 +4766,46 @@ const Zo = {
4753
4766
  }, Or = { class: "ud-json-actions" }, Er = ["onClick"], Rr = ["onClick"], Sr = {
4754
4767
  key: 1,
4755
4768
  class: "userdata-empty"
4756
- }, Hr = /* @__PURE__ */ be({
4769
+ }, Hr = /* @__PURE__ */ Ie({
4757
4770
  __name: "UserDataTab",
4758
4771
  props: {
4759
4772
  selectedObject: {}
4760
4773
  },
4761
4774
  setup(r) {
4762
- const e = r, t = j(""), s = j(""), n = j(null), i = j(""), o = j(null), a = j([]);
4775
+ const e = r, t = L(""), s = L(""), n = L(null), i = L(""), o = L(null), a = L([]);
4763
4776
  function l(C) {
4764
4777
  if (C === null) return "null";
4765
4778
  if (C === void 0) return "undefined";
4766
4779
  if (Array.isArray(C)) return "array";
4767
- const y = typeof C;
4768
- return y === "object" ? "object" : y === "number" ? "number" : y === "boolean" ? "boolean" : "string";
4780
+ const x = typeof C;
4781
+ return x === "object" ? "object" : x === "number" ? "number" : x === "boolean" ? "boolean" : "string";
4769
4782
  }
4770
4783
  function c(C) {
4771
- const y = [];
4784
+ const x = [];
4772
4785
  if (C.userData)
4773
4786
  for (const [w, D] of Object.entries(C.userData))
4774
- typeof w == "string" && !w.startsWith("_") && y.push({
4787
+ typeof w == "string" && !w.startsWith("_") && x.push({
4775
4788
  key: w,
4776
4789
  value: typeof D == "object" ? JSON.stringify(D) : String(D),
4777
4790
  rawType: l(D)
4778
4791
  });
4779
- a.value = y;
4792
+ a.value = x;
4780
4793
  }
4781
- function A(C) {
4782
- const y = C.trim();
4783
- if (y === "true") return !0;
4784
- if (y === "false") return !1;
4785
- if (y === "null") return null;
4786
- if (y === "undefined") return;
4787
- const w = Number(y);
4788
- if (y !== "" && !isNaN(w))
4789
- return String(w) !== y ? y : w;
4790
- if (y.startsWith("{") && y.endsWith("}") || y.startsWith("[") && y.endsWith("]"))
4794
+ function d(C) {
4795
+ const x = C.trim();
4796
+ if (x === "true") return !0;
4797
+ if (x === "false") return !1;
4798
+ if (x === "null") return null;
4799
+ if (x === "undefined") return;
4800
+ const w = Number(x);
4801
+ if (x !== "" && !isNaN(w))
4802
+ return String(w) !== x ? x : w;
4803
+ if (x.startsWith("{") && x.endsWith("}") || x.startsWith("[") && x.endsWith("]"))
4791
4804
  try {
4792
- return JSON.parse(y);
4805
+ return JSON.parse(x);
4793
4806
  } catch {
4794
4807
  }
4795
- return y;
4808
+ return x;
4796
4809
  }
4797
4810
  function u() {
4798
4811
  if (!e.selectedObject || !t.value.trim()) return;
@@ -4801,28 +4814,28 @@ const Zo = {
4801
4814
  t.value = "";
4802
4815
  return;
4803
4816
  }
4804
- const y = A(s.value);
4805
- e.selectedObject.userData[C] = y, c(e.selectedObject), t.value = "", s.value = "";
4817
+ const x = d(s.value);
4818
+ e.selectedObject.userData[C] = x, c(e.selectedObject), t.value = "", s.value = "";
4806
4819
  }
4807
- function h(C, y) {
4820
+ function h(C, x) {
4808
4821
  e.selectedObject && (delete e.selectedObject.userData[C], c(e.selectedObject));
4809
4822
  }
4810
- function d(C) {
4823
+ function A(C) {
4811
4824
  return C.length <= 28 ? C : C.substring(0, 28) + "…";
4812
4825
  }
4813
- function p(C) {
4826
+ function f(C) {
4814
4827
  n.value = C;
4815
- const y = e.selectedObject;
4816
- if (!y) return;
4817
- const w = y.userData[C];
4828
+ const x = e.selectedObject;
4829
+ if (!x) return;
4830
+ const w = x.userData[C];
4818
4831
  try {
4819
4832
  i.value = JSON.stringify(w, null, 2);
4820
4833
  } catch {
4821
4834
  i.value = String(w);
4822
4835
  }
4823
- m();
4836
+ p();
4824
4837
  }
4825
- function m() {
4838
+ function p() {
4826
4839
  const C = i.value.trim();
4827
4840
  if (!C) {
4828
4841
  o.value = null;
@@ -4834,60 +4847,60 @@ const Zo = {
4834
4847
  }
4835
4848
  try {
4836
4849
  JSON.parse(C), o.value = null;
4837
- } catch (y) {
4838
- o.value = "JSON 格式错误:" + y.message;
4850
+ } catch (x) {
4851
+ o.value = "JSON 格式错误:" + x.message;
4839
4852
  }
4840
4853
  }
4841
- function f(C) {
4842
- const y = e.selectedObject;
4843
- if (!y) return;
4854
+ function m(C) {
4855
+ const x = e.selectedObject;
4856
+ if (!x) return;
4844
4857
  const w = i.value.trim();
4845
4858
  try {
4846
4859
  const D = JSON.parse(w);
4847
- y.userData[C] = D, c(y), n.value = null, i.value = "";
4860
+ x.userData[C] = D, c(x), n.value = null, i.value = "";
4848
4861
  } catch {
4849
- y.userData[C] = w, c(y), n.value = null, i.value = "";
4862
+ x.userData[C] = w, c(x), n.value = null, i.value = "";
4850
4863
  }
4851
4864
  }
4852
4865
  function g() {
4853
4866
  n.value = null, i.value = "";
4854
4867
  }
4855
- function x() {
4868
+ function y() {
4856
4869
  const C = e.selectedObject;
4857
4870
  if (!C) return;
4858
- const y = Yi();
4859
- y && (C.userData.closeUpView = {
4860
- x: y.position.x,
4861
- y: y.position.y,
4862
- z: y.position.z
4871
+ const x = Yi();
4872
+ x && (C.userData.closeUpView = {
4873
+ x: x.position.x,
4874
+ y: x.position.y,
4875
+ z: x.position.z
4863
4876
  }, c(C));
4864
4877
  }
4865
- return Me(
4878
+ return de(
4866
4879
  () => e.selectedObject,
4867
4880
  (C) => {
4868
4881
  C ? c(C) : a.value = [], n.value = null, i.value = "";
4869
4882
  },
4870
4883
  { immediate: !0 }
4871
- ), (C, y) => (T(), R("div", Ir, [
4884
+ ), (C, x) => (T(), R("div", Ir, [
4872
4885
  b("div", yr, [
4873
- y[3] || (y[3] = b("label", null, "userData 属性", -1)),
4886
+ x[3] || (x[3] = b("label", null, "userData 属性", -1)),
4874
4887
  b("div", Cr, [
4875
4888
  E(b("input", {
4876
4889
  type: "text",
4877
- "onUpdate:modelValue": y[0] || (y[0] = (w) => t.value = w),
4890
+ "onUpdate:modelValue": x[0] || (x[0] = (w) => t.value = w),
4878
4891
  placeholder: "属性名",
4879
4892
  class: "ud-input",
4880
4893
  onKeyup: He(u, ["enter"])
4881
4894
  }, null, 544), [
4882
- [N, t.value]
4895
+ [H, t.value]
4883
4896
  ]),
4884
4897
  E(b("textarea", {
4885
- "onUpdate:modelValue": y[1] || (y[1] = (w) => s.value = w),
4898
+ "onUpdate:modelValue": x[1] || (x[1] = (w) => s.value = w),
4886
4899
  placeholder: "值",
4887
4900
  class: "ud-input ud-textarea",
4888
4901
  onKeyup: He(jt(u, ["prevent"]), ["enter"])
4889
4902
  }, null, 40, xr), [
4890
- [N, s.value]
4903
+ [H, s.value]
4891
4904
  ]),
4892
4905
  b("button", {
4893
4906
  class: "ud-btn add-btn",
@@ -4896,37 +4909,37 @@ const Zo = {
4896
4909
  }, " + ")
4897
4910
  ]),
4898
4911
  a.value.length > 0 ? (T(), R("div", wr, [
4899
- (T(!0), R(ve, null, wt(a.value, (w, D) => (T(), R("div", {
4912
+ (T(!0), R(Me, null, wt(a.value, (w, D) => (T(), R("div", {
4900
4913
  key: w.key,
4901
- class: se(["userdata-item", {
4914
+ class: ie(["userdata-item", {
4902
4915
  readonly: w.key === "isMovable",
4903
4916
  "editing-json": n.value === w.key
4904
4917
  }])
4905
4918
  }, [
4906
- b("span", vr, ie(w.key), 1),
4907
- w.key === "isMovable" ? (T(), R("span", Mr, ie(String(w.value)) + " 🔒 ", 1)) : w.key !== "isMovable" ? (T(), R(ve, { key: 1 }, [
4908
- n.value !== w.key ? (T(), R(ve, { key: 0 }, [
4909
- b("span", Dr, ie(d(w.value)), 1),
4919
+ b("span", vr, _(w.key), 1),
4920
+ w.key === "isMovable" ? (T(), R("span", Mr, _(String(w.value)) + " 🔒 ", 1)) : w.key !== "isMovable" ? (T(), R(Me, { key: 1 }, [
4921
+ n.value !== w.key ? (T(), R(Me, { key: 0 }, [
4922
+ b("span", Dr, _(A(w.value)), 1),
4910
4923
  b("button", {
4911
4924
  class: "ud-btn edit-json-btn",
4912
4925
  title: "编辑对象",
4913
- onClick: (S) => p(w.key)
4926
+ onClick: (S) => f(w.key)
4914
4927
  }, " ✎ ", 8, Pr)
4915
- ], 64)) : (T(), R(ve, { key: 1 }, [
4916
- o.value ? (T(), R("div", Tr, " ⚠ " + ie(o.value), 1)) : X("", !0),
4928
+ ], 64)) : (T(), R(Me, { key: 1 }, [
4929
+ o.value ? (T(), R("div", Tr, " ⚠ " + _(o.value), 1)) : X("", !0),
4917
4930
  E(b("textarea", {
4918
- "onUpdate:modelValue": y[2] || (y[2] = (S) => i.value = S),
4919
- class: se(["ud-json-textarea", { "has-error": o.value }]),
4931
+ "onUpdate:modelValue": x[2] || (x[2] = (S) => i.value = S),
4932
+ class: ie(["ud-json-textarea", { "has-error": o.value }]),
4920
4933
  rows: "3",
4921
- onInput: m
4934
+ onInput: p
4922
4935
  }, null, 34), [
4923
- [N, i.value]
4936
+ [H, i.value]
4924
4937
  ]),
4925
4938
  b("div", Or, [
4926
4939
  b("button", {
4927
4940
  class: "ud-btn apply-btn",
4928
4941
  title: "应用修改",
4929
- onClick: (S) => f(w.key)
4942
+ onClick: (S) => m(w.key)
4930
4943
  }, " ✓ ", 8, Er),
4931
4944
  b("button", {
4932
4945
  class: "ud-btn cancel-btn",
@@ -4946,167 +4959,221 @@ const Zo = {
4946
4959
  ])) : (T(), R("div", Sr, "暂无自定义数据")),
4947
4960
  b("button", {
4948
4961
  class: "get-camera-btn",
4949
- onClick: x
4962
+ onClick: y
4950
4963
  }, " 添加当前相机位置 ")
4951
4964
  ])
4952
4965
  ]));
4953
4966
  }
4954
- }), Lr = /* @__PURE__ */ Ie(Hr, [["__scopeId", "data-v-4e117415"]]), Nr = { class: "datapanel-tab" }, jr = { class: "property-group" }, kr = { class: "dp-section" }, Wr = { class: "dp-visibility-row" }, zr = { class: "dp-toggle" }, Gr = { class: "dp-visibility-text" }, Fr = { class: "dp-section" }, qr = { class: "dp-section" }, Xr = { class: "dp-list" }, Br = ["onUpdate:modelValue"], Ur = ["onUpdate:modelValue"], Vr = ["onUpdate:modelValue"], Yr = ["onUpdate:modelValue"], Kr = ["onClick"], Zr = { class: "dp-add-row" }, Qr = /* @__PURE__ */ be({
4967
+ }), Lr = /* @__PURE__ */ ye(Hr, [["__scopeId", "data-v-4e117415"]]), Nr = { class: "datapanel-tab" }, jr = { class: "property-group" }, kr = { class: "dp-section" }, Wr = { class: "dp-visibility-row" }, zr = { class: "dp-toggle" }, Gr = { class: "dp-visibility-text" }, Fr = { class: "dp-section" }, qr = { class: "dp-size-row" }, Xr = { class: "dp-size-value" }, Br = { class: "dp-section" }, Ur = { class: "dp-size-row" }, Vr = { class: "dp-size-value" }, Yr = { class: "dp-section" }, Kr = { class: "dp-section" }, Zr = { class: "dp-list" }, Qr = ["onUpdate:modelValue"], Jr = ["onUpdate:modelValue"], _r = ["onUpdate:modelValue"], $r = ["onUpdate:modelValue"], ea = ["onClick"], ta = { class: "dp-add-row" }, na = /* @__PURE__ */ Ie({
4955
4968
  __name: "DataPanelTab",
4956
4969
  props: {
4957
4970
  selectedObject: {}
4958
4971
  },
4959
4972
  setup(r) {
4960
- const e = r, t = j(""), s = j([]), n = j(!0), i = j(""), o = j(""), a = j(""), l = j("");
4961
- let c = u(), A = !1;
4962
- function u() {
4963
- const m = e.selectedObject;
4964
- return m ? Zt(xt(m)) : null;
4973
+ const e = r, t = L(""), s = L([]), n = L(!0), i = L(200), o = L(13), a = L(""), l = L(""), c = L(""), d = L("");
4974
+ let u = A(), h = !1;
4975
+ function A() {
4976
+ const g = e.selectedObject;
4977
+ return g ? Zt(xt(g)) : null;
4965
4978
  }
4966
- Me(n, (m) => {
4967
- A || !c || (c.visible = m);
4979
+ de(n, (g) => {
4980
+ h || !u || (u.visible = g);
4968
4981
  });
4969
- function h() {
4970
- A || !c || (c.setTitle(t.value), c.setItems([...s.value]));
4982
+ function f() {
4983
+ h || !u || (u.setTitle(t.value), u.setItems([...s.value]));
4971
4984
  }
4972
- Me(t, () => h()), Me(s, () => h(), { deep: !0 });
4973
- function d(m) {
4974
- s.value = s.value.filter((f, g) => g !== m), h();
4985
+ de(i, (g) => {
4986
+ h || !u || u.setWidth(`${g}px`);
4987
+ }), de(o, (g) => {
4988
+ h || !u || u.setFontSize(`${g}px`);
4989
+ }), de(t, () => f()), de(s, () => f(), { deep: !0 });
4990
+ function p(g) {
4991
+ s.value = s.value.filter((y, C) => C !== g), f();
4975
4992
  }
4976
- function p() {
4977
- !i.value.trim() || !o.value.trim() || (s.value = [
4993
+ function m() {
4994
+ !a.value.trim() || !l.value.trim() || (s.value = [
4978
4995
  ...s.value,
4979
4996
  {
4980
- label: i.value.trim(),
4981
- value: o.value.trim(),
4982
- unit: a.value.trim() || void 0,
4983
- code: l.value.trim() || void 0
4997
+ label: a.value.trim(),
4998
+ value: l.value.trim(),
4999
+ unit: c.value.trim() || void 0,
5000
+ code: d.value.trim() || void 0
4984
5001
  }
4985
- ], h(), i.value = "", o.value = "", a.value = "", l.value = "");
5002
+ ], f(), a.value = "", l.value = "", c.value = "", d.value = "");
4986
5003
  }
4987
- return Me(
5004
+ return de(
4988
5005
  () => e.selectedObject,
4989
5006
  () => {
4990
- A = !0, c = u(), c ? (t.value = c.getTitle(), s.value = c.getItems(), n.value = c.visible) : (t.value = "", s.value = [], n.value = !0), i.value = "", o.value = "", a.value = "", setTimeout(() => {
4991
- A = !1;
5007
+ if (h = !0, u = A(), u) {
5008
+ t.value = u.getTitle(), s.value = u.getItems(), n.value = u.visible;
5009
+ const g = u.getWidth();
5010
+ i.value = parseInt(g) || 200;
5011
+ const y = u.getFontSize();
5012
+ o.value = parseInt(y) || 13;
5013
+ } else
5014
+ t.value = "", s.value = [], n.value = !0, i.value = 200, o.value = 13;
5015
+ a.value = "", l.value = "", c.value = "", setTimeout(() => {
5016
+ h = !1;
4992
5017
  }, 0);
4993
5018
  },
4994
5019
  { immediate: !0 }
4995
- ), (m, f) => (T(), R("div", Nr, [
5020
+ ), (g, y) => (T(), R("div", Nr, [
4996
5021
  b("div", jr, [
4997
- f[10] || (f[10] = b("label", null, "📊 数据面板", -1)),
5022
+ y[14] || (y[14] = b("label", null, "📊 数据面板", -1)),
4998
5023
  b("div", kr, [
4999
- f[7] || (f[7] = b("span", { class: "dp-label-sm" }, "可见性", -1)),
5024
+ y[9] || (y[9] = b("span", { class: "dp-label-sm" }, "可见性", -1)),
5000
5025
  b("div", Wr, [
5001
5026
  b("label", zr, [
5002
5027
  E(b("input", {
5003
5028
  type: "checkbox",
5004
- "onUpdate:modelValue": f[0] || (f[0] = (g) => n.value = g)
5029
+ "onUpdate:modelValue": y[0] || (y[0] = (C) => n.value = C)
5005
5030
  }, null, 512), [
5006
5031
  [is, n.value]
5007
5032
  ]),
5008
- f[6] || (f[6] = b("span", { class: "dp-toggle-slider" }, null, -1))
5033
+ y[8] || (y[8] = b("span", { class: "dp-toggle-slider" }, null, -1))
5009
5034
  ]),
5010
- b("span", Gr, ie(n.value ? "显示中" : "已隐藏"), 1)
5035
+ b("span", Gr, _(n.value ? "显示中" : "已隐藏"), 1)
5011
5036
  ])
5012
5037
  ]),
5013
5038
  b("div", Fr, [
5014
- f[8] || (f[8] = b("span", { class: "dp-label-sm" }, "标题", -1)),
5039
+ y[10] || (y[10] = b("span", { class: "dp-label-sm" }, "面板宽度", -1)),
5040
+ b("div", qr, [
5041
+ E(b("input", {
5042
+ type: "range",
5043
+ class: "dp-range",
5044
+ min: "100",
5045
+ max: "1200",
5046
+ step: "10",
5047
+ "onUpdate:modelValue": y[1] || (y[1] = (C) => i.value = C)
5048
+ }, null, 512), [
5049
+ [
5050
+ H,
5051
+ i.value,
5052
+ void 0,
5053
+ { number: !0 }
5054
+ ]
5055
+ ]),
5056
+ b("span", Xr, _(i.value) + "px", 1)
5057
+ ])
5058
+ ]),
5059
+ b("div", Br, [
5060
+ y[11] || (y[11] = b("span", { class: "dp-label-sm" }, "字体大小", -1)),
5061
+ b("div", Ur, [
5062
+ E(b("input", {
5063
+ type: "range",
5064
+ class: "dp-range",
5065
+ min: "10",
5066
+ max: "50",
5067
+ step: "1",
5068
+ "onUpdate:modelValue": y[2] || (y[2] = (C) => o.value = C)
5069
+ }, null, 512), [
5070
+ [
5071
+ H,
5072
+ o.value,
5073
+ void 0,
5074
+ { number: !0 }
5075
+ ]
5076
+ ]),
5077
+ b("span", Vr, _(o.value) + "px", 1)
5078
+ ])
5079
+ ]),
5080
+ b("div", Yr, [
5081
+ y[12] || (y[12] = b("span", { class: "dp-label-sm" }, "标题", -1)),
5015
5082
  E(b("input", {
5016
5083
  type: "text",
5017
5084
  class: "dp-input",
5018
- "onUpdate:modelValue": f[1] || (f[1] = (g) => t.value = g),
5085
+ "onUpdate:modelValue": y[3] || (y[3] = (C) => t.value = C),
5019
5086
  placeholder: "面板标题"
5020
5087
  }, null, 512), [
5021
- [N, t.value]
5088
+ [H, t.value]
5022
5089
  ])
5023
5090
  ]),
5024
- b("div", qr, [
5025
- f[9] || (f[9] = b("span", { class: "dp-label-sm" }, "数据项", -1)),
5026
- b("div", Xr, [
5027
- (T(!0), R(ve, null, wt(s.value, (g, x) => (T(), R("div", {
5091
+ b("div", Kr, [
5092
+ y[13] || (y[13] = b("span", { class: "dp-label-sm" }, "数据项", -1)),
5093
+ b("div", Zr, [
5094
+ (T(!0), R(Me, null, wt(s.value, (C, x) => (T(), R("div", {
5028
5095
  key: x,
5029
5096
  class: "dp-item"
5030
5097
  }, [
5031
5098
  E(b("input", {
5032
5099
  type: "text",
5033
5100
  class: "dp-input dp-input-sm",
5034
- "onUpdate:modelValue": (C) => g.label = C,
5101
+ "onUpdate:modelValue": (w) => C.label = w,
5035
5102
  placeholder: "标签"
5036
- }, null, 8, Br), [
5037
- [N, g.label]
5103
+ }, null, 8, Qr), [
5104
+ [H, C.label]
5038
5105
  ]),
5039
5106
  E(b("input", {
5040
5107
  type: "text",
5041
5108
  class: "dp-input dp-input-sm",
5042
- "onUpdate:modelValue": (C) => g.value = C,
5109
+ "onUpdate:modelValue": (w) => C.value = w,
5043
5110
  placeholder: "值"
5044
- }, null, 8, Ur), [
5045
- [N, g.value]
5111
+ }, null, 8, Jr), [
5112
+ [H, C.value]
5046
5113
  ]),
5047
5114
  E(b("input", {
5048
5115
  type: "text",
5049
5116
  class: "dp-input dp-input-xs",
5050
- "onUpdate:modelValue": (C) => g.unit = C,
5117
+ "onUpdate:modelValue": (w) => C.unit = w,
5051
5118
  placeholder: "单位"
5052
- }, null, 8, Vr), [
5053
- [N, g.unit]
5119
+ }, null, 8, _r), [
5120
+ [H, C.unit]
5054
5121
  ]),
5055
5122
  E(b("input", {
5056
5123
  type: "text",
5057
5124
  class: "dp-input dp-input-xs",
5058
- "onUpdate:modelValue": (C) => g.code = C,
5125
+ "onUpdate:modelValue": (w) => C.code = w,
5059
5126
  placeholder: "编码"
5060
- }, null, 8, Yr), [
5061
- [N, g.code]
5127
+ }, null, 8, $r), [
5128
+ [H, C.code]
5062
5129
  ]),
5063
5130
  b("button", {
5064
5131
  class: "dp-btn dp-btn-del",
5065
- onClick: (C) => d(x),
5132
+ onClick: (w) => p(x),
5066
5133
  title: "删除此项"
5067
- }, "✕", 8, Kr)
5134
+ }, "✕", 8, ea)
5068
5135
  ]))), 128))
5069
5136
  ]),
5070
- b("div", Zr, [
5137
+ b("div", ta, [
5071
5138
  E(b("input", {
5072
5139
  type: "text",
5073
5140
  class: "dp-input dp-input-sm",
5074
- "onUpdate:modelValue": f[2] || (f[2] = (g) => i.value = g),
5141
+ "onUpdate:modelValue": y[4] || (y[4] = (C) => a.value = C),
5075
5142
  placeholder: "标签",
5076
- onKeyup: He(p, ["enter"])
5143
+ onKeyup: He(m, ["enter"])
5077
5144
  }, null, 544), [
5078
- [N, i.value]
5145
+ [H, a.value]
5079
5146
  ]),
5080
5147
  E(b("input", {
5081
5148
  type: "text",
5082
5149
  class: "dp-input dp-input-sm",
5083
- "onUpdate:modelValue": f[3] || (f[3] = (g) => o.value = g),
5150
+ "onUpdate:modelValue": y[5] || (y[5] = (C) => l.value = C),
5084
5151
  placeholder: "值",
5085
- onKeyup: He(p, ["enter"])
5152
+ onKeyup: He(m, ["enter"])
5086
5153
  }, null, 544), [
5087
- [N, o.value]
5154
+ [H, l.value]
5088
5155
  ]),
5089
5156
  E(b("input", {
5090
5157
  type: "text",
5091
5158
  class: "dp-input dp-input-xs",
5092
- "onUpdate:modelValue": f[4] || (f[4] = (g) => a.value = g),
5159
+ "onUpdate:modelValue": y[6] || (y[6] = (C) => c.value = C),
5093
5160
  placeholder: "单位",
5094
- onKeyup: He(p, ["enter"])
5161
+ onKeyup: He(m, ["enter"])
5095
5162
  }, null, 544), [
5096
- [N, a.value]
5163
+ [H, c.value]
5097
5164
  ]),
5098
5165
  E(b("input", {
5099
5166
  type: "text",
5100
5167
  class: "dp-input dp-input-xs",
5101
- "onUpdate:modelValue": f[5] || (f[5] = (g) => l.value = g),
5168
+ "onUpdate:modelValue": y[7] || (y[7] = (C) => d.value = C),
5102
5169
  placeholder: "编码",
5103
- onKeyup: He(p, ["enter"])
5170
+ onKeyup: He(m, ["enter"])
5104
5171
  }, null, 544), [
5105
- [N, l.value]
5172
+ [H, d.value]
5106
5173
  ]),
5107
5174
  b("button", {
5108
5175
  class: "dp-btn dp-btn-add",
5109
- onClick: p,
5176
+ onClick: m,
5110
5177
  title: "添加"
5111
5178
  }, "+")
5112
5179
  ])
@@ -5114,9 +5181,9 @@ const Zo = {
5114
5181
  ])
5115
5182
  ]));
5116
5183
  }
5117
- }), Jr = /* @__PURE__ */ Ie(Qr, [["__scopeId", "data-v-6ea18080"]]);
5118
- function _r(r) {
5119
- const e = j(/* @__PURE__ */ new Set()), t = (n) => {
5184
+ }), sa = /* @__PURE__ */ ye(na, [["__scopeId", "data-v-8d2c144b"]]);
5185
+ function ia(r) {
5186
+ const e = L(/* @__PURE__ */ new Set()), t = (n) => {
5120
5187
  const i = new Set(e.value);
5121
5188
  i.has(n) ? i.delete(n) : i.add(n), e.value = i;
5122
5189
  }, s = (n) => {
@@ -5127,7 +5194,7 @@ function _r(r) {
5127
5194
  i.add(o.uuid), o = o.parent;
5128
5195
  e.value = i;
5129
5196
  };
5130
- return Me(
5197
+ return de(
5131
5198
  r,
5132
5199
  (n) => {
5133
5200
  n && s(n);
@@ -5135,22 +5202,22 @@ function _r(r) {
5135
5202
  { immediate: !0 }
5136
5203
  ), { expandedSet: e, toggleExpand: t };
5137
5204
  }
5138
- const $r = {
5205
+ const oa = {
5139
5206
  key: 0,
5140
5207
  class: "property-panel"
5141
- }, ea = { class: "property-group tree-group" }, ta = { class: "tree-container" }, na = {
5208
+ }, ra = { class: "property-group tree-group" }, aa = { class: "tree-container" }, la = {
5142
5209
  key: 0,
5143
5210
  class: "tree-empty"
5144
- }, sa = { class: "property-group" }, ia = { class: "transform-mode-row" }, oa = {
5211
+ }, ca = { class: "property-group" }, ua = { class: "transform-mode-row" }, da = {
5145
5212
  key: 0,
5146
5213
  class: "tabs"
5147
- }, ra = {
5214
+ }, Aa = {
5148
5215
  key: 1,
5149
5216
  class: "tab-content"
5150
- }, aa = {
5217
+ }, ha = {
5151
5218
  key: 1,
5152
5219
  class: "property-panel empty"
5153
- }, la = /* @__PURE__ */ be({
5220
+ }, fa = /* @__PURE__ */ Ie({
5154
5221
  __name: "index",
5155
5222
  props: {
5156
5223
  transform: {},
@@ -5159,69 +5226,69 @@ const $r = {
5159
5226
  },
5160
5227
  emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
5161
5228
  setup(r, { emit: e }) {
5162
- const t = r, s = e, n = j("translate");
5163
- function i(p) {
5164
- n.value = p, s("transformModeChange", p);
5229
+ const t = r, s = e, n = L("translate");
5230
+ function i(f) {
5231
+ n.value = f, s("transformModeChange", f);
5165
5232
  }
5166
- const o = () => s("propertyChange"), a = j("transform"), l = Be(() => {
5167
- var p;
5168
- return !!(t.selectedObject && ((p = t.selectedObject.userData) != null && p._hasDataPanel));
5169
- }), c = j(0), A = os(t, "selectedObject"), { expandedSet: u, toggleExpand: h } = _r(A);
5233
+ const o = () => s("propertyChange"), a = L("transform"), l = Be(() => {
5234
+ var f;
5235
+ return !!(t.selectedObject && ((f = t.selectedObject.userData) != null && f._hasDataPanel));
5236
+ }), c = L(0), d = os(t, "selectedObject"), { expandedSet: u, toggleExpand: h } = ia(d);
5170
5237
  rs("treeExpand", { expandedSet: u, toggleExpand: h });
5171
- const d = (p) => {
5172
- c.value++, s("treeDelete", p);
5238
+ const A = (f) => {
5239
+ c.value++, s("treeDelete", f);
5173
5240
  };
5174
- return (p, m) => r.transform ? (T(), R("div", $r, [
5175
- b("div", ea, [
5176
- m[7] || (m[7] = b("label", null, "场景物体", -1)),
5177
- b("div", ta, [
5178
- (T(!0), R(ve, null, wt(r.treeData, (f) => (T(), Ke(er, {
5179
- key: f.uuid,
5180
- node: f,
5241
+ return (f, p) => r.transform ? (T(), R("div", oa, [
5242
+ b("div", ra, [
5243
+ p[7] || (p[7] = b("label", null, "场景物体", -1)),
5244
+ b("div", aa, [
5245
+ (T(!0), R(Me, null, wt(r.treeData, (m) => (T(), Ke(er, {
5246
+ key: m.uuid,
5247
+ node: m,
5181
5248
  "selected-object": r.selectedObject,
5182
5249
  version: c.value,
5183
- onSelect: m[0] || (m[0] = (g) => s("treeSelect", g)),
5184
- onDelete: d
5250
+ onSelect: p[0] || (p[0] = (g) => s("treeSelect", g)),
5251
+ onDelete: A
5185
5252
  }, null, 8, ["node", "selected-object", "version"]))), 128)),
5186
- r.treeData.length === 0 ? (T(), R("div", na, "暂无物体")) : X("", !0)
5253
+ r.treeData.length === 0 ? (T(), R("div", la, "暂无物体")) : X("", !0)
5187
5254
  ])
5188
5255
  ]),
5189
- b("div", sa, [
5190
- m[8] || (m[8] = b("label", null, "全局属性", -1)),
5191
- b("div", ia, [
5256
+ b("div", ca, [
5257
+ p[8] || (p[8] = b("label", null, "全局属性", -1)),
5258
+ b("div", ua, [
5192
5259
  b("button", {
5193
- class: se(["mode-btn", { active: n.value === "translate" }]),
5260
+ class: ie(["mode-btn", { active: n.value === "translate" }]),
5194
5261
  title: "移动 (W)",
5195
- onClick: m[1] || (m[1] = (f) => i("translate"))
5262
+ onClick: p[1] || (p[1] = (m) => i("translate"))
5196
5263
  }, " ↕ 移动 ", 2),
5197
5264
  b("button", {
5198
- class: se(["mode-btn", { active: n.value === "rotate" }]),
5265
+ class: ie(["mode-btn", { active: n.value === "rotate" }]),
5199
5266
  title: "旋转 (E)",
5200
- onClick: m[2] || (m[2] = (f) => i("rotate"))
5267
+ onClick: p[2] || (p[2] = (m) => i("rotate"))
5201
5268
  }, " ↻ 旋转 ", 2),
5202
5269
  b("button", {
5203
- class: se(["mode-btn", { active: n.value === "scale" }]),
5270
+ class: ie(["mode-btn", { active: n.value === "scale" }]),
5204
5271
  title: "缩放 (R)",
5205
- onClick: m[3] || (m[3] = (f) => i("scale"))
5272
+ onClick: p[3] || (p[3] = (m) => i("scale"))
5206
5273
  }, " ⤡ 缩放 ", 2)
5207
5274
  ])
5208
5275
  ]),
5209
- r.selectedObject ? (T(), R("div", oa, [
5276
+ r.selectedObject ? (T(), R("div", da, [
5210
5277
  b("button", {
5211
- class: se(["tab-btn", { active: a.value === "transform" }]),
5212
- onClick: m[4] || (m[4] = (f) => a.value = "transform")
5278
+ class: ie(["tab-btn", { active: a.value === "transform" }]),
5279
+ onClick: p[4] || (p[4] = (m) => a.value = "transform")
5213
5280
  }, " 🔄 变换 ", 2),
5214
5281
  b("button", {
5215
- class: se(["tab-btn", { active: a.value === "userdata" }]),
5216
- onClick: m[5] || (m[5] = (f) => a.value = "userdata")
5282
+ class: ie(["tab-btn", { active: a.value === "userdata" }]),
5283
+ onClick: p[5] || (p[5] = (m) => a.value = "userdata")
5217
5284
  }, " 📋 自定义数据 ", 2),
5218
5285
  l.value ? (T(), R("button", {
5219
5286
  key: 0,
5220
- class: se(["tab-btn", { active: a.value === "datapanel" }]),
5221
- onClick: m[6] || (m[6] = (f) => a.value = "datapanel")
5287
+ class: ie(["tab-btn", { active: a.value === "datapanel" }]),
5288
+ onClick: p[6] || (p[6] = (m) => a.value = "datapanel")
5222
5289
  }, " 📊 数据面板 ", 2)) : X("", !0)
5223
5290
  ])) : X("", !0),
5224
- r.selectedObject ? (T(), R("div", ra, [
5291
+ r.selectedObject ? (T(), R("div", Aa, [
5225
5292
  E(Dt(br, {
5226
5293
  transform: r.transform,
5227
5294
  "selected-object": r.selectedObject,
@@ -5232,62 +5299,62 @@ const $r = {
5232
5299
  E(Dt(Lr, { "selected-object": r.selectedObject }, null, 8, ["selected-object"]), [
5233
5300
  [De, a.value === "userdata"]
5234
5301
  ]),
5235
- E(Dt(Jr, { "selected-object": r.selectedObject }, null, 8, ["selected-object"]), [
5302
+ E(Dt(sa, { "selected-object": r.selectedObject }, null, 8, ["selected-object"]), [
5236
5303
  [De, a.value === "datapanel"]
5237
5304
  ])
5238
5305
  ])) : X("", !0)
5239
- ])) : (T(), R("div", aa, [...m[9] || (m[9] = [
5306
+ ])) : (T(), R("div", ha, [...p[9] || (p[9] = [
5240
5307
  b("p", null, "未选中任何模型", -1)
5241
5308
  ])]));
5242
5309
  }
5243
- }), ca = /* @__PURE__ */ Ie(la, [["__scopeId", "data-v-c92c9fa7"]]), ua = { class: "top-bar" }, Aa = { class: "left-section" }, da = { class: "dropdown-menu" }, ha = { class: "dropdown-menu sub-menu" }, fa = { class: "dropdown-menu sub-menu" }, pa = { class: "dropdown-menu" }, ma = /* @__PURE__ */ be({
5310
+ }), pa = /* @__PURE__ */ ye(fa, [["__scopeId", "data-v-c92c9fa7"]]), ma = { class: "top-bar" }, ga = { class: "left-section" }, ba = { class: "dropdown-menu" }, Ia = { class: "dropdown-menu sub-menu" }, ya = { class: "dropdown-menu sub-menu" }, Ca = { class: "dropdown-menu" }, xa = /* @__PURE__ */ Ie({
5244
5311
  __name: "TopBar",
5245
5312
  emits: ["addModel", "importModel"],
5246
5313
  setup(r, { emit: e }) {
5247
- const t = j(!1), s = j(!1), n = j(!1), i = j(!1), o = e, a = j(null), l = () => {
5248
- var m;
5249
- return (m = a.value) == null ? void 0 : m.click();
5250
- }, c = (m) => {
5251
- const f = m.target;
5252
- f.files && f.files.length > 0 && (o("importModel", f.files[0]), f.value = "");
5253
- }, A = () => console.log("撤销"), u = () => console.log("删除物体"), h = async () => {
5254
- const m = Ki();
5255
- console.log(JSON.parse(await m));
5256
- }, d = () => {
5314
+ const t = L(!1), s = L(!1), n = L(!1), i = L(!1), o = e, a = L(null), l = () => {
5315
+ var p;
5316
+ return (p = a.value) == null ? void 0 : p.click();
5317
+ }, c = (p) => {
5318
+ const m = p.target;
5319
+ m.files && m.files.length > 0 && (o("importModel", m.files[0]), m.value = "");
5320
+ }, d = () => console.log("撤销"), u = () => console.log("删除物体"), h = async () => {
5321
+ const p = Ki();
5322
+ console.log(JSON.parse(await p));
5323
+ }, A = () => {
5257
5324
  if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
5258
5325
  Ei(localStorage.getItem("test_id"));
5259
- }, p = () => qn();
5260
- return (m, f) => (T(), R("div", ua, [
5261
- b("div", Aa, [
5326
+ }, f = () => qn();
5327
+ return (p, m) => (T(), R("div", ma, [
5328
+ b("div", ga, [
5262
5329
  b("div", {
5263
5330
  class: "dropdown-wrapper",
5264
- onMouseenter: f[9] || (f[9] = (g) => s.value = !0),
5265
- onMouseleave: f[10] || (f[10] = (g) => s.value = !1)
5331
+ onMouseenter: m[9] || (m[9] = (g) => s.value = !0),
5332
+ onMouseleave: m[10] || (m[10] = (g) => s.value = !1)
5266
5333
  }, [
5267
- f[15] || (f[15] = b("button", { class: "menu-btn" }, "添加", -1)),
5268
- E(b("div", da, [
5334
+ m[15] || (m[15] = b("button", { class: "menu-btn" }, "添加", -1)),
5335
+ E(b("div", ba, [
5269
5336
  b("div", {
5270
5337
  class: "menu-item",
5271
- onClick: A
5338
+ onClick: d
5272
5339
  }, "组"),
5273
5340
  b("div", {
5274
5341
  class: "menu-item dropdown-wrapper sub-trigger",
5275
- onMouseenter: f[3] || (f[3] = (g) => n.value = !0),
5276
- onMouseleave: f[4] || (f[4] = (g) => n.value = !1)
5342
+ onMouseenter: m[3] || (m[3] = (g) => n.value = !0),
5343
+ onMouseleave: m[4] || (m[4] = (g) => n.value = !1)
5277
5344
  }, [
5278
- f[13] || (f[13] = b("span", null, "网格", -1)),
5279
- E(b("div", ha, [
5345
+ m[13] || (m[13] = b("span", null, "网格", -1)),
5346
+ E(b("div", Ia, [
5280
5347
  b("div", {
5281
5348
  class: "menu-item",
5282
- onClick: f[0] || (f[0] = (g) => o("addModel", "box"))
5349
+ onClick: m[0] || (m[0] = (g) => o("addModel", "box"))
5283
5350
  }, " 正方体 "),
5284
5351
  b("div", {
5285
5352
  class: "menu-item",
5286
- onClick: f[1] || (f[1] = (g) => o("addModel", "sphere"))
5353
+ onClick: m[1] || (m[1] = (g) => o("addModel", "sphere"))
5287
5354
  }, " 球体 "),
5288
5355
  b("div", {
5289
5356
  class: "menu-item",
5290
- onClick: f[2] || (f[2] = (g) => o("addModel", "waterPlane"))
5357
+ onClick: m[2] || (m[2] = (g) => o("addModel", "waterPlane"))
5291
5358
  }, " 水面 "),
5292
5359
  b("div", {
5293
5360
  class: "menu-item",
@@ -5299,14 +5366,14 @@ const $r = {
5299
5366
  ], 32),
5300
5367
  b("div", {
5301
5368
  class: "menu-item dropdown-wrapper sub-trigger",
5302
- onMouseenter: f[6] || (f[6] = (g) => i.value = !0),
5303
- onMouseleave: f[7] || (f[7] = (g) => i.value = !1)
5369
+ onMouseenter: m[6] || (m[6] = (g) => i.value = !0),
5370
+ onMouseleave: m[7] || (m[7] = (g) => i.value = !1)
5304
5371
  }, [
5305
- f[14] || (f[14] = b("span", null, "光源", -1)),
5306
- E(b("div", fa, [
5372
+ m[14] || (m[14] = b("span", null, "光源", -1)),
5373
+ E(b("div", ya, [
5307
5374
  b("div", {
5308
5375
  class: "menu-item",
5309
- onClick: f[5] || (f[5] = (g) => o("addModel", "directionalLight"))
5376
+ onClick: m[5] || (m[5] = (g) => o("addModel", "directionalLight"))
5310
5377
  }, " 平行光 ")
5311
5378
  ], 512), [
5312
5379
  [De, i.value]
@@ -5318,7 +5385,7 @@ const $r = {
5318
5385
  }, "摄像机"),
5319
5386
  b("div", {
5320
5387
  class: "menu-item",
5321
- onClick: f[8] || (f[8] = (g) => o("addModel", "dataPanel"))
5388
+ onClick: m[8] || (m[8] = (g) => o("addModel", "dataPanel"))
5322
5389
  }, " 数据面板 ")
5323
5390
  ], 512), [
5324
5391
  [De, s.value]
@@ -5326,29 +5393,29 @@ const $r = {
5326
5393
  ], 32),
5327
5394
  b("div", {
5328
5395
  class: "dropdown-wrapper",
5329
- onMouseenter: f[11] || (f[11] = (g) => t.value = !0),
5330
- onMouseleave: f[12] || (f[12] = (g) => t.value = !1)
5396
+ onMouseenter: m[11] || (m[11] = (g) => t.value = !0),
5397
+ onMouseleave: m[12] || (m[12] = (g) => t.value = !1)
5331
5398
  }, [
5332
- f[16] || (f[16] = b("button", { class: "menu-btn" }, "帮助", -1)),
5333
- E(b("div", pa, [
5399
+ m[16] || (m[16] = b("button", { class: "menu-btn" }, "帮助", -1)),
5400
+ E(b("div", Ca, [
5334
5401
  b("div", {
5335
5402
  class: "menu-item",
5336
5403
  onClick: h
5337
5404
  }, "获取场景"),
5338
5405
  b("div", {
5339
5406
  class: "menu-item",
5340
- onClick: d
5407
+ onClick: A
5341
5408
  }, "镜头拉近"),
5342
5409
  b("div", {
5343
5410
  class: "menu-item",
5344
- onClick: p
5411
+ onClick: f
5345
5412
  }, " 重置相机位置 ")
5346
5413
  ], 512), [
5347
5414
  [De, t.value]
5348
5415
  ])
5349
5416
  ], 32)
5350
5417
  ]),
5351
- f[17] || (f[17] = b("div", { class: "right-section" }, [
5418
+ m[17] || (m[17] = b("div", { class: "right-section" }, [
5352
5419
  b("span", { class: "app-title" }, "3D 模型编辑器")
5353
5420
  ], -1)),
5354
5421
  b("input", {
@@ -5361,10 +5428,10 @@ const $r = {
5361
5428
  }, null, 544)
5362
5429
  ]));
5363
5430
  }
5364
- }), ga = /* @__PURE__ */ Ie(ma, [["__scopeId", "data-v-45df3361"]]), ba = { class: "bottom-bar" }, Ia = /* @__PURE__ */ be({
5431
+ }), wa = /* @__PURE__ */ ye(xa, [["__scopeId", "data-v-45df3361"]]), va = { class: "bottom-bar" }, Ma = /* @__PURE__ */ Ie({
5365
5432
  __name: "BottomBar",
5366
5433
  setup(r) {
5367
- return (e, t) => (T(), R("div", ba, [...t[0] || (t[0] = [
5434
+ return (e, t) => (T(), R("div", va, [...t[0] || (t[0] = [
5368
5435
  b("div", { class: "status-left" }, [
5369
5436
  b("span", null, "就绪")
5370
5437
  ], -1),
@@ -5373,17 +5440,17 @@ const $r = {
5373
5440
  ], -1)
5374
5441
  ])]));
5375
5442
  }
5376
- }), ya = /* @__PURE__ */ Ie(Ia, [["__scopeId", "data-v-3427bb27"]]), Ca = { class: "app-layout" }, xa = {
5443
+ }), Da = /* @__PURE__ */ ye(Ma, [["__scopeId", "data-v-3427bb27"]]), Pa = { class: "app-layout" }, Ta = {
5377
5444
  key: 0,
5378
5445
  class: "loading-overlay"
5379
- }, wa = /* @__PURE__ */ be({
5446
+ }, Oa = /* @__PURE__ */ Ie({
5380
5447
  __name: "DrawingBoard",
5381
5448
  props: {
5382
5449
  mode: { default: "edit" },
5383
5450
  sceneData: { default: null }
5384
5451
  },
5385
5452
  setup(r) {
5386
- const e = r, t = j(!1);
5453
+ const e = r, t = L(!1);
5387
5454
  Ti((g) => {
5388
5455
  t.value = g;
5389
5456
  });
@@ -5417,64 +5484,64 @@ const $r = {
5417
5484
  }, l = (g) => Yo(g), c = async (g) => {
5418
5485
  try {
5419
5486
  await Vo(g);
5420
- } catch (x) {
5421
- console.error("导入失败:", x), alert("导入失败:" + x.message);
5487
+ } catch (y) {
5488
+ console.error("导入失败:", y), alert("导入失败:" + y.message);
5422
5489
  }
5423
- }, A = $t([]);
5490
+ }, d = $t([]);
5424
5491
  Bi((g) => {
5425
- A.value = g;
5492
+ d.value = g;
5426
5493
  });
5427
5494
  const u = () => {
5428
5495
  const g = Ui();
5429
- g && (A.value = g);
5430
- }, h = (g) => Qt(g), d = (g) => Wi(g.uuid), p = (g) => {
5496
+ g && (d.value = g);
5497
+ }, h = (g) => Qt(g), A = (g) => Wi(g.uuid), f = (g) => {
5431
5498
  Oi(g);
5432
- }, m = j(null), f = () => {
5433
- m.value && Ii(m.value, e.mode, e.sceneData), u();
5499
+ }, p = L(null), m = () => {
5500
+ p.value && Ii(p.value, e.mode, e.sceneData), u();
5434
5501
  };
5435
5502
  return as(() => {
5436
- f(), m.value && fi(m.value);
5503
+ m(), p.value && fi(p.value);
5437
5504
  }), ls(() => {
5438
5505
  console.log("endset_three_editor destroy"), Qi();
5439
- }), (g, x) => (T(), R("div", Ca, [
5440
- t.value ? (T(), R("div", xa, [...x[0] || (x[0] = [
5506
+ }), (g, y) => (T(), R("div", Pa, [
5507
+ t.value ? (T(), R("div", Ta, [...y[0] || (y[0] = [
5441
5508
  b("div", { class: "loading-spinner" }, null, -1),
5442
5509
  b("div", { class: "loading-text" }, "加载中...", -1)
5443
5510
  ])])) : X("", !0),
5444
- r.mode === "edit" ? (T(), Ke(ga, {
5511
+ r.mode === "edit" ? (T(), Ke(wa, {
5445
5512
  key: 1,
5446
5513
  onAddModel: l,
5447
5514
  onImportModel: c
5448
5515
  })) : X("", !0),
5449
5516
  b("div", {
5450
- class: se(`editor-container editor-container-mode-${r.mode}`)
5517
+ class: ie(`editor-container editor-container-mode-${r.mode}`)
5451
5518
  }, [
5452
5519
  b("div", {
5453
- class: se(`canvas canvas-mode-${r.mode}`),
5520
+ class: ie(`canvas canvas-mode-${r.mode}`),
5454
5521
  ref_key: "containerRef",
5455
- ref: m
5522
+ ref: p
5456
5523
  }, null, 2),
5457
- r.mode === "edit" ? (T(), Ke(ca, {
5524
+ r.mode === "edit" ? (T(), Ke(pa, {
5458
5525
  key: 0,
5459
5526
  transform: n,
5460
- "tree-data": A.value,
5527
+ "tree-data": d.value,
5461
5528
  "selected-object": s.value,
5462
5529
  onPropertyChange: a,
5463
5530
  onTreeSelect: h,
5464
- onTreeDelete: d,
5465
- onTransformModeChange: p
5531
+ onTreeDelete: A,
5532
+ onTransformModeChange: f
5466
5533
  }, null, 8, ["transform", "tree-data", "selected-object"])) : X("", !0)
5467
5534
  ], 2),
5468
- r.mode === "edit" ? (T(), Ke(ya, { key: 2 })) : X("", !0)
5535
+ r.mode === "edit" ? (T(), Ke(Da, { key: 2 })) : X("", !0)
5469
5536
  ]));
5470
5537
  }
5471
- }), Sa = /* @__PURE__ */ Ie(wa, [["__scopeId", "data-v-ffa5f5c1"]]);
5538
+ }), Wa = /* @__PURE__ */ ye(Oa, [["__scopeId", "data-v-ffa5f5c1"]]);
5472
5539
  export {
5473
- ya as BottomBar,
5540
+ Da as BottomBar,
5474
5541
  Gn as DataPanel,
5475
- Sa as DrawingBoard,
5476
- ca as PropertyPanel,
5477
- ga as TopBar,
5542
+ Wa as DrawingBoard,
5543
+ pa as PropertyPanel,
5544
+ wa as TopBar,
5478
5545
  er as TreeItem,
5479
5546
  qo as addBox,
5480
5547
  Ko as addDataPanel,
@@ -5488,11 +5555,11 @@ export {
5488
5555
  gi as disposeCSS2DRenderer,
5489
5556
  Ki as exportSceneToJSON,
5490
5557
  Hi as focusOnObject,
5491
- Ta as getCSS2DRenderer,
5558
+ La as getCSS2DRenderer,
5492
5559
  Yi as getCamera,
5493
5560
  Zt as getDataPanel,
5494
- Ra as getRenderer,
5495
- Ea as getScene,
5561
+ ka as getRenderer,
5562
+ ja as getScene,
5496
5563
  Ui as getSceneObjects,
5497
5564
  Vi as getSelectedObject,
5498
5565
  Vo as importModelFromFile,
@@ -5512,7 +5579,7 @@ export {
5512
5579
  qi as setSelectedObjectCallback,
5513
5580
  Xi as setTransformChangeCallback,
5514
5581
  Oi as setTransformMode,
5515
- Oa as updateDataPanelValue,
5516
- _r as useTreeExpand
5582
+ Na as updateDataPanelValue,
5583
+ ia as useTreeExpand
5517
5584
  };
5518
5585
  //# sourceMappingURL=three-editor.es.js.map