@shopware-ag/dive 3.1.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +31 -5
  2. package/build/chunks/{AssetCache-xpY_N7Yp.cjs → AssetCache-CUVFS7wk.cjs} +1 -1
  3. package/build/chunks/{AssetCache-C3YXhbaX.mjs → AssetCache-DnAAa719.mjs} +1 -1
  4. package/build/chunks/AssetExporter-CD2iuQce.mjs +108 -0
  5. package/build/chunks/AssetExporter-CoL-QXkB.cjs +1 -0
  6. package/build/chunks/{AssetLoader-MfH5d_Rr.mjs → AssetLoader-Bkp3fWZz.mjs} +9 -9
  7. package/build/chunks/{AssetLoader-CRxLq0AL.cjs → AssetLoader-DnVvCd41.cjs} +2 -2
  8. package/build/chunks/FileTypes-B-MjfMGd.cjs +29 -0
  9. package/build/chunks/FileTypes-D3Dxr2dj.mjs +2294 -0
  10. package/build/chunks/ModelComponent-Cmu0EX0r.cjs +1 -0
  11. package/build/chunks/ModelComponent-WA0kLOEY.mjs +87 -0
  12. package/build/chunks/OrbitController-CAJIiZeE.cjs +1 -0
  13. package/build/chunks/OrbitController-DxCbrQVB.mjs +612 -0
  14. package/build/chunks/SpriteTextComponent-BpoKLOjA.cjs +1 -0
  15. package/build/chunks/SpriteTextComponent-DIZFqao0.mjs +83 -0
  16. package/build/chunks/collectAnimations-BgYCN1le.mjs +35 -0
  17. package/build/chunks/collectAnimations-C3HfZHte.cjs +1 -0
  18. package/build/chunks/contributesToBounds-C1mva__U.cjs +1 -0
  19. package/build/chunks/contributesToBounds-DYmHYES4.mjs +14 -0
  20. package/build/chunks/detachTransformControls-B4iRF1bw.mjs +209 -0
  21. package/build/chunks/detachTransformControls-CZ2cd5hx.cjs +1 -0
  22. package/build/chunks/{isFileTypeSupported-BBU39V4u.cjs → isFileExtensionSupported-B1q2eWs7.cjs} +1 -1
  23. package/build/chunks/{isFileTypeSupported-9h8lrIuG.mjs → isFileExtensionSupported-BqOqU3-h.mjs} +1 -1
  24. package/build/chunks/isVisibleInHierarchy-D9JcLqR5.cjs +1 -0
  25. package/build/chunks/isVisibleInHierarchy-KzVGvDEw.mjs +21 -0
  26. package/build/components/boundingbox/BoundingBoxComponent.d.ts +100 -0
  27. package/build/components/boundingbox/index.d.ts +1 -0
  28. package/build/components/camera/CameraComponent.d.ts +75 -0
  29. package/build/components/camera/index.d.ts +2 -0
  30. package/build/components/camera/perspective/PerspectiveCameraComponent.d.ts +39 -0
  31. package/build/components/grid/GridComponent.d.ts +50 -0
  32. package/build/components/index.d.ts +6 -10
  33. package/build/components/light/LightComponent.d.ts +65 -0
  34. package/build/components/light/ambient/AmbientLightComponent.d.ts +10 -0
  35. package/build/components/light/directional/DirectionalLightComponent.d.ts +23 -0
  36. package/build/components/light/hemi/HemisphereLightComponent.d.ts +21 -0
  37. package/build/components/light/index.d.ts +5 -3
  38. package/build/components/light/point/PointLightComponent.d.ts +26 -0
  39. package/build/components/line/MultiLineComponent.d.ts +133 -0
  40. package/build/components/line/index.d.ts +1 -0
  41. package/build/components/mesh/MeshComponent.d.ts +74 -0
  42. package/build/components/mesh/floor/FloorComponent.d.ts +36 -0
  43. package/build/components/mesh/index.d.ts +4 -0
  44. package/build/components/mesh/model/ModelComponent.d.ts +67 -0
  45. package/build/components/mesh/primitive/PrimitiveComponent.d.ts +43 -0
  46. package/build/components/spritetext/SpriteTextComponent.d.ts +58 -0
  47. package/build/constants/VisibilityLayerMask.d.ts +23 -0
  48. package/build/dive.cjs +1 -1
  49. package/build/dive.mjs +252 -773
  50. package/build/engine/Dive.d.ts +11 -13
  51. package/build/engine/boundingbox/BoundingBox.d.ts +76 -0
  52. package/build/engine/component/Component.d.ts +236 -0
  53. package/build/engine/environment/Environment.d.ts +0 -18
  54. package/build/engine/index.d.ts +4 -1
  55. package/build/engine/node/Node.d.ts +189 -0
  56. package/build/engine/promise/abortable/AbortablePromise.d.ts +8 -0
  57. package/build/engine/renderer/Renderer.d.ts +43 -7
  58. package/build/engine/scene/Scene.d.ts +88 -4
  59. package/build/engine/scene/root/Root.d.ts +29 -0
  60. package/build/engine/scene/xrroot/XRRoot.d.ts +1 -1
  61. package/build/engine/view/View.d.ts +15 -4
  62. package/build/helpers/collectAnimations/collectAnimations.d.ts +23 -0
  63. package/build/helpers/computeProductBounds/computeProductBounds.d.ts +18 -0
  64. package/build/helpers/contributesToBounds/contributesToBounds.d.ts +17 -0
  65. package/build/helpers/detachTransformControls/detachTransformControls.d.ts +15 -0
  66. package/build/helpers/disposeComponents/disposeComponents.d.ts +20 -0
  67. package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +7 -3
  68. package/build/helpers/implementsInterface/implementsInterface.d.ts +11 -0
  69. package/build/helpers/index.d.ts +6 -1
  70. package/build/helpers/isVisibleInHierarchy/isVisibleInHierarchy.d.ts +12 -0
  71. package/build/index.d.ts +0 -1
  72. package/build/plugins/animation/index.mjs +3 -2
  73. package/build/plugins/animation/src/system/AnimationSystem.d.ts +3 -2
  74. package/build/plugins/ar/index.cjs +1 -1
  75. package/build/plugins/ar/index.mjs +2 -2
  76. package/build/plugins/ar/src/webxr/WebXR.d.ts +7 -0
  77. package/build/plugins/assetcache/index.cjs +1 -1
  78. package/build/plugins/assetcache/index.mjs +1 -1
  79. package/build/plugins/assetexporter/index.cjs +1 -1
  80. package/build/plugins/assetexporter/index.mjs +1 -1
  81. package/build/plugins/assetexporter/src/AssetExporter.d.ts +12 -0
  82. package/build/plugins/assetloader/index.cjs +1 -1
  83. package/build/plugins/assetloader/index.mjs +2 -2
  84. package/build/plugins/mediacreator/index.cjs +1 -1
  85. package/build/plugins/mediacreator/index.mjs +32 -30
  86. package/build/plugins/mediacreator/src/MediaCreator.d.ts +1 -2
  87. package/build/plugins/orbitcontroller/index.cjs +1 -1
  88. package/build/plugins/orbitcontroller/index.d.ts +1 -0
  89. package/build/plugins/orbitcontroller/index.mjs +1 -1
  90. package/build/plugins/orbitcontroller/src/OrbitController.d.ts +39 -6
  91. package/build/plugins/orientationdisplay/index.cjs +1 -1
  92. package/build/plugins/orientationdisplay/index.mjs +39 -31
  93. package/build/plugins/orientationdisplay/src/OrientationDisplay.d.ts +3 -3
  94. package/build/plugins/quickview/index.cjs +1 -1
  95. package/build/plugins/quickview/index.mjs +68 -45
  96. package/build/plugins/quickview/src/QuickView.d.ts +40 -13
  97. package/build/plugins/quickview/types/index.d.ts +0 -18
  98. package/build/plugins/state/index.cjs +1 -27
  99. package/build/plugins/state/index.mjs +1983 -4262
  100. package/build/plugins/state/src/EngineGateway.d.ts +98 -0
  101. package/build/plugins/state/src/EntityRegistry.d.ts +51 -0
  102. package/build/plugins/state/src/State.d.ts +20 -9
  103. package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
  104. package/build/plugins/state/src/actions/camera/movecamera.d.ts +2 -2
  105. package/build/plugins/state/src/actions/media/generatemedia.d.ts +1 -1
  106. package/build/plugins/state/src/actions/object/addobject.d.ts +2 -3
  107. package/build/plugins/state/src/actions/object/deleteobject.d.ts +3 -4
  108. package/build/plugins/state/src/actions/object/deselectobject.d.ts +3 -4
  109. package/build/plugins/state/src/actions/object/dropit.d.ts +2 -2
  110. package/build/plugins/state/src/actions/object/getallobjects.d.ts +2 -3
  111. package/build/plugins/state/src/actions/object/getobjects.d.ts +3 -4
  112. package/build/plugins/state/src/actions/object/index.d.ts +0 -1
  113. package/build/plugins/state/src/actions/object/modelloaded.d.ts +2 -2
  114. package/build/plugins/state/src/actions/object/selectobject.d.ts +3 -4
  115. package/build/plugins/state/src/actions/object/setparent.d.ts +3 -4
  116. package/build/plugins/state/src/actions/object/updateobject.d.ts +3 -4
  117. package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
  118. package/build/plugins/state/src/actions/scene/exportscene.d.ts +2 -2
  119. package/build/plugins/state/src/actions/scene/index.d.ts +0 -1
  120. package/build/plugins/state/src/actions/scene/setbackground.d.ts +2 -2
  121. package/build/plugins/state/src/actions/scene/updatescene.d.ts +2 -2
  122. package/build/plugins/state/src/actions/state/getstate.d.ts +1 -1
  123. package/build/plugins/state/src/actions/state/setstate.d.ts +1 -1
  124. package/build/plugins/state/src/helpers/copyVectors/copyVectors.d.ts +17 -0
  125. package/build/plugins/state/src/helpers/updateParentLink/updateParentLink.d.ts +29 -0
  126. package/build/plugins/state/src/helpers/watchEntity/watchEntity.d.ts +30 -0
  127. package/build/plugins/state/types/ActionTypes.d.ts +18 -3
  128. package/build/plugins/state/types/RegisteredEntity.d.ts +27 -0
  129. package/build/plugins/state/types/StateData.d.ts +1 -1
  130. package/build/plugins/state/types/index.d.ts +2 -1
  131. package/build/{types → plugins/state/types}/schema/GroupSchema.d.ts +1 -1
  132. package/build/{types → plugins/state/types}/schema/ModelSchema.d.ts +7 -4
  133. package/build/{types → plugins/state/types}/schema/PrimitiveSchema.d.ts +4 -5
  134. package/build/{types → plugins/state/types}/schema/index.d.ts +0 -3
  135. package/build/plugins/toolbox/index.cjs +1 -1
  136. package/build/plugins/toolbox/index.mjs +193 -140
  137. package/build/plugins/toolbox/src/PointerContext.d.ts +7 -0
  138. package/build/plugins/toolbox/src/SelectionState.d.ts +21 -0
  139. package/build/plugins/toolbox/src/Toolbox.d.ts +9 -2
  140. package/build/{components → plugins/toolbox/src}/gizmo/Gizmo.d.ts +16 -2
  141. package/build/{components → plugins/toolbox/src}/gizmo/handles/AxisHandle.d.ts +2 -3
  142. package/build/{components → plugins/toolbox/src}/gizmo/handles/RadialHandle.d.ts +2 -3
  143. package/build/{components → plugins/toolbox/src}/gizmo/handles/ScaleHandle.d.ts +2 -3
  144. package/build/{components → plugins/toolbox/src}/gizmo/rotate/RotateGizmo.d.ts +2 -2
  145. package/build/{components → plugins/toolbox/src}/gizmo/scale/ScaleGizmo.d.ts +3 -3
  146. package/build/{components → plugins/toolbox/src}/gizmo/translate/TranslateGizmo.d.ts +2 -2
  147. package/build/types/components/DIVESceneObject.d.ts +13 -6
  148. package/build/types/components/index.d.ts +0 -1
  149. package/build/types/events/DIVEComponentEventMap.d.ts +14 -0
  150. package/build/types/events/DIVEEntityEventMap.d.ts +47 -0
  151. package/build/types/events/index.d.ts +2 -0
  152. package/build/types/{schema/GeometrySchema.d.ts → geometry/DIVEGeometry.d.ts} +4 -4
  153. package/build/types/{schema/GeometryTypeSchema.d.ts → geometry/DIVEGeometryType.d.ts} +1 -1
  154. package/build/types/geometry/index.d.ts +2 -0
  155. package/build/types/index.d.ts +3 -1
  156. package/build/types/{schema/MaterialSchema.d.ts → material/DIVEMaterial.d.ts} +1 -1
  157. package/build/types/material/index.d.ts +1 -0
  158. package/package.json +6 -5
  159. package/build/chunks/AssetExporter-C5MScs9S.mjs +0 -70
  160. package/build/chunks/AssetExporter-Cdxb04b3.cjs +0 -1
  161. package/build/chunks/CameraSchema-cgY5WBGW.mjs +0 -10
  162. package/build/chunks/CameraSchema-twxH-72N.cjs +0 -1
  163. package/build/chunks/FileTypes-Cgyf8ocm.cjs +0 -29
  164. package/build/chunks/FileTypes-DiYB3WBp.mjs +0 -2166
  165. package/build/chunks/PerspectiveCamera-B5TvUzTa.mjs +0 -39
  166. package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +0 -1
  167. package/build/chunks/SpriteText-2lCRglsw.cjs +0 -1
  168. package/build/chunks/SpriteText-C_CQPvUn.mjs +0 -50
  169. package/build/chunks/findInterface-C6mrvf_t.cjs +0 -1
  170. package/build/chunks/findInterface-DbJ5qzbc.mjs +0 -11
  171. package/build/components/boundingbox/BoundingBox.d.ts +0 -140
  172. package/build/components/floor/Floor.d.ts +0 -14
  173. package/build/components/grid/Grid.d.ts +0 -23
  174. package/build/components/group/Group.d.ts +0 -28
  175. package/build/components/light/AmbientLight.d.ts +0 -19
  176. package/build/components/light/PointLight.d.ts +0 -29
  177. package/build/components/light/SceneLight.d.ts +0 -20
  178. package/build/components/model/Model.d.ts +0 -26
  179. package/build/components/node/Node.d.ts +0 -24
  180. package/build/components/primitive/Primitive.d.ts +0 -27
  181. package/build/components/root/Root.d.ts +0 -34
  182. package/build/components/spritetext/SpriteText.d.ts +0 -27
  183. package/build/engine/camera/PerspectiveCamera.d.ts +0 -24
  184. package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +0 -9
  185. package/build/plugins/quickview/src/state/QuickViewState.d.ts +0 -4
  186. package/build/plugins/quickview/src/uri/QuickViewUri.d.ts +0 -3
  187. package/build/plugins/state/src/actions/object/placeonfloor.d.ts +0 -12
  188. package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +0 -12
  189. package/build/plugins/state/types/StateSceneData.d.ts +0 -5
  190. package/build/types/components/DIVELight.d.ts +0 -4
  191. /package/build/{types → plugins/state/types}/schema/BaseEntitySchema.d.ts +0 -0
  192. /package/build/{types → plugins/state/types}/schema/CameraSchema.d.ts +0 -0
  193. /package/build/{types → plugins/state/types}/schema/EntitySchema.d.ts +0 -0
  194. /package/build/{types → plugins/state/types}/schema/EntityTypeSchema.d.ts +0 -0
  195. /package/build/{types → plugins/state/types}/schema/LightSchema.d.ts +0 -0
  196. /package/build/{components → plugins/toolbox/src}/gizmo/plane/GizmoPlane.d.ts +0 -0
