@planara/core 2.5.0 → 2.6.1

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.
package/dist/index.es.js CHANGED
@@ -1,30 +1,30 @@
1
1
  import "reflect-metadata";
2
2
  import * as a from "three";
3
- import { Controls as xe, Vector3 as E, MOUSE as T, TOUCH as D, Quaternion as me, Spherical as fe, Vector2 as v, Ray as Ie, Plane as He, MathUtils as ke } from "three";
4
- import { FigureType as y, SelectMode as M, Figure as Ne, DisplayMode as R, ToolType as O, SceneMode as j } from "@planara/types";
5
- import { SymmetricAxesHelper as Ye, OrbitWithState as Ue, CameraAxesGizmo as $e, ModelingTransformControls as ze } from "@planara/three";
6
- import { injectable as u, inject as l, injectAll as k, container as Fe } from "tsyringe";
7
- import { EventEmitter as We } from "events";
8
- import { makeAutoObservable as Ze } from "mobx";
9
- const Be = {
10
- [y.Plane]: () => new a.PlaneGeometry(1, 1, 1, 1),
11
- [y.Cube]: () => new a.BoxGeometry(1, 1, 1, 1, 1, 1),
12
- [y.UVSphere]: () => new a.SphereGeometry(0.5, 32, 16),
13
- [y.Icosphere]: () => new a.IcosahedronGeometry(0.5, 0),
14
- [y.Cylinder]: () => new a.CylinderGeometry(0.5, 0.5, 1, 32, 1, !1),
15
- [y.Cone]: () => new a.ConeGeometry(0.5, 1, 32, 1, !1),
16
- [y.Torus]: () => new a.TorusGeometry(0.5, 0.2, 16, 64),
17
- [y.Circle]: () => new a.CircleGeometry(0.5, 32),
18
- [y.Sphere]: () => new a.SphereGeometry(0.5, 32, 16),
19
- [y.Custom]: function() {
3
+ import { Controls as Ue, Vector3 as D, MOUSE as j, TOUCH as x, Quaternion as be, Spherical as ve, Vector2 as w, Ray as We, Plane as ze, MathUtils as Fe } from "three";
4
+ import { FigureType as P, SelectMode as v, Figure as Ze, DisplayMode as k, DEFAULT_TOOL_RULES as ye, ToolType as C, SceneMode as V } from "@planara/types";
5
+ import { SymmetricAxesHelper as $e, OrbitWithState as Be, CameraAxesGizmo as Xe, ModelingTransformControls as Ge } from "@planara/three";
6
+ import { injectable as u, inject as h, injectAll as W, container as Ke } from "tsyringe";
7
+ import { EventEmitter as qe } from "events";
8
+ import { makeAutoObservable as Qe } from "mobx";
9
+ const Je = {
10
+ [P.Plane]: () => new a.PlaneGeometry(1, 1, 1, 1),
11
+ [P.Cube]: () => new a.BoxGeometry(1, 1, 1, 1, 1, 1),
12
+ [P.UVSphere]: () => new a.SphereGeometry(0.5, 32, 16),
13
+ [P.Icosphere]: () => new a.IcosahedronGeometry(0.5, 0),
14
+ [P.Cylinder]: () => new a.CylinderGeometry(0.5, 0.5, 1, 32, 1, !1),
15
+ [P.Cone]: () => new a.ConeGeometry(0.5, 1, 32, 1, !1),
16
+ [P.Torus]: () => new a.TorusGeometry(0.5, 0.2, 16, 64),
17
+ [P.Circle]: () => new a.CircleGeometry(0.5, 32),
18
+ [P.Sphere]: () => new a.SphereGeometry(0.5, 32, 16),
19
+ [P.Custom]: function() {
20
20
  throw new Error("Custom geometry is not generated here.");
21
21
  }
22
- }, Le = new a.MeshStandardMaterial({
22
+ }, Re = new a.MeshStandardMaterial({
23
23
  color: 12566463,
24
24
  metalness: 0,
25
25
  roughness: 0.6
26
- });
27
- class Ce {
26
+ }), et = 8;
27
+ class Ie {
28
28
  /** Корневой объект сцены */
29
29
  scene;
30
30
  /** Камера для сцены */
@@ -81,7 +81,7 @@ class Ce {
81
81
  addFigure(e) {
82
82
  const s = new a.BufferGeometry();
83
83
  s.setAttribute("position", new a.Float32BufferAttribute(e.position, 3)), e.normal && s.setAttribute("normal", new a.Float32BufferAttribute(e.normal, 3)), e.uv && s.setAttribute("uv", new a.Float32BufferAttribute(e.uv, 2));
84
- const i = new a.Mesh(s, Le);
84
+ const i = new a.Mesh(s, Re);
85
85
  return this.scene.add(i), this.meshes.push(i), i;
86
86
  }
87
87
  /**
@@ -172,15 +172,15 @@ class Ce {
172
172
  this.meshes && (this.meshes.length = 0, this.meshes = []), this.scene = null, this.camera = null, this.renderer?.dispose(), this.canvas = null;
173
173
  }
174
174
  }
175
- var Xe = Object.getOwnPropertyDescriptor, Ve = (t, e, s, i) => {
176
- for (var r = i > 1 ? void 0 : i ? Xe(e, s) : e, o = t.length - 1, n; o >= 0; o--)
175
+ var tt = Object.getOwnPropertyDescriptor, st = (t, e, s, i) => {
176
+ for (var r = i > 1 ? void 0 : i ? tt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
177
177
  (n = t[o]) && (r = n(r) || r);
178
178
  return r;
179
179
  };
180
- let $ = class {
180
+ let X = class {
181
181
  _emitter;
182
182
  constructor() {
183
- this._emitter = new We();
183
+ this._emitter = new qe();
184
184
  }
185
185
  /** Публикация события */
186
186
  emit(t, e) {
@@ -195,28 +195,54 @@ let $ = class {
195
195
  this._emitter.off(t, e);
196
196
  }
197
197
  };
198
- $ = Ve([
198
+ X = st([
199
199
  u()
200
- ], $);
201
- var L = /* @__PURE__ */ ((t) => (t.SelectHover = "select.hover", t.SelectClick = "select.click", t.ToolSelect = "tool.select", t))(L || {});
202
- const Ke = 0.03, Ge = 10;
203
- var qe = Object.getOwnPropertyDescriptor, Qe = (t, e, s, i) => {
204
- for (var r = i > 1 ? void 0 : i ? qe(e, s) : e, o = t.length - 1, n; o >= 0; o--)
200
+ ], X);
201
+ var R = /* @__PURE__ */ ((t) => (t.SelectHover = "select.hover", t.SelectClick = "select.click", t.ToolSelect = "tool.select", t))(R || {});
202
+ const it = 0.03, rt = 0.05, He = 0, ot = 1, nt = 2, T = 31, z = 16776960, F = 16755200, at = 2236962, ht = 2236962, lt = (t) => !!t && t.isMesh, ke = (t) => {
203
+ let e = t;
204
+ for (; e; ) {
205
+ if (e.isMesh) return e;
206
+ e = e.parent;
207
+ }
208
+ return null;
209
+ }, Ve = (t) => {
210
+ const e = new a.BufferGeometry();
211
+ e.setAttribute("position", t.getAttribute("position")), e.computeBoundingSphere(), e.computeBoundingBox();
212
+ const s = new a.PointsMaterial({
213
+ color: ht,
214
+ size: 6,
215
+ sizeAttenuation: !1,
216
+ depthTest: !1,
217
+ depthWrite: !1,
218
+ transparent: !0,
219
+ opacity: 0.9
220
+ }), i = new a.Points(e, s);
221
+ return i.layers.set(nt), i.renderOrder = 1e3, i.visible = !1, i;
222
+ }, Ne = (t) => {
223
+ const e = new a.EdgesGeometry(t), s = new a.LineSegments(
224
+ e,
225
+ new a.LineBasicMaterial({ color: at, linewidth: 1 })
226
+ );
227
+ return s.layers.set(ot), s;
228
+ };
229
+ var ct = Object.getOwnPropertyDescriptor, dt = (t, e, s, i) => {
230
+ for (var r = i > 1 ? void 0 : i ? ct(e, s) : e, o = t.length - 1, n; o >= 0; o--)
205
231
  (n = t[o]) && (r = n(r) || r);
206
232
  return r;
207
- }, ge = (t, e) => (s, i) => e(s, i, t);
208
- let z = class extends Ce {
233
+ }, Me = (t, e) => (s, i) => e(s, i, t);
234
+ let G = class extends Ie {
209
235
  constructor(t, e) {
210
236
  super(t), this._canvas = t, this._bus = e;
211
237
  const s = new a.GridHelper(10, 10);
212
238
  s.position.y = -1e-3, this.scene.add(s);
213
- const i = new Ye(6);
214
- this.scene.add(i), this._orbit = new Ue(this.camera, this.renderer.domElement), this._orbit.enableDamping = !0, this._orbit.dampingFactor = 0.05, this._cameraGizmo = new $e(this.renderer, this.camera, {
239
+ const i = new $e(6);
240
+ this.scene.add(i), this._orbit = new Be(this.camera, this.renderer.domElement), this._orbit.enableDamping = !0, this._orbit.dampingFactor = 0.05, this._cameraGizmo = new Xe(this.renderer, this.camera, {
215
241
  size: 96,
216
242
  // Размер квадрата
217
243
  margin: 36
218
244
  // Отступы по сторонам (снизу и справа)
219
- }), this._raycaster = new a.Raycaster(), this._mouse = new a.Vector2(), this.scene.add(new a.HemisphereLight(16777215, 4473924, 0.6)), this.camera.layers.enable(0), this.camera.layers.enable(1), this._transform = new ze(this.camera, this.renderer.domElement), this._transformHelper = this._transform.getHelper(), this.scene.add(this._transformHelper), this._isEventListenersAdded || this._initMouseListeners();
245
+ }), this._raycaster = new a.Raycaster(), this._mouse = new a.Vector2(), this.scene.add(new a.HemisphereLight(16777215, 4473924, 0.6)), this.camera.layers.enable(0), this.camera.layers.enable(1), this._transform = new Ge(this.camera, this.renderer.domElement), this._transformHelper = this._transform.getHelper(), this.scene.add(this._transformHelper), this._isEventListenersAdded || this._initMouseListeners();
220
246
  }
221
247
  /** Orbit-контроллер для управления камерой */
222
248
  _orbit;
@@ -245,12 +271,11 @@ let z = class extends Ce {
245
271
  /** Добавление фигуры на сцену */
246
272
  addFigure(t) {
247
273
  const e = super.addFigure(t);
248
- e.layers.enable(0);
249
- const s = new a.EdgesGeometry(e.geometry), i = new a.LineSegments(
250
- s,
251
- new a.LineBasicMaterial({ color: 8947848, linewidth: 1 })
252
- );
253
- return i.layers.set(1), e.add(i), e;
274
+ e.layers.enable(He);
275
+ const s = Ne(e.geometry);
276
+ e.add(s);
277
+ const i = Ve(e.geometry);
278
+ return e.add(i), e;
254
279
  }
255
280
  /**
256
281
  * Смена отображения `TransformControls` в зависимости от типа инструмента.
@@ -282,15 +307,15 @@ let z = class extends Ce {
282
307
  setRaycastMode(t) {
283
308
  const e = this._raycaster;
284
309
  switch (e.params.Line.threshold = 0, e.params.Points.threshold = 0, t) {
285
- case M.Mesh:
286
- case M.Face:
310
+ case v.Mesh:
311
+ case v.Face:
287
312
  e.layers.set(0);
288
313
  break;
289
- case M.Edge:
290
- e.layers.set(1), e.params.Line.threshold = Ke;
314
+ case v.Edge:
315
+ e.layers.set(1), e.params.Line.threshold = it;
291
316
  break;
292
- case M.Vertex:
293
- e.layers.set(2), e.params.Points.threshold = Ge;
317
+ case v.Vertex:
318
+ e.layers.set(2), e.params.Points.threshold = rt;
294
319
  break;
295
320
  }
296
321
  }
@@ -310,11 +335,11 @@ let z = class extends Ce {
310
335
  }
311
336
  /** Обработчик события для hover */
312
337
  _handleMouseMove = (t) => {
313
- this._processRaycastEvent(t, L.SelectHover, !0);
338
+ this._processRaycastEvent(t, R.SelectHover, !0);
314
339
  };
315
340
  /** Обработчик события на click */
316
341
  _handleMouseClick = (t) => {
317
- this._processRaycastEvent(t, L.SelectClick, !1);
342
+ this._processRaycastEvent(t, R.SelectClick, !1);
318
343
  };
319
344
  /** Вспомогательный метод для получения модели, которую выбрали и отправки события в event bus */
320
345
  _processRaycastEvent(t, e, s) {
@@ -325,12 +350,12 @@ let z = class extends Ce {
325
350
  s ? n !== this._lastHovered && (this.meshes.forEach((c) => c.userData.isHit = !1), n && (n.userData.isHit = !0), this._lastHovered = n, this._bus.emit(e, o ? { intersection: o } : null)) : this._bus.emit(e, o ? { intersection: o } : null);
326
351
  }
327
352
  };
328
- z = Qe([
353
+ G = dt([
329
354
  u(),
330
- ge(0, l("Canvas")),
331
- ge(1, l("EventBus"))
332
- ], z);
333
- const be = { type: "change" }, oe = { type: "start" }, Ae = { type: "end" }, I = new Ie(), ve = new He(), Je = Math.cos(70 * ke.DEG2RAD), _ = new E(), m = 2 * Math.PI, h = {
355
+ Me(0, h("Canvas")),
356
+ Me(1, h("EventBus"))
357
+ ], G);
358
+ const Ee = { type: "change" }, pe = { type: "start" }, Ye = { type: "end" }, U = new We(), we = new ze(), _t = Math.cos(70 * Fe.DEG2RAD), p = new D(), g = 2 * Math.PI, l = {
334
359
  NONE: -1,
335
360
  ROTATE: 0,
336
361
  DOLLY: 1,
@@ -339,8 +364,8 @@ const be = { type: "change" }, oe = { type: "start" }, Ae = { type: "end" }, I =
339
364
  TOUCH_PAN: 4,
340
365
  TOUCH_DOLLY_PAN: 5,
341
366
  TOUCH_DOLLY_ROTATE: 6
342
- }, Y = 1e-6;
343
- class et extends xe {
367
+ }, $ = 1e-6;
368
+ class pt extends Ue {
344
369
  /**
345
370
  * Constructs a new controls instance.
346
371
  *
@@ -348,7 +373,7 @@ class et extends xe {
348
373
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
349
374
  */
350
375
  constructor(e, s = null) {
351
- super(e, s), this.state = h.NONE, this.target = new E(), this.cursor = new E(), 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: T.ROTATE, MIDDLE: T.DOLLY, RIGHT: T.PAN }, this.touches = { ONE: D.ROTATE, TWO: D.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new E(), this._lastQuaternion = new me(), this._lastTargetPosition = new E(), this._quat = new me().setFromUnitVectors(e.up, new E(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new fe(), this._sphericalDelta = new fe(), this._scale = 1, this._panOffset = new E(), this._rotateStart = new v(), this._rotateEnd = new v(), this._rotateDelta = new v(), this._panStart = new v(), this._panEnd = new v(), this._panDelta = new v(), this._dollyStart = new v(), this._dollyEnd = new v(), this._dollyDelta = new v(), this._dollyDirection = new E(), this._mouse = new v(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = st.bind(this), this._onPointerDown = tt.bind(this), this._onPointerUp = it.bind(this), this._onContextMenu = ct.bind(this), this._onMouseWheel = nt.bind(this), this._onKeyDown = at.bind(this), this._onTouchStart = ht.bind(this), this._onTouchMove = lt.bind(this), this._onMouseDown = rt.bind(this), this._onMouseMove = ot.bind(this), this._interceptControlDown = dt.bind(this), this._interceptControlUp = _t.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
376
+ super(e, s), this.state = l.NONE, this.target = new D(), this.cursor = new D(), 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: j.ROTATE, MIDDLE: j.DOLLY, RIGHT: j.PAN }, this.touches = { ONE: x.ROTATE, TWO: x.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new D(), this._lastQuaternion = new be(), this._lastTargetPosition = new D(), this._quat = new be().setFromUnitVectors(e.up, new D(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ve(), this._sphericalDelta = new ve(), this._scale = 1, this._panOffset = new D(), this._rotateStart = new w(), this._rotateEnd = new w(), this._rotateDelta = new w(), this._panStart = new w(), this._panEnd = new w(), this._panDelta = new w(), this._dollyStart = new w(), this._dollyEnd = new w(), this._dollyDelta = new w(), this._dollyDirection = new D(), this._mouse = new w(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = mt.bind(this), this._onPointerDown = ut.bind(this), this._onPointerUp = ft.bind(this), this._onContextMenu = wt.bind(this), this._onMouseWheel = vt.bind(this), this._onKeyDown = yt.bind(this), this._onTouchStart = Mt.bind(this), this._onTouchMove = Et.bind(this), this._onMouseDown = gt.bind(this), this._onMouseMove = bt.bind(this), this._interceptControlDown = Pt.bind(this), this._interceptControlUp = St.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
352
377
  }
353
378
  connect(e) {
354
379
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -409,13 +434,13 @@ class et extends xe {
409
434
  * was called, or the initial state.
410
435
  */
411
436
  reset() {
412
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(be), this.update(), this.state = h.NONE;
437
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ee), this.update(), this.state = l.NONE;
413
438
  }
414
439
  update(e = null) {
415
440
  const s = this.object.position;
416
- _.copy(s).sub(this.target), _.applyQuaternion(this._quat), this._spherical.setFromVector3(_), 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);
441
+ p.copy(s).sub(this.target), p.applyQuaternion(this._quat), this._spherical.setFromVector3(p), this.autoRotate && this.state === l.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);
417
442
  let i = this.minAzimuthAngle, r = this.maxAzimuthAngle;
418
- isFinite(i) && isFinite(r) && (i < -Math.PI ? i += m : i > Math.PI && (i -= m), r < -Math.PI ? r += m : r > Math.PI && (r -= m), i <= r ? this._spherical.theta = Math.max(i, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + r) / 2 ? Math.max(i, this._spherical.theta) : Math.min(r, 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);
443
+ isFinite(i) && isFinite(r) && (i < -Math.PI ? i += g : i > Math.PI && (i -= g), r < -Math.PI ? r += g : r > Math.PI && (r -= g), i <= r ? this._spherical.theta = Math.max(i, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + r) / 2 ? Math.max(i, this._spherical.theta) : Math.min(r, 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);
419
444
  let o = !1;
420
445
  if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
421
446
  this._spherical.radius = this._clampDistance(this._spherical.radius);
@@ -423,31 +448,31 @@ class et extends xe {
423
448
  const n = this._spherical.radius;
424
449
  this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), o = n != this._spherical.radius;
425
450
  }
426
- if (_.setFromSpherical(this._spherical), _.applyQuaternion(this._quatInverse), s.copy(this.target).add(_), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
451
+ if (p.setFromSpherical(this._spherical), p.applyQuaternion(this._quatInverse), s.copy(this.target).add(p), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
427
452
  let n = null;
428
453
  if (this.object.isPerspectiveCamera) {
429
- const c = _.length();
454
+ const c = p.length();
430
455
  n = this._clampDistance(c * this._scale);
431
- const p = c - n;
432
- this.object.position.addScaledVector(this._dollyDirection, p), this.object.updateMatrixWorld(), o = !!p;
456
+ const _ = c - n;
457
+ this.object.position.addScaledVector(this._dollyDirection, _), this.object.updateMatrixWorld(), o = !!_;
433
458
  } else if (this.object.isOrthographicCamera) {
434
- const c = new E(this._mouse.x, this._mouse.y, 0);
459
+ const c = new D(this._mouse.x, this._mouse.y, 0);
435
460
  c.unproject(this.object);
436
- const p = this.object.zoom;
437
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), o = p !== this.object.zoom;
438
- const f = new E(this._mouse.x, this._mouse.y, 0);
439
- f.unproject(this.object), this.object.position.sub(f).add(c), this.object.updateMatrixWorld(), n = _.length();
461
+ const _ = this.object.zoom;
462
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), o = _ !== this.object.zoom;
463
+ const m = new D(this._mouse.x, this._mouse.y, 0);
464
+ m.unproject(this.object), this.object.position.sub(m).add(c), this.object.updateMatrixWorld(), n = p.length();
440
465
  } else
441
466
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
442
- n !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position) : (I.origin.copy(this.object.position), I.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(I.direction)) < Je ? this.object.lookAt(this.target) : (ve.setFromNormalAndCoplanarPoint(this.object.up, this.target), I.intersectPlane(ve, this.target))));
467
+ n !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position) : (U.origin.copy(this.object.position), U.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(U.direction)) < _t ? this.object.lookAt(this.target) : (we.setFromNormalAndCoplanarPoint(this.object.up, this.target), U.intersectPlane(we, this.target))));
443
468
  } else if (this.object.isOrthographicCamera) {
444
469
  const n = this.object.zoom;
445
470
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), n !== this.object.zoom && (this.object.updateProjectionMatrix(), o = !0);
446
471
  }
447
- return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > Y || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Y || this._lastTargetPosition.distanceToSquared(this.target) > Y ? (this.dispatchEvent(be), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
472
+ return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > $ || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > $ || this._lastTargetPosition.distanceToSquared(this.target) > $ ? (this.dispatchEvent(Ee), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
448
473
  }
449
474
  _getAutoRotationAngle(e) {
450
- return e !== null ? m / 60 * this.autoRotateSpeed * e : m / 60 / 60 * this.autoRotateSpeed;
475
+ return e !== null ? g / 60 * this.autoRotateSpeed * e : g / 60 / 60 * this.autoRotateSpeed;
451
476
  }
452
477
  _getZoomScale(e) {
453
478
  const s = Math.abs(e * 0.01);
@@ -460,18 +485,18 @@ class et extends xe {
460
485
  this._sphericalDelta.phi -= e;
461
486
  }
462
487
  _panLeft(e, s) {
463
- _.setFromMatrixColumn(s, 0), _.multiplyScalar(-e), this._panOffset.add(_);
488
+ p.setFromMatrixColumn(s, 0), p.multiplyScalar(-e), this._panOffset.add(p);
464
489
  }
465
490
  _panUp(e, s) {
466
- this.screenSpacePanning === !0 ? _.setFromMatrixColumn(s, 1) : (_.setFromMatrixColumn(s, 0), _.crossVectors(this.object.up, _)), _.multiplyScalar(e), this._panOffset.add(_);
491
+ this.screenSpacePanning === !0 ? p.setFromMatrixColumn(s, 1) : (p.setFromMatrixColumn(s, 0), p.crossVectors(this.object.up, p)), p.multiplyScalar(e), this._panOffset.add(p);
467
492
  }
468
493
  // deltaX and deltaY are in pixels; right and down are positive
469
494
  _pan(e, s) {
470
495
  const i = this.domElement;
471
496
  if (this.object.isPerspectiveCamera) {
472
497
  const r = this.object.position;
473
- _.copy(r).sub(this.target);
474
- let o = _.length();
498
+ p.copy(r).sub(this.target);
499
+ let o = p.length();
475
500
  o *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * o / i.clientHeight, this.object.matrix), this._panUp(2 * s * o / i.clientHeight, this.object.matrix);
476
501
  } else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / i.clientWidth, this.object.matrix), this._panUp(s * (this.object.top - this.object.bottom) / this.object.zoom / i.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
477
502
  }
@@ -506,7 +531,7 @@ class et extends xe {
506
531
  _handleMouseMoveRotate(e) {
507
532
  this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
508
533
  const s = this.domElement;
509
- this._rotateLeft(m * this._rotateDelta.x / s.clientHeight), this._rotateUp(m * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
534
+ this._rotateLeft(g * this._rotateDelta.x / s.clientHeight), this._rotateUp(g * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
510
535
  }
511
536
  _handleMouseMoveDolly(e) {
512
537
  this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
@@ -521,16 +546,16 @@ class et extends xe {
521
546
  let s = !1;
522
547
  switch (e.code) {
523
548
  case this.keys.UP:
524
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), s = !0;
549
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(g * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), s = !0;
525
550
  break;
526
551
  case this.keys.BOTTOM:
527
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), s = !0;
552
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-g * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), s = !0;
528
553
  break;
529
554
  case this.keys.LEFT:
530
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), s = !0;
555
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(g * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), s = !0;
531
556
  break;
532
557
  case this.keys.RIGHT:
533
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), s = !0;
558
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-g * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), s = !0;
534
559
  break;
535
560
  }
536
561
  s && (e.preventDefault(), this.update());
@@ -570,7 +595,7 @@ class et extends xe {
570
595
  }
571
596
  this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
572
597
  const s = this.domElement;
573
- this._rotateLeft(m * this._rotateDelta.x / s.clientHeight), this._rotateUp(m * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd);
598
+ this._rotateLeft(g * this._rotateDelta.x / s.clientHeight), this._rotateUp(g * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd);
574
599
  }
575
600
  _handleTouchMovePan(e) {
576
601
  if (this._pointers.length === 1)
@@ -612,7 +637,7 @@ class et extends xe {
612
637
  }
613
638
  _trackPointer(e) {
614
639
  let s = this._pointerPositions[e.pointerId];
615
- s === void 0 && (s = new v(), this._pointerPositions[e.pointerId] = s), s.set(e.pageX, e.pageY);
640
+ s === void 0 && (s = new w(), this._pointerPositions[e.pointerId] = s), s.set(e.pageX, e.pageY);
616
641
  }
617
642
  _getSecondPointerPosition(e) {
618
643
  const s = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
@@ -636,16 +661,16 @@ class et extends xe {
636
661
  return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
637
662
  }
638
663
  }
639
- function tt(t) {
664
+ function ut(t) {
640
665
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(t.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(t) && (this._addPointer(t), t.pointerType === "touch" ? this._onTouchStart(t) : this._onMouseDown(t)));
641
666
  }
642
- function st(t) {
667
+ function mt(t) {
643
668
  this.enabled !== !1 && (t.pointerType === "touch" ? this._onTouchMove(t) : this._onMouseMove(t));
644
669
  }
645
- function it(t) {
670
+ function ft(t) {
646
671
  switch (this._removePointer(t), this._pointers.length) {
647
672
  case 0:
648
- this.domElement.releasePointerCapture(t.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Ae), this.state = h.NONE;
673
+ this.domElement.releasePointerCapture(t.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Ye), this.state = l.NONE;
649
674
  break;
650
675
  case 1:
651
676
  const e = this._pointers[0], s = this._pointerPositions[e];
@@ -653,7 +678,7 @@ function it(t) {
653
678
  break;
654
679
  }
655
680
  }
656
- function rt(t) {
681
+ function gt(t) {
657
682
  let e;
658
683
  switch (t.button) {
659
684
  case 0:
@@ -669,126 +694,126 @@ function rt(t) {
669
694
  e = -1;
670
695
  }
671
696
  switch (e) {
672
- case T.DOLLY:
697
+ case j.DOLLY:
673
698
  if (this.enableZoom === !1) return;
674
- this._handleMouseDownDolly(t), this.state = h.DOLLY;
699
+ this._handleMouseDownDolly(t), this.state = l.DOLLY;
675
700
  break;
676
- case T.ROTATE:
701
+ case j.ROTATE:
677
702
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
678
703
  if (this.enablePan === !1) return;
679
- this._handleMouseDownPan(t), this.state = h.PAN;
704
+ this._handleMouseDownPan(t), this.state = l.PAN;
680
705
  } else {
681
706
  if (this.enableRotate === !1) return;
682
- this._handleMouseDownRotate(t), this.state = h.ROTATE;
707
+ this._handleMouseDownRotate(t), this.state = l.ROTATE;
683
708
  }
684
709
  break;
685
- case T.PAN:
710
+ case j.PAN:
686
711
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
687
712
  if (this.enableRotate === !1) return;
688
- this._handleMouseDownRotate(t), this.state = h.ROTATE;
713
+ this._handleMouseDownRotate(t), this.state = l.ROTATE;
689
714
  } else {
690
715
  if (this.enablePan === !1) return;
691
- this._handleMouseDownPan(t), this.state = h.PAN;
716
+ this._handleMouseDownPan(t), this.state = l.PAN;
692
717
  }
693
718
  break;
694
719
  default:
695
- this.state = h.NONE;
720
+ this.state = l.NONE;
696
721
  }
697
- this.state !== h.NONE && this.dispatchEvent(oe);
722
+ this.state !== l.NONE && this.dispatchEvent(pe);
698
723
  }
699
- function ot(t) {
724
+ function bt(t) {
700
725
  switch (this.state) {
701
- case h.ROTATE:
726
+ case l.ROTATE:
702
727
  if (this.enableRotate === !1) return;
703
728
  this._handleMouseMoveRotate(t);
704
729
  break;
705
- case h.DOLLY:
730
+ case l.DOLLY:
706
731
  if (this.enableZoom === !1) return;
707
732
  this._handleMouseMoveDolly(t);
708
733
  break;
709
- case h.PAN:
734
+ case l.PAN:
710
735
  if (this.enablePan === !1) return;
711
736
  this._handleMouseMovePan(t);
712
737
  break;
713
738
  }
714
739
  }
715
- function nt(t) {
716
- this.enabled === !1 || this.enableZoom === !1 || this.state !== h.NONE || (t.preventDefault(), this.dispatchEvent(oe), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Ae));
740
+ function vt(t) {
741
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== l.NONE || (t.preventDefault(), this.dispatchEvent(pe), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Ye));
717
742
  }
718
- function at(t) {
743
+ function yt(t) {
719
744
  this.enabled !== !1 && this._handleKeyDown(t);
720
745
  }
721
- function ht(t) {
746
+ function Mt(t) {
722
747
  switch (this._trackPointer(t), this._pointers.length) {
723
748
  case 1:
724
749
  switch (this.touches.ONE) {
725
- case D.ROTATE:
750
+ case x.ROTATE:
726
751
  if (this.enableRotate === !1) return;
727
- this._handleTouchStartRotate(t), this.state = h.TOUCH_ROTATE;
752
+ this._handleTouchStartRotate(t), this.state = l.TOUCH_ROTATE;
728
753
  break;
729
- case D.PAN:
754
+ case x.PAN:
730
755
  if (this.enablePan === !1) return;
731
- this._handleTouchStartPan(t), this.state = h.TOUCH_PAN;
756
+ this._handleTouchStartPan(t), this.state = l.TOUCH_PAN;
732
757
  break;
733
758
  default:
734
- this.state = h.NONE;
759
+ this.state = l.NONE;
735
760
  }
736
761
  break;
737
762
  case 2:
738
763
  switch (this.touches.TWO) {
739
- case D.DOLLY_PAN:
764
+ case x.DOLLY_PAN:
740
765
  if (this.enableZoom === !1 && this.enablePan === !1) return;
741
- this._handleTouchStartDollyPan(t), this.state = h.TOUCH_DOLLY_PAN;
766
+ this._handleTouchStartDollyPan(t), this.state = l.TOUCH_DOLLY_PAN;
742
767
  break;
743
- case D.DOLLY_ROTATE:
768
+ case x.DOLLY_ROTATE:
744
769
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
745
- this._handleTouchStartDollyRotate(t), this.state = h.TOUCH_DOLLY_ROTATE;
770
+ this._handleTouchStartDollyRotate(t), this.state = l.TOUCH_DOLLY_ROTATE;
746
771
  break;
747
772
  default:
748
- this.state = h.NONE;
773
+ this.state = l.NONE;
749
774
  }
750
775
  break;
751
776
  default:
752
- this.state = h.NONE;
777
+ this.state = l.NONE;
753
778
  }
754
- this.state !== h.NONE && this.dispatchEvent(oe);
779
+ this.state !== l.NONE && this.dispatchEvent(pe);
755
780
  }
756
- function lt(t) {
781
+ function Et(t) {
757
782
  switch (this._trackPointer(t), this.state) {
758
- case h.TOUCH_ROTATE:
783
+ case l.TOUCH_ROTATE:
759
784
  if (this.enableRotate === !1) return;
760
785
  this._handleTouchMoveRotate(t), this.update();
761
786
  break;
762
- case h.TOUCH_PAN:
787
+ case l.TOUCH_PAN:
763
788
  if (this.enablePan === !1) return;
764
789
  this._handleTouchMovePan(t), this.update();
765
790
  break;
766
- case h.TOUCH_DOLLY_PAN:
791
+ case l.TOUCH_DOLLY_PAN:
767
792
  if (this.enableZoom === !1 && this.enablePan === !1) return;
768
793
  this._handleTouchMoveDollyPan(t), this.update();
769
794
  break;
770
- case h.TOUCH_DOLLY_ROTATE:
795
+ case l.TOUCH_DOLLY_ROTATE:
771
796
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
772
797
  this._handleTouchMoveDollyRotate(t), this.update();
773
798
  break;
774
799
  default:
775
- this.state = h.NONE;
800
+ this.state = l.NONE;
776
801
  }
777
802
  }
778
- function ct(t) {
803
+ function wt(t) {
779
804
  this.enabled !== !1 && t.preventDefault();
780
805
  }
781
- function dt(t) {
806
+ function Pt(t) {
782
807
  t.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
783
808
  }
784
- function _t(t) {
809
+ function St(t) {
785
810
  t.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
786
811
  }
787
- class ns extends Ce {
812
+ class ys extends Ie {
788
813
  /** Orbit-контроллер для управления камерой */
789
814
  _orbit;
790
815
  constructor(e) {
791
- super(e), this.camera.position.set(1, 1, 7), this.camera.lookAt(0, 0, 0), this._orbit = new et(this.camera, this.canvas), this._orbit.target.set(0, 0, 0), this._orbit.minPolarAngle = Math.PI / 2, this._orbit.maxPolarAngle = Math.PI / 2, this._orbit.enableRotate = !0, this._orbit.enableZoom = !1, this._orbit.enablePan = !1;
816
+ super(e), this.camera.position.set(1, 1, 7), this.camera.lookAt(0, 0, 0), this._orbit = new pt(this.camera, this.canvas), this._orbit.target.set(0, 0, 0), this._orbit.minPolarAngle = Math.PI / 2, this._orbit.maxPolarAngle = Math.PI / 2, this._orbit.enableRotate = !0, this._orbit.enableZoom = !1, this._orbit.enablePan = !1;
792
817
  }
793
818
  /**
794
819
  * Обновление состояния рендерера.
@@ -797,7 +822,7 @@ class ns extends Ce {
797
822
  this._orbit?.update();
798
823
  }
799
824
  }
800
- class as {
825
+ class Ms {
801
826
  /** Позиции вершин */
802
827
  _positions = [];
803
828
  /** Нормали вершин */
@@ -834,12 +859,12 @@ class as {
834
859
  }
835
860
  }
836
861
  const i = {
837
- type: y.Custom,
862
+ type: P.Custom,
838
863
  position: this._positions,
839
864
  ...this._normals.length > 0 && { normal: this._normals },
840
865
  ...this._uvs.length > 0 && { uv: this._uvs }
841
866
  };
842
- return new Ne(i);
867
+ return new Ze(i);
843
868
  }
844
869
  /**
845
870
  * Обрабатывает строку face (f) и разворачивает индексы в массивы для рендеринга
@@ -848,60 +873,60 @@ class as {
848
873
  for (let s = 1; s < e.length; s++) {
849
874
  const i = e[s];
850
875
  if (!i) continue;
851
- const [r, o, n] = i.split("/"), c = r ? parseInt(r, 10) : void 0, p = o ? parseInt(o, 10) : void 0, f = n ? parseInt(n, 10) : void 0;
876
+ const [r, o, n] = i.split("/"), c = r ? parseInt(r, 10) : void 0, _ = o ? parseInt(o, 10) : void 0, m = n ? parseInt(n, 10) : void 0;
852
877
  if (c !== void 0) {
853
- const g = this._tmpPositions[c - 1];
854
- g && this._positions.push(...g);
878
+ const f = this._tmpPositions[c - 1];
879
+ f && this._positions.push(...f);
855
880
  }
856
- if (p !== void 0) {
857
- const g = this._tmpUVs[p - 1];
858
- g && this._uvs.push(...g);
881
+ if (_ !== void 0) {
882
+ const f = this._tmpUVs[_ - 1];
883
+ f && this._uvs.push(...f);
859
884
  }
860
- if (f !== void 0) {
861
- const g = this._tmpNormals[f - 1];
862
- g && this._normals.push(...g);
885
+ if (m !== void 0) {
886
+ const f = this._tmpNormals[m - 1];
887
+ f && this._normals.push(...f);
863
888
  }
864
889
  }
865
890
  }
866
891
  }
867
- var pt = Object.getOwnPropertyDescriptor, ut = (t, e, s, i) => {
868
- for (var r = i > 1 ? void 0 : i ? pt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
892
+ var Ot = Object.getOwnPropertyDescriptor, Dt = (t, e, s, i) => {
893
+ for (var r = i > 1 ? void 0 : i ? Ot(e, s) : e, o = t.length - 1, n; o >= 0; o--)
869
894
  (n = t[o]) && (r = n(r) || r);
870
895
  return r;
871
- }, ye = (t, e) => (s, i) => e(s, i, t);
872
- let F = class {
896
+ }, Pe = (t, e) => (s, i) => e(s, i, t);
897
+ let K = class {
873
898
  constructor(t, e) {
874
899
  this._store = e, this._handlers = new Map(t.map((s) => [s.mode, s]));
875
900
  }
876
901
  /** Текущий режим отображения */
877
- _currentMode = R.Plane;
902
+ _currentMode = k.Plane;
878
903
  /** Хендлеры, которые управляют отображением */
879
904
  _handlers;
880
905
  /** Установка режима отображения */
881
906
  manage(t) {
882
- t !== this._currentMode && (this._handlers.get(this._currentMode)?.rollback(), t !== R.Plane && this._handlers.get(t)?.handle(), this._currentMode = t, this._store.setDisplayMode(this._currentMode));
907
+ t !== this._currentMode && (this._handlers.get(this._currentMode)?.rollback(), t !== k.Plane && this._handlers.get(t)?.handle(), this._currentMode = t, this._store.setDisplayMode(this._currentMode));
883
908
  }
884
909
  /** Освобождает ресурсы менеджера. */
885
910
  dispose() {
886
- this._handlers && this._handlers.clear(), this._currentMode = R.Plane, this._store.setDisplayMode(this._currentMode);
911
+ this._handlers && this._handlers.clear(), this._currentMode = k.Plane, this._store.setDisplayMode(this._currentMode);
887
912
  }
888
913
  };
889
- F = ut([
914
+ K = Dt([
890
915
  u(),
891
- ye(0, k("IDisplayHandler")),
892
- ye(1, l("IEditorStore"))
893
- ], F);
894
- var S = /* @__PURE__ */ ((t) => (t.Hover = "hover", t.Click = "click", t))(S || {}), mt = Object.getOwnPropertyDescriptor, ft = (t, e, s, i) => {
895
- for (var r = i > 1 ? void 0 : i ? mt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
916
+ Pe(0, W("IDisplayHandler")),
917
+ Pe(1, h("IEditorStore"))
918
+ ], K);
919
+ var S = /* @__PURE__ */ ((t) => (t.Hover = "hover", t.Click = "click", t))(S || {}), Tt = Object.getOwnPropertyDescriptor, Lt = (t, e, s, i) => {
920
+ for (var r = i > 1 ? void 0 : i ? Tt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
896
921
  (n = t[o]) && (r = n(r) || r);
897
922
  return r;
898
- }, U = (t, e) => (s, i) => e(s, i, t);
899
- let W = class {
923
+ }, B = (t, e) => (s, i) => e(s, i, t);
924
+ let q = class {
900
925
  constructor(t, e, s) {
901
- this._eventBus = t, this._store = s, this._handlers = new Map(e.map((i) => [i.mode, i])), this._eventBus.on(L.SelectHover, this._onHover), this._eventBus.on(L.SelectClick, this._onClick);
926
+ this._eventBus = t, this._store = s, this._handlers = new Map(e.map((i) => [i.mode, i])), this._eventBus.on(R.SelectHover, this._onHover), this._eventBus.on(R.SelectClick, this._onClick);
902
927
  }
903
928
  /** Текущий режим выборки */
904
- _currentMode = M.Mesh;
929
+ _currentMode = v.Mesh;
905
930
  /** Хендлеры, которые управляют выборкой */
906
931
  _handlers;
907
932
  /** Переключает режим выбора */
@@ -918,52 +943,67 @@ let W = class {
918
943
  };
919
944
  /** Освобождает ресурсы менеджера. */
920
945
  dispose() {
921
- this._handlers && this._handlers.clear(), this._eventBus.off(L.SelectHover, this._onHover), this._currentMode = M.Mesh, this._store.setSelectMode(this._currentMode);
946
+ this._handlers && this._handlers.clear(), this._eventBus.off(R.SelectHover, this._onHover), this._currentMode = v.Mesh, this._store.setSelectMode(this._currentMode);
922
947
  }
923
948
  };
924
- W = ft([
949
+ q = Lt([
925
950
  u(),
926
- U(0, l("EventBus")),
927
- U(1, k("ISelectHandler")),
928
- U(2, l("IEditorStore"))
929
- ], W);
930
- var gt = Object.getOwnPropertyDescriptor, bt = (t, e, s, i) => {
931
- for (var r = i > 1 ? void 0 : i ? gt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
951
+ B(0, h("EventBus")),
952
+ B(1, W("ISelectHandler")),
953
+ B(2, h("IEditorStore"))
954
+ ], q);
955
+ class Ct {
956
+ /** Доступен ли инструмент при текущем режиме выборки */
957
+ isToolEnabled(e, s) {
958
+ return ye[s].includes(e);
959
+ }
960
+ /** Получение доступных инструментов для режима выборки*/
961
+ getEnabledTools(e) {
962
+ return ye[e];
963
+ }
964
+ }
965
+ var At = Object.getOwnPropertyDescriptor, xt = (t, e, s, i) => {
966
+ for (var r = i > 1 ? void 0 : i ? At(e, s) : e, o = t.length - 1, n; o >= 0; o--)
932
967
  (n = t[o]) && (r = n(r) || r);
933
968
  return r;
934
- }, Me = (t, e) => (s, i) => e(s, i, t);
935
- let Z = class {
969
+ }, Se = (t, e) => (s, i) => e(s, i, t);
970
+ let Q = class {
936
971
  constructor(t, e) {
937
972
  this._store = e, this._handlers = new Map(t.map((s) => [s.mode, s])), this._unsubSelected = this._store.onSelectedObjectChange(() => {
938
973
  this._handlers.get(this._currentTool)?.handle();
939
- });
974
+ }), this._policy = new Ct();
940
975
  }
941
976
  /** Текущий выбранный инструмент */
942
- _currentTool = O.Translate;
977
+ _currentTool = C.Translate;
943
978
  /** Хендлеры, которые управляют инструментами */
944
979
  _handlers;
980
+ /** Событие обновления выбора объекта */
945
981
  _unsubSelected;
982
+ /** Политика доступности инструментов */
983
+ _policy;
946
984
  manage(t) {
947
- this._currentTool !== t && (this._handlers.get(this._currentTool)?.rollback(), this._currentTool = t, this._store.setToolType(this._currentTool), this._handlers.get(this._currentTool)?.handle());
985
+ if (this._currentTool === t) return;
986
+ const e = this._store.getSelectMode();
987
+ this._policy.isToolEnabled(t, e) && (this._handlers.get(this._currentTool)?.rollback(), this._currentTool = t, this._store.setToolType(this._currentTool), this._handlers.get(this._currentTool)?.handle());
948
988
  }
949
989
  /** Освобождает ресурсы менеджера. */
950
990
  dispose() {
951
- this._unsubSelected?.(), this._handlers && this._handlers.clear(), this._currentTool = O.Translate, this._store.setToolType(this._currentTool);
991
+ this._unsubSelected?.(), this._handlers && this._handlers.clear(), this._currentTool = C.Translate, this._store.setToolType(this._currentTool);
952
992
  }
953
993
  };
954
- Z = bt([
994
+ Q = xt([
955
995
  u(),
956
- Me(0, k("IToolHandler")),
957
- Me(1, l("IEditorStore"))
958
- ], Z);
959
- var vt = Object.getOwnPropertyDescriptor, yt = (t, e, s, i) => {
960
- for (var r = i > 1 ? void 0 : i ? vt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
996
+ Se(0, W("IToolHandler")),
997
+ Se(1, h("IEditorStore"))
998
+ ], Q);
999
+ var jt = Object.getOwnPropertyDescriptor, Rt = (t, e, s, i) => {
1000
+ for (var r = i > 1 ? void 0 : i ? jt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
961
1001
  (n = t[o]) && (r = n(r) || r);
962
1002
  return r;
963
- }, Mt = (t, e) => (s, i) => e(s, i, t);
964
- let B = class {
1003
+ }, It = (t, e) => (s, i) => e(s, i, t);
1004
+ let J = class {
965
1005
  /** Текущий режим редактирования сцены */
966
- _currentMode = j.AddFigure;
1006
+ _currentMode = V.AddFigure;
967
1007
  /** Хендлеры, которые управляют отображением */
968
1008
  _handlers;
969
1009
  constructor(t) {
@@ -971,28 +1011,28 @@ let B = class {
971
1011
  }
972
1012
  /** Установка режима редактирования сцены */
973
1013
  manage(t, e) {
974
- console.log("manage", t), t === j.AddFigure ? this._handlers.get(t)?.handle(e) : this._handlers.get(t)?.handle(), this._currentMode = t;
1014
+ console.log("manage", t), t === V.AddFigure ? this._handlers.get(t)?.handle(e) : this._handlers.get(t)?.handle(), this._currentMode = t;
975
1015
  }
976
1016
  /** Освобождает ресурсы менеджера. */
977
1017
  dispose() {
978
- this._handlers && this._handlers.clear(), this._currentMode = j.AddFigure;
1018
+ this._handlers && this._handlers.clear(), this._currentMode = V.AddFigure;
979
1019
  }
980
1020
  };
981
- B = yt([
1021
+ J = Rt([
982
1022
  u(),
983
- Mt(0, k("ISceneHandler"))
984
- ], B);
985
- var Et = Object.getOwnPropertyDescriptor, wt = (t, e, s, i) => {
986
- for (var r = i > 1 ? void 0 : i ? Et(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1023
+ It(0, W("ISceneHandler"))
1024
+ ], J);
1025
+ var Ht = Object.getOwnPropertyDescriptor, kt = (t, e, s, i) => {
1026
+ for (var r = i > 1 ? void 0 : i ? Ht(e, s) : e, o = t.length - 1, n; o >= 0; o--)
987
1027
  (n = t[o]) && (r = n(r) || r);
988
1028
  return r;
989
- }, St = (t, e) => (s, i) => e(s, i, t);
990
- let X = class {
1029
+ }, Vt = (t, e) => (s, i) => e(s, i, t);
1030
+ let ee = class {
991
1031
  constructor(t) {
992
1032
  this._api = t;
993
1033
  }
994
1034
  /** Режим отображения. */
995
- mode = R.Wireframe;
1035
+ mode = k.Wireframe;
996
1036
  /** Сохраняем предыдущие значения wireframe для отката. */
997
1037
  _prevWireframe = /* @__PURE__ */ new Map();
998
1038
  /** Сохраняем исходные цвета материалов для отката */
@@ -1043,31 +1083,30 @@ let X = class {
1043
1083
  "wireframe" in e && !this._prevWireframe.has(t) && (this._prevWireframe.set(t, !!e.wireframe), e.wireframe = !0, t.needsUpdate = !0), e.color?.isColor && (this._prevColorMesh.has(t) || this._prevColorMesh.set(t, e.color.clone()), e.color.copy(this._wireColor));
1044
1084
  }
1045
1085
  };
1046
- X = wt([
1086
+ ee = kt([
1047
1087
  u(),
1048
- St(0, l("RendererApi"))
1049
- ], X);
1050
- const ne = 16776960, ae = 16755200, Pt = 2236962;
1051
- var Ot = Object.getOwnPropertyDescriptor, Dt = (t, e, s, i) => {
1052
- for (var r = i > 1 ? void 0 : i ? Ot(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1088
+ Vt(0, h("RendererApi"))
1089
+ ], ee);
1090
+ var Nt = Object.getOwnPropertyDescriptor, Yt = (t, e, s, i) => {
1091
+ for (var r = i > 1 ? void 0 : i ? Nt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1053
1092
  (n = t[o]) && (r = n(r) || r);
1054
1093
  return r;
1055
- }, Ee = (t, e) => (s, i) => e(s, i, t);
1056
- let V = class {
1094
+ }, Oe = (t, e) => (s, i) => e(s, i, t);
1095
+ let te = class {
1057
1096
  constructor(t, e) {
1058
1097
  this._api = t, this._store = e;
1059
1098
  }
1060
1099
  /** Режим, которым управляет хендлер, нужен только менеджеру */
1061
- mode = M.Mesh;
1100
+ mode = v.Mesh;
1062
1101
  /** Фигура, на которую навелись в данный момент */
1063
1102
  _hoveredMesh = null;
1064
1103
  /** Фигура, которую выбрали в данный момент */
1065
1104
  _selectedMesh = null;
1066
1105
  // Цвета, необходимые для переключения
1067
1106
  /** Цвет ребер для фигуры, на которую навелись */
1068
- _hoverColor = ne;
1107
+ _hoverColor = z;
1069
1108
  /** Цвет ребер для выделенной фигуры */
1070
- _selectColor = ae;
1109
+ _selectColor = F;
1071
1110
  /** Исходные цвета материалов линий для отката */
1072
1111
  _origLineColors = /* @__PURE__ */ new WeakMap();
1073
1112
  handle(t, e) {
@@ -1124,31 +1163,31 @@ let V = class {
1124
1163
  });
1125
1164
  }
1126
1165
  };
1127
- V = Dt([
1166
+ te = Yt([
1128
1167
  u(),
1129
- Ee(0, l("RendererApi")),
1130
- Ee(1, l("IEditorStore"))
1131
- ], V);
1132
- var Tt = Object.getOwnPropertyDescriptor, Lt = (t, e, s, i) => {
1133
- for (var r = i > 1 ? void 0 : i ? Tt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1168
+ Oe(0, h("RendererApi")),
1169
+ Oe(1, h("IEditorStore"))
1170
+ ], te);
1171
+ var Ut = Object.getOwnPropertyDescriptor, Wt = (t, e, s, i) => {
1172
+ for (var r = i > 1 ? void 0 : i ? Ut(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1134
1173
  (n = t[o]) && (r = n(r) || r);
1135
1174
  return r;
1136
- }, Ct = (t, e) => (s, i) => e(s, i, t);
1137
- let K = class {
1175
+ }, zt = (t, e) => (s, i) => e(s, i, t);
1176
+ let se = class {
1138
1177
  constructor(t) {
1139
1178
  this._api = t;
1140
1179
  }
1141
1180
  /** Режим, которым управляет хендлер, нужен только менеджеру */
1142
- mode = M.Face;
1181
+ mode = v.Face;
1143
1182
  /** Текущая наведённая грань */
1144
1183
  _hovered = null;
1145
1184
  /** Текущая выбранная грань */
1146
1185
  _selected = null;
1147
1186
  // Цвета, необходимые для переключения
1148
1187
  /** Цвет грани, на которую навелись */
1149
- _hoverColor = ne;
1188
+ _hoverColor = z;
1150
1189
  /** Цвет выделенной граней */
1151
- _selectColor = ae;
1190
+ _selectColor = F;
1152
1191
  /** Изначальный цвет граней у модели, перед наложением эффектов*/
1153
1192
  _defaultColor = 2236962;
1154
1193
  handle(t, e) {
@@ -1162,11 +1201,137 @@ let K = class {
1162
1201
  throw new Error("Method not implemented.");
1163
1202
  }
1164
1203
  };
1165
- K = Lt([
1204
+ se = Wt([
1166
1205
  u(),
1167
- Ct(0, l("RendererApi"))
1168
- ], K);
1169
- class he {
1206
+ zt(0, h("RendererApi"))
1207
+ ], se);
1208
+ var Ft = Object.getOwnPropertyDescriptor, Zt = (t, e, s, i) => {
1209
+ for (var r = i > 1 ? void 0 : i ? Ft(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1210
+ (n = t[o]) && (r = n(r) || r);
1211
+ return r;
1212
+ }, De = (t, e) => (s, i) => e(s, i, t);
1213
+ let ie = class {
1214
+ constructor(t, e) {
1215
+ this._api = t, this._store = e, this._api.enableCameraLayer(T), this._hoverVertex = this._makeOverlayVertex(this._hoverColor), this._selectVertex = this._makeOverlayVertex(this._selectColor), this._api.addObject(this._hoverVertex, T), this._api.addObject(this._selectVertex, T);
1216
+ }
1217
+ /** Режим, которым управляет хендлер, нужен только менеджеру */
1218
+ mode = v.Vertex;
1219
+ _hovered = null;
1220
+ _selected = null;
1221
+ /** Текущая наведённая вершина. */
1222
+ _hoverVertex;
1223
+ /** Текущая выбранная вершина. */
1224
+ _selectVertex;
1225
+ // Цвета, необходимые для переключения
1226
+ /** Цвет ребра, на которое навелись */
1227
+ _hoverColor = z;
1228
+ /** Цвет выделенного ребра */
1229
+ _selectColor = F;
1230
+ handle(t, e) {
1231
+ if (this._api.setRaycastMode(this.mode), e === S.Hover) {
1232
+ if (!t) {
1233
+ this._hoverVertex.visible = !1, this._hovered = null;
1234
+ return;
1235
+ }
1236
+ const s = t.intersection.object;
1237
+ if (!s?.isPoints) return;
1238
+ const i = s, r = t.intersection.index ?? -1;
1239
+ if (r < 0) return;
1240
+ this._selected && this._same({ points: i, index: r }, this._selected) ? this._hoverVertex.visible = !1 : (this._writeWorldVertex(this._hoverVertex, i, r), this._hoverVertex.visible = !0);
1241
+ return;
1242
+ }
1243
+ if (e === S.Click) {
1244
+ if (!t) {
1245
+ this._selectVertex.visible = !1, this._selected = null, this._store.setSelectedObject(null);
1246
+ return;
1247
+ }
1248
+ const s = t.intersection.object;
1249
+ if (!s?.isPoints) return;
1250
+ const i = s, r = t.intersection.index ?? -1;
1251
+ if (r < 0) return;
1252
+ this._writeWorldVertex(this._selectVertex, i, r), this._centerVertexOnPoint(this._selectVertex, i, r), this._selectVertex.visible = !0, this._prepareVertexMetadata(i, r), this._store.setSelectedObject(this._selectVertex), this._selected = { points: i, index: r }, this._hovered && this._same(this._hovered, this._selected) && (this._hoverVertex.visible = !1);
1253
+ return;
1254
+ }
1255
+ }
1256
+ rollback() {
1257
+ this._hoverVertex.visible = !1, this._selectVertex.visible = !1, this._hovered = this._selected = null;
1258
+ }
1259
+ dispose() {
1260
+ this.rollback(), this._api.removeObject(this._hoverVertex), this._api.removeObject(this._selectVertex), this._hoverVertex.geometry.dispose(), this._hoverVertex.material.dispose(), this._selectVertex.geometry.dispose(), this._selectVertex.material.dispose();
1261
+ }
1262
+ _makeOverlayVertex(t, e = et) {
1263
+ const s = new a.BufferGeometry();
1264
+ s.setAttribute("position", new a.Float32BufferAttribute([0, 0, 0], 3));
1265
+ const i = new a.PointsMaterial({
1266
+ color: t,
1267
+ size: e,
1268
+ sizeAttenuation: !1,
1269
+ depthTest: !1,
1270
+ depthWrite: !1,
1271
+ transparent: !0,
1272
+ opacity: 1
1273
+ }), r = new a.Points(s, i);
1274
+ return r.renderOrder = 1e3, r.raycast = () => {
1275
+ }, r.layers.set(T), r.visible = !1, r;
1276
+ }
1277
+ /** Локальную вершину points переводим в world и пишем в target (прокси-точку) */
1278
+ _writeWorldVertex(t, e, s) {
1279
+ const i = e.geometry.getAttribute("position"), r = new a.Vector3(
1280
+ i.getX(s),
1281
+ i.getY(s),
1282
+ i.getZ(s)
1283
+ ).applyMatrix4(e.matrixWorld), o = t.geometry.getAttribute("position");
1284
+ o.setXYZ(0, r.x, r.y, r.z), o.needsUpdate = !0;
1285
+ }
1286
+ _same(t, e) {
1287
+ return !!t && !!e && t.points === e.points && t.index === e.index;
1288
+ }
1289
+ /** Готовит метаданные для выбранной вершины и пишет их в _selectVertex.userData */
1290
+ _prepareVertexMetadata(t, e) {
1291
+ const s = ke(t);
1292
+ if (!s) return;
1293
+ const i = t.geometry.getAttribute("position"), r = new a.Vector3(
1294
+ i.getX(e),
1295
+ i.getY(e),
1296
+ i.getZ(e)
1297
+ ).applyMatrix4(t.matrixWorld), o = new a.Matrix4().copy(s.matrixWorld).invert(), n = r.clone().applyMatrix4(o), _ = s.geometry.getAttribute("position"), m = 1e-6, f = m * m, L = new a.Vector3(), b = [];
1298
+ for (let M = 0; M < _.count; M++)
1299
+ L.fromBufferAttribute(_, M), L.distanceToSquared(n) < f && b.push(M);
1300
+ const O = s.children.find((M) => M?.isLineSegments);
1301
+ let y = [];
1302
+ if (O) {
1303
+ const M = new a.Matrix4().copy(O.matrixWorld).invert(), N = r.clone().applyMatrix4(M), I = O.geometry.getAttribute("position"), Y = new a.Vector3();
1304
+ for (let A = 0; A < I.count; A++)
1305
+ Y.fromBufferAttribute(I, A), Y.distanceToSquared(N) < f && y.push(A);
1306
+ }
1307
+ this._selectVertex.userData.vertexInfo = {
1308
+ points: t,
1309
+ index: e,
1310
+ mesh: s,
1311
+ vertexIndices: b,
1312
+ lines: O ?? null,
1313
+ edgeVertexIndices: y
1314
+ };
1315
+ }
1316
+ /** Центрует прокси-вершину на выбранной точке */
1317
+ _centerVertexOnPoint(t, e, s) {
1318
+ const i = e.geometry.getAttribute("position"), r = new a.Vector3(
1319
+ i.getX(s),
1320
+ i.getY(s),
1321
+ i.getZ(s)
1322
+ ).applyMatrix4(e.matrixWorld);
1323
+ t.position.copy(r);
1324
+ const o = t.geometry;
1325
+ let n = o.getAttribute("position");
1326
+ (!n || n.count < 1) && (o.setAttribute("position", new a.BufferAttribute(new Float32Array(3), 3)), n = o.getAttribute("position")), n.setXYZ(0, 0, 0, 0), n.needsUpdate = !0, t.quaternion.identity(), t.scale.set(1, 1, 1), t.updateMatrixWorld(!0);
1327
+ }
1328
+ };
1329
+ ie = Zt([
1330
+ u(),
1331
+ De(0, h("RendererApi")),
1332
+ De(1, h("IEditorStore"))
1333
+ ], ie);
1334
+ class ue {
1170
1335
  constructor(e, s) {
1171
1336
  this.api = e, this.store = s;
1172
1337
  }
@@ -1190,69 +1355,68 @@ class he {
1190
1355
  this.rollback();
1191
1356
  }
1192
1357
  }
1193
- var At = Object.getOwnPropertyDescriptor, Rt = (t, e, s, i) => {
1194
- for (var r = i > 1 ? void 0 : i ? At(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1358
+ var $t = Object.getOwnPropertyDescriptor, Bt = (t, e, s, i) => {
1359
+ for (var r = i > 1 ? void 0 : i ? $t(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1195
1360
  (n = t[o]) && (r = n(r) || r);
1196
1361
  return r;
1197
- }, we = (t, e) => (s, i) => e(s, i, t);
1198
- let G = class extends he {
1362
+ }, Te = (t, e) => (s, i) => e(s, i, t);
1363
+ let re = class extends ue {
1199
1364
  /** Инструмент, которым управляет хендлер, нужен только менеджеру */
1200
- mode = O.Translate;
1365
+ mode = C.Translate;
1201
1366
  constructor(t, e) {
1202
1367
  super(t, e);
1203
1368
  }
1204
1369
  };
1205
- G = Rt([
1370
+ re = Bt([
1206
1371
  u(),
1207
- we(0, l("RendererApi")),
1208
- we(1, l("IEditorStore"))
1209
- ], G);
1210
- var jt = Object.getOwnPropertyDescriptor, xt = (t, e, s, i) => {
1211
- for (var r = i > 1 ? void 0 : i ? jt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1372
+ Te(0, h("RendererApi")),
1373
+ Te(1, h("IEditorStore"))
1374
+ ], re);
1375
+ var Xt = Object.getOwnPropertyDescriptor, Gt = (t, e, s, i) => {
1376
+ for (var r = i > 1 ? void 0 : i ? Xt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1212
1377
  (n = t[o]) && (r = n(r) || r);
1213
1378
  return r;
1214
- }, Se = (t, e) => (s, i) => e(s, i, t);
1215
- let q = class extends he {
1379
+ }, Le = (t, e) => (s, i) => e(s, i, t);
1380
+ let oe = class extends ue {
1216
1381
  /** Инструмент, которым управляет хендлер, нужен только менеджеру */
1217
- mode = O.Scale;
1382
+ mode = C.Scale;
1218
1383
  constructor(t, e) {
1219
1384
  super(t, e);
1220
1385
  }
1221
1386
  };
1222
- q = xt([
1387
+ oe = Gt([
1223
1388
  u(),
1224
- Se(0, l("RendererApi")),
1225
- Se(1, l("IEditorStore"))
1226
- ], q);
1227
- var It = Object.getOwnPropertyDescriptor, Ht = (t, e, s, i) => {
1228
- for (var r = i > 1 ? void 0 : i ? It(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1389
+ Le(0, h("RendererApi")),
1390
+ Le(1, h("IEditorStore"))
1391
+ ], oe);
1392
+ var Kt = Object.getOwnPropertyDescriptor, qt = (t, e, s, i) => {
1393
+ for (var r = i > 1 ? void 0 : i ? Kt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1229
1394
  (n = t[o]) && (r = n(r) || r);
1230
1395
  return r;
1231
- }, Pe = (t, e) => (s, i) => e(s, i, t);
1232
- let Q = class extends he {
1396
+ }, Ce = (t, e) => (s, i) => e(s, i, t);
1397
+ let ne = class extends ue {
1233
1398
  /** Инструмент, которым управляет хендлер, нужен только менеджеру */
1234
- mode = O.Rotate;
1399
+ mode = C.Rotate;
1235
1400
  constructor(t, e) {
1236
1401
  super(t, e);
1237
1402
  }
1238
1403
  };
1239
- Q = Ht([
1404
+ ne = qt([
1240
1405
  u(),
1241
- Pe(0, l("RendererApi")),
1242
- Pe(1, l("IEditorStore"))
1243
- ], Q);
1244
- const H = 31;
1245
- var kt = Object.getOwnPropertyDescriptor, Nt = (t, e, s, i) => {
1246
- for (var r = i > 1 ? void 0 : i ? kt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1406
+ Ce(0, h("RendererApi")),
1407
+ Ce(1, h("IEditorStore"))
1408
+ ], ne);
1409
+ var Qt = Object.getOwnPropertyDescriptor, Jt = (t, e, s, i) => {
1410
+ for (var r = i > 1 ? void 0 : i ? Qt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1247
1411
  (n = t[o]) && (r = n(r) || r);
1248
1412
  return r;
1249
- }, Oe = (t, e) => (s, i) => e(s, i, t);
1250
- let J = class {
1413
+ }, Ae = (t, e) => (s, i) => e(s, i, t);
1414
+ let ae = class {
1251
1415
  constructor(t, e) {
1252
- this._api = t, this._store = e, this._api.enableCameraLayer(H), this._hoverLine = this._makeOverlayLine(this._hoverColor), this._selectLine = this._makeOverlayLine(this._selectColor), this._api.addObject(this._hoverLine, H), this._api.addObject(this._selectLine, H);
1416
+ this._api = t, this._store = e, this._api.enableCameraLayer(T), this._hoverLine = this._makeOverlayLine(this._hoverColor), this._selectLine = this._makeOverlayLine(this._selectColor), this._api.addObject(this._hoverLine, T), this._api.addObject(this._selectLine, T);
1253
1417
  }
1254
1418
  /** Режим, которым управляет хендлер, нужен только менеджеру */
1255
- mode = M.Edge;
1419
+ mode = v.Edge;
1256
1420
  /** Текущее наведённое ребро. */
1257
1421
  _hoverLine;
1258
1422
  /** Текущее выбранное ребро. */
@@ -1263,9 +1427,9 @@ let J = class {
1263
1427
  _selected = null;
1264
1428
  // Цвета, необходимые для переключения
1265
1429
  /** Цвет ребра, на которое навелись */
1266
- _hoverColor = ne;
1430
+ _hoverColor = z;
1267
1431
  /** Цвет выделенного ребра */
1268
- _selectColor = ae;
1432
+ _selectColor = F;
1269
1433
  /** Обработка текущего режима выборки. */
1270
1434
  handle(t, e) {
1271
1435
  if (this._api.setRaycastMode(this.mode), e === S.Hover) {
@@ -1315,7 +1479,7 @@ let J = class {
1315
1479
  opacity: 1
1316
1480
  }), i = new a.Line(e, s);
1317
1481
  return i.renderOrder = 1e3, i.raycast = () => {
1318
- }, i.layers.set(H), i.visible = !1, i;
1482
+ }, i.layers.set(T), i.visible = !1, i;
1319
1483
  }
1320
1484
  /** Локальные точки сегмента переводим в target (который висит на сцене) */
1321
1485
  _writeWorldSegment(t, e, s) {
@@ -1323,8 +1487,8 @@ let J = class {
1323
1487
  e.matrixWorld
1324
1488
  ), c = new a.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1325
1489
  e.matrixWorld
1326
- ), p = t.geometry.getAttribute("position");
1327
- p.setXYZ(0, n.x, n.y, n.z), p.setXYZ(1, c.x, c.y, c.z), p.needsUpdate = !0;
1490
+ ), _ = t.geometry.getAttribute("position");
1491
+ _.setXYZ(0, n.x, n.y, n.z), _.setXYZ(1, c.x, c.y, c.z), _.needsUpdate = !0;
1328
1492
  }
1329
1493
  _same(t, e) {
1330
1494
  return !!t && !!e && t.lines === e.lines && t.seg === e.seg;
@@ -1335,79 +1499,69 @@ let J = class {
1335
1499
  e.matrixWorld
1336
1500
  ), c = new a.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1337
1501
  e.matrixWorld
1338
- ), p = new a.Vector3().subVectors(c, n), f = p.length();
1339
- if (!isFinite(f) || f === 0) return;
1340
- const g = new a.Vector3().addVectors(n, c).multiplyScalar(0.5);
1341
- t.position.copy(g);
1342
- const x = t.geometry;
1343
- let w = x.getAttribute("position");
1344
- (!w || w.count < 2) && (x.setAttribute("position", new a.BufferAttribute(new Float32Array(6), 3)), w = x.getAttribute("position")), w.setXYZ(0, -f / 2, 0, 0), w.setXYZ(1, f / 2, 0, 0), w.needsUpdate = !0, p.normalize();
1345
- const C = new a.Quaternion().setFromUnitVectors(new a.Vector3(1, 0, 0), p);
1346
- t.quaternion.copy(C), t.updateMatrixWorld(!0);
1347
- }
1348
- /** Поиск родителя ребер (сама фигура) */
1349
- _findParentMesh(t) {
1350
- let e = t;
1351
- for (; e; ) {
1352
- if (e.isMesh) return e;
1353
- e = e.parent;
1354
- }
1355
- return null;
1502
+ ), _ = new a.Vector3().subVectors(c, n), m = _.length();
1503
+ if (!isFinite(m) || m === 0) return;
1504
+ const f = new a.Vector3().addVectors(n, c).multiplyScalar(0.5);
1505
+ t.position.copy(f);
1506
+ const L = t.geometry;
1507
+ let b = L.getAttribute("position");
1508
+ (!b || b.count < 2) && (L.setAttribute("position", new a.BufferAttribute(new Float32Array(6), 3)), b = L.getAttribute("position")), b.setXYZ(0, -m / 2, 0, 0), b.setXYZ(1, m / 2, 0, 0), b.needsUpdate = !0, _.normalize();
1509
+ const O = new a.Quaternion().setFromUnitVectors(new a.Vector3(1, 0, 0), _);
1510
+ t.quaternion.copy(O), t.updateMatrixWorld(!0);
1356
1511
  }
1357
1512
  /** Запись метаданных выбранного ребра для использования инструментов */
1358
1513
  _prepareEdgeMetadata(t, e) {
1359
- const s = this._findParentMesh(t);
1514
+ const s = ke(t);
1360
1515
  if (!s) return;
1361
1516
  const i = t.geometry.getAttribute("position"), r = e * 2, o = r + 1, n = new a.Vector3(i.getX(r), i.getY(r), i.getZ(r)).applyMatrix4(
1362
1517
  t.matrixWorld
1363
1518
  ), c = new a.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1364
1519
  t.matrixWorld
1365
- ), p = new a.Matrix4().copy(s.matrixWorld).invert(), f = n.clone().applyMatrix4(p), g = c.clone().applyMatrix4(p), w = s.geometry.getAttribute("position"), C = new a.Vector3(), P = 1e-6, le = [], ce = [];
1366
- for (let b = 0; b < w.count; b++)
1367
- C.fromBufferAttribute(w, b), C.distanceToSquared(f) < P * P ? le.push(b) : C.distanceToSquared(g) < P * P && ce.push(b);
1368
- const de = new a.Matrix4().copy(t.matrixWorld).invert(), Re = n.clone().applyMatrix4(de), je = c.clone().applyMatrix4(de), _e = t.geometry.getAttribute("position"), N = new a.Vector3(), pe = [], ue = [];
1369
- for (let b = 0; b < _e.count; b++)
1370
- N.fromBufferAttribute(_e, b), N.distanceToSquared(Re) < P * P ? pe.push(b) : N.distanceToSquared(je) < P * P && ue.push(b);
1520
+ ), _ = new a.Matrix4().copy(s.matrixWorld).invert(), m = n.clone().applyMatrix4(_), f = c.clone().applyMatrix4(_), b = s.geometry.getAttribute("position"), O = new a.Vector3(), y = 1e-6, M = [], N = [];
1521
+ for (let E = 0; E < b.count; E++)
1522
+ O.fromBufferAttribute(b, E), O.distanceToSquared(m) < y * y ? M.push(E) : O.distanceToSquared(f) < y * y && N.push(E);
1523
+ const I = new a.Matrix4().copy(t.matrixWorld).invert(), Y = n.clone().applyMatrix4(I), A = c.clone().applyMatrix4(I), me = t.geometry.getAttribute("position"), Z = new a.Vector3(), fe = [], ge = [];
1524
+ for (let E = 0; E < me.count; E++)
1525
+ Z.fromBufferAttribute(me, E), Z.distanceToSquared(Y) < y * y ? fe.push(E) : Z.distanceToSquared(A) < y * y && ge.push(E);
1371
1526
  this._selectLine.userData.edgeInfo = {
1372
1527
  lines: t,
1373
1528
  seg: e,
1374
1529
  mesh: s,
1375
- aIndices: le,
1376
- bIndices: ce,
1377
- aEdgeIndices: pe,
1378
- bEdgeIndices: ue
1530
+ aIndices: M,
1531
+ bIndices: N,
1532
+ aEdgeIndices: fe,
1533
+ bEdgeIndices: ge
1379
1534
  };
1380
1535
  }
1381
1536
  };
1382
- J = Nt([
1537
+ ae = Jt([
1383
1538
  u(),
1384
- Oe(0, l("RendererApi")),
1385
- Oe(1, l("IEditorStore"))
1386
- ], J);
1387
- var Yt = Object.getOwnPropertyDescriptor, Ut = (t, e, s, i) => {
1388
- for (var r = i > 1 ? void 0 : i ? Yt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1539
+ Ae(0, h("RendererApi")),
1540
+ Ae(1, h("IEditorStore"))
1541
+ ], ae);
1542
+ var es = Object.getOwnPropertyDescriptor, ts = (t, e, s, i) => {
1543
+ for (var r = i > 1 ? void 0 : i ? es(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1389
1544
  (n = t[o]) && (r = n(r) || r);
1390
1545
  return r;
1391
- }, $t = (t, e) => (s, i) => e(s, i, t);
1392
- let ee = class {
1546
+ }, ss = (t, e) => (s, i) => e(s, i, t);
1547
+ let he = class {
1393
1548
  constructor(t) {
1394
1549
  this._api = t;
1395
1550
  }
1396
1551
  /** Режим редактирования сцены */
1397
- mode = j.AddFigure;
1552
+ mode = V.AddFigure;
1398
1553
  /** Последняя добавленная фигура, нужно для отката через `ctrl + z`. */
1399
1554
  _lastAddedMesh = null;
1400
1555
  /** Добавление базовых фигур на сцену, которые приписаны в `FigureType`. */
1401
1556
  handle(t) {
1402
- const e = Be[t](), s = e.getAttribute("position");
1557
+ const e = Je[t](), s = e.getAttribute("position");
1403
1558
  s && s.setUsage && s.setUsage(a.DynamicDrawUsage);
1404
- const i = new a.Mesh(e, Le);
1405
- i.layers.enable(0);
1406
- const r = new a.EdgesGeometry(i.geometry), o = new a.LineSegments(
1407
- r,
1408
- new a.LineBasicMaterial({ color: Pt, linewidth: 1 })
1409
- );
1410
- o.layers.set(1), i.add(o), this._api.addMesh(i), this._lastAddedMesh = i;
1559
+ const i = new a.Mesh(e, Re);
1560
+ i.layers.enable(He);
1561
+ const r = Ne(i.geometry);
1562
+ i.add(r);
1563
+ const o = Ve(i.geometry);
1564
+ i.add(o), this._api.addMesh(i), this._lastAddedMesh = i;
1411
1565
  }
1412
1566
  /** Срабатывает только на `ctrl + z`. */
1413
1567
  rollback() {
@@ -1418,27 +1572,26 @@ let ee = class {
1418
1572
  this._lastAddedMesh = null;
1419
1573
  }
1420
1574
  };
1421
- ee = Ut([
1575
+ he = ts([
1422
1576
  u(),
1423
- $t(0, l("RendererApi"))
1424
- ], ee);
1425
- const zt = (t) => !!t && t.isMesh;
1426
- var Ft = Object.getOwnPropertyDescriptor, Wt = (t, e, s, i) => {
1427
- for (var r = i > 1 ? void 0 : i ? Ft(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1577
+ ss(0, h("RendererApi"))
1578
+ ], he);
1579
+ var is = Object.getOwnPropertyDescriptor, rs = (t, e, s, i) => {
1580
+ for (var r = i > 1 ? void 0 : i ? is(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1428
1581
  (n = t[o]) && (r = n(r) || r);
1429
1582
  return r;
1430
- }, De = (t, e) => (s, i) => e(s, i, t);
1431
- let te = class {
1583
+ }, xe = (t, e) => (s, i) => e(s, i, t);
1584
+ let le = class {
1432
1585
  constructor(t, e) {
1433
1586
  this._api = t, this._store = e;
1434
1587
  }
1435
1588
  /** Режим редактирования сцены */
1436
- mode = j.DeleteFigure;
1589
+ mode = V.DeleteFigure;
1437
1590
  /** Последняя удаленная фигура, сохраняем для отката через `ctrl + z` */
1438
1591
  _lastDeletedMesh = null;
1439
1592
  handle() {
1440
1593
  const t = this._store.getSelectedObject();
1441
- zt(t) && (this._api.removeMesh(t), this._store.setSelectedObject(null), this._lastDeletedMesh = t);
1594
+ lt(t) && (this._api.removeMesh(t), this._store.setSelectedObject(null), this._lastDeletedMesh = t);
1442
1595
  }
1443
1596
  /** Срабатывает только на `ctrl + z`. */
1444
1597
  rollback() {
@@ -1449,17 +1602,17 @@ let te = class {
1449
1602
  this._lastDeletedMesh = null;
1450
1603
  }
1451
1604
  };
1452
- te = Wt([
1605
+ le = rs([
1453
1606
  u(),
1454
- De(0, l("RendererApi")),
1455
- De(1, l("IEditorStore"))
1456
- ], te);
1457
- var Zt = Object.getOwnPropertyDescriptor, Bt = (t, e, s, i) => {
1458
- for (var r = i > 1 ? void 0 : i ? Zt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1607
+ xe(0, h("RendererApi")),
1608
+ xe(1, h("IEditorStore"))
1609
+ ], le);
1610
+ var os = Object.getOwnPropertyDescriptor, ns = (t, e, s, i) => {
1611
+ for (var r = i > 1 ? void 0 : i ? os(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1459
1612
  (n = t[o]) && (r = n(r) || r);
1460
1613
  return r;
1461
- }, Xt = (t, e) => (s, i) => e(s, i, t);
1462
- let se = class {
1614
+ }, as = (t, e) => (s, i) => e(s, i, t);
1615
+ let ce = class {
1463
1616
  constructor(t) {
1464
1617
  this._renderer = t;
1465
1618
  }
@@ -1514,18 +1667,18 @@ let se = class {
1514
1667
  this._renderer.enableCameraLayer(t);
1515
1668
  }
1516
1669
  };
1517
- se = Bt([
1670
+ ce = ns([
1518
1671
  u(),
1519
- Xt(0, l("EditorRenderer"))
1520
- ], se);
1521
- var Vt = Object.getOwnPropertyDescriptor, Kt = (t, e, s, i) => {
1522
- for (var r = i > 1 ? void 0 : i ? Vt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1672
+ as(0, h("EditorRenderer"))
1673
+ ], ce);
1674
+ var hs = Object.getOwnPropertyDescriptor, ls = (t, e, s, i) => {
1675
+ for (var r = i > 1 ? void 0 : i ? hs(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1523
1676
  (n = t[o]) && (r = n(r) || r);
1524
1677
  return r;
1525
- }, A = (t, e) => (s, i) => e(s, i, t);
1526
- let ie = class {
1678
+ }, H = (t, e) => (s, i) => e(s, i, t);
1679
+ let de = class {
1527
1680
  constructor(t, e, s, i, r) {
1528
- this._displayManager = t, this._selectManager = e, this._toolManager = s, this._sceneManager = i, this._renderer = r, this.setSelectMode(M.Mesh), this.setToolMode(O.Translate);
1681
+ this._displayManager = t, this._selectManager = e, this._toolManager = s, this._sceneManager = i, this._renderer = r, this.setSelectMode(v.Mesh), this.setToolMode(C.Translate);
1529
1682
  }
1530
1683
  setDisplayMode(t) {
1531
1684
  this._displayManager.manage(t);
@@ -1552,32 +1705,32 @@ let ie = class {
1552
1705
  this._displayManager.dispose(), this._selectManager.dispose(), this._renderer.dispose();
1553
1706
  }
1554
1707
  };
1555
- ie = Kt([
1708
+ de = ls([
1556
1709
  u(),
1557
- A(0, l("IDisplayManager")),
1558
- A(1, l("ISelectManager")),
1559
- A(2, l("IToolManager")),
1560
- A(3, l("ISceneManager")),
1561
- A(4, l("EditorRenderer"))
1562
- ], ie);
1563
- var Gt = Object.getOwnPropertyDescriptor, qt = (t, e, s, i) => {
1564
- for (var r = i > 1 ? void 0 : i ? Gt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1710
+ H(0, h("IDisplayManager")),
1711
+ H(1, h("ISelectManager")),
1712
+ H(2, h("IToolManager")),
1713
+ H(3, h("ISceneManager")),
1714
+ H(4, h("EditorRenderer"))
1715
+ ], de);
1716
+ var cs = Object.getOwnPropertyDescriptor, ds = (t, e, s, i) => {
1717
+ for (var r = i > 1 ? void 0 : i ? cs(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1565
1718
  (n = t[o]) && (r = n(r) || r);
1566
1719
  return r;
1567
1720
  };
1568
- let re = class {
1721
+ let _e = class {
1569
1722
  /** Текущий режим выборки. */
1570
- _selectMode = M.Mesh;
1723
+ _selectMode = v.Mesh;
1571
1724
  /** Текущий выбранный инструмент. */
1572
- _toolType = O.Translate;
1725
+ _toolType = C.Translate;
1573
1726
  /** Выбранный режим отображения. */
1574
- _displayMode = R.Plane;
1727
+ _displayMode = k.Plane;
1575
1728
  /** Выбранный объект на сцене. */
1576
1729
  _selectedObject = null;
1577
1730
  /** Слушатели событий по изменению выбранного объекта. */
1578
1731
  _selectedListeners = /* @__PURE__ */ new Set();
1579
1732
  constructor() {
1580
- Ze(this, {}, { autoBind: !0 });
1733
+ Qe(this, {}, { autoBind: !0 });
1581
1734
  }
1582
1735
  /** @inheritdoc */
1583
1736
  getSelectMode() {
@@ -1619,24 +1772,24 @@ let re = class {
1619
1772
  return this._selectedListeners.add(t), () => this._selectedListeners.delete(t);
1620
1773
  }
1621
1774
  };
1622
- re = qt([
1775
+ _e = ds([
1623
1776
  u()
1624
- ], re);
1625
- let Te = !1;
1626
- const d = Fe.createChildContainer();
1627
- function Qt(t) {
1628
- return Te || (d.registerInstance("Canvas", t), d.registerSingleton("EventBus", $), d.registerSingleton("EditorRenderer", z), d.registerSingleton("RendererApi", se), d.registerSingleton("IDisplayHandler", X), d.registerSingleton("ISelectHandler", V), d.registerSingleton("ISelectHandler", K), d.registerSingleton("ISelectHandler", J), d.registerSingleton("IToolHandler", G), d.registerSingleton("IToolHandler", q), d.registerSingleton("IToolHandler", Q), d.registerSingleton("ISceneHandler", ee), d.registerSingleton("ISceneHandler", te), d.registerSingleton("IDisplayManager", F), d.registerSingleton("ISelectManager", W), d.registerSingleton("IToolManager", Z), d.registerSingleton("ISceneManager", B), d.registerSingleton("EditorHub", ie), d.registerSingleton("IEditorStore", re), Te = !0), d;
1777
+ ], _e);
1778
+ let je = !1;
1779
+ const d = Ke.createChildContainer();
1780
+ function _s(t) {
1781
+ return je || (d.registerInstance("Canvas", t), d.registerSingleton("EventBus", X), d.registerSingleton("EditorRenderer", G), d.registerSingleton("RendererApi", ce), d.registerSingleton("IDisplayHandler", ee), d.registerSingleton("ISelectHandler", te), d.registerSingleton("ISelectHandler", se), d.registerSingleton("ISelectHandler", ae), d.registerSingleton("ISelectHandler", ie), d.registerSingleton("IToolHandler", re), d.registerSingleton("IToolHandler", oe), d.registerSingleton("IToolHandler", ne), d.registerSingleton("ISceneHandler", he), d.registerSingleton("ISceneHandler", le), d.registerSingleton("IDisplayManager", K), d.registerSingleton("ISelectManager", q), d.registerSingleton("IToolManager", Q), d.registerSingleton("ISceneManager", J), d.registerSingleton("EditorHub", de), d.registerSingleton("IEditorStore", _e), je = !0), d;
1629
1782
  }
1630
- function hs(t) {
1631
- return Qt(t).resolve("EditorHub");
1783
+ function Es(t) {
1784
+ return _s(t).resolve("EditorHub");
1632
1785
  }
1633
1786
  export {
1634
- ie as EditorHub,
1635
- z as EditorRenderer,
1636
- $ as EventBus,
1637
- L as EventTopics,
1638
- as as ObjLoader,
1639
- ns as PreviewRenderer,
1640
- Ce as Renderer,
1641
- hs as createAppHub
1787
+ de as EditorHub,
1788
+ G as EditorRenderer,
1789
+ X as EventBus,
1790
+ R as EventTopics,
1791
+ Ms as ObjLoader,
1792
+ ys as PreviewRenderer,
1793
+ Ie as Renderer,
1794
+ Es as createAppHub
1642
1795
  };