@shopware-ag/dive 2.1.0 → 2.1.2

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 (30) hide show
  1. package/build/chunks/{AssetCache-BQRROeKj.cjs → AssetCache-TvwR2H4n.cjs} +1 -1
  2. package/build/chunks/{AssetCache-D-tIG2cD.mjs → AssetCache-nWe2kXVH.mjs} +1 -1
  3. package/build/chunks/{AssetLoader-Da8hFXRL.mjs → AssetLoader-BUfmW1RY.mjs} +2 -2
  4. package/build/chunks/{AssetLoader-CoPAaRfM.cjs → AssetLoader-CX9EEQuM.cjs} +1 -1
  5. package/build/chunks/{FileTypes-CTHWb2IV.mjs → FileTypes-BIdZgVcQ.mjs} +283 -321
  6. package/build/chunks/FileTypes-CfyYHJWw.cjs +29 -0
  7. package/build/chunks/{SelectTool-Bcc2oxWf.mjs → SelectTool-CwQY2P8A.mjs} +1 -1
  8. package/build/chunks/{SelectTool-ut3Qwv63.cjs → SelectTool-LE2592aq.cjs} +1 -1
  9. package/build/components/model/Model.d.ts +3 -3
  10. package/build/components/primitive/Primitive.d.ts +6 -7
  11. package/build/dive.cjs +1 -1
  12. package/build/dive.mjs +2 -2
  13. package/build/plugins/ar/index.cjs +1 -1
  14. package/build/plugins/ar/index.mjs +1 -1
  15. package/build/plugins/assetcache/index.cjs +1 -1
  16. package/build/plugins/assetcache/index.mjs +1 -1
  17. package/build/plugins/assetloader/index.cjs +1 -1
  18. package/build/plugins/assetloader/index.mjs +1 -1
  19. package/build/plugins/orbitcontroller/index.cjs +1 -1
  20. package/build/plugins/orbitcontroller/index.mjs +1 -1
  21. package/build/plugins/orientationdisplay/index.cjs +1 -1
  22. package/build/plugins/orientationdisplay/index.mjs +1 -1
  23. package/build/plugins/quickview/index.cjs +1 -1
  24. package/build/plugins/quickview/index.mjs +16 -22
  25. package/build/plugins/state/index.cjs +4 -4
  26. package/build/plugins/state/index.mjs +746 -750
  27. package/build/plugins/toolbox/index.cjs +1 -1
  28. package/build/plugins/toolbox/index.mjs +2 -2
  29. package/package.json +1 -1
  30. package/build/chunks/FileTypes-B2n185uW.cjs +0 -29
