@shopware-ag/dive 2.2.30 → 2.2.31

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.
Files changed (28) hide show
  1. package/build/chunks/{AssetCache-DqR9MuYr.cjs → AssetCache-USoLeA8n.cjs} +1 -1
  2. package/build/chunks/{AssetCache-BAVgjwZD.mjs → AssetCache-Yaezy697.mjs} +1 -1
  3. package/build/chunks/{AssetLoader-DYfC6o4E.mjs → AssetLoader-CWm-aunM.mjs} +3 -3
  4. package/build/chunks/{AssetLoader-ULFVz0k1.cjs → AssetLoader-CxWzLiHn.cjs} +1 -1
  5. package/build/chunks/{FileTypes-DvYQDBRG.cjs → FileTypes-D3vblaAa.cjs} +1 -1
  6. package/build/chunks/{FileTypes-Bf6fWggQ.mjs → FileTypes-qgM3TaRh.mjs} +1 -1
  7. package/build/chunks/{isFileTypeSupported-DRAnF6K8.mjs → isFileTypeSupported-CGTPFOhi.mjs} +1 -1
  8. package/build/chunks/{isFileTypeSupported-rlWKlVtV.cjs → isFileTypeSupported-uAFXvyzy.cjs} +1 -1
  9. package/build/dive.cjs +1 -1
  10. package/build/dive.mjs +2 -2
  11. package/build/plugins/ar/index.cjs +1 -1
  12. package/build/plugins/ar/index.mjs +1 -1
  13. package/build/plugins/assetcache/index.cjs +1 -1
  14. package/build/plugins/assetcache/index.mjs +1 -1
  15. package/build/plugins/assetloader/index.cjs +1 -1
  16. package/build/plugins/assetloader/index.mjs +1 -1
  17. package/build/plugins/orbitcontroller/index.cjs +1 -1
  18. package/build/plugins/orbitcontroller/index.mjs +1 -1
  19. package/build/plugins/orientationdisplay/index.cjs +1 -1
  20. package/build/plugins/orientationdisplay/index.mjs +1 -1
  21. package/build/plugins/quickview/index.cjs +1 -1
  22. package/build/plugins/quickview/index.mjs +1 -1
  23. package/build/plugins/state/index.cjs +1 -1
  24. package/build/plugins/state/index.mjs +1 -1
  25. package/build/plugins/toolbox/index.cjs +1 -1
  26. package/build/plugins/toolbox/index.mjs +339 -313
  27. package/build/plugins/toolbox/src/transform/TransformTool.d.ts +18 -2
  28. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- var Xt = Object.defineProperty;
