@car-cutter/react-webplayer 0.12.0 → 0.13.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.
|
@@ -74,7 +74,7 @@ const Rt = /* @__PURE__ */ new Map(), eo = (r) => {
|
|
|
74
74
|
if (x === "*")
|
|
75
75
|
return s;
|
|
76
76
|
function o(L) {
|
|
77
|
-
return x.split("|").some((
|
|
77
|
+
return x.split("|").some((D) => new RegExp(`^${D.replace(/\*/g, ".*")}$`).test(L));
|
|
78
78
|
}
|
|
79
79
|
return s.filter(({ id: L }) => o(L));
|
|
80
80
|
}, [s, x]), z = et(
|
|
@@ -83,10 +83,10 @@ const Rt = /* @__PURE__ */ new Map(), eo = (r) => {
|
|
|
83
83
|
), y = {
|
|
84
84
|
aspectRatio: l.replace(":", " / ")
|
|
85
85
|
}, h = et(() => {
|
|
86
|
-
const o = f.concat(p), L = o.sort((k, m) => k - m),
|
|
86
|
+
const o = f.concat(p), L = o.sort((k, m) => k - m), D = L.filter(
|
|
87
87
|
(k) => k >= E && k <= e
|
|
88
88
|
);
|
|
89
|
-
if (
|
|
89
|
+
if (D.length === 0) {
|
|
90
90
|
const k = (E + e) / 2, m = o.reduce(
|
|
91
91
|
(N, w) => Math.abs(w - k) < Math.abs(N - k) ? w : N,
|
|
92
92
|
p
|
|
@@ -96,7 +96,7 @@ const Rt = /* @__PURE__ */ new Map(), eo = (r) => {
|
|
|
96
96
|
`Using the closest width instead (${m}).`
|
|
97
97
|
), [m];
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return D;
|
|
100
100
|
}, [f, p, E, e]);
|
|
101
101
|
return /* @__PURE__ */ i(
|
|
102
102
|
dr.Provider,
|
|
@@ -135,8 +135,8 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
135
135
|
),
|
|
136
136
|
[a]
|
|
137
137
|
), s = j((L) => {
|
|
138
|
-
const
|
|
139
|
-
for (const m of
|
|
138
|
+
const D = L.querySelectorAll(Qt), k = /* @__PURE__ */ new Map();
|
|
139
|
+
for (const m of D) {
|
|
140
140
|
const N = m.getAttribute("name");
|
|
141
141
|
if (!N) {
|
|
142
142
|
console.warn("Icon element is missing a name attribute");
|
|
@@ -166,21 +166,21 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
166
166
|
const L = l();
|
|
167
167
|
if (!L)
|
|
168
168
|
return;
|
|
169
|
-
const
|
|
169
|
+
const D = new MutationObserver(() => {
|
|
170
170
|
f(s(L));
|
|
171
171
|
});
|
|
172
|
-
return
|
|
172
|
+
return D.observe(L, {
|
|
173
173
|
childList: !0,
|
|
174
174
|
subtree: !0
|
|
175
|
-
}), () =>
|
|
175
|
+
}), () => D.disconnect();
|
|
176
176
|
}, [s, l]);
|
|
177
177
|
const E = j(
|
|
178
178
|
(L) => p.get(L),
|
|
179
179
|
[p]
|
|
180
180
|
), e = j(
|
|
181
|
-
(L,
|
|
181
|
+
(L, D) => {
|
|
182
182
|
f((k) => {
|
|
183
|
-
const { Icon: m, ...N } =
|
|
183
|
+
const { Icon: m, ...N } = D;
|
|
184
184
|
return new Map(
|
|
185
185
|
k.set(L, {
|
|
186
186
|
...N,
|
|
@@ -191,12 +191,12 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
191
191
|
},
|
|
192
192
|
[]
|
|
193
193
|
), x = j((L) => {
|
|
194
|
-
f((
|
|
194
|
+
f((D) => (D.delete(L), new Map(D)));
|
|
195
195
|
}, []), b = j((L) => {
|
|
196
|
-
const
|
|
196
|
+
const D = L.querySelectorAll(
|
|
197
197
|
Jt
|
|
198
198
|
), k = new Array();
|
|
199
|
-
for (const m of
|
|
199
|
+
for (const m of D) {
|
|
200
200
|
const N = m.innerHTML;
|
|
201
201
|
if (!N) {
|
|
202
202
|
console.warn("Custom media element is empty");
|
|
@@ -230,16 +230,16 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
230
230
|
const L = l();
|
|
231
231
|
if (!L)
|
|
232
232
|
return;
|
|
233
|
-
const
|
|
233
|
+
const D = new MutationObserver(() => {
|
|
234
234
|
y(b(L));
|
|
235
235
|
});
|
|
236
|
-
return
|
|
236
|
+
return D.observe(L, {
|
|
237
237
|
childList: !0,
|
|
238
238
|
subtree: !0
|
|
239
|
-
}), () =>
|
|
239
|
+
}), () => D.disconnect();
|
|
240
240
|
}, [b, l]);
|
|
241
241
|
const h = j((L) => {
|
|
242
|
-
const { Media:
|
|
242
|
+
const { Media: D, ...k } = L, m = /* @__PURE__ */ i("div", { className: Xt, children: D }), N = JSON.stringify(k);
|
|
243
243
|
return y((w) => [
|
|
244
244
|
...w,
|
|
245
245
|
{
|
|
@@ -250,7 +250,7 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
250
250
|
]), N;
|
|
251
251
|
}, []), o = j((L) => {
|
|
252
252
|
y(
|
|
253
|
-
(
|
|
253
|
+
(D) => D.filter((k) => k.id !== L)
|
|
254
254
|
);
|
|
255
255
|
}, []);
|
|
256
256
|
return /* @__PURE__ */ i(
|
|
@@ -307,13 +307,13 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
307
307
|
);
|
|
308
308
|
},
|
|
309
309
|
[]
|
|
310
|
-
), [L,
|
|
310
|
+
), [L, D] = Le(0), [k, m] = Le(null), N = k ?? L, w = z[N], d = y[N], [C, P] = Le(
|
|
311
311
|
null
|
|
312
|
-
), O = !!C, M = j(() =>
|
|
312
|
+
), O = !!C, M = j(() => P(null), []), X = j(() => {
|
|
313
313
|
if (O || k !== null)
|
|
314
314
|
return;
|
|
315
315
|
const Z = L - 1;
|
|
316
|
-
Z >= 0 ? m(Z) : a && (
|
|
316
|
+
Z >= 0 ? m(Z) : a && (P("first_to_last"), m(z.length - 1));
|
|
317
317
|
}, [
|
|
318
318
|
O,
|
|
319
319
|
k,
|
|
@@ -324,7 +324,7 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
324
324
|
if (O || k !== null)
|
|
325
325
|
return;
|
|
326
326
|
const Z = L + 1;
|
|
327
|
-
Z < z.length ? m(Z) : a && (
|
|
327
|
+
Z < z.length ? m(Z) : a && (P("last_to_first"), m(0));
|
|
328
328
|
}, [
|
|
329
329
|
O,
|
|
330
330
|
k,
|
|
@@ -334,7 +334,7 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
334
334
|
]), V = j(
|
|
335
335
|
(Z) => {
|
|
336
336
|
const ie = Math.min(L, Z), ge = Math.max(L, Z);
|
|
337
|
-
y.slice(ie, ge + 1).filter((_e) => _e === null).length > 2 &&
|
|
337
|
+
y.slice(ie, ge + 1).filter((_e) => _e === null).length > 2 && P("instant"), m(Z);
|
|
338
338
|
},
|
|
339
339
|
[L, y]
|
|
340
340
|
);
|
|
@@ -366,7 +366,7 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
366
366
|
V(ge);
|
|
367
367
|
},
|
|
368
368
|
[x, z, V]
|
|
369
|
-
),
|
|
369
|
+
), I = et(() => {
|
|
370
370
|
switch (w.type) {
|
|
371
371
|
case "image":
|
|
372
372
|
return !!w.hotspots?.length;
|
|
@@ -375,9 +375,9 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
375
375
|
default:
|
|
376
376
|
return !1;
|
|
377
377
|
}
|
|
378
|
-
}, [w, d]), [F,
|
|
378
|
+
}, [w, d]), [F, T] = Le(!0), B = j(() => {
|
|
379
379
|
const Z = !F;
|
|
380
|
-
|
|
380
|
+
T(Z), s(Z ? ar : ir);
|
|
381
381
|
}, [s, F]), J = et(() => {
|
|
382
382
|
switch (w.type) {
|
|
383
383
|
case "video":
|
|
@@ -453,7 +453,7 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
453
453
|
setItemInteraction: o,
|
|
454
454
|
slidable: z.length > 1,
|
|
455
455
|
carrouselItemIndex: L,
|
|
456
|
-
setCarrouselItemIndex:
|
|
456
|
+
setCarrouselItemIndex: D,
|
|
457
457
|
itemIndexCommand: k,
|
|
458
458
|
setItemIndexCommand: m,
|
|
459
459
|
masterItemIndex: N,
|
|
@@ -465,7 +465,7 @@ const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
|
|
|
465
465
|
scrollToItemIndex: V,
|
|
466
466
|
displayedCategoryId: te,
|
|
467
467
|
changeCategory: W,
|
|
468
|
-
enableHotspotsControl:
|
|
468
|
+
enableHotspotsControl: I,
|
|
469
469
|
showHotspots: F,
|
|
470
470
|
toggleHotspots: B,
|
|
471
471
|
showGalleryControls: J,
|
|
@@ -676,7 +676,7 @@ const Xe = ({
|
|
|
676
676
|
...E
|
|
677
677
|
}) => {
|
|
678
678
|
const { mediaLoadStrategy: e, playerInViewportWidthRatio: x } = $e(), { imageHdWidth: b, usedMediaWidths: z } = it(), [y, h] = et(() => {
|
|
679
|
-
const
|
|
679
|
+
const D = z.map((m) => `${m !== b ? Qr(r, m) : r} ${m}w`);
|
|
680
680
|
let k;
|
|
681
681
|
if (p)
|
|
682
682
|
k = [`${z[0]}px`];
|
|
@@ -710,7 +710,7 @@ const Xe = ({
|
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
return [
|
|
713
|
+
return [D.join(", "), k.join(", ")];
|
|
714
714
|
}, [
|
|
715
715
|
b,
|
|
716
716
|
s,
|
|
@@ -723,10 +723,10 @@ const Xe = ({
|
|
|
723
723
|
return fe(() => {
|
|
724
724
|
if (o === !0)
|
|
725
725
|
return;
|
|
726
|
-
const
|
|
726
|
+
const D = setTimeout(() => {
|
|
727
727
|
L((k) => k ?? !1);
|
|
728
728
|
}, 30);
|
|
729
|
-
return () => clearTimeout(
|
|
729
|
+
return () => clearTimeout(D);
|
|
730
730
|
}, [o]), /* @__PURE__ */ i(
|
|
731
731
|
"img",
|
|
732
732
|
{
|
|
@@ -741,8 +741,8 @@ const Xe = ({
|
|
|
741
741
|
o === !0 && "opacity-100"
|
|
742
742
|
)
|
|
743
743
|
),
|
|
744
|
-
onLoad: (
|
|
745
|
-
L(!0), l?.(
|
|
744
|
+
onLoad: (D) => {
|
|
745
|
+
L(!0), l?.(D);
|
|
746
746
|
},
|
|
747
747
|
...E
|
|
748
748
|
}
|
|
@@ -1002,17 +1002,17 @@ const Xe = ({
|
|
|
1002
1002
|
prevItem: h,
|
|
1003
1003
|
nextItem: o,
|
|
1004
1004
|
scrollToItemIndex: L,
|
|
1005
|
-
resetView:
|
|
1005
|
+
resetView: D
|
|
1006
1006
|
} = Ke(), k = et(() => {
|
|
1007
1007
|
if (l)
|
|
1008
1008
|
return [];
|
|
1009
1009
|
const S = new Array();
|
|
1010
1010
|
let V = E[0];
|
|
1011
1011
|
const te = (W) => E.find(
|
|
1012
|
-
(
|
|
1012
|
+
(I) => I.items.some((F) => F === W)
|
|
1013
1013
|
);
|
|
1014
1014
|
for (let W = 0; W < x.length; W++) {
|
|
1015
|
-
const
|
|
1015
|
+
const I = x[W], F = te(I);
|
|
1016
1016
|
F && F !== V && (S.push(W), V = F);
|
|
1017
1017
|
}
|
|
1018
1018
|
return S;
|
|
@@ -1022,11 +1022,11 @@ const Xe = ({
|
|
|
1022
1022
|
return m.current;
|
|
1023
1023
|
}, []), w = Ie(!1), d = Ie(
|
|
1024
1024
|
null
|
|
1025
|
-
), [C,
|
|
1025
|
+
), [C, P] = Le(!1), O = j(
|
|
1026
1026
|
(S, V) => {
|
|
1027
|
-
const te = N(), W = te.clientWidth,
|
|
1027
|
+
const te = N(), W = te.clientWidth, I = te.scrollWidth / x.length, F = (S + 1 / 2) * I - W / 2, T = te.scrollWidth - te.clientWidth;
|
|
1028
1028
|
te.scrollTo({
|
|
1029
|
-
left: tt(F, 0,
|
|
1029
|
+
left: tt(F, 0, T),
|
|
1030
1030
|
behavior: V
|
|
1031
1031
|
});
|
|
1032
1032
|
},
|
|
@@ -1036,26 +1036,26 @@ const Xe = ({
|
|
|
1036
1036
|
const S = m.current;
|
|
1037
1037
|
if (!S)
|
|
1038
1038
|
return;
|
|
1039
|
-
const V = (
|
|
1040
|
-
|
|
1041
|
-
x:
|
|
1039
|
+
const V = (I) => {
|
|
1040
|
+
I.preventDefault(), w.current = !0, d.current = {
|
|
1041
|
+
x: I.pageX - S.offsetLeft,
|
|
1042
1042
|
scrollLeft: S.scrollLeft
|
|
1043
1043
|
};
|
|
1044
|
-
}, te = (
|
|
1044
|
+
}, te = (I) => {
|
|
1045
1045
|
if (!w.current)
|
|
1046
1046
|
return;
|
|
1047
1047
|
if (d.current === null)
|
|
1048
1048
|
throw new Error("[onMouseMove] scrollStart is null");
|
|
1049
|
-
const
|
|
1050
|
-
if (!C && Math.abs(
|
|
1049
|
+
const T = I.pageX - S.offsetLeft - d.current.x;
|
|
1050
|
+
if (!C && Math.abs(T) < 5)
|
|
1051
1051
|
return;
|
|
1052
|
-
const B = d.current.scrollLeft -
|
|
1053
|
-
|
|
1052
|
+
const B = d.current.scrollLeft - T;
|
|
1053
|
+
P(!0), requestAnimationFrame(() => {
|
|
1054
1054
|
S.scrollLeft = B;
|
|
1055
1055
|
});
|
|
1056
1056
|
}, W = () => {
|
|
1057
1057
|
w.current && (w.current = !1, requestAnimationFrame(() => {
|
|
1058
|
-
|
|
1058
|
+
P(!1);
|
|
1059
1059
|
}));
|
|
1060
1060
|
};
|
|
1061
1061
|
return S.addEventListener("mousedown", V), document.addEventListener("mousemove", te), document.addEventListener("mouseleave", W), document.addEventListener("mouseup", W), document.addEventListener("contextmenu", W), () => {
|
|
@@ -1075,7 +1075,7 @@ const Xe = ({
|
|
|
1075
1075
|
z
|
|
1076
1076
|
]);
|
|
1077
1077
|
const X = (S) => {
|
|
1078
|
-
C || (s && S === x.length - 1 && y === 0 ? h() : s && S === 0 && y === x.length - 1 ? o() : L(S),
|
|
1078
|
+
C || (s && S === x.length - 1 && y === 0 ? h() : s && S === 0 && y === x.length - 1 ? o() : L(S), D());
|
|
1079
1079
|
};
|
|
1080
1080
|
return /* @__PURE__ */ i(
|
|
1081
1081
|
"div",
|
|
@@ -1145,20 +1145,20 @@ const Xe = ({
|
|
|
1145
1145
|
(w) => {
|
|
1146
1146
|
const d = e("setTransformStyle"), {
|
|
1147
1147
|
x: C,
|
|
1148
|
-
y:
|
|
1148
|
+
y: P,
|
|
1149
1149
|
scale: O
|
|
1150
1150
|
} = {
|
|
1151
1151
|
...y.current,
|
|
1152
1152
|
...w
|
|
1153
|
-
}, M = tt(O, 1, ct), X = d.clientWidth, S = d.clientHeight, V = X * M, te = S * M, W = tt(C, -(V - X), 0),
|
|
1154
|
-
y.current = { x: W, y:
|
|
1153
|
+
}, M = tt(O, 1, ct), X = d.clientWidth, S = d.clientHeight, V = X * M, te = S * M, W = tt(C, -(V - X), 0), I = tt(P, -(te - S), 0);
|
|
1154
|
+
y.current = { x: W, y: I, scale: M }, d.style.transform = `translate(${W}px, ${I}px) scale(${M})`;
|
|
1155
1155
|
},
|
|
1156
1156
|
[e]
|
|
1157
1157
|
), L = j(
|
|
1158
1158
|
(w, d) => {
|
|
1159
1159
|
const {
|
|
1160
1160
|
x: C,
|
|
1161
|
-
y:
|
|
1161
|
+
y: P,
|
|
1162
1162
|
scale: O
|
|
1163
1163
|
} = y.current, {
|
|
1164
1164
|
x: M,
|
|
@@ -1171,33 +1171,33 @@ const Xe = ({
|
|
|
1171
1171
|
h.current && (cancelAnimationFrame(h.current), h.current = null);
|
|
1172
1172
|
const V = () => {
|
|
1173
1173
|
o({ x: M, y: X, scale: S }), p(S);
|
|
1174
|
-
}, te = Math.abs(M - C) < 1 && Math.abs(X -
|
|
1174
|
+
}, te = Math.abs(M - C) < 1 && Math.abs(X - P) < 1 && Math.abs(S - O) < 5e-3;
|
|
1175
1175
|
if (!d || te) {
|
|
1176
1176
|
V();
|
|
1177
1177
|
return;
|
|
1178
1178
|
}
|
|
1179
|
-
const W = (/* @__PURE__ */ new Date()).getTime(),
|
|
1179
|
+
const W = (/* @__PURE__ */ new Date()).getTime(), I = () => {
|
|
1180
1180
|
const F = () => {
|
|
1181
1181
|
const B = (/* @__PURE__ */ new Date()).getTime() - W;
|
|
1182
1182
|
if (B >= d) {
|
|
1183
1183
|
V(), h.current = null;
|
|
1184
1184
|
return;
|
|
1185
1185
|
}
|
|
1186
|
-
const J = Math.min(B / d, 1), me = Lr(J), xe = yt(C, M, me), Pe = yt(
|
|
1187
|
-
o({ x: xe, y: Pe, scale: ne }),
|
|
1186
|
+
const J = Math.min(B / d, 1), me = Lr(J), xe = yt(C, M, me), Pe = yt(P, X, me), ne = yt(O, S, me);
|
|
1187
|
+
o({ x: xe, y: Pe, scale: ne }), I();
|
|
1188
1188
|
};
|
|
1189
1189
|
h.current = requestAnimationFrame(F);
|
|
1190
1190
|
};
|
|
1191
|
-
|
|
1191
|
+
I();
|
|
1192
1192
|
},
|
|
1193
1193
|
[o, p]
|
|
1194
|
-
),
|
|
1194
|
+
), D = j(
|
|
1195
1195
|
(w, d) => {
|
|
1196
|
-
let { x: C, y:
|
|
1197
|
-
w.x && (C += w.x), w.y && (
|
|
1196
|
+
let { x: C, y: P } = y.current;
|
|
1197
|
+
w.x && (C += w.x), w.y && (P += w.y), L(
|
|
1198
1198
|
{
|
|
1199
1199
|
x: C,
|
|
1200
|
-
y:
|
|
1200
|
+
y: P
|
|
1201
1201
|
},
|
|
1202
1202
|
d
|
|
1203
1203
|
);
|
|
@@ -1205,7 +1205,7 @@ const Xe = ({
|
|
|
1205
1205
|
[L]
|
|
1206
1206
|
), k = j(
|
|
1207
1207
|
(w, d, C) => {
|
|
1208
|
-
const
|
|
1208
|
+
const P = y.current.scale, O = tt(w, 1, ct), M = O / P, { x: X, y: S } = y.current, { x: V, y: te } = d, W = -X + V, I = -S + te, F = W * M, T = I * M, B = F - V, J = T - te, me = -B, xe = -J;
|
|
1209
1209
|
L(
|
|
1210
1210
|
{
|
|
1211
1211
|
x: me,
|
|
@@ -1220,12 +1220,12 @@ const Xe = ({
|
|
|
1220
1220
|
(w) => {
|
|
1221
1221
|
const d = e(
|
|
1222
1222
|
"shiftZoomFromButton"
|
|
1223
|
-
), C = d.clientWidth,
|
|
1223
|
+
), C = d.clientWidth, P = d.clientHeight;
|
|
1224
1224
|
k(
|
|
1225
1225
|
w,
|
|
1226
1226
|
{
|
|
1227
1227
|
x: C / 2,
|
|
1228
|
-
y:
|
|
1228
|
+
y: P / 2
|
|
1229
1229
|
},
|
|
1230
1230
|
200
|
|
1231
1231
|
);
|
|
@@ -1233,9 +1233,9 @@ const Xe = ({
|
|
|
1233
1233
|
[e, k]
|
|
1234
1234
|
), N = j(
|
|
1235
1235
|
(w, d, C) => {
|
|
1236
|
-
const { scale:
|
|
1236
|
+
const { scale: P } = y.current;
|
|
1237
1237
|
k(
|
|
1238
|
-
|
|
1238
|
+
P + w,
|
|
1239
1239
|
d,
|
|
1240
1240
|
C
|
|
1241
1241
|
);
|
|
@@ -1262,39 +1262,39 @@ const Xe = ({
|
|
|
1262
1262
|
throw new Error("mouseStartXY.current is null");
|
|
1263
1263
|
O.stopPropagation();
|
|
1264
1264
|
const M = O.clientX - b.current.x, X = O.clientY - b.current.y;
|
|
1265
|
-
|
|
1265
|
+
D({
|
|
1266
1266
|
x: M,
|
|
1267
1267
|
y: X
|
|
1268
1268
|
}), b.current = {
|
|
1269
1269
|
x: O.clientX,
|
|
1270
1270
|
y: O.clientY
|
|
1271
1271
|
};
|
|
1272
|
-
},
|
|
1272
|
+
}, P = () => {
|
|
1273
1273
|
x.current = !1;
|
|
1274
1274
|
};
|
|
1275
|
-
return w.addEventListener("mousedown", d), document.addEventListener("mousemove", C), document.addEventListener("mouseleave",
|
|
1276
|
-
w.removeEventListener("mousedown", d), document.removeEventListener("mousemove", C), document.removeEventListener("mouseleave",
|
|
1275
|
+
return w.addEventListener("mousedown", d), document.addEventListener("mousemove", C), document.addEventListener("mouseleave", P), document.addEventListener("mouseup", P), document.addEventListener("contextmenu", P), () => {
|
|
1276
|
+
w.removeEventListener("mousedown", d), document.removeEventListener("mousemove", C), document.removeEventListener("mouseleave", P), document.removeEventListener("mouseup", P), document.removeEventListener("contextmenu", P);
|
|
1277
1277
|
};
|
|
1278
|
-
}, [s,
|
|
1278
|
+
}, [s, D, r]), fe(() => {
|
|
1279
1279
|
if (r)
|
|
1280
1280
|
return;
|
|
1281
1281
|
const w = f.current;
|
|
1282
1282
|
if (!w)
|
|
1283
1283
|
return;
|
|
1284
1284
|
const d = (C) => {
|
|
1285
|
-
const { ctrlKey:
|
|
1286
|
-
if (
|
|
1285
|
+
const { ctrlKey: P, clientX: O, clientY: M, deltaX: X, deltaY: S } = C;
|
|
1286
|
+
if (P) {
|
|
1287
1287
|
if (!s && S >= 0)
|
|
1288
1288
|
return;
|
|
1289
|
-
const { left: V, top: te } = w.getBoundingClientRect(), W = O - V,
|
|
1289
|
+
const { left: V, top: te } = w.getBoundingClientRect(), W = O - V, I = M - te;
|
|
1290
1290
|
N(-0.01 * S, {
|
|
1291
1291
|
x: W,
|
|
1292
|
-
y:
|
|
1292
|
+
y: I
|
|
1293
1293
|
});
|
|
1294
1294
|
} else {
|
|
1295
1295
|
if (!s)
|
|
1296
1296
|
return;
|
|
1297
|
-
|
|
1297
|
+
D({
|
|
1298
1298
|
x: -2 * X,
|
|
1299
1299
|
y: -2 * S
|
|
1300
1300
|
});
|
|
@@ -1304,11 +1304,11 @@ const Xe = ({
|
|
|
1304
1304
|
return w.addEventListener("wheel", d), () => {
|
|
1305
1305
|
w.removeEventListener("wheel", d);
|
|
1306
1306
|
};
|
|
1307
|
-
}, [s,
|
|
1307
|
+
}, [s, D, N, r]), fe(() => {
|
|
1308
1308
|
const w = f.current, d = E.current;
|
|
1309
1309
|
if (!w || !d)
|
|
1310
1310
|
return;
|
|
1311
|
-
const C = z.current,
|
|
1311
|
+
const C = z.current, P = (X) => {
|
|
1312
1312
|
for (let S = 0; S < X.changedTouches.length; S++) {
|
|
1313
1313
|
const V = X.changedTouches[S];
|
|
1314
1314
|
C.set(V.identifier, V);
|
|
@@ -1327,19 +1327,19 @@ const Xe = ({
|
|
|
1327
1327
|
const V = X.touches[0], te = C.get(V.identifier);
|
|
1328
1328
|
if (!te)
|
|
1329
1329
|
throw new Error("touchStart is null");
|
|
1330
|
-
const W = V.clientX - te.clientX,
|
|
1331
|
-
|
|
1330
|
+
const W = V.clientX - te.clientX, I = V.clientY - te.clientY;
|
|
1331
|
+
D({
|
|
1332
1332
|
x: W,
|
|
1333
|
-
y:
|
|
1333
|
+
y: I
|
|
1334
1334
|
}), C.set(V.identifier, V);
|
|
1335
1335
|
} else if (S === 2) {
|
|
1336
1336
|
X.preventDefault();
|
|
1337
|
-
const [V, te] = X.touches, W = C.get(V.identifier),
|
|
1338
|
-
if (!W || !
|
|
1337
|
+
const [V, te] = X.touches, W = C.get(V.identifier), I = C.get(te.identifier);
|
|
1338
|
+
if (!W || !I)
|
|
1339
1339
|
throw new Error("initialTouch1 or initialTouch2 is null");
|
|
1340
1340
|
const F = Yt(
|
|
1341
1341
|
W,
|
|
1342
|
-
|
|
1342
|
+
I
|
|
1343
1343
|
), B = Yt(V, te) / F, { left: J, top: me } = w.getBoundingClientRect();
|
|
1344
1344
|
N(B - 1, {
|
|
1345
1345
|
x: (V.clientX + te.clientX) / 2 - J,
|
|
@@ -1347,10 +1347,10 @@ const Xe = ({
|
|
|
1347
1347
|
}), C.set(V.identifier, V), C.set(te.identifier, te);
|
|
1348
1348
|
}
|
|
1349
1349
|
};
|
|
1350
|
-
return d.addEventListener("touchstart",
|
|
1351
|
-
d.removeEventListener("touchstart",
|
|
1350
|
+
return d.addEventListener("touchstart", P), d.addEventListener("touchmove", M), d.addEventListener("touchend", O), d.addEventListener("touchcancel", O), () => {
|
|
1351
|
+
d.removeEventListener("touchstart", P), d.removeEventListener("touchmove", M), d.removeEventListener("touchend", O), d.removeEventListener("touchcancel", O);
|
|
1352
1352
|
};
|
|
1353
|
-
}, [s,
|
|
1353
|
+
}, [s, D, N]), /* @__PURE__ */ i(
|
|
1354
1354
|
"div",
|
|
1355
1355
|
{
|
|
1356
1356
|
ref: f,
|
|
@@ -1470,12 +1470,12 @@ window.libpannellum = function(r, a, l) {
|
|
|
1470
1470
|
function s(z) {
|
|
1471
1471
|
var y = a.createElement("canvas");
|
|
1472
1472
|
y.style.width = y.style.height = "100%", z.appendChild(y);
|
|
1473
|
-
var h, o, L,
|
|
1473
|
+
var h, o, L, D, k, m, N, w, d, C, P, O, M, X, S, V;
|
|
1474
1474
|
this.init = function(c, g, le, oe, q, v, Q, $) {
|
|
1475
1475
|
if (g === l && (g = "equirectangular"), g != "equirectangular" && g != "cubemap" && g != "multires")
|
|
1476
1476
|
throw console.log("Error: invalid image type specified!"), { type: "config error" };
|
|
1477
|
-
if (C = g, d = c,
|
|
1478
|
-
if (L && (o.detachShader(h, L), o.deleteShader(L)),
|
|
1477
|
+
if (C = g, d = c, P = le, V = $ || {}, h) {
|
|
1478
|
+
if (L && (o.detachShader(h, L), o.deleteShader(L)), D && (o.detachShader(h, D), o.deleteShader(D)), o.bindBuffer(o.ARRAY_BUFFER, null), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, null), h.texture && o.deleteTexture(h.texture), h.nodeCache)
|
|
1479
1479
|
for (var he = 0; he < h.nodeCache.length; he++)
|
|
1480
1480
|
o.deleteTexture(h.nodeCache[he].texture);
|
|
1481
1481
|
o.deleteProgram(h), h = l;
|
|
@@ -1545,9 +1545,9 @@ window.libpannellum = function(r, a, l) {
|
|
|
1545
1545
|
var Ae = o.TEXTURE_2D;
|
|
1546
1546
|
o.viewport(0, 0, o.drawingBufferWidth, o.drawingBufferHeight), L = o.createShader(o.VERTEX_SHADER);
|
|
1547
1547
|
var je = p;
|
|
1548
|
-
C == "multires" && (je = f), o.shaderSource(L, je), o.compileShader(L),
|
|
1548
|
+
C == "multires" && (je = f), o.shaderSource(L, je), o.compileShader(L), D = o.createShader(o.FRAGMENT_SHADER);
|
|
1549
1549
|
var Ve = x;
|
|
1550
|
-
C == "cubemap" ? (Ae = o.TEXTURE_CUBE_MAP, Ve = e) : C == "multires" && (Ve = b), o.shaderSource(
|
|
1550
|
+
C == "cubemap" ? (Ae = o.TEXTURE_CUBE_MAP, Ve = e) : C == "multires" && (Ve = b), o.shaderSource(D, Ve), o.compileShader(D), h = o.createProgram(), o.attachShader(h, L), o.attachShader(h, D), o.linkProgram(h), o.getShaderParameter(L, o.COMPILE_STATUS) || console.log(o.getShaderInfoLog(L)), o.getShaderParameter(D, o.COMPILE_STATUS) || console.log(o.getShaderInfoLog(D)), o.getProgramParameter(h, o.LINK_STATUS) || console.log(o.getProgramInfoLog(h)), o.useProgram(h), h.drawInProgress = !1;
|
|
1551
1551
|
var Te = $.backgroundColor ? $.backgroundColor : [0, 0, 0];
|
|
1552
1552
|
o.clearColor(Te[0], Te[1], Te[2], 1), o.clear(o.COLOR_BUFFER_BIT), h.texCoordLocation = o.getAttribLocation(h, "a_texCoord"), o.enableVertexAttribArray(h.texCoordLocation), C != "multires" ? (O || (O = o.createBuffer()), o.bindBuffer(o.ARRAY_BUFFER, O), o.bufferData(o.ARRAY_BUFFER, new Float32Array([-1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), o.STATIC_DRAW), o.vertexAttribPointer(h.texCoordLocation, 2, o.FLOAT, !1, 0, 0), h.aspectRatio = o.getUniformLocation(h, "u_aspectRatio"), o.uniform1f(h.aspectRatio, o.drawingBufferWidth / o.drawingBufferHeight), h.psi = o.getUniformLocation(h, "u_psi"), h.theta = o.getUniformLocation(h, "u_theta"), h.f = o.getUniformLocation(h, "u_f"), h.h = o.getUniformLocation(h, "u_h"), h.v = o.getUniformLocation(h, "u_v"), h.vo = o.getUniformLocation(h, "u_vo"), h.rot = o.getUniformLocation(h, "u_rot"), o.uniform1f(h.h, oe / (Math.PI * 2)), o.uniform1f(h.v, q / Math.PI), o.uniform1f(h.vo, v / Math.PI * 2), C == "equirectangular" && (h.backgroundColor = o.getUniformLocation(h, "u_backgroundColor"), o.uniform4fv(h.backgroundColor, Te.concat([1]))), h.texture = o.createTexture(), o.bindTexture(Ae, h.texture), C == "cubemap" ? (o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[1]), o.texImage2D(o.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[3]), o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[4]), o.texImage2D(o.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[5]), o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[0]), o.texImage2D(o.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[2])) : o.texImage2D(Ae, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d), o.texParameteri(Ae, o.TEXTURE_WRAP_S, o.CLAMP_TO_EDGE), o.texParameteri(Ae, o.TEXTURE_WRAP_T, o.CLAMP_TO_EDGE), o.texParameteri(Ae, o.TEXTURE_MIN_FILTER, o.LINEAR), o.texParameteri(Ae, o.TEXTURE_MAG_FILTER, o.LINEAR)) : (h.vertPosLocation = o.getAttribLocation(h, "a_vertCoord"), o.enableVertexAttribArray(h.vertPosLocation), M || (M = o.createBuffer()), X || (X = o.createBuffer()), S || (S = o.createBuffer()), o.bindBuffer(o.ARRAY_BUFFER, X), o.bufferData(o.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), o.STATIC_DRAW), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, S), o.bufferData(o.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), o.STATIC_DRAW), h.perspUniform = o.getUniformLocation(h, "u_perspMatrix"), h.cubeUniform = o.getUniformLocation(h, "u_cubeMatrix"), h.level = -1, h.currentNodes = [], h.nodeCache = [], h.nodeCacheTimestamp = 0);
|
|
1553
1553
|
var He = o.getError();
|
|
@@ -1592,7 +1592,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
if (C != "multires") {
|
|
1594
1594
|
var je = 2 * Math.atan(Math.tan(le * 0.5) / (o.drawingBufferWidth / o.drawingBufferHeight));
|
|
1595
|
-
q = 1 / Math.tan(je * 0.5), o.uniform1f(h.psi, g), o.uniform1f(h.theta, c), o.uniform1f(h.rot, $), o.uniform1f(h.f, q),
|
|
1595
|
+
q = 1 / Math.tan(je * 0.5), o.uniform1f(h.psi, g), o.uniform1f(h.theta, c), o.uniform1f(h.rot, $), o.uniform1f(h.f, q), P === !0 && C == "equirectangular" && (o.bindTexture(o.TEXTURE_2D, h.texture), o.texImage2D(o.TEXTURE_2D, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d)), o.drawArrays(o.TRIANGLES, 0, 6);
|
|
1596
1596
|
} else {
|
|
1597
1597
|
var Ve = ne(le, o.drawingBufferWidth / o.drawingBufferHeight, 0.1, 100);
|
|
1598
1598
|
ze(le);
|
|
@@ -1606,7 +1606,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1606
1606
|
var U = ["f", "b", "u", "d", "l", "r"];
|
|
1607
1607
|
for (Q = 0; Q < 6; Q++) {
|
|
1608
1608
|
var Ee = new F(N[Q], U[Q], 1, 0, 0, d.fullpath);
|
|
1609
|
-
|
|
1609
|
+
T(He, Ee, c, g);
|
|
1610
1610
|
}
|
|
1611
1611
|
for (h.currentNodes.sort(W), v = G.length - 1; v >= 0; v--)
|
|
1612
1612
|
h.currentNodes.indexOf(G[v].node) === -1 && (G[v].node.textureLoad = !1, G.splice(v, 1));
|
|
@@ -1618,7 +1618,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1618
1618
|
break;
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
1621
|
-
|
|
1621
|
+
I();
|
|
1622
1622
|
}
|
|
1623
1623
|
if (oe.returnImage !== l)
|
|
1624
1624
|
return y.toDataURL("image/png");
|
|
@@ -1638,7 +1638,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1638
1638
|
function W(c, g) {
|
|
1639
1639
|
return c.level != g.level ? c.level - g.level : c.diff - g.diff;
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function I() {
|
|
1642
1642
|
if (!h.drawInProgress) {
|
|
1643
1643
|
h.drawInProgress = !0, o.clear(o.COLOR_BUFFER_BIT);
|
|
1644
1644
|
for (var c = 0; c < h.currentNodes.length; c++)
|
|
@@ -1649,7 +1649,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1649
1649
|
function F(c, g, le, oe, q, v) {
|
|
1650
1650
|
this.vertices = c, this.side = g, this.level = le, this.x = oe, this.y = q, this.path = v.replace("%s", g).replace("%l", le).replace("%x", oe).replace("%y", q);
|
|
1651
1651
|
}
|
|
1652
|
-
function
|
|
1652
|
+
function T(c, g, le, oe, q) {
|
|
1653
1653
|
if (Ze(c, g.vertices)) {
|
|
1654
1654
|
var v = g.vertices, Q = v[0] + v[3] + v[6] + v[9], $ = v[1] + v[4] + v[7] + v[10], he = v[2] + v[5] + v[8] + v[11], ae = Math.sqrt(Q * Q + $ * $ + he * he), Se = Math.asin(he / ae), ke = Math.atan2($, Q), Ue = ke - oe;
|
|
1655
1655
|
Ue += Ue > Math.PI ? -2 * Math.PI : Ue < -Math.PI ? 2 * Math.PI : 0, Ue = Math.abs(Ue), g.diff = Math.acos(Math.sin(le) * Math.sin(Se) + Math.cos(le) * Math.cos(Se) * Math.cos(Ue));
|
|
@@ -1666,7 +1666,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1666
1666
|
var Ne = 1 - _e, Fe = [], Ae, je, Ve = _e, Te = _e, He = _e, De = Ne, U = Ne, Ee = Ne;
|
|
1667
1667
|
be < d.tileResolution && (g.x == ie && g.y != ie ? (Te = 0.5, U = 0.5, (g.side == "d" || g.side == "u") && (He = 0.5, Ee = 0.5)) : g.x != ie && g.y == ie && (Ve = 0.5, De = 0.5, (g.side == "l" || g.side == "r") && (He = 0.5, Ee = 0.5))), ge <= d.tileResolution && (g.x == ie && (Ve = 0, De = 1, (g.side == "l" || g.side == "r") && (He = 0, Ee = 1)), g.y == ie && (Te = 0, U = 1, (g.side == "d" || g.side == "u") && (He = 0, Ee = 1))), Ae = [v[0], v[1], v[2], v[0] * Ve + v[3] * De, v[1] * _e + v[4] * Ne, v[2] * He + v[5] * Ee, v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee, v[0] * _e + v[9] * Ne, v[1] * Te + v[10] * U, v[2] * He + v[11] * Ee], je = new F(Ae, g.side, g.level + 1, g.x * 2, g.y * 2, d.fullpath), Fe.push(je), g.x == ie && ge <= d.tileResolution || (Ae = [v[0] * Ve + v[3] * De, v[1] * _e + v[4] * Ne, v[2] * He + v[5] * Ee, v[3], v[4], v[5], v[3] * _e + v[6] * Ne, v[4] * Te + v[7] * U, v[5] * He + v[8] * Ee, v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee], je = new F(Ae, g.side, g.level + 1, g.x * 2 + 1, g.y * 2, d.fullpath), Fe.push(je)), !(g.x == ie && ge <= d.tileResolution) && !(g.y == ie && ge <= d.tileResolution) && (Ae = [v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee, v[3] * _e + v[6] * Ne, v[4] * Te + v[7] * U, v[5] * He + v[8] * Ee, v[6], v[7], v[8], v[9] * Ve + v[6] * De, v[10] * _e + v[7] * Ne, v[11] * He + v[8] * Ee], je = new F(Ae, g.side, g.level + 1, g.x * 2 + 1, g.y * 2 + 1, d.fullpath), Fe.push(je)), g.y == ie && ge <= d.tileResolution || (Ae = [v[0] * _e + v[9] * Ne, v[1] * Te + v[10] * U, v[2] * He + v[11] * Ee, v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee, v[9] * Ve + v[6] * De, v[10] * _e + v[7] * Ne, v[11] * He + v[8] * Ee, v[9], v[10], v[11]], je = new F(Ae, g.side, g.level + 1, g.x * 2, g.y * 2 + 1, d.fullpath), Fe.push(je));
|
|
1668
1668
|
for (var we = 0; we < Fe.length; we++)
|
|
1669
|
-
|
|
1669
|
+
T(c, Fe[we], le, oe);
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
@@ -1933,7 +1933,7 @@ window.libpannellum = function(r, a, l) {
|
|
|
1933
1933
|
}(window, document);
|
|
1934
1934
|
window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
1935
1935
|
function s(p, f) {
|
|
1936
|
-
var E = this, e, x, b, z = !1, y = Date.now(), h = 0, o = 0, L = -1,
|
|
1936
|
+
var E = this, e, x, b, z = !1, y = Date.now(), h = 0, o = 0, L = -1, D = 0, k = 0, m = new Array(10), N = !1, w, d = !1, C = !1, P, O, M = { yaw: 0, pitch: 0, hfov: 0 }, X = !1, S = !1, V = 0, te, W = 0, I, F, T = {}, B = {}, J = [], me = !1, xe = !1, Pe = {
|
|
1937
1937
|
hfov: 100,
|
|
1938
1938
|
minHfov: 50,
|
|
1939
1939
|
maxHfov: 120,
|
|
@@ -2023,37 +2023,37 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2023
2023
|
q();
|
|
2024
2024
|
return;
|
|
2025
2025
|
}
|
|
2026
|
-
|
|
2026
|
+
I = e.hfov, F = e.pitch;
|
|
2027
2027
|
var n, u;
|
|
2028
2028
|
if (e.type == "cubemap") {
|
|
2029
|
-
for (
|
|
2030
|
-
|
|
2029
|
+
for (P = [], n = 0; n < 6; n++)
|
|
2030
|
+
P.push(new Image()), P[n].crossOrigin = e.crossOrigin;
|
|
2031
2031
|
H.load.lbox.style.display = "block", H.load.lbar.style.display = "none";
|
|
2032
2032
|
} else if (e.type == "multires") {
|
|
2033
2033
|
var R = JSON.parse(JSON.stringify(e.multiRes));
|
|
2034
|
-
e.basePath && e.multiRes.basePath && !/^(?:[a-z]+:)?\/\//i.test(e.multiRes.basePath) ? R.basePath = e.basePath + e.multiRes.basePath : e.multiRes.basePath ? R.basePath = e.multiRes.basePath : e.basePath && (R.basePath = e.basePath),
|
|
2034
|
+
e.basePath && e.multiRes.basePath && !/^(?:[a-z]+:)?\/\//i.test(e.multiRes.basePath) ? R.basePath = e.basePath + e.multiRes.basePath : e.multiRes.basePath ? R.basePath = e.multiRes.basePath : e.basePath && (R.basePath = e.basePath), P = R;
|
|
2035
2035
|
} else if (e.dynamic === !0)
|
|
2036
|
-
|
|
2036
|
+
P = e.panorama;
|
|
2037
2037
|
else {
|
|
2038
2038
|
if (e.panorama === l) {
|
|
2039
2039
|
q(e.strings.noPanoramaError);
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
2042
|
-
|
|
2042
|
+
P = new Image();
|
|
2043
2043
|
}
|
|
2044
2044
|
if (e.type == "cubemap") {
|
|
2045
|
-
var
|
|
2046
|
-
|
|
2045
|
+
var A = 6, _ = function() {
|
|
2046
|
+
A--, A === 0 && le();
|
|
2047
2047
|
}, se = function(Me) {
|
|
2048
2048
|
var ye = a.createElement("a");
|
|
2049
2049
|
ye.href = Me.target.src, ye.textContent = ye.href, q(e.strings.fileAccessError.replace("%s", ye.outerHTML));
|
|
2050
2050
|
};
|
|
2051
|
-
for (n = 0; n <
|
|
2052
|
-
u = e.cubeMap[n], u == "null" ? (console.log("Will use background instead of missing cubemap face " + n), _()) : (e.basePath && !g(u) && (u = e.basePath + u),
|
|
2051
|
+
for (n = 0; n < P.length; n++)
|
|
2052
|
+
u = e.cubeMap[n], u == "null" ? (console.log("Will use background instead of missing cubemap face " + n), _()) : (e.basePath && !g(u) && (u = e.basePath + u), P[n].onload = _, P[n].onerror = se, P[n].src = lt(u));
|
|
2053
2053
|
} else if (e.type == "multires")
|
|
2054
2054
|
le();
|
|
2055
2055
|
else if (u = "", e.basePath && (u = e.basePath), e.dynamic !== !0) {
|
|
2056
|
-
u = g(e.panorama) ? e.panorama : u + e.panorama,
|
|
2056
|
+
u = g(e.panorama) ? e.panorama : u + e.panorama, P.onload = function() {
|
|
2057
2057
|
r.URL.revokeObjectURL(this.src), le();
|
|
2058
2058
|
};
|
|
2059
2059
|
var ee = new XMLHttpRequest();
|
|
@@ -2097,9 +2097,9 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2097
2097
|
var R = u.indexOf("ÿÂ");
|
|
2098
2098
|
(R < 0 || R > 65536) && q(e.strings.iOS8WebGLError);
|
|
2099
2099
|
}
|
|
2100
|
-
var
|
|
2101
|
-
if (
|
|
2102
|
-
var _ = u.substring(
|
|
2100
|
+
var A = u.indexOf("<x:xmpmeta");
|
|
2101
|
+
if (A > -1 && e.ignoreGPanoXMP !== !0) {
|
|
2102
|
+
var _ = u.substring(A, u.indexOf("</x:xmpmeta>") + 12), se = function(Me) {
|
|
2103
2103
|
var ye;
|
|
2104
2104
|
return _.indexOf(Me + '="') >= 0 ? (ye = _.substring(_.indexOf(Me + '="') + Me.length + 2), ye = ye.substring(0, ye.indexOf('"'))) : _.indexOf(Me + ">") >= 0 && (ye = _.substring(_.indexOf(Me + ">") + Me.length + 1), ye = ye.substring(0, ye.indexOf("<"))), ye !== l ? Number(ye) : null;
|
|
2105
2105
|
}, ee = {
|
|
@@ -2114,7 +2114,7 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2114
2114
|
};
|
|
2115
2115
|
ee.fullWidth !== null && ee.croppedWidth !== null && ee.fullHeight !== null && ee.croppedHeight !== null && ee.topPixels !== null && (J.indexOf("haov") < 0 && (e.haov = ee.croppedWidth / ee.fullWidth * 360), J.indexOf("vaov") < 0 && (e.vaov = ee.croppedHeight / ee.fullHeight * 180), J.indexOf("vOffset") < 0 && (e.vOffset = ((ee.topPixels + ee.croppedHeight / 2) / ee.fullHeight - 0.5) * -180), ee.heading !== null && J.indexOf("northOffset") < 0 && (e.northOffset = ee.heading, e.compass !== !1 && (e.compass = !0)), ee.horizonPitch !== null && ee.horizonRoll !== null && (J.indexOf("horizonPitch") < 0 && (e.horizonPitch = ee.horizonPitch), J.indexOf("horizonRoll") < 0 && (e.horizonRoll = ee.horizonRoll)));
|
|
2116
2116
|
}
|
|
2117
|
-
|
|
2117
|
+
P.src = r.URL.createObjectURL(t);
|
|
2118
2118
|
}), n.readAsBinaryString !== l ? n.readAsBinaryString(t) : n.readAsText(t);
|
|
2119
2119
|
}
|
|
2120
2120
|
function q(t) {
|
|
@@ -2142,27 +2142,27 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2142
2142
|
var u = Se(t);
|
|
2143
2143
|
console.log("Pitch: " + u[0] + ", Yaw: " + u[1] + ", Center Pitch: " + e.pitch + ", Center Yaw: " + e.yaw + ", HFOV: " + e.hfov);
|
|
2144
2144
|
}
|
|
2145
|
-
gt(), ht(), e.roll = 0, M.hfov = 0, z = !0, y = Date.now(), h = n.x, o = n.y,
|
|
2145
|
+
gt(), ht(), e.roll = 0, M.hfov = 0, z = !0, y = Date.now(), h = n.x, o = n.y, D = e.yaw, k = e.pitch, ne.classList.add("pnlm-grabbing"), ne.classList.remove("pnlm-grab"), ot("mousedown", t), we();
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
2148
|
function ae(t) {
|
|
2149
2149
|
if (e.minHfov === e.hfov)
|
|
2150
|
-
E.setHfov(
|
|
2150
|
+
E.setHfov(I, 1e3);
|
|
2151
2151
|
else {
|
|
2152
2152
|
var n = Se(t);
|
|
2153
2153
|
E.lookAt(n[0], n[1], e.minHfov, 1e3);
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
2156
|
function Se(t) {
|
|
2157
|
-
var n = $(t), u = x.getCanvas(), R = u.clientWidth,
|
|
2157
|
+
var n = $(t), u = x.getCanvas(), R = u.clientWidth, A = u.clientHeight, _ = n.x / R * 2 - 1, se = (1 - n.y / A * 2) * A / R, ee = 1 / Math.tan(e.hfov * Math.PI / 360), de = Math.sin(e.pitch * Math.PI / 180), Me = Math.cos(e.pitch * Math.PI / 180), ye = ee * Me - se * de, qe = Math.sqrt(_ * _ + ye * ye), We = Math.atan((se * Me + ee * de) / qe) * 180 / Math.PI, nt = Math.atan2(_ / qe, ye / qe) * 180 / Math.PI + e.yaw;
|
|
2158
2158
|
return nt < -180 && (nt += 360), nt > 180 && (nt -= 360), [We, nt];
|
|
2159
2159
|
}
|
|
2160
2160
|
function ke(t) {
|
|
2161
2161
|
if (z && w) {
|
|
2162
2162
|
y = Date.now();
|
|
2163
|
-
var n = x.getCanvas(), u = n.clientWidth, R = n.clientHeight,
|
|
2163
|
+
var n = x.getCanvas(), u = n.clientWidth, R = n.clientHeight, A = $(t), _ = (Math.atan(h / u * 2 - 1) - Math.atan(A.x / u * 2 - 1)) * 180 / Math.PI * e.hfov / 90 + D;
|
|
2164
2164
|
M.yaw = (_ - e.yaw) % 360 * 0.2, e.yaw = _;
|
|
2165
|
-
var se = 2 * Math.atan(Math.tan(e.hfov / 360 * Math.PI) * R / u) * 180 / Math.PI, ee = (Math.atan(
|
|
2165
|
+
var se = 2 * Math.atan(Math.tan(e.hfov / 360 * Math.PI) * R / u) * 180 / Math.PI, ee = (Math.atan(A.y / R * 2 - 1) - Math.atan(o / R * 2 - 1)) * 180 / Math.PI * se / 90 + k;
|
|
2166
2166
|
M.pitch = (ee - e.pitch) * 0.2, e.pitch = ee;
|
|
2167
2167
|
}
|
|
2168
2168
|
}
|
|
@@ -2177,19 +2177,19 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2177
2177
|
var u = $(t.targetTouches[1]);
|
|
2178
2178
|
h += (u.x - n.x) * 0.5, o += (u.y - n.y) * 0.5, L = Math.sqrt((n.x - u.x) * (n.x - u.x) + (n.y - u.y) * (n.y - u.y));
|
|
2179
2179
|
}
|
|
2180
|
-
z = !0, y = Date.now(),
|
|
2180
|
+
z = !0, y = Date.now(), D = e.yaw, k = e.pitch, ot("touchstart", t), we();
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
2183
|
function Ye(t) {
|
|
2184
2184
|
if (e.draggable && (t.preventDefault(), w && (y = Date.now()), z && w)) {
|
|
2185
2185
|
var n = $(t.targetTouches[0]), u = n.x, R = n.y;
|
|
2186
2186
|
if (t.targetTouches.length == 2 && L != -1) {
|
|
2187
|
-
var
|
|
2188
|
-
u += (
|
|
2189
|
-
var _ = Math.sqrt((n.x -
|
|
2187
|
+
var A = $(t.targetTouches[1]);
|
|
2188
|
+
u += (A.x - n.x) * 0.5, R += (A.y - n.y) * 0.5;
|
|
2189
|
+
var _ = Math.sqrt((n.x - A.x) * (n.x - A.x) + (n.y - A.y) * (n.y - A.y));
|
|
2190
2190
|
Je(e.hfov + (L - _) * 0.1), L = _;
|
|
2191
2191
|
}
|
|
2192
|
-
var se = e.hfov / 360 * e.touchPanSpeedCoeffFactor, ee = (h - u) * se +
|
|
2192
|
+
var se = e.hfov / 360 * e.touchPanSpeedCoeffFactor, ee = (h - u) * se + D;
|
|
2193
2193
|
M.yaw = (ee - e.yaw) % 360 * 0.2, e.yaw = ee;
|
|
2194
2194
|
var de = (R - o) * se + k;
|
|
2195
2195
|
M.pitch = (de - e.pitch) * 0.2, e.pitch = de;
|
|
@@ -2277,21 +2277,21 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2277
2277
|
}
|
|
2278
2278
|
function He() {
|
|
2279
2279
|
if (w) {
|
|
2280
|
-
var t = !1, n = e.pitch, u = e.yaw, R = e.hfov,
|
|
2281
|
-
typeof performance < "u" && performance.now() ?
|
|
2282
|
-
var _ = (
|
|
2280
|
+
var t = !1, n = e.pitch, u = e.yaw, R = e.hfov, A;
|
|
2281
|
+
typeof performance < "u" && performance.now() ? A = performance.now() : A = Date.now(), O === l && (O = A);
|
|
2282
|
+
var _ = (A - O) * e.hfov / 1700;
|
|
2283
2283
|
if (_ = Math.min(_, 1), m[0] && e.keyboardZoom === !0 && (Je(e.hfov + (M.hfov * 0.8 + 0.5) * _), t = !0), m[1] && e.keyboardZoom === !0 && (Je(e.hfov + (M.hfov * 0.8 - 0.2) * _), t = !0), (m[2] || m[6]) && (e.pitch += (M.pitch * 0.8 + 0.2) * _, t = !0), (m[3] || m[7]) && (e.pitch += (M.pitch * 0.8 - 0.2) * _, t = !0), (m[4] || m[8]) && (e.yaw += (M.yaw * 0.8 - 0.2) * _, t = !0), (m[5] || m[9]) && (e.yaw += (M.yaw * 0.8 + 0.2) * _, t = !0), t && (y = Date.now()), e.autoRotate) {
|
|
2284
|
-
if (
|
|
2285
|
-
var se = (
|
|
2284
|
+
if (A - O > 1e-3) {
|
|
2285
|
+
var se = (A - O) / 1e3, ee = (M.yaw / se * _ - e.autoRotate * 0.2) * se;
|
|
2286
2286
|
ee = (-e.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(e.autoRotate * se), Math.abs(ee)), e.yaw += ee;
|
|
2287
2287
|
}
|
|
2288
|
-
e.autoRotateStopDelay && (e.autoRotateStopDelay -=
|
|
2288
|
+
e.autoRotateStopDelay && (e.autoRotateStopDelay -= A - O, e.autoRotateStopDelay <= 0 && (e.autoRotateStopDelay = !1, W = e.autoRotate, e.autoRotate = 0));
|
|
2289
2289
|
}
|
|
2290
|
-
if (
|
|
2290
|
+
if (T.pitch && (De("pitch"), n = e.pitch), T.yaw && (De("yaw"), u = e.yaw), T.hfov && (De("hfov"), R = e.hfov), _ > 0 && !e.autoRotate) {
|
|
2291
2291
|
var de = 0.85;
|
|
2292
|
-
!m[4] && !m[5] && !m[8] && !m[9] && !
|
|
2292
|
+
!m[4] && !m[5] && !m[8] && !m[9] && !T.yaw && (e.yaw += M.yaw * _ * de), !m[2] && !m[3] && !m[6] && !m[7] && !T.pitch && (e.pitch += M.pitch * _ * de), !m[0] && !m[1] && !T.hfov && Je(e.hfov + M.hfov * _ * de);
|
|
2293
2293
|
}
|
|
2294
|
-
if (O =
|
|
2294
|
+
if (O = A, _ > 0) {
|
|
2295
2295
|
M.yaw = M.yaw * 0.8 + (e.yaw - u) / _ * 0.2, M.pitch = M.pitch * 0.8 + (e.pitch - n) / _ * 0.2, M.hfov = M.hfov * 0.8 + (e.hfov - R) / _ * 0.2;
|
|
2296
2296
|
var Me = e.autoRotate ? Math.abs(e.autoRotate) : 5;
|
|
2297
2297
|
M.yaw = Math.min(Me, Math.max(M.yaw, -Me)), M.pitch = Math.min(Me, Math.max(M.pitch, -Me)), M.hfov = Math.min(Me, Math.max(M.hfov, -Me));
|
|
@@ -2300,11 +2300,11 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2300
2300
|
}
|
|
2301
2301
|
}
|
|
2302
2302
|
function De(t) {
|
|
2303
|
-
var n =
|
|
2303
|
+
var n = T[t], u = Math.min(1, Math.max((Date.now() - n.startTime) / 1e3 / (n.duration / 1e3), 0)), R = n.startPosition + e.animationTimingFunction(u) * (n.endPosition - n.startPosition);
|
|
2304
2304
|
if (n.endPosition > n.startPosition && R >= n.endPosition || n.endPosition < n.startPosition && R <= n.endPosition || n.endPosition === n.startPosition) {
|
|
2305
2305
|
R = n.endPosition, M[t] = 0;
|
|
2306
|
-
var
|
|
2307
|
-
delete
|
|
2306
|
+
var A = T[t].callback, _ = T[t].callbackArgs;
|
|
2307
|
+
delete T[t], typeof A == "function" && A(_);
|
|
2308
2308
|
}
|
|
2309
2309
|
e[t] = R;
|
|
2310
2310
|
}
|
|
@@ -2320,16 +2320,16 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2320
2320
|
function ue() {
|
|
2321
2321
|
if (Ce(), te && clearTimeout(te), z || S === !0)
|
|
2322
2322
|
requestAnimationFrame(ue);
|
|
2323
|
-
else if (m[0] || m[1] || m[2] || m[3] || m[4] || m[5] || m[6] || m[7] || m[8] || m[9] || e.autoRotate ||
|
|
2324
|
-
He(), e.autoRotateInactivityDelay >= 0 && W && Date.now() - y > e.autoRotateInactivityDelay && !e.autoRotate && (e.autoRotate = W, E.lookAt(F, l,
|
|
2323
|
+
else if (m[0] || m[1] || m[2] || m[3] || m[4] || m[5] || m[6] || m[7] || m[8] || m[9] || e.autoRotate || T.pitch || T.yaw || T.hfov || Math.abs(M.yaw) > 0.01 || Math.abs(M.pitch) > 0.01 || Math.abs(M.hfov) > 0.01)
|
|
2324
|
+
He(), e.autoRotateInactivityDelay >= 0 && W && Date.now() - y > e.autoRotateInactivityDelay && !e.autoRotate && (e.autoRotate = W, E.lookAt(F, l, I, 3e3)), requestAnimationFrame(ue);
|
|
2325
2325
|
else if (x && (x.isLoading() || e.dynamic === !0 && me))
|
|
2326
2326
|
requestAnimationFrame(ue);
|
|
2327
2327
|
else {
|
|
2328
2328
|
X = !1, O = l;
|
|
2329
2329
|
var t = e.autoRotateInactivityDelay - (Date.now() - y);
|
|
2330
2330
|
t > 0 ? te = setTimeout(function() {
|
|
2331
|
-
e.autoRotate = W, E.lookAt(F, l,
|
|
2332
|
-
}, t) : e.autoRotateInactivityDelay >= 0 && W && (e.autoRotate = W, E.lookAt(F, l,
|
|
2331
|
+
e.autoRotate = W, E.lookAt(F, l, I, 3e3), we();
|
|
2332
|
+
}, t) : e.autoRotateInactivityDelay >= 0 && W && (e.autoRotate = W, E.lookAt(F, l, I, 3e3), we());
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
2335
|
function Ce() {
|
|
@@ -2338,8 +2338,8 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2338
2338
|
e.yaw > 180 ? e.yaw -= 360 : e.yaw < -180 && (e.yaw += 360), t = e.yaw;
|
|
2339
2339
|
var n = 0;
|
|
2340
2340
|
if (e.avoidShowingBackground) {
|
|
2341
|
-
var de = x.getCanvas(), u = e.hfov / 2, R = Math.atan2(Math.tan(u / 180 * Math.PI), de.width / de.height) * 180 / Math.PI,
|
|
2342
|
-
|
|
2341
|
+
var de = x.getCanvas(), u = e.hfov / 2, R = Math.atan2(Math.tan(u / 180 * Math.PI), de.width / de.height) * 180 / Math.PI, A = e.vaov > e.haov;
|
|
2342
|
+
A ? R * (1 - Math.min(Math.cos((e.pitch - u) / 180 * Math.PI), Math.cos((e.pitch + u) / 180 * Math.PI))) : n = u * (1 - Math.min(Math.cos((e.pitch - R) / 180 * Math.PI), Math.cos((e.pitch + R) / 180 * Math.PI)));
|
|
2343
2343
|
}
|
|
2344
2344
|
var _ = e.maxYaw - e.minYaw, se = -180, ee = 180;
|
|
2345
2345
|
_ < 360 && (se = e.minYaw + e.hfov / 2 + n, ee = e.maxYaw - e.hfov / 2 - n, _ < e.hfov && (se = ee = (se + ee) / 2), e.yaw = Math.max(se, Math.min(ee, e.yaw))), e.autoRotate !== !1 && t != e.yaw && O !== l && (e.autoRotate *= -1);
|
|
@@ -2357,14 +2357,14 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2357
2357
|
return [t, n, u];
|
|
2358
2358
|
};
|
|
2359
2359
|
function Ir(t, n, u) {
|
|
2360
|
-
var R = [n ? n * Math.PI / 180 / 2 : 0, u ? u * Math.PI / 180 / 2 : 0, t ? t * Math.PI / 180 / 2 : 0],
|
|
2361
|
-
return new K(
|
|
2360
|
+
var R = [n ? n * Math.PI / 180 / 2 : 0, u ? u * Math.PI / 180 / 2 : 0, t ? t * Math.PI / 180 / 2 : 0], A = [Math.cos(R[0]), Math.cos(R[1]), Math.cos(R[2])], _ = [Math.sin(R[0]), Math.sin(R[1]), Math.sin(R[2])];
|
|
2361
|
+
return new K(A[0] * A[1] * A[2] - _[0] * _[1] * _[2], _[0] * A[1] * A[2] - A[0] * _[1] * _[2], A[0] * _[1] * A[2] + _[0] * A[1] * _[2], A[0] * A[1] * _[2] + _[0] * _[1] * A[2]);
|
|
2362
2362
|
}
|
|
2363
2363
|
function Tr(t, n, u) {
|
|
2364
2364
|
var R = Ir(t, n, u);
|
|
2365
2365
|
R = R.multiply(new K(Math.sqrt(0.5), -Math.sqrt(0.5), 0, 0));
|
|
2366
|
-
var
|
|
2367
|
-
return R.multiply(new K(Math.cos(
|
|
2366
|
+
var A = r.orientation ? -r.orientation * Math.PI / 180 / 2 : 0;
|
|
2367
|
+
return R.multiply(new K(Math.cos(A), 0, -Math.sin(A), 0));
|
|
2368
2368
|
}
|
|
2369
2369
|
function Dt(t) {
|
|
2370
2370
|
var n = Tr(t.alpha, t.beta, t.gamma).toEulerAngles();
|
|
@@ -2373,7 +2373,7 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2373
2373
|
function Pr() {
|
|
2374
2374
|
try {
|
|
2375
2375
|
var t = {};
|
|
2376
|
-
e.horizonPitch !== l && (t.horizonPitch = e.horizonPitch * Math.PI / 180), e.horizonRoll !== l && (t.horizonRoll = e.horizonRoll * Math.PI / 180), e.backgroundColor !== l && (t.backgroundColor = e.backgroundColor), x.init(
|
|
2376
|
+
e.horizonPitch !== l && (t.horizonPitch = e.horizonPitch * Math.PI / 180), e.horizonRoll !== l && (t.horizonRoll = e.horizonRoll * Math.PI / 180), e.backgroundColor !== l && (t.backgroundColor = e.backgroundColor), x.init(P, e.type, e.dynamic, e.haov * Math.PI / 180, e.vaov * Math.PI / 180, e.vOffset * Math.PI / 180, Rr, t), e.dynamic !== !0 && (P = l);
|
|
2377
2377
|
} catch (n) {
|
|
2378
2378
|
if (n.type == "webgl error" || n.type == "no webgl")
|
|
2379
2379
|
q();
|
|
@@ -2401,8 +2401,8 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2401
2401
|
t.text && (u.innerHTML = st(t.text));
|
|
2402
2402
|
var R;
|
|
2403
2403
|
if (t.video) {
|
|
2404
|
-
var
|
|
2405
|
-
e.basePath && !g(_) && (_ = e.basePath + _),
|
|
2404
|
+
var A = a.createElement("video"), _ = t.video;
|
|
2405
|
+
e.basePath && !g(_) && (_ = e.basePath + _), A.src = lt(_), A.controls = !0, A.style.width = t.width + "px", re.appendChild(n), u.appendChild(A);
|
|
2406
2406
|
} else if (t.image) {
|
|
2407
2407
|
var _ = t.image;
|
|
2408
2408
|
e.basePath && !g(_) && (_ = e.basePath + _), R = a.createElement("a"), R.href = lt(t.URL ? t.URL : _), R.target = "_blank", u.appendChild(R);
|
|
@@ -2430,13 +2430,13 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2430
2430
|
}
|
|
2431
2431
|
}
|
|
2432
2432
|
function Ht(t) {
|
|
2433
|
-
var n = Math.sin(t.pitch * Math.PI / 180), u = Math.cos(t.pitch * Math.PI / 180), R = Math.sin(e.pitch * Math.PI / 180),
|
|
2433
|
+
var n = Math.sin(t.pitch * Math.PI / 180), u = Math.cos(t.pitch * Math.PI / 180), R = Math.sin(e.pitch * Math.PI / 180), A = Math.cos(e.pitch * Math.PI / 180), _ = Math.cos((-t.yaw + e.yaw) * Math.PI / 180), se = n * R + u * _ * A;
|
|
2434
2434
|
if (t.yaw <= 90 && t.yaw > -90 && se <= 0 || (t.yaw > 90 || t.yaw <= -90) && se <= 0)
|
|
2435
2435
|
t.div.style.visibility = "hidden";
|
|
2436
2436
|
else {
|
|
2437
2437
|
var ee = Math.sin((-t.yaw + e.yaw) * Math.PI / 180), de = Math.tan(e.hfov * Math.PI / 360);
|
|
2438
2438
|
t.div.style.visibility = "visible";
|
|
2439
|
-
var Me = x.getCanvas(), ye = Me.clientWidth, qe = Me.clientHeight, We = [-ye / de * ee * u / se / 2, -ye / de * (n *
|
|
2439
|
+
var Me = x.getCanvas(), ye = Me.clientWidth, qe = Me.clientHeight, We = [-ye / de * ee * u / se / 2, -ye / de * (n * A - u * _ * R) / se / 2], nt = Math.sin(e.roll * Math.PI / 180), Vt = Math.cos(e.roll * Math.PI / 180);
|
|
2440
2440
|
We = [We[0] * Vt - We[1] * nt, We[0] * nt + We[1] * Vt], We[0] += (ye - t.div.offsetWidth) / 2, We[1] += (qe - t.div.offsetHeight) / 2;
|
|
2441
2441
|
var Pt = "translate(" + We[0] + "px, " + We[1] + "px) translateZ(9999px) rotate(" + e.roll + "deg)";
|
|
2442
2442
|
t.div.style.webkitTransform = Pt, t.div.style.MozTransform = Pt, t.div.style.transform = Pt;
|
|
@@ -2459,14 +2459,14 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2459
2459
|
else
|
|
2460
2460
|
e[n] = f.default[n], R.indexOf(n) >= 0 && J.push(n);
|
|
2461
2461
|
if (t !== null && t !== "" && f.scenes && f.scenes[t]) {
|
|
2462
|
-
var
|
|
2463
|
-
for (n in
|
|
2464
|
-
if (
|
|
2462
|
+
var A = f.scenes[t];
|
|
2463
|
+
for (n in A)
|
|
2464
|
+
if (A.hasOwnProperty(n))
|
|
2465
2465
|
if (n == "strings")
|
|
2466
|
-
for (u in
|
|
2467
|
-
|
|
2466
|
+
for (u in A.strings)
|
|
2467
|
+
A.strings.hasOwnProperty(u) && (e.strings[u] = st(A.strings[u]));
|
|
2468
2468
|
else
|
|
2469
|
-
e[n] =
|
|
2469
|
+
e[n] = A[n], R.indexOf(n) >= 0 && J.push(n);
|
|
2470
2470
|
e.scene = t;
|
|
2471
2471
|
}
|
|
2472
2472
|
for (n in f)
|
|
@@ -2484,41 +2484,41 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2484
2484
|
}
|
|
2485
2485
|
var u = e.title, R = e.author;
|
|
2486
2486
|
t && ("previewTitle" in e && (e.title = e.previewTitle), "previewAuthor" in e && (e.author = e.previewAuthor)), e.hasOwnProperty("title") || (H.title.innerHTML = ""), e.hasOwnProperty("author") || (H.author.innerHTML = ""), !e.hasOwnProperty("title") && !e.hasOwnProperty("author") && (H.container.style.display = "none"), Y.load.innerHTML = "<p>" + e.strings.loadButtonLabel + "</p>", H.load.boxp.innerHTML = e.strings.loadingLabel;
|
|
2487
|
-
for (var
|
|
2488
|
-
if (e.hasOwnProperty(
|
|
2489
|
-
switch (
|
|
2487
|
+
for (var A in e)
|
|
2488
|
+
if (e.hasOwnProperty(A))
|
|
2489
|
+
switch (A) {
|
|
2490
2490
|
case "title":
|
|
2491
|
-
H.title.innerHTML = st(e[
|
|
2491
|
+
H.title.innerHTML = st(e[A]), H.container.style.display = "inline";
|
|
2492
2492
|
break;
|
|
2493
2493
|
case "author":
|
|
2494
|
-
H.author.innerHTML = e.strings.bylineLabel.replace("%s", st(e[
|
|
2494
|
+
H.author.innerHTML = e.strings.bylineLabel.replace("%s", st(e[A])), H.container.style.display = "inline";
|
|
2495
2495
|
break;
|
|
2496
2496
|
case "fallback":
|
|
2497
2497
|
var _ = a.createElement("a");
|
|
2498
|
-
_.href = lt(e[
|
|
2498
|
+
_.href = lt(e[A]), _.target = "_blank", _.textContent = "Click here to view this panorama in an alternative viewer.";
|
|
2499
2499
|
var se = a.createElement("p");
|
|
2500
2500
|
se.textContent = "Your browser does not support WebGL.", se.appendChild(a.createElement("br")), se.appendChild(_), H.errorMsg.innerHTML = "", H.errorMsg.appendChild(se);
|
|
2501
2501
|
break;
|
|
2502
2502
|
case "hfov":
|
|
2503
|
-
Je(Number(e[
|
|
2503
|
+
Je(Number(e[A]));
|
|
2504
2504
|
break;
|
|
2505
2505
|
case "autoLoad":
|
|
2506
|
-
e[
|
|
2506
|
+
e[A] === !0 && x === l && (H.load.box.style.display = "inline", Y.load.style.display = "none", c());
|
|
2507
2507
|
break;
|
|
2508
2508
|
case "showZoomCtrl":
|
|
2509
|
-
e[
|
|
2509
|
+
e[A] && e.showControls != !1 ? Y.zoom.style.display = "block" : Y.zoom.style.display = "none";
|
|
2510
2510
|
break;
|
|
2511
2511
|
case "showFullscreenCtrl":
|
|
2512
|
-
e[
|
|
2512
|
+
e[A] && e.showControls != !1 && ("fullscreen" in a || "mozFullScreen" in a || "webkitIsFullScreen" in a || "msFullscreenElement" in a) ? Y.fullscreen.style.display = "block" : Y.fullscreen.style.display = "none";
|
|
2513
2513
|
break;
|
|
2514
2514
|
case "hotSpotDebug":
|
|
2515
|
-
e[
|
|
2515
|
+
e[A] ? ze.style.display = "block" : ze.style.display = "none";
|
|
2516
2516
|
break;
|
|
2517
2517
|
case "showControls":
|
|
2518
|
-
e[
|
|
2518
|
+
e[A] || (Y.orientation.style.display = "none", Y.zoom.style.display = "none", Y.fullscreen.style.display = "none");
|
|
2519
2519
|
break;
|
|
2520
2520
|
case "orientationOnByDefault":
|
|
2521
|
-
e[
|
|
2521
|
+
e[A] && (Re === l ? Be = !0 : Re === !0 && vt());
|
|
2522
2522
|
break;
|
|
2523
2523
|
}
|
|
2524
2524
|
t && (u ? e.title = u : delete e.title, R ? e.author = R : delete e.author);
|
|
@@ -2558,15 +2558,15 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2558
2558
|
e.hfov = Ft(t);
|
|
2559
2559
|
}
|
|
2560
2560
|
function gt() {
|
|
2561
|
-
|
|
2561
|
+
T = {}, W = e.autoRotate ? e.autoRotate : W, e.autoRotate = !1;
|
|
2562
2562
|
}
|
|
2563
2563
|
function Ut() {
|
|
2564
2564
|
v(), w = !1, Y.load.style.display = "none", H.load.box.style.display = "inline", c();
|
|
2565
2565
|
}
|
|
2566
|
-
function Tt(t, n, u, R,
|
|
2567
|
-
w = !1,
|
|
2566
|
+
function Tt(t, n, u, R, A) {
|
|
2567
|
+
w = !1, T = {};
|
|
2568
2568
|
var _, se, ee, de;
|
|
2569
|
-
if (e.sceneFadeDuration && !
|
|
2569
|
+
if (e.sceneFadeDuration && !A) {
|
|
2570
2570
|
var Me = x.render(e.pitch * Math.PI / 180, e.yaw * Math.PI / 180, e.hfov * Math.PI / 180, { returnImage: !0 });
|
|
2571
2571
|
if (Me !== l) {
|
|
2572
2572
|
_ = new Image(), _.className = "pnlm-fade-img", _.style.transition = "opacity " + e.sceneFadeDuration / 1e3 + "s", _.style.width = "100%", _.style.height = "100%", _.onload = function() {
|
|
@@ -2599,7 +2599,7 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2599
2599
|
}, this.getPitch = function() {
|
|
2600
2600
|
return e.pitch;
|
|
2601
2601
|
}, this.setPitch = function(t, n, u, R) {
|
|
2602
|
-
return n = n == l ? 1e3 : Number(n), n ?
|
|
2602
|
+
return n = n == l ? 1e3 : Number(n), n ? T.pitch = {
|
|
2603
2603
|
startTime: Date.now(),
|
|
2604
2604
|
startPosition: e.pitch,
|
|
2605
2605
|
endPosition: t,
|
|
@@ -2614,7 +2614,7 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2614
2614
|
}, this.getYaw = function() {
|
|
2615
2615
|
return e.yaw;
|
|
2616
2616
|
}, this.setYaw = function(t, n, u, R) {
|
|
2617
|
-
return n = n == l ? 1e3 : Number(n), t = (t + 180) % 360 - 180, n ? (e.yaw - t > 180 ? t += 360 : t - e.yaw > 180 && (t -= 360),
|
|
2617
|
+
return n = n == l ? 1e3 : Number(n), t = (t + 180) % 360 - 180, n ? (e.yaw - t > 180 ? t += 360 : t - e.yaw > 180 && (t -= 360), T.yaw = {
|
|
2618
2618
|
startTime: Date.now(),
|
|
2619
2619
|
startPosition: e.yaw,
|
|
2620
2620
|
endPosition: t,
|
|
@@ -2629,7 +2629,7 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2629
2629
|
}, this.getHfov = function() {
|
|
2630
2630
|
return e.hfov;
|
|
2631
2631
|
}, this.setHfov = function(t, n, u, R) {
|
|
2632
|
-
return n = n == l ? 1e3 : Number(n), n ?
|
|
2632
|
+
return n = n == l ? 1e3 : Number(n), n ? T.hfov = {
|
|
2633
2633
|
startTime: Date.now(),
|
|
2634
2634
|
startPosition: e.hfov,
|
|
2635
2635
|
endPosition: Ft(t),
|
|
@@ -2641,8 +2641,8 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2641
2641
|
return [e.minHfov, e.maxHfov];
|
|
2642
2642
|
}, this.setHfovBounds = function(t) {
|
|
2643
2643
|
return e.minHfov = Math.max(0, t[0]), e.maxHfov = Math.max(0, t[1]), this;
|
|
2644
|
-
}, this.lookAt = function(t, n, u, R,
|
|
2645
|
-
return R = R == l ? 1e3 : Number(R), t !== l && (this.setPitch(t, R,
|
|
2644
|
+
}, this.lookAt = function(t, n, u, R, A, _) {
|
|
2645
|
+
return R = R == l ? 1e3 : Number(R), t !== l && (this.setPitch(t, R, A, _), A = l), n !== l && (this.setYaw(n, R, A, _), A = l), u !== l && this.setHfov(u, R, A, _), this;
|
|
2646
2646
|
}, this.getNorthOffset = function() {
|
|
2647
2647
|
return e.northOffset;
|
|
2648
2648
|
}, this.setNorthOffset = function(t) {
|
|
@@ -2656,7 +2656,7 @@ window.pannellum = /* @__PURE__ */ function(r, a, l) {
|
|
|
2656
2656
|
}, this.setHorizonPitch = function(t) {
|
|
2657
2657
|
return e.horizonPitch = Math.min(90, Math.max(-90, t)), x.setPose(e.horizonPitch * Math.PI / 180, e.horizonRoll * Math.PI / 180), we(), this;
|
|
2658
2658
|
}, this.startAutoRotate = function(t) {
|
|
2659
|
-
return t = t || W || 1, e.autoRotate = t, E.lookAt(F, l,
|
|
2659
|
+
return t = t || W || 1, e.autoRotate = t, E.lookAt(F, l, I, 3e3), we(), this;
|
|
2660
2660
|
}, this.stopAutoRotate = function() {
|
|
2661
2661
|
return W = e.autoRotate ? e.autoRotate : W, e.autoRotate = !1, e.autoRotateInactivityDelay = -1, this;
|
|
2662
2662
|
}, this.getRenderer = function() {
|
|
@@ -2997,7 +2997,7 @@ const _o = ({
|
|
|
2997
2997
|
}
|
|
2998
2998
|
)
|
|
2999
2999
|
] }) })), No = (r) => {
|
|
3000
|
-
const { itemIndex: a, src: l, poster: s, onLoaded: p, onError: f } = r, { autoLoadInterior360: E } = $e(), { isShowingDetails: e, setItemInteraction: x, zoom: b, isZooming: z, setZoom: y } = Ke(), [h, o] = Ro(l), L = Ie(null),
|
|
3000
|
+
const { itemIndex: a, src: l, poster: s, onLoaded: p, onError: f } = r, { autoLoadInterior360: E } = $e(), { isShowingDetails: e, setItemInteraction: x, zoom: b, isZooming: z, setZoom: y } = Ke(), [h, o] = Ro(l), L = Ie(null), D = Ie(null), [k, m] = Le(!1), N = j(() => {
|
|
3001
3001
|
a !== void 0 && x(a, "ready"), p?.(), m(!0);
|
|
3002
3002
|
}, [a, x, p]), w = j((C) => {
|
|
3003
3003
|
C instanceof MouseEvent && C.button !== 0 || (C.preventDefault(), C.stopPropagation(), C.stopImmediatePropagation());
|
|
@@ -3006,26 +3006,26 @@ const _o = ({
|
|
|
3006
3006
|
C && C.loadScene();
|
|
3007
3007
|
}, []);
|
|
3008
3008
|
return fe(() => {
|
|
3009
|
-
if (L.current && k) {
|
|
3010
|
-
const C = L.current.getViewer();
|
|
3009
|
+
if (L.current && k && D.current) {
|
|
3010
|
+
const C = L.current.getViewer(), P = D.current;
|
|
3011
3011
|
if (C) {
|
|
3012
|
-
const
|
|
3012
|
+
const O = (W) => {
|
|
3013
3013
|
W.preventDefault();
|
|
3014
|
-
const
|
|
3014
|
+
const I = Bt(
|
|
3015
3015
|
C.getHfov(),
|
|
3016
3016
|
bt,
|
|
3017
3017
|
xt,
|
|
3018
3018
|
ct,
|
|
3019
3019
|
dt
|
|
3020
|
-
),
|
|
3021
|
-
y(
|
|
3020
|
+
), T = (W.deltaY < 0 ? "zoom-in" : "zoom-out") === "zoom-in" ? Math.min(I + dt, ct) : Math.max(I - dt, 1);
|
|
3021
|
+
y(T);
|
|
3022
3022
|
}, M = So(
|
|
3023
3023
|
O,
|
|
3024
3024
|
100,
|
|
3025
3025
|
150
|
|
3026
3026
|
), X = (W) => {
|
|
3027
3027
|
W.preventDefault();
|
|
3028
|
-
const
|
|
3028
|
+
const I = Bt(
|
|
3029
3029
|
C.getHfov(),
|
|
3030
3030
|
bt,
|
|
3031
3031
|
xt,
|
|
@@ -3033,21 +3033,12 @@ const _o = ({
|
|
|
3033
3033
|
dt,
|
|
3034
3034
|
!0
|
|
3035
3035
|
);
|
|
3036
|
-
y(
|
|
3036
|
+
y(I);
|
|
3037
3037
|
};
|
|
3038
|
-
|
|
3039
|
-
"wheel",
|
|
3040
|
-
M
|
|
3041
|
-
), I.addEventListener(
|
|
3042
|
-
"dblclick",
|
|
3043
|
-
X
|
|
3044
|
-
));
|
|
3038
|
+
P.addEventListener("wheel", M), P.addEventListener("dblclick", X);
|
|
3045
3039
|
const S = Math.abs(1 - Math.abs(b)), V = xt - bt, te = jt - S * V;
|
|
3046
3040
|
return C.setHfov(te), () => {
|
|
3047
|
-
|
|
3048
|
-
"dblclick",
|
|
3049
|
-
X
|
|
3050
|
-
));
|
|
3041
|
+
P.removeEventListener("wheel", O), P.removeEventListener("dblclick", X);
|
|
3051
3042
|
};
|
|
3052
3043
|
}
|
|
3053
3044
|
}
|
|
@@ -3059,26 +3050,27 @@ const _o = ({
|
|
|
3059
3050
|
e ? "scale-105" : "scale-100"
|
|
3060
3051
|
),
|
|
3061
3052
|
children: [
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
/* @__PURE__ */ i(
|
|
3053
|
+
/* @__PURE__ */ pe("div", { ref: D, children: [
|
|
3054
|
+
/* @__PURE__ */ i("style", { children: `
|
|
3055
|
+
.pnlm-load-button {
|
|
3056
|
+
display: none !important;
|
|
3057
|
+
}
|
|
3058
|
+
.pnlm-load-box {
|
|
3059
|
+
display: none !important;
|
|
3060
|
+
}
|
|
3061
|
+
.pnlm-container {
|
|
3062
|
+
background-image: none !important;
|
|
3063
|
+
}
|
|
3064
|
+
` }),
|
|
3065
|
+
D.current && /* @__PURE__ */ i(
|
|
3075
3066
|
Lt,
|
|
3076
3067
|
{
|
|
3077
3068
|
ref: L,
|
|
3069
|
+
id: D.current,
|
|
3078
3070
|
panorama: l,
|
|
3079
3071
|
preview: s,
|
|
3080
|
-
width: "
|
|
3081
|
-
height: "
|
|
3072
|
+
width: "0",
|
|
3073
|
+
height: "0",
|
|
3082
3074
|
image: l,
|
|
3083
3075
|
pitch: To,
|
|
3084
3076
|
yaw: Po,
|
|
@@ -3087,6 +3079,7 @@ const _o = ({
|
|
|
3087
3079
|
minHfov: bt,
|
|
3088
3080
|
compass: !1,
|
|
3089
3081
|
showControls: !1,
|
|
3082
|
+
keyboardZoom: !1,
|
|
3090
3083
|
onLoad: N,
|
|
3091
3084
|
onError: f,
|
|
3092
3085
|
onMousedown: w,
|
|
@@ -3095,18 +3088,18 @@ const _o = ({
|
|
|
3095
3088
|
onMouseup: w,
|
|
3096
3089
|
autoLoad: !1
|
|
3097
3090
|
}
|
|
3098
|
-
),
|
|
3099
|
-
/* @__PURE__ */ i(
|
|
3100
|
-
_o,
|
|
3101
|
-
{
|
|
3102
|
-
isPannellumLoaded: k,
|
|
3103
|
-
isLoading: o,
|
|
3104
|
-
progress: h,
|
|
3105
|
-
autoloadInterior360: E,
|
|
3106
|
-
loadScene: d
|
|
3107
|
-
}
|
|
3108
3091
|
)
|
|
3109
|
-
] })
|
|
3092
|
+
] }),
|
|
3093
|
+
/* @__PURE__ */ i(
|
|
3094
|
+
_o,
|
|
3095
|
+
{
|
|
3096
|
+
isPannellumLoaded: k,
|
|
3097
|
+
isLoading: o,
|
|
3098
|
+
progress: h,
|
|
3099
|
+
autoloadInterior360: E,
|
|
3100
|
+
loadScene: d
|
|
3101
|
+
}
|
|
3102
|
+
)
|
|
3110
3103
|
]
|
|
3111
3104
|
}
|
|
3112
3105
|
) }) });
|
|
@@ -3136,10 +3129,10 @@ const _o = ({
|
|
|
3136
3129
|
z.current && (clearTimeout(z.current), z.current = null);
|
|
3137
3130
|
}, []), h = Ie(null), o = () => {
|
|
3138
3131
|
h.current && (cancelAnimationFrame(h.current), h.current = null);
|
|
3139
|
-
}, [L,
|
|
3140
|
-
|
|
3132
|
+
}, [L, D] = Le(0), k = r.length, m = j(() => {
|
|
3133
|
+
D((w) => (w - 1 + k) % k);
|
|
3141
3134
|
}, [k]), N = j(() => {
|
|
3142
|
-
|
|
3135
|
+
D((w) => (w + 1) % k);
|
|
3143
3136
|
}, [k]);
|
|
3144
3137
|
return fe(() => {
|
|
3145
3138
|
if (E) {
|
|
@@ -3153,14 +3146,14 @@ const _o = ({
|
|
|
3153
3146
|
const re = Date.now(), G = () => {
|
|
3154
3147
|
const ve = () => {
|
|
3155
3148
|
const ze = (Date.now() - re) / Ao, Re = Math.round(((Ze) => Ze * (2 - Ze))(ze) * k), Be = tt(Re % k, 0, k - 1);
|
|
3156
|
-
|
|
3149
|
+
D(Be), !(Re >= k) && G();
|
|
3157
3150
|
};
|
|
3158
3151
|
h.current = requestAnimationFrame(ve);
|
|
3159
3152
|
};
|
|
3160
3153
|
G();
|
|
3161
3154
|
}, Do));
|
|
3162
3155
|
const C = Ho / k;
|
|
3163
|
-
let
|
|
3156
|
+
let P = null, O = [];
|
|
3164
3157
|
const M = (re) => {
|
|
3165
3158
|
O.push(re), O.length > 20 && O.shift();
|
|
3166
3159
|
}, X = () => {
|
|
@@ -3193,27 +3186,27 @@ const _o = ({
|
|
|
3193
3186
|
return;
|
|
3194
3187
|
re.preventDefault(), re.stopPropagation(), S();
|
|
3195
3188
|
const G = re.clientX;
|
|
3196
|
-
|
|
3189
|
+
P = G, O = [{ timestamp: Date.now(), value: G }];
|
|
3197
3190
|
}, te = (re) => {
|
|
3198
|
-
if (
|
|
3191
|
+
if (P === null)
|
|
3199
3192
|
return;
|
|
3200
3193
|
re.stopPropagation();
|
|
3201
3194
|
const { clientX: G } = re;
|
|
3202
3195
|
M({ timestamp: Date.now(), value: G });
|
|
3203
|
-
const ve = G -
|
|
3204
|
-
Math.abs(ve) < C || (ve > 0 !== s ? N() : m(),
|
|
3196
|
+
const ve = G - P;
|
|
3197
|
+
Math.abs(ve) < C || (ve > 0 !== s ? N() : m(), P = G);
|
|
3205
3198
|
}, W = () => {
|
|
3206
|
-
|
|
3199
|
+
P !== null && (P = null, X());
|
|
3207
3200
|
};
|
|
3208
3201
|
w.addEventListener("mousedown", V), document.addEventListener("mousemove", te), document.addEventListener("mouseleave", W), document.addEventListener("mouseup", W), document.addEventListener("contextmenu", W);
|
|
3209
|
-
const
|
|
3210
|
-
const re =
|
|
3202
|
+
const I = Oo / k, F = () => d.getBoundingClientRect().width, T = () => d.scrollWidth / 2 - F() / 2, B = () => {
|
|
3203
|
+
const re = T();
|
|
3211
3204
|
d.scrollLeft = re;
|
|
3212
3205
|
};
|
|
3213
3206
|
B();
|
|
3214
3207
|
const J = () => {
|
|
3215
|
-
const re = d.scrollLeft -
|
|
3216
|
-
Math.abs(re) <
|
|
3208
|
+
const re = d.scrollLeft - T();
|
|
3209
|
+
Math.abs(re) < I || (re < 0 !== s ? N() : m(), B());
|
|
3217
3210
|
};
|
|
3218
3211
|
d.addEventListener("scroll", J);
|
|
3219
3212
|
let me = null;
|
|
@@ -3222,9 +3215,9 @@ const _o = ({
|
|
|
3222
3215
|
return;
|
|
3223
3216
|
S();
|
|
3224
3217
|
const { identifier: G, clientX: ve } = re.changedTouches[0];
|
|
3225
|
-
me = G,
|
|
3218
|
+
me = G, P = ve, O = [{ timestamp: Date.now(), value: ve }];
|
|
3226
3219
|
}, Pe = (re) => {
|
|
3227
|
-
if (!
|
|
3220
|
+
if (!P)
|
|
3228
3221
|
return;
|
|
3229
3222
|
const G = Array.from(re.changedTouches).find(
|
|
3230
3223
|
({ identifier: ze }) => ze === me
|
|
@@ -3234,12 +3227,12 @@ const _o = ({
|
|
|
3234
3227
|
re.preventDefault();
|
|
3235
3228
|
const { clientX: ve } = G;
|
|
3236
3229
|
M({ timestamp: Date.now(), value: ve });
|
|
3237
|
-
const H = ve -
|
|
3238
|
-
Math.abs(H) < C || (H > 0 !== s ? N() : m(),
|
|
3230
|
+
const H = ve - P;
|
|
3231
|
+
Math.abs(H) < C || (H > 0 !== s ? N() : m(), P = ve);
|
|
3239
3232
|
}, ne = (re) => {
|
|
3240
|
-
!
|
|
3233
|
+
!P || !Array.from(re.changedTouches).some(
|
|
3241
3234
|
({ identifier: ve }) => ve === me
|
|
3242
|
-
) || (me = null,
|
|
3235
|
+
) || (me = null, P = null, X());
|
|
3243
3236
|
};
|
|
3244
3237
|
return d.addEventListener("touchstart", xe), d.addEventListener("touchmove", Pe), d.addEventListener("touchend", ne), d.addEventListener("touchcancel", ne), () => {
|
|
3245
3238
|
w.removeEventListener("mousedown", V), document.removeEventListener("mousemove", te), document.removeEventListener("mouseleave", W), document.removeEventListener("mouseup", W), document.removeEventListener("contextmenu", W), d.removeEventListener("scroll", J), d.removeEventListener("touchstart", xe), d.removeEventListener("touchmove", Pe), d.removeEventListener("touchend", ne), d.removeEventListener("touchcancel", ne);
|
|
@@ -3413,70 +3406,70 @@ const _o = ({
|
|
|
3413
3406
|
}, [s, l, b]);
|
|
3414
3407
|
const [z, y] = Le(!1), [h, o] = Le(!0), L = () => {
|
|
3415
3408
|
y(!0), p(l, "running");
|
|
3416
|
-
},
|
|
3409
|
+
}, D = () => {
|
|
3417
3410
|
y(!1), p(l, "ready");
|
|
3418
3411
|
}, k = () => {
|
|
3419
3412
|
o(!1);
|
|
3420
3413
|
}, m = () => {
|
|
3421
3414
|
o(!0);
|
|
3422
|
-
}, [N, w] = Le(null), d = (
|
|
3423
|
-
const B = e(), J =
|
|
3415
|
+
}, [N, w] = Le(null), d = (T) => {
|
|
3416
|
+
const B = e(), J = T.currentTarget.getBoundingClientRect(), xe = (T.clientX - J.left) / J.width, Pe = Math.min(1, Math.max(0, xe));
|
|
3424
3417
|
B.volume = Pe, B.muted = !1;
|
|
3425
|
-
}, C = (
|
|
3418
|
+
}, C = (T) => {
|
|
3426
3419
|
const B = e();
|
|
3427
|
-
B.muted =
|
|
3420
|
+
B.muted = T;
|
|
3428
3421
|
};
|
|
3429
3422
|
fe(() => {
|
|
3430
|
-
const
|
|
3431
|
-
if (!
|
|
3423
|
+
const T = E.current;
|
|
3424
|
+
if (!T)
|
|
3432
3425
|
return;
|
|
3433
3426
|
const B = () => {
|
|
3434
3427
|
w({
|
|
3435
|
-
volume:
|
|
3436
|
-
isMuted:
|
|
3428
|
+
volume: T.volume,
|
|
3429
|
+
isMuted: T.muted
|
|
3437
3430
|
});
|
|
3438
3431
|
};
|
|
3439
|
-
return B(),
|
|
3440
|
-
|
|
3432
|
+
return B(), T.addEventListener("volumechange", B), () => {
|
|
3433
|
+
T.removeEventListener("volumechange", B);
|
|
3441
3434
|
};
|
|
3442
3435
|
}, []);
|
|
3443
|
-
const [
|
|
3436
|
+
const [P, O] = Le(null), M = P ? P.currentTime / P.duration : 0;
|
|
3444
3437
|
fe(() => {
|
|
3445
|
-
const
|
|
3446
|
-
if (!
|
|
3438
|
+
const T = E.current;
|
|
3439
|
+
if (!T) return;
|
|
3447
3440
|
const B = () => {
|
|
3448
|
-
const J =
|
|
3441
|
+
const J = T.currentTime, me = T.duration;
|
|
3449
3442
|
isNaN(J) || isNaN(me) || O({
|
|
3450
3443
|
currentTime: J,
|
|
3451
3444
|
duration: me
|
|
3452
3445
|
});
|
|
3453
3446
|
};
|
|
3454
|
-
return B(),
|
|
3455
|
-
|
|
3447
|
+
return B(), T.addEventListener("timeupdate", B), () => {
|
|
3448
|
+
T.removeEventListener("timeupdate", B);
|
|
3456
3449
|
};
|
|
3457
3450
|
}, []);
|
|
3458
|
-
const X = (
|
|
3459
|
-
const B = e(), J =
|
|
3451
|
+
const X = (T) => {
|
|
3452
|
+
const B = e(), J = T.currentTarget.getBoundingClientRect(), xe = (T.clientX - J.left) / J.width, Pe = B.duration * xe;
|
|
3460
3453
|
B.currentTime = Pe;
|
|
3461
|
-
}, S = (
|
|
3462
|
-
const B = Math.floor(
|
|
3454
|
+
}, S = (T) => {
|
|
3455
|
+
const B = Math.floor(T % 3600 / 60), J = Math.floor(T % 60);
|
|
3463
3456
|
return `${B}:${J.toString().padStart(2, "0")}`;
|
|
3464
|
-
}, [V, te] = Le(!1), W = Ie(void 0),
|
|
3457
|
+
}, [V, te] = Le(!1), W = Ie(void 0), I = j(
|
|
3465
3458
|
() => clearTimeout(W.current),
|
|
3466
3459
|
[]
|
|
3467
3460
|
), F = j(() => {
|
|
3468
|
-
|
|
3461
|
+
I(), W.current = setTimeout(() => {
|
|
3469
3462
|
te(!1);
|
|
3470
3463
|
}, Zo);
|
|
3471
|
-
}, [
|
|
3464
|
+
}, [I]);
|
|
3472
3465
|
return fe(() => {
|
|
3473
|
-
const
|
|
3474
|
-
if (!
|
|
3466
|
+
const T = f.current, B = E.current;
|
|
3467
|
+
if (!T || !B)
|
|
3475
3468
|
return;
|
|
3476
3469
|
const J = () => {
|
|
3477
3470
|
F(), te(!0);
|
|
3478
3471
|
}, me = () => {
|
|
3479
|
-
|
|
3472
|
+
I(), te(!1);
|
|
3480
3473
|
};
|
|
3481
3474
|
let xe = !1;
|
|
3482
3475
|
const Pe = () => {
|
|
@@ -3488,10 +3481,10 @@ const _o = ({
|
|
|
3488
3481
|
}, G = (ve) => {
|
|
3489
3482
|
ve.preventDefault(), ve.touches.length === 1 && (F(), te((ze) => !ze));
|
|
3490
3483
|
};
|
|
3491
|
-
return
|
|
3492
|
-
|
|
3484
|
+
return T.addEventListener("mousedown", Pe), T.addEventListener("mouseup", ne), T.addEventListener("mouseenter", J), T.addEventListener("mousemove", re), T.addEventListener("mouseleave", me), B.addEventListener("touchstart", G), () => {
|
|
3485
|
+
T.removeEventListener("mousedown", Pe), T.removeEventListener("mouseup", ne), T.removeEventListener("mouseenter", J), T.removeEventListener("mousemove", J), T.removeEventListener("mouseleave", me), B.removeEventListener("touchstart", G);
|
|
3493
3486
|
};
|
|
3494
|
-
}, [
|
|
3487
|
+
}, [I, b, F]), /* @__PURE__ */ pe("div", { ref: f, className: "relative size-full", children: [
|
|
3495
3488
|
/* @__PURE__ */ i(
|
|
3496
3489
|
"video",
|
|
3497
3490
|
{
|
|
@@ -3502,8 +3495,8 @@ const _o = ({
|
|
|
3502
3495
|
disablePictureInPicture: !0,
|
|
3503
3496
|
playsInline: !0,
|
|
3504
3497
|
onPlay: L,
|
|
3505
|
-
onPause:
|
|
3506
|
-
onEnded:
|
|
3498
|
+
onPause: D,
|
|
3499
|
+
onEnded: D,
|
|
3507
3500
|
onCanPlay: k,
|
|
3508
3501
|
onWaiting: m
|
|
3509
3502
|
}
|
|
@@ -3516,7 +3509,7 @@ const _o = ({
|
|
|
3516
3509
|
"absolute inset-x-0 bottom-0 cursor-auto space-y-2 bg-gradient-to-t from-foreground to-transparent p-4 pr-12 pt-8 transition-opacity duration-300",
|
|
3517
3510
|
V ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"
|
|
3518
3511
|
),
|
|
3519
|
-
onMouseDownCapture: (
|
|
3512
|
+
onMouseDownCapture: (T) => T.stopPropagation(),
|
|
3520
3513
|
children: [
|
|
3521
3514
|
/* @__PURE__ */ pe("div", { className: "flex items-center justify-between text-background", children: [
|
|
3522
3515
|
/* @__PURE__ */ pe(
|
|
@@ -3534,11 +3527,11 @@ const _o = ({
|
|
|
3534
3527
|
children: /* @__PURE__ */ i(Wo, { className: "size-full" })
|
|
3535
3528
|
}
|
|
3536
3529
|
),
|
|
3537
|
-
|
|
3538
|
-
S(
|
|
3530
|
+
P && /* @__PURE__ */ pe("span", { className: "text-sm", children: [
|
|
3531
|
+
S(P.currentTime),
|
|
3539
3532
|
" /",
|
|
3540
3533
|
" ",
|
|
3541
|
-
S(
|
|
3534
|
+
S(P.duration)
|
|
3542
3535
|
] })
|
|
3543
3536
|
]
|
|
3544
3537
|
}
|
|
@@ -3866,14 +3859,14 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
3866
3859
|
showGalleryControls: h,
|
|
3867
3860
|
enableHotspotsControl: o,
|
|
3868
3861
|
showHotspots: L,
|
|
3869
|
-
toggleHotspots:
|
|
3862
|
+
toggleHotspots: D,
|
|
3870
3863
|
showGallery: k,
|
|
3871
3864
|
toggleGallery: m,
|
|
3872
3865
|
extendMode: N,
|
|
3873
3866
|
toggleExtendMode: w,
|
|
3874
3867
|
shownDetails: d,
|
|
3875
3868
|
isShowingDetails: C,
|
|
3876
|
-
resetShownDetails:
|
|
3869
|
+
resetShownDetails: P,
|
|
3877
3870
|
showZoomControls: O,
|
|
3878
3871
|
isZooming: M,
|
|
3879
3872
|
canZoomIn: X,
|
|
@@ -3881,13 +3874,13 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
3881
3874
|
canZoomOut: V,
|
|
3882
3875
|
zoomOut: te,
|
|
3883
3876
|
resetView: W
|
|
3884
|
-
} = Ke(),
|
|
3885
|
-
(
|
|
3886
|
-
Ko(
|
|
3877
|
+
} = Ke(), I = j(
|
|
3878
|
+
(T) => {
|
|
3879
|
+
Ko(T) && P();
|
|
3887
3880
|
},
|
|
3888
|
-
[
|
|
3881
|
+
[P]
|
|
3889
3882
|
);
|
|
3890
|
-
qo(
|
|
3883
|
+
qo(P);
|
|
3891
3884
|
const F = "absolute z-overlay";
|
|
3892
3885
|
return /* @__PURE__ */ pe(at, { children: [
|
|
3893
3886
|
!r && f > 1 && /* @__PURE__ */ i(
|
|
@@ -3982,7 +3975,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
3982
3975
|
M ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
3983
3976
|
),
|
|
3984
3977
|
enabled: L,
|
|
3985
|
-
onToggle:
|
|
3978
|
+
onToggle: D,
|
|
3986
3979
|
children: /* @__PURE__ */ i(en, { className: "size-full" })
|
|
3987
3980
|
}
|
|
3988
3981
|
),
|
|
@@ -4033,7 +4026,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4033
4026
|
"inset-0 flex justify-end overflow-hidden bg-foreground/60 transition-opacity duration-details",
|
|
4034
4027
|
C ? "opacity-100" : "pointer-events-none opacity-0"
|
|
4035
4028
|
),
|
|
4036
|
-
onClick:
|
|
4029
|
+
onClick: I,
|
|
4037
4030
|
children: /* @__PURE__ */ i(
|
|
4038
4031
|
"div",
|
|
4039
4032
|
{
|
|
@@ -4107,44 +4100,44 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4107
4100
|
isRunningSpecialCommand: h,
|
|
4108
4101
|
finishSpecialCommand: o,
|
|
4109
4102
|
extendMode: L,
|
|
4110
|
-
extendTransition:
|
|
4111
|
-
} = Ke(), k = Ie(null), m = j((
|
|
4103
|
+
extendTransition: D
|
|
4104
|
+
} = Ke(), k = Ie(null), m = j((I) => {
|
|
4112
4105
|
if (!k.current)
|
|
4113
|
-
throw new Error(`[${
|
|
4106
|
+
throw new Error(`[${I ?? "sliderOrThrow"}] slider.current is null`);
|
|
4114
4107
|
return k.current;
|
|
4115
|
-
}, []), N = Ie(!1), w = Ie(null), d = Ie(null), C = Ie(null),
|
|
4108
|
+
}, []), N = Ie(!1), w = Ie(null), d = Ie(null), C = Ie(null), P = j(() => {
|
|
4116
4109
|
C.current && cancelAnimationFrame(C.current);
|
|
4117
4110
|
}, []), O = j(() => {
|
|
4118
|
-
const
|
|
4111
|
+
const I = m("computeClosestSnapIndex"), F = Array.from(I.children), T = I.scrollLeft;
|
|
4119
4112
|
return F.reduce(
|
|
4120
4113
|
(J, me, xe) => {
|
|
4121
4114
|
const Pe = me.offsetLeft;
|
|
4122
|
-
return Math.abs(Pe -
|
|
4115
|
+
return Math.abs(Pe - T) < Math.abs(F[J].offsetLeft - T) ? xe : J;
|
|
4123
4116
|
},
|
|
4124
4117
|
0
|
|
4125
4118
|
);
|
|
4126
4119
|
}, [m]), M = j(
|
|
4127
|
-
(
|
|
4120
|
+
(I) => {
|
|
4128
4121
|
const F = m("setStyleCursor");
|
|
4129
|
-
F.style.cursor =
|
|
4122
|
+
F.style.cursor = I;
|
|
4130
4123
|
},
|
|
4131
4124
|
[m]
|
|
4132
4125
|
), X = j(
|
|
4133
|
-
(
|
|
4126
|
+
(I) => {
|
|
4134
4127
|
const F = m("setStyleSnapState");
|
|
4135
|
-
|
|
4128
|
+
I === "mandatory" ? F.style.scrollSnapType = "x mandatory" : F.style.scrollSnapType = "none";
|
|
4136
4129
|
},
|
|
4137
4130
|
[m]
|
|
4138
4131
|
), S = j(
|
|
4139
|
-
(
|
|
4140
|
-
|
|
4141
|
-
const B = m("scrollToIndex"), J = Array.from(B.children), me = B.scrollLeft, xe = J[
|
|
4132
|
+
(I, F, T) => {
|
|
4133
|
+
P();
|
|
4134
|
+
const B = m("scrollToIndex"), J = Array.from(B.children), me = B.scrollLeft, xe = J[I].offsetLeft, Pe = (ze) => {
|
|
4142
4135
|
B.scrollTo({
|
|
4143
4136
|
left: ze,
|
|
4144
4137
|
behavior: "instant"
|
|
4145
4138
|
});
|
|
4146
4139
|
}, ne = () => {
|
|
4147
|
-
Pe(xe), X("mandatory"),
|
|
4140
|
+
Pe(xe), X("mandatory"), T?.();
|
|
4148
4141
|
}, re = Math.abs(me - xe);
|
|
4149
4142
|
if (re < 1 || F === "instant") {
|
|
4150
4143
|
ne();
|
|
@@ -4166,24 +4159,24 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4166
4159
|
};
|
|
4167
4160
|
H();
|
|
4168
4161
|
},
|
|
4169
|
-
[
|
|
4162
|
+
[P, m, X]
|
|
4170
4163
|
), [V, te] = Le(), W = !!V;
|
|
4171
4164
|
return fe(() => {
|
|
4172
|
-
const
|
|
4165
|
+
const I = () => {
|
|
4173
4166
|
clearTimeout(V);
|
|
4174
4167
|
const F = setTimeout(() => {
|
|
4175
4168
|
te(void 0);
|
|
4176
4169
|
}, pr);
|
|
4177
4170
|
te(F);
|
|
4178
4171
|
};
|
|
4179
|
-
return addEventListener("resize",
|
|
4180
|
-
removeEventListener("resize",
|
|
4172
|
+
return addEventListener("resize", I), document.addEventListener("fullscreenchange", I), () => {
|
|
4173
|
+
removeEventListener("resize", I), document.removeEventListener("fullscreenchange", I);
|
|
4181
4174
|
};
|
|
4182
4175
|
}, [V]), fe(() => {
|
|
4183
4176
|
if (y)
|
|
4184
4177
|
return;
|
|
4185
|
-
const
|
|
4186
|
-
Number.isNaN(
|
|
4178
|
+
const I = O();
|
|
4179
|
+
Number.isNaN(I) || I !== e && S(e, "instant");
|
|
4187
4180
|
}, [
|
|
4188
4181
|
e,
|
|
4189
4182
|
O,
|
|
@@ -4194,29 +4187,29 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4194
4187
|
V,
|
|
4195
4188
|
s,
|
|
4196
4189
|
L,
|
|
4197
|
-
|
|
4190
|
+
D
|
|
4198
4191
|
]), fe(() => {
|
|
4199
4192
|
if (!E || h) {
|
|
4200
4193
|
M("auto");
|
|
4201
4194
|
return;
|
|
4202
4195
|
}
|
|
4203
|
-
const
|
|
4204
|
-
if (!
|
|
4196
|
+
const I = k.current;
|
|
4197
|
+
if (!I)
|
|
4205
4198
|
return;
|
|
4206
4199
|
M("grab"), X("mandatory");
|
|
4207
4200
|
const F = (J) => {
|
|
4208
|
-
J.button === 0 && (J.preventDefault(), J.stopPropagation(),
|
|
4209
|
-
},
|
|
4201
|
+
J.button === 0 && (J.preventDefault(), J.stopPropagation(), P(), N.current = !0, w.current = J.pageX - I.offsetLeft, d.current = I.scrollLeft, M("grabbing"));
|
|
4202
|
+
}, T = (J) => {
|
|
4210
4203
|
if (!N.current)
|
|
4211
4204
|
return;
|
|
4212
4205
|
if (w.current === null)
|
|
4213
4206
|
throw new Error("[onMouseMove] startX is null");
|
|
4214
4207
|
X("none");
|
|
4215
|
-
const xe = J.pageX -
|
|
4208
|
+
const xe = J.pageX - I.offsetLeft - w.current;
|
|
4216
4209
|
requestAnimationFrame(() => {
|
|
4217
4210
|
if (d.current === null)
|
|
4218
4211
|
throw new Error("[onMouseMove] scrollLeft is null");
|
|
4219
|
-
|
|
4212
|
+
I.scrollLeft = d.current - xe;
|
|
4220
4213
|
});
|
|
4221
4214
|
}, B = () => {
|
|
4222
4215
|
if (!N.current)
|
|
@@ -4225,11 +4218,11 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4225
4218
|
const J = O();
|
|
4226
4219
|
S(J, "smooth");
|
|
4227
4220
|
};
|
|
4228
|
-
return
|
|
4229
|
-
|
|
4221
|
+
return I.addEventListener("mousedown", F), document.addEventListener("mousemove", T), document.addEventListener("mouseleave", B), document.addEventListener("mouseup", B), document.addEventListener("contextmenu", B), () => {
|
|
4222
|
+
I.removeEventListener("mousedown", F), document.removeEventListener("mousemove", T), document.removeEventListener("mouseleave", B), document.removeEventListener("mouseup", B), document.removeEventListener("contextmenu", B);
|
|
4230
4223
|
};
|
|
4231
4224
|
}, [
|
|
4232
|
-
|
|
4225
|
+
P,
|
|
4233
4226
|
O,
|
|
4234
4227
|
h,
|
|
4235
4228
|
S,
|
|
@@ -4237,21 +4230,21 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4237
4230
|
X,
|
|
4238
4231
|
E
|
|
4239
4232
|
]), fe(() => {
|
|
4240
|
-
if (
|
|
4233
|
+
if (D || W)
|
|
4241
4234
|
return;
|
|
4242
|
-
const
|
|
4243
|
-
if (!
|
|
4235
|
+
const I = k.current;
|
|
4236
|
+
if (!I)
|
|
4244
4237
|
return;
|
|
4245
4238
|
const F = () => {
|
|
4246
|
-
const
|
|
4247
|
-
Number.isNaN(
|
|
4239
|
+
const T = O();
|
|
4240
|
+
Number.isNaN(T) || (x(T), T === b && z(null));
|
|
4248
4241
|
};
|
|
4249
|
-
return
|
|
4250
|
-
|
|
4242
|
+
return I.addEventListener("scroll", F), () => {
|
|
4243
|
+
I.removeEventListener("scroll", F);
|
|
4251
4244
|
};
|
|
4252
4245
|
}, [
|
|
4253
4246
|
O,
|
|
4254
|
-
|
|
4247
|
+
D,
|
|
4255
4248
|
W,
|
|
4256
4249
|
b,
|
|
4257
4250
|
x,
|
|
@@ -4259,20 +4252,20 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4259
4252
|
]), fe(() => {
|
|
4260
4253
|
if (b === null)
|
|
4261
4254
|
return;
|
|
4262
|
-
const
|
|
4255
|
+
const I = () => {
|
|
4263
4256
|
setTimeout(() => {
|
|
4264
4257
|
z(null), o();
|
|
4265
4258
|
}, 75);
|
|
4266
4259
|
};
|
|
4267
4260
|
switch (y) {
|
|
4268
4261
|
case "first_to_last":
|
|
4269
|
-
S(f.length - 1, "instant",
|
|
4262
|
+
S(f.length - 1, "instant", I);
|
|
4270
4263
|
break;
|
|
4271
4264
|
case "last_to_first":
|
|
4272
|
-
S(0, "instant",
|
|
4265
|
+
S(0, "instant", I);
|
|
4273
4266
|
break;
|
|
4274
4267
|
case "instant":
|
|
4275
|
-
S(b, "instant",
|
|
4268
|
+
S(b, "instant", I);
|
|
4276
4269
|
break;
|
|
4277
4270
|
default:
|
|
4278
4271
|
S(b, "smooth");
|
|
@@ -4299,8 +4292,8 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4299
4292
|
{
|
|
4300
4293
|
ref: k,
|
|
4301
4294
|
className: `flex size-full ${E ? "overflow-x-auto no-scrollbar *:snap-start *:snap-always" : "justify-center"}`,
|
|
4302
|
-
children: f.map((
|
|
4303
|
-
const
|
|
4295
|
+
children: f.map((I, F) => {
|
|
4296
|
+
const T = F === e, B = F === 0, J = F === f.length - 1, me = (() => {
|
|
4304
4297
|
if (y === "first_to_last" && B)
|
|
4305
4298
|
return {
|
|
4306
4299
|
transform: `translateX(${100 * f.length}%)`
|
|
@@ -4314,18 +4307,18 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4314
4307
|
xe ||= F === b, a && (xe ||= e < l && f.length - F <= l - e, xe ||= e >= f.length - l && F <= l - (f.length - e));
|
|
4315
4308
|
const Pe = (() => {
|
|
4316
4309
|
let ne;
|
|
4317
|
-
switch (
|
|
4310
|
+
switch (I.type) {
|
|
4318
4311
|
case "360":
|
|
4319
|
-
ne =
|
|
4312
|
+
ne = I.images[0].src;
|
|
4320
4313
|
break;
|
|
4321
4314
|
case "interior-360":
|
|
4322
|
-
ne =
|
|
4315
|
+
ne = I.poster ?? "interior-360";
|
|
4323
4316
|
break;
|
|
4324
4317
|
case "image":
|
|
4325
|
-
ne =
|
|
4318
|
+
ne = I.src;
|
|
4326
4319
|
break;
|
|
4327
4320
|
case "video":
|
|
4328
|
-
ne =
|
|
4321
|
+
ne = I.poster ?? "video";
|
|
4329
4322
|
break;
|
|
4330
4323
|
case "custom":
|
|
4331
4324
|
ne = "custom";
|
|
@@ -4344,7 +4337,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4344
4337
|
// Give high-ground to the shown item (to avoid 1px vertical line)
|
|
4345
4338
|
),
|
|
4346
4339
|
style: { ...p, ...me },
|
|
4347
|
-
children: xe && /* @__PURE__ */ i(jo, { index: F, item:
|
|
4340
|
+
children: xe && /* @__PURE__ */ i(jo, { index: F, item: I, isShown: T })
|
|
4348
4341
|
},
|
|
4349
4342
|
Pe
|
|
4350
4343
|
);
|
|
@@ -4370,11 +4363,11 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4370
4363
|
return fe(() => {
|
|
4371
4364
|
if (!E)
|
|
4372
4365
|
return;
|
|
4373
|
-
const L = y.current,
|
|
4374
|
-
if (!L || !
|
|
4366
|
+
const L = y.current, D = h.current, k = o.current;
|
|
4367
|
+
if (!L || !D || !k)
|
|
4375
4368
|
return;
|
|
4376
4369
|
let m = !1;
|
|
4377
|
-
const N = (C) => [L,
|
|
4370
|
+
const N = (C) => [L, D, k].includes(C.target), w = (C) => {
|
|
4378
4371
|
m = N(C);
|
|
4379
4372
|
}, d = (C) => {
|
|
4380
4373
|
m && (N(C) && e(), m = !1);
|
|
@@ -4383,8 +4376,8 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4383
4376
|
L.removeEventListener("mousedown", w), L.removeEventListener("mouseup", d);
|
|
4384
4377
|
};
|
|
4385
4378
|
}, [e, E]), fe(() => {
|
|
4386
|
-
const L = (
|
|
4387
|
-
|
|
4379
|
+
const L = (D) => {
|
|
4380
|
+
D.key === "Escape" && (x ? b() : p ? f() : e());
|
|
4388
4381
|
};
|
|
4389
4382
|
return addEventListener("keydown", L), () => {
|
|
4390
4383
|
removeEventListener("keydown", L);
|
|
@@ -4473,7 +4466,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4473
4466
|
eventPrefix: h = cr,
|
|
4474
4467
|
demoSpin: o = Kr,
|
|
4475
4468
|
reverse360: L = Jr,
|
|
4476
|
-
children:
|
|
4469
|
+
children: D
|
|
4477
4470
|
// NOTE: use to customize the player, not to display the content
|
|
4478
4471
|
}) => {
|
|
4479
4472
|
const k = Ie(null), [m, N] = Le(0.5), [w, d] = Le(!1), C = j(
|
|
@@ -4514,7 +4507,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4514
4507
|
document.removeEventListener("fullscreenchange", X);
|
|
4515
4508
|
};
|
|
4516
4509
|
}, [y]);
|
|
4517
|
-
const
|
|
4510
|
+
const P = j(async () => {
|
|
4518
4511
|
const M = k.current;
|
|
4519
4512
|
if (!M)
|
|
4520
4513
|
throw new Error("Wrapper not found");
|
|
@@ -4550,7 +4543,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4550
4543
|
emitEvent: C,
|
|
4551
4544
|
playerInViewportWidthRatio: m,
|
|
4552
4545
|
isFullScreen: w,
|
|
4553
|
-
requestFullscreen:
|
|
4546
|
+
requestFullscreen: P,
|
|
4554
4547
|
exitFullscreen: O,
|
|
4555
4548
|
children: /* @__PURE__ */ pe(oo, { children: [
|
|
4556
4549
|
/* @__PURE__ */ i(
|
|
@@ -4573,7 +4566,7 @@ const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("div", { cla
|
|
|
4573
4566
|
children: /* @__PURE__ */ i(dn, {})
|
|
4574
4567
|
}
|
|
4575
4568
|
),
|
|
4576
|
-
|
|
4569
|
+
D
|
|
4577
4570
|
] })
|
|
4578
4571
|
}
|
|
4579
4572
|
);
|
|
@@ -4637,11 +4630,11 @@ const kn = (r) => /* @__PURE__ */ pe(at, { children: [
|
|
|
4637
4630
|
...o
|
|
4638
4631
|
}) => {
|
|
4639
4632
|
const L = et(() => {
|
|
4640
|
-
const
|
|
4641
|
-
return z && Object.assign(
|
|
4633
|
+
const D = vn(o);
|
|
4634
|
+
return z && Object.assign(D, { class: z }), D;
|
|
4642
4635
|
}, [z, o]);
|
|
4643
4636
|
return fe(() => {
|
|
4644
|
-
const
|
|
4637
|
+
const D = o.eventPrefix ?? cr, k = (w) => `${D}${w}`, m = {
|
|
4645
4638
|
[$t]: r,
|
|
4646
4639
|
[er]: a,
|
|
4647
4640
|
[tr]: l,
|
|
@@ -4656,8 +4649,8 @@ const kn = (r) => /* @__PURE__ */ pe(at, { children: [
|
|
|
4656
4649
|
return Object.entries(m).forEach(([w, d]) => {
|
|
4657
4650
|
if (!d)
|
|
4658
4651
|
return;
|
|
4659
|
-
const C = k(w),
|
|
4660
|
-
N.set(C,
|
|
4652
|
+
const C = k(w), P = (O) => d(O.detail);
|
|
4653
|
+
N.set(C, P), document.addEventListener(C, P);
|
|
4661
4654
|
}), () => {
|
|
4662
4655
|
N.forEach((w, d) => {
|
|
4663
4656
|
document.removeEventListener(d, w);
|