@cntrl-site/components 1.0.103 → 1.0.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
- package/dist/Components/utils/index.d.ts +1 -0
- package/dist/Components/utils/observeIntersection.d.ts +4 -0
- package/dist/Components/utils/useLazyVideos.d.ts +12 -0
- package/dist/Grid-BBpdl60K.js +374 -0
- package/dist/Grid-DS53S_gA.mjs +1576 -0
- package/dist/{Helix-BmkAKT1G.mjs → Helix-BPn9V1sg.mjs} +53 -53
- package/dist/{Helix-2Vr-9WBa.js → Helix-DcgsCc4D.js} +2 -2
- package/dist/{Hive-BGMWinrW.mjs → Hive-D6-R6TwM.mjs} +114 -111
- package/dist/Hive-n8Fz-j3o.js +321 -0
- package/dist/LazyVideo-CdAWymKO.mjs +15 -0
- package/dist/LazyVideo-imbU18js.js +1 -0
- package/dist/Marquee-DOIRRCu4.js +133 -0
- package/dist/Marquee-O_PDwlIb.mjs +564 -0
- package/dist/MarqueeText-DkaO2lQ5.js +132 -0
- package/dist/MarqueeText-Rzt2fJYt.mjs +517 -0
- package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-C9D10TTT.mjs} +55 -54
- package/dist/Mercury-DynO-NxY.js +267 -0
- package/dist/{PretextComponent-CGycuNNn.js → PretextComponent-BnsS2zJ6.js} +1 -1
- package/dist/{PretextComponent-DN8cyZ8x.mjs → PretextComponent-j-OsRZTx.mjs} +7 -7
- package/dist/Waterfall-DC2WQ3GT.js +287 -0
- package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-Yud2VR62.mjs} +299 -295
- package/dist/{components-DTCDEBo0.js → components-B9Vdjf0w.js} +1 -1
- package/dist/{components-BFJINCME.mjs → components-D2LyuDm-.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +7 -7
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/observeIntersection-B0f3L2iK.mjs +23 -0
- package/dist/observeIntersection-DxGj9Ctt.js +1 -0
- package/dist/sources.js +147 -59
- package/dist/sources.mjs +155 -67
- package/dist/useLazyVideos-CdCbc2j0.js +1 -0
- package/dist/useLazyVideos-CxXyEjRQ.mjs +52 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +14 -12
- package/package.json +5 -3
- package/dist/Grid-CemGhf3F.js +0 -374
- package/dist/Grid-cfQsXW3b.mjs +0 -1553
- package/dist/Hive-BC6zQBsv.js +0 -321
- package/dist/Marquee-BYClHHws.mjs +0 -551
- package/dist/Marquee-vmHaTGIP.js +0 -133
- package/dist/MarqueeText-4Rip_sQX.mjs +0 -515
- package/dist/MarqueeText-E6OubMOG.js +0 -132
- package/dist/Mercury-BwF_XW2w.js +0 -267
- package/dist/Waterfall-DnPDHbCL.js +0 -287
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as h, jsxs as bt, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { g as
|
|
2
|
+
import { useState as $, useRef as y, useCallback as w, useEffect as D, useLayoutEffect as Pt, useMemo as me } from "react";
|
|
3
|
+
import { createPortal as an } from "react-dom";
|
|
4
|
+
import { g as ln, a as cn } from "./getImageRect-CBMhFNHM.mjs";
|
|
5
5
|
import { s as ne } from "./scalingValue-C9JH5L6O.mjs";
|
|
6
6
|
import { u as sn } from "./useScopedStyles-DhBG3557.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { L as un } from "./LazyVideo-CdAWymKO.mjs";
|
|
8
|
+
import { t as fn } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
9
|
+
import { u as dn } from "./useLazyVideos-CxXyEjRQ.mjs";
|
|
10
|
+
import { H as hn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
|
|
11
|
+
function pn(t) {
|
|
10
12
|
return `
|
|
11
13
|
.${t}-titles-row {
|
|
12
14
|
position: relative;
|
|
@@ -207,27 +209,27 @@ function dn(t) {
|
|
|
207
209
|
}
|
|
208
210
|
`;
|
|
209
211
|
}
|
|
210
|
-
const Q = 500, _t = 650,
|
|
211
|
-
function
|
|
212
|
-
const r = t.width /
|
|
213
|
-
return `translate(${i}px, ${
|
|
212
|
+
const Q = 500, _t = 650, B = "cubic-bezier(0.22, 1, 0.36, 1)", gn = 72, mn = 50, wn = 1e4, vn = 650, yn = 500;
|
|
213
|
+
function xn(t, n) {
|
|
214
|
+
const r = t.width / n.width, o = t.height / n.height, i = t.left - n.left, l = t.top - n.top;
|
|
215
|
+
return `translate(${i}px, ${l}px) scale(${r}, ${o})`;
|
|
214
216
|
}
|
|
215
|
-
function je(t,
|
|
216
|
-
if (
|
|
217
|
-
const o =
|
|
217
|
+
function je(t, n) {
|
|
218
|
+
if (n === "contain" && t instanceof HTMLImageElement) {
|
|
219
|
+
const o = ln(t);
|
|
218
220
|
return { left: o.x, top: o.y, width: o.width, height: o.height };
|
|
219
221
|
}
|
|
220
222
|
const r = t.getBoundingClientRect();
|
|
221
223
|
return { left: r.left, top: r.top, width: r.width, height: r.height };
|
|
222
224
|
}
|
|
223
|
-
function
|
|
224
|
-
const o = t.querySelector(`[data-waterfall-index="${
|
|
225
|
+
function $n(t, n, r) {
|
|
226
|
+
const o = t.querySelector(`[data-waterfall-index="${n}"]`);
|
|
225
227
|
return o instanceof HTMLElement ? je(o, r) : null;
|
|
226
228
|
}
|
|
227
|
-
function
|
|
228
|
-
return t.reduce((
|
|
229
|
+
function bn(t) {
|
|
230
|
+
return t.reduce((n, r, o) => {
|
|
229
231
|
var i;
|
|
230
|
-
return (i = r.image) != null && i.assetId &&
|
|
232
|
+
return (i = r.image) != null && i.assetId && n.push({
|
|
231
233
|
gridIndex: o,
|
|
232
234
|
items: [r.image],
|
|
233
235
|
entry: {
|
|
@@ -235,23 +237,23 @@ function xn(t) {
|
|
|
235
237
|
title2: r.subtitle ?? "",
|
|
236
238
|
title3: r.caption ?? ""
|
|
237
239
|
}
|
|
238
|
-
}),
|
|
240
|
+
}), n;
|
|
239
241
|
}, []);
|
|
240
242
|
}
|
|
241
|
-
function jt(t,
|
|
243
|
+
function jt(t, n, r) {
|
|
242
244
|
var i;
|
|
243
245
|
if (t.length <= 1) return null;
|
|
244
|
-
const o = (
|
|
246
|
+
const o = (n + r + t.length) % t.length;
|
|
245
247
|
return ((i = t[o]) == null ? void 0 : i.items[0]) ?? null;
|
|
246
248
|
}
|
|
247
|
-
function De(t,
|
|
249
|
+
function De(t, n, r) {
|
|
248
250
|
if (t.length <= 2) return null;
|
|
249
|
-
const o = (
|
|
251
|
+
const o = (n + r + t.length) % t.length;
|
|
250
252
|
return jt(t, o, r);
|
|
251
253
|
}
|
|
252
|
-
const
|
|
254
|
+
const Sn = 0.03;
|
|
253
255
|
function Ve(t) {
|
|
254
|
-
return t.width *
|
|
256
|
+
return t.width * Sn;
|
|
255
257
|
}
|
|
256
258
|
const we = {
|
|
257
259
|
left: 0,
|
|
@@ -259,58 +261,60 @@ const we = {
|
|
|
259
261
|
width: typeof window < "u" ? window.innerWidth : 1440,
|
|
260
262
|
height: typeof window < "u" ? window.innerHeight : 900
|
|
261
263
|
};
|
|
262
|
-
function te(t,
|
|
264
|
+
function te(t, n) {
|
|
263
265
|
return {
|
|
264
|
-
left: t.left -
|
|
265
|
-
top: t.top -
|
|
266
|
+
left: t.left - n.left,
|
|
267
|
+
top: t.top - n.top,
|
|
266
268
|
width: t.width,
|
|
267
269
|
height: t.height
|
|
268
270
|
};
|
|
269
271
|
}
|
|
270
272
|
function _e(t) {
|
|
271
|
-
const
|
|
272
|
-
return { width:
|
|
273
|
+
const n = t.getBoundingClientRect();
|
|
274
|
+
return { width: n.width, height: n.height, left: n.left, top: n.top };
|
|
273
275
|
}
|
|
274
|
-
function
|
|
276
|
+
function In(t) {
|
|
275
277
|
return t instanceof HTMLVideoElement ? { width: t.videoWidth, height: t.videoHeight } : { width: t.naturalWidth, height: t.naturalHeight };
|
|
276
278
|
}
|
|
277
|
-
function ye(t,
|
|
278
|
-
const o = t.getBoundingClientRect(), i = o.width,
|
|
279
|
+
function ye(t, n, r) {
|
|
280
|
+
const o = t.getBoundingClientRect(), i = o.width, l = o.height, p = n / r, s = i / l;
|
|
279
281
|
if (p > s) {
|
|
280
282
|
const b = i / p;
|
|
281
|
-
return { width: i, height: b, left: o.left, top: o.top + (
|
|
283
|
+
return { width: i, height: b, left: o.left, top: o.top + (l - b) / 2 };
|
|
282
284
|
}
|
|
283
|
-
const I =
|
|
284
|
-
return { width: I, height:
|
|
285
|
+
const I = l * p;
|
|
286
|
+
return { width: I, height: l, left: o.left + (i - I) / 2, top: o.top };
|
|
285
287
|
}
|
|
286
|
-
function
|
|
287
|
-
return !t || !(
|
|
288
|
+
function Ln(t, n) {
|
|
289
|
+
return !t || !(n != null && n.width) || !(n != null && n.height) ? null : ye(t, n.width, n.height);
|
|
288
290
|
}
|
|
289
|
-
function
|
|
291
|
+
function Tn(t, n) {
|
|
290
292
|
if (oe(t)) {
|
|
291
293
|
const o = document.createElement("video"), i = () => {
|
|
292
|
-
o.videoWidth > 0 && o.videoHeight > 0 &&
|
|
294
|
+
o.videoWidth > 0 && o.videoHeight > 0 && n(t.assetId, o.videoWidth, o.videoHeight), o.removeEventListener("loadedmetadata", i);
|
|
293
295
|
};
|
|
294
296
|
o.addEventListener("loadedmetadata", i), o.preload = "auto", o.src = t.assetId, o.load();
|
|
295
297
|
return;
|
|
296
298
|
}
|
|
297
299
|
const r = new Image();
|
|
298
300
|
r.onload = () => {
|
|
299
|
-
r.naturalWidth > 0 && r.naturalHeight > 0 &&
|
|
301
|
+
r.naturalWidth > 0 && r.naturalHeight > 0 && n(t.assetId, r.naturalWidth, r.naturalHeight);
|
|
300
302
|
}, r.src = t.assetId;
|
|
301
303
|
}
|
|
302
|
-
function
|
|
303
|
-
const
|
|
304
|
+
function kn(t) {
|
|
305
|
+
const n = /* @__PURE__ */ new Set(), r = [];
|
|
304
306
|
for (const o of t) {
|
|
305
307
|
const i = o.image;
|
|
306
|
-
!(i != null && i.assetId) ||
|
|
308
|
+
!(i != null && i.assetId) || n.has(i.assetId) || (n.add(i.assetId), r.push(i));
|
|
307
309
|
}
|
|
308
310
|
return r;
|
|
309
311
|
}
|
|
310
|
-
function
|
|
311
|
-
|
|
312
|
+
function Hn({ mediaList: t }) {
|
|
313
|
+
const [n, r] = $(null);
|
|
314
|
+
return dn(n, { preload: "metadata" }), t.length === 0 ? null : /* @__PURE__ */ h(
|
|
312
315
|
"div",
|
|
313
316
|
{
|
|
317
|
+
ref: r,
|
|
314
318
|
"aria-hidden": !0,
|
|
315
319
|
style: {
|
|
316
320
|
position: "absolute",
|
|
@@ -320,98 +324,98 @@ function Tn({ mediaList: t }) {
|
|
|
320
324
|
opacity: 0,
|
|
321
325
|
pointerEvents: "none"
|
|
322
326
|
},
|
|
323
|
-
children: t.map((
|
|
327
|
+
children: t.map((o) => oe(o) ? /* @__PURE__ */ h(
|
|
324
328
|
"video",
|
|
325
329
|
{
|
|
326
|
-
src:
|
|
327
|
-
preload: "
|
|
330
|
+
src: o.assetId,
|
|
331
|
+
preload: "none",
|
|
328
332
|
muted: !0,
|
|
329
333
|
playsInline: !0
|
|
330
334
|
},
|
|
331
|
-
|
|
335
|
+
o.assetId
|
|
332
336
|
) : /* @__PURE__ */ h(
|
|
333
337
|
"img",
|
|
334
338
|
{
|
|
335
|
-
src:
|
|
339
|
+
src: o.assetId,
|
|
336
340
|
alt: ""
|
|
337
341
|
},
|
|
338
|
-
|
|
342
|
+
o.assetId
|
|
339
343
|
))
|
|
340
344
|
}
|
|
341
345
|
);
|
|
342
346
|
}
|
|
343
|
-
function Nt(t,
|
|
344
|
-
const { width: o, height: i, top:
|
|
345
|
-
return
|
|
347
|
+
function Nt(t, n, r) {
|
|
348
|
+
const { width: o, height: i, top: l } = t, { left: p, width: s } = r, I = Ve(r);
|
|
349
|
+
return n === "left" ? {
|
|
346
350
|
left: p + I - o,
|
|
347
|
-
top:
|
|
351
|
+
top: l,
|
|
348
352
|
width: o,
|
|
349
353
|
height: i
|
|
350
354
|
} : {
|
|
351
355
|
left: p + s - I,
|
|
352
|
-
top:
|
|
356
|
+
top: l,
|
|
353
357
|
width: o,
|
|
354
358
|
height: i
|
|
355
359
|
};
|
|
356
360
|
}
|
|
357
|
-
function re(t,
|
|
358
|
-
const o = Nt(t,
|
|
361
|
+
function re(t, n, r) {
|
|
362
|
+
const o = Nt(t, n, r);
|
|
359
363
|
return {
|
|
360
364
|
...o,
|
|
361
365
|
left: 2 * o.left - t.left
|
|
362
366
|
};
|
|
363
367
|
}
|
|
364
|
-
function
|
|
365
|
-
const { left: o, width: i } = r,
|
|
366
|
-
return
|
|
368
|
+
function An(t, n, r) {
|
|
369
|
+
const { left: o, width: i } = r, l = Ve(r);
|
|
370
|
+
return n === "left" ? {
|
|
367
371
|
left: o,
|
|
368
372
|
top: t.top,
|
|
369
|
-
width:
|
|
373
|
+
width: l,
|
|
370
374
|
height: t.height
|
|
371
375
|
} : {
|
|
372
|
-
left: o + i -
|
|
376
|
+
left: o + i - l,
|
|
373
377
|
top: t.top,
|
|
374
|
-
width:
|
|
378
|
+
width: l,
|
|
375
379
|
height: t.height
|
|
376
380
|
};
|
|
377
381
|
}
|
|
378
|
-
function
|
|
379
|
-
const i = Nt(t, "left", o),
|
|
382
|
+
function Me(t, n, r, o) {
|
|
383
|
+
const i = Nt(t, "left", o), l = Nt(t, "right", o), p = re(t, "left", o), s = re(t, "right", o);
|
|
380
384
|
if (r === 1)
|
|
381
|
-
switch (
|
|
385
|
+
switch (n) {
|
|
382
386
|
case "center":
|
|
383
387
|
return { start: t, end: i };
|
|
384
388
|
case "right-adjacent":
|
|
385
|
-
return { start:
|
|
389
|
+
return { start: l, end: t };
|
|
386
390
|
case "left-adjacent":
|
|
387
391
|
return { start: i, end: p };
|
|
388
392
|
case "far-right":
|
|
389
|
-
return { start: s, end:
|
|
393
|
+
return { start: s, end: l };
|
|
390
394
|
default:
|
|
391
395
|
return { start: t, end: t };
|
|
392
396
|
}
|
|
393
|
-
switch (
|
|
397
|
+
switch (n) {
|
|
394
398
|
case "center":
|
|
395
|
-
return { start: t, end:
|
|
399
|
+
return { start: t, end: l };
|
|
396
400
|
case "left-adjacent":
|
|
397
401
|
return { start: i, end: t };
|
|
398
402
|
case "right-adjacent":
|
|
399
|
-
return { start:
|
|
403
|
+
return { start: l, end: s };
|
|
400
404
|
case "far-left":
|
|
401
405
|
return { start: p, end: i };
|
|
402
406
|
default:
|
|
403
407
|
return { start: t, end: t };
|
|
404
408
|
}
|
|
405
409
|
}
|
|
406
|
-
function
|
|
407
|
-
const { start: i, end:
|
|
410
|
+
function Rn(t, n, r, o) {
|
|
411
|
+
const { start: i, end: l } = Me(t, n, r, o);
|
|
408
412
|
return {
|
|
409
|
-
x:
|
|
410
|
-
y:
|
|
413
|
+
x: l.left - i.left,
|
|
414
|
+
y: l.top - i.top
|
|
411
415
|
};
|
|
412
416
|
}
|
|
413
|
-
function
|
|
414
|
-
const o = Nt(t,
|
|
417
|
+
function Cn(t, n, r) {
|
|
418
|
+
const o = Nt(t, n, r), i = re(t, n, r);
|
|
415
419
|
return {
|
|
416
420
|
x: i.left - o.left,
|
|
417
421
|
y: i.top - o.top
|
|
@@ -420,13 +424,13 @@ function An(t, e, r) {
|
|
|
420
424
|
function oe(t) {
|
|
421
425
|
return t.type === "video" ? !0 : /\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(t.assetId);
|
|
422
426
|
}
|
|
423
|
-
function
|
|
427
|
+
function En({
|
|
424
428
|
src: t,
|
|
425
|
-
phase:
|
|
429
|
+
phase: n,
|
|
426
430
|
onMediaElement: r,
|
|
427
431
|
wrapperStyle: o,
|
|
428
432
|
videoStyle: i,
|
|
429
|
-
onLoadedMetadata:
|
|
433
|
+
onLoadedMetadata: l,
|
|
430
434
|
onTransitionEnd: p
|
|
431
435
|
}) {
|
|
432
436
|
const s = y(null);
|
|
@@ -440,10 +444,10 @@ function Rn({
|
|
|
440
444
|
{
|
|
441
445
|
ref: s,
|
|
442
446
|
src: t,
|
|
443
|
-
controls:
|
|
447
|
+
controls: n === "open",
|
|
444
448
|
playsInline: !0,
|
|
445
449
|
preload: "auto",
|
|
446
|
-
onLoadedMetadata:
|
|
450
|
+
onLoadedMetadata: l,
|
|
447
451
|
onClick: (I) => I.stopPropagation(),
|
|
448
452
|
style: i
|
|
449
453
|
},
|
|
@@ -452,7 +456,7 @@ function Rn({
|
|
|
452
456
|
}
|
|
453
457
|
function ee({
|
|
454
458
|
media: t,
|
|
455
|
-
style:
|
|
459
|
+
style: n,
|
|
456
460
|
onTransitionEnd: r,
|
|
457
461
|
onMeasure: o
|
|
458
462
|
}) {
|
|
@@ -463,10 +467,10 @@ function ee({
|
|
|
463
467
|
muted: !0,
|
|
464
468
|
playsInline: !0,
|
|
465
469
|
preload: "auto",
|
|
466
|
-
style:
|
|
470
|
+
style: n,
|
|
467
471
|
onLoadedMetadata: (i) => {
|
|
468
|
-
const
|
|
469
|
-
|
|
472
|
+
const l = i.currentTarget;
|
|
473
|
+
l.videoWidth > 0 && l.videoHeight > 0 && (o == null || o(t.assetId, l.videoWidth, l.videoHeight));
|
|
470
474
|
},
|
|
471
475
|
onTransitionEnd: r
|
|
472
476
|
}
|
|
@@ -475,22 +479,22 @@ function ee({
|
|
|
475
479
|
{
|
|
476
480
|
src: t.assetId,
|
|
477
481
|
alt: t.name,
|
|
478
|
-
style:
|
|
482
|
+
style: n,
|
|
479
483
|
onLoad: (i) => {
|
|
480
|
-
const
|
|
481
|
-
|
|
484
|
+
const l = i.currentTarget;
|
|
485
|
+
l.naturalWidth > 0 && l.naturalHeight > 0 && (o == null || o(t.assetId, l.naturalWidth, l.naturalHeight));
|
|
482
486
|
},
|
|
483
487
|
onTransitionEnd: r
|
|
484
488
|
}
|
|
485
489
|
);
|
|
486
490
|
}
|
|
487
|
-
function
|
|
491
|
+
function Nn({
|
|
488
492
|
prefix: t,
|
|
489
|
-
items:
|
|
493
|
+
items: n,
|
|
490
494
|
index: r,
|
|
491
495
|
entry: o,
|
|
492
496
|
settings: i,
|
|
493
|
-
isEditor:
|
|
497
|
+
isEditor: l,
|
|
494
498
|
isEditMode: p,
|
|
495
499
|
isPreviewMode: s,
|
|
496
500
|
canNavigate: I,
|
|
@@ -503,39 +507,39 @@ function Cn({
|
|
|
503
507
|
onPrev: tt,
|
|
504
508
|
onNext: Ft
|
|
505
509
|
}) {
|
|
506
|
-
const Wt = y(null), G = y(null), X = y(null), et = y(/* @__PURE__ */ new Map()), [ut,
|
|
507
|
-
}), dt = y(null), ht = y(null), pt = y(null), it = y(!1), [E, $t] = $(null), [N, W] = $(we), [
|
|
508
|
-
const
|
|
509
|
-
return
|
|
510
|
-
})() : null, Ke = A &&
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
})() : null, qt = Ye ?? Ze, Yt = Ue ?? Ke, wt = w((
|
|
514
|
-
if (!
|
|
515
|
-
const c = et.current, x = c.get(
|
|
516
|
-
(x == null ? void 0 : x.width) ===
|
|
517
|
-
}, []), Rt = w((
|
|
518
|
-
if (!(
|
|
519
|
-
const
|
|
520
|
-
return
|
|
521
|
-
}, [ut,
|
|
510
|
+
const Wt = y(null), G = y(null), X = y(null), et = y(/* @__PURE__ */ new Map()), [ut, Mt] = $(0), nt = y(null), rt = y(0), k = y(0), C = y("none"), F = y(!1), yt = y(!1), xt = y(!1), ft = y(null), _ = y(null), St = y(null), ot = y(() => {
|
|
511
|
+
}), dt = y(null), ht = y(null), pt = y(null), it = y(!1), [E, $t] = $(null), [N, W] = $(we), [ae, le] = $(0), [g, It] = $("opening"), [q, Lt] = $(0), [f, v] = $(0), [S, j] = $(!1), [z, at] = $(null), [gt, Tt] = $(null), [Bt, kt] = $(null), [Be, ce] = $(!1), [Ge, Xe] = $(null), [xe, se] = $(!1), Gt = y(!1), [Y, Ht] = $(!1), [qe, $e] = $(!1), be = y(r), Se = y(void 0), d = n[r], Xt = d ? oe(d) : !1, U = f !== 0 || S, ue = !p && (!l || !!s), lt = I && !p, mt = b.length > 1, At = w((e, a) => n.length <= 1 ? null : n[(e + a + n.length) % n.length] ?? null, [n]), H = mt ? jt(b, P, -1) : At(r, -1), A = mt ? jt(b, P, 1) : At(r, 1), fe = z === -1 && U ? mt && gt !== null ? jt(b, gt, -1) : Bt !== null ? At(Bt, -1) : null : null, de = z === 1 && U ? mt && gt !== null ? jt(b, gt, 1) : Bt !== null ? At(Bt, 1) : null : null, Ye = fe && fe.assetId !== (H == null ? void 0 : H.assetId) ? fe : null, Ue = de && de.assetId !== (A == null ? void 0 : A.assetId) ? de : null, Ze = H && lt ? (() => {
|
|
512
|
+
const e = mt ? De(b, P, -1) : n.length > 2 ? At((r - 1 + n.length) % n.length, -1) : null;
|
|
513
|
+
return e && e.assetId !== H.assetId ? e : null;
|
|
514
|
+
})() : null, Ke = A && lt ? (() => {
|
|
515
|
+
const e = mt ? De(b, P, 1) : n.length > 2 ? At((r + 1) % n.length, 1) : null;
|
|
516
|
+
return e && e.assetId !== A.assetId ? e : null;
|
|
517
|
+
})() : null, qt = Ye ?? Ze, Yt = Ue ?? Ke, wt = w((e, a, u) => {
|
|
518
|
+
if (!e || !a || !u) return;
|
|
519
|
+
const c = et.current, x = c.get(e);
|
|
520
|
+
(x == null ? void 0 : x.width) === a && (x == null ? void 0 : x.height) === u || (c.set(e, { width: a, height: u }), Mt((M) => M + 1));
|
|
521
|
+
}, []), Rt = w((e) => {
|
|
522
|
+
if (!(e != null && e.assetId)) return null;
|
|
523
|
+
const a = et.current.get(e.assetId);
|
|
524
|
+
return Ln(G.current, a);
|
|
525
|
+
}, [ut, ae]), Ut = w(() => {
|
|
522
526
|
if (!d) return;
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
$t(
|
|
527
|
+
const e = Rt(d);
|
|
528
|
+
if (e) {
|
|
529
|
+
$t(e);
|
|
526
530
|
return;
|
|
527
531
|
}
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
}, [d, Rt]), Zt = w((
|
|
532
|
+
const a = G.current;
|
|
533
|
+
a && $t(_e(a));
|
|
534
|
+
}, [d, Rt]), Zt = w((e) => {
|
|
531
535
|
if (mt) {
|
|
532
|
-
const
|
|
533
|
-
Tt((P +
|
|
536
|
+
const a = b.length;
|
|
537
|
+
Tt((P + e + a) % a), kt(null);
|
|
534
538
|
return;
|
|
535
539
|
}
|
|
536
|
-
|
|
537
|
-
}, [mt, b.length, P,
|
|
538
|
-
xt.current =
|
|
540
|
+
n.length > 1 && (kt((r + e + n.length) % n.length), Tt(null));
|
|
541
|
+
}, [mt, b.length, P, n.length, r]), R = w((e) => {
|
|
542
|
+
xt.current = e, j(e);
|
|
539
543
|
}, []), L = w(() => {
|
|
540
544
|
ft.current !== null && (window.clearTimeout(ft.current), ft.current = null);
|
|
541
545
|
}, []), Ie = w(() => {
|
|
@@ -543,8 +547,8 @@ function Cn({
|
|
|
543
547
|
L(), R(!1);
|
|
544
548
|
}, _t + 32);
|
|
545
549
|
}, [L, R]), Le = w(() => {
|
|
546
|
-
const
|
|
547
|
-
if (!
|
|
550
|
+
const e = Wt.current;
|
|
551
|
+
if (!e) {
|
|
548
552
|
W({
|
|
549
553
|
left: 0,
|
|
550
554
|
top: 0,
|
|
@@ -553,21 +557,21 @@ function Cn({
|
|
|
553
557
|
});
|
|
554
558
|
return;
|
|
555
559
|
}
|
|
556
|
-
const
|
|
560
|
+
const a = e.getBoundingClientRect();
|
|
557
561
|
W({
|
|
558
|
-
left:
|
|
559
|
-
top:
|
|
560
|
-
width:
|
|
561
|
-
height:
|
|
562
|
+
left: a.left,
|
|
563
|
+
top: a.top,
|
|
564
|
+
width: a.width,
|
|
565
|
+
height: a.height
|
|
562
566
|
});
|
|
563
|
-
}, []), Te = w((
|
|
567
|
+
}, []), Te = w((e, a) => {
|
|
564
568
|
if (U) {
|
|
565
569
|
if (Y && !S)
|
|
566
570
|
return `translate(${f}px, 0px)`;
|
|
567
|
-
if (S &&
|
|
568
|
-
const u = Rt(
|
|
571
|
+
if (S && z !== null) {
|
|
572
|
+
const u = Rt(e);
|
|
569
573
|
if (!u) return;
|
|
570
|
-
const { x: c, y: x } =
|
|
574
|
+
const { x: c, y: x } = Rn(u, a, z, N);
|
|
571
575
|
return `translate(${c}px, ${x}px)`;
|
|
572
576
|
}
|
|
573
577
|
if (S)
|
|
@@ -578,31 +582,31 @@ function Cn({
|
|
|
578
582
|
Y,
|
|
579
583
|
S,
|
|
580
584
|
f,
|
|
581
|
-
|
|
585
|
+
z,
|
|
582
586
|
N,
|
|
583
587
|
Rt
|
|
584
588
|
]), Ct = w(() => {
|
|
585
|
-
const
|
|
586
|
-
_.current = null, L(), R(!1),
|
|
589
|
+
const e = _.current;
|
|
590
|
+
_.current = null, L(), R(!1), at(null), Tt(null), kt(null), v(0), Ht(!1), F.current = !1, k.current = 0, C.current = "none", e === -1 ? tt() : e === 1 && Ft();
|
|
587
591
|
}, [L, R, tt, Ft]), Kt = w(() => {
|
|
588
592
|
L(), ft.current = window.setTimeout(() => {
|
|
589
593
|
_.current !== null && Ct();
|
|
590
594
|
}, _t + 32);
|
|
591
595
|
}, [L, Ct]), ke = w(() => {
|
|
592
|
-
L(), _.current = null, R(!1),
|
|
593
|
-
}, [L, R]), He = w((
|
|
594
|
-
if (!(!
|
|
596
|
+
L(), _.current = null, R(!1), at(null), Tt(null), kt(null), v(0), Ht(!1), F.current = !1, k.current = 0, C.current = "none";
|
|
597
|
+
}, [L, R]), He = w((e) => {
|
|
598
|
+
if (!(!lt || !E)) {
|
|
595
599
|
if (xt.current) {
|
|
596
|
-
if (_.current ===
|
|
597
|
-
St.current =
|
|
600
|
+
if (_.current === e) {
|
|
601
|
+
St.current = e, Ct();
|
|
598
602
|
return;
|
|
599
603
|
}
|
|
600
604
|
ke();
|
|
601
605
|
}
|
|
602
|
-
L(), Zt(
|
|
606
|
+
L(), Zt(e), _.current = e, at(e), R(!0), Kt();
|
|
603
607
|
}
|
|
604
608
|
}, [
|
|
605
|
-
|
|
609
|
+
lt,
|
|
606
610
|
E,
|
|
607
611
|
Ct,
|
|
608
612
|
ke,
|
|
@@ -614,95 +618,95 @@ function Cn({
|
|
|
614
618
|
ot.current = He;
|
|
615
619
|
const ct = w(() => {
|
|
616
620
|
dt.current = null, it.current = !1, ht.current !== null && (window.clearInterval(ht.current), ht.current = null), pt.current !== null && (window.clearTimeout(pt.current), pt.current = null);
|
|
617
|
-
}, []), he = w((
|
|
621
|
+
}, []), he = w((e) => {
|
|
618
622
|
ht.current !== null && window.clearInterval(ht.current);
|
|
619
|
-
const
|
|
623
|
+
const a = it.current ? yn : vn;
|
|
620
624
|
ht.current = window.setInterval(() => {
|
|
621
|
-
ot.current(
|
|
622
|
-
},
|
|
623
|
-
}, []), Ae = w((
|
|
624
|
-
dt.current !==
|
|
625
|
-
pt.current = null, dt.current ===
|
|
626
|
-
},
|
|
625
|
+
ot.current(e);
|
|
626
|
+
}, a);
|
|
627
|
+
}, []), Ae = w((e) => {
|
|
628
|
+
dt.current !== e && (ct(), dt.current = e, it.current = !1, ot.current(e), he(e), pt.current = window.setTimeout(() => {
|
|
629
|
+
pt.current = null, dt.current === e && (it.current = !0, he(e));
|
|
630
|
+
}, wn));
|
|
627
631
|
}, [ct, he]), Z = w(() => {
|
|
628
|
-
const
|
|
629
|
-
if (!
|
|
630
|
-
const
|
|
632
|
+
const e = G.current;
|
|
633
|
+
if (!e) return;
|
|
634
|
+
const a = d == null ? void 0 : d.assetId, u = a ? et.current.get(a) : void 0;
|
|
631
635
|
if (u != null && u.width && (u != null && u.height)) {
|
|
632
|
-
$t(ye(
|
|
636
|
+
$t(ye(e, u.width, u.height));
|
|
633
637
|
return;
|
|
634
638
|
}
|
|
635
639
|
const c = X.current;
|
|
636
|
-
if (c &&
|
|
637
|
-
const { width:
|
|
638
|
-
if (
|
|
639
|
-
wt(
|
|
640
|
+
if (c && a && (c.src === a || c.currentSrc === a)) {
|
|
641
|
+
const { width: M, height: m } = In(c);
|
|
642
|
+
if (M && m) {
|
|
643
|
+
wt(a, M, m), $t(ye(e, M, m));
|
|
640
644
|
return;
|
|
641
645
|
}
|
|
642
646
|
}
|
|
643
|
-
const x = _e(
|
|
647
|
+
const x = _e(e);
|
|
644
648
|
!x.width || !x.height || $t(x);
|
|
645
|
-
}, [d == null ? void 0 : d.assetId, wt]), Re = w((
|
|
646
|
-
if (X.current =
|
|
647
|
-
if (
|
|
648
|
-
|
|
649
|
+
}, [d == null ? void 0 : d.assetId, wt]), Re = w((e) => {
|
|
650
|
+
if (X.current = e, !!e) {
|
|
651
|
+
if (e instanceof HTMLVideoElement) {
|
|
652
|
+
e.readyState >= 1 && e.videoWidth > 0 && Z();
|
|
649
653
|
return;
|
|
650
654
|
}
|
|
651
|
-
|
|
655
|
+
e.complete && e.naturalWidth > 0 && Z();
|
|
652
656
|
}
|
|
653
|
-
}, [Z]),
|
|
654
|
-
Le(), Z(),
|
|
657
|
+
}, [Z]), zt = w(() => {
|
|
658
|
+
Le(), Z(), le((e) => e + 1);
|
|
655
659
|
}, [Le, Z]);
|
|
656
660
|
D(() => {
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
return
|
|
660
|
-
u.disconnect(), window.removeEventListener("resize",
|
|
661
|
+
zt();
|
|
662
|
+
const e = G.current, a = Wt.current, u = new ResizeObserver(() => zt());
|
|
663
|
+
return e && u.observe(e), a && u.observe(a), window.addEventListener("resize", zt), () => {
|
|
664
|
+
u.disconnect(), window.removeEventListener("resize", zt);
|
|
661
665
|
};
|
|
662
|
-
}, [
|
|
666
|
+
}, [zt, r, ie]), Pt(() => {
|
|
663
667
|
if (!d) return;
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
666
|
-
if (
|
|
668
|
+
const e = X.current;
|
|
669
|
+
if (e) {
|
|
670
|
+
if (e instanceof HTMLImageElement && e.complete && e.naturalWidth > 0) {
|
|
667
671
|
Z();
|
|
668
672
|
return;
|
|
669
673
|
}
|
|
670
|
-
|
|
674
|
+
e instanceof HTMLVideoElement && e.readyState >= 1 && e.videoWidth > 0 && Z();
|
|
671
675
|
}
|
|
672
676
|
}, [d == null ? void 0 : d.assetId, r, Z]), D(() => {
|
|
673
677
|
Ut();
|
|
674
678
|
}, [Ut, ut]), D(() => {
|
|
675
|
-
const
|
|
676
|
-
!(c != null && c.assetId) ||
|
|
679
|
+
const e = /* @__PURE__ */ new Set(), a = [], u = (c) => {
|
|
680
|
+
!(c != null && c.assetId) || e.has(c.assetId) || (e.add(c.assetId), a.push(c));
|
|
677
681
|
};
|
|
678
|
-
|
|
679
|
-
et.current.has(c.assetId) ||
|
|
682
|
+
n.forEach(u), b.forEach((c) => c.items.forEach(u)), a.forEach((c) => {
|
|
683
|
+
et.current.has(c.assetId) || Tn(c, wt);
|
|
680
684
|
});
|
|
681
|
-
}, [
|
|
685
|
+
}, [n, b, wt]), D(() => {
|
|
682
686
|
if (g !== "opening" || !E) return;
|
|
683
687
|
if (!st) {
|
|
684
688
|
It("open");
|
|
685
689
|
return;
|
|
686
690
|
}
|
|
687
691
|
ce(!1);
|
|
688
|
-
const
|
|
692
|
+
const e = requestAnimationFrame(() => {
|
|
689
693
|
requestAnimationFrame(() => {
|
|
690
694
|
ce(!0), It("open");
|
|
691
695
|
});
|
|
692
696
|
});
|
|
693
|
-
return () => cancelAnimationFrame(
|
|
697
|
+
return () => cancelAnimationFrame(e);
|
|
694
698
|
}, [g, E, st]), D(() => {
|
|
695
699
|
if (g !== "closing") return;
|
|
696
|
-
const
|
|
697
|
-
return () => clearTimeout(
|
|
700
|
+
const e = setTimeout(() => Vt(), Q);
|
|
701
|
+
return () => clearTimeout(e);
|
|
698
702
|
}, [g, Vt]), D(() => () => {
|
|
699
703
|
L();
|
|
700
704
|
}, [L]), Pt(() => {
|
|
701
|
-
be.current === r && Se.current === (d == null ? void 0 : d.assetId) || (L(), _.current = null,
|
|
705
|
+
be.current === r && Se.current === (d == null ? void 0 : d.assetId) || (L(), _.current = null, at(null), Tt(null), kt(null), Lt(0), v(0), R(!1), $e(!1), Ht(!1), rt.current = 0, k.current = 0, C.current = "none", F.current = !1, nt.current = null, yt.current = !1, X.current = null, Ut(), be.current = r, Se.current = d == null ? void 0 : d.assetId);
|
|
702
706
|
}, [r, d == null ? void 0 : d.assetId, R, L, Ut]), Pt(() => {
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
ot.current(
|
|
707
|
+
const e = St.current;
|
|
708
|
+
e !== null && (St.current = null, requestAnimationFrame(() => {
|
|
709
|
+
ot.current(e);
|
|
706
710
|
}));
|
|
707
711
|
}, [r, P, d == null ? void 0 : d.assetId]), Pt(() => {
|
|
708
712
|
if (g === "opening") {
|
|
@@ -715,28 +719,28 @@ function Cn({
|
|
|
715
719
|
return;
|
|
716
720
|
}
|
|
717
721
|
se(!1);
|
|
718
|
-
const
|
|
722
|
+
const e = requestAnimationFrame(() => {
|
|
719
723
|
requestAnimationFrame(() => {
|
|
720
724
|
se(!0), Gt.current = !0;
|
|
721
725
|
});
|
|
722
726
|
});
|
|
723
|
-
return () => cancelAnimationFrame(
|
|
727
|
+
return () => cancelAnimationFrame(e);
|
|
724
728
|
}, [g, H == null ? void 0 : H.assetId, A == null ? void 0 : A.assetId]), D(() => {
|
|
725
729
|
if (g !== "open") return;
|
|
726
|
-
const
|
|
730
|
+
const e = () => {
|
|
727
731
|
const m = (T) => {
|
|
728
732
|
T.stopPropagation(), T.preventDefault(), document.removeEventListener("click", m, !0);
|
|
729
733
|
};
|
|
730
734
|
document.addEventListener("click", m, !0);
|
|
731
|
-
},
|
|
735
|
+
}, a = (m) => {
|
|
732
736
|
const T = m < 0 ? 1 : -1;
|
|
733
|
-
L(), Zt(T), _.current = T,
|
|
737
|
+
L(), Zt(T), _.current = T, at(T), R(!0), Kt();
|
|
734
738
|
}, u = (m) => {
|
|
735
|
-
if (Math.abs(m) >
|
|
736
|
-
|
|
739
|
+
if (Math.abs(m) > mn && lt) {
|
|
740
|
+
a(m);
|
|
737
741
|
return;
|
|
738
742
|
}
|
|
739
|
-
_.current = null,
|
|
743
|
+
_.current = null, at(null), Tt(null), kt(null), R(!0), v(0), Ie();
|
|
740
744
|
}, c = (m) => {
|
|
741
745
|
if (m.touches.length !== 1 || xt.current) return;
|
|
742
746
|
const T = m.touches[0];
|
|
@@ -747,7 +751,7 @@ function Cn({
|
|
|
747
751
|
if (C.current === "none") {
|
|
748
752
|
if (Math.abs(K) < 10 && Math.abs(J) < 10) return;
|
|
749
753
|
if (Math.abs(K) > Math.abs(J)) {
|
|
750
|
-
if (!
|
|
754
|
+
if (!lt) return;
|
|
751
755
|
C.current = "horizontal";
|
|
752
756
|
} else if (J > 0) {
|
|
753
757
|
if (!ue) return;
|
|
@@ -760,57 +764,57 @@ function Cn({
|
|
|
760
764
|
return;
|
|
761
765
|
}
|
|
762
766
|
C.current === "vertical" && (F.current = !0, Ht(!0), rt.current = J, Lt(J), m.preventDefault());
|
|
763
|
-
},
|
|
767
|
+
}, M = () => {
|
|
764
768
|
if (!nt.current) return;
|
|
765
769
|
const m = C.current, T = F.current;
|
|
766
770
|
if (T && m === "horizontal")
|
|
767
|
-
u(k.current),
|
|
771
|
+
u(k.current), e();
|
|
768
772
|
else if (T && m === "vertical") {
|
|
769
773
|
const K = rt.current;
|
|
770
|
-
if (ue && K >
|
|
774
|
+
if (ue && K > gn) {
|
|
771
775
|
const J = window.innerHeight;
|
|
772
776
|
rt.current = J, $e(!0), Lt(J), It("closing");
|
|
773
777
|
} else
|
|
774
778
|
rt.current = 0, Lt(0);
|
|
775
|
-
|
|
776
|
-
} else m === "horizontal" && Math.abs(k.current) > 0 && (u(k.current),
|
|
779
|
+
e();
|
|
780
|
+
} else m === "horizontal" && Math.abs(k.current) > 0 && (u(k.current), e());
|
|
777
781
|
nt.current = null, C.current = "none", k.current = 0, F.current = !1, Ht(!1);
|
|
778
782
|
};
|
|
779
|
-
return document.addEventListener("touchstart", c, { passive: !0 }), document.addEventListener("touchmove", x, { passive: !1 }), document.addEventListener("touchend",
|
|
780
|
-
document.removeEventListener("touchstart", c), document.removeEventListener("touchmove", x), document.removeEventListener("touchend",
|
|
783
|
+
return document.addEventListener("touchstart", c, { passive: !0 }), document.addEventListener("touchmove", x, { passive: !1 }), document.addEventListener("touchend", M), document.addEventListener("touchcancel", M), () => {
|
|
784
|
+
document.removeEventListener("touchstart", c), document.removeEventListener("touchmove", x), document.removeEventListener("touchend", M), document.removeEventListener("touchcancel", M);
|
|
781
785
|
};
|
|
782
|
-
}, [g,
|
|
786
|
+
}, [g, lt, R, Ie, L, ue, Kt, Zt]);
|
|
783
787
|
const pe = w(() => {
|
|
784
|
-
const
|
|
785
|
-
|
|
788
|
+
const e = (vt == null ? void 0 : vt()) ?? st ?? null;
|
|
789
|
+
e && E && (Xe(e), ce(!0)), It("closing");
|
|
786
790
|
}, [vt, st, E]);
|
|
787
791
|
D(() => {
|
|
788
|
-
const
|
|
792
|
+
const e = (c) => {
|
|
789
793
|
if (c.key === "Escape") {
|
|
790
|
-
if (
|
|
794
|
+
if (l && s || g === "closing") return;
|
|
791
795
|
ct(), pe();
|
|
792
796
|
return;
|
|
793
797
|
}
|
|
794
|
-
if (c.key !== "ArrowLeft" && c.key !== "ArrowRight" || g !== "open" || !
|
|
798
|
+
if (c.key !== "ArrowLeft" && c.key !== "ArrowRight" || g !== "open" || !lt) return;
|
|
795
799
|
c.preventDefault();
|
|
796
800
|
const x = c.key === "ArrowLeft" ? -1 : 1;
|
|
797
801
|
c.repeat && dt.current === x || Ae(x);
|
|
798
|
-
},
|
|
802
|
+
}, a = (c) => {
|
|
799
803
|
if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
|
|
800
804
|
const x = c.key === "ArrowLeft" ? -1 : 1;
|
|
801
805
|
dt.current === x && ct();
|
|
802
806
|
}, u = () => {
|
|
803
807
|
ct();
|
|
804
808
|
};
|
|
805
|
-
return window.addEventListener("keydown",
|
|
806
|
-
window.removeEventListener("keydown",
|
|
809
|
+
return window.addEventListener("keydown", e), window.addEventListener("keyup", a), window.addEventListener("blur", u), () => {
|
|
810
|
+
window.removeEventListener("keydown", e), window.removeEventListener("keyup", a), window.removeEventListener("blur", u), ct();
|
|
807
811
|
};
|
|
808
812
|
}, [
|
|
809
813
|
g,
|
|
810
|
-
|
|
814
|
+
l,
|
|
811
815
|
s,
|
|
812
816
|
pe,
|
|
813
|
-
|
|
817
|
+
lt,
|
|
814
818
|
Ae,
|
|
815
819
|
ct
|
|
816
820
|
]), D(() => {
|
|
@@ -818,15 +822,15 @@ function Cn({
|
|
|
818
822
|
}, [g, ct]);
|
|
819
823
|
const Ce = () => {
|
|
820
824
|
g === "closing" || p || pe();
|
|
821
|
-
},
|
|
822
|
-
if (!(
|
|
825
|
+
}, O = g === "open", Jt = g === "closing", Je = q > 0 ? Math.max(0, 1 - q / 500) : 1, Qe = q > 0 ? Math.max(0.35, 1 - q / 500) : 1, Et = w((e) => {
|
|
826
|
+
if (!(e.propertyName !== "transform" || !xt.current)) {
|
|
823
827
|
if (_.current !== null) {
|
|
824
828
|
Ct();
|
|
825
829
|
return;
|
|
826
830
|
}
|
|
827
831
|
L(), R(!1);
|
|
828
832
|
}
|
|
829
|
-
}, [L, R, Ct]), ge = g === "closing" ? Ge ?? st : st, Pe = ge && E && (g === "opening" || Jt) ?
|
|
833
|
+
}, [L, R, Ct]), ge = g === "closing" ? Ge ?? st : st, Pe = ge && E && (g === "opening" || Jt) ? xn(ge, E) : void 0, tn = U && d ? Te(d, "center") : q > 0 ? `translateY(${q}px)` : Pe, V = E ? te(E, N) : null, Ee = !!(ge && E), en = Ee && (g === "closing" || g === "open" && Be), Ne = {
|
|
830
834
|
position: "absolute",
|
|
831
835
|
top: V == null ? void 0 : V.top,
|
|
832
836
|
left: V == null ? void 0 : V.left,
|
|
@@ -836,9 +840,9 @@ function Cn({
|
|
|
836
840
|
transformOrigin: "top left",
|
|
837
841
|
transform: tn,
|
|
838
842
|
opacity: q > 0 ? Qe : Ee ? 1 : g === "opening" || Jt ? 0 : 1,
|
|
839
|
-
transition: Y && !S ? "none" : S ? `transform ${_t}ms ${
|
|
840
|
-
pointerEvents: Xt &&
|
|
841
|
-
touchAction: Xt &&
|
|
843
|
+
transition: Y && !S ? "none" : S ? `transform ${_t}ms ${B}` : qe ? `transform ${Q}ms ${B}, opacity ${Q}ms ${B}` : en ? `transform ${Q}ms ${B}` : g === "opening" || Jt ? `opacity ${Q}ms ${B}` : "none",
|
|
844
|
+
pointerEvents: Xt && O && !U ? "auto" : "none",
|
|
845
|
+
touchAction: Xt && O ? "none" : void 0,
|
|
842
846
|
zIndex: 1,
|
|
843
847
|
overflow: Xt ? "hidden" : void 0
|
|
844
848
|
}, nn = {
|
|
@@ -846,13 +850,13 @@ function Cn({
|
|
|
846
850
|
height: "100%",
|
|
847
851
|
display: "block",
|
|
848
852
|
objectFit: "contain",
|
|
849
|
-
pointerEvents:
|
|
850
|
-
}, Qt = (
|
|
851
|
-
const c = Rt(
|
|
853
|
+
pointerEvents: O && !U ? "auto" : "none"
|
|
854
|
+
}, Qt = (e, a, u = "adjacent") => {
|
|
855
|
+
const c = Rt(e);
|
|
852
856
|
if (!c) return { display: "none" };
|
|
853
|
-
const x = u === "far" ?
|
|
854
|
-
start: u === "far" ? re(c,
|
|
855
|
-
}, m = te(
|
|
857
|
+
const x = u === "far" ? a === "left" ? "far-left" : "far-right" : a === "left" ? "left-adjacent" : "right-adjacent", { start: M } = z !== null ? Me(c, x, z, N) : {
|
|
858
|
+
start: u === "far" ? re(c, a, N) : Nt(c, a, N)
|
|
859
|
+
}, m = te(M, N), T = Te(e, x), K = !U && u === "adjacent" && O && !xe ? Cn(c, a, N) : null, J = u === "far" && U && z === (a === "left" ? -1 : 1), rn = Y && !S ? !1 : S, on = u === "adjacent" && O && xe && !U;
|
|
856
860
|
return {
|
|
857
861
|
position: "absolute",
|
|
858
862
|
top: m.top,
|
|
@@ -861,30 +865,30 @@ function Cn({
|
|
|
861
865
|
height: m.height,
|
|
862
866
|
objectFit: "contain",
|
|
863
867
|
transform: T ?? (K ? `translate(${K.x}px, ${K.y}px)` : void 0),
|
|
864
|
-
opacity: u === "far" ?
|
|
865
|
-
transition: rn ? u === "far" ? `transform ${_t}ms ${
|
|
868
|
+
opacity: u === "far" ? O && J ? 1 : 0 : O ? 1 : 0,
|
|
869
|
+
transition: rn ? u === "far" ? `transform ${_t}ms ${B}` : `transform ${_t}ms ${B}, opacity ${Q}ms ${B}` : on ? `transform ${Q}ms ${B}` : g === "opening" || Jt ? `opacity ${Q}ms ${B}` : "none",
|
|
866
870
|
pointerEvents: "none",
|
|
867
871
|
zIndex: 1
|
|
868
872
|
};
|
|
869
|
-
}, Fe = (
|
|
870
|
-
const u = Rt(
|
|
871
|
-
return u ?
|
|
872
|
-
}, We = (
|
|
873
|
+
}, Fe = (e, a) => {
|
|
874
|
+
const u = Rt(e);
|
|
875
|
+
return u ? An(Nt(u, a, N), a, N) : null;
|
|
876
|
+
}, We = (e) => (a) => {
|
|
873
877
|
if (!p) {
|
|
874
878
|
if (yt.current) {
|
|
875
879
|
yt.current = !1;
|
|
876
880
|
return;
|
|
877
881
|
}
|
|
878
|
-
|
|
882
|
+
a.stopPropagation(), He(e);
|
|
879
883
|
}
|
|
880
|
-
},
|
|
884
|
+
}, ze = H ? Fe(H, "left") : null, Oe = A ? Fe(A, "right") : null, Ot = ze ? te(ze, N) : null, Dt = Oe ? te(Oe, N) : null;
|
|
881
885
|
return /* @__PURE__ */ bt(
|
|
882
886
|
"div",
|
|
883
887
|
{
|
|
884
888
|
ref: Wt,
|
|
885
889
|
className: [
|
|
886
890
|
`${t}-lightbox`,
|
|
887
|
-
|
|
891
|
+
l ? `${t}-lightbox-editor` : "",
|
|
888
892
|
p ? `${t}-lightbox-edit-mode` : ""
|
|
889
893
|
].filter(Boolean).join(" "),
|
|
890
894
|
style: {
|
|
@@ -899,8 +903,8 @@ function Cn({
|
|
|
899
903
|
position: "absolute",
|
|
900
904
|
inset: 0,
|
|
901
905
|
background: i.backgroundColor ?? "#FFFFFF",
|
|
902
|
-
opacity:
|
|
903
|
-
transition: Y ? "none" : `opacity ${Q}ms ${
|
|
906
|
+
opacity: O ? Je : 0,
|
|
907
|
+
transition: Y ? "none" : `opacity ${Q}ms ${B}`,
|
|
904
908
|
pointerEvents: "none"
|
|
905
909
|
}
|
|
906
910
|
}
|
|
@@ -943,17 +947,17 @@ function Cn({
|
|
|
943
947
|
style: {
|
|
944
948
|
position: "absolute",
|
|
945
949
|
inset: 0,
|
|
946
|
-
opacity:
|
|
947
|
-
transition: Y ? "none" : `opacity ${Q}ms ${
|
|
950
|
+
opacity: O ? 1 : 0,
|
|
951
|
+
transition: Y ? "none" : `opacity ${Q}ms ${B}`,
|
|
948
952
|
pointerEvents: "none"
|
|
949
953
|
},
|
|
950
954
|
children: /* @__PURE__ */ h(
|
|
951
|
-
|
|
955
|
+
hn,
|
|
952
956
|
{
|
|
953
957
|
prefix: t,
|
|
954
958
|
entry: o,
|
|
955
959
|
settings: i,
|
|
956
|
-
isEditor:
|
|
960
|
+
isEditor: l,
|
|
957
961
|
isEditMode: p,
|
|
958
962
|
isPreviewMode: s,
|
|
959
963
|
onClose: Ce
|
|
@@ -962,7 +966,7 @@ function Cn({
|
|
|
962
966
|
}
|
|
963
967
|
)
|
|
964
968
|
] }),
|
|
965
|
-
|
|
969
|
+
O && qt && /* @__PURE__ */ h(
|
|
966
970
|
ee,
|
|
967
971
|
{
|
|
968
972
|
media: qt,
|
|
@@ -972,7 +976,7 @@ function Cn({
|
|
|
972
976
|
},
|
|
973
977
|
`far-prev-${qt.assetId}`
|
|
974
978
|
),
|
|
975
|
-
|
|
979
|
+
O && H && /* @__PURE__ */ bt(ve, { children: [
|
|
976
980
|
/* @__PURE__ */ h(
|
|
977
981
|
ee,
|
|
978
982
|
{
|
|
@@ -983,15 +987,15 @@ function Cn({
|
|
|
983
987
|
},
|
|
984
988
|
`prev-${H.assetId}`
|
|
985
989
|
),
|
|
986
|
-
|
|
990
|
+
Ot && /* @__PURE__ */ h(
|
|
987
991
|
"div",
|
|
988
992
|
{
|
|
989
993
|
style: {
|
|
990
994
|
position: "absolute",
|
|
991
|
-
top:
|
|
992
|
-
left:
|
|
993
|
-
width:
|
|
994
|
-
height:
|
|
995
|
+
top: Ot.top,
|
|
996
|
+
left: Ot.left,
|
|
997
|
+
width: Ot.width,
|
|
998
|
+
height: Ot.height,
|
|
995
999
|
cursor: p || Y ? "default" : "pointer",
|
|
996
1000
|
pointerEvents: p || Y ? "none" : "auto",
|
|
997
1001
|
zIndex: 3
|
|
@@ -1000,7 +1004,7 @@ function Cn({
|
|
|
1000
1004
|
}
|
|
1001
1005
|
)
|
|
1002
1006
|
] }),
|
|
1003
|
-
|
|
1007
|
+
O && A && /* @__PURE__ */ bt(ve, { children: [
|
|
1004
1008
|
/* @__PURE__ */ h(
|
|
1005
1009
|
ee,
|
|
1006
1010
|
{
|
|
@@ -1028,7 +1032,7 @@ function Cn({
|
|
|
1028
1032
|
}
|
|
1029
1033
|
)
|
|
1030
1034
|
] }),
|
|
1031
|
-
|
|
1035
|
+
O && Yt && /* @__PURE__ */ h(
|
|
1032
1036
|
ee,
|
|
1033
1037
|
{
|
|
1034
1038
|
media: Yt,
|
|
@@ -1039,7 +1043,7 @@ function Cn({
|
|
|
1039
1043
|
`far-next-${Yt.assetId}`
|
|
1040
1044
|
),
|
|
1041
1045
|
E && d && (Xt ? /* @__PURE__ */ h(
|
|
1042
|
-
|
|
1046
|
+
En,
|
|
1043
1047
|
{
|
|
1044
1048
|
src: d.assetId,
|
|
1045
1049
|
phase: g,
|
|
@@ -1066,8 +1070,8 @@ function Cn({
|
|
|
1066
1070
|
}
|
|
1067
1071
|
);
|
|
1068
1072
|
}
|
|
1069
|
-
const
|
|
1070
|
-
function
|
|
1073
|
+
const Fn = 20, Wn = 0.18;
|
|
1074
|
+
function zn(t) {
|
|
1071
1075
|
return `
|
|
1072
1076
|
.${t}-wrapper {
|
|
1073
1077
|
box-sizing: border-box;
|
|
@@ -1155,26 +1159,26 @@ function Fn(t) {
|
|
|
1155
1159
|
z-index: 2;
|
|
1156
1160
|
pointer-events: auto;
|
|
1157
1161
|
}
|
|
1158
|
-
${
|
|
1162
|
+
${pn(t)}
|
|
1159
1163
|
`;
|
|
1160
1164
|
}
|
|
1161
|
-
function
|
|
1162
|
-
const { imageDisplay:
|
|
1165
|
+
function On(t) {
|
|
1166
|
+
const { imageDisplay: n } = t ?? {}, r = (n == null ? void 0 : n.ratioValue) ?? "1:1", o = (n == null ? void 0 : n.reversed) ?? !1, [i, l] = r.split(":").map(Number), p = o ? l : i, s = o ? i : l;
|
|
1163
1167
|
return s > 0 ? p / s : 1;
|
|
1164
1168
|
}
|
|
1165
|
-
function
|
|
1166
|
-
const
|
|
1167
|
-
return !
|
|
1169
|
+
function Dn(t) {
|
|
1170
|
+
const n = t instanceof HTMLVideoElement ? t.videoWidth : t.naturalWidth, r = t instanceof HTMLVideoElement ? t.videoHeight : t.naturalHeight;
|
|
1171
|
+
return !n || !r ? null : n / r;
|
|
1168
1172
|
}
|
|
1169
|
-
function
|
|
1173
|
+
function _n(t, n, r) {
|
|
1170
1174
|
const o = (t == null ? void 0 : t.titleFontSize) ?? 0.07, i = (t == null ? void 0 : t.titleLineHeight) ?? o;
|
|
1171
1175
|
return {
|
|
1172
|
-
[`--${
|
|
1173
|
-
[`--${
|
|
1174
|
-
[`--${
|
|
1176
|
+
[`--${n}-line-height`]: ne(i, r ?? !1),
|
|
1177
|
+
[`--${n}-image-inline-gap`]: ne(o * Wn, r ?? !1),
|
|
1178
|
+
[`--${n}-image-aspect`]: On(t)
|
|
1175
1179
|
};
|
|
1176
1180
|
}
|
|
1177
|
-
function
|
|
1181
|
+
function jn(t, n) {
|
|
1178
1182
|
var o, i;
|
|
1179
1183
|
const r = {
|
|
1180
1184
|
fontSettings: {
|
|
@@ -1189,48 +1193,48 @@ function Dn(t, e) {
|
|
|
1189
1193
|
textAppearance: t == null ? void 0 : t.titleTextAppearance,
|
|
1190
1194
|
color: (t == null ? void 0 : t.titleColor) ?? "#000000"
|
|
1191
1195
|
};
|
|
1192
|
-
return
|
|
1196
|
+
return fn(r, n);
|
|
1193
1197
|
}
|
|
1194
|
-
function
|
|
1198
|
+
function Vn(t) {
|
|
1195
1199
|
var i;
|
|
1196
|
-
const
|
|
1197
|
-
objectFit:
|
|
1200
|
+
const n = ((i = t == null ? void 0 : t.imageDisplay) == null ? void 0 : i.display) === "cover", r = ((t == null ? void 0 : t.lightbox) ?? "on") === "on", o = {
|
|
1201
|
+
objectFit: n ? "cover" : "contain",
|
|
1198
1202
|
pointerEvents: "auto",
|
|
1199
1203
|
...r ? { cursor: "pointer" } : null
|
|
1200
1204
|
};
|
|
1201
1205
|
return {
|
|
1202
|
-
objectFitMode:
|
|
1206
|
+
objectFitMode: n ? "cover" : "contain",
|
|
1203
1207
|
imageStyle: o
|
|
1204
1208
|
};
|
|
1205
1209
|
}
|
|
1206
|
-
function
|
|
1207
|
-
if (!(!t || !
|
|
1210
|
+
function Mn(t, n, r, o, i, l) {
|
|
1211
|
+
if (!(!t || !n))
|
|
1208
1212
|
return (p) => {
|
|
1209
1213
|
var I;
|
|
1210
1214
|
const s = ((I = p.currentTarget.closest(`.${o}-item`)) == null ? void 0 : I.querySelector(
|
|
1211
1215
|
`[data-waterfall-index="${r}"]`
|
|
1212
1216
|
)) ?? (p.currentTarget instanceof HTMLImageElement || p.currentTarget instanceof HTMLVideoElement ? p.currentTarget : null);
|
|
1213
|
-
|
|
1217
|
+
l(
|
|
1214
1218
|
r,
|
|
1215
1219
|
s ? je(s, i) : void 0
|
|
1216
1220
|
);
|
|
1217
1221
|
};
|
|
1218
1222
|
}
|
|
1219
|
-
function
|
|
1223
|
+
function Pn({
|
|
1220
1224
|
settings: t,
|
|
1221
|
-
content:
|
|
1225
|
+
content: n,
|
|
1222
1226
|
isEditor: r,
|
|
1223
1227
|
isPreviewMode: o,
|
|
1224
1228
|
isEditMode: i,
|
|
1225
|
-
layoutId:
|
|
1229
|
+
layoutId: l,
|
|
1226
1230
|
portalId: p
|
|
1227
1231
|
}) {
|
|
1228
|
-
const { prefix: s } = sn(), I = me(() =>
|
|
1232
|
+
const { prefix: s } = sn(), I = me(() => zn(s), [s]), b = n ?? [], P = (t == null ? void 0 : t.type) ?? "a", ie = typeof (t == null ? void 0 : t.wrapperWidth) == "number" ? t.wrapperWidth : 1, st = typeof (t == null ? void 0 : t.horizontalGap) == "number" ? t.horizontalGap : 0, vt = ne(st, r ?? !1), Vt = `max(${vt}, ${Fn}px)`, { objectFitMode: tt, imageStyle: Ft } = Vn(t), Wt = jn(t, r), G = y(null), [X, et] = $(!1), [ut, Mt] = $([]), [nt, rt] = $(0), [k, C] = $(0), [F, yt] = $(null), [xt, ft] = $({ title1: "", title2: "", title3: "" }), _ = (!r || o) && !X, St = (t == null ? void 0 : t.imageHoverEffect) ?? { sizeType: "none", value: 120 }, ot = St.sizeType ?? "none", dt = _ && ot !== "none" ? `${s}-item-image-hover-${ot}` : void 0, ht = (St.value ?? 120) / 100, pt = w((f) => {
|
|
1229
1233
|
!f || ot !== "scale" || (f.style.transformOrigin = cn(f));
|
|
1230
1234
|
}, [ot]), it = w((f) => {
|
|
1231
1235
|
if (f) {
|
|
1232
1236
|
if (tt === "contain") {
|
|
1233
|
-
const v =
|
|
1237
|
+
const v = Dn(f);
|
|
1234
1238
|
if (v) {
|
|
1235
1239
|
const S = f.closest(`.${s}-item-image`);
|
|
1236
1240
|
S instanceof HTMLElement && S.style.setProperty(`--${s}-item-media-aspect`, String(v));
|
|
@@ -1241,26 +1245,26 @@ function Zn({
|
|
|
1241
1245
|
}, [s, pt, tt]), E = {
|
|
1242
1246
|
width: ne(ie, r ?? !1),
|
|
1243
1247
|
...Wt,
|
|
1244
|
-
...
|
|
1248
|
+
..._n(t, s, r),
|
|
1245
1249
|
[`--${s}-image-hover-scale`]: String(ht)
|
|
1246
1250
|
}, $t = (() => {
|
|
1247
1251
|
const f = {}, v = G.current ? getComputedStyle(G.current).getPropertyValue("--cntrl-article-width").trim() : "";
|
|
1248
1252
|
return v && (f["--cntrl-article-width"] = v), f;
|
|
1249
|
-
})(), N = ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && (!r || o || i), W = me(() =>
|
|
1253
|
+
})(), N = ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && (!r || o || i), W = me(() => bn(b), [b]), ae = me(() => kn(b), [b]), le = (f, v) => {
|
|
1250
1254
|
if (((t == null ? void 0 : t.lightbox) ?? "on") === "off" || r && !i && !o) return;
|
|
1251
|
-
const S = W.findIndex((
|
|
1255
|
+
const S = W.findIndex((z) => z.gridIndex === f);
|
|
1252
1256
|
if (S < 0) return;
|
|
1253
1257
|
const j = W[S];
|
|
1254
|
-
C(S),
|
|
1258
|
+
C(S), Mt(j.items), rt(0), ft(j.entry), yt(v ?? null), et(!0);
|
|
1255
1259
|
}, g = w(() => {
|
|
1256
1260
|
et(!1), yt(null);
|
|
1257
1261
|
}, []), It = w(() => {
|
|
1258
1262
|
const f = W[k];
|
|
1259
|
-
return !f || !G.current ? F :
|
|
1263
|
+
return !f || !G.current ? F : $n(G.current, f.gridIndex, tt) ?? F;
|
|
1260
1264
|
}, [W, k, F, tt]), q = w((f) => {
|
|
1261
1265
|
if (W.length > 1) {
|
|
1262
1266
|
const v = W.length, S = (k + f + v) % v, j = W[S];
|
|
1263
|
-
C(S),
|
|
1267
|
+
C(S), Mt(j.items), rt(0), ft(j.entry);
|
|
1264
1268
|
return;
|
|
1265
1269
|
}
|
|
1266
1270
|
rt((v) => (v + f + ut.length) % ut.length);
|
|
@@ -1277,16 +1281,16 @@ function Zn({
|
|
|
1277
1281
|
((t == null ? void 0 : t.lightbox) ?? "on") === "off" && et(!1);
|
|
1278
1282
|
}, [t == null ? void 0 : t.lightbox]), /* @__PURE__ */ bt(ve, { children: [
|
|
1279
1283
|
/* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: I } }),
|
|
1280
|
-
/* @__PURE__ */ h(
|
|
1284
|
+
/* @__PURE__ */ h(Hn, { mediaList: ae }),
|
|
1281
1285
|
/* @__PURE__ */ h("div", { ref: G, className: `${s}-wrapper ${s}-type-${P}`, style: E, children: b.map((f, v) => {
|
|
1282
|
-
var
|
|
1283
|
-
const S = !!((
|
|
1286
|
+
var z, at;
|
|
1287
|
+
const S = !!((z = f.image) != null && z.assetId), j = Mn(
|
|
1284
1288
|
!!N,
|
|
1285
1289
|
S,
|
|
1286
1290
|
v,
|
|
1287
1291
|
s,
|
|
1288
1292
|
tt,
|
|
1289
|
-
|
|
1293
|
+
le
|
|
1290
1294
|
);
|
|
1291
1295
|
return /* @__PURE__ */ bt(
|
|
1292
1296
|
"div",
|
|
@@ -1302,7 +1306,7 @@ function Zn({
|
|
|
1302
1306
|
children: f.title
|
|
1303
1307
|
}
|
|
1304
1308
|
) : null,
|
|
1305
|
-
(
|
|
1309
|
+
(at = f.image) != null && at.assetId ? /* @__PURE__ */ h(
|
|
1306
1310
|
"span",
|
|
1307
1311
|
{
|
|
1308
1312
|
className: [
|
|
@@ -1311,7 +1315,7 @@ function Zn({
|
|
|
1311
1315
|
dt
|
|
1312
1316
|
].filter(Boolean).join(" "),
|
|
1313
1317
|
children: f.image.type === "video" ? /* @__PURE__ */ h(
|
|
1314
|
-
|
|
1318
|
+
un,
|
|
1315
1319
|
{
|
|
1316
1320
|
ref: it,
|
|
1317
1321
|
src: f.image.assetId,
|
|
@@ -1322,7 +1326,7 @@ function Zn({
|
|
|
1322
1326
|
loop: !0,
|
|
1323
1327
|
autoPlay: !0,
|
|
1324
1328
|
onClick: j,
|
|
1325
|
-
|
|
1329
|
+
onLoadedMetadata: (gt) => it(gt.currentTarget)
|
|
1326
1330
|
}
|
|
1327
1331
|
) : /* @__PURE__ */ h(
|
|
1328
1332
|
"img",
|
|
@@ -1367,9 +1371,9 @@ function Zn({
|
|
|
1367
1371
|
}) }),
|
|
1368
1372
|
X && ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && typeof document < "u" && t && (() => {
|
|
1369
1373
|
const f = (p ? document.getElementById(p) : null) ?? document.body;
|
|
1370
|
-
return
|
|
1374
|
+
return an(
|
|
1371
1375
|
/* @__PURE__ */ h("div", { style: $t, "data-selection": "none", children: /* @__PURE__ */ h(
|
|
1372
|
-
|
|
1376
|
+
Nn,
|
|
1373
1377
|
{
|
|
1374
1378
|
prefix: s,
|
|
1375
1379
|
items: ut,
|
|
@@ -1382,7 +1386,7 @@ function Zn({
|
|
|
1382
1386
|
canNavigate: Lt,
|
|
1383
1387
|
lightboxEntries: W,
|
|
1384
1388
|
entryIdx: k,
|
|
1385
|
-
layoutId:
|
|
1389
|
+
layoutId: l,
|
|
1386
1390
|
sourceRect: F,
|
|
1387
1391
|
resolveCloseSourceRect: It,
|
|
1388
1392
|
onClose: g,
|
|
@@ -1396,5 +1400,5 @@ function Zn({
|
|
|
1396
1400
|
] });
|
|
1397
1401
|
}
|
|
1398
1402
|
export {
|
|
1399
|
-
|
|
1403
|
+
Pn as Waterfall
|
|
1400
1404
|
};
|