@cntrl-site/components 1.0.102 → 1.0.104
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/ClickGallerie-D7g093HX.js +36 -0
- package/dist/{ClickGallerie-D_O1XhAO.mjs → ClickGallerie-QSOQjSdv.mjs} +92 -91
- package/dist/Components/ClickGallerie/ClickGallerie.d.ts +1 -0
- package/dist/Components/Scale/Scale.d.ts +2 -0
- package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
- package/dist/Components/utils/index.d.ts +1 -0
- package/dist/Components/utils/useLazyVideos.d.ts +15 -0
- package/dist/Grid-B2_o1dvz.mjs +1576 -0
- package/dist/Grid-Bq6bk2AQ.js +374 -0
- package/dist/{Helix-2Vr-9WBa.js → Helix-B7rxlvKq.js} +2 -2
- package/dist/{Helix-BmkAKT1G.mjs → Helix-BrKQzGX5.mjs} +53 -53
- package/dist/{Hive-BGMWinrW.mjs → Hive-BusARSOi.mjs} +114 -111
- package/dist/Hive-Dh5nKPGm.js +321 -0
- package/dist/LazyVideo-Cn_vmMq8.js +1 -0
- package/dist/LazyVideo-D8eVYFyw.mjs +15 -0
- package/dist/Marquee-CdtAqhQE.mjs +563 -0
- package/dist/Marquee-DUN8wUax.js +133 -0
- package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-BRqlbk4i.mjs} +55 -54
- package/dist/Mercury-C-O2VGkK.js +267 -0
- package/dist/{PretextComponent-C3YFICy8.js → PretextComponent-D5P0AjnL.js} +1 -1
- package/dist/{PretextComponent-Ct0newmn.mjs → PretextComponent-s4DDfmzY.mjs} +25 -16
- package/dist/Scale-Bg3bGICG.js +114 -0
- package/dist/Scale-TnkWtRrs.mjs +409 -0
- package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-DKuh4bnv.mjs} +299 -295
- package/dist/Waterfall-fdiHR0Rc.js +287 -0
- package/dist/{components-OE3ac1dr.js → components-DzNixU7Q.js} +1 -1
- package/dist/{components-w-jHX-2U.mjs → components-Yf9Zjska.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +8 -8
- 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/sources.js +260 -72
- package/dist/sources.mjs +264 -76
- package/dist/useLazyVideos-BbgdvELi.js +1 -0
- package/dist/useLazyVideos-CZLyNolX.mjs +72 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +14 -12
- package/package.json +5 -3
- package/dist/ClickGallerie-M9xdGR1G.js +0 -36
- 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/Mercury-BwF_XW2w.js +0 -267
- package/dist/Scale-976sjO8e.js +0 -111
- package/dist/Scale-rLNT4KAk.mjs +0 -345
- package/dist/Waterfall-DnPDHbCL.js +0 -287
package/dist/Scale-rLNT4KAk.mjs
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import { jsxs as D, Fragment as de, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as Be, useState as c, useRef as me, useCallback as fe, useEffect as E } from "react";
|
|
3
|
-
import S from "classnames";
|
|
4
|
-
import { u as Ee } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
|
-
const Oe = 100, _e = 70, f = "cubic-bezier(0.86, 0, 0.07, 1)";
|
|
6
|
-
function Ue(e) {
|
|
7
|
-
return `
|
|
8
|
-
.${e}-wrapper {
|
|
9
|
-
position: relative;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
}
|
|
14
|
-
.${e}-background {
|
|
15
|
-
position: absolute;
|
|
16
|
-
inset: 0;
|
|
17
|
-
z-index: 1;
|
|
18
|
-
pointer-events: none;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
}
|
|
21
|
-
.${e}-effect-image {
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
object-fit: cover;
|
|
25
|
-
display: block;
|
|
26
|
-
}
|
|
27
|
-
.${e}-stage {
|
|
28
|
-
position: absolute;
|
|
29
|
-
left: 50%;
|
|
30
|
-
top: 50%;
|
|
31
|
-
transform: translate(-50%, -50%) scale(var(--${e}-stage-scale, 1));
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
}
|
|
34
|
-
.${e}-foreground {
|
|
35
|
-
z-index: 2;
|
|
36
|
-
}
|
|
37
|
-
.${e}-incoming {
|
|
38
|
-
will-change: transform;
|
|
39
|
-
}
|
|
40
|
-
.${e}-incoming-next {
|
|
41
|
-
z-index: 4;
|
|
42
|
-
transition: transform var(--${e}-transition-ms) ${f};
|
|
43
|
-
}
|
|
44
|
-
.${e}-incoming-prev {
|
|
45
|
-
z-index: 4;
|
|
46
|
-
transition: transform var(--${e}-transition-ms) ${f};
|
|
47
|
-
}
|
|
48
|
-
.${e}-outgoing {
|
|
49
|
-
will-change: transform;
|
|
50
|
-
}
|
|
51
|
-
.${e}-outgoing-next {
|
|
52
|
-
z-index: 3;
|
|
53
|
-
transition: transform var(--${e}-transition-ms) ${f};
|
|
54
|
-
}
|
|
55
|
-
.${e}-outgoing-prev {
|
|
56
|
-
z-index: 3;
|
|
57
|
-
transition: transform var(--${e}-transition-ms) ${f};
|
|
58
|
-
}
|
|
59
|
-
.${e}-outgoing-next .${e}-effect-image {
|
|
60
|
-
transition: filter var(--${e}-transition-ms) ${f};
|
|
61
|
-
}
|
|
62
|
-
.${e}-outgoing-prev .${e}-effect-image {
|
|
63
|
-
transition: filter var(--${e}-transition-ms) ${f};
|
|
64
|
-
}
|
|
65
|
-
.${e}-incoming .${e}-effect-image {
|
|
66
|
-
transition: filter var(--${e}-transition-ms) ${f};
|
|
67
|
-
}
|
|
68
|
-
.${e}-background .${e}-effect-image {
|
|
69
|
-
transition: filter var(--${e}-transition-ms) ${f};
|
|
70
|
-
}
|
|
71
|
-
.${e}-snap .${e}-incoming,
|
|
72
|
-
.${e}-snap .${e}-outgoing,
|
|
73
|
-
.${e}-snap .${e}-outgoing .${e}-effect-image,
|
|
74
|
-
.${e}-snap .${e}-incoming .${e}-effect-image {
|
|
75
|
-
transition: none !important;
|
|
76
|
-
}
|
|
77
|
-
.${e}-nav {
|
|
78
|
-
position: absolute;
|
|
79
|
-
top: 0;
|
|
80
|
-
bottom: 0;
|
|
81
|
-
width: 50%;
|
|
82
|
-
z-index: 5;
|
|
83
|
-
margin: 0;
|
|
84
|
-
padding: 0;
|
|
85
|
-
border: none;
|
|
86
|
-
background: none;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
outline: none;
|
|
89
|
-
-webkit-tap-highlight-color: transparent;
|
|
90
|
-
}
|
|
91
|
-
.${e}-nav-prev {
|
|
92
|
-
left: 0;
|
|
93
|
-
cursor: w-resize;
|
|
94
|
-
}
|
|
95
|
-
.${e}-nav-next {
|
|
96
|
-
right: 0;
|
|
97
|
-
cursor: e-resize;
|
|
98
|
-
}
|
|
99
|
-
.${e}-nav:focus,
|
|
100
|
-
.${e}-nav:focus-visible {
|
|
101
|
-
outline: none;
|
|
102
|
-
}
|
|
103
|
-
.${e}-editor .${e}-nav {
|
|
104
|
-
cursor: default;
|
|
105
|
-
pointer-events: none;
|
|
106
|
-
}
|
|
107
|
-
.${e}-foreground {
|
|
108
|
-
pointer-events: none;
|
|
109
|
-
}
|
|
110
|
-
.${e}-image {
|
|
111
|
-
width: 100%;
|
|
112
|
-
height: 100%;
|
|
113
|
-
object-fit: contain;
|
|
114
|
-
display: block;
|
|
115
|
-
pointer-events: none;
|
|
116
|
-
}
|
|
117
|
-
`;
|
|
118
|
-
}
|
|
119
|
-
function Le(e) {
|
|
120
|
-
return e === "blur" ? _e : e === "greyscale" ? Oe : 0;
|
|
121
|
-
}
|
|
122
|
-
function M(e, n = 1, o = 1) {
|
|
123
|
-
const r = Le(e) * Math.max(0, Math.min(1, n));
|
|
124
|
-
if (e === "greyscale")
|
|
125
|
-
return `grayscale(${r}%)`;
|
|
126
|
-
if (e === "blur") {
|
|
127
|
-
const t = r / 4;
|
|
128
|
-
return t <= 0 ? "none" : `blur(${t / Math.max(o, 1)}px)`;
|
|
129
|
-
}
|
|
130
|
-
return "none";
|
|
131
|
-
}
|
|
132
|
-
function $e(e) {
|
|
133
|
-
return e <= 1 ? { backgroundIndex: 0, activeIndex: 0 } : { backgroundIndex: 0, activeIndex: 1 };
|
|
134
|
-
}
|
|
135
|
-
function je(e, n) {
|
|
136
|
-
return n <= 1 ? 0 : (e - 1 + n) % n;
|
|
137
|
-
}
|
|
138
|
-
function qe(e, n = 1) {
|
|
139
|
-
return !e || e.height === 0 ? n : e.width / e.height;
|
|
140
|
-
}
|
|
141
|
-
function De(e, n, o, r, t) {
|
|
142
|
-
if (e <= 0 || n <= 0)
|
|
143
|
-
return { widthPercent: r, heightPercent: t };
|
|
144
|
-
const O = e * r / 100, A = n * t / 100;
|
|
145
|
-
let y = O, p = y / o;
|
|
146
|
-
return p > A && (p = A, y = p * o), {
|
|
147
|
-
widthPercent: y / e * 100,
|
|
148
|
-
heightPercent: p / n * 100
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function xe(e, n, o) {
|
|
152
|
-
if (e <= 0 || n <= 0) return 1;
|
|
153
|
-
const r = e * o.widthPercent / 100, t = n * o.heightPercent / 100;
|
|
154
|
-
return r <= 0 || t <= 0 ? 1 : Math.max(e / r, n / t);
|
|
155
|
-
}
|
|
156
|
-
function pe(e) {
|
|
157
|
-
return {
|
|
158
|
-
width: `${e.widthPercent}%`,
|
|
159
|
-
height: `${e.heightPercent}%`
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function ve(e, n, o) {
|
|
163
|
-
return {
|
|
164
|
-
...pe(e),
|
|
165
|
-
[`--${o}-stage-scale`]: n
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
function Ge(e, n) {
|
|
169
|
-
[...new Set(e.filter(Boolean))].forEach((r) => {
|
|
170
|
-
const t = new Image();
|
|
171
|
-
t.onload = () => {
|
|
172
|
-
t.naturalWidth > 0 && t.naturalHeight > 0 && n(r, { width: t.naturalWidth, height: t.naturalHeight });
|
|
173
|
-
}, t.src = r;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
function Je({ settings: e, content: n, isEditor: o, isPreviewMode: r }) {
|
|
177
|
-
var ne, ie, ae, se, re, oe, ce;
|
|
178
|
-
const { prefix: t } = Ee(), O = Be(() => Ue(t), [t]), {
|
|
179
|
-
imageSize: A,
|
|
180
|
-
maxWidth: y,
|
|
181
|
-
maxHeight: p,
|
|
182
|
-
transition: Ie = 1e3,
|
|
183
|
-
bgImage: I = "greyscale"
|
|
184
|
-
} = e, i = n ?? [], G = $e(i.length), [g, H] = c(G.activeIndex), [W, _] = c(G.backgroundIndex), [w, U] = c(!1), [we, L] = c(!1), [Y, C] = c(null), [Z, R] = c(null), [be, z] = c(0), [Se, k] = c(1), [ye, N] = c("none"), [J, K] = c("next"), [Q, ze] = c({}), [u, ke] = c({ width: 0, height: 0 }), F = me(null), V = me(null), j = !o || !!r, X = A ?? 60, P = Math.max(10, Math.min(100, y ?? X)), ee = Math.max(10, Math.min(100, p ?? X)), q = Math.max(100, Ie), Ne = M(I), b = fe((s) => {
|
|
185
|
-
const a = qe(s ? Q[s] : void 0);
|
|
186
|
-
return De(
|
|
187
|
-
u.width,
|
|
188
|
-
u.height,
|
|
189
|
-
a,
|
|
190
|
-
P,
|
|
191
|
-
ee
|
|
192
|
-
);
|
|
193
|
-
}, [u.height, u.width, Q, ee, P]);
|
|
194
|
-
E(() => {
|
|
195
|
-
const s = V.current;
|
|
196
|
-
if (!s) return;
|
|
197
|
-
const a = new ResizeObserver(([h]) => {
|
|
198
|
-
const { width: m, height: v } = h.contentRect;
|
|
199
|
-
ke({ width: m, height: v });
|
|
200
|
-
});
|
|
201
|
-
return a.observe(s), () => a.disconnect();
|
|
202
|
-
}, []), E(() => {
|
|
203
|
-
const s = (n ?? []).map((a) => {
|
|
204
|
-
var h;
|
|
205
|
-
return (h = a.image) == null ? void 0 : h.assetId;
|
|
206
|
-
}).filter((a) => !!a);
|
|
207
|
-
Ge(s, (a, h) => {
|
|
208
|
-
ze((m) => {
|
|
209
|
-
var v, T;
|
|
210
|
-
return ((v = m[a]) == null ? void 0 : v.width) === h.width && ((T = m[a]) == null ? void 0 : T.height) === h.height ? m : { ...m, [a]: h };
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
}, [n]), E(() => {
|
|
214
|
-
const { backgroundIndex: s, activeIndex: a } = $e(i.length);
|
|
215
|
-
H(a), _(s), U(!1), L(!1), C(null), R(null), z(0), k(1), N("none"), K("next");
|
|
216
|
-
}, [i.length, n]), E(() => () => {
|
|
217
|
-
F.current && clearTimeout(F.current);
|
|
218
|
-
}, []);
|
|
219
|
-
const te = fe((s) => {
|
|
220
|
-
var le, ge, ue, he;
|
|
221
|
-
if (!j || w || i.length <= 1) return;
|
|
222
|
-
const a = s === "next" ? (g + 1) % i.length : (g - 1 + i.length) % i.length, h = b((ge = (le = i[g]) == null ? void 0 : le.image) == null ? void 0 : ge.assetId), m = b((he = (ue = i[a]) == null ? void 0 : ue.image) == null ? void 0 : he.assetId), v = xe(u.width, u.height, h), T = xe(u.width, u.height, m);
|
|
223
|
-
F.current && clearTimeout(F.current), K(s), L(!0), U(!0), s === "next" ? (C(g), R(a), z(0), k(1), N(M(I, 0, 1))) : (_(je(a, i.length)), C(a), R(g), z(1), k(T), N(M(I, 1, T))), requestAnimationFrame(() => {
|
|
224
|
-
L(!1), requestAnimationFrame(() => {
|
|
225
|
-
s === "next" ? (z(1), k(v), N(M(I, 1, v))) : (z(0), k(1), N(M(I, 0, 1)));
|
|
226
|
-
});
|
|
227
|
-
}), F.current = setTimeout(() => {
|
|
228
|
-
s === "next" && _(g), H(a), C(null), R(null), U(!1);
|
|
229
|
-
}, q);
|
|
230
|
-
}, [
|
|
231
|
-
g,
|
|
232
|
-
I,
|
|
233
|
-
u.height,
|
|
234
|
-
u.width,
|
|
235
|
-
b,
|
|
236
|
-
w,
|
|
237
|
-
j,
|
|
238
|
-
i,
|
|
239
|
-
q
|
|
240
|
-
]), d = i[g], B = W !== null ? i[W] : null, $ = Y !== null ? i[Y] : null, x = Z !== null ? i[Z] : null, Fe = i.length <= 1 ? 0 : (g - 1 + i.length) % i.length, Te = i.length <= 1 ? 0 : (g + 1) % i.length, Me = b((ne = d == null ? void 0 : d.image) == null ? void 0 : ne.assetId), Ae = b((ie = $ == null ? void 0 : $.image) == null ? void 0 : ie.assetId), Ce = b((ae = x == null ? void 0 : x.image) == null ? void 0 : ae.assetId), Re = {
|
|
241
|
-
[`--${t}-transition-ms`]: `${q}ms`
|
|
242
|
-
};
|
|
243
|
-
return /* @__PURE__ */ D(de, { children: [
|
|
244
|
-
/* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: O } }),
|
|
245
|
-
/* @__PURE__ */ D(
|
|
246
|
-
"div",
|
|
247
|
-
{
|
|
248
|
-
ref: V,
|
|
249
|
-
className: S(`${t}-wrapper`, we && `${t}-snap`, o && !r && `${t}-editor`),
|
|
250
|
-
style: Re,
|
|
251
|
-
"aria-label": "Zoom gallery",
|
|
252
|
-
children: [
|
|
253
|
-
((se = B == null ? void 0 : B.image) == null ? void 0 : se.assetId) && /* @__PURE__ */ l("div", { className: `${t}-background`, "aria-hidden": "true", children: /* @__PURE__ */ l(
|
|
254
|
-
"img",
|
|
255
|
-
{
|
|
256
|
-
className: `${t}-effect-image`,
|
|
257
|
-
src: B.image.assetId,
|
|
258
|
-
alt: "",
|
|
259
|
-
style: { filter: Ne }
|
|
260
|
-
}
|
|
261
|
-
) }),
|
|
262
|
-
w && ((re = $ == null ? void 0 : $.image) == null ? void 0 : re.assetId) && /* @__PURE__ */ l(
|
|
263
|
-
"div",
|
|
264
|
-
{
|
|
265
|
-
className: S(
|
|
266
|
-
`${t}-stage`,
|
|
267
|
-
`${t}-outgoing`,
|
|
268
|
-
`${t}-outgoing-${J}`
|
|
269
|
-
),
|
|
270
|
-
style: ve(Ae, Se, t),
|
|
271
|
-
"aria-hidden": "true",
|
|
272
|
-
children: /* @__PURE__ */ l(
|
|
273
|
-
"img",
|
|
274
|
-
{
|
|
275
|
-
className: `${t}-effect-image`,
|
|
276
|
-
src: $.image.assetId,
|
|
277
|
-
alt: "",
|
|
278
|
-
style: { filter: ye }
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
w && ((oe = x == null ? void 0 : x.image) == null ? void 0 : oe.assetId) && /* @__PURE__ */ l(
|
|
284
|
-
"div",
|
|
285
|
-
{
|
|
286
|
-
className: S(
|
|
287
|
-
`${t}-stage`,
|
|
288
|
-
`${t}-incoming`,
|
|
289
|
-
`${t}-incoming-${J}`
|
|
290
|
-
),
|
|
291
|
-
style: ve(Ce, be, t),
|
|
292
|
-
"aria-hidden": "true",
|
|
293
|
-
children: /* @__PURE__ */ l(
|
|
294
|
-
"img",
|
|
295
|
-
{
|
|
296
|
-
className: `${t}-image`,
|
|
297
|
-
src: x.image.assetId,
|
|
298
|
-
alt: ""
|
|
299
|
-
}
|
|
300
|
-
)
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
!w && ((ce = d == null ? void 0 : d.image) == null ? void 0 : ce.assetId) && /* @__PURE__ */ l(
|
|
304
|
-
"div",
|
|
305
|
-
{
|
|
306
|
-
className: S(`${t}-stage`, `${t}-foreground`),
|
|
307
|
-
style: pe(Me),
|
|
308
|
-
children: /* @__PURE__ */ l(
|
|
309
|
-
"img",
|
|
310
|
-
{
|
|
311
|
-
className: `${t}-image`,
|
|
312
|
-
src: d.image.assetId,
|
|
313
|
-
alt: d.image.name ?? ""
|
|
314
|
-
}
|
|
315
|
-
)
|
|
316
|
-
}
|
|
317
|
-
),
|
|
318
|
-
j && i.length > 1 && !w && /* @__PURE__ */ D(de, { children: [
|
|
319
|
-
/* @__PURE__ */ l(
|
|
320
|
-
"button",
|
|
321
|
-
{
|
|
322
|
-
type: "button",
|
|
323
|
-
className: S(`${t}-nav`, `${t}-nav-prev`),
|
|
324
|
-
onClick: () => te("prev"),
|
|
325
|
-
"aria-label": `Show previous image (${Fe + 1} of ${i.length})`
|
|
326
|
-
}
|
|
327
|
-
),
|
|
328
|
-
/* @__PURE__ */ l(
|
|
329
|
-
"button",
|
|
330
|
-
{
|
|
331
|
-
type: "button",
|
|
332
|
-
className: S(`${t}-nav`, `${t}-nav-next`),
|
|
333
|
-
onClick: () => te("next"),
|
|
334
|
-
"aria-label": `Show next image (${Te + 1} of ${i.length})`
|
|
335
|
-
}
|
|
336
|
-
)
|
|
337
|
-
] })
|
|
338
|
-
]
|
|
339
|
-
}
|
|
340
|
-
)
|
|
341
|
-
] });
|
|
342
|
-
}
|
|
343
|
-
export {
|
|
344
|
-
Je as Scale
|
|
345
|
-
};
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),Pt=require("react-dom"),Et=require("./getImageRect-BQhQXvT8.js"),Je=require("./scalingValue-CSHYgTZl.js"),en=require("./useScopedStyles-Bf6yohVQ.js"),tn=require("./textStylesToCss-CNN3zZTV.js"),nn=require("./HiveLightboxTitles-DlyptAaK.js");function rn(e){return`
|
|
2
|
-
.${e}-titles-row {
|
|
3
|
-
position: relative;
|
|
4
|
-
flex: 0 1 auto;
|
|
5
|
-
z-index: 2;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
word-break: break-word;
|
|
9
|
-
min-width: 0;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: row;
|
|
12
|
-
align-items: baseline;
|
|
13
|
-
}
|
|
14
|
-
.${e}-titles-row-header {
|
|
15
|
-
flex: 1;
|
|
16
|
-
align-items: baseline;
|
|
17
|
-
}
|
|
18
|
-
.${e}-titles-row-header-controls {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: row;
|
|
21
|
-
align-items: baseline;
|
|
22
|
-
flex-shrink: 0;
|
|
23
|
-
}
|
|
24
|
-
.${e}-close-icon {
|
|
25
|
-
position: relative;
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
align-self: center;
|
|
28
|
-
pointer-events: auto;
|
|
29
|
-
z-index: 2;
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
border: none;
|
|
34
|
-
background-color: transparent;
|
|
35
|
-
padding: 0;
|
|
36
|
-
}
|
|
37
|
-
.${e}-close-icon-inner {
|
|
38
|
-
all: unset;
|
|
39
|
-
position: relative;
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
pointer-events: auto;
|
|
44
|
-
}
|
|
45
|
-
.${e}-close-icon-img {
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 50%;
|
|
48
|
-
left: 50%;
|
|
49
|
-
transform: translate(-50%, -50%);
|
|
50
|
-
}
|
|
51
|
-
.${e}-titles-baseline-strut {
|
|
52
|
-
width: 0;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
flex-shrink: 0;
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
white-space: nowrap;
|
|
57
|
-
}
|
|
58
|
-
.${e}-titles-row-titles {
|
|
59
|
-
position: relative;
|
|
60
|
-
flex: 1;
|
|
61
|
-
min-width: 0;
|
|
62
|
-
align-self: flex-start;
|
|
63
|
-
}
|
|
64
|
-
.${e}-titles-stack {
|
|
65
|
-
position: relative;
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: row;
|
|
68
|
-
align-items: baseline;
|
|
69
|
-
align-self: flex-start;
|
|
70
|
-
min-width: 0;
|
|
71
|
-
}
|
|
72
|
-
.${e}-titles-row-two-row {
|
|
73
|
-
display: flex;
|
|
74
|
-
flex: 1;
|
|
75
|
-
height: 100%;
|
|
76
|
-
min-height: 0;
|
|
77
|
-
align-self: stretch;
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
width: 100%;
|
|
80
|
-
}
|
|
81
|
-
.${e}-titles-row-top {
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: row;
|
|
84
|
-
align-items: baseline;
|
|
85
|
-
width: 100%;
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
margin-bottom: 0;
|
|
88
|
-
}
|
|
89
|
-
.${e}-titles-row-top .${e}-title-cell[data-title="title1"] {
|
|
90
|
-
flex: 0 0 auto;
|
|
91
|
-
min-width: 0;
|
|
92
|
-
}
|
|
93
|
-
.${e}-titles-row-bottom-wrap {
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
width: 100%;
|
|
97
|
-
margin-top: auto;
|
|
98
|
-
flex-shrink: 0;
|
|
99
|
-
}
|
|
100
|
-
.${e}-titles-row-bottom-area {
|
|
101
|
-
position: relative;
|
|
102
|
-
flex: 1;
|
|
103
|
-
min-height: 0;
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-direction: column;
|
|
106
|
-
width: 100%;
|
|
107
|
-
}
|
|
108
|
-
.${e}-titles-row-bottom {
|
|
109
|
-
position: relative;
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: row;
|
|
112
|
-
align-items: flex-end;
|
|
113
|
-
width: 100%;
|
|
114
|
-
}
|
|
115
|
-
.${e}-titles-row-bottom .${e}-title-cell {
|
|
116
|
-
flex: 0 0 auto;
|
|
117
|
-
}
|
|
118
|
-
.${e}-title-cell {
|
|
119
|
-
position: relative;
|
|
120
|
-
flex: 0 0 auto;
|
|
121
|
-
min-width: 0;
|
|
122
|
-
box-sizing: border-box;
|
|
123
|
-
}
|
|
124
|
-
.${e}-text-bar-cell {
|
|
125
|
-
position: relative;
|
|
126
|
-
flex: 0 1 auto;
|
|
127
|
-
min-width: 0;
|
|
128
|
-
display: flex;
|
|
129
|
-
align-items: baseline;
|
|
130
|
-
}
|
|
131
|
-
.${e}-title1,
|
|
132
|
-
.${e}-title2,
|
|
133
|
-
.${e}-title3 {
|
|
134
|
-
margin: 0;
|
|
135
|
-
min-width: 0;
|
|
136
|
-
}
|
|
137
|
-
.${e}-title-resize-handle {
|
|
138
|
-
background: transparent;
|
|
139
|
-
}
|
|
140
|
-
.${e}-lightbox {
|
|
141
|
-
position: fixed;
|
|
142
|
-
inset: 0;
|
|
143
|
-
z-index: 9997;
|
|
144
|
-
overscroll-behavior: none;
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
}
|
|
147
|
-
.${e}-lightbox-editor {
|
|
148
|
-
inset: auto;
|
|
149
|
-
top: var(--cntrl-article-top, 0);
|
|
150
|
-
left: var(--cntrl-article-left, 0);
|
|
151
|
-
width: var(--cntrl-article-width, 100vw) !important;
|
|
152
|
-
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
153
|
-
}
|
|
154
|
-
.${e}-lightbox-edit-mode {
|
|
155
|
-
z-index: 1;
|
|
156
|
-
}
|
|
157
|
-
.${e}-lightbox-dismiss-area {
|
|
158
|
-
position: relative;
|
|
159
|
-
width: 100%;
|
|
160
|
-
height: 100%;
|
|
161
|
-
}
|
|
162
|
-
.${e}-lightbox-overlay-content {
|
|
163
|
-
position: absolute;
|
|
164
|
-
inset: 0;
|
|
165
|
-
z-index: 3;
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
isolation: isolate;
|
|
170
|
-
}
|
|
171
|
-
.${e}-lightbox-content-area {
|
|
172
|
-
position: relative;
|
|
173
|
-
display: flex;
|
|
174
|
-
flex-direction: row;
|
|
175
|
-
align-items: flex-start;
|
|
176
|
-
flex: 1;
|
|
177
|
-
min-width: 0;
|
|
178
|
-
min-height: 0;
|
|
179
|
-
}
|
|
180
|
-
.${e}-lightbox-content-area-stacked {
|
|
181
|
-
align-items: stretch;
|
|
182
|
-
align-self: stretch;
|
|
183
|
-
}
|
|
184
|
-
.${e}-text-bar-cell-stacked {
|
|
185
|
-
align-self: stretch;
|
|
186
|
-
flex: 1;
|
|
187
|
-
min-width: 0;
|
|
188
|
-
min-height: 0;
|
|
189
|
-
height: 100%;
|
|
190
|
-
flex-direction: column;
|
|
191
|
-
align-items: stretch;
|
|
192
|
-
}
|
|
193
|
-
.${e}-control {
|
|
194
|
-
position: relative;
|
|
195
|
-
z-index: 2;
|
|
196
|
-
pointer-events: auto;
|
|
197
|
-
flex-shrink: 0;
|
|
198
|
-
}
|
|
199
|
-
`}const Z=500,Ne=650,_="cubic-bezier(0.22, 1, 0.36, 1)",on=72,an=50,ln=1e4,cn=650,sn=500;function un(e,t){const r=e.width/t.width,i=e.height/t.height,a=e.left-t.left,c=e.top-t.top;return`translate(${a}px, ${c}px) scale(${r}, ${i})`}function Ft(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Et.getDisplayedImageRect(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const r=e.getBoundingClientRect();return{left:r.left,top:r.top,width:r.width,height:r.height}}function fn(e,t,r){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Ft(i,r):null}function dn(e){return e.reduce((t,r,i)=>{var a;return(a=r.image)!=null&&a.assetId&&t.push({gridIndex:i,items:[r.image],entry:{title1:r.title??"",title2:r.subtitle??"",title3:r.caption??""}}),t},[])}function We(e,t,r){var a;if(e.length<=1)return null;const i=(t+r+e.length)%e.length;return((a=e[i])==null?void 0:a.items[0])??null}function Ht(e,t,r){if(e.length<=2)return null;const i=(t+r+e.length)%e.length;return We(e,i,r)}const hn=.03;function Nt(e){return e.width*hn}const ft={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Ze(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function At(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function pn(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function dt(e,t,r){const i=e.getBoundingClientRect(),a=i.width,c=i.height,g=t/r,f=a/c;if(g>f){const y=a/g;return{width:a,height:y,left:i.left,top:i.top+(c-y)/2}}const $=c*g;return{width:$,height:c,left:i.left+(a-$)/2,top:i.top}}function gn(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:dt(e,t.width,t.height)}function mn(e,t){if(Pe(e)){const i=document.createElement("video"),a=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",a)};i.addEventListener("loadedmetadata",a),i.preload="auto",i.src=e.assetId,i.load();return}const r=new Image;r.onload=()=>{r.naturalWidth>0&&r.naturalHeight>0&&t(e.assetId,r.naturalWidth,r.naturalHeight)},r.src=e.assetId}function wn(e){const t=new Set,r=[];for(const i of e){const a=i.image;!(a!=null&&a.assetId)||t.has(a.assetId)||(t.add(a.assetId),r.push(a))}return r}function vn({mediaList:e}){return e.length===0?null:s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Pe(t)?s.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):s.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Ce(e,t,r){const{width:i,height:a,top:c}=e,{left:g,width:f}=r,$=Nt(r);return t==="left"?{left:g+$-i,top:c,width:i,height:a}:{left:g+f-$,top:c,width:i,height:a}}function Qe(e,t,r){const i=Ce(e,t,r);return{...i,left:2*i.left-e.left}}function xn(e,t,r){const{left:i,width:a}=r,c=Nt(r);return t==="left"?{left:i,top:e.top,width:c,height:e.height}:{left:i+a-c,top:e.top,width:c,height:e.height}}function Wt(e,t,r,i){const a=Ce(e,"left",i),c=Ce(e,"right",i),g=Qe(e,"left",i),f=Qe(e,"right",i);if(r===1)switch(t){case"center":return{start:e,end:a};case"right-adjacent":return{start:c,end:e};case"left-adjacent":return{start:a,end:g};case"far-right":return{start:f,end:c};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:c};case"left-adjacent":return{start:a,end:e};case"right-adjacent":return{start:c,end:f};case"far-left":return{start:g,end:a};default:return{start:e,end:e}}}function yn(e,t,r,i){const{start:a,end:c}=Wt(e,t,r,i);return{x:c.left-a.left,y:c.top-a.top}}function bn(e,t,r){const i=Ce(e,t,r),a=Qe(e,t,r);return{x:a.left-i.left,y:a.top-i.top}}function Pe(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function $n({src:e,phase:t,onMediaElement:r,wrapperStyle:i,videoStyle:a,onLoadedMetadata:c,onTransitionEnd:g}){const f=o.useRef(null);return o.useEffect(()=>{const $=f.current;return r==null||r($??null),()=>{$==null||$.pause(),r==null||r(null)}},[e,r]),s.jsx("div",{style:i,onTransitionEnd:g,children:s.jsx("video",{ref:f,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:c,onClick:$=>$.stopPropagation(),style:a},e)})}function Ke({media:e,style:t,onTransitionEnd:r,onMeasure:i}){return Pe(e)?s.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:a=>{const c=a.currentTarget;c.videoWidth>0&&c.videoHeight>0&&(i==null||i(e.assetId,c.videoWidth,c.videoHeight))},onTransitionEnd:r}):s.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:a=>{const c=a.currentTarget;c.naturalWidth>0&&c.naturalHeight>0&&(i==null||i(e.assetId,c.naturalWidth,c.naturalHeight))},onTransitionEnd:r})}function Sn({prefix:e,items:t,index:r,entry:i,settings:a,isEditor:c,isEditMode:g,isPreviewMode:f,canNavigate:$,lightboxEntries:y,entryIdx:K,layoutId:et,sourceRect:ae,resolveCloseSourceRect:ge,onClose:Oe,onPrev:J,onNext:je}){const He=o.useRef(null),V=o.useRef(null),M=o.useRef(null),Q=o.useRef(new Map),[le,ze]=o.useState(0),P=o.useRef(null),ee=o.useRef(0),k=o.useRef(0),C=o.useRef("none"),A=o.useRef(!1),me=o.useRef(!1),we=o.useRef(!1),ce=o.useRef(null),W=o.useRef(null),xe=o.useRef(null),te=o.useRef(()=>{}),se=o.useRef(null),ue=o.useRef(null),fe=o.useRef(null),ne=o.useRef(!1),[j,ve]=o.useState(null),[H,E]=o.useState(ft),[tt,nt]=o.useState(0),[m,ye]=o.useState("opening"),[B,be]=o.useState(0),[h,v]=o.useState(0),[b,O]=o.useState(!1),[F,re]=o.useState(null),[de,$e]=o.useState(null),[De,Se]=o.useState(null),[Ot,rt]=o.useState(!1),[zt,Dt]=o.useState(null),[ht,ot]=o.useState(!1),_e=o.useRef(!1),[q,Ie]=o.useState(!1),[_t,pt]=o.useState(!1),gt=o.useRef(r),mt=o.useRef(void 0),p=t[r],Ve=p?Pe(p):!1,G=h!==0||b,it=!g&&(!c||!!f),oe=$&&!g,he=y.length>1,ke=o.useCallback((n,l)=>t.length<=1?null:t[(n+l+t.length)%t.length]??null,[t]),L=he?We(y,K,-1):ke(r,-1),R=he?We(y,K,1):ke(r,1),at=F===-1&&G?he&&de!==null?We(y,de,-1):De!==null?ke(De,-1):null:null,lt=F===1&&G?he&&de!==null?We(y,de,1):De!==null?ke(De,1):null:null,Vt=at&&at.assetId!==(L==null?void 0:L.assetId)?at:null,Mt=lt&<.assetId!==(R==null?void 0:R.assetId)?lt:null,Bt=L&&oe?(()=>{const n=he?Ht(y,K,-1):t.length>2?ke((r-1+t.length)%t.length,-1):null;return n&&n.assetId!==L.assetId?n:null})():null,qt=R&&oe?(()=>{const n=he?Ht(y,K,1):t.length>2?ke((r+1)%t.length,1):null;return n&&n.assetId!==R.assetId?n:null})():null,Me=Vt??Bt,Be=Mt??qt,pe=o.useCallback((n,l,d)=>{if(!n||!l||!d)return;const u=Q.current,x=u.get(n);(x==null?void 0:x.width)===l&&(x==null?void 0:x.height)===d||(u.set(n,{width:l,height:d}),ze(D=>D+1))},[]),Le=o.useCallback(n=>{if(!(n!=null&&n.assetId))return null;const l=Q.current.get(n.assetId);return gn(V.current,l)},[le,tt]),qe=o.useCallback(()=>{if(!p)return;const n=Le(p);if(n){ve(n);return}const l=V.current;l&&ve(At(l))},[p,Le]),Ge=o.useCallback(n=>{if(he){const l=y.length;$e((K+n+l)%l),Se(null);return}t.length>1&&(Se((r+n+t.length)%t.length),$e(null))},[he,y.length,K,t.length,r]),T=o.useCallback(n=>{we.current=n,O(n)},[]),S=o.useCallback(()=>{ce.current!==null&&(window.clearTimeout(ce.current),ce.current=null)},[]),wt=o.useCallback(()=>{S(),ce.current=window.setTimeout(()=>{S(),T(!1)},Ne+32)},[S,T]),vt=o.useCallback(()=>{const n=He.current;if(!n){E({left:0,top:0,width:typeof window<"u"?window.innerWidth:ft.width,height:typeof window<"u"?window.innerHeight:ft.height});return}const l=n.getBoundingClientRect();E({left:l.left,top:l.top,width:l.width,height:l.height})},[]),xt=o.useCallback((n,l)=>{if(G){if(q&&!b)return`translate(${h}px, 0px)`;if(b&&F!==null){const d=Le(n);if(!d)return;const{x:u,y:x}=yn(d,l,F,H);return`translate(${u}px, ${x}px)`}if(b)return"translate(0px, 0px)"}},[G,q,b,h,F,H,Le]),Re=o.useCallback(()=>{const n=W.current;W.current=null,S(),T(!1),re(null),$e(null),Se(null),v(0),Ie(!1),A.current=!1,k.current=0,C.current="none",n===-1?J():n===1&&je()},[S,T,J,je]),Xe=o.useCallback(()=>{S(),ce.current=window.setTimeout(()=>{W.current!==null&&Re()},Ne+32)},[S,Re]),yt=o.useCallback(()=>{S(),W.current=null,T(!1),re(null),$e(null),Se(null),v(0),Ie(!1),A.current=!1,k.current=0,C.current="none"},[S,T]),bt=o.useCallback(n=>{if(!(!oe||!j)){if(we.current){if(W.current===n){xe.current=n,Re();return}yt()}S(),Ge(n),W.current=n,re(n),T(!0),Xe()}},[oe,j,Re,yt,S,Ge,T,Xe]);te.current=bt;const ie=o.useCallback(()=>{se.current=null,ne.current=!1,ue.current!==null&&(window.clearInterval(ue.current),ue.current=null),fe.current!==null&&(window.clearTimeout(fe.current),fe.current=null)},[]),ct=o.useCallback(n=>{ue.current!==null&&window.clearInterval(ue.current);const l=ne.current?sn:cn;ue.current=window.setInterval(()=>{te.current(n)},l)},[]),$t=o.useCallback(n=>{se.current!==n&&(ie(),se.current=n,ne.current=!1,te.current(n),ct(n),fe.current=window.setTimeout(()=>{fe.current=null,se.current===n&&(ne.current=!0,ct(n))},ln))},[ie,ct]),X=o.useCallback(()=>{const n=V.current;if(!n)return;const l=p==null?void 0:p.assetId,d=l?Q.current.get(l):void 0;if(d!=null&&d.width&&(d!=null&&d.height)){ve(dt(n,d.width,d.height));return}const u=M.current;if(u&&l&&(u.src===l||u.currentSrc===l)){const{width:D,height:w}=pn(u);if(D&&w){pe(l,D,w),ve(dt(n,D,w));return}}const x=At(n);!x.width||!x.height||ve(x)},[p==null?void 0:p.assetId,pe]),St=o.useCallback(n=>{if(M.current=n,!!n){if(n instanceof HTMLVideoElement){n.readyState>=1&&n.videoWidth>0&&X();return}n.complete&&n.naturalWidth>0&&X()}},[X]),Ae=o.useCallback(()=>{vt(),X(),nt(n=>n+1)},[vt,X]);o.useEffect(()=>{Ae();const n=V.current,l=He.current,d=new ResizeObserver(()=>Ae());return n&&d.observe(n),l&&d.observe(l),window.addEventListener("resize",Ae),()=>{d.disconnect(),window.removeEventListener("resize",Ae)}},[Ae,r,et]),o.useLayoutEffect(()=>{if(!p)return;const n=M.current;if(n){if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0){X();return}n instanceof HTMLVideoElement&&n.readyState>=1&&n.videoWidth>0&&X()}},[p==null?void 0:p.assetId,r,X]),o.useEffect(()=>{qe()},[qe,le]),o.useEffect(()=>{const n=new Set,l=[],d=u=>{!(u!=null&&u.assetId)||n.has(u.assetId)||(n.add(u.assetId),l.push(u))};t.forEach(d),y.forEach(u=>u.items.forEach(d)),l.forEach(u=>{Q.current.has(u.assetId)||mn(u,pe)})},[t,y,pe]),o.useEffect(()=>{if(m!=="opening"||!j)return;if(!ae){ye("open");return}rt(!1);const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{rt(!0),ye("open")})});return()=>cancelAnimationFrame(n)},[m,j,ae]),o.useEffect(()=>{if(m!=="closing")return;const n=setTimeout(()=>Oe(),Z);return()=>clearTimeout(n)},[m,Oe]),o.useEffect(()=>()=>{S()},[S]),o.useLayoutEffect(()=>{gt.current===r&&mt.current===(p==null?void 0:p.assetId)||(S(),W.current=null,re(null),$e(null),Se(null),be(0),v(0),T(!1),pt(!1),Ie(!1),ee.current=0,k.current=0,C.current="none",A.current=!1,P.current=null,me.current=!1,M.current=null,qe(),gt.current=r,mt.current=p==null?void 0:p.assetId)},[r,p==null?void 0:p.assetId,T,S,qe]),o.useLayoutEffect(()=>{const n=xe.current;n!==null&&(xe.current=null,requestAnimationFrame(()=>{te.current(n)}))},[r,K,p==null?void 0:p.assetId]),o.useLayoutEffect(()=>{if(m==="opening"){_e.current=!1,ot(!1);return}if(m!=="open"||_e.current)return;if(!L&&!R){_e.current=!0;return}ot(!1);const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ot(!0),_e.current=!0})});return()=>cancelAnimationFrame(n)},[m,L==null?void 0:L.assetId,R==null?void 0:R.assetId]),o.useEffect(()=>{if(m!=="open")return;const n=()=>{const w=I=>{I.stopPropagation(),I.preventDefault(),document.removeEventListener("click",w,!0)};document.addEventListener("click",w,!0)},l=w=>{const I=w<0?1:-1;S(),Ge(I),W.current=I,re(I),T(!0),Xe()},d=w=>{if(Math.abs(w)>an&&oe){l(w);return}W.current=null,re(null),$e(null),Se(null),T(!0),v(0),wt()},u=w=>{if(w.touches.length!==1||we.current)return;const I=w.touches[0];me.current=!0,P.current={x:I.clientX,y:I.clientY},C.current="none",k.current=0,A.current=!1},x=w=>{if(!P.current||w.touches.length!==1||we.current)return;const I=w.touches[0],Y=I.clientX-P.current.x,U=I.clientY-P.current.y;if(C.current==="none"){if(Math.abs(Y)<10&&Math.abs(U)<10)return;if(Math.abs(Y)>Math.abs(U)){if(!oe)return;C.current="horizontal"}else if(U>0){if(!it)return;C.current="vertical"}else return}if(C.current==="horizontal"){A.current=!0,Ie(!0),k.current=Y,v(Y),w.preventDefault();return}C.current==="vertical"&&(A.current=!0,Ie(!0),ee.current=U,be(U),w.preventDefault())},D=()=>{if(!P.current)return;const w=C.current,I=A.current;if(I&&w==="horizontal")d(k.current),n();else if(I&&w==="vertical"){const Y=ee.current;if(it&&Y>on){const U=window.innerHeight;ee.current=U,pt(!0),be(U),ye("closing")}else ee.current=0,be(0);n()}else w==="horizontal"&&Math.abs(k.current)>0&&(d(k.current),n());P.current=null,C.current="none",k.current=0,A.current=!1,Ie(!1)};return document.addEventListener("touchstart",u,{passive:!0}),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",D),document.addEventListener("touchcancel",D),()=>{document.removeEventListener("touchstart",u),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",D),document.removeEventListener("touchcancel",D)}},[m,oe,T,wt,S,it,Xe,Ge]);const st=o.useCallback(()=>{const n=(ge==null?void 0:ge())??ae??null;n&&j&&(Dt(n),rt(!0)),ye("closing")},[ge,ae,j]);o.useEffect(()=>{const n=u=>{if(u.key==="Escape"){if(c&&f||m==="closing")return;ie(),st();return}if(u.key!=="ArrowLeft"&&u.key!=="ArrowRight"||m!=="open"||!oe)return;u.preventDefault();const x=u.key==="ArrowLeft"?-1:1;u.repeat&&se.current===x||$t(x)},l=u=>{if(u.key!=="ArrowLeft"&&u.key!=="ArrowRight")return;const x=u.key==="ArrowLeft"?-1:1;se.current===x&&ie()},d=()=>{ie()};return window.addEventListener("keydown",n),window.addEventListener("keyup",l),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",l),window.removeEventListener("blur",d),ie()}},[m,c,f,st,oe,$t,ie]),o.useEffect(()=>{m!=="open"&&ie()},[m,ie]);const It=()=>{m==="closing"||g||st()},N=m==="open",Ye=m==="closing",Gt=B>0?Math.max(0,1-B/500):1,Xt=B>0?Math.max(.35,1-B/500):1,Te=o.useCallback(n=>{if(!(n.propertyName!=="transform"||!we.current)){if(W.current!==null){Re();return}S(),T(!1)}},[S,T,Re]),ut=m==="closing"?zt??ae:ae,Yt=ut&&j&&(m==="opening"||Ye)?un(ut,j):void 0,Ut=G&&p?xt(p,"center"):B>0?`translateY(${B}px)`:Yt,z=j?Ze(j,H):null,kt=!!(ut&&j),Zt=kt&&(m==="closing"||m==="open"&&Ot),Lt={position:"absolute",top:z==null?void 0:z.top,left:z==null?void 0:z.left,width:z==null?void 0:z.width,height:z==null?void 0:z.height,objectFit:"contain",transformOrigin:"top left",transform:Ut,opacity:B>0?Xt:kt?1:m==="opening"||Ye?0:1,transition:q&&!b?"none":b?`transform ${Ne}ms ${_}`:_t?`transform ${Z}ms ${_}, opacity ${Z}ms ${_}`:Zt?`transform ${Z}ms ${_}`:m==="opening"||Ye?`opacity ${Z}ms ${_}`:"none",pointerEvents:Ve&&N&&!G?"auto":"none",touchAction:Ve&&N?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:N&&!G?"auto":"none"},Ue=(n,l,d="adjacent")=>{const u=Le(n);if(!u)return{display:"none"};const x=d==="far"?l==="left"?"far-left":"far-right":l==="left"?"left-adjacent":"right-adjacent",{start:D}=F!==null?Wt(u,x,F,H):{start:d==="far"?Qe(u,l,H):Ce(u,l,H)},w=Ze(D,H),I=xt(n,x),Y=!G&&d==="adjacent"&&N&&!ht?bn(u,l,H):null,U=d==="far"&&G&&F===(l==="left"?-1:1),Jt=q&&!b?!1:b,Qt=d==="adjacent"&&N&&ht&&!G;return{position:"absolute",top:w.top,left:w.left,width:w.width,height:w.height,objectFit:"contain",transform:I??(Y?`translate(${Y.x}px, ${Y.y}px)`:void 0),opacity:d==="far"?N&&U?1:0:N?1:0,transition:Jt?d==="far"?`transform ${Ne}ms ${_}`:`transform ${Ne}ms ${_}, opacity ${Z}ms ${_}`:Qt?`transform ${Z}ms ${_}`:m==="opening"||Ye?`opacity ${Z}ms ${_}`:"none",pointerEvents:"none",zIndex:1}},Rt=(n,l)=>{const d=Le(n);return d?xn(Ce(d,l,H),l,H):null},Tt=n=>l=>{if(!g){if(me.current){me.current=!1;return}l.stopPropagation(),bt(n)}},Ct=L?Rt(L,"left"):null,jt=R?Rt(R,"right"):null,Ee=Ct?Ze(Ct,H):null,Fe=jt?Ze(jt,H):null;return s.jsxs("div",{ref:He,className:[`${e}-lightbox`,c?`${e}-lightbox-editor`:"",g?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:m==="open"?"none":void 0},onClick:It,children:[s.jsx("div",{style:{position:"absolute",inset:0,background:a.backgroundColor??"#FFFFFF",opacity:N?Gt:0,transition:q?"none":`opacity ${Z}ms ${_}`,pointerEvents:"none"}}),s.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[s.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[s.jsx("div",{style:{height:"10%"}}),s.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsx("div",{ref:V,style:{width:"100%",height:"100%"}})}),s.jsx("div",{style:{height:"10%"}})]}),s.jsx("div",{style:{position:"absolute",inset:0,opacity:N?1:0,transition:q?"none":`opacity ${Z}ms ${_}`,pointerEvents:"none"},children:s.jsx(nn.HiveLightboxTitles,{prefix:e,entry:i,settings:a,isEditor:c,isEditMode:g,isPreviewMode:f,onClose:It})})]}),N&&Me&&s.jsx(Ke,{media:Me,style:Ue(Me,"left","far"),onMeasure:pe,onTransitionEnd:Te},`far-prev-${Me.assetId}`),N&&L&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{media:L,style:Ue(L,"left"),onMeasure:pe,onTransitionEnd:Te},`prev-${L.assetId}`),Ee&&s.jsx("div",{style:{position:"absolute",top:Ee.top,left:Ee.left,width:Ee.width,height:Ee.height,cursor:g||q?"default":"pointer",pointerEvents:g||q?"none":"auto",zIndex:3},onClick:Tt(-1)})]}),N&&R&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{media:R,style:Ue(R,"right"),onMeasure:pe,onTransitionEnd:Te},`next-${R.assetId}`),Fe&&s.jsx("div",{style:{position:"absolute",top:Fe.top,left:Fe.left,width:Fe.width,height:Fe.height,cursor:g||q?"default":"pointer",pointerEvents:g||q?"none":"auto",zIndex:3},onClick:Tt(1)})]}),N&&Be&&s.jsx(Ke,{media:Be,style:Ue(Be,"right","far"),onMeasure:pe,onTransitionEnd:Te},`far-next-${Be.assetId}`),j&&p&&(Ve?s.jsx($n,{src:p.assetId,phase:m,onMediaElement:St,wrapperStyle:Lt,videoStyle:Kt,onLoadedMetadata:X,onTransitionEnd:Te},`${r}-${p.assetId}`):s.jsx("img",{ref:St,src:p.assetId,alt:p.name,onLoad:X,onTransitionEnd:Te,style:Lt},`${r}-${p.assetId}`))]})}const In=20,kn=.18;function Ln(e){return`
|
|
200
|
-
.${e}-wrapper {
|
|
201
|
-
box-sizing: border-box;
|
|
202
|
-
max-width: 100%;
|
|
203
|
-
overflow: visible;
|
|
204
|
-
overflow-wrap: anywhere;
|
|
205
|
-
word-break: break-word;
|
|
206
|
-
}
|
|
207
|
-
.${e}-item {
|
|
208
|
-
display: inline;
|
|
209
|
-
white-space: normal;
|
|
210
|
-
max-width: 100%;
|
|
211
|
-
}
|
|
212
|
-
.${e}-item-title {
|
|
213
|
-
display: inline;
|
|
214
|
-
white-space: pre-wrap;
|
|
215
|
-
overflow-wrap: anywhere;
|
|
216
|
-
word-break: break-word;
|
|
217
|
-
}
|
|
218
|
-
.${e}-type-a.${e}-wrapper,
|
|
219
|
-
.${e}-type-a .${e}-item-title {
|
|
220
|
-
text-align: left;
|
|
221
|
-
}
|
|
222
|
-
.${e}-type-b.${e}-wrapper,
|
|
223
|
-
.${e}-type-b .${e}-item-title {
|
|
224
|
-
text-align: center;
|
|
225
|
-
}
|
|
226
|
-
.${e}-type-c.${e}-wrapper,
|
|
227
|
-
.${e}-type-c .${e}-item-title {
|
|
228
|
-
text-align: right;
|
|
229
|
-
}
|
|
230
|
-
.${e}-item-image {
|
|
231
|
-
display: inline-block;
|
|
232
|
-
vertical-align: baseline;
|
|
233
|
-
position: relative;
|
|
234
|
-
z-index: 1;
|
|
235
|
-
height: 0;
|
|
236
|
-
width: calc(1cap * var(--${e}-image-aspect));
|
|
237
|
-
margin: 0 var(--${e}-image-inline-gap);
|
|
238
|
-
}
|
|
239
|
-
.${e}-item-image-fit {
|
|
240
|
-
width: calc(1cap * var(--${e}-item-media-aspect, var(--${e}-image-aspect)));
|
|
241
|
-
}
|
|
242
|
-
.${e}-item-image img,
|
|
243
|
-
.${e}-item-image video {
|
|
244
|
-
position: absolute;
|
|
245
|
-
left: 0;
|
|
246
|
-
bottom: 0;
|
|
247
|
-
display: block;
|
|
248
|
-
height: 1cap;
|
|
249
|
-
width: 100%;
|
|
250
|
-
max-height: none;
|
|
251
|
-
object-position: bottom;
|
|
252
|
-
}
|
|
253
|
-
.${e}-item-image-hover-scale img,
|
|
254
|
-
.${e}-item-image-hover-scale video {
|
|
255
|
-
transition: transform 0.3s ease;
|
|
256
|
-
}
|
|
257
|
-
.${e}-item-image-hover-scale:hover {
|
|
258
|
-
z-index: 10;
|
|
259
|
-
}
|
|
260
|
-
.${e}-item-image-hover-scale:hover img,
|
|
261
|
-
.${e}-item-image-hover-scale:hover video {
|
|
262
|
-
transform: scale(var(--${e}-image-hover-scale, 1.2));
|
|
263
|
-
}
|
|
264
|
-
.${e}-item-image-hover-saturate img,
|
|
265
|
-
.${e}-item-image-hover-saturate video {
|
|
266
|
-
filter: grayscale(100%);
|
|
267
|
-
transition: filter 0.3s ease;
|
|
268
|
-
}
|
|
269
|
-
.${e}-item-image-hover-saturate:hover img,
|
|
270
|
-
.${e}-item-image-hover-saturate:hover video {
|
|
271
|
-
filter: grayscale(0%);
|
|
272
|
-
}
|
|
273
|
-
.${e}-item-gap-host {
|
|
274
|
-
display: inline-block;
|
|
275
|
-
vertical-align: top;
|
|
276
|
-
height: var(--${e}-line-height);
|
|
277
|
-
position: relative;
|
|
278
|
-
flex-shrink: 0;
|
|
279
|
-
}
|
|
280
|
-
.${e}-item-gap-control {
|
|
281
|
-
position: absolute;
|
|
282
|
-
top: 0;
|
|
283
|
-
z-index: 2;
|
|
284
|
-
pointer-events: auto;
|
|
285
|
-
}
|
|
286
|
-
${rn(e)}
|
|
287
|
-
`}function Rn(e){const{imageDisplay:t}=e??{},r=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[a,c]=r.split(":").map(Number),g=i?c:a,f=i?a:c;return f>0?g/f:1}function Tn(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!r?null:t/r}function Cn(e,t,r){const i=(e==null?void 0:e.titleFontSize)??.07,a=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:Je.scalingValue(a,r??!1),[`--${t}-image-inline-gap`]:Je.scalingValue(i*kn,r??!1),[`--${t}-image-aspect`]:Rn(e)}}function jn(e,t){var i,a;const r={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((a=e==null?void 0:e.titleFontSettings)==null?void 0:a.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return tn.textStylesToCss(r,t)}function Hn(e){var a;const t=((a=e==null?void 0:e.imageDisplay)==null?void 0:a.display)==="cover",r=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...r?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function An(e,t,r,i,a,c){if(!(!e||!t))return g=>{var $;const f=(($=g.currentTarget.closest(`.${i}-item`))==null?void 0:$.querySelector(`[data-waterfall-index="${r}"]`))??(g.currentTarget instanceof HTMLImageElement||g.currentTarget instanceof HTMLVideoElement?g.currentTarget:null);c(r,f?Ft(f,a):void 0)}}function En({settings:e,content:t,isEditor:r,isPreviewMode:i,isEditMode:a,layoutId:c,portalId:g}){const{prefix:f}=en.useScopedStyles(),$=o.useMemo(()=>Ln(f),[f]),y=t??[],K=(e==null?void 0:e.type)??"a",et=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,ae=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,ge=Je.scalingValue(ae,r??!1),Oe=`max(${ge}, ${In}px)`,{objectFitMode:J,imageStyle:je}=Hn(e),He=jn(e,r),V=o.useRef(null),[M,Q]=o.useState(!1),[le,ze]=o.useState([]),[P,ee]=o.useState(0),[k,C]=o.useState(0),[A,me]=o.useState(null),[we,ce]=o.useState({title1:"",title2:"",title3:""}),W=(!r||i)&&!M,xe=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},te=xe.sizeType??"none",se=W&&te!=="none"?`${f}-item-image-hover-${te}`:void 0,ue=(xe.value??120)/100,fe=o.useCallback(h=>{!h||te!=="scale"||(h.style.transformOrigin=Et.getContainedMediaTransformOrigin(h))},[te]),ne=o.useCallback(h=>{if(h){if(J==="contain"){const v=Tn(h);if(v){const b=h.closest(`.${f}-item-image`);b instanceof HTMLElement&&b.style.setProperty(`--${f}-item-media-aspect`,String(v))}}fe(h)}},[f,fe,J]),j={width:Je.scalingValue(et,r??!1),...He,...Cn(e,f,r),[`--${f}-image-hover-scale`]:String(ue)},ve=(()=>{const h={},v=V.current?getComputedStyle(V.current).getPropertyValue("--cntrl-article-width").trim():"";return v&&(h["--cntrl-article-width"]=v),h})(),H=((e==null?void 0:e.lightbox)??"on")==="on"&&(!r||i||a),E=o.useMemo(()=>dn(y),[y]),tt=o.useMemo(()=>wn(y),[y]),nt=(h,v)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||r&&!a&&!i)return;const b=E.findIndex(F=>F.gridIndex===h);if(b<0)return;const O=E[b];C(b),ze(O.items),ee(0),ce(O.entry),me(v??null),Q(!0)},m=o.useCallback(()=>{Q(!1),me(null)},[]),ye=o.useCallback(()=>{const h=E[k];return!h||!V.current?A:fn(V.current,h.gridIndex,J)??A},[E,k,A,J]),B=o.useCallback(h=>{if(E.length>1){const v=E.length,b=(k+h+v)%v,O=E[b];C(b),ze(O.items),ee(0),ce(O.entry);return}ee(v=>(v+h+le.length)%le.length)},[E,k,le.length]),be=E.length>1||le.length>1;return o.useEffect(()=>{if(!M||typeof document>"u")return;const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}},[M]),o.useEffect(()=>{!r||a||i||Q(!1)},[r,a,i]),o.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&Q(!1)},[e==null?void 0:e.lightbox]),s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),s.jsx(vn,{mediaList:tt}),s.jsx("div",{ref:V,className:`${f}-wrapper ${f}-type-${K}`,style:j,children:y.map((h,v)=>{var F,re;const b=!!((F=h.image)!=null&&F.assetId),O=An(!!H,b,v,f,J,nt);return s.jsxs("div",{className:`${f}-item`,children:[h.title?s.jsx("span",{className:`${f}-item-title`,onClick:O,style:O?{cursor:"pointer"}:void 0,children:h.title}):null,(re=h.image)!=null&&re.assetId?s.jsx("span",{className:[`${f}-item-image`,J==="contain"?`${f}-item-image-fit`:void 0,se].filter(Boolean).join(" "),children:h.image.type==="video"?s.jsx("video",{ref:ne,src:h.image.assetId,"data-waterfall-index":v,style:je,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:O,onLoadedData:de=>ne(de.currentTarget)}):s.jsx("img",{ref:ne,src:h.image.assetId,alt:h.image.name??"","data-waterfall-index":v,style:je,onClick:O,onLoad:de=>ne(de.currentTarget)})}):null,v<y.length-1&&s.jsx("div",{className:`${f}-item-gap-host`,style:{width:ge},children:a&&!M&&s.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${f}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:Oe,height:"100%"}})})]},v)})}),M&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const h=(g?document.getElementById(g):null)??document.body;return Pt.createPortal(s.jsx("div",{style:ve,"data-selection":"none",children:s.jsx(Sn,{prefix:f,items:le,index:P,entry:we,settings:e,isEditor:r,isEditMode:a,isPreviewMode:i,canNavigate:be,lightboxEntries:E,entryIdx:k,layoutId:c,sourceRect:A,resolveCloseSourceRect:ye,onClose:m,onPrev:()=>B(-1),onNext:()=>B(1)})}),h)})()]})}exports.Waterfall=En;
|