2
- var Yt = (h, t, e) => t in h ? Xt(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
- var o = (h, t, e) => Yt(h, typeof t != "symbol" ? t + "" : t, e);
4
- import { Object3D as lt, Vector3 as l, Quaternion as E, Raycaster as ot, MeshBasicMaterial as Dt, LineBasicMaterial as jt, CylinderGeometry as w, BoxGeometry as f, BufferGeometry as dt, Float32BufferAttribute as pt, Mesh as r, OctahedronGeometry as tt, Line as A, TorusGeometry as Q, SphereGeometry as kt, Euler as Qt, Matrix4 as Et, PlaneGeometry as Ot, DoubleSide as Rt, Vector2 as F, Layers as _t } from "three";
5
- import "../../chunks/FileTypes-Bf6fWggQ.mjs";
1
+ var Ht = Object.defineProperty;
2
+ var Xt = (l, e, t) => e in l ? Ht(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
+ var o = (l, e, t) => Xt(l, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Object3D as ht, Vector3 as h, Quaternion as E, Raycaster as ot, MeshBasicMaterial as Dt, LineBasicMaterial as kt, CylinderGeometry as w, BoxGeometry as f, BufferGeometry as dt, Float32BufferAttribute as pt, Mesh as r, OctahedronGeometry as tt, Line as A, TorusGeometry as Q, SphereGeometry as Yt, Euler as Qt, Matrix4 as Et, PlaneGeometry as Ot, DoubleSide as Rt, EventDispatcher as Zt, Vector2 as F, Layers as _t } from "three";
5
+ import "../../chunks/FileTypes-qgM3TaRh.mjs";
6
6
  import { P as G, U as W } from "../../chunks/PerspectiveCamera-BFzE2TQU.mjs";
7
7
  import { f as B, i as O } from "../../chunks/findInterface-DbJ5qzbc.mjs";
8
8
  import { A as ut, a as gt, b as ft } from "../../chunks/AxisHelperColors-JLBHYQDi.mjs";
9
- class Zt {
9
+ class Gt {
10
10
  constructor() {
11
11
  o(this, "_selected", null);
12
12
  o(this, "_listeners", /* @__PURE__ */ new Set());
@@ -21,29 +21,29 @@ class Zt {
21
21
  * Select an object. Deselects any previously selected object.
22
22
  * Calls onSelect on the new object and onDeselect on the previous.
23
23
  */
24
- select(t) {
25
- var e, i, n;
26
- this._selected !== t && (this._selected && ((i = (e = this._selected).onDeselect) == null || i.call(e)), this._selected = t, (n = t.onSelect) == null || n.call(t), this.notifyListeners());
24
+ select(e) {
25
+ var t, i, n;
26
+ this._selected !== e && (this._selected && ((i = (t = this._selected).onDeselect) == null || i.call(t)), this._selected = e, (n = e.onSelect) == null || n.call(e), this.notifyListeners());
27
27
  }
28
28
  /**
29
29
  * Deselect the currently selected object.
30
30
  * Calls onDeselect on the object.
31
31
  */
32
32
  deselect() {
33
- var t, e;
34
- this._selected && ((e = (t = this._selected).onDeselect) == null || e.call(t), this._selected = null, this.notifyListeners());
33
+ var e, t;
34
+ this._selected && ((t = (e = this._selected).onDeselect) == null || t.call(e), this._selected = null, this.notifyListeners());
35
35
  }
36
36
  /**
37
37
  * Register a callback to be notified when selection changes.
38
38
  */
39
- onChange(t) {
40
- this._listeners.add(t);
39
+ onChange(e) {
40
+ this._listeners.add(e);
41
41
  }
42
42
  /**
43
43
  * Unregister a previously registered callback.
44
44
  */
45
- offChange(t) {
46
- this._listeners.delete(t);
45
+ offChange(e) {
46
+ this._listeners.delete(e);
47
47
  }
48
48
  /**
49
49
  * Dispose of the selection state and clear all listeners.
@@ -52,11 +52,11 @@ class Zt {
52
52
  this._selected = null, this._listeners.clear();
53
53
  }
54
54
  notifyListeners() {
55
- for (const t of this._listeners)
56
- t(this._selected);
55
+ for (const e of this._listeners)
56
+ e(this._selected);
57
57
  }
58
58
  }
59
- class Gt {
59
+ class Wt {
60
60
  constructor() {
61
61
  o(this, "name", "hover");
62
62
  o(this, "priority", 20);
@@ -72,37 +72,37 @@ class Gt {
72
72
  this._hovered = null;
73
73
  }
74
74
  onDeactivate() {
75
- var t, e;
76
- this._hovered && ((e = (t = this._hovered).onPointerLeave) == null || e.call(t), this._hovered = null);
75
+ var e, t;
76
+ this._hovered && ((t = (e = this._hovered).onPointerLeave) == null || t.call(e), this._hovered = null);
77
77
  }
78
- onPointerMove(t) {
78
+ onPointerMove(e) {
79
79
  var n, a, s, c, u, P, M;
80
- const e = t.modelIntersects[0], i = B(
81
- e == null ? void 0 : e.object,
80
+ const t = e.modelIntersects[0], i = B(
81
+ t == null ? void 0 : t.object,
82
82
  "isHoverable"
83
83
  );
84
- if (e && i) {
84
+ if (t && i) {
85
85
  if (!this._hovered) {
86
- (n = i.onPointerEnter) == null || n.call(i, e), this._hovered = i;
86
+ (n = i.onPointerEnter) == null || n.call(i, t), this._hovered = i;
87
87
  return;
88
88
  }
89
89
  if (this._hovered.uuid !== i.uuid) {
90
- (s = (a = this._hovered).onPointerLeave) == null || s.call(a), (c = i.onPointerEnter) == null || c.call(i, e), this._hovered = i;
90
+ (s = (a = this._hovered).onPointerLeave) == null || s.call(a), (c = i.onPointerEnter) == null || c.call(i, t), this._hovered = i;
91
91
  return;
92
92
  }
93
- (u = i.onPointerOver) == null || u.call(i, e);
93
+ (u = i.onPointerOver) == null || u.call(i, t);
94
94
  return;
95
95
  }
96
96
  this._hovered && ((M = (P = this._hovered).onPointerLeave) == null || M.call(P), this._hovered = null);
97
97
  }
98
98
  }
99
- const he = (h) => h.name === "select";
100
- class Wt {
101
- constructor(t) {
99
+ const ce = (l) => l.name === "select";
100
+ class qt {
101
+ constructor(e) {
102
102
  o(this, "name", "select");
103
103
  o(this, "priority", 30);
104
104
  o(this, "_selectionState");
105
- this._selectionState = t;
105
+ this._selectionState = e;
106
106
  }
107
107
  /**
108
108
  * Get the currently selected object.
@@ -114,12 +114,12 @@ class Wt {
114
114
  }
115
115
  onDeactivate() {
116
116
  }
117
- onClick(t) {
118
- const e = t.modelIntersects[0], i = B(
119
- e == null ? void 0 : e.object,
117
+ onClick(e) {
118
+ const t = e.modelIntersects[0], i = B(
119
+ t == null ? void 0 : t.object,
120
120
  "isSelectable"
121
121
  );
122
- if (!e || !i) {
122
+ if (!t || !i) {
123
123
  this._selectionState.deselect();
124
124
  return;
125
125
  }
@@ -129,8 +129,8 @@ class Wt {
129
129
  /**
130
130
  * Programmatically select an object.
131
131
  */
132
- select(t) {
133
- this._selectionState.select(t);
132
+ select(e) {
133
+ this._selectionState.select(e);
134
134
  }
135
135
  /**
136
136
  * Programmatically deselect the current selection.
@@ -139,87 +139,87 @@ class Wt {
139
139
  this._selectionState.deselect();
140
140
  }
141
141
  }
142
- const L = new ot(), _ = new l(), C = new l(), p = new E(), mt = {
143
- X: new l(1, 0, 0),
144
- Y: new l(0, 1, 0),
145
- Z: new l(0, 0, 1)
142
+ const j = new ot(), _ = new h(), C = new h(), p = new E(), mt = {
143
+ X: new h(1, 0, 0),
144
+ Y: new h(0, 1, 0),
145
+ Z: new h(0, 0, 1)
146
146
  }, rt = { type: "change" }, wt = { type: "mouseDown" }, yt = { type: "mouseUp", mode: null }, bt = { type: "objectChange" };
147
- class qt extends lt {
148
- constructor(t, e) {
149
- super(), e === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), e = document), this.isTransformControls = !0, this.visible = !1, this.domElement = e, this.domElement.style.touchAction = "none";
150
- const i = new Kt();
147
+ class Ut extends ht {
148
+ constructor(e, t) {
149
+ super(), t === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), t = document), this.isTransformControls = !0, this.visible = !1, this.domElement = t, this.domElement.style.touchAction = "none";
150
+ const i = new $t();
151
151
  this._gizmo = i, this.add(i);
152
- const n = new $t();
152
+ const n = new Jt();
153
153
  this._plane = n, this.add(n);
154
154
  const a = this;
155
155
  function s(g, b) {
156
- let X = b;
156
+ let H = b;
157
157
  Object.defineProperty(a, g, {
158
158
  get: function() {
159
- return X !== void 0 ? X : b;
159
+ return H !== void 0 ? H : b;
160
160
  },
161
161
  set: function(z) {
162
- X !== z && (X = z, n[g] = z, i[g] = z, a.dispatchEvent({ type: g + "-changed", value: z }), a.dispatchEvent(rt));
162
+ H !== z && (H = z, n[g] = z, i[g] = z, a.dispatchEvent({ type: g + "-changed", value: z }), a.dispatchEvent(rt));
163
163
  }
164
164
  }), a[g] = b, n[g] = b, i[g] = b;
165
165
  }
166
- s("camera", t), s("object", void 0), s("enabled", !0), s("axis", null), s("mode", "translate"), s("translationSnap", null), s("rotationSnap", null), s("scaleSnap", null), s("space", "world"), s("size", 1), s("dragging", !1), s("showX", !0), s("showY", !0), s("showZ", !0);
167
- const c = new l(), u = new l(), P = new E(), M = new E(), j = new l(), k = new E(), ht = new l(), V = new l(), x = new l(), I = 0, S = new l();
168
- s("worldPosition", c), s("worldPositionStart", u), s("worldQuaternion", P), s("worldQuaternionStart", M), s("cameraPosition", j), s("cameraQuaternion", k), s("pointStart", ht), s("pointEnd", V), s("rotationAxis", x), s("rotationAngle", I), s("eye", S), this._offset = new l(), this._startNorm = new l(), this._endNorm = new l(), this._cameraScale = new l(), this._parentPosition = new l(), this._parentQuaternion = new E(), this._parentQuaternionInv = new E(), this._parentScale = new l(), this._worldScaleStart = new l(), this._worldQuaternionInv = new E(), this._worldScale = new l(), this._positionStart = new l(), this._quaternionStart = new E(), this._scaleStart = new l(), this._getPointer = Ut.bind(this), this._onPointerDown = Bt.bind(this), this._onPointerHover = Ft.bind(this), this._onPointerMove = Vt.bind(this), this._onPointerUp = Nt.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
166
+ s("camera", e), s("object", void 0), s("enabled", !0), s("axis", null), s("mode", "translate"), s("translationSnap", null), s("rotationSnap", null), s("scaleSnap", null), s("space", "world"), s("size", 1), s("dragging", !1), s("showX", !0), s("showY", !0), s("showZ", !0);
167
+ const c = new h(), u = new h(), P = new E(), M = new E(), k = new h(), Y = new E(), lt = new h(), V = new h(), x = new h(), I = 0, S = new h();
168
+ s("worldPosition", c), s("worldPositionStart", u), s("worldQuaternion", P), s("worldQuaternionStart", M), s("cameraPosition", k), s("cameraQuaternion", Y), s("pointStart", lt), s("pointEnd", V), s("rotationAxis", x), s("rotationAngle", I), s("eye", S), this._offset = new h(), this._startNorm = new h(), this._endNorm = new h(), this._cameraScale = new h(), this._parentPosition = new h(), this._parentQuaternion = new E(), this._parentQuaternionInv = new E(), this._parentScale = new h(), this._worldScaleStart = new h(), this._worldQuaternionInv = new E(), this._worldScale = new h(), this._positionStart = new h(), this._quaternionStart = new E(), this._scaleStart = new h(), this._getPointer = Ft.bind(this), this._onPointerDown = Vt.bind(this), this._onPointerHover = Bt.bind(this), this._onPointerMove = Nt.bind(this), this._onPointerUp = Kt.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
169
169
  }
170
170
  // updateMatrixWorld updates key transformation variables
171
- updateMatrixWorld(t) {
172
- this.object !== void 0 && (this.object.updateMatrixWorld(), this.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : this.object.parent.matrixWorld.decompose(this._parentPosition, this._parentQuaternion, this._parentScale), this.object.matrixWorld.decompose(this.worldPosition, this.worldQuaternion, this._worldScale), this._parentQuaternionInv.copy(this._parentQuaternion).invert(), this._worldQuaternionInv.copy(this.worldQuaternion).invert()), this.camera.updateMatrixWorld(), this.camera.matrixWorld.decompose(this.cameraPosition, this.cameraQuaternion, this._cameraScale), this.camera.isOrthographicCamera ? this.camera.getWorldDirection(this.eye).negate() : this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(), super.updateMatrixWorld(t);
171
+ updateMatrixWorld(e) {
172
+ this.object !== void 0 && (this.object.updateMatrixWorld(), this.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : this.object.parent.matrixWorld.decompose(this._parentPosition, this._parentQuaternion, this._parentScale), this.object.matrixWorld.decompose(this.worldPosition, this.worldQuaternion, this._worldScale), this._parentQuaternionInv.copy(this._parentQuaternion).invert(), this._worldQuaternionInv.copy(this.worldQuaternion).invert()), this.camera.updateMatrixWorld(), this.camera.matrixWorld.decompose(this.cameraPosition, this.cameraQuaternion, this._cameraScale), this.camera.isOrthographicCamera ? this.camera.getWorldDirection(this.eye).negate() : this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(), super.updateMatrixWorld(e);
173
173
  }
174
- pointerHover(t) {
174
+ pointerHover(e) {
175
175
  if (this.object === void 0 || this.dragging === !0) return;
176
- t !== null && L.setFromCamera(t, this.camera);
177
- const e = at(this._gizmo.picker[this.mode], L);
178
- e ? this.axis = e.object.name : this.axis = null;
179
- }
180
- pointerDown(t) {
181
- if (!(this.object === void 0 || this.dragging === !0 || t != null && t.button !== 0) && this.axis !== null) {
182
- t !== null && L.setFromCamera(t, this.camera);
183
- const e = at(this._plane, L, !0);
184
- e && (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(e.point).sub(this.worldPositionStart)), this.dragging = !0, wt.mode = this.mode, this.dispatchEvent(wt);
176
+ e !== null && j.setFromCamera(e, this.camera);
177
+ const t = at(this._gizmo.picker[this.mode], j);
178
+ t ? this.axis = t.object.name : this.axis = null;
179
+ }
180
+ pointerDown(e) {
181
+ if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
182
+ e !== null && j.setFromCamera(e, this.camera);
183
+ const t = at(this._plane, j, !0);
184
+ 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, wt.mode = this.mode, this.dispatchEvent(wt);
185
185
  }
186
186
  }
187
- pointerMove(t) {
188
- const e = this.axis, i = this.mode, n = this.object;
187
+ pointerMove(e) {
188
+ const t = this.axis, i = this.mode, n = this.object;
189
189
  let a = this.space;
190
- if (i === "scale" ? a = "local" : (e === "E" || e === "XYZE" || e === "XYZ") && (a = "world"), n === void 0 || e === null || this.dragging === !1 || t !== null && t.button !== -1) return;
191
- t !== null && L.setFromCamera(t, this.camera);
192
- const s = at(this._plane, L, !0);
190
+ if (i === "scale" ? a = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (a = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
191
+ e !== null && j.setFromCamera(e, this.camera);
192
+ const s = at(this._plane, j, !0);
193
193
  if (s) {
194
194
  if (this.pointEnd.copy(s.point).sub(this.worldPositionStart), i === "translate")
195
- this._offset.copy(this.pointEnd).sub(this.pointStart), a === "local" && e !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), e.indexOf("X") === -1 && (this._offset.x = 0), e.indexOf("Y") === -1 && (this._offset.y = 0), e.indexOf("Z") === -1 && (this._offset.z = 0), a === "local" && e !== "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 && (a === "local" && (n.position.applyQuaternion(p.copy(this._quaternionStart).invert()), e.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), e.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), e.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), a === "world" && (n.parent && n.position.add(_.setFromMatrixPosition(n.parent.matrixWorld)), e.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), e.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), e.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(_.setFromMatrixPosition(n.parent.matrixWorld))));
195
+ this._offset.copy(this.pointEnd).sub(this.pointStart), a === "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), a === "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 && (a === "local" && (n.position.applyQuaternion(p.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)), a === "world" && (n.parent && n.position.add(_.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(_.setFromMatrixPosition(n.parent.matrixWorld))));
196
196
  else if (i === "scale") {
197
- if (e.search("XYZ") !== -1) {
197
+ if (t.search("XYZ") !== -1) {
198
198
  let c = this.pointEnd.length() / this.pointStart.length();
199
199
  this.pointEnd.dot(this.pointStart) < 0 && (c *= -1), C.set(c, c, c);
200
200
  } else
201
- _.copy(this.pointStart), C.copy(this.pointEnd), _.applyQuaternion(this._worldQuaternionInv), C.applyQuaternion(this._worldQuaternionInv), C.divide(_), e.search("X") === -1 && (C.x = 1), e.search("Y") === -1 && (C.y = 1), e.search("Z") === -1 && (C.z = 1);
202
- n.scale.copy(this._scaleStart).multiply(C), this.scaleSnap && (e.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), e.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), e.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
201
+ _.copy(this.pointStart), C.copy(this.pointEnd), _.applyQuaternion(this._worldQuaternionInv), C.applyQuaternion(this._worldQuaternionInv), C.divide(_), t.search("X") === -1 && (C.x = 1), t.search("Y") === -1 && (C.y = 1), t.search("Z") === -1 && (C.z = 1);
202
+ n.scale.copy(this._scaleStart).multiply(C), 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));
203
203
  } else if (i === "rotate") {
204
204
  this._offset.copy(this.pointEnd).sub(this.pointStart);
205
205
  const c = 20 / this.worldPosition.distanceTo(_.setFromMatrixPosition(this.camera.matrixWorld));
206
206
  let u = !1;
207
- e === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(_.copy(this.rotationAxis).cross(this.eye)) * c) : (e === "X" || e === "Y" || e === "Z") && (this.rotationAxis.copy(mt[e]), _.copy(mt[e]), a === "local" && _.applyQuaternion(this.worldQuaternion), _.cross(this.eye), _.length() === 0 ? u = !0 : this.rotationAngle = this._offset.dot(_.normalize()) * c), (e === "E" || u) && (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), a === "local" && e !== "E" && e !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(p.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(p.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
207
+ t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(_.copy(this.rotationAxis).cross(this.eye)) * c) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(mt[t]), _.copy(mt[t]), a === "local" && _.applyQuaternion(this.worldQuaternion), _.cross(this.eye), _.length() === 0 ? u = !0 : this.rotationAngle = this._offset.dot(_.normalize()) * c), (t === "E" || u) && (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), a === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(p.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(p.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
208
208
  }
209
209
  this.dispatchEvent(rt), this.dispatchEvent(bt);
210
210
  }
211
211
  }
212
- pointerUp(t) {
213
- t !== null && t.button !== 0 || (this.dragging && this.axis !== null && (yt.mode = this.mode, this.dispatchEvent(yt)), this.dragging = !1, this.axis = null);
212
+ pointerUp(e) {
213
+ e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (yt.mode = this.mode, this.dispatchEvent(yt)), this.dragging = !1, this.axis = null);
214
214
  }
215
215
  dispose() {
216
- this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(t) {
217
- t.geometry && t.geometry.dispose(), t.material && t.material.dispose();
216
+ this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(e) {
217
+ e.geometry && e.geometry.dispose(), e.material && e.material.dispose();
218
218
  });
219
219
  }
220
220
  // Set current object
221
- attach(t) {
222
- return this.object = t, this.visible = !0, this;
221
+ attach(e) {
222
+ return this.object = e, this.visible = !0, this;
223
223
  }
224
224
  // Detach from object
225
225
  detach() {
@@ -229,109 +229,109 @@ class qt extends lt {
229
229
  this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(rt), this.dispatchEvent(bt), this.pointStart.copy(this.pointEnd));
230
230
  }
231
231
  getRaycaster() {
232
- return L;
232
+ return j;
233
233
  }
234
234
  // TODO: deprecate
235
235
  getMode() {
236
236
  return this.mode;
237
237
  }
238
- setMode(t) {
239
- this.mode = t;
238
+ setMode(e) {
239
+ this.mode = e;
240
240
  }
241
- setTranslationSnap(t) {
242
- this.translationSnap = t;
241
+ setTranslationSnap(e) {
242
+ this.translationSnap = e;
243
243
  }
244
- setRotationSnap(t) {
245
- this.rotationSnap = t;
244
+ setRotationSnap(e) {
245
+ this.rotationSnap = e;
246
246
  }
247
- setScaleSnap(t) {
248
- this.scaleSnap = t;
247
+ setScaleSnap(e) {
248
+ this.scaleSnap = e;
249
249
  }
250
- setSize(t) {
251
- this.size = t;
250
+ setSize(e) {
251
+ this.size = e;
252
252
  }
253
- setSpace(t) {
254
- this.space = t;
253
+ setSpace(e) {
254
+ this.space = e;
255
255
  }
256
256
  }
257
- function Ut(h) {
257
+ function Ft(l) {
258
258
  if (this.domElement.ownerDocument.pointerLockElement)
259
259
  return {
260
260
  x: 0,
261
261
  y: 0,
262
- button: h.button
262
+ button: l.button
263
263
  };
264
264
  {
265
- const t = this.domElement.getBoundingClientRect();
265
+ const e = this.domElement.getBoundingClientRect();
266
266
  return {
267
- x: (h.clientX - t.left) / t.width * 2 - 1,
268
- y: -(h.clientY - t.top) / t.height * 2 + 1,
269
- button: h.button
267
+ x: (l.clientX - e.left) / e.width * 2 - 1,
268
+ y: -(l.clientY - e.top) / e.height * 2 + 1,
269
+ button: l.button
270
270
  };
271
271
  }
272
272
  }
273
- function Ft(h) {
273
+ function Bt(l) {
274
274
  if (this.enabled)
275
- switch (h.pointerType) {
275
+ switch (l.pointerType) {
276
276
  case "mouse":
277
277
  case "pen":
278
- this.pointerHover(this._getPointer(h));
278
+ this.pointerHover(this._getPointer(l));
279
279
  break;
280
280
  }
281
281
  }
282
- function Bt(h) {
283
- this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(h.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(h)), this.pointerDown(this._getPointer(h)));
282
+ function Vt(l) {
283
+ this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(l.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(l)), this.pointerDown(this._getPointer(l)));
284
284
  }
285
- function Vt(h) {
286
- this.enabled && this.pointerMove(this._getPointer(h));
285
+ function Nt(l) {
286
+ this.enabled && this.pointerMove(this._getPointer(l));
287
287
  }
288
- function Nt(h) {
289
- this.enabled && (this.domElement.releasePointerCapture(h.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(h)));
288
+ function Kt(l) {
289
+ this.enabled && (this.domElement.releasePointerCapture(l.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(l)));
290
290
  }
291
- function at(h, t, e) {
292
- const i = t.intersectObject(h, !0);
291
+ function at(l, e, t) {
292
+ const i = e.intersectObject(l, !0);
293
293
  for (let n = 0; n < i.length; n++)
294
- if (i[n].object.visible || e)
294
+ if (i[n].object.visible || t)
295
295
  return i[n];
296
296
  return !1;
297
297
  }
298
- const et = new Qt(), d = new l(0, 1, 0), vt = new l(0, 0, 0), Pt = new Et(), it = new E(), nt = new E(), D = new l(), St = new Et(), q = new l(1, 0, 0), H = new l(0, 1, 0), U = new l(0, 0, 1), st = new l(), R = new l(), Z = new l();
299
- class Kt extends lt {
298
+ const et = new Qt(), d = new h(0, 1, 0), vt = new h(0, 0, 0), Pt = new Et(), it = new E(), nt = new E(), D = new h(), St = new Et(), q = new h(1, 0, 0), L = new h(0, 1, 0), U = new h(0, 0, 1), st = new h(), R = new h(), Z = new h();
299
+ class $t extends ht {
300
300
  constructor() {
301
301
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
302
- const t = new Dt({
302
+ const e = new Dt({
303
303
  depthTest: !1,
304
304
  depthWrite: !1,
305
305
  fog: !1,
306
306
  toneMapped: !1,
307
307
  transparent: !0
308
- }), e = new jt({
308
+ }), t = new kt({
309
309
  depthTest: !1,
310
310
  depthWrite: !1,
311
311
  fog: !1,
312
312
  toneMapped: !1,
313
313
  transparent: !0
314
- }), i = t.clone();
314
+ }), i = e.clone();
315
315
  i.opacity = 0.15;
316
- const n = e.clone();
316
+ const n = t.clone();
317
317
  n.opacity = 0.5;
318
- const a = t.clone();
318
+ const a = e.clone();
319
319
  a.color.setHex(16711680);
320
- const s = t.clone();
320
+ const s = e.clone();
321
321
  s.color.setHex(65280);
322
- const c = t.clone();
322
+ const c = e.clone();
323
323
  c.color.setHex(255);
324
- const u = t.clone();
324
+ const u = e.clone();
325
325
  u.color.setHex(16711680), u.opacity = 0.5;
326
- const P = t.clone();
326
+ const P = e.clone();
327
327
  P.color.setHex(65280), P.opacity = 0.5;
328
- const M = t.clone();
328
+ const M = e.clone();
329
329
  M.color.setHex(255), M.opacity = 0.5;
330
- const j = t.clone();
331
- j.opacity = 0.25;
332
- const k = t.clone();
333
- k.color.setHex(16776960), k.opacity = 0.25, t.clone().color.setHex(16776960);
334
- const V = t.clone();
330
+ const k = e.clone();
331
+ k.opacity = 0.25;
332
+ const Y = e.clone();
333
+ Y.color.setHex(16776960), Y.opacity = 0.25, e.clone().color.setHex(16776960);
334
+ const V = e.clone();
335
335
  V.color.setHex(7895160);
336
336
  const x = new w(0, 0.04, 0.1, 12);
337
337
  x.translate(0, 0.05, 0);
@@ -345,7 +345,7 @@ class Kt extends lt {
345
345
  const v = new Q(y, 75e-4, 3, 64, N * Math.PI * 2);
346
346
  return v.rotateY(Math.PI / 2), v.rotateX(Math.PI / 2), v;
347
347
  }
348
- function X() {
348
+ function H() {
349
349
  const y = new dt();
350
350
  return y.setAttribute("position", new pt([0, 0, 0, 1, 1, 1], 3)), y;
351
351
  }
@@ -366,7 +366,7 @@ class Kt extends lt {
366
366
  [new r(g, c), null, [Math.PI / 2, 0, 0]]
367
367
  ],
368
368
  XYZ: [
369
- [new r(new tt(0.1, 0), j.clone()), [0, 0, 0]]
369
+ [new r(new tt(0.1, 0), k.clone()), [0, 0, 0]]
370
370
  ],
371
371
  XY: [
372
372
  [new r(new f(0.15, 0.15, 0.01), M.clone()), [0.15, 0.15, 0]]
@@ -410,7 +410,7 @@ class Kt extends lt {
410
410
  [new r(new tt(0.01, 2), n), null, null, null, "helper"]
411
411
  ],
412
412
  DELTA: [
413
- [new A(X(), n), null, null, null, "helper"]
413
+ [new A(H(), n), null, null, null, "helper"]
414
414
  ],
415
415
  X: [
416
416
  [new A(S, n.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
@@ -435,7 +435,7 @@ class Kt extends lt {
435
435
  [new r(b(0.5, 0.5), c), null, [0, Math.PI / 2, 0]]
436
436
  ],
437
437
  E: [
438
- [new r(b(0.75, 1), k), null, [0, Math.PI / 2, 0]]
438
+ [new r(b(0.75, 1), Y), null, [0, Math.PI / 2, 0]]
439
439
  ]
440
440
  }, Tt = {
441
441
  AXIS: [
@@ -443,7 +443,7 @@ class Kt extends lt {
443
443
  ]
444
444
  }, At = {
445
445
  XYZE: [
446
- [new r(new kt(0.25, 10, 8), i)]
446
+ [new r(new Yt(0.25, 10, 8), i)]
447
447
  ],
448
448
  X: [
449
449
  [new r(new Q(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
@@ -483,7 +483,7 @@ class Kt extends lt {
483
483
  [new r(new f(0.15, 0.15, 0.01), P), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
484
484
  ],
485
485
  XYZ: [
486
- [new r(new f(0.1, 0.1, 0.1), j.clone())]
486
+ [new r(new f(0.1, 0.1, 0.1), k.clone())]
487
487
  ]
488
488
  }, zt = {
489
489
  X: [
@@ -510,7 +510,7 @@ class Kt extends lt {
510
510
  XYZ: [
511
511
  [new r(new f(0.2, 0.2, 0.2), i), [0, 0, 0]]
512
512
  ]
513
- }, Lt = {
513
+ }, jt = {
514
514
  X: [
515
515
  [new A(S, n.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
516
516
  ],
@@ -522,20 +522,20 @@ class Kt extends lt {
522
522
  ]
523
523
  };
524
524
  function T(y) {
525
- const N = new lt();
525
+ const N = new ht();
526
526
  for (const v in y)
527
- for (let Y = y[v].length; Y--; ) {
528
- const m = y[v][Y][0].clone(), K = y[v][Y][1], $ = y[v][Y][2], J = y[v][Y][3], Ht = y[v][Y][4];
529
- m.name = v, m.tag = Ht, K && m.position.set(K[0], K[1], K[2]), $ && m.rotation.set($[0], $[1], $[2]), J && m.scale.set(J[0], J[1], J[2]), m.updateMatrix();
527
+ for (let X = y[v].length; X--; ) {
528
+ const m = y[v][X][0].clone(), K = y[v][X][1], $ = y[v][X][2], J = y[v][X][3], Lt = y[v][X][4];
529
+ m.name = v, m.tag = Lt, K && m.position.set(K[0], K[1], K[2]), $ && m.rotation.set($[0], $[1], $[2]), J && m.scale.set(J[0], J[1], J[2]), m.updateMatrix();
530
530
  const ct = m.geometry.clone();
531
531
  ct.applyMatrix4(m.matrix), m.geometry = ct, m.renderOrder = 1 / 0, m.position.set(0, 0, 0), m.rotation.set(0, 0, 0), m.scale.set(1, 1, 1), N.add(m);
532
532
  }
533
533
  return N;
534
534
  }
535
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = T(z)), this.add(this.gizmo.rotate = T(It)), this.add(this.gizmo.scale = T(Ct)), this.add(this.picker.translate = T(Mt)), this.add(this.picker.rotate = T(At)), this.add(this.picker.scale = T(zt)), this.add(this.helper.translate = T(xt)), this.add(this.helper.rotate = T(Tt)), this.add(this.helper.scale = T(Lt)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
535
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = T(z)), this.add(this.gizmo.rotate = T(It)), this.add(this.gizmo.scale = T(Ct)), this.add(this.picker.translate = T(Mt)), this.add(this.picker.rotate = T(At)), this.add(this.picker.scale = T(zt)), this.add(this.helper.translate = T(xt)), this.add(this.helper.rotate = T(Tt)), this.add(this.helper.scale = T(jt)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
536
536
  }
537
537
  // updateMatrixWorld will update transformations and appearance of individual handles
538
- updateMatrixWorld(t) {
538
+ updateMatrixWorld(e) {
539
539
  const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : nt;
540
540
  this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
541
541
  let n = [];
@@ -545,26 +545,26 @@ class Kt extends lt {
545
545
  s.visible = !0, s.rotation.set(0, 0, 0), s.position.copy(this.worldPosition);
546
546
  let c;
547
547
  if (this.camera.isOrthographicCamera ? c = (this.camera.top - this.camera.bottom) / this.camera.zoom : c = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), s.scale.set(1, 1, 1).multiplyScalar(c * this.size / 4), s.tag === "helper") {
548
- s.visible = !1, s.name === "AXIS" ? (s.visible = !!this.axis, this.axis === "X" && (p.setFromEuler(et.set(0, 0, 0)), s.quaternion.copy(i).multiply(p), Math.abs(d.copy(q).applyQuaternion(i).dot(this.eye)) > 0.9 && (s.visible = !1)), this.axis === "Y" && (p.setFromEuler(et.set(0, 0, Math.PI / 2)), s.quaternion.copy(i).multiply(p), Math.abs(d.copy(H).applyQuaternion(i).dot(this.eye)) > 0.9 && (s.visible = !1)), this.axis === "Z" && (p.setFromEuler(et.set(0, Math.PI / 2, 0)), s.quaternion.copy(i).multiply(p), Math.abs(d.copy(U).applyQuaternion(i).dot(this.eye)) > 0.9 && (s.visible = !1)), this.axis === "XYZE" && (p.setFromEuler(et.set(0, Math.PI / 2, 0)), d.copy(this.rotationAxis), s.quaternion.setFromRotationMatrix(Pt.lookAt(vt, d, H)), s.quaternion.multiply(p), s.visible = this.dragging), this.axis === "E" && (s.visible = !1)) : s.name === "START" ? (s.position.copy(this.worldPositionStart), s.visible = this.dragging) : s.name === "END" ? (s.position.copy(this.worldPosition), s.visible = this.dragging) : s.name === "DELTA" ? (s.position.copy(this.worldPositionStart), s.quaternion.copy(this.worldQuaternionStart), _.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), _.applyQuaternion(this.worldQuaternionStart.clone().invert()), s.scale.copy(_), s.visible = this.dragging) : (s.quaternion.copy(i), this.dragging ? s.position.copy(this.worldPositionStart) : s.position.copy(this.worldPosition), this.axis && (s.visible = this.axis.search(s.name) !== -1));
548
+ s.visible = !1, s.name === "AXIS" ? (s.visible = !!this.axis, this.axis === "X" && (p.setFromEuler(et.set(0, 0, 0)), s.quaternion.copy(i).multiply(p), Math.abs(d.copy(q).applyQuaternion(i).dot(this.eye)) > 0.9 && (s.visible = !1)), this.axis === "Y" && (p.setFromEuler(et.set(0, 0, Math.PI / 2)), s.quaternion.copy(i).multiply(p), Math.abs(d.copy(L).applyQuaternion(i).dot(this.eye)) > 0.9 && (s.visible = !1)), this.axis === "Z" && (p.setFromEuler(et.set(0, Math.PI / 2, 0)), s.quaternion.copy(i).multiply(p), Math.abs(d.copy(U).applyQuaternion(i).dot(this.eye)) > 0.9 && (s.visible = !1)), this.axis === "XYZE" && (p.setFromEuler(et.set(0, Math.PI / 2, 0)), d.copy(this.rotationAxis), s.quaternion.setFromRotationMatrix(Pt.lookAt(vt, d, L)), s.quaternion.multiply(p), s.visible = this.dragging), this.axis === "E" && (s.visible = !1)) : s.name === "START" ? (s.position.copy(this.worldPositionStart), s.visible = this.dragging) : s.name === "END" ? (s.position.copy(this.worldPosition), s.visible = this.dragging) : s.name === "DELTA" ? (s.position.copy(this.worldPositionStart), s.quaternion.copy(this.worldQuaternionStart), _.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), _.applyQuaternion(this.worldQuaternionStart.clone().invert()), s.scale.copy(_), s.visible = this.dragging) : (s.quaternion.copy(i), this.dragging ? s.position.copy(this.worldPositionStart) : s.position.copy(this.worldPosition), this.axis && (s.visible = this.axis.search(s.name) !== -1));
549
549
  continue;
550
550
  }
551
- s.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (s.name === "X" && Math.abs(d.copy(q).applyQuaternion(i).dot(this.eye)) > 0.99 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "Y" && Math.abs(d.copy(H).applyQuaternion(i).dot(this.eye)) > 0.99 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "Z" && Math.abs(d.copy(U).applyQuaternion(i).dot(this.eye)) > 0.99 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "XY" && Math.abs(d.copy(U).applyQuaternion(i).dot(this.eye)) < 0.2 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "YZ" && Math.abs(d.copy(q).applyQuaternion(i).dot(this.eye)) < 0.2 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "XZ" && Math.abs(d.copy(H).applyQuaternion(i).dot(this.eye)) < 0.2 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1)) : this.mode === "rotate" && (it.copy(i), d.copy(this.eye).applyQuaternion(p.copy(i).invert()), s.name.search("E") !== -1 && s.quaternion.setFromRotationMatrix(Pt.lookAt(this.eye, vt, H)), s.name === "X" && (p.setFromAxisAngle(q, Math.atan2(-d.y, d.z)), p.multiplyQuaternions(it, p), s.quaternion.copy(p)), s.name === "Y" && (p.setFromAxisAngle(H, Math.atan2(d.x, d.z)), p.multiplyQuaternions(it, p), s.quaternion.copy(p)), s.name === "Z" && (p.setFromAxisAngle(U, Math.atan2(d.y, d.x)), p.multiplyQuaternions(it, p), s.quaternion.copy(p))), s.visible = s.visible && (s.name.indexOf("X") === -1 || this.showX), s.visible = s.visible && (s.name.indexOf("Y") === -1 || this.showY), s.visible = s.visible && (s.name.indexOf("Z") === -1 || this.showZ), s.visible = s.visible && (s.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), s.material._color = s.material._color || s.material.color.clone(), s.material._opacity = s.material._opacity || s.material.opacity, s.material.color.copy(s.material._color), s.material.opacity = s.material._opacity, this.enabled && this.axis && (s.name === this.axis || this.axis.split("").some(function(u) {
551
+ s.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (s.name === "X" && Math.abs(d.copy(q).applyQuaternion(i).dot(this.eye)) > 0.99 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "Y" && Math.abs(d.copy(L).applyQuaternion(i).dot(this.eye)) > 0.99 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "Z" && Math.abs(d.copy(U).applyQuaternion(i).dot(this.eye)) > 0.99 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "XY" && Math.abs(d.copy(U).applyQuaternion(i).dot(this.eye)) < 0.2 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "YZ" && Math.abs(d.copy(q).applyQuaternion(i).dot(this.eye)) < 0.2 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1), s.name === "XZ" && Math.abs(d.copy(L).applyQuaternion(i).dot(this.eye)) < 0.2 && (s.scale.set(1e-10, 1e-10, 1e-10), s.visible = !1)) : this.mode === "rotate" && (it.copy(i), d.copy(this.eye).applyQuaternion(p.copy(i).invert()), s.name.search("E") !== -1 && s.quaternion.setFromRotationMatrix(Pt.lookAt(this.eye, vt, L)), s.name === "X" && (p.setFromAxisAngle(q, Math.atan2(-d.y, d.z)), p.multiplyQuaternions(it, p), s.quaternion.copy(p)), s.name === "Y" && (p.setFromAxisAngle(L, Math.atan2(d.x, d.z)), p.multiplyQuaternions(it, p), s.quaternion.copy(p)), s.name === "Z" && (p.setFromAxisAngle(U, Math.atan2(d.y, d.x)), p.multiplyQuaternions(it, p), s.quaternion.copy(p))), s.visible = s.visible && (s.name.indexOf("X") === -1 || this.showX), s.visible = s.visible && (s.name.indexOf("Y") === -1 || this.showY), s.visible = s.visible && (s.name.indexOf("Z") === -1 || this.showZ), s.visible = s.visible && (s.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), s.material._color = s.material._color || s.material.color.clone(), s.material._opacity = s.material._opacity || s.material.opacity, s.material.color.copy(s.material._color), s.material.opacity = s.material._opacity, this.enabled && this.axis && (s.name === this.axis || this.axis.split("").some(function(u) {
552
552
  return s.name === u;
553
553
  })) && (s.material.color.setHex(16776960), s.material.opacity = 1);
554
554
  }
555
- super.updateMatrixWorld(t);
555
+ super.updateMatrixWorld(e);
556
556
  }
557
557
  }
558
- class $t extends r {
558
+ class Jt extends r {
559
559
  constructor() {
560
560
  super(
561
561
  new Ot(1e5, 1e5, 2, 2),
562
562
  new Dt({ visible: !1, wireframe: !0, side: Rt, transparent: !0, opacity: 0.1, toneMapped: !1 })
563
563
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
564
564
  }
565
- updateMatrixWorld(t) {
566
- let e = this.space;
567
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (e = "local"), st.copy(q).applyQuaternion(e === "local" ? this.worldQuaternion : nt), R.copy(H).applyQuaternion(e === "local" ? this.worldQuaternion : nt), Z.copy(U).applyQuaternion(e === "local" ? this.worldQuaternion : nt), d.copy(R), this.mode) {
565
+ updateMatrixWorld(e) {
566
+ let t = this.space;
567
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), st.copy(q).applyQuaternion(t === "local" ? this.worldQuaternion : nt), R.copy(L).applyQuaternion(t === "local" ? this.worldQuaternion : nt), Z.copy(U).applyQuaternion(t === "local" ? this.worldQuaternion : nt), d.copy(R), this.mode) {
568
568
  case "translate":
569
569
  case "scale":
570
570
  switch (this.axis) {
@@ -596,12 +596,13 @@ class $t extends r {
596
596
  default:
597
597
  D.set(0, 0, 0);
598
598
  }
599
- D.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (St.lookAt(_.set(0, 0, 0), D, d), this.quaternion.setFromRotationMatrix(St)), super.updateMatrixWorld(t);
599
+ D.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (St.lookAt(_.set(0, 0, 0), D, d), this.quaternion.setFromRotationMatrix(St)), super.updateMatrixWorld(e);
600
600
  }
601
601
  }
602
- const ce = (h) => h.name === "transform";
603
- class Jt {
604
- constructor(t, e, i) {
602
+ const de = (l) => l.name === "transform";
603
+ class te extends Zt {
604
+ constructor(t, i, n) {
605
+ super();
605
606
  o(this, "name", "transform");
606
607
  o(this, "priority", 5);
607
608
  o(this, "_scene");
@@ -611,7 +612,7 @@ class Jt {
611
612
  o(this, "_scaleLinked", !1);
612
613
  o(this, "_gizmoVisible", !0);
613
614
  o(this, "_selectionChangeHandler");
614
- this._scene = t, this._controller = e, this._selectionState = i, this._gizmo = this.initGizmo(), this._scene.add(this._gizmo), this._selectionChangeHandler = this.onSelectionChange.bind(this);
615
+ this._scene = t, this._controller = i, this._selectionState = n, this._gizmo = this.initGizmo(), this._scene.add(this._gizmo), this._selectionChangeHandler = this.onSelectionChange.bind(this);
615
616
  }
616
617
  /**
617
618
  * Get the TransformControls gizmo.
@@ -635,7 +636,7 @@ class Jt {
635
636
  }
636
637
  onPointerMove(t) {
637
638
  if (this._gizmo.dragging || t.uiIntersects.length > 0 && t.uiIntersects.some(
638
- (i) => this.isGizmoChild(i.object)
639
+ (n) => this.isGizmoChild(n.object)
639
640
  ))
640
641
  return !0;
641
642
  }
@@ -650,8 +651,8 @@ class Jt {
650
651
  */
651
652
  setGizmoVisible(t) {
652
653
  this._gizmoVisible = t;
653
- const e = this._scene.children.includes(this._gizmo);
654
- t && !e ? (this._scene.add(this._gizmo), this._gizmo.getRaycaster().layers.enableAll()) : !t && e && (this._scene.remove(this._gizmo), this._gizmo.getRaycaster().layers.disableAll());
654
+ const i = this._scene.children.includes(this._gizmo);
655
+ t && !i ? (this._scene.add(this._gizmo), this._gizmo.getRaycaster().layers.enableAll()) : !t && i && (this._scene.remove(this._gizmo), this._gizmo.getRaycaster().layers.disableAll());
655
656
  }
656
657
  /**
657
658
  * Set whether scale operations are linked (uniform scaling).
@@ -673,40 +674,65 @@ class Jt {
673
674
  O(t, "isMovable") && (this._gizmo.attach(t), this.setGizmoVisible(t.visible && this._gizmoVisible));
674
675
  }
675
676
  isGizmoChild(t) {
676
- let e = t;
677
- for (; e; ) {
678
- if (e === this._gizmo) return !0;
679
- e = e.parent;
677
+ let i = t;
678
+ for (; i; ) {
679
+ if (i === this._gizmo) return !0;
680
+ i = i.parent;
680
681
  }
681
682
  return !1;
682
683
  }
683
684
  initGizmo() {
684
- const t = new qt(
685
+ const t = new Ut(
685
686
  this._controller.object,
686
687
  this._controller.domElement
687
688
  );
688
- return t.mode = "translate", t.traverse((e) => {
689
- if (!("isMesh" in e)) return;
690
- const i = e.material;
691
- e.name === "X" && i.color.set(ut), e.name === "Y" && i.color.set(gt), e.name === "Z" && i.color.set(ft), e.name === "XY" && i.color.set(ft), e.name === "YZ" && i.color.set(ut), e.name === "XZ" && i.color.set(gt);
689
+ return t.mode = "translate", t.traverse((i) => {
690
+ if (!("isMesh" in i)) return;
691
+ const n = i.material;
692
+ i.name === "X" && n.color.set(ut), i.name === "Y" && n.color.set(gt), i.name === "Z" && n.color.set(ft), i.name === "XY" && n.color.set(ft), i.name === "YZ" && n.color.set(ut), i.name === "XZ" && n.color.set(gt);
692
693
  }), t.addEventListener("mouseDown", () => {
693
- var e, i;
694
- this._controller.enabled = !1, O(t.object, "isMovable") && ((i = (e = t.object).onMoveStart) == null || i.call(e));
694
+ var i, n;
695
+ this._controller.enabled = !1, O(t.object, "isMovable") && ((n = (i = t.object).onMoveStart) == null || n.call(i));
695
696
  }), t.addEventListener("objectChange", () => {
696
- var e, i;
697
- if (O(t.object, "isMovable") && ((i = (e = t.object).onMove) == null || i.call(e), this._scaleLinked && t.object)) {
698
- const n = t.object.scale, a = (n.x + n.y + n.z) / 3;
699
- t.object.scale.set(a, a, a);
697
+ var i, n;
698
+ if (O(t.object, "isMovable")) {
699
+ if ((n = (i = t.object).onMove) == null || n.call(i), this._scaleLinked && t.object) {
700
+ const a = t.object.scale, s = (a.x + a.y + a.z) / 3;
701
+ t.object.scale.set(s, s, s);
702
+ }
703
+ switch (this.dispatchEvent({
704
+ type: "object-change",
705
+ object: t.object
706
+ }), t.mode) {
707
+ case "translate":
708
+ this.dispatchEvent({
709
+ type: "object-position-change",
710
+ object: t.object
711
+ });
712
+ break;
713
+ case "rotate":
714
+ this.dispatchEvent({
715
+ type: "object-rotation-change",
716
+ object: t.object
717
+ });
718
+ break;
719
+ case "scale":
720
+ this.dispatchEvent({
721
+ type: "object-scale-change",
722
+ object: t.object
723
+ });
724
+ break;
725
+ }
700
726
  }
701
727
  }), t.addEventListener("mouseUp", () => {
702
- var e, i;
703
- this._controller.enabled = !0, O(t.object, "isMovable") && ((i = (e = t.object).onMoveEnd) == null || i.call(e));
728
+ var i, n;
729
+ this._controller.enabled = !0, O(t.object, "isMovable") && ((n = (i = t.object).onMoveEnd) == null || n.call(i));
704
730
  }), t;
705
731
  }
706
732
  }
707
- const te = 1e-3;
708
- class ee {
709
- constructor(t) {
733
+ const ee = 1e-3;
734
+ class ie {
735
+ constructor(e) {
710
736
  o(this, "name", "drag");
711
737
  o(this, "priority", 10);
712
738
  o(this, "_controller");
@@ -714,13 +740,13 @@ class ee {
714
740
  // Drag state
715
741
  o(this, "_dragging", !1);
716
742
  o(this, "_draggable", null);
717
- o(this, "_dragStart", new l());
718
- o(this, "_dragCurrent", new l());
719
- o(this, "_dragEnd", new l());
720
- o(this, "_dragDelta", new l());
743
+ o(this, "_dragStart", new h());
744
+ o(this, "_dragCurrent", new h());
745
+ o(this, "_dragEnd", new h());
746
+ o(this, "_dragDelta", new h());
721
747
  // Custom raycast targets for drag plane
722
748
  o(this, "_dragRaycastTargets", null);
723
- this._controller = t, this._raycaster = new ot();
749
+ this._controller = e, this._raycaster = new ot();
724
750
  }
725
751
  /**
726
752
  * Whether a drag operation is currently in progress.
@@ -740,19 +766,19 @@ class ee {
740
766
  onDeactivate() {
741
767
  this._dragging && this._draggable && this.endDrag(), this.resetDragState();
742
768
  }
743
- onPointerDown(t) {
744
- var e;
745
- t.pointerPrimaryDown && (this._draggable = B(
746
- (e = t.intersects[0]) == null ? void 0 : e.object,
769
+ onPointerDown(e) {
770
+ var t;
771
+ e.pointerPrimaryDown && (this._draggable = B(
772
+ (t = e.intersects[0]) == null ? void 0 : t.object,
747
773
  "isDraggable"
748
774
  ) || null);
749
775
  }
750
- onPointerMove(t) {
751
- if (t.pointerPrimaryDown && this._draggable && (this._raycaster.setFromCamera(t.pointer, this._controller.object), this._dragging || t.lastPointerDown.distanceTo(t.pointer) > te && this.startDrag(t), this._dragging))
752
- return this.updateDrag(t), !0;
776
+ onPointerMove(e) {
777
+ if (e.pointerPrimaryDown && this._draggable && (this._raycaster.setFromCamera(e.pointer, this._controller.object), this._dragging || e.lastPointerDown.distanceTo(e.pointer) > ee && this.startDrag(e), this._dragging))
778
+ return this.updateDrag(e), !0;
753
779
  }
754
- onPointerUp(t) {
755
- this._dragging && (this._raycaster.setFromCamera(t.pointer, this._controller.object), this.endDrag()), this._draggable = null;
780
+ onPointerUp(e) {
781
+ this._dragging && (this._raycaster.setFromCamera(e.pointer, this._controller.object), this.endDrag()), this._draggable = null;
756
782
  }
757
783
  /**
758
784
  * Set custom objects to raycast against during drag.
@@ -760,30 +786,30 @@ class ee {
760
786
  *
761
787
  * @param targets Objects to raycast against, or null to use scene objects
762
788
  */
763
- setDragRaycastTargets(t) {
764
- this._dragRaycastTargets = t;
789
+ setDragRaycastTargets(e) {
790
+ this._dragRaycastTargets = e;
765
791
  }
766
792
  // ============ Private Methods ============
767
- startDrag(t) {
793
+ startDrag(e) {
768
794
  var i, n;
769
- const e = this.getDragIntersect(t);
770
- e && (this._dragStart.copy(e.point), this._dragCurrent.copy(e.point), this._dragEnd.copy(e.point), this._dragDelta.set(0, 0, 0), (n = (i = this._draggable) == null ? void 0 : i.onDragStart) == null || n.call(i, this.createDragEvent()), this._dragging = !0, this._controller.enabled = !1);
795
+ const t = this.getDragIntersect(e);
796
+ t && (this._dragStart.copy(t.point), this._dragCurrent.copy(t.point), this._dragEnd.copy(t.point), this._dragDelta.set(0, 0, 0), (n = (i = this._draggable) == null ? void 0 : i.onDragStart) == null || n.call(i, this.createDragEvent()), this._dragging = !0, this._controller.enabled = !1);
771
797
  }
772
- updateDrag(t) {
798
+ updateDrag(e) {
773
799
  var i, n;
774
- const e = this.getDragIntersect(t);
775
- e && (this._dragCurrent.copy(e.point), this._dragEnd.copy(e.point), this._dragDelta.subVectors(this._dragCurrent, this._dragStart), (n = (i = this._draggable) == null ? void 0 : i.onDrag) == null || n.call(i, this.createDragEvent()));
800
+ const t = this.getDragIntersect(e);
801
+ t && (this._dragCurrent.copy(t.point), this._dragEnd.copy(t.point), this._dragDelta.subVectors(this._dragCurrent, this._dragStart), (n = (i = this._draggable) == null ? void 0 : i.onDrag) == null || n.call(i, this.createDragEvent()));
776
802
  }
777
803
  endDrag() {
778
- var e, i;
779
- const t = this.createDragEvent();
780
- (i = (e = this._draggable) == null ? void 0 : e.onDragEnd) == null || i.call(e, t), this._dragging = !1, this._controller.enabled = !0, this.resetDragState();
804
+ var t, i;
805
+ const e = this.createDragEvent();
806
+ (i = (t = this._draggable) == null ? void 0 : t.onDragEnd) == null || i.call(t, e), this._dragging = !1, this._controller.enabled = !0, this.resetDragState();
781
807
  }
782
- getDragIntersect(t) {
808
+ getDragIntersect(e) {
783
809
  return this._dragRaycastTargets ? this._raycaster.intersectObjects(
784
810
  this._dragRaycastTargets,
785
811
  !0
786
- )[0] || null : t.intersects[0] || null;
812
+ )[0] || null : e.intersects[0] || null;
787
813
  }
788
814
  createDragEvent() {
789
815
  return {
@@ -797,9 +823,9 @@ class ee {
797
823
  this._dragStart.set(0, 0, 0), this._dragCurrent.set(0, 0, 0), this._dragEnd.set(0, 0, 0), this._dragDelta.set(0, 0, 0);
798
824
  }
799
825
  }
800
- const ie = 1e-3;
801
- class de {
802
- constructor(t, e) {
826
+ const se = 1e-3;
827
+ class pe {
828
+ constructor(e, t) {
803
829
  o(this, "_scene");
804
830
  o(this, "_controller");
805
831
  o(this, "_canvas");
@@ -824,22 +850,22 @@ class de {
824
850
  o(this, "_boundPointerDown");
825
851
  o(this, "_boundPointerUp");
826
852
  o(this, "_boundWheel");
827
- this._scene = t, this._controller = e, this._canvas = e.domElement, this._selectionState = new Zt(), this._raycaster = new ot(), this._pointer = new F(), this._lastPointerDown = new F(), this._productLayerMask = new _t(), this._productLayerMask.set(Math.log2(G)), this._uiLayerMask = new _t(), this._uiLayerMask.set(Math.log2(W)), this._tools = /* @__PURE__ */ new Map([
853
+ this._scene = e, this._controller = t, this._canvas = t.domElement, this._selectionState = new Gt(), this._raycaster = new ot(), this._pointer = new F(), this._lastPointerDown = new F(), this._productLayerMask = new _t(), this._productLayerMask.set(Math.log2(G)), this._uiLayerMask = new _t(), this._uiLayerMask.set(Math.log2(W)), this._tools = /* @__PURE__ */ new Map([
828
854
  [
829
855
  "hover",
830
- new Gt()
856
+ new Wt()
831
857
  ],
832
858
  [
833
859
  "select",
834
- new Wt(this._selectionState)
860
+ new qt(this._selectionState)
835
861
  ],
836
862
  [
837
863
  "transform",
838
- new Jt(t, e, this._selectionState)
864
+ new te(e, t, this._selectionState)
839
865
  ],
840
866
  [
841
867
  "drag",
842
- new ee(e)
868
+ new ie(t)
843
869
  ]
844
870
  ]), this._boundPointerMove = this.onPointerMove.bind(this), this._boundPointerDown = this.onPointerDown.bind(this), this._boundPointerUp = this.onPointerUp.bind(this), this._boundWheel = this.onWheel.bind(this), this._canvas.addEventListener("pointermove", this._boundPointerMove), this._canvas.addEventListener("pointerdown", this._boundPointerDown), this._canvas.addEventListener("pointerup", this._boundPointerUp), this._canvas.addEventListener("wheel", this._boundWheel);
845
871
  }
@@ -849,30 +875,30 @@ class de {
849
875
  /**
850
876
  * Enable a tool by type.
851
877
  */
852
- enableTool(t) {
878
+ enableTool(e) {
853
879
  var i;
854
- const e = this._tools.get(t);
855
- e && (this._activeTools.has(t) || (this._activeTools.set(t, e), this.updateSortedTools(), (i = e.onActivate) == null || i.call(e)));
880
+ const t = this._tools.get(e);
881
+ t && (this._activeTools.has(e) || (this._activeTools.set(e, t), this.updateSortedTools(), (i = t.onActivate) == null || i.call(t)));
856
882
  }
857
883
  /**
858
884
  * Disable an active tool by type.
859
885
  */
860
- disableTool(t) {
886
+ disableTool(e) {
861
887
  var i;
862
- const e = this._activeTools.get(t);
863
- e && ((i = e.onDeactivate) == null || i.call(e), this._activeTools.delete(t), this.updateSortedTools());
888
+ const t = this._activeTools.get(e);
889
+ t && ((i = t.onDeactivate) == null || i.call(t), this._activeTools.delete(e), this.updateSortedTools());
864
890
  }
865
891
  /**
866
892
  * Check if a tool is currently enabled.
867
893
  */
868
- isToolEnabled(t) {
869
- return this._activeTools.has(t);
894
+ isToolEnabled(e) {
895
+ return this._activeTools.has(e);
870
896
  }
871
897
  /**
872
898
  * Get a tool by type.
873
899
  */
874
- getTool(t) {
875
- return this._tools.get(t);
900
+ getTool(e) {
901
+ return this._tools.get(e);
876
902
  }
877
903
  /**
878
904
  * Get all currently active tools.
@@ -884,57 +910,57 @@ class de {
884
910
  * Dispose of the toolbox and clean up resources.
885
911
  */
886
912
  dispose() {
887
- var t;
888
- for (const e of this._activeTools.values())
889
- (t = e.onDeactivate) == null || t.call(e);
913
+ var e;
914
+ for (const t of this._activeTools.values())
915
+ (e = t.onDeactivate) == null || e.call(t);
890
916
  this._activeTools.clear(), this._tools.clear(), this._sortedActiveTools = [], this._canvas.removeEventListener("pointermove", this._boundPointerMove), this._canvas.removeEventListener("pointerdown", this._boundPointerDown), this._canvas.removeEventListener("pointerup", this._boundPointerUp), this._canvas.removeEventListener("wheel", this._boundWheel), this._selectionState.dispose();
891
917
  }
892
918
  // ============ Event Handlers ============
893
- onPointerMove(t) {
919
+ onPointerMove(e) {
894
920
  var i;
895
- this.updatePointer(t);
896
- const e = this.createPointerContext(t);
921
+ this.updatePointer(e);
922
+ const t = this.createPointerContext(e);
897
923
  for (const n of this._sortedActiveTools)
898
- if ((i = n.onPointerMove) == null ? void 0 : i.call(n, e)) break;
924
+ if ((i = n.onPointerMove) == null ? void 0 : i.call(n, t)) break;
899
925
  }
900
- onPointerDown(t) {
926
+ onPointerDown(e) {
901
927
  var i;
902
- this.updatePointerState(t, !0), this.updatePointer(t), this._lastPointerDown.copy(this._pointer);
903
- const e = this.createPointerContext(t);
928
+ this.updatePointerState(e, !0), this.updatePointer(e), this._lastPointerDown.copy(this._pointer);
929
+ const t = this.createPointerContext(e);
904
930
  for (const n of this._sortedActiveTools)
905
- if ((i = n.onPointerDown) == null ? void 0 : i.call(n, e)) break;
931
+ if ((i = n.onPointerDown) == null ? void 0 : i.call(n, t)) break;
906
932
  }
907
- onPointerUp(t) {
933
+ onPointerUp(e) {
908
934
  var n, a;
909
- this.updatePointer(t);
910
- const e = this.createPointerContext(t), i = !this.pointerWasDragged();
935
+ this.updatePointer(e);
936
+ const t = this.createPointerContext(e), i = !this.pointerWasDragged();
911
937
  for (const s of this._sortedActiveTools)
912
- if ((n = s.onPointerUp) == null ? void 0 : n.call(s, e)) break;
938
+ if ((n = s.onPointerUp) == null ? void 0 : n.call(s, t)) break;
913
939
  if (i) {
914
940
  for (const s of this._sortedActiveTools)
915
- if ((a = s.onClick) == null ? void 0 : a.call(s, e)) break;
941
+ if ((a = s.onClick) == null ? void 0 : a.call(s, t)) break;
916
942
  }
917
- this.updatePointerState(t, !1);
943
+ this.updatePointerState(e, !1);
918
944
  }
919
- onWheel(t) {
945
+ onWheel(e) {
920
946
  var i;
921
- const e = this.createWheelContext(t);
947
+ const t = this.createWheelContext(e);
922
948
  for (const n of this._sortedActiveTools)
923
- if ((i = n.onWheel) == null ? void 0 : i.call(n, e)) break;
949
+ if ((i = n.onWheel) == null ? void 0 : i.call(n, t)) break;
924
950
  }
925
951
  // ============ Context Creation ============
926
- createPointerContext(t) {
927
- const e = this.raycast();
952
+ createPointerContext(e) {
953
+ const t = this.raycast();
928
954
  return {
929
- event: t,
955
+ event: e,
930
956
  pointer: this._pointer.clone(),
931
- intersects: e,
957
+ intersects: t,
932
958
  modelIntersects: this.filterIntersectsByLayer(
933
- e,
959
+ t,
934
960
  G
935
961
  ),
936
962
  uiIntersects: this.filterIntersectsByLayer(
937
- e,
963
+ t,
938
964
  W
939
965
  ),
940
966
  pointerPrimaryDown: this._pointerPrimaryDown,
@@ -943,73 +969,73 @@ class de {
943
969
  lastPointerDown: this._lastPointerDown.clone()
944
970
  };
945
971
  }
946
- createWheelContext(t) {
947
- const e = this.raycast();
972
+ createWheelContext(e) {
973
+ const t = this.raycast();
948
974
  return {
949
- event: t,
975
+ event: e,
950
976
  pointer: this._pointer.clone(),
951
- intersects: e,
977
+ intersects: t,
952
978
  modelIntersects: this.filterIntersectsByLayer(
953
- e,
979
+ t,
954
980
  G
955
981
  ),
956
982
  uiIntersects: this.filterIntersectsByLayer(
957
- e,
983
+ t,
958
984
  W
959
985
  )
960
986
  };
961
987
  }
962
988
  // ============ Helper Methods ============
963
- updatePointer(t) {
964
- this._pointer.x = t.offsetX / this._canvas.clientWidth * 2 - 1, this._pointer.y = -(t.offsetY / this._canvas.clientHeight) * 2 + 1, this._raycaster.setFromCamera(this._pointer, this._controller.object);
989
+ updatePointer(e) {
990
+ this._pointer.x = e.offsetX / this._canvas.clientWidth * 2 - 1, this._pointer.y = -(e.offsetY / this._canvas.clientHeight) * 2 + 1, this._raycaster.setFromCamera(this._pointer, this._controller.object);
965
991
  }
966
- updatePointerState(t, e) {
967
- switch (t.button) {
992
+ updatePointerState(e, t) {
993
+ switch (e.button) {
968
994
  case 0:
969
- this._pointerPrimaryDown = e;
995
+ this._pointerPrimaryDown = t;
970
996
  break;
971
997
  case 1:
972
- this._pointerMiddleDown = e;
998
+ this._pointerMiddleDown = t;
973
999
  break;
974
1000
  case 2:
975
- this._pointerSecondaryDown = e;
1001
+ this._pointerSecondaryDown = t;
976
1002
  break;
977
1003
  }
978
1004
  }
979
1005
  raycast() {
980
1006
  this._raycaster.layers.mask = G | W;
981
- const t = this._scene.children.filter(
982
- (e) => e.visible && "isMesh" in e && e.isMesh
1007
+ const e = this._scene.children.filter(
1008
+ (t) => t.visible && "isMesh" in t && t.isMesh
983
1009
  );
984
- return this._raycaster.intersectObjects(t, !0);
1010
+ return this._raycaster.intersectObjects(e, !0);
985
1011
  }
986
- filterIntersectsByLayer(t, e) {
987
- return t.filter(
988
- (i) => (i.object.layers.mask & e) !== 0
1012
+ filterIntersectsByLayer(e, t) {
1013
+ return e.filter(
1014
+ (i) => (i.object.layers.mask & t) !== 0
989
1015
  );
990
1016
  }
991
1017
  updateSortedTools() {
992
1018
  this._sortedActiveTools = [...this._activeTools.values()].sort(
993
- (t, e) => t.priority - e.priority
1019
+ (e, t) => e.priority - t.priority
994
1020
  );
995
1021
  }
996
1022
  pointerWasDragged() {
997
- return this._lastPointerDown.distanceTo(this._pointer) > ie;
1023
+ return this._lastPointerDown.distanceTo(this._pointer) > se;
998
1024
  }
999
1025
  // ============ Legacy API Compatibility ============
1000
1026
  /**
1001
1027
  * @deprecated Use enableTool/disableTool instead.
1002
1028
  * Enable or disable a tool by type.
1003
1029
  */
1004
- useTool(t) {
1005
- const e = [
1030
+ useTool(e) {
1031
+ const t = [
1006
1032
  "hover",
1007
1033
  "select",
1008
1034
  "transform",
1009
1035
  "drag"
1010
1036
  ];
1011
- for (const i of e)
1012
- (i === t || t === "select") && this.enableTool(i);
1037
+ for (const i of t)
1038
+ (i === e || e === "select") && this.enableTool(i);
1013
1039
  }
1014
1040
  /**
1015
1041
  * @deprecated Use getActiveTools instead.
@@ -1019,8 +1045,8 @@ class de {
1019
1045
  return this._sortedActiveTools[0] || null;
1020
1046
  }
1021
1047
  }
1022
- class pe {
1023
- constructor(t, e) {
1048
+ class _e {
1049
+ constructor(e, t) {
1024
1050
  o(this, "POINTER_DRAG_THRESHOLD", 1e-3);
1025
1051
  o(this, "name");
1026
1052
  o(this, "_canvas");
@@ -1046,7 +1072,7 @@ class pe {
1046
1072
  o(this, "_dragDelta");
1047
1073
  o(this, "_draggable");
1048
1074
  o(this, "_dragRaycastOnObjects");
1049
- this.name = "BaseTool", this._canvas = e.domElement, this._scene = t, this._controller = e, this._pointer = new F(), this._pointerPrimaryDown = !1, this._pointerMiddleDown = !1, this._pointerSecondaryDown = !1, this._lastPointerDown = new F(), this._lastPointerUp = new F(), this._raycaster = new ot(), this._raycaster.layers.mask = G | W, this._intersects = [], this._hovered = null, this._dragging = !1, this._dragStart = new l(), this._dragCurrent = new l(), this._dragEnd = new l(), this._dragDelta = new l(), this._draggable = null, this._dragRaycastOnObjects = null;
1075
+ this.name = "BaseTool", this._canvas = t.domElement, this._scene = e, this._controller = t, this._pointer = new F(), this._pointerPrimaryDown = !1, this._pointerMiddleDown = !1, this._pointerSecondaryDown = !1, this._lastPointerDown = new F(), this._lastPointerUp = new F(), this._raycaster = new ot(), this._raycaster.layers.mask = G | W, this._intersects = [], this._hovered = null, this._dragging = !1, this._dragStart = new h(), this._dragCurrent = new h(), this._dragEnd = new h(), this._dragDelta = new h(), this._draggable = null, this._dragRaycastOnObjects = null;
1050
1076
  }
1051
1077
  get _pointerAnyDown() {
1052
1078
  return this._pointerPrimaryDown || this._pointerMiddleDown || this._pointerSecondaryDown;
@@ -1055,9 +1081,9 @@ class pe {
1055
1081
  }
1056
1082
  deactivate() {
1057
1083
  }
1058
- onPointerDown(t) {
1059
- var e;
1060
- switch (t.button) {
1084
+ onPointerDown(e) {
1085
+ var t;
1086
+ switch (e.button) {
1061
1087
  case 0: {
1062
1088
  this._pointerPrimaryDown = !0;
1063
1089
  break;
@@ -1072,15 +1098,15 @@ class pe {
1072
1098
  }
1073
1099
  default:
1074
1100
  console.warn(
1075
- "DIVEBaseTool.onPointerDown: Unknown button: " + t.button
1101
+ "DIVEBaseTool.onPointerDown: Unknown button: " + e.button
1076
1102
  );
1077
1103
  }
1078
1104
  this._lastPointerDown.copy(this._pointer), this._draggable = B(
1079
- (e = this._intersects[0]) == null ? void 0 : e.object,
1105
+ (t = this._intersects[0]) == null ? void 0 : t.object,
1080
1106
  "isDraggable"
1081
1107
  ) || null;
1082
1108
  }
1083
- onDragStart(t) {
1109
+ onDragStart(e) {
1084
1110
  this._draggable && (this._dragRaycastOnObjects !== null && (this._intersects = this._raycaster.intersectObjects(
1085
1111
  this._dragRaycastOnObjects,
1086
1112
  !0
@@ -1091,34 +1117,34 @@ class pe {
1091
1117
  dragDelta: this._dragDelta
1092
1118
  }), this._dragging = !0, this._controller.enabled = !1)));
1093
1119
  }
1094
- onPointerMove(t) {
1120
+ onPointerMove(e) {
1095
1121
  var i;
1096
- this._pointer.x = t.offsetX / this._canvas.clientWidth * 2 - 1, this._pointer.y = -(t.offsetY / this._canvas.clientHeight) * 2 + 1, this._raycaster.setFromCamera(this._pointer, this._controller.object), this._intersects = this.raycast(this._scene.children);
1097
- const e = B(
1122
+ this._pointer.x = e.offsetX / this._canvas.clientWidth * 2 - 1, this._pointer.y = -(e.offsetY / this._canvas.clientHeight) * 2 + 1, this._raycaster.setFromCamera(this._pointer, this._controller.object), this._intersects = this.raycast(this._scene.children);
1123
+ const t = B(
1098
1124
  (i = this._intersects[0]) == null ? void 0 : i.object,
1099
1125
  "isHoverable"
1100
1126
  );
1101
- if (this._intersects[0] && e) {
1127
+ if (this._intersects[0] && t) {
1102
1128
  if (!this._hovered) {
1103
- e.onPointerEnter && e.onPointerEnter(this._intersects[0]), this._hovered = e;
1129
+ t.onPointerEnter && t.onPointerEnter(this._intersects[0]), this._hovered = t;
1104
1130
  return;
1105
1131
  }
1106
- if (this._hovered.uuid !== e.uuid) {
1107
- this._hovered.onPointerLeave && this._hovered.onPointerLeave(), e.onPointerEnter && e.onPointerEnter(this._intersects[0]), this._hovered = e;
1132
+ if (this._hovered.uuid !== t.uuid) {
1133
+ this._hovered.onPointerLeave && this._hovered.onPointerLeave(), t.onPointerEnter && t.onPointerEnter(this._intersects[0]), this._hovered = t;
1108
1134
  return;
1109
1135
  }
1110
- e.onPointerOver && e.onPointerOver(this._intersects[0]), this._hovered = e;
1136
+ t.onPointerOver && t.onPointerOver(this._intersects[0]), this._hovered = t;
1111
1137
  } else
1112
1138
  this._hovered && this._hovered.onPointerLeave && this._hovered.onPointerLeave(), this._hovered = null;
1113
- this._pointerAnyDown && (this._dragging || this.onDragStart(t), this.onDrag(t));
1139
+ this._pointerAnyDown && (this._dragging || this.onDragStart(e), this.onDrag(e));
1114
1140
  }
1115
- onDrag(t) {
1141
+ onDrag(e) {
1116
1142
  this._dragRaycastOnObjects !== null && (this._intersects = this._raycaster.intersectObjects(
1117
1143
  this._dragRaycastOnObjects,
1118
1144
  !0
1119
1145
  ));
1120
- const e = this._intersects[0];
1121
- e && (this._dragCurrent.copy(e.point.clone()), this._dragEnd.copy(e.point.clone()), this._dragDelta.subVectors(
1146
+ const t = this._intersects[0];
1147
+ t && (this._dragCurrent.copy(t.point.clone()), this._dragEnd.copy(t.point.clone()), this._dragDelta.subVectors(
1122
1148
  this._dragCurrent.clone(),
1123
1149
  this._dragStart.clone()
1124
1150
  ), this._draggable && this._draggable.onDrag && this._draggable.onDrag({
@@ -1128,8 +1154,8 @@ class pe {
1128
1154
  dragDelta: this._dragDelta
1129
1155
  }));
1130
1156
  }
1131
- onPointerUp(t) {
1132
- switch (this.pointerWasDragged() || this._dragging ? this._draggable && this.onDragEnd(t) : this.onClick(t), t.button) {
1157
+ onPointerUp(e) {
1158
+ switch (this.pointerWasDragged() || this._dragging ? this._draggable && this.onDragEnd(e) : this.onClick(e), e.button) {
1133
1159
  case 0:
1134
1160
  this._pointerPrimaryDown = !1;
1135
1161
  break;
@@ -1142,11 +1168,11 @@ class pe {
1142
1168
  }
1143
1169
  this._lastPointerUp.copy(this._pointer);
1144
1170
  }
1145
- onClick(t) {
1171
+ onClick(e) {
1146
1172
  }
1147
- onDragEnd(t) {
1148
- const e = this._intersects[0];
1149
- e && (this._dragEnd.copy(e.point.clone()), this._dragCurrent.copy(e.point.clone()), this._dragDelta.subVectors(
1173
+ onDragEnd(e) {
1174
+ const t = this._intersects[0];
1175
+ t && (this._dragEnd.copy(t.point.clone()), this._dragCurrent.copy(t.point.clone()), this._dragDelta.subVectors(
1150
1176
  this._dragCurrent.clone(),
1151
1177
  this._dragStart.clone()
1152
1178
  )), this._draggable && this._draggable.onDragEnd && this._draggable.onDragEnd({
@@ -1156,10 +1182,10 @@ class pe {
1156
1182
  dragDelta: this._dragDelta
1157
1183
  }), this._draggable = null, this._dragging = !1, this._dragStart.set(0, 0, 0), this._dragCurrent.set(0, 0, 0), this._dragEnd.set(0, 0, 0), this._dragDelta.set(0, 0, 0), this._controller.enabled = !0;
1158
1184
  }
1159
- onWheel(t) {
1185
+ onWheel(e) {
1160
1186
  }
1161
- raycast(t) {
1162
- const i = (t || this._scene.children).filter(
1187
+ raycast(e) {
1188
+ const i = (e || this._scene.children).filter(
1163
1189
  (n) => n.visible && "isMesh" in n && n.isMesh
1164
1190
  );
1165
1191
  return this._raycaster.intersectObjects(i, !0);
@@ -1169,15 +1195,15 @@ class pe {
1169
1195
  }
1170
1196
  }
1171
1197
  export {
1172
- pe as DIVEBaseTool,
1173
- Wt as DIVESelectTool,
1174
- Jt as DIVETransformTool,
1175
- ee as DragTool,
1176
- Gt as HoverTool,
1177
- Wt as SelectTool,
1178
- Zt as SelectionState,
1179
- de as Toolbox,
1180
- Jt as TransformTool,
1181
- he as isSelectTool,
1182
- ce as isTransformTool
1198
+ _e as DIVEBaseTool,
1199
+ qt as DIVESelectTool,
1200
+ te as DIVETransformTool,
1201
+ ie as DragTool,
1202
+ Wt as HoverTool,
1203
+ qt as SelectTool,
1204
+ Gt as SelectionState,
1205
+ pe as Toolbox,
1206
+ te as TransformTool,
1207
+ ce as isSelectTool,
1208
+ de as isTransformTool
1183
1209
  };