@spiffcommerce/preview 4.1.0-alpha.4 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,34 +1,34 @@
1
- import { ArcRotateCamera as de } from "@babylonjs/core/Cameras/arcRotateCamera";
2
- import { Engine as ue } from "@babylonjs/core/Engines/engine";
3
- import { NullEngine as be } from "@babylonjs/core/Engines/nullEngine";
4
- import { HighlightLayer as ve } from "@babylonjs/core/Layers/highlightLayer";
5
- import { SceneLoader as ge } from "@babylonjs/core/Loading/sceneLoader";
6
- import { CubeTexture as we } from "@babylonjs/core/Materials/Textures/cubeTexture";
1
+ import { ArcRotateCamera as ge } from "@babylonjs/core/Cameras/arcRotateCamera";
2
+ import { Engine as me } from "@babylonjs/core/Engines/engine";
3
+ import { NullEngine as we } from "@babylonjs/core/Engines/nullEngine";
4
+ import { HighlightLayer as Ce } from "@babylonjs/core/Layers/highlightLayer";
5
+ import { SceneLoader as pe } from "@babylonjs/core/Loading/sceneLoader";
6
+ import { CubeTexture as ye } from "@babylonjs/core/Materials/Textures/cubeTexture";
7
7
  import { Color4 as f, Color3 as w } from "@babylonjs/core/Maths/math.color";
8
- import { Vector3 as g, Vector2 as J, Matrix as ee, Quaternion as te } from "@babylonjs/core/Maths/math.vector";
9
- import { DracoCompression as Ce } from "@babylonjs/core/Meshes/Compression/dracoCompression";
8
+ import { Vector3 as g, Quaternion as C, Vector2 as ie, Matrix as se } from "@babylonjs/core/Maths/math.vector";
9
+ import { DracoCompression as Pe } from "@babylonjs/core/Meshes/Compression/dracoCompression";
10
10
  import { Observable as b } from "@babylonjs/core/Misc/observable";
11
- import { Tools as ye } from "@babylonjs/core/Misc/tools";
12
- import { Scene as Me } from "@babylonjs/core/scene";
13
- import { GLTF2 as Pe } from "@babylonjs/loaders/glTF";
14
- import { PBRMaterial as T } from "@babylonjs/core/Materials/PBR/pbrMaterial";
15
- import { MirrorTexture as xe } from "@babylonjs/core/Materials/Textures/mirrorTexture";
16
- import { Color3 as Le, Vector3 as ie, Plane as Re } from "@babylonjs/core/Maths/math";
17
- import { ReflectionProbe as Ae } from "@babylonjs/core/Probes/reflectionProbe";
18
- import { GlowLayer as Oe } from "@babylonjs/core/Layers/glowLayer";
19
- import { ActionManager as L } from "@babylonjs/core/Actions/actionManager";
20
- import { ExecuteCodeAction as se } from "@babylonjs/core/Actions/directActions";
21
- import { Mesh as Ee } from "@babylonjs/core/Meshes/mesh";
22
- import { TransformNode as Te } from "@babylonjs/core/Meshes/transformNode";
23
- import { DynamicTexture as Ie } from "@babylonjs/core/Materials/Textures/dynamicTexture";
24
- import { Texture as Se } from "@babylonjs/core/Materials/Textures/texture";
11
+ import { Tools as Me } from "@babylonjs/core/Misc/tools";
12
+ import { Scene as xe } from "@babylonjs/core/scene";
13
+ import { GLTF2 as Le } from "@babylonjs/loaders/glTF";
14
+ import { PBRMaterial as F } from "@babylonjs/core/Materials/PBR/pbrMaterial";
15
+ import { MirrorTexture as Ae } from "@babylonjs/core/Materials/Textures/mirrorTexture";
16
+ import { Color3 as Ee, Vector3 as ne, Plane as Re } from "@babylonjs/core/Maths/math";
17
+ import { ReflectionProbe as Oe } from "@babylonjs/core/Probes/reflectionProbe";
18
+ import { GlowLayer as Te } from "@babylonjs/core/Layers/glowLayer";
19
+ import { ActionManager as A } from "@babylonjs/core/Actions/actionManager";
20
+ import { ExecuteCodeAction as re } from "@babylonjs/core/Actions/directActions";
21
+ import { Mesh as Ie } from "@babylonjs/core/Meshes/mesh";
22
+ import { TransformNode as Se } from "@babylonjs/core/Meshes/transformNode";
23
+ import { DynamicTexture as Fe } from "@babylonjs/core/Materials/Textures/dynamicTexture";
24
+ import { Texture as Be } from "@babylonjs/core/Materials/Textures/texture";
25
25
  import { Animation as v } from "@babylonjs/core/Animations/animation";
26
- import { QuadraticEase as Fe, EasingFunction as Be } from "@babylonjs/core/Animations/easing";
27
- import { AssetsManager as De } from "@babylonjs/core/Misc/assetsManager";
28
- import { ColorCurves as ne } from "@babylonjs/core/Materials/colorCurves";
26
+ import { QuadraticEase as De, EasingFunction as ze } from "@babylonjs/core/Animations/easing";
27
+ import { AssetsManager as ke } from "@babylonjs/core/Misc/assetsManager";
28
+ import { ColorCurves as ae } from "@babylonjs/core/Materials/colorCurves";
29
29
  import { ImageProcessingConfiguration as M } from "@babylonjs/core/Materials/imageProcessingConfiguration";
30
- import { DefaultRenderingPipeline as ze } from "@babylonjs/core/PostProcesses/RenderPipeline";
31
- import { DepthOfFieldEffectBlurLevel as R } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
30
+ import { DefaultRenderingPipeline as Ve } from "@babylonjs/core/PostProcesses/RenderPipeline";
31
+ import { DepthOfFieldEffectBlurLevel as E } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
32
32
  import "@babylonjs/core/Rendering/depthRendererSceneComponent";
33
33
  import "@babylonjs/core/Engines/Extensions/engine.views";
34
34
  import "@babylonjs/core/Meshes/instancedMesh";
@@ -39,13 +39,13 @@ import "@babylonjs/core/Animations/animatable";
39
39
  import "@babylonjs/core/Misc/screenshotTools";
40
40
  import "@babylonjs/core/Rendering/boundingBoxRenderer";
41
41
  import "@babylonjs/loaders/glTF/2.0/Extensions";