@@ -1,10 +1,10 @@
1
- var J = Object.defineProperty;
2
- var $ = (r, n, t) => n in r ? J(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
- var i = (r, n, t) => $(r, typeof n != "symbol" ? n + "" : n, t);
4
- import { WebGLRenderer as j, PCFSoftShadowMap as tt, PCFShadowMap as et, BasicShadowMap as it, MathUtils as E, Object3D as w, AmbientLight as st, PointLight as nt, SphereGeometry as T, MeshBasicMaterial as z, FrontSide as G, Mesh as S, HemisphereLight as at, DirectionalLight as ot, Vector3 as h, Box3 as I, MeshStandardMaterial as L, Raycaster as F, Color as g, CylinderGeometry as rt, BufferGeometry as U, BufferAttribute as V, BoxGeometry as v, ConeGeometry as ht, LineDashedMaterial as lt, Line as dt, PlaneGeometry as ct, GridHelper as ut, Scene as pt, TOUCH as f, MOUSE as m, EventDispatcher as mt, Spherical as A, Vector2 as p, Quaternion as x, AxesHelper as gt, Matrix4 as _t, OrthographicCamera as ft, Vector4 as wt, Box3Helper as yt, Sphere as bt } from "three";
5
- import { P as _, U as Dt, H as Et, C as y, a as St, D as C } from "./PerspectiveCamera-8tnOn5YS.mjs";
6
- import M from "three-spritetext";
7
- class Pt {
1
+ var $ = Object.defineProperty;
2
+ var j = (r, s, t) => s in r ? $(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
+ var i = (r, s, t) => j(r, typeof s != "symbol" ? s + "" : s, t);
4
+ import { WebGLRenderer as tt, PCFSoftShadowMap as et, PCFShadowMap as it, BasicShadowMap as st, MathUtils as S, Object3D as w, AmbientLight as at, PointLight as nt, SphereGeometry as I, MeshBasicMaterial as B, FrontSide as G, Mesh as P, HemisphereLight as rt, DirectionalLight as ot, Vector3 as h, Box3 as T, MeshStandardMaterial as M, Raycaster as ht, CylinderGeometry as lt, BufferGeometry as F, BufferAttribute as R, BoxGeometry as v, ConeGeometry as dt, LineDashedMaterial as ct, Line as ut, PlaneGeometry as pt, Color as g, GridHelper as mt, Scene as _t, TOUCH as _, MOUSE as p, EventDispatcher as gt, Spherical as A, Vector2 as u, Quaternion as x, AxesHelper as ft, Matrix4 as wt, OrthographicCamera as yt, Vector4 as bt, Box3Helper as Dt, Sphere as Et } from "three";
5
+ import { P as f, U as St, H as Pt, C as y, a as vt, D as C } from "./PerspectiveCamera-8tnOn5YS.mjs";
6
+ import L from "three-spritetext";
7
+ class Lt {
8
8
  constructor() {
9
9
  i(this, "isDIVEClock", !0);
10
10
  i(this, "_lastTime", 0);
@@ -17,26 +17,26 @@ class Pt {
17
17
  stop() {
18
18
  this._isRunning = !1;
19
19
  }
20
- addTicker(n) {
21
- this._tickers.find((t) => t.uuid === n.uuid) || this._tickers.push(n);
20
+ addTicker(s) {
21
+ this._tickers.find((t) => t.uuid === s.uuid) || this._tickers.push(s);
22
22
  }
23
- hasTicker(n) {
24
- return this._tickers.find((t) => t.uuid === n.uuid) !== void 0;
23
+ hasTicker(s) {
24
+ return this._tickers.find((t) => t.uuid === s.uuid) !== void 0;
25
25
  }
26
- removeTicker(n) {
27
- const t = this._tickers.findIndex((e) => e.uuid === n.uuid);
26
+ removeTicker(s) {
27
+ const t = this._tickers.findIndex((e) => e.uuid === s.uuid);
28
28
  t !== -1 && this._tickers.splice(t, 1);
29
29
  }
30
30
  dispose() {
31
31
  this.stop(), this._tickers = [], this._isRunning = !1, this._lastTime = 0;
32
32
  }
33
- _tick(n) {
33
+ _tick(s) {
34
34
  if (!this._isRunning) return;
35
- const t = (n - this._lastTime) / 1e3;
36
- this._lastTime = n, this._tickers.forEach((e) => e.tick(t)), requestAnimationFrame(this._tick.bind(this));
35
+ const t = (s - this._lastTime) / 1e3;
36
+ this._lastTime = s, this._tickers.forEach((e) => e.tick(t)), requestAnimationFrame(this._tick.bind(this));
37
37
  }
38
38
  }
39
- const H = {
39
+ const U = {
40
40
  canvas: void 0,
41
41
  antialias: !0,
42
42
  alpha: !0,
@@ -48,13 +48,13 @@ const H = {
48
48
  shadows: !0,
49
49
  shadowQuality: "high"
50
50
  };
51
- class Y {
52
- constructor(n, t, e) {
51
+ class H {
52
+ constructor(s, t, e) {
53
53
  i(this, "isDIVERenderer", !0);
54
54
  i(this, "_webglrenderer");
55
55
  i(this, "_settings");
56
- this._scene = n, this._camera = t, this._settings = {
57
- ...H,
56
+ this._scene = s, this._camera = t, this._settings = {
57
+ ...U,
58
58
  ...e ?? {}
59
59
  }, this._webglrenderer = this._createWebGLRenderer();
60
60
  }
@@ -67,62 +67,62 @@ class Y {
67
67
  render() {
68
68
  this._webglrenderer.render(this._scene, this._camera);
69
69
  }
70
- onResize(n, t) {
71
- this._webglrenderer.setSize(n, t, !1);
70
+ onResize(s, t) {
71
+ this._webglrenderer.setSize(s, t, !1);
72
72
  }
73
73
  dispose() {
74
74
  this._webglrenderer.dispose();
75
75
  }
76
- setCanvas(n) {
77
- this._webglrenderer.dispose(), this._settings.canvas = n, this._webglrenderer = this._createWebGLRenderer();
76
+ setCanvas(s) {
77
+ this._webglrenderer.dispose(), this._settings.canvas = s, this._webglrenderer = this._createWebGLRenderer();
78
78
  }
79
79
  _createWebGLRenderer() {
80
- const n = new j(this._settings);
81
- return n.shadowMap.enabled = this._settings.shadows, n.shadowMap.type = this._settings.shadowQuality === "high" ? tt : this._settings.shadowQuality === "medium" ? et : it, n.setPixelRatio(window.devicePixelRatio), n;
80
+ const s = new tt(this._settings);
81
+ return s.shadowMap.enabled = this._settings.shadows, s.shadowMap.type = this._settings.shadowQuality === "high" ? et : this._settings.shadowQuality === "medium" ? it : st, s.setPixelRatio(window.devicePixelRatio), s;
82
82
  }
83
83
  }
84
- const te = Y;
85
- class vt {
86
- constructor(n, t) {
84
+ const te = H;
85
+ class xt {
86
+ constructor(s, t) {
87
87
  i(this, "isDIVEResizeManager", !0);
88
88
  i(this, "_resizeObserver");
89
89
  i(this, "_width", 0);
90
90
  i(this, "_height", 0);
91
- this._renderer = n, this._camera = t, this._resizeObserver = new ResizeObserver((e) => {
92
- const s = e[0], { width: a, height: o } = s.contentRect;
93
- a === this._width && o === this._height || (this._renderer.onResize(a, o), this._camera.onResize(a, o), this._width = a, this._height = o);
91
+ this._renderer = s, this._camera = t, this._resizeObserver = new ResizeObserver((e) => {
92
+ const a = e[0], { width: n, height: o } = a.contentRect;
93
+ n === this._width && o === this._height || (this._renderer.onResize(n, o), this._camera.onResize(n, o), this._width = n, this._height = o);
94
94
  }), this._observeCanvas(this._renderer.canvas);
95
95
  }
96
- setCanvas(n) {
97
- this._resizeObserver.disconnect(), this._observeCanvas(n);
98
- const { width: t, height: e } = n.getBoundingClientRect();
96
+ setCanvas(s) {
97
+ this._resizeObserver.disconnect(), this._observeCanvas(s);
98
+ const { width: t, height: e } = s.getBoundingClientRect();
99
99
  this._renderer.onResize(t, e), this._camera.onResize(t, e), this._width = t, this._height = e;
100
100
  }
101
101
  dispose() {
102
102
  this._resizeObserver.disconnect();
103
103
  }
104
- _observeCanvas(n) {
105
- if (n.parentElement)
106
- this._resizeObserver.observe(n.parentElement);
104
+ _observeCanvas(s) {
105
+ if (s.parentElement)
106
+ this._resizeObserver.observe(s.parentElement);
107
107
  else {
108
108
  const t = setInterval(() => {
109
- n.parentElement && (this._resizeObserver.observe(n.parentElement), clearInterval(t));
109
+ s.parentElement && (this._resizeObserver.observe(s.parentElement), clearInterval(t));
110
110
  }, 16);
111
111
  }
112
112
  }
113
113
  }
114
114
  class O {
115
- constructor(n, t, e) {
115
+ constructor(s, t, e) {
116
116
  i(this, "isDIVEView", !0);
117
- i(this, "uuid", E.generateUUID());
117
+ i(this, "uuid", S.generateUUID());
118
118
  i(this, "_paused", !1);
119
119
  i(this, "_renderer");
120
120
  i(this, "_resizeManager");
121
- this._scene = n, this._camera = t, this._settings = e, this._renderer = new Y(
121
+ this._scene = s, this._camera = t, this._settings = e, this._renderer = new H(
122
122
  this._scene,
123
123
  this._camera,
124
124
  this._settings
125
- ), this._resizeManager = new vt(
125
+ ), this._resizeManager = new xt(
126
126
  this._renderer,
127
127
  this._camera
128
128
  );
@@ -142,11 +142,11 @@ class O {
142
142
  dispose() {
143
143
  this._resizeManager.dispose(), this._renderer.dispose();
144
144
  }
145
- onResize(n, t) {
146
- this._renderer.onResize(n, t), this._camera.onResize(n, t);
145
+ onResize(s, t) {
146
+ this._renderer.onResize(s, t), this._camera.onResize(s, t);
147
147
  }
148
- setCanvas(n) {
149
- this._renderer.setCanvas(n), this._resizeManager.setCanvas(n), this.onResize(
148
+ setCanvas(s) {
149
+ this._renderer.setCanvas(s), this._resizeManager.setCanvas(s), this.onResize(
150
150
  this._renderer.canvas.clientWidth,
151
151
  this._renderer.canvas.clientHeight
152
152
  );
@@ -159,14 +159,14 @@ class O {
159
159
  this._paused = !1;
160
160
  }
161
161
  }
162
- class Mt extends w {
162
+ class It extends w {
163
163
  constructor() {
164
164
  super();
165
165
  i(this, "isDIVELight", !0);
166
166
  i(this, "isDIVEAmbientLight", !0);
167
167
  i(this, "isSelectable", !0);
168
168
  i(this, "_light");
169
- this.name = "DIVEAmbientLight", this._light = new st(16777215, 1), this._light.layers.mask = _, this.add(this._light);
169
+ this.name = "DIVEAmbientLight", this._light = new at(16777215, 1), this._light.layers.mask = f, this.add(this._light);
170
170
  }
171
171
  setColor(t) {
172
172
  this._light.color = t;
@@ -178,7 +178,7 @@ class Mt extends w {
178
178
  this._light.visible = t;
179
179
  }
180
180
  }
181
- class xt extends w {
181
+ class Tt extends w {
182
182
  constructor() {
183
183
  super();
184
184
  i(this, "isDIVELight", !0);
@@ -188,18 +188,18 @@ class xt extends w {
188
188
  i(this, "gizmo", null);
189
189
  i(this, "light");
190
190
  i(this, "mesh");
191
- this.name = "DIVEPointLight", this.light = new nt(16777215, 1), this.light.layers.mask = _, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
192
- const t = 0.1, e = new T(
191
+ this.name = "DIVEPointLight", this.light = new nt(16777215, 1), this.light.layers.mask = f, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
192
+ const t = 0.1, e = new I(
193
193
  t,
194
194
  t * 320,
195
195
  t * 320
196
- ), s = new z({
196
+ ), a = new B({
197
197
  color: this.light.color,
198
198
  transparent: !0,
199
199
  opacity: 0.8,
200
200
  side: G
201
201
  });
202
- this.mesh = new S(e, s), this.mesh.layers.mask = Dt, this.add(this.mesh);
202
+ this.mesh = new P(e, a), this.mesh.layers.mask = St, this.add(this.mesh);
203
203
  }
204
204
  setColor(t) {
205
205
  this.light.color = t, this.mesh.material.color = t;
@@ -236,7 +236,7 @@ class xt extends w {
236
236
  });
237
237
  }
238
238
  }
239
- class Tt extends w {
239
+ class Mt extends w {
240
240
  constructor() {
241
241
  super();
242
242
  i(this, "isDIVELight", !0);
@@ -244,7 +244,7 @@ class Tt extends w {
244
244
  i(this, "isSelectable", !0);
245
245
  i(this, "_hemiLight");
246
246
  i(this, "_dirLight");
247
- this.name = "DIVESceneLight", this._hemiLight = new at(16777215, 16777215, 2), this._hemiLight.layers.mask = _, this._hemiLight.position.set(0, 50, 0), this._hemiLight.visible = !0, this.add(this._hemiLight), this._dirLight = new ot(16777215, 3), this._dirLight.layers.mask = _, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.visible = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
247
+ this.name = "DIVESceneLight", this._hemiLight = new rt(16777215, 16777215, 2), this._hemiLight.layers.mask = f, this._hemiLight.position.set(0, 50, 0), this._hemiLight.visible = !0, this.add(this._hemiLight), this._dirLight = new ot(16777215, 3), this._dirLight.layers.mask = f, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.visible = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
248
248
  const t = 5;
249
249
  this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = t, this._dirLight.shadow.camera.top = t, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
250
250
  }
@@ -258,8 +258,8 @@ class Tt extends w {
258
258
  this._hemiLight.visible = t, this._dirLight.visible = t;
259
259
  }
260
260
  }
261
- const k = (r) => r.parent ? k(r.parent) : r;
262
- class P extends w {
261
+ const Y = (r) => r.parent ? Y(r.parent) : r;
262
+ class k extends w {
263
263
  constructor() {
264
264
  super();
265
265
  i(this, "isSelectable", !0);
@@ -268,7 +268,7 @@ class P extends w {
268
268
  i(this, "gizmo", null);
269
269
  i(this, "_positionWorldBuffer");
270
270
  i(this, "_boundingBox");
271
- this.layers.mask = _, this._positionWorldBuffer = new h(), this._boundingBox = new I();
271
+ this.layers.mask = f, this._positionWorldBuffer = new h(), this._boundingBox = new T();
272
272
  }
273
273
  setPosition(t) {
274
274
  if (!this.parent) {
@@ -329,7 +329,7 @@ class P extends w {
329
329
  });
330
330
  }
331
331
  }
332
- class It extends P {
332
+ class W extends k {
333
333
  constructor() {
334
334
  super();
335
335
  i(this, "isDIVEModel", !0);
@@ -342,10 +342,10 @@ class It extends P {
342
342
  return this._assetLoader || (this._assetLoader = new (await import("../plugins/assetloader/index.mjs")).AssetLoader()), this._assetLoader;
343
343
  }
344
344
  async setFromURL(t) {
345
- const s = await (await this._getAssetLoader()).load(t);
346
- return this.setFromGLTF(s), import("../plugins/state/index.mjs").then(({ State: a }) => {
345
+ const a = await (await this._getAssetLoader()).load(t);
346
+ return this.setFromGLTF(a), import("../plugins/state/index.mjs").then(({ State: n }) => {
347
347
  var o;
348
- (o = a.get(this.userData.id)) == null || o.performAction("MODEL_LOADED", {
348
+ (o = n.get(this.userData.id)) == null || o.performAction("MODEL_LOADED", {
349
349
  id: this.userData.id
350
350
  });
351
351
  }), this;
@@ -356,16 +356,16 @@ class It extends P {
356
356
  }), this.add(t), this;
357
357
  }
358
358
  setMaterial(t) {
359
- this._material || (this._material = new L()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
359
+ this._material || (this._material = new M()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
360
360
  }
361
361
  placeOnFloor() {
362
- var a, o, l, c;
362
+ var n, o, l, c;
363
363
  const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
364
- (o = (a = this._mesh) == null ? void 0 : a.geometry) == null || o.computeBoundingBox();
365
- const s = (c = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : c.boundingBox;
366
- !s || !this._mesh || (t.y = t.y - this._mesh.localToWorld(s.min.clone()).y, t.y !== e.y && import("../plugins/state/index.mjs").then(({ State: d }) => {
367
- var u;
368
- (u = d.get(this.userData.id)) == null || u.performAction("UPDATE_OBJECT", {
364
+ (o = (n = this._mesh) == null ? void 0 : n.geometry) == null || o.computeBoundingBox();
365
+ const a = (c = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : c.boundingBox;
366
+ !a || !this._mesh || (t.y = t.y - this._mesh.localToWorld(a.min.clone()).y, t.y !== e.y && import("../plugins/state/index.mjs").then(({ State: d }) => {
367
+ var m;
368
+ (m = d.get(this.userData.id)) == null || m.performAction("UPDATE_OBJECT", {
369
369
  id: this.userData.id,
370
370
  position: t,
371
371
  rotation: this.rotation,
@@ -385,85 +385,41 @@ class It extends P {
385
385
  this._boundingBox.getCenter(new h()).multiply(this.scale)
386
386
  );
387
387
  e.y = t + this.position.y;
388
- const s = new F(e, new h(0, -1, 0));
389
- s.layers.mask = _;
390
- const a = s.intersectObjects(
391
- k(this).root.children,
388
+ const a = new ht(e, new h(0, -1, 0));
389
+ a.layers.mask = f;
390
+ const n = a.intersectObjects(
391
+ Y(this).root.children,
392
392
  !0
393
393
  );
394
- if (a.length > 0) {
395
- const o = a[0].object;
394
+ if (n.length > 0) {
395
+ const o = n[0].object;
396
396
  o.geometry.computeBoundingBox();
397
- const l = o.geometry.boundingBox, c = o.localToWorld(l.max.clone()), d = this.position.clone(), u = this.position.clone().setY(c.y).sub(new h(0, t, 0));
398
- if (this.position.copy(u), this.position.y === d.y) return;
397
+ const l = o.geometry.boundingBox, c = o.localToWorld(l.max.clone()), d = this.position.clone(), m = this.position.clone().setY(c.y).sub(new h(0, t, 0));
398
+ if (this.position.copy(m), this.position.y === d.y) return;
399
399
  this.onMove();
400
400
  }
401
401
  }
402
402
  }
403
- class Lt extends P {
403
+ class kt extends W {
404
404
  constructor() {
405
405
  super();
406
406
  i(this, "isDIVEPrimitive", !0);
407
407
  i(this, "_mesh");
408
- this._mesh = new S(), this._mesh.layers.mask = _, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new L(), this.add(this._mesh);
408
+ i(this, "_material");
409
+ this._mesh = new P(), this._mesh.name = "PrimitiveMesh", this._mesh.layers.mask = f, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this.add(this._mesh), this._material = new M(), this._mesh.material = this._material;
409
410
  }
410
411
  setGeometry(t) {
411
412
  const e = this.assembleGeometry(t);
412
413
  e && (this._mesh.geometry = e, this._boundingBox.setFromObject(this._mesh));
413
414
  }
414
- setMaterial(t) {
415
- const e = this._mesh.material;
416
- t.vertexColors !== void 0 && (e.vertexColors = t.vertexColors), t.color !== void 0 && (e.color = new g(t.color)), t.map !== void 0 && (e.map = t.map), t.normalMap !== void 0 && (e.normalMap = t.normalMap), t.roughness !== void 0 && (e.roughness = t.roughness), t.roughnessMap !== void 0 && (e.roughnessMap = t.roughnessMap, e.roughnessMap && (e.roughness = 1)), t.metalness !== void 0 && (e.metalness = t.metalness), t.metalnessMap !== void 0 && (e.metalnessMap = t.metalnessMap, e.metalnessMap && (e.metalness = 0)), this._mesh && (this._mesh.material = e);
417
- }
418
- placeOnFloor() {
419
- var a, o, l, c;
420
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
421
- (o = (a = this._mesh) == null ? void 0 : a.geometry) == null || o.computeBoundingBox();
422
- const s = (c = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : c.boundingBox;
423
- !s || !this._mesh || (t.y = t.y - this._mesh.localToWorld(s.min.clone()).y, t.y !== e.y && import("../plugins/state/index.mjs").then(({ State: d }) => {
424
- var u;
425
- (u = d.get(this.userData.id)) == null || u.performAction("UPDATE_OBJECT", {
426
- id: this.userData.id,
427
- position: t,
428
- rotation: this.rotation,
429
- scale: this.scale
430
- });
431
- }));
432
- }
433
- dropIt() {
434
- if (!this.parent) {
435
- console.warn(
436
- "DIVEPrimitive: dropIt() called on a model that is not in the scene.",
437
- this
438
- );
439
- return;
440
- }
441
- const t = this._boundingBox.min.y * this.scale.y, e = this.localToWorld(
442
- this._boundingBox.getCenter(new h()).multiply(this.scale)
443
- );
444
- e.y = t + this.position.y;
445
- const s = new F(e, new h(0, -1, 0));
446
- s.layers.mask = _;
447
- const a = s.intersectObjects(
448
- k(this).root.children,
449
- !0
450
- );
451
- if (a.length > 0) {
452
- const o = a[0].object;
453
- o.geometry.computeBoundingBox();
454
- const l = o.geometry.boundingBox, c = o.localToWorld(l.max.clone()), d = this.position.clone(), u = this.position.clone().setY(c.y).sub(new h(0, t, 0));
455
- if (this.position.copy(u), this.position.y === d.y) return;
456
- this.onMove();
457
- }
458
- }
459
415
  assembleGeometry(t) {
460
- switch (this._mesh.material.flatShading = !1, t.name.toLowerCase()) {
416
+ switch (this._material.flatShading = !1, t.name.toLowerCase()) {
461
417
  case "cylinder":
462
418
  return this.createCylinderGeometry(t);
463
419
  case "sphere":
464
420
  return this.createSphereGeometry(t);
465
421
  case "pyramid":
466
- return this._mesh.material.flatShading = !0, this.createPyramidGeometry(t);
422
+ return this._material.flatShading = !0, this.createPyramidGeometry(t);
467
423
  case "cube":
468
424
  case "box":
469
425
  return this.createBoxGeometry(t);
@@ -481,7 +437,7 @@ class Lt extends P {
481
437
  }
482
438
  }
483
439
  createCylinderGeometry(t) {
484
- const e = new rt(
440
+ const e = new lt(
485
441
  t.width / 2,
486
442
  t.width / 2,
487
443
  t.height,
@@ -490,7 +446,7 @@ class Lt extends P {
490
446
  return e.translate(0, t.height / 2, 0), e;
491
447
  }
492
448
  createSphereGeometry(t) {
493
- return new T(t.width / 2, 256, 256);
449
+ return new I(t.width / 2, 256, 256);
494
450
  }
495
451
  createPyramidGeometry(t) {
496
452
  const e = new Float32Array([
@@ -513,7 +469,7 @@ class Lt extends P {
513
469
  0,
514
470
  t.height,
515
471
  0
516
- ]), s = new Uint16Array([
472
+ ]), a = new Uint16Array([
517
473
  0,
518
474
  1,
519
475
  2,
@@ -532,11 +488,11 @@ class Lt extends P {
532
488
  3,
533
489
  4,
534
490
  0
535
- ]), a = new U();
536
- return a.setAttribute(
491
+ ]), n = new F();
492
+ return n.setAttribute(
537
493
  "position",
538
- new V(e, 3)
539
- ), a.setIndex(new V(s, 1)), a.computeVertexNormals(), a.computeBoundingBox(), a.computeBoundingSphere(), a;
494
+ new R(e, 3)
495
+ ), n.setIndex(new R(a, 1)), n.computeVertexNormals(), n.computeBoundingBox(), n.computeBoundingSphere(), n;
540
496
  }
541
497
  createBoxGeometry(t) {
542
498
  const e = new v(
@@ -547,7 +503,7 @@ class Lt extends P {
547
503
  return e.translate(0, t.height / 2, 0), e;
548
504
  }
549
505
  createConeGeometry(t) {
550
- const e = new ht(t.width / 2, t.height, 256);
506
+ const e = new dt(t.width / 2, t.height, 256);
551
507
  return e.translate(0, t.height / 2, 0), e;
552
508
  }
553
509
  createWallGeometry(t) {
@@ -568,7 +524,7 @@ class Lt extends P {
568
524
  return e.translate(0, t.height / 2, 0), e;
569
525
  }
570
526
  }
571
- class kt extends P {
527
+ class Vt extends k {
572
528
  // lines to children
573
529
  constructor() {
574
530
  super();
@@ -588,13 +544,13 @@ class kt extends P {
588
544
  }
589
545
  setLinesVisibility(t, e) {
590
546
  if (!e) {
591
- this._lines.forEach((a) => {
592
- a.visible = t;
547
+ this._lines.forEach((n) => {
548
+ n.visible = t;
593
549
  });
594
550
  return;
595
551
  }
596
- const s = this._members.indexOf(e);
597
- s !== -1 && (this._lines[s].visible = t);
552
+ const a = this._members.indexOf(e);
553
+ a !== -1 && (this._lines[a].visible = t);
598
554
  }
599
555
  attach(t) {
600
556
  if (this._members.includes(t))
@@ -611,8 +567,8 @@ class kt extends P {
611
567
  const e = this._members.indexOf(t);
612
568
  if (e === -1)
613
569
  return this;
614
- const s = this._lines[e];
615
- return super.remove(s), this._lines.splice(e, 1), super.remove(t), this._members.splice(e, 1), this;
570
+ const a = this._lines[e];
571
+ return super.remove(a), this._lines.splice(e, 1), super.remove(t), this._members.splice(e, 1), this;
616
572
  }
617
573
  updateLineTo(t) {
618
574
  const e = this._members.indexOf(t);
@@ -622,22 +578,22 @@ class kt extends P {
622
578
  * Creates a line for visualization.
623
579
  */
624
580
  createLine() {
625
- const t = new U(), e = new lt({
581
+ const t = new F(), e = new ct({
626
582
  color: 6710886,
627
583
  dashSize: 0.05,
628
584
  gapSize: 0.025
629
- }), s = new dt(t, e);
630
- return s.visible = !1, s;
585
+ }), a = new ut(t, e);
586
+ return a.visible = !1, a;
631
587
  }
632
588
  /**
633
589
  * Updates a line to the object.
634
590
  */
635
591
  _updateLineTo(t, e) {
636
- const s = [
592
+ const a = [
637
593
  new h(0, 0, 0),
638
594
  e.position.clone()
639
595
  ];
640
- t.geometry.setFromPoints(s), t.computeLineDistances();
596
+ t.geometry.setFromPoints(a), t.computeLineDistances();
641
597
  }
642
598
  // public setBoundingBoxVisibility(visible: boolean): void {
643
599
  // this._boxMesh.visible = visible;
@@ -687,17 +643,17 @@ class kt extends P {
687
643
  // this._boxMesh.visible = true;
688
644
  // }
689
645
  }
690
- class Rt extends S {
646
+ class Rt extends P {
691
647
  constructor() {
692
- const t = new ct(1, 1);
648
+ const t = new pt(1, 1);
693
649
  t.scale(1e3, 1e3, 1), t.rotateX(-Math.PI / 2);
694
- const e = new L({
650
+ const e = new M({
695
651
  color: new g(16777215),
696
652
  side: G
697
653
  });
698
654
  super(t, e);
699
655
  i(this, "isDIVEFloor", !0);
700
- this.name = "Floor", this.layers.mask = _, this.receiveShadow = !0;
656
+ this.name = "Floor", this.layers.mask = f, this.receiveShadow = !0;
701
657
  }
702
658
  setVisibility(t) {
703
659
  this.visible = t;
@@ -706,7 +662,7 @@ class Rt extends S {
706
662
  this.material.color = new g(t);
707
663
  }
708
664
  }
709
- class Vt extends w {
665
+ class At extends w {
710
666
  constructor() {
711
667
  super();
712
668
  i(this, "isDIVERoot", !0);
@@ -717,17 +673,17 @@ class Vt extends w {
717
673
  return this._floor;
718
674
  }
719
675
  computeSceneBB() {
720
- const t = new I();
676
+ const t = new T();
721
677
  return this.children.forEach((e) => {
722
- "isDIVEFloor" in e || e.traverse((s) => {
723
- "isObject3D" in s && t.expandByObject(s);
678
+ "isDIVEFloor" in e || e.traverse((a) => {
679
+ "isObject3D" in a && t.expandByObject(a);
724
680
  });
725
681
  }), t;
726
682
  }
727
683
  getSceneObject(t) {
728
684
  let e;
729
- return this.traverse((s) => {
730
- e || s.userData.id === t.id && (e = s);
685
+ return this.traverse((a) => {
686
+ e || a.userData.id === t.id && (e = a);
731
687
  }), e;
732
688
  }
733
689
  addSceneObject(t) {
@@ -742,15 +698,15 @@ class Vt extends w {
742
698
  case "light": {
743
699
  switch (t.type) {
744
700
  case "scene": {
745
- e = new Tt();
701
+ e = new Mt();
746
702
  break;
747
703
  }
748
704
  case "ambient": {
749
- e = new Mt();
705
+ e = new It();
750
706
  break;
751
707
  }
752
708
  case "point": {
753
- e = new xt();
709
+ e = new Tt();
754
710
  break;
755
711
  }
756
712
  default:
@@ -762,15 +718,15 @@ class Vt extends w {
762
718
  break;
763
719
  }
764
720
  case "model": {
765
- e = new It(), e.name = t.name, e.userData.id = t.id, e.userData.uri = t.uri, this.add(e), this._updateModel(e, t);
721
+ e = new W(), e.name = t.name, e.userData.id = t.id, e.userData.uri = t.uri, this.add(e), this._updateModel(e, t);
766
722
  break;
767
723
  }
768
724
  case "primitive": {
769
- e = new Lt(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updatePrimitive(e, t);
725
+ e = new kt(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updatePrimitive(e, t);
770
726
  break;
771
727
  }
772
728
  case "group": {
773
- e = new kt(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updateGroup(e, t);
729
+ e = new Vt(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updateGroup(e, t);
774
730
  break;
775
731
  }
776
732
  default:
@@ -880,12 +836,12 @@ class Vt extends w {
880
836
  _setParent(t) {
881
837
  const e = this.getSceneObject(t);
882
838
  if (t.parentId !== null) {
883
- const s = this.getSceneObject({
839
+ const a = this.getSceneObject({
884
840
  id: t.parentId,
885
841
  entityType: t.entityType
886
842
  });
887
- if (!s) return;
888
- s.attach(e);
843
+ if (!a) return;
844
+ a.attach(e);
889
845
  } else
890
846
  this.attach(e);
891
847
  }
@@ -898,39 +854,39 @@ class Vt extends w {
898
854
  return t.parent !== null ? this._findScene(t.parent) : t;
899
855
  }
900
856
  }
901
- const At = "#888888", Ct = "#dddddd";
902
- class Ot extends w {
857
+ const Ct = "#888888", Ot = "#dddddd";
858
+ class zt extends w {
903
859
  constructor() {
904
860
  super(), this.name = "Grid";
905
- const n = new ut(
861
+ const s = new mt(
906
862
  100,
907
863
  100,
908
- At,
909
- Ct
864
+ Ct,
865
+ Ot
910
866
  );
911
- n.material.depthTest = !1, n.layers.mask = Et, this.add(n);
867
+ s.material.depthTest = !1, s.layers.mask = Pt, this.add(s);
912
868
  }
913
- setVisibility(n) {
914
- this.visible = n;
869
+ setVisibility(s) {
870
+ this.visible = s;
915
871
  }
916
872
  }
917
- const D = {
873
+ const E = {
918
874
  displayFloor: !1,
919
875
  displayGrid: !1,
920
876
  backgroundColor: "#ffffff"
921
877
  };
922
- class Bt extends pt {
878
+ class Bt extends _t {
923
879
  constructor(t) {
924
880
  super();
925
881
  i(this, "isDIVEScene", !0);
926
882
  i(this, "_root");
927
883
  i(this, "_grid");
928
884
  this.background = new g(
929
- (t == null ? void 0 : t.backgroundColor) ?? D.backgroundColor
930
- ), this._root = new Vt(), this._root.floor.setVisibility(
931
- (t == null ? void 0 : t.displayFloor) ?? D.displayFloor
932
- ), this.add(this._root), this._grid = new Ot(), this._grid.setVisibility(
933
- (t == null ? void 0 : t.displayGrid) ?? D.displayGrid
885
+ (t == null ? void 0 : t.backgroundColor) ?? E.backgroundColor
886
+ ), this._root = new At(), this._root.floor.setVisibility(
887
+ (t == null ? void 0 : t.displayFloor) ?? E.displayFloor
888
+ ), this.add(this._root), this._grid = new zt(), this._grid.setVisibility(
889
+ (t == null ? void 0 : t.displayGrid) ?? E.displayGrid
934
890
  ), this.add(this._grid);
935
891
  }
936
892
  get root() {
@@ -946,7 +902,7 @@ class Bt extends pt {
946
902
  return this._root.computeSceneBB();
947
903
  }
948
904
  }
949
- const zt = {
905
+ const Gt = {
950
906
  enableDamping: !0,
951
907
  dampingFactor: 0.05,
952
908
  enabled: !0,
@@ -976,16 +932,16 @@ const zt = {
976
932
  BOTTOM: "ArrowDown"
977
933
  },
978
934
  mouseButtons: {
979
- LEFT: m.ROTATE,
980
- MIDDLE: m.DOLLY,
981
- RIGHT: m.PAN
935
+ LEFT: p.ROTATE,
936
+ MIDDLE: p.DOLLY,
937
+ RIGHT: p.PAN
982
938
  },
983
939
  touches: {
984
- ONE: f.ROTATE,
985
- TWO: f.DOLLY_PAN
940
+ ONE: _.ROTATE,
941
+ TWO: _.DOLLY_PAN
986
942
  }
987
- }, b = class b extends mt {
988
- constructor(t, e, s) {
943
+ }, b = class b extends gt {
944
+ constructor(t, e, a) {
989
945
  super();
990
946
  // public API
991
947
  i(this, "object");
@@ -1023,15 +979,15 @@ const zt = {
1023
979
  BOTTOM: "ArrowDown"
1024
980
  });
1025
981
  i(this, "mouseButtons", {
1026
- LEFT: m.ROTATE,
1027
- MIDDLE: m.DOLLY,
1028
- RIGHT: m.PAN
982
+ LEFT: p.ROTATE,
983
+ MIDDLE: p.DOLLY,
984
+ RIGHT: p.PAN
1029
985
  });
1030
- i(this, "touches", { ONE: f.ROTATE, TWO: f.DOLLY_PAN });
986
+ i(this, "touches", { ONE: _.ROTATE, TWO: _.DOLLY_PAN });
1031
987
  i(this, "target0");
1032
988
  i(this, "position0");
1033
989
  i(this, "zoom0");
1034
- i(this, "uuid", E.generateUUID());
990
+ i(this, "uuid", S.generateUUID());
1035
991
  // private state
1036
992
  i(this, "state", -1);
1037
993
  i(this, "EPS", 1e-6);
@@ -1040,15 +996,15 @@ const zt = {
1040
996
  i(this, "scale", 1);
1041
997
  i(this, "panOffset", new h());
1042
998
  i(this, "zoomChanged", !1);
1043
- i(this, "rotateStart", new p());
1044
- i(this, "rotateEnd", new p());
1045
- i(this, "rotateDelta", new p());
1046
- i(this, "panStart", new p());
1047
- i(this, "panEnd", new p());
1048
- i(this, "panDelta", new p());
1049
- i(this, "dollyStart", new p());
1050
- i(this, "dollyEnd", new p());
1051
- i(this, "dollyDelta", new p());
999
+ i(this, "rotateStart", new u());
1000
+ i(this, "rotateEnd", new u());
1001
+ i(this, "rotateDelta", new u());
1002
+ i(this, "panStart", new u());
1003
+ i(this, "panEnd", new u());
1004
+ i(this, "panDelta", new u());
1005
+ i(this, "dollyStart", new u());
1006
+ i(this, "dollyEnd", new u());
1007
+ i(this, "dollyDelta", new u());
1052
1008
  i(this, "pointers", []);
1053
1009
  i(this, "pointerPositions", {});
1054
1010
  // for update() function
@@ -1060,14 +1016,14 @@ const zt = {
1060
1016
  i(this, "lastTarget", new h());
1061
1017
  i(this, "panLeft", (() => {
1062
1018
  const t = new h();
1063
- return (e, s) => {
1064
- t.setFromMatrixColumn(s, 0), t.multiplyScalar(-e), this.panOffset.add(t);
1019
+ return (e, a) => {
1020
+ t.setFromMatrixColumn(a, 0), t.multiplyScalar(-e), this.panOffset.add(t);
1065
1021
  };
1066
1022
  })());
1067
1023
  i(this, "panUp", (() => {
1068
1024
  const t = new h();
1069
- return (e, s) => {
1070
- this.screenSpacePanning === !0 ? t.setFromMatrixColumn(s, 1) : (t.setFromMatrixColumn(s, 0), t.crossVectors(this.object.up, t)), t.multiplyScalar(e), this.panOffset.add(t);
1025
+ return (e, a) => {
1026
+ this.screenSpacePanning === !0 ? t.setFromMatrixColumn(a, 1) : (t.setFromMatrixColumn(a, 0), t.crossVectors(this.object.up, t)), t.multiplyScalar(e), this.panOffset.add(t);
1071
1027
  };
1072
1028
  })());
1073
1029
  i(this, "onMouseDown", (t) => {
@@ -1086,11 +1042,11 @@ const zt = {
1086
1042
  e = -1;
1087
1043
  }
1088
1044
  switch (e) {
1089
- case m.DOLLY:
1045
+ case p.DOLLY:
1090
1046
  if (this.enableZoom === !1) return;
1091
1047
  this.handleMouseDownDolly(t), this.state = 1;
1092
1048
  break;
1093
- case m.ROTATE:
1049
+ case p.ROTATE:
1094
1050
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
1095
1051
  if (this.enablePan === !1) return;
1096
1052
  this.handleMouseDownPan(t), this.state = 2;
@@ -1099,7 +1055,7 @@ const zt = {
1099
1055
  this.handleMouseDownRotate(t), this.state = 0;
1100
1056
  }
1101
1057
  break;
1102
- case m.PAN:
1058
+ case p.PAN:
1103
1059
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
1104
1060
  if (this.enableRotate === !1) return;
1105
1061
  this.handleMouseDownRotate(t), this.state = 0;
@@ -1140,11 +1096,11 @@ const zt = {
1140
1096
  switch (this.trackPointer(t), this.pointers.length) {
1141
1097
  case 1:
1142
1098
  switch (this.touches.ONE) {
1143
- case f.ROTATE:
1099
+ case _.ROTATE:
1144
1100
  if (this.enableRotate === !1) return;
1145
1101
  this.handleTouchStartRotate(t), this.state = 3;
1146
1102
  break;
1147
- case f.PAN:
1103
+ case _.PAN:
1148
1104
  if (this.enablePan === !1) return;
1149
1105
  this.handleTouchStartPan(t), this.state = 4;
1150
1106
  break;
@@ -1154,12 +1110,12 @@ const zt = {
1154
1110
  break;
1155
1111
  case 2:
1156
1112
  switch (this.touches.TWO) {
1157
- case f.DOLLY_PAN:
1113
+ case _.DOLLY_PAN:
1158
1114
  if (this.enableZoom === !1 && this.enablePan === !1)
1159
1115
  return;
1160
1116
  this.handleTouchStartDollyPan(t), this.state = 5;
1161
1117
  break;
1162
- case f.DOLLY_ROTATE:
1118
+ case _.DOLLY_ROTATE:
1163
1119
  if (this.enableZoom === !1 && this.enableRotate === !1)
1164
1120
  return;
1165
1121
  this.handleTouchStartDollyRotate(t), this.state = 6;
@@ -1221,10 +1177,10 @@ const zt = {
1221
1177
  i(this, "onContextMenu", (t) => {
1222
1178
  this.enabled !== !1 && t.preventDefault();
1223
1179
  });
1224
- this.object = t, this.domElements = Array.isArray(e) ? e : [e], Object.assign(this, s), this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.quat = new x().setFromUnitVectors(
1180
+ this.object = t, this.domElements = Array.isArray(e) ? e : [e], Object.assign(this, a), this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.quat = new x().setFromUnitVectors(
1225
1181
  t.up,
1226
1182
  new h(0, 1, 0)
1227
- ), this.quatInverse = this.quat.clone().invert(), this.domElements.forEach((a) => this.addEventListeners(a)), this.update();
1183
+ ), this.quatInverse = this.quat.clone().invert(), this.domElements.forEach((n) => this.addEventListeners(n)), this.update();
1228
1184
  }
1229
1185
  get domElement() {
1230
1186
  return this.domElements[0];
@@ -1271,23 +1227,23 @@ const zt = {
1271
1227
  }
1272
1228
  removeDomElements(...t) {
1273
1229
  t.forEach((e) => {
1274
- const s = this.domElements.indexOf(e);
1275
- s > -1 && (this.removeEventListeners(e), this.domElements.splice(s, 1));
1230
+ const a = this.domElements.indexOf(e);
1231
+ a > -1 && (this.removeEventListeners(e), this.domElements.splice(a, 1));
1276
1232
  });
1277
1233
  }
1278
1234
  setDomElements(...t) {
1279
1235
  this.removeDomElements(...this.domElements), this.domElements = [], this.addDomElements(...t);
1280
1236
  }
1281
1237
  computeEncompassingView(t, e = 0) {
1282
- const s = t.center, o = t.sphere.radius, l = this.object.fov * (Math.PI / 180), c = this.object.aspect, d = l / 2, u = Math.atan(Math.tan(d) * c), X = o / Math.sin(d), q = o / Math.sin(u), K = Math.max(X, q) * (1 + e), R = this.object.position.clone().sub(this.target).normalize(), Q = R.length() > 1e-3 ? R : new h(0, 0, 1);
1238
+ const a = t.center, o = t.sphere.radius, l = this.object.fov * (Math.PI / 180), c = this.object.aspect, d = l / 2, m = Math.atan(Math.tan(d) * c), q = o / Math.sin(d), K = o / Math.sin(m), Q = Math.max(q, K) * (1 + e), V = this.object.position.clone().sub(this.target).normalize(), J = V.length() > 1e-3 ? V : new h(0, 0, 1);
1283
1239
  return {
1284
- position: s.clone().add(Q.multiplyScalar(K)),
1285
- target: s
1240
+ position: a.clone().add(J.multiplyScalar(Q)),
1241
+ target: a
1286
1242
  };
1287
1243
  }
1288
1244
  focusObject(t, e = 0) {
1289
- const s = new Xt(t), a = this.computeEncompassingView(s, e);
1290
- this.object.position.copy(a.position), this.target.copy(a.target), this.update();
1245
+ const a = new Xt(t), n = this.computeEncompassingView(a, e);
1246
+ this.object.position.copy(n.position), this.target.copy(n.target), this.update();
1291
1247
  }
1292
1248
  zoomIn(t) {
1293
1249
  this.dollyIn(Math.pow(0.95, t ?? b.DEFAULT_ZOOM_FACTOR)), this.update();
@@ -1333,26 +1289,26 @@ const zt = {
1333
1289
  rotateUp(t) {
1334
1290
  this.sphericalDelta.phi -= t;
1335
1291
  }
1336
- pan(t, e, s) {
1337
- const a = new h();
1292
+ pan(t, e, a) {
1293
+ const n = new h();
1338
1294
  if ("isPerspectiveCamera" in this.object) {
1339
1295
  const o = this.object.position;
1340
- a.copy(o).sub(this.target);
1341
- let l = a.length();
1296
+ n.copy(o).sub(this.target);
1297
+ let l = n.length();
1342
1298
  l *= Math.tan(
1343
1299
  this.object.fov / 2 * Math.PI / 180
1344
1300
  ), this.panLeft(
1345
- 2 * t * l / s.clientHeight,
1301
+ 2 * t * l / a.clientHeight,
1346
1302
  this.object.matrix
1347
1303
  ), this.panUp(
1348
- 2 * e * l / s.clientHeight,
1304
+ 2 * e * l / a.clientHeight,
1349
1305
  this.object.matrix
1350
1306
  );
1351
1307
  } else "isOrthographicCamera" in this.object ? (this.panLeft(
1352
- t * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth,
1308
+ t * (this.object.right - this.object.left) / this.object.zoom / a.clientWidth,
1353
1309
  this.object.matrix
1354
1310
  ), this.panUp(
1355
- e * (this.object.top - this.object.bottom) / this.object.zoom / s.clientHeight,
1311
+ e * (this.object.top - this.object.bottom) / this.object.zoom / a.clientHeight,
1356
1312
  this.object.matrix
1357
1313
  )) : (console.warn(
1358
1314
  "WARNING: OrbitController encountered an unknown camera type - pan disabled."
@@ -1399,19 +1355,19 @@ const zt = {
1399
1355
  }
1400
1356
  handleKeyDown(t) {
1401
1357
  let e = !1;
1402
- const s = t.currentTarget;
1358
+ const a = t.currentTarget;
1403
1359
  switch (t.code) {
1404
1360
  case this.keys.UP:
1405
- this.pan(0, this.keyPanSpeed, s), e = !0;
1361
+ this.pan(0, this.keyPanSpeed, a), e = !0;
1406
1362
  break;
1407
1363
  case this.keys.BOTTOM:
1408
- this.pan(0, -this.keyPanSpeed, s), e = !0;
1364
+ this.pan(0, -this.keyPanSpeed, a), e = !0;
1409
1365
  break;
1410
1366
  case this.keys.LEFT:
1411
- this.pan(this.keyPanSpeed, 0, s), e = !0;
1367
+ this.pan(this.keyPanSpeed, 0, a), e = !0;
1412
1368
  break;
1413
1369
  case this.keys.RIGHT:
1414
- this.pan(-this.keyPanSpeed, 0, s), e = !0;
1370
+ this.pan(-this.keyPanSpeed, 0, a), e = !0;
1415
1371
  break;
1416
1372
  }
1417
1373
  e && (t.preventDefault(), this.update());
@@ -1420,20 +1376,20 @@ const zt = {
1420
1376
  if (this.pointers.length === 1)
1421
1377
  this.rotateStart.set(t.pageX, t.pageY);
1422
1378
  else {
1423
- const e = this.getSecondPointer(t), s = 0.5 * (t.pageX + e.pageX), a = 0.5 * (t.pageY + e.pageY);
1424
- this.rotateStart.set(s, a);
1379
+ const e = this.getSecondPointer(t), a = 0.5 * (t.pageX + e.pageX), n = 0.5 * (t.pageY + e.pageY);
1380
+ this.rotateStart.set(a, n);
1425
1381
  }
1426
1382
  }
1427
1383
  handleTouchStartPan(t) {
1428
1384
  if (this.pointers.length === 1)
1429
1385
  this.panStart.set(t.pageX, t.pageY);
1430
1386
  else {
1431
- const e = this.getSecondPointer(t), s = 0.5 * (t.pageX + e.pageX), a = 0.5 * (t.pageY + e.pageY);
1432
- this.panStart.set(s, a);
1387
+ const e = this.getSecondPointer(t), a = 0.5 * (t.pageX + e.pageX), n = 0.5 * (t.pageY + e.pageY);
1388
+ this.panStart.set(a, n);
1433
1389
  }
1434
1390
  }
1435
1391
  handleTouchStartDolly(t) {
1436
- const e = this.getSecondPointer(t), s = t.pageX - e.pageX, a = t.pageY - e.pageY, o = Math.sqrt(s * s + a * a);
1392
+ const e = this.getSecondPointer(t), a = t.pageX - e.pageX, n = t.pageY - e.pageY, o = Math.sqrt(a * a + n * n);
1437
1393
  this.dollyStart.set(0, o);
1438
1394
  }
1439
1395
  handleTouchStartDollyPan(t) {
@@ -1446,8 +1402,8 @@ const zt = {
1446
1402
  if (this.pointers.length === 1)
1447
1403
  this.rotateEnd.set(t.pageX, t.pageY);
1448
1404
  else {
1449
- const s = this.getSecondPointer(t), a = 0.5 * (t.pageX + s.pageX), o = 0.5 * (t.pageY + s.pageY);
1450
- this.rotateEnd.set(a, o);
1405
+ const a = this.getSecondPointer(t), n = 0.5 * (t.pageX + a.pageX), o = 0.5 * (t.pageY + a.pageY);
1406
+ this.rotateEnd.set(n, o);
1451
1407
  }
1452
1408
  const e = t.currentTarget;
1453
1409
  this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart).multiplyScalar(this.rotateSpeed), this.rotateLeft(
@@ -1460,14 +1416,14 @@ const zt = {
1460
1416
  if (this.pointers.length === 1)
1461
1417
  this.panEnd.set(t.pageX, t.pageY);
1462
1418
  else {
1463
- const s = this.getSecondPointer(t), a = 0.5 * (t.pageX + s.pageX), o = 0.5 * (t.pageY + s.pageY);
1464
- this.panEnd.set(a, o);
1419
+ const a = this.getSecondPointer(t), n = 0.5 * (t.pageX + a.pageX), o = 0.5 * (t.pageY + a.pageY);
1420
+ this.panEnd.set(n, o);
1465
1421
  }
1466
1422
  const e = t.currentTarget;
1467
1423
  this.panDelta.subVectors(this.panEnd, this.panStart).multiplyScalar(this.panSpeed), this.pan(this.panDelta.x, this.panDelta.y, e), this.panStart.copy(this.panEnd);
1468
1424
  }
1469
1425
  handleTouchMoveDolly(t) {
1470
- const e = this.getSecondPointer(t), s = t.pageX - e.pageX, a = t.pageY - e.pageY, o = Math.sqrt(s * s + a * a);
1426
+ const e = this.getSecondPointer(t), a = t.pageX - e.pageX, n = t.pageY - e.pageY, o = Math.sqrt(a * a + n * n);
1471
1427
  this.dollyEnd.set(0, o), this.dollyDelta.set(
1472
1428
  0,
1473
1429
  Math.pow(this.dollyEnd.y / this.dollyStart.y, this.zoomSpeed)
@@ -1492,7 +1448,7 @@ const zt = {
1492
1448
  }
1493
1449
  trackPointer(t) {
1494
1450
  let e = this.pointerPositions[t.pointerId];
1495
- e === void 0 && (e = new p(), this.pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
1451
+ e === void 0 && (e = new u(), this.pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
1496
1452
  }
1497
1453
  getSecondPointer(t) {
1498
1454
  return this.pointers[0].pointerId === t.pointerId ? this.pointers[1] : this.pointers[0];
@@ -1504,52 +1460,52 @@ const zt = {
1504
1460
  }
1505
1461
  };
1506
1462
  i(b, "DEFAULT_ZOOM_FACTOR", 1);
1507
- let B = b;
1508
- class Gt extends w {
1463
+ let z = b;
1464
+ class Ft extends w {
1509
1465
  constructor() {
1510
1466
  super();
1511
1467
  i(this, "_axesHelper");
1512
- this._axesHelper = new gt(0.5), this._axesHelper.layers.mask = y, this._axesHelper.material.depthTest = !1, this._axesHelper.position.set(0, 0, -1), this._axesHelper.setColors(
1468
+ this._axesHelper = new ft(0.5), this._axesHelper.layers.mask = y, this._axesHelper.material.depthTest = !1, this._axesHelper.position.set(0, 0, -1), this._axesHelper.setColors(
1513
1469
  new g(Wt),
1514
1470
  new g(Zt),
1515
1471
  new g(Nt)
1516
1472
  );
1517
- const t = new M("X", 0.2, W), e = new M("Y", 0.2, Z), s = new M("Z", 0.2, N);
1518
- t.layers.mask = y, e.layers.mask = y, s.layers.mask = y, t.position.set(0.7, 0, 0), e.position.set(0, 0.7, 0), s.position.set(0, 0, 0.7), this._axesHelper.add(t), this._axesHelper.add(e), this._axesHelper.add(s);
1473
+ const t = new L("X", 0.2, Z), e = new L("Y", 0.2, N), a = new L("Z", 0.2, X);
1474
+ t.layers.mask = y, e.layers.mask = y, a.layers.mask = y, t.position.set(0.7, 0, 0), e.position.set(0, 0.7, 0), a.position.set(0, 0, 0.7), this._axesHelper.add(t), this._axesHelper.add(e), this._axesHelper.add(a);
1519
1475
  }
1520
1476
  setFromCameraMatrix(t) {
1521
1477
  this._axesHelper.rotation.setFromRotationMatrix(
1522
- new _t().extractRotation(t).invert()
1478
+ new wt().extractRotation(t).invert()
1523
1479
  );
1524
1480
  }
1525
1481
  }
1526
- class Ft {
1527
- constructor(n, t, e) {
1528
- i(this, "uuid", E.generateUUID());
1482
+ class Ut {
1483
+ constructor(s, t, e) {
1484
+ i(this, "uuid", S.generateUUID());
1529
1485
  i(this, "_axes");
1530
1486
  i(this, "_orthographicCamera");
1531
- i(this, "_restoreViewport", new wt());
1532
- this._renderer = n, this._scene = t, this._camera = e, this._orthographicCamera = new ft(
1487
+ i(this, "_restoreViewport", new bt());
1488
+ this._renderer = s, this._scene = t, this._camera = e, this._orthographicCamera = new yt(
1533
1489
  -1,
1534
1490
  1,
1535
1491
  1,
1536
1492
  -1,
1537
1493
  0.1,
1538
1494
  100
1539
- ), this._orthographicCamera.layers.mask = y, this._scene.add(this._orthographicCamera), this._axes = new Gt(), this._scene.add(this._axes);
1495
+ ), this._orthographicCamera.layers.mask = y, this._scene.add(this._orthographicCamera), this._axes = new Ft(), this._scene.add(this._axes);
1540
1496
  }
1541
1497
  tick() {
1542
- const n = this._scene.background;
1498
+ const s = this._scene.background;
1543
1499
  this._scene.background = null, this._renderer.webglrenderer.getViewport(this._restoreViewport), this._renderer.webglrenderer.setViewport(0, 0, 150, 150), this._renderer.webglrenderer.autoClear = !1, this._axes.setFromCameraMatrix(this._camera.matrix), this._renderer.webglrenderer.render(
1544
1500
  this._scene,
1545
1501
  this._orthographicCamera
1546
- ), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = n;
1502
+ ), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = s;
1547
1503
  }
1548
1504
  dispose() {
1549
1505
  this._scene.remove(this._axes), this._scene.remove(this._orthographicCamera);
1550
1506
  }
1551
1507
  }
1552
- const Ut = `
1508
+ const Ht = `
1553
1509
  @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
1554
1510
  @@@@+-:::::::---------------------==------------------------------=#@@@@
1555
1511
  @@%=::::.......::---------------------------------------------------------+@@
@@ -1584,18 +1540,18 @@ window.DIVE = {
1584
1540
  return window.DIVE.instances[0];
1585
1541
  }
1586
1542
  };
1587
- const Ht = {
1543
+ const D = {
1588
1544
  autoStart: !0,
1589
1545
  displayAxes: !1,
1590
- ...D,
1591
- ...St,
1592
- ...H,
1593
- ...zt
1546
+ ...E,
1547
+ ...vt,
1548
+ ...U,
1549
+ ...Gt
1594
1550
  };
1595
1551
  class Yt {
1596
- constructor(n) {
1552
+ constructor(s) {
1597
1553
  // descriptive members
1598
- i(this, "_instanceId", E.generateUUID());
1554
+ i(this, "_instanceId", S.generateUUID());
1599
1555
  i(this, "_settings");
1600
1556
  i(this, "_views");
1601
1557
  i(this, "_mainView");
@@ -1603,26 +1559,32 @@ class Yt {
1603
1559
  i(this, "_clock");
1604
1560
  i(this, "orientationDisplay");
1605
1561
  this._settings = {
1606
- ...Ht,
1607
- ...n ?? {}
1608
- }, this._clock = new Pt(), this._scene = new Bt();
1562
+ ...D,
1563
+ ...s ?? {}
1564
+ }, this._clock = new Lt(), this._scene = new Bt(), this.scene.setBackground(
1565
+ (s == null ? void 0 : s.backgroundColor) ?? D.backgroundColor
1566
+ ), this.scene.grid.setVisibility(
1567
+ (s == null ? void 0 : s.displayGrid) ?? D.displayGrid
1568
+ ), this.scene.root.floor.setVisibility(
1569
+ (s == null ? void 0 : s.displayFloor) ?? D.displayFloor
1570
+ );
1609
1571
  const t = new O(
1610
1572
  this._scene,
1611
1573
  new C(),
1612
1574
  this._settings
1613
1575
  );
1614
- this._clock.addTicker(t), this._views = [t], this._mainView = t, this._settings.autoStart && this.start(), this._settings.displayAxes ? (console.log("displayAxes", this._settings.displayAxes), this.orientationDisplay = new Ft(
1576
+ this._clock.addTicker(t), this._views = [t], this._mainView = t, this._settings.autoStart && this.start(), this._settings.displayAxes ? (console.log("displayAxes", this._settings.displayAxes), this.orientationDisplay = new Ut(
1615
1577
  this.mainView.renderer,
1616
1578
  this.scene,
1617
1579
  this.mainView.camera
1618
- ), this.clock.addTicker(this.orientationDisplay)) : this.orientationDisplay = null, console.log("DIVE 2.1.0 initialized successfully!"), console.log(Ut), window.DIVE.instances.push(this);
1580
+ ), this.clock.addTicker(this.orientationDisplay)) : this.orientationDisplay = null, console.log("DIVE 2.1.2 initialized successfully!"), console.log(Ht), window.DIVE.instances.push(this);
1619
1581
  }
1620
1582
  /**
1621
1583
  * @deprecated This static method will be removed in a future version. Please use `import { QuickView, QuickViewSettings, QuickViewDefaultSettings } from '@shopware-ag/dive/quickview'` instead.
1622
1584
  */
1623
- static async QuickView(n, t) {
1585
+ static async QuickView(s, t) {
1624
1586
  return import("../plugins/quickview/index.mjs").then(
1625
- ({ QuickView: e }) => e(n, t)
1587
+ ({ QuickView: e }) => e(s, t)
1626
1588
  );
1627
1589
  }
1628
1590
  /**
@@ -1632,8 +1594,8 @@ class Yt {
1632
1594
  return Object.assign(this, {
1633
1595
  camera: this.mainView.camera,
1634
1596
  renderer: this.mainView.renderer,
1635
- setCanvas: (n) => {
1636
- this.mainView.setCanvas(n);
1597
+ setCanvas: (s) => {
1598
+ this.mainView.setCanvas(s);
1637
1599
  },
1638
1600
  start: () => {
1639
1601
  this.start();
@@ -1668,18 +1630,18 @@ class Yt {
1668
1630
  this._clock.stop();
1669
1631
  }
1670
1632
  async dispose() {
1671
- return new Promise((n) => {
1633
+ return new Promise((s) => {
1672
1634
  this._views.forEach((t) => {
1673
1635
  t.dispose();
1674
1636
  }), this._views = [], this.orientationDisplay && (this._clock.removeTicker(this.orientationDisplay), this.orientationDisplay.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
1675
1637
  (t) => t._instanceId !== this._instanceId
1676
- ), n();
1638
+ ), s();
1677
1639
  });
1678
1640
  }
1679
- createView(n) {
1641
+ createView(s) {
1680
1642
  const t = new O(
1681
1643
  this._scene,
1682
- n ?? new C(),
1644
+ s ?? new C(),
1683
1645
  {
1684
1646
  ...this._settings,
1685
1647
  canvas: void 0
@@ -1688,12 +1650,12 @@ class Yt {
1688
1650
  );
1689
1651
  return this._views.push(t), this._clock.addTicker(t), this._views.length === 1 && (this._mainView = t), t;
1690
1652
  }
1691
- disposeView(n) {
1692
- this._views = this._views.filter((t) => t !== n), this._clock.removeTicker(n), this._mainView === n && (this._mainView = this._views[0]), n.dispose();
1653
+ disposeView(s) {
1654
+ this._views = this._views.filter((t) => t !== s), this._clock.removeTicker(s), this._mainView === s && (this._mainView = this._views[0]), s.dispose();
1693
1655
  }
1694
1656
  }
1695
- const ee = Yt, W = "#c20017", Z = "#00ab26", N = "#0081d4", Wt = W, Zt = Z, Nt = N;
1696
- class Xt extends P {
1657
+ const ee = Yt, Z = "#c20017", N = "#00ab26", X = "#0081d4", Wt = Z, Zt = N, Nt = X;
1658
+ class Xt extends k {
1697
1659
  /**
1698
1660
  * Creates a new BoundingBox instance for the specified 3D object.
1699
1661
  *
@@ -1716,7 +1678,7 @@ class Xt extends P {
1716
1678
  * const defaultBox = new BoundingBox(mesh);
1717
1679
  * ```
1718
1680
  */
1719
- constructor(t, e = !1, s = 65280) {
1681
+ constructor(t, e = !1, a = 65280) {
1720
1682
  super();
1721
1683
  /** The computed bounding box (Box3) */
1722
1684
  i(this, "_box");
@@ -1732,19 +1694,19 @@ class Xt extends P {
1732
1694
  i(this, "_sphereHelper");
1733
1695
  /** The dimensions (width, height, depth) of the bounding box */
1734
1696
  i(this, "_size");
1735
- const a = new I();
1736
- e ? a.setFromObject(t) : (t.updateWorldMatrix(!0, !0), t.traverse((l) => {
1697
+ const n = new T();
1698
+ e ? n.setFromObject(t) : (t.updateWorldMatrix(!0, !0), t.traverse((l) => {
1737
1699
  if (l.isMesh) {
1738
1700
  const c = l, d = c.geometry.clone();
1739
1701
  d.applyMatrix4(c.matrixWorld);
1740
- const u = c.getWorldQuaternion(new x()).invert();
1741
- d.applyQuaternion(u), d.computeBoundingBox(), d.boundingBox && a.union(d.boundingBox);
1702
+ const m = c.getWorldQuaternion(new x()).invert();
1703
+ d.applyQuaternion(m), d.computeBoundingBox(), d.boundingBox && n.union(d.boundingBox);
1742
1704
  }
1743
- })), this.rotation.copy(t.rotation), this._box = a, this._size = a.getSize(new h()), this._center = a.getCenter(new h()), this._boxHelper = new yt(this._box, s), this._boxHelper.visible = !1, this.add(this._boxHelper), this._sphere = a.getBoundingSphere(new bt()), this._radius = this._sphere.radius;
1744
- const o = new T(this._radius, 32, 32);
1745
- o.translate(this._center.x, this._center.y, this._center.z), this._sphereHelper = new S(
1705
+ })), this.rotation.copy(t.rotation), this._box = n, this._size = n.getSize(new h()), this._center = n.getCenter(new h()), this._boxHelper = new Dt(this._box, a), this._boxHelper.visible = !1, this.add(this._boxHelper), this._sphere = n.getBoundingSphere(new Et()), this._radius = this._sphere.radius;
1706
+ const o = new I(this._radius, 32, 32);
1707
+ o.translate(this._center.x, this._center.y, this._center.z), this._sphereHelper = new P(
1746
1708
  o,
1747
- new z({ color: s, wireframe: !0 })
1709
+ new B({ color: a, wireframe: !0 })
1748
1710
  ), this._sphereHelper.visible = !1, this.add(this._sphereHelper);
1749
1711
  }
1750
1712
  /**
@@ -1839,40 +1801,40 @@ const qt = {
1839
1801
  );
1840
1802
  export {
1841
1803
  Wt as A,
1842
- P as B,
1843
- Lt as C,
1844
- Ht as D,
1845
- Vt as E,
1804
+ k as B,
1805
+ kt as C,
1806
+ D,
1807
+ At as E,
1846
1808
  Xt as F,
1847
- At as G,
1848
- k as H,
1809
+ Ct as G,
1810
+ Y as H,
1849
1811
  qt as I,
1850
- zt as O,
1812
+ Gt as O,
1851
1813
  ie as S,
1852
- B as a,
1853
- Ft as b,
1854
- Gt as c,
1814
+ z as a,
1815
+ Ut as b,
1816
+ Ft as c,
1855
1817
  Yt as d,
1856
- Tt as e,
1857
- It as f,
1818
+ Mt as e,
1819
+ W as f,
1858
1820
  Zt as g,
1859
1821
  Nt as h,
1860
1822
  ee as i,
1861
- Pt as j,
1862
- H as k,
1863
- Y as l,
1823
+ Lt as j,
1824
+ U as k,
1825
+ H as l,
1864
1826
  te as m,
1865
- vt as n,
1866
- D as o,
1827
+ xt as n,
1828
+ E as o,
1867
1829
  Bt as p,
1868
1830
  O as q,
1869
- W as r,
1870
- Z as s,
1871
- N as t,
1872
- Ct as u,
1831
+ Z as r,
1832
+ N as s,
1833
+ X as t,
1834
+ Ot as u,
1873
1835
  Rt as v,
1874
- Ot as w,
1875
- kt as x,
1876
- Mt as y,
1877
- xt as z
1836
+ zt as w,
1837
+ Vt as x,
1838
+ It as y,
1839
+ Tt as z
1878
1840
  };