@shopware-ag/dive 2.0.1-beta.5 → 2.0.1-beta.6

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 (117) hide show
  1. package/build/chunks/ARSystem-D27w7Pck.mjs +208 -0
  2. package/build/chunks/ARSystem-_0cLAxyG.cjs +1 -0
  3. package/build/{src/modules/animation/AnimationSystem.mjs → chunks/AnimationSystem-Bf-xhqRe.mjs} +24 -18
  4. package/build/chunks/AnimationSystem-DFUYMNpj.cjs +1 -0
  5. package/build/{src/modules/asset/exporter/AssetExporter.cjs → chunks/AssetExporter-CAqADFbL.cjs} +1 -1
  6. package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-ClYQ4gnb.mjs} +2 -2
  7. package/build/{src/modules/asset/loader/AssetLoader.mjs → chunks/AssetLoader-BewzFwHi.mjs} +6 -6
  8. package/build/chunks/AssetLoader-Bq-Ekxil.cjs +4 -0
  9. package/build/chunks/AxisCamera-CUb3g8WX.cjs +1 -0
  10. package/build/chunks/AxisCamera-lXJLIPLK.mjs +39 -0
  11. package/build/chunks/AxisHelperColors-BrGqktN5.cjs +1 -0
  12. package/build/chunks/AxisHelperColors-JLBHYQDi.mjs +9 -0
  13. package/build/chunks/MediaCreator-CEWeS42n.cjs +1 -0
  14. package/build/{src/modules/mediacreator/MediaCreator.mjs → chunks/MediaCreator-psLAAyJA.mjs} +1 -1
  15. package/build/chunks/ModuleRegistry-CBfx1EVd.mjs +13 -0
  16. package/build/chunks/ModuleRegistry-CDIxOzgZ.cjs +1 -0
  17. package/build/chunks/OrbitController-B8VkQV1e.cjs +1 -0
  18. package/build/chunks/OrbitController-CXu1ko6E.mjs +462 -0
  19. package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
  20. package/build/chunks/SelectTool-9eiKZXT4.cjs +1 -0
  21. package/build/chunks/{SelectTool-DmuTopJx.mjs → SelectTool-DLXheZay.mjs} +23 -18
  22. package/build/{src/modules/state/State.mjs → chunks/State-BNgqNPrs.mjs} +2 -2
  23. package/build/{src/modules/state/State.cjs → chunks/State-Mvu0hG-n.cjs} +1 -1
  24. package/build/{src/modules/toolbox/Toolbox.mjs → chunks/Toolbox-DKuyL8n5.mjs} +1 -1
  25. package/build/chunks/Toolbox-qFN47t2F.cjs +1 -0
  26. package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
  27. package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
  28. package/build/chunks/index-C_uFFwT2.mjs +5 -0
  29. package/build/chunks/index-DAwIH9xh.cjs +1 -0
  30. package/build/chunks/package-CHgGmFCa.cjs +1 -0
  31. package/build/chunks/package-CIkS9WF6.mjs +39 -0
  32. package/build/dive.cjs +2 -2
  33. package/build/dive.mjs +588 -1057
  34. package/build/modules/animation/index.cjs +1 -0
  35. package/build/modules/animation/index.d.ts +2 -0
  36. package/build/modules/animation/index.mjs +5 -0
  37. package/build/modules/ar/index.cjs +1 -0
  38. package/build/modules/ar/index.d.ts +2 -0
  39. package/build/modules/ar/index.mjs +11 -0
  40. package/build/modules/assetconverter/index.cjs +1 -0
  41. package/build/modules/assetconverter/index.d.ts +2 -0
  42. package/build/modules/assetconverter/index.mjs +4 -0
  43. package/build/modules/assetexporter/index.cjs +1 -0
  44. package/build/modules/assetexporter/index.d.ts +2 -0
  45. package/build/modules/assetexporter/index.mjs +4 -0
  46. package/build/modules/assetloader/index.cjs +1 -0
  47. package/build/modules/assetloader/index.d.ts +2 -0
  48. package/build/modules/assetloader/index.mjs +4 -0
  49. package/build/modules/axiscamera/index.cjs +1 -0
  50. package/build/modules/axiscamera/index.d.ts +2 -0
  51. package/build/modules/axiscamera/index.mjs +4 -0
  52. package/build/modules/controller/index.cjs +1 -0
  53. package/build/modules/controller/index.d.ts +2 -0
  54. package/build/modules/controller/index.mjs +5 -0
  55. package/build/modules/mediacreator/index.cjs +1 -0
  56. package/build/modules/mediacreator/index.d.ts +2 -0
  57. package/build/modules/mediacreator/index.mjs +4 -0
  58. package/build/modules/state/index.cjs +1 -0
  59. package/build/modules/state/index.d.ts +2 -0
  60. package/build/modules/state/index.mjs +39 -0
  61. package/build/modules/systeminfo/index.cjs +1 -0
  62. package/build/modules/systeminfo/index.d.ts +2 -0
  63. package/build/{src/modules/systeminfo/SystemInfo.mjs → modules/systeminfo/index.mjs} +48 -27
  64. package/build/modules/toolbox/index.cjs +1 -0
  65. package/build/modules/toolbox/index.d.ts +2 -0
  66. package/build/modules/toolbox/index.mjs +10 -0
  67. package/build/src/engine/index.d.ts +6 -0
  68. package/build/src/engine/renderer/Renderer.d.ts +47 -7
  69. package/build/src/events/index.d.ts +1 -0
  70. package/build/src/index.d.ts +2 -1
  71. package/build/src/modules/ModuleRegistry.d.ts +3 -3
  72. package/build/src/modules/animation/index.d.ts +2 -0
  73. package/build/src/modules/ar/ARSystem.d.ts +0 -20
  74. package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +8 -0
  75. package/build/src/modules/ar/error/ar-errors.d.ts +18 -0
  76. package/build/src/modules/ar/index.d.ts +4 -0
  77. package/build/src/modules/ar/sceneviewer/SceneViewer.d.ts +10 -0
  78. package/build/src/modules/ar/webxr/raycaster/WebXRRaycaster.d.ts +1 -1
  79. package/build/src/modules/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
  80. package/build/src/modules/{asset/converter → assetconverter}/AssetConverter.d.ts +3 -3
  81. package/build/src/modules/assetconverter/index.d.ts +1 -0
  82. package/build/src/modules/{asset/exporter → assetexporter}/AssetExporter.d.ts +1 -1
  83. package/build/src/modules/assetexporter/index.d.ts +1 -0
  84. package/build/src/modules/assetloader/index.d.ts +1 -0
  85. package/build/src/modules/axiscamera/index.d.ts +1 -0
  86. package/build/src/modules/controller/index.d.ts +1 -0
  87. package/build/src/modules/mediacreator/index.d.ts +1 -0
  88. package/build/src/modules/state/index.d.ts +4 -0
  89. package/build/src/modules/state/types/ActionTypes.d.ts +1 -1
  90. package/build/src/modules/systeminfo/SystemInfo.d.ts +21 -0
  91. package/build/src/modules/systeminfo/index.d.ts +1 -0
  92. package/build/src/modules/toolbox/index.d.ts +4 -0
  93. package/build/src/modules/toolbox/select/SelectTool.d.ts +0 -3
  94. package/build/src/modules/toolbox/transform/TransformTool.d.ts +0 -3
  95. package/package.json +47 -37
  96. package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
  97. package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
  98. package/build/chunks/SelectTool-C7nerV4P.cjs +0 -1
  99. package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
  100. package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
  101. package/build/chunks/index-C7Wx_9uY.mjs +0 -33
  102. package/build/chunks/index-MNP0K5dt.cjs +0 -1
  103. package/build/chunks/package-DeBkqggW.mjs +0 -39
  104. package/build/chunks/package-o6as1hwQ.cjs +0 -1
  105. package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
  106. package/build/src/modules/animation/AnimationSystem.cjs +0 -1
  107. package/build/src/modules/ar/ARSystem.cjs +0 -1
  108. package/build/src/modules/ar/ARSystem.mjs +0 -163
  109. package/build/src/modules/asset/loader/AssetLoader.cjs +0 -4
  110. package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
  111. package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
  112. package/build/src/modules/toolbox/Toolbox.cjs +0 -1
  113. /package/build/{src/modules/asset/converter/AssetConverter.cjs → chunks/AssetConverter-BTAb23e8.cjs} +0 -0
  114. /package/build/{src/modules/asset/converter/AssetConverter.mjs → chunks/AssetConverter-D-qOTLs1.mjs} +0 -0
  115. /package/build/src/{modules/events → events}/EventExecutor.d.ts +0 -0
  116. /package/build/src/modules/{asset/loader → assetloader}/AssetLoader.d.ts +0 -0
  117. /package/build/src/modules/{asset → assetloader}/draco/DracoLoader.d.ts +0 -0
