js-cloudimage-360-view 4.2.0 → 4.3.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.
@@ -1,105 +1,105 @@
1
- var ti = Object.defineProperty;
2
- var ei = (e, t, i) => t in e ? ti(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
- var le = (e, t, i) => ei(e, typeof t != "symbol" ? t + "" : t, i);
4
- var Mt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function ii(e) {
1
+ var ni = Object.defineProperty;
2
+ var ri = (e, t, i) => t in e ? ni(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
+ var de = (e, t, i) => ri(e, typeof t != "symbol" ? t + "" : t, i);
4
+ var Rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
+ function ai(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var Ze = "Expected a function", ce = NaN, si = "[object Symbol]", oi = /^\s+|\s+$/g, ni = /^[-+]0x[0-9a-f]+$/i, ri = /^0b[01]+$/i, ai = /^0o[0-7]+$/i, li = parseInt, ci = typeof Mt == "object" && Mt && Mt.Object === Object && Mt, hi = typeof self == "object" && self && self.Object === Object && self, di = ci || hi || Function("return this")(), ui = Object.prototype, pi = ui.toString, fi = Math.max, mi = Math.min, Kt = function() {
9
- return di.Date.now();
8
+ var Ve = "Expected a function", ue = NaN, li = "[object Symbol]", ci = /^\s+|\s+$/g, hi = /^[-+]0x[0-9a-f]+$/i, di = /^0b[01]+$/i, ui = /^0o[0-7]+$/i, pi = parseInt, mi = typeof Rt == "object" && Rt && Rt.Object === Object && Rt, fi = typeof self == "object" && self && self.Object === Object && self, vi = mi || fi || Function("return this")(), gi = Object.prototype, yi = gi.toString, bi = Math.max, wi = Math.min, Kt = function() {
9
+ return vi.Date.now();
10
10
  };
11
- function vi(e, t, i) {
12
- var s, o, n, l, r, a, c = 0, h = !1, p = !1, f = !0;
11
+ function Ii(e, t, i) {
12
+ var s, o, n, l, r, a, c = 0, h = !1, u = !1, f = !0;
13
13
  if (typeof e != "function")
14
- throw new TypeError(Ze);
15
- t = he(t) || 0, Bt(i) && (h = !!i.leading, p = "maxWait" in i, n = p ? fi(he(i.maxWait) || 0, t) : n, f = "trailing" in i ? !!i.trailing : f);
16
- function u(y) {
17
- var O = s, S = o;
18
- return s = o = void 0, c = y, l = e.apply(S, O), l;
14
+ throw new TypeError(Ve);
15
+ t = pe(t) || 0, Wt(i) && (h = !!i.leading, u = "maxWait" in i, n = u ? bi(pe(i.maxWait) || 0, t) : n, f = "trailing" in i ? !!i.trailing : f);
16
+ function p(m) {
17
+ var g = s, x = o;
18
+ return s = o = void 0, c = m, l = e.apply(x, g), l;
19
19
  }
20
- function I(y) {
21
- return c = y, r = setTimeout(m, t), h ? u(y) : l;
20
+ function I(m) {
21
+ return c = m, r = setTimeout(O, t), h ? p(m) : l;
22
22
  }
23
- function g(y) {
24
- var O = y - a, S = y - c, E = t - O;
25
- return p ? mi(E, n - S) : E;
23
+ function b(m) {
24
+ var g = m - a, x = m - c, A = t - g;
25
+ return u ? wi(A, n - x) : A;
26
26
  }
27
- function v(y) {
28
- var O = y - a, S = y - c;
29
- return a === void 0 || O >= t || O < 0 || p && S >= n;
27
+ function v(m) {
28
+ var g = m - a, x = m - c;
29
+ return a === void 0 || g >= t || g < 0 || u && x >= n;
30
30
  }
31
- function m() {
32
- var y = Kt();
33
- if (v(y))
34
- return b(y);
35
- r = setTimeout(m, g(y));
31
+ function O() {
32
+ var m = Kt();
33
+ if (v(m))
34
+ return E(m);
35
+ r = setTimeout(O, b(m));
36
36
  }
37
- function b(y) {
38
- return r = void 0, f && s ? u(y) : (s = o = void 0, l);
37
+ function E(m) {
38
+ return r = void 0, f && s ? p(m) : (s = o = void 0, l);
39
39
  }
40
- function x() {
40
+ function w() {
41
41
  r !== void 0 && clearTimeout(r), c = 0, s = a = o = r = void 0;
42
42
  }
43
- function w() {
44
- return r === void 0 ? l : b(Kt());
43
+ function y() {
44
+ return r === void 0 ? l : E(Kt());
45
45
  }
46
46
  function C() {
47
- var y = Kt(), O = v(y);
48
- if (s = arguments, o = this, a = y, O) {
47
+ var m = Kt(), g = v(m);
48
+ if (s = arguments, o = this, a = m, g) {
49
49
  if (r === void 0)
50
50
  return I(a);
51
- if (p)
52
- return r = setTimeout(m, t), u(a);
51
+ if (u)
52
+ return r = setTimeout(O, t), p(a);
53
53
  }
54
- return r === void 0 && (r = setTimeout(m, t)), l;
54
+ return r === void 0 && (r = setTimeout(O, t)), l;
55
55
  }
56
- return C.cancel = x, C.flush = w, C;
56
+ return C.cancel = w, C.flush = y, C;
57
57
  }
58
- function gi(e, t, i) {
58
+ function xi(e, t, i) {
59
59
  var s = !0, o = !0;
60
60
  if (typeof e != "function")
61
- throw new TypeError(Ze);
62
- return Bt(i) && (s = "leading" in i ? !!i.leading : s, o = "trailing" in i ? !!i.trailing : o), vi(e, t, {
61
+ throw new TypeError(Ve);
62
+ return Wt(i) && (s = "leading" in i ? !!i.leading : s, o = "trailing" in i ? !!i.trailing : o), Ii(e, t, {
63
63
  leading: s,
64
64
  maxWait: t,
65
65
  trailing: o
66
66
  });
67
67
  }
68
- function Bt(e) {
68
+ function Wt(e) {
69
69
  var t = typeof e;
70
70
  return !!e && (t == "object" || t == "function");
71
71
  }
72
- function yi(e) {
72
+ function Ci(e) {
73
73
  return !!e && typeof e == "object";
74
74
  }
75
- function bi(e) {
76
- return typeof e == "symbol" || yi(e) && pi.call(e) == si;
75
+ function Oi(e) {
76
+ return typeof e == "symbol" || Ci(e) && yi.call(e) == li;
77
77
  }
78
- function he(e) {
78
+ function pe(e) {
79
79
  if (typeof e == "number")
80
80
  return e;
81
- if (bi(e))
82
- return ce;
83
- if (Bt(e)) {
81
+ if (Oi(e))
82
+ return ue;
83
+ if (Wt(e)) {
84
84
  var t = typeof e.valueOf == "function" ? e.valueOf() : e;
85
- e = Bt(t) ? t + "" : t;
85
+ e = Wt(t) ? t + "" : t;
86
86
  }
87
87
  if (typeof e != "string")
88
88
  return e === 0 ? e : +e;
89
- e = e.replace(oi, "");
90
- var i = ri.test(e);
91
- return i || ai.test(e) ? li(e.slice(2), i ? 2 : 8) : ni.test(e) ? ce : +e;
89
+ e = e.replace(ci, "");
90
+ var i = di.test(e);
91
+ return i || ui.test(e) ? pi(e.slice(2), i ? 2 : 8) : hi.test(e) ? ue : +e;
92
92
  }
93
- var wi = gi;
94
- const de = /* @__PURE__ */ ii(wi), M = {
93
+ var Ei = xi;
94
+ const me = /* @__PURE__ */ ai(Ei), R = {
95
95
  SPIN_X: "spin-x",
96
96
  SPIN_Y: "spin-y",
97
97
  SPIN_XY: "spin-xy",
98
98
  SPIN_YX: "spin-yx"
99
- }, Ii = [!1, 0, null, void 0, "false", "0", "null", "undefined"], P = {
99
+ }, Ai = [!1, 0, null, void 0, "false", "0", "null", "undefined"], Y = {
100
100
  X: "x-axis",
101
101
  Y: "y-axis"
102
- }, xi = [37, 39], Ci = [38, 40], ue = 10, Oi = 150, pe = 800, Ei = 150, Si = 200, fe = 50, Ai = 50, Li = 5, me = 5, ki = "https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg", d = {
102
+ }, ki = [37, 39], Si = [38, 40], Ti = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), fe = Ti ? 32 : 10, Li = 150, Ht = 800, Pi = 150, Mi = 200, ve = 50, Yi = 50, Xi = 5, ge = 5, Ri = "https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg", d = {
103
103
  folder: "/",
104
104
  apiVersion: "v7",
105
105
  filenameX: "image-{index}.jpg",
@@ -116,10 +116,11 @@ const de = /* @__PURE__ */ ii(wi), M = {
116
116
  keys: !1,
117
117
  keysReverse: !1,
118
118
  autoplay: !1,
119
- autoplayBehavior: M.SPIN_X,
119
+ autoplayBehavior: R.SPIN_X,
120
120
  playOnce: !1,
121
121
  autoplayReverse: !1,
122
122
  pointerZoom: 0,
123
+ pointerZoomTrigger: "dblclick",
123
124
  fullscreen: !1,
124
125
  magnifier: null,
125
126
  bottomCircle: !0,
@@ -133,8 +134,9 @@ const de = /* @__PURE__ */ ii(wi), M = {
133
134
  imageInfo: !1,
134
135
  initialIconShown: !0,
135
136
  hotspots: null,
137
+ hotspotTrigger: "hover",
136
138
  hide360Logo: !1,
137
- logoSrc: ki,
139
+ logoSrc: Ri,
138
140
  inertia: !1,
139
141
  pinchZoom: !0,
140
142
  hints: !0,
@@ -153,58 +155,60 @@ const de = /* @__PURE__ */ ii(wi), M = {
153
155
  onZoomOut: null,
154
156
  onDragStart: null,
155
157
  onDragEnd: null
156
- }, Ti = (e) => ({
157
- folder: L(e, "folder", d.folder),
158
- apiVersion: L(e, "api-version", d.apiVersion),
159
- filenameX: L(e, "filename") || L(e, "filename-x") || d.filenameX,
160
- filenameY: L(e, "filename-y", d.filenameY),
161
- imageListX: L(e, "image-list-x", d.imageListX),
162
- imageListY: L(e, "image-list-y", d.imageListY),
163
- indexZeroBase: parseInt(L(e, "index-zero-base", d.indexZeroBase), 10),
164
- amountX: parseInt(L(e, "amount-x", d.amountX), 10),
165
- amountY: parseInt(L(e, "amount-y", d.amountY), 10),
166
- speed: parseInt(L(e, "speed", d.speed), 10),
167
- dragSpeed: parseInt(L(e, "drag-speed", d.dragSpeed), 10),
168
- draggable: X(e, "draggable", d.draggable),
169
- swipeable: X(e, "swipeable", d.swipeable),
170
- keys: X(e, "keys", d.keys),
171
- keysReverse: X(e, "keys-reverse", d.keysReverse),
172
- autoplay: X(e, "autoplay", d.autoplay),
173
- autoplayBehavior: L(e, "autoplay-behavior", d.autoplayBehavior),
174
- playOnce: X(e, "play-once", d.playOnce),
175
- autoplayReverse: X(e, "autoplay-reverse", d.autoplayReverse),
176
- pointerZoom: parseFloat(L(e, "pointer-zoom", d.pointerZoom)),
177
- fullscreen: X(e, "fullscreen") || X(e, "full-screen", d.fullscreen),
178
- magnifier: parseFloat(L(e, "magnifier", d.magnifier)),
158
+ }, Hi = (e) => ({
159
+ folder: S(e, "folder", d.folder),
160
+ apiVersion: S(e, "api-version", d.apiVersion),
161
+ filenameX: S(e, "filename") || S(e, "filename-x") || d.filenameX,
162
+ filenameY: S(e, "filename-y", d.filenameY),
163
+ imageListX: S(e, "image-list-x", d.imageListX),
164
+ imageListY: S(e, "image-list-y", d.imageListY),
165
+ indexZeroBase: parseInt(S(e, "index-zero-base", d.indexZeroBase), 10),
166
+ amountX: parseInt(S(e, "amount-x", d.amountX), 10),
167
+ amountY: parseInt(S(e, "amount-y", d.amountY), 10),
168
+ speed: parseInt(S(e, "speed", d.speed), 10),
169
+ dragSpeed: parseInt(S(e, "drag-speed", d.dragSpeed), 10),
170
+ draggable: M(e, "draggable", d.draggable),
171
+ swipeable: M(e, "swipeable", d.swipeable),
172
+ keys: M(e, "keys", d.keys),
173
+ keysReverse: M(e, "keys-reverse", d.keysReverse),
174
+ autoplay: M(e, "autoplay", d.autoplay),
175
+ autoplayBehavior: S(e, "autoplay-behavior", d.autoplayBehavior),
176
+ playOnce: M(e, "play-once", d.playOnce),
177
+ autoplayReverse: M(e, "autoplay-reverse", d.autoplayReverse),
178
+ pointerZoom: parseFloat(S(e, "pointer-zoom", d.pointerZoom)),
179
+ pointerZoomTrigger: S(e, "pointer-zoom-trigger", d.pointerZoomTrigger),
180
+ fullscreen: M(e, "fullscreen") || M(e, "full-screen", d.fullscreen),
181
+ magnifier: parseFloat(S(e, "magnifier", d.magnifier)),
179
182
  bottomCircleOffset: parseInt(
180
- L(e, "bottom-circle-offset", d.bottomCircleOffset),
183
+ S(e, "bottom-circle-offset", d.bottomCircleOffset),
181
184
  10
182
185
  ),
183
- ciToken: L(e, "responsive", d.ciToken),
184
- ciFilters: L(e, "filters", d.ciFilters),
185
- ciTransformation: L(e, "transformation", d.ciTransformation),
186
- lazyload: X(e, "lazyload", d.lazyload),
187
- dragReverse: X(e, "drag-reverse", d.dragReverse),
188
- stopAtEdges: X(e, "stop-at-edges", d.stopAtEdges),
189
- imageInfo: X(e, "info", d.imageInfo),
190
- initialIconShown: !Ht(e, "initial-icon"),
191
- bottomCircle: !Ht(e, "bottom-circle"),
192
- hide360Logo: X(e, "hide-360-logo", d.hide360Logo),
193
- logoSrc: L(e, "logo-src", d.logoSrc),
194
- inertia: X(e, "inertia", d.inertia),
195
- pinchZoom: X(e, "pinch-zoom", d.pinchZoom),
196
- hints: !Ht(e, "hints"),
197
- theme: L(e, "theme", d.theme),
198
- hotspotTimelineOnClick: !Ht(e, "hotspot-timeline-on-click"),
199
- aspectRatio: L(e, "aspect-ratio", d.aspectRatio)
200
- }), Yi = (e) => {
186
+ ciToken: S(e, "responsive", d.ciToken),
187
+ ciFilters: S(e, "filters", d.ciFilters),
188
+ ciTransformation: S(e, "transformation", d.ciTransformation),
189
+ lazyload: M(e, "lazyload", d.lazyload),
190
+ dragReverse: M(e, "drag-reverse", d.dragReverse),
191
+ stopAtEdges: M(e, "stop-at-edges", d.stopAtEdges),
192
+ imageInfo: M(e, "info", d.imageInfo),
193
+ initialIconShown: !Zt(e, "initial-icon"),
194
+ bottomCircle: !Zt(e, "bottom-circle"),
195
+ hide360Logo: M(e, "hide-360-logo", d.hide360Logo),
196
+ logoSrc: S(e, "logo-src", d.logoSrc),
197
+ inertia: M(e, "inertia", d.inertia),
198
+ pinchZoom: M(e, "pinch-zoom", d.pinchZoom),
199
+ hints: !Zt(e, "hints"),
200
+ theme: S(e, "theme", d.theme),
201
+ hotspotTrigger: S(e, "hotspot-trigger", d.hotspotTrigger),
202
+ hotspotTimelineOnClick: !Zt(e, "hotspot-timeline-on-click"),
203
+ aspectRatio: S(e, "aspect-ratio", d.aspectRatio)
204
+ }), Zi = (e) => {
201
205
  const t = [];
202
206
  e.amountX !== void 0 && e.amountX < 0 && t.push("amountX should be a positive number"), e.amountY !== void 0 && e.amountY < 0 && t.push("amountY should be a positive number"), e.speed !== void 0 && e.speed <= 0 && t.push("speed should be a positive number"), e.dragSpeed !== void 0 && e.dragSpeed <= 0 && t.push("dragSpeed should be a positive number"), e.pointerZoom !== void 0 && e.pointerZoom !== 0 && (e.pointerZoom < 1 || e.pointerZoom > 5) && t.push("pointerZoom should be between 1 and 5 (or 0 to disable)"), e.magnifier !== void 0 && e.magnifier !== null && e.magnifier !== 0 && (e.magnifier < 1 || e.magnifier > 5) && t.push("magnifier should be between 1 and 5 (or 0/null to disable)"), !e.folder && !e.imageListX && !e.imageListY && t.push("Either folder or imageListX/imageListY is required"), e.folder && !e.amountX && !e.imageListX && t.push("amountX is required when using folder (unless imageListX is provided)");
203
207
  const i = ["spin-x", "spin-y", "spin-xy", "spin-yx"];
204
208
  return e.autoplayBehavior && !i.includes(e.autoplayBehavior) && t.push(`autoplayBehavior should be one of: ${i.join(", ")}`), t.forEach((s) => {
205
209
  console.warn(`CloudImage 360: ${s}`);
206
210
  }), t.length === 0;
207
- }, Xi = (e) => (Yi(e), {
211
+ }, Di = (e) => (Zi(e), {
208
212
  folder: e.folder || d.folder,
209
213
  apiVersion: e.apiVersion || d.apiVersion,
210
214
  filenameX: e.filenameX || e.filename || d.filenameX,
@@ -225,6 +229,7 @@ const de = /* @__PURE__ */ ii(wi), M = {
225
229
  playOnce: e.playOnce ?? d.playOnce,
226
230
  autoplayReverse: e.autoplayReverse ?? d.autoplayReverse,
227
231
  pointerZoom: parseFloat(e.pointerZoom ?? d.pointerZoom),
232
+ pointerZoomTrigger: e.pointerZoomTrigger || d.pointerZoomTrigger,
228
233
  fullscreen: e.fullscreen ?? d.fullscreen,
229
234
  magnifier: parseFloat(e.magnifier ?? d.magnifier),
230
235
  bottomCircleOffset: parseInt(e.bottomCircleOffset ?? d.bottomCircleOffset, 10),
@@ -238,6 +243,7 @@ const de = /* @__PURE__ */ ii(wi), M = {
238
243
  initialIconShown: e.initialIconShown ?? d.initialIconShown,
239
244
  bottomCircle: e.bottomCircle ?? d.bottomCircle,
240
245
  hotspots: e.hotspots ?? d.hotspots,
246
+ hotspotTrigger: e.hotspotTrigger || d.hotspotTrigger,
241
247
  hide360Logo: e.hide360Logo ?? d.hide360Logo,
242
248
  logoSrc: e.logoSrc || d.logoSrc,
243
249
  inertia: e.inertia ?? d.inertia,
@@ -258,32 +264,32 @@ const de = /* @__PURE__ */ ii(wi), M = {
258
264
  onZoomOut: e.onZoomOut ?? d.onZoomOut,
259
265
  onDragStart: e.onDragStart ?? d.onDragStart,
260
266
  onDragEnd: e.onDragEnd ?? d.onDragEnd
261
- }), L = (e, t, i) => e.getAttribute(t) || e.getAttribute(`data-${t}`) || i, X = (e, t, i) => {
267
+ }), S = (e, t, i) => e.getAttribute(t) || e.getAttribute(`data-${t}`) || i, M = (e, t, i) => {
262
268
  if (!(e.hasAttribute(t) || e.hasAttribute(`data-${t}`))) return i;
263
- const o = L(e, t, null);
269
+ const o = S(e, t, null);
264
270
  return o !== "false" && o !== "0";
265
- }, Ht = (e, t) => L(e, t, null) === "false", Pi = (e = 1) => {
271
+ }, Zt = (e, t) => S(e, t, null) === "false", Bi = (e = 1) => {
266
272
  const t = Math.round(window.devicePixelRatio || 1);
267
273
  return parseInt(e) * t;
268
- }, Ri = (e, t, i) => new URL(e).origin.includes("cloudimg") ? e : `https://${t}.cloudimg.io/${i}${e}`, Mi = ({ ciTransformation: e, responsiveWidth: t, ciFilters: i }) => {
274
+ }, Wi = (e, t, i) => new URL(e).origin.includes("cloudimg") ? e : `https://${t}.cloudimg.io/${i}${e}`, Ni = ({ ciTransformation: e, responsiveWidth: t, ciFilters: i }) => {
269
275
  const s = `width=${t}`, o = e || s, n = i ? `&f=${i}` : "";
270
276
  return `${o}${n}`;
271
- }, Et = (e, t) => {
277
+ }, Ct = (e, t) => {
272
278
  const { folder: i, apiVersion: s, filename: o = "", ciParams: n } = e, { ciToken: l, ciFilters: r, ciTransformation: a } = n || {}, c = `${i}${o}`;
273
- if (!l) return c;
274
- const h = Ii.includes(s) ? null : s, p = h ? `${h}/` : "", f = Pi(t), u = Ri(c, l, p), I = Mi({
279
+ if (!l || !t) return c;
280
+ const h = Ai.includes(s) ? null : s, u = h ? `${h}/` : "", f = Bi(t), p = Wi(c, l, u), I = Ni({
275
281
  ciTransformation: a,
276
282
  responsiveWidth: f,
277
283
  ciFilters: r
278
284
  });
279
- return `${u}${I ? "?" : ""}${I}`;
280
- }, Hi = (e, t, i) => {
285
+ return `${p}${I ? "?" : ""}${I}`;
286
+ }, Fi = (e, t, i) => {
281
287
  const [s, o] = e.split("?"), n = `${t}=${encodeURIComponent(i)}`;
282
288
  if (!o)
283
289
  return `${s}?${n}`;
284
290
  const l = new URLSearchParams(o);
285
291
  return l.set(t, i), `${s}?${l.toString()}`;
286
- }, Di = (e, t) => Hi(e, "width", t), Be = (e, t = 0) => (e += "", e.length >= t ? e : new Array(t - e.length + 1).join("0") + e), Zi = (e, { amount: t = 0, indexZeroBase: i = 0 } = {}) => Array.from({ length: t }, (s, o) => e.replace("{index}", Be(o + 1, i))), Bi = ({
292
+ }, Vi = (e, t) => Fi(e, "width", t), ze = (e, t = 0) => (e += "", e.length >= t ? e : new Array(t - e.length + 1).join("0") + e), zi = (e, { amount: t = 0, indexZeroBase: i = 0 } = {}) => Array.from({ length: t }, (s, o) => e.replace("{index}", ze(o + 1, i))), ji = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), $i = ji ? 3 : 6, Gi = ({
287
293
  imagesUrls: e,
288
294
  onFirstImageLoad: t,
289
295
  onImageLoad: i,
@@ -292,64 +298,67 @@ const de = /* @__PURE__ */ ii(wi), M = {
292
298
  autoplayReverse: n
293
299
  }) => {
294
300
  let l = 0, r = 0;
295
- const a = e.length, c = [], h = [], p = (m, b, x = !1) => {
296
- const w = {
301
+ const a = e.length, c = [], h = [];
302
+ let u = 0, f = 0;
303
+ const p = [], I = (m, g, x = !1) => {
304
+ const A = {
297
305
  message: `Failed to load image: ${m}`,
298
306
  url: m,
299
- index: b,
307
+ index: g,
300
308
  isFirstImage: x
301
309
  };
302
- h.push(w), r++, o == null || o({
303
- error: w,
310
+ h.push(A), r++, o == null || o({
311
+ error: A,
304
312
  errorCount: r,
305
313
  totalImages: a,
306
314
  errors: h
307
315
  });
308
- }, f = () => {
316
+ }, b = () => {
309
317
  l === a && (s == null || s(c, { errorCount: r, errors: h }));
310
- }, u = (m, b) => {
318
+ }, v = () => {
319
+ for (; u < $i && f < p.length; ) {
320
+ const m = p[f];
321
+ f++, O(e[m], m);
322
+ }
323
+ }, O = (m, g) => {
324
+ u++;
311
325
  const x = new Image();
312
326
  x.crossOrigin = "anonymous", x.src = m, x.onload = async () => {
313
327
  try {
314
- const w = await createImageBitmap(x), C = {
328
+ const A = await createImageBitmap(x), k = {
315
329
  src: m,
316
- bitmapImage: w,
330
+ bitmapImage: A,
317
331
  naturalWidth: x.naturalWidth,
318
332
  naturalHeight: x.naturalHeight
319
333
  };
320
- l++, c[b] = C, i == null || i(C, b), f();
334
+ x.onload = null, x.onerror = null, x.src = "", l++, u--, c[g] = k, i == null || i(k, g), b(), v();
321
335
  } catch {
322
- l++, p(m, b), f();
336
+ x.onload = null, x.onerror = null, x.src = "", l++, u--, I(m, g), b(), v();
323
337
  }
324
338
  }, x.onerror = () => {
325
- l++, p(m, b), f();
339
+ x.onload = null, x.onerror = null, x.src = "", l++, u--, I(m, g), b(), v();
326
340
  };
327
- }, I = new Image(), g = n ? e.length - 1 : 0, v = e[g];
328
- I.crossOrigin = "anonymous", I.src = v, I.onload = async () => {
341
+ }, E = (m) => {
342
+ for (let g = 0; g < e.length; g++)
343
+ g !== m && p.push(g);
344
+ f = 0, v();
345
+ }, w = new Image(), y = n ? e.length - 1 : 0, C = e[y];
346
+ w.crossOrigin = "anonymous", w.src = C, w.onload = async () => {
329
347
  try {
330
- const m = await createImageBitmap(I), b = {
331
- src: v,
348
+ const m = await createImageBitmap(w), g = {
349
+ src: C,
332
350
  bitmapImage: m,
333
- naturalWidth: I.naturalWidth,
334
- naturalHeight: I.naturalHeight
351
+ naturalWidth: w.naturalWidth,
352
+ naturalHeight: w.naturalHeight
335
353
  };
336
- c[g] = b, l++, t == null || t(b), i == null || i(b, g);
337
- for (let x = 0; x < e.length; x++)
338
- x !== g && u(e[x], x);
339
- f();
354
+ w.onload = null, w.onerror = null, w.src = "", c[y] = g, l++, t == null || t(g), i == null || i(g, y), a === 1 ? b() : E(y);
340
355
  } catch {
341
- l++, p(v, g, !0);
342
- for (let b = 0; b < e.length; b++)
343
- b !== g && u(e[b], b);
344
- f();
356
+ w.onload = null, w.onerror = null, w.src = "", l++, I(C, y, !0), a === 1 ? b() : E(y);
345
357
  }
346
- }, I.onerror = () => {
347
- l++, p(v, g, !0);
348
- for (let m = 0; m < e.length; m++)
349
- m !== g && u(e[m], m);
350
- f();
358
+ }, w.onerror = () => {
359
+ w.onload = null, w.onerror = null, w.src = "", l++, I(C, y, !0), a === 1 ? b() : E(y);
351
360
  };
352
- }, ve = ({
361
+ }, ye = ({
353
362
  cdnPathX: e,
354
363
  cdnPathY: t,
355
364
  configX: i,
@@ -359,50 +368,50 @@ const de = /* @__PURE__ */ ii(wi), M = {
359
368
  onAllImagesLoad: l,
360
369
  onError: r
361
370
  }) => {
362
- let a = { x: !1, y: !1 }, c = [], h = [], p = { errorCount: 0, errors: [] }, f = { errorCount: 0, errors: [] };
363
- const u = e || i.imageList.length, I = t || s.imageList.length, g = () => {
371
+ let a = { x: !1, y: !1 }, c = [], h = [], u = { errorCount: 0, errors: [] }, f = { errorCount: 0, errors: [] };
372
+ const p = e || i.imageList.length, I = t || s.imageList.length, b = () => {
364
373
  if (a.x && a.y) {
365
- const m = {
366
- errorCount: p.errorCount + f.errorCount,
367
- errors: [...p.errors, ...f.errors]
374
+ const O = {
375
+ errorCount: u.errorCount + f.errorCount,
376
+ errors: [...u.errors, ...f.errors]
368
377
  };
369
- l == null || l(c, h, m);
378
+ l == null || l(c, h, O);
370
379
  }
371
- }, v = ({ cdnPath: m, config: b, orientation: x, loadedImages: w, loadStats: C, onFirstImageLoad: y }) => {
372
- const O = x === P.X, S = b.imageList.length ? b.imageList : Zi(m, b);
373
- Bi({
374
- imagesUrls: S,
375
- onFirstImageLoad: y,
376
- onImageLoad: (E, A) => {
377
- n == null || n(E, A, x), w[A] = E;
380
+ }, v = ({ cdnPath: O, config: E, orientation: w, loadedImages: y, loadStats: C, onFirstImageLoad: m }) => {
381
+ const g = w === Y.X, x = E.imageList.length ? E.imageList : zi(O, E);
382
+ Gi({
383
+ imagesUrls: x,
384
+ onFirstImageLoad: m,
385
+ onImageLoad: (A, k) => {
386
+ n == null || n(A, k, w), y[k] = A;
378
387
  },
379
- onError: (E) => {
380
- r == null || r({ ...E, orientation: x });
388
+ onError: (A) => {
389
+ r == null || r({ ...A, orientation: w });
381
390
  },
382
- onAllImagesLoad: (E, A) => {
383
- w.length = 0, E.forEach((k, R) => {
384
- k && (w[R] = k);
385
- }), C.errorCount = A.errorCount, C.errors = A.errors.map((k) => ({ ...k, orientation: x })), a[O ? "x" : "y"] = !0, g();
391
+ onAllImagesLoad: (A, k) => {
392
+ y.length = 0, A.forEach((T, X) => {
393
+ T && (y[X] = T);
394
+ }), C.errorCount = k.errorCount, C.errors = k.errors.map((T) => ({ ...T, orientation: w })), a[g ? "x" : "y"] = !0, b();
386
395
  },
387
- autoplayReverse: b.autoplayReverse
396
+ autoplayReverse: E.autoplayReverse
388
397
  });
389
398
  };
390
- u ? v({
399
+ p ? v({
391
400
  cdnPath: e,
392
401
  config: i,
393
- orientation: P.X,
402
+ orientation: Y.X,
394
403
  loadedImages: c,
395
- loadStats: p,
404
+ loadStats: u,
396
405
  onFirstImageLoad: o
397
406
  }) : a.x = !0, I ? v({
398
407
  cdnPath: t,
399
408
  config: s,
400
- orientation: P.Y,
409
+ orientation: Y.Y,
401
410
  loadedImages: h,
402
411
  loadStats: f,
403
- onFirstImageLoad: u ? void 0 : o
404
- }) : a.y = !0, !u && !I && g();
405
- }, Wi = `
412
+ onFirstImageLoad: p ? void 0 : o
413
+ }) : a.y = !0, !p && !I && b();
414
+ }, Ui = `
406
415
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1052 156" aria-hidden="true">
407
416
  <path fill="currentColor" d="M409.9,145.6c-42.7-1.7-85.5-4.4-128.1-8.4c-21.3-2-42.6-4.3-63.8-7.1c-21.2-2.8-42.4-5.9-63.4-9.7c-21.1-3.8-42-8.2-62.7-13.7c-10.3-2.8-20.6-5.8-30.7-9.4c-10.1-3.5-20.1-7.6-29.5-12.7c-4.7-2.6-9.3-5.4-13.5-8.8c-2.1-1.7-4-3.6-5.8-5.6c-1.8-2-3.3-4.3-4.3-6.8c-1.1-2.5-1.6-5.3-1.4-8c0.2-2.7,1.1-5.4,2.4-7.7c2.7-4.8,6.7-8.5,11-11.7c8.6-6.4,18.4-10.9,28.3-15c9.9-4,20.1-7.3,30.4-10.3c-10.2,3.1-20.4,6.5-30.3,10.5c-9.8,4.1-19.6,8.7-28.1,15.1c-4.2,3.2-8.2,6.9-10.7,11.6c-1.2,2.3-2.1,4.8-2.3,7.5c-0.1,2.6,0.4,5.2,1.4,7.6c2.1,4.8,5.9,8.7,10,12.1c4.1,3.3,8.7,6.1,13.4,8.6c9.4,5,19.4,8.9,29.4,12.4c10.1,3.5,20.4,6.4,30.7,9.1c20.7,5.3,41.6,9.5,62.7,13.2c21,3.6,42.2,6.6,63.4,9.2c21.2,2.6,42.5,4.8,63.7,6.6c42.6,3.7,85.2,6,127.9,7.4L409.9,145.6z"/>
408
417
  <path fill="currentColor" d="M977.1,11.6c13.8,4.1,27.4,8.8,40.4,15.2c6.4,3.2,12.7,6.9,18.3,11.5c2.7,2.4,5.3,5,7.3,8c2,3,3.3,6.6,3.3,10.3c0,3.7-1.4,7.2-3.3,10.3c-2,3.1-4.5,5.7-7.3,8.1c-2.7,2.4-5.7,4.4-8.8,6.3c-1.6,0.9-3.1,1.9-4.7,2.7l-2.4,1.3l-2.4,1.2C1004.5,93,990.8,97.8,977,102c-6.9,2.1-13.8,4-20.8,5.8c-7,1.8-14,3.5-21,5c-14.1,3.1-28.2,5.9-42.4,8.3c-28.4,4.9-57,8.8-85.6,12c-57.3,6.4-114.8,10.2-172.4,12.2c-57.6,2-115.2,2.3-172.9,0.8l0.1-4c57.5,1.8,115.1,1.9,172.6,0.2c57.5-1.7,115-5.2,172.3-11.2c28.6-3.1,57.2-6.7,85.6-11.5c14.2-2.4,28.3-5,42.4-8.1c7-1.5,14-3.1,21-4.9c7-1.7,13.9-3.6,20.8-5.7c13.8-4.1,27.4-8.8,40.3-15.2l2.4-1.2l2.4-1.3c1.6-0.8,3.1-1.8,4.7-2.7c3-1.9,6-3.9,8.7-6.2c2.7-2.3,5.2-4.9,7.2-7.9c1.9-3,3.2-6.4,3.3-10c0-3.6-1.2-7-3.1-10c-1.9-3-4.4-5.6-7.1-8c-5.5-4.7-11.7-8.3-18.1-11.6C1004.5,20.6,990.8,15.8,977.1,11.6z"/>
@@ -413,10 +422,10 @@ const de = /* @__PURE__ */ ii(wi), M = {
413
422
  <path fill="currentColor" d="M10.9,9.7c0-1.1-0.8-2-2.5-2.5c1.3-0.5,1.9-1.3,1.9-2.3c0-1.7-1.7-2.8-4.6-2.8c-1.5,0-2.7,0.3-3.6,0.8v1.7c0.9-0.4,2.3-0.7,3.4-0.7C7,3.9,8,4.4,8,5.1c0,0.8-0.7,1.3-2.4,1.3H4.3v1.6h1.3c2,0,2.9,0.8,2.9,1.6c0,0.8-1,1.5-2.8,1.5c-1.5,0-2.8-0.3-3.7-0.6v1.7c0.9,0.3,2.1,0.6,3.8,0.6C9.2,12.8,10.9,11.4,10.9,9.7"/>
414
423
  </g>
415
424
  </svg>
416
- `, Fi = (e) => {
425
+ `, _i = (e) => {
417
426
  const t = document.createElement("div");
418
- return t.innerHTML = Wi, t.style.bottom = `${e}%`, t.className = "cloudimage-360-view-360-circle", t;
419
- }, Ni = `
427
+ return t.innerHTML = Ui, t.style.bottom = `${e}%`, t.className = "cloudimage-360-view-360-circle", t;
428
+ }, Ki = `
420
429
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
421
430
  <!-- Circular arrows -->
422
431
  <path d="M 75 50 A 25 25 0 1 1 50 25" stroke="currentColor" stroke-width="3"/>
@@ -427,107 +436,113 @@ const de = /* @__PURE__ */ ii(wi), M = {
427
436
  <!-- 360 text -->
428
437
  <text x="50" y="54" text-anchor="middle" font-size="16" font-weight="600" fill="currentColor" stroke="none" font-family="system-ui, -apple-system, sans-serif">360°</text>
429
438
  </svg>
430
- `, Vi = (e) => {
439
+ `, Ji = (e) => {
431
440
  const t = document.createElement("div");
432
- return t.className = "cloudimage-initial-icon", t.setAttribute("aria-label", "360 degree view - drag to rotate"), e ? (t.style.backgroundImage = `url('${e}')`, t.style.backgroundPosition = "50% 50%", t.style.backgroundSize = "contain", t.style.backgroundRepeat = "no-repeat") : t.innerHTML = Ni, t;
433
- }, ji = (e, t) => {
441
+ return t.className = "cloudimage-initial-icon", t.setAttribute("aria-label", "360 degree view - drag to rotate"), e ? (t.style.backgroundImage = `url('${e}')`, t.style.backgroundPosition = "50% 50%", t.style.backgroundSize = "contain", t.style.backgroundRepeat = "no-repeat") : t.innerHTML = Ki, t;
442
+ }, qi = (e, t) => {
434
443
  const { width: i, height: s } = t, o = document.createElement("canvas");
435
444
  return o.width = i, o.height = s, o.style.width = "100%", o.style.height = "auto", e.appendChild(o), o;
436
- }, $i = () => {
445
+ }, Qi = () => {
437
446
  const e = document.createElement("button");
438
447
  return e.className = "cloudimage-360-button cloudimage-360-close-icon", e.setAttribute("aria-label", "Close fullscreen"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>', e;
439
- }, zi = () => {
448
+ }, ts = () => {
440
449
  const e = document.createElement("button");
441
450
  return e.className = "cloudimage-360-button cloudimage-360-fullscreen-button", e.setAttribute("aria-label", "View fullscreen"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>', e;
442
- }, ge = (e) => {
451
+ }, be = (e) => {
443
452
  const t = document.createElement("div");
444
453
  return t.className = "cloudimage-360-icons-container", e.appendChild(t), t;
445
- }, Gi = (e) => {
454
+ }, es = (e) => {
446
455
  const t = document.createElement("div");
447
456
  return t.className = "cloudimage-360-inner-box", t.setAttribute("role", "img"), t.setAttribute("aria-label", "360 degree product view. Use mouse drag or arrow keys to rotate."), e.appendChild(t), t;
448
- }, Ui = () => {
457
+ }, is = () => {
449
458
  const e = document.createElement("button");
450
459
  return e.className = "cloudimage-360-button cloudimage-360-magnifier-button", e.setAttribute("aria-label", "Magnify image"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M11 8v6"/><path d="M8 11h6"/></svg>', e;
451
- }, Ki = (e) => {
460
+ }, ss = () => {
461
+ const e = document.createElement("button");
462
+ return e.className = "cloudimage-360-button cloudimage-360-zoom-out-button", e.setAttribute("aria-label", "Zoom out"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M8 11h6"/></svg>', e;
463
+ }, os = (e) => {
452
464
  const t = document.createElement("div");
453
465
  t.className = "cloudimage-initial-icon";
454
466
  const i = document.createElement("span");
455
467
  return i.className = "percentage", i.innerText = "0%", t.appendChild(i), e.appendChild(t), t;
456
- }, _i = (e) => {
468
+ }, ns = (e) => {
457
469
  const t = document.createElement("div");
458
470
  t.className = "cloudimage-360-fullscreen-modal";
459
471
  const i = e.cloneNode();
460
472
  return i.style.width = "100%", i.style.maxWidth = "100%", i.style.height = "100vh", i.style.maxHeight = "100%", t.appendChild(i), window.document.body.appendChild(t), i;
461
- }, Jt = (e, t) => {
473
+ }, qt = (e, t) => {
462
474
  const i = e.querySelector(t);
463
475
  i && i.parentNode.removeChild(i);
464
- }, Ji = () => {
476
+ }, rs = () => {
465
477
  const e = document.createElement("div");
466
478
  return e.className = "cloudimage-loading-spinner", e;
467
- }, qi = () => {
479
+ }, as = () => {
468
480
  const e = document.createElement("div");
469
481
  return e.className = "cloudimage-360-transition-overlay", e;
470
- }, Qi = (e) => {
482
+ }, ls = (e) => {
471
483
  const t = document.createElement("div");
472
484
  return t.className = "cloudimage-360-hotspot-container", e.appendChild(t), t;
473
- }, ts = (e) => {
485
+ }, cs = (e) => {
474
486
  const t = document.createElement("div");
475
487
  return t.className = "cloudimage-360-sr-only", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), e.appendChild(t), t;
476
- }, es = (e, t) => {
488
+ }, hs = (e, t) => {
477
489
  e && (e.textContent = "", setTimeout(() => {
478
490
  e.textContent = t;
479
491
  }, 50));
480
- }, We = {
492
+ }, je = {
481
493
  drag: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>',
482
494
  swipe: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="M8 12h8"/></svg>',
483
495
  click: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 5 12 1.8-5.2L21 14Z"/><path d="M7.2 2.2 8 5.1"/><path d="m5.1 8-2.9-.8"/><path d="M14 4.1 12 6"/><path d="m6 12-1.9 2"/></svg>',
484
496
  pinch: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l4 4"/><path d="M18 6l-4 4"/><path d="M6 18l4-4"/><path d="M18 18l-4-4"/><circle cx="12" cy="12" r="2"/></svg>',
485
497
  keys: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m9 10 3 3 3-3"/></svg>',
486
498
  fullscreen: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>'
487
- }, is = {
499
+ }, we = {
488
500
  drag: "Drag to rotate",
489
501
  swipe: "Swipe to rotate",
490
502
  click: "Click to zoom",
503
+ dblclick: "Double-click to zoom",
491
504
  pinch: "Pinch to zoom",
492
505
  keys: "Use arrow keys",
493
506
  fullscreen: "Click for fullscreen"
494
- }, ss = (e) => {
495
- const t = document.createElement("div");
496
- return t.className = "cloudimage-360-hint-item", t.innerHTML = `
497
- ${We[e]}
498
- <span>${is[e]}</span>
499
- `, t;
500
- }, ye = (e, t = []) => {
501
- if (!t || t.length === 0) return null;
507
+ }, ds = (e, t = {}) => {
502
508
  const i = document.createElement("div");
503
- i.className = "cloudimage-360-hints-overlay", i.setAttribute("role", "tooltip"), i.setAttribute("aria-label", "Interaction hints");
509
+ i.className = "cloudimage-360-hint-item";
510
+ let s = we[e];
511
+ return e === "click" && t.pointerZoomTrigger === "dblclick" && (s = we.dblclick), i.innerHTML = `
512
+ ${je[e]}
513
+ <span>${s}</span>
514
+ `, i;
515
+ }, Ie = (e, t = [], i = {}) => {
516
+ if (!t || t.length === 0) return null;
504
517
  const s = document.createElement("div");
505
- return s.className = "cloudimage-360-hints-container", t.forEach((o) => {
506
- We[o] && s.appendChild(ss(o));
507
- }), i.appendChild(s), e.appendChild(i), i;
508
- }, be = (e, t) => t ? ["swipe"] : ["drag", "click"], we = (e) => {
518
+ s.className = "cloudimage-360-hints-overlay", s.setAttribute("role", "tooltip"), s.setAttribute("aria-label", "Interaction hints");
519
+ const o = document.createElement("div");
520
+ return o.className = "cloudimage-360-hints-container", t.forEach((n) => {
521
+ je[n] && o.appendChild(ds(n, i));
522
+ }), s.appendChild(o), e.appendChild(s), s;
523
+ }, xe = (e, t) => t ? ["swipe"] : ["drag", "click"], Ce = (e) => {
509
524
  e && e.classList.add("visible");
510
- }, os = (e) => {
525
+ }, us = (e) => {
511
526
  e && (e.classList.remove("visible"), e.classList.add("hiding"), setTimeout(() => {
512
527
  e.classList.remove("hiding");
513
528
  }, 300));
514
- }, ns = (e) => {
529
+ }, ps = (e) => {
515
530
  if (!e || typeof e != "object") return null;
516
531
  const t = Object.keys(e).map((s) => parseInt(s, 10)).filter((s) => !isNaN(s)).sort((s, o) => s - o);
517
532
  if (t.length === 0) return null;
518
533
  const i = Math.floor(t.length / 2);
519
534
  return t[i];
520
- }, rs = (e) => {
535
+ }, ms = (e) => {
521
536
  const t = [];
522
537
  return !e || !Array.isArray(e) || e.forEach((i, s) => {
523
- const o = ns(i.positions);
538
+ const o = ps(i.positions);
524
539
  o !== null && t.push({
525
540
  id: i.id || `hotspot-${s}`,
526
541
  frame: o,
527
542
  label: i.label || null
528
543
  });
529
544
  }), t;
530
- }, as = 400, ls = (e, t, i, s) => {
545
+ }, fs = 400, vs = (e, t, i, s) => {
531
546
  const o = document.createElement("button");
532
547
  o.className = "cloudimage-360-hotspot-timeline-dot", o.setAttribute("type", "button"), o.setAttribute("aria-label", s || `Go to hotspot at frame ${t + 1}`), o.setAttribute("data-frame", t.toString()), o.setAttribute("data-hotspot-id", e);
533
548
  const n = i > 1 ? t / (i - 1) * 100 : 0;
@@ -538,7 +553,7 @@ const de = /* @__PURE__ */ ii(wi), M = {
538
553
  o.addEventListener("mouseenter", () => {
539
554
  r = setTimeout(() => {
540
555
  l.classList.add("visible");
541
- }, as);
556
+ }, fs);
542
557
  }), o.addEventListener("mouseleave", () => {
543
558
  r && (clearTimeout(r), r = null), l.classList.remove("visible");
544
559
  }), o.addEventListener("click", () => {
@@ -546,8 +561,8 @@ const de = /* @__PURE__ */ ii(wi), M = {
546
561
  });
547
562
  }
548
563
  return o;
549
- }, cs = (e, t, i) => {
550
- const s = rs(i);
564
+ }, gs = (e, t, i) => {
565
+ const s = ms(i);
551
566
  if (s.length === 0) return null;
552
567
  const o = document.createElement("div");
553
568
  o.className = "cloudimage-360-hotspot-timeline", o.setAttribute("role", "navigation"), o.setAttribute("aria-label", "Hotspot timeline navigation");
@@ -555,37 +570,37 @@ const de = /* @__PURE__ */ ii(wi), M = {
555
570
  n.className = "cloudimage-360-hotspot-timeline-track";
556
571
  const l = document.createElement("div");
557
572
  return l.className = "cloudimage-360-hotspot-timeline-indicator", s.forEach(({ id: r, frame: a, label: c }) => {
558
- const h = ls(r, a, t, c);
573
+ const h = vs(r, a, t, c);
559
574
  n.appendChild(h);
560
575
  }), n.appendChild(l), o.appendChild(n), e.appendChild(o), {
561
576
  element: o,
562
577
  indicator: l,
563
578
  hotspotFrames: s
564
579
  };
565
- }, hs = (e, t, i) => {
580
+ }, ys = (e, t, i) => {
566
581
  if (!e) return;
567
582
  const s = i > 1 ? t / (i - 1) * 100 : 0;
568
583
  e.style.left = `${s}%`;
569
- }, ds = (e) => {
584
+ }, bs = (e) => {
570
585
  e && e.classList.add("visible");
571
- }, us = (e) => {
586
+ }, ws = (e) => {
572
587
  e && e.classList.remove("visible");
573
- }, qt = (e, t = []) => {
588
+ }, Qt = (e, t = []) => {
574
589
  if (!e) return t;
575
590
  try {
576
591
  return JSON.parse(e);
577
592
  } catch (i) {
578
593
  return console.warn("CloudImage 360: Failed to parse JSON:", i.message), t;
579
594
  }
580
- }, ps = (e, t) => {
595
+ }, Is = (e, t) => {
581
596
  const [i, s] = e.split("?");
582
597
  if (!s) return e;
583
598
  const o = new RegExp(`^${t}=|&${t}=`), n = s.split("&").filter((l) => !o.test(l)).join("&");
584
599
  return n ? `${i}?${n}` : i;
585
- }, fs = (e) => {
586
- const t = ps(e, "width"), i = t.includes("?") ? "&" : "?";
600
+ }, xs = (e) => {
601
+ const t = Is(e, "width"), i = t.includes("?") ? "&" : "?";
587
602
  return `${t}${i}width=${150 * devicePixelRatio}`;
588
- }, ms = (e) => {
603
+ }, Cs = (e) => {
589
604
  const t = {
590
605
  root: null,
591
606
  rootMargin: "0px",
@@ -599,25 +614,25 @@ const de = /* @__PURE__ */ ii(wi), M = {
599
614
  l.isIntersecting && (i(l.target), n.unobserve(l.target));
600
615
  });
601
616
  }, t).observe(e);
602
- }, vs = (e, t) => {
603
- const i = Be(1, t);
617
+ }, Os = (e, t) => {
618
+ const i = ze(1, t);
604
619
  return e.replace("{index}", i);
605
- }, gs = (e, t) => {
620
+ }, Es = (e, t) => {
606
621
  const [i] = e, s = /(https?):\/\//i.test(i);
607
- return Et({
622
+ return Ct({
608
623
  ...t,
609
624
  folder: s ? "" : t.folder,
610
625
  filename: i
611
626
  });
612
- }, ys = (e, t) => {
627
+ }, As = (e, t) => {
613
628
  const { imageList: i, indexZeroBase: s } = t;
614
629
  if (i.length) {
615
- const o = qt(i, null);
630
+ const o = Qt(i, null);
616
631
  if (o)
617
- return gs(o, t);
632
+ return Es(o, t);
618
633
  }
619
- return vs(e, s);
620
- }, Ie = (e, t, i) => {
634
+ return Os(e, s);
635
+ }, Oe = (e, t, i) => {
621
636
  const s = new Image();
622
637
  return s.setAttribute(t ? "data-src" : "src", e), s.className = i, s.style.cssText = `
623
638
  position: ${t ? "absolute" : "static"};
@@ -628,9 +643,9 @@ const de = /* @__PURE__ */ ii(wi), M = {
628
643
  object-position: center;
629
644
  filter: blur(10px);
630
645
  `, s;
631
- }, xe = (e, t, i) => {
632
- const { innerBox: s, imageList: o, lazyload: n } = t || {}, [l] = o, r = l || ys(e, t), a = fs(r), c = Ie(a, n, "cloudimage-lazy"), h = Ie(a, !1, "cloudimage-360-placeholder"), p = (f) => {
633
- Jt(s, ".cloudimage-lazy"), i && i({
646
+ }, Ee = (e, t, i) => {
647
+ const { innerBox: s, imageList: o, lazyload: n } = t || {}, [l] = o, r = l || As(e, t), a = xs(r), c = Oe(a, n, "cloudimage-lazy"), h = Oe(a, !1, "cloudimage-360-placeholder"), u = (f) => {
648
+ qt(s, ".cloudimage-lazy"), i && i({
634
649
  event: f,
635
650
  width: c.width,
636
651
  height: c.height,
@@ -639,8 +654,8 @@ const de = /* @__PURE__ */ ii(wi), M = {
639
654
  src: a
640
655
  });
641
656
  };
642
- c.onload = p, s.appendChild(c), s.appendChild(h), ms(c);
643
- }, bs = (e, t, i) => {
657
+ c.onload = u, s.appendChild(c), s.appendChild(h), Cs(c);
658
+ }, ks = (e, t, i) => {
644
659
  const s = new Image();
645
660
  s.src = e, s.onload = (o) => {
646
661
  t && t({
@@ -655,59 +670,75 @@ const de = /* @__PURE__ */ ii(wi), M = {
655
670
  const n = new Error(`Failed to load image: ${e}`);
656
671
  n.url = e, n.event = o, i ? i(n) : console.error(n.message);
657
672
  };
658
- }, ws = (e, t) => {
673
+ }, Ss = (e, t) => {
659
674
  const i = t.getBoundingClientRect(), s = e.touches ? e.touches[0].clientX : e.clientX, o = e.touches ? e.touches[0].clientY : e.clientY;
660
675
  return {
661
676
  x: s - i.left,
662
677
  y: o - i.top
663
678
  };
664
- }, _t = (e, t, i) => {
665
- const { container: s, w: o, h: n, zoom: l, bw: r, offsetX: a, offsetY: c } = t, h = ws(e, s);
666
- let p = h.x, f = h.y;
667
- p = Math.max(o / l, Math.min(p, s.offsetWidth - o / l)), f = Math.max(n / l, Math.min(f, s.offsetHeight - n / l)), i.style.left = `${p - o}px`, i.style.top = `${f - n}px`;
668
- const u = (p - a) * l - o + r, I = (f - c) * l - n + r;
669
- i.style.backgroundPosition = `-${u}px -${I}px`;
670
- }, Is = (e, t, i, s, o, n) => {
679
+ }, Jt = (e, t, i) => {
680
+ const { container: s, w: o, h: n, zoom: l, bw: r, offsetX: a, offsetY: c } = t, h = Ss(e, s);
681
+ let u = h.x, f = h.y;
682
+ u = Math.max(o / l, Math.min(u, s.offsetWidth - o / l)), f = Math.max(n / l, Math.min(f, s.offsetHeight - n / l)), i.style.left = `${u - o}px`, i.style.top = `${f - n}px`;
683
+ const p = (u - a) * l - o + r, I = (f - c) * l - n + r;
684
+ i.style.backgroundPosition = `-${p}px -${I}px`;
685
+ }, Ts = (e, t, i, s, o, n) => {
671
686
  const { x: l = 0, y: r = 0 } = i || {}, a = (t.offsetWidth - l * 2) * n, c = (t.offsetHeight - r * 2) * n;
672
687
  if (!o) return;
673
688
  o.setAttribute("class", "cloudimage-360-img-magnifier-glass"), t.prepend(o), o.style.backgroundImage = `url('${s.src}')`, o.style.backgroundSize = `${a}px ${c}px`;
674
- const h = 3, p = o.offsetWidth / 2, f = o.offsetHeight / 2, u = {
689
+ const h = 3, u = o.offsetWidth / 2, f = o.offsetHeight / 2, p = {
675
690
  container: t,
676
- w: p,
691
+ w: u,
677
692
  h: f,
678
693
  zoom: n,
679
694
  bw: h,
680
695
  offsetX: l,
681
696
  offsetY: r
682
697
  };
683
- _t(e, u, o);
698
+ Jt(e, p, o);
684
699
  const I = (v) => {
685
- _t(v, u, o);
686
- }, g = (v) => {
687
- v.preventDefault(), _t(v, u, o);
700
+ Jt(v, p, o);
701
+ }, b = (v) => {
702
+ v.preventDefault(), Jt(v, p, o);
688
703
  };
689
- o.addEventListener("mousemove", I), t.addEventListener("mousemove", I), t.addEventListener("touchmove", g);
690
- }, xs = (e, t, i) => {
704
+ o.addEventListener("mousemove", I), t.addEventListener("mousemove", I), t.addEventListener("touchmove", b);
705
+ }, Ls = (e, t, i) => {
691
706
  const { clientX: s, clientY: o } = e, n = t.getBoundingClientRect(), l = t.width / (n.width * i), r = t.height / (n.height * i), a = (s - n.left) * l, c = (o - n.top) * r;
692
707
  return { offsetX: a, offsetY: c };
693
- }, Ce = (e, { bottom: t, top: i }) => {
708
+ }, Ps = (e, t, i) => {
709
+ const s = e / i, o = t / i;
710
+ return { zoomedWidth: s, zoomedHeight: o };
711
+ }, Ms = ({
712
+ pointerX: e,
713
+ pointerY: t,
714
+ imageData: i,
715
+ zoomedWidth: s,
716
+ zoomedHeight: o,
717
+ drawWidth: n,
718
+ drawHeight: l
719
+ }) => {
720
+ const { naturalWidth: r, naturalHeight: a } = i;
721
+ let c = e / n * r - s / 2, h = t / l * a - o / 2;
722
+ const u = Math.max(0, r - s), f = Math.max(0, a - o);
723
+ return c = Math.max(0, Math.min(c, u)), h = Math.max(0, Math.min(h, f)), { zoomOffsetX: c, zoomOffsetY: h };
724
+ }, Ae = (e, { bottom: t, top: i }) => {
694
725
  e ? t() : i();
695
- }, Oe = (e, { left: t, right: i }) => {
726
+ }, ke = (e, { left: t, right: i }) => {
696
727
  e ? t() : i();
697
- }, Cs = ({ autoplayBehavior: e, spinY: t, reversed: i, loopTriggers: s }) => {
728
+ }, Ys = ({ autoplayBehavior: e, spinY: t, reversed: i, loopTriggers: s }) => {
698
729
  switch (e) {
699
- case M.SPIN_XY:
700
- case M.SPIN_YX:
701
- t ? Ce(i, s) : Oe(i, s);
730
+ case R.SPIN_XY:
731
+ case R.SPIN_YX:
732
+ t ? Ae(i, s) : ke(i, s);
702
733
  break;
703
- case M.SPIN_Y:
704
- Ce(i, s);
734
+ case R.SPIN_Y:
735
+ Ae(i, s);
705
736
  break;
706
- case M.SPIN_X:
737
+ case R.SPIN_X:
707
738
  default:
708
- Oe(i, s);
739
+ ke(i, s);
709
740
  }
710
- }, Os = ({
741
+ }, Xs = ({
711
742
  autoplayBehavior: e,
712
743
  activeImageX: t,
713
744
  activeImageY: i,
@@ -720,15 +751,15 @@ const de = /* @__PURE__ */ ii(wi), M = {
720
751
  return n ? r === 0 : r === c;
721
752
  };
722
753
  switch (e) {
723
- case M.SPIN_XY:
724
- case M.SPIN_Y:
754
+ case R.SPIN_XY:
755
+ case R.SPIN_Y:
725
756
  return l(i, o);
726
- case M.SPIN_X:
727
- case M.SPIN_YX:
757
+ case R.SPIN_X:
758
+ case R.SPIN_YX:
728
759
  default:
729
760
  return l(t, s);
730
761
  }
731
- }, Es = ({
762
+ }, Rs = ({
732
763
  autoplayBehavior: e,
733
764
  activeImageX: t,
734
765
  activeImageY: i,
@@ -738,39 +769,39 @@ const de = /* @__PURE__ */ ii(wi), M = {
738
769
  spinDirection: l
739
770
  }) => {
740
771
  const r = t === (n ? 0 : s - 1), a = i === (n ? 0 : o - 1);
741
- return e === M.SPIN_XY || e === M.SPIN_YX ? l === "x" && r || l === "y" && a : !1;
742
- }, Ss = (e, t, i) => {
772
+ return e === R.SPIN_XY || e === R.SPIN_YX ? l === "x" && r || l === "y" && a : !1;
773
+ }, Hs = (e, t, i) => {
743
774
  if (!i) return "x";
744
775
  if (!t) return "y";
745
776
  switch (e) {
746
- case M.SPIN_XY:
777
+ case R.SPIN_XY:
747
778
  return "x";
748
- case M.SPIN_YX:
779
+ case R.SPIN_YX:
749
780
  return "y";
750
- case M.SPIN_Y:
781
+ case R.SPIN_Y:
751
782
  return "y";
752
- case M.SPIN_X:
783
+ case R.SPIN_X:
753
784
  default:
754
785
  return "x";
755
786
  }
756
- }, As = (e) => e === "x" ? "y" : "x", Ee = (e, t) => {
757
- const i = [...xi];
758
- return t ? [...i, ...Ci].includes(e) : i.includes(e);
759
- }, Se = ({ deltaX: e, deltaY: t, reversed: i, allowSpinX: s, allowSpinY: o, threshold: n = 0 }) => {
787
+ }, Zs = (e) => e === "x" ? "y" : "x", Se = (e, t) => {
788
+ const i = [...ki];
789
+ return t ? [...i, ...Si].includes(e) : i.includes(e);
790
+ }, Te = ({ deltaX: e, deltaY: t, reversed: i, allowSpinX: s, allowSpinY: o, threshold: n = 0 }) => {
760
791
  const l = s && !o || o && !s ? 0 : n, r = Math.abs(e), a = Math.abs(t);
761
792
  return s && r - l > a ? i ? e > 0 ? "left" : "right" : e > 0 ? "right" : "left" : o && a - l > r ? i ? t > 0 ? "up" : "down" : t > 0 ? "down" : "up" : null;
762
- }, Ls = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, ks = (e, t = 150) => {
793
+ }, Ds = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, Bs = (e, t = 150) => {
763
794
  let i;
764
795
  return function(...s) {
765
796
  clearTimeout(i), i = setTimeout(() => {
766
797
  e.apply(this, s);
767
798
  }, t);
768
799
  };
769
- }, Fe = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2FudmFzLndvcmtlci1DZzBma3BEMS5qcy5tYXAK", Ts = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), Ae = typeof self < "u" && self.Blob && new Blob([Ts(Fe)], { type: "text/javascript;charset=utf-8" });
770
- function Ys(e) {
800
+ }, $e = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2FudmFzLndvcmtlci1DZzBma3BEMS5qcy5tYXAK", Ws = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), Le = typeof self < "u" && self.Blob && new Blob([Ws($e)], { type: "text/javascript;charset=utf-8" });
801
+ function Ns(e) {
771
802
  let t;
772
803
  try {
773
- if (t = Ae && (self.URL || self.webkitURL).createObjectURL(Ae), !t) throw "";
804
+ if (t = Le && (self.URL || self.webkitURL).createObjectURL(Le), !t) throw "";
774
805
  const i = new Worker(t, {
775
806
  name: e == null ? void 0 : e.name
776
807
  });
@@ -779,7 +810,7 @@ function Ys(e) {
779
810
  }), i;
780
811
  } catch {
781
812
  return new Worker(
782
- "data:text/javascript;base64," + Fe,
813
+ "data:text/javascript;base64," + $e,
783
814
  {
784
815
  name: e == null ? void 0 : e.name
785
816
  }
@@ -788,7 +819,84 @@ function Ys(e) {
788
819
  t && (self.URL || self.webkitURL).revokeObjectURL(t);
789
820
  }
790
821
  }
791
- const Xs = /* @__PURE__ */ new Set([
822
+ class Fs {
823
+ constructor() {
824
+ this.canvas = null, this.ctx = null, this.dpr = 1, this.drawWidth = 0, this.drawHeight = 0, this.wideImage = !1;
825
+ }
826
+ /**
827
+ * Mimics worker.postMessage() interface
828
+ */
829
+ postMessage(t) {
830
+ const {
831
+ action: i,
832
+ offscreen: s,
833
+ // Will be a regular canvas on main thread
834
+ devicePixelRatio: o,
835
+ imageData: n,
836
+ zoomScale: l,
837
+ pointerX: r,
838
+ pointerY: a,
839
+ imageAspectRatio: c,
840
+ containerWidth: h,
841
+ containerHeight: u
842
+ } = t;
843
+ switch (i) {
844
+ case "initCanvas":
845
+ this.initCanvas(s, o);
846
+ break;
847
+ case "adaptCanvasSize":
848
+ this.adaptCanvasSize(c, h, u);
849
+ break;
850
+ case "drawImageOnCanvas":
851
+ this.drawImageOnCanvas(n, l, r, a);
852
+ break;
853
+ }
854
+ }
855
+ /**
856
+ * Mimics worker.terminate() - cleans up resources
857
+ */
858
+ terminate() {
859
+ var t, i;
860
+ this.ctx && this.ctx.clearRect(0, 0, ((t = this.canvas) == null ? void 0 : t.width) || 0, ((i = this.canvas) == null ? void 0 : i.height) || 0), this.canvas = null, this.ctx = null;
861
+ }
862
+ initCanvas(t, i) {
863
+ this.canvas = t, this.ctx = t.getContext("2d"), this.dpr = i;
864
+ }
865
+ adaptCanvasSize(t, i, s) {
866
+ if (!this.canvas || !this.ctx) return;
867
+ const o = i / s;
868
+ this.wideImage = t > o, this.canvas.width = i * this.dpr, this.canvas.height = s * this.dpr, this.ctx.scale(this.dpr, this.dpr), this.wideImage ? (this.drawWidth = i, this.drawHeight = i / t) : (this.drawHeight = s, this.drawWidth = s * t), this.ctx.imageSmoothingEnabled = !0, this.ctx.imageSmoothingQuality = "high";
869
+ }
870
+ drawImageOnCanvas(t = {}, i = 1, s = 0, o = 0) {
871
+ const { bitmapImage: n } = t;
872
+ if (!this.canvas || !this.ctx || !n) return;
873
+ let l, r;
874
+ if (this.wideImage ? (l = 0, r = (this.canvas.height / this.dpr - this.drawHeight) / 2) : (l = (this.canvas.width / this.dpr - this.drawWidth) / 2, r = 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), i !== 1) {
875
+ const { naturalWidth: a, naturalHeight: c } = t, { zoomedWidth: h, zoomedHeight: u } = Ps(a, c, i), { zoomOffsetX: f, zoomOffsetY: p } = Ms({
876
+ pointerX: s,
877
+ pointerY: o,
878
+ imageData: t,
879
+ zoomedWidth: h,
880
+ zoomedHeight: u,
881
+ drawWidth: this.drawWidth,
882
+ drawHeight: this.drawHeight
883
+ });
884
+ this.ctx.drawImage(
885
+ n,
886
+ f,
887
+ p,
888
+ h,
889
+ u,
890
+ l,
891
+ r,
892
+ this.drawWidth,
893
+ this.drawHeight
894
+ );
895
+ } else
896
+ this.ctx.drawImage(n, l, r, this.drawWidth, this.drawHeight);
897
+ }
898
+ }
899
+ const Vs = /* @__PURE__ */ new Set([
792
900
  // Basic HTML
793
901
  "p",
794
902
  "span",
@@ -847,7 +955,7 @@ const Xs = /* @__PURE__ */ new Set([
847
955
  "lineargradient",
848
956
  "radialgradient",
849
957
  "stop"
850
- ]), Le = {
958
+ ]), Pe = {
851
959
  a: ["href", "title", "target", "rel"],
852
960
  img: ["src", "alt", "title", "width", "height"],
853
961
  button: ["type", "disabled", "name", "value"],
@@ -875,12 +983,12 @@ const Xs = /* @__PURE__ */ new Set([
875
983
  clippath: ["id"],
876
984
  mask: ["id"],
877
985
  "*": ["class", "id", "style"]
878
- }, Ps = [
986
+ }, zs = [
879
987
  /javascript:/gi,
880
988
  /vbscript:/gi,
881
989
  /data:/gi,
882
990
  /on\w+\s*=/gi
883
- ], Rs = (e) => {
991
+ ], js = (e) => {
884
992
  if (typeof e != "string")
885
993
  return "";
886
994
  const t = document.createElement("template");
@@ -888,7 +996,7 @@ const Xs = /* @__PURE__ */ new Set([
888
996
  const i = (s) => {
889
997
  if (Array.from(s.childNodes).forEach(i), s.nodeType === Node.ELEMENT_NODE) {
890
998
  const n = s.tagName.toLowerCase();
891
- if (!Xs.has(n)) {
999
+ if (!Vs.has(n)) {
892
1000
  if (n === "script" || n === "style") {
893
1001
  s.remove();
894
1002
  return;
@@ -898,8 +1006,8 @@ const Xs = /* @__PURE__ */ new Set([
898
1006
  return;
899
1007
  }
900
1008
  const l = [
901
- ...Le[n] || [],
902
- ...Le["*"] || []
1009
+ ...Pe[n] || [],
1010
+ ...Pe["*"] || []
903
1011
  ];
904
1012
  if (Array.from(s.attributes).forEach((a) => {
905
1013
  const c = a.name.toLowerCase();
@@ -912,8 +1020,8 @@ const Xs = /* @__PURE__ */ new Set([
912
1020
  return;
913
1021
  }
914
1022
  let h = a.value;
915
- Ps.forEach((p) => {
916
- p.test(h) && s.removeAttribute(a.name);
1023
+ zs.forEach((u) => {
1024
+ u.test(h) && s.removeAttribute(a.name);
917
1025
  });
918
1026
  }), n === "a") {
919
1027
  const a = s.getAttribute("href");
@@ -926,12 +1034,12 @@ const Xs = /* @__PURE__ */ new Set([
926
1034
  }
927
1035
  };
928
1036
  return i(t.content), t.innerHTML;
929
- }, Ms = (e) => e === "x" ? P.X : P.Y, Hs = (e, t, i) => e.filter(
930
- (s) => Ms(s.orientation) === i && t in s.positions
931
- ), Ds = (e, t) => {
1037
+ }, $s = (e) => e === "x" ? Y.X : Y.Y, Gs = (e, t, i) => e.filter(
1038
+ (s) => $s(s.orientation) === i && t in s.positions
1039
+ ), Us = (e, t) => {
932
1040
  const i = document.createElement("button");
933
1041
  return i.id = e, i.className = "cloudimage-360-hotspot", i.dataset.hotspotId = e, i.setAttribute("type", "button"), i.setAttribute("aria-label", t || `Hotspot ${e}`), i.setAttribute("aria-haspopup", "true"), i.setAttribute("aria-expanded", "false"), i;
934
- }, Zs = (e) => {
1042
+ }, _s = (e) => {
935
1043
  const t = Object.entries(e).sort(([n], [l]) => Number(n) - Number(l));
936
1044
  let i = null, s = null;
937
1045
  const o = {};
@@ -946,7 +1054,7 @@ const Xs = /* @__PURE__ */ new Set([
946
1054
  };
947
1055
  }
948
1056
  return o;
949
- }, Bs = (e) => [
1057
+ }, Ks = (e) => [
950
1058
  {
951
1059
  name: "offset",
952
1060
  options: {
@@ -959,16 +1067,16 @@ const Xs = /* @__PURE__ */ new Set([
959
1067
  boundary: e
960
1068
  }
961
1069
  }
962
- ], Ws = (e, t) => {
1070
+ ], Js = (e, t) => {
963
1071
  const i = document.createElement("div");
964
- return i.className = "cloudimage-360-popper", i.id = `cloudimage-360-popper-${t}`, i.dataset.popperId = t, i.setAttribute("role", "tooltip"), i.setAttribute("aria-hidden", "false"), typeof e == "string" && /<\/?[a-z][\s\S]*>/i.test(e) ? i.innerHTML = Rs(e) : i.textContent = e, document.body.appendChild(i), i;
965
- }, Fs = (e) => {
1072
+ return i.className = "cloudimage-360-popper", i.id = `cloudimage-360-popper-${t}`, i.dataset.popperId = t, i.setAttribute("role", "tooltip"), i.setAttribute("aria-hidden", "false"), typeof e == "string" && /<\/?[a-z][\s\S]*>/i.test(e) ? i.innerHTML = js(e) : i.textContent = e, document.body.appendChild(i), i;
1073
+ }, qs = (e) => {
966
1074
  const t = [...e];
967
1075
  return t.forEach((i, s) => {
968
- const o = { ...Zs(i.positions) };
1076
+ const o = { ..._s(i.positions) };
969
1077
  t[s].initialPositions = o, t[s].positions = o;
970
1078
  }), t;
971
- }, Ns = ({
1079
+ }, Qs = ({
972
1080
  newWidth: e,
973
1081
  newHeight: t,
974
1082
  initialContainerSize: i,
@@ -977,25 +1085,25 @@ const Xs = /* @__PURE__ */ new Set([
977
1085
  }) => {
978
1086
  const [n, l] = i;
979
1087
  let r = e, a = t, c = 0, h = 0;
980
- const p = e / t;
981
- s > p ? (a = e / s, h = (t - a) / 2) : (r = t * s, c = (e - r) / 2);
982
- const u = r / n, I = a / l;
983
- return o.map((g) => {
1088
+ const u = e / t;
1089
+ s > u ? (a = e / s, h = (t - a) / 2) : (r = t * s, c = (e - r) / 2);
1090
+ const p = r / n, I = a / l;
1091
+ return o.map((b) => {
984
1092
  const v = {};
985
- return Object.entries(g.initialPositions).forEach(([m, b]) => {
986
- v[m] = {
987
- x: b.x * u + c,
988
- y: b.y * I + h
1093
+ return Object.entries(b.initialPositions).forEach(([O, E]) => {
1094
+ v[O] = {
1095
+ x: E.x * p + c,
1096
+ y: E.y * I + h
989
1097
  };
990
- }), { ...g, positions: v };
1098
+ }), { ...b, positions: v };
991
1099
  });
992
1100
  };
993
- var H = "top", F = "bottom", N = "right", D = "left", ee = "auto", Tt = [H, F, N, D], ut = "start", Lt = "end", Vs = "clippingParents", Ne = "viewport", Ot = "popper", js = "reference", ke = /* @__PURE__ */ Tt.reduce(function(e, t) {
994
- return e.concat([t + "-" + ut, t + "-" + Lt]);
995
- }, []), Ve = /* @__PURE__ */ [].concat(Tt, [ee]).reduce(function(e, t) {
996
- return e.concat([t, t + "-" + ut, t + "-" + Lt]);
997
- }, []), $s = "beforeRead", zs = "read", Gs = "afterRead", Us = "beforeMain", Ks = "main", _s = "afterMain", Js = "beforeWrite", qs = "write", Qs = "afterWrite", to = [$s, zs, Gs, Us, Ks, _s, Js, qs, Qs];
998
- function $(e) {
1101
+ var H = "top", N = "bottom", F = "right", Z = "left", ie = "auto", St = [H, N, F, Z], mt = "start", At = "end", to = "clippingParents", Ge = "viewport", xt = "popper", eo = "reference", Me = /* @__PURE__ */ St.reduce(function(e, t) {
1102
+ return e.concat([t + "-" + mt, t + "-" + At]);
1103
+ }, []), Ue = /* @__PURE__ */ [].concat(St, [ie]).reduce(function(e, t) {
1104
+ return e.concat([t, t + "-" + mt, t + "-" + At]);
1105
+ }, []), io = "beforeRead", so = "read", oo = "afterRead", no = "beforeMain", ro = "main", ao = "afterMain", lo = "beforeWrite", co = "write", ho = "afterWrite", uo = [io, so, oo, no, ro, ao, lo, co, ho];
1106
+ function j(e) {
999
1107
  return e ? (e.nodeName || "").toLowerCase() : null;
1000
1108
  }
1001
1109
  function B(e) {
@@ -1007,7 +1115,7 @@ function B(e) {
1007
1115
  }
1008
1116
  return e;
1009
1117
  }
1010
- function nt(e) {
1118
+ function st(e) {
1011
1119
  var t = B(e).Element;
1012
1120
  return e instanceof t || e instanceof Element;
1013
1121
  }
@@ -1015,23 +1123,23 @@ function W(e) {
1015
1123
  var t = B(e).HTMLElement;
1016
1124
  return e instanceof t || e instanceof HTMLElement;
1017
1125
  }
1018
- function ie(e) {
1126
+ function se(e) {
1019
1127
  if (typeof ShadowRoot > "u")
1020
1128
  return !1;
1021
1129
  var t = B(e).ShadowRoot;
1022
1130
  return e instanceof t || e instanceof ShadowRoot;
1023
1131
  }
1024
- function eo(e) {
1132
+ function po(e) {
1025
1133
  var t = e.state;
1026
1134
  Object.keys(t.elements).forEach(function(i) {
1027
1135
  var s = t.styles[i] || {}, o = t.attributes[i] || {}, n = t.elements[i];
1028
- !W(n) || !$(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(l) {
1136
+ !W(n) || !j(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(l) {
1029
1137
  var r = o[l];
1030
1138
  r === !1 ? n.removeAttribute(l) : n.setAttribute(l, r === !0 ? "" : r);
1031
1139
  }));
1032
1140
  });
1033
1141
  }
1034
- function io(e) {
1142
+ function mo(e) {
1035
1143
  var t = e.state, i = {
1036
1144
  popper: {
1037
1145
  position: t.options.strategy,
@@ -1049,51 +1157,51 @@ function io(e) {
1049
1157
  var o = t.elements[s], n = t.attributes[s] || {}, l = Object.keys(t.styles.hasOwnProperty(s) ? t.styles[s] : i[s]), r = l.reduce(function(a, c) {
1050
1158
  return a[c] = "", a;
1051
1159
  }, {});
1052
- !W(o) || !$(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) {
1160
+ !W(o) || !j(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) {
1053
1161
  o.removeAttribute(a);
1054
1162
  }));
1055
1163
  });
1056
1164
  };
1057
1165
  }
1058
- const so = {
1166
+ const fo = {
1059
1167
  name: "applyStyles",
1060
1168
  enabled: !0,
1061
1169
  phase: "write",
1062
- fn: eo,
1063
- effect: io,
1170
+ fn: po,
1171
+ effect: mo,
1064
1172
  requires: ["computeStyles"]
1065
1173
  };
1066
- function j(e) {
1174
+ function z(e) {
1067
1175
  return e.split("-")[0];
1068
1176
  }
1069
- var ot = Math.max, Wt = Math.min, pt = Math.round;
1070
- function Qt() {
1177
+ var it = Math.max, Nt = Math.min, ft = Math.round;
1178
+ function te() {
1071
1179
  var e = navigator.userAgentData;
1072
1180
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
1073
1181
  return t.brand + "/" + t.version;
1074
1182
  }).join(" ") : navigator.userAgent;
1075
1183
  }
1076
- function je() {
1077
- return !/^((?!chrome|android).)*safari/i.test(Qt());
1184
+ function _e() {
1185
+ return !/^((?!chrome|android).)*safari/i.test(te());
1078
1186
  }
1079
- function ft(e, t, i) {
1187
+ function vt(e, t, i) {
1080
1188
  t === void 0 && (t = !1), i === void 0 && (i = !1);
1081
1189
  var s = e.getBoundingClientRect(), o = 1, n = 1;
1082
- t && W(e) && (o = e.offsetWidth > 0 && pt(s.width) / e.offsetWidth || 1, n = e.offsetHeight > 0 && pt(s.height) / e.offsetHeight || 1);
1083
- var l = nt(e) ? B(e) : window, r = l.visualViewport, a = !je() && i, c = (s.left + (a && r ? r.offsetLeft : 0)) / o, h = (s.top + (a && r ? r.offsetTop : 0)) / n, p = s.width / o, f = s.height / n;
1190
+ t && W(e) && (o = e.offsetWidth > 0 && ft(s.width) / e.offsetWidth || 1, n = e.offsetHeight > 0 && ft(s.height) / e.offsetHeight || 1);
1191
+ var l = st(e) ? B(e) : window, r = l.visualViewport, a = !_e() && i, c = (s.left + (a && r ? r.offsetLeft : 0)) / o, h = (s.top + (a && r ? r.offsetTop : 0)) / n, u = s.width / o, f = s.height / n;
1084
1192
  return {
1085
- width: p,
1193
+ width: u,
1086
1194
  height: f,
1087
1195
  top: h,
1088
- right: c + p,
1196
+ right: c + u,
1089
1197
  bottom: h + f,
1090
1198
  left: c,
1091
1199
  x: c,
1092
1200
  y: h
1093
1201
  };
1094
1202
  }
1095
- function se(e) {
1096
- var t = ft(e), i = e.offsetWidth, s = e.offsetHeight;
1203
+ function oe(e) {
1204
+ var t = vt(e), i = e.offsetWidth, s = e.offsetHeight;
1097
1205
  return Math.abs(t.width - i) <= 1 && (i = t.width), Math.abs(t.height - s) <= 1 && (s = t.height), {
1098
1206
  x: e.offsetLeft,
1099
1207
  y: e.offsetTop,
@@ -1101,11 +1209,11 @@ function se(e) {
1101
1209
  height: s
1102
1210
  };
1103
1211
  }
1104
- function $e(e, t) {
1212
+ function Ke(e, t) {
1105
1213
  var i = t.getRootNode && t.getRootNode();
1106
1214
  if (e.contains(t))
1107
1215
  return !0;
1108
- if (i && ie(i)) {
1216
+ if (i && se(i)) {
1109
1217
  var s = t;
1110
1218
  do {
1111
1219
  if (s && e.isSameNode(s))
@@ -1118,40 +1226,40 @@ function $e(e, t) {
1118
1226
  function J(e) {
1119
1227
  return B(e).getComputedStyle(e);
1120
1228
  }
1121
- function oo(e) {
1122
- return ["table", "td", "th"].indexOf($(e)) >= 0;
1229
+ function vo(e) {
1230
+ return ["table", "td", "th"].indexOf(j(e)) >= 0;
1123
1231
  }
1124
1232
  function Q(e) {
1125
- return ((nt(e) ? e.ownerDocument : (
1233
+ return ((st(e) ? e.ownerDocument : (
1126
1234
  // $FlowFixMe[prop-missing]
1127
1235
  e.document
1128
1236
  )) || window.document).documentElement;
1129
1237
  }
1130
- function Nt(e) {
1131
- return $(e) === "html" ? e : (
1238
+ function Vt(e) {
1239
+ return j(e) === "html" ? e : (
1132
1240
  // this is a quicker (but less type safe) way to save quite some bytes from the bundle
1133
1241
  // $FlowFixMe[incompatible-return]
1134
1242
  // $FlowFixMe[prop-missing]
1135
1243
  e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
1136
1244
  e.parentNode || // DOM Element detected
1137
- (ie(e) ? e.host : null) || // ShadowRoot detected
1245
+ (se(e) ? e.host : null) || // ShadowRoot detected
1138
1246
  // $FlowFixMe[incompatible-call]: HTMLElement is a Node
1139
1247
  Q(e)
1140
1248
  );
1141
1249
  }
1142
- function Te(e) {
1250
+ function Ye(e) {
1143
1251
  return !W(e) || // https://github.com/popperjs/popper-core/issues/837
1144
1252
  J(e).position === "fixed" ? null : e.offsetParent;
1145
1253
  }
1146
- function no(e) {
1147
- var t = /firefox/i.test(Qt()), i = /Trident/i.test(Qt());
1254
+ function go(e) {
1255
+ var t = /firefox/i.test(te()), i = /Trident/i.test(te());
1148
1256
  if (i && W(e)) {
1149
1257
  var s = J(e);
1150
1258
  if (s.position === "fixed")
1151
1259
  return null;
1152
1260
  }
1153
- var o = Nt(e);
1154
- for (ie(o) && (o = o.host); W(o) && ["html", "body"].indexOf($(o)) < 0; ) {
1261
+ var o = Vt(e);
1262
+ for (se(o) && (o = o.host); W(o) && ["html", "body"].indexOf(j(o)) < 0; ) {
1155
1263
  var n = J(o);
1156
1264
  if (n.transform !== "none" || n.perspective !== "none" || n.contain === "paint" || ["transform", "perspective"].indexOf(n.willChange) !== -1 || t && n.willChange === "filter" || t && n.filter && n.filter !== "none")
1157
1265
  return o;
@@ -1159,22 +1267,22 @@ function no(e) {
1159
1267
  }
1160
1268
  return null;
1161
1269
  }
1162
- function Yt(e) {
1163
- for (var t = B(e), i = Te(e); i && oo(i) && J(i).position === "static"; )
1164
- i = Te(i);
1165
- return i && ($(i) === "html" || $(i) === "body" && J(i).position === "static") ? t : i || no(e) || t;
1270
+ function Tt(e) {
1271
+ for (var t = B(e), i = Ye(e); i && vo(i) && J(i).position === "static"; )
1272
+ i = Ye(i);
1273
+ return i && (j(i) === "html" || j(i) === "body" && J(i).position === "static") ? t : i || go(e) || t;
1166
1274
  }
1167
- function oe(e) {
1275
+ function ne(e) {
1168
1276
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
1169
1277
  }
1170
- function St(e, t, i) {
1171
- return ot(e, Wt(t, i));
1278
+ function Ot(e, t, i) {
1279
+ return it(e, Nt(t, i));
1172
1280
  }
1173
- function ro(e, t, i) {
1174
- var s = St(e, t, i);
1281
+ function yo(e, t, i) {
1282
+ var s = Ot(e, t, i);
1175
1283
  return s > i ? i : s;
1176
1284
  }
1177
- function ze() {
1285
+ function Je() {
1178
1286
  return {
1179
1287
  top: 0,
1180
1288
  right: 0,
@@ -1182,114 +1290,114 @@ function ze() {
1182
1290
  left: 0
1183
1291
  };
1184
1292
  }
1185
- function Ge(e) {
1186
- return Object.assign({}, ze(), e);
1293
+ function qe(e) {
1294
+ return Object.assign({}, Je(), e);
1187
1295
  }
1188
- function Ue(e, t) {
1296
+ function Qe(e, t) {
1189
1297
  return t.reduce(function(i, s) {
1190
1298
  return i[s] = e, i;
1191
1299
  }, {});
1192
1300
  }
1193
- var ao = function(t, i) {
1301
+ var bo = function(t, i) {
1194
1302
  return t = typeof t == "function" ? t(Object.assign({}, i.rects, {
1195
1303
  placement: i.placement
1196
- })) : t, Ge(typeof t != "number" ? t : Ue(t, Tt));
1304
+ })) : t, qe(typeof t != "number" ? t : Qe(t, St));
1197
1305
  };
1198
- function lo(e) {
1199
- var t, i = e.state, s = e.name, o = e.options, n = i.elements.arrow, l = i.modifiersData.popperOffsets, r = j(i.placement), a = oe(r), c = [D, N].indexOf(r) >= 0, h = c ? "height" : "width";
1306
+ function wo(e) {
1307
+ var t, i = e.state, s = e.name, o = e.options, n = i.elements.arrow, l = i.modifiersData.popperOffsets, r = z(i.placement), a = ne(r), c = [Z, F].indexOf(r) >= 0, h = c ? "height" : "width";
1200
1308
  if (!(!n || !l)) {
1201
- var p = ao(o.padding, i), f = se(n), u = a === "y" ? H : D, I = a === "y" ? F : N, g = i.rects.reference[h] + i.rects.reference[a] - l[a] - i.rects.popper[h], v = l[a] - i.rects.reference[a], m = Yt(n), b = m ? a === "y" ? m.clientHeight || 0 : m.clientWidth || 0 : 0, x = g / 2 - v / 2, w = p[u], C = b - f[h] - p[I], y = b / 2 - f[h] / 2 + x, O = St(w, y, C), S = a;
1202
- i.modifiersData[s] = (t = {}, t[S] = O, t.centerOffset = O - y, t);
1309
+ var u = bo(o.padding, i), f = oe(n), p = a === "y" ? H : Z, I = a === "y" ? N : F, b = i.rects.reference[h] + i.rects.reference[a] - l[a] - i.rects.popper[h], v = l[a] - i.rects.reference[a], O = Tt(n), E = O ? a === "y" ? O.clientHeight || 0 : O.clientWidth || 0 : 0, w = b / 2 - v / 2, y = u[p], C = E - f[h] - u[I], m = E / 2 - f[h] / 2 + w, g = Ot(y, m, C), x = a;
1310
+ i.modifiersData[s] = (t = {}, t[x] = g, t.centerOffset = g - m, t);
1203
1311
  }
1204
1312
  }
1205
- function co(e) {
1313
+ function Io(e) {
1206
1314
  var t = e.state, i = e.options, s = i.element, o = s === void 0 ? "[data-popper-arrow]" : s;
1207
- o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || $e(t.elements.popper, o) && (t.elements.arrow = o));
1315
+ o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || Ke(t.elements.popper, o) && (t.elements.arrow = o));
1208
1316
  }
1209
- const ho = {
1317
+ const xo = {
1210
1318
  name: "arrow",
1211
1319
  enabled: !0,
1212
1320
  phase: "main",
1213
- fn: lo,
1214
- effect: co,
1321
+ fn: wo,
1322
+ effect: Io,
1215
1323
  requires: ["popperOffsets"],
1216
1324
  requiresIfExists: ["preventOverflow"]
1217
1325
  };
1218
- function mt(e) {
1326
+ function gt(e) {
1219
1327
  return e.split("-")[1];
1220
1328
  }
1221
- var uo = {
1329
+ var Co = {
1222
1330
  top: "auto",
1223
1331
  right: "auto",
1224
1332
  bottom: "auto",
1225
1333
  left: "auto"
1226
1334
  };
1227
- function po(e, t) {
1335
+ function Oo(e, t) {
1228
1336
  var i = e.x, s = e.y, o = t.devicePixelRatio || 1;
1229
1337
  return {
1230
- x: pt(i * o) / o || 0,
1231
- y: pt(s * o) / o || 0
1338
+ x: ft(i * o) / o || 0,
1339
+ y: ft(s * o) / o || 0
1232
1340
  };
1233
1341
  }
1234
- function Ye(e) {
1235
- var t, i = e.popper, s = e.popperRect, o = e.placement, n = e.variation, l = e.offsets, r = e.position, a = e.gpuAcceleration, c = e.adaptive, h = e.roundOffsets, p = e.isFixed, f = l.x, u = f === void 0 ? 0 : f, I = l.y, g = I === void 0 ? 0 : I, v = typeof h == "function" ? h({
1236
- x: u,
1237
- y: g
1342
+ function Xe(e) {
1343
+ var t, i = e.popper, s = e.popperRect, o = e.placement, n = e.variation, l = e.offsets, r = e.position, a = e.gpuAcceleration, c = e.adaptive, h = e.roundOffsets, u = e.isFixed, f = l.x, p = f === void 0 ? 0 : f, I = l.y, b = I === void 0 ? 0 : I, v = typeof h == "function" ? h({
1344
+ x: p,
1345
+ y: b
1238
1346
  }) : {
1239
- x: u,
1240
- y: g
1347
+ x: p,
1348
+ y: b
1241
1349
  };
1242
- u = v.x, g = v.y;
1243
- var m = l.hasOwnProperty("x"), b = l.hasOwnProperty("y"), x = D, w = H, C = window;
1350
+ p = v.x, b = v.y;
1351
+ var O = l.hasOwnProperty("x"), E = l.hasOwnProperty("y"), w = Z, y = H, C = window;
1244
1352
  if (c) {
1245
- var y = Yt(i), O = "clientHeight", S = "clientWidth";
1246
- if (y === B(i) && (y = Q(i), J(y).position !== "static" && r === "absolute" && (O = "scrollHeight", S = "scrollWidth")), y = y, o === H || (o === D || o === N) && n === Lt) {
1247
- w = F;
1248
- var E = p && y === C && C.visualViewport ? C.visualViewport.height : (
1353
+ var m = Tt(i), g = "clientHeight", x = "clientWidth";
1354
+ if (m === B(i) && (m = Q(i), J(m).position !== "static" && r === "absolute" && (g = "scrollHeight", x = "scrollWidth")), m = m, o === H || (o === Z || o === F) && n === At) {
1355
+ y = N;
1356
+ var A = u && m === C && C.visualViewport ? C.visualViewport.height : (
1249
1357
  // $FlowFixMe[prop-missing]
1250
- y[O]
1358
+ m[g]
1251
1359
  );
1252
- g -= E - s.height, g *= a ? 1 : -1;
1360
+ b -= A - s.height, b *= a ? 1 : -1;
1253
1361
  }
1254
- if (o === D || (o === H || o === F) && n === Lt) {
1255
- x = N;
1256
- var A = p && y === C && C.visualViewport ? C.visualViewport.width : (
1362
+ if (o === Z || (o === H || o === N) && n === At) {
1363
+ w = F;
1364
+ var k = u && m === C && C.visualViewport ? C.visualViewport.width : (
1257
1365
  // $FlowFixMe[prop-missing]
1258
- y[S]
1366
+ m[x]
1259
1367
  );
1260
- u -= A - s.width, u *= a ? 1 : -1;
1368
+ p -= k - s.width, p *= a ? 1 : -1;
1261
1369
  }
1262
1370
  }
1263
- var k = Object.assign({
1371
+ var T = Object.assign({
1264
1372
  position: r
1265
- }, c && uo), R = h === !0 ? po({
1266
- x: u,
1267
- y: g
1373
+ }, c && Co), X = h === !0 ? Oo({
1374
+ x: p,
1375
+ y: b
1268
1376
  }, B(i)) : {
1269
- x: u,
1270
- y: g
1377
+ x: p,
1378
+ y: b
1271
1379
  };
1272
- if (u = R.x, g = R.y, a) {
1273
- var T;
1274
- return Object.assign({}, k, (T = {}, T[w] = b ? "0" : "", T[x] = m ? "0" : "", T.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + u + "px, " + g + "px)" : "translate3d(" + u + "px, " + g + "px, 0)", T));
1380
+ if (p = X.x, b = X.y, a) {
1381
+ var L;
1382
+ return Object.assign({}, T, (L = {}, L[y] = E ? "0" : "", L[w] = O ? "0" : "", L.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + b + "px)" : "translate3d(" + p + "px, " + b + "px, 0)", L));
1275
1383
  }
1276
- return Object.assign({}, k, (t = {}, t[w] = b ? g + "px" : "", t[x] = m ? u + "px" : "", t.transform = "", t));
1384
+ return Object.assign({}, T, (t = {}, t[y] = E ? b + "px" : "", t[w] = O ? p + "px" : "", t.transform = "", t));
1277
1385
  }
1278
- function fo(e) {
1386
+ function Eo(e) {
1279
1387
  var t = e.state, i = e.options, s = i.gpuAcceleration, o = s === void 0 ? !0 : s, n = i.adaptive, l = n === void 0 ? !0 : n, r = i.roundOffsets, a = r === void 0 ? !0 : r, c = {
1280
- placement: j(t.placement),
1281
- variation: mt(t.placement),
1388
+ placement: z(t.placement),
1389
+ variation: gt(t.placement),
1282
1390
  popper: t.elements.popper,
1283
1391
  popperRect: t.rects.popper,
1284
1392
  gpuAcceleration: o,
1285
1393
  isFixed: t.options.strategy === "fixed"
1286
1394
  };
1287
- t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Ye(Object.assign({}, c, {
1395
+ t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Xe(Object.assign({}, c, {
1288
1396
  offsets: t.modifiersData.popperOffsets,
1289
1397
  position: t.options.strategy,
1290
1398
  adaptive: l,
1291
1399
  roundOffsets: a
1292
- })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Ye(Object.assign({}, c, {
1400
+ })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Xe(Object.assign({}, c, {
1293
1401
  offsets: t.modifiersData.arrow,
1294
1402
  position: "absolute",
1295
1403
  adaptive: !1,
@@ -1298,17 +1406,17 @@ function fo(e) {
1298
1406
  "data-popper-placement": t.placement
1299
1407
  });
1300
1408
  }
1301
- const mo = {
1409
+ const Ao = {
1302
1410
  name: "computeStyles",
1303
1411
  enabled: !0,
1304
1412
  phase: "beforeWrite",
1305
- fn: fo,
1413
+ fn: Eo,
1306
1414
  data: {}
1307
1415
  };
1308
1416
  var Dt = {
1309
1417
  passive: !0
1310
1418
  };
1311
- function vo(e) {
1419
+ function ko(e) {
1312
1420
  var t = e.state, i = e.instance, s = e.options, o = s.scroll, n = o === void 0 ? !0 : o, l = s.resize, r = l === void 0 ? !0 : l, a = B(t.elements.popper), c = [].concat(t.scrollParents.reference, t.scrollParents.popper);
1313
1421
  return n && c.forEach(function(h) {
1314
1422
  h.addEventListener("scroll", i.update, Dt);
@@ -1318,85 +1426,85 @@ function vo(e) {
1318
1426
  }), r && a.removeEventListener("resize", i.update, Dt);
1319
1427
  };
1320
1428
  }
1321
- const go = {
1429
+ const So = {
1322
1430
  name: "eventListeners",
1323
1431
  enabled: !0,
1324
1432
  phase: "write",
1325
1433
  fn: function() {
1326
1434
  },
1327
- effect: vo,
1435
+ effect: ko,
1328
1436
  data: {}
1329
1437
  };
1330
- var yo = {
1438
+ var To = {
1331
1439
  left: "right",
1332
1440
  right: "left",
1333
1441
  bottom: "top",
1334
1442
  top: "bottom"
1335
1443
  };
1336
- function Zt(e) {
1444
+ function Bt(e) {
1337
1445
  return e.replace(/left|right|bottom|top/g, function(t) {
1338
- return yo[t];
1446
+ return To[t];
1339
1447
  });
1340
1448
  }
1341
- var bo = {
1449
+ var Lo = {
1342
1450
  start: "end",
1343
1451
  end: "start"
1344
1452
  };
1345
- function Xe(e) {
1453
+ function Re(e) {
1346
1454
  return e.replace(/start|end/g, function(t) {
1347
- return bo[t];
1455
+ return Lo[t];
1348
1456
  });
1349
1457
  }
1350
- function ne(e) {
1458
+ function re(e) {
1351
1459
  var t = B(e), i = t.pageXOffset, s = t.pageYOffset;
1352
1460
  return {
1353
1461
  scrollLeft: i,
1354
1462
  scrollTop: s
1355
1463
  };
1356
1464
  }
1357
- function re(e) {
1358
- return ft(Q(e)).left + ne(e).scrollLeft;
1465
+ function ae(e) {
1466
+ return vt(Q(e)).left + re(e).scrollLeft;
1359
1467
  }
1360
- function wo(e, t) {
1468
+ function Po(e, t) {
1361
1469
  var i = B(e), s = Q(e), o = i.visualViewport, n = s.clientWidth, l = s.clientHeight, r = 0, a = 0;
1362
1470
  if (o) {
1363
1471
  n = o.width, l = o.height;
1364
- var c = je();
1472
+ var c = _e();
1365
1473
  (c || !c && t === "fixed") && (r = o.offsetLeft, a = o.offsetTop);
1366
1474
  }
1367
1475
  return {
1368
1476
  width: n,
1369
1477
  height: l,
1370
- x: r + re(e),
1478
+ x: r + ae(e),
1371
1479
  y: a
1372
1480
  };
1373
1481
  }
1374
- function Io(e) {
1375
- var t, i = Q(e), s = ne(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, n = ot(i.scrollWidth, i.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), l = ot(i.scrollHeight, i.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), r = -s.scrollLeft + re(e), a = -s.scrollTop;
1376
- return J(o || i).direction === "rtl" && (r += ot(i.clientWidth, o ? o.clientWidth : 0) - n), {
1482
+ function Mo(e) {
1483
+ var t, i = Q(e), s = re(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, n = it(i.scrollWidth, i.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), l = it(i.scrollHeight, i.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), r = -s.scrollLeft + ae(e), a = -s.scrollTop;
1484
+ return J(o || i).direction === "rtl" && (r += it(i.clientWidth, o ? o.clientWidth : 0) - n), {
1377
1485
  width: n,
1378
1486
  height: l,
1379
1487
  x: r,
1380
1488
  y: a
1381
1489
  };
1382
1490
  }
1383
- function ae(e) {
1491
+ function le(e) {
1384
1492
  var t = J(e), i = t.overflow, s = t.overflowX, o = t.overflowY;
1385
1493
  return /auto|scroll|overlay|hidden/.test(i + o + s);
1386
1494
  }
1387
- function Ke(e) {
1388
- return ["html", "body", "#document"].indexOf($(e)) >= 0 ? e.ownerDocument.body : W(e) && ae(e) ? e : Ke(Nt(e));
1495
+ function ti(e) {
1496
+ return ["html", "body", "#document"].indexOf(j(e)) >= 0 ? e.ownerDocument.body : W(e) && le(e) ? e : ti(Vt(e));
1389
1497
  }
1390
- function At(e, t) {
1498
+ function Et(e, t) {
1391
1499
  var i;
1392
1500
  t === void 0 && (t = []);
1393
- var s = Ke(e), o = s === ((i = e.ownerDocument) == null ? void 0 : i.body), n = B(s), l = o ? [n].concat(n.visualViewport || [], ae(s) ? s : []) : s, r = t.concat(l);
1501
+ var s = ti(e), o = s === ((i = e.ownerDocument) == null ? void 0 : i.body), n = B(s), l = o ? [n].concat(n.visualViewport || [], le(s) ? s : []) : s, r = t.concat(l);
1394
1502
  return o ? r : (
1395
1503
  // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
1396
- r.concat(At(Nt(l)))
1504
+ r.concat(Et(Vt(l)))
1397
1505
  );
1398
1506
  }
1399
- function te(e) {
1507
+ function ee(e) {
1400
1508
  return Object.assign({}, e, {
1401
1509
  left: e.x,
1402
1510
  top: e.y,
@@ -1404,28 +1512,28 @@ function te(e) {
1404
1512
  bottom: e.y + e.height
1405
1513
  });
1406
1514
  }
1407
- function xo(e, t) {
1408
- var i = ft(e, !1, t === "fixed");
1515
+ function Yo(e, t) {
1516
+ var i = vt(e, !1, t === "fixed");
1409
1517
  return i.top = i.top + e.clientTop, i.left = i.left + e.clientLeft, i.bottom = i.top + e.clientHeight, i.right = i.left + e.clientWidth, i.width = e.clientWidth, i.height = e.clientHeight, i.x = i.left, i.y = i.top, i;
1410
1518
  }
1411
- function Pe(e, t, i) {
1412
- return t === Ne ? te(wo(e, i)) : nt(t) ? xo(t, i) : te(Io(Q(e)));
1519
+ function He(e, t, i) {
1520
+ return t === Ge ? ee(Po(e, i)) : st(t) ? Yo(t, i) : ee(Mo(Q(e)));
1413
1521
  }
1414
- function Co(e) {
1415
- var t = At(Nt(e)), i = ["absolute", "fixed"].indexOf(J(e).position) >= 0, s = i && W(e) ? Yt(e) : e;
1416
- return nt(s) ? t.filter(function(o) {
1417
- return nt(o) && $e(o, s) && $(o) !== "body";
1522
+ function Xo(e) {
1523
+ var t = Et(Vt(e)), i = ["absolute", "fixed"].indexOf(J(e).position) >= 0, s = i && W(e) ? Tt(e) : e;
1524
+ return st(s) ? t.filter(function(o) {
1525
+ return st(o) && Ke(o, s) && j(o) !== "body";
1418
1526
  }) : [];
1419
1527
  }
1420
- function Oo(e, t, i, s) {
1421
- var o = t === "clippingParents" ? Co(e) : [].concat(t), n = [].concat(o, [i]), l = n[0], r = n.reduce(function(a, c) {
1422
- var h = Pe(e, c, s);
1423
- return a.top = ot(h.top, a.top), a.right = Wt(h.right, a.right), a.bottom = Wt(h.bottom, a.bottom), a.left = ot(h.left, a.left), a;
1424
- }, Pe(e, l, s));
1528
+ function Ro(e, t, i, s) {
1529
+ var o = t === "clippingParents" ? Xo(e) : [].concat(t), n = [].concat(o, [i]), l = n[0], r = n.reduce(function(a, c) {
1530
+ var h = He(e, c, s);
1531
+ return a.top = it(h.top, a.top), a.right = Nt(h.right, a.right), a.bottom = Nt(h.bottom, a.bottom), a.left = it(h.left, a.left), a;
1532
+ }, He(e, l, s));
1425
1533
  return r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
1426
1534
  }
1427
- function _e(e) {
1428
- var t = e.reference, i = e.element, s = e.placement, o = s ? j(s) : null, n = s ? mt(s) : null, l = t.x + t.width / 2 - i.width / 2, r = t.y + t.height / 2 - i.height / 2, a;
1535
+ function ei(e) {
1536
+ var t = e.reference, i = e.element, s = e.placement, o = s ? z(s) : null, n = s ? gt(s) : null, l = t.x + t.width / 2 - i.width / 2, r = t.y + t.height / 2 - i.height / 2, a;
1429
1537
  switch (o) {
1430
1538
  case H:
1431
1539
  a = {
@@ -1433,19 +1541,19 @@ function _e(e) {
1433
1541
  y: t.y - i.height
1434
1542
  };
1435
1543
  break;
1436
- case F:
1544
+ case N:
1437
1545
  a = {
1438
1546
  x: l,
1439
1547
  y: t.y + t.height
1440
1548
  };
1441
1549
  break;
1442
- case N:
1550
+ case F:
1443
1551
  a = {
1444
1552
  x: t.x + t.width,
1445
1553
  y: r
1446
1554
  };
1447
1555
  break;
1448
- case D:
1556
+ case Z:
1449
1557
  a = {
1450
1558
  x: t.x - i.width,
1451
1559
  y: r
@@ -1457,14 +1565,14 @@ function _e(e) {
1457
1565
  y: t.y
1458
1566
  };
1459
1567
  }
1460
- var c = o ? oe(o) : null;
1568
+ var c = o ? ne(o) : null;
1461
1569
  if (c != null) {
1462
1570
  var h = c === "y" ? "height" : "width";
1463
1571
  switch (n) {
1464
- case ut:
1572
+ case mt:
1465
1573
  a[c] = a[c] - (t[h] / 2 - i[h] / 2);
1466
1574
  break;
1467
- case Lt:
1575
+ case At:
1468
1576
  a[c] = a[c] + (t[h] / 2 - i[h] / 2);
1469
1577
  break;
1470
1578
  }
@@ -1473,110 +1581,110 @@ function _e(e) {
1473
1581
  }
1474
1582
  function kt(e, t) {
1475
1583
  t === void 0 && (t = {});
1476
- var i = t, s = i.placement, o = s === void 0 ? e.placement : s, n = i.strategy, l = n === void 0 ? e.strategy : n, r = i.boundary, a = r === void 0 ? Vs : r, c = i.rootBoundary, h = c === void 0 ? Ne : c, p = i.elementContext, f = p === void 0 ? Ot : p, u = i.altBoundary, I = u === void 0 ? !1 : u, g = i.padding, v = g === void 0 ? 0 : g, m = Ge(typeof v != "number" ? v : Ue(v, Tt)), b = f === Ot ? js : Ot, x = e.rects.popper, w = e.elements[I ? b : f], C = Oo(nt(w) ? w : w.contextElement || Q(e.elements.popper), a, h, l), y = ft(e.elements.reference), O = _e({
1477
- reference: y,
1478
- element: x,
1584
+ var i = t, s = i.placement, o = s === void 0 ? e.placement : s, n = i.strategy, l = n === void 0 ? e.strategy : n, r = i.boundary, a = r === void 0 ? to : r, c = i.rootBoundary, h = c === void 0 ? Ge : c, u = i.elementContext, f = u === void 0 ? xt : u, p = i.altBoundary, I = p === void 0 ? !1 : p, b = i.padding, v = b === void 0 ? 0 : b, O = qe(typeof v != "number" ? v : Qe(v, St)), E = f === xt ? eo : xt, w = e.rects.popper, y = e.elements[I ? E : f], C = Ro(st(y) ? y : y.contextElement || Q(e.elements.popper), a, h, l), m = vt(e.elements.reference), g = ei({
1585
+ reference: m,
1586
+ element: w,
1479
1587
  placement: o
1480
- }), S = te(Object.assign({}, x, O)), E = f === Ot ? S : y, A = {
1481
- top: C.top - E.top + m.top,
1482
- bottom: E.bottom - C.bottom + m.bottom,
1483
- left: C.left - E.left + m.left,
1484
- right: E.right - C.right + m.right
1485
- }, k = e.modifiersData.offset;
1486
- if (f === Ot && k) {
1487
- var R = k[o];
1488
- Object.keys(A).forEach(function(T) {
1489
- var z = [N, F].indexOf(T) >= 0 ? 1 : -1, G = [H, F].indexOf(T) >= 0 ? "y" : "x";
1490
- A[T] += R[G] * z;
1588
+ }), x = ee(Object.assign({}, w, g)), A = f === xt ? x : m, k = {
1589
+ top: C.top - A.top + O.top,
1590
+ bottom: A.bottom - C.bottom + O.bottom,
1591
+ left: C.left - A.left + O.left,
1592
+ right: A.right - C.right + O.right
1593
+ }, T = e.modifiersData.offset;
1594
+ if (f === xt && T) {
1595
+ var X = T[o];
1596
+ Object.keys(k).forEach(function(L) {
1597
+ var $ = [F, N].indexOf(L) >= 0 ? 1 : -1, G = [H, N].indexOf(L) >= 0 ? "y" : "x";
1598
+ k[L] += X[G] * $;
1491
1599
  });
1492
1600
  }
1493
- return A;
1601
+ return k;
1494
1602
  }
1495
- function Eo(e, t) {
1603
+ function Ho(e, t) {
1496
1604
  t === void 0 && (t = {});
1497
- var i = t, s = i.placement, o = i.boundary, n = i.rootBoundary, l = i.padding, r = i.flipVariations, a = i.allowedAutoPlacements, c = a === void 0 ? Ve : a, h = mt(s), p = h ? r ? ke : ke.filter(function(I) {
1498
- return mt(I) === h;
1499
- }) : Tt, f = p.filter(function(I) {
1605
+ var i = t, s = i.placement, o = i.boundary, n = i.rootBoundary, l = i.padding, r = i.flipVariations, a = i.allowedAutoPlacements, c = a === void 0 ? Ue : a, h = gt(s), u = h ? r ? Me : Me.filter(function(I) {
1606
+ return gt(I) === h;
1607
+ }) : St, f = u.filter(function(I) {
1500
1608
  return c.indexOf(I) >= 0;
1501
1609
  });
1502
- f.length === 0 && (f = p);
1503
- var u = f.reduce(function(I, g) {
1504
- return I[g] = kt(e, {
1505
- placement: g,
1610
+ f.length === 0 && (f = u);
1611
+ var p = f.reduce(function(I, b) {
1612
+ return I[b] = kt(e, {
1613
+ placement: b,
1506
1614
  boundary: o,
1507
1615
  rootBoundary: n,
1508
1616
  padding: l
1509
- })[j(g)], I;
1617
+ })[z(b)], I;
1510
1618
  }, {});
1511
- return Object.keys(u).sort(function(I, g) {
1512
- return u[I] - u[g];
1619
+ return Object.keys(p).sort(function(I, b) {
1620
+ return p[I] - p[b];
1513
1621
  });
1514
1622
  }
1515
- function So(e) {
1516
- if (j(e) === ee)
1623
+ function Zo(e) {
1624
+ if (z(e) === ie)
1517
1625
  return [];
1518
- var t = Zt(e);
1519
- return [Xe(e), t, Xe(t)];
1626
+ var t = Bt(e);
1627
+ return [Re(e), t, Re(t)];
1520
1628
  }
1521
- function Ao(e) {
1629
+ function Do(e) {
1522
1630
  var t = e.state, i = e.options, s = e.name;
1523
1631
  if (!t.modifiersData[s]._skip) {
1524
- for (var o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !0 : l, a = i.fallbackPlacements, c = i.padding, h = i.boundary, p = i.rootBoundary, f = i.altBoundary, u = i.flipVariations, I = u === void 0 ? !0 : u, g = i.allowedAutoPlacements, v = t.options.placement, m = j(v), b = m === v, x = a || (b || !I ? [Zt(v)] : So(v)), w = [v].concat(x).reduce(function(q, V) {
1525
- return q.concat(j(V) === ee ? Eo(t, {
1632
+ for (var o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !0 : l, a = i.fallbackPlacements, c = i.padding, h = i.boundary, u = i.rootBoundary, f = i.altBoundary, p = i.flipVariations, I = p === void 0 ? !0 : p, b = i.allowedAutoPlacements, v = t.options.placement, O = z(v), E = O === v, w = a || (E || !I ? [Bt(v)] : Zo(v)), y = [v].concat(w).reduce(function(q, V) {
1633
+ return q.concat(z(V) === ie ? Ho(t, {
1526
1634
  placement: V,
1527
1635
  boundary: h,
1528
- rootBoundary: p,
1636
+ rootBoundary: u,
1529
1637
  padding: c,
1530
1638
  flipVariations: I,
1531
- allowedAutoPlacements: g
1639
+ allowedAutoPlacements: b
1532
1640
  }) : V);
1533
- }, []), C = t.rects.reference, y = t.rects.popper, O = /* @__PURE__ */ new Map(), S = !0, E = w[0], A = 0; A < w.length; A++) {
1534
- var k = w[A], R = j(k), T = mt(k) === ut, z = [H, F].indexOf(R) >= 0, G = z ? "width" : "height", Y = kt(t, {
1535
- placement: k,
1641
+ }, []), C = t.rects.reference, m = t.rects.popper, g = /* @__PURE__ */ new Map(), x = !0, A = y[0], k = 0; k < y.length; k++) {
1642
+ var T = y[k], X = z(T), L = gt(T) === mt, $ = [H, N].indexOf(X) >= 0, G = $ ? "width" : "height", P = kt(t, {
1643
+ placement: T,
1536
1644
  boundary: h,
1537
- rootBoundary: p,
1645
+ rootBoundary: u,
1538
1646
  altBoundary: f,
1539
1647
  padding: c
1540
- }), Z = z ? T ? N : D : T ? F : H;
1541
- C[G] > y[G] && (Z = Zt(Z));
1542
- var rt = Zt(Z), U = [];
1543
- if (n && U.push(Y[R] <= 0), r && U.push(Y[Z] <= 0, Y[rt] <= 0), U.every(function(q) {
1648
+ }), D = $ ? L ? F : Z : L ? N : H;
1649
+ C[G] > m[G] && (D = Bt(D));
1650
+ var ot = Bt(D), U = [];
1651
+ if (n && U.push(P[X] <= 0), r && U.push(P[D] <= 0, P[ot] <= 0), U.every(function(q) {
1544
1652
  return q;
1545
1653
  })) {
1546
- E = k, S = !1;
1654
+ A = T, x = !1;
1547
1655
  break;
1548
1656
  }
1549
- O.set(k, U);
1657
+ g.set(T, U);
1550
1658
  }
1551
- if (S)
1552
- for (var at = I ? 3 : 1, vt = function(V) {
1553
- var et = w.find(function(it) {
1554
- var K = O.get(it);
1555
- if (K)
1556
- return K.slice(0, V).every(function(ct) {
1557
- return ct;
1659
+ if (x)
1660
+ for (var nt = I ? 3 : 1, yt = function(V) {
1661
+ var et = y.find(function(at) {
1662
+ var _ = g.get(at);
1663
+ if (_)
1664
+ return _.slice(0, V).every(function(lt) {
1665
+ return lt;
1558
1666
  });
1559
1667
  });
1560
1668
  if (et)
1561
- return E = et, "break";
1562
- }, tt = at; tt > 0; tt--) {
1563
- var lt = vt(tt);
1564
- if (lt === "break") break;
1669
+ return A = et, "break";
1670
+ }, tt = nt; tt > 0; tt--) {
1671
+ var rt = yt(tt);
1672
+ if (rt === "break") break;
1565
1673
  }
1566
- t.placement !== E && (t.modifiersData[s]._skip = !0, t.placement = E, t.reset = !0);
1674
+ t.placement !== A && (t.modifiersData[s]._skip = !0, t.placement = A, t.reset = !0);
1567
1675
  }
1568
1676
  }
1569
- const Lo = {
1677
+ const Bo = {
1570
1678
  name: "flip",
1571
1679
  enabled: !0,
1572
1680
  phase: "main",
1573
- fn: Ao,
1681
+ fn: Do,
1574
1682
  requiresIfExists: ["offset"],
1575
1683
  data: {
1576
1684
  _skip: !1
1577
1685
  }
1578
1686
  };
1579
- function Re(e, t, i) {
1687
+ function Ze(e, t, i) {
1580
1688
  return i === void 0 && (i = {
1581
1689
  x: 0,
1582
1690
  y: 0
@@ -1587,39 +1695,39 @@ function Re(e, t, i) {
1587
1695
  left: e.left - t.width - i.x
1588
1696
  };
1589
1697
  }
1590
- function Me(e) {
1591
- return [H, N, F, D].some(function(t) {
1698
+ function De(e) {
1699
+ return [H, F, N, Z].some(function(t) {
1592
1700
  return e[t] >= 0;
1593
1701
  });
1594
1702
  }
1595
- function ko(e) {
1703
+ function Wo(e) {
1596
1704
  var t = e.state, i = e.name, s = t.rects.reference, o = t.rects.popper, n = t.modifiersData.preventOverflow, l = kt(t, {
1597
1705
  elementContext: "reference"
1598
1706
  }), r = kt(t, {
1599
1707
  altBoundary: !0
1600
- }), a = Re(l, s), c = Re(r, o, n), h = Me(a), p = Me(c);
1708
+ }), a = Ze(l, s), c = Ze(r, o, n), h = De(a), u = De(c);
1601
1709
  t.modifiersData[i] = {
1602
1710
  referenceClippingOffsets: a,
1603
1711
  popperEscapeOffsets: c,
1604
1712
  isReferenceHidden: h,
1605
- hasPopperEscaped: p
1713
+ hasPopperEscaped: u
1606
1714
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
1607
1715
  "data-popper-reference-hidden": h,
1608
- "data-popper-escaped": p
1716
+ "data-popper-escaped": u
1609
1717
  });
1610
1718
  }
1611
- const To = {
1719
+ const No = {
1612
1720
  name: "hide",
1613
1721
  enabled: !0,
1614
1722
  phase: "main",
1615
1723
  requiresIfExists: ["preventOverflow"],
1616
- fn: ko
1724
+ fn: Wo
1617
1725
  };
1618
- function Yo(e, t, i) {
1619
- var s = j(e), o = [D, H].indexOf(s) >= 0 ? -1 : 1, n = typeof i == "function" ? i(Object.assign({}, t, {
1726
+ function Fo(e, t, i) {
1727
+ var s = z(e), o = [Z, H].indexOf(s) >= 0 ? -1 : 1, n = typeof i == "function" ? i(Object.assign({}, t, {
1620
1728
  placement: e
1621
1729
  })) : i, l = n[0], r = n[1];
1622
- return l = l || 0, r = (r || 0) * o, [D, N].indexOf(s) >= 0 ? {
1730
+ return l = l || 0, r = (r || 0) * o, [Z, F].indexOf(s) >= 0 ? {
1623
1731
  x: r,
1624
1732
  y: l
1625
1733
  } : {
@@ -1627,108 +1735,108 @@ function Yo(e, t, i) {
1627
1735
  y: r
1628
1736
  };
1629
1737
  }
1630
- function Xo(e) {
1631
- var t = e.state, i = e.options, s = e.name, o = i.offset, n = o === void 0 ? [0, 0] : o, l = Ve.reduce(function(h, p) {
1632
- return h[p] = Yo(p, t.rects, n), h;
1738
+ function Vo(e) {
1739
+ var t = e.state, i = e.options, s = e.name, o = i.offset, n = o === void 0 ? [0, 0] : o, l = Ue.reduce(function(h, u) {
1740
+ return h[u] = Fo(u, t.rects, n), h;
1633
1741
  }, {}), r = l[t.placement], a = r.x, c = r.y;
1634
1742
  t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a, t.modifiersData.popperOffsets.y += c), t.modifiersData[s] = l;
1635
1743
  }
1636
- const Po = {
1744
+ const zo = {
1637
1745
  name: "offset",
1638
1746
  enabled: !0,
1639
1747
  phase: "main",
1640
1748
  requires: ["popperOffsets"],
1641
- fn: Xo
1749
+ fn: Vo
1642
1750
  };
1643
- function Ro(e) {
1751
+ function jo(e) {
1644
1752
  var t = e.state, i = e.name;
1645
- t.modifiersData[i] = _e({
1753
+ t.modifiersData[i] = ei({
1646
1754
  reference: t.rects.reference,
1647
1755
  element: t.rects.popper,
1648
1756
  placement: t.placement
1649
1757
  });
1650
1758
  }
1651
- const Mo = {
1759
+ const $o = {
1652
1760
  name: "popperOffsets",
1653
1761
  enabled: !0,
1654
1762
  phase: "read",
1655
- fn: Ro,
1763
+ fn: jo,
1656
1764
  data: {}
1657
1765
  };
1658
- function Ho(e) {
1766
+ function Go(e) {
1659
1767
  return e === "x" ? "y" : "x";
1660
1768
  }
1661
- function Do(e) {
1662
- var t = e.state, i = e.options, s = e.name, o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !1 : l, a = i.boundary, c = i.rootBoundary, h = i.altBoundary, p = i.padding, f = i.tether, u = f === void 0 ? !0 : f, I = i.tetherOffset, g = I === void 0 ? 0 : I, v = kt(t, {
1769
+ function Uo(e) {
1770
+ var t = e.state, i = e.options, s = e.name, o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !1 : l, a = i.boundary, c = i.rootBoundary, h = i.altBoundary, u = i.padding, f = i.tether, p = f === void 0 ? !0 : f, I = i.tetherOffset, b = I === void 0 ? 0 : I, v = kt(t, {
1663
1771
  boundary: a,
1664
1772
  rootBoundary: c,
1665
- padding: p,
1773
+ padding: u,
1666
1774
  altBoundary: h
1667
- }), m = j(t.placement), b = mt(t.placement), x = !b, w = oe(m), C = Ho(w), y = t.modifiersData.popperOffsets, O = t.rects.reference, S = t.rects.popper, E = typeof g == "function" ? g(Object.assign({}, t.rects, {
1775
+ }), O = z(t.placement), E = gt(t.placement), w = !E, y = ne(O), C = Go(y), m = t.modifiersData.popperOffsets, g = t.rects.reference, x = t.rects.popper, A = typeof b == "function" ? b(Object.assign({}, t.rects, {
1668
1776
  placement: t.placement
1669
- })) : g, A = typeof E == "number" ? {
1670
- mainAxis: E,
1671
- altAxis: E
1777
+ })) : b, k = typeof A == "number" ? {
1778
+ mainAxis: A,
1779
+ altAxis: A
1672
1780
  } : Object.assign({
1673
1781
  mainAxis: 0,
1674
1782
  altAxis: 0
1675
- }, E), k = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, R = {
1783
+ }, A), T = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, X = {
1676
1784
  x: 0,
1677
1785
  y: 0
1678
1786
  };
1679
- if (y) {
1787
+ if (m) {
1680
1788
  if (n) {
1681
- var T, z = w === "y" ? H : D, G = w === "y" ? F : N, Y = w === "y" ? "height" : "width", Z = y[w], rt = Z + v[z], U = Z - v[G], at = u ? -S[Y] / 2 : 0, vt = b === ut ? O[Y] : S[Y], tt = b === ut ? -S[Y] : -O[Y], lt = t.elements.arrow, q = u && lt ? se(lt) : {
1789
+ var L, $ = y === "y" ? H : Z, G = y === "y" ? N : F, P = y === "y" ? "height" : "width", D = m[y], ot = D + v[$], U = D - v[G], nt = p ? -x[P] / 2 : 0, yt = E === mt ? g[P] : x[P], tt = E === mt ? -x[P] : -g[P], rt = t.elements.arrow, q = p && rt ? oe(rt) : {
1682
1790
  width: 0,
1683
1791
  height: 0
1684
- }, V = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : ze(), et = V[z], it = V[G], K = St(0, O[Y], q[Y]), ct = x ? O[Y] / 2 - at - K - et - A.mainAxis : vt - K - et - A.mainAxis, Vt = x ? -O[Y] / 2 + at + K + it + A.mainAxis : tt + K + it + A.mainAxis, gt = t.elements.arrow && Yt(t.elements.arrow), jt = gt ? w === "y" ? gt.clientTop || 0 : gt.clientLeft || 0 : 0, Xt = (T = k == null ? void 0 : k[w]) != null ? T : 0, $t = Z + ct - Xt - jt, zt = Z + Vt - Xt, Pt = St(u ? Wt(rt, $t) : rt, Z, u ? ot(U, zt) : U);
1685
- y[w] = Pt, R[w] = Pt - Z;
1792
+ }, V = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Je(), et = V[$], at = V[G], _ = Ot(0, g[P], q[P]), lt = w ? g[P] / 2 - nt - _ - et - k.mainAxis : yt - _ - et - k.mainAxis, zt = w ? -g[P] / 2 + nt + _ + at + k.mainAxis : tt + _ + at + k.mainAxis, ct = t.elements.arrow && Tt(t.elements.arrow), jt = ct ? y === "y" ? ct.clientTop || 0 : ct.clientLeft || 0 : 0, Lt = (L = T == null ? void 0 : T[y]) != null ? L : 0, $t = D + lt - Lt - jt, Gt = D + zt - Lt, Pt = Ot(p ? Nt(ot, $t) : ot, D, p ? it(U, Gt) : U);
1793
+ m[y] = Pt, X[y] = Pt - D;
1686
1794
  }
1687
1795
  if (r) {
1688
- var Rt, Gt = w === "x" ? H : D, Ut = w === "x" ? F : N, _ = y[C], ht = C === "y" ? "height" : "width", yt = _ + v[Gt], dt = _ - v[Ut], st = [H, D].indexOf(m) !== -1, bt = (Rt = k == null ? void 0 : k[C]) != null ? Rt : 0, wt = st ? yt : _ - O[ht] - S[ht] - bt + A.altAxis, It = st ? _ + O[ht] + S[ht] - bt - A.altAxis : dt, xt = u && st ? ro(wt, _, It) : St(u ? wt : yt, _, u ? It : dt);
1689
- y[C] = xt, R[C] = xt - _;
1796
+ var Mt, Ut = y === "x" ? H : Z, _t = y === "x" ? N : F, K = m[C], ht = C === "y" ? "height" : "width", Yt = K + v[Ut], Xt = K - v[_t], dt = [H, Z].indexOf(O) !== -1, ut = (Mt = T == null ? void 0 : T[C]) != null ? Mt : 0, pt = dt ? Yt : K - g[ht] - x[ht] - ut + k.altAxis, bt = dt ? K + g[ht] + x[ht] - ut - k.altAxis : Xt, wt = p && dt ? yo(pt, K, bt) : Ot(p ? pt : Yt, K, p ? bt : Xt);
1797
+ m[C] = wt, X[C] = wt - K;
1690
1798
  }
1691
- t.modifiersData[s] = R;
1799
+ t.modifiersData[s] = X;
1692
1800
  }
1693
1801
  }
1694
- const Zo = {
1802
+ const _o = {
1695
1803
  name: "preventOverflow",
1696
1804
  enabled: !0,
1697
1805
  phase: "main",
1698
- fn: Do,
1806
+ fn: Uo,
1699
1807
  requiresIfExists: ["offset"]
1700
1808
  };
1701
- function Bo(e) {
1809
+ function Ko(e) {
1702
1810
  return {
1703
1811
  scrollLeft: e.scrollLeft,
1704
1812
  scrollTop: e.scrollTop
1705
1813
  };
1706
1814
  }
1707
- function Wo(e) {
1708
- return e === B(e) || !W(e) ? ne(e) : Bo(e);
1815
+ function Jo(e) {
1816
+ return e === B(e) || !W(e) ? re(e) : Ko(e);
1709
1817
  }
1710
- function Fo(e) {
1711
- var t = e.getBoundingClientRect(), i = pt(t.width) / e.offsetWidth || 1, s = pt(t.height) / e.offsetHeight || 1;
1818
+ function qo(e) {
1819
+ var t = e.getBoundingClientRect(), i = ft(t.width) / e.offsetWidth || 1, s = ft(t.height) / e.offsetHeight || 1;
1712
1820
  return i !== 1 || s !== 1;
1713
1821
  }
1714
- function No(e, t, i) {
1822
+ function Qo(e, t, i) {
1715
1823
  i === void 0 && (i = !1);
1716
- var s = W(t), o = W(t) && Fo(t), n = Q(t), l = ft(e, o, i), r = {
1824
+ var s = W(t), o = W(t) && qo(t), n = Q(t), l = vt(e, o, i), r = {
1717
1825
  scrollLeft: 0,
1718
1826
  scrollTop: 0
1719
1827
  }, a = {
1720
1828
  x: 0,
1721
1829
  y: 0
1722
1830
  };
1723
- return (s || !s && !i) && (($(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1724
- ae(n)) && (r = Wo(t)), W(t) ? (a = ft(t, !0), a.x += t.clientLeft, a.y += t.clientTop) : n && (a.x = re(n))), {
1831
+ return (s || !s && !i) && ((j(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1832
+ le(n)) && (r = Jo(t)), W(t) ? (a = vt(t, !0), a.x += t.clientLeft, a.y += t.clientTop) : n && (a.x = ae(n))), {
1725
1833
  x: l.left + r.scrollLeft - a.x,
1726
1834
  y: l.top + r.scrollTop - a.y,
1727
1835
  width: l.width,
1728
1836
  height: l.height
1729
1837
  };
1730
1838
  }
1731
- function Vo(e) {
1839
+ function tn(e) {
1732
1840
  var t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [];
1733
1841
  e.forEach(function(n) {
1734
1842
  t.set(n.name, n);
@@ -1747,15 +1855,15 @@ function Vo(e) {
1747
1855
  i.has(n.name) || o(n);
1748
1856
  }), s;
1749
1857
  }
1750
- function jo(e) {
1751
- var t = Vo(e);
1752
- return to.reduce(function(i, s) {
1858
+ function en(e) {
1859
+ var t = tn(e);
1860
+ return uo.reduce(function(i, s) {
1753
1861
  return i.concat(t.filter(function(o) {
1754
1862
  return o.phase === s;
1755
1863
  }));
1756
1864
  }, []);
1757
1865
  }
1758
- function $o(e) {
1866
+ function sn(e) {
1759
1867
  var t;
1760
1868
  return function() {
1761
1869
  return t || (t = new Promise(function(i) {
@@ -1765,7 +1873,7 @@ function $o(e) {
1765
1873
  })), t;
1766
1874
  };
1767
1875
  }
1768
- function zo(e) {
1876
+ function on(e) {
1769
1877
  var t = e.reduce(function(i, s) {
1770
1878
  var o = i[s.name];
1771
1879
  return i[s.name] = o ? Object.assign({}, o, s, {
@@ -1777,27 +1885,27 @@ function zo(e) {
1777
1885
  return t[i];
1778
1886
  });
1779
1887
  }
1780
- var He = {
1888
+ var Be = {
1781
1889
  placement: "bottom",
1782
1890
  modifiers: [],
1783
1891
  strategy: "absolute"
1784
1892
  };
1785
- function De() {
1893
+ function We() {
1786
1894
  for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
1787
1895
  t[i] = arguments[i];
1788
1896
  return !t.some(function(s) {
1789
1897
  return !(s && typeof s.getBoundingClientRect == "function");
1790
1898
  });
1791
1899
  }
1792
- function Go(e) {
1900
+ function nn(e) {
1793
1901
  e === void 0 && (e = {});
1794
- var t = e, i = t.defaultModifiers, s = i === void 0 ? [] : i, o = t.defaultOptions, n = o === void 0 ? He : o;
1902
+ var t = e, i = t.defaultModifiers, s = i === void 0 ? [] : i, o = t.defaultOptions, n = o === void 0 ? Be : o;
1795
1903
  return function(r, a, c) {
1796
1904
  c === void 0 && (c = n);
1797
1905
  var h = {
1798
1906
  placement: "bottom",
1799
1907
  orderedModifiers: [],
1800
- options: Object.assign({}, He, n),
1908
+ options: Object.assign({}, Be, n),
1801
1909
  modifiersData: {},
1802
1910
  elements: {
1803
1911
  reference: r,
@@ -1805,18 +1913,18 @@ function Go(e) {
1805
1913
  },
1806
1914
  attributes: {},
1807
1915
  styles: {}
1808
- }, p = [], f = !1, u = {
1916
+ }, u = [], f = !1, p = {
1809
1917
  state: h,
1810
- setOptions: function(m) {
1811
- var b = typeof m == "function" ? m(h.options) : m;
1812
- g(), h.options = Object.assign({}, n, h.options, b), h.scrollParents = {
1813
- reference: nt(r) ? At(r) : r.contextElement ? At(r.contextElement) : [],
1814
- popper: At(a)
1918
+ setOptions: function(O) {
1919
+ var E = typeof O == "function" ? O(h.options) : O;
1920
+ b(), h.options = Object.assign({}, n, h.options, E), h.scrollParents = {
1921
+ reference: st(r) ? Et(r) : r.contextElement ? Et(r.contextElement) : [],
1922
+ popper: Et(a)
1815
1923
  };
1816
- var x = jo(zo([].concat(s, h.options.modifiers)));
1817
- return h.orderedModifiers = x.filter(function(w) {
1818
- return w.enabled;
1819
- }), I(), u.update();
1924
+ var w = en(on([].concat(s, h.options.modifiers)));
1925
+ return h.orderedModifiers = w.filter(function(y) {
1926
+ return y.enabled;
1927
+ }), I(), p.update();
1820
1928
  },
1821
1929
  // Sync update – it will always be executed, even if not necessary. This
1822
1930
  // is useful for low frequency updates where sync behavior simplifies the
@@ -1825,25 +1933,25 @@ function Go(e) {
1825
1933
  // prefer the async Popper#update method
1826
1934
  forceUpdate: function() {
1827
1935
  if (!f) {
1828
- var m = h.elements, b = m.reference, x = m.popper;
1829
- if (De(b, x)) {
1936
+ var O = h.elements, E = O.reference, w = O.popper;
1937
+ if (We(E, w)) {
1830
1938
  h.rects = {
1831
- reference: No(b, Yt(x), h.options.strategy === "fixed"),
1832
- popper: se(x)
1833
- }, h.reset = !1, h.placement = h.options.placement, h.orderedModifiers.forEach(function(A) {
1834
- return h.modifiersData[A.name] = Object.assign({}, A.data);
1939
+ reference: Qo(E, Tt(w), h.options.strategy === "fixed"),
1940
+ popper: oe(w)
1941
+ }, h.reset = !1, h.placement = h.options.placement, h.orderedModifiers.forEach(function(k) {
1942
+ return h.modifiersData[k.name] = Object.assign({}, k.data);
1835
1943
  });
1836
- for (var w = 0; w < h.orderedModifiers.length; w++) {
1944
+ for (var y = 0; y < h.orderedModifiers.length; y++) {
1837
1945
  if (h.reset === !0) {
1838
- h.reset = !1, w = -1;
1946
+ h.reset = !1, y = -1;
1839
1947
  continue;
1840
1948
  }
1841
- var C = h.orderedModifiers[w], y = C.fn, O = C.options, S = O === void 0 ? {} : O, E = C.name;
1842
- typeof y == "function" && (h = y({
1949
+ var C = h.orderedModifiers[y], m = C.fn, g = C.options, x = g === void 0 ? {} : g, A = C.name;
1950
+ typeof m == "function" && (h = m({
1843
1951
  state: h,
1844
- options: S,
1845
- name: E,
1846
- instance: u
1952
+ options: x,
1953
+ name: A,
1954
+ instance: p
1847
1955
  }) || h);
1848
1956
  }
1849
1957
  }
@@ -1851,56 +1959,63 @@ function Go(e) {
1851
1959
  },
1852
1960
  // Async and optimistically optimized update – it will not be executed if
1853
1961
  // not necessary (debounced to run at most once-per-tick)
1854
- update: $o(function() {
1962
+ update: sn(function() {
1855
1963
  return new Promise(function(v) {
1856
- u.forceUpdate(), v(h);
1964
+ p.forceUpdate(), v(h);
1857
1965
  });
1858
1966
  }),
1859
1967
  destroy: function() {
1860
- g(), f = !0;
1968
+ b(), f = !0;
1861
1969
  }
1862
1970
  };
1863
- if (!De(r, a))
1864
- return u;
1865
- u.setOptions(c).then(function(v) {
1971
+ if (!We(r, a))
1972
+ return p;
1973
+ p.setOptions(c).then(function(v) {
1866
1974
  !f && c.onFirstUpdate && c.onFirstUpdate(v);
1867
1975
  });
1868
1976
  function I() {
1869
1977
  h.orderedModifiers.forEach(function(v) {
1870
- var m = v.name, b = v.options, x = b === void 0 ? {} : b, w = v.effect;
1871
- if (typeof w == "function") {
1872
- var C = w({
1978
+ var O = v.name, E = v.options, w = E === void 0 ? {} : E, y = v.effect;
1979
+ if (typeof y == "function") {
1980
+ var C = y({
1873
1981
  state: h,
1874
- name: m,
1875
- instance: u,
1876
- options: x
1877
- }), y = function() {
1982
+ name: O,
1983
+ instance: p,
1984
+ options: w
1985
+ }), m = function() {
1878
1986
  };
1879
- p.push(C || y);
1987
+ u.push(C || m);
1880
1988
  }
1881
1989
  });
1882
1990
  }
1883
- function g() {
1884
- p.forEach(function(v) {
1991
+ function b() {
1992
+ u.forEach(function(v) {
1885
1993
  return v();
1886
- }), p = [];
1994
+ }), u = [];
1887
1995
  }
1888
- return u;
1996
+ return p;
1889
1997
  };
1890
1998
  }
1891
- var Uo = [go, Mo, mo, so, Po, Lo, Zo, ho, To], Ko = /* @__PURE__ */ Go({
1892
- defaultModifiers: Uo
1999
+ var rn = [So, $o, Ao, fo, zo, Bo, _o, xo, No], an = /* @__PURE__ */ nn({
2000
+ defaultModifiers: rn
1893
2001
  });
1894
- class _o {
1895
- constructor(t, i, s) {
1896
- le(this, "updateHotspotPosition", (t, i) => {
2002
+ class ln {
2003
+ /**
2004
+ * @param {Array} hotspotsConfig - Hotspot configuration array
2005
+ * @param {HTMLElement} container - Container element
2006
+ * @param {number} imageAspectRatio - Image aspect ratio
2007
+ * @param {Object} options - Additional options
2008
+ * @param {string} options.trigger - 'hover' or 'click' (default: 'hover')
2009
+ */
2010
+ constructor(t, i, s, o = {}) {
2011
+ de(this, "updateHotspotPosition", (t, i) => {
1897
2012
  this.currentActiveIndex = t, this.currentOrientation = i;
1898
- const s = Hs(this.hotspotsConfig, t, i);
2013
+ const s = Gs(this.hotspotsConfig, t, i);
1899
2014
  this.hideHotspots(), s.forEach((o) => this.updateAndShowHotspot(o, t));
1900
2015
  });
1901
- this.container = i, this.popper = null, this.popperInstance = null, this.hotspotsContainer = Qi(this.container), this.hotspotsConfig = Fs(t), this.shouldHidePopper = !0, this.hidePopper = this.hidePopper.bind(this), this.imageAspectRatio = s, this.hotspotElements = /* @__PURE__ */ new Map(), this.popperListeners = [];
1902
- const { containerSize: o } = t[0];
1903
- this.initialContainerSize = o || [i.offsetWidth, i.offsetHeight], this.initHotspots(), this.observeContainerResize();
2016
+ this.container = i, this.popper = null, this.popperInstance = null, this.hotspotsContainer = ls(this.container), this.hotspotsConfig = qs(t), this.shouldHidePopper = !0, this.hidePopper = this.hidePopper.bind(this), this.forceHidePopper = this.forceHidePopper.bind(this), this.imageAspectRatio = s, this.hotspotElements = /* @__PURE__ */ new Map(), this.popperListeners = [], this.trigger = o.trigger || "hover";
2017
+ const { containerSize: n } = t[0];
2018
+ this.initialContainerSize = n || [i.offsetWidth, i.offsetHeight], this.initHotspots(), this.observeContainerResize();
1904
2019
  }
1905
2020
  observeContainerResize() {
1906
2021
  this.resizeObserver = new ResizeObserver(() => {
@@ -1909,7 +2024,7 @@ class _o {
1909
2024
  }), this.resizeObserver.observe(this.container);
1910
2025
  }
1911
2026
  updateHotspotsForResize(t, i) {
1912
- this.hotspotsConfig = Ns({
2027
+ this.hotspotsConfig = Qs({
1913
2028
  newWidth: t,
1914
2029
  newHeight: i,
1915
2030
  initialContainerSize: this.initialContainerSize,
@@ -1923,12 +2038,12 @@ class _o {
1923
2038
  }), this.popperListeners = [];
1924
2039
  }
1925
2040
  showPopper({ hotspotElement: t, content: i, id: s, keepOpen: o }) {
1926
- this.popperInstance && this.popperInstance.instanceId !== s && this.hidePopper();
2041
+ this.popperInstance && this.hidePopper();
1927
2042
  const n = {
1928
2043
  placement: "top",
1929
- modifiers: Bs(this.container)
2044
+ modifiers: Ks(this.container)
1930
2045
  };
1931
- this.popper = Ws(i, s), this.popper.setAttribute("data-show", ""), this.currentHotspotElement = t, t.setAttribute("aria-expanded", "true"), t.setAttribute("aria-describedby", `cloudimage-360-popper-${s}`);
2046
+ this.popper = Js(i, s), this.popper.setAttribute("data-show", ""), this.currentHotspotElement = t, t.setAttribute("aria-expanded", "true"), t.setAttribute("aria-describedby", `cloudimage-360-popper-${s}`);
1932
2047
  const l = () => {
1933
2048
  this.shouldHidePopper = !1;
1934
2049
  }, r = () => {
@@ -1944,7 +2059,7 @@ class _o {
1944
2059
  { element: t, event: "mouseleave", handler: a },
1945
2060
  { element: t, event: "mouseenter", handler: c }
1946
2061
  ), this.popperInstance = {
1947
- ...Ko(t, this.popper, n),
2062
+ ...an(t, this.popper, n),
1948
2063
  keepOpen: o,
1949
2064
  instanceId: s
1950
2065
  };
@@ -1953,25 +2068,36 @@ class _o {
1953
2068
  var t;
1954
2069
  this.shouldHidePopper && !((t = this.popperInstance) != null && t.keepOpen) && (this.hidePopperTimeout = setTimeout(() => {
1955
2070
  this.shouldHidePopper && this.hidePopper();
1956
- }, Ei));
2071
+ }, Pi));
1957
2072
  }
1958
2073
  hidePopper() {
1959
- if (this.cleanupPopperListeners(), this.currentHotspotElement && (this.currentHotspotElement.setAttribute("aria-expanded", "false"), this.currentHotspotElement.removeAttribute("aria-describedby"), this.currentHotspotElement = null), this.popperInstance && (this.popperInstance.destroy(), this.popperInstance = null), this.popper) {
2074
+ if (this.hidePopperTimeout && (clearTimeout(this.hidePopperTimeout), this.hidePopperTimeout = null), this.cleanupPopperListeners(), this.currentHotspotElement && (this.currentHotspotElement.setAttribute("aria-expanded", "false"), this.currentHotspotElement.removeAttribute("aria-describedby"), this.currentHotspotElement = null), this.popperInstance && (this.popperInstance.destroy(), this.popperInstance = null), this.popper) {
1960
2075
  this.popper.removeAttribute("data-show"), this.popper.setAttribute("aria-hidden", "true");
1961
2076
  const t = this.popper;
1962
2077
  this.popper = null, setTimeout(() => {
1963
2078
  t.remove();
1964
- }, Si);
2079
+ }, Mi);
1965
2080
  }
2081
+ this.shouldHidePopper = !0;
2082
+ }
2083
+ /**
2084
+ * Force hide the popper immediately, ignoring keepOpen and shouldHidePopper flags
2085
+ * Use this when the user starts dragging or other interactions that should close the modal
2086
+ */
2087
+ forceHidePopper() {
2088
+ this.shouldHidePopper = !0, this.popperInstance && (this.popperInstance.keepOpen = !1), this.hidePopper();
1966
2089
  }
1967
2090
  createHotspot(t) {
1968
- const { id: i, content: s, keepOpen: o, onClick: n, label: l } = t, r = Ds(i, l);
1969
- n && (r.style.cursor = "pointer"), r.onclick = (a) => {
1970
- a.stopPropagation(), n == null || n(a, this.popperInstance, i);
1971
- }, s && (r.addEventListener(
2091
+ const { id: i, content: s, keepOpen: o, onClick: n, label: l } = t, r = Us(i, l);
2092
+ (n || s && this.trigger === "click") && (r.style.cursor = "pointer"), r.onclick = (a) => {
2093
+ var c;
2094
+ a.stopPropagation(), s && this.trigger === "click" && (((c = this.popperInstance) == null ? void 0 : c.instanceId) === i ? this.hidePopper() : this.showPopper({ hotspotElement: r, content: s, id: i, keepOpen: o })), n == null || n(a, this.popperInstance, i);
2095
+ }, s && (this.trigger === "hover" && (r.addEventListener(
1972
2096
  "mouseenter",
1973
2097
  () => this.showPopper({ hotspotElement: r, content: s, id: i, keepOpen: o })
1974
- ), r.addEventListener(
2098
+ ), r.addEventListener("mouseleave", () => {
2099
+ this.shouldHidePopper = !0, this.checkAndHidePopper();
2100
+ })), r.addEventListener(
1975
2101
  "focus",
1976
2102
  () => this.showPopper({ hotspotElement: r, content: s, id: i, keepOpen: o })
1977
2103
  ), r.addEventListener("blur", () => {
@@ -2012,32 +2138,48 @@ class _o {
2012
2138
  this.hidePopperTimeout && clearTimeout(this.hidePopperTimeout), this.resizeObserver.disconnect(), this.hidePopper(), this.hotspotElements.clear(), this.hotspotsContainer.innerHTML = "";
2013
2139
  }
2014
2140
  }
2141
+ const Ne = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
2015
2142
  class Ft {
2016
2143
  constructor(t, i, s) {
2017
- this.container = t, this.isClicked = !1, this.fullscreenView = !!s, this.imagesX = [], this.imagesY = [], this.devicePixelRatio = Math.round(window.devicePixelRatio || 1), this.id = t.id, this.movementStart = { x: 0, y: 0 }, this.draggingDirection = null, this.isReady = !1, this.velocityX = 0, this.velocityY = 0, this.lastDragTime = 0, this.lastDragX = 0, this.lastDragY = 0, this.inertiaAnimationId = null, this.hasInteracted = !1, this.currentZoomScale = 1, this.touchDevice = Ls(), this.dragJustEnded = !1, this.isPinching = !1, this.initialPinchDistance = 0, this.pinchZoomLevel = 1, this.pinchZoomEmitted = !1, this.lastEmittedZoom = 1, this.panOffsetX = 0, this.panOffsetY = 0, this.canvasWorker = new Ys(), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null, this.isAnimatingToFrame = !1, this.onMoveHandler = this.onMoveHandler.bind(this), this.destroy = this.destroy.bind(this), this.init(this.container, i);
2144
+ this.container = t, this.isClicked = !1, this.fullscreenView = !!s, this.imagesX = [], this.imagesY = [];
2145
+ const o = Math.round(window.devicePixelRatio || 1);
2146
+ this.devicePixelRatio = Ne ? Math.min(o, 2) : o, this.id = t.id, this.movementStart = { x: 0, y: 0 }, this.draggingDirection = null, this.isReady = !1, this.velocityX = 0, this.velocityY = 0, this.lastDragTime = 0, this.lastDragX = 0, this.lastDragY = 0, this.inertiaAnimationId = null, this.hasInteracted = !1, this.currentZoomScale = 1, this.touchDevice = Ds(), this.dragJustEnded = !1, this.isPinching = !1, this.initialPinchDistance = 0, this.pinchZoomLevel = 1, this.pinchZoomEmitted = !1, this.lastEmittedZoom = 1, this.panOffsetX = 0, this.panOffsetY = 0, this.useMainThreadCanvas = Ne, this.canvasWorker = this.useMainThreadCanvas ? new Fs() : new Ns(), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null, this.isAnimatingToFrame = !1, this.onMoveHandler = this.onMoveHandler.bind(this), this.destroy = this.destroy.bind(this), this.init(this.container, i);
2147
+ }
2148
+ /**
2149
+ * Close ImageBitmap objects to free GPU memory
2150
+ * @param {Array} images - Array of image objects with bitmapImage property
2151
+ */
2152
+ closeImageBitmaps(t) {
2153
+ !t || !Array.isArray(t) || t.forEach((i) => {
2154
+ var s;
2155
+ (s = i == null ? void 0 : i.bitmapImage) != null && s.close && i.bitmapImage.close();
2156
+ });
2018
2157
  }
2019
2158
  emit(t, i = {}) {
2020
2159
  const s = this[t];
2021
2160
  typeof s == "function" && s({ ...i, viewerId: this.id });
2022
2161
  }
2023
2162
  announce(t) {
2024
- es(this.ariaLiveRegion, t);
2163
+ hs(this.ariaLiveRegion, t);
2025
2164
  }
2026
2165
  mouseDown(t) {
2027
2166
  if (!this.isReady || this.glass) return;
2028
- const { pageX: i, pageY: s } = t;
2029
- this.hideHints(), this.hideHotspotPopper(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.autoplayJustStopped = !1, (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1, this.autoplayJustStopped = !0), this.movementStart = { x: i, y: s }, this.isClicked = !0, this.isDragging = !1, this.inertia && (this.velocityX = 0, this.velocityY = 0, this.lastDragTime = performance.now(), this.lastDragX = i, this.lastDragY = s);
2167
+ const i = t.target;
2168
+ if (i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")))
2169
+ return;
2170
+ const { pageX: s, pageY: o } = t;
2171
+ this.hideHints(), this.hideHotspotPopper(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.autoplayJustStopped = !1, (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1, this.autoplayJustStopped = !0), this.movementStart = { x: s, y: o }, this.isClicked = !0, this.isDragging = !1, this.inertia && (this.velocityX = 0, this.velocityY = 0, this.lastDragTime = performance.now(), this.lastDragX = s, this.lastDragY = o);
2030
2172
  }
2031
2173
  mouseUp() {
2032
2174
  this.isReady && (!this.isZoomed && !this.autoplayJustStopped && this.showAllIcons(), this.inertia && this.isDragging && (Math.abs(this.velocityX) > 0.1 || Math.abs(this.velocityY) > 0.1) && this.startInertia(), this.isDragging && (this.emit("onDragEnd"), this.dragJustEnded = !0), this.movementStart = { x: 0, y: 0 }, this.isClicked = !1, this.isDragging = !1, this.innerBox.style.cursor = "grab");
2033
2175
  }
2034
2176
  startInertia() {
2035
- const s = this.fullscreenView ? document.body : this.container, o = this.dragSpeed / fe, n = o * (this.amountX / s.offsetWidth), l = o * (this.amountY / s.offsetHeight), r = () => {
2177
+ const s = this.fullscreenView ? document.body : this.container, o = this.dragSpeed / ve, n = o * (this.amountX / s.offsetWidth), l = o * (this.amountY / s.offsetHeight), r = () => {
2036
2178
  if (this.velocityX *= 0.95, this.velocityY *= 0.95, Math.abs(this.velocityX) < 0.01 && Math.abs(this.velocityY) < 0.01) {
2037
2179
  this.inertiaAnimationId = null;
2038
2180
  return;
2039
2181
  }
2040
- const a = this.velocityX * 16, c = this.velocityY * 16, h = Se({
2182
+ const a = this.velocityX * 16, c = this.velocityY * 16, h = Te({
2041
2183
  deltaX: a,
2042
2184
  deltaY: c,
2043
2185
  reversed: this.dragReverse,
@@ -2045,8 +2187,8 @@ class Ft {
2045
2187
  allowSpinY: this.allowSpinY
2046
2188
  });
2047
2189
  if (h) {
2048
- const p = this.allowSpinX ? Math.max(1, Math.abs(Math.round(a * n))) : 0, f = this.allowSpinY ? Math.max(1, Math.abs(Math.round(c * l))) : 0;
2049
- (p > 0 || f > 0) && this.onMoveHandler(h, p, f);
2190
+ const u = this.allowSpinX ? Math.max(1, Math.abs(Math.round(a * n))) : 0, f = this.allowSpinY ? Math.max(1, Math.abs(Math.round(c * l))) : 0;
2191
+ (u > 0 || f > 0) && this.onMoveHandler(h, u, f);
2050
2192
  }
2051
2193
  this.inertiaAnimationId = requestAnimationFrame(r);
2052
2194
  };
@@ -2056,26 +2198,28 @@ class Ft {
2056
2198
  if (!this.isReady || !this.isClicked) return;
2057
2199
  const s = t - this.movementStart.x, o = i - this.movementStart.y;
2058
2200
  if (this.inertia) {
2059
- const f = performance.now(), u = f - this.lastDragTime;
2060
- u > 0 && u < 100 && (this.velocityX = (t - this.lastDragX) / u, this.velocityY = (i - this.lastDragY) / u), this.lastDragTime = f, this.lastDragX = t, this.lastDragY = i;
2201
+ const f = performance.now(), p = f - this.lastDragTime;
2202
+ p > 0 && p < 100 && (this.velocityX = (t - this.lastDragX) / p, this.velocityY = (i - this.lastDragY) / p), this.lastDragTime = f, this.lastDragX = t, this.lastDragY = i;
2061
2203
  }
2062
- this.draggingDirection = Se({
2204
+ this.draggingDirection = Te({
2063
2205
  deltaX: s,
2064
2206
  deltaY: o,
2065
2207
  reversed: this.dragReverse,
2066
2208
  allowSpinX: this.allowSpinX,
2067
2209
  allowSpinY: this.allowSpinY
2068
2210
  }) || this.draggingDirection;
2069
- const n = this.fullscreenView ? document.body : this.container, l = this.dragSpeed / fe, r = l * (this.amountX / n.offsetWidth), a = l * (this.amountY / n.offsetHeight), c = this.allowSpinX ? Math.abs(Math.round(s * r)) : 0, h = this.allowSpinY ? Math.abs(Math.round(o * a)) : 0;
2211
+ const n = this.fullscreenView ? document.body : this.container, l = this.dragSpeed / ve, r = l * (this.amountX / n.offsetWidth), a = l * (this.amountY / n.offsetHeight), c = this.allowSpinX ? Math.abs(Math.round(s * r)) : 0, h = this.allowSpinY ? Math.abs(Math.round(o * a)) : 0;
2070
2212
  (this.allowSpinX && c !== 0 || this.allowSpinY && h !== 0) && (this.hasInteracted = !0, this.hideHotspotPopper(), this.onMoveHandler(this.draggingDirection, c, h), this.movementStart = { x: t, y: i }, setTimeout(() => {
2071
2213
  this.isDragging || (this.isDragging = !0, this.emit("onDragStart"));
2072
- }, Oi));
2214
+ }, Li));
2073
2215
  }
2074
2216
  mouseMove(t) {
2075
- !this.isReady || !this.isClicked && !this.isZoomed || this.glass || (this.hideAllIcons(), this.drag(t.pageX, t.pageY), this.isZoomed && this.applyZoom(t));
2217
+ !this.isReady || !this.isClicked && !this.isZoomed || this.glass || (this.isZoomed || this.hideAllIcons(), this.drag(t.pageX, t.pageY), this.isZoomed && this.applyZoom(t));
2076
2218
  }
2077
2219
  mouseClick(t) {
2078
- if (!(!this.isReady || this.isDragging)) {
2220
+ if (!this.isReady || this.isDragging) return;
2221
+ const i = t.target;
2222
+ if (!(i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")))) {
2079
2223
  if (this.dragJustEnded) {
2080
2224
  this.dragJustEnded = !1;
2081
2225
  return;
@@ -2088,18 +2232,23 @@ class Ft {
2088
2232
  this.removeGlass();
2089
2233
  return;
2090
2234
  }
2091
- this.pointerZoom && !this.glass && !this.touchDevice && this.toggleZoom(t);
2235
+ this.pointerZoomTrigger === "click" && this.pointerZoom && !this.glass && !this.touchDevice && this.toggleZoom(t);
2092
2236
  }
2093
2237
  }
2238
+ mouseDblClick(t) {
2239
+ if (!this.isReady) return;
2240
+ const i = t.target;
2241
+ i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")) || this.pointerZoomTrigger === "dblclick" && this.pointerZoom && !this.glass && !this.touchDevice && this.toggleZoom(t);
2242
+ }
2094
2243
  loadHigherQualityImages(t, i) {
2095
- const s = Et(this.srcXConfig, t), o = this.allowSpinY ? Et(this.srcYConfig, t) : null;
2096
- ve({
2244
+ const s = Ct(this.srcXConfig, t), o = this.allowSpinY ? Ct(this.srcYConfig, t) : null;
2245
+ ye({
2097
2246
  cdnPathX: s,
2098
2247
  cdnPathY: o,
2099
2248
  configX: this.srcXConfig,
2100
2249
  configY: this.srcYConfig,
2101
2250
  onAllImagesLoad: (n, l) => {
2102
- this.imagesX = n, this.imagesY = l, i();
2251
+ this.closeImageBitmaps(this.imagesX), this.closeImageBitmaps(this.imagesY), this.imagesX = n, this.imagesY = l, i();
2103
2252
  },
2104
2253
  onError: (n) => this.emit("onError", n)
2105
2254
  });
@@ -2108,31 +2257,46 @@ class Ft {
2108
2257
  this.hotspotsInstance && this.hotspotsInstance.hideHotspots();
2109
2258
  }
2110
2259
  hideHotspotPopper() {
2111
- this.hotspotsInstance && this.hotspotsInstance.hidePopper();
2260
+ this.hotspotsInstance && this.hotspotsInstance.forceHidePopper();
2112
2261
  }
2113
2262
  toggleZoom(t) {
2114
2263
  if (this.isZoomed)
2115
2264
  this.showTransitionOverlay(), setTimeout(() => {
2116
2265
  this.removeZoom();
2117
- }, pe);
2266
+ }, Ht);
2118
2267
  else {
2119
2268
  let i = (this.fullscreenView || this.pointerZoom ? document.body : this.container).offsetWidth;
2120
2269
  this.hideHotspots(), this.showLoadingSpinner(), this.loadHigherQualityImages(i, () => {
2121
2270
  this.showTransitionOverlay(), setTimeout(() => {
2122
2271
  this.applyZoom(t);
2123
- }, pe);
2272
+ }, Ht);
2124
2273
  });
2125
2274
  }
2126
2275
  }
2127
2276
  removeZoom() {
2128
- this.isZoomed = !1, this.updateView(), this.showAllIcons(), this.hideTransitionOverlay(), this.emit("onZoomOut"), this.announce("Zoomed out");
2277
+ this.isZoomed = !1, this.updateView(), this.showAllIcons(), this.hideZoomOutIcon(), this.hideTransitionOverlay(), this.emit("onZoomOut"), this.announce("Zoomed out");
2278
+ }
2279
+ zoomIn(t) {
2280
+ if (this.isZoomed || !this.pointerZoom) return;
2281
+ t == null || t.stopPropagation();
2282
+ let i = (this.fullscreenView || this.pointerZoom ? document.body : this.container).offsetWidth;
2283
+ this.hideHotspots(), this.hideAllIcons(), this.showLoadingSpinner(), this.loadHigherQualityImages(i, () => {
2284
+ this.showTransitionOverlay(), setTimeout(() => {
2285
+ this.applyZoom(t);
2286
+ }, Ht);
2287
+ });
2288
+ }
2289
+ zoomOut(t) {
2290
+ this.isZoomed && (t == null || t.stopPropagation(), this.showTransitionOverlay(), setTimeout(() => {
2291
+ this.removeZoom();
2292
+ }, Ht));
2129
2293
  }
2130
2294
  mouseLeave() {
2131
2295
  this.isZoomed && this.removeZoom();
2132
2296
  }
2133
2297
  applyZoom(t) {
2134
- const { offsetX: i, offsetY: s } = xs(t, this.canvas, this.devicePixelRatio);
2135
- this.isZoomed = !0, this.hideAllIcons(), this.hideLoadingSpinner(), this.hideTransitionOverlay(), this.updateView(this.pointerZoom, i, s), this.emit("onZoomIn", { zoomLevel: this.pointerZoom }), this.announce("Zoomed in. Move mouse to pan. Click to zoom out.");
2298
+ const { offsetX: i, offsetY: s } = Ls(t, this.canvas, this.devicePixelRatio);
2299
+ this.isZoomed || (this.isZoomed = !0, this.hideAllIcons(), this.hideLoadingSpinner(), this.hideTransitionOverlay(), this.showZoomOutIcon(), this.emit("onZoomIn", { zoomLevel: this.pointerZoom }), this.announce("Zoomed in. Move mouse to pan. Click to zoom out.")), this.updateView(this.pointerZoom, i, s);
2136
2300
  }
2137
2301
  touchOutside(t) {
2138
2302
  if (!this.glass) return;
@@ -2141,7 +2305,8 @@ class Ft {
2141
2305
  touchStart(t) {
2142
2306
  if (!this.isReady || this.glass || !t.touches || !t.touches.length) return;
2143
2307
  const i = t.target;
2144
- if (i && i.closest && i.closest(".cloudimage-360-button")) return;
2308
+ if (i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")))
2309
+ return;
2145
2310
  if (this.hideHints(), t.touches.length === 2 && this.pinchZoom && !this.isDragging) {
2146
2311
  t.preventDefault(), this.isPinching = !0, this.isClicked = !1, this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null);
2147
2312
  const n = t.touches[0], l = t.touches[1];
@@ -2192,10 +2357,10 @@ class Ft {
2192
2357
  this.initialPinchDistance = l;
2193
2358
  return;
2194
2359
  }
2195
- const r = l / this.initialPinchDistance, a = Math.max(1, Math.min(this.pinchZoomLevel * r, me));
2360
+ const r = l / this.initialPinchDistance, a = Math.max(1, Math.min(this.pinchZoomLevel * r, ge));
2196
2361
  if (this.initialPinchDistance = l, this.pinchZoomLevel = a, !this.canvas) return;
2197
- const c = this.canvas.getBoundingClientRect(), h = c.width / 2 * this.devicePixelRatio, p = c.height / 2 * this.devicePixelRatio;
2198
- a > 1 ? (this.isZoomed = !0, this.hideAllIcons(), this.updateView(a, h, p), (!this.pinchZoomEmitted || a > this.lastEmittedZoom) && (this.emit("onZoomIn", { zoomLevel: a }), this.pinchZoomEmitted = !0, this.lastEmittedZoom = a)) : (this.isZoomed = !1, this.panOffsetX = 0, this.panOffsetY = 0, this.updateView());
2362
+ const c = this.canvas.getBoundingClientRect(), h = c.width / 2 * this.devicePixelRatio, u = c.height / 2 * this.devicePixelRatio;
2363
+ a > 1 ? (this.isZoomed = !0, this.hideAllIcons(), this.updateView(a, h, u), (!this.pinchZoomEmitted || a > this.lastEmittedZoom) && (this.emit("onZoomIn", { zoomLevel: a }), this.pinchZoomEmitted = !0, this.lastEmittedZoom = a)) : (this.isZoomed = !1, this.panOffsetX = 0, this.panOffsetY = 0, this.updateView());
2199
2364
  return;
2200
2365
  }
2201
2366
  if (!this.isClicked || !t.touches || !t.touches[0]) return;
@@ -2210,7 +2375,7 @@ class Ft {
2210
2375
  keyDown(t) {
2211
2376
  if (!this.isReady) return;
2212
2377
  const { keyCode: i } = t, s = this.keysReverse;
2213
- switch (this.autoplay && this.stopAutoplay(), Ee(i, this.allowSpinY) && (this.hasInteracted = !0, this.hideAllIcons(), this.hideHints()), i) {
2378
+ switch (this.autoplay && this.stopAutoplay(), Se(i, this.allowSpinY) && (this.hasInteracted = !0, this.hideAllIcons(), this.hideHints()), i) {
2214
2379
  case 37:
2215
2380
  s ? this.moveLeft() : this.moveRight();
2216
2381
  break;
@@ -2227,19 +2392,19 @@ class Ft {
2227
2392
  }
2228
2393
  keyUp(t) {
2229
2394
  const { keyCode: i } = t;
2230
- Ee(i, this.allowSpinY) && this.showAllIcons();
2395
+ Se(i, this.allowSpinY) && this.showAllIcons();
2231
2396
  }
2232
2397
  moveActiveXIndexUp(t) {
2233
- this.orientation = P.X, this.activeImageX = (this.activeImageX + t) % this.amountX;
2398
+ this.orientation = Y.X, this.activeImageX = (this.activeImageX + t) % this.amountX;
2234
2399
  }
2235
2400
  moveActiveXIndexDown(t) {
2236
- this.orientation = P.X, this.activeImageX = (this.activeImageX - t + this.amountX) % this.amountX;
2401
+ this.orientation = Y.X, this.activeImageX = (this.activeImageX - t + this.amountX) % this.amountX;
2237
2402
  }
2238
2403
  moveActiveYIndexUp(t) {
2239
- this.orientation = P.Y, this.activeImageY = (this.activeImageY + t) % this.amountY;
2404
+ this.orientation = Y.Y, this.activeImageY = (this.activeImageY + t) % this.amountY;
2240
2405
  }
2241
2406
  moveActiveYIndexDown(t) {
2242
- this.orientation = P.Y, this.activeImageY = (this.activeImageY - t + this.amountY) % this.amountY;
2407
+ this.orientation = Y.Y, this.activeImageY = (this.activeImageY - t + this.amountY) % this.amountY;
2243
2408
  }
2244
2409
  moveRight(t, i = 1) {
2245
2410
  t && this.activeImageX >= this.imagesX.length - 1 || (this.moveActiveXIndexUp(i), this.isZoomed || this.updateView());
@@ -2263,8 +2428,8 @@ class Ft {
2263
2428
  });
2264
2429
  }
2265
2430
  updateView(t, i, s) {
2266
- const o = this.orientation === P.X ? this.activeImageX : this.activeImageY, n = this.orientation === P.X ? this.imagesX[this.activeImageX] : this.imagesY[this.activeImageY];
2267
- this.hotspotsInstance && !this.isZoomed && !this.autoplay && this.hotspotsInstance.updateHotspotPosition(o, this.orientation), this.hotspotTimelineIndicator && this.orientation === P.X && this.updateHotspotTimelinePosition(), this.drawImageOnCanvas(n, t, i, s);
2431
+ const o = this.orientation === Y.X ? this.activeImageX : this.activeImageY, n = this.orientation === Y.X ? this.imagesX[this.activeImageX] : this.imagesY[this.activeImageY];
2432
+ this.hotspotsInstance && !this.isZoomed && !this.autoplay && this.hotspotsInstance.updateHotspotPosition(o, this.orientation), this.hotspotTimelineIndicator && this.orientation === Y.X && this.updateHotspotTimelinePosition(), this.drawImageOnCanvas(n, t, i, s);
2268
2433
  }
2269
2434
  updatePercentageInLoader(t = 0) {
2270
2435
  this.loader && (this.loader.innerText = t + "%");
@@ -2282,16 +2447,21 @@ class Ft {
2282
2447
  });
2283
2448
  }
2284
2449
  drawImageOnCanvas(t, i = 1, s = 0, o = 0) {
2285
- this.canvasWorker.postMessage({
2286
- action: "drawImageOnCanvas",
2287
- imageData: t,
2288
- zoomScale: i,
2289
- pointerX: s,
2290
- pointerY: o
2291
- });
2450
+ this.pendingDrawData = { imageData: t, zoomScale: i, pointerX: s, pointerY: o }, this.drawFrameRequested || (this.drawFrameRequested = !0, requestAnimationFrame(() => {
2451
+ if (this.drawFrameRequested = !1, this.pendingDrawData) {
2452
+ const { imageData: n, zoomScale: l, pointerX: r, pointerY: a } = this.pendingDrawData;
2453
+ this.canvasWorker.postMessage({
2454
+ action: "drawImageOnCanvas",
2455
+ imageData: n,
2456
+ zoomScale: l,
2457
+ pointerX: r,
2458
+ pointerY: a
2459
+ });
2460
+ }
2461
+ }));
2292
2462
  }
2293
2463
  pushImageToSet(t, i, s) {
2294
- s === P.X ? this.imagesX[i] = t : this.imagesY[i] = t;
2464
+ s === Y.X ? this.imagesX[i] = t : this.imagesY[i] = t;
2295
2465
  }
2296
2466
  calculatePercentage() {
2297
2467
  const t = this.amountX + this.amountY, i = this.imagesX.length + this.imagesY.length;
@@ -2304,17 +2474,21 @@ class Ft {
2304
2474
  this.createContainers(t), this.adaptCanvasSize(i), this.drawImageOnCanvas(i);
2305
2475
  }
2306
2476
  onAllImagesLoaded() {
2307
- if (this.addAllIcons(), this.isReady = !0, this.amountX = this.imagesX.length, this.amountY = this.imagesY.length, this.activeImageX = this.autoplayReverse ? this.amountX - 1 : 0, this.activeImageY = this.autoplayReverse ? this.amountY - 1 : 0, this.hotspots && (this.hotspotsInstance = new _o(this.hotspots, this.innerBox, this.imageAspectRatio), this.addHotspotTimeline(), this.showHotspotTimeline()), this.emit("onLoad", { imagesX: this.imagesX.length, imagesY: this.imagesY.length }), this.emit("onReady"), this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."), this.hints !== !1 && !this.autoplay) {
2308
- const t = this.hints === !0 || this.hints === void 0 ? be(this.viewerConfig, this.touchDevice) : this.hints;
2309
- t && t.length > 0 && (this.hintsOverlay = ye(this.innerBox, t), we(this.hintsOverlay));
2477
+ if (this.addAllIcons(), this.isReady = !0, this.amountX = this.imagesX.length, this.amountY = this.imagesY.length, this.activeImageX = this.autoplayReverse ? this.amountX - 1 : 0, this.activeImageY = this.autoplayReverse ? this.amountY - 1 : 0, this.hotspots && (this.hotspotsInstance = new ln(this.hotspots, this.innerBox, this.imageAspectRatio, {
2478
+ trigger: this.hotspotTrigger
2479
+ }), this.addHotspotTimeline(), this.showHotspotTimeline()), this.emit("onLoad", { imagesX: this.imagesX.length, imagesY: this.imagesY.length }), this.emit("onReady"), this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."), this.hints !== !1 && !this.autoplay) {
2480
+ const t = this.hints === !0 || this.hints === void 0 ? xe(this.viewerConfig, this.touchDevice) : this.hints;
2481
+ t && t.length > 0 && (this.hintsOverlay = Ie(this.innerBox, t, {
2482
+ pointerZoomTrigger: this.pointerZoomTrigger
2483
+ }), Ce(this.hintsOverlay));
2310
2484
  }
2311
- this.autoplay && (this.hideAllIcons(), ks(this.play.bind(this))());
2485
+ this.autoplay && (this.hideAllIcons(), Bs(this.play.bind(this))());
2312
2486
  }
2313
2487
  magnify(t) {
2314
2488
  t.stopPropagation();
2315
- const { src: i } = this.orientation === P.Y ? this.imagesY[this.activeImageY] : this.imagesX[this.activeImageX], o = (this.fullscreenView ? document.body : this.container).offsetWidth * this.magnifier, n = Di(i, o);
2316
- this.showLoadingSpinner(), this.createGlass(), bs(n, (a) => {
2317
- this.hideLoadingSpinner(), this.magnified = !0, Is(t, this.innerBox, this.offset, a, this.glass, this.magnifier);
2489
+ const { src: i } = this.orientation === Y.Y ? this.imagesY[this.activeImageY] : this.imagesX[this.activeImageX], o = (this.fullscreenView ? document.body : this.container).offsetWidth * this.magnifier, n = Vi(i, o);
2490
+ this.showLoadingSpinner(), this.createGlass(), ks(n, (a) => {
2491
+ this.hideLoadingSpinner(), this.magnified = !0, Ts(t, this.innerBox, this.offset, a, this.glass, this.magnifier);
2318
2492
  }, (a) => {
2319
2493
  this.hideLoadingSpinner(), this.removeGlass(), this.emit("onError", {
2320
2494
  error: { message: a.message, url: a.url },
@@ -2325,12 +2499,19 @@ class Ft {
2325
2499
  });
2326
2500
  }
2327
2501
  openFullscreenModal(t) {
2328
- t.stopPropagation(), window.document.body.style.overflow = "hidden";
2329
- const i = _i(this.container);
2330
- new Ft(i, this.viewerConfig, !0), this.emit("onFullscreenOpen"), this.announce("Opened fullscreen mode. Press Escape to exit.");
2502
+ t.stopPropagation(), this.hideHotspotPopper(), this.releaseMemory(), window.document.body.style.overflow = "hidden";
2503
+ const i = ns(this.container);
2504
+ this.fullscreenInstance = new Ft(i, this.viewerConfig, !0), this.fullscreenInstance.originalViewer = this, this.emit("onFullscreenOpen"), this.announce("Opened fullscreen mode. Press Escape to exit.");
2331
2505
  }
2332
2506
  closeFullscreenModal(t) {
2333
- t.stopPropagation(), document.body.removeChild(this.container.parentNode), window.document.body.style.overflow = "visible", this.emit("onFullscreenClose"), this.announce("Exited fullscreen mode");
2507
+ t.stopPropagation();
2508
+ const i = this.originalViewer || this, s = this.fullscreenView ? this : i.fullscreenInstance;
2509
+ if (s) {
2510
+ s.hideHotspotPopper();
2511
+ const o = s.container.parentNode;
2512
+ o && o.parentNode && o.parentNode.removeChild(o), s.destroy(), i.fullscreenInstance && (i.fullscreenInstance = null);
2513
+ }
2514
+ window.document.body.style.overflow = "visible", i.reloadImages(), i.emit("onFullscreenClose"), i.announce("Exited fullscreen mode");
2334
2515
  }
2335
2516
  play() {
2336
2517
  if (this.isClicked) return;
@@ -2342,7 +2523,7 @@ class Ft {
2342
2523
  bottom: this.moveBottom.bind(this)
2343
2524
  };
2344
2525
  this.loopTimeoutId = window.setInterval(() => {
2345
- if (this.playOnce && Os({
2526
+ if (this.playOnce && Xs({
2346
2527
  autoplayBehavior: this.autoplayBehavior,
2347
2528
  activeImageX: this.activeImageX,
2348
2529
  activeImageY: this.activeImageY,
@@ -2353,7 +2534,7 @@ class Ft {
2353
2534
  this.stopAutoplay();
2354
2535
  return;
2355
2536
  }
2356
- Es({
2537
+ Rs({
2357
2538
  autoplayBehavior: this.autoplayBehavior,
2358
2539
  activeImageX: this.activeImageX,
2359
2540
  activeImageY: this.activeImageY,
@@ -2361,9 +2542,9 @@ class Ft {
2361
2542
  amountY: this.amountY,
2362
2543
  autoplayReverse: this.autoplayReverse,
2363
2544
  spinDirection: this.spinDirection
2364
- }) && (this.spinDirection = As(this.spinDirection));
2545
+ }) && (this.spinDirection = Zs(this.spinDirection));
2365
2546
  const n = this.spinDirection === "y";
2366
- Cs({
2547
+ Ys({
2367
2548
  autoplayBehavior: this.autoplayBehavior,
2368
2549
  spinY: n,
2369
2550
  reversed: this.autoplayReverse,
@@ -2373,15 +2554,37 @@ class Ft {
2373
2554
  }
2374
2555
  stopAutoplay() {
2375
2556
  if (this.showAllIcons(), this.autoplay = !1, window.clearTimeout(this.loopTimeoutId), this.loopTimeoutId = null, this.emit("onAutoplayStop"), this.hints !== !1 && !this.hintsOverlay && !this.hintsHidden) {
2376
- const t = this.hints === !0 ? be(this.viewerConfig, this.touchDevice) : this.hints;
2377
- t && t.length > 0 && (this.hintsOverlay = ye(this.innerBox, t), we(this.hintsOverlay));
2557
+ const t = this.hints === !0 ? xe(this.viewerConfig, this.touchDevice) : this.hints;
2558
+ t && t.length > 0 && (this.hintsOverlay = Ie(this.innerBox, t, {
2559
+ pointerZoomTrigger: this.pointerZoomTrigger
2560
+ }), Ce(this.hintsOverlay));
2378
2561
  }
2379
2562
  }
2380
2563
  destroy() {
2381
- this.stopAutoplay(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.removeEvents(), this.canvasWorker && (this.canvasWorker.terminate(), this.canvasWorker = null), this.hotspotsInstance && this.hotspotsInstance.destroy(), this.hintsOverlay && this.hintsOverlay.parentNode && (this.hintsOverlay.parentNode.removeChild(this.hintsOverlay), this.hintsOverlay = null), this.hotspotTimeline && this.hotspotTimeline.parentNode && (this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null), this.container && (this.container.classList.remove("ci360-theme-dark"), this.container.innerHTML = "");
2564
+ this.stopAutoplay(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.removeEvents(), this.closeImageBitmaps(this.imagesX), this.closeImageBitmaps(this.imagesY), this.imagesX = [], this.imagesY = [], this.canvasWorker && (this.canvasWorker.terminate(), this.canvasWorker = null), this.hotspotsInstance && this.hotspotsInstance.destroy(), this.hintsOverlay && this.hintsOverlay.parentNode && (this.hintsOverlay.parentNode.removeChild(this.hintsOverlay), this.hintsOverlay = null), this.hotspotTimeline && this.hotspotTimeline.parentNode && (this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null), this.container && (this.container.classList.remove("ci360-theme-dark"), this.container.innerHTML = "");
2565
+ }
2566
+ /**
2567
+ * Release memory by closing ImageBitmap objects without destroying the viewer.
2568
+ * Useful for freeing memory when the viewer scrolls off-screen on mobile.
2569
+ * Call reloadImages() to restore the images when the viewer becomes visible again.
2570
+ */
2571
+ releaseMemory() {
2572
+ this.stopAutoplay(), this.closeImageBitmaps(this.imagesX), this.closeImageBitmaps(this.imagesY), this.imagesX = [], this.imagesY = [], this.isMemoryReleased = !0;
2573
+ }
2574
+ /**
2575
+ * Reload images after memory was released.
2576
+ * Call this when the viewer becomes visible again after releaseMemory() was called.
2577
+ */
2578
+ reloadImages() {
2579
+ if (!this.isMemoryReleased) return;
2580
+ this.isMemoryReleased = !1;
2581
+ const t = this.container.offsetWidth;
2582
+ this.loadHigherQualityImages(t, () => {
2583
+ this.updateView();
2584
+ });
2382
2585
  }
2383
2586
  addInitialIcon() {
2384
- this.initialIcon || this.hide360Logo || (this.initialIcon = Vi(this.logoSrc), this.innerBox.appendChild(this.initialIcon));
2587
+ this.initialIcon || this.hide360Logo || (this.initialIcon = Ji(this.logoSrc), this.innerBox.appendChild(this.initialIcon));
2385
2588
  }
2386
2589
  showInitialIcon() {
2387
2590
  !this.initialIcon || this.hasInteracted || (this.initialIcon.style.opacity = 1);
@@ -2396,19 +2599,25 @@ class Ft {
2396
2599
  this.showAllIcons(), this.innerBox.removeChild(this.glass), this.glass = null, this.magnified = !1;
2397
2600
  }
2398
2601
  addMagnifierIcon() {
2399
- this.magnifier && (this.magnifierIcon = Ui(), this.magnifierIcon.onclick = this.magnify.bind(this), this.iconsContainer.appendChild(this.magnifierIcon));
2602
+ this.pointerZoom && (this.magnifierIcon = is(), this.magnifierIcon.onclick = this.zoomIn.bind(this), this.iconsContainer.appendChild(this.magnifierIcon), this.zoomOutIcon = ss(), this.zoomOutIcon.onclick = this.zoomOut.bind(this), this.zoomOutIcon.style.display = "none", this.iconsContainer.appendChild(this.zoomOutIcon));
2400
2603
  }
2401
2604
  showMagnifierIcon() {
2402
- this.magnifierIcon && (this.magnifierIcon.style.visibility = "visible", this.magnifierIcon.style.opacity = 1);
2605
+ this.magnifierIcon && (this.magnifierIcon.style.display = "", this.magnifierIcon.style.visibility = "visible", this.magnifierIcon.style.opacity = 1);
2403
2606
  }
2404
2607
  hideMagnifierIcon() {
2405
- this.magnifierIcon && (this.magnifierIcon.style.visibility = "hidden", this.magnifierIcon.style.opacity = 0);
2608
+ this.magnifierIcon && (this.magnifierIcon.style.display = "none", this.magnifierIcon.style.visibility = "hidden", this.magnifierIcon.style.opacity = 0);
2609
+ }
2610
+ showZoomOutIcon() {
2611
+ this.zoomOutIcon && (this.zoomOutIcon.style.display = "", this.zoomOutIcon.style.visibility = "visible", this.zoomOutIcon.style.opacity = 1);
2612
+ }
2613
+ hideZoomOutIcon() {
2614
+ this.zoomOutIcon && (this.zoomOutIcon.style.display = "none", this.zoomOutIcon.style.visibility = "hidden", this.zoomOutIcon.style.opacity = 0);
2406
2615
  }
2407
2616
  addFullscreenIcon() {
2408
- this.fullscreen && (this.fullscreenIcon = zi(), this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenIcon));
2617
+ this.fullscreen && (this.fullscreenIcon = ts(), this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenIcon));
2409
2618
  }
2410
2619
  addCloseFullscreenIcon() {
2411
- this.fullscreenCloseIcon = $i(), this.fullscreenCloseIcon.onclick = this.closeFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenCloseIcon);
2620
+ this.fullscreenCloseIcon = Qi(), this.fullscreenCloseIcon.onclick = this.closeFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenCloseIcon);
2412
2621
  }
2413
2622
  showFullscreenIcon() {
2414
2623
  this.fullscreenIcon && (this.fullscreenIcon.style.opacity = 1);
@@ -2417,7 +2626,7 @@ class Ft {
2417
2626
  this.fullscreenIcon && (this.fullscreenIcon.style.opacity = 0);
2418
2627
  }
2419
2628
  add360ViewCircleIcon() {
2420
- this.view360CircleIcon || (this.view360CircleIcon = Fi(this.bottomCircleOffset), this.innerBox.appendChild(this.view360CircleIcon));
2629
+ this.view360CircleIcon || (this.view360CircleIcon = _i(this.bottomCircleOffset), this.innerBox.appendChild(this.view360CircleIcon));
2421
2630
  }
2422
2631
  show360ViewCircleIcon() {
2423
2632
  this.view360CircleIcon && (this.view360CircleIcon.style.opacity = 1);
@@ -2426,13 +2635,13 @@ class Ft {
2426
2635
  this.view360CircleIcon && (this.view360CircleIcon.style.opacity = 0);
2427
2636
  }
2428
2637
  addLoadingSpinner() {
2429
- this.loadingSpinner = Ji(), this.innerBox.appendChild(this.loadingSpinner);
2638
+ this.loadingSpinner = rs(), this.innerBox.appendChild(this.loadingSpinner);
2430
2639
  }
2431
2640
  showLoadingSpinner() {
2432
2641
  this.loadingSpinner && (this.hideAllIcons(), this.loadingSpinner.style.opacity = 1);
2433
2642
  }
2434
2643
  createTransitionOverlay() {
2435
- this.transitionOverlay = qi(), this.innerBox.appendChild(this.transitionOverlay);
2644
+ this.transitionOverlay = as(), this.innerBox.appendChild(this.transitionOverlay);
2436
2645
  }
2437
2646
  showTransitionOverlay() {
2438
2647
  this.transitionOverlay && (this.hideAllIcons(), this.transitionOverlay.style.opacity = 1);
@@ -2444,28 +2653,28 @@ class Ft {
2444
2653
  this.loadingSpinner && (this.loadingSpinner.style.opacity = 0);
2445
2654
  }
2446
2655
  hideHints() {
2447
- !this.hintsOverlay || this.hintsHidden || (this.hintsHidden = !0, os(this.hintsOverlay));
2656
+ !this.hintsOverlay || this.hintsHidden || (this.hintsHidden = !0, us(this.hintsOverlay));
2448
2657
  }
2449
2658
  addHotspotTimeline() {
2450
2659
  if (!this.hotspots || this.hotspotTimeline) return;
2451
- const t = cs(this.container, this.amountX, this.hotspots);
2660
+ const t = gs(this.container, this.amountX, this.hotspots);
2452
2661
  if (!t) return;
2453
2662
  this.hotspotTimeline = t.element, this.hotspotTimelineIndicator = t.indicator, this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach((s) => {
2454
2663
  s.addEventListener("click", (o) => {
2455
- o.stopPropagation();
2664
+ o.stopPropagation(), this.hideAllIcons(), this.hideHints();
2456
2665
  const n = parseInt(s.getAttribute("data-frame"), 10), l = s.getAttribute("data-hotspot-id");
2457
2666
  isNaN(n) || this.animateToFrame(n, l);
2458
2667
  });
2459
2668
  }), this.updateHotspotTimelinePosition();
2460
2669
  }
2461
2670
  showHotspotTimeline() {
2462
- ds(this.hotspotTimeline);
2671
+ bs(this.hotspotTimeline);
2463
2672
  }
2464
2673
  hideHotspotTimeline() {
2465
- us(this.hotspotTimeline);
2674
+ ws(this.hotspotTimeline);
2466
2675
  }
2467
2676
  updateHotspotTimelinePosition() {
2468
- hs(this.hotspotTimelineIndicator, this.activeImageX, this.amountX);
2677
+ ys(this.hotspotTimelineIndicator, this.activeImageX, this.amountX);
2469
2678
  }
2470
2679
  /**
2471
2680
  * Animates the viewer to a target frame, optionally showing a hotspot popup on arrival
@@ -2502,13 +2711,13 @@ class Ft {
2502
2711
  this.view360CircleIcon && (this.innerBox.removeChild(this.view360CircleIcon), this.view360CircleIcon = null);
2503
2712
  }
2504
2713
  addAllIcons() {
2505
- this.removeLoader(), this.innerBox.style.cursor = "grab", this.pointerZoom && (this.createTransitionOverlay(), this.addLoadingSpinner()), !this.fullscreenView && !this.touchDevice && this.addMagnifierIcon(), this.fullscreenView || this.addFullscreenIcon(), this.initialIconShown && this.addInitialIcon(), this.bottomCircle && this.add360ViewCircleIcon();
2714
+ this.removeLoader(), this.iconsContainer && (this.innerBox.style.cursor = "grab", this.pointerZoom && (this.createTransitionOverlay(), this.addLoadingSpinner()), !this.fullscreenView && !this.touchDevice && this.addMagnifierIcon(), this.fullscreenView || this.addFullscreenIcon(), this.initialIconShown && this.addInitialIcon(), this.bottomCircle && this.add360ViewCircleIcon());
2506
2715
  }
2507
2716
  showAllIcons() {
2508
2717
  this.showInitialIcon(), this.show360ViewCircleIcon(), this.showMagnifierIcon(), this.showFullscreenIcon(), this.showHotspotTimeline();
2509
2718
  }
2510
2719
  hideAllIcons() {
2511
- this.hideInitialIcon(), this.hide360ViewCircleIcon(), this.hideMagnifierIcon(), this.hideFullscreenIcon(), this.hideHotspotTimeline();
2720
+ this.hideInitialIcon(), this.hide360ViewCircleIcon(), this.hideMagnifierIcon(), this.hideZoomOutIcon(), this.hideFullscreenIcon();
2512
2721
  }
2513
2722
  removeLoader() {
2514
2723
  this.loader && (this.innerBox.removeChild(this.loader), this.loader = null);
@@ -2520,10 +2729,10 @@ class Ft {
2520
2729
  this.removeMouseEvents(), this.removeTouchEvents(), this.removeKeyboardEvents(), this.removeEscKeyHandler();
2521
2730
  }
2522
2731
  addMouseEvents() {
2523
- this.boundMouseClick = this.mouseClick.bind(this), this.boundMouseDown = this.mouseDown.bind(this), this.boundMouseMove = de(this.mouseMove.bind(this), ue), this.boundMouseUp = this.mouseUp.bind(this), this.boundMouseLeave = this.mouseLeave.bind(this), this.innerBox.addEventListener("click", this.boundMouseClick), this.innerBox.addEventListener("mousedown", this.boundMouseDown), this.innerBox.addEventListener("mouseleave", this.boundMouseLeave), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
2732
+ this.boundMouseClick = this.mouseClick.bind(this), this.boundMouseDblClick = this.mouseDblClick.bind(this), this.boundMouseDown = this.mouseDown.bind(this), this.boundMouseMove = me(this.mouseMove.bind(this), fe), this.boundMouseUp = this.mouseUp.bind(this), this.boundMouseLeave = this.mouseLeave.bind(this), this.innerBox.addEventListener("click", this.boundMouseClick), this.innerBox.addEventListener("dblclick", this.boundMouseDblClick), this.innerBox.addEventListener("mousedown", this.boundMouseDown), this.innerBox.addEventListener("mouseleave", this.boundMouseLeave), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
2524
2733
  }
2525
2734
  addTouchEvents() {
2526
- this.boundTouchOutside = this.touchOutside.bind(this), this.boundTouchStart = this.touchStart.bind(this), this.boundTouchEnd = this.touchEnd.bind(this), this.boundTouchMove = de(this.touchMove.bind(this), ue), document.addEventListener("touchstart", this.boundTouchOutside), this.container.addEventListener("touchstart", this.boundTouchStart), this.container.addEventListener("touchend", this.boundTouchEnd), this.container.addEventListener("touchmove", this.boundTouchMove);
2735
+ this.boundTouchOutside = this.touchOutside.bind(this), this.boundTouchStart = this.touchStart.bind(this), this.boundTouchEnd = this.touchEnd.bind(this), this.boundTouchMove = me(this.touchMove.bind(this), fe), document.addEventListener("touchstart", this.boundTouchOutside), this.container.addEventListener("touchstart", this.boundTouchStart), this.container.addEventListener("touchend", this.boundTouchEnd), this.container.addEventListener("touchmove", this.boundTouchMove);
2527
2736
  }
2528
2737
  addKeyboardEvents() {
2529
2738
  this.boundKeyDown = this.keyDown.bind(this), this.boundKeyUp = this.keyUp.bind(this), document.addEventListener("keydown", this.boundKeyDown), document.addEventListener("keyup", this.boundKeyUp);
@@ -2537,7 +2746,7 @@ class Ft {
2537
2746
  document.removeEventListener("keydown", this.boundEscHandler);
2538
2747
  }
2539
2748
  removeMouseEvents() {
2540
- this.innerBox.removeEventListener("click", this.boundMouseClick), this.innerBox.removeEventListener("mousedown", this.boundMouseDown), this.innerBox.removeEventListener("mouseleave", this.boundMouseLeave), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("mouseup", this.boundMouseUp);
2749
+ this.innerBox.removeEventListener("click", this.boundMouseClick), this.innerBox.removeEventListener("dblclick", this.boundMouseDblClick), this.innerBox.removeEventListener("mousedown", this.boundMouseDown), this.innerBox.removeEventListener("mouseleave", this.boundMouseLeave), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("mouseup", this.boundMouseUp);
2541
2750
  }
2542
2751
  removeTouchEvents() {
2543
2752
  document.removeEventListener("touchstart", this.boundTouchOutside), this.container.removeEventListener("touchstart", this.boundTouchStart), this.container.removeEventListener("touchend", this.boundTouchEnd), this.container.removeEventListener("touchmove", this.boundTouchMove);
@@ -2546,115 +2755,126 @@ class Ft {
2546
2755
  document.removeEventListener("keydown", this.boundKeyDown), document.removeEventListener("keyup", this.boundKeyUp);
2547
2756
  }
2548
2757
  createContainers(t) {
2549
- this.iconsContainer = ge(this.innerBox), this.canvas = ji(this.innerBox, t), this.loader = Ki(this.innerBox), this.ariaLiveRegion = ts(this.innerBox);
2550
- const i = this.canvas.transferControlToOffscreen();
2551
- this.canvasWorker.postMessage(
2552
- {
2758
+ if (this.iconsContainer = be(this.innerBox), this.canvas = qi(this.innerBox, t), this.loader = os(this.innerBox), this.ariaLiveRegion = cs(this.innerBox), this.useMainThreadCanvas)
2759
+ this.canvasWorker.postMessage({
2553
2760
  action: "initCanvas",
2554
- offscreen: i,
2761
+ offscreen: this.canvas,
2555
2762
  devicePixelRatio: this.devicePixelRatio
2556
- },
2557
- [i]
2558
- ), this.fullscreenView && this.addCloseFullscreenIcon(), Jt(this.innerBox, ".cloudimage-360-placeholder");
2763
+ });
2764
+ else {
2765
+ const i = this.canvas.transferControlToOffscreen();
2766
+ this.canvasWorker.postMessage(
2767
+ {
2768
+ action: "initCanvas",
2769
+ offscreen: i,
2770
+ devicePixelRatio: this.devicePixelRatio
2771
+ },
2772
+ [i]
2773
+ );
2774
+ }
2775
+ this.fullscreenView && this.addCloseFullscreenIcon(), qt(this.innerBox, ".cloudimage-360-placeholder");
2559
2776
  }
2560
2777
  update(t) {
2561
- this.isReady && (this.stopAutoplay(), Jt(this.innerBox, ".cloudimage-360-icons-container"), this.init(this.container, t, !0), this.iconsContainer = ge(this.innerBox), this.onAllImagesLoaded());
2778
+ this.isReady && (this.stopAutoplay(), qt(this.innerBox, ".cloudimage-360-icons-container"), this.init(this.container, t, !0), this.iconsContainer = be(this.innerBox), this.onAllImagesLoaded());
2562
2779
  }
2563
2780
  init(t, i, s) {
2564
- const o = i ? Xi(i) : Ti(t), {
2781
+ const o = i ? Di(i) : Hi(t), {
2565
2782
  folder: n,
2566
2783
  apiVersion: l,
2567
2784
  filenameX: r,
2568
2785
  filenameY: a,
2569
2786
  imageListX: c,
2570
2787
  imageListY: h,
2571
- indexZeroBase: p,
2788
+ indexZeroBase: u,
2572
2789
  amountX: f,
2573
- amountY: u,
2790
+ amountY: p,
2574
2791
  draggable: I = !0,
2575
- swipeable: g = !0,
2792
+ swipeable: b = !0,
2576
2793
  keys: v,
2577
- keysReverse: m,
2578
- bottomCircleOffset: b,
2579
- autoplay: x,
2580
- autoplayBehavior: w,
2794
+ keysReverse: O,
2795
+ bottomCircleOffset: E,
2796
+ autoplay: w,
2797
+ autoplayBehavior: y,
2581
2798
  playOnce: C,
2582
- speed: y,
2583
- autoplayReverse: O,
2584
- fullscreen: S,
2585
- magnifier: E,
2586
- ciToken: A,
2587
- ciFilters: k,
2588
- ciTransformation: R,
2589
- lazyload: T,
2590
- dragSpeed: z,
2799
+ speed: m,
2800
+ autoplayReverse: g,
2801
+ fullscreen: x,
2802
+ magnifier: A,
2803
+ ciToken: k,
2804
+ ciFilters: T,
2805
+ ciTransformation: X,
2806
+ lazyload: L,
2807
+ dragSpeed: $,
2591
2808
  stopAtEdges: G,
2592
- pointerZoom: Y,
2593
- imageInfo: Z = "black",
2594
- initialIconShown: rt,
2595
- bottomCircle: U,
2596
- hotspots: at,
2597
- dragReverse: vt,
2598
- hide360Logo: tt,
2599
- logoSrc: lt,
2600
- inertia: q,
2601
- pinchZoom: V,
2602
- hints: et,
2603
- theme: it,
2604
- hotspotTimelineOnClick: K = !0,
2809
+ pointerZoom: P,
2810
+ pointerZoomTrigger: D = "dblclick",
2811
+ imageInfo: ot = "black",
2812
+ initialIconShown: U,
2813
+ bottomCircle: nt,
2814
+ hotspots: yt,
2815
+ hotspotTrigger: tt = "hover",
2816
+ dragReverse: rt,
2817
+ hide360Logo: q,
2818
+ logoSrc: V,
2819
+ inertia: et,
2820
+ pinchZoom: at,
2821
+ hints: _,
2822
+ theme: lt,
2823
+ hotspotTimelineOnClick: zt = !0,
2605
2824
  aspectRatio: ct,
2606
2825
  // Event callbacks
2607
- onReady: Vt,
2608
- onLoad: gt,
2609
- onSpin: jt,
2610
- onAutoplayStart: Xt,
2611
- onAutoplayStop: $t,
2612
- onFullscreenOpen: zt,
2613
- onFullscreenClose: Pt,
2614
- onZoomIn: Rt,
2615
- onZoomOut: Gt,
2616
- onDragStart: Ut,
2617
- onDragEnd: _,
2618
- onError: ht
2619
- } = o, yt = { ciToken: A, ciFilters: k, ciTransformation: R }, dt = qt(c, []), st = qt(h, []);
2620
- if (this.viewerConfig = o, this.amountX = dt.length || f, this.amountY = st.length || u, this.allowSpinX = !!this.amountX, this.allowSpinY = !!this.amountY, this.activeImageX = O ? this.amountX - 1 : 0, this.activeImageY = O ? this.amountY - 1 : 0, this.bottomCircleOffset = b, this.autoplay = x, this.autoplayBehavior = w, this.playOnce = C, this.speed = y, this.autoplayReverse = O, this.fullscreen = S, this.magnifier = E > 1 ? Math.min(E, Li) : 0, this.dragSpeed = Math.max(z, Ai), this.stopAtEdges = G, this.ciParams = yt, this.apiVersion = l, this.pointerZoom = Y > 1 ? Math.min(Y, me) : null, this.keysReverse = m, this.info = Z, this.keys = v, this.innerBox = this.innerBox ?? Gi(this.container), ct && (this.container.style.aspectRatio = ct), this.initialIconShown = rt, this.bottomCircle = U, this.spinDirection = Ss(this.autoplayBehavior, this.allowSpinX, this.allowSpinY), this.dragReverse = vt, this.hotspots = at, this.hide360Logo = tt, this.logoSrc = lt, this.inertia = q, this.pinchZoom = V, this.hints = et, this.hotspotTimelineOnClick = K, it === "dark" ? this.container.classList.add("ci360-theme-dark") : it === "light" && this.container.classList.remove("ci360-theme-dark"), this.onReady = Vt, this.onLoad = gt, this.onSpin = jt, this.onAutoplayStart = Xt, this.onAutoplayStop = $t, this.onFullscreenOpen = zt, this.onFullscreenClose = Pt, this.onZoomIn = Rt, this.onZoomOut = Gt, this.onDragStart = Ut, this.onDragEnd = _, this.onError = ht, this.srcXConfig = {
2826
+ onReady: jt,
2827
+ onLoad: Lt,
2828
+ onSpin: $t,
2829
+ onAutoplayStart: Gt,
2830
+ onAutoplayStop: Pt,
2831
+ onFullscreenOpen: Mt,
2832
+ onFullscreenClose: Ut,
2833
+ onZoomIn: _t,
2834
+ onZoomOut: K,
2835
+ onDragStart: ht,
2836
+ onDragEnd: Yt,
2837
+ onError: Xt
2838
+ } = o, dt = { ciToken: k, ciFilters: T, ciTransformation: X }, ut = Qt(c, []), pt = Qt(h, []);
2839
+ if (this.viewerConfig = o, this.amountX = ut.length || f, this.amountY = pt.length || p, this.allowSpinX = !!this.amountX, this.allowSpinY = !!this.amountY, this.activeImageX = g ? this.amountX - 1 : 0, this.activeImageY = g ? this.amountY - 1 : 0, this.bottomCircleOffset = E, this.autoplay = w, this.autoplayBehavior = y, this.playOnce = C, this.speed = m, this.autoplayReverse = g, this.fullscreen = x, this.magnifier = A > 1 ? Math.min(A, Xi) : 0, this.dragSpeed = Math.max($, Yi), this.stopAtEdges = G, this.ciParams = dt, this.apiVersion = l, this.pointerZoom = P > 1 ? Math.min(P, ge) : null, this.pointerZoomTrigger = D, this.keysReverse = O, this.info = ot, this.keys = v, this.innerBox = this.innerBox ?? es(this.container), ct && (this.container.style.aspectRatio = ct), this.initialIconShown = U, this.bottomCircle = nt, this.spinDirection = Hs(this.autoplayBehavior, this.allowSpinX, this.allowSpinY), this.dragReverse = rt, this.hotspots = yt, this.hotspotTrigger = tt, this.hide360Logo = q, this.logoSrc = V, this.inertia = et, this.pinchZoom = at, this.hints = _, this.hotspotTimelineOnClick = zt, lt === "dark" ? this.container.classList.add("ci360-theme-dark") : lt === "light" && this.container.classList.remove("ci360-theme-dark"), this.onReady = jt, this.onLoad = Lt, this.onSpin = $t, this.onAutoplayStart = Gt, this.onAutoplayStop = Pt, this.onFullscreenOpen = Mt, this.onFullscreenClose = Ut, this.onZoomIn = _t, this.onZoomOut = K, this.onDragStart = ht, this.onDragEnd = Yt, this.onError = Xt, this.srcXConfig = {
2621
2840
  folder: n,
2622
2841
  filename: r,
2623
- imageList: dt,
2842
+ imageList: ut,
2624
2843
  container: t,
2625
2844
  innerBox: this.innerBox,
2626
2845
  apiVersion: l,
2627
- ciParams: yt,
2628
- lazyload: T,
2846
+ ciParams: dt,
2847
+ lazyload: L,
2629
2848
  amount: this.amountX,
2630
- indexZeroBase: p,
2631
- autoplayReverse: O,
2632
- orientation: P.X
2849
+ indexZeroBase: u,
2850
+ autoplayReverse: g,
2851
+ orientation: Y.X
2633
2852
  }, this.srcYConfig = {
2634
2853
  ...this.srcXConfig,
2635
2854
  filename: a,
2636
- imageList: st,
2637
- orientation: P.Y,
2855
+ imageList: pt,
2856
+ orientation: Y.Y,
2638
2857
  amount: this.amountY
2639
- }, s && this.removeEvents(), this.attachEvents(I, g, v), s) return;
2640
- const bt = (this.fullscreenView ? document.body : this.container).offsetWidth, wt = this.allowSpinX && !dt.length ? Et(this.srcXConfig, bt) : null, It = this.allowSpinY && !st.length ? Et(this.srcYConfig, bt) : null, xt = (Je) => {
2641
- ve({
2858
+ }, s && this.removeEvents(), this.attachEvents(I, b, v), s) return;
2859
+ const bt = (this.fullscreenView ? document.body : this.container).offsetWidth, wt = this.allowSpinX && !ut.length ? Ct(this.srcXConfig, bt) : null, ce = this.allowSpinY && !pt.length ? Ct(this.srcYConfig, bt) : null, he = (ii) => {
2860
+ ye({
2642
2861
  cdnPathX: wt,
2643
- cdnPathY: It,
2862
+ cdnPathY: ce,
2644
2863
  configX: this.srcXConfig,
2645
2864
  configY: this.srcYConfig,
2646
- onImageLoad: (Ct, qe, Qe) => this.onImageLoad(Ct, qe, Qe),
2647
- onFirstImageLoad: (Ct) => this.onFirstImageLoaded(Je, Ct),
2865
+ onImageLoad: (It, si, oi) => this.onImageLoad(It, si, oi),
2866
+ onFirstImageLoad: (It) => this.onFirstImageLoaded(ii, It),
2648
2867
  onAllImagesLoad: this.onAllImagesLoaded.bind(this),
2649
- onError: (Ct) => this.emit("onError", Ct)
2868
+ onError: (It) => this.emit("onError", It)
2650
2869
  });
2651
2870
  };
2652
- this.allowSpinX ? xe(wt, this.srcXConfig, xt) : this.allowSpinY && xe(It, this.srcYConfig, xt);
2871
+ this.allowSpinX ? Ee(wt, this.srcXConfig, he) : this.allowSpinY && Ee(ce, this.srcYConfig, he);
2653
2872
  }
2654
2873
  }
2655
- class qo {
2874
+ const Fe = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
2875
+ class hn {
2656
2876
  constructor() {
2657
- this.views = /* @__PURE__ */ new Map(), this.initAll = this.initAll.bind(this), this.getViews = this.getViews.bind(this);
2877
+ this.views = /* @__PURE__ */ new Map(), this.initAll = this.initAll.bind(this), this.getViews = this.getViews.bind(this), this.memoryObserver = null, this.memoryManagementAutoEnabled = !1;
2658
2878
  }
2659
2879
  generateId() {
2660
2880
  return `ci360-${Math.random().toString(36).slice(2, 11)}`;
@@ -2664,7 +2884,7 @@ class qo {
2664
2884
  const o = t.id || this.generateId();
2665
2885
  t.id || (t.id = o);
2666
2886
  const n = new Ft(t, i, s);
2667
- return this.views.set(o, n), n;
2887
+ return this.views.set(o, n), Fe && !this.memoryManagementAutoEnabled && (this.memoryManagementAutoEnabled = !0, setTimeout(() => this.enableMemoryManagement(), 100)), n;
2668
2888
  }
2669
2889
  initAll(t = "cloudimage-360") {
2670
2890
  [...document.querySelectorAll(`.${t}`)].filter(Boolean).forEach((s) => {
@@ -2672,7 +2892,7 @@ class qo {
2672
2892
  s.id || (s.id = o);
2673
2893
  const n = new Ft(s);
2674
2894
  this.views.set(o, n);
2675
- });
2895
+ }), Fe && !this.memoryManagementAutoEnabled && this.views.size > 0 && (this.memoryManagementAutoEnabled = !0, setTimeout(() => this.enableMemoryManagement(), 100));
2676
2896
  }
2677
2897
  destroy(t) {
2678
2898
  const i = this.getViewById(t);
@@ -2697,8 +2917,50 @@ class qo {
2697
2917
  const n = document.getElementById(t);
2698
2918
  return this.init(n, o);
2699
2919
  }
2920
+ /**
2921
+ * Enable automatic memory management for mobile devices.
2922
+ * Releases memory for off-screen viewers and reloads when they become visible.
2923
+ * Also releases memory when the page is backgrounded (visibilitychange).
2924
+ * Call this after initializing all viewers.
2925
+ * @param {Object} options - Configuration options
2926
+ * @param {string} options.rootMargin - IntersectionObserver rootMargin (default: '200px')
2927
+ */
2928
+ enableMemoryManagement(t = {}) {
2929
+ this.memoryObserver && this.memoryObserver.disconnect();
2930
+ const i = t.rootMargin || "200px";
2931
+ this.memoryObserver = new IntersectionObserver(
2932
+ (s) => {
2933
+ s.forEach((o) => {
2934
+ const n = this.getViewById(o.target.id);
2935
+ n && (o.isIntersecting ? n.isMemoryReleased && n.reloadImages() : !n.isMemoryReleased && n.isReady && n.releaseMemory());
2936
+ });
2937
+ },
2938
+ { rootMargin: i }
2939
+ ), this.views.forEach((s, o) => {
2940
+ const n = document.getElementById(o);
2941
+ n && this.memoryObserver.observe(n);
2942
+ }), this.boundVisibilityHandler = () => {
2943
+ document.hidden ? this.views.forEach((s) => {
2944
+ !s.isMemoryReleased && s.isReady && s.releaseMemory();
2945
+ }) : this.views.forEach((s, o) => {
2946
+ if (s.isMemoryReleased) {
2947
+ const n = document.getElementById(o);
2948
+ if (n) {
2949
+ const l = n.getBoundingClientRect();
2950
+ l.top < window.innerHeight && l.bottom > 0 && s.reloadImages();
2951
+ }
2952
+ }
2953
+ });
2954
+ }, document.addEventListener("visibilitychange", this.boundVisibilityHandler);
2955
+ }
2956
+ /**
2957
+ * Disable automatic memory management
2958
+ */
2959
+ disableMemoryManagement() {
2960
+ this.memoryObserver && (this.memoryObserver.disconnect(), this.memoryObserver = null), this.boundVisibilityHandler && (document.removeEventListener("visibilitychange", this.boundVisibilityHandler), this.boundVisibilityHandler = null);
2961
+ }
2700
2962
  }
2701
2963
  export {
2702
- qo as default
2964
+ hn as default
2703
2965
  };
2704
- //# sourceMappingURL=ci360-CILBSFAa.mjs.map
2966
+ //# sourceMappingURL=ci360-85fPJbOD.mjs.map