@car-cutter/react-webplayer 3.2.3 → 3.2.4
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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, jsxs as me, Fragment as nt } from "react/jsx-runtime";
|
|
2
|
-
import { useState as Ie, useEffect as ve, createContext as
|
|
3
|
-
const At = "cc-webplayer", Qt = "cc-webplayer-custom-media", er = "cc-webplayer-icon", tr = "composition-loading", rr = "composition-loaded", nr = "composition-load-error", or = "item-change", ar = "extend-mode-on", ir = "extend-mode-off", Pt = "hotspots-on", Nt = "hotspots-off", sr = "gallery-open", lr = "gallery-close", Xr = "analytics-load", Zr = "analytics-display", Vr = "analytics-interaction", Yr = "analytics-error", Gr = !1, jr = !1, qr = !1, Kr = "quality", $r = 0, Jr = 1 / 0, Qr = 1, en = !1, tn = !1, rn = "*", nn = "full_screen", cr = "cc-webplayer:", on = !0, an = !1, Dt = "ew-resize", sn = !1, ur = 1, dr = "cc-analytics:", ln = "", cn = "", un = !1, dn = !1,
|
|
2
|
+
import { useState as Ie, useEffect as ve, createContext as Et, useContext as Mt, useMemo as Ue, useCallback as G, forwardRef as Br, useRef as Le, Fragment as Wr } from "react";
|
|
3
|
+
const At = "cc-webplayer", Qt = "cc-webplayer-custom-media", er = "cc-webplayer-icon", tr = "composition-loading", rr = "composition-loaded", nr = "composition-load-error", or = "item-change", ar = "extend-mode-on", ir = "extend-mode-off", Pt = "hotspots-on", Nt = "hotspots-off", sr = "gallery-open", lr = "gallery-close", Xr = "analytics-load", Zr = "analytics-display", Vr = "analytics-interaction", Yr = "analytics-error", Gr = !1, jr = !1, qr = !1, Kr = "quality", $r = 0, Jr = 1 / 0, Qr = 1, en = !1, tn = !1, rn = "*", nn = "full_screen", cr = "cc-webplayer:", on = !0, an = !1, Dt = "ew-resize", sn = !1, ur = 1, dr = "cc-analytics:", ln = "", cn = "", un = !1, dn = !1, hn = !1;
|
|
4
4
|
function Ft() {
|
|
5
5
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
6
6
|
return crypto.randomUUID();
|
|
@@ -17,14 +17,14 @@ function Ft() {
|
|
|
17
17
|
return (t === "x" ? o : o & 3 | 8).toString(16);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function p2(t, o) {
|
|
21
21
|
return `https://cdn.car-cutter.com/gallery/${t}/${o}/composition_v3.json`;
|
|
22
22
|
}
|
|
23
23
|
function fn(t, o) {
|
|
24
24
|
const i = t.split("/"), d = i.pop();
|
|
25
25
|
return [i.join("/"), o, d].join("/");
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function pn() {
|
|
28
28
|
const t = "car-cutter-webplayer-browser-id", o = typeof window < "u" ? window.localStorage.getItem(t) : null;
|
|
29
29
|
if (o) return o;
|
|
30
30
|
const i = Ft();
|
|
@@ -48,13 +48,13 @@ async function vn(t) {
|
|
|
48
48
|
throw new Error(`Failed to fetch composition: ${o.statusText}`);
|
|
49
49
|
return await o.json();
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const mt = /* @__PURE__ */ new Map(), wn = (t) => {
|
|
52
52
|
const [o, i] = Ie({
|
|
53
53
|
status: "pending",
|
|
54
54
|
isSuccess: !1
|
|
55
55
|
});
|
|
56
56
|
return ve(() => {
|
|
57
|
-
const d = (u) => i({ status: "success", data: u, isSuccess: !0 }), c =
|
|
57
|
+
const d = (u) => i({ status: "success", data: u, isSuccess: !0 }), c = mt.get(t);
|
|
58
58
|
if (c && !(c instanceof Promise)) {
|
|
59
59
|
d(c);
|
|
60
60
|
return;
|
|
@@ -66,10 +66,20 @@ const St = /* @__PURE__ */ new Map(), wn = (t) => {
|
|
|
66
66
|
try {
|
|
67
67
|
let u;
|
|
68
68
|
if (c)
|
|
69
|
-
|
|
69
|
+
try {
|
|
70
|
+
u = await c;
|
|
71
|
+
} catch (v) {
|
|
72
|
+
throw mt.delete(t), v;
|
|
73
|
+
}
|
|
70
74
|
else {
|
|
71
75
|
const v = vn(t);
|
|
72
|
-
|
|
76
|
+
mt.set(t, v);
|
|
77
|
+
try {
|
|
78
|
+
u = await v;
|
|
79
|
+
} catch (e) {
|
|
80
|
+
throw mt.delete(t), e;
|
|
81
|
+
}
|
|
82
|
+
mt.set(t, u);
|
|
73
83
|
}
|
|
74
84
|
d(u);
|
|
75
85
|
} catch (u) {
|
|
@@ -81,15 +91,15 @@ const St = /* @__PURE__ */ new Map(), wn = (t) => {
|
|
|
81
91
|
}
|
|
82
92
|
})();
|
|
83
93
|
}, [t]), o;
|
|
84
|
-
},
|
|
85
|
-
const t =
|
|
94
|
+
}, hr = Et(null), je = () => {
|
|
95
|
+
const t = Mt(hr);
|
|
86
96
|
if (!t)
|
|
87
97
|
throw new Error(
|
|
88
98
|
"useGlobalContext must be used within a GlobalContextProvider"
|
|
89
99
|
);
|
|
90
100
|
return t;
|
|
91
|
-
}, xn = ({ children: t, ...o }) => /* @__PURE__ */ a(
|
|
92
|
-
const t =
|
|
101
|
+
}, xn = ({ children: t, ...o }) => /* @__PURE__ */ a(hr.Provider, { value: o, children: t }), fr = Et(null), lt = () => {
|
|
102
|
+
const t = Mt(fr);
|
|
93
103
|
if (!t)
|
|
94
104
|
throw new Error(
|
|
95
105
|
"useCompositionContext must be used within a CompositionContextProvider"
|
|
@@ -113,7 +123,7 @@ const St = /* @__PURE__ */ new Map(), wn = (t) => {
|
|
|
113
123
|
[k]
|
|
114
124
|
), L = {
|
|
115
125
|
aspectRatio: i.replace(":", " / ")
|
|
116
|
-
},
|
|
126
|
+
}, h = Ue(() => {
|
|
117
127
|
const n = u.concat(c), b = n.sort((_, w) => _ - w), P = b.filter(
|
|
118
128
|
(_) => _ >= v && _ <= e
|
|
119
129
|
);
|
|
@@ -137,19 +147,19 @@ const St = /* @__PURE__ */ new Map(), wn = (t) => {
|
|
|
137
147
|
categories: k,
|
|
138
148
|
items: N,
|
|
139
149
|
aspectRatioStyle: L,
|
|
140
|
-
usedMediaWidths:
|
|
150
|
+
usedMediaWidths: h
|
|
141
151
|
},
|
|
142
152
|
children: o
|
|
143
153
|
}
|
|
144
154
|
);
|
|
145
|
-
},
|
|
155
|
+
}, pr = 500, dt = 0.75, st = 1 + dt * 2, mr = () => {
|
|
146
156
|
const { isFullScreen: t, maxItemsShown: o, integration: i } = je();
|
|
147
157
|
return { effectiveMaxItemsShown: i && t ? ur : o };
|
|
148
158
|
};
|
|
149
159
|
function tt(t, o, i) {
|
|
150
160
|
return Math.min(Math.max(t, o), i);
|
|
151
161
|
}
|
|
152
|
-
const
|
|
162
|
+
const Lt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
153
163
|
const v = tt(t, o, i);
|
|
154
164
|
if (v === (u ? i : o)) return d;
|
|
155
165
|
if (v === (u ? o : i)) return 1;
|
|
@@ -164,7 +174,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
164
174
|
u < d && (d = u, i = o[c]);
|
|
165
175
|
}
|
|
166
176
|
return i;
|
|
167
|
-
}, gr =
|
|
177
|
+
}, gr = Et(null), Ot = () => Mt(gr), vt = () => {
|
|
168
178
|
const t = Ot();
|
|
169
179
|
if (!t)
|
|
170
180
|
throw new Error(
|
|
@@ -185,18 +195,18 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
185
195
|
console.warn("Icon element is missing a name attribute");
|
|
186
196
|
continue;
|
|
187
197
|
}
|
|
188
|
-
const x = w.innerHTML,
|
|
198
|
+
const x = w.innerHTML, p = x ? /* @__PURE__ */ a(
|
|
189
199
|
"div",
|
|
190
200
|
{
|
|
191
201
|
className: qt,
|
|
192
202
|
dangerouslySetInnerHTML: { __html: x }
|
|
193
203
|
}
|
|
194
204
|
) : void 0;
|
|
195
|
-
if (!
|
|
205
|
+
if (!p) {
|
|
196
206
|
console.warn(`Icon "${C}" customization is empty.`);
|
|
197
207
|
continue;
|
|
198
208
|
}
|
|
199
|
-
_.set(C, { Icon:
|
|
209
|
+
_.set(C, { Icon: p });
|
|
200
210
|
}
|
|
201
211
|
return _;
|
|
202
212
|
}, []), [c, u] = Ie(
|
|
@@ -250,7 +260,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
250
260
|
console.warn("Custom media element is missing the 'index' attribute");
|
|
251
261
|
continue;
|
|
252
262
|
}
|
|
253
|
-
const
|
|
263
|
+
const p = w.getAttribute("thumbnail-src") ?? void 0, y = JSON.stringify({ index: x, thumbnailSrc: p });
|
|
254
264
|
_.push({
|
|
255
265
|
id: y,
|
|
256
266
|
Media: /* @__PURE__ */ a(
|
|
@@ -261,7 +271,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
261
271
|
}
|
|
262
272
|
),
|
|
263
273
|
index: x,
|
|
264
|
-
thumbnailSrc:
|
|
274
|
+
thumbnailSrc: p
|
|
265
275
|
});
|
|
266
276
|
}
|
|
267
277
|
return _;
|
|
@@ -281,7 +291,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
281
291
|
subtree: !0
|
|
282
292
|
}), () => P.disconnect();
|
|
283
293
|
}, [k, i]);
|
|
284
|
-
const
|
|
294
|
+
const h = G((b) => {
|
|
285
295
|
const { Media: P, ..._ } = b, w = /* @__PURE__ */ a("div", { className: Kt, children: P }), C = JSON.stringify(_);
|
|
286
296
|
return L((x) => [
|
|
287
297
|
...x,
|
|
@@ -304,14 +314,14 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
304
314
|
registerIconConfig: e,
|
|
305
315
|
unregisterIconConfig: E,
|
|
306
316
|
customMediaList: N,
|
|
307
|
-
registerCustomMedia:
|
|
317
|
+
registerCustomMedia: h,
|
|
308
318
|
unregisterCustomMedia: n
|
|
309
319
|
},
|
|
310
320
|
children: t
|
|
311
321
|
}
|
|
312
322
|
);
|
|
313
|
-
}, vr =
|
|
314
|
-
const t =
|
|
323
|
+
}, vr = Et(null), Ke = () => {
|
|
324
|
+
const t = Mt(vr);
|
|
315
325
|
if (!t)
|
|
316
326
|
throw new Error(
|
|
317
327
|
"useControlsContext must be used within a ControlsContextProvider"
|
|
@@ -329,30 +339,30 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
329
339
|
isFullScreen: v,
|
|
330
340
|
requestFullscreen: e,
|
|
331
341
|
exitFullscreen: E
|
|
332
|
-
} = je(), { customMediaList: k } =
|
|
342
|
+
} = je(), { customMediaList: k } = vt(), { categories: N, items: L } = lt(), h = Ue(() => {
|
|
333
343
|
const O = new Array(
|
|
334
344
|
...L
|
|
335
|
-
), se = k.slice().sort((A,
|
|
345
|
+
), se = k.slice().sort((A, pe) => A.index < 0 && pe.index < 0 ? pe.index - A.index : A.index < 0 ? 1 : pe.index < 0 ? -1 : A.index - pe.index);
|
|
336
346
|
for (const A of se) {
|
|
337
|
-
let
|
|
338
|
-
|
|
347
|
+
let pe = A.index;
|
|
348
|
+
pe < 0 && (pe = O.length + pe + 1), O.splice(pe, 0, {
|
|
339
349
|
type: "custom",
|
|
340
350
|
...A
|
|
341
351
|
});
|
|
342
352
|
}
|
|
343
353
|
return O;
|
|
344
|
-
}, [L, k]), [n, b] = Ie(
|
|
354
|
+
}, [L, k]), [n, b] = Ie(h.map(() => null));
|
|
345
355
|
ve(() => {
|
|
346
|
-
b(
|
|
347
|
-
}, [
|
|
356
|
+
b(h.map(() => null));
|
|
357
|
+
}, [h]);
|
|
348
358
|
const P = G(
|
|
349
359
|
(O, se) => {
|
|
350
360
|
b(
|
|
351
|
-
(A) => A.map((
|
|
361
|
+
(A) => A.map((pe, _e) => _e === O ? se : pe)
|
|
352
362
|
);
|
|
353
363
|
},
|
|
354
364
|
[]
|
|
355
|
-
), [_, w] = Ie(0), [C, x] = Ie(null),
|
|
365
|
+
), [_, w] = Ie(0), [C, x] = Ie(null), p = C ?? _, y = h[p], T = n[p], [$, I] = Ie(
|
|
356
366
|
null
|
|
357
367
|
), X = !!$, V = G(() => I(null), []), { effectiveMaxItemsShown: z } = mr(), H = G(
|
|
358
368
|
(O) => {
|
|
@@ -363,7 +373,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
363
373
|
), R = Ue(() => {
|
|
364
374
|
let O;
|
|
365
375
|
if (y.type === "custom") {
|
|
366
|
-
const se =
|
|
376
|
+
const se = h.slice(0, p).reverse().find((A) => A.type !== "custom") ?? h.slice(p + 1).find((A) => A.type !== "custom");
|
|
367
377
|
if (!se)
|
|
368
378
|
throw new Error("No non-custom item found");
|
|
369
379
|
O = se;
|
|
@@ -373,18 +383,18 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
373
383
|
if (se.items.includes(O))
|
|
374
384
|
return se.id;
|
|
375
385
|
throw new Error("Current item not found in any category");
|
|
376
|
-
}, [N, y,
|
|
386
|
+
}, [N, y, h, p]), q = Ue(
|
|
377
387
|
() => N.find(({ id: O }) => O === R)?.title ?? "Unnamed Category",
|
|
378
388
|
[N, R]
|
|
379
|
-
), ce = Ue(() =>
|
|
389
|
+
), ce = Ue(() => h.length, [h]), U = G(
|
|
380
390
|
(O) => {
|
|
381
|
-
const se = N.find(({ id:
|
|
391
|
+
const se = N.find(({ id: pe }) => pe === O)?.items[0];
|
|
382
392
|
if (se === void 0)
|
|
383
393
|
throw new Error("Failed to find target category");
|
|
384
|
-
const A =
|
|
394
|
+
const A = h.findIndex((pe) => pe === se);
|
|
385
395
|
H(A);
|
|
386
396
|
},
|
|
387
|
-
[N,
|
|
397
|
+
[N, h, H]
|
|
388
398
|
), D = G(() => {
|
|
389
399
|
if (X || C !== null)
|
|
390
400
|
return;
|
|
@@ -393,8 +403,8 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
393
403
|
x(O);
|
|
394
404
|
else if (o) {
|
|
395
405
|
I("first_to_last");
|
|
396
|
-
const se = Math.ceil(z), A =
|
|
397
|
-
x(
|
|
406
|
+
const se = Math.ceil(z), A = h.length + (d && !o && z % 1 !== 0 ? 1 : 0), pe = z > 1 ? Math.max(0, A - se) : h.length - 1;
|
|
407
|
+
x(pe);
|
|
398
408
|
}
|
|
399
409
|
u({
|
|
400
410
|
type: "interaction",
|
|
@@ -420,13 +430,13 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
420
430
|
q,
|
|
421
431
|
y.type,
|
|
422
432
|
z,
|
|
423
|
-
|
|
433
|
+
h.length,
|
|
424
434
|
d
|
|
425
435
|
]), J = G(() => {
|
|
426
436
|
if (X || C !== null)
|
|
427
437
|
return;
|
|
428
|
-
const O = _ + 1, se = Math.ceil(z), A =
|
|
429
|
-
O <=
|
|
438
|
+
const O = _ + 1, se = Math.ceil(z), A = h.length + (d && !o && z % 1 !== 0 ? 1 : 0), pe = z > 1 ? Math.max(0, A - se) : h.length - 1;
|
|
439
|
+
O <= pe ? x(O) : o && (I("last_to_first"), x(0)), u({
|
|
430
440
|
type: "interaction",
|
|
431
441
|
current: {
|
|
432
442
|
category_id: R,
|
|
@@ -445,7 +455,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
445
455
|
C,
|
|
446
456
|
_,
|
|
447
457
|
z,
|
|
448
|
-
|
|
458
|
+
h.length,
|
|
449
459
|
d,
|
|
450
460
|
o,
|
|
451
461
|
u,
|
|
@@ -455,10 +465,10 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
455
465
|
]);
|
|
456
466
|
ve(() => {
|
|
457
467
|
c(or, {
|
|
458
|
-
index:
|
|
468
|
+
index: p,
|
|
459
469
|
item: y
|
|
460
470
|
});
|
|
461
|
-
}, [y, c,
|
|
471
|
+
}, [y, c, p]), ve(() => {
|
|
462
472
|
if (X || C !== null)
|
|
463
473
|
return;
|
|
464
474
|
const O = {
|
|
@@ -484,7 +494,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
484
494
|
]);
|
|
485
495
|
const S = Ue(() => {
|
|
486
496
|
if (d && !v)
|
|
487
|
-
return
|
|
497
|
+
return h.some((O) => {
|
|
488
498
|
switch (O.type) {
|
|
489
499
|
case "image":
|
|
490
500
|
return !!O.hotspots?.length;
|
|
@@ -506,18 +516,18 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
506
516
|
default:
|
|
507
517
|
return !1;
|
|
508
518
|
}
|
|
509
|
-
}, [y, T, d,
|
|
519
|
+
}, [y, T, d, h, v]), [B, ie] = Ie(!0), [F, te] = Ie({}), K = Ue(() => d && v ? F[p] ?? !0 : B, [
|
|
510
520
|
d,
|
|
511
521
|
v,
|
|
512
522
|
F,
|
|
513
|
-
|
|
523
|
+
p,
|
|
514
524
|
B
|
|
515
525
|
]), ne = G(() => {
|
|
516
526
|
if (d && v) {
|
|
517
|
-
const se = !(F[
|
|
527
|
+
const se = !(F[p] ?? !0);
|
|
518
528
|
te((A) => ({
|
|
519
529
|
...A,
|
|
520
|
-
[
|
|
530
|
+
[p]: se
|
|
521
531
|
})), c(se ? Pt : Nt), u({
|
|
522
532
|
type: "interaction",
|
|
523
533
|
current: {
|
|
@@ -553,7 +563,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
553
563
|
d,
|
|
554
564
|
v,
|
|
555
565
|
F,
|
|
556
|
-
|
|
566
|
+
p,
|
|
557
567
|
c,
|
|
558
568
|
u,
|
|
559
569
|
R,
|
|
@@ -635,9 +645,9 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
635
645
|
ee((se) => tt(se + O, 1, st));
|
|
636
646
|
},
|
|
637
647
|
[ee]
|
|
638
|
-
),
|
|
639
|
-
|
|
640
|
-
}, [
|
|
648
|
+
), he = G(() => ee(1), [ee]), Ge = G(() => xe(dt), [xe]), He = G(() => xe(-dt), [xe]), ge = G(() => {
|
|
649
|
+
he(), we();
|
|
650
|
+
}, [he, we]), [ye, Ce] = Ie(!1), [Pe, Ne] = Ie(), [Be, We] = Ie(!1), ke = G(
|
|
641
651
|
async (O) => {
|
|
642
652
|
ge(), Ce(O), c(O ? ar : ir), u({
|
|
643
653
|
type: "interaction",
|
|
@@ -667,7 +677,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
667
677
|
clearTimeout(Pe);
|
|
668
678
|
const O = setTimeout(() => {
|
|
669
679
|
Ne(void 0);
|
|
670
|
-
},
|
|
680
|
+
}, pr);
|
|
671
681
|
Ne(O);
|
|
672
682
|
}, [Pe]), Xe = G(async () => {
|
|
673
683
|
const O = await e();
|
|
@@ -750,14 +760,14 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
750
760
|
vr.Provider,
|
|
751
761
|
{
|
|
752
762
|
value: {
|
|
753
|
-
items:
|
|
763
|
+
items: h,
|
|
754
764
|
setItemInteraction: P,
|
|
755
|
-
slidable:
|
|
765
|
+
slidable: h.length > 1,
|
|
756
766
|
carrouselItemIndex: _,
|
|
757
767
|
setCarrouselItemIndex: w,
|
|
758
768
|
itemIndexCommand: C,
|
|
759
769
|
setItemIndexCommand: x,
|
|
760
|
-
masterItemIndex:
|
|
770
|
+
masterItemIndex: p,
|
|
761
771
|
specialCommand: $,
|
|
762
772
|
isRunningSpecialCommand: X,
|
|
763
773
|
finishSpecialCommand: V,
|
|
@@ -782,7 +792,7 @@ const bt = (t, o, i) => t + (o - t) * i, jt = (t, o, i, d, c, u = !1) => {
|
|
|
782
792
|
zoom: Q,
|
|
783
793
|
isZooming: g,
|
|
784
794
|
setZoom: ee,
|
|
785
|
-
resetZoom:
|
|
795
|
+
resetZoom: he,
|
|
786
796
|
canZoomIn: ae,
|
|
787
797
|
zoomIn: Ge,
|
|
788
798
|
canZoomOut: re,
|
|
@@ -866,7 +876,7 @@ function Sn({
|
|
|
866
876
|
const i = new Array();
|
|
867
877
|
return t && i.push(Tn(t)), o && i.push(yr(o)), i.join(" ");
|
|
868
878
|
}
|
|
869
|
-
function
|
|
879
|
+
function ht(t) {
|
|
870
880
|
const [o, i] = _n(t);
|
|
871
881
|
return Sn({ positionX: i, positionY: o });
|
|
872
882
|
}
|
|
@@ -875,7 +885,7 @@ const qe = ({
|
|
|
875
885
|
className: o,
|
|
876
886
|
children: i
|
|
877
887
|
}) => {
|
|
878
|
-
const { getIconConfig: d } =
|
|
888
|
+
const { getIconConfig: d } = vt(), u = d(t)?.Icon;
|
|
879
889
|
return u ? o ? /* @__PURE__ */ a("div", { className: o, children: u }) : u : i;
|
|
880
890
|
}, Pn = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customizationKey: "UI_CLOSE", children: /* @__PURE__ */ a("svg", { className: t, viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ a(
|
|
881
891
|
"path",
|
|
@@ -934,19 +944,19 @@ const qe = ({
|
|
|
934
944
|
errorImage: "https://cdn.car-cutter.com/libs/web-player/v3/assets/autonation-fallback.svg"
|
|
935
945
|
}, Hn = {
|
|
936
946
|
autonation: On
|
|
937
|
-
},
|
|
947
|
+
}, wt = (t) => {
|
|
938
948
|
if (t)
|
|
939
949
|
return Hn[t];
|
|
940
950
|
}, Un = () => {
|
|
941
951
|
let t = "https://cdn.car-cutter.com/libs/web-player/v3/assets/car_placeholder.png";
|
|
942
|
-
const { themeConfig: o } = je(), i = Ue(() =>
|
|
952
|
+
const { themeConfig: o } = je(), i = Ue(() => wt(o), [o]);
|
|
943
953
|
i?.errorImage && (t = i.errorImage);
|
|
944
954
|
const d = {
|
|
945
955
|
className: i?.errorImage ? void 0 : "h-20 small:h-28",
|
|
946
956
|
style: i?.errorImage ? { height: "12rem", width: "auto" } : void 0
|
|
947
957
|
};
|
|
948
958
|
return /* @__PURE__ */ a("img", { ...d, alt: "", src: t });
|
|
949
|
-
},
|
|
959
|
+
}, It = ({ text: t, className: o }) => /* @__PURE__ */ me(
|
|
950
960
|
"div",
|
|
951
961
|
{
|
|
952
962
|
className: ue(
|
|
@@ -991,7 +1001,7 @@ const qe = ({
|
|
|
991
1001
|
fadeIn: u,
|
|
992
1002
|
...v
|
|
993
1003
|
}, e) => {
|
|
994
|
-
const { mediaLoadStrategy: E, playerInViewportWidthRatio: k } = je(), { imageHdWidth: N, usedMediaWidths: L } = lt(), [
|
|
1004
|
+
const { mediaLoadStrategy: E, playerInViewportWidthRatio: k } = je(), { imageHdWidth: N, usedMediaWidths: L } = lt(), [h, n] = Ue(() => {
|
|
995
1005
|
const _ = L.map((C) => `${C !== N ? fn(t, C) : t} ${C}w`);
|
|
996
1006
|
let w;
|
|
997
1007
|
if (c)
|
|
@@ -1000,28 +1010,28 @@ const qe = ({
|
|
|
1000
1010
|
const C = 1 / (d * k);
|
|
1001
1011
|
switch (E) {
|
|
1002
1012
|
case "quality": {
|
|
1003
|
-
const x = [...L],
|
|
1013
|
+
const x = [...L], p = x.pop();
|
|
1004
1014
|
w = x.map(
|
|
1005
1015
|
(y) => `(max-width: ${C * y}px) ${y}px`
|
|
1006
|
-
), w.push(`${
|
|
1016
|
+
), w.push(`${p}px`);
|
|
1007
1017
|
break;
|
|
1008
1018
|
}
|
|
1009
1019
|
case "balanced": {
|
|
1010
1020
|
w = [];
|
|
1011
1021
|
for (let x = 0; x < L.length - 1; x++) {
|
|
1012
|
-
const
|
|
1022
|
+
const p = L[x], y = L[x + 1], T = Math.round((p + y) / 2);
|
|
1013
1023
|
w.push(
|
|
1014
|
-
`(max-width: ${C * T}px) ${
|
|
1024
|
+
`(max-width: ${C * T}px) ${p}px`
|
|
1015
1025
|
);
|
|
1016
1026
|
}
|
|
1017
1027
|
w.push(`${L[L.length - 1]}px`);
|
|
1018
1028
|
break;
|
|
1019
1029
|
}
|
|
1020
1030
|
case "speed": {
|
|
1021
|
-
const x = [...L],
|
|
1031
|
+
const x = [...L], p = x.shift();
|
|
1022
1032
|
w = x.reverse().map(
|
|
1023
1033
|
(y) => `(min-width: ${C * y}px) ${y}px`
|
|
1024
|
-
), w.push(`${
|
|
1034
|
+
), w.push(`${p}px`);
|
|
1025
1035
|
break;
|
|
1026
1036
|
}
|
|
1027
1037
|
}
|
|
@@ -1048,7 +1058,7 @@ const qe = ({
|
|
|
1048
1058
|
{
|
|
1049
1059
|
ref: e,
|
|
1050
1060
|
src: t,
|
|
1051
|
-
srcSet:
|
|
1061
|
+
srcSet: h,
|
|
1052
1062
|
sizes: n,
|
|
1053
1063
|
className: ue(
|
|
1054
1064
|
o,
|
|
@@ -1241,7 +1251,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1241
1251
|
fadeIn: !i
|
|
1242
1252
|
}
|
|
1243
1253
|
) : /* @__PURE__ */ a("img", { className: d, src: t });
|
|
1244
|
-
},
|
|
1254
|
+
}, bt = ({
|
|
1245
1255
|
children: t
|
|
1246
1256
|
}) => {
|
|
1247
1257
|
const { extendMode: o } = Ke();
|
|
@@ -1284,16 +1294,16 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1284
1294
|
let v;
|
|
1285
1295
|
switch (i) {
|
|
1286
1296
|
case "360":
|
|
1287
|
-
v = /* @__PURE__ */ a(
|
|
1297
|
+
v = /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(Ht, { className: "size-full" }) });
|
|
1288
1298
|
break;
|
|
1289
1299
|
case "interior-360":
|
|
1290
|
-
v = /* @__PURE__ */ a(
|
|
1300
|
+
v = /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(Lr, { className: "size-full" }) });
|
|
1291
1301
|
break;
|
|
1292
1302
|
case "video":
|
|
1293
|
-
v = /* @__PURE__ */ a(
|
|
1303
|
+
v = /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(Er, { className: "size-full p-0.5 text-background" }) });
|
|
1294
1304
|
break;
|
|
1295
1305
|
case "custom":
|
|
1296
|
-
v = d ? null : /* @__PURE__ */ a(
|
|
1306
|
+
v = d ? null : /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(br, { className: "size-full p-0.5 text-background" }) });
|
|
1297
1307
|
break;
|
|
1298
1308
|
}
|
|
1299
1309
|
return /* @__PURE__ */ me("div", { className: "relative bg-foreground/30", style: o, children: [
|
|
@@ -1324,7 +1334,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1324
1334
|
} = je(), { categories: e, aspectRatioStyle: E } = lt(), { emitAnalyticsEvent: k } = je(), {
|
|
1325
1335
|
items: N,
|
|
1326
1336
|
extendMode: L,
|
|
1327
|
-
extendTransition:
|
|
1337
|
+
extendTransition: h,
|
|
1328
1338
|
masterItemIndex: n,
|
|
1329
1339
|
prevItem: b,
|
|
1330
1340
|
nextItem: P,
|
|
@@ -1332,7 +1342,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1332
1342
|
resetView: w,
|
|
1333
1343
|
displayedCategoryId: C,
|
|
1334
1344
|
displayedCategoryName: x
|
|
1335
|
-
} = Ke(),
|
|
1345
|
+
} = Ke(), p = Ue(
|
|
1336
1346
|
() => N[n].type,
|
|
1337
1347
|
[N, n]
|
|
1338
1348
|
), y = Ue(() => {
|
|
@@ -1404,7 +1414,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1404
1414
|
// - Run the effect when those values change
|
|
1405
1415
|
u,
|
|
1406
1416
|
L,
|
|
1407
|
-
|
|
1417
|
+
h
|
|
1408
1418
|
]);
|
|
1409
1419
|
const q = G(
|
|
1410
1420
|
(D) => {
|
|
@@ -1413,7 +1423,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1413
1423
|
current: {
|
|
1414
1424
|
category_id: C,
|
|
1415
1425
|
category_name: x,
|
|
1416
|
-
item_type:
|
|
1426
|
+
item_type: p,
|
|
1417
1427
|
item_position: n
|
|
1418
1428
|
},
|
|
1419
1429
|
action: {
|
|
@@ -1427,7 +1437,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1427
1437
|
k,
|
|
1428
1438
|
C,
|
|
1429
1439
|
x,
|
|
1430
|
-
|
|
1440
|
+
p,
|
|
1431
1441
|
n
|
|
1432
1442
|
]
|
|
1433
1443
|
), ce = G(
|
|
@@ -1526,21 +1536,21 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1526
1536
|
`[${x ?? "getTransformElementOrThrow"}] transformElementRef.current is null`
|
|
1527
1537
|
);
|
|
1528
1538
|
return v.current;
|
|
1529
|
-
}, []), E = Le(!1), k = Le(null), N = Le(/* @__PURE__ */ new Map()), L = Le({ x: 0, y: 0, scale: 1 }),
|
|
1539
|
+
}, []), E = Le(!1), k = Le(null), N = Le(/* @__PURE__ */ new Map()), L = Le({ x: 0, y: 0, scale: 1 }), h = Le(null), n = G(
|
|
1530
1540
|
(x) => {
|
|
1531
|
-
const
|
|
1541
|
+
const p = e("setTransformStyle"), {
|
|
1532
1542
|
x: y,
|
|
1533
1543
|
y: T,
|
|
1534
1544
|
scale: $
|
|
1535
1545
|
} = {
|
|
1536
1546
|
...L.current,
|
|
1537
1547
|
...x
|
|
1538
|
-
}, I = tt($, 1, st), X =
|
|
1539
|
-
L.current = { x: R, y: q, scale: I },
|
|
1548
|
+
}, I = tt($, 1, st), X = p.clientWidth, V = p.clientHeight, z = X * I, H = V * I, R = tt(y, -(z - X), 0), q = tt(T, -(H - V), 0);
|
|
1549
|
+
L.current = { x: R, y: q, scale: I }, p.style.transform = `translate(${R}px, ${q}px) scale(${I})`;
|
|
1540
1550
|
},
|
|
1541
1551
|
[e]
|
|
1542
1552
|
), b = G(
|
|
1543
|
-
(x,
|
|
1553
|
+
(x, p) => {
|
|
1544
1554
|
const {
|
|
1545
1555
|
x: y,
|
|
1546
1556
|
y: T,
|
|
@@ -1553,44 +1563,44 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1553
1563
|
...L.current,
|
|
1554
1564
|
...x
|
|
1555
1565
|
};
|
|
1556
|
-
|
|
1566
|
+
h.current && (cancelAnimationFrame(h.current), h.current = null);
|
|
1557
1567
|
const z = () => {
|
|
1558
1568
|
n({ x: I, y: X, scale: V }), c(V);
|
|
1559
1569
|
}, H = Math.abs(I - y) < 1 && Math.abs(X - T) < 1 && Math.abs(V - $) < 5e-3;
|
|
1560
|
-
if (!
|
|
1570
|
+
if (!p || H) {
|
|
1561
1571
|
z();
|
|
1562
1572
|
return;
|
|
1563
1573
|
}
|
|
1564
1574
|
const R = (/* @__PURE__ */ new Date()).getTime(), q = () => {
|
|
1565
1575
|
const ce = () => {
|
|
1566
1576
|
const D = (/* @__PURE__ */ new Date()).getTime() - R;
|
|
1567
|
-
if (D >=
|
|
1568
|
-
z(),
|
|
1577
|
+
if (D >= p) {
|
|
1578
|
+
z(), h.current = null;
|
|
1569
1579
|
return;
|
|
1570
1580
|
}
|
|
1571
|
-
const J = Math.min(D /
|
|
1581
|
+
const J = Math.min(D / p, 1), S = kr(J), B = Lt(y, I, S), ie = Lt(T, X, S), F = Lt($, V, S);
|
|
1572
1582
|
n({ x: B, y: ie, scale: F }), q();
|
|
1573
1583
|
};
|
|
1574
|
-
|
|
1584
|
+
h.current = requestAnimationFrame(ce);
|
|
1575
1585
|
};
|
|
1576
1586
|
q();
|
|
1577
1587
|
},
|
|
1578
1588
|
[n, c]
|
|
1579
1589
|
), P = G(
|
|
1580
|
-
(x,
|
|
1590
|
+
(x, p) => {
|
|
1581
1591
|
let { x: y, y: T } = L.current;
|
|
1582
1592
|
x.x && (y += x.x), x.y && (T += x.y), b(
|
|
1583
1593
|
{
|
|
1584
1594
|
x: y,
|
|
1585
1595
|
y: T
|
|
1586
1596
|
},
|
|
1587
|
-
|
|
1597
|
+
p
|
|
1588
1598
|
);
|
|
1589
1599
|
},
|
|
1590
1600
|
[b]
|
|
1591
1601
|
), _ = G(
|
|
1592
|
-
(x,
|
|
1593
|
-
const T = L.current.scale, $ = tt(x, 1, st), I = $ / T, { x: X, y: V } = L.current, { x: z, y: H } =
|
|
1602
|
+
(x, p, y) => {
|
|
1603
|
+
const T = L.current.scale, $ = tt(x, 1, st), I = $ / T, { x: X, y: V } = L.current, { x: z, y: H } = p, R = -X + z, q = -V + H, ce = R * I, U = q * I, D = ce - z, J = U - H, S = -D, B = -J;
|
|
1594
1604
|
b(
|
|
1595
1605
|
{
|
|
1596
1606
|
x: S,
|
|
@@ -1603,9 +1613,9 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1603
1613
|
[b]
|
|
1604
1614
|
), w = G(
|
|
1605
1615
|
(x) => {
|
|
1606
|
-
const
|
|
1616
|
+
const p = e(
|
|
1607
1617
|
"shiftZoomFromButton"
|
|
1608
|
-
), y =
|
|
1618
|
+
), y = p.clientWidth, T = p.clientHeight;
|
|
1609
1619
|
_(
|
|
1610
1620
|
x,
|
|
1611
1621
|
{
|
|
@@ -1617,11 +1627,11 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1617
1627
|
},
|
|
1618
1628
|
[e, _]
|
|
1619
1629
|
), C = G(
|
|
1620
|
-
(x,
|
|
1630
|
+
(x, p, y) => {
|
|
1621
1631
|
const { scale: T } = L.current;
|
|
1622
1632
|
_(
|
|
1623
1633
|
T + x,
|
|
1624
|
-
|
|
1634
|
+
p,
|
|
1625
1635
|
y
|
|
1626
1636
|
);
|
|
1627
1637
|
},
|
|
@@ -1635,7 +1645,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1635
1645
|
const x = v.current;
|
|
1636
1646
|
if (!x)
|
|
1637
1647
|
return;
|
|
1638
|
-
const
|
|
1648
|
+
const p = ($) => {
|
|
1639
1649
|
$.preventDefault(), $.stopPropagation(), E.current = !0, k.current = {
|
|
1640
1650
|
x: $.clientX,
|
|
1641
1651
|
y: $.clientY
|
|
@@ -1657,8 +1667,8 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1657
1667
|
}, T = () => {
|
|
1658
1668
|
E.current = !1;
|
|
1659
1669
|
};
|
|
1660
|
-
return x.addEventListener("mousedown",
|
|
1661
|
-
x.removeEventListener("mousedown",
|
|
1670
|
+
return x.addEventListener("mousedown", p), document.addEventListener("mousemove", y), document.addEventListener("mouseleave", T), document.addEventListener("mouseup", T), document.addEventListener("contextmenu", T), () => {
|
|
1671
|
+
x.removeEventListener("mousedown", p), document.removeEventListener("mousemove", y), document.removeEventListener("mouseleave", T), document.removeEventListener("mouseup", T), document.removeEventListener("contextmenu", T);
|
|
1662
1672
|
};
|
|
1663
1673
|
}, [d, P, t]), ve(() => {
|
|
1664
1674
|
if (t)
|
|
@@ -1666,7 +1676,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1666
1676
|
const x = u.current;
|
|
1667
1677
|
if (!x)
|
|
1668
1678
|
return;
|
|
1669
|
-
const
|
|
1679
|
+
const p = (y) => {
|
|
1670
1680
|
const { ctrlKey: T, clientX: $, clientY: I, deltaX: X, deltaY: V } = y;
|
|
1671
1681
|
if (T) {
|
|
1672
1682
|
if (!d && V >= 0)
|
|
@@ -1686,12 +1696,12 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1686
1696
|
}
|
|
1687
1697
|
y.preventDefault();
|
|
1688
1698
|
};
|
|
1689
|
-
return x.addEventListener("wheel",
|
|
1690
|
-
x.removeEventListener("wheel",
|
|
1699
|
+
return x.addEventListener("wheel", p), () => {
|
|
1700
|
+
x.removeEventListener("wheel", p);
|
|
1691
1701
|
};
|
|
1692
1702
|
}, [d, P, C, t]), ve(() => {
|
|
1693
|
-
const x = u.current,
|
|
1694
|
-
if (!x || !
|
|
1703
|
+
const x = u.current, p = v.current;
|
|
1704
|
+
if (!x || !p)
|
|
1695
1705
|
return;
|
|
1696
1706
|
const y = N.current, T = (X) => {
|
|
1697
1707
|
for (let V = 0; V < X.changedTouches.length; V++) {
|
|
@@ -1732,8 +1742,8 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1732
1742
|
}), y.set(z.identifier, z), y.set(H.identifier, H);
|
|
1733
1743
|
}
|
|
1734
1744
|
};
|
|
1735
|
-
return
|
|
1736
|
-
|
|
1745
|
+
return p.addEventListener("touchstart", T), p.addEventListener("touchmove", I), p.addEventListener("touchend", $), p.addEventListener("touchcancel", $), () => {
|
|
1746
|
+
p.removeEventListener("touchstart", T), p.removeEventListener("touchmove", I), p.removeEventListener("touchend", $), p.removeEventListener("touchcancel", $);
|
|
1737
1747
|
};
|
|
1738
1748
|
}, [d, P, C]), /* @__PURE__ */ a(
|
|
1739
1749
|
"div",
|
|
@@ -1792,7 +1802,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1792
1802
|
extendMode: k,
|
|
1793
1803
|
setShownDetails: N,
|
|
1794
1804
|
displayedCategoryId: L,
|
|
1795
|
-
displayedCategoryName:
|
|
1805
|
+
displayedCategoryName: h
|
|
1796
1806
|
} = Ke(), n = G(
|
|
1797
1807
|
(ne) => {
|
|
1798
1808
|
const M = ne === "click" ? "Hotspot Clicked" : "Hotspot Hovered", le = ne === "click" ? "hotspot_clicked" : "hotspot_hovered";
|
|
@@ -1800,7 +1810,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1800
1810
|
type: "interaction",
|
|
1801
1811
|
current: {
|
|
1802
1812
|
category_id: L,
|
|
1803
|
-
category_name:
|
|
1813
|
+
category_name: h,
|
|
1804
1814
|
item_type: o.item_type,
|
|
1805
1815
|
item_position: o.item_position
|
|
1806
1816
|
},
|
|
@@ -1814,7 +1824,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1814
1824
|
[
|
|
1815
1825
|
E,
|
|
1816
1826
|
L,
|
|
1817
|
-
|
|
1827
|
+
h,
|
|
1818
1828
|
o,
|
|
1819
1829
|
i
|
|
1820
1830
|
]
|
|
@@ -1822,8 +1832,8 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1822
1832
|
n("click");
|
|
1823
1833
|
}, [n]), P = G(() => {
|
|
1824
1834
|
n("hover");
|
|
1825
|
-
}, [n]), { getIconConfig: _ } =
|
|
1826
|
-
$ && (b(), !(
|
|
1835
|
+
}, [n]), { getIconConfig: _ } = vt(), w = c ? _(c) : void 0, C = !!v?.src?.trim(), x = v?.type === "image" && C, p = v?.type === "link" && C, y = v?.type === "pdf" && C, T = x || p || y, $ = !!u || T, I = !!d, X = Le(null), V = Le(null), z = Le(null), [H, R] = Ie(!1), q = T ? e === "damage" ? /* @__PURE__ */ a(jn, { className: "size-4" }) : /* @__PURE__ */ a(br, { className: "size-4" }) : /* @__PURE__ */ a("div", { className: "size-1" }), ce = () => {
|
|
1836
|
+
$ && (b(), !(p || y) && N({
|
|
1827
1837
|
src: x ? v.src : void 0,
|
|
1828
1838
|
title: d,
|
|
1829
1839
|
text: u
|
|
@@ -1907,7 +1917,7 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
1907
1917
|
}
|
|
1908
1918
|
)
|
|
1909
1919
|
] });
|
|
1910
|
-
return
|
|
1920
|
+
return p || y ? /* @__PURE__ */ a(
|
|
1911
1921
|
"a",
|
|
1912
1922
|
{
|
|
1913
1923
|
className: F,
|
|
@@ -2005,19 +2015,19 @@ const br = ({ className: t }) => /* @__PURE__ */ a(qe, { className: t, customiza
|
|
|
2005
2015
|
]
|
|
2006
2016
|
}
|
|
2007
2017
|
) });
|
|
2008
|
-
}, Kn = 100, ft = 100,
|
|
2018
|
+
}, Kn = 100, ft = 100, gt = 50, $n = 0, Jn = 0, Qn = (t) => {
|
|
2009
2019
|
const [o, i] = Ie(0), [d, c] = Ie(!1);
|
|
2010
2020
|
return ve(() => {
|
|
2011
2021
|
const u = XMLHttpRequest.prototype.open, v = XMLHttpRequest.prototype.send;
|
|
2012
2022
|
let e = !1;
|
|
2013
|
-
return XMLHttpRequest.prototype.open = function(E, k, N = !0, L,
|
|
2023
|
+
return XMLHttpRequest.prototype.open = function(E, k, N = !0, L, h) {
|
|
2014
2024
|
return k.toString().includes(t) && (e = !0, c(!0)), u.call(
|
|
2015
2025
|
this,
|
|
2016
2026
|
E,
|
|
2017
2027
|
k,
|
|
2018
2028
|
N,
|
|
2019
2029
|
L || null,
|
|
2020
|
-
|
|
2030
|
+
h || null
|
|
2021
2031
|
);
|
|
2022
2032
|
}, XMLHttpRequest.prototype.send = function(E) {
|
|
2023
2033
|
return e && (this.addEventListener("progress", (k) => {
|
|
@@ -2037,42 +2047,42 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2037
2047
|
function d(N) {
|
|
2038
2048
|
var L = o.createElement("canvas");
|
|
2039
2049
|
L.style.width = L.style.height = "100%", N.appendChild(L);
|
|
2040
|
-
var
|
|
2050
|
+
var h, n, b, P, _, w, C, x, p, y, T, $, I, X, V, z;
|
|
2041
2051
|
this.init = function(l, f, Q, oe, ee, g, ae, re) {
|
|
2042
2052
|
if (f === i && (f = "equirectangular"), f != "equirectangular" && f != "cubemap" && f != "multires")
|
|
2043
2053
|
throw console.log("Error: invalid image type specified!"), { type: "config error" };
|
|
2044
|
-
if (y = f,
|
|
2045
|
-
if (b && (n.detachShader(
|
|
2046
|
-
for (var xe = 0; xe <
|
|
2047
|
-
n.deleteTexture(
|
|
2048
|
-
n.deleteProgram(
|
|
2054
|
+
if (y = f, p = l, T = Q, z = re || {}, h) {
|
|
2055
|
+
if (b && (n.detachShader(h, b), n.deleteShader(b)), P && (n.detachShader(h, P), n.deleteShader(P)), n.bindBuffer(n.ARRAY_BUFFER, null), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, null), h.texture && n.deleteTexture(h.texture), h.nodeCache)
|
|
2056
|
+
for (var xe = 0; xe < h.nodeCache.length; xe++)
|
|
2057
|
+
n.deleteTexture(h.nodeCache[xe].texture);
|
|
2058
|
+
n.deleteProgram(h), h = i;
|
|
2049
2059
|
}
|
|
2050
2060
|
x = i;
|
|
2051
|
-
var
|
|
2061
|
+
var he, Ge = !1, He;
|
|
2052
2062
|
if (y == "cubemap")
|
|
2053
|
-
for (
|
|
2054
|
-
|
|
2063
|
+
for (he = 0; he < 6; he++)
|
|
2064
|
+
p[he].width > 0 ? (He === i && (He = p[he].width), He != p[he].width && console.log("Cube faces have inconsistent widths: " + He + " vs. " + p[he].width)) : Ge = !0;
|
|
2055
2065
|
function ge(se) {
|
|
2056
2066
|
if (Ge) {
|
|
2057
|
-
var A = se * se * 4,
|
|
2067
|
+
var A = se * se * 4, pe = new Uint8ClampedArray(A), _e = re.backgroundColor ? re.backgroundColor : [0, 0, 0];
|
|
2058
2068
|
_e[0] *= 255, _e[1] *= 255, _e[2] *= 255;
|
|
2059
2069
|
for (var Ee = 0; Ee < A; Ee++)
|
|
2060
|
-
|
|
2061
|
-
var Fe = new ImageData(
|
|
2062
|
-
for (
|
|
2063
|
-
|
|
2070
|
+
pe[Ee++] = _e[0], pe[Ee++] = _e[1], pe[Ee++] = _e[2];
|
|
2071
|
+
var Fe = new ImageData(pe, se, se);
|
|
2072
|
+
for (he = 0; he < 6; he++)
|
|
2073
|
+
p[he].width == 0 && (p[he] = Fe);
|
|
2064
2074
|
}
|
|
2065
2075
|
}
|
|
2066
|
-
if (y == "cubemap" && (He & He - 1) !== 0 && (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/) || navigator.userAgent.match(/Trident.*rv[ :]*11\./)) || (n || (n = L.getContext("experimental-webgl", { alpha: !1, depth: !1 })), n && n.getError() == 1286 && we()), !n && (y == "multires" &&
|
|
2076
|
+
if (y == "cubemap" && (He & He - 1) !== 0 && (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/) || navigator.userAgent.match(/Trident.*rv[ :]*11\./)) || (n || (n = L.getContext("experimental-webgl", { alpha: !1, depth: !1 })), n && n.getError() == 1286 && we()), !n && (y == "multires" && p.hasOwnProperty("fallbackPath") || y == "cubemap") && ("WebkitAppearance" in o.documentElement.style || navigator.userAgent.match(/Trident.*rv[ :]*11\./) || navigator.appVersion.indexOf("MSIE 10") !== -1)) {
|
|
2067
2077
|
w && N.removeChild(w), w = o.createElement("div"), w.className = "pnlm-world";
|
|
2068
2078
|
var ye;
|
|
2069
|
-
|
|
2079
|
+
p.basePath ? ye = p.basePath + p.fallbackPath : ye = p.fallbackPath;
|
|
2070
2080
|
var Ce = ["f", "r", "b", "l", "u", "d"], Pe = 0, Ne = function() {
|
|
2071
2081
|
var A = o.createElement("canvas");
|
|
2072
2082
|
A.className = "pnlm-face pnlm-" + Ce[this.side] + "face", w.appendChild(A);
|
|
2073
|
-
var
|
|
2074
|
-
A.style.width = this.width + 4 + "px", A.style.height = this.height + 4 + "px", A.width = this.width + 4, A.height = this.height + 4,
|
|
2075
|
-
var _e =
|
|
2083
|
+
var pe = A.getContext("2d");
|
|
2084
|
+
A.style.width = this.width + 4 + "px", A.style.height = this.height + 4 + "px", A.width = this.width + 4, A.height = this.height + 4, pe.drawImage(this, 2, 2);
|
|
2085
|
+
var _e = pe.getImageData(0, 0, A.width, A.height), Ee = _e.data, Fe, de;
|
|
2076
2086
|
for (Fe = 2; Fe < A.width - 2; Fe++)
|
|
2077
2087
|
for (de = 0; de < 4; de++)
|
|
2078
2088
|
Ee[(Fe + A.width) * 4 + de] = Ee[(Fe + A.width * 2) * 4 + de], Ee[(Fe + A.width * (A.height - 2)) * 4 + de] = Ee[(Fe + A.width * (A.height - 3)) * 4 + de];
|
|
@@ -2089,24 +2099,24 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2089
2099
|
Ee[Fe * A.width * 4 + de] = Ee[(Fe * A.width + 1) * 4 + de], Ee[((Fe + 1) * A.width - 1) * 4 + de] = Ee[((Fe + 1) * A.width - 2) * 4 + de];
|
|
2090
2100
|
for (de = 0; de < 4; de++)
|
|
2091
2101
|
Ee[de] = Ee[(A.width + 1) * 4 + de], Ee[(A.width - 1) * 4 + de] = Ee[(A.width * 2 - 2) * 4 + de], Ee[A.width * (A.height - 1) * 4 + de] = Ee[(A.width * (A.height - 2) + 1) * 4 + de], Ee[(A.width * A.height - 1) * 4 + de] = Ee[(A.width * (A.height - 1) - 2) * 4 + de];
|
|
2092
|
-
|
|
2102
|
+
pe.putImageData(_e, 0, 0), Be.call(this);
|
|
2093
2103
|
}, Be = function() {
|
|
2094
2104
|
this.width > 0 ? (_ === i && (_ = this.width), _ != this.width && console.log("Fallback faces have inconsistent widths: " + _ + " vs. " + this.width)) : Ge = !0, Pe++, Pe == 6 && (_ = this.width, N.appendChild(w), ae());
|
|
2095
2105
|
};
|
|
2096
|
-
for (Ge = !1,
|
|
2106
|
+
for (Ge = !1, he = 0; he < 6; he++) {
|
|
2097
2107
|
var We = new Image();
|
|
2098
|
-
We.crossOrigin = z.crossOrigin ? z.crossOrigin : "anonymous", We.side =
|
|
2108
|
+
We.crossOrigin = z.crossOrigin ? z.crossOrigin : "anonymous", We.side = he, We.onload = Ne, We.onerror = Be, y == "multires" ? We.src = encodeURI(ye.replace("%s", Ce[he]) + "." + p.extension) : We.src = encodeURI(p[he].src);
|
|
2099
2109
|
}
|
|
2100
2110
|
ge(_);
|
|
2101
2111
|
return;
|
|
2102
2112
|
} else if (!n)
|
|
2103
2113
|
throw console.log("Error: no WebGL support detected!"), { type: "no webgl" };
|
|
2104
|
-
y == "cubemap" && ge(He),
|
|
2114
|
+
y == "cubemap" && ge(He), p.basePath ? p.fullpath = p.basePath + p.path : p.fullpath = p.path, p.invTileResolution = 1 / p.tileResolution;
|
|
2105
2115
|
var ke = D();
|
|
2106
|
-
for (C = [],
|
|
2107
|
-
C[
|
|
2116
|
+
for (C = [], he = 0; he < 6; he++)
|
|
2117
|
+
C[he] = ke.slice(he * 12, he * 12 + 12), ke = D();
|
|
2108
2118
|
var Se = 0, Xe = 0;
|
|
2109
|
-
if (y == "equirectangular" ? (Se = Math.max(
|
|
2119
|
+
if (y == "equirectangular" ? (Se = Math.max(p.width, p.height), Xe = n.getParameter(n.MAX_TEXTURE_SIZE)) : y == "cubemap" && (Se = He, Xe = n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE)), Se > Xe)
|
|
2110
2120
|
throw console.log("Error: The image is too big; it's " + Se + "px wide, but this device's maximum supported size is " + Xe + "px."), { type: "webgl size error", width: Se, maxWidth: Xe };
|
|
2111
2121
|
re !== i && (re.horizonPitch !== i || re.horizonRoll !== i) && (x = [re.horizonPitch == i ? 0 : re.horizonPitch, re.horizonRoll == i ? 0 : re.horizonRoll]);
|
|
2112
2122
|
var De = n.TEXTURE_2D;
|
|
@@ -2114,9 +2124,9 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2114
2124
|
var Ze = c;
|
|
2115
2125
|
y == "multires" && (Ze = u), n.shaderSource(b, Ze), n.compileShader(b), P = n.createShader(n.FRAGMENT_SHADER);
|
|
2116
2126
|
var Ae = E;
|
|
2117
|
-
y == "cubemap" ? (De = n.TEXTURE_CUBE_MAP, Ae = e) : y == "multires" && (Ae = k), n.shaderSource(P, Ae), n.compileShader(P),
|
|
2127
|
+
y == "cubemap" ? (De = n.TEXTURE_CUBE_MAP, Ae = e) : y == "multires" && (Ae = k), n.shaderSource(P, Ae), n.compileShader(P), h = n.createProgram(), n.attachShader(h, b), n.attachShader(h, P), n.linkProgram(h), n.getShaderParameter(b, n.COMPILE_STATUS) || console.log(n.getShaderInfoLog(b)), n.getShaderParameter(P, n.COMPILE_STATUS) || console.log(n.getShaderInfoLog(P)), n.getProgramParameter(h, n.LINK_STATUS) || console.log(n.getProgramInfoLog(h)), n.useProgram(h), h.drawInProgress = !1;
|
|
2118
2128
|
var Re = re.backgroundColor ? re.backgroundColor : [0, 0, 0];
|
|
2119
|
-
n.clearColor(Re[0], Re[1], Re[2], 1), n.clear(n.COLOR_BUFFER_BIT),
|
|
2129
|
+
n.clearColor(Re[0], Re[1], Re[2], 1), n.clear(n.COLOR_BUFFER_BIT), h.texCoordLocation = n.getAttribLocation(h, "a_texCoord"), n.enableVertexAttribArray(h.texCoordLocation), y != "multires" ? ($ || ($ = n.createBuffer()), n.bindBuffer(n.ARRAY_BUFFER, $), n.bufferData(n.ARRAY_BUFFER, new Float32Array([-1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), n.STATIC_DRAW), n.vertexAttribPointer(h.texCoordLocation, 2, n.FLOAT, !1, 0, 0), h.aspectRatio = n.getUniformLocation(h, "u_aspectRatio"), n.uniform1f(h.aspectRatio, n.drawingBufferWidth / n.drawingBufferHeight), h.psi = n.getUniformLocation(h, "u_psi"), h.theta = n.getUniformLocation(h, "u_theta"), h.f = n.getUniformLocation(h, "u_f"), h.h = n.getUniformLocation(h, "u_h"), h.v = n.getUniformLocation(h, "u_v"), h.vo = n.getUniformLocation(h, "u_vo"), h.rot = n.getUniformLocation(h, "u_rot"), n.uniform1f(h.h, oe / (Math.PI * 2)), n.uniform1f(h.v, ee / Math.PI), n.uniform1f(h.vo, g / Math.PI * 2), y == "equirectangular" && (h.backgroundColor = n.getUniformLocation(h, "u_backgroundColor"), n.uniform4fv(h.backgroundColor, Re.concat([1]))), h.texture = n.createTexture(), n.bindTexture(De, h.texture), y == "cubemap" ? (n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p[1]), n.texImage2D(n.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p[3]), n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p[4]), n.texImage2D(n.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p[5]), n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p[0]), n.texImage2D(n.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p[2])) : n.texImage2D(De, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p), n.texParameteri(De, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(De, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), n.texParameteri(De, n.TEXTURE_MIN_FILTER, n.LINEAR), n.texParameteri(De, n.TEXTURE_MAG_FILTER, n.LINEAR)) : (h.vertPosLocation = n.getAttribLocation(h, "a_vertCoord"), n.enableVertexAttribArray(h.vertPosLocation), I || (I = n.createBuffer()), X || (X = n.createBuffer()), V || (V = n.createBuffer()), n.bindBuffer(n.ARRAY_BUFFER, X), n.bufferData(n.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), n.STATIC_DRAW), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, V), n.bufferData(n.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), n.STATIC_DRAW), h.perspUniform = n.getUniformLocation(h, "u_perspMatrix"), h.cubeUniform = n.getUniformLocation(h, "u_cubeMatrix"), h.level = -1, h.currentNodes = [], h.nodeCache = [], h.nodeCacheTimestamp = 0);
|
|
2120
2130
|
var O = n.getError();
|
|
2121
2131
|
if (O !== 0)
|
|
2122
2132
|
throw console.log("Error: Something went wrong with WebGL!", O), { type: "webgl error" };
|
|
@@ -2128,15 +2138,15 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2128
2138
|
}
|
|
2129
2139
|
}, this.resize = function() {
|
|
2130
2140
|
var l = t.devicePixelRatio || 1;
|
|
2131
|
-
L.width = L.clientWidth * l, L.height = L.clientHeight * l, n && (n.getError() == 1286 && we(), n.viewport(0, 0, n.drawingBufferWidth, n.drawingBufferHeight), y != "multires" && n.uniform1f(
|
|
2141
|
+
L.width = L.clientWidth * l, L.height = L.clientHeight * l, n && (n.getError() == 1286 && we(), n.viewport(0, 0, n.drawingBufferWidth, n.drawingBufferHeight), y != "multires" && n.uniform1f(h.aspectRatio, L.clientWidth / L.clientHeight));
|
|
2132
2142
|
}, this.resize(), this.setPose = function(l, f) {
|
|
2133
2143
|
x = [l, f];
|
|
2134
2144
|
}, this.render = function(l, f, Q, oe) {
|
|
2135
2145
|
var ee, g, ae, re = 0;
|
|
2136
2146
|
if (oe === i && (oe = {}), oe.roll && (re = oe.roll), x !== i) {
|
|
2137
|
-
var xe = x[0],
|
|
2147
|
+
var xe = x[0], he = x[1], Ge = l, He = f, ge = Math.cos(he) * Math.sin(l) * Math.sin(xe) + Math.cos(l) * (Math.cos(xe) * Math.cos(f) + Math.sin(he) * Math.sin(xe) * Math.sin(f)), ye = -Math.sin(l) * Math.sin(he) + Math.cos(l) * Math.cos(he) * Math.sin(f), Ce = Math.cos(he) * Math.cos(xe) * Math.sin(l) + Math.cos(l) * (-Math.cos(f) * Math.sin(xe) + Math.cos(xe) * Math.sin(he) * Math.sin(f));
|
|
2138
2148
|
l = Math.asin(Math.max(Math.min(Ce, 1), -1)), f = Math.atan2(ye, ge);
|
|
2139
|
-
var Pe = [Math.cos(Ge) * (Math.sin(
|
|
2149
|
+
var Pe = [Math.cos(Ge) * (Math.sin(he) * Math.sin(xe) * Math.cos(He) - Math.cos(xe) * Math.sin(He)), Math.cos(Ge) * Math.cos(he) * Math.cos(He), Math.cos(Ge) * (Math.cos(xe) * Math.sin(he) * Math.cos(He) + Math.sin(He) * Math.sin(xe))], Ne = [-Math.cos(l) * Math.sin(f), Math.cos(l) * Math.cos(f)], Be = Math.acos(Math.max(Math.min((Pe[0] * Ne[0] + Pe[1] * Ne[1]) / (Math.sqrt(Pe[0] * Pe[0] + Pe[1] * Pe[1] + Pe[2] * Pe[2]) * Math.sqrt(Ne[0] * Ne[0] + Ne[1] * Ne[1])), 1), -1));
|
|
2140
2150
|
Pe[2] < 0 && (Be = 2 * Math.PI - Be), re += Be;
|
|
2141
2151
|
}
|
|
2142
2152
|
if (!n && (y == "multires" || y == "cubemap")) {
|
|
@@ -2159,27 +2169,27 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2159
2169
|
}
|
|
2160
2170
|
if (y != "multires") {
|
|
2161
2171
|
var Ze = 2 * Math.atan(Math.tan(Q * 0.5) / (n.drawingBufferWidth / n.drawingBufferHeight));
|
|
2162
|
-
ee = 1 / Math.tan(Ze * 0.5), n.uniform1f(
|
|
2172
|
+
ee = 1 / Math.tan(Ze * 0.5), n.uniform1f(h.psi, f), n.uniform1f(h.theta, l), n.uniform1f(h.rot, re), n.uniform1f(h.f, ee), T === !0 && y == "equirectangular" && (n.bindTexture(n.TEXTURE_2D, h.texture), n.texImage2D(n.TEXTURE_2D, 0, n.RGB, n.RGB, n.UNSIGNED_BYTE, p)), n.drawArrays(n.TRIANGLES, 0, 6);
|
|
2163
2173
|
} else {
|
|
2164
2174
|
var Ae = F(Q, n.drawingBufferWidth / n.drawingBufferHeight, 0.1, 100);
|
|
2165
2175
|
le(Q);
|
|
2166
2176
|
var Re = J();
|
|
2167
|
-
Re = S(Re, -re, "z"), Re = S(Re, -l, "x"), Re = S(Re, f, "y"), Re = B(Re), n.uniformMatrix4fv(
|
|
2177
|
+
Re = S(Re, -re, "z"), Re = S(Re, -l, "x"), Re = S(Re, f, "y"), Re = B(Re), n.uniformMatrix4fv(h.perspUniform, !1, new Float32Array(ie(Ae))), n.uniformMatrix4fv(h.cubeUniform, !1, new Float32Array(ie(Re)));
|
|
2168
2178
|
var O = j(Ae, Re);
|
|
2169
|
-
if (
|
|
2170
|
-
for (var se =
|
|
2179
|
+
if (h.nodeCache.sort(H), h.nodeCache.length > 200 && h.nodeCache.length > h.currentNodes.length + 50)
|
|
2180
|
+
for (var se = h.nodeCache.splice(200, h.nodeCache.length - 200), g = 0; g < se.length; g++)
|
|
2171
2181
|
n.deleteTexture(se[g].texture);
|
|
2172
|
-
|
|
2182
|
+
h.currentNodes = [];
|
|
2173
2183
|
var A = ["f", "b", "u", "d", "l", "r"];
|
|
2174
2184
|
for (ae = 0; ae < 6; ae++) {
|
|
2175
|
-
var
|
|
2176
|
-
U(O,
|
|
2185
|
+
var pe = new ce(C[ae], A[ae], 1, 0, 0, p.fullpath);
|
|
2186
|
+
U(O, pe, l, f);
|
|
2177
2187
|
}
|
|
2178
|
-
for (
|
|
2179
|
-
|
|
2188
|
+
for (h.currentNodes.sort(R), g = K.length - 1; g >= 0; g--)
|
|
2189
|
+
h.currentNodes.indexOf(K[g].node) === -1 && (K[g].node.textureLoad = !1, K.splice(g, 1));
|
|
2180
2190
|
if (K.length === 0)
|
|
2181
|
-
for (g = 0; g <
|
|
2182
|
-
var _e =
|
|
2191
|
+
for (g = 0; g < h.currentNodes.length; g++) {
|
|
2192
|
+
var _e = h.currentNodes[g];
|
|
2183
2193
|
if (!_e.texture && !_e.textureLoad) {
|
|
2184
2194
|
_e.textureLoad = !0, setTimeout(M, 0, _e);
|
|
2185
2195
|
break;
|
|
@@ -2191,8 +2201,8 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2191
2201
|
return L.toDataURL("image/png");
|
|
2192
2202
|
}, this.isLoading = function() {
|
|
2193
2203
|
if (n && y == "multires") {
|
|
2194
|
-
for (var l = 0; l <
|
|
2195
|
-
if (!
|
|
2204
|
+
for (var l = 0; l < h.currentNodes.length; l++)
|
|
2205
|
+
if (!h.currentNodes[l].textureLoaded)
|
|
2196
2206
|
return !0;
|
|
2197
2207
|
}
|
|
2198
2208
|
return !1;
|
|
@@ -2206,11 +2216,11 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2206
2216
|
return l.level != f.level ? l.level - f.level : l.diff - f.diff;
|
|
2207
2217
|
}
|
|
2208
2218
|
function q() {
|
|
2209
|
-
if (!
|
|
2210
|
-
|
|
2211
|
-
for (var l = 0; l <
|
|
2212
|
-
|
|
2213
|
-
|
|
2219
|
+
if (!h.drawInProgress) {
|
|
2220
|
+
h.drawInProgress = !0, n.clear(n.COLOR_BUFFER_BIT);
|
|
2221
|
+
for (var l = 0; l < h.currentNodes.length; l++)
|
|
2222
|
+
h.currentNodes[l].textureLoaded > 1 && (n.bindBuffer(n.ARRAY_BUFFER, I), n.bufferData(n.ARRAY_BUFFER, new Float32Array(h.currentNodes[l].vertices), n.STATIC_DRAW), n.vertexAttribPointer(h.vertPosLocation, 3, n.FLOAT, !1, 0, 0), n.bindBuffer(n.ARRAY_BUFFER, X), n.vertexAttribPointer(h.texCoordLocation, 2, n.FLOAT, !1, 0, 0), n.bindTexture(n.TEXTURE_2D, h.currentNodes[l].texture), n.drawElements(n.TRIANGLES, 6, n.UNSIGNED_SHORT, 0));
|
|
2223
|
+
h.drawInProgress = !1;
|
|
2214
2224
|
}
|
|
2215
2225
|
}
|
|
2216
2226
|
function ce(l, f, Q, oe, ee, g) {
|
|
@@ -2218,20 +2228,20 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2218
2228
|
}
|
|
2219
2229
|
function U(l, f, Q, oe, ee) {
|
|
2220
2230
|
if (Ve(l, f.vertices)) {
|
|
2221
|
-
var g = f.vertices, ae = g[0] + g[3] + g[6] + g[9], re = g[1] + g[4] + g[7] + g[10], xe = g[2] + g[5] + g[8] + g[11],
|
|
2231
|
+
var g = f.vertices, ae = g[0] + g[3] + g[6] + g[9], re = g[1] + g[4] + g[7] + g[10], xe = g[2] + g[5] + g[8] + g[11], he = Math.sqrt(ae * ae + re * re + xe * xe), Ge = Math.asin(xe / he), He = Math.atan2(re, ae), ge = He - oe;
|
|
2222
2232
|
ge += ge > Math.PI ? -2 * Math.PI : ge < -Math.PI ? 2 * Math.PI : 0, ge = Math.abs(ge), f.diff = Math.acos(Math.sin(Q) * Math.sin(Ge) + Math.cos(Q) * Math.cos(Ge) * Math.cos(ge));
|
|
2223
|
-
for (var ye = !1, Ce = 0; Ce <
|
|
2224
|
-
if (
|
|
2225
|
-
ye = !0,
|
|
2233
|
+
for (var ye = !1, Ce = 0; Ce < h.nodeCache.length; Ce++)
|
|
2234
|
+
if (h.nodeCache[Ce].path == f.path) {
|
|
2235
|
+
ye = !0, h.nodeCache[Ce].timestamp = h.nodeCacheTimestamp++, h.nodeCache[Ce].diff = f.diff, h.currentNodes.push(h.nodeCache[Ce]);
|
|
2226
2236
|
break;
|
|
2227
2237
|
}
|
|
2228
|
-
if (ye || (f.timestamp =
|
|
2229
|
-
var Pe =
|
|
2230
|
-
We === 0 && (We =
|
|
2238
|
+
if (ye || (f.timestamp = h.nodeCacheTimestamp++, h.currentNodes.push(f), h.nodeCache.push(f)), f.level < h.level) {
|
|
2239
|
+
var Pe = p.cubeResolution * Math.pow(2, f.level - p.maxLevel), Ne = Math.ceil(Pe * p.invTileResolution) - 1, Be = Pe % p.tileResolution * 2, We = Pe * 2 % p.tileResolution;
|
|
2240
|
+
We === 0 && (We = p.tileResolution), Be === 0 && (Be = p.tileResolution * 2);
|
|
2231
2241
|
var ke = 0.5;
|
|
2232
|
-
(f.x == Ne || f.y == Ne) && (ke = 1 -
|
|
2233
|
-
var Se = 1 - ke, Xe = [], De, Ze, Ae = ke, Re = ke, O = ke, se = Se, A = Se,
|
|
2234
|
-
We <
|
|
2242
|
+
(f.x == Ne || f.y == Ne) && (ke = 1 - p.tileResolution / (p.tileResolution + We));
|
|
2243
|
+
var Se = 1 - ke, Xe = [], De, Ze, Ae = ke, Re = ke, O = ke, se = Se, A = Se, pe = Se;
|
|
2244
|
+
We < p.tileResolution && (f.x == Ne && f.y != Ne ? (Re = 0.5, A = 0.5, (f.side == "d" || f.side == "u") && (O = 0.5, pe = 0.5)) : f.x != Ne && f.y == Ne && (Ae = 0.5, se = 0.5, (f.side == "l" || f.side == "r") && (O = 0.5, pe = 0.5))), Be <= p.tileResolution && (f.x == Ne && (Ae = 0, se = 1, (f.side == "l" || f.side == "r") && (O = 0, pe = 1)), f.y == Ne && (Re = 0, A = 1, (f.side == "d" || f.side == "u") && (O = 0, pe = 1))), De = [g[0], g[1], g[2], g[0] * Ae + g[3] * se, g[1] * ke + g[4] * Se, g[2] * O + g[5] * pe, g[0] * Ae + g[6] * se, g[1] * Re + g[7] * A, g[2] * O + g[8] * pe, g[0] * ke + g[9] * Se, g[1] * Re + g[10] * A, g[2] * O + g[11] * pe], Ze = new ce(De, f.side, f.level + 1, f.x * 2, f.y * 2, p.fullpath), Xe.push(Ze), f.x == Ne && Be <= p.tileResolution || (De = [g[0] * Ae + g[3] * se, g[1] * ke + g[4] * Se, g[2] * O + g[5] * pe, g[3], g[4], g[5], g[3] * ke + g[6] * Se, g[4] * Re + g[7] * A, g[5] * O + g[8] * pe, g[0] * Ae + g[6] * se, g[1] * Re + g[7] * A, g[2] * O + g[8] * pe], Ze = new ce(De, f.side, f.level + 1, f.x * 2 + 1, f.y * 2, p.fullpath), Xe.push(Ze)), !(f.x == Ne && Be <= p.tileResolution) && !(f.y == Ne && Be <= p.tileResolution) && (De = [g[0] * Ae + g[6] * se, g[1] * Re + g[7] * A, g[2] * O + g[8] * pe, g[3] * ke + g[6] * Se, g[4] * Re + g[7] * A, g[5] * O + g[8] * pe, g[6], g[7], g[8], g[9] * Ae + g[6] * se, g[10] * ke + g[7] * Se, g[11] * O + g[8] * pe], Ze = new ce(De, f.side, f.level + 1, f.x * 2 + 1, f.y * 2 + 1, p.fullpath), Xe.push(Ze)), f.y == Ne && Be <= p.tileResolution || (De = [g[0] * ke + g[9] * Se, g[1] * Re + g[10] * A, g[2] * O + g[11] * pe, g[0] * Ae + g[6] * se, g[1] * Re + g[7] * A, g[2] * O + g[8] * pe, g[9] * Ae + g[6] * se, g[10] * ke + g[7] * Se, g[11] * O + g[8] * pe, g[9], g[10], g[11]], Ze = new ce(De, f.side, f.level + 1, f.x * 2, f.y * 2 + 1, p.fullpath), Xe.push(Ze));
|
|
2235
2245
|
for (var _e = 0; _e < Xe.length; _e++)
|
|
2236
2246
|
U(l, Xe[_e], Q, oe);
|
|
2237
2247
|
}
|
|
@@ -2354,11 +2364,11 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2354
2364
|
};
|
|
2355
2365
|
this.image.addEventListener("load", xe), this.image.addEventListener("error", xe);
|
|
2356
2366
|
}
|
|
2357
|
-
oe.prototype.loadTexture = function(re, xe,
|
|
2358
|
-
this.texture = xe, this.callback =
|
|
2367
|
+
oe.prototype.loadTexture = function(re, xe, he) {
|
|
2368
|
+
this.texture = xe, this.callback = he, this.image.src = re;
|
|
2359
2369
|
};
|
|
2360
|
-
function ee(re, xe,
|
|
2361
|
-
this.node = re, this.src = xe, this.texture =
|
|
2370
|
+
function ee(re, xe, he, Ge) {
|
|
2371
|
+
this.node = re, this.src = xe, this.texture = he, this.callback = Ge;
|
|
2362
2372
|
}
|
|
2363
2373
|
function g(re) {
|
|
2364
2374
|
if (K.length) {
|
|
@@ -2369,21 +2379,21 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2369
2379
|
}
|
|
2370
2380
|
for (var ae = 0; ae < l; ae++)
|
|
2371
2381
|
f[ae] = new oe();
|
|
2372
|
-
return function(re, xe,
|
|
2382
|
+
return function(re, xe, he, Ge) {
|
|
2373
2383
|
Q = Ge;
|
|
2374
2384
|
var He = n.createTexture();
|
|
2375
|
-
return l ? f[--l].loadTexture(xe, He,
|
|
2385
|
+
return l ? f[--l].loadTexture(xe, He, he) : K.push(new ee(re, xe, He, he)), He;
|
|
2376
2386
|
};
|
|
2377
2387
|
})();
|
|
2378
2388
|
function M(l) {
|
|
2379
|
-
ne(l, encodeURI(l.path + "." +
|
|
2389
|
+
ne(l, encodeURI(l.path + "." + p.extension), function(f, Q) {
|
|
2380
2390
|
l.texture = f, l.textureLoaded = Q ? 2 : 1;
|
|
2381
2391
|
}, z.crossOrigin);
|
|
2382
2392
|
}
|
|
2383
2393
|
function le(l) {
|
|
2384
|
-
for (var f = 1; f <
|
|
2394
|
+
for (var f = 1; f < p.maxLevel && n.drawingBufferWidth > p.tileResolution * Math.pow(2, f - 1) * Math.tan(l / 2) * 0.707; )
|
|
2385
2395
|
f++;
|
|
2386
|
-
|
|
2396
|
+
h.level = f;
|
|
2387
2397
|
}
|
|
2388
2398
|
function j(l, f) {
|
|
2389
2399
|
return [l[0] * f[0], l[0] * f[1], l[0] * f[2], 0, l[5] * f[4], l[5] * f[5], l[5] * f[6], 0, l[10] * f[8], l[10] * f[9], l[10] * f[10], l[11], -f[8], -f[9], -f[10], 0];
|
|
@@ -2493,14 +2503,14 @@ window.libpannellum = (function(t, o, i) {
|
|
|
2493
2503
|
"}"
|
|
2494
2504
|
].join("");
|
|
2495
2505
|
return {
|
|
2496
|
-
renderer: function(L,
|
|
2506
|
+
renderer: function(L, h, n, b) {
|
|
2497
2507
|
return new d(L);
|
|
2498
2508
|
}
|
|
2499
2509
|
};
|
|
2500
2510
|
})(window, document);
|
|
2501
2511
|
window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
2502
2512
|
function d(c, u) {
|
|
2503
|
-
var v = this, e, E, k, N = !1, L = Date.now(),
|
|
2513
|
+
var v = this, e, E, k, N = !1, L = Date.now(), h = 0, n = 0, b = -1, P = 0, _ = 0, w = new Array(10), C = !1, x, p = !1, y = !1, T, $, I = { yaw: 0, pitch: 0, hfov: 0 }, X = !1, V = !1, z = 0, H, R = 0, q, ce, U = {}, D = {}, J = [], S = !1, B = !1, ie = {
|
|
2504
2514
|
hfov: 100,
|
|
2505
2515
|
minHfov: 50,
|
|
2506
2516
|
maxHfov: 120,
|
|
@@ -2567,9 +2577,9 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2567
2577
|
le.className = "pnlm-sprite pnlm-hot-spot-debug-indicator", F.appendChild(le), M.container = o.createElement("div"), M.container.className = "pnlm-panorama-info", M.title = o.createElement("div"), M.title.className = "pnlm-title-box", M.container.appendChild(M.title), M.author = o.createElement("div"), M.author.className = "pnlm-author-box", M.container.appendChild(M.author), F.appendChild(M.container), M.load = {}, M.load.box = o.createElement("div"), M.load.box.className = "pnlm-load-box", M.load.boxp = o.createElement("p"), M.load.box.appendChild(M.load.boxp), M.load.lbox = o.createElement("div"), M.load.lbox.className = "pnlm-lbox", M.load.lbox.innerHTML = '<div class="pnlm-loading"></div>', M.load.box.appendChild(M.load.lbox), M.load.lbar = o.createElement("div"), M.load.lbar.className = "pnlm-lbar", M.load.lbarFill = o.createElement("div"), M.load.lbarFill.className = "pnlm-lbar-fill", M.load.lbar.appendChild(M.load.lbarFill), M.load.box.appendChild(M.load.lbar), M.load.msg = o.createElement("p"), M.load.msg.className = "pnlm-lmsg", M.load.box.appendChild(M.load.msg), F.appendChild(M.load.box), M.errorMsg = o.createElement("div"), M.errorMsg.className = "pnlm-error-msg pnlm-info-box", F.appendChild(M.errorMsg);
|
|
2568
2578
|
var j = {};
|
|
2569
2579
|
j.container = o.createElement("div"), j.container.className = "pnlm-controls-container", F.appendChild(j.container), j.load = o.createElement("div"), j.load.className = "pnlm-load-button", j.load.addEventListener("click", function() {
|
|
2570
|
-
|
|
2571
|
-
}), F.appendChild(j.load), j.zoom = o.createElement("div"), j.zoom.className = "pnlm-zoom-controls pnlm-controls", j.zoomIn = o.createElement("div"), j.zoomIn.className = "pnlm-zoom-in pnlm-sprite pnlm-control", j.zoomIn.addEventListener("click", Or), j.zoom.appendChild(j.zoomIn), j.zoomOut = o.createElement("div"), j.zoomOut.className = "pnlm-zoom-out pnlm-sprite pnlm-control", j.zoomOut.addEventListener("click", Hr), j.zoom.appendChild(j.zoomOut), j.container.appendChild(j.zoom), j.fullscreen = o.createElement("div"), j.fullscreen.addEventListener("click",
|
|
2572
|
-
V ?
|
|
2580
|
+
kt(), Yt();
|
|
2581
|
+
}), F.appendChild(j.load), j.zoom = o.createElement("div"), j.zoom.className = "pnlm-zoom-controls pnlm-controls", j.zoomIn = o.createElement("div"), j.zoomIn.className = "pnlm-zoom-in pnlm-sprite pnlm-control", j.zoomIn.addEventListener("click", Or), j.zoom.appendChild(j.zoomIn), j.zoomOut = o.createElement("div"), j.zoomOut.className = "pnlm-zoom-out pnlm-sprite pnlm-control", j.zoomOut.addEventListener("click", Hr), j.zoom.appendChild(j.zoomOut), j.container.appendChild(j.zoom), j.fullscreen = o.createElement("div"), j.fullscreen.addEventListener("click", _t), j.fullscreen.className = "pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control", (o.fullscreenEnabled || o.mozFullScreenEnabled || o.webkitFullscreenEnabled || o.msFullscreenEnabled) && j.container.appendChild(j.fullscreen), j.orientation = o.createElement("div"), j.orientation.addEventListener("click", function(r) {
|
|
2582
|
+
V ? pt() : Ct();
|
|
2573
2583
|
}), j.orientation.addEventListener("mousedown", function(r) {
|
|
2574
2584
|
r.stopPropagation();
|
|
2575
2585
|
}), j.orientation.addEventListener("touchstart", function(r) {
|
|
@@ -2579,11 +2589,11 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2579
2589
|
}), j.orientation.className = "pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";
|
|
2580
2590
|
var Te, Ye = !1;
|
|
2581
2591
|
function Ve(r) {
|
|
2582
|
-
t.removeEventListener("deviceorientation", Ve), r && r.alpha !== null && r.beta !== null && r.gamma !== null ? (j.container.appendChild(j.orientation), Te = !0, Ye &&
|
|
2592
|
+
t.removeEventListener("deviceorientation", Ve), r && r.alpha !== null && r.beta !== null && r.gamma !== null ? (j.container.appendChild(j.orientation), Te = !0, Ye && Ct()) : Te = !1;
|
|
2583
2593
|
}
|
|
2584
2594
|
t.DeviceOrientationEvent ? t.addEventListener("deviceorientation", Ve) : Te = !1;
|
|
2585
2595
|
var we = o.createElement("div");
|
|
2586
|
-
we.className = "pnlm-compass pnlm-controls pnlm-control", F.appendChild(we), u.firstScene ?
|
|
2596
|
+
we.className = "pnlm-compass pnlm-controls pnlm-control", F.appendChild(we), u.firstScene ? xt(u.firstScene) : u.default && u.default.firstScene ? xt(u.default.firstScene) : xt(null), kt(!0);
|
|
2587
2597
|
function l() {
|
|
2588
2598
|
var r = o.createElement("div");
|
|
2589
2599
|
if (r.innerHTML = "<!--[if lte IE 9]><i></i><![endif]-->", r.getElementsByTagName("i").length == 1) {
|
|
@@ -2653,7 +2663,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2653
2663
|
return new RegExp("^(?:[a-z]+:)?//", "i").test(r) || r[0] == "/" || r.slice(0, 5) == "blob:";
|
|
2654
2664
|
}
|
|
2655
2665
|
function Q() {
|
|
2656
|
-
E || (E = new libpannellum.renderer(te)), y || (y = !0, K.addEventListener("mousedown", xe, !1), o.addEventListener("mousemove", He, !1), o.addEventListener("mouseup", ge, !1), e.mouseZoom && (F.addEventListener("mousewheel", Xe, !1), F.addEventListener("DOMMouseScroll", Xe, !1)), e.doubleClickZoom && K.addEventListener("dblclick",
|
|
2666
|
+
E || (E = new libpannellum.renderer(te)), y || (y = !0, K.addEventListener("mousedown", xe, !1), o.addEventListener("mousemove", He, !1), o.addEventListener("mouseup", ge, !1), e.mouseZoom && (F.addEventListener("mousewheel", Xe, !1), F.addEventListener("DOMMouseScroll", Xe, !1)), e.doubleClickZoom && K.addEventListener("dblclick", he, !1), F.addEventListener("mozfullscreenchange", ot, !1), F.addEventListener("webkitfullscreenchange", ot, !1), F.addEventListener("msfullscreenchange", ot, !1), F.addEventListener("fullscreenchange", ot, !1), t.addEventListener("resize", pe, !1), t.addEventListener("orientationchange", pe, !1), e.disableKeyboardCtrl || (c.addEventListener("keydown", De, !1), c.addEventListener("keyup", Ae, !1), c.addEventListener("blur", Ze, !1)), o.addEventListener("mouseleave", ge, !1), o.documentElement.style.pointerAction === "" && o.documentElement.style.touchAction === "" ? (K.addEventListener("pointerdown", We, !1), K.addEventListener("pointermove", ke, !1), K.addEventListener("pointerup", Se, !1), K.addEventListener("pointerleave", Se, !1)) : (K.addEventListener("touchstart", ye, !1), K.addEventListener("touchmove", Ce, !1), K.addEventListener("touchend", Pe, !1)), t.navigator.pointerEnabled && (c.style.touchAction = "none")), zr(), et(e.hfov), setTimeout(function() {
|
|
2657
2667
|
}, 500);
|
|
2658
2668
|
}
|
|
2659
2669
|
function oe(r) {
|
|
@@ -2685,10 +2695,10 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2685
2695
|
}), s.readAsBinaryString !== i ? s.readAsBinaryString(r) : s.readAsText(r);
|
|
2686
2696
|
}
|
|
2687
2697
|
function ee(r) {
|
|
2688
|
-
r === i && (r = e.strings.genericWebGLError), M.errorMsg.innerHTML = "<p>" + r + "</p>", j.load.style.display = "none", M.load.box.style.display = "none", M.errorMsg.style.display = "table",
|
|
2698
|
+
r === i && (r = e.strings.genericWebGLError), M.errorMsg.innerHTML = "<p>" + r + "</p>", j.load.style.display = "none", M.load.box.style.display = "none", M.errorMsg.style.display = "table", p = !0, te.style.display = "none", at("error", r);
|
|
2689
2699
|
}
|
|
2690
2700
|
function g() {
|
|
2691
|
-
|
|
2701
|
+
p && (M.load.box.style.display = "none", M.errorMsg.style.display = "none", p = !1, at("errorcleared"));
|
|
2692
2702
|
}
|
|
2693
2703
|
function ae(r) {
|
|
2694
2704
|
var s = re(r);
|
|
@@ -2709,10 +2719,10 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2709
2719
|
var m = Ge(r);
|
|
2710
2720
|
console.log("Pitch: " + m[0] + ", Yaw: " + m[1] + ", Center Pitch: " + e.pitch + ", Center Yaw: " + e.yaw + ", HFOV: " + e.hfov);
|
|
2711
2721
|
}
|
|
2712
|
-
|
|
2722
|
+
yt(), pt(), e.roll = 0, I.hfov = 0, N = !0, L = Date.now(), h = s.x, n = s.y, P = e.yaw, _ = e.pitch, F.classList.add("pnlm-grabbing"), F.classList.remove("pnlm-grab"), at("mousedown", r), _e();
|
|
2713
2723
|
}
|
|
2714
2724
|
}
|
|
2715
|
-
function
|
|
2725
|
+
function he(r) {
|
|
2716
2726
|
if (e.minHfov === e.hfov)
|
|
2717
2727
|
v.setHfov(q, 1e3);
|
|
2718
2728
|
else {
|
|
@@ -2727,7 +2737,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2727
2737
|
function He(r) {
|
|
2728
2738
|
if (N && x) {
|
|
2729
2739
|
L = Date.now();
|
|
2730
|
-
var s = E.getCanvas(), m = s.clientWidth, W = s.clientHeight, Y = re(r), Z = (Math.atan(
|
|
2740
|
+
var s = E.getCanvas(), m = s.clientWidth, W = s.clientHeight, Y = re(r), Z = (Math.atan(h / m * 2 - 1) - Math.atan(Y.x / m * 2 - 1)) * 180 / Math.PI * e.hfov / 90 + P;
|
|
2731
2741
|
I.yaw = (Z - e.yaw) % 360 * 0.2, e.yaw = Z;
|
|
2732
2742
|
var be = 2 * Math.atan(Math.tan(e.hfov / 360 * Math.PI) * W / m) * 180 / Math.PI, fe = (Math.atan(Y.y / W * 2 - 1) - Math.atan(n / W * 2 - 1)) * 180 / Math.PI * be / 90 + _;
|
|
2733
2743
|
I.pitch = (fe - e.pitch) * 0.2, e.pitch = fe;
|
|
@@ -2738,11 +2748,11 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2738
2748
|
}
|
|
2739
2749
|
function ye(r) {
|
|
2740
2750
|
if (!(!x || !e.draggable)) {
|
|
2741
|
-
|
|
2751
|
+
yt(), pt(), e.roll = 0, I.hfov = 0;
|
|
2742
2752
|
var s = re(r.targetTouches[0]);
|
|
2743
|
-
if (
|
|
2753
|
+
if (h = s.x, n = s.y, r.targetTouches.length == 2) {
|
|
2744
2754
|
var m = re(r.targetTouches[1]);
|
|
2745
|
-
|
|
2755
|
+
h += (m.x - s.x) * 0.5, n += (m.y - s.y) * 0.5, b = Math.sqrt((s.x - m.x) * (s.x - m.x) + (s.y - m.y) * (s.y - m.y));
|
|
2746
2756
|
}
|
|
2747
2757
|
N = !0, L = Date.now(), P = e.yaw, _ = e.pitch, at("touchstart", r), _e();
|
|
2748
2758
|
}
|
|
@@ -2756,7 +2766,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2756
2766
|
var Z = Math.sqrt((s.x - Y.x) * (s.x - Y.x) + (s.y - Y.y) * (s.y - Y.y));
|
|
2757
2767
|
et(e.hfov + (b - Z) * 0.1), b = Z;
|
|
2758
2768
|
}
|
|
2759
|
-
var be = e.hfov / 360 * e.touchPanSpeedCoeffFactor, fe = (
|
|
2769
|
+
var be = e.hfov / 360 * e.touchPanSpeedCoeffFactor, fe = (h - m) * be + P;
|
|
2760
2770
|
I.yaw = (fe - e.yaw) % 360 * 0.2, e.yaw = fe;
|
|
2761
2771
|
var Me = (W - n) * be + _;
|
|
2762
2772
|
I.pitch = (Me - e.pitch) * 0.2, e.pitch = Me;
|
|
@@ -2786,12 +2796,12 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2786
2796
|
}
|
|
2787
2797
|
}
|
|
2788
2798
|
function Xe(r) {
|
|
2789
|
-
!x || e.mouseZoom == "fullscreenonly" && !C || (r.preventDefault(),
|
|
2799
|
+
!x || e.mouseZoom == "fullscreenonly" && !C || (r.preventDefault(), yt(), L = Date.now(), r.wheelDeltaY ? (et(e.hfov - r.wheelDeltaY * 0.05), I.hfov = r.wheelDelta < 0 ? 1 : -1) : r.wheelDelta ? (et(e.hfov - r.wheelDelta * 0.05), I.hfov = r.wheelDelta < 0 ? 1 : -1) : r.detail && (et(e.hfov + r.detail * 1.5), I.hfov = r.detail > 0 ? 1 : -1), _e());
|
|
2790
2800
|
}
|
|
2791
2801
|
function De(r) {
|
|
2792
|
-
|
|
2802
|
+
yt(), L = Date.now(), pt(), e.roll = 0;
|
|
2793
2803
|
var s = r.which || r.keycode;
|
|
2794
|
-
e.capturedKeyNumbers.indexOf(s) < 0 || (r.preventDefault(), s == 27 ? C &&
|
|
2804
|
+
e.capturedKeyNumbers.indexOf(s) < 0 || (r.preventDefault(), s == 27 ? C && _t() : Re(s, !0));
|
|
2795
2805
|
}
|
|
2796
2806
|
function Ze() {
|
|
2797
2807
|
for (var r = 0; r < 10; r++)
|
|
@@ -2888,7 +2898,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2888
2898
|
function A(r) {
|
|
2889
2899
|
return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
|
|
2890
2900
|
}
|
|
2891
|
-
function
|
|
2901
|
+
function pe() {
|
|
2892
2902
|
ot();
|
|
2893
2903
|
}
|
|
2894
2904
|
function _e() {
|
|
@@ -2986,7 +2996,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
2986
2996
|
var be = o.createElement("img");
|
|
2987
2997
|
be.src = ut(Z), be.style.width = r.width + "px", be.style.paddingTop = "5px", te.appendChild(s), W.appendChild(be), m.style.maxWidth = "initial";
|
|
2988
2998
|
} else r.URL ? (W = o.createElement("a"), W.href = ut(r.URL), W.target = "_blank", te.appendChild(W), s.className += " pnlm-pointer", m.className += " pnlm-pointer", W.appendChild(s)) : (r.sceneId && (s.onclick = s.ontouchend = function() {
|
|
2989
|
-
return s.clicked || (s.clicked = !0,
|
|
2999
|
+
return s.clicked || (s.clicked = !0, Tt(r.sceneId, r.targetPitch, r.targetYaw, r.targetHfov)), !1;
|
|
2990
3000
|
}, s.className += " pnlm-pointer", m.className += " pnlm-pointer"), te.appendChild(s));
|
|
2991
3001
|
r.createTooltipFunc ? r.createTooltipFunc(s, r.createTooltipArgs) : (r.text || r.video || r.image) && (s.classList.add("pnlm-tooltip"), s.appendChild(m), m.style.width = m.scrollWidth - 20 + "px", m.style.marginLeft = -(m.scrollWidth - s.offsetWidth) / 2 + "px", m.style.marginTop = -m.scrollHeight - 12 + "px"), r.clickHandlerFunc && (s.addEventListener("click", function(fe) {
|
|
2992
3002
|
r.clickHandlerFunc(fe, r.clickHandlerArgs);
|
|
@@ -3015,14 +3025,14 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3015
3025
|
r.div.style.visibility = "visible";
|
|
3016
3026
|
var Oe = E.getCanvas(), ze = Oe.clientWidth, Je = Oe.clientHeight, $e = [-ze / Me * fe * m / be / 2, -ze / Me * (s * Y - m * Z * W) / be / 2], it = Math.sin(e.roll * Math.PI / 180), Gt = Math.cos(e.roll * Math.PI / 180);
|
|
3017
3027
|
$e = [$e[0] * Gt - $e[1] * it, $e[0] * it + $e[1] * Gt], $e[0] += (ze - r.div.offsetWidth) / 2, $e[1] += (Je - r.div.offsetHeight) / 2;
|
|
3018
|
-
var
|
|
3019
|
-
r.div.style.webkitTransform =
|
|
3028
|
+
var St = "translate(" + $e[0] + "px, " + $e[1] + "px) translateZ(9999px) rotate(" + e.roll + "deg)";
|
|
3029
|
+
r.div.style.webkitTransform = St, r.div.style.MozTransform = St, r.div.style.transform = St;
|
|
3020
3030
|
}
|
|
3021
3031
|
}
|
|
3022
3032
|
function Zt() {
|
|
3023
3033
|
e.hotSpots.forEach(Xt);
|
|
3024
3034
|
}
|
|
3025
|
-
function
|
|
3035
|
+
function xt(r) {
|
|
3026
3036
|
e = {};
|
|
3027
3037
|
var s, m, W = ["haov", "vaov", "vOffset", "northOffset", "horizonPitch", "horizonRoll"];
|
|
3028
3038
|
J = [];
|
|
@@ -3054,7 +3064,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3054
3064
|
else
|
|
3055
3065
|
e[s] = u[s], W.indexOf(s) >= 0 && J.push(s);
|
|
3056
3066
|
}
|
|
3057
|
-
function
|
|
3067
|
+
function kt(r) {
|
|
3058
3068
|
if (r = r || !1, r && "preview" in e) {
|
|
3059
3069
|
var s = e.preview;
|
|
3060
3070
|
e.basePath && !f(s) && (s = e.basePath + s), k = o.createElement("div"), k.className = "pnlm-preview-img", k.style.backgroundImage = "url('" + Ur(s) + "')", te.appendChild(k);
|
|
@@ -3095,13 +3105,13 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3095
3105
|
e[Y] || (j.orientation.style.display = "none", j.zoom.style.display = "none", j.fullscreen.style.display = "none");
|
|
3096
3106
|
break;
|
|
3097
3107
|
case "orientationOnByDefault":
|
|
3098
|
-
e[Y] && (Te === i ? Ye = !0 : Te === !0 &&
|
|
3108
|
+
e[Y] && (Te === i ? Ye = !0 : Te === !0 && Ct());
|
|
3099
3109
|
break;
|
|
3100
3110
|
}
|
|
3101
3111
|
r && (m ? e.title = m : delete e.title, W ? e.author = W : delete e.author);
|
|
3102
3112
|
}
|
|
3103
|
-
function
|
|
3104
|
-
if (x && !
|
|
3113
|
+
function _t() {
|
|
3114
|
+
if (x && !p)
|
|
3105
3115
|
if (C)
|
|
3106
3116
|
o.exitFullscreen ? o.exitFullscreen() : o.mozCancelFullScreen ? o.mozCancelFullScreen() : o.webkitCancelFullScreen ? o.webkitCancelFullScreen() : o.msExitFullscreen && o.msExitFullscreen();
|
|
3107
3117
|
else
|
|
@@ -3134,30 +3144,30 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3134
3144
|
function et(r) {
|
|
3135
3145
|
e.hfov = Vt(r);
|
|
3136
3146
|
}
|
|
3137
|
-
function
|
|
3147
|
+
function yt() {
|
|
3138
3148
|
U = {}, R = e.autoRotate ? e.autoRotate : R, e.autoRotate = !1;
|
|
3139
3149
|
}
|
|
3140
3150
|
function Yt() {
|
|
3141
3151
|
g(), x = !1, j.load.style.display = "none", M.load.box.style.display = "inline", l();
|
|
3142
3152
|
}
|
|
3143
|
-
function
|
|
3153
|
+
function Tt(r, s, m, W, Y) {
|
|
3144
3154
|
x = !1, U = {};
|
|
3145
3155
|
var Z, be, fe, Me;
|
|
3146
3156
|
if (e.sceneFadeDuration && !Y) {
|
|
3147
3157
|
var Oe = E.render(e.pitch * Math.PI / 180, e.yaw * Math.PI / 180, e.hfov * Math.PI / 180, { returnImage: !0 });
|
|
3148
3158
|
if (Oe !== i) {
|
|
3149
3159
|
Z = new Image(), Z.className = "pnlm-fade-img", Z.style.transition = "opacity " + e.sceneFadeDuration / 1e3 + "s", Z.style.width = "100%", Z.style.height = "100%", Z.onload = function() {
|
|
3150
|
-
|
|
3160
|
+
Tt(r, s, m, W, !0);
|
|
3151
3161
|
}, Z.src = Oe, te.appendChild(Z), E.fadeImg = Z;
|
|
3152
3162
|
return;
|
|
3153
3163
|
}
|
|
3154
3164
|
}
|
|
3155
|
-
s === "same" ? be = e.pitch : be = s, m === "same" ? fe = e.yaw : m === "sameAzimuth" ? fe = e.yaw + (e.northOffset || 0) - (u.scenes[r].northOffset || 0) : fe = m, W === "same" ? Me = e.hfov : Me = W, Fr(),
|
|
3165
|
+
s === "same" ? be = e.pitch : be = s, m === "same" ? fe = e.yaw : m === "sameAzimuth" ? fe = e.yaw + (e.northOffset || 0) - (u.scenes[r].northOffset || 0) : fe = m, W === "same" ? Me = e.hfov : Me = W, Fr(), xt(r), I.yaw = I.pitch = I.hfov = 0, kt(), be !== i && (e.pitch = be), fe !== i && (e.yaw = fe), Me !== i && (e.hfov = Me), at("scenechange", r), Yt();
|
|
3156
3166
|
}
|
|
3157
|
-
function
|
|
3167
|
+
function pt() {
|
|
3158
3168
|
t.removeEventListener("deviceorientation", Bt), j.orientation.classList.remove("pnlm-orientation-button-active"), V = !1;
|
|
3159
3169
|
}
|
|
3160
|
-
function
|
|
3170
|
+
function Ct() {
|
|
3161
3171
|
V = 1, t.addEventListener("deviceorientation", Bt), j.orientation.classList.add("pnlm-orientation-button-active");
|
|
3162
3172
|
}
|
|
3163
3173
|
function ct(r) {
|
|
@@ -3243,7 +3253,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3243
3253
|
}, this.mouseEventToCoords = function(r) {
|
|
3244
3254
|
return Ge(r);
|
|
3245
3255
|
}, this.loadScene = function(r, s, m, W) {
|
|
3246
|
-
return x !== !1 &&
|
|
3256
|
+
return x !== !1 && Tt(r, s, m, W), this;
|
|
3247
3257
|
}, this.getScene = function() {
|
|
3248
3258
|
return e.scene;
|
|
3249
3259
|
}, this.addScene = function(r, s) {
|
|
@@ -3251,7 +3261,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3251
3261
|
}, this.removeScene = function(r) {
|
|
3252
3262
|
return e.scene === r || !u.scenes.hasOwnProperty(r) ? !1 : (delete u.scenes[r], !0);
|
|
3253
3263
|
}, this.toggleFullscreen = function() {
|
|
3254
|
-
return
|
|
3264
|
+
return _t(), this;
|
|
3255
3265
|
}, this.getConfig = function() {
|
|
3256
3266
|
return e;
|
|
3257
3267
|
}, this.getContainer = function() {
|
|
@@ -3286,15 +3296,15 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3286
3296
|
} else
|
|
3287
3297
|
return !1;
|
|
3288
3298
|
}, this.resize = function() {
|
|
3289
|
-
E &&
|
|
3299
|
+
E && pe();
|
|
3290
3300
|
}, this.isLoaded = function() {
|
|
3291
3301
|
return x;
|
|
3292
3302
|
}, this.isOrientationSupported = function() {
|
|
3293
3303
|
return Te || !1;
|
|
3294
3304
|
}, this.stopOrientation = function() {
|
|
3295
|
-
|
|
3305
|
+
pt();
|
|
3296
3306
|
}, this.startOrientation = function() {
|
|
3297
|
-
Te &&
|
|
3307
|
+
Te && Ct();
|
|
3298
3308
|
}, this.isOrientationActive = function() {
|
|
3299
3309
|
return !!V;
|
|
3300
3310
|
}, this.on = function(r, s) {
|
|
@@ -3315,7 +3325,7 @@ window.pannellum = /* @__PURE__ */ (function(t, o, i) {
|
|
|
3315
3325
|
D[r][D[r].length - s].apply(null, [].slice.call(arguments, 1));
|
|
3316
3326
|
}
|
|
3317
3327
|
this.destroy = function() {
|
|
3318
|
-
E && E.destroy(), y && (K.removeEventListener("mousedown", xe, !1), K.removeEventListener("dblclick",
|
|
3328
|
+
E && E.destroy(), y && (K.removeEventListener("mousedown", xe, !1), K.removeEventListener("dblclick", he, !1), o.removeEventListener("mousemove", He, !1), o.removeEventListener("mouseup", ge, !1), c.removeEventListener("mousewheel", Xe, !1), c.removeEventListener("DOMMouseScroll", Xe, !1), c.removeEventListener("mozfullscreenchange", ot, !1), c.removeEventListener("webkitfullscreenchange", ot, !1), c.removeEventListener("msfullscreenchange", ot, !1), c.removeEventListener("fullscreenchange", ot, !1), t.removeEventListener("resize", pe, !1), t.removeEventListener("orientationchange", pe, !1), c.removeEventListener("keydown", De, !1), c.removeEventListener("keyup", Ae, !1), c.removeEventListener("blur", Ze, !1), o.removeEventListener("mouseleave", ge, !1), K.removeEventListener("touchstart", ye, !1), K.removeEventListener("touchmove", Ce, !1), K.removeEventListener("touchend", Pe, !1), K.removeEventListener("pointerdown", We, !1), K.removeEventListener("pointermove", ke, !1), K.removeEventListener("pointerup", Se, !1), K.removeEventListener("pointerleave", Se, !1)), c.innerHTML = "", c.classList.remove("pnlm-container"), F.classList.remove("pnlm-grab"), F.classList.remove("pnlm-grabbing");
|
|
3319
3329
|
};
|
|
3320
3330
|
}
|
|
3321
3331
|
return {
|
|
@@ -3347,7 +3357,7 @@ function eo(t, o, i) {
|
|
|
3347
3357
|
yaw: Jn,
|
|
3348
3358
|
hfov: Kn,
|
|
3349
3359
|
maxHfov: ft,
|
|
3350
|
-
minHfov:
|
|
3360
|
+
minHfov: gt,
|
|
3351
3361
|
compass: !1,
|
|
3352
3362
|
showControls: !1,
|
|
3353
3363
|
keyboardZoom: !1,
|
|
@@ -3450,7 +3460,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3450
3460
|
)
|
|
3451
3461
|
] }) });
|
|
3452
3462
|
}, oo = (t) => {
|
|
3453
|
-
const { itemIndex: o, src: i, poster: d, onLoaded: c, onError: u, onlyPreload: v } = t, { autoLoadInterior360: e } = je(), { isShowingDetails: E, zoom: k, setZoom: N } = Ke(), [L,
|
|
3463
|
+
const { itemIndex: o, src: i, poster: d, onLoaded: c, onError: u, onlyPreload: v } = t, { autoLoadInterior360: e } = je(), { isShowingDetails: E, zoom: k, setZoom: N } = Ke(), [L, h] = Qn(i), n = Le(null), [b, P] = Ie(!1), [_, w] = Ie(e);
|
|
3454
3464
|
ve(() => {
|
|
3455
3465
|
e && w(!0);
|
|
3456
3466
|
}, [e]);
|
|
@@ -3458,7 +3468,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3458
3468
|
c?.(), P(!0);
|
|
3459
3469
|
}, [c]), x = G((T) => {
|
|
3460
3470
|
T instanceof MouseEvent && T.button !== 0 || (T.preventDefault(), T.stopPropagation(), T.stopImmediatePropagation());
|
|
3461
|
-
}, []),
|
|
3471
|
+
}, []), p = G(() => {
|
|
3462
3472
|
w(!0);
|
|
3463
3473
|
}, []), y = eo(
|
|
3464
3474
|
n,
|
|
@@ -3477,8 +3487,8 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3477
3487
|
const T = y.current;
|
|
3478
3488
|
if (!T || !b) return;
|
|
3479
3489
|
const $ = 1, I = tt((k - $) / (st - $), 0, 1), X = tt(
|
|
3480
|
-
ft - I * (ft -
|
|
3481
|
-
|
|
3490
|
+
ft - I * (ft - gt),
|
|
3491
|
+
gt,
|
|
3482
3492
|
ft
|
|
3483
3493
|
);
|
|
3484
3494
|
T.setHfov(X);
|
|
@@ -3492,7 +3502,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3492
3502
|
if (!z) return;
|
|
3493
3503
|
const H = jt(
|
|
3494
3504
|
z.getHfov(),
|
|
3495
|
-
|
|
3505
|
+
gt,
|
|
3496
3506
|
ft,
|
|
3497
3507
|
st,
|
|
3498
3508
|
dt
|
|
@@ -3504,7 +3514,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3504
3514
|
if (!z) return;
|
|
3505
3515
|
const H = jt(
|
|
3506
3516
|
z.getHfov(),
|
|
3507
|
-
|
|
3517
|
+
gt,
|
|
3508
3518
|
ft,
|
|
3509
3519
|
st,
|
|
3510
3520
|
dt,
|
|
@@ -3534,10 +3544,10 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3534
3544
|
no,
|
|
3535
3545
|
{
|
|
3536
3546
|
isPannellumLoaded: b,
|
|
3537
|
-
isLoading:
|
|
3547
|
+
isLoading: h,
|
|
3538
3548
|
progress: L,
|
|
3539
3549
|
autoloadInterior360: e,
|
|
3540
|
-
loadScene:
|
|
3550
|
+
loadScene: p,
|
|
3541
3551
|
itemIndex: o
|
|
3542
3552
|
}
|
|
3543
3553
|
)
|
|
@@ -3555,7 +3565,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3555
3565
|
return ve(() => {
|
|
3556
3566
|
d === null || d === "error" || i(o, d === "spin" ? "running" : "ready");
|
|
3557
3567
|
}, [o, i, d]), d === "error" ? /* @__PURE__ */ a(
|
|
3558
|
-
|
|
3568
|
+
It,
|
|
3559
3569
|
{
|
|
3560
3570
|
className: "text-background",
|
|
3561
3571
|
text: "Interior Spin could not be loaded"
|
|
@@ -3580,11 +3590,11 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3580
3590
|
strokeLinejoin: "round",
|
|
3581
3591
|
children: /* @__PURE__ */ a("polygon", { points: "6 3 20 12 6 21 6 3" })
|
|
3582
3592
|
}
|
|
3583
|
-
) }), io = 750, so = 1250, lo = 360, co = 480, uo = (t, o, i) => ({ cursor: `url("${t}") ${o.x} ${o.y}, ${i}` }),
|
|
3584
|
-
const { demoSpin: d, reverse360: c, spinCursor: u, themeConfig: v } = je(), { currentItemHotspotsVisible: e, isShowingDetails: E, isZooming: k } = Ke(), N = Ue(() =>
|
|
3593
|
+
) }), io = 750, so = 1250, lo = 360, co = 480, uo = (t, o, i) => ({ cursor: `url("${t}") ${o.x} ${o.y}, ${i}` }), ho = ({ images: t, itemIndex: o, onlyPreload: i }) => {
|
|
3594
|
+
const { demoSpin: d, reverse360: c, spinCursor: u, themeConfig: v } = je(), { currentItemHotspotsVisible: e, isShowingDetails: E, isZooming: k } = Ke(), N = Ue(() => wt(v), [v]), L = k || E, h = Le(null), n = Le(null), [b, P] = Ie(!1), [_, w] = Ie("default"), C = u === "grab" && b ? "grabbing" : u, x = N?.cursor ? (() => {
|
|
3585
3595
|
const te = _ === "left" ? "leftSpin" : _ === "right" ? "rightSpin" : "default", K = N.cursor[te];
|
|
3586
3596
|
return uo(K.url, K.hotspot, C);
|
|
3587
|
-
})() : C === Dt ? { cursor: `url("${Sr}") 45 28, ew-resize` } : { cursor: C },
|
|
3597
|
+
})() : C === Dt ? { cursor: `url("${Sr}") 45 28, ew-resize` } : { cursor: C }, p = Le(0), y = Le(null), [T, $] = Ie(0), I = Le(null), X = Le(null), V = Le(null), z = Le(0), H = 16, R = Le({
|
|
3588
3598
|
timestamps: new Float64Array(10),
|
|
3589
3599
|
values: new Float64Array(10),
|
|
3590
3600
|
index: 0,
|
|
@@ -3595,19 +3605,19 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3595
3605
|
D.current && (cancelAnimationFrame(D.current), D.current = null);
|
|
3596
3606
|
}, S = t.length, B = G(
|
|
3597
3607
|
(te) => {
|
|
3598
|
-
const K =
|
|
3608
|
+
const K = p.current;
|
|
3599
3609
|
if (K === te) return;
|
|
3600
3610
|
const ne = y.current;
|
|
3601
|
-
ne && (ne.src = t[te].src),
|
|
3611
|
+
ne && (ne.src = t[te].src), p.current = te;
|
|
3602
3612
|
const M = !!t[K]?.hotspots?.length, le = !!t[te]?.hotspots?.length;
|
|
3603
3613
|
(M || le) && $(te);
|
|
3604
3614
|
},
|
|
3605
3615
|
[t]
|
|
3606
3616
|
), ie = G(() => {
|
|
3607
|
-
const te = (
|
|
3617
|
+
const te = (p.current + 1) % S;
|
|
3608
3618
|
B(te);
|
|
3609
3619
|
}, [S, B]), F = G(() => {
|
|
3610
|
-
const te = (
|
|
3620
|
+
const te = (p.current - 1 + S) % S;
|
|
3611
3621
|
B(te);
|
|
3612
3622
|
}, [S, B]);
|
|
3613
3623
|
return ve(() => {
|
|
@@ -3615,7 +3625,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3615
3625
|
U();
|
|
3616
3626
|
return;
|
|
3617
3627
|
}
|
|
3618
|
-
const te =
|
|
3628
|
+
const te = h.current, K = n.current;
|
|
3619
3629
|
if (!te || !K)
|
|
3620
3630
|
return;
|
|
3621
3631
|
q.current && (q.current = !1, ce.current = setTimeout(() => {
|
|
@@ -3707,7 +3717,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3707
3717
|
if (ye === null || Ce === null) return;
|
|
3708
3718
|
const Pe = ye - Ce;
|
|
3709
3719
|
Pe !== 0 && N?.cursor && w(Pe < 0 ? "left" : "right"), !(Math.abs(Pe) < ne) && (Pe > 0 !== c ? ie() : F(), V.current = ye, M = ye);
|
|
3710
|
-
},
|
|
3720
|
+
}, he = (ge) => {
|
|
3711
3721
|
if (re !== null || ge.changedTouches.length !== 1)
|
|
3712
3722
|
return;
|
|
3713
3723
|
Ve(), P(!0), w("default"), I.current !== null && (cancelAnimationFrame(I.current), I.current = null);
|
|
@@ -3740,8 +3750,8 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3740
3750
|
}
|
|
3741
3751
|
ye && (I.current !== null && (cancelAnimationFrame(I.current), I.current = null), re = null, M = null, V.current = null, X.current = null, P(!1), w("default"), Ye());
|
|
3742
3752
|
};
|
|
3743
|
-
return K.addEventListener("touchstart",
|
|
3744
|
-
J(), P(!1), I.current !== null && (cancelAnimationFrame(I.current), I.current = null), te.removeEventListener("mousedown", we), document.removeEventListener("mousemove", l), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseup", f), document.removeEventListener("contextmenu", f), K.removeEventListener("scroll", ae), K.removeEventListener("touchstart",
|
|
3753
|
+
return K.addEventListener("touchstart", he, { passive: !1 }), K.addEventListener("touchmove", Ge, { passive: !1 }), K.addEventListener("touchend", He), K.addEventListener("touchcancel", He), () => {
|
|
3754
|
+
J(), P(!1), I.current !== null && (cancelAnimationFrame(I.current), I.current = null), te.removeEventListener("mousedown", we), document.removeEventListener("mousemove", l), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseup", f), document.removeEventListener("contextmenu", f), K.removeEventListener("scroll", ae), K.removeEventListener("touchstart", he), K.removeEventListener("touchmove", Ge), K.removeEventListener("touchend", He), K.removeEventListener("touchcancel", He);
|
|
3745
3755
|
};
|
|
3746
3756
|
}, [
|
|
3747
3757
|
U,
|
|
@@ -3752,7 +3762,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3752
3762
|
N,
|
|
3753
3763
|
S,
|
|
3754
3764
|
B
|
|
3755
|
-
]), /* @__PURE__ */ a("div", { ref:
|
|
3765
|
+
]), /* @__PURE__ */ a("div", { ref: h, style: x, children: /* @__PURE__ */ me("div", { ref: n, className: " overflow-x-scroll", children: [
|
|
3756
3766
|
/* @__PURE__ */ a("div", { className: "sticky left-0 top-0", children: /* @__PURE__ */ me("div", { className: "relative", children: [
|
|
3757
3767
|
/* @__PURE__ */ a(
|
|
3758
3768
|
"img",
|
|
@@ -3784,7 +3794,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3784
3794
|
onSpinImagesLoaded: d,
|
|
3785
3795
|
onError: c
|
|
3786
3796
|
}) => {
|
|
3787
|
-
const { autoLoad360: u, emitAnalyticsEvent: v, themeConfig: e } = je(), { displayedCategoryId: E, displayedCategoryName: k } = Ke(), N = Ue(() =>
|
|
3797
|
+
const { autoLoad360: u, emitAnalyticsEvent: v, themeConfig: e } = je(), { displayedCategoryId: E, displayedCategoryName: k } = Ke(), N = Ue(() => wt(e), [e]), L = Ue(() => o.map(({ src: C }) => C), [o]), [h, n] = Ie(null), b = h ? [...h.values()].filter((C) => C).length / o.length * 100 : null, P = G(
|
|
3788
3798
|
(C) => {
|
|
3789
3799
|
b === null && (n(new Map(L.map((x) => [x, !1]))), v({
|
|
3790
3800
|
type: "interaction",
|
|
@@ -3813,8 +3823,8 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3813
3823
|
P("click");
|
|
3814
3824
|
}, [P]), w = G((C) => {
|
|
3815
3825
|
n((x) => {
|
|
3816
|
-
const
|
|
3817
|
-
return
|
|
3826
|
+
const p = new Map(x);
|
|
3827
|
+
return p.set(C, !0), p;
|
|
3818
3828
|
});
|
|
3819
3829
|
}, []);
|
|
3820
3830
|
return ve(() => {
|
|
@@ -3872,14 +3882,14 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3872
3882
|
)
|
|
3873
3883
|
] })
|
|
3874
3884
|
] });
|
|
3875
|
-
},
|
|
3885
|
+
}, po = (t) => {
|
|
3876
3886
|
const { itemIndex: o } = t, { setItemInteraction: i } = Ke(), [d, c] = Ie(
|
|
3877
3887
|
null
|
|
3878
3888
|
);
|
|
3879
3889
|
return ve(() => {
|
|
3880
3890
|
d === null || d === "error" || i(o, d === "spin" ? "running" : "ready");
|
|
3881
3891
|
}, [o, i, d]), d === "error" ? /* @__PURE__ */ a(
|
|
3882
|
-
|
|
3892
|
+
It,
|
|
3883
3893
|
{
|
|
3884
3894
|
className: "text-background",
|
|
3885
3895
|
text: "Spin could not be loaded"
|
|
@@ -3892,15 +3902,15 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3892
3902
|
onSpinImagesLoaded: () => c("spin"),
|
|
3893
3903
|
onError: () => c("error")
|
|
3894
3904
|
}
|
|
3895
|
-
) : /* @__PURE__ */ a(
|
|
3905
|
+
) : /* @__PURE__ */ a(ho, { ...t });
|
|
3896
3906
|
}, mo = 750, go = 1250, vo = 360, wo = 480, xo = (t, o, i) => ({ cursor: `url("${t}") ${o.x} ${o.y}, ${i}` }), yo = ({
|
|
3897
3907
|
images: t,
|
|
3898
3908
|
onlyPreload: o
|
|
3899
3909
|
}) => {
|
|
3900
|
-
const { demoSpin: i, reverse360: d, spinCursor: c, themeConfig: u } = je(), { isShowingDetails: v, isZooming: e } = Ke(), E = Ue(() =>
|
|
3910
|
+
const { demoSpin: i, reverse360: d, spinCursor: c, themeConfig: u } = je(), { isShowingDetails: v, isZooming: e } = Ke(), E = Ue(() => wt(u), [u]), k = e || v, N = Le(null), L = Le(null), [h, n] = Ie(!1), [b, P] = Ie("default"), _ = c === "grab" && h ? "grabbing" : c, w = E?.cursor ? (() => {
|
|
3901
3911
|
const H = b === "left" ? "leftSpin" : b === "right" ? "rightSpin" : "default", R = E.cursor[H];
|
|
3902
3912
|
return xo(R.url, R.hotspot, _);
|
|
3903
|
-
})() : _ === Dt ? { cursor: `url("${Sr}") 45 28, ew-resize` } : { cursor: _ }, C = Le(i), x = Le(null),
|
|
3913
|
+
})() : _ === Dt ? { cursor: `url("${Sr}") 45 28, ew-resize` } : { cursor: _ }, C = Le(i), x = Le(null), p = G(() => {
|
|
3904
3914
|
x.current && (clearTimeout(x.current), x.current = null);
|
|
3905
3915
|
}, []), y = Le(null), T = () => {
|
|
3906
3916
|
y.current && (cancelAnimationFrame(y.current), y.current = null);
|
|
@@ -3911,7 +3921,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3911
3921
|
}, [X]);
|
|
3912
3922
|
return ve(() => {
|
|
3913
3923
|
if (k) {
|
|
3914
|
-
|
|
3924
|
+
p();
|
|
3915
3925
|
return;
|
|
3916
3926
|
}
|
|
3917
3927
|
const H = N.current, R = L.current;
|
|
@@ -3944,8 +3954,8 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3944
3954
|
let f = 0, Q = l;
|
|
3945
3955
|
const oe = () => {
|
|
3946
3956
|
const ee = () => {
|
|
3947
|
-
const g = Date.now(), ae = (g - l) / 1e3, re = Math.pow(0.05, ae), xe = we * re,
|
|
3948
|
-
if (f += xe *
|
|
3957
|
+
const g = Date.now(), ae = (g - l) / 1e3, re = Math.pow(0.05, ae), xe = we * re, he = (g - Q) / 1e3;
|
|
3958
|
+
if (f += xe * he, Math.abs(xe) < 5 * q && Math.abs(f) < q) {
|
|
3949
3959
|
y.current = null;
|
|
3950
3960
|
return;
|
|
3951
3961
|
}
|
|
@@ -3955,7 +3965,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
3955
3965
|
};
|
|
3956
3966
|
oe();
|
|
3957
3967
|
}, S = () => {
|
|
3958
|
-
|
|
3968
|
+
p(), T();
|
|
3959
3969
|
};
|
|
3960
3970
|
n(!1);
|
|
3961
3971
|
const B = (we) => {
|
|
@@ -4015,7 +4025,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4015
4025
|
n(!1), H.removeEventListener("mousedown", B), document.removeEventListener("mousemove", ie), document.removeEventListener("mouseleave", F), document.removeEventListener("mouseup", F), document.removeEventListener("contextmenu", F), R.removeEventListener("scroll", le), R.removeEventListener("touchstart", Te), R.removeEventListener("touchmove", Ye), R.removeEventListener("touchend", Ve), R.removeEventListener("touchcancel", Ve);
|
|
4016
4026
|
};
|
|
4017
4027
|
}, [
|
|
4018
|
-
|
|
4028
|
+
p,
|
|
4019
4029
|
z,
|
|
4020
4030
|
V,
|
|
4021
4031
|
k,
|
|
@@ -4050,7 +4060,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4050
4060
|
onSpinImagesLoaded: d,
|
|
4051
4061
|
onError: c
|
|
4052
4062
|
}) => {
|
|
4053
|
-
const { autoLoad360: u, emitAnalyticsEvent: v, themeConfig: e } = je(), { displayedCategoryId: E, displayedCategoryName: k } = Ke(), N = Ue(() =>
|
|
4063
|
+
const { autoLoad360: u, emitAnalyticsEvent: v, themeConfig: e } = je(), { displayedCategoryId: E, displayedCategoryName: k } = Ke(), N = Ue(() => wt(e), [e]), L = Ue(() => o.map(({ src: C }) => C), [o]), [h, n] = Ie(null), b = h ? [...h.values()].filter((C) => C).length / o.length * 100 : null, P = G(
|
|
4054
4064
|
(C) => {
|
|
4055
4065
|
b === null && (n(new Map(L.map((x) => [x, !1]))), v({
|
|
4056
4066
|
type: "interaction",
|
|
@@ -4079,8 +4089,8 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4079
4089
|
P("click");
|
|
4080
4090
|
}, [P]), w = G((C) => {
|
|
4081
4091
|
n((x) => {
|
|
4082
|
-
const
|
|
4083
|
-
return
|
|
4092
|
+
const p = new Map(x);
|
|
4093
|
+
return p.set(C, !0), p;
|
|
4084
4094
|
});
|
|
4085
4095
|
}, []);
|
|
4086
4096
|
return ve(() => {
|
|
@@ -4143,7 +4153,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4143
4153
|
return ve(() => {
|
|
4144
4154
|
d === null || d === "error" || i(o, d === "spin" ? "running" : "ready");
|
|
4145
4155
|
}, [o, i, d]), d === "error" ? /* @__PURE__ */ a(
|
|
4146
|
-
|
|
4156
|
+
It,
|
|
4147
4157
|
{
|
|
4148
4158
|
className: "text-background",
|
|
4149
4159
|
text: "Spin could not be loaded"
|
|
@@ -4231,7 +4241,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4231
4241
|
ve(() => {
|
|
4232
4242
|
d === i || k();
|
|
4233
4243
|
}, [d, i, k]);
|
|
4234
|
-
const [N, L] = Ie(!1), [
|
|
4244
|
+
const [N, L] = Ie(!1), [h, n] = Ie(!0), b = () => {
|
|
4235
4245
|
L(!0), c(i, "running");
|
|
4236
4246
|
}, P = () => {
|
|
4237
4247
|
L(!1), c(i, "ready");
|
|
@@ -4239,7 +4249,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4239
4249
|
n(!1);
|
|
4240
4250
|
}, w = () => {
|
|
4241
4251
|
n(!0);
|
|
4242
|
-
}, [C, x] = Ie(null),
|
|
4252
|
+
}, [C, x] = Ie(null), p = (U) => {
|
|
4243
4253
|
const D = e(), J = U.currentTarget.getBoundingClientRect(), B = (U.clientX - J.left) / J.width, ie = Math.min(1, Math.max(0, B));
|
|
4244
4254
|
D.volume = ie, D.muted = !1;
|
|
4245
4255
|
}, y = (U) => {
|
|
@@ -4372,7 +4382,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4372
4382
|
"div",
|
|
4373
4383
|
{
|
|
4374
4384
|
className: `w-12 cursor-pointer py-1 opacity-0 transition-opacity ${C.isMuted ? "group-hover/volume:opacity-50" : "group-hover/volume:opacity-100"}`,
|
|
4375
|
-
onClick:
|
|
4385
|
+
onClick: p,
|
|
4376
4386
|
children: /* @__PURE__ */ a(Jt, { progress: C.volume })
|
|
4377
4387
|
}
|
|
4378
4388
|
),
|
|
@@ -4399,7 +4409,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4399
4409
|
]
|
|
4400
4410
|
}
|
|
4401
4411
|
),
|
|
4402
|
-
|
|
4412
|
+
h && /* @__PURE__ */ a(
|
|
4403
4413
|
"div",
|
|
4404
4414
|
{
|
|
4405
4415
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center bg-foreground/25",
|
|
@@ -4428,7 +4438,7 @@ const ro = ({ className: t }) => /* @__PURE__ */ a(
|
|
|
4428
4438
|
c = /* @__PURE__ */ a(bo, { itemIndex: t, onlyPreload: !i, ...o });
|
|
4429
4439
|
break;
|
|
4430
4440
|
case "next360":
|
|
4431
|
-
c = /* @__PURE__ */ a(
|
|
4441
|
+
c = /* @__PURE__ */ a(po, { itemIndex: t, onlyPreload: !i, ...o });
|
|
4432
4442
|
break;
|
|
4433
4443
|
case "interior-360":
|
|
4434
4444
|
c = /* @__PURE__ */ a(
|
|
@@ -4470,7 +4480,7 @@ const No = ({
|
|
|
4470
4480
|
aspectRatioStyle: k,
|
|
4471
4481
|
maxItemsShown: N = 1
|
|
4472
4482
|
}) => {
|
|
4473
|
-
const { isFullScreen: L, integration:
|
|
4483
|
+
const { isFullScreen: L, integration: h } = je(), n = () => E || (!h || L ? "centered" : "aside"), b = () => !!(c || u), P = () => !!d, _ = () => P() && !b(), w = n(), C = (x) => {
|
|
4474
4484
|
if (!k) return {};
|
|
4475
4485
|
switch (x) {
|
|
4476
4486
|
case "centered":
|
|
@@ -4606,7 +4616,7 @@ const No = ({
|
|
|
4606
4616
|
),
|
|
4607
4617
|
style: {
|
|
4608
4618
|
containerType: "inline-size",
|
|
4609
|
-
width:
|
|
4619
|
+
width: h ? `${100 / (L ? 1 : N)}%` : `${100 / N}%`
|
|
4610
4620
|
},
|
|
4611
4621
|
children: [
|
|
4612
4622
|
o,
|
|
@@ -4674,7 +4684,7 @@ const No = ({
|
|
|
4674
4684
|
),
|
|
4675
4685
|
style: {
|
|
4676
4686
|
containerType: "inline-size",
|
|
4677
|
-
width:
|
|
4687
|
+
width: h ? `${100 / (L ? 1 : N)}%` : `${100 / N}%`
|
|
4678
4688
|
},
|
|
4679
4689
|
children: [
|
|
4680
4690
|
o,
|
|
@@ -4846,7 +4856,7 @@ const No = ({
|
|
|
4846
4856
|
{
|
|
4847
4857
|
className: ue(
|
|
4848
4858
|
t,
|
|
4849
|
-
|
|
4859
|
+
ht("top-left"),
|
|
4850
4860
|
"flex gap-x-2 small:hidden"
|
|
4851
4861
|
),
|
|
4852
4862
|
children: [
|
|
@@ -4912,7 +4922,7 @@ const No = ({
|
|
|
4912
4922
|
items: { length: k },
|
|
4913
4923
|
slidable: N,
|
|
4914
4924
|
carrouselItemIndex: L,
|
|
4915
|
-
masterItemIndex:
|
|
4925
|
+
masterItemIndex: h,
|
|
4916
4926
|
prevItem: n,
|
|
4917
4927
|
nextItem: b,
|
|
4918
4928
|
showGalleryControls: P,
|
|
@@ -4920,7 +4930,7 @@ const No = ({
|
|
|
4920
4930
|
currentItemHotspotsVisible: w,
|
|
4921
4931
|
toggleHotspots: C,
|
|
4922
4932
|
showGallery: x,
|
|
4923
|
-
toggleGallery:
|
|
4933
|
+
toggleGallery: p,
|
|
4924
4934
|
extendMode: y,
|
|
4925
4935
|
toggleExtendMode: T,
|
|
4926
4936
|
shownDetails: $,
|
|
@@ -4945,9 +4955,9 @@ const No = ({
|
|
|
4945
4955
|
const F = Math.floor(c) - 1;
|
|
4946
4956
|
return L + F;
|
|
4947
4957
|
}, B = () => {
|
|
4948
|
-
if (!v) return
|
|
4958
|
+
if (!v) return h;
|
|
4949
4959
|
const F = Math.floor(c) - 1;
|
|
4950
|
-
return
|
|
4960
|
+
return h + F;
|
|
4951
4961
|
};
|
|
4952
4962
|
return /* @__PURE__ */ me(nt, { children: [
|
|
4953
4963
|
!t && E > 1 && /* @__PURE__ */ a(
|
|
@@ -4960,7 +4970,7 @@ const No = ({
|
|
|
4960
4970
|
)
|
|
4961
4971
|
}
|
|
4962
4972
|
),
|
|
4963
|
-
N && !z && /* @__PURE__ */ a("div", { className: ue(J,
|
|
4973
|
+
N && !z && /* @__PURE__ */ a("div", { className: ue(J, ht("top-right")), children: /* @__PURE__ */ a(
|
|
4964
4974
|
Ro,
|
|
4965
4975
|
{
|
|
4966
4976
|
currentIndex: !v || u ? L : S(),
|
|
@@ -4975,11 +4985,11 @@ const No = ({
|
|
|
4975
4985
|
color: "neutral",
|
|
4976
4986
|
className: ue(
|
|
4977
4987
|
J,
|
|
4978
|
-
|
|
4988
|
+
ht("middle-left"),
|
|
4979
4989
|
z ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
4980
4990
|
),
|
|
4981
4991
|
onClick: n,
|
|
4982
|
-
disabled: !o &&
|
|
4992
|
+
disabled: !o && h <= 0,
|
|
4983
4993
|
children: /* @__PURE__ */ a(qe, { customizationKey: "CONTROLS_PREV", children: /* @__PURE__ */ a(zt, { className: "size-full -scale-x-100" }) })
|
|
4984
4994
|
}
|
|
4985
4995
|
),
|
|
@@ -4990,7 +5000,7 @@ const No = ({
|
|
|
4990
5000
|
color: "neutral",
|
|
4991
5001
|
className: ue(
|
|
4992
5002
|
J,
|
|
4993
|
-
|
|
5003
|
+
ht("middle-right"),
|
|
4994
5004
|
z ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
4995
5005
|
),
|
|
4996
5006
|
onClick: b,
|
|
@@ -5004,7 +5014,7 @@ const No = ({
|
|
|
5004
5014
|
{
|
|
5005
5015
|
className: ue(
|
|
5006
5016
|
J,
|
|
5007
|
-
|
|
5017
|
+
ht("bottom-fullW"),
|
|
5008
5018
|
"pointer-events-none grid grid-cols-[auto,1fr,auto] items-end *:pointer-events-auto small:gap-x-2"
|
|
5009
5019
|
),
|
|
5010
5020
|
children: [
|
|
@@ -5016,7 +5026,7 @@ const No = ({
|
|
|
5016
5026
|
variant: "fill",
|
|
5017
5027
|
color: x ? "primary" : "neutral",
|
|
5018
5028
|
shape: "icon",
|
|
5019
|
-
onClick:
|
|
5029
|
+
onClick: p,
|
|
5020
5030
|
children: /* @__PURE__ */ a(Ao, { className: "size-full" })
|
|
5021
5031
|
}
|
|
5022
5032
|
),
|
|
@@ -5109,7 +5119,7 @@ const No = ({
|
|
|
5109
5119
|
z && /* @__PURE__ */ a(
|
|
5110
5120
|
Rt,
|
|
5111
5121
|
{
|
|
5112
|
-
className: ue(J,
|
|
5122
|
+
className: ue(J, ht("top-right")),
|
|
5113
5123
|
onClick: U
|
|
5114
5124
|
}
|
|
5115
5125
|
)
|
|
@@ -5127,20 +5137,20 @@ const No = ({
|
|
|
5127
5137
|
carrouselItemIndex: k,
|
|
5128
5138
|
setCarrouselItemIndex: N,
|
|
5129
5139
|
itemIndexCommand: L,
|
|
5130
|
-
setItemIndexCommand:
|
|
5140
|
+
setItemIndexCommand: h,
|
|
5131
5141
|
specialCommand: n,
|
|
5132
5142
|
isRunningSpecialCommand: b,
|
|
5133
5143
|
finishSpecialCommand: P,
|
|
5134
5144
|
extendMode: _,
|
|
5135
5145
|
extendTransition: w
|
|
5136
|
-
} = Ke(), { effectiveMaxItemsShown: C } = mr(), x = Le(null),
|
|
5146
|
+
} = Ke(), { effectiveMaxItemsShown: C } = mr(), x = Le(null), p = G((S) => {
|
|
5137
5147
|
if (!x.current)
|
|
5138
5148
|
throw new Error(`[${S ?? "sliderOrThrow"}] slider.current is null`);
|
|
5139
5149
|
return x.current;
|
|
5140
5150
|
}, []), y = Le(!1), T = Le(null), $ = Le(null), I = Le(null), X = G(() => {
|
|
5141
5151
|
I.current && cancelAnimationFrame(I.current);
|
|
5142
5152
|
}, []), V = G(() => {
|
|
5143
|
-
const S =
|
|
5153
|
+
const S = p("computeClosestSnapIndex"), B = Array.from(S.children), ie = S.scrollLeft;
|
|
5144
5154
|
let F = 0, te = 1 / 0;
|
|
5145
5155
|
if (B.forEach((K, ne) => {
|
|
5146
5156
|
const M = K.offsetLeft, le = Math.abs(M - ie);
|
|
@@ -5154,27 +5164,27 @@ const No = ({
|
|
|
5154
5164
|
}
|
|
5155
5165
|
return F;
|
|
5156
5166
|
}, [
|
|
5157
|
-
|
|
5167
|
+
p,
|
|
5158
5168
|
C,
|
|
5159
5169
|
e.length,
|
|
5160
5170
|
o,
|
|
5161
5171
|
u
|
|
5162
5172
|
]), z = G(
|
|
5163
5173
|
(S) => {
|
|
5164
|
-
const B =
|
|
5174
|
+
const B = p("setStyleCursor");
|
|
5165
5175
|
B.style.cursor = S;
|
|
5166
5176
|
},
|
|
5167
|
-
[
|
|
5177
|
+
[p]
|
|
5168
5178
|
), H = G(
|
|
5169
5179
|
(S) => {
|
|
5170
|
-
const B =
|
|
5180
|
+
const B = p("setStyleSnapState");
|
|
5171
5181
|
S === "mandatory" ? B.style.scrollSnapType = "x mandatory" : B.style.scrollSnapType = "none";
|
|
5172
5182
|
},
|
|
5173
|
-
[
|
|
5183
|
+
[p]
|
|
5174
5184
|
), R = G(
|
|
5175
5185
|
(S, B, ie) => {
|
|
5176
5186
|
X();
|
|
5177
|
-
const F =
|
|
5187
|
+
const F = p("scrollToIndex"), te = Array.from(F.children), K = F.scrollLeft;
|
|
5178
5188
|
let ne = te[S].offsetLeft;
|
|
5179
5189
|
const M = F.clientWidth, le = F.scrollWidth - M;
|
|
5180
5190
|
if (C > 1) {
|
|
@@ -5202,7 +5212,7 @@ const No = ({
|
|
|
5202
5212
|
Te();
|
|
5203
5213
|
return;
|
|
5204
5214
|
}
|
|
5205
|
-
const ee = Math.min(oe / Ve, 1), g = kr(ee), ae =
|
|
5215
|
+
const ee = Math.min(oe / Ve, 1), g = kr(ee), ae = Lt(K, ne, g);
|
|
5206
5216
|
j(ae), l();
|
|
5207
5217
|
};
|
|
5208
5218
|
I.current = requestAnimationFrame(f);
|
|
@@ -5211,7 +5221,7 @@ const No = ({
|
|
|
5211
5221
|
},
|
|
5212
5222
|
[
|
|
5213
5223
|
X,
|
|
5214
|
-
|
|
5224
|
+
p,
|
|
5215
5225
|
C,
|
|
5216
5226
|
H,
|
|
5217
5227
|
e.length,
|
|
@@ -5224,7 +5234,7 @@ const No = ({
|
|
|
5224
5234
|
clearTimeout(q);
|
|
5225
5235
|
const B = setTimeout(() => {
|
|
5226
5236
|
ce(void 0);
|
|
5227
|
-
},
|
|
5237
|
+
}, pr);
|
|
5228
5238
|
ce(B);
|
|
5229
5239
|
};
|
|
5230
5240
|
return addEventListener("resize", S), document.addEventListener("fullscreenchange", S), () => {
|
|
@@ -5301,7 +5311,7 @@ const No = ({
|
|
|
5301
5311
|
return;
|
|
5302
5312
|
const B = () => {
|
|
5303
5313
|
const ie = V();
|
|
5304
|
-
Number.isNaN(ie) || (N(ie), ie === L &&
|
|
5314
|
+
Number.isNaN(ie) || (N(ie), ie === L && h(null));
|
|
5305
5315
|
};
|
|
5306
5316
|
return S.addEventListener("scroll", B), () => {
|
|
5307
5317
|
S.removeEventListener("scroll", B);
|
|
@@ -5313,13 +5323,13 @@ const No = ({
|
|
|
5313
5323
|
L,
|
|
5314
5324
|
c,
|
|
5315
5325
|
N,
|
|
5316
|
-
|
|
5326
|
+
h
|
|
5317
5327
|
]), ve(() => {
|
|
5318
5328
|
if (L === null)
|
|
5319
5329
|
return;
|
|
5320
5330
|
const S = () => {
|
|
5321
5331
|
setTimeout(() => {
|
|
5322
|
-
|
|
5332
|
+
h(null), P();
|
|
5323
5333
|
}, 75);
|
|
5324
5334
|
};
|
|
5325
5335
|
switch (n) {
|
|
@@ -5344,7 +5354,7 @@ const No = ({
|
|
|
5344
5354
|
L,
|
|
5345
5355
|
e.length,
|
|
5346
5356
|
R,
|
|
5347
|
-
|
|
5357
|
+
h,
|
|
5348
5358
|
C,
|
|
5349
5359
|
o,
|
|
5350
5360
|
u
|
|
@@ -5451,18 +5461,18 @@ const No = ({
|
|
|
5451
5461
|
isZooming: e,
|
|
5452
5462
|
resetZoom: E,
|
|
5453
5463
|
fakeFullScreen: k
|
|
5454
|
-
} = Ke(), N = Le(null), L = Le(null),
|
|
5464
|
+
} = Ke(), N = Le(null), L = Le(null), h = Le(null);
|
|
5455
5465
|
return ve(() => {
|
|
5456
5466
|
if (!u)
|
|
5457
5467
|
return;
|
|
5458
|
-
const n = N.current, b = L.current, P =
|
|
5468
|
+
const n = N.current, b = L.current, P = h.current;
|
|
5459
5469
|
if (!n || !b || !P)
|
|
5460
5470
|
return;
|
|
5461
5471
|
let _ = !1;
|
|
5462
|
-
const w = (
|
|
5463
|
-
_ = w(
|
|
5464
|
-
}, x = (
|
|
5465
|
-
_ && (w(
|
|
5472
|
+
const w = (p) => [n, b, P].includes(p.target), C = (p) => {
|
|
5473
|
+
_ = w(p);
|
|
5474
|
+
}, x = (p) => {
|
|
5475
|
+
_ && (w(p) && v(), _ = !1);
|
|
5466
5476
|
};
|
|
5467
5477
|
return n.addEventListener("mousedown", C), n.addEventListener("mouseup", x), () => {
|
|
5468
5478
|
n.removeEventListener("mousedown", C), n.removeEventListener("mouseup", x);
|
|
@@ -5499,7 +5509,7 @@ const No = ({
|
|
|
5499
5509
|
/* @__PURE__ */ a(
|
|
5500
5510
|
"div",
|
|
5501
5511
|
{
|
|
5502
|
-
ref:
|
|
5512
|
+
ref: h,
|
|
5503
5513
|
className: ue(
|
|
5504
5514
|
u && "mx-auto flex min-h-0 w-full max-w-[1600px] justify-center"
|
|
5505
5515
|
),
|
|
@@ -5559,7 +5569,7 @@ const No = ({
|
|
|
5559
5569
|
u,
|
|
5560
5570
|
c
|
|
5561
5571
|
]), v ? /* @__PURE__ */ a(
|
|
5562
|
-
|
|
5572
|
+
It,
|
|
5563
5573
|
{
|
|
5564
5574
|
className: "aspect-square text-foreground/70",
|
|
5565
5575
|
text: "Player could not be loaded"
|
|
@@ -5572,7 +5582,7 @@ const No = ({
|
|
|
5572
5582
|
hideCategoriesNav: !0,
|
|
5573
5583
|
infiniteCarrousel: !1,
|
|
5574
5584
|
permanentGallery: !1
|
|
5575
|
-
}, Go = [1, 1.5, 2, 2.5], jo = () => Ue(() =>
|
|
5585
|
+
}, Go = [1, 1.5, 2, 2.5], jo = () => Ue(() => pn(), []), qo = () => Ue(() => mn(), []), Ko = () => Ue(() => gn(), []), $o = "https://analytics.eu.car-cutter.com", Jo = {
|
|
5576
5586
|
load: "/webplayer/load",
|
|
5577
5587
|
display: "/webplayer/display",
|
|
5578
5588
|
interaction: "/webplayer/interaction",
|
|
@@ -5615,7 +5625,7 @@ const No = ({
|
|
|
5615
5625
|
preloadRange: k = Qr,
|
|
5616
5626
|
autoLoad360: N = en,
|
|
5617
5627
|
autoLoadInterior360: L = tn,
|
|
5618
|
-
categoriesFilter:
|
|
5628
|
+
categoriesFilter: h = rn,
|
|
5619
5629
|
extendBehavior: n = nn,
|
|
5620
5630
|
eventPrefix: b = cr,
|
|
5621
5631
|
demoSpin: P = on,
|
|
@@ -5623,9 +5633,9 @@ const No = ({
|
|
|
5623
5633
|
analyticsEventPrefix: w = dr,
|
|
5624
5634
|
analyticsUrl: C = ln,
|
|
5625
5635
|
analyticsBearer: x = cn,
|
|
5626
|
-
analyticsSimpleRequestsOnly:
|
|
5636
|
+
analyticsSimpleRequestsOnly: p = un,
|
|
5627
5637
|
analyticsDryRun: y = dn,
|
|
5628
|
-
analyticsDebug: T =
|
|
5638
|
+
analyticsDebug: T = hn,
|
|
5629
5639
|
spinCursor: $ = Dt,
|
|
5630
5640
|
monitoring: I,
|
|
5631
5641
|
themeConfig: X,
|
|
@@ -5665,7 +5675,7 @@ const No = ({
|
|
|
5665
5675
|
});
|
|
5666
5676
|
if (document.dispatchEvent(Te), C || z) {
|
|
5667
5677
|
const Ye = "POST", Ve = new Headers();
|
|
5668
|
-
|
|
5678
|
+
p || (Ve.append("Content-Type", "application/json"), Ve.append("Cache-Control", "no-cache"), x && Ve.append("Authorization", `Bearer ${x}`));
|
|
5669
5679
|
const we = JSON.stringify(le), l = [];
|
|
5670
5680
|
C && l.push(fetch(C, { method: Ye, headers: Ve, body: we })), z && l.push(
|
|
5671
5681
|
n2({ payload: le, compositionUrl: t })
|
|
@@ -5687,7 +5697,7 @@ const No = ({
|
|
|
5687
5697
|
w,
|
|
5688
5698
|
C,
|
|
5689
5699
|
x,
|
|
5690
|
-
|
|
5700
|
+
p,
|
|
5691
5701
|
y,
|
|
5692
5702
|
T,
|
|
5693
5703
|
B,
|
|
@@ -5710,7 +5720,7 @@ const No = ({
|
|
|
5710
5720
|
preload_range: k,
|
|
5711
5721
|
auto_load_360: N,
|
|
5712
5722
|
auto_load_interior_360: L,
|
|
5713
|
-
categories_filter:
|
|
5723
|
+
categories_filter: h,
|
|
5714
5724
|
extend_behavior: n,
|
|
5715
5725
|
event_prefix: b,
|
|
5716
5726
|
demo_spin: P,
|
|
@@ -5780,7 +5790,7 @@ const No = ({
|
|
|
5780
5790
|
minMediaWidth: e,
|
|
5781
5791
|
maxMediaWidth: E,
|
|
5782
5792
|
preloadRange: k,
|
|
5783
|
-
categoriesFilter:
|
|
5793
|
+
categoriesFilter: h,
|
|
5784
5794
|
autoLoad360: N,
|
|
5785
5795
|
autoLoadInterior360: L,
|
|
5786
5796
|
extendBehavior: n,
|
|
@@ -5825,7 +5835,7 @@ const No = ({
|
|
|
5825
5835
|
}
|
|
5826
5836
|
);
|
|
5827
5837
|
}, a2 = ({ children: t, index: o, thumbnailSrc: i }) => {
|
|
5828
|
-
const { registerCustomMedia: d, unregisterCustomMedia: c } =
|
|
5838
|
+
const { registerCustomMedia: d, unregisterCustomMedia: c } = vt();
|
|
5829
5839
|
return ve(() => {
|
|
5830
5840
|
if (!t)
|
|
5831
5841
|
return;
|
|
@@ -5839,7 +5849,7 @@ const No = ({
|
|
|
5839
5849
|
};
|
|
5840
5850
|
}, [t, c, o, d, i]), null;
|
|
5841
5851
|
}, g2 = (t) => Ot() ? /* @__PURE__ */ a(a2, { ...t }) : /* @__PURE__ */ a("slot", {}), i2 = ({ name: t, children: o }) => {
|
|
5842
|
-
const { registerIconConfig: i, unregisterIconConfig: d } =
|
|
5852
|
+
const { registerIconConfig: i, unregisterIconConfig: d } = vt();
|
|
5843
5853
|
return ve(() => {
|
|
5844
5854
|
if (o)
|
|
5845
5855
|
return i(t, {
|
|
@@ -5880,7 +5890,7 @@ const w2 = (t) => /* @__PURE__ */ me(nt, { children: [
|
|
|
5880
5890
|
onGalleryClose: k,
|
|
5881
5891
|
onAnalyticsLoad: N,
|
|
5882
5892
|
onAnalyticsDisplay: L,
|
|
5883
|
-
onAnalyticsInteraction:
|
|
5893
|
+
onAnalyticsInteraction: h,
|
|
5884
5894
|
onAnalyticsError: n,
|
|
5885
5895
|
className: b,
|
|
5886
5896
|
style: P = {},
|
|
@@ -5892,7 +5902,7 @@ const w2 = (t) => /* @__PURE__ */ me(nt, { children: [
|
|
|
5892
5902
|
return b && Object.assign(x, { class: b }), x;
|
|
5893
5903
|
}, [b, w]);
|
|
5894
5904
|
return ve(() => {
|
|
5895
|
-
const x = w.eventPrefix ?? cr,
|
|
5905
|
+
const x = w.eventPrefix ?? cr, p = w.analyticsEventPrefix ?? dr, y = (z) => `${x}${z}`, T = (z) => `${p}${z}`, $ = {
|
|
5896
5906
|
[tr]: t,
|
|
5897
5907
|
[rr]: o,
|
|
5898
5908
|
[nr]: i,
|
|
@@ -5906,7 +5916,7 @@ const w2 = (t) => /* @__PURE__ */ me(nt, { children: [
|
|
|
5906
5916
|
}, I = {
|
|
5907
5917
|
[Xr]: N,
|
|
5908
5918
|
[Zr]: L,
|
|
5909
|
-
[Vr]:
|
|
5919
|
+
[Vr]: h,
|
|
5910
5920
|
[Yr]: n
|
|
5911
5921
|
}, X = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
|
|
5912
5922
|
return Object.entries($).forEach(([z, H]) => {
|
|
@@ -5941,7 +5951,7 @@ const w2 = (t) => /* @__PURE__ */ me(nt, { children: [
|
|
|
5941
5951
|
w.analyticsEventPrefix,
|
|
5942
5952
|
N,
|
|
5943
5953
|
L,
|
|
5944
|
-
|
|
5954
|
+
h,
|
|
5945
5955
|
n
|
|
5946
5956
|
]), /* @__PURE__ */ a("cc-webplayer", { style: { display: "block", ...P }, ...C, children: _ });
|
|
5947
5957
|
}, y2 = ({ children: t, ...o }) => {
|
|
@@ -5980,5 +5990,5 @@ export {
|
|
|
5980
5990
|
x2 as s,
|
|
5981
5991
|
y2 as t,
|
|
5982
5992
|
C2 as u,
|
|
5983
|
-
|
|
5993
|
+
p2 as v
|
|
5984
5994
|
};
|