@shopware-ag/dive 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/chunks/{AssetCache-MXFCGzZU.mjs → AssetCache-DadU3pjv.mjs} +8 -9
  2. package/build/chunks/AssetCache-GSqD2GKD.cjs +1 -0
  3. package/build/chunks/{AssetLoader-BDDJG9JL.cjs → AssetLoader-BOBXNUHe.cjs} +1 -1
  4. package/build/chunks/{AssetLoader-kRhuVN4p.mjs → AssetLoader-Dwnjh3GI.mjs} +16 -17
  5. package/build/chunks/{FileTypes-DGSsi-AX.mjs → FileTypes-CUga4xrG.mjs} +386 -294
  6. package/build/chunks/{FileTypes-gD_1MonW.cjs → FileTypes-Cm1k0dUE.cjs} +2 -2
  7. package/build/chunks/GridNode-CK4PiwHT.cjs +1 -0
  8. package/build/chunks/GridNode-KgFpPNWa.mjs +30 -0
  9. package/build/chunks/{ModelComponent-DkfAgTL0.mjs → ModelComponent-Cpy9q21L.mjs} +1 -1
  10. package/build/chunks/{ModelComponent-Cj3ff6nL.cjs → ModelComponent-DuBAn1uS.cjs} +1 -1
  11. package/build/chunks/OrbitController-CK4OclLu.cjs +1 -0
  12. package/build/chunks/{OrbitController-DLEyTvUt.mjs → OrbitController-DFf6ANcN.mjs} +3 -4
  13. package/build/chunks/{SpriteTextComponent-ByefJLeU.cjs → SpriteTextComponent-Bho3ynCj.cjs} +1 -1
  14. package/build/chunks/{SpriteTextComponent-CG5vfiFy.mjs → SpriteTextComponent-DrBnD0_-.mjs} +1 -1
  15. package/build/chunks/{detachTransformControls-Dr3TIdVy.mjs → detachTransformControls-D6VK3L3-.mjs} +1 -1
  16. package/build/chunks/{detachTransformControls-2XQrpLN-.cjs → detachTransformControls-DFTq45Xl.cjs} +1 -1
  17. package/build/chunks/{isFileExtensionSupported-RvlnH2dr.cjs → isFileExtensionSupported-CCEhBoz9.cjs} +1 -1
  18. package/build/chunks/{isFileExtensionSupported-CgcqpgqN.mjs → isFileExtensionSupported-vz_2VJPi.mjs} +1 -1
  19. package/build/components/grid/GridComponent.d.ts +51 -1
  20. package/build/constants/GridColors.d.ts +46 -2
  21. package/build/dive.cjs +1 -1
  22. package/build/dive.mjs +106 -104
  23. package/build/engine/renderer/Renderer.d.ts +21 -1
  24. package/build/engine/scene/Scene.d.ts +9 -9
  25. package/build/plugins/ar/index.cjs +1 -1
  26. package/build/plugins/ar/index.mjs +1 -1
  27. package/build/plugins/assetcache/index.cjs +1 -1
  28. package/build/plugins/assetcache/index.mjs +1 -1
  29. package/build/plugins/assetloader/index.cjs +1 -1
  30. package/build/plugins/assetloader/index.mjs +2 -2
  31. package/build/plugins/mediacreator/index.cjs +1 -1
  32. package/build/plugins/mediacreator/index.mjs +3 -4
  33. package/build/plugins/orbitcontroller/index.cjs +1 -1
  34. package/build/plugins/orbitcontroller/index.mjs +1 -1
  35. package/build/plugins/orientationdisplay/index.cjs +1 -1
  36. package/build/plugins/orientationdisplay/index.mjs +4 -5
  37. package/build/plugins/quickview/index.cjs +1 -1
  38. package/build/plugins/quickview/index.mjs +49 -49
  39. package/build/plugins/quickview/src/QuickView.d.ts +2 -3
  40. package/build/plugins/quickview/types/QuickViewSettings.d.ts +0 -14
  41. package/build/plugins/shader/index.cjs +1 -1
  42. package/build/plugins/shader/index.mjs +1 -1
  43. package/build/plugins/shader/src/shaders/GridNode.d.ts +4 -0
  44. package/build/plugins/state/index.cjs +1 -1
  45. package/build/plugins/state/index.mjs +151 -163
  46. package/build/plugins/toolbox/index.cjs +1 -1
  47. package/build/plugins/toolbox/index.mjs +7 -8
  48. package/package.json +5 -4
  49. package/build/chunks/AssetCache-DdxevusY.cjs +0 -1
  50. package/build/chunks/GridNode-0R5ZnzR6.mjs +0 -30
  51. package/build/chunks/GridNode-iqnu86_v.cjs +0 -1
  52. package/build/chunks/OrbitController-DFPcXvlO.cjs +0 -1
