@lumiscaphe/viewer 4.1.17 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ls-viewer-container{display:block;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none;width:100%;height:100%}.ls-viewer-container-image,.ls-viewer-container-video{cursor:default;pointer-events:none}.ls-viewer-container-vrcube{cursor:pointer;cursor:grab}.ls-viewer-container-vrcube-grabbing{cursor:move;cursor:grabbing}.ls-viewer-container-vrobject{cursor:move;cursor:grab}.ls-viewer-container-vrobject-grabbing{cursor:move;cursor:grabbing}.ls-viewer-container-loading{cursor:progress}.ls-viewer-canvas{position:absolute;opacity:0;transition:opacity .5s}.ls-viewer-video{position:absolute}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- import C from "debounce-promise";
3
- import * as P from "twgl.js";
2
+ import D from "debounce-promise";
3
+ import * as M from "twgl.js";
4
4
  import { v3 as h, m4 as c } from "twgl.js";
5
- import $ from "regression";
6
- class b {
5
+ import U from "regression";
6
+ class f {
7
7
  constructor(t, e) {
8
8
  this.width = t, this.height = e;
9
9
  }
@@ -11,7 +11,7 @@ class b {
11
11
  return this.width / this.height;
12
12
  }
13
13
  }
14
- class p {
14
+ const P = class P {
15
15
  constructor(t, e, i, s) {
16
16
  this.top = t, this.left = e, this.width = i, this.height = s;
17
17
  }
@@ -20,63 +20,66 @@ class p {
20
20
  }
21
21
  static fit(t, e, i) {
22
22
  const s = t.aspect, r = e.aspect;
23
- let n = 0, a = 0;
23
+ let a = 0, n = 0;
24
24
  switch (i) {
25
25
  case "contain":
26
- n = r < s ? e.width : e.height * s, a = r < s ? e.width / s : e.height;
26
+ a = r < s ? e.width : e.height * s, n = r < s ? e.width / s : e.height;
27
27
  break;
28
28
  case "cover":
29
29
  default:
30
- n = r < s ? e.height * s : e.width, a = r < s ? e.height : e.width / s;
30
+ a = r < s ? e.height * s : e.width, n = r < s ? e.height : e.width / s;
31
31
  break;
32
32
  case "fill":
33
- n = e.width, a = e.height;
33
+ a = e.width, n = e.height;
34
34
  break;
35
35
  }
36
- const o = (e.height - a) / 2, l = (e.width - n) / 2;
37
- return new p(o, l, n, a);
36
+ const o = (e.height - n) / 2, u = (e.width - a) / 2;
37
+ return new P(o, u, a, n);
38
38
  }
39
39
  static project(t, e, i, s) {
40
- const r = p.fit(t, e, i), n = r.width / t.width, a = r.height / t.height;
40
+ const r = P.fit(t, e, i), a = r.width / t.width, n = r.height / t.height;
41
41
  return {
42
- x: Math.round(r.left + s.x * n),
43
- y: Math.round(r.top + s.y * a)
42
+ x: Math.round(r.left + s.x * a),
43
+ y: Math.round(r.top + s.y * n)
44
44
  };
45
45
  }
46
46
  static unproject(t, e, i, s) {
47
- const r = p.fit(t, e, i), n = r.width / t.width, a = r.height / t.height;
47
+ const r = P.fit(t, e, i), a = r.width / t.width, n = r.height / t.height;
48
48
  return {
49
- x: Math.round((s.x - r.left) / n),
50
- y: Math.round((s.y - r.top) / a)
49
+ x: Math.round((s.x - r.left) / a),
50
+ y: Math.round((s.y - r.top) / n)
51
51
  };
52
52
  }
53
- static getStandardAspectRatio(t, e) {
53
+ static getStandardAspectRatio(t, e, i) {
54
54
  if (t === 0 || e === 0)
55
55
  return 0;
56
- const i = t / e;
57
- if (t < e) {
58
- const n = Math.abs(0.75 - i), a = Math.abs(9 / 16 - i);
59
- return n < a ? 3 / 4 : 9 / 16;
60
- }
61
- const s = Math.abs(4 / 3 - i), r = Math.abs(16 / 9 - i);
62
- return s < r ? 4 / 3 : 16 / 9;
56
+ if (i)
57
+ return i;
58
+ const s = t / e;
59
+ return t < e ? s < P.PORTRAIT_ASPECT_BOUNDARY ? 9 / 16 : 3 / 4 : s < P.LANDSCAPE_ASPECT_BOUNDARY ? 4 / 3 : 16 / 9;
63
60
  }
64
- static getStandardResolution(t, e) {
61
+ static getStandardResolution(t, e, i) {
65
62
  if (t === 0 || e === 0)
66
- return new b(0, 0);
67
- const i = p.getStandardAspectRatio(t, e);
63
+ return new f(0, 0);
64
+ const s = P.getStandardAspectRatio(t, e, i);
65
+ if (i) {
66
+ const a = P.getStandardQuality(Math.min(t, e));
67
+ return new f(Math.round(a * s), Math.round(a));
68
+ }
68
69
  if (t < e) {
69
- const r = p.getStandardQuality(Math.max(e * i, t));
70
- return new b(Math.round(r), Math.round(r / i));
70
+ const a = P.getStandardQuality(Math.max(e * s, t));
71
+ return new f(Math.round(a), Math.round(a / s));
71
72
  }
72
- const s = p.getStandardQuality(Math.max(t / i, e));
73
- return new b(Math.round(s * i), Math.round(s));
73
+ const r = P.getStandardQuality(Math.max(t / s, e));
74
+ return new f(Math.round(r * s), Math.round(r));
74
75
  }
75
76
  static getStandardQuality(t) {
76
- return t <= 240 ? 240 : t <= 360 ? 360 : t <= 480 ? 480 : t <= 720 ? 720 : 1080;
77
+ return t <= 720 ? 720 : 1080;
77
78
  }
78
- }
79
- class U {
79
+ };
80
+ P.LANDSCAPE_ASPECT_BOUNDARY = Math.sqrt(4 / 3 * (16 / 9)), P.PORTRAIT_ASPECT_BOUNDARY = Math.sqrt(3 / 4 * (9 / 16));
81
+ let b = P;
82
+ class N {
80
83
  constructor(t) {
81
84
  this.element = document.createElement("canvas"), this.element.classList.add("ls-viewer-canvas"), this.element.style.opacity = "0", this.element.width = 0, this.element.height = 0, this.context = this.element.getContext("2d"), this.backCanvas = document.createElement("canvas"), this.backContext = this.backCanvas.getContext("2d"), this.fit = t, this.pixelRatio = 1;
82
85
  }
@@ -90,7 +93,7 @@ class U {
90
93
  t ? this.element.style.display = "none" : this.element.style.opacity = "0";
91
94
  }
92
95
  get resolution() {
93
- return new b(this.element.width / this.pixelRatio, this.element.height / this.pixelRatio);
96
+ return new f(this.element.width / this.pixelRatio, this.element.height / this.pixelRatio);
94
97
  }
95
98
  resize(t, e, i) {
96
99
  this.element.width = t * i, this.element.height = e * i, this.element.style.width = `${t}px`, this.element.style.height = `${e}px`, this.backCanvas.width = t * i, this.backCanvas.height = e * i, this.pixelRatio = i;
@@ -99,7 +102,7 @@ class U {
99
102
  if (!t)
100
103
  return;
101
104
  this.requestAnimationId && (cancelAnimationFrame(this.requestAnimationId), this.requestAnimationId = void 0);
102
- const s = p.fit(new b(t.width, t.height), new b(this.element.width, this.element.height), this.fit);
105
+ const s = b.fit(new f(t.width, t.height), new f(this.element.width, this.element.height), this.fit);
103
106
  e ? (this.backContext.drawImage(this.element, 0, 0), this.context.globalAlpha = 0, this.fadeLoop(t, i || 0)) : (this.context.globalAlpha = 1, this.context.drawImage(t, s.left, s.top, s.width, s.height)), this.image = t;
104
107
  }
105
108
  fadeLoop(t, e) {
@@ -107,15 +110,15 @@ class U {
107
110
  cancelAnimationFrame(this.requestAnimationId), this.requestAnimationId = void 0;
108
111
  return;
109
112
  }
110
- const i = Math.min(this.context.globalAlpha + e, 1), s = p.fit(new b(t.width, t.height), new b(this.element.width, this.element.height), this.fit);
113
+ const i = Math.min(this.context.globalAlpha + e, 1), s = b.fit(new f(t.width, t.height), new f(this.element.width, this.element.height), this.fit);
111
114
  this.context.clearRect(0, 0, this.element.width, this.element.height), this.context.globalAlpha = 1, this.context.drawImage(this.backCanvas, 0, 0), this.context.globalAlpha = i, this.context.drawImage(t, s.left, s.top, s.width, s.height), this.requestAnimationId = requestAnimationFrame(() => {
112
115
  this.fadeLoop(t, e);
113
116
  });
114
117
  }
115
118
  }
116
- class N {
119
+ class B {
117
120
  constructor() {
118
- this.element = document.createElement("canvas"), this.element.classList.add("ls-viewer-canvas"), this.element.style.opacity = "0", this.element.width = 0, this.element.height = 0, this.context = P.getContext(this.element, { preserveDrawingBuffer: !0 }), this.context && this.context.isContextLost() && (this.context = void 0), P.setDefaults({ textureColor: [1, 1, 1, 1] });
121
+ this.element = document.createElement("canvas"), this.element.classList.add("ls-viewer-canvas"), this.element.style.opacity = "0", this.element.width = 0, this.element.height = 0, this.context = M.getContext(this.element, { preserveDrawingBuffer: !0 }), this.context && this.context.isContextLost() && (this.context = void 0), M.setDefaults({ textureColor: [1, 1, 1, 1] });
119
122
  }
120
123
  show() {
121
124
  this.element.style.opacity = "1";
@@ -145,44 +148,44 @@ class w {
145
148
  return t - e * Math.floor(t / e);
146
149
  }
147
150
  static perspectiveWithFovX(t, e, i, s, r) {
148
- const n = Math.tan(t / 2), a = n / e;
149
- return this.perspectiveWithLeft(-n, n, -a, a, i, s, r);
151
+ const a = Math.tan(t / 2), n = a / e;
152
+ return this.perspectiveWithLeft(-a, a, -n, n, i, s, r);
150
153
  }
151
154
  static perspectiveWithFovY(t, e, i, s, r) {
152
- const n = i * Math.tan(t / 2), a = n * e;
153
- return this.perspectiveWithLeft(-a, a, -n, n, i, s, r);
155
+ const a = i * Math.tan(t / 2), n = a * e;
156
+ return this.perspectiveWithLeft(-n, n, -a, a, i, s, r);
154
157
  }
155
- static perspectiveWithLeft(t, e, i, s, r, n, a) {
156
- a = a || new Float32Array(16);
157
- const o = e + t, l = e - t, u = s + i, f = s - i, d = n - r;
158
- return a[0] = 2 * r / l, a[1] = 0, a[2] = 0, a[3] = 0, a[4] = 0, a[5] = 2 * r / f, a[6] = 0, a[7] = 0, a[8] = o / l, a[9] = u / f, a[10] = -n / d, a[11] = -1, a[12] = 0, a[13] = 0, a[14] = -n * r / d, a[15] = 0, a;
158
+ static perspectiveWithLeft(t, e, i, s, r, a, n) {
159
+ n = n || new Float32Array(16);
160
+ const o = e + t, u = e - t, l = s + i, p = s - i, d = a - r;
161
+ return n[0] = 2 * r / u, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = 0, n[5] = 2 * r / p, n[6] = 0, n[7] = 0, n[8] = o / u, n[9] = l / p, n[10] = -a / d, n[11] = -1, n[12] = 0, n[13] = 0, n[14] = -a * r / d, n[15] = 0, n;
159
162
  }
160
163
  }
161
- const A = class A {
164
+ const O = class O {
162
165
  static initCubeFace(t, e, i) {
163
166
  let s = [0, 0, 0];
164
- const r = h.subtract(e, t), n = h.mulScalar([0, 1, 0], h.length(r)), a = h.mulScalar(h.normalize(h.cross(r, n)), h.length(r)), o = h.mulScalar(h.normalize(h.cross(n, a)), h.length(r));
167
+ const r = h.subtract(e, t), a = h.mulScalar([0, 1, 0], h.length(r)), n = h.mulScalar(h.normalize(h.cross(r, a)), h.length(r)), o = h.mulScalar(h.normalize(h.cross(a, n)), h.length(r));
165
168
  switch (i) {
166
169
  case "front":
167
- e = h.add(t, o), s = h.normalize(n);
170
+ e = h.add(t, o), s = h.normalize(a);
168
171
  break;
169
172
  case "right":
170
- e = h.add(t, a), s = h.normalize(n);
173
+ e = h.add(t, n), s = h.normalize(a);
171
174
  break;
172
175
  case "back":
173
- e = h.subtract(t, o), s = h.normalize(n);
176
+ e = h.subtract(t, o), s = h.normalize(a);
174
177
  break;
175
178
  case "left":
176
- e = h.subtract(t, a), s = h.normalize(n);
179
+ e = h.subtract(t, n), s = h.normalize(a);
177
180
  break;
178
181
  case "up":
179
- e = h.add(t, n), s = h.normalize(h.mulScalar(o, -1));
182
+ e = h.add(t, a), s = h.normalize(h.mulScalar(o, -1));
180
183
  break;
181
184
  case "down":
182
- e = h.subtract(t, n), s = h.normalize(o);
185
+ e = h.subtract(t, a), s = h.normalize(o);
183
186
  break;
184
187
  }
185
- return new A(e, t, s);
188
+ return new O(e, t, s);
186
189
  }
187
190
  constructor(t, e, i) {
188
191
  this.target = h.copy(t), this.eye = h.copy(e), this.up = h.copy(i);
@@ -197,12 +200,12 @@ const A = class A {
197
200
  return c.inverse(c.lookAt(this.eye, this.target, this.up));
198
201
  }
199
202
  clone() {
200
- return new A(h.copy(this.target), h.copy(this.eye), h.copy(this.up));
203
+ return new O(h.copy(this.target), h.copy(this.eye), h.copy(this.up));
201
204
  }
202
205
  };
203
- A.default = new A([0, 0, 0], [2, 2, 2], [0, 1, 0]);
204
- let L = A;
205
- class B {
206
+ O.default = new O([0, 0, 0], [2, 2, 2], [0, 1, 0]);
207
+ let S = O;
208
+ class X {
206
209
  constructor(t) {
207
210
  this.target = t.target;
208
211
  const e = h.normalize(h.subtract(t.eye, t.target)), i = h.dot(e, [1, 0, 0]), s = h.dot(e, [0, 1, 0]), r = h.dot(e, [0, 0, 1]);
@@ -214,15 +217,15 @@ class B {
214
217
  }
215
218
  pointOfView(t) {
216
219
  const e = c.rotationY(this.longitude), i = c.rotationX(-this.latitude), s = c.rotationZ(0), r = c.multiply(e, c.multiply(i, s));
217
- let n = [0, 0, -1];
218
- n = c.transformPoint(r, n);
219
- let a = [0, 1, 0];
220
+ let a = [0, 0, -1];
220
221
  a = c.transformPoint(r, a);
221
- const o = h.subtract(t, h.mulScalar(n, this.distance));
222
- return new L(t, o, a);
222
+ let n = [0, 1, 0];
223
+ n = c.transformPoint(r, n);
224
+ const o = h.subtract(t, h.mulScalar(a, this.distance));
225
+ return new S(t, o, n);
223
226
  }
224
227
  }
225
- class X {
228
+ class Y {
226
229
  constructor() {
227
230
  }
228
231
  async animation(t) {
@@ -277,7 +280,7 @@ class H {
277
280
  return {
278
281
  id: t.getAttribute("id"),
279
282
  name: t.getAttribute("name"),
280
- pointOfView: new L(
283
+ pointOfView: new S(
281
284
  [
282
285
  parseFloat(t.querySelector("PointOfView Target").getAttribute("x")),
283
286
  //
@@ -315,7 +318,7 @@ const g = class g {
315
318
  return Object.entries(t).filter(([e, i]) => i != null).map(([e, i]) => `${e}=${i}`).join("&");
316
319
  }
317
320
  static sceneParameters(t) {
318
- const e = t.scene, i = e.length > 1 ? e.find((n) => n.accessory) : null, s = e.length > 1 ? e.find((n) => n.decor) : null, r = e.find((n) => n !== i && n !== s);
321
+ const e = t.scene, i = e.length > 1 ? e.find((a) => a.accessory) : null, s = e.length > 1 ? e.find((a) => a.decor) : null, r = e.find((a) => a !== i && a !== s);
319
322
  return {
320
323
  databaseId: r.database,
321
324
  configuration: r?.configuration,
@@ -415,7 +418,7 @@ const g = class g {
415
418
  }
416
419
  };
417
420
  g.xmlRegex = /directUrl="([^"]*)"/g;
418
- let S = g;
421
+ let F = g;
419
422
  class m {
420
423
  constructor(t) {
421
424
  this.server = t;
@@ -627,20 +630,20 @@ class m {
627
630
  };
628
631
  }
629
632
  }
630
- class D {
633
+ class V {
631
634
  constructor(t, e, i) {
632
635
  switch (e) {
633
636
  case "static":
634
- this.webrender = new X();
637
+ this.webrender = new Y();
635
638
  break;
636
639
  case "v1":
637
- this.webrender = new S(t), this.webrenderV2 = new m(t);
640
+ this.webrender = new F(t), this.webrenderV2 = new m(t);
638
641
  break;
639
642
  case "v2":
640
643
  this.webrender = new m(t), this.webrenderV2 = new m(t);
641
644
  break;
642
645
  default:
643
- this.webrender = new S(t), this.webrenderV2 = new m(t);
646
+ this.webrender = new F(t), this.webrenderV2 = new m(t);
644
647
  break;
645
648
  }
646
649
  this.delegate = i, this.loadingId = 0, this.loaded = 0, this.total = 0, this.databases = [], this.onLoadStart = i && i.onLoadStart ? i.onLoadStart : () => {
@@ -677,8 +680,8 @@ class D {
677
680
  }
678
681
  async loadImage(t, e) {
679
682
  const i = new Image();
680
- i.crossOrigin = location.protocol === "file:" && !D.isValidHttpUrl(t) ? null : "anonymous";
681
- const s = new Promise((r, n) => {
683
+ i.crossOrigin = location.protocol === "file:" && !V.isValidHttpUrl(t) ? null : "anonymous";
684
+ const s = new Promise((r, a) => {
682
685
  i.addEventListener(
683
686
  "load",
684
687
  () => {
@@ -687,8 +690,8 @@ class D {
687
690
  { once: !0 }
688
691
  ), i.addEventListener(
689
692
  "error",
690
- (a) => {
691
- e === this.loadingId && n(`${a.type} : ${t}`);
693
+ (n) => {
694
+ e === this.loadingId && a(`${n.type} : ${t}`);
692
695
  },
693
696
  { once: !0 }
694
697
  );
@@ -697,27 +700,27 @@ class D {
697
700
  }
698
701
  loadImageFrames(t, e, i, s) {
699
702
  this.total = t.length;
700
- const r = new Array(t.length), n = i || 0;
701
- for (let a = 0, o = t.length; a < o; a += 1) {
702
- const l = Math.ceil(a / 2) * (a % 2 === 0 ? 1 : -1), u = e ? w.mod(n + l, o) : a;
703
- r[u] = this.loadImage(t[u], s);
703
+ const r = new Array(t.length), a = i || 0;
704
+ for (let n = 0, o = t.length; n < o; n += 1) {
705
+ const u = Math.ceil(n / 2) * (n % 2 === 0 ? 1 : -1), l = e ? w.mod(a + u, o) : n;
706
+ r[l] = this.loadImage(t[l], s);
704
707
  }
705
708
  return Promise.all(r).then(() => this.onLoadEnd(this.progress)).catch(() => {
706
709
  }), r;
707
710
  }
708
711
  async loadVideo(t, e, i, s) {
709
712
  t.loop = i;
710
- const r = new Promise((n, a) => {
713
+ const r = new Promise((a, n) => {
711
714
  t.addEventListener(
712
715
  "canplaythrough",
713
716
  () => {
714
- s === this.loadingId && (this.loaded += 1, this.onLoadProgress(this.progress), n());
717
+ s === this.loadingId && (this.loaded += 1, this.onLoadProgress(this.progress), a());
715
718
  },
716
719
  { once: !0 }
717
720
  ), t.addEventListener(
718
721
  "error",
719
722
  (o) => {
720
- s === this.loadingId && a(`${o.type} : ${e}`);
723
+ s === this.loadingId && n(`${o.type} : ${e}`);
721
724
  },
722
725
  { once: !0 }
723
726
  );
@@ -725,24 +728,24 @@ class D {
725
728
  return t.src = e, t.load(), r;
726
729
  }
727
730
  async loadVideoFrame(t, e, i, s, r) {
728
- let n = 0;
729
- return new Promise((a, o) => {
730
- const l = () => {
731
+ let a = 0;
732
+ return new Promise((n, o) => {
733
+ const u = () => {
731
734
  if (r !== this.loadingId) return;
732
- if (n !== s) {
733
- n += 1;
735
+ if (a !== s) {
736
+ a += 1;
734
737
  return;
735
738
  }
736
- t.removeEventListener("seeked", l);
737
- const u = document.createElement("canvas");
738
- u.width = t.videoWidth, u.height = t.videoHeight, u.getContext("2d").drawImage(t, 0, 0);
739
+ t.removeEventListener("seeked", u);
740
+ const l = document.createElement("canvas");
741
+ l.width = t.videoWidth, l.height = t.videoHeight, l.getContext("2d").drawImage(t, 0, 0);
739
742
  const d = new Image();
740
- d.src = u.toDataURL(), a(d), this.loaded += 1, this.onLoadProgress(this.progress), s !== i - 1 && (t.currentTime += 1 / e);
743
+ d.src = l.toDataURL(), n(d), this.loaded += 1, this.onLoadProgress(this.progress), s !== i - 1 && (t.currentTime += 1 / e);
741
744
  };
742
- t.addEventListener("seeked", l), t.addEventListener(
745
+ t.addEventListener("seeked", u), t.addEventListener(
743
746
  "error",
744
- (u) => {
745
- r === this.loadingId && o(u);
747
+ (l) => {
748
+ r === this.loadingId && o(l);
746
749
  },
747
750
  { once: !0 }
748
751
  );
@@ -750,16 +753,16 @@ class D {
750
753
  }
751
754
  loadVideoFrames(t, e, i, s) {
752
755
  this.total = e;
753
- const r = new Array(e), n = document.createElement("video");
754
- for (let a = 0, o = e; a < o; a += 1)
755
- r[a] = this.loadVideoFrame(n, i, e, a, s);
756
- return n.addEventListener(
756
+ const r = new Array(e), a = document.createElement("video");
757
+ for (let n = 0, o = e; n < o; n += 1)
758
+ r[n] = this.loadVideoFrame(a, i, e, n, s);
759
+ return a.addEventListener(
757
760
  "canplaythrough",
758
761
  () => {
759
- s === this.loadingId && (n.currentTime = 1 / i / 2);
762
+ s === this.loadingId && (a.currentTime = 1 / i / 2);
760
763
  },
761
764
  { once: !0 }
762
- ), n.src = t, n.load(), Promise.all(r).then(() => this.onLoadEnd(this.progress)).catch(() => {
765
+ ), a.src = t, a.load(), Promise.all(r).then(() => this.onLoadEnd(this.progress)).catch(() => {
763
766
  }), r;
764
767
  }
765
768
  async loadImageHotspots(t, e) {
@@ -788,40 +791,41 @@ class D {
788
791
  return t;
789
792
  let i = this.databases.find((o) => o.id === e.database);
790
793
  (!i || !i.xmlDoc) && (i = await this.webrender.database(e.database), this.databases.push(i));
791
- const s = t.view.camera?.split("/"), r = s.length === 2 ? s[0] : void 0, n = s.length === 2 ? s[1] : s[0], a = i.getCameraId(n, r);
792
- if (a)
793
- return { ...t, view: { ...t.view, camera: a } };
794
+ const s = t.view.camera.split("/"), r = s.length === 2 ? s[0] : void 0, a = s.length === 2 ? s[1] : s[0], n = i.getCameraId(a, r);
795
+ if (n)
796
+ return { ...t, view: { ...t.view, camera: n } };
794
797
  {
795
- const o = i.getCameraGroupId(n);
798
+ const o = i.getCameraGroupId(a);
796
799
  return o ? { ...t, view: { ...t.view, cameraGroup: o } } : t;
797
800
  }
798
801
  }
799
802
  async vrObjectFrameSnapshot(t, e, i) {
800
803
  if (!this.webrenderV2)
801
804
  return t;
802
- const s = t.scene.find((n) => !n.decor && !n.accessory);
805
+ const s = t.scene.find((a) => !a.decor && !a.accessory);
803
806
  if (!s)
804
807
  return t;
805
- let r = this.databases.find((n) => n.id === s.database);
806
- if (r || (r = await this.webrender.database(s.database), this.databases.push(r)), this.webrender instanceof S) {
808
+ let r = this.databases.find((a) => a.id === s.database);
809
+ if (r || (r = await this.webrender.database(s.database), this.databases.push(r)), this.webrender instanceof F) {
807
810
  if (!t.view.camera)
808
811
  return t;
809
- const n = r.getCameraGroupId(t.view.camera);
810
- if (!n)
811
- return t;
812
- const a = r.getCameraGroupById(n);
812
+ const a = r.getCameraGroupId(t.view.camera);
813
813
  if (!a)
814
814
  return t;
815
- const o = a.cameras[e];
815
+ const n = r.getCameraGroupById(a);
816
+ if (!n)
817
+ return t;
818
+ const o = n.cameras[e];
816
819
  return o ? { ...t, view: { ...t.view, camera: o.id } } : t;
817
- } else if (this.webrender instanceof m)
818
- if (t.view.camera) {
819
- const n = r.getCameraById(t.view.camera);
820
+ } else if (this.webrender instanceof m) {
821
+ const a = typeof t.view.camera == "string" ? t.view.camera : t.view.camera?.id;
822
+ if (a) {
823
+ const n = r.getCameraById(a);
820
824
  if (!n)
821
825
  return t;
822
- const a = new B(n.pointOfView), o = 2 * Math.PI / i;
823
- a.longitude += e * o % (2 * Math.PI);
824
- const l = a.pointOfView(n.pointOfView.target);
826
+ const o = new X(n.pointOfView), u = 2 * Math.PI / i;
827
+ o.longitude += e * u % (2 * Math.PI);
828
+ const l = o.pointOfView(n.pointOfView.target);
825
829
  return {
826
830
  ...t,
827
831
  view: {
@@ -852,11 +856,11 @@ class D {
852
856
  const n = r.getCameraGroupById(t.view.cameraGroup);
853
857
  if (!n)
854
858
  return t;
855
- const a = n.cameras[e];
856
- return a ? { ...t, view: { ...t.view, camera: a.id } } : t;
859
+ const o = n.cameras[e];
860
+ return o ? { ...t, view: { ...t.view, camera: o.id } } : t;
857
861
  } else
858
862
  return t;
859
- else
863
+ } else
860
864
  return t;
861
865
  }
862
866
  async vrCubeFrameSnapshot(t, e) {
@@ -867,37 +871,37 @@ class D {
867
871
  if (s || (s = await this.webrender.database(i.database), this.databases.push(s)), !t.view.camera)
868
872
  return t;
869
873
  let r;
870
- if (this.webrender instanceof S) {
871
- const o = t.view.camera.split("/"), l = o.length === 2 ? o[0] : void 0, u = o.length === 2 ? o[1] : o[0];
872
- r = s.getCameraId(u, l);
873
- } else this.webrender instanceof m && (r = t.view.camera);
874
+ if (this.webrender instanceof F) {
875
+ const o = t.view.camera.split("/"), u = o.length === 2 ? o[0] : void 0, l = o.length === 2 ? o[1] : o[0];
876
+ r = s.getCameraId(l, u);
877
+ } else this.webrender instanceof m && (r = typeof t.view.camera == "string" ? t.view.camera : t.view.camera.id);
874
878
  if (!r)
875
879
  return t;
876
- const n = s.getCameraById(r);
877
- if (!n)
880
+ const a = s.getCameraById(r);
881
+ if (!a)
878
882
  return t;
879
- const a = L.initCubeFace(n.pointOfView.eye, n.pointOfView.target, e);
883
+ const n = S.initCubeFace(a.pointOfView.eye, a.pointOfView.target, e);
880
884
  return {
881
885
  ...t,
882
886
  view: {
883
887
  ...t.view,
884
888
  camera: {
885
- id: n.id,
889
+ id: a.id,
886
890
  pov: {
887
891
  target: {
888
- x: a.target[0],
889
- y: a.target[1],
890
- z: a.target[2]
892
+ x: n.target[0],
893
+ y: n.target[1],
894
+ z: n.target[2]
891
895
  },
892
896
  eye: {
893
- x: a.eye[0],
894
- y: a.eye[1],
895
- z: a.eye[2]
897
+ x: n.eye[0],
898
+ y: n.eye[1],
899
+ z: n.eye[2]
896
900
  },
897
901
  up: {
898
- x: a.up[0],
899
- y: a.up[1],
900
- z: a.up[2]
902
+ x: n.up[0],
903
+ y: n.up[1],
904
+ z: n.up[2]
901
905
  }
902
906
  },
903
907
  lens: {
@@ -931,7 +935,7 @@ class D {
931
935
  return e.protocol === "http:" || e.protocol === "https:";
932
936
  }
933
937
  }
934
- class Y {
938
+ class J {
935
939
  constructor() {
936
940
  this.element = document.createElement("video"), this.element.classList.add("ls-viewer-video"), this.element.style.opacity = "0", this.element.width = 0, this.element.height = 0, this.element.setAttribute("muted", ""), this.element.setAttribute("playsinline", ""), this.element.setAttribute("preload", "auto");
937
941
  }
@@ -942,11 +946,11 @@ class Y {
942
946
  this.element.style.opacity = "0";
943
947
  }
944
948
  resize(t, e, i, s) {
945
- const r = p.fit(i, new b(t, e), s);
949
+ const r = b.fit(i, new f(t, e), s);
946
950
  this.element.style.top = `${r.top}px`, this.element.style.left = `${r.left}px`, this.element.style.width = `${r.width}px`, this.element.style.height = `${r.height}px`, (i.width !== this.element.width || i.height !== this.element.height) && (this.element.width = i.width, this.element.height = i.height);
947
951
  }
948
952
  }
949
- class J {
953
+ class Q {
950
954
  constructor(t, e, i) {
951
955
  this.container = t, this.canvas = e, this.loader = i, this.hotspotList = [];
952
956
  }
@@ -960,25 +964,25 @@ class J {
960
964
  }
961
965
  async load(t, e, i, s) {
962
966
  let r = Promise.resolve();
963
- const n = JSON.stringify(t);
964
- n === this.snapshotHash && this.image ? r = r.then(() => this.canvas.draw(this.image, s, 0.05)) : r = r.then(
967
+ const a = JSON.stringify(t);
968
+ a === this.snapshotHash && this.image ? r = r.then(() => this.canvas.draw(this.image, s, 0.05)) : r = r.then(
965
969
  () => this.loader.loadImageSnapshot(t).then((o) => {
966
970
  this.canvas.draw(o, s, 0.05), this.image = o;
967
971
  })
968
972
  );
969
- const a = JSON.stringify(e);
970
- return (n !== this.snapshotHash || a !== this.hotspotsHash) && (e.length ? r = r.then(
973
+ const n = JSON.stringify(e);
974
+ return (a !== this.snapshotHash || n !== this.hotspotsHash) && (e.length ? r = r.then(
971
975
  () => this.loader.loadImageHotspots(t, e).then((o) => {
972
976
  this.hotspotList = o;
973
977
  })
974
- ) : this.hotspotList = []), this.hotspotsHash = a, this.snapshotHash = n, r;
978
+ ) : this.hotspotList = []), this.hotspotsHash = n, this.snapshotHash = a, r;
975
979
  }
976
980
  async pick(t, e) {
977
- const i = new b(t.parameters.width, t.parameters.height), s = p.unproject(i, this.canvas.resolution, this.canvas.fit, e);
981
+ const i = new f(t.parameters.width, t.parameters.height), s = b.unproject(i, this.canvas.resolution, this.canvas.fit, e);
978
982
  return this.loader.loadImagePick(t, s);
979
983
  }
980
984
  hotspots(t) {
981
- return this.hotspotList.map((e) => ({ ...e, position2D: p.project(t, this.canvas.resolution, this.canvas.fit, e.position2D) })).map((e) => ({ ...e, visibility: p.contains(this.canvas.resolution, e.position2D) ? e.visibility : "OutOfFrustum" }));
985
+ return this.hotspotList.map((e) => ({ ...e, position2D: b.project(t, this.canvas.resolution, this.canvas.fit, e.position2D) })).map((e) => ({ ...e, visibility: b.contains(this.canvas.resolution, e.position2D) ? e.visibility : "OutOfFrustum" }));
982
986
  }
983
987
  snapshot(t, e) {
984
988
  return this.canvas.element.toDataURL(t, e);
@@ -1000,24 +1004,24 @@ class J {
1000
1004
  onDeviceOrientation(t) {
1001
1005
  }
1002
1006
  }
1003
- class I {
1007
+ class L {
1004
1008
  constructor(t, e) {
1005
1009
  this.x = t, this.y = e;
1006
1010
  }
1007
1011
  clone() {
1008
- return new I(this.x, this.y);
1012
+ return new L(this.x, this.y);
1009
1013
  }
1010
1014
  }
1011
1015
  class y {
1012
1016
  static pointFromMouseEvent(t) {
1013
- return new I(t.screenX, t.screenY);
1017
+ return new L(t.screenX, t.screenY);
1014
1018
  }
1015
1019
  static pointFromTouchEvent(t) {
1016
1020
  const e = t.targetTouches[0] || t.changedTouches[0];
1017
- return new I(e.screenX, e.screenY);
1021
+ return new L(e.screenX, e.screenY);
1018
1022
  }
1019
1023
  }
1020
- class V {
1024
+ class j {
1021
1025
  constructor(...t) {
1022
1026
  t.length === 3 ? ({ 0: this.u, 1: this.v, 2: this.o } = t, this.w = h.cross(this.u, this.v)) : t.length === 4 ? { 0: this.u, 1: this.v, 2: this.w, 3: this.o } = t : (this.u = [1, 0, 0], this.v = [0, 1, 0], this.w = [0, 0, 1], this.o = [0, 0, 0]);
1023
1027
  }
@@ -1034,9 +1038,9 @@ class Z {
1034
1038
  this.x = t, this.y = e, this.time = i;
1035
1039
  }
1036
1040
  }
1037
- class q {
1041
+ class R {
1038
1042
  constructor(t) {
1039
- this.points = [], this.onMotion = t, this.lastPoint = new I(0, 0), this.velocity = new I(0, 0), this.loop = this.loop.bind(this);
1043
+ this.points = [], this.onMotion = t, this.lastPoint = new L(0, 0), this.velocity = new L(0, 0), this.loop = this.loop.bind(this);
1040
1044
  }
1041
1045
  destroy() {
1042
1046
  this.animationFrameId && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0);
@@ -1049,7 +1053,7 @@ class q {
1049
1053
  if (this.points.length === 0)
1050
1054
  return;
1051
1055
  const t = this.points[0], e = this.points[this.points.length - 1], i = e.x - t.x, s = e.y - t.y, r = e.time - t.time;
1052
- this.velocity = new I(r === 0 ? 0 : i / (r / 15), r === 0 ? 0 : s / (r / 15)), this.animationFrameId && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0), this.animationFrameId = requestAnimationFrame(this.loop);
1056
+ this.velocity = new L(r === 0 ? 0 : i / (r / 15), r === 0 ? 0 : s / (r / 15)), this.animationFrameId && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0), this.animationFrameId = requestAnimationFrame(this.loop);
1053
1057
  }
1054
1058
  stop() {
1055
1059
  this.animationFrameId && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0), this.points = [];
@@ -1062,18 +1066,18 @@ class q {
1062
1066
  this.lastPoint.x += this.velocity.x, this.lastPoint.y += this.velocity.y, this.velocity.x *= 0.9, this.velocity.y *= 0.9, this.onMotion(this.lastPoint.clone()), this.animationFrameId = requestAnimationFrame(this.loop);
1063
1067
  }
1064
1068
  }
1065
- class Q {
1069
+ class W {
1066
1070
  constructor(t, e, i) {
1067
- this.isStarted = !1, this.pov = t, this.fov = w.degreesToRadians(e), this.orientationMatrix = c.identity(), this.inertia = new q(this.motion.bind(this)), this.onMotion = i, this.initPov = this.pov, this.initFov = this.fov, this.initOrientation = w.degreesToRadians(window.orientation) || 0, this.startPov = new L([0, 0, 1], [0, 0, 0], [0, 1, 0]), this.startSize = { width: 0, height: 0 }, this.previousPoint = new I(0, 0);
1071
+ this.isStarted = !1, this.pov = t, this.fov = w.degreesToRadians(e), this.orientationMatrix = c.identity(), this.inertia = new R(this.motion.bind(this)), this.onMotion = i, this.initPov = this.pov, this.initFov = this.fov, this.initOrientation = w.degreesToRadians(window.orientation) || 0, this.startPov = new S([0, 0, 1], [0, 0, 0], [0, 1, 0]), this.startSize = { width: 0, height: 0 }, this.previousPoint = new L(0, 0);
1068
1072
  }
1069
1073
  destroy() {
1070
1074
  this.inertia.destroy();
1071
1075
  }
1072
1076
  get orientedPov() {
1073
- const t = h.normalize(h.cross(this.pov.up, this.pov.target)), e = new V(t, [0, 1, 0], this.pov.eye), i = c.identity();
1077
+ const t = h.normalize(h.cross(this.pov.up, this.pov.target)), e = new j(t, [0, 1, 0], this.pov.eye), i = c.identity();
1074
1078
  c.multiply(i, e.localToGlobalMatrix, i), c.multiply(i, this.orientationMatrix, i), c.multiply(i, e.globalToLocalMatrix, i);
1075
- const s = c.transformDirection(i, this.pov.target), r = this.pov.eye, n = c.transformDirection(i, this.pov.up);
1076
- return new L(s, r, n);
1079
+ const s = c.transformDirection(i, this.pov.target), r = this.pov.eye, a = c.transformDirection(i, this.pov.up);
1080
+ return new S(s, r, a);
1077
1081
  }
1078
1082
  reset() {
1079
1083
  this.pov = this.initPov.clone(), this.fov = this.initFov;
@@ -1086,20 +1090,20 @@ class Q {
1086
1090
  const e = {
1087
1091
  x: t.x - this.previousPoint.x,
1088
1092
  y: t.y - this.previousPoint.y
1089
- }, i = w.accelerate(e.x, 1.3) / this.startSize.width * 0.2 * Math.PI * 1.5, s = w.accelerate(e.y, 1.3) / this.startSize.height * 0.2 * Math.PI, r = c.multiply(c.rotationY(i), c.rotationX(-s)), n = h.normalize(h.cross(this.pov.up, this.pov.target)), a = new V(n, [0, 1, 0], this.pov.eye), o = c.identity();
1090
- c.multiply(o, a.localToGlobalMatrix, o), c.multiply(o, r, o), c.multiply(o, a.globalToLocalMatrix, o);
1091
- const l = c.transformPoint(o, this.pov.target), u = c.transformDirection(o, this.pov.up);
1092
- h.cross(u, [0, 0, 1])[0] >= 0 && (this.pov.target = l, this.pov.up = u), this.previousPoint = t, this.onMotion();
1093
+ }, i = w.accelerate(e.x, 1.3) / this.startSize.width * 0.2 * Math.PI * 1.5, s = w.accelerate(e.y, 1.3) / this.startSize.height * 0.2 * Math.PI, r = c.multiply(c.rotationY(i), c.rotationX(-s)), a = h.normalize(h.cross(this.pov.up, this.pov.target)), n = new j(a, [0, 1, 0], this.pov.eye), o = c.identity();
1094
+ c.multiply(o, n.localToGlobalMatrix, o), c.multiply(o, r, o), c.multiply(o, n.globalToLocalMatrix, o);
1095
+ const u = c.transformPoint(o, this.pov.target), l = c.transformDirection(o, this.pov.up);
1096
+ h.cross(l, [0, 0, 1])[0] >= 0 && (this.pov.target = u, this.pov.up = l), this.previousPoint = t, this.onMotion();
1093
1097
  }
1094
1098
  end(t, e) {
1095
1099
  this.isStarted = !1, e && (this.inertia.track(t), this.inertia.start());
1096
1100
  }
1097
1101
  orientation(t, e, i) {
1098
- const s = w.degreesToRadians(window.orientation) || 0, r = w.degreesToRadians(t), n = w.degreesToRadians(-e), a = w.degreesToRadians(-i), o = c.rotationX(w.degreesToRadians(90));
1099
- c.rotateZ(o, this.initOrientation, o), c.rotateZ(o, r, o), c.rotateX(o, n, o), c.rotateY(o, a, o), c.rotateZ(o, -s, o), this.orientationMatrix = o, this.onMotion();
1102
+ const s = w.degreesToRadians(window.orientation) || 0, r = w.degreesToRadians(t), a = w.degreesToRadians(-e), n = w.degreesToRadians(-i), o = c.rotationX(w.degreesToRadians(90));
1103
+ c.rotateZ(o, this.initOrientation, o), c.rotateZ(o, r, o), c.rotateX(o, a, o), c.rotateY(o, n, o), c.rotateZ(o, -s, o), this.orientationMatrix = o, this.onMotion();
1100
1104
  }
1101
1105
  }
1102
- var W = `precision mediump float;
1106
+ var _ = `precision mediump float;
1103
1107
 
1104
1108
  uniform float u_mix;
1105
1109
  uniform samplerCube u_texture;
@@ -1111,7 +1115,7 @@ void main() {
1111
1115
  vec4 backColor = textureCube(u_texture_back, direction);
1112
1116
  vec4 color = textureCube(u_texture, direction);
1113
1117
  gl_FragColor = mix(backColor, color, u_mix);
1114
- }`, _ = `attribute vec4 position;
1118
+ }`, K = `attribute vec4 position;
1115
1119
 
1116
1120
  uniform mat4 u_mvpi;
1117
1121
 
@@ -1121,27 +1125,27 @@ void main() {
1121
1125
  direction = (u_mvpi * position).xyz;
1122
1126
  gl_Position = position;
1123
1127
  }`;
1124
- class K {
1125
- constructor(t, e, i, s) {
1126
- this.container = t, this.canvas = e, this.loader = i, this.images = [], this.hotspotsList = [[]];
1127
- const r = new L([0, 0, 1], [0, 0, 0], [0, 1, 0]), n = 60, a = c.rotationX(w.degreesToRadians(15));
1128
- c.transformDirection(a, r.target, r.target), c.transformDirection(a, r.up, r.up), this.interaction = new Q(r, n, () => {
1128
+ class tt {
1129
+ constructor(t, e, i, s, r) {
1130
+ this.container = t, this.canvas = e, this.loader = i, this.aspectRatioOverride = r, this.images = [], this.hotspotsList = [[]];
1131
+ const a = new S([0, 0, 1], [0, 0, 0], [0, 1, 0]), n = 60, o = c.rotationX(w.degreesToRadians(15));
1132
+ c.transformDirection(o, a.target, a.target), c.transformDirection(o, a.up, a.up), this.interaction = new W(a, n, () => {
1129
1133
  this.animationFrameId = requestAnimationFrame(this.render), this.onInteraction({
1130
1134
  pov: this.interaction.pov.clone(),
1131
1135
  fov: this.interaction.fov
1132
1136
  });
1133
- }), this.onInteraction = s, this.gl = this.canvas.context, this.programInfo = P.createProgramInfo(this.gl, [`${_}
1134
- `, `${W}
1135
- `]), this.quad = P.primitives.createXYQuadBufferInfo(this.gl), this.uniforms = {
1137
+ }), this.onInteraction = s, this.gl = this.canvas.context, this.programInfo = M.createProgramInfo(this.gl, [`${K}
1138
+ `, `${_}
1139
+ `]), this.quad = M.primitives.createXYQuadBufferInfo(this.gl), this.uniforms = {
1136
1140
  u_mvpi: c.identity(),
1137
1141
  u_mix: 0,
1138
- u_texture_back: P.createTexture(this.gl, {
1142
+ u_texture_back: M.createTexture(this.gl, {
1139
1143
  target: this.gl.TEXTURE_CUBE_MAP,
1140
1144
  minMag: this.gl.LINEAR,
1141
1145
  width: 1,
1142
1146
  height: 1
1143
1147
  }),
1144
- u_texture: P.createTexture(this.gl, {
1148
+ u_texture: M.createTexture(this.gl, {
1145
1149
  target: this.gl.TEXTURE_CUBE_MAP,
1146
1150
  minMag: this.gl.LINEAR,
1147
1151
  width: 1,
@@ -1176,10 +1180,10 @@ class K {
1176
1180
  const o = this.gl.getExtension("WEBGL_debug_renderer_info");
1177
1181
  o && navigator.platform === "MacIntel" && navigator.userAgent.includes("Chrome") && this.gl.getParameter(o.UNMASKED_RENDERER_WEBGL).includes("OpenGL") && (t.parameters.width = Math.min(t.parameters.width, 1812), t.parameters.height = Math.min(t.parameters.height, 1812));
1178
1182
  }
1179
- const n = JSON.stringify(t);
1180
- n === this.snapshotHash ? r = r.then(() => (this.animationFrameId = requestAnimationFrame(this.render), Promise.resolve())) : (this.images = [], this.animationFrameId = requestAnimationFrame(this.render), r = r.then(
1183
+ const a = JSON.stringify(t);
1184
+ a === this.snapshotHash ? r = r.then(() => (this.animationFrameId = requestAnimationFrame(this.render), Promise.resolve())) : (this.images = [], this.animationFrameId = requestAnimationFrame(this.render), r = r.then(
1181
1185
  () => this.loader.loadVRCubeSnapshot(t).then((o) => {
1182
- this.images = o, P.createTexture(
1186
+ this.images = o, M.createTexture(
1183
1187
  this.gl,
1184
1188
  {
1185
1189
  target: this.gl.TEXTURE_CUBE_MAP,
@@ -1196,49 +1200,49 @@ class K {
1196
1200
  ],
1197
1201
  src: o
1198
1202
  },
1199
- (l, u) => {
1200
- l || (i && this.interaction.reset(), this.uniforms.u_mix = s ? 0 : 1, this.uniforms.u_texture_back = this.uniforms.u_texture, this.uniforms.u_texture = u, this.animationFrameId = requestAnimationFrame(this.render));
1203
+ (u, l) => {
1204
+ u || (i && this.interaction.reset(), this.uniforms.u_mix = s ? 0 : 1, this.uniforms.u_texture_back = this.uniforms.u_texture, this.uniforms.u_texture = l, this.animationFrameId = requestAnimationFrame(this.render));
1201
1205
  }
1202
1206
  );
1203
1207
  })
1204
1208
  ));
1205
- const a = JSON.stringify(e);
1206
- return (n !== this.snapshotHash || a !== this.hotspotsHash) && (e.length ? r = r.then(
1209
+ const n = JSON.stringify(e);
1210
+ return (a !== this.snapshotHash || n !== this.hotspotsHash) && (e.length ? r = r.then(
1207
1211
  () => this.loader.loadVRCubeHotspots(t, e).then((o) => {
1208
1212
  this.hotspotsList = o;
1209
1213
  })
1210
- ) : this.hotspotsList = [[]]), this.hotspotsHash = a, this.snapshotHash = n, r;
1214
+ ) : this.hotspotsList = [[]]), this.hotspotsHash = n, this.snapshotHash = a, r;
1211
1215
  }
1212
1216
  async pick(t, e) {
1213
- const i = this.canvas.element.clientWidth, s = this.canvas.element.clientHeight, r = e.x, n = s - e.y, a = 2 * r / i - 1, o = 2 * n / s - 1, l = [a, o, 0], u = this.modelViewProjectionMatrix, f = c.inverse(u), d = h.normalize(c.transformPoint(f, l)), T = Math.max(Math.abs(d[0]), Math.abs(d[1]), Math.abs(d[2]));
1214
- let F = "";
1215
- Math.abs(d[0]) === T ? F = d[0] > 0 ? "XPOS" : "XNEG" : Math.abs(d[1]) === T ? F = d[1] > 0 ? "YPOS" : "YNEG" : F = d[2] > 0 ? "ZPOS" : "ZNEG";
1216
- let x = 0, M = 0, E = "";
1217
- switch (F) {
1217
+ const i = this.canvas.element.clientWidth, s = this.canvas.element.clientHeight, r = e.x, a = s - e.y, n = 2 * r / i - 1, o = 2 * a / s - 1, u = [n, o, 0], l = this.modelViewProjectionMatrix, p = c.inverse(l), d = h.normalize(c.transformPoint(p, u)), T = Math.max(Math.abs(d[0]), Math.abs(d[1]), Math.abs(d[2]));
1218
+ let A = "";
1219
+ Math.abs(d[0]) === T ? A = d[0] > 0 ? "XPOS" : "XNEG" : Math.abs(d[1]) === T ? A = d[1] > 0 ? "YPOS" : "YNEG" : A = d[2] > 0 ? "ZPOS" : "ZNEG";
1220
+ let x = 0, E = 0, I = "";
1221
+ switch (A) {
1218
1222
  case "XPOS":
1219
- x = (-d[2] / Math.abs(d[0]) + 1) / 2, M = (-d[1] / Math.abs(d[0]) + 1) / 2, E = "right";
1223
+ x = (-d[2] / Math.abs(d[0]) + 1) / 2, E = (-d[1] / Math.abs(d[0]) + 1) / 2, I = "right";
1220
1224
  break;
1221
1225
  case "XNEG":
1222
- x = (d[2] / Math.abs(d[0]) + 1) / 2, M = (-d[1] / Math.abs(d[0]) + 1) / 2, E = "left";
1226
+ x = (d[2] / Math.abs(d[0]) + 1) / 2, E = (-d[1] / Math.abs(d[0]) + 1) / 2, I = "left";
1223
1227
  break;
1224
1228
  case "YPOS":
1225
- x = (d[0] / Math.abs(d[1]) + 1) / 2, M = (d[2] / Math.abs(d[1]) + 1) / 2, E = "up";
1229
+ x = (d[0] / Math.abs(d[1]) + 1) / 2, E = (d[2] / Math.abs(d[1]) + 1) / 2, I = "up";
1226
1230
  break;
1227
1231
  case "YNEG":
1228
- x = (d[0] / Math.abs(d[1]) + 1) / 2, M = (-d[2] / Math.abs(d[1]) + 1) / 2, E = "down";
1232
+ x = (d[0] / Math.abs(d[1]) + 1) / 2, E = (-d[2] / Math.abs(d[1]) + 1) / 2, I = "down";
1229
1233
  break;
1230
1234
  case "ZPOS":
1231
- x = (d[0] / Math.abs(d[2]) + 1) / 2, M = (-d[1] / Math.abs(d[2]) + 1) / 2, E = "front";
1235
+ x = (d[0] / Math.abs(d[2]) + 1) / 2, E = (-d[1] / Math.abs(d[2]) + 1) / 2, I = "front";
1232
1236
  break;
1233
1237
  case "ZNEG":
1234
- x = (-d[0] / Math.abs(d[2]) + 1) / 2, M = (-d[1] / Math.abs(d[2]) + 1) / 2, E = "back";
1238
+ x = (-d[0] / Math.abs(d[2]) + 1) / 2, E = (-d[1] / Math.abs(d[2]) + 1) / 2, I = "back";
1235
1239
  break;
1236
1240
  }
1237
- const O = {
1241
+ const C = {
1238
1242
  x: Math.round(x * Math.max(t.parameters.width, t.parameters.height)),
1239
- y: Math.round(M * Math.max(t.parameters.width, t.parameters.height))
1243
+ y: Math.round(E * Math.max(t.parameters.width, t.parameters.height))
1240
1244
  };
1241
- return this.loader.loadVRCubePick(t, O, E);
1245
+ return this.loader.loadVRCubePick(t, C, I);
1242
1246
  }
1243
1247
  hotspots() {
1244
1248
  const t = [];
@@ -1246,36 +1250,36 @@ class K {
1246
1250
  return [];
1247
1251
  const e = this.hotspotsList[0]?.length ?? 0, i = this.modelViewProjectionMatrix;
1248
1252
  for (let s = 0; s < e; s++) {
1249
- const r = this.hotspotsList.findIndex((R) => R[s].visibility !== "OutOfFrustum");
1253
+ const r = this.hotspotsList.findIndex(($) => $[s].visibility !== "OutOfFrustum");
1250
1254
  if (r === -1)
1251
1255
  continue;
1252
- const n = { ...this.hotspotsList[r][s] }, a = n.position2D.x / this.images[0].width, o = n.position2D.y / this.images[0].height;
1253
- let l = 0, u = 0, f = 0;
1256
+ const a = { ...this.hotspotsList[r][s] }, n = a.position2D.x / this.images[0].width, o = a.position2D.y / this.images[0].height;
1257
+ let u = 0, l = 0, p = 0;
1254
1258
  switch (r) {
1255
1259
  case 0:
1256
- this.pov.target[2] < 0 && (n.visibility = "OutOfFrustum"), l = 2 * a - 1, u = 1 - 2 * o, f = 1;
1260
+ this.pov.target[2] < 0 && (a.visibility = "OutOfFrustum"), u = 2 * n - 1, l = 1 - 2 * o, p = 1;
1257
1261
  break;
1258
1262
  case 1:
1259
- this.pov.target[0] > 0 && (n.visibility = "OutOfFrustum"), l = 1, u = 1 - 2 * o, f = 1 - 2 * a;
1263
+ this.pov.target[0] > 0 && (a.visibility = "OutOfFrustum"), u = 1, l = 1 - 2 * o, p = 1 - 2 * n;
1260
1264
  break;
1261
1265
  case 2:
1262
- this.pov.target[2] > 0 && (n.visibility = "OutOfFrustum"), l = 1 - 2 * a, u = 1 - 2 * o, f = -1;
1266
+ this.pov.target[2] > 0 && (a.visibility = "OutOfFrustum"), u = 1 - 2 * n, l = 1 - 2 * o, p = -1;
1263
1267
  break;
1264
1268
  case 3:
1265
- this.pov.target[0] < 0 && (n.visibility = "OutOfFrustum"), l = -1, u = 1 - 2 * o, f = 2 * a - 1;
1269
+ this.pov.target[0] < 0 && (a.visibility = "OutOfFrustum"), u = -1, l = 1 - 2 * o, p = 2 * n - 1;
1266
1270
  break;
1267
1271
  case 4:
1268
- this.pov.target[1] < 0 && (n.visibility = "OutOfFrustum"), l = 2 * a - 1, u = 1, f = 2 * o - 1;
1272
+ this.pov.target[1] < 0 && (a.visibility = "OutOfFrustum"), u = 2 * n - 1, l = 1, p = 2 * o - 1;
1269
1273
  break;
1270
1274
  case 5:
1271
- this.pov.target[1] > 0 && (n.visibility = "OutOfFrustum"), l = 2 * a - 1, u = -1, f = 1 - 2 * o;
1275
+ this.pov.target[1] > 0 && (a.visibility = "OutOfFrustum"), u = 2 * n - 1, l = -1, p = 1 - 2 * o;
1272
1276
  break;
1273
1277
  }
1274
- const d = h.normalize([l, u, f]), T = c.transformPoint(i, d), F = this.canvas.element.clientWidth, x = this.canvas.element.clientHeight, M = 0.5 * F * (T[0] + 1), E = 0.5 * x * (T[1] + 1), O = {
1275
- x: Math.round(M),
1276
- y: Math.round(x - E)
1277
- }, G = new b(F, x), z = p.contains(G, O) ? n.visibility : "OutOfFrustum";
1278
- t.push({ ...n, position2D: O, visibility: z });
1278
+ const d = h.normalize([u, l, p]), T = c.transformPoint(i, d), A = this.canvas.element.clientWidth, x = this.canvas.element.clientHeight, E = 0.5 * A * (T[0] + 1), I = 0.5 * x * (T[1] + 1), C = {
1279
+ x: Math.round(E),
1280
+ y: Math.round(x - I)
1281
+ }, G = new f(A, x), z = b.contains(G, C) ? a.visibility : "OutOfFrustum";
1282
+ t.push({ ...a, position2D: C, visibility: z });
1279
1283
  }
1280
1284
  return t;
1281
1285
  }
@@ -1283,11 +1287,11 @@ class K {
1283
1287
  return this.canvas.element.toDataURL(t, e);
1284
1288
  }
1285
1289
  get modelViewProjectionMatrix() {
1286
- const t = this.canvas.element.clientWidth, e = this.canvas.element.clientHeight, i = t > e ? t / e : e / t, s = p.getStandardAspectRatio(t, e), r = this.interaction.fov * (s / i), n = c.setAxis(c.identity(), [-1, 0, 0], 0), a = t > e ? w.perspectiveWithFovY(r, t / e, 0.5, 100) : w.perspectiveWithFovX(r, t / e, 0.5, 100), o = this.interaction.orientedPov, l = c.inverse(c.lookAt(o.eye, o.target, o.up));
1287
- return c.multiply(c.multiply(a, l), n);
1290
+ const t = this.canvas.element.clientWidth, e = this.canvas.element.clientHeight, i = t > e ? t / e : e / t, s = b.getStandardAspectRatio(t, e, this.aspectRatioOverride), r = this.interaction.fov * (s / i), a = c.setAxis(c.identity(), [-1, 0, 0], 0), n = t > e ? w.perspectiveWithFovY(r, t / e, 0.5, 100) : w.perspectiveWithFovX(r, t / e, 0.5, 100), o = this.interaction.orientedPov, u = c.inverse(c.lookAt(o.eye, o.target, o.up));
1291
+ return c.multiply(c.multiply(n, u), a);
1288
1292
  }
1289
1293
  render() {
1290
- this.gl.viewport(0, 0, this.gl.canvas.width, this.gl.canvas.height), this.uniforms.u_mvpi = c.inverse(this.modelViewProjectionMatrix), this.gl.useProgram(this.programInfo.program), P.setBuffersAndAttributes(this.gl, this.programInfo, this.quad), P.setUniforms(this.programInfo, this.uniforms), P.drawBufferInfo(this.gl, this.quad), this.uniforms.u_mix < 1 && (this.uniforms.u_mix = Math.min(this.uniforms.u_mix + 0.05, 1), this.animationFrameId = requestAnimationFrame(this.render));
1294
+ this.gl.viewport(0, 0, this.gl.canvas.width, this.gl.canvas.height), this.uniforms.u_mvpi = c.inverse(this.modelViewProjectionMatrix), this.gl.useProgram(this.programInfo.program), M.setBuffersAndAttributes(this.gl, this.programInfo, this.quad), M.setUniforms(this.programInfo, this.uniforms), M.drawBufferInfo(this.gl, this.quad), this.uniforms.u_mix < 1 && (this.uniforms.u_mix = Math.min(this.uniforms.u_mix + 0.05, 1), this.animationFrameId = requestAnimationFrame(this.render));
1291
1295
  }
1292
1296
  onMouseDown(t) {
1293
1297
  this.container.classList.add("ls-viewer-container-vrcube-grabbing"), this.interaction.start(y.pointFromMouseEvent(t), {
@@ -1320,9 +1324,9 @@ class K {
1320
1324
  this.interaction.orientation(t.alpha, t.beta, t.gamma);
1321
1325
  }
1322
1326
  }
1323
- class tt {
1327
+ class et {
1324
1328
  constructor(t, e, i, s, r) {
1325
- this.isStarted = !1, this.position = t, this.frames = e, this.rows = i, this.loop = s, this.onMotion = r, this.inertia = new q(this.motion.bind(this)), this.initPosition = { ...this.position }, this.startPosition = { x: 0, y: 0 }, this.startPoint = new I(0, 0), this.startSize = { width: 0, height: 0 }, this.lastPoints = [], this.lastPointsNumber = 20;
1329
+ this.isStarted = !1, this.position = t, this.frames = e, this.rows = i, this.loop = s, this.onMotion = r, this.inertia = new R(this.motion.bind(this)), this.initPosition = { ...this.position }, this.startPosition = { x: 0, y: 0 }, this.startPoint = new L(0, 0), this.startSize = { width: 0, height: 0 }, this.lastPoints = [], this.lastPointsNumber = 20;
1326
1330
  }
1327
1331
  destroy() {
1328
1332
  this.inertia.destroy();
@@ -1344,19 +1348,19 @@ class tt {
1344
1348
  }
1345
1349
  motion(t) {
1346
1350
  this.isStarted && this.inertia.track(t), this.lastPoints.push({ x: t.x, y: t.y }), this.lastPoints.splice(0, this.lastPoints.length - this.lastPointsNumber);
1347
- const e = $.linear(this.lastPoints.map((s) => [s.x, s.y])), i = 25;
1351
+ const e = U.linear(this.lastPoints.map((s) => [s.x, s.y])), i = 25;
1348
1352
  if (Math.abs(e.equation[0]) < 1) {
1349
1353
  const s = w.accelerate(t.x - this.startPoint.x, 1.3) / this.startSize.width * (this.frames / 4);
1350
1354
  let r = this.startPosition.x - Math.round(s);
1351
1355
  r = this.loop ? w.mod(r, this.frames) : Math.max(0, Math.min(r, this.frames - 1)), r !== this.position.x && (this.position.x = r, this.onMotion());
1352
- const n = Math.min(...this.lastPoints.map((o) => o.x));
1353
- Math.max(...this.lastPoints.map((o) => o.x)) - n > i && (this.startPoint.y = t.y, this.startPosition.y = this.position.y);
1356
+ const a = Math.min(...this.lastPoints.map((o) => o.x));
1357
+ Math.max(...this.lastPoints.map((o) => o.x)) - a > i && (this.startPoint.y = t.y, this.startPosition.y = this.position.y);
1354
1358
  } else {
1355
1359
  const s = w.accelerate(t.y - this.startPoint.y, 1.7) / this.startSize.height * (this.rows / 4);
1356
1360
  let r = this.startPosition.y + Math.round(s);
1357
1361
  r = Math.max(0, Math.min(r, this.rows - 1)), r !== this.position.y && (this.position.y = r, this.onMotion());
1358
- const n = Math.min(...this.lastPoints.map((o) => o.y));
1359
- Math.max(...this.lastPoints.map((o) => o.y)) - n > i && (this.startPoint.x = t.x, this.startPosition.x = this.position.x);
1362
+ const a = Math.min(...this.lastPoints.map((o) => o.y));
1363
+ Math.max(...this.lastPoints.map((o) => o.y)) - a > i && (this.startPoint.x = t.x, this.startPosition.x = this.position.x);
1360
1364
  }
1361
1365
  }
1362
1366
  end(t, e) {
@@ -1365,7 +1369,7 @@ class tt {
1365
1369
  }
1366
1370
  class k {
1367
1371
  constructor(t, e, i, s) {
1368
- this.container = t, this.canvas = e, this.loader = i, this.images = [], this.frames = 24, this.hotspotsList = [[]], this.interaction = new tt({ x: 0, y: 0 }, 1, 1, !1, () => {
1372
+ this.container = t, this.canvas = e, this.loader = i, this.images = [], this.frames = 24, this.hotspotsList = [[]], this.interaction = new et({ x: 0, y: 0 }, 1, 1, !1, () => {
1369
1373
  this.canvas.draw(this.image, !0, 0.5), this.onInteraction({
1370
1374
  position: this.interaction.positionIndex
1371
1375
  });
@@ -1406,31 +1410,31 @@ class k {
1406
1410
  async load(t, e, i, s) {
1407
1411
  let r = Promise.resolve();
1408
1412
  i && this.interaction.reset();
1409
- const n = JSON.stringify(t);
1410
- n === this.snapshotHash && this.image ? r = r.then(() => this.canvas.draw(this.image, s, 0.05)) : (this.images = [], r = r.then(
1413
+ const a = JSON.stringify(t);
1414
+ a === this.snapshotHash && this.image ? r = r.then(() => this.canvas.draw(this.image, s, 0.05)) : (this.images = [], r = r.then(
1411
1415
  () => this.loader.loadVRObjectSnapshot(t, this.interaction.positionIndex).then((o) => {
1412
- const l = o.length;
1413
- return this.images = new Array(l), this.interaction.frames = t.view.frames ?? t.view.panFrames ?? this.frames, this.interaction.rows = l / this.interaction.frames, this.interaction.loop = !!t.view.loop, i && this.interaction.reset(), o.forEach((u, f) => {
1414
- u.then((d) => {
1415
- this.images[f] = d, d === this.image && this.canvas.draw(this.image, s, 0.05);
1416
+ const u = o.length;
1417
+ return this.images = new Array(u), this.interaction.frames = t.view.frames ?? t.view.panFrames ?? this.frames, this.interaction.rows = u / this.interaction.frames, this.interaction.loop = !!t.view.loop, i && this.interaction.reset(), o.forEach((l, p) => {
1418
+ l.then((d) => {
1419
+ this.images[p] = d, d === this.image && this.canvas.draw(this.image, s, 0.05);
1416
1420
  }).catch(() => {
1417
1421
  });
1418
1422
  }), o[this.interaction.positionIndex].then(() => Promise.resolve());
1419
1423
  })
1420
1424
  ));
1421
- const a = JSON.stringify(e);
1422
- return (n !== this.snapshotHash || a !== this.hotspotsHash) && (e.length ? r = r.then(
1425
+ const n = JSON.stringify(e);
1426
+ return (a !== this.snapshotHash || n !== this.hotspotsHash) && (e.length ? r = r.then(
1423
1427
  () => this.loader.loadVRObjectHotspots(t, e).then((o) => {
1424
1428
  this.hotspotsList = o;
1425
1429
  })
1426
- ) : this.hotspotsList = [[]]), this.hotspotsHash = a, this.snapshotHash = n, r;
1430
+ ) : this.hotspotsList = [[]]), this.hotspotsHash = n, this.snapshotHash = a, r;
1427
1431
  }
1428
1432
  async pick(t, e) {
1429
- const i = new b(t.parameters.width, t.parameters.height), s = p.unproject(i, this.canvas.resolution, this.canvas.fit, e);
1433
+ const i = new f(t.parameters.width, t.parameters.height), s = b.unproject(i, this.canvas.resolution, this.canvas.fit, e);
1430
1434
  return this.loader.loadVRObjectPick(t, s, this.position, this.frames);
1431
1435
  }
1432
1436
  hotspots(t) {
1433
- return (this.hotspotsList[this.interaction.positionIndex] || []).map((i) => ({ ...i, position2D: p.project(t, this.canvas.resolution, this.canvas.fit, i.position2D) })).map((i) => ({ ...i, visibility: p.contains(this.canvas.resolution, i.position2D) ? i.visibility : "OutOfFrustum" }));
1437
+ return (this.hotspotsList[this.interaction.positionIndex] || []).map((i) => ({ ...i, position2D: b.project(t, this.canvas.resolution, this.canvas.fit, i.position2D) })).map((i) => ({ ...i, visibility: b.contains(this.canvas.resolution, i.position2D) ? i.visibility : "OutOfFrustum" }));
1434
1438
  }
1435
1439
  snapshot(t, e) {
1436
1440
  return this.canvas.element.toDataURL(t, e);
@@ -1465,7 +1469,7 @@ class k {
1465
1469
  onDeviceOrientation(t) {
1466
1470
  }
1467
1471
  }
1468
- class et {
1472
+ class it {
1469
1473
  constructor(t, e, i) {
1470
1474
  this.container = t, this.loader = i, this.video = e;
1471
1475
  }
@@ -1549,7 +1553,7 @@ class nt {
1549
1553
  onHotspotsChange: () => {
1550
1554
  },
1551
1555
  ...e.events
1552
- }, this.options.events.onLoadError = C(this.options.events.onLoadError, 10), this.container = t, this.container.classList.add("ls-viewer-container"), this.containerWidth = 0, this.containerHeight = 0, this.canvas2D = new U(this.options.fit), this.container.prepend(this.canvas2D.element), this.canvas3D = new N(), this.container.prepend(this.canvas3D.element), this.video = new Y(), this.container.prepend(this.video.element), this.loader = new D(this.options.server, this.options.api, this), this.resolution = new b(0, 0), this.parameters = {
1556
+ }, this.options.events.onLoadError = D(this.options.events.onLoadError, 10), this.container = t, this.container.classList.add("ls-viewer-container"), this.containerWidth = 0, this.containerHeight = 0, this.canvas2D = new N(this.options.fit), this.container.prepend(this.canvas2D.element), this.canvas3D = new B(), this.container.prepend(this.canvas3D.element), this.video = new J(), this.container.prepend(this.video.element), this.loader = new V(this.options.server, this.options.api, this), this.resolution = new f(0, 0), this.parameters = {
1553
1557
  width: 0,
1554
1558
  height: 0,
1555
1559
  antialiasing: !1,
@@ -1557,7 +1561,7 @@ class nt {
1557
1561
  }, this.encoder = {
1558
1562
  format: "jpeg",
1559
1563
  quality: 80
1560
- }, this.hotspots = [], this.widgetImage = new J(t, this.canvas2D, this.loader), this.widgetVideo = new et(t, this.video, this.loader), this.widgetVRObject = new k(t, this.canvas2D, this.loader, this.onVrobjectInteraction), this.canvas3D.context && (this.widgetVRCube = new K(t, this.canvas3D, this.loader, this.onVrcubeInteraction)), this.widget = this.widgetImage, this.isDestroyed = !1, this.container.addEventListener("mousedown", this.onMouseDown), this.container.addEventListener("mouseenter", this.onMouseEnter), this.container.addEventListener("touchstart", this.onTouchStart), document.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), document.addEventListener("touchend", this.onTouchEnd), this.loadWidget = C(this.loadWidget, 10), this.onResize = C(this.onResize, 250), requestAnimationFrame(this.checkResize);
1564
+ }, this.hotspots = [], this.widgetImage = new Q(t, this.canvas2D, this.loader), this.widgetVideo = new it(t, this.video, this.loader), this.widgetVRObject = new k(t, this.canvas2D, this.loader, this.onVrobjectInteraction), this.canvas3D.context && (this.widgetVRCube = new tt(t, this.canvas3D, this.loader, this.onVrcubeInteraction, this.aspectRatioOverride)), this.widget = this.widgetImage, this.isDestroyed = !1, this.container.addEventListener("mousedown", this.onMouseDown), this.container.addEventListener("mouseenter", this.onMouseEnter), this.container.addEventListener("touchstart", this.onTouchStart), document.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), document.addEventListener("touchend", this.onTouchEnd), this.loadWidget = D(this.loadWidget, 10), this.onResize = D(this.onResize, 250), requestAnimationFrame(this.checkResize);
1561
1565
  }
1562
1566
  destroy() {
1563
1567
  this.canvas2D.destroy(), this.container.removeEventListener("mousedown", this.onMouseDown), this.container.removeEventListener("mouseenter", this.onMouseEnter), this.container.removeEventListener("touchstart", this.onTouchStart), document.removeEventListener("mousemove", this.onMouseMove), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("touchmove", this.onTouchMove), document.removeEventListener("touchend", this.onTouchEnd), this.isDestroyed = !0;
@@ -1576,7 +1580,7 @@ class nt {
1576
1580
  }), e;
1577
1581
  }
1578
1582
  setParameters(t) {
1579
- t.width && t.height && (this.resolution = new b(t.width, t.height)), this.parameters = { ...t }, this.parameters.width = this.resolution.width, this.parameters.height = this.resolution.height;
1583
+ t.width && t.height && (this.resolution = new f(t.width, t.height)), this.parameters = { ...t }, this.parameters.width = this.resolution.width, this.parameters.height = this.resolution.height;
1580
1584
  let e = Promise.resolve();
1581
1585
  return e = e.then(() => this.loadWidget(!1, !0)), e.catch((i) => {
1582
1586
  this.onLoadError(i);
@@ -1663,6 +1667,16 @@ class nt {
1663
1667
  this.widget.hide(), this.widget = i, this.widget.show(), this.widgetVideo.hide(), this.onHotspotsChange();
1664
1668
  });
1665
1669
  }
1670
+ get aspectRatioOverride() {
1671
+ switch (this.options.aspectRatio) {
1672
+ case "4:3":
1673
+ return 4 / 3;
1674
+ case "16:9":
1675
+ return 16 / 9;
1676
+ default:
1677
+ return;
1678
+ }
1679
+ }
1666
1680
  get viewWidget() {
1667
1681
  switch (this.view?.mode) {
1668
1682
  case "image":
@@ -1709,7 +1723,7 @@ class nt {
1709
1723
  }
1710
1724
  onResize() {
1711
1725
  const t = this.container.clientWidth, e = this.container.clientHeight;
1712
- this.options.autores && (this.resolution = p.getStandardResolution(t * window.devicePixelRatio, e * window.devicePixelRatio), this.parameters.width = this.resolution.width, this.parameters.height = this.resolution.height), this.canvas2D.resize(t, e, window.devicePixelRatio), this.canvas3D.resize(t, e, window.devicePixelRatio), this.video.resize(t, e, this.resolution, this.options.fit), this.loadWidget(!1, !1).then(() => {
1726
+ this.options.autores && (this.resolution = b.getStandardResolution(t * window.devicePixelRatio, e * window.devicePixelRatio, this.aspectRatioOverride), this.parameters.width = this.resolution.width, this.parameters.height = this.resolution.height), this.canvas2D.resize(t, e, window.devicePixelRatio), this.canvas3D.resize(t, e, window.devicePixelRatio), this.video.resize(t, e, this.resolution, this.options.fit), this.loadWidget(!1, !1).then(() => {
1713
1727
  this.onHotspotsChange();
1714
1728
  }).catch((i) => {
1715
1729
  this.onLoadError(i);
@@ -1738,7 +1752,7 @@ class nt {
1738
1752
  this.container.classList.remove("ls-viewer-container-loading"), this.options.events.onLoadError(...t);
1739
1753
  }
1740
1754
  }
1741
- var j;
1755
+ var q;
1742
1756
  ((v) => {
1743
1757
  ((t) => {
1744
1758
  t.Visible = "Visible", t.Occluded = "Occluded", t.Clipped = "Clipped", t.OutOfFrustum = "OutOfFrustum";
@@ -1751,12 +1765,12 @@ var j;
1751
1765
  })(v.SunUseCaseMode || (v.SunUseCaseMode = {})), ((t) => {
1752
1766
  t.ShowOnly = "showOnly", t.HideOnly = "hideOnly";
1753
1767
  })(v.SurfacesFilterMode || (v.SurfacesFilterMode = {}));
1754
- })(j || (j = {}));
1768
+ })(q || (q = {}));
1755
1769
  export {
1756
1770
  nt as Viewer,
1757
- j as WRAPIv2,
1758
- J as WidgetImage,
1759
- K as WidgetVRCube,
1771
+ q as WRAPIv2,
1772
+ Q as WidgetImage,
1773
+ tt as WidgetVRCube,
1760
1774
  k as WidgetVRObject,
1761
- et as WidgetVideo
1775
+ it as WidgetVideo
1762
1776
  };