@@ -3,8 +3,9 @@ var Xt = (r, i, t) => i in r ? jt(r, i, { enumerable: !0, configurable: !0, writ
3
3
  var c = (r, i, t) => Xt(r, typeof i != "symbol" ? i + "" : i, t);
4
4
  import { Object3D as st, Vector3 as a, Quaternion as E, Raycaster as bt, MeshBasicMaterial as St, LineBasicMaterial as Yt, CylinderGeometry as w, BoxGeometry as f, BufferGeometry as lt, Float32BufferAttribute as ht, Mesh as o, OctahedronGeometry as B, Line as I, TorusGeometry as C, SphereGeometry as Qt, Euler as Zt, Matrix4 as vt, PlaneGeometry as Ht, DoubleSide as Ot, Vector2 as tt } from "three";
5
5
  import { P as Ct, U as kt } from "./VisibilityLayerMask-CXgt1fJc.mjs";
6
- import { f as ot, A as ct, a as dt, b as pt, i as et } from "./findInterface-OrXgmwxj.mjs";
7
- const j = new bt(), u = new a(), z = new a(), d = new E(), ut = {
6
+ import { f as ot, i as et } from "./findInterface-DbJ5qzbc.mjs";
7
+ import { A as ct, a as dt, b as pt } from "./AxisHelperColors-JLBHYQDi.mjs";
8
+ const j = new bt(), u = new a(), T = new a(), d = new E(), ut = {
8
9
  X: new a(1, 0, 0),
9
10
  Y: new a(0, 1, 0),
10
11
  Z: new a(0, 0, 1)
@@ -29,8 +30,8 @@ class Lt extends st {
29
30
  }), l[m] = b, s[m] = b, n[m] = b;
30
31
  }
31
32
  e("camera", i), e("object", void 0), e("enabled", !0), e("axis", null), e("mode", "translate"), e("translationSnap", null), e("rotationSnap", null), e("scaleSnap", null), e("space", "world"), e("size", 1), e("dragging", !1), e("showX", !0), e("showY", !0), e("showZ", !0);
32
- const p = new a(), g = new a(), T = new E(), Y = new E(), H = new a(), O = new E(), at = new a(), q = new a(), M = new a(), x = 0, v = new a();
33
- e("worldPosition", p), e("worldPositionStart", g), e("worldQuaternion", T), e("worldQuaternionStart", Y), e("cameraPosition", H), e("cameraQuaternion", O), e("pointStart", at), e("pointEnd", q), e("rotationAxis", M), e("rotationAngle", x), e("eye", v), this._offset = new a(), this._startNorm = new a(), this._endNorm = new a(), this._cameraScale = new a(), this._parentPosition = new a(), this._parentQuaternion = new E(), this._parentQuaternionInv = new E(), this._parentScale = new a(), this._worldScaleStart = new a(), this._worldQuaternionInv = new E(), this._worldScale = new a(), this._positionStart = new a(), this._quaternionStart = new E(), this._scaleStart = new a(), this._getPointer = Rt.bind(this), this._onPointerDown = qt.bind(this), this._onPointerHover = Gt.bind(this), this._onPointerMove = Wt.bind(this), this._onPointerUp = Ft.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
33
+ const p = new a(), g = new a(), z = new E(), Y = new E(), H = new a(), O = new E(), at = new a(), q = new a(), M = new a(), x = 0, v = new a();
34
+ e("worldPosition", p), e("worldPositionStart", g), e("worldQuaternion", z), e("worldQuaternionStart", Y), e("cameraPosition", H), e("cameraQuaternion", O), e("pointStart", at), e("pointEnd", q), e("rotationAxis", M), e("rotationAngle", x), e("eye", v), this._offset = new a(), this._startNorm = new a(), this._endNorm = new a(), this._cameraScale = new a(), this._parentPosition = new a(), this._parentQuaternion = new E(), this._parentQuaternionInv = new E(), this._parentScale = new a(), this._worldScaleStart = new a(), this._worldQuaternionInv = new E(), this._worldScale = new a(), this._positionStart = new a(), this._quaternionStart = new E(), this._scaleStart = new a(), this._getPointer = Rt.bind(this), this._onPointerDown = qt.bind(this), this._onPointerHover = Gt.bind(this), this._onPointerMove = Wt.bind(this), this._onPointerUp = Ft.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
34
35
  }
35
36
  // updateMatrixWorld updates key transformation variables
36
37
  updateMatrixWorld(i) {
@@ -61,10 +62,10 @@ class Lt extends st {
61
62
  else if (n === "scale") {
62
63
  if (t.search("XYZ") !== -1) {
63
64
  let p = this.pointEnd.length() / this.pointStart.length();
64
- this.pointEnd.dot(this.pointStart) < 0 && (p *= -1), z.set(p, p, p);
65
+ this.pointEnd.dot(this.pointStart) < 0 && (p *= -1), T.set(p, p, p);
65
66
  } else
66
- u.copy(this.pointStart), z.copy(this.pointEnd), u.applyQuaternion(this._worldQuaternionInv), z.applyQuaternion(this._worldQuaternionInv), z.divide(u), t.search("X") === -1 && (z.x = 1), t.search("Y") === -1 && (z.y = 1), t.search("Z") === -1 && (z.z = 1);
67
- s.scale.copy(this._scaleStart).multiply(z), this.scaleSnap && (t.search("X") !== -1 && (s.scale.x = Math.round(s.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (s.scale.y = Math.round(s.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (s.scale.z = Math.round(s.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
67
+ u.copy(this.pointStart), T.copy(this.pointEnd), u.applyQuaternion(this._worldQuaternionInv), T.applyQuaternion(this._worldQuaternionInv), T.divide(u), t.search("X") === -1 && (T.x = 1), t.search("Y") === -1 && (T.y = 1), t.search("Z") === -1 && (T.z = 1);
68
+ s.scale.copy(this._scaleStart).multiply(T), this.scaleSnap && (t.search("X") !== -1 && (s.scale.x = Math.round(s.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (s.scale.y = Math.round(s.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (s.scale.z = Math.round(s.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
68
69
  } else if (n === "rotate") {
69
70
  this._offset.copy(this.pointEnd).sub(this.pointStart);
70
71
  const p = 20 / this.worldPosition.distanceTo(u.setFromMatrixPosition(this.camera.matrixWorld));
@@ -188,8 +189,8 @@ class Ut extends st {
188
189
  p.color.setHex(255);
189
190
  const g = i.clone();
190
191
  g.color.setHex(16711680), g.opacity = 0.5;
191
- const T = i.clone();
192
- T.color.setHex(65280), T.opacity = 0.5;
192
+ const z = i.clone();
193
+ z.color.setHex(65280), z.opacity = 0.5;
193
194
  const Y = i.clone();
194
195
  Y.color.setHex(255), Y.opacity = 0.5;
195
196
  const H = i.clone();
@@ -240,7 +241,7 @@ class Ut extends st {
240
241
  [new o(new f(0.15, 0.15, 0.01), g.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
241
242
  ],
242
243
  XZ: [
243
- [new o(new f(0.15, 0.15, 0.01), T.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
244
+ [new o(new f(0.15, 0.15, 0.01), z.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
244
245
  ]
245
246
  }, Pt = {
246
247
  X: [
@@ -345,12 +346,12 @@ class Ut extends st {
345
346
  [new o(new f(0.15, 0.15, 0.01), g), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
346
347
  ],
347
348
  XZ: [
348
- [new o(new f(0.15, 0.15, 0.01), T), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
349
+ [new o(new f(0.15, 0.15, 0.01), z), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
349
350
  ],
350
351
  XYZ: [
351
352
  [new o(new f(0.1, 0.1, 0.1), H.clone())]
352
353
  ]
353
- }, zt = {
354
+ }, Tt = {
354
355
  X: [
355
356
  [new o(new w(0.2, 0, 0.6, 4), n), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
356
357
  [new o(new w(0.2, 0, 0.6, 4), n), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
@@ -375,7 +376,7 @@ class Ut extends st {
375
376
  XYZ: [
376
377
  [new o(new f(0.2, 0.2, 0.2), n), [0, 0, 0]]
377
378
  ]
378
- }, Tt = {
379
+ }, zt = {
379
380
  X: [
380
381
  [new I(v, s.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
381
382
  ],
@@ -397,7 +398,7 @@ class Ut extends st {
397
398
  }
398
399
  return W;
399
400
  }
400
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = D(A)), this.add(this.gizmo.rotate = D(Mt)), this.add(this.gizmo.scale = D(It)), this.add(this.picker.translate = D(Pt)), this.add(this.picker.rotate = D(Dt)), this.add(this.picker.scale = D(zt)), this.add(this.helper.translate = D(Et)), this.add(this.helper.rotate = D(xt)), this.add(this.helper.scale = D(Tt)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
401
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = D(A)), this.add(this.gizmo.rotate = D(Mt)), this.add(this.gizmo.scale = D(It)), this.add(this.picker.translate = D(Pt)), this.add(this.picker.rotate = D(Dt)), this.add(this.picker.scale = D(Tt)), this.add(this.helper.translate = D(Et)), this.add(this.helper.rotate = D(xt)), this.add(this.helper.scale = D(zt)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
401
402
  }
402
403
  // updateMatrixWorld will update transformations and appearance of individual handles
403
404
  updateMatrixWorld(i) {
@@ -610,6 +611,7 @@ class Bt {
610
611
  return this._lastPointerDown.distanceTo(this._pointer) > this.POINTER_DRAG_THRESHOLD;
611
612
  }
612
613
  }
614
+ const ie = (r) => r.isTransformTool !== void 0;
613
615
  class Nt extends Bt {
614
616
  constructor(t, n) {
615
617
  super(t, n);
@@ -665,8 +667,8 @@ class Nt extends Bt {
665
667
  }), t;
666
668
  }
667
669
  }
668
- const ee = (r) => r.isSelectTool !== void 0;
669
- class ie extends Nt {
670
+ const ne = (r) => r.isSelectTool !== void 0;
671
+ class se extends Nt {
670
672
  constructor(t, n) {
671
673
  super(t, n);
672
674
  c(this, "isSelectTool", !0);
@@ -707,6 +709,9 @@ class ie extends Nt {
707
709
  }
708
710
  }
709
711
  export {
710
- ie as D,
711
- ee as i
712
+ Bt as D,
713
+ se as a,
714
+ ie as b,
715
+ Nt as c,
716
+ ne as i
712
717
  };
@@ -1,9 +1,9 @@
1
1
  var v_ = Object.defineProperty;
2
2
  var w_ = (g, d, o) => d in g ? v_(g, d, { enumerable: !0, configurable: !0, writable: !0, value: o }) : g[d] = o;
3
3
  var fn = (g, d, o) => w_(g, typeof d != "symbol" ? d + "" : d, o);
4
- import { g as ht } from "../../../chunks/ModuleRegistry-RSub8W0G.mjs";
4
+ import { g as ht } from "./ModuleRegistry-CBfx1EVd.mjs";
5
5
  import { Easing as _o } from "@tweenjs/tween.js";
6
- import { i as wo } from "../../../chunks/SelectTool-DmuTopJx.mjs";
6
+ import { i as wo } from "./SelectTool-DLXheZay.mjs";
7
7
  const on = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
8
8
  function x_() {
9
9
  const g = Math.random() * 4294967295 | 0, d = Math.random() * 4294967295 | 0, o = Math.random() * 4294967295 | 0, E = Math.random() * 4294967295 | 0;
@@ -1,4 +1,4 @@
1
- "use strict";var K_=Object.defineProperty;var Z_=(g,d,o)=>d in g?K_(g,d,{enumerable:!0,configurable:!0,writable:!0,value:o}):g[d]=o;var fn=(g,d,o)=>Z_(g,typeof d!="symbol"?d+"":d,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ht=require("../../../chunks/ModuleRegistry-NyNtjHb2.cjs"),wo=require("@tweenjs/tween.js"),xo=require("../../../chunks/SelectTool-C7nerV4P.cjs"),on=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Y_(){const g=Math.random()*4294967295|0,d=Math.random()*4294967295|0,o=Math.random()*4294967295|0,m=Math.random()*4294967295|0;return(on[g&255]+on[g>>8&255]+on[g>>16&255]+on[g>>24&255]+"-"+on[d&255]+on[d>>8&255]+"-"+on[d>>16&15|64]+on[d>>24&255]+"-"+on[o&63|128]+on[o>>8&255]+"-"+on[o>>16&255]+on[o>>24&255]+on[m&255]+on[m>>8&255]+on[m>>16&255]+on[m>>24&255]).toLowerCase()}const mo={};function N(g,d){mo[g]=d}function Eo(g){return mo[g]}class F{constructor(d,o){fn(this,"_payload");fn(this,"_dependencies");this._payload=d,this._dependencies=o}static define({description:d,execute:o}){return class extends F{constructor(E,B){super(E,B);fn(this,"_description",d);fn(this,"_payload");this._payload=E}execute(){return o(this._payload,this._dependencies)}}}}const bo=F.define({description:"Launches AR mode in native capabilities. (iOS: AR Quick Look, Android: Google Scene Viewer)",execute:async(g,{getARSystem:d})=>d().then(o=>{o.launch(g.uri,g.options)})});N("LAUNCH_AR",bo);const So=F.define({description:"Calculates the camera position and target to view the whole scene. (experimental).",execute:(g,{engine:d,controller:o})=>{const m=d.scene.computeSceneBB();return o.computeEncompassingView(m)}});N("COMPUTE_ENCOMPASSING_VIEW",So);const Oo=F.define({description:"Gets the current camera position and target.",execute:(g,{controller:d})=>({position:d.object.position.clone(),target:d.target.clone()})});N("GET_CAMERA_TRANSFORM",Oo);function J_(g){return g.entityType==="primitive"}function To(g){return g.entityType==="model"}function X_(g){return g.entityType==="light"}function Di(g){return g.entityType==="pov"}function Q_(g){return g.entityType==="group"}const Co=F.define({description:"Moves the camera to a new position and target.",execute:async(g,{controller:d,registered:o,getAnimationSystem:m,engine:E})=>{let B={x:0,y:0,z:0},K={x:0,y:0,z:0};if("id"in g){const V=o.get(g.id);if(!V)throw new Error(`POV with id ${g.id} not registered. Registered: ${o}`);if(!Di(V))throw new Error(`Object with id ${g.id} is not a POV. Object: ${V}`);B=V.position,K=V.target}else B=g.position,K=g.target;const Q=await m().then(V=>{E.clock.addTicker(V),d.enabled=!0;const ar=V.createAnimator(d.object.position,B,g.duration,{easing:wo.Easing.Quadratic.Out}).play(),Ae=V.createAnimator(d.target,K,g.duration,{easing:wo.Easing.Quadratic.Out,onUpdate:()=>{d.object.lookAt(d.target)},onComplete:()=>{d.enabled=!g.locked}}).play();return[ar,Ae]});return{stop:()=>Q.forEach(V=>V.stop())}}});N("MOVE_CAMERA",Co);const Io=F.define({description:"Sets the camera layer to a certain layer.",execute:(g,{controller:d})=>{d.object.setCameraLayer(g.layer)}});N("SET_CAMERA_LAYER",Io);const Ro=F.define({description:"Sets the camera position and target.",execute:(g,{controller:d})=>{d.object.position.copy(g.position),d.target.copy(g.target),d.update()}});N("SET_CAMERA_TRANSFORM",Ro);const yo=F.define({description:"Zooms the camera in or out by a certain amount.",execute:(g,{controller:d})=>{g.direction==="IN"&&d.zoomIn(g.by),g.direction==="OUT"&&d.zoomOut(g.by)}});N("ZOOM_CAMERA",yo);const Lo=F.define({description:"Generates a screenshot, stores it in a Blob and returns a Promise of a valid URI.",execute:async(g,{registered:d,getMediaCreator:o})=>{let m={x:0,y:0,z:0},E={x:0,y:0,z:0};if("id"in g){const B=d.get(g.id);if(!B)throw new Error(`Object with id ${g.id} not registered. Registered: ${d}`);if(!Di(B))throw new Error(`Object with id ${g.id} is not a POV. Object: ${B}`);m=B.position,E=B.target}else m=g.position,E=g.target;return o().then(B=>B.generateMedia(m,E,g.width,g.height))}});N("GENERATE_MEDIA",Lo);const Mo=F.define({description:"Adds an object to the scene.",execute:(g,{engine:d,registered:o})=>{o.get(g.id)||(g.parentId===void 0&&(g.parentId=null),o.set(g.id,g),d.scene.root.addSceneObject(g))}});N("ADD_OBJECT",Mo);var cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gt={exports:{}};/**
1
+ "use strict";var K_=Object.defineProperty;var Z_=(g,d,o)=>d in g?K_(g,d,{enumerable:!0,configurable:!0,writable:!0,value:o}):g[d]=o;var fn=(g,d,o)=>Z_(g,typeof d!="symbol"?d+"":d,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ht=require("./ModuleRegistry-CDIxOzgZ.cjs"),wo=require("@tweenjs/tween.js"),xo=require("./SelectTool-9eiKZXT4.cjs"),on=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Y_(){const g=Math.random()*4294967295|0,d=Math.random()*4294967295|0,o=Math.random()*4294967295|0,m=Math.random()*4294967295|0;return(on[g&255]+on[g>>8&255]+on[g>>16&255]+on[g>>24&255]+"-"+on[d&255]+on[d>>8&255]+"-"+on[d>>16&15|64]+on[d>>24&255]+"-"+on[o&63|128]+on[o>>8&255]+"-"+on[o>>16&255]+on[o>>24&255]+on[m&255]+on[m>>8&255]+on[m>>16&255]+on[m>>24&255]).toLowerCase()}const mo={};function N(g,d){mo[g]=d}function Eo(g){return mo[g]}class F{constructor(d,o){fn(this,"_payload");fn(this,"_dependencies");this._payload=d,this._dependencies=o}static define({description:d,execute:o}){return class extends F{constructor(E,B){super(E,B);fn(this,"_description",d);fn(this,"_payload");this._payload=E}execute(){return o(this._payload,this._dependencies)}}}}const bo=F.define({description:"Launches AR mode in native capabilities. (iOS: AR Quick Look, Android: Google Scene Viewer)",execute:async(g,{getARSystem:d})=>d().then(o=>{o.launch(g.uri,g.options)})});N("LAUNCH_AR",bo);const So=F.define({description:"Calculates the camera position and target to view the whole scene. (experimental).",execute:(g,{engine:d,controller:o})=>{const m=d.scene.computeSceneBB();return o.computeEncompassingView(m)}});N("COMPUTE_ENCOMPASSING_VIEW",So);const Oo=F.define({description:"Gets the current camera position and target.",execute:(g,{controller:d})=>({position:d.object.position.clone(),target:d.target.clone()})});N("GET_CAMERA_TRANSFORM",Oo);function J_(g){return g.entityType==="primitive"}function To(g){return g.entityType==="model"}function X_(g){return g.entityType==="light"}function Di(g){return g.entityType==="pov"}function Q_(g){return g.entityType==="group"}const Co=F.define({description:"Moves the camera to a new position and target.",execute:async(g,{controller:d,registered:o,getAnimationSystem:m,engine:E})=>{let B={x:0,y:0,z:0},K={x:0,y:0,z:0};if("id"in g){const V=o.get(g.id);if(!V)throw new Error(`POV with id ${g.id} not registered. Registered: ${o}`);if(!Di(V))throw new Error(`Object with id ${g.id} is not a POV. Object: ${V}`);B=V.position,K=V.target}else B=g.position,K=g.target;const Q=await m().then(V=>{E.clock.addTicker(V),d.enabled=!0;const ar=V.createAnimator(d.object.position,B,g.duration,{easing:wo.Easing.Quadratic.Out}).play(),Ae=V.createAnimator(d.target,K,g.duration,{easing:wo.Easing.Quadratic.Out,onUpdate:()=>{d.object.lookAt(d.target)},onComplete:()=>{d.enabled=!g.locked}}).play();return[ar,Ae]});return{stop:()=>Q.forEach(V=>V.stop())}}});N("MOVE_CAMERA",Co);const Io=F.define({description:"Sets the camera layer to a certain layer.",execute:(g,{controller:d})=>{d.object.setCameraLayer(g.layer)}});N("SET_CAMERA_LAYER",Io);const Ro=F.define({description:"Sets the camera position and target.",execute:(g,{controller:d})=>{d.object.position.copy(g.position),d.target.copy(g.target),d.update()}});N("SET_CAMERA_TRANSFORM",Ro);const yo=F.define({description:"Zooms the camera in or out by a certain amount.",execute:(g,{controller:d})=>{g.direction==="IN"&&d.zoomIn(g.by),g.direction==="OUT"&&d.zoomOut(g.by)}});N("ZOOM_CAMERA",yo);const Lo=F.define({description:"Generates a screenshot, stores it in a Blob and returns a Promise of a valid URI.",execute:async(g,{registered:d,getMediaCreator:o})=>{let m={x:0,y:0,z:0},E={x:0,y:0,z:0};if("id"in g){const B=d.get(g.id);if(!B)throw new Error(`Object with id ${g.id} not registered. Registered: ${d}`);if(!Di(B))throw new Error(`Object with id ${g.id} is not a POV. Object: ${B}`);m=B.position,E=B.target}else m=g.position,E=g.target;return o().then(B=>B.generateMedia(m,E,g.width,g.height))}});N("GENERATE_MEDIA",Lo);const Mo=F.define({description:"Adds an object to the scene.",execute:(g,{engine:d,registered:o})=>{o.get(g.id)||(g.parentId===void 0&&(g.parentId=null),o.set(g.id,g),d.scene.root.addSceneObject(g))}});N("ADD_OBJECT",Mo);var cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gt={exports:{}};/**
2
2
  * @license
3
3
  * Lodash <https://lodash.com/>
4
4
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -1,7 +1,7 @@
1
1
  var n = Object.defineProperty;
2
2
  var s = (t, e, o) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
3
  var i = (t, e, o) => s(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { D as l } from "../../../chunks/SelectTool-DmuTopJx.mjs";
4
+ import { a as l } from "./SelectTool-DLXheZay.mjs";
5
5
  class r {
6
6
  constructor(e, o) {
7
7
  i(this, "_scene");
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var l=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var i=(t,e,o)=>l(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./SelectTool-9eiKZXT4.cjs");class n{constructor(e,o){i(this,"_scene");i(this,"_controller");i(this,"_activeTool");i(this,"_selectTool");this._scene=e,this._controller=o,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new r.DIVESelectTool(this._scene,this._controller)),this._selectTool}dispose(){this.removeEventListeners()}getActiveTool(){return this._activeTool}useTool(e){var o;switch((o=this._activeTool)==null||o.deactivate(),e){case"select":{this.addEventListeners(),this.selectTool.activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.useTool: Unknown tool: ${e}`)}}setGizmoMode(e){this.selectTool.setGizmoMode(e)}setGizmoVisibility(e){this.selectTool.setGizmoVisibility(e)}setGizmoScaleLinked(e){this.selectTool.setGizmoScaleLinked(e)}onPointerMove(e){var o;(o=this._activeTool)==null||o.onPointerMove(e)}onPointerDown(e){var o;(o=this._activeTool)==null||o.onPointerDown(e)}onPointerUp(e){var o;(o=this._activeTool)==null||o.onPointerUp(e)}onWheel(e){var o;(o=this._activeTool)==null||o.onWheel(e)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.addEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.addEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.addEventListener("wheel",e=>this.onWheel(e))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.removeEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.removeEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.removeEventListener("wheel",e=>this.onWheel(e))}}i(n,"DefaultTool","select");exports.Toolbox=n;
@@ -0,0 +1 @@
1
+ "use strict";function r(n,e){return n?e in n:!1}function f(n,e){if(n)return r(n,e)?n:f(n.parent,e)}exports.findInterface=f;exports.implementsInterface=r;
@@ -0,0 +1,11 @@
1
+ function e(n, r) {
2
+ return n ? r in n : !1;
3
+ }
4
+ function f(n, r) {
5
+ if (n)
6
+ return e(n, r) ? n : f(n.parent, r);
7
+ }
8
+ export {
9
+ f,
10
+ e as i
11
+ };
@@ -0,0 +1,5 @@
1
+ var _ = /* @__PURE__ */ ((N) => (N.IOS = "iOS", N.ANDROID = "Android", N.WINDOWS = "Windows", N.MACOS = "MacOS", N.LINUX = "Linux", N.UNKNOWN = "Unknown", N))(_ || {}), O = /* @__PURE__ */ ((N) => (N.NO_WEBXR_API = "NO_WEBXR_API", N.NO_HTTPS = "NO_HTTPS", N.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE = "IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE", N.AR_PERMISSION_DENIED = "AR_PERMISSION_DENIED", N.UNKNOWN_ERROR = "UNKNOWN_ERROR", N))(O || {});
2
+ export {
3
+ _ as E,
4
+ O as a
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";var _=(N=>(N.IOS="iOS",N.ANDROID="Android",N.WINDOWS="Windows",N.MACOS="MacOS",N.LINUX="Linux",N.UNKNOWN="Unknown",N))(_||{}),O=(N=>(N.NO_WEBXR_API="NO_WEBXR_API",N.NO_HTTPS="NO_HTTPS",N.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE="IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE",N.AR_PERMISSION_DENIED="AR_PERMISSION_DENIED",N.UNKNOWN_ERROR="UNKNOWN_ERROR",N))(O||{});exports.ESystem=_;exports.EWebXRUnsupportedReason=O;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="@shopware-ag/dive",s="2.0.1-beta.6",t="Shopware Spatial Framework",i="module",d="build/dive.cjs",o="build/dive.mjs",r="build/dive.d.ts",l={".":{types:"./build/dive.d.ts",import:"./build/dive.mjs",require:"./build/dive.cjs"},"./animation":{types:"./build/modules/animation/index.d.ts",import:"./build/modules/animation/index.mjs",require:"./build/modules/animation/index.cjs"},"./ar":{types:"./build/modules/ar/index.d.ts",import:"./build/modules/ar/index.mjs",require:"./build/modules/ar/index.cjs"},"./assetconverter":{types:"./build/modules/assetconverter/index.d.ts",import:"./build/modules/assetconverter/index.mjs",require:"./build/modules/assetconverter/index.cjs"},"./assetexporter":{types:"./build/modules/assetexporter/index.d.ts",import:"./build/modules/assetexporter/index.mjs",require:"./build/modules/assetexporter/index.cjs"},"./assetloader":{types:"./build/modules/assetloader/index.d.ts",import:"./build/modules/assetloader/index.mjs",require:"./build/modules/assetloader/index.cjs"},"./axiscamera":{types:"./build/modules/axiscamera/index.d.ts",import:"./build/modules/axiscamera/index.mjs",require:"./build/modules/axiscamera/index.cjs"},"./controller":{types:"./build/modules/controller/index.d.ts",import:"./build/modules/controller/index.mjs",require:"./build/modules/controller/index.cjs"},"./mediacreator":{types:"./build/modules/mediacreator/index.d.ts",import:"./build/modules/mediacreator/index.mjs",require:"./build/modules/mediacreator/index.cjs"},"./state":{types:"./build/modules/state/index.d.ts",import:"./build/modules/state/index.mjs",require:"./build/modules/state/index.cjs"},"./systeminfo":{types:"./build/modules/systeminfo/index.d.ts",import:"./build/modules/systeminfo/index.mjs",require:"./build/modules/systeminfo/index.cjs"},"./toolbox":{types:"./build/modules/toolbox/index.d.ts",import:"./build/modules/toolbox/index.mjs",require:"./build/modules/toolbox/index.cjs"}},n=["build","LICENSE","package.json"],a=["dive","shopware","sw6","three","three.js","3d","typescript"],u="git@github.com:shopware/dive.git",c="ffrank <f.frank@shopware.com>",m="MIT",p=["> 1%, not dead, not ie 11, not op_mini all"],b={"@tweenjs/tween.js":"^23.1.1",lodash:"^4.17.21",three:"^0.163.0","three-spritetext":"^1.8.2"},x={"@eslint/js":"^9.1.1","@testing-library/jest-dom":"^6.6.3","@types/jest":"^29.5.12","@types/lodash":"^4.17.12","@types/node":"^20.12.7","@types/three":"^0.163.0","@vitest/coverage-v8":"3.1.2",acorn:"^8.14.1","acorn-walk":"^8.3.4",eslint:"^9.1.1",glob:"^11.0.1",globals:"^15.0.0",jsdom:"^26.1.0","magic-string":"^0.30.17",prettier:"^3.3.3","prettier-plugin-multiline-arrays":"^3.0.6","rollup-plugin-copy":"^3.5.0","ts-jest":"^29.1.2","ts-morph":"^25.0.1","ts-node":"^10.9.2",tsc:"^2.0.4",tsx:"^4.19.4",typescript:"^5.8.2","typescript-eslint":"^7.7.1",vite:"^6.2.1","vite-plugin-dts":"^4.5.3","vite-plugin-wasm":"^3.4.1",vitest:"^3.1.2"},y={"validate-build-paths":"NODE_OPTIONS='--loader ts-node/esm' ts-node ci/build/validate-build-paths.ts",build:"vite build",dev:"vite build --watch",lint:"eslint","prettier:check":"prettier --check .","prettier:fix":"prettier --write .",unit:"vitest --run",coverage:"vitest --coverage --run",docs:"yarn docs:actions && yarn docs:modules","docs:actions":"tsx docs/generators/generate-actions-docs.ts","docs:modules":"tsx docs/generators/generate-modules-docs.ts",ci:"yarn lint && yarn prettier:check && yarn docs && yarn coverage && yarn build"},j={name:e,version:s,description:t,type:i,main:d,module:o,types:r,exports:l,files:n,keywords:a,repository:u,author:c,license:m,browserslist:p,dependencies:b,devDependencies:x,scripts:y};exports.author=c;exports.browserslist=p;exports.default=j;exports.dependencies=b;exports.description=t;exports.devDependencies=x;exports.exports=l;exports.files=n;exports.keywords=a;exports.license=m;exports.main=d;exports.module=o;exports.name=e;exports.repository=u;exports.scripts=y;exports.type=i;exports.types=r;exports.version=s;
@@ -0,0 +1,39 @@
1
+ const e = "@shopware-ag/dive", s = "2.0.1-beta.6", t = "Shopware Spatial Framework", i = "module", d = "build/dive.cjs", o = "build/dive.mjs", r = "build/dive.d.ts", l = { ".": { types: "./build/dive.d.ts", import: "./build/dive.mjs", require: "./build/dive.cjs" }, "./animation": { types: "./build/modules/animation/index.d.ts", import: "./build/modules/animation/index.mjs", require: "./build/modules/animation/index.cjs" }, "./ar": { types: "./build/modules/ar/index.d.ts", import: "./build/modules/ar/index.mjs", require: "./build/modules/ar/index.cjs" }, "./assetconverter": { types: "./build/modules/assetconverter/index.d.ts", import: "./build/modules/assetconverter/index.mjs", require: "./build/modules/assetconverter/index.cjs" }, "./assetexporter": { types: "./build/modules/assetexporter/index.d.ts", import: "./build/modules/assetexporter/index.mjs", require: "./build/modules/assetexporter/index.cjs" }, "./assetloader": { types: "./build/modules/assetloader/index.d.ts", import: "./build/modules/assetloader/index.mjs", require: "./build/modules/assetloader/index.cjs" }, "./axiscamera": { types: "./build/modules/axiscamera/index.d.ts", import: "./build/modules/axiscamera/index.mjs", require: "./build/modules/axiscamera/index.cjs" }, "./controller": { types: "./build/modules/controller/index.d.ts", import: "./build/modules/controller/index.mjs", require: "./build/modules/controller/index.cjs" }, "./mediacreator": { types: "./build/modules/mediacreator/index.d.ts", import: "./build/modules/mediacreator/index.mjs", require: "./build/modules/mediacreator/index.cjs" }, "./state": { types: "./build/modules/state/index.d.ts", import: "./build/modules/state/index.mjs", require: "./build/modules/state/index.cjs" }, "./systeminfo": { types: "./build/modules/systeminfo/index.d.ts", import: "./build/modules/systeminfo/index.mjs", require: "./build/modules/systeminfo/index.cjs" }, "./toolbox": { types: "./build/modules/toolbox/index.d.ts", import: "./build/modules/toolbox/index.mjs", require: "./build/modules/toolbox/index.cjs" } }, n = ["build", "LICENSE", "package.json"], a = ["dive", "shopware", "sw6", "three", "three.js", "3d", "typescript"], u = "git@github.com:shopware/dive.git", m = "ffrank <f.frank@shopware.com>", c = "MIT", p = ["> 1%, not dead, not ie 11, not op_mini all"], b = { "@tweenjs/tween.js": "^23.1.1", lodash: "^4.17.21", three: "^0.163.0", "three-spritetext": "^1.8.2" }, x = { "@eslint/js": "^9.1.1", "@testing-library/jest-dom": "^6.6.3", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.12", "@types/node": "^20.12.7", "@types/three": "^0.163.0", "@vitest/coverage-v8": "3.1.2", acorn: "^8.14.1", "acorn-walk": "^8.3.4", eslint: "^9.1.1", glob: "^11.0.1", globals: "^15.0.0", jsdom: "^26.1.0", "magic-string": "^0.30.17", prettier: "^3.3.3", "prettier-plugin-multiline-arrays": "^3.0.6", "rollup-plugin-copy": "^3.5.0", "ts-jest": "^29.1.2", "ts-morph": "^25.0.1", "ts-node": "^10.9.2", tsc: "^2.0.4", tsx: "^4.19.4", typescript: "^5.8.2", "typescript-eslint": "^7.7.1", vite: "^6.2.1", "vite-plugin-dts": "^4.5.3", "vite-plugin-wasm": "^3.4.1", vitest: "^3.1.2" }, y = { "validate-build-paths": "NODE_OPTIONS='--loader ts-node/esm' ts-node ci/build/validate-build-paths.ts", build: "vite build", dev: "vite build --watch", lint: "eslint", "prettier:check": "prettier --check .", "prettier:fix": "prettier --write .", unit: "vitest --run", coverage: "vitest --coverage --run", docs: "yarn docs:actions && yarn docs:modules", "docs:actions": "tsx docs/generators/generate-actions-docs.ts", "docs:modules": "tsx docs/generators/generate-modules-docs.ts", ci: "yarn lint && yarn prettier:check && yarn docs && yarn coverage && yarn build" }, j = {
2
+ name: e,
3
+ version: s,
4
+ description: t,
5
+ type: i,
6
+ main: d,
7
+ module: o,
8
+ types: r,
9
+ exports: l,
10
+ files: n,
11
+ keywords: a,
12
+ repository: u,
13
+ author: m,
14
+ license: c,
15
+ browserslist: p,
16
+ dependencies: b,
17
+ devDependencies: x,
18
+ scripts: y
19
+ };
20
+ export {
21
+ m as author,
22
+ p as browserslist,
23
+ j as default,
24
+ b as dependencies,
25
+ t as description,
26
+ x as devDependencies,
27
+ l as exports,
28
+ n as files,
29
+ a as keywords,
30
+ c as license,
31
+ d as main,
32
+ o as module,
33
+ e as name,
34
+ u as repository,
35
+ y as scripts,
36
+ i as type,
37
+ r as types,
38
+ s as version
39
+ };
package/build/dive.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ht=Object.defineProperty;var dt=(l,n,t)=>n in l?ht(l,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[n]=t;var c=(l,n,t)=>dt(l,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three"),ae=require("three-spritetext"),y=require("./chunks/VisibilityLayerMask-BI7jPKdx.cjs"),x=require("./chunks/findInterface-BEdL2iUQ.cjs"),E=require("./chunks/ModuleRegistry-NyNtjHb2.cjs"),Be=require("./chunks/PerspectiveCamera-BByyG5R4.cjs"),K=require("./chunks/FileTypes-DzVpDu_p.cjs"),he=require("./chunks/index-MNP0K5dt.cjs"),Ue=require("./chunks/parse-error-Bd09D_1L.cjs"),ve={type:"change"},ce={type:"start"},Ve={type:"end"},J=new s.Ray,ke=new s.Plane,ut=Math.cos(70*s.MathUtils.DEG2RAD);class mt extends s.EventDispatcher{constructor(n,t){super(),this.object=n,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new s.Vector3,this.cursor=new s.Vector3,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=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=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:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(i){i.addEventListener("keydown",re),this._domElementKeyEvents=i},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",re),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(ve),e.update(),r=o.NONE},this.update=function(){const i=new s.Vector3,a=new s.Quaternion().setFromUnitVectors(n.up,new s.Vector3(0,1,0)),u=a.clone().invert(),m=new s.Vector3,b=new s.Quaternion,P=new s.Vector3,w=2*Math.PI;return function(lt=null){const Ae=e.object.position;i.copy(Ae).sub(e.target),i.applyQuaternion(a),h.setFromVector3(i),e.autoRotate&&r===o.NONE&&Y(He(lt)),e.enableDamping?(h.theta+=p.theta*e.dampingFactor,h.phi+=p.phi*e.dampingFactor):(h.theta+=p.theta,h.phi+=p.phi);let M=e.minAzimuthAngle,T=e.maxAzimuthAngle;isFinite(M)&&isFinite(T)&&(M<-Math.PI?M+=w:M>Math.PI&&(M-=w),T<-Math.PI?T+=w:T>Math.PI&&(T-=w),M<=T?h.theta=Math.max(M,Math.min(T,h.theta)):h.theta=h.theta>(M+T)/2?Math.max(M,h.theta):Math.min(T,h.theta)),h.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,h.phi)),h.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(_,e.dampingFactor):e.target.add(_),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let G=!1;if(e.zoomToCursor&&W||e.object.isOrthographicCamera)h.radius=ne(h.radius);else{const L=h.radius;h.radius=ne(h.radius*f),G=L!=h.radius}if(i.setFromSpherical(h),i.applyQuaternion(u),Ae.copy(e.target).add(i),e.object.lookAt(e.target),e.enableDamping===!0?(p.theta*=1-e.dampingFactor,p.phi*=1-e.dampingFactor,_.multiplyScalar(1-e.dampingFactor)):(p.set(0,0,0),_.set(0,0,0)),e.zoomToCursor&&W){let L=null;if(e.object.isPerspectiveCamera){const j=i.length();L=ne(j*f);const q=j-L;e.object.position.addScaledVector(me,q),e.object.updateMatrixWorld(),G=!!q}else if(e.object.isOrthographicCamera){const j=new s.Vector3(S.x,S.y,0);j.unproject(e.object);const q=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),e.object.updateProjectionMatrix(),G=q!==e.object.zoom;const Re=new s.Vector3(S.x,S.y,0);Re.unproject(e.object),e.object.position.sub(Re).add(j),e.object.updateMatrixWorld(),L=i.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;L!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(L).add(e.object.position):(J.origin.copy(e.object.position),J.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(J.direction))<ut?n.lookAt(e.target):(ke.setFromNormalAndCoplanarPoint(e.object.up,e.target),J.intersectPlane(ke,e.target))))}else if(e.object.isOrthographicCamera){const L=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),L!==e.object.zoom&&(e.object.updateProjectionMatrix(),G=!0)}return f=1,W=!1,G||m.distanceToSquared(e.object.position)>d||8*(1-b.dot(e.object.quaternion))>d||P.distanceToSquared(e.target)>d?(e.dispatchEvent(ve),m.copy(e.object.position),b.copy(e.object.quaternion),P.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Ie),e.domElement.removeEventListener("pointerdown",Le),e.domElement.removeEventListener("pointercancel",F),e.domElement.removeEventListener("wheel",Se),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.domElement.getRootNode().removeEventListener("keydown",Pe,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",re),e._domElementKeyEvents=null)};const e=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=o.NONE;const d=1e-6,h=new s.Spherical,p=new s.Spherical;let f=1;const _=new s.Vector3,C=new s.Vector2,I=new s.Vector2,v=new s.Vector2,O=new s.Vector2,A=new s.Vector2,V=new s.Vector2,k=new s.Vector2,B=new s.Vector2,R=new s.Vector2,me=new s.Vector3,S=new s.Vector2;let W=!1;const g=[],N={};let te=!1;function He(i){return i!==null?2*Math.PI/60*e.autoRotateSpeed*i:2*Math.PI/60/60*e.autoRotateSpeed}function Z(i){const a=Math.abs(i*.01);return Math.pow(.95,e.zoomSpeed*a)}function Y(i){p.theta-=i}function X(i){p.phi-=i}const pe=function(){const i=new s.Vector3;return function(u,m){i.setFromMatrixColumn(m,0),i.multiplyScalar(-u),_.add(i)}}(),fe=function(){const i=new s.Vector3;return function(u,m){e.screenSpacePanning===!0?i.setFromMatrixColumn(m,1):(i.setFromMatrixColumn(m,0),i.crossVectors(e.object.up,i)),i.multiplyScalar(u),_.add(i)}}(),U=function(){const i=new s.Vector3;return function(u,m){const b=e.domElement;if(e.object.isPerspectiveCamera){const P=e.object.position;i.copy(P).sub(e.target);let w=i.length();w*=Math.tan(e.object.fov/2*Math.PI/180),pe(2*u*w/b.clientHeight,e.object.matrix),fe(2*m*w/b.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(pe(u*(e.object.right-e.object.left)/e.object.zoom/b.clientWidth,e.object.matrix),fe(m*(e.object.top-e.object.bottom)/e.object.zoom/b.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function ie(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f/=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function ge(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f*=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function se(i,a){if(!e.zoomToCursor)return;W=!0;const u=e.domElement.getBoundingClientRect(),m=i-u.left,b=a-u.top,P=u.width,w=u.height;S.x=m/P*2-1,S.y=-(b/w)*2+1,me.set(S.x,S.y,1).unproject(e.object).sub(e.object.position).normalize()}function ne(i){return Math.max(e.minDistance,Math.min(e.maxDistance,i))}function _e(i){C.set(i.clientX,i.clientY)}function Ke(i){se(i.clientX,i.clientX),k.set(i.clientX,i.clientY)}function ye(i){O.set(i.clientX,i.clientY)}function We(i){I.set(i.clientX,i.clientY),v.subVectors(I,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;Y(2*Math.PI*v.x/a.clientHeight),X(2*Math.PI*v.y/a.clientHeight),C.copy(I),e.update()}function Ze(i){B.set(i.clientX,i.clientY),R.subVectors(B,k),R.y>0?ie(Z(R.y)):R.y<0&&ge(Z(R.y)),k.copy(B),e.update()}function Xe(i){A.set(i.clientX,i.clientY),V.subVectors(A,O).multiplyScalar(e.panSpeed),U(V.x,V.y),O.copy(A),e.update()}function qe(i){se(i.clientX,i.clientY),i.deltaY<0?ge(Z(i.deltaY)):i.deltaY>0&&ie(Z(i.deltaY)),e.update()}function Je(i){let a=!1;switch(i.code){case e.keys.UP:i.ctrlKey||i.metaKey||i.shiftKey?X(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,e.keyPanSpeed),a=!0;break;case e.keys.BOTTOM:i.ctrlKey||i.metaKey||i.shiftKey?X(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,-e.keyPanSpeed),a=!0;break;case e.keys.LEFT:i.ctrlKey||i.metaKey||i.shiftKey?Y(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(e.keyPanSpeed,0),a=!0;break;case e.keys.RIGHT:i.ctrlKey||i.metaKey||i.shiftKey?Y(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(-e.keyPanSpeed,0),a=!0;break}a&&(i.preventDefault(),e.update())}function be(i){if(g.length===1)C.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);C.set(u,m)}}function Ee(i){if(g.length===1)O.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);O.set(u,m)}}function we(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);k.set(0,b)}function $e(i){e.enableZoom&&we(i),e.enablePan&&Ee(i)}function Qe(i){e.enableZoom&&we(i),e.enableRotate&&be(i)}function De(i){if(g.length==1)I.set(i.pageX,i.pageY);else{const u=z(i),m=.5*(i.pageX+u.x),b=.5*(i.pageY+u.y);I.set(m,b)}v.subVectors(I,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;Y(2*Math.PI*v.x/a.clientHeight),X(2*Math.PI*v.y/a.clientHeight),C.copy(I)}function Me(i){if(g.length===1)A.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);A.set(u,m)}V.subVectors(A,O).multiplyScalar(e.panSpeed),U(V.x,V.y),O.copy(A)}function Te(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);B.set(0,b),R.set(0,Math.pow(B.y/k.y,e.zoomSpeed)),ie(R.y),k.copy(B);const P=(i.pageX+a.x)*.5,w=(i.pageY+a.y)*.5;se(P,w)}function et(i){e.enableZoom&&Te(i),e.enablePan&&Me(i)}function tt(i){e.enableZoom&&Te(i),e.enableRotate&&De(i)}function Le(i){e.enabled!==!1&&(g.length===0&&(e.domElement.setPointerCapture(i.pointerId),e.domElement.addEventListener("pointermove",oe),e.domElement.addEventListener("pointerup",F)),!ct(i)&&(rt(i),i.pointerType==="touch"?Ce(i):it(i)))}function oe(i){e.enabled!==!1&&(i.pointerType==="touch"?ot(i):st(i))}function F(i){switch(at(i),g.length){case 0:e.domElement.releasePointerCapture(i.pointerId),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.dispatchEvent(Ve),r=o.NONE;break;case 1:const a=g[0],u=N[a];Ce({pointerId:a,pageX:u.x,pageY:u.y});break}}function it(i){let a;switch(i.button){case 0:a=e.mouseButtons.LEFT;break;case 1:a=e.mouseButtons.MIDDLE;break;case 2:a=e.mouseButtons.RIGHT;break;default:a=-1}switch(a){case s.MOUSE.DOLLY:if(e.enableZoom===!1)return;Ke(i),r=o.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enablePan===!1)return;ye(i),r=o.PAN}else{if(e.enableRotate===!1)return;_e(i),r=o.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enableRotate===!1)return;_e(i),r=o.ROTATE}else{if(e.enablePan===!1)return;ye(i),r=o.PAN}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(ce)}function st(i){switch(r){case o.ROTATE:if(e.enableRotate===!1)return;We(i);break;case o.DOLLY:if(e.enableZoom===!1)return;Ze(i);break;case o.PAN:if(e.enablePan===!1)return;Xe(i);break}}function Se(i){e.enabled===!1||e.enableZoom===!1||r!==o.NONE||(i.preventDefault(),e.dispatchEvent(ce),qe(nt(i)),e.dispatchEvent(Ve))}function nt(i){const a=i.deltaMode,u={clientX:i.clientX,clientY:i.clientY,deltaY:i.deltaY};switch(a){case 1:u.deltaY*=16;break;case 2:u.deltaY*=100;break}return i.ctrlKey&&!te&&(u.deltaY*=10),u}function Pe(i){i.key==="Control"&&(te=!0,e.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(i){i.key==="Control"&&(te=!1,e.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function re(i){e.enabled===!1||e.enablePan===!1||Je(i)}function Ce(i){switch(Oe(i),g.length){case 1:switch(e.touches.ONE){case s.TOUCH.ROTATE:if(e.enableRotate===!1)return;be(i),r=o.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(e.enablePan===!1)return;Ee(i),r=o.TOUCH_PAN;break;default:r=o.NONE}break;case 2:switch(e.touches.TWO){case s.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;$e(i),r=o.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Qe(i),r=o.TOUCH_DOLLY_ROTATE;break;default:r=o.NONE}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(ce)}function ot(i){switch(Oe(i),r){case o.TOUCH_ROTATE:if(e.enableRotate===!1)return;De(i),e.update();break;case o.TOUCH_PAN:if(e.enablePan===!1)return;Me(i),e.update();break;case o.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;et(i),e.update();break;case o.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;tt(i),e.update();break;default:r=o.NONE}}function Ie(i){e.enabled!==!1&&i.preventDefault()}function rt(i){g.push(i.pointerId)}function at(i){delete N[i.pointerId];for(let a=0;a<g.length;a++)if(g[a]==i.pointerId){g.splice(a,1);return}}function ct(i){for(let a=0;a<g.length;a++)if(g[a]==i.pointerId)return!0;return!1}function Oe(i){let a=N[i.pointerId];a===void 0&&(a=new s.Vector2,N[i.pointerId]=a),a.set(i.pageX,i.pageY)}function z(i){const a=i.pointerId===g[0]?g[1]:g[0];return N[a]}e.domElement.addEventListener("contextmenu",Ie),e.domElement.addEventListener("pointerdown",Le),e.domElement.addEventListener("pointercancel",F),e.domElement.addEventListener("wheel",Se,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Pe,{passive:!0,capture:!0}),this.update()}}const $={enableDamping:!0,dampingFactor:.05},H=class H extends mt{constructor(t,e,o=$){super(t,e);c(this,"uuid",s.MathUtils.generateUUID());c(this,"object");this.domElement=e,this.domElement=e,this.object=t,this.enableDamping=o.enableDamping??$.enableDamping,this.dampingFactor=o.dampingFactor??$.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}tick(){this.enabled&&this.update()}computeEncompassingView(t){const e=t.getCenter(new s.Vector3),o=t.getSize(new s.Vector3),r=Math.max(o.x,o.y,o.z)*1.25;return{position:this.object.position.clone().normalize().clone().multiplyScalar(r),target:e.clone()}}zoomIn(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()-e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}zoomOut(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()+e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}};c(H,"DEFAULT_ZOOM_FACTOR",1);let Q=H;class pt extends s.OrthographicCamera{constructor(t,e,o){super(-1,1,1,-1,.1,100);c(this,"axesHelper");c(this,"_renderer");c(this,"_scene");c(this,"_camera");c(this,"_restoreViewport",new s.Vector4);this.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper=new s.AxesHelper(.5),this.axesHelper.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new s.Color(x.AxesColorRed),new s.Color(x.AxesColorGreen),new s.Color(x.AxesColorBlue));const r=new ae("X",.2,x.AxesColorRedLetter),d=new ae("Y",.2,x.AxesColorGreenLetter),h=new ae("Z",.2,x.AxesColorBlueLetter);r.layers.mask=y.COORDINATE_LAYER_MASK,d.layers.mask=y.COORDINATE_LAYER_MASK,h.layers.mask=y.COORDINATE_LAYER_MASK,r.position.set(.7,0,0),d.position.set(0,.7,0),h.position.set(0,0,.7),this.axesHelper.add(r),this.axesHelper.add(d),this.axesHelper.add(h),this.add(this.axesHelper),this._renderer=t,this._scene=e,this._camera=o,this._scene.add(this)}tick(){const t=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this.setFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=t}dispose(){this._scene.remove(this)}setFromCameraMatrix(t){this.axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(t).invert())}}class ft extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVEAmbientLight",!0);c(this,"_light");this.name="DIVEAmbientLight",this._light=new s.AmbientLight(16777215,1),this._light.layers.mask=y.PRODUCT_LAYER_MASK,this.add(this._light)}setColor(t){this._light.color=t}setIntensity(t){this._light.intensity=t}setEnabled(t){this._light.visible=t}}class gt extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVEPointLight",!0);c(this,"isMovable",!0);c(this,"isSelectable",!0);c(this,"gizmo",null);c(this,"light");c(this,"mesh");this.name="DIVEPointLight",this.light=new s.PointLight(16777215,1),this.light.layers.mask=y.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const t=.1,e=new s.SphereGeometry(t,t*320,t*320),o=new s.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:s.FrontSide});this.mesh=new s.Mesh(e,o),this.mesh.layers.mask=y.UI_LAYER_MASK,this.add(this.mesh)}setColor(t){this.light.color=t,this.mesh.material.color=t}setIntensity(t){this.light.intensity=t,this.mesh.material.opacity=t>.8?.8:t*.8}setEnabled(t){this.light.visible=t}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class ze extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVESceneLight",!0);c(this,"_hemiLight");c(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new s.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=y.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new s.DirectionalLight(16777215,3),this._dirLight.layers.mask=y.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const t=5;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)}setColor(t){this._hemiLight.color=t,this._dirLight.color=t}setIntensity(t){this._hemiLight.intensity=t*2,this._dirLight.intensity=t*3}setEnabled(t){this._hemiLight.visible=t,this._dirLight.visible=t}}const ee=l=>l.parent?ee(l.parent):l;class de extends s.Object3D{constructor(){super();c(this,"isSelectable",!0);c(this,"isMovable",!0);c(this,"isDIVENode",!0);c(this,"gizmo",null);c(this,"_positionWorldBuffer");c(this,"_boundingBox");this.layers.mask=y.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new s.Vector3,this._boundingBox=new s.Box3}setPosition(t){if(!this.parent){this.position.set(t.x,t.y,t.z);return}const e=new s.Vector3(t.x,t.y,t.z);this.position.copy(this.parent.worldToLocal(e)),"isDIVEGroup"in this.parent&&this.parent.updateLineTo(this)}setRotation(t){this.rotation.set(t.x,t.y,t.z)}setScale(t){this.scale.set(t.x,t.y,t.z)}setVisibility(t){this.visible=t}setToWorldOrigin(){this.position.set(0,0,0),E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class Ne extends de{constructor(){super(...arguments);c(this,"isDIVEModel",!0);c(this,"_mesh",null);c(this,"_material",null);c(this,"_assetLoader",null)}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}async setFromURL(t){const o=await(await this._getAssetLoader()).load(t);this.setFromGLTF(o),E.getModule("State").then(r=>{var d;(d=r.get(this.userData.id))==null||d.performAction("MODEL_LOADED",{id:this.userData.id})})}setFromGLTF(t){this.clear(),this._boundingBox.makeEmpty(),t.traverse(e=>{e.castShadow=!0,e.receiveShadow=!0,e.layers.mask=this.layers.mask,this._boundingBox.expandByObject(e),!this._mesh&&"isMesh"in e&&(this._mesh=e,this._material?this._mesh.material=this._material:this._material=e.material)}),this.add(t)}setMaterial(t){this._material||(this._material=new s.MeshStandardMaterial),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)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEModel: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}}class _t extends de{constructor(){super();c(this,"isDIVEPrimitive",!0);c(this,"_mesh");this._mesh=new s.Mesh,this._mesh.layers.mask=y.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new s.MeshStandardMaterial,this.add(this._mesh)}setGeometry(t){const e=this.assembleGeometry(t);e&&(this._mesh.geometry=e,this._boundingBox.setFromObject(this._mesh))}setMaterial(t){const e=this._mesh.material;t.vertexColors!==void 0&&(e.vertexColors=t.vertexColors),t.color!==void 0&&(e.color=new s.Color(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)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEPrimitive: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}assembleGeometry(t){switch(this._mesh.material.flatShading=!1,t.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(t);case"sphere":return this.createSphereGeometry(t);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(t);case"cube":case"box":return this.createBoxGeometry(t);case"cone":return this.createConeGeometry(t);case"wall":return this.createWallGeometry(t);case"plane":return this.createPlaneGeometry(t);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",t.name.toLowerCase()),null}}createCylinderGeometry(t){const e=new s.CylinderGeometry(t.width/2,t.width/2,t.height,64);return e.translate(0,t.height/2,0),e}createSphereGeometry(t){return new s.SphereGeometry(t.width/2,256,256)}createPyramidGeometry(t){const e=new Float32Array([-t.width/2,0,-t.depth/2,t.width/2,0,-t.depth/2,t.width/2,0,t.depth/2,-t.width/2,0,t.depth/2,0,t.height,0]),o=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),r=new s.BufferGeometry;return r.setAttribute("position",new s.BufferAttribute(e,3)),r.setIndex(new s.BufferAttribute(o,1)),r.computeVertexNormals(),r.computeBoundingBox(),r.computeBoundingSphere(),r}createBoxGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}createConeGeometry(t){const e=new s.ConeGeometry(t.width/2,t.height,256);return e.translate(0,t.height/2,0),e}createWallGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth||.05,16);return e.translate(0,t.height/2,0),e}createPlaneGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}}class yt extends de{constructor(){super();c(this,"isDIVEGroup",!0);c(this,"_members");c(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}setPosition(t){super.setPosition(t),this._members.forEach(e=>{"isDIVENode"in e&&e.onMove()})}setLinesVisibility(t,e){if(!e){this._lines.forEach(r=>{r.visible=t});return}const o=this._members.indexOf(e);o!==-1&&(this._lines[o].visible=t)}attach(t){if(this._members.includes(t))return this;const e=this.createLine();return this.add(e),this._lines.push(e),super.attach(t),this._members.push(t),this._updateLineTo(e,t),this.setLinesVisibility(!0,t),this}remove(t){const e=this._members.indexOf(t);if(e===-1)return this;const o=this._lines[e];return super.remove(o),this._lines.splice(e,1),super.remove(t),this._members.splice(e,1),this}updateLineTo(t){const e=this._members.indexOf(t);e!==-1&&this._updateLineTo(this._lines[e],t)}createLine(){const t=new s.BufferGeometry,e=new s.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),o=new s.Line(t,e);return o.visible=!1,o}_updateLineTo(t,e){const o=[new s.Vector3(0,0,0),e.position.clone()];t.geometry.setFromPoints(o),t.computeLineDistances()}}class bt extends s.Mesh{constructor(){super(new s.PlaneGeometry(1e4,1e4),new s.MeshStandardMaterial({color:new s.Color(150/255,150/255,150/255)}));c(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=y.PRODUCT_LAYER_MASK,this.receiveShadow=!0,this.rotateX(-Math.PI/2)}setVisibility(t){this.visible=t}setColor(t){this.material.color=new s.Color(t)}}class Et extends s.Object3D{constructor(){super();c(this,"isDIVERoot",!0);c(this,"_floor");c(this,"_assetLoader",null);this.name="Root",this._floor=new bt,this.add(this._floor)}get floor(){return this._floor}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}computeSceneBB(){const t=new s.Box3;return this.children.forEach(e=>{"isDIVEFloor"in e||e.traverse(o=>{"isObject3D"in o&&t.expandByObject(o)})}),t}getSceneObject(t){let e;return this.traverse(o=>{e||o.userData.id===t.id&&(e=o)}),e}addSceneObject(t){let e=this.getSceneObject(t);if(e)return console.warn(`DIVERoot.addSceneObject: Scene object with id ${t.id} already exists`),e;switch(t.entityType){case"pov":break;case"light":{switch(t.type){case"scene":{e=new ze;break}case"ambient":{e=new ft;break}case"point":{e=new gt;break}default:throw new Error(`DIVERoot.addSceneObject: Unknown light type: ${t.type}`)}e.name=t.name,e.userData.id=t.id,this.add(e),this._updateLight(e,t);break}case"model":{e=new Ne,e.name=t.name,e.userData.id=t.id,e.userData.uri=t.uri,this.add(e),this._updateModel(e,t);break}case"primitive":{e=new _t,e.name=t.name,e.userData.id=t.id,this.add(e),this._updatePrimitive(e,t);break}case"group":{e=new yt,e.name=t.name,e.userData.id=t.id,this.add(e),this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.addSceneObject: Unknown entity type: ${t.entityType}`)}return e}updateSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.updateSceneObject: Scene object with id ${t.id} does not exist`);return}switch(t.entityType){case"pov":break;case"light":{this._updateLight(e,t);break}case"model":{this._updateModel(e,t);break}case"primitive":{this._updatePrimitive(e,t);break}case"group":{this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.updateSceneObject: Unknown entity type: ${t.entityType}`)}}deleteSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.deleteSceneObject: Object with id ${t.id} not found`);return}switch(t.entityType){case"pov":break;case"light":{this._deleteLight(e);break}case"model":{this._deleteModel(e);break}case"primitive":{this._deletePrimitive(e);break}case"group":{this._deleteGroup(e);break}default:throw new Error(`DIVERoot.deleteSceneObject: Unknown entity type: ${t.entityType}`)}}_updateLight(t,e){e.name!==void 0&&e.name!==null&&(t.name=e.name),e.position!==void 0&&e.position!==null&&t.position.set(e.position.x,e.position.y,e.position.z),e.intensity!==void 0&&e.intensity!==null&&t.setIntensity(e.intensity),e.enabled!==void 0&&e.enabled!==null&&t.setEnabled(e.enabled),e.color!==void 0&&e.color!==null&&t.setColor(new s.Color(e.color)),e.visible!==void 0&&e.visible!==null&&(t.visible=e.visible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateModel(t,e){e.uri!==void 0&&t.setFromURL(e.uri),e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updatePrimitive(t,e){e.name!==void 0&&(t.name=e.name),e.geometry!==void 0&&t.setGeometry(e.geometry),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateGroup(t,e){e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.bbVisible!==void 0&&t.setLinesVisibility(e.bbVisible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_deleteLight(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteModel(t){this._detachTransformControls(t),t.parent.remove(t)}_deletePrimitive(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteGroup(t){this._detachTransformControls(t);for(let e=t.members.length-1;e>=0;e--)this.attach(t.members[e]);t.parent.remove(t)}_setParent(t){const e=this.getSceneObject(t);if(t.parentId!==null){const o=this.getSceneObject({id:t.parentId,entityType:t.entityType});if(!o)return;o.attach(e)}else this.attach(e)}_detachTransformControls(t){this._findScene(t).children.find(e=>{"isTransformControls"in e&&e.detach()})}_findScene(t){return t.parent!==null?this._findScene(t.parent):t}}const wt="#888888",Dt="#dddddd";class Mt extends s.Object3D{constructor(){super(),this.name="Grid";const n=new s.GridHelper(100,100,wt,Dt);n.material.depthTest=!1,n.layers.mask=y.HELPER_LAYER_MASK,this.add(n)}setVisibility(n){this.visible=n}}class Tt extends s.Scene{constructor(){super();c(this,"_root");c(this,"_grid");this.background=new s.Color(16777215),this._root=new Et,this.add(this._root),this._grid=new Mt,this.add(this._grid)}get root(){return this._root}get grid(){return this._grid}setBackground(t){this.background=new s.Color(t)}computeSceneBB(){return this.root.computeSceneBB()}}const Ye={canvas:void 0,antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1};class Lt{constructor(n,t,e){c(this,"_webglrenderer");c(this,"_settings");this._scene=n,this._camera=t,this._settings={...Ye,...e??{}},this._webglrenderer=new s.WebGLRenderer({canvas:this._settings.canvas,antialias:this._settings.antialias,alpha:this._settings.alpha,powerPreference:this._settings.powerPreference,precision:this._settings.precision,stencil:this._settings.stencil,depth:this._settings.depth,logarithmicDepthBuffer:this._settings.logarithmicDepthBuffer})}get webglrenderer(){return this._webglrenderer}setCanvas(n){this._webglrenderer.dispose(),this._settings.canvas=n,this._webglrenderer=new s.WebGLRenderer(this._settings)}render(){this._webglrenderer.render(this._scene,this._camera)}onResize(n,t){this._webglrenderer.setSize(n,t,!1)}dispose(){this._webglrenderer.dispose()}}class St{constructor(){c(this,"_renderer",null);c(this,"_lastTime",0);c(this,"_isRunning",!1);c(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}setRenderer(n){this._renderer=n}addTicker(n){this._tickers.find(t=>t.uuid===n.uuid)||this._tickers.push(n)}removeTicker(n){const t=this._tickers.findIndex(e=>e.uuid===n.uuid);t!==-1&&this._tickers.splice(t,1)}dispose(){this.stop(),this._tickers.forEach(n=>{var t;return(t=n.dispose)==null?void 0:t.call(n)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(n){var e;if(!this._isRunning)return;const t=(n-this._lastTime)/1e3;this._lastTime=n,this._tickers.forEach(o=>o.tick(t)),(e=this._renderer)==null||e.render(),requestAnimationFrame(this._tick.bind(this))}}class Pt{constructor(n,t){c(this,"_resizeObserver");c(this,"_width",0);c(this,"_height",0);this._resizeObserver=new ResizeObserver(e=>{for(const o of e){const{width:r,height:d}=o.contentRect;r===this._width&&d===this._height||(n.onResize(r,d),t.onResize(r,d),this._width=r,this._height=d)}}),this._observeCanvas(n.webglrenderer.domElement)}setCanvas(n){this._resizeObserver.disconnect(),this._observeCanvas(n)}dispose(){this._resizeObserver.disconnect()}_observeCanvas(n){if(n.parentElement)this._resizeObserver.observe(n.parentElement);else{const t=setInterval(()=>{n.parentElement&&(this._resizeObserver.observe(n.parentElement),clearInterval(t))},16)}}}const Fe={autoStart:!0,displayAxes:!1,...Be.DIVEPerspectiveCameraDefaultSettings,...Ye};class xt{constructor(n){c(this,"_renderer");c(this,"_scene");c(this,"_camera");c(this,"_resizeManager");c(this,"_clock");c(this,"_settings");this._settings={...Fe,...n??{}},this._scene=new Tt,this._camera=new Be.DIVEPerspectiveCamera(this._settings),this._renderer=new Lt(this._scene,this._camera,this._settings),this._resizeManager=new Pt(this._renderer,this._camera),this._clock=new St,this._clock.setRenderer(this._renderer),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}setCanvas(n){this._renderer.setCanvas(n),this._resizeManager.setCanvas(n)}get clock(){return this._clock}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._renderer.dispose()}}function D(l,n){const t=(l+"e").split("e");return+(t[0]+"e"+(+t[1]+(n||0)))}function Ct(l,n=0){const t=D(l,+n);return D(Math.ceil(t),-n)}function It(l,n=0){const t=D(l,+n);return D(Math.floor(t),-n)}function Ge(l,n=0){if(l<0)return-Ge(-l,n);const t=D(l,+n);return D(Math.round(t),-n)}function Ot(l,n,t){return Math.atan2(l.clone().cross(n).dot(t),n.clone().dot(l))}function At(l,n=0){const t=D(l,+n);return D(Math.round(t),-n).toFixed(n)}function Rt(l,n=0){const t=D(l,+n);return D(Math.trunc(t),-n)}function vt(l){return(s.MathUtils.radToDeg(l)+360)%360}function Vt(l){return s.MathUtils.degToRad(l)}const kt={ceilExp:Ct,floorExp:It,roundExp:Ge,toFixedExp:At,truncateExp:Rt,signedAngleTo:Ot,radToDeg:vt,degToRad:Vt};window.DIVE={instances:[],get instance(){return window.DIVE.instances[0]}};const je={...Fe,...$};class ue{constructor(n){c(this,"_instanceId",s.MathUtils.generateUUID());c(this,"_settings");c(this,"_engine");c(this,"orbitController");c(this,"axisCamera");this._settings={...je,...n??{}},this._engine=new xt(n),this.orbitController=new Q(this._engine.camera,this._engine.renderer.webglrenderer.domElement,this._settings),this._engine.clock.addTicker(this.orbitController),this._settings.displayAxes?(this.axisCamera=new pt(this._engine.renderer,this._engine.scene,this._engine.camera),this._engine.clock.addTicker(this.axisCamera)):this.axisCamera=null,Promise.resolve().then(()=>require("./chunks/package-o6as1hwQ.cjs")).then(t=>{console.log(`DIVE ${t.default.version} initialized successfully!`),console.log(`
1
+ "use strict";var k=Object.defineProperty;var G=(n,i,e)=>i in n?k(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var o=(n,i,e)=>G(n,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./chunks/OrbitController-B8VkQV1e.cjs"),U=require("./chunks/AxisCamera-CUb3g8WX.cjs"),s=require("three"),u=require("./chunks/VisibilityLayerMask-BI7jPKdx.cjs"),c=require("./chunks/ModuleRegistry-CDIxOzgZ.cjs"),f=require("./chunks/PerspectiveCamera-BByyG5R4.cjs"),p=require("./chunks/FileTypes-DzVpDu_p.cjs"),I=require("./chunks/findInterface-C6mrvf_t.cjs"),M=require("./chunks/parse-error-Bd09D_1L.cjs"),L=require("./chunks/index-DAwIH9xh.cjs");class F extends s.Object3D{constructor(){super();o(this,"isDIVELight",!0);o(this,"isDIVEAmbientLight",!0);o(this,"_light");this.name="DIVEAmbientLight",this._light=new s.AmbientLight(16777215,1),this._light.layers.mask=u.PRODUCT_LAYER_MASK,this.add(this._light)}setColor(e){this._light.color=e}setIntensity(e){this._light.intensity=e}setEnabled(e){this._light.visible=e}}class z extends s.Object3D{constructor(){super();o(this,"isDIVELight",!0);o(this,"isDIVEPointLight",!0);o(this,"isMovable",!0);o(this,"isSelectable",!0);o(this,"gizmo",null);o(this,"light");o(this,"mesh");this.name="DIVEPointLight",this.light=new s.PointLight(16777215,1),this.light.layers.mask=u.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const e=.1,t=new s.SphereGeometry(e,e*320,e*320),r=new s.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:s.FrontSide});this.mesh=new s.Mesh(t,r),this.mesh.layers.mask=u.UI_LAYER_MASK,this.add(this.mesh)}setColor(e){this.light.color=e,this.mesh.material.color=e}setIntensity(e){this.light.intensity=e,this.mesh.material.opacity=e>.8?.8:e*.8}setEnabled(e){this.light.visible=e}onMove(){c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})})}onSelect(){c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class C extends s.Object3D{constructor(){super();o(this,"isDIVELight",!0);o(this,"isDIVESceneLight",!0);o(this,"_hemiLight");o(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new s.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=u.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new s.DirectionalLight(16777215,3),this._dirLight.layers.mask=u.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const e=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=e,this._dirLight.shadow.camera.top=e,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}setColor(e){this._hemiLight.color=e,this._dirLight.color=e}setIntensity(e){this._hemiLight.intensity=e*2,this._dirLight.intensity=e*3}setEnabled(e){this._hemiLight.visible=e,this._dirLight.visible=e}}const w=n=>n.parent?w(n.parent):n;class D extends s.Object3D{constructor(){super();o(this,"isSelectable",!0);o(this,"isMovable",!0);o(this,"isDIVENode",!0);o(this,"gizmo",null);o(this,"_positionWorldBuffer");o(this,"_boundingBox");this.layers.mask=u.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new s.Vector3,this._boundingBox=new s.Box3}setPosition(e){if(!this.parent){this.position.set(e.x,e.y,e.z);return}const t=new s.Vector3(e.x,e.y,e.z);this.position.copy(this.parent.worldToLocal(t)),"isDIVEGroup"in this.parent&&this.parent.updateLineTo(this)}setRotation(e){this.rotation.set(e.x,e.y,e.z)}setScale(e){this.scale.set(e.x,e.y,e.z)}setVisibility(e){this.visible=e}setToWorldOrigin(){this.position.set(0,0,0),c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onMove(){c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onSelect(){c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){c.getModule("State").then(e=>{var t;(t=e.get(this.userData.id))==null||t.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class V extends D{constructor(){super(...arguments);o(this,"isDIVEModel",!0);o(this,"_mesh",null);o(this,"_material",null);o(this,"_assetLoader",null)}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await c.getModule("AssetLoader"))),this._assetLoader}async setFromURL(e){const r=await(await this._getAssetLoader()).load(e);this.setFromGLTF(r),c.getModule("State").then(a=>{var h;(h=a.get(this.userData.id))==null||h.performAction("MODEL_LOADED",{id:this.userData.id})})}setFromGLTF(e){this.clear(),this._boundingBox.makeEmpty(),e.traverse(t=>{t.castShadow=!0,t.receiveShadow=!0,t.layers.mask=this.layers.mask,this._boundingBox.expandByObject(t),!this._mesh&&"isMesh"in t&&(this._mesh=t,this._material?this._mesh.material=this._material:this._material=t.material)}),this.add(e)}setMaterial(e){this._material||(this._material=new s.MeshStandardMaterial),e.vertexColors!==void 0&&(this._material.vertexColors=e.vertexColors),e.color!==void 0&&this._material.color.set(e.color),e.map!==void 0&&(this._material.map=e.map),e.normalMap!==void 0&&(this._material.normalMap=e.normalMap),e.roughness!==void 0&&(this._material.roughness=e.roughness),e.roughnessMap!==void 0&&(this._material.roughnessMap=e.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),e.metalness!==void 0&&(this._material.metalness=e.metalness),e.metalnessMap!==void 0&&(this._material.metalnessMap=e.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}placeOnFloor(){var a,h,l,d;const e=this.getWorldPosition(this._positionWorldBuffer),t=e.clone();(h=(a=this._mesh)==null?void 0:a.geometry)==null||h.computeBoundingBox();const r=(d=(l=this._mesh)==null?void 0:l.geometry)==null?void 0:d.boundingBox;!r||!this._mesh||(e.y=e.y-this._mesh.localToWorld(r.min.clone()).y,e.y!==t.y&&c.getModule("State").then(g=>{var m;(m=g.get(this.userData.id))==null||m.performAction("UPDATE_OBJECT",{id:this.userData.id,position:e,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEModel: dropIt() called on a model that is not in the scene.",this);return}const e=this._boundingBox.min.y*this.scale.y,t=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));t.y=e+this.position.y;const r=new s.Raycaster(t,new s.Vector3(0,-1,0));r.layers.mask=u.PRODUCT_LAYER_MASK;const a=r.intersectObjects(w(this).root.children,!0);if(a.length>0){const h=a[0].object;h.geometry.computeBoundingBox();const l=h.geometry.boundingBox,d=h.localToWorld(l.max.clone()),g=this.position.clone(),m=this.position.clone().setY(d.y).sub(new s.Vector3(0,e,0));if(this.position.copy(m),this.position.y===g.y)return;this.onMove()}}}class W extends D{constructor(){super();o(this,"isDIVEPrimitive",!0);o(this,"_mesh");this._mesh=new s.Mesh,this._mesh.layers.mask=u.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new s.MeshStandardMaterial,this.add(this._mesh)}setGeometry(e){const t=this.assembleGeometry(e);t&&(this._mesh.geometry=t,this._boundingBox.setFromObject(this._mesh))}setMaterial(e){const t=this._mesh.material;e.vertexColors!==void 0&&(t.vertexColors=e.vertexColors),e.color!==void 0&&(t.color=new s.Color(e.color)),e.map!==void 0&&(t.map=e.map),e.normalMap!==void 0&&(t.normalMap=e.normalMap),e.roughness!==void 0&&(t.roughness=e.roughness),e.roughnessMap!==void 0&&(t.roughnessMap=e.roughnessMap,t.roughnessMap&&(t.roughness=1)),e.metalness!==void 0&&(t.metalness=e.metalness),e.metalnessMap!==void 0&&(t.metalnessMap=e.metalnessMap,t.metalnessMap&&(t.metalness=0)),this._mesh&&(this._mesh.material=t)}placeOnFloor(){var a,h,l,d;const e=this.getWorldPosition(this._positionWorldBuffer),t=e.clone();(h=(a=this._mesh)==null?void 0:a.geometry)==null||h.computeBoundingBox();const r=(d=(l=this._mesh)==null?void 0:l.geometry)==null?void 0:d.boundingBox;!r||!this._mesh||(e.y=e.y-this._mesh.localToWorld(r.min.clone()).y,e.y!==t.y&&c.getModule("State").then(g=>{var m;(m=g.get(this.userData.id))==null||m.performAction("UPDATE_OBJECT",{id:this.userData.id,position:e,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEPrimitive: dropIt() called on a model that is not in the scene.",this);return}const e=this._boundingBox.min.y*this.scale.y,t=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));t.y=e+this.position.y;const r=new s.Raycaster(t,new s.Vector3(0,-1,0));r.layers.mask=u.PRODUCT_LAYER_MASK;const a=r.intersectObjects(w(this).root.children,!0);if(a.length>0){const h=a[0].object;h.geometry.computeBoundingBox();const l=h.geometry.boundingBox,d=h.localToWorld(l.max.clone()),g=this.position.clone(),m=this.position.clone().setY(d.y).sub(new s.Vector3(0,e,0));if(this.position.copy(m),this.position.y===g.y)return;this.onMove()}}assembleGeometry(e){switch(this._mesh.material.flatShading=!1,e.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(e);case"sphere":return this.createSphereGeometry(e);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(e);case"cube":case"box":return this.createBoxGeometry(e);case"cone":return this.createConeGeometry(e);case"wall":return this.createWallGeometry(e);case"plane":return this.createPlaneGeometry(e);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",e.name.toLowerCase()),null}}createCylinderGeometry(e){const t=new s.CylinderGeometry(e.width/2,e.width/2,e.height,64);return t.translate(0,e.height/2,0),t}createSphereGeometry(e){return new s.SphereGeometry(e.width/2,256,256)}createPyramidGeometry(e){const t=new Float32Array([-e.width/2,0,-e.depth/2,e.width/2,0,-e.depth/2,e.width/2,0,e.depth/2,-e.width/2,0,e.depth/2,0,e.height,0]),r=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),a=new s.BufferGeometry;return a.setAttribute("position",new s.BufferAttribute(t,3)),a.setIndex(new s.BufferAttribute(r,1)),a.computeVertexNormals(),a.computeBoundingBox(),a.computeBoundingSphere(),a}createBoxGeometry(e){const t=new s.BoxGeometry(e.width,e.height,e.depth);return t.translate(0,e.height/2,0),t}createConeGeometry(e){const t=new s.ConeGeometry(e.width/2,e.height,256);return t.translate(0,e.height/2,0),t}createWallGeometry(e){const t=new s.BoxGeometry(e.width,e.height,e.depth||.05,16);return t.translate(0,e.height/2,0),t}createPlaneGeometry(e){const t=new s.BoxGeometry(e.width,e.height,e.depth);return t.translate(0,e.height/2,0),t}}class Y extends D{constructor(){super();o(this,"isDIVEGroup",!0);o(this,"_members");o(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}setPosition(e){super.setPosition(e),this._members.forEach(t=>{"isDIVENode"in t&&t.onMove()})}setLinesVisibility(e,t){if(!t){this._lines.forEach(a=>{a.visible=e});return}const r=this._members.indexOf(t);r!==-1&&(this._lines[r].visible=e)}attach(e){if(this._members.includes(e))return this;const t=this.createLine();return this.add(t),this._lines.push(t),super.attach(e),this._members.push(e),this._updateLineTo(t,e),this.setLinesVisibility(!0,e),this}remove(e){const t=this._members.indexOf(e);if(t===-1)return this;const r=this._lines[t];return super.remove(r),this._lines.splice(t,1),super.remove(e),this._members.splice(t,1),this}updateLineTo(e){const t=this._members.indexOf(e);t!==-1&&this._updateLineTo(this._lines[t],e)}createLine(){const e=new s.BufferGeometry,t=new s.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),r=new s.Line(e,t);return r.visible=!1,r}_updateLineTo(e,t){const r=[new s.Vector3(0,0,0),t.position.clone()];e.geometry.setFromPoints(r),e.computeLineDistances()}}class q extends s.Mesh{constructor(){const e=new s.PlaneGeometry(1,1);e.scale(1e3,1e3,1),e.rotateX(-Math.PI/2);const t=new s.MeshStandardMaterial({color:new s.Color(16777215),side:s.FrontSide});super(e,t);o(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=u.PRODUCT_LAYER_MASK,this.receiveShadow=!0}setVisibility(e){this.visible=e}setColor(e){this.material.color=new s.Color(e)}}class K extends s.Object3D{constructor(){super();o(this,"isDIVERoot",!0);o(this,"_floor");o(this,"_assetLoader",null);this.name="Root",this._floor=new q,this.add(this._floor)}get floor(){return this._floor}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await c.getModule("AssetLoader"))),this._assetLoader}computeSceneBB(){const e=new s.Box3;return this.children.forEach(t=>{"isDIVEFloor"in t||t.traverse(r=>{"isObject3D"in r&&e.expandByObject(r)})}),e}getSceneObject(e){let t;return this.traverse(r=>{t||r.userData.id===e.id&&(t=r)}),t}addSceneObject(e){let t=this.getSceneObject(e);if(t)return console.warn(`DIVERoot.addSceneObject: Scene object with id ${e.id} already exists`),t;switch(e.entityType){case"pov":break;case"light":{switch(e.type){case"scene":{t=new C;break}case"ambient":{t=new F;break}case"point":{t=new z;break}default:throw new Error(`DIVERoot.addSceneObject: Unknown light type: ${e.type}`)}t.name=e.name,t.userData.id=e.id,this.add(t),this._updateLight(t,e);break}case"model":{t=new V,t.name=e.name,t.userData.id=e.id,t.userData.uri=e.uri,this.add(t),this._updateModel(t,e);break}case"primitive":{t=new W,t.name=e.name,t.userData.id=e.id,this.add(t),this._updatePrimitive(t,e);break}case"group":{t=new Y,t.name=e.name,t.userData.id=e.id,this.add(t),this._updateGroup(t,e);break}default:throw new Error(`DIVERoot.addSceneObject: Unknown entity type: ${e.entityType}`)}return t}updateSceneObject(e){const t=this.getSceneObject(e);if(!t){console.warn(`DIVERoot.updateSceneObject: Scene object with id ${e.id} does not exist`);return}switch(e.entityType){case"pov":break;case"light":{this._updateLight(t,e);break}case"model":{this._updateModel(t,e);break}case"primitive":{this._updatePrimitive(t,e);break}case"group":{this._updateGroup(t,e);break}default:throw new Error(`DIVERoot.updateSceneObject: Unknown entity type: ${e.entityType}`)}}deleteSceneObject(e){const t=this.getSceneObject(e);if(!t){console.warn(`DIVERoot.deleteSceneObject: Object with id ${e.id} not found`);return}switch(e.entityType){case"pov":break;case"light":{this._deleteLight(t);break}case"model":{this._deleteModel(t);break}case"primitive":{this._deletePrimitive(t);break}case"group":{this._deleteGroup(t);break}default:throw new Error(`DIVERoot.deleteSceneObject: Unknown entity type: ${e.entityType}`)}}_updateLight(e,t){t.name!==void 0&&t.name!==null&&(e.name=t.name),t.position!==void 0&&t.position!==null&&e.position.set(t.position.x,t.position.y,t.position.z),t.intensity!==void 0&&t.intensity!==null&&e.setIntensity(t.intensity),t.enabled!==void 0&&t.enabled!==null&&e.setEnabled(t.enabled),t.color!==void 0&&t.color!==null&&e.setColor(new s.Color(t.color)),t.visible!==void 0&&t.visible!==null&&(e.visible=t.visible),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_updateModel(e,t){t.uri!==void 0&&e.setFromURL(t.uri),t.name!==void 0&&(e.name=t.name),t.position!==void 0&&e.setPosition(t.position),t.rotation!==void 0&&e.setRotation(t.rotation),t.scale!==void 0&&e.setScale(t.scale),t.visible!==void 0&&e.setVisibility(t.visible),t.material!==void 0&&e.setMaterial(t.material),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_updatePrimitive(e,t){t.name!==void 0&&(e.name=t.name),t.geometry!==void 0&&e.setGeometry(t.geometry),t.position!==void 0&&e.setPosition(t.position),t.rotation!==void 0&&e.setRotation(t.rotation),t.scale!==void 0&&e.setScale(t.scale),t.visible!==void 0&&e.setVisibility(t.visible),t.material!==void 0&&e.setMaterial(t.material),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_updateGroup(e,t){t.name!==void 0&&(e.name=t.name),t.position!==void 0&&e.setPosition(t.position),t.rotation!==void 0&&e.setRotation(t.rotation),t.scale!==void 0&&e.setScale(t.scale),t.visible!==void 0&&e.setVisibility(t.visible),t.bbVisible!==void 0&&e.setLinesVisibility(t.bbVisible),t.parentId!==void 0&&this._setParent({...t,parentId:t.parentId})}_deleteLight(e){this._detachTransformControls(e),e.parent.remove(e)}_deleteModel(e){this._detachTransformControls(e),e.parent.remove(e)}_deletePrimitive(e){this._detachTransformControls(e),e.parent.remove(e)}_deleteGroup(e){this._detachTransformControls(e);for(let t=e.members.length-1;t>=0;t--)this.attach(e.members[t]);e.parent.remove(e)}_setParent(e){const t=this.getSceneObject(e);if(e.parentId!==null){const r=this.getSceneObject({id:e.parentId,entityType:e.entityType});if(!r)return;r.attach(t)}else this.attach(t)}_detachTransformControls(e){this._findScene(e).children.find(t=>{"isTransformControls"in t&&t.detach()})}_findScene(e){return e.parent!==null?this._findScene(e.parent):e}}const N="#888888",J="#dddddd";class $ extends s.Object3D{constructor(){super(),this.name="Grid";const i=new s.GridHelper(100,100,N,J);i.material.depthTest=!1,i.layers.mask=u.HELPER_LAYER_MASK,this.add(i)}setVisibility(i){this.visible=i}}class P extends s.Scene{constructor(){super();o(this,"_root");o(this,"_grid");this.background=new s.Color(16777215),this._root=new K,this.add(this._root),this._grid=new $,this.add(this._grid)}get root(){return this._root}get grid(){return this._grid}setBackground(e){this.background=new s.Color(e)}computeSceneBB(){return this.root.computeSceneBB()}}const b={canvas:void 0,antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1,shadows:!0,shadowQuality:"high"};class T{constructor(i,e,t){o(this,"_webglrenderer");o(this,"_settings");this._scene=i,this._camera=e,this._settings={...b,...t??{}},this._webglrenderer=new s.WebGLRenderer(this._settings),this._webglrenderer.shadowMap.enabled=this._settings.shadows,this._webglrenderer.shadowMap.type=this._settings.shadowQuality==="high"?s.PCFSoftShadowMap:this._settings.shadowQuality==="medium"?s.PCFShadowMap:s.BasicShadowMap}get webglrenderer(){return this._webglrenderer}setCanvas(i){this._webglrenderer.dispose(),this._settings.canvas=i,this._webglrenderer=new s.WebGLRenderer(this._settings)}render(){this._webglrenderer.render(this._scene,this._camera)}onResize(i,e){this._webglrenderer.setSize(i,e,!1)}dispose(){this._webglrenderer.dispose()}}class x{constructor(){o(this,"_renderer",null);o(this,"_lastTime",0);o(this,"_isRunning",!1);o(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}setRenderer(i){this._renderer=i}addTicker(i){this._tickers.find(e=>e.uuid===i.uuid)||this._tickers.push(i)}removeTicker(i){const e=this._tickers.findIndex(t=>t.uuid===i.uuid);e!==-1&&this._tickers.splice(e,1)}dispose(){this.stop(),this._tickers.forEach(i=>{var e;return(e=i.dispose)==null?void 0:e.call(i)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(i){var t;if(!this._isRunning)return;const e=(i-this._lastTime)/1e3;this._lastTime=i,this._tickers.forEach(r=>r.tick(e)),(t=this._renderer)==null||t.render(),requestAnimationFrame(this._tick.bind(this))}}class R{constructor(i,e){o(this,"_resizeObserver");o(this,"_width",0);o(this,"_height",0);this._resizeObserver=new ResizeObserver(t=>{for(const r of t){const{width:a,height:h}=r.contentRect;a===this._width&&h===this._height||(i.onResize(a,h),e.onResize(a,h),this._width=a,this._height=h)}}),this._observeCanvas(i.webglrenderer.domElement)}setCanvas(i){this._resizeObserver.disconnect(),this._observeCanvas(i)}dispose(){this._resizeObserver.disconnect()}_observeCanvas(i){if(i.parentElement)this._resizeObserver.observe(i.parentElement);else{const e=setInterval(()=>{i.parentElement&&(this._resizeObserver.observe(i.parentElement),clearInterval(e))},16)}}}const v={autoStart:!0,displayAxes:!1,...f.DIVEPerspectiveCameraDefaultSettings,...b};class B{constructor(i){o(this,"_renderer");o(this,"_scene");o(this,"_camera");o(this,"_resizeManager");o(this,"_clock");o(this,"_settings");this._settings={...v,...i??{}},this._scene=new P,this._camera=new f.DIVEPerspectiveCamera(this._settings),this._renderer=new T(this._scene,this._camera,this._settings),this._resizeManager=new R(this._renderer,this._camera),this._clock=new x,this._clock.setRenderer(this._renderer),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}setCanvas(i){this._renderer.setCanvas(i),this._resizeManager.setCanvas(i)}get clock(){return this._clock}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._renderer.dispose()}}function _(n,i){const e=(n+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function Q(n,i=0){const e=_(n,+i);return _(Math.ceil(e),-i)}function H(n,i=0){const e=_(n,+i);return _(Math.floor(e),-i)}function A(n,i=0){if(n<0)return-A(-n,i);const e=_(n,+i);return _(Math.round(e),-i)}function X(n,i,e){return Math.atan2(n.clone().cross(i).dot(e),i.clone().dot(n))}function Z(n,i=0){const e=_(n,+i);return _(Math.round(e),-i).toFixed(i)}function j(n,i=0){const e=_(n,+i);return _(Math.trunc(e),-i)}function ee(n){return(s.MathUtils.radToDeg(n)+360)%360}function te(n){return s.MathUtils.degToRad(n)}const ie={ceilExp:Q,floorExp:H,roundExp:A,toFixedExp:Z,truncateExp:j,signedAngleTo:X,radToDeg:ee,degToRad:te};window.DIVE={instances:[],get instance(){return window.DIVE.instances[0]}};const O={...v,...E.OrbitControllerDefaultSettings};class S{constructor(i){o(this,"_instanceId",s.MathUtils.generateUUID());o(this,"_settings");o(this,"_engine");o(this,"orbitController");o(this,"axisCamera");this._settings={...O,...i??{}},this._engine=new B(i),this.orbitController=new E.OrbitController(this._engine.camera,this._engine.renderer.webglrenderer.domElement,this._settings),this._engine.clock.addTicker(this.orbitController),this._settings.displayAxes?(this.axisCamera=new U.DIVEAxisCamera(this._engine.renderer,this._engine.scene,this._engine.camera),this._engine.clock.addTicker(this.axisCamera)):this.axisCamera=null,Promise.resolve().then(()=>require("./chunks/package-CHgGmFCa.cjs")).then(e=>{console.log(`DIVE ${e.default.version} initialized successfully!`),console.log(`
2
2
  @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
3
3
  @@@@+-:::::::---------------------==------------------------------=#@@@@
4
4
  @@%=::::.......::---------------------------------------------------------+@@
@@ -27,4 +27,4 @@
27
27
  @@@@+:::::::#@@ @@*-------*@@@@
28
28
  @@@@@@@ @@@@@@
29
29
 
30
- `)}),window.DIVE.instances.push(this)}static async QuickView(n,t){const e=new ue(t);e.engine.scene.background=new s.Color(16777215),e.engine.scene.grid.setVisibility(!1),e.engine.scene.root.floor.setVisibility(!0),e.engine.scene.root.floor.setColor(16777215),e.engine.camera.position.set(0,2,2),e.orbitController.target.set(0,.5,0);const o=new ze;o.name="SceneLight",o.userData.id=s.MathUtils.generateUUID(),o.setEnabled(!0),o.visible=!0,o.setIntensity((t==null?void 0:t.lightIntensity)??1),o.setColor(new s.Color(16777215)),e.engine.scene.root.add(o);const r=new Ne;r.name="object",r.userData.id=s.MathUtils.generateUUID(),r.userData.uri=n,r.visible=!0,e.engine.scene.root.add(r),await r.setFromURL(n);const d=e.engine.scene.computeSceneBB(),h=e.orbitController.computeEncompassingView(d);return e.engine.camera.position.copy(h.position),e.orbitController.target.copy(h.target),e}get engine(){return this._engine}get canvas(){return this._engine.renderer.webglrenderer.domElement}setCanvas(n){this._engine.setCanvas(n),this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.orbitController=new Q(this._engine.camera,n,this._settings),this._engine.clock.addTicker(this.orbitController)}async dispose(){return new Promise(n=>{this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.axisCamera&&(this._engine.clock.removeTicker(this.axisCamera),this.axisCamera.dispose()),window.DIVE.instances=window.DIVE.instances.filter(t=>t._instanceId!==this._instanceId),n()})}}const le=(l,n)=>{if(Object.keys(l).length===0&&Object.keys(n).length===0)return{};if(typeof l!="object"||typeof n!="object")return n;let t={};return Object.keys(n).forEach(e=>{if(!Object.keys(l).includes(e)){t={...t,[e]:n[e]};return}if(Array.isArray(n[e])){if(!Array.isArray(l[e])){t={...t,[e]:n[e]};return}const o=l[e],r=n[e];if(o.length===0&&r.length===0){t={...t};return}if(o.length!==r.length){t={...t,[e]:n[e]};return}const d=[];if(r.forEach((h,p)=>{const f=le(o[p],r[p]);Object.keys(f).length&&d.push(r[p])}),Object.keys(d).length){t={...t,[e]:d};return}return}if(typeof n[e]=="object"){if(typeof l[e]!="object"){t={...t,[e]:n[e]};return}const o=le(l[e],n[e]);if(Object.keys(o).length){t={...t,[e]:o};return}}l[e]!==n[e]&&(t={...t,[e]:n[e]})}),t};function Bt(l,n){return n.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(o=>{if(o==="constructor")return;const r=Object.getOwnPropertyDescriptor(t.prototype,o);Object.defineProperty(l.prototype,o,r)});const e=new t;Object.getOwnPropertyNames(e).forEach(o=>{const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(l.prototype,o,r)})}),l}exports.findInterface=x.findInterface;exports.implementsInterface=x.implementsInterface;exports.getModule=E.getModule;exports.FILE_TYPES=K.FILE_TYPES;exports.NetworkError=K.NetworkError;exports.SUPPORTED_FILE_TYPES=K.SUPPORTED_FILE_TYPES;exports.getFileTypeFromUri=K.getFileTypeFromUri;exports.isFileTypeSupported=K.isFileTypeSupported;exports.ARCompatibilityError=he.ARCompatibilityError;exports.ESystem=he.ESystem;exports.EWebXRUnsupportedReason=he.EWebXRUnsupportedReason;exports.FileTypeError=Ue.FileTypeError;exports.ParseError=Ue.ParseError;exports.DIVE=ue;exports.DIVEDefaultSettings=je;exports.DIVEMath=kt;exports.applyMixins=Bt;exports.findSceneRecursive=ee;exports.getObjectDelta=le;
30
+ `)}),window.DIVE.instances.push(this)}static async QuickView(i,e){const t=new S(e);t.engine.scene.background=new s.Color(16777215),t.engine.scene.grid.setVisibility(!1),t.engine.scene.root.floor.setVisibility(!0),t.engine.camera.position.set(0,2,2),t.orbitController.target.set(0,.5,0);const r=new C;r.name="SceneLight",r.userData.id=s.MathUtils.generateUUID(),r.setEnabled(!0),r.visible=!0,r.setIntensity((e==null?void 0:e.lightIntensity)??1),r.setColor(new s.Color(16777215)),t.engine.scene.root.add(r);const a=new V;a.name="object",a.userData.id=s.MathUtils.generateUUID(),a.userData.uri=i,a.visible=!0,t.engine.scene.root.add(a),await a.setFromURL(i);const h=t.engine.scene.computeSceneBB(),l=t.orbitController.computeEncompassingView(h);return t.engine.camera.position.copy(l.position),t.orbitController.target.copy(l.target),t}get engine(){return this._engine}get canvas(){return this._engine.renderer.webglrenderer.domElement}setCanvas(i){this._engine.setCanvas(i),this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.orbitController=new E.OrbitController(this._engine.camera,i,this._settings),this._engine.clock.addTicker(this.orbitController)}async dispose(){return new Promise(i=>{this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.axisCamera&&(this._engine.clock.removeTicker(this.axisCamera),this.axisCamera.dispose()),window.DIVE.instances=window.DIVE.instances.filter(e=>e._instanceId!==this._instanceId),i()})}}class se{constructor(){o(this,"isMovable",!0)}}class re{constructor(){o(this,"isSelectable",!0)}}const y=(n,i)=>{if(Object.keys(n).length===0&&Object.keys(i).length===0)return{};if(typeof n!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(n).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(n[t])){e={...e,[t]:i[t]};return}const r=n[t],a=i[t];if(r.length===0&&a.length===0){e={...e};return}if(r.length!==a.length){e={...e,[t]:i[t]};return}const h=[];if(a.forEach((l,d)=>{const g=y(r[d],a[d]);Object.keys(g).length&&h.push(a[d])}),Object.keys(h).length){e={...e,[t]:h};return}return}if(typeof i[t]=="object"){if(typeof n[t]!="object"){e={...e,[t]:i[t]};return}const r=y(n[t],i[t]);if(Object.keys(r).length){e={...e,[t]:r};return}}n[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function ne(n,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(r=>{if(r==="constructor")return;const a=Object.getOwnPropertyDescriptor(e.prototype,r);Object.defineProperty(n.prototype,r,a)});const t=new e;Object.getOwnPropertyNames(t).forEach(r=>{const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n.prototype,r,a)})}),n}exports.getModule=c.getModule;exports.DIVEPerspectiveCamera=f.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=f.DIVEPerspectiveCameraDefaultSettings;exports.FILE_TYPES=p.FILE_TYPES;exports.NetworkError=p.NetworkError;exports.SUPPORTED_FILE_TYPES=p.SUPPORTED_FILE_TYPES;exports.getFileTypeFromUri=p.getFileTypeFromUri;exports.isFileTypeSupported=p.isFileTypeSupported;exports.findInterface=I.findInterface;exports.implementsInterface=I.implementsInterface;exports.FileTypeError=M.FileTypeError;exports.ParseError=M.ParseError;exports.ESystem=L.ESystem;exports.EWebXRUnsupportedReason=L.EWebXRUnsupportedReason;exports.DIVE=S;exports.DIVEClock=x;exports.DIVEDefaultSettings=O;exports.DIVEEngine=B;exports.DIVEMath=ie;exports.DIVEMovable=se;exports.DIVERenderPipeline=T;exports.DIVERenderPipelineDefaultSettings=b;exports.DIVEResizeManager=R;exports.DIVEScene=P;exports.DIVESelectable=re;exports.EngineDefaultSettings=v;exports.applyMixins=ne;exports.findSceneRecursive=w;exports.getObjectDelta=y;