package/build/dive.mjs CHANGED
@@ -1,820 +1,299 @@
1
- var O = Object.defineProperty;
2
- var A = (r, s, t) => s in r ? O(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
- var i = (r, s, t) => A(r, typeof s != "symbol" ? s + "" : s, t);
4
- import { d as G, F as R } from "./chunks/FileTypes-DiYB3WBp.mjs";
5
- import { B as _t, D as gt, e as mt, f as Et, g as Dt, h as wt, c as yt, i as Mt, j as xt, k as It, l as Pt, m as Vt, n as bt, b as Ht, o as zt, p as vt, q as St, r as Ot, s as At, t as Gt, u as Rt, v as Tt, w as Ct, x as Lt, G as Yt, y as jt, S as Nt, z as Xt } from "./chunks/FileTypes-DiYB3WBp.mjs";
6
- import { U as d } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
7
- import { C as Zt, b as qt, D as Qt, a as Ut, H as Wt, P as kt } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
8
- import { A as I, a as P, b as V } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
9
- import { e as Kt, d as Jt, c as $t } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
10
- import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as T, CylinderGeometry as E, BoxGeometry as C, PlaneGeometry as w } from "three/webgpu";
11
- import { D as ee } from "./chunks/SpriteText-C_CQPvUn.mjs";
12
- import { f as se, i as ie } from "./chunks/findInterface-DbJ5qzbc.mjs";
13
- import { g as L } from "./chunks/isFileTypeSupported-9h8lrIuG.mjs";
14
- import { i as ae } from "./chunks/isFileTypeSupported-9h8lrIuG.mjs";
15
- import { F as he, N as le } from "./chunks/network-error-BONfHWQq.mjs";
16
- import { F as de, P as pe } from "./chunks/parse-error-DfOPyLWM.mjs";
17
- import { i as fe, a as _e } from "./chunks/CameraSchema-cgY5WBGW.mjs";
18
- class y extends f {
19
- constructor(t, e, n, o, a) {
20
- super();
21
- i(this, "isHoverable", !0);
22
- i(this, "isDraggable", !0);
23
- i(this, "parent", null);
24
- i(this, "axis");
25
- i(this, "_color", new b(16711935));
26
- i(this, "_colorHover");
27
- i(this, "_hovered");
28
- i(this, "_highlight");
29
- i(this, "_lineMaterial");
30
- i(this, "_colliderMesh");
31
- this.name = "DIVERadialHandle", this.axis = t, this._color.set(a), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1;
32
- const h = new H(e, 0.01, 13, 48, n);
33
- this._lineMaterial = new g({
34
- color: a,
35
- depthTest: !1,
36
- depthWrite: !1
37
- });
38
- const l = new p(h, this._lineMaterial);
39
- l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
40
- const _ = new H(e, 0.1, 3, 48, n), D = new g({
41
- color: 16711935,
42
- transparent: !0,
43
- opacity: 0.15,
44
- depthTest: !1,
45
- depthWrite: !1
46
- });
47
- this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
48
- }
49
- set debug(t) {
50
- this._colliderMesh.visible = t;
51
- }
52
- get highlight() {
53
- return this._highlight;
54
- }
55
- set highlight(t) {
56
- this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
57
- }
58
- get forwardVector() {
59
- return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
60
- }
61
- get rightVector() {
62
- return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
63
- }
64
- get upVector() {
65
- return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
66
- }
67
- reset() {
68
- this._lineMaterial.color = this._color;
69
- }
70
- onPointerEnter() {
71
- this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
72
- }
73
- onPointerLeave() {
74
- this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
75
- }
76
- onDragStart() {
77
- this.parent && this.parent.onHandleDragStart(this);
78
- }
79
- onDrag(t) {
80
- this.parent && this.parent.onHandleDrag(this, t);
81
- }
82
- onDragEnd() {
83
- this.parent && this.parent.onHandleDragEnd(this);
84
- }
85
- }
86
- function u(r, s) {
87
- const t = (r + "e").split("e");
88
- return +(t[0] + "e" + (+t[1] + (s || 0)));
89
- }
90
- function Y(r, s = 0) {
91
- const t = u(r, +s);
92
- return u(Math.ceil(t), -s);
93
- }
94
- function j(r, s = 0) {
95
- const t = u(r, +s);
96
- return u(Math.floor(t), -s);
97
- }
98
- function S(r, s = 0) {
99
- if (r < 0) return -S(-r, s);
100
- const t = u(r, +s);
101
- return u(Math.round(t), -s);
102
- }
103
- function N(r, s, t) {
104
- return Math.atan2(
105
- r.clone().cross(s).dot(t),
106
- s.clone().dot(r)
107
- );
108
- }
109
- function X(r, s = 0) {
110
- const t = u(r, +s);
111
- return u(Math.round(t), -s).toFixed(s);
112
- }
113
- function F(r, s = 0) {
114
- const t = u(r, +s);
115
- return u(Math.trunc(t), -s);
116
- }
117
- function Z(r) {
118
- return (v.radToDeg(r) + 360) % 360;
119
- }
120
- function q(r) {
121
- return v.degToRad(r);
122
- }
123
- const Q = {
124
- ceilExp: Y,
125
- floorExp: j,
126
- roundExp: S,
127
- toFixedExp: X,
128
- truncateExp: F,
129
- signedAngleTo: N,
130
- radToDeg: Z,
131
- degToRad: q
132
- };
133
- class U extends f {
134
- constructor(t) {
135
- super();
136
- i(this, "children");
137
- i(this, "_controller");
138
- i(this, "_startRot");
139
- this.name = "DIVERotateGizmo", this.children = [], this._startRot = null, this._controller = t, this.add(
140
- new y(
141
- "x",
142
- 1,
143
- Math.PI / 2,
144
- new c(1, 0, 0),
145
- I
146
- )
147
- ), this.add(
148
- new y(
149
- "y",
150
- 1,
151
- -Math.PI / 2,
152
- new c(0, 1, 0),
153
- P
154
- )
155
- ), this.add(
156
- new y(
157
- "z",
158
- 1,
159
- Math.PI / 2,
160
- new c(0, 0, 1),
161
- V
162
- )
163
- );
164
- }
165
- set debug(t) {
166
- this.children.forEach((e) => {
167
- e.debug = t;
168
- });
169
- }
170
- reset() {
171
- this.children.forEach((t) => {
172
- t.reset();
173
- });
174
- }
175
- handleHighlight(t, e, n) {
176
- this.children.forEach((o) => {
177
- n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
178
- });
179
- }
180
- onHandleHover(t, e) {
181
- this._startRot || this.parent && this.parent.parent && (this.parent.parent.onHover("rotate", t.axis, e), this.handleHighlight(t.axis, e, !1));
182
- }
183
- onHandleDragStart(t) {
184
- if (!this.parent || !this.parent.parent) return;
185
- const e = this.parent.parent.object;
186
- e && (this._startRot = e.rotation.clone(), this.handleHighlight(t.axis, !0, !0));
187
- }
188
- onHandleDrag(t, e) {
189
- if (!this._startRot || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
190
- const n = e.dragCurrent.clone().sub(this.parent.parent.position).normalize(), o = e.dragStart.clone().sub(this.parent.parent.position).normalize(), a = Q.signedAngleTo(
191
- o,
192
- n,
193
- t.forwardVector
194
- ), h = new T(
195
- this._startRot.x + t.forwardVector.x * a,
196
- this._startRot.y + t.forwardVector.y * a,
197
- this._startRot.z + t.forwardVector.z * a
198
- );
199
- this.parent.parent.onChange(void 0, h);
200
- }
201
- onHandleDragEnd(t) {
202
- this._startRot = null, this.handleHighlight(t.axis, !1, !1);
203
- }
204
- }
205
- class M extends f {
206
- constructor(t, e, n, o) {
207
- super();
208
- i(this, "isHoverable", !0);
209
- i(this, "isDraggable", !0);
210
- i(this, "parent", null);
211
- i(this, "axis");
212
- i(this, "_color", new b(16711935));
213
- i(this, "_colorHover");
214
- i(this, "_hovered");
215
- i(this, "_highlight");
216
- i(this, "_lineMaterial");
217
- i(this, "_colliderMesh");
218
- this.name = "DIVEAxisHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
219
- const a = new E(0.01, 0.01, e, 13);
220
- this._lineMaterial = new g({
221
- color: o,
222
- depthTest: !1,
223
- depthWrite: !1
224
- });
225
- const h = new p(a, this._lineMaterial);
226
- h.layers.mask = d, h.renderOrder = 1 / 0, h.rotateX(Math.PI / 2), h.translateY(e / 2), this.add(h);
227
- const l = new E(0.1, 0.1, e, 3), _ = new g({
228
- color: 16711935,
229
- transparent: !0,
230
- opacity: 0.15,
231
- depthTest: !1,
232
- depthWrite: !1
233
- });
234
- this._colliderMesh = new p(l, _), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
235
- }
236
- set debug(t) {
237
- this._colliderMesh.visible = t;
238
- }
239
- get highlight() {
240
- return this._highlight;
241
- }
242
- set highlight(t) {
243
- this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
244
- }
245
- get forwardVector() {
246
- return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
247
- }
248
- get rightVector() {
249
- return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
250
- }
251
- get upVector() {
252
- return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
253
- }
254
- reset() {
255
- this._lineMaterial.color = this._color;
256
- }
257
- onPointerEnter() {
258
- this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
259
- }
260
- onPointerLeave() {
261
- this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
262
- }
263
- onDragStart() {
264
- this.parent && this.parent.onHandleDragStart(this);
265
- }
266
- onDrag(t) {
267
- this.parent && this.parent.onHandleDrag(this, t);
268
- }
269
- onDragEnd() {
270
- this.parent && this.parent.onHandleDragEnd(this);
271
- }
272
- }
273
- class W extends f {
274
- constructor(t) {
275
- super();
276
- i(this, "_controller");
277
- i(this, "children");
278
- i(this, "_startPos");
279
- this.name = "DIVETranslateGizmo", this.children = [], this._startPos = null, this._controller = t, this.add(
280
- new M("x", 1, new c(1, 0, 0), I)
281
- ), this.add(
282
- new M("y", 1, new c(0, 1, 0), P)
283
- ), this.add(
284
- new M("z", 1, new c(0, 0, 1), V)
285
- );
286
- }
287
- set debug(t) {
288
- this.children.forEach((e) => {
289
- e.debug = t;
290
- });
291
- }
292
- reset() {
293
- this.children.forEach((t) => {
294
- t.reset();
295
- });
296
- }
297
- handleHighlight(t, e, n) {
298
- this.children.forEach((o) => {
299
- n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
300
- });
301
- }
302
- onHandleHover(t, e) {
303
- this._startPos || this.parent && this.parent.parent && (this.parent.parent.onHover(
304
- "translate",
305
- t.axis,
306
- e
307
- ), this.handleHighlight(t.axis, e, !1));
308
- }
309
- onHandleDragStart(t) {
310
- if (!this.parent || !this.parent.parent) return;
311
- const e = this.parent.parent.object;
312
- e && (this._startPos = e.position.clone(), this.handleHighlight(t.axis, !0, !0));
313
- }
314
- onHandleDrag(t, e) {
315
- if (!this._startPos || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
316
- const n = e.dragDelta.clone().projectOnVector(t.forwardVector);
317
- this.parent.parent.onChange(
318
- this._startPos.clone().add(n)
319
- );
320
- }
321
- onHandleDragEnd(t) {
322
- this._startPos = null, this.handleHighlight(t.axis, !1, !1);
323
- }
324
- }
325
- class x extends f {
326
- constructor(t, e, n, o, a = 0.05) {
327
- super();
328
- i(this, "isHoverable", !0);
329
- i(this, "isDraggable", !0);
330
- i(this, "parent", null);
331
- i(this, "axis");
332
- i(this, "_color", new b(16711935));
333
- i(this, "_colorHover");
334
- i(this, "_hovered");
335
- i(this, "_highlight");
336
- i(this, "_lineMaterial");
337
- i(this, "_colliderMesh");
338
- i(this, "_box");
339
- i(this, "_boxSize");
340
- this.name = "DIVEScaleHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = a;
341
- const h = new E(
342
- 0.01,
343
- 0.01,
344
- e - a / 2,
345
- 13
346
- );
347
- this._lineMaterial = new g({
348
- color: o,
349
- depthTest: !1,
350
- depthWrite: !1
351
- });
352
- const l = new p(h, this._lineMaterial);
353
- l.layers.mask = d, l.renderOrder = 1 / 0, l.rotateX(Math.PI / 2), l.translateY(e / 2 - a / 4), this.add(l), this._box = new p(
354
- new C(a, a, a),
355
- this._lineMaterial
356
- ), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - a / 2), this._box.rotateZ(n.x * Math.PI / 2), this._box.rotateX(n.z * Math.PI / 2), this.add(this._box);
357
- const _ = new E(
358
- 0.1,
359
- 0.1,
360
- e + a / 2,
361
- 3
362
- ), D = new g({
363
- color: 16711935,
364
- transparent: !0,
365
- opacity: 0.15,
366
- depthTest: !1,
367
- depthWrite: !1
368
- });
369
- this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
370
- }
371
- set debug(t) {
372
- this._colliderMesh.visible = t;
373
- }
374
- get highlight() {
375
- return this._highlight;
376
- }
377
- set highlight(t) {
378
- this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
379
- }
380
- get forwardVector() {
381
- return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
382
- }
383
- get rightVector() {
384
- return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
385
- }
386
- get upVector() {
387
- return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
388
- }
389
- reset() {
390
- this._lineMaterial.color = this._color;
391
- }
392
- update(t) {
393
- this._box.scale.copy(
394
- new c(1, 1, 1).sub(this.forwardVector).add(
395
- // to then add ...
396
- t.clone().multiply(this.forwardVector)
397
- // that is scaled by the forward vector again to get the forward vector as the only direction
398
- )
399
- );
400
- }
401
- onPointerEnter() {
402
- this._hovered = !0, this.parent && this.parent.onHoverAxis(this, !0);
403
- }
404
- onPointerLeave() {
405
- this._hovered = !1, this.parent && this.parent.onHoverAxis(this, !1);
406
- }
407
- onDragStart() {
408
- this.parent && this.parent.onAxisDragStart(this);
409
- }
410
- onDrag(t) {
411
- this.parent && this.parent.onAxisDrag(this, t);
412
- }
413
- onDragEnd() {
414
- this.parent && this.parent.onAxisDragEnd(this);
415
- }
416
- }
417
- class k extends f {
418
- constructor(t) {
419
- super();
420
- i(this, "isHoverable", !0);
421
- i(this, "children");
422
- i(this, "_controller");
423
- i(this, "_startScale");
424
- this.name = "DIVEScaleGizmo", this.children = [], this._startScale = null, this._controller = t, this.add(
425
- new x("x", 1, new c(1, 0, 0), I)
426
- ), this.add(
427
- new x("y", 1, new c(0, 1, 0), P)
428
- ), this.add(
429
- new x("z", 1, new c(0, 0, 1), V)
430
- );
431
- }
432
- set debug(t) {
433
- this.children.forEach((e) => {
434
- e.debug = t;
435
- });
436
- }
437
- reset() {
438
- this.children.forEach((t) => {
439
- t.reset();
440
- });
441
- }
442
- update(t) {
443
- this.children.forEach((e) => {
444
- e.update(t);
445
- });
446
- }
447
- handleHighlight(t, e, n) {
448
- this.children.forEach((o) => {
449
- n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
450
- });
451
- }
452
- onHoverAxis(t, e) {
453
- this._startScale || this.parent && this.parent.parent && (this.parent.parent.onHover(
454
- "translate",
455
- t.axis,
456
- e
457
- ), this.handleHighlight(t.axis, e, !1));
458
- }
459
- onAxisDragStart(t) {
460
- if (!this.parent || !this.parent.parent) return;
461
- const e = this.parent.parent.object;
462
- e && (this._startScale = e.scale.clone(), this.handleHighlight(t.axis, !0, !0));
463
- }
464
- onAxisDrag(t, e) {
465
- if (!this._startScale || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
466
- const n = e.dragDelta.clone().projectOnVector(t.forwardVector);
467
- this.parent.parent.onChange(
468
- void 0,
469
- void 0,
470
- this._startScale.clone().add(n)
471
- );
472
- }
473
- onAxisDragEnd(t) {
474
- this._startScale = null, this.handleHighlight(t.axis, !1, !1);
475
- }
476
- }
477
- class B extends f {
478
- constructor() {
479
- super();
480
- i(this, "_meshX");
481
- i(this, "_meshY");
482
- i(this, "_meshZ");
483
- this.name = "DIVEGizmoPlane";
484
- const t = new g({
485
- transparent: !0,
486
- opacity: 0.15,
487
- depthTest: !1,
488
- depthWrite: !1,
489
- side: 2
490
- }), e = new w(100, 100, 2, 2), n = t.clone();
491
- n.color.set(16711680), this._meshX = new p(e, n), this._meshX.layers.mask = d, this._meshX.rotateY(Math.PI / 2);
492
- const o = new w(100, 100, 2, 2), a = t.clone();
493
- a.color.set(65280), this._meshY = new p(o, a), this._meshY.layers.mask = d, this._meshY.rotateX(-Math.PI / 2);
494
- const h = new w(100, 100, 2, 2), l = t.clone();
495
- l.color.set(255), this._meshZ = new p(h, l), this._meshZ.layers.mask = d;
496
- }
497
- get XPlane() {
498
- return this._meshX;
499
- }
500
- get YPlane() {
501
- return this._meshY;
502
- }
503
- get ZPlane() {
504
- return this._meshZ;
505
- }
506
- assemble(t, e) {
507
- if (this.clear(), t === "translate" || t === "scale")
508
- switch (e) {
509
- case "x":
510
- this.add(this._meshY), this.add(this._meshZ);
511
- break;
512
- case "y":
513
- this.add(this._meshX), this.add(this._meshZ);
514
- break;
515
- case "z":
516
- this.add(this._meshX), this.add(this._meshY);
517
- break;
518
- }
519
- else if (t === "rotate")
520
- switch (e) {
521
- case "x":
522
- this.add(this._meshX);
523
- break;
524
- case "y":
525
- this.add(this._meshY);
526
- break;
527
- case "z":
528
- this.add(this._meshZ);
529
- break;
530
- }
531
- }
532
- }
533
- class it extends f {
534
- constructor(t) {
535
- super();
536
- i(this, "_mode");
537
- i(this, "_gizmoNode");
538
- i(this, "_translateGizmo");
539
- i(this, "_rotateGizmo");
540
- i(this, "_scaleGizmo");
541
- i(this, "_gizmoPlane");
542
- // attachment stuff
543
- i(this, "_object");
544
- this.name = "DIVEGizmo", t.addEventListener("change", () => {
545
- const e = t.getDistance() / 2.5;
546
- this.scale.set(e, e, e);
547
- }), this._mode = "translate", this._gizmoNode = new f(), this.add(this._gizmoNode), this._translateGizmo = new W(t), this._rotateGizmo = new U(t), this._scaleGizmo = new k(t), this._gizmoPlane = new B(), this._gizmoPlane.visible = !1, this._object = null;
548
- }
549
- get mode() {
550
- return this._mode;
551
- }
552
- set mode(t) {
553
- this._mode = t, this.assemble();
554
- }
555
- set debug(t) {
556
- this._translateGizmo.debug = t, this._rotateGizmo.debug = t, this._scaleGizmo.debug = t;
557
- }
558
- get gizmoNode() {
559
- return this._gizmoNode;
560
- }
561
- get gizmoPlane() {
562
- return this._gizmoPlane;
563
- }
564
- get object() {
565
- return this._object;
566
- }
567
- attach(t) {
568
- return this._object = t, this.assemble(), this;
569
- }
570
- detach() {
571
- return this._object = null, this.assemble(), this;
572
- }
573
- onHover(t, e, n) {
574
- n && this._gizmoPlane.assemble(t, e);
575
- }
576
- onChange(t, e, n) {
577
- this.object !== null && (t && (this.position.copy(t), this.object.position.copy(t)), e && this.object.rotation.copy(e), n && (this.object.scale.copy(n), this._scaleGizmo.update(n)));
578
- }
579
- assemble() {
580
- this._gizmoNode.clear(), this._gizmoPlane.clear(), this._translateGizmo.reset(), this._rotateGizmo.reset(), this._scaleGizmo.reset(), this.object !== null && (this._mode === "translate" && this._gizmoNode.add(this._translateGizmo), this._mode === "rotate" && this._gizmoNode.add(this._rotateGizmo), this._mode === "scale" && this._gizmoNode.add(this._scaleGizmo), this.add(this._gizmoPlane));
581
- }
582
- }
583
- class nt {
1
+ var g = Object.defineProperty;
2
+ var O = (e, t, r) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var u = (e, t, r) => O(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { h as d } from "./chunks/FileTypes-D3Dxr2dj.mjs";
5
+ import { B as G, i as j, c as v, j as H, D as b, k as J, l as W, a as q, b as z, m as X, n as Q, o as Z, f as $, d as k, p as ee, q as te, r as re, s as ne, t as oe, u as se, v as ae, w as ce, F as ie, x as fe, G as pe, y as ue, z as le, H as Ee, M as me, A as De, P as ge, S as Oe, C as de, E as Ae, e as Ie, I as ye, g as he, J as Ce } from "./chunks/FileTypes-D3Dxr2dj.mjs";
6
+ import { b as Me, e as xe, a as Se, d as Re, A as Le, c as Ve } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
7
+ import { C as Te, D as we, F as Fe, H as Ne, P as Ye, a as Be, U as Ue, c as Ke } from "./chunks/contributesToBounds-DYmHYES4.mjs";
8
+ import { A as je, P as ve, a as He, d as be } from "./chunks/detachTransformControls-B4iRF1bw.mjs";
9
+ import { M as We } from "./chunks/ModelComponent-WA0kLOEY.mjs";
10
+ import { S as ze } from "./chunks/SpriteTextComponent-DIZFqao0.mjs";
11
+ import { c as Qe } from "./chunks/collectAnimations-BgYCN1le.mjs";
12
+ import { f as $e, i as ke, a as et } from "./chunks/isVisibleInHierarchy-KzVGvDEw.mjs";
13
+ import { i as A, g as I } from "./chunks/isFileExtensionSupported-BqOqU3-h.mjs";
14
+ import { MathUtils as E } from "three/webgpu";
15
+ import { F as rt, N as nt } from "./chunks/network-error-BONfHWQq.mjs";
16
+ import { F as st, P as at } from "./chunks/parse-error-DfOPyLWM.mjs";
17
+ class T {
584
18
  constructor() {
585
- i(this, "isMovable", !0);
19
+ u(this, "isMovable", !0);
586
20
  }
587
21
  }
588
- class at {
22
+ class w {
589
23
  constructor() {
590
- i(this, "isSelectable", !0);
24
+ u(this, "isSelectable", !0);
591
25
  }
592
26
  }
593
- function ot(r, s) {
594
- return s.forEach((t) => {
595
- Object.getOwnPropertyNames(t.prototype).forEach((n) => {
596
- if (n === "constructor")
27
+ function F(e, t) {
28
+ return t.forEach((r) => {
29
+ Object.getOwnPropertyNames(r.prototype).forEach((a) => {
30
+ if (a === "constructor")
597
31
  return;
598
- const o = Object.getOwnPropertyDescriptor(
599
- t.prototype,
600
- n
32
+ const c = Object.getOwnPropertyDescriptor(
33
+ r.prototype,
34
+ a
601
35
  );
602
- Object.defineProperty(r.prototype, n, o);
36
+ Object.defineProperty(e.prototype, a, c);
603
37
  });
604
- const e = new t();
605
- Object.getOwnPropertyNames(e).forEach((n) => {
606
- const o = Object.getOwnPropertyDescriptor(
607
- e,
608
- n
38
+ const n = new r();
39
+ Object.getOwnPropertyNames(n).forEach((a) => {
40
+ const c = Object.getOwnPropertyDescriptor(
41
+ n,
42
+ a
609
43
  );
610
- Object.defineProperty(r.prototype, n, o);
44
+ Object.defineProperty(e.prototype, a, c);
611
45
  });
612
- }), r;
46
+ }), e;
613
47
  }
614
- function m(r, s = /* @__PURE__ */ new WeakMap()) {
615
- if (r === null || typeof r != "object")
616
- return r;
617
- if (s.has(r))
618
- return s.get(r);
619
- if (r instanceof Date)
620
- return new Date(r.getTime());
621
- if (r instanceof RegExp)
622
- return new RegExp(r.source, r.flags);
623
- if (Array.isArray(r)) {
624
- const a = [];
625
- s.set(r, a);
626
- for (let h = 0; h < r.length; h++)
627
- a[h] = m(r[h], s);
628
- return a;
629
- }
630
- if (r instanceof Map) {
631
- const a = /* @__PURE__ */ new Map();
632
- s.set(r, a);
633
- for (const [h, l] of r)
634
- a.set(m(h, s), m(l, s));
635
- return a;
636
- }
637
- if (r instanceof Set) {
638
- const a = /* @__PURE__ */ new Set();
639
- s.set(r, a);
640
- for (const h of r)
641
- a.add(m(h, s));
642
- return a;
643
- }
644
- const t = r;
645
- if (typeof t.clone == "function") {
646
- const a = t.clone();
647
- return s.set(r, a), a;
648
- }
649
- const e = Object.create(Object.getPrototypeOf(r));
650
- s.set(r, e);
651
- const n = Object.getOwnPropertyNames(r);
652
- for (const a of n) {
653
- const h = Object.getOwnPropertyDescriptor(r, a);
654
- if (h)
655
- if (h.value !== void 0) {
656
- const l = m(h.value, s);
657
- Object.defineProperty(e, a, {
658
- ...h,
659
- value: l
48
+ function p(e, t = /* @__PURE__ */ new WeakMap()) {
49
+ if (e === null || typeof e != "object")
50
+ return e;
51
+ if (t.has(e))
52
+ return t.get(e);
53
+ if (e instanceof Date)
54
+ return new Date(e.getTime());
55
+ if (e instanceof RegExp)
56
+ return new RegExp(e.source, e.flags);
57
+ if (Array.isArray(e)) {
58
+ const o = [];
59
+ t.set(e, o);
60
+ for (let s = 0; s < e.length; s++)
61
+ o[s] = p(e[s], t);
62
+ return o;
63
+ }
64
+ if (e instanceof Map) {
65
+ const o = /* @__PURE__ */ new Map();
66
+ t.set(e, o);
67
+ for (const [s, f] of e)
68
+ o.set(p(s, t), p(f, t));
69
+ return o;
70
+ }
71
+ if (e instanceof Set) {
72
+ const o = /* @__PURE__ */ new Set();
73
+ t.set(e, o);
74
+ for (const s of e)
75
+ o.add(p(s, t));
76
+ return o;
77
+ }
78
+ const r = e;
79
+ if (typeof r.clone == "function") {
80
+ const o = r.clone();
81
+ return t.set(e, o), o;
82
+ }
83
+ const n = Object.create(Object.getPrototypeOf(e));
84
+ t.set(e, n);
85
+ const a = Object.getOwnPropertyNames(e);
86
+ for (const o of a) {
87
+ const s = Object.getOwnPropertyDescriptor(e, o);
88
+ if (s)
89
+ if (s.value !== void 0) {
90
+ const f = p(s.value, t);
91
+ Object.defineProperty(n, o, {
92
+ ...s,
93
+ value: f
660
94
  });
661
95
  } else
662
- Object.defineProperty(e, a, h);
663
- }
664
- const o = Object.getOwnPropertySymbols(r);
665
- for (const a of o) {
666
- const h = Object.getOwnPropertyDescriptor(r, a);
667
- if (h)
668
- if (h.value !== void 0) {
669
- const l = m(h.value, s);
670
- Object.defineProperty(e, a, {
671
- ...h,
672
- value: l
96
+ Object.defineProperty(n, o, s);
97
+ }
98
+ const c = Object.getOwnPropertySymbols(e);
99
+ for (const o of c) {
100
+ const s = Object.getOwnPropertyDescriptor(e, o);
101
+ if (s)
102
+ if (s.value !== void 0) {
103
+ const f = p(s.value, t);
104
+ Object.defineProperty(n, o, {
105
+ ...s,
106
+ value: f
673
107
  });
674
108
  } else
675
- Object.defineProperty(e, a, h);
109
+ Object.defineProperty(n, o, s);
676
110
  }
677
- return e;
111
+ return n;
678
112
  }
679
- const z = (r, s) => {
680
- if (Object.keys(r).length === 0 && Object.keys(s).length === 0)
113
+ const l = (e, t) => {
114
+ if (Object.keys(e).length === 0 && Object.keys(t).length === 0)
681
115
  return {};
682
- if (typeof r != "object" || typeof s != "object")
683
- return s;
684
- let t = {};
685
- return Object.keys(s).forEach((e) => {
686
- if (!Object.keys(r).includes(e)) {
687
- t = { ...t, [e]: s[e] };
116
+ if (typeof e != "object" || typeof t != "object")
117
+ return t;
118
+ let r = {};
119
+ return Object.keys(t).forEach((n) => {
120
+ if (!Object.keys(e).includes(n)) {
121
+ r = { ...r, [n]: t[n] };
688
122
  return;
689
123
  }
690
- if (Array.isArray(s[e])) {
691
- if (!Array.isArray(r[e])) {
692
- t = { ...t, [e]: s[e] };
124
+ if (Array.isArray(t[n])) {
125
+ if (!Array.isArray(e[n])) {
126
+ r = { ...r, [n]: t[n] };
693
127
  return;
694
128
  }
695
- const n = r[e], o = s[e];
696
- if (n.length === 0 && o.length === 0) {
697
- t = { ...t };
129
+ const a = e[n], c = t[n];
130
+ if (a.length === 0 && c.length === 0) {
131
+ r = { ...r };
698
132
  return;
699
133
  }
700
- if (n.length !== o.length) {
701
- t = { ...t, [e]: s[e] };
134
+ if (a.length !== c.length) {
135
+ r = { ...r, [n]: t[n] };
702
136
  return;
703
137
  }
704
- const a = [];
705
- if (o.forEach((h, l) => {
706
- const _ = z(
707
- n[l],
708
- o[l]
138
+ const o = [];
139
+ if (c.forEach((s, f) => {
140
+ const D = l(
141
+ a[f],
142
+ c[f]
709
143
  );
710
- Object.keys(_).length && a.push(o[l]);
711
- }), Object.keys(a).length) {
712
- t = { ...t, [e]: a };
144
+ Object.keys(D).length && o.push(c[f]);
145
+ }), Object.keys(o).length) {
146
+ r = { ...r, [n]: o };
713
147
  return;
714
148
  }
715
149
  return;
716
150
  }
717
- if (typeof s[e] == "object") {
718
- if (typeof r[e] != "object") {
719
- t = { ...t, [e]: s[e] };
151
+ if (typeof t[n] == "object") {
152
+ if (typeof e[n] != "object") {
153
+ r = { ...r, [n]: t[n] };
720
154
  return;
721
155
  }
722
- const n = z(
723
- r[e],
724
- s[e]
156
+ const a = l(
157
+ e[n],
158
+ t[n]
725
159
  );
726
- if (Object.keys(n).length) {
727
- t = { ...t, [e]: n };
160
+ if (Object.keys(a).length) {
161
+ r = { ...r, [n]: a };
728
162
  return;
729
163
  }
730
164
  }
731
- r[e] !== s[e] && (t = { ...t, [e]: s[e] });
732
- }), t;
165
+ e[n] !== t[n] && (r = { ...r, [n]: t[n] });
166
+ }), r;
733
167
  };
734
- function ht(r) {
735
- return G.includes(r.toLowerCase());
168
+ function N(e) {
169
+ return d.includes(e.toLowerCase());
736
170
  }
737
- function K(r) {
738
- return r.toLowerCase() in R;
171
+ function Y(e) {
172
+ return A(I(e));
739
173
  }
740
- function lt(r) {
741
- return K(L(r));
174
+ function i(e, t) {
175
+ const r = (e + "e").split("e");
176
+ return +(r[0] + "e" + (+r[1] + (t || 0)));
742
177
  }
743
- function ct(r) {
744
- return r.entityType === "group";
178
+ function y(e, t = 0) {
179
+ const r = i(e, +t);
180
+ return i(Math.ceil(r), -t);
745
181
  }
746
- function dt(r) {
747
- return r.entityType === "light";
182
+ function h(e, t = 0) {
183
+ const r = i(e, +t);
184
+ return i(Math.floor(r), -t);
748
185
  }
749
- function pt(r) {
750
- return r.entityType === "primitive";
186
+ function m(e, t = 0) {
187
+ if (e < 0) return -m(-e, t);
188
+ const r = i(e, +t);
189
+ return i(Math.round(r), -t);
751
190
  }
191
+ function C(e, t, r) {
192
+ return Math.atan2(
193
+ e.clone().cross(t).dot(r),
194
+ t.clone().dot(e)
195
+ );
196
+ }
197
+ function P(e, t = 0) {
198
+ const r = i(e, +t);
199
+ return i(Math.round(r), -t).toFixed(t);
200
+ }
201
+ function M(e, t = 0) {
202
+ const r = i(e, +t);
203
+ return i(Math.trunc(r), -t);
204
+ }
205
+ function x(e) {
206
+ return (E.radToDeg(e) + 360) % 360;
207
+ }
208
+ function S(e) {
209
+ return E.degToRad(e);
210
+ }
211
+ const B = {
212
+ ceilExp: y,
213
+ floorExp: h,
214
+ roundExp: m,
215
+ toFixedExp: P,
216
+ truncateExp: M,
217
+ signedAngleTo: C,
218
+ radToDeg: x,
219
+ degToRad: S
220
+ };
752
221
  export {
753
- V as AxesColorBlue,
754
- Kt as AxesColorBlueLetter,
755
- P as AxesColorGreen,
756
- Jt as AxesColorGreenLetter,
757
- I as AxesColorRed,
758
- $t as AxesColorRedLetter,
759
- _t as BoundingBox,
760
- Zt as COORDINATE_LAYER_MASK,
761
- qt as DEFAULT_LAYER_MASK,
762
- gt as DIVE,
763
- mt as DIVEAbortablePromise,
764
- Et as DIVEAmbientLight,
765
- Dt as DIVECanvasLifecycleManager,
766
- wt as DIVEClock,
767
- yt as DIVEDefaultSettings,
768
- Mt as DIVEDeferredPromise,
769
- xt as DIVEEnvironment,
770
- It as DIVEEnvironmentDefaultSettings,
771
- Pt as DIVEFloor,
772
- it as DIVEGizmo,
773
- Vt as DIVEGrid,
774
- bt as DIVEGroup,
775
- Q as DIVEMath,
776
- Ht as DIVEModel,
777
- nt as DIVEMovable,
778
- zt as DIVENode,
779
- Qt as DIVEPerspectiveCamera,
780
- Ut as DIVEPerspectiveCameraDefaultSettings,
781
- vt as DIVEPointLight,
782
- St as DIVEPrimitive,
783
- Ot as DIVERenderer,
784
- At as DIVERendererDefaultSettings,
785
- Gt as DIVERoot,
786
- Rt as DIVEScene,
787
- Tt as DIVESceneDefaultSettings,
788
- Ct as DIVESceneLight,
789
- at as DIVESelectable,
790
- ee as DIVESpriteText,
791
- Lt as DIVEView,
792
- R as FILE_TYPES,
793
- he as FileContentError,
794
- de as FileTypeError,
795
- Yt as GRID_MAJOR_LINE_COLOR,
796
- jt as GRID_MINOR_LINE_COLOR,
797
- Wt as HELPER_LAYER_MASK,
798
- le as NetworkError,
799
- kt as PRODUCT_LAYER_MASK,
800
- pe as ParseError,
801
- Nt as SUPPORTED_FILE_TYPES,
802
- G as SUPPORTED_MIME_TYPES,
803
- d as UI_LAYER_MASK,
804
- ot as applyMixins,
805
- m as deepClone,
806
- se as findInterface,
807
- Xt as findSceneRecursive,
808
- L as getFileTypeFromUri,
809
- z as getObjectDelta,
810
- ie as implementsInterface,
811
- fe as isCameraSchema,
812
- K as isFileExtensionSupported,
813
- ae as isFileTypeSupported,
814
- ct as isGroupSchema,
815
- dt as isLightSchema,
816
- ht as isMimeTypeSupported,
817
- _e as isModelSchema,
818
- pt as isPrimitiveSchema,
819
- lt as isURIFileExtensionSupported
222
+ je as AmbientLightComponent,
223
+ Me as AxesColorBlue,
224
+ xe as AxesColorBlueLetter,
225
+ Se as AxesColorGreen,
226
+ Re as AxesColorGreenLetter,
227
+ Le as AxesColorRed,
228
+ Ve as AxesColorRedLetter,
229
+ G as BoundingBox,
230
+ j as BoundingBoxComponent,
231
+ Te as COORDINATE_LAYER_MASK,
232
+ we as DEFAULT_LAYER_MASK,
233
+ v as DIVE,
234
+ H as DIVEAbortablePromise,
235
+ b as DIVECameraComponent,
236
+ J as DIVECanvasLifecycleManager,
237
+ W as DIVEClock,
238
+ q as DIVEComponent,
239
+ z as DIVEDefaultSettings,
240
+ X as DIVEDeferredPromise,
241
+ Q as DIVEEnvironment,
242
+ Z as DIVEEnvironmentDefaultSettings,
243
+ $ as DIVELightComponent,
244
+ B as DIVEMath,
245
+ T as DIVEMovable,
246
+ k as DIVENode,
247
+ ee as DIVEPerspectiveCameraDefaultSettings,
248
+ te as DIVERenderer,
249
+ re as DIVERendererDefaultSettings,
250
+ ne as DIVERoot,
251
+ oe as DIVEScene,
252
+ se as DIVESceneDefaultSettings,
253
+ w as DIVESelectable,
254
+ ae as DIVEView,
255
+ ce as DirectionalLightComponent,
256
+ ie as FILE_TYPES,
257
+ Fe as FLOOR_LAYER_MASK,
258
+ rt as FileContentError,
259
+ st as FileTypeError,
260
+ fe as FloorComponent,
261
+ pe as GRID_MAJOR_LINE_COLOR,
262
+ ue as GRID_MINOR_LINE_COLOR,
263
+ le as GridComponent,
264
+ Ne as HELPER_LAYER_MASK,
265
+ Ee as HemisphereLightComponent,
266
+ me as MeshComponent,
267
+ We as ModelComponent,
268
+ De as MultiLineComponent,
269
+ nt as NetworkError,
270
+ Ye as PRODUCT_LAYER_MASK,
271
+ Be as PROXY_LAYER_MASK,
272
+ at as ParseError,
273
+ ge as PerspectiveCameraComponent,
274
+ ve as PointLightComponent,
275
+ He as PrimitiveComponent,
276
+ Oe as SUPPORTED_FILE_TYPES,
277
+ d as SUPPORTED_MIME_TYPES,
278
+ ze as SpriteTextComponent,
279
+ Ue as UI_LAYER_MASK,
280
+ F as applyMixins,
281
+ Qe as collectAnimations,
282
+ de as computeProductBounds,
283
+ Ae as contributedBy,
284
+ Ke as contributesToBounds,
285
+ p as deepClone,
286
+ be as detachTransformControls,
287
+ Ie as disposeComponents,
288
+ ye as findComponent,
289
+ $e as findInterface,
290
+ he as findSceneRecursive,
291
+ I as getFileTypeFromUri,
292
+ l as getObjectDelta,
293
+ ke as implementsInterface,
294
+ Ce as isDIVEComponent,
295
+ A as isFileExtensionSupported,
296
+ N as isMimeTypeSupported,
297
+ Y as isURIFileExtensionSupported,
298
+ et as isVisibleInHierarchy
820
299
  };