42
- var O = /* @__PURE__ */ ((a) => (a[a.Orbit = 0] = "Orbit", a[a.Pan = 1] = "Pan", a))(O || {}), E = /* @__PURE__ */ ((a) => (a.None = "None", a.RemoveWhenSelected = "RemoveWhenSelected", a.ApplyWhenSelected = "ApplyWhenSelected", a))(E || {});
43
- class ke {
42
+ var I = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(I || {}), S = /* @__PURE__ */ ((n) => (n.None = "None", n.RemoveWhenSelected = "RemoveWhenSelected", n.ApplyWhenSelected = "ApplyWhenSelected", n))(S || {});
43
+ class Ne {
44
44
  constructor(e) {
45
45
  this.getSceneClearColor = () => {
46
- var i, r, n, s;
47
- const t = (i = this.customOptions) != null && i.transparentBackground || (r = this.customOptions) != null && r.backgroundImage ? 0 : 1;
48
- if (this.customOptions && ((n = this.customOptions) != null && n.transparentBackground) || (s = this.customOptions) != null && s.backgroundImage)
46
+ var i, a, r, s;
47
+ const t = (i = this.customOptions) != null && i.transparentBackground || (a = this.customOptions) != null && a.backgroundImage ? 0 : 1;
48
+ if (this.customOptions && ((r = this.customOptions) != null && r.transparentBackground) || (s = this.customOptions) != null && s.backgroundImage)
49
49
  return new f(0, 0, 0, t).toLinearSpace();
50
50
  if (this.customOptions && this.customOptions.backgroundColor) {
51
51
  const o = w.FromHexString(
@@ -60,11 +60,11 @@ class ke {
60
60
  }
61
61
  return new f(0.98, 0.98, 0.98, t).toLinearSpace();
62
62
  }, this.highlightColorFromConfig = () => this.customOptions && this.customOptions.highlightColor ? this.hexToColor4(this.customOptions.highlightColor) : new f(0.98, 0.98, 0.98, 1).toLinearSpace(), this.hexToColor4 = (t, i = 1) => {
63
- const r = w.FromHexString(t);
63
+ const a = w.FromHexString(t);
64
64
  return new f(
65
- r.r,
66
- r.g,
67
- r.b,
65
+ a.r,
66
+ a.g,
67
+ a.b,
68
68
  i
69
69
  ).toLinearSpace();
70
70
  }, this.customOptions = e;
@@ -91,7 +91,7 @@ class ke {
91
91
  * Configuration related to the camera used to view and interact with the scene.
92
92
  */
93
93
  get camera() {
94
- var e, t, i, r, n, s, o, l, c, d, u, m, p;
94
+ var e, t, i, a, r, s, o, l, c, d, u, m, p;
95
95
  return {
96
96
  autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
97
97
  autoRotation: {
@@ -100,7 +100,7 @@ class ke {
100
100
  },
101
101
  limits: {
102
102
  min: {
103
- alpha: (r = this.customOptions) != null && r.lowerAlphaLimitDeg ? ((n = this.customOptions) == null ? void 0 : n.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
103
+ alpha: (a = this.customOptions) != null && a.lowerAlphaLimitDeg ? ((r = this.customOptions) == null ? void 0 : r.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
104
104
  beta: (s = this.customOptions) != null && s.lowerBetaLimitDeg ? ((o = this.customOptions) == null ? void 0 : o.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
105
105
  radius: (l = this.customOptions) == null ? void 0 : l.minZoomOverride
106
106
  },
@@ -124,10 +124,10 @@ class ke {
124
124
  };
125
125
  }
126
126
  get lighting() {
127
- var e, t, i, r;
127
+ var e, t, i, a;
128
128
  return {
129
129
  exposure: ((t = (e = this.customOptions) == null ? void 0 : e.lighting) == null ? void 0 : t.exposure) ?? 0.9,
130
- contrast: ((r = (i = this.customOptions) == null ? void 0 : i.lighting) == null ? void 0 : r.contrast) ?? 1.6
130
+ contrast: ((a = (i = this.customOptions) == null ? void 0 : i.lighting) == null ? void 0 : a.contrast) ?? 1.6
131
131
  };
132
132
  }
133
133
  get emissiveGlowIntensity() {
@@ -135,12 +135,12 @@ class ke {
135
135
  return ((e = this.customOptions) == null ? void 0 : e.emissiveGlowIntensity) ?? 0.5;
136
136
  }
137
137
  }
138
- class y {
138
+ class P {
139
139
  /**
140
140
  * Returns the resolution expected for generated textures.
141
141
  */
142
142
  static getDynamicTextureResolution() {
143
- return this.getIsMobile() || !y.offscreenRenderingSupported() ? {
143
+ return this.getIsMobile() || !P.offscreenRenderingSupported() ? {
144
144
  width: 1024,
145
145
  height: 1024
146
146
  } : {
@@ -176,7 +176,7 @@ class y {
176
176
  }
177
177
  }
178
178
  }
179
- const Ve = 128, h = {
179
+ const Ge = 128, h = {
180
180
  antiAliasing: {
181
181
  samples: 4,
182
182
  fxaaEnabled: !1
@@ -233,7 +233,7 @@ const Ve = 128, h = {
233
233
  weight: 1
234
234
  }
235
235
  };
236
- class Ne {
236
+ class He {
237
237
  constructor(e) {
238
238
  this.name = "glbPostProcessor", this.enabled = !0, this.loader = e;
239
239
  }
@@ -248,11 +248,11 @@ class Ne {
248
248
  return this.loader.loadNodeAsync(
249
249
  e,
250
250
  t,
251
- function(r) {
252
- t.extras && Object.keys(t.extras).forEach((n) => {
253
- const s = t.extras[n];
254
- r.metadata[n] = s;
255
- }), i(r);
251
+ function(a) {
252
+ t.extras && Object.keys(t.extras).forEach((r) => {
253
+ const s = t.extras[r];
254
+ a.metadata[r] = s;
255
+ }), i(a);
256
256
  }
257
257
  );
258
258
  }
@@ -277,14 +277,14 @@ class Ne {
277
277
  * @param babylonMaterial An instance of a material representation in babylon.
278
278
  */
279
279
  enableMaterialExtrasIfRequired(e, t) {
280
- if (!(!e.extras || !(t instanceof T))) {
280
+ if (!(!e.extras || !(t instanceof F))) {
281
281
  if (e.extras.sheen) {
282
282
  const i = t;
283
283
  i.sheen.isEnabled = !0, i.sheen.intensity = e.extras.sheen;
284
284
  }
285
285
  if (e.extras.translucency) {
286
286
  const i = t;
287
- i.subSurface.isTranslucencyEnabled = !0, i.subSurface.translucencyIntensity = e.extras.translucency, e.extras.translucencyR && e.extras.translucencyG && e.extras.translucencyB && (i.subSurface.tintColor = new Le(
287
+ i.subSurface.isTranslucencyEnabled = !0, i.subSurface.translucencyIntensity = e.extras.translucency, e.extras.translucencyR && e.extras.translucencyG && e.extras.translucencyB && (i.subSurface.tintColor = new Ee(
288
288
  e.extras.translucencyR,
289
289
  e.extras.translucencyG,
290
290
  e.extras.translucencyB
@@ -310,60 +310,60 @@ class Ne {
310
310
  * @param scene The scene to parse.
311
311
  */
312
312
  applyReflections(e) {
313
- function t(n) {
313
+ function t(r) {
314
314
  const s = [];
315
- return n.transformNodes.forEach((o) => {
315
+ return r.transformNodes.forEach((o) => {
316
316
  o.metadata && o.metadata.reflective && s.push(...o.getChildMeshes());
317
- }), n.meshes.forEach((o) => {
317
+ }), r.meshes.forEach((o) => {
318
318
  o.metadata && o.metadata.reflective && !s.includes(o) && s.push(o);
319
319
  }), s;
320
320
  }
321
- function i(n, s = 1) {
322
- const o = n.material;
321
+ function i(r, s = 1) {
322
+ const o = r.material;
323
323
  if (!o)
324
324
  return;
325
- const l = new xe(
325
+ const l = new Ae(
326
326
  "mirror",
327
- y.getMirrorTextureResolution(),
327
+ P.getMirrorTextureResolution(),
328
328
  e,
329
329
  !0
330
330
  );
331
331
  l.renderList = t(e);
332
- const c = n.getVerticesData("normal");
332
+ const c = r.getVerticesData("normal");
333
333
  if (!c)
334
334
  throw new Error(
335
- "Mirror attribute specified on: " + n.name + "But no normals exist to generate a mirror from!"
335
+ "Mirror attribute specified on: " + r.name + "But no normals exist to generate a mirror from!"
336
336
  );
337
- n.computeWorldMatrix(!0);
338
- const d = n.getWorldMatrix(), u = ie.TransformNormal(
339
- new ie(c[0], c[1], c[2]),
337
+ r.computeWorldMatrix(!0);
338
+ const d = r.getWorldMatrix(), u = ne.TransformNormal(
339
+ new ne(c[0], c[1], c[2]),
340
340
  d
341
341
  ).normalize(), m = Re.FromPositionAndNormal(
342
- n.position,
342
+ r.position,
343
343
  u.scale(-1)
344
344
  );
345
345
  l.mirrorPlane = m, l.level = s, o.reflectionTexture = l;
346
346
  }
347
- function r(n) {
348
- const s = n.material, o = new Ae(
347
+ function a(r) {
348
+ const s = r.material, o = new Oe(
349
349
  "probe-" + s.name,
350
- Ve,
350
+ Ge,
351
351
  e
352
352
  );
353
- o.attachToMesh(n), o.renderList && o.renderList.push(...t(e)), s.reflectionTexture = o.cubeTexture;
353
+ o.attachToMesh(r), o.renderList && o.renderList.push(...t(e)), s.reflectionTexture = o.cubeTexture;
354
354
  }
355
- e.meshes.forEach((n) => {
356
- const s = n.metadata;
357
- s && (s.mirrorTexture && i(n, s.mirrorTexture), s.reflectionProbe && r(n));
355
+ e.meshes.forEach((r) => {
356
+ const s = r.metadata;
357
+ s && (s.mirrorTexture && i(r, s.mirrorTexture), s.reflectionProbe && a(r));
358
358
  });
359
359
  }
360
360
  }
361
- class Ge {
361
+ class _e {
362
362
  constructor(e, t) {
363
363
  this.scene = e, this.intensity = t, this.meshCount = 0;
364
364
  }
365
365
  includeMeshes(e) {
366
- this.glowLayer || (this.glowLayer = new Oe("glow", this.scene), this.glowLayer.intensity = this.intensity), e.forEach((t) => {
366
+ this.glowLayer || (this.glowLayer = new Te("glow", this.scene), this.glowLayer.intensity = this.intensity), e.forEach((t) => {
367
367
  this.glowLayer.hasMesh(t) || (this.glowLayer.addIncludedOnlyMesh(t), this.meshCount++);
368
368
  });
369
369
  }
@@ -373,107 +373,107 @@ class Ge {
373
373
  }), this.meshCount === 0 && (this.glowLayer.dispose(), this.glowLayer = void 0));
374
374
  }
375
375
  }
376
- const re = /* @__PURE__ */ new Map();
377
- async function me(a, e, t) {
378
- return new Promise((i, r) => {
379
- const n = re.get(a);
380
- if (n && n.scene.uid === e.uid)
381
- return i(n);
382
- ge.LoadAssetContainerAsync(
383
- a,
376
+ const oe = /* @__PURE__ */ new Map();
377
+ async function fe(n, e, t) {
378
+ return new Promise((i, a) => {
379
+ const r = oe.get(n);
380
+ if (r && r.scene.uid === e.uid)
381
+ return i(r);
382
+ pe.LoadAssetContainerAsync(
383
+ n,
384
384
  void 0,
385
385
  e,
386
386
  t
387
387
  ).then((s) => {
388
- re.set(a, s), i(s);
389
- }).catch(r);
388
+ oe.set(n, s), i(s);
389
+ }).catch(a);
390
390
  });
391
391
  }
392
- function He(a, e, t, i, r = "") {
393
- t.forEach((n) => {
394
- const s = n.getID(), o = n.getName(), l = y.getDynamicTextureResolution();
395
- a.filter((d) => d.name === r + o).forEach((d) => {
392
+ function qe(n, e, t, i, a = "") {
393
+ t.forEach((r) => {
394
+ const s = r.getID(), o = r.getName(), l = P.getDynamicTextureResolution();
395
+ n.filter((d) => d.name === a + o).forEach((d) => {
396
396
  const u = i.get(s), m = !1;
397
397
  if (u)
398
- ae(d, u), u.update(m);
398
+ le(d, u), u.update(m);
399
399
  else {
400
- const p = _e(
400
+ const p = Ke(
401
401
  o,
402
402
  e,
403
403
  l.width,
404
404
  l.height
405
405
  );
406
- i.set(s, p), n.setStaticContext(
406
+ i.set(s, p), r.setStaticContext(
407
407
  p.getContext()
408
- ), ae(d, p), p.onLoadObservable.addOnce(() => {
408
+ ), le(d, p), p.onLoadObservable.addOnce(() => {
409
409
  p.update(m);
410
410
  });
411
411
  }
412
412
  });
413
413
  });
414
414
  }
415
- function _e(a, e, t, i) {
416
- const r = new Ie(
417
- a,
415
+ function Ke(n, e, t, i) {
416
+ const a = new Fe(
417
+ n,
418
418
  { width: t, height: i },
419
419
  e,
420
- y.shouldMipMap(),
421
- Se.TRILINEAR_SAMPLINGMODE,
422
- ue.TEXTUREFORMAT_RGBA
423
- ), n = r.getContext();
424
- return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i), r.update()), r;
420
+ P.shouldMipMap(),
421
+ Be.TRILINEAR_SAMPLINGMODE,
422
+ me.TEXTUREFORMAT_RGBA
423
+ ), r = a.getContext();
424
+ return r && (r.fillStyle = "#f5f5f5", r.fillRect(0, 0, t, i), a.update()), a;
425
425
  }
426
- function ae(a, e) {
427
- if (a instanceof T) {
428
- const t = a, i = t.albedoTexture;
426
+ function le(n, e) {
427
+ if (n instanceof F) {
428
+ const t = n, i = t.albedoTexture;
429
429
  i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
430
430
  } else {
431
- const t = a, i = t.diffuseTexture;
431
+ const t = n, i = t.diffuseTexture;
432
432
  i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
433
433
  }
434
434
  }
435
- function qe() {
436
- const a = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
437
- return a() + a() + "-" + a() + "-" + a() + "-" + a() + "-" + a() + a() + a();
435
+ function Ue() {
436
+ const n = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
437
+ return n() + n() + "-" + n() + "-" + n() + "-" + n() + "-" + n() + n() + n();
438
438
  }
439
- const C = 60, oe = 1;
440
- function le(a) {
441
- return a.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / a.targetedAnimations.length || 0;
439
+ const y = 60, he = 1;
440
+ function ce(n) {
441
+ return n.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / n.targetedAnimations.length || 0;
442
442
  }
443
- function Ke(a, e, t, i, r) {
444
- const n = r ? a.filter((s) => s.name === r) : a;
445
- if (n.length === 0) {
446
- console.warn(`No animations found for name: ${r}`);
443
+ function We(n, e, t, i, a) {
444
+ const r = a ? n.filter((s) => s.name === a) : n;
445
+ if (r.length === 0) {
446
+ console.warn(`No animations found for name: ${a}`);
447
447
  return;
448
448
  }
449
449
  if (i !== void 0 && t !== void 0 && i === t) {
450
- n.forEach((s) => {
450
+ r.forEach((s) => {
451
451
  s.stop();
452
- const o = le(s), l = i * o;
453
- s.start(e, oe, l, l);
452
+ const o = ce(s), l = i * o;
453
+ s.start(e, he, l, l);
454
454
  });
455
455
  return;
456
456
  }
457
- n.forEach((s) => {
457
+ r.forEach((s) => {
458
458
  s.stop();
459
- const o = le(s), l = i !== void 0 ? i * o : void 0, c = t !== void 0 ? t * o : void 0;
460
- s.start(e, oe, l, c);
459
+ const o = ce(s), l = i !== void 0 ? i * o : void 0, c = t !== void 0 ? t * o : void 0;
460
+ s.start(e, he, l, c);
461
461
  });
462
462
  }
463
- function pe(a) {
464
- a.forEach((e) => {
463
+ function be(n) {
464
+ n.forEach((e) => {
465
465
  e.stop();
466
466
  });
467
467
  }
468
- function Ue(a) {
469
- const e = a.animationGroups;
470
- pe(e);
468
+ function Qe(n) {
469
+ const e = n.animationGroups;
470
+ be(e);
471
471
  }
472
- function We(a, e, t) {
473
- a.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ze(e.alpha, 0, 2 * Math.PI));
474
- const i = [], r = t.target, n = 0, s = r ? 1 : 0;
472
+ function Ze(n, e, t) {
473
+ n.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = $e(e.alpha, 0, 2 * Math.PI));
474
+ const i = [], a = t.target, r = 0, s = a ? 1 : 0;
475
475
  if (t.target && Object.keys(t.target).length > 0 && i.push(
476
- P(
476
+ x(
477
477
  "cameraTargetLerp",
478
478
  "target",
479
479
  new g().copyFrom(e.target),
@@ -483,30 +483,30 @@ function We(a, e, t) {
483
483
  t.target.z
484
484
  ),
485
485
  v.ANIMATIONTYPE_VECTOR3,
486
- n
486
+ r
487
487
  )
488
488
  ), i.push(
489
- P(
489
+ x(
490
490
  "cameraAlphaLerp",
491
491
  "alpha",
492
492
  e.alpha,
493
- he(t.lonDeg),
493
+ de(t.lonDeg),
494
494
  v.ANIMATIONTYPE_FLOAT,
495
495
  s
496
496
  )
497
497
  ), i.push(
498
- P(
498
+ x(
499
499
  "cameraBetaLerp",
500
500
  "beta",
501
501
  e.beta,
502
- he(t.latDeg),
502
+ de(t.latDeg),
503
503
  v.ANIMATIONTYPE_FLOAT,
504
504
  s
505
505
  )
506
506
  ), t.radius !== void 0) {
507
507
  const c = Math.max(0.01, t.radius);
508
508
  i.push(
509
- P(
509
+ x(
510
510
  "cameraRadiusLerp",
511
511
  "radius",
512
512
  e.radius,
@@ -518,10 +518,10 @@ function We(a, e, t) {
518
518
  }
519
519
  e.animations.push(...i);
520
520
  const l = e.useAutoRotationBehavior;
521
- e.disableAutoRotationBehavior(), a.beginAnimation(
521
+ e.disableAutoRotationBehavior(), n.beginAnimation(
522
522
  e,
523
523
  0,
524
- r ? C * 2 : C,
524
+ a ? y * 2 : y,
525
525
  !1,
526
526
  1,
527
527
  () => {
@@ -529,28 +529,28 @@ function We(a, e, t) {
529
529
  }
530
530
  );
531
531
  }
532
- function he(a) {
533
- return a * Math.PI / 180;
532
+ function de(n) {
533
+ return n * Math.PI / 180;
534
534
  }
535
- function P(a, e, t, i, r, n = 0, s = v.ANIMATIONLOOPMODE_CONSTANT) {
536
- const o = new Fe();
537
- o.setEasingMode(Be.EASINGMODE_EASEINOUT);
535
+ function x(n, e, t, i, a, r = 0, s = v.ANIMATIONLOOPMODE_CONSTANT) {
536
+ const o = new De();
537
+ o.setEasingMode(ze.EASINGMODE_EASEINOUT);
538
538
  const l = new v(
539
- a,
539
+ n,
540
540
  e,
541
- C,
542
- r,
541
+ y,
542
+ a,
543
543
  s
544
544
  ), c = [];
545
- return n > 0 && c.push({ frame: 0, value: t }), c.push({ frame: C * n, value: t }), c.push({
546
- frame: C * (n + 1),
545
+ return r > 0 && c.push({ frame: 0, value: t }), c.push({ frame: y * r, value: t }), c.push({
546
+ frame: y * (r + 1),
547
547
  value: i
548
548
  }), l.setKeys(c), l.setEasingFunction(o), l;
549
549
  }
550
- function Ze(a, e, t) {
551
- return a < e ? a = t - (e - a) % (t - e) : a = e + (a - e) % (t - e);
550
+ function $e(n, e, t) {
551
+ return n < e ? n = t - (e - n) % (t - e) : n = e + (n - e) % (t - e);
552
552
  }
553
- const $e = {
553
+ const Ye = {
554
554
  albedoTexture: "albedoMap",
555
555
  bumpTexture: "normalMap",
556
556
  ambientTexture: "ambientMap",
@@ -559,7 +559,7 @@ const $e = {
559
559
  metallicTexture: "metallicMap",
560
560
  refractionTexture: "refractionMap"
561
561
  };
562
- function Qe(a, e, t, i) {
562
+ function je(n, e, t, i) {
563
563
  [
564
564
  "albedoTexture",
565
565
  "bumpTexture",
@@ -568,33 +568,33 @@ function Qe(a, e, t, i) {
568
568
  "opacityTexture",
569
569
  "metallicTexture",
570
570
  "refractionTexture"
571
- ].forEach((n) => {
572
- Ye(
571
+ ].forEach((r) => {
572
+ Xe(
573
+ r,
573
574
  n,
574
- a,
575
575
  e,
576
576
  t,
577
577
  i
578
578
  );
579
- }), Je(a, e);
579
+ }), tt(n, e);
580
580
  }
581
- function Ye(a, e, t, i, r) {
582
- const n = $e[a];
583
- if (!n)
581
+ function Xe(n, e, t, i, a) {
582
+ const r = Ye[n];
583
+ if (!r)
584
584
  throw new Error("Unexpected texture name encountered.");
585
- const s = e[n], o = s == null ? void 0 : s.fileLink;
586
- o ? i.addTextureTask(a, o, !1, !1) : r && t[a] && (t[a] && t[a].dispose(), t[a] = null, je(a, t));
585
+ const s = e[r], o = s == null ? void 0 : s.fileLink;
586
+ o ? i.addTextureTask(n, o, !1, !1) : a && t[n] && (t[n] && t[n].dispose(), t[n] = null, Je(n, t));
587
587
  }
588
- function je(a, e) {
589
- a === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), a === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), a === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), a === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0));
588
+ function Je(n, e) {
589
+ n === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), n === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), n === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), n === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0));
590
590
  }
591
- function Xe(a, e, t, i) {
592
- a === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), a === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), a === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), e[a] = i, a === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
591
+ function et(n, e, t, i) {
592
+ n === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), n === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), n === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), e[n] = i, n === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
593
593
  }
594
- function Je(a, e) {
595
- a.clearCoat && (a.clearCoat === E.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : a.clearCoat === E.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = a.clearCoatIOR || e.clearCoat.indexOfRefraction));
594
+ function tt(n, e) {
595
+ n.clearCoat && (n.clearCoat === S.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : n.clearCoat === S.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = n.clearCoatIOR || e.clearCoat.indexOfRefraction));
596
596
  }
597
- class et {
597
+ class it {
598
598
  constructor(e, t, i) {
599
599
  this.materialVariantMap = /* @__PURE__ */ new Map(), this.keysThatRemovedBaseModel = [], this.loadedContainerForKey = /* @__PURE__ */ new Map(), this.loadedMaterialsForKey = /* @__PURE__ */ new Map(), this.scene = e, this.renameClonedAsset = t, this.setBaseModelEnabled = i;
600
600
  }
@@ -607,8 +607,8 @@ class et {
607
607
  * instead remove material textures when they aren't defined. this is useful for material editor applications
608
608
  * where we want to undo changes are remove effects from display.
609
609
  */
610
- async applyMaterial(e, t, i, r) {
611
- return new Promise((n) => {
610
+ async applyMaterial(e, t, i, a) {
611
+ return new Promise((r) => {
612
612
  const s = this.materialVariantMap.get(e);
613
613
  this.materialVariantMap.set(e, {
614
614
  ...s,
@@ -618,16 +618,16 @@ class et {
618
618
  (d) => d.name === o
619
619
  );
620
620
  if (l.length === 0) {
621
- n();
621
+ r();
622
622
  return;
623
623
  }
624
- const c = new De(this.scene);
624
+ const c = new ke(this.scene);
625
625
  c.useDefaultLoadingScreen = !1, l.forEach(
626
- (d) => Qe(
626
+ (d) => je(
627
627
  t,
628
628
  d,
629
629
  c,
630
- r
630
+ a
631
631
  )
632
632
  ), c.onProgress = (d, u, m) => {
633
633
  i && i(d / u * 100, 100, m.name);
@@ -635,14 +635,14 @@ class et {
635
635
  d.forEach((u) => {
636
636
  const m = u;
637
637
  i && i(100, 100, u.name), l.forEach(
638
- (p) => Xe(
638
+ (p) => et(
639
639
  u.name,
640
640
  p,
641
641
  t,
642
642
  m.texture
643
643
  )
644
644
  );
645
- }), n();
645
+ }), r();
646
646
  }, c.loadAsync();
647
647
  });
648
648
  }
@@ -653,16 +653,16 @@ class et {
653
653
  * @param model The details for the new model, when undefined we should remove the variant associated to the given key.
654
654
  * @param onProgress A load progress callback that can be used for loading bars and event timing.
655
655
  */
656
- async applyModel(e, t, i, r) {
656
+ async applyModel(e, t, i, a) {
657
657
  var l, c;
658
658
  if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
659
659
  return this.keysThatRemovedBaseModel.includes(e) && this.setBaseModelEnabled(!0), (l = this.loadedContainerForKey.get(e)) == null || l.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e), Promise.resolve(void 0);
660
660
  this.loadedContainerForKey.has(e) && ((c = this.loadedContainerForKey.get(e)) == null || c.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), t && this.setBaseModelEnabled(!1);
661
- const s = (await me(i, this.scene, r)).instantiateModelsToScene(
661
+ const s = (await fe(i, this.scene, a)).instantiateModelsToScene(
662
662
  this.renameClonedAsset,
663
663
  !0
664
664
  );
665
- this.loadedContainerForKey.set(e, s), this.loadedMaterialsForKey.set(e, fe(s));
665
+ this.loadedContainerForKey.set(e, s), this.loadedMaterialsForKey.set(e, ve(s));
666
666
  const o = [];
667
667
  return this.materialVariantMap.forEach(async (d, u) => {
668
668
  o.push(this.applyMaterial(u, d));
@@ -688,51 +688,51 @@ class et {
688
688
  }), e;
689
689
  }
690
690
  }
691
- function fe(a) {
691
+ function ve(n) {
692
692
  const e = [];
693
- return a.rootNodes.forEach((t) => {
693
+ return n.rootNodes.forEach((t) => {
694
694
  t.getChildMeshes().forEach((i) => {
695
- i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((r) => {
696
- const n = r.getMaterial(!1);
697
- n && !e.includes(n) && e.push(n);
695
+ i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((a) => {
696
+ const r = a.getMaterial(!1);
697
+ r && !e.includes(r) && e.push(r);
698
698
  });
699
699
  });
700
700
  }), e;
701
701
  }
702
- function ce(a, e = "") {
703
- return a.map((t) => ({
702
+ function ue(n, e = "") {
703
+ return n.map((t) => ({
704
704
  name: t.name.substring(e.length),
705
705
  loop: t.loopAnimation,
706
706
  to: t.to,
707
707
  from: t.from
708
708
  }));
709
709
  }
710
- class tt {
710
+ class st {
711
711
  constructor(e) {
712
712
  this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new b(), this.materialDeselectedObservable = new b(), this.materialVariantObservable = new b(), this.modelVariantObservable = new b(), this.materialReadyToLoadCallbacks = /* @__PURE__ */ new Map(), this.modelReadyToLoadCallbacks = /* @__PURE__ */ new Map(), this.dynamicTextures = /* @__PURE__ */ new Map(), this.queuedMaterialChanges = /* @__PURE__ */ new Map(), this.materialChangesInProgress = [], this.queuedModelChanges = /* @__PURE__ */ new Map(), this.modelChangesInProgress = [], this.animations = [], this.initialized = !1, this.materials = [];
713
713
  const {
714
714
  enablePicking: t,
715
715
  modelDetails: i,
716
- previewService: r,
717
- progressHandler: n,
716
+ previewService: a,
717
+ progressHandler: r,
718
718
  scene: s
719
719
  } = e;
720
- this.enablePicking = t, this.contextService = i.contextService, this.id = qe(), this.previewService = r, this.scene = s, this.variantManager = new et(
720
+ this.enablePicking = t, this.contextService = i.contextService, this.id = Ue(), this.previewService = a, this.scene = s, this.variantManager = new it(
721
721
  s,
722
722
  this.renameClonedAsset.bind(this),
723
723
  this.setEnabled.bind(this)
724
724
  ), this.previewService.registerInitializedListener(
725
725
  async () => await this.processQueuedEvents()
726
- ), this.transformRoot = new Te("root", this.scene);
727
- const o = async () => (this.assetContainer = await me(
726
+ ), this.transformRoot = new Se("root", this.scene);
727
+ const o = async () => (this.assetContainer = await fe(
728
728
  i.model,
729
729
  s,
730
- n
730
+ r
731
731
  ), this.initialized = !0, this.instantiate(), this);
732
732
  this.importPromise = o();
733
733
  }
734
734
  //#region Interface implementation
735
- async applyMaterialVariant(e, t, i, r) {
735
+ async applyMaterialVariant(e, t, i, a) {
736
736
  if (this.previewService.getSceneInitializationProgress() !== 100 || !this.initialized) {
737
737
  if (this.materialReadyToLoadCallbacks.has(e)) {
738
738
  const s = this.materialReadyToLoadCallbacks.get(e);
@@ -743,7 +743,7 @@ class tt {
743
743
  e,
744
744
  t,
745
745
  i,
746
- r
746
+ a
747
747
  )
748
748
  );
749
749
  } else {
@@ -759,13 +759,13 @@ class tt {
759
759
  e,
760
760
  t,
761
761
  i,
762
- r
762
+ a
763
763
  )
764
764
  );
765
765
  }
766
766
  return;
767
767
  }
768
- const n = async () => {
768
+ const r = async () => {
769
769
  await this.variantManager.applyMaterial(
770
770
  e,
771
771
  i,
@@ -776,24 +776,24 @@ class tt {
776
776
  taskName: l
777
777
  });
778
778
  },
779
- r
779
+ a
780
780
  );
781
781
  };
782
782
  if (this.materialChangesInProgress.includes(e)) {
783
783
  if (this.queuedMaterialChanges.has(e)) {
784
784
  const s = this.queuedMaterialChanges.get(e);
785
- s == null || s.set(t, n);
785
+ s == null || s.set(t, r);
786
786
  } else {
787
787
  this.queuedMaterialChanges.set(
788
788
  e,
789
789
  /* @__PURE__ */ new Map()
790
790
  );
791
791
  const s = this.queuedMaterialChanges.get(e);
792
- s == null || s.set(t, n);
792
+ s == null || s.set(t, r);
793
793
  }
794
794
  return;
795
795
  }
796
- this.materialChangesInProgress.push(e), await n(), this.queuedMaterialChanges.has(e) && (this.queuedMaterialChanges.get(e).forEach(async (o) => {
796
+ this.materialChangesInProgress.push(e), await r(), this.queuedMaterialChanges.has(e) && (this.queuedMaterialChanges.get(e).forEach(async (o) => {
797
797
  await o();
798
798
  }), this.queuedMaterialChanges.delete(e)), this.materialChangesInProgress.splice(
799
799
  this.materialChangesInProgress.indexOf(e),
@@ -813,7 +813,7 @@ class tt {
813
813
  );
814
814
  return;
815
815
  }
816
- const r = () => this.variantManager.applyModel(
816
+ const a = () => this.variantManager.applyModel(
817
817
  e,
818
818
  i,
819
819
  t == null ? void 0 : t.model,
@@ -825,18 +825,18 @@ class tt {
825
825
  }
826
826
  );
827
827
  if (this.modelChangesInProgress.includes(e)) {
828
- this.queuedModelChanges.set(e, r);
828
+ this.queuedModelChanges.set(e, a);
829
829
  return;
830
830
  }
831
831
  const s = await (async () => {
832
832
  this.modelChangesInProgress.push(e);
833
- let o = await r();
833
+ let o = await a();
834
834
  return this.queuedModelChanges.has(e) && (o = await this.queuedModelChanges.get(e)(), this.queuedModelChanges.delete(e)), this.modelChangesInProgress.splice(
835
835
  this.modelChangesInProgress.indexOf(e),
836
836
  1
837
837
  ), o;
838
838
  })();
839
- this.modelInstance && pe(this.modelInstance.animationGroups), this.contextService || (this.contextService = t == null ? void 0 : t.contextService), s ? this.configureModelInstance(s) : this.configureGlowLayer();
839
+ this.modelInstance && be(this.modelInstance.animationGroups), this.contextService || (this.contextService = t == null ? void 0 : t.contextService), s ? this.configureModelInstance(s) : this.configureGlowLayer();
840
840
  }
841
841
  dispose() {
842
842
  var e;
@@ -847,7 +847,7 @@ class tt {
847
847
  this.queuedModelAnimation = e;
848
848
  return;
849
849
  }
850
- this.modelInstance && Ke(
850
+ this.modelInstance && We(
851
851
  [
852
852
  ...this.modelInstance.animationGroups,
853
853
  ...this.variantManager.getAnimationGroups()
@@ -861,7 +861,7 @@ class tt {
861
861
  getAnimations(e) {
862
862
  return [
863
863
  ...this.animations,
864
- ...e ? ce(
864
+ ...e ? ue(
865
865
  this.variantManager.getAnimationGroups(),
866
866
  this.renameClonedAsset("")
867
867
  ) : []
@@ -899,10 +899,14 @@ class tt {
899
899
  this.transformRoot.position = new g(e.x, e.y, e.z);
900
900
  }
901
901
  get rotation() {
902
- return this.transformRoot.rotation;
902
+ return this.transformRoot.rotationQuaternion.toEulerAngles();
903
903
  }
904
904
  set rotation(e) {
905
- this.transformRoot.rotation = new g(e.x, e.y, e.z);
905
+ this.transformRoot.rotationQuaternion = C.FromEulerAngles(
906
+ e.x,
907
+ e.y,
908
+ e.z
909
+ );
906
910
  }
907
911
  get scale() {
908
912
  return this.transformRoot.scaling;
@@ -915,15 +919,15 @@ class tt {
915
919
  attachPickingHandler(e) {
916
920
  e.rootNodes.forEach((t) => {
917
921
  t.getChildMeshes(!1).forEach((i) => {
918
- i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new L(this.scene)), i.actionManager.registerAction(
919
- new se(L.OnPointerOverTrigger, (r) => {
920
- r.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
922
+ i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new A(this.scene)), i.actionManager.registerAction(
923
+ new re(A.OnPointerOverTrigger, (a) => {
924
+ a.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
921
925
  id: i.material.id,
922
926
  name: this.stripIdFromName(i.material.name)
923
927
  });
924
928
  })
925
929
  ), i.actionManager.registerAction(
926
- new se(L.OnPointerOutTrigger, () => {
930
+ new re(A.OnPointerOutTrigger, () => {
927
931
  i.material && this.materialDeselectedObservable.notifyObservers({
928
932
  id: i.material.id,
929
933
  name: this.stripIdFromName(i.material.name)
@@ -952,15 +956,15 @@ class tt {
952
956
  return this.modelReadyToLoadCallbacks.size;
953
957
  }
954
958
  configureGlowLayer() {
955
- const e = (i) => i instanceof T && i.emissiveTexture !== null;
959
+ const e = (i) => i instanceof F && i.emissiveTexture !== null;
956
960
  this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
957
961
  }
958
962
  configureModelInstance(e) {
959
- var n;
960
- const t = this.transformRoot.position, i = this.transformRoot.rotation, r = this.transformRoot.scaling;
961
- this.transformRoot.position = g.Zero(), this.transformRoot.rotation = g.Zero(), this.transformRoot.scaling = g.One(), e.rootNodes.forEach((s) => {
963
+ var r;
964
+ const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, a = this.transformRoot.scaling;
965
+ this.transformRoot.position = g.Zero(), this.transformRoot.rotationQuaternion = C.Identity(), this.transformRoot.scaling = g.One(), e.rootNodes.forEach((s) => {
962
966
  s.parent = this.transformRoot;
963
- }), this.transformRoot.position = t, this.transformRoot.rotation = i, this.transformRoot.scaling = r, this.canvasPanels = ((n = this.contextService) == null ? void 0 : n.getAll()) || /* @__PURE__ */ new Map(), He(
967
+ }), this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = a, this.canvasPanels = ((r = this.contextService) == null ? void 0 : r.getAll()) || /* @__PURE__ */ new Map(), qe(
964
968
  this.materials.concat(this.variantManager.getAllMaterials()),
965
969
  this.scene,
966
970
  this.canvasPanels,
@@ -978,14 +982,14 @@ class tt {
978
982
  getAllMeshes() {
979
983
  var e;
980
984
  return (e = this.modelInstance) == null ? void 0 : e.rootNodes.map(
981
- (t) => t.getChildMeshes(!1).filter((i) => i instanceof Ee)
985
+ (t) => t.getChildMeshes(!1).filter((i) => i instanceof Ie)
982
986
  ).flat();
983
987
  }
984
988
  instantiate() {
985
989
  this.modelInstance = this.assetContainer.instantiateModelsToScene(
986
990
  this.renameClonedAsset.bind(this),
987
991
  !0
988
- ), this.materials = fe(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = ce(
992
+ ), this.materials = ve(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = ue(
989
993
  this.modelInstance.animationGroups,
990
994
  this.renameClonedAsset("")
991
995
  ), this.processQueuedEvents();
@@ -1000,8 +1004,8 @@ class tt {
1000
1004
  var e;
1001
1005
  (e = this.canvasPanels) == null || e.forEach(
1002
1006
  (t, i) => {
1003
- const r = this.dynamicTextures.get(i);
1004
- r && t.getStaticContextDirty() && r.isReady() && (r.update(!1), t.setStaticContextDirty(!1));
1007
+ const a = this.dynamicTextures.get(i);
1008
+ a && t.getStaticContextDirty() && a.isReady() && (a.update(!1), t.setStaticContextDirty(!1));
1005
1009
  }
1006
1010
  );
1007
1011
  }
@@ -1035,14 +1039,14 @@ class tt {
1035
1039
  }
1036
1040
  //#endregion
1037
1041
  }
1038
- class I extends de {
1039
- constructor(e, t, i, r, n, s, o, l) {
1042
+ class B extends ge {
1043
+ constructor(e, t, i, a, r, s, o, l) {
1040
1044
  super(
1041
1045
  e,
1042
1046
  t,
1043
1047
  i,
1048
+ a,
1044
1049
  r,
1045
- n,
1046
1050
  s,
1047
1051
  l
1048
1052
  ), this.lastFocus = new g(0, 0, 0), this.panDenominator = 1, this.minZ = 0.01, this.setRadius(this.radius), this.enableFramingBehavior(), this.wheelDeltaPercentage = 0.01, this.pinchDeltaPercentage = 5e-3, this.useNaturalPinchZoom = !0, o.camera.autoOrientation && (this.alpha += Math.PI), o && (o.camera.limits.min.beta && (this.lowerBetaLimit = o.camera.limits.min.beta), o.camera.limits.max.beta && (this.upperBetaLimit = o.camera.limits.max.beta), o.camera.limits.min.alpha && (this.lowerAlphaLimit = o.camera.limits.min.alpha), o.camera.limits.max.alpha && (this.upperAlphaLimit = o.camera.limits.max.alpha), o.camera.limits.min.radius && (this.lowerRadiusLimit = o.camera.limits.min.radius), o.camera.limits.max.radius && (this.upperRadiusLimit = o.camera.limits.max.radius), o.camera.autoRotation.enabled && this.enableAutoRotationBehavior(
@@ -1072,7 +1076,7 @@ class I extends de {
1072
1076
  this.useFramingBehavior = !0;
1073
1077
  const e = this.getFramingBehavior();
1074
1078
  e.attach(this), e.framingTime = 0, e.elevationReturnTime = -1, e.zoomStopsAnimation = !1, this.lowerRadiusLimit = null;
1075
- const t = A(this._scene);
1079
+ const t = R(this._scene);
1076
1080
  return e.zoomOnBoundingInfo(t.min, t.max), this.wheelPrecision = 100 / this.radius, this.lowerRadiusLimit === null && (this.lowerRadiusLimit = 0.1), this.lastFocus.copyFrom(this.target), e;
1077
1081
  }
1078
1082
  /**
@@ -1083,14 +1087,14 @@ class I extends de {
1083
1087
  rerunFramingBehavior(e, t) {
1084
1088
  const i = this.getFramingBehavior();
1085
1089
  i.framingTime = t || 800;
1086
- const r = () => {
1090
+ const a = () => {
1087
1091
  e && e();
1088
- }, n = A(this._scene), s = n.max.subtract(n.min), o = n.min.add(s.scale(0.5));
1092
+ }, r = R(this._scene), s = r.max.subtract(r.min), o = r.min.add(s.scale(0.5));
1089
1093
  this.setRadius(s.length() * 1.5), this.wheelPrecision = 100 / this.radius, this.panningInertia = 0, this.panningOriginTarget.copyFrom(o), this.panDenominator = s.length(), i.zoomOnBoundingInfo(
1090
- n.min,
1091
- n.max,
1094
+ r.min,
1095
+ r.max,
1092
1096
  void 0,
1093
- r
1097
+ a
1094
1098
  ), i.framingTime = 0;
1095
1099
  }
1096
1100
  /**
@@ -1120,32 +1124,32 @@ class I extends de {
1120
1124
  * @param assignActive If true the camera will be assigned as the active camera on the scene.
1121
1125
  */
1122
1126
  static create(e, t, i) {
1123
- const r = A(e), n = r.max.subtract(r.min), s = r.min.add(n.scale(0.5)), o = new I(
1127
+ const a = R(e), r = a.max.subtract(a.min), s = a.min.add(r.scale(0.5)), o = new B(
1124
1128
  "ProductCamera",
1125
1129
  -(Math.PI / 2),
1126
1130
  Math.PI / 2,
1127
- n.length() * 1.5,
1131
+ r.length() * 1.5,
1128
1132
  s,
1129
1133
  e,
1130
1134
  t
1131
1135
  );
1132
- return o.panningInertia = 0, o.panningOriginTarget.copyFrom(s), o.panDenominator = n.length(), o.onAfterCheckInputsObservable.add(() => {
1136
+ return o.panningInertia = 0, o.panningOriginTarget.copyFrom(s), o.panDenominator = r.length(), o.onAfterCheckInputsObservable.add(() => {
1133
1137
  o.panningSensibility = 1e3 / o.panDenominator;
1134
1138
  }), i && (e.activeCamera = o), o;
1135
1139
  }
1136
1140
  }
1137
- function A(a) {
1138
- if (a.meshes.length === 0)
1141
+ function R(n) {
1142
+ if (n.meshes.length === 0)
1139
1143
  return {
1140
1144
  min: new g(-1, -1, -1),
1141
1145
  max: new g(1, 1, 1)
1142
1146
  };
1143
- const e = a.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1144
- return a.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1147
+ const e = n.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1148
+ return n.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1145
1149
  }
1146
- class it {
1150
+ class nt {
1147
1151
  constructor(e, t = !1, i = void 0) {
1148
- this.renderingPipeline = new ze(
1152
+ this.renderingPipeline = new Ve(
1149
1153
  "default",
1150
1154
  t,
1151
1155
  e,
@@ -1161,27 +1165,27 @@ class it {
1161
1165
  return this.currentConfiguration;
1162
1166
  }
1163
1167
  setConfiguration(e) {
1164
- var t, i, r, n, s, o, l, c, d, u, m, p, S, F, B, D, z, k, V, N, G, H, _, q, K, U, W, Z, $, Q, Y, j, X;
1168
+ var t, i, a, r, s, o, l, c, d, u, m, p, D, z, k, V, N, G, H, _, q, K, U, W, Q, Z, $, Y, j, X, J, ee, te;
1165
1169
  if (this.renderingPipeline.isSupported) {
1166
- if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? h.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? h.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? h.bloom.enabled, this.renderingPipeline.bloomKernel = ((n = e.bloom) == null ? void 0 : n.kernel) ?? h.bloom.kernel, this.renderingPipeline.bloomScale = ((s = e.bloom) == null ? void 0 : s.scale) ?? h.bloom.scale, this.renderingPipeline.bloomThreshold = ((o = e.bloom) == null ? void 0 : o.threshold) ?? h.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? h.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? h.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((d = e.chromaticAberration) == null ? void 0 : d.aberrationAmount) ?? h.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? h.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new J(
1170
+ if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? h.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? h.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((a = e.bloom) == null ? void 0 : a.enabled) ?? h.bloom.enabled, this.renderingPipeline.bloomKernel = ((r = e.bloom) == null ? void 0 : r.kernel) ?? h.bloom.kernel, this.renderingPipeline.bloomScale = ((s = e.bloom) == null ? void 0 : s.scale) ?? h.bloom.scale, this.renderingPipeline.bloomThreshold = ((o = e.bloom) == null ? void 0 : o.threshold) ?? h.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? h.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? h.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((d = e.chromaticAberration) == null ? void 0 : d.aberrationAmount) ?? h.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? h.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new ie(
1167
1171
  e.chromaticAberration.direction.x,
1168
1172
  e.chromaticAberration.direction.y
1169
- ) : new J(
1173
+ ) : new ie(
1170
1174
  h.chromaticAberration.direction.x,
1171
1175
  h.chromaticAberration.direction.y
1172
- ), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((p = e.colorCurves) == null ? void 0 : p.enabled) ?? h.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new ne(), this.renderingPipeline.depthOfFieldEnabled = ((S = e.depthOfField) == null ? void 0 : S.enabled) ?? h.depthOfField.enabled, e.depthOfField)
1176
+ ), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((p = e.colorCurves) == null ? void 0 : p.enabled) ?? h.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new ae(), this.renderingPipeline.depthOfFieldEnabled = ((D = e.depthOfField) == null ? void 0 : D.enabled) ?? h.depthOfField.enabled, e.depthOfField)
1173
1177
  switch (e.depthOfField.blurLevel ?? h.depthOfField.blurLevel) {
1174
1178
  case "Low":
1175
- this.renderingPipeline.depthOfFieldBlurLevel = R.Low;
1179
+ this.renderingPipeline.depthOfFieldBlurLevel = E.Low;
1176
1180
  break;
1177
1181
  case "Medium":
1178
- this.renderingPipeline.depthOfFieldBlurLevel = R.Medium;
1182
+ this.renderingPipeline.depthOfFieldBlurLevel = E.Medium;
1179
1183
  break;
1180
1184
  case "High":
1181
- this.renderingPipeline.depthOfFieldBlurLevel = R.High;
1185
+ this.renderingPipeline.depthOfFieldBlurLevel = E.High;
1182
1186
  break;
1183
1187
  }
1184
- if (this.renderingPipeline.depthOfField.focalLength = ((F = e.depthOfField) == null ? void 0 : F.focalLength) ?? h.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((B = e.depthOfField) == null ? void 0 : B.fStop) ?? h.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((D = e.depthOfField) == null ? void 0 : D.focusDistance) ?? h.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((z = e.depthOfField) == null ? void 0 : z.lensSize) ?? h.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((k = e.grain) == null ? void 0 : k.enabled) ?? h.grain.enabled, this.renderingPipeline.grain.animated = ((V = e.grain) == null ? void 0 : V.animated) ?? h.grain.animated, this.renderingPipeline.grain.intensity = ((N = e.grain) == null ? void 0 : N.intensity) ?? h.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((G = e.misc) == null ? void 0 : G.contrast) ?? h.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((H = e.misc) == null ? void 0 : H.exposure) ?? h.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((_ = e.misc) == null ? void 0 : _.toneMappingEnabled) ?? h.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1188
+ if (this.renderingPipeline.depthOfField.focalLength = ((z = e.depthOfField) == null ? void 0 : z.focalLength) ?? h.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((k = e.depthOfField) == null ? void 0 : k.fStop) ?? h.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((V = e.depthOfField) == null ? void 0 : V.focusDistance) ?? h.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((N = e.depthOfField) == null ? void 0 : N.lensSize) ?? h.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((G = e.grain) == null ? void 0 : G.enabled) ?? h.grain.enabled, this.renderingPipeline.grain.animated = ((H = e.grain) == null ? void 0 : H.animated) ?? h.grain.animated, this.renderingPipeline.grain.intensity = ((_ = e.grain) == null ? void 0 : _.intensity) ?? h.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((q = e.misc) == null ? void 0 : q.contrast) ?? h.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((K = e.misc) == null ? void 0 : K.exposure) ?? h.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((U = e.misc) == null ? void 0 : U.toneMappingEnabled) ?? h.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1185
1189
  switch (e.misc.toneMappingType ?? h.misc.toneMappingType) {
1186
1190
  case "Standard":
1187
1191
  this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_STANDARD;
@@ -1190,8 +1194,8 @@ class it {
1190
1194
  this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_ACES;
1191
1195
  break;
1192
1196
  }
1193
- if (this.renderingPipeline.sharpenEnabled = ((q = e.sharpen) == null ? void 0 : q.enabled) ?? h.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((K = e.sharpen) == null ? void 0 : K.colorAmount) ?? h.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((U = e.sharpen) == null ? void 0 : U.edgeAmount) ?? h.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((W = e.vignette) == null ? void 0 : W.enabled) ?? h.vignette.enabled, (Z = e.vignette) != null && Z.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = h.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = h.vignette.center.y), e.vignette)
1194
- switch ((($ = e.vignette) == null ? void 0 : $.blendMode) ?? h.vignette.blendMode) {
1197
+ if (this.renderingPipeline.sharpenEnabled = ((W = e.sharpen) == null ? void 0 : W.enabled) ?? h.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Q = e.sharpen) == null ? void 0 : Q.colorAmount) ?? h.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((Z = e.sharpen) == null ? void 0 : Z.edgeAmount) ?? h.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = (($ = e.vignette) == null ? void 0 : $.enabled) ?? h.vignette.enabled, (Y = e.vignette) != null && Y.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = h.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = h.vignette.center.y), e.vignette)
1198
+ switch (((j = e.vignette) == null ? void 0 : j.blendMode) ?? h.vignette.blendMode) {
1195
1199
  case "Multiply":
1196
1200
  this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_MULTIPLY;
1197
1201
  break;
@@ -1199,54 +1203,60 @@ class it {
1199
1203
  this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_OPAQUE;
1200
1204
  break;
1201
1205
  }
1202
- (Q = e.vignette) != null && Q.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new f(
1206
+ (X = e.vignette) != null && X.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new f(
1203
1207
  e.vignette.colorRgba.r,
1204
1208
  e.vignette.colorRgba.g,
1205
1209
  e.vignette.colorRgba.b,
1206
1210
  e.vignette.colorRgba.a
1207
- ) : (Y = e.vignette) != null && Y.colorHex ? this.renderingPipeline.imageProcessing.vignetteColor = f.FromHexString(e.vignette.colorHex) : this.renderingPipeline.imageProcessing.vignetteColor = new f(
1211
+ ) : (J = e.vignette) != null && J.colorHex ? this.renderingPipeline.imageProcessing.vignetteColor = f.FromHexString(e.vignette.colorHex) : this.renderingPipeline.imageProcessing.vignetteColor = new f(
1208
1212
  h.vignette.colorRgba.r,
1209
1213
  h.vignette.colorRgba.g,
1210
1214
  h.vignette.colorRgba.b,
1211
1215
  h.vignette.colorRgba.a
1212
- ), this.renderingPipeline.imageProcessing.vignetteStretch = ((j = e.vignette) == null ? void 0 : j.stretch) ?? h.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((X = e.vignette) == null ? void 0 : X.weight) ?? h.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
1216
+ ), this.renderingPipeline.imageProcessing.vignetteStretch = ((ee = e.vignette) == null ? void 0 : ee.stretch) ?? h.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((te = e.vignette) == null ? void 0 : te.weight) ?? h.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
1213
1217
  }
1214
1218
  }
1215
1219
  updateColorCurve(e) {
1216
- const t = new ne();
1220
+ const t = new ae();
1217
1221
  return t.globalDensity = e.globalDensity ?? t.globalDensity, t.globalExposure = e.globalExposure ?? t.globalExposure, t.globalHue = e.globalHue ?? t.globalHue, t.globalSaturation = e.globalSaturation ?? t.globalSaturation, t.highlightsDensity = e.highlightsDensity ?? t.highlightsDensity, t.highlightsExposure = e.highlightsExposure ?? t.highlightsExposure, t.highlightsHue = e.highlightsHue ?? t.highlightsHue, t.highlightsSaturation = e.highlightsSaturation ?? t.highlightsSaturation, t.midtonesDensity = e.midtonesDensity ?? t.midtonesDensity, t.midtonesExposure = e.midtonesExposure ?? t.midtonesExposure, t.midtonesHue = e.midtonesHue ?? t.midtonesHue, t.midtonesSaturation = e.midtonesSaturation ?? t.midtonesSaturation, t.shadowsDensity = e.shadowsDensity ?? t.shadowsDensity, t.shadowsExposure = e.shadowsExposure ?? t.shadowsExposure, t.shadowsHue = e.shadowsHue ?? t.shadowsHue, t.shadowsSaturation = e.shadowsSaturation ?? t.shadowsSaturation, t;
1218
1222
  }
1219
1223
  }
1220
- Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(a) {
1221
- return new Ne(a);
1224
+ Le.GLTFLoader.RegisterExtension("glbPostProcessor", function(n) {
1225
+ return new He(n);
1222
1226
  });
1223
- ge.OnPluginActivatedObservable.add((a) => {
1224
- if (a.name === "gltf") {
1225
- const e = a;
1227
+ pe.OnPluginActivatedObservable.add((n) => {
1228
+ if (n.name === "gltf") {
1229
+ const e = n;
1226
1230
  e.transparencyAsCoverage = !0;
1227
1231
  }
1228
1232
  });
1229
- const x = "initialScene";
1230
- class Kt {
1233
+ const L = "initialScene";
1234
+ function O(n) {
1235
+ return new g(n.x, n.y, n.z);
1236
+ }
1237
+ function T(n) {
1238
+ return { x: n.x, y: n.y, z: n.z };
1239
+ }
1240
+ class Wt {
1231
1241
  constructor(e) {
1232
1242
  this.loadProgress = /* @__PURE__ */ new Map([
1233
- [x, 0]
1234
- ]), this.focusLostNotified = !1, this.loadObservable = new b(), this.focusLostObservable = new b(), this.initializedCallbacks = [], this.isInitialized = !1, this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.configuration = new ke(e);
1243
+ [L, 0]
1244
+ ]), this.focusLostNotified = !1, this.loadObservable = new b(), this.focusLostObservable = new b(), this.initializedCallbacks = [], this.isInitialized = !1, this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.configuration = new Ne(e);
1235
1245
  const i = (() => {
1236
1246
  if (!(e != null && e.noRender))
1237
1247
  return this.configuration.createCanvas();
1238
- })(), r = "1.5.6";
1239
- Ce.Configuration = {
1248
+ })(), a = "1.5.6";
1249
+ Pe.Configuration = {
1240
1250
  decoder: {
1241
- wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_wasm_wrapper_gltf.js`,
1242
- wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.wasm`,
1243
- fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.js`
1251
+ wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${a}/draco_wasm_wrapper_gltf.js`,
1252
+ wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${a}/draco_decoder_gltf.wasm`,
1253
+ fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${a}/draco_decoder_gltf.js`
1244
1254
  }
1245
1255
  }, i && (i.getContext("webgl2") || i.getContext("webgl"));
1246
- const n = console.log;
1256
+ const r = console.log;
1247
1257
  console.log = () => {
1248
1258
  };
1249
- const s = i ? new ue(i, !0, {
1259
+ const s = i ? new me(i, !0, {
1250
1260
  adaptToDeviceRatio: !0,
1251
1261
  limitDeviceRatio: 2,
1252
1262
  premultipliedAlpha: !1,
@@ -1254,12 +1264,12 @@ class Kt {
1254
1264
  audioEngine: !1,
1255
1265
  stencil: this.configuration.highlights.enabled,
1256
1266
  forceSRGBBufferSupportState: !0
1257
- }) : new be();
1258
- console.log = n, s.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = s, this.scene = new Me(s), this.camera = I.create(this.scene, this.configuration), this.renderingPipeline = new it(
1267
+ }) : new we();
1268
+ console.log = r, s.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = s, this.scene = new xe(s), this.camera = B.create(this.scene, this.configuration), this.renderingPipeline = new nt(
1259
1269
  this.scene,
1260
1270
  !1,
1261
1271
  this.camera
1262
- ), this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast, this.glowLayerManager = new Ge(
1272
+ ), this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast, this.glowLayerManager = new _e(
1263
1273
  this.scene,
1264
1274
  this.configuration.emissiveGlowIntensity
1265
1275
  );
@@ -1304,7 +1314,7 @@ class Kt {
1304
1314
  }
1305
1315
  registerView(e) {
1306
1316
  const t = e.height, i = e.width;
1307
- this.engine.registerView(e), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(O.Pan), this.reattachControls(e);
1317
+ this.engine.registerView(e), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(I.Pan), this.reattachControls(e);
1308
1318
  }
1309
1319
  getNumViewports() {
1310
1320
  var e;
@@ -1317,11 +1327,11 @@ class Kt {
1317
1327
  this.plugins.forEach((e) => e.dispose(!0)), this.renderingPipeline.dispose(), this.engine && this.engine.dispose(), window.removeEventListener("resize", this.fireResizeEvent);
1318
1328
  }
1319
1329
  getSceneInitializationProgress() {
1320
- return this.loadProgress.get(x);
1330
+ return this.loadProgress.get(L);
1321
1331
  }
1322
1332
  async initialize(e) {
1323
- var i, r;
1324
- this.scene.clearColor = this.configuration.scene.clearColor, this.scene.environmentTexture = we.CreateFromPrefilteredData(
1333
+ var i, a;
1334
+ this.scene.clearColor = this.configuration.scene.clearColor, this.scene.environmentTexture = ye.CreateFromPrefilteredData(
1325
1335
  this.configuration.scene.environmentFile,
1326
1336
  this.scene
1327
1337
  );
@@ -1330,20 +1340,20 @@ class Kt {
1330
1340
  e,
1331
1341
  (s) => {
1332
1342
  this.loadProgress.set(
1333
- x,
1343
+ L,
1334
1344
  s.loaded * 100 / s.total
1335
1345
  ), this.notifyLoadHandlers();
1336
1346
  }
1337
- ).getInitializationPromise()), this.loadProgress.set(x, 100), this.notifyLoadHandlers(), this.scene.activeCamera = this.camera, this.camera.rerunFramingBehavior(void 0, 1), Ue(this.scene), ((i = this.engine.views) == null ? void 0 : i.length) >= 1 && this.reattachControls(
1347
+ ).getInitializationPromise()), this.loadProgress.set(L, 100), this.notifyLoadHandlers(), this.scene.activeCamera = this.camera, this.camera.rerunFramingBehavior(void 0, 1), Qe(this.scene), ((i = this.engine.views) == null ? void 0 : i.length) >= 1 && this.reattachControls(
1338
1348
  this.engine.views[this.engine.views.length - 1].target
1339
- ), this.queuedCameraAnimation && (this.executeCameraAnimation(this.queuedCameraAnimation), this.queuedCameraAnimation = void 0), this.isInitialized = !0, await Promise.all(this.initializedCallbacks.map((n) => n())), this.initializedCallbacks = [], (r = this.configuration.options) != null && r.renderingPipelineConfiguration && this.renderingPipeline.setConfiguration(
1349
+ ), this.queuedCameraAnimation && (this.executeCameraAnimation(this.queuedCameraAnimation), this.queuedCameraAnimation = void 0), this.isInitialized = !0, await Promise.all(this.initializedCallbacks.map((r) => r())), this.initializedCallbacks = [], (a = this.configuration.options) != null && a.renderingPipelineConfiguration && this.renderingPipeline.setConfiguration(
1340
1350
  this.configuration.options.renderingPipelineConfiguration
1341
1351
  ), this.engine.runRenderLoop(() => {
1342
- this.engine.views && (this.modelContainers.forEach((n) => {
1343
- n.updateDynamicTextures();
1344
- }), this.configuration.scene.transparentBackground && this.engine.views.forEach((n) => {
1352
+ this.engine.views && (this.modelContainers.forEach((r) => {
1353
+ r.updateDynamicTextures();
1354
+ }), this.configuration.scene.transparentBackground && this.engine.views.forEach((r) => {
1345
1355
  const s = this.engine.getRenderingCanvas();
1346
- n.target.getContext("2d").clearRect(
1356
+ r.target.getContext("2d").clearRect(
1347
1357
  0,
1348
1358
  0,
1349
1359
  s.width,
@@ -1357,7 +1367,7 @@ class Kt {
1357
1367
  this.queuedCameraAnimation = e;
1358
1368
  return;
1359
1369
  }
1360
- We(
1370
+ Ze(
1361
1371
  this.scene,
1362
1372
  this.scene.activeCamera,
1363
1373
  e
@@ -1389,7 +1399,7 @@ class Kt {
1389
1399
  throw new Error(
1390
1400
  "No views attached, camera state requires a view to attach controls onto."
1391
1401
  );
1392
- e === O.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
1402
+ e === I.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
1393
1403
  }
1394
1404
  animateToLastCameraFocus() {
1395
1405
  return new Promise((e) => {
@@ -1413,7 +1423,7 @@ class Kt {
1413
1423
  async renderSceneScreenshot(e, t) {
1414
1424
  if (!this.camera)
1415
1425
  throw new Error("Missing product camera, cannot render screenshot!");
1416
- const i = new de(
1426
+ const i = new ge(
1417
1427
  "screenshotCamera",
1418
1428
  0,
1419
1429
  0,
@@ -1422,9 +1432,9 @@ class Kt {
1422
1432
  this.scene
1423
1433
  );
1424
1434
  try {
1425
- const r = t.latDeg * Math.PI / 180, n = t.lonDeg * Math.PI / 180;
1426
- i.target = t.target ? new g(t.target.x, t.target.y, t.target.z) : g.Zero(), i.alpha = n, i.beta = r, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
1427
- const s = await ye.CreateScreenshotUsingRenderTargetAsync(
1435
+ const a = t.latDeg * Math.PI / 180, r = t.lonDeg * Math.PI / 180;
1436
+ i.target = t.target ? new g(t.target.x, t.target.y, t.target.z) : g.Zero(), i.alpha = r, i.beta = a, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
1437
+ const s = await Me.CreateScreenshotUsingRenderTargetAsync(
1428
1438
  this.engine,
1429
1439
  i,
1430
1440
  e,
@@ -1441,26 +1451,26 @@ class Kt {
1441
1451
  const e = this.configuration;
1442
1452
  if (!e)
1443
1453
  return !0;
1444
- const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, r = e.camera.limits.min.beta, n = e.camera.limits.max.beta;
1445
- if (t === void 0 || i === void 0 || r === void 0 || n === void 0)
1454
+ const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, a = e.camera.limits.min.beta, r = e.camera.limits.max.beta;
1455
+ if (t === void 0 || i === void 0 || a === void 0 || r === void 0)
1446
1456
  return !0;
1447
- const s = [t, i], o = [r, n], l = s.every((d) => d === t), c = o.every((d) => d === r);
1457
+ const s = [t, i], o = [a, r], l = s.every((d) => d === t), c = o.every((d) => d === a);
1448
1458
  return !l && !c;
1449
1459
  }
1450
1460
  fireResizeEvent() {
1451
1461
  this.getNumViewports() > 0 && this.engine.resize();
1452
1462
  }
1453
1463
  setHighlights(e, t) {
1454
- var r;
1455
- e.length === 0 && ((r = this.highlightLayer) == null || r.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new ve("highlights", this.scene, {
1464
+ var a;
1465
+ e.length === 0 && ((a = this.highlightLayer) == null || a.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new Ce("highlights", this.scene, {
1456
1466
  isStroke: !0,
1457
1467
  blurVerticalSize: 0.85,
1458
1468
  blurHorizontalSize: 0.85
1459
1469
  }), this.highlightLayer.innerGlow = !0, this.highlightLayer.outerGlow = !1), this.highlightLayer.removeAllMeshes();
1460
1470
  const i = t ? new w(t[0], t[1], t[2]).toLinearSpace() : void 0;
1461
- e.forEach((n) => {
1471
+ e.forEach((r) => {
1462
1472
  const s = this.scene.materials.find(
1463
- (o) => o.name === n.name && o.id === n.id
1473
+ (o) => o.name === r.name && o.id === r.id
1464
1474
  );
1465
1475
  s && s.getBindedMeshes().forEach(
1466
1476
  (o) => {
@@ -1477,7 +1487,7 @@ class Kt {
1477
1487
  this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
1478
1488
  }
1479
1489
  loadModel(e, t) {
1480
- const i = new tt({
1490
+ const i = new st({
1481
1491
  enablePicking: this.configuration.highlights.enabled,
1482
1492
  modelDetails: e,
1483
1493
  scene: this.scene,
@@ -1485,15 +1495,15 @@ class Kt {
1485
1495
  progressHandler: t
1486
1496
  });
1487
1497
  return i.registerMaterialVariantListener(
1488
- (r) => this.handleMaterialProgressCallback(
1489
- r.remainingCount,
1490
- r.totalCount,
1491
- r.taskName
1498
+ (a) => this.handleMaterialProgressCallback(
1499
+ a.remainingCount,
1500
+ a.totalCount,
1501
+ a.taskName
1492
1502
  )
1493
1503
  ), i.registerModelVariantListener(
1494
- (r) => this.handleModelProgressCallback(r, r.key)
1495
- ), this.configuration.highlights.enabled && (i.registerMaterialSelectedCallback((r) => {
1496
- this.setHighlights([r]);
1504
+ (a) => this.handleModelProgressCallback(a, a.key)
1505
+ ), this.configuration.highlights.enabled && (i.registerMaterialSelectedCallback((a) => {
1506
+ this.setHighlights([a]);
1497
1507
  }), i.registerMaterialDeselectedCallback(() => {
1498
1508
  this.setHighlights([]);
1499
1509
  })), this.modelContainers.set(i.getId(), i), this.triggerModelLoadEvent({
@@ -1516,7 +1526,7 @@ class Kt {
1516
1526
  }
1517
1527
  unregisterPlugin(e) {
1518
1528
  const t = this.plugins.indexOf(e);
1519
- t > -1 && this.plugins.splice(t, 1).forEach((r) => r.dispose(!1));
1529
+ t > -1 && this.plugins.splice(t, 1).forEach((a) => a.dispose(!1));
1520
1530
  }
1521
1531
  getGlowLayerManager() {
1522
1532
  return this.glowLayerManager;
@@ -1527,47 +1537,26 @@ class Kt {
1527
1537
  modelContainer: e
1528
1538
  });
1529
1539
  }
1540
+ triggerModelLoadEvent(e) {
1541
+ this.modelLoadEventCallbacks.forEach((t) => t(e));
1542
+ }
1530
1543
  /**
1531
- * Rotates a transform around the origin.
1532
- * @param transform The transform to rotate. All values are optional and default to standard identity values.
1533
- * @param axis The axis to rotate around. Defaults to the Y axis.
1534
- * @param angle The angle to rotate by. Defaults to PI (180 degrees);
1544
+ * Flips a transform around the origin.
1535
1545
  */
1536
- rotateAroundOrigin(e, t = { x: 0, y: 1, z: 0 }, i = Math.PI) {
1537
- const {
1538
- position: r = g.Zero(),
1539
- rotation: n = g.Zero(),
1540
- scale: s = g.One()
1541
- } = e, o = ee.Compose(
1542
- this.toBabylonVector3(s),
1543
- te.FromEulerVector(this.toBabylonVector3(n)),
1544
- this.toBabylonVector3(r)
1545
- ), l = ee.RotationAxis(this.toBabylonVector3(t), i), c = o.multiply(l), d = g.Zero(), u = te.Identity(), m = g.Zero();
1546
- return c.decompose(m, u, d), {
1547
- position: this.fromBabylonVector3(d),
1548
- rotation: this.fromBabylonVector3(u.toEulerAngles()),
1549
- scale: this.fromBabylonVector3(m)
1550
- };
1551
- }
1552
- toBabylonVector3(e) {
1553
- return new g(e.x, e.y, e.z);
1554
- }
1555
- fromBabylonVector3(e) {
1556
- return { x: e.x, y: e.y, z: e.z };
1557
- }
1558
- toRadians(e) {
1559
- return e * Math.PI / 180;
1560
- }
1561
- toRadiansVector(e) {
1562
- return {
1563
- x: this.toRadians(e.x),
1564
- y: this.toRadians(e.y),
1565
- z: this.toRadians(e.z)
1546
+ flipTransform(e, t, i) {
1547
+ const a = se.Compose(
1548
+ O(i || { x: 1, y: 1, z: 1 }),
1549
+ C.FromEulerVector(
1550
+ O(t || { x: 0, y: 0, z: 0 })
1551
+ ),
1552
+ O(e || { x: 0, y: 0, z: 0 })
1553
+ ), r = se.RotationAxis(g.Up(), Math.PI), s = a.multiply(r), o = g.Zero(), l = C.Identity(), c = g.Zero();
1554
+ return s.decompose(c, l, o), l.multiplyInPlace(C.FromEulerAngles(0, Math.PI, 0)), {
1555
+ position: T(o),
1556
+ rotation: T(l.toEulerAngles()),
1557
+ scale: T(c)
1566
1558
  };
1567
1559
  }
1568
- triggerModelLoadEvent(e) {
1569
- this.modelLoadEventCallbacks.forEach((t) => t(e));
1570
- }
1571
1560
  handleMaterialProgressCallback(e, t, i) {
1572
1561
  this.loadProgress.set(`key_${i}`, e / t * 100), this.notifyLoadHandlers();
1573
1562
  }
@@ -1592,8 +1581,8 @@ class Kt {
1592
1581
  */
1593
1582
  getLoadListenerEvent() {
1594
1583
  const e = Array.from(this.loadProgress.values()).filter(
1595
- (r) => r < 100
1596
- ), i = e.reduce((r, n) => r + n, 0) / e.length || 0;
1584
+ (a) => a < 100
1585
+ ), i = e.reduce((a, r) => a + r, 0) / e.length || 0;
1597
1586
  return {
1598
1587
  loadValue: e.length === 0 ? 100 : i,
1599
1588
  sceneInitialized: this.getSceneInitializationProgress() === 100
@@ -1608,10 +1597,10 @@ class Kt {
1608
1597
  }
1609
1598
  }
1610
1599
  export {
1611
- E as MaterialEffectMode,
1612
- O as ProductCameraRig,
1613
- Ve as REFLECTION_PROBE_RESOLUTION,
1614
- y as RenderingConfiguration,
1615
- Kt as SpiffCommerce3DPreviewService,
1600
+ S as MaterialEffectMode,
1601
+ I as ProductCameraRig,
1602
+ Ge as REFLECTION_PROBE_RESOLUTION,
1603
+ P as RenderingConfiguration,
1604
+ Wt as SpiffCommerce3DPreviewService,
1616
1605
  h as renderingPipelineDefaults
1617
1606
  };