package/build/dive.mjs CHANGED
@@ -1,27 +1,27 @@
1
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-DGSsi-AX.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-DGSsi-AX.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-Dr3TIdVy.mjs";
9
- import { M as We } from "./chunks/ModelComponent-DkfAgTL0.mjs";
10
- import { S as ze } from "./chunks/SpriteTextComponent-CG5vfiFy.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-CgcqpgqN.mjs";
2
+ var d = (e, t, r) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var l = (e, t, r) => d(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { h as O } from "./chunks/FileTypes-CUga4xrG.mjs";
5
+ import { B as N, i as j, c as v, j as H, D as b, k as W, l as q, a as z, b as J, m as X, n as Q, o as Z, p as $, q as k, r as ee, s as te, f as re, d as ne, t as oe, u as se, v as ae, w as ce, x as ie, y as fe, z as pe, A as le, F as ue, C as Ee, G as De, H as me, M as ge, E as de, P as Oe, S as ye, I as Ae, J as he, e as Ce, K as Ie, g as Pe, L as Se } from "./chunks/FileTypes-CUga4xrG.mjs";
6
+ import { b as Me, e as Ve, a as Le, d as Re, A as Te, c as _e } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
7
+ import { C as Fe, D as Ye, F as Be, H as Ke, P as Ue, a as Ge, U as Ne, c as je } from "./chunks/contributesToBounds-DYmHYES4.mjs";
8
+ import { A as He, P as be, a as We, d as qe } from "./chunks/detachTransformControls-D6VK3L3-.mjs";
9
+ import { M as Je } from "./chunks/ModelComponent-Cpy9q21L.mjs";
10
+ import { S as Qe } from "./chunks/SpriteTextComponent-DrBnD0_-.mjs";
11
+ import { c as $e } from "./chunks/collectAnimations-BgYCN1le.mjs";
12
+ import { f as et, i as tt, a as rt } from "./chunks/isVisibleInHierarchy-KzVGvDEw.mjs";
13
+ import { i as y, g as A } from "./chunks/isFileExtensionSupported-vz_2VJPi.mjs";
14
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 {
15
+ import { F as ot, N as st } from "./chunks/network-error-BONfHWQq.mjs";
16
+ import { F as ct, P as it } from "./chunks/parse-error-DfOPyLWM.mjs";
17
+ class _ {
18
18
  constructor() {
19
- u(this, "isMovable", !0);
19
+ l(this, "isMovable", !0);
20
20
  }
21
21
  }
22
22
  class w {
23
23
  constructor() {
24
- u(this, "isSelectable", !0);
24
+ l(this, "isSelectable", !0);
25
25
  }
26
26
  }
27
27
  function F(e, t) {
@@ -110,7 +110,7 @@ function p(e, t = /* @__PURE__ */ new WeakMap()) {
110
110
  }
111
111
  return n;
112
112
  }
113
- const l = (e, t) => {
113
+ const u = (e, t) => {
114
114
  if (Object.keys(e).length === 0 && Object.keys(t).length === 0)
115
115
  return {};
116
116
  if (typeof e != "object" || typeof t != "object")
@@ -137,11 +137,11 @@ const l = (e, t) => {
137
137
  }
138
138
  const o = [];
139
139
  if (c.forEach((s, f) => {
140
- const D = l(
140
+ const m = u(
141
141
  a[f],
142
142
  c[f]
143
143
  );
144
- Object.keys(D).length && o.push(c[f]);
144
+ Object.keys(m).length && o.push(c[f]);
145
145
  }), Object.keys(o).length) {
146
146
  r = { ...r, [n]: o };
147
147
  return;
@@ -153,7 +153,7 @@ const l = (e, t) => {
153
153
  r = { ...r, [n]: t[n] };
154
154
  return;
155
155
  }
156
- const a = l(
156
+ const a = u(
157
157
  e[n],
158
158
  t[n]
159
159
  );
@@ -165,30 +165,30 @@ const l = (e, t) => {
165
165
  e[n] !== t[n] && (r = { ...r, [n]: t[n] });
166
166
  }), r;
167
167
  };
168
- function N(e) {
169
- return d.includes(e.toLowerCase());
170
- }
171
168
  function Y(e) {
172
- return A(I(e));
169
+ return O.includes(e.toLowerCase());
170
+ }
171
+ function B(e) {
172
+ return y(A(e));
173
173
  }
174
174
  function i(e, t) {
175
175
  const r = (e + "e").split("e");
176
176
  return +(r[0] + "e" + (+r[1] + (t || 0)));
177
177
  }
178
- function y(e, t = 0) {
178
+ function h(e, t = 0) {
179
179
  const r = i(e, +t);
180
180
  return i(Math.ceil(r), -t);
181
181
  }
182
- function h(e, t = 0) {
182
+ function C(e, t = 0) {
183
183
  const r = i(e, +t);
184
184
  return i(Math.floor(r), -t);
185
185
  }
186
- function m(e, t = 0) {
187
- if (e < 0) return -m(-e, t);
186
+ function D(e, t = 0) {
187
+ if (e < 0) return -D(-e, t);
188
188
  const r = i(e, +t);
189
189
  return i(Math.round(r), -t);
190
190
  }
191
- function C(e, t, r) {
191
+ function I(e, t, r) {
192
192
  return Math.atan2(
193
193
  e.clone().cross(t).dot(r),
194
194
  t.clone().dot(e)
@@ -198,102 +198,104 @@ function P(e, t = 0) {
198
198
  const r = i(e, +t);
199
199
  return i(Math.round(r), -t).toFixed(t);
200
200
  }
201
- function M(e, t = 0) {
201
+ function S(e, t = 0) {
202
202
  const r = i(e, +t);
203
203
  return i(Math.trunc(r), -t);
204
204
  }
205
205
  function x(e) {
206
206
  return (E.radToDeg(e) + 360) % 360;
207
207
  }
208
- function S(e) {
208
+ function M(e) {
209
209
  return E.degToRad(e);
210
210
  }
211
- const B = {
212
- ceilExp: y,
213
- floorExp: h,
214
- roundExp: m,
211
+ const K = {
212
+ ceilExp: h,
213
+ floorExp: C,
214
+ roundExp: D,
215
215
  toFixedExp: P,
216
- truncateExp: M,
217
- signedAngleTo: C,
216
+ truncateExp: S,
217
+ signedAngleTo: I,
218
218
  radToDeg: x,
219
- degToRad: S
219
+ degToRad: M
220
220
  };
221
221
  export {
222
- je as AmbientLightComponent,
222
+ He as AmbientLightComponent,
223
223
  Me as AxesColorBlue,
224
- xe as AxesColorBlueLetter,
225
- Se as AxesColorGreen,
224
+ Ve as AxesColorBlueLetter,
225
+ Le as AxesColorGreen,
226
226
  Re as AxesColorGreenLetter,
227
- Le as AxesColorRed,
228
- Ve as AxesColorRedLetter,
229
- G as BoundingBox,
227
+ Te as AxesColorRed,
228
+ _e as AxesColorRedLetter,
229
+ N as BoundingBox,
230
230
  j as BoundingBoxComponent,
231
- Te as COORDINATE_LAYER_MASK,
232
- we as DEFAULT_LAYER_MASK,
231
+ Fe as COORDINATE_LAYER_MASK,
232
+ Ye as DEFAULT_LAYER_MASK,
233
233
  v as DIVE,
234
234
  H as DIVEAbortablePromise,
235
235
  b as DIVECameraComponent,
236
- J as DIVECanvasLifecycleManager,
237
- W as DIVEClock,
238
- q as DIVEComponent,
239
- z as DIVEDefaultSettings,
236
+ W as DIVECanvasLifecycleManager,
237
+ q as DIVEClock,
238
+ z as DIVEComponent,
239
+ J as DIVEDefaultSettings,
240
240
  X as DIVEDeferredPromise,
241
241
  Q as DIVEEnvironment,
242
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,
243
+ $ as DIVEGridDefaultSettings,
244
+ k as DIVEGridOnAnyColors,
245
+ ee as DIVEGridOnDarkColors,
246
+ te as DIVEGridOnLightColors,
247
+ re as DIVELightComponent,
248
+ K as DIVEMath,
249
+ _ as DIVEMovable,
250
+ ne as DIVENode,
251
+ oe as DIVEPerspectiveCameraDefaultSettings,
252
+ se as DIVERenderer,
253
+ ae as DIVERendererDefaultSettings,
254
+ ce as DIVERoot,
255
+ ie as DIVEScene,
256
+ fe as DIVESceneDefaultSettings,
253
257
  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,
258
+ pe as DIVEView,
259
+ le as DirectionalLightComponent,
260
+ ue as FILE_TYPES,
261
+ Be as FLOOR_LAYER_MASK,
262
+ ot as FileContentError,
263
+ ct as FileTypeError,
264
+ Ee as FloorComponent,
265
+ De as GridComponent,
266
+ Ke as HELPER_LAYER_MASK,
267
+ me as HemisphereLightComponent,
268
+ ge as MeshComponent,
269
+ Je as ModelComponent,
270
+ de as MultiLineComponent,
271
+ st as NetworkError,
272
+ Ue as PRODUCT_LAYER_MASK,
273
+ Ge as PROXY_LAYER_MASK,
274
+ it as ParseError,
275
+ Oe as PerspectiveCameraComponent,
276
+ be as PointLightComponent,
277
+ We as PrimitiveComponent,
278
+ ye as SUPPORTED_FILE_TYPES,
279
+ O as SUPPORTED_MIME_TYPES,
280
+ Qe as SpriteTextComponent,
281
+ Ne as UI_LAYER_MASK,
280
282
  F as applyMixins,
281
- Qe as collectAnimations,
282
- de as computeProductBounds,
283
- Ae as contributedBy,
284
- Ke as contributesToBounds,
283
+ $e as collectAnimations,
284
+ Ae as computeProductBounds,
285
+ he as contributedBy,
286
+ je as contributesToBounds,
285
287
  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
288
+ qe as detachTransformControls,
289
+ Ce as disposeComponents,
290
+ Ie as findComponent,
291
+ et as findInterface,
292
+ Pe as findSceneRecursive,
293
+ A as getFileTypeFromUri,
294
+ u as getObjectDelta,
295
+ tt as implementsInterface,
296
+ Se as isDIVEComponent,
297
+ y as isFileExtensionSupported,
298
+ Y as isMimeTypeSupported,
299
+ B as isURIFileExtensionSupported,
300
+ rt as isVisibleInHierarchy
299
301
  };
@@ -44,9 +44,29 @@ export type DIVERendererSettings = {
44
44
  /**
45
45
  * Whether to use logarithmic depth buffer
46
46
  *
47
- * @default true
47
+ * Off, and {@link reversedDepthBuffer} on in its place: both answer the same
48
+ * question, and only one of them answers it in the projection. A logarithmic
49
+ * buffer has every fragment shader write its own depth, which costs early-z
50
+ * and makes every rasterizer-level depth bias a no-op -- `polygonOffset`
51
+ * included, which is how coplanar surfaces are normally settled.
52
+ *
53
+ * @default false
48
54
  */
49
55
  logarithmicDepthBuffer: boolean;
56
+ /**
57
+ * Whether to use a reversed depth buffer
58
+ *
59
+ * Floating point depth is near-uniform in its exponent, and a reversed range
60
+ * lines that up with where a perspective divide puts its precision. That is
61
+ * what makes a near plane of a millimeter and a far plane of a kilometer
62
+ * survivable without writing depth per fragment.
63
+ *
64
+ * The WebGL backend needs `EXT_clip_control` for it; three warns and falls
65
+ * back to a plain depth buffer where the extension is missing.
66
+ *
67
+ * @default true
68
+ */
69
+ reversedDepthBuffer: boolean;
50
70
  /**
51
71
  * Whether to enable shadows
52
72
  *
@@ -1,6 +1,6 @@
1
1
  import { Scene, Box3, ColorRepresentation } from 'three/webgpu';
2
2
  import { DIVERoot } from './root/Root.ts';
3
- import { GridComponent } from '../../components/grid/GridComponent.ts';
3
+ import { DIVEGridSettings, GridComponent } from '../../components/grid/GridComponent.ts';
4
4
  import { DIVEComponent } from '../component/Component.ts';
5
5
  import { DIVETicker } from '../clock/Clock.ts';
6
6
  export type DIVESceneSettings = {
@@ -17,17 +17,17 @@ export type DIVESceneSettings = {
17
17
  */
18
18
  displayGrid: boolean;
19
19
  /**
20
- * Distance between minor grid lines in meters.
20
+ * How the grid looks: cell size, major line spacing, line colors.
21
21
  *
22
- * @default 1
23
- */
24
- gridSize: number;
25
- /**
26
- * Draw a thicker major line every N cells.
22
+ * Whatever it leaves out keeps its default. Line colors come as a preset --
23
+ * `DIVEGridOnLightColors`, `DIVEGridOnDarkColors`, `DIVEGridOnAnyColors` --
24
+ * because which one reads well is a question about the ground the grid sits
25
+ * on, and the engine cannot see it: that ground is a white floor in one
26
+ * scene and the page behind a transparent canvas in the next.
27
27
  *
28
- * @default 5
28
+ * @default DIVEGridDefaultSettings
29
29
  */
30
- gridMajorLineEvery: number;
30
+ grid: Partial<DIVEGridSettings>;
31
31
  /**
32
32
  * The background color of the scene.
33
33
  *
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var h=(o,e,r)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r;var l=(o,e,r)=>h(o,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../systeminfo/index.cjs"),A=require("../assetconverter/index.cjs"),O=require("../../chunks/AssetLoader-BDDJG9JL.cjs");require("three/examples/jsm/loaders/DRACOLoader.js");const w=require("../../chunks/AssetExporter-CoL-QXkB.cjs");var m=(o=>(o.AR_DESKTOP_PLATFORM_ERROR="ar-desktop-platform-error",o.AR_QUICK_LOOK_NOT_SAFARI_ERROR="ar-quicklook-not-safari-error",o.AR_QUICK_LOOK_VERSION_MISMATCH_ERROR="ar-quicklook-version-mismatch-error",o.AR_QUICK_LOOK_UNKNOWN_ERROR="ar-quicklook-unknown-error",o))(m||{});class a extends Error{constructor(r,t){super(r);l(this,"type");this.name=this.constructor.name,this.type=t,Object.setPrototypeOf(this,new.target.prototype)}}class R extends a{constructor(){super("AR features are not supported on desktop platforms.","ar-desktop-platform-error")}}class p extends a{constructor(){super("ARQuickLook on iOS is only available in Safari.","ar-quicklook-not-safari-error")}}class d extends a{constructor(e,r){super(`ARQuickLook requires iOS version ${r} or later. Current version: ${e}.`,"ar-quicklook-version-mismatch-error"),this.currentVersion=e,this.requiredVersion=r}}class u extends a{constructor(){super("An unknown ARQuickLook compatibility error occurred.","ar-quicklook-unknown-error")}}const k=12;class S{constructor(){l(this,"converter",new A.AssetConverter(new O.AssetLoader,new w.AssetExporter))}async launch(e,r){if(c.SystemInfo.getBrowser()!==c.EBrowser.SAFARI)return Promise.reject(new p);const t=c.SystemInfo.getIOSVersion();if(t&&t.major<k)return Promise.reject(new d(t.full,k));if(!t)return Promise.reject(new u);if(!c.SystemInfo.getSupportsARQuickLook())return Promise.reject(new u);const n=await this.convertToUSDZ(e,r);return this.launchARQuickLook(n,r)}async convertToUSDZ(e,r){const t=await this.converter.convert(e).to("usdz",{quickLookCompatible:!0,ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}}}),n=new Blob([t],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(n)}launchARQuickLook(e,r){return new Promise(t=>{(r==null?void 0:r.arScale)==="fixed"&&(e=e.concat("#allowsContentScaling=0"));const n=document.createElement("a");n.innerHTML="<picture></picture>",n.rel="ar",n.href=e,n.download="scene.usdz",t(),n.click()})}}class _{launch(e,r){const t=self.location.toString(),n=document.createElement("a"),s=this._createParams(t,e,r),i=this._createIntent(t,e,s);n.setAttribute("href",i),n.click()}_createParams(e,r,t){const n=new URL(r,e),s=new URLSearchParams(n.search);return s.set("mode","ar_preferred"),this._applyScaleOption(s,t),this._applyPlacementOption(s,t),this._applySoundOption(s,e),this._applyLinkOption(s,e),s}_applyScaleOption(e,r){(r==null?void 0:r.arScale)==="fixed"&&e.set("resizable","false")}_applyPlacementOption(e,r){(r==null?void 0:r.arPlacement)==="vertical"&&e.set("enable_vertical_placement","true")}_applySoundOption(e,r){if(e.has("sound")){const t=new URL(e.get("sound"),r);e.set("sound",t.toString())}}_applyLinkOption(e,r){if(e.has("link")){const t=new URL(e.get("link"),r);e.set("link",t.toString())}}_createIntent(e,r,t){const n=new URL(e),s=new URL(r,e),i="#model-viewer-no-ar-fallback";return n.hash=i,`intent://arvr.google.com/scene-viewer/1.2?${t.toString()+"&file="+s.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(n.toString())};end;`}}class L{async launch(e,r){const t=c.SystemInfo.getSystem();return t===c.ESystem.IOS?new S().launch(e,r):t===c.ESystem.ANDROID?new _().launch(e,r):Promise.reject(new R)}}exports.ARDesktopPlatformError=R;exports.ARError=a;exports.ARQuickLook=S;exports.ARQuickLookNotSafariError=p;exports.ARQuickLookUnknownError=u;exports.ARQuickLookVersionMismatchError=d;exports.ARSystem=L;exports.EARErrorType=m;exports.SceneViewer=_;
1
+ "use strict";var f=Object.defineProperty;var h=(o,e,r)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r;var l=(o,e,r)=>h(o,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../systeminfo/index.cjs"),A=require("../assetconverter/index.cjs"),O=require("../../chunks/AssetLoader-BOBXNUHe.cjs");require("three/examples/jsm/loaders/DRACOLoader.js");const w=require("../../chunks/AssetExporter-CoL-QXkB.cjs");var m=(o=>(o.AR_DESKTOP_PLATFORM_ERROR="ar-desktop-platform-error",o.AR_QUICK_LOOK_NOT_SAFARI_ERROR="ar-quicklook-not-safari-error",o.AR_QUICK_LOOK_VERSION_MISMATCH_ERROR="ar-quicklook-version-mismatch-error",o.AR_QUICK_LOOK_UNKNOWN_ERROR="ar-quicklook-unknown-error",o))(m||{});class a extends Error{constructor(r,t){super(r);l(this,"type");this.name=this.constructor.name,this.type=t,Object.setPrototypeOf(this,new.target.prototype)}}class R extends a{constructor(){super("AR features are not supported on desktop platforms.","ar-desktop-platform-error")}}class p extends a{constructor(){super("ARQuickLook on iOS is only available in Safari.","ar-quicklook-not-safari-error")}}class d extends a{constructor(e,r){super(`ARQuickLook requires iOS version ${r} or later. Current version: ${e}.`,"ar-quicklook-version-mismatch-error"),this.currentVersion=e,this.requiredVersion=r}}class u extends a{constructor(){super("An unknown ARQuickLook compatibility error occurred.","ar-quicklook-unknown-error")}}const k=12;class S{constructor(){l(this,"converter",new A.AssetConverter(new O.AssetLoader,new w.AssetExporter))}async launch(e,r){if(c.SystemInfo.getBrowser()!==c.EBrowser.SAFARI)return Promise.reject(new p);const t=c.SystemInfo.getIOSVersion();if(t&&t.major<k)return Promise.reject(new d(t.full,k));if(!t)return Promise.reject(new u);if(!c.SystemInfo.getSupportsARQuickLook())return Promise.reject(new u);const n=await this.convertToUSDZ(e,r);return this.launchARQuickLook(n,r)}async convertToUSDZ(e,r){const t=await this.converter.convert(e).to("usdz",{quickLookCompatible:!0,ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}}}),n=new Blob([t],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(n)}launchARQuickLook(e,r){return new Promise(t=>{(r==null?void 0:r.arScale)==="fixed"&&(e=e.concat("#allowsContentScaling=0"));const n=document.createElement("a");n.innerHTML="<picture></picture>",n.rel="ar",n.href=e,n.download="scene.usdz",t(),n.click()})}}class _{launch(e,r){const t=self.location.toString(),n=document.createElement("a"),s=this._createParams(t,e,r),i=this._createIntent(t,e,s);n.setAttribute("href",i),n.click()}_createParams(e,r,t){const n=new URL(r,e),s=new URLSearchParams(n.search);return s.set("mode","ar_preferred"),this._applyScaleOption(s,t),this._applyPlacementOption(s,t),this._applySoundOption(s,e),this._applyLinkOption(s,e),s}_applyScaleOption(e,r){(r==null?void 0:r.arScale)==="fixed"&&e.set("resizable","false")}_applyPlacementOption(e,r){(r==null?void 0:r.arPlacement)==="vertical"&&e.set("enable_vertical_placement","true")}_applySoundOption(e,r){if(e.has("sound")){const t=new URL(e.get("sound"),r);e.set("sound",t.toString())}}_applyLinkOption(e,r){if(e.has("link")){const t=new URL(e.get("link"),r);e.set("link",t.toString())}}_createIntent(e,r,t){const n=new URL(e),s=new URL(r,e),i="#model-viewer-no-ar-fallback";return n.hash=i,`intent://arvr.google.com/scene-viewer/1.2?${t.toString()+"&file="+s.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(n.toString())};end;`}}class L{async launch(e,r){const t=c.SystemInfo.getSystem();return t===c.ESystem.IOS?new S().launch(e,r):t===c.ESystem.ANDROID?new _().launch(e,r):Promise.reject(new R)}}exports.ARDesktopPlatformError=R;exports.ARError=a;exports.ARQuickLook=S;exports.ARQuickLookNotSafariError=p;exports.ARQuickLookUnknownError=u;exports.ARQuickLookVersionMismatchError=d;exports.ARSystem=L;exports.EARErrorType=m;exports.SceneViewer=_;
@@ -3,7 +3,7 @@ var R = (o, e, r) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writab
3
3
  var l = (o, e, r) => R(o, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { SystemInfo as c, EBrowser as d, ESystem as u } from "../systeminfo/index.mjs";
5
5
  import { AssetConverter as h } from "../assetconverter/index.mjs";
6
- import { A as _ } from "../../chunks/AssetLoader-kRhuVN4p.mjs";
6
+ import { A as _ } from "../../chunks/AssetLoader-Dwnjh3GI.mjs";
7
7
  import "three/examples/jsm/loaders/DRACOLoader.js";
8
8
  import { A as f } from "../../chunks/AssetExporter-CD2iuQce.mjs";
9
9
  var S = /* @__PURE__ */ ((o) => (o.AR_DESKTOP_PLATFORM_ERROR = "ar-desktop-platform-error", o.AR_QUICK_LOOK_NOT_SAFARI_ERROR = "ar-quicklook-not-safari-error", o.AR_QUICK_LOOK_VERSION_MISMATCH_ERROR = "ar-quicklook-version-mismatch-error", o.AR_QUICK_LOOK_UNKNOWN_ERROR = "ar-quicklook-unknown-error", o))(S || {});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetCache-DdxevusY.cjs");exports.AssetCache=e.AssetCache;exports.Chunk=e.Chunk;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetCache-GSqD2GKD.cjs");exports.AssetCache=e.AssetCache;exports.Chunk=e.Chunk;
@@ -1,4 +1,4 @@
1
- import { A as e, C } from "../../chunks/AssetCache-MXFCGzZU.mjs";
1
+ import { A as e, C } from "../../chunks/AssetCache-DadU3pjv.mjs";
2
2
  export {
3
3
  e as AssetCache,
4
4
  C as Chunk
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetLoader-BDDJG9JL.cjs");exports.AssetLoader=e.AssetLoader;exports.DRACOWorker=e.DRACOWorker;exports.DracoLoader=e.DracoLoader;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/AssetLoader-BOBXNUHe.cjs");exports.AssetLoader=e.AssetLoader;exports.DRACOWorker=e.DRACOWorker;exports.DracoLoader=e.DracoLoader;
@@ -1,5 +1,5 @@
1
- import { A as o } from "../../chunks/AssetLoader-kRhuVN4p.mjs";
2
- import { D as s, a as t } from "../../chunks/AssetLoader-kRhuVN4p.mjs";
1
+ import { A as o } from "../../chunks/AssetLoader-Dwnjh3GI.mjs";
2
+ import { D as s, a as t } from "../../chunks/AssetLoader-Dwnjh3GI.mjs";
3
3
  export {
4
4
  o as AssetLoader,
5
5
  s as DRACOWorker,
@@ -1 +1 @@
1
- "use strict";var p=Object.defineProperty;var w=(a,e,t)=>e in a?p(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var h=(a,e,t)=>w(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("three/webgpu"),y=require("../../chunks/FileTypes-gD_1MonW.cjs");require("three/examples/jsm/loaders/HDRLoader.js");require("three/tsl");class C{constructor(e,t,r){h(this,"_renderer");h(this,"_scene");h(this,"_controller");this._renderer=e,this._scene=t,this._controller=r}async generateMedia(e){const{position:t,target:r,resolution:i}=e,{width:o,height:s}=i,d=this._controller.object.owner.position.clone(),n=this._controller.target.clone(),g=this._renderer.canvas.clientWidth||o,_=this._renderer.canvas.clientHeight||s;try{return this._controller.object.onResize(o,s),this._controller.object.owner.position.copy(t),this._controller.target.copy(r),this._controller.update(),(await this.drawCanvas(void 0,i)).toDataURL()}finally{this._controller.object.owner.position.copy(d),this._controller.target.copy(n),this._controller.update(),this._controller.object.onResize(g,_)}}async drawCanvas(e,t){await this._renderer.initAsync();const r=this._renderer.webgpurenderer,i=Math.max(1,(t==null?void 0:t.width)??(e==null?void 0:e.width)??(e==null?void 0:e.clientWidth)??this._renderer.canvas.clientWidth),o=Math.max(1,(t==null?void 0:t.height)??(e==null?void 0:e.height)??(e==null?void 0:e.clientHeight)??this._renderer.canvas.clientHeight),s=new l.RenderTarget(i,o,{colorSpace:l.SRGBColorSpace}),d=r.getRenderTarget(),n=this._controller.object.camera,g=n.layers.mask;try{r.setRenderTarget(s),n.layers.mask=y.DIVECameraComponent.LIVE_VIEW_LAYER_MASK,r.render(this._scene,n);const _=await r.readRenderTargetPixelsAsync(s,0,0,i,o),c=e??document.createElement("canvas");return c.width=i,c.height=o,this._writePixelsToCanvas(c,_,i,o),c}finally{n.layers.mask=g,r.setRenderTarget(d),s.dispose()}}_writePixelsToCanvas(e,t,r,i){const o=e.getContext("2d");if(!o)throw new Error("MediaCreator.drawCanvas: 2D canvas context is not available.");const s=o.createImageData(r,i);s.data.set(new Uint8ClampedArray(Array.from(t))),o.putImageData(s,0,0)}}exports.MediaCreator=C;
1
+ "use strict";var p=Object.defineProperty;var w=(a,e,t)=>e in a?p(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var h=(a,e,t)=>w(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("three/webgpu"),y=require("../../chunks/FileTypes-Cm1k0dUE.cjs");require("three/examples/jsm/loaders/HDRLoader.js");class C{constructor(e,t,r){h(this,"_renderer");h(this,"_scene");h(this,"_controller");this._renderer=e,this._scene=t,this._controller=r}async generateMedia(e){const{position:t,target:r,resolution:i}=e,{width:o,height:s}=i,d=this._controller.object.owner.position.clone(),n=this._controller.target.clone(),g=this._renderer.canvas.clientWidth||o,_=this._renderer.canvas.clientHeight||s;try{return this._controller.object.onResize(o,s),this._controller.object.owner.position.copy(t),this._controller.target.copy(r),this._controller.update(),(await this.drawCanvas(void 0,i)).toDataURL()}finally{this._controller.object.owner.position.copy(d),this._controller.target.copy(n),this._controller.update(),this._controller.object.onResize(g,_)}}async drawCanvas(e,t){await this._renderer.initAsync();const r=this._renderer.webgpurenderer,i=Math.max(1,(t==null?void 0:t.width)??(e==null?void 0:e.width)??(e==null?void 0:e.clientWidth)??this._renderer.canvas.clientWidth),o=Math.max(1,(t==null?void 0:t.height)??(e==null?void 0:e.height)??(e==null?void 0:e.clientHeight)??this._renderer.canvas.clientHeight),s=new l.RenderTarget(i,o,{colorSpace:l.SRGBColorSpace}),d=r.getRenderTarget(),n=this._controller.object.camera,g=n.layers.mask;try{r.setRenderTarget(s),n.layers.mask=y.DIVECameraComponent.LIVE_VIEW_LAYER_MASK,r.render(this._scene,n);const _=await r.readRenderTargetPixelsAsync(s,0,0,i,o),c=e??document.createElement("canvas");return c.width=i,c.height=o,this._writePixelsToCanvas(c,_,i,o),c}finally{n.layers.mask=g,r.setRenderTarget(d),s.dispose()}}_writePixelsToCanvas(e,t,r,i){const o=e.getContext("2d");if(!o)throw new Error("MediaCreator.drawCanvas: 2D canvas context is not available.");const s=o.createImageData(r,i);s.data.set(new Uint8ClampedArray(Array.from(t))),o.putImageData(s,0,0)}}exports.MediaCreator=C;
@@ -2,10 +2,9 @@ var l = Object.defineProperty;
2
2
  var p = (a, t, r) => t in a ? l(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
3
3
  var h = (a, t, r) => p(a, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { RenderTarget as w, SRGBColorSpace as y } from "three/webgpu";
5
- import { D as C } from "../../chunks/FileTypes-DGSsi-AX.mjs";
5
+ import { D as C } from "../../chunks/FileTypes-CUga4xrG.mjs";
6
6
  import "three/examples/jsm/loaders/HDRLoader.js";
7
- import "three/tsl";
8
- class M {
7
+ class D {
9
8
  constructor(t, r, e) {
10
9
  h(this, "_renderer");
11
10
  h(this, "_scene");
@@ -56,5 +55,5 @@ class M {
56
55
  }
57
56
  }
58
57
  export {
59
- M as MediaCreator
58
+ D as MediaCreator
60
59
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../chunks/OrbitController-DFPcXvlO.cjs");exports.OrbitController=t.OrbitController;exports.OrbitControllerDefaultSettings=t.OrbitControllerDefaultSettings;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../chunks/OrbitController-CK4OclLu.cjs");exports.OrbitController=t.OrbitController;exports.OrbitControllerDefaultSettings=t.OrbitControllerDefaultSettings;
@@ -1,4 +1,4 @@
1
- import { O as o, a as e } from "../../chunks/OrbitController-DLEyTvUt.mjs";
1
+ import { O as o, a as e } from "../../chunks/OrbitController-DFf6ANcN.mjs";
2
2
  export {
3
3
  o as OrbitController,
4
4
  e as OrbitControllerDefaultSettings
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var c=(t,e,r)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e,r)=>c(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three/webgpu"),d=require("../../chunks/FileTypes-gD_1MonW.cjs"),h=require("../../chunks/contributesToBounds-C1mva__U.cjs");require("three/examples/jsm/loaders/HDRLoader.js");require("three/tsl");const a=require("../../chunks/AxisHelperColors-BrGqktN5.cjs"),x=require("../../chunks/SpriteTextComponent-ByefJLeU.cjs"),n=(t,e,r)=>{const i=new d.DIVENode;return i.position.set(r.x,r.y,r.z),i.layers.mask=h.COORDINATE_LAYER_MASK,i.addComponent(new x.SpriteTextComponent).setText(t).setTextHeight(.2).setColor(e),i};class p extends s.Object3D{constructor(){super();o(this,"_axesHelper");this._axesHelper=new s.AxesHelper(.5),this._axesHelper.layers.mask=h.COORDINATE_LAYER_MASK,this._axesHelper.material.depthTest=!1,this._axesHelper.position.set(0,0,-1),this._axesHelper.setColors(new s.Color(a.AxesColorRed),new s.Color(a.AxesColorGreen),new s.Color(a.AxesColorBlue)),this._axesHelper.add(n("X",a.AxesColorRedLetter,{x:.7,y:0,z:0}),n("Y",a.AxesColorGreenLetter,{x:0,y:.7,z:0}),n("Z",a.AxesColorBlueLetter,{x:0,y:0,z:.7})),this.add(this._axesHelper)}setFromCameraMatrix(r){this._axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(r).invert())}}class u{constructor(e,r,i){o(this,"uuid",s.MathUtils.generateUUID());o(this,"_axes");o(this,"_orthographicCamera");o(this,"_restoreViewport",new s.Vector4);this._renderer=e,this._scene=r,this._cameraComponent=i,this._orthographicCamera=new s.OrthographicCamera(-1,1,1,-1,.1,100),this._orthographicCamera.name="OrientationDisplayCamera",this._orthographicCamera.layers.mask=h.COORDINATE_LAYER_MASK,this._scene.add(this._orthographicCamera),this._axes=new p,this._axes.name="OrientationDisplayAxes",this._scene.add(this._axes)}tick(){var l;if(!this._renderer.webgpurenderer.initialized)return;const e=this._scene.background??null,r=this._renderer.webgpurenderer.autoClear;this._scene.background=null,this._renderer.webgpurenderer.getViewport(this._restoreViewport);const i=((l=this._renderer.webgpurenderer.domElement)==null?void 0:l.clientHeight)??this._restoreViewport.w;this._renderer.webgpurenderer.setViewport(0,Math.max(0,i-150),150,150),this._renderer.webgpurenderer.autoClear=!1,this._axes.setFromCameraMatrix(this._cameraComponent.camera.matrixWorld),this._renderer.webgpurenderer.render(this._scene,this._orthographicCamera),this._renderer.webgpurenderer.setViewport(this._restoreViewport),this._renderer.webgpurenderer.autoClear=r,this._scene.background=e}dispose(){this._scene.remove(this._axes),this._scene.remove(this._orthographicCamera)}}exports.OrientationDisplay=u;exports.OrientationDisplayAxes=p;
1
+ "use strict";var _=Object.defineProperty;var c=(t,e,r)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e,r)=>c(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three/webgpu"),d=require("../../chunks/FileTypes-Cm1k0dUE.cjs"),h=require("../../chunks/contributesToBounds-C1mva__U.cjs");require("three/examples/jsm/loaders/HDRLoader.js");const a=require("../../chunks/AxisHelperColors-BrGqktN5.cjs"),x=require("../../chunks/SpriteTextComponent-Bho3ynCj.cjs"),n=(t,e,r)=>{const i=new d.DIVENode;return i.position.set(r.x,r.y,r.z),i.layers.mask=h.COORDINATE_LAYER_MASK,i.addComponent(new x.SpriteTextComponent).setText(t).setTextHeight(.2).setColor(e),i};class p extends s.Object3D{constructor(){super();o(this,"_axesHelper");this._axesHelper=new s.AxesHelper(.5),this._axesHelper.layers.mask=h.COORDINATE_LAYER_MASK,this._axesHelper.material.depthTest=!1,this._axesHelper.position.set(0,0,-1),this._axesHelper.setColors(new s.Color(a.AxesColorRed),new s.Color(a.AxesColorGreen),new s.Color(a.AxesColorBlue)),this._axesHelper.add(n("X",a.AxesColorRedLetter,{x:.7,y:0,z:0}),n("Y",a.AxesColorGreenLetter,{x:0,y:.7,z:0}),n("Z",a.AxesColorBlueLetter,{x:0,y:0,z:.7})),this.add(this._axesHelper)}setFromCameraMatrix(r){this._axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(r).invert())}}class u{constructor(e,r,i){o(this,"uuid",s.MathUtils.generateUUID());o(this,"_axes");o(this,"_orthographicCamera");o(this,"_restoreViewport",new s.Vector4);this._renderer=e,this._scene=r,this._cameraComponent=i,this._orthographicCamera=new s.OrthographicCamera(-1,1,1,-1,.1,100),this._orthographicCamera.name="OrientationDisplayCamera",this._orthographicCamera.layers.mask=h.COORDINATE_LAYER_MASK,this._scene.add(this._orthographicCamera),this._axes=new p,this._axes.name="OrientationDisplayAxes",this._scene.add(this._axes)}tick(){var l;if(!this._renderer.webgpurenderer.initialized)return;const e=this._scene.background??null,r=this._renderer.webgpurenderer.autoClear;this._scene.background=null,this._renderer.webgpurenderer.getViewport(this._restoreViewport);const i=((l=this._renderer.webgpurenderer.domElement)==null?void 0:l.clientHeight)??this._restoreViewport.w;this._renderer.webgpurenderer.setViewport(0,Math.max(0,i-150),150,150),this._renderer.webgpurenderer.autoClear=!1,this._axes.setFromCameraMatrix(this._cameraComponent.camera.matrixWorld),this._renderer.webgpurenderer.render(this._scene,this._orthographicCamera),this._renderer.webgpurenderer.setViewport(this._restoreViewport),this._renderer.webgpurenderer.autoClear=r,this._scene.background=e}dispose(){this._scene.remove(this._axes),this._scene.remove(this._orthographicCamera)}}exports.OrientationDisplay=u;exports.OrientationDisplayAxes=p;
@@ -2,12 +2,11 @@ var p = Object.defineProperty;
2
2
  var _ = (t, e, r) => e in t ? p(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var a = (t, e, r) => _(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { Object3D as d, AxesHelper as l, Color as o, Matrix4 as m, OrthographicCamera as c, MathUtils as x, Vector4 as C } from "three/webgpu";
5
- import { d as u } from "../../chunks/FileTypes-DGSsi-AX.mjs";
5
+ import { d as u } from "../../chunks/FileTypes-CUga4xrG.mjs";
6
6
  import { C as n } from "../../chunks/contributesToBounds-DYmHYES4.mjs";
7
7
  import "three/examples/jsm/loaders/HDRLoader.js";
8
- import "three/tsl";
9
8
  import { A as w, a as g, b, c as A, d as H, e as y } from "../../chunks/AxisHelperColors-JLBHYQDi.mjs";
10
- import { S as V } from "../../chunks/SpriteTextComponent-CG5vfiFy.mjs";
9
+ import { S as V } from "../../chunks/SpriteTextComponent-DrBnD0_-.mjs";
11
10
  const i = (t, e, r) => {
12
11
  const s = new u();
13
12
  return s.position.set(r.x, r.y, r.z), s.layers.mask = n, s.addComponent(new V()).setText(t).setTextHeight(0.2).setColor(e), s;
@@ -32,7 +31,7 @@ class f extends d {
32
31
  );
33
32
  }
34
33
  }
35
- class E {
34
+ class v {
36
35
  constructor(e, r, s) {
37
36
  a(this, "uuid", x.generateUUID());
38
37
  a(this, "_axes");
@@ -70,6 +69,6 @@ class E {
70
69
  }
71
70
  }
72
71
  export {
73
- E as OrientationDisplay,
72
+ v as OrientationDisplay,
74
73
  f as OrientationDisplayAxes
75
74
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../chunks/FileTypes-gD_1MonW.cjs");require("three/webgpu");require("three/examples/jsm/loaders/HDRLoader.js");require("three/tsl");const b=require("../../chunks/ModelComponent-Cj3ff6nL.cjs"),E=require("../../chunks/OrbitController-DFPcXvlO.cjs"),v={...s.DIVEDefaultSettings},d=u=>{s.disposeComponents(u),u.removeFromParent()};async function D(u,l){let a=!1;const e=new s.DIVE({...l,autoStart:!1});try{e.mainView.cameraComponent.owner.position.set(0,1,2);const i=new E.OrbitController(e.mainView.cameraComponent,e.mainView.canvas);e.clock.addTicker(i);let o=null,c=null,f=0,w=Promise.resolve();const m=()=>{const t=o??e.scene.root;new s.BoundingBox().enclose(t).isEmpty||i.focusObject(t)},p=()=>{o&&(d(o),o=null),c&&(c.destroyInstance(),c=null,e.scene.root.nodes.forEach(d))},k=e.disposeAsync.bind(e);e.disposeAsync=async()=>{a=!0,f++,i.dispose(),p(),await k()};const q=async(t,r)=>{c&&p(),o||(o=new s.DIVENode,o.name="QuickViewModel",o.addComponent(new b.ModelComponent),e.scene.root.add(o));const n=o;if(await n.requireComponent(b.ModelComponent).setFromURL(t),a){s.disposeComponents(n),n.removeFromParent();return}((r==null?void 0:r.dropToFloor)??!0)&&n.dropIt(),((r==null?void 0:r.focus)??!0)&&m()},h=async(t,r)=>{p();const n=new(await Promise.resolve().then(()=>require("../state/index.cjs"))).State(e,i);if(c=n,await n.performAction("SET_STATE",t),a){n.destroyInstance(),e.scene.root.nodes.forEach(d);return}((r==null?void 0:r.focus)??!0)&&m()},y=(t,r)=>{const n=++f,C=w.then(()=>{if(!(n!==f||a))return typeof t=="string"?q(t,r):h(t,r)});return w=C.then(()=>{},()=>{}),C},V=Object.assign(e,{orbitController:i,load:y});return Object.defineProperties(V,{model:{get:()=>o,enumerable:!0},state:{get:()=>c,enumerable:!0}}),await y(u,{focus:!1}),((l==null?void 0:l.autoStart)??!0)&&(await e.startAsync(),m()),V}catch(i){a=!0;try{await e.disposeAsync()}catch(o){console.error("Failed to clean up a QuickView:",o)}throw i}}exports.QuickView=D;exports.QuickViewDefaultSettings=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../chunks/FileTypes-Cm1k0dUE.cjs");require("three/webgpu");require("three/examples/jsm/loaders/HDRLoader.js");const C=require("../../chunks/ModelComponent-DuBAn1uS.cjs"),S=require("../../chunks/OrbitController-CK4OclLu.cjs"),v={...i.DIVEDefaultSettings},w=c=>{i.disposeComponents(c),c.removeFromParent()};async function E(c,l){let s=!1;const e=new i.DIVE({...l,autoStart:!1});try{e.mainView.cameraComponent.owner.position.set(0,1,2);const{clientWidth:u,clientHeight:d}=e.mainView.canvas;u>0&&d>0&&e.mainView.cameraComponent.onResize(u,d);const a=new S.OrbitController(e.mainView.cameraComponent,e.mainView.canvas);e.clock.addTicker(a);let t=null,r=null,m=0,f=Promise.resolve();const b=()=>{const o=t??e.scene.root;new i.BoundingBox().enclose(o).isEmpty||a.focusObject(o)},p=()=>{t&&(w(t),t=null),r&&(r.destroyInstance(),r=null,e.scene.root.nodes.forEach(w))},g=e.disposeAsync.bind(e);e.disposeAsync=async()=>{s=!0,m++,a.dispose(),p(),await g()};const k=async o=>{r&&p(),t||(t=new i.DIVENode,t.name="QuickViewModel",t.addComponent(new C.ModelComponent),e.scene.root.add(t));const n=t;if(await n.requireComponent(C.ModelComponent).setFromURL(o),s){i.disposeComponents(n),n.removeFromParent();return}n.dropIt()},q=async o=>{p();const n=new(await Promise.resolve().then(()=>require("../state/index.cjs"))).State(e,a);if(r=n,await n.performAction("SET_STATE",o),s){n.destroyInstance(),e.scene.root.nodes.forEach(w);return}},y=o=>{const n=++m,h=f.then(()=>{if(!(n!==m||s))return typeof o=="string"?k(o):q(o)});return f=h.then(()=>{},()=>{}),h},V=Object.assign(e,{orbitController:a,load:y});return Object.defineProperties(V,{model:{get:()=>t,enumerable:!0},state:{get:()=>r,enumerable:!0}}),await y(c),b(),((l==null?void 0:l.autoStart)??!0)&&await e.startAsync(),V}catch(u){s=!0;try{await e.disposeAsync()}catch(d){console.error("Failed to clean up a QuickView:",d)}throw u}}exports.QuickView=E;exports.QuickViewDefaultSettings=v;