@cntrl-site/components 1.0.104 → 1.0.106

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.
Files changed (99) hide show
  1. package/dist/ClickGallerie-CYQMgrIr.js +36 -0
  2. package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
  3. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
  4. package/dist/Components/Helix/Helix.d.ts +4 -1
  5. package/dist/Components/Hive/Hive.d.ts +4 -1
  6. package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
  7. package/dist/Components/List/List.d.ts +6 -2
  8. package/dist/Components/Marquee/Marquee.d.ts +6 -2
  9. package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
  10. package/dist/Components/Mercury/Mercury.d.ts +4 -1
  11. package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
  12. package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
  13. package/dist/Components/utils/LinkWrapper.d.ts +16 -0
  14. package/dist/Components/utils/embedMedia.d.ts +40 -0
  15. package/dist/Components/utils/index.d.ts +6 -0
  16. package/dist/Components/utils/observeIntersection.d.ts +4 -0
  17. package/dist/Components/utils/useLazyVideos.d.ts +0 -3
  18. package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  19. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  20. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  21. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  22. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  23. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  24. package/dist/Grid-CFHTP3mb.js +378 -0
  25. package/dist/Grid-e-gLfsji.mjs +1590 -0
  26. package/dist/Helix-BpLo9FD3.js +43 -0
  27. package/dist/Helix-CidI3ucE.mjs +324 -0
  28. package/dist/{Hive-BusARSOi.mjs → Hive-BsmFHk2i.mjs} +505 -475
  29. package/dist/Hive-D1j6wZpV.js +321 -0
  30. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  31. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  32. package/dist/{LazyVideo-D8eVYFyw.mjs → LazyVideo-CdAWymKO.mjs} +1 -1
  33. package/dist/{LazyVideo-Cn_vmMq8.js → LazyVideo-imbU18js.js} +1 -1
  34. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  35. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  36. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  37. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  38. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  39. package/dist/List-DVvpQ24J.js +377 -0
  40. package/dist/Marquee-DByooiWP.mjs +578 -0
  41. package/dist/Marquee-DfIP-tIN.js +133 -0
  42. package/dist/MarqueeText-D6FNCe6P.mjs +518 -0
  43. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  44. package/dist/Mercury-B-s2Kvuq.js +267 -0
  45. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  46. package/dist/PretextComponent-Dnbenstn.js +1 -0
  47. package/dist/{PretextComponent-s4DDfmzY.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
  48. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  49. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  50. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  51. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  52. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  53. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  54. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  55. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  56. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  57. package/dist/Waterfall-DII4-WV5.js +288 -0
  58. package/dist/{components-Yf9Zjska.mjs → components-BRmbflgg.mjs} +15 -15
  59. package/dist/components-nvbH4l0S.js +1 -0
  60. package/dist/content/postFieldBindings.d.ts +29 -0
  61. package/dist/elements.js +1 -1
  62. package/dist/elements.mjs +16 -16
  63. package/dist/elements.node.js +1 -1
  64. package/dist/elements.node.mjs +1 -1
  65. package/dist/index.d.ts +3 -1
  66. package/dist/index.js +1 -1
  67. package/dist/index.mjs +52 -15
  68. package/dist/observeIntersection-B0f3L2iK.mjs +23 -0
  69. package/dist/observeIntersection-DxGj9Ctt.js +1 -0
  70. package/dist/sources.js +335 -223
  71. package/dist/sources.mjs +339 -227
  72. package/dist/types/SchemaV1.d.ts +53 -1
  73. package/dist/useLazyVideos-CdCbc2j0.js +1 -0
  74. package/dist/useLazyVideos-CxXyEjRQ.mjs +52 -0
  75. package/dist/utils.js +1 -1
  76. package/dist/utils.mjs +30 -20
  77. package/package.json +1 -1
  78. package/dist/ClickGallerie-D7g093HX.js +0 -36
  79. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  80. package/dist/Grid-B2_o1dvz.mjs +0 -1576
  81. package/dist/Grid-Bq6bk2AQ.js +0 -374
  82. package/dist/Helix-B7rxlvKq.js +0 -43
  83. package/dist/Helix-BrKQzGX5.mjs +0 -315
  84. package/dist/Hive-Dh5nKPGm.js +0 -321
  85. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  86. package/dist/List-C32WImI3.js +0 -377
  87. package/dist/Marquee-CdtAqhQE.mjs +0 -563
  88. package/dist/Marquee-DUN8wUax.js +0 -133
  89. package/dist/MarqueeText-4Rip_sQX.mjs +0 -515
  90. package/dist/MarqueeText-E6OubMOG.js +0 -132
  91. package/dist/Mercury-BRqlbk4i.mjs +0 -1702
  92. package/dist/Mercury-C-O2VGkK.js +0 -267
  93. package/dist/PretextComponent-D5P0AjnL.js +0 -1
  94. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  95. package/dist/Waterfall-DKuh4bnv.mjs +0 -1404
  96. package/dist/Waterfall-fdiHR0Rc.js +0 -287
  97. package/dist/components-DzNixU7Q.js +0 -1
  98. package/dist/useLazyVideos-BbgdvELi.js +0 -1
  99. package/dist/useLazyVideos-CZLyNolX.mjs +0 -72
@@ -0,0 +1,1432 @@
1
+ import { jsx as h, jsxs as It, Fragment as ye } from "react/jsx-runtime";
2
+ import { useState as $, useRef as y, useCallback as v, useEffect as W, useLayoutEffect as te, useMemo as we } from "react";
3
+ import { createPortal as un } from "react-dom";
4
+ import { s as re } from "./scalingValue-C9JH5L6O.mjs";
5
+ import { u as fn } from "./useScopedStyles-DhBG3557.mjs";
6
+ import { i as Lt, E as Be, g as Ge } from "./EmbedMediaFrame-DwHeOAy5.mjs";
7
+ import { g as dn, a as hn } from "./getImageRect-CBMhFNHM.mjs";
8
+ import { L as pn } from "./LazyVideo-CdAWymKO.mjs";
9
+ import { t as gn } from "./textStylesToCss-05Mn6I_2.mjs";
10
+ import { u as mn } from "./useLazyVideos-CxXyEjRQ.mjs";
11
+ import { H as wn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
12
+ function vn(t) {
13
+ return `
14
+ .${t}-titles-row {
15
+ position: relative;
16
+ flex: 0 1 auto;
17
+ z-index: 2;
18
+ box-sizing: border-box;
19
+ pointer-events: none;
20
+ word-break: break-word;
21
+ min-width: 0;
22
+ display: flex;
23
+ flex-direction: row;
24
+ align-items: baseline;
25
+ }
26
+ .${t}-titles-row-header {
27
+ flex: 1;
28
+ align-items: baseline;
29
+ }
30
+ .${t}-titles-row-header-controls {
31
+ display: flex;
32
+ flex-direction: row;
33
+ align-items: baseline;
34
+ flex-shrink: 0;
35
+ }
36
+ .${t}-close-icon {
37
+ position: relative;
38
+ flex-shrink: 0;
39
+ align-self: center;
40
+ pointer-events: auto;
41
+ z-index: 2;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ border: none;
46
+ background-color: transparent;
47
+ padding: 0;
48
+ }
49
+ .${t}-close-icon-inner {
50
+ all: unset;
51
+ position: relative;
52
+ cursor: pointer;
53
+ width: 100%;
54
+ height: 100%;
55
+ pointer-events: auto;
56
+ }
57
+ .${t}-close-icon-img {
58
+ position: absolute;
59
+ top: 50%;
60
+ left: 50%;
61
+ transform: translate(-50%, -50%);
62
+ }
63
+ .${t}-titles-baseline-strut {
64
+ width: 0;
65
+ overflow: hidden;
66
+ flex-shrink: 0;
67
+ pointer-events: none;
68
+ white-space: nowrap;
69
+ }
70
+ .${t}-titles-row-titles {
71
+ position: relative;
72
+ flex: 1;
73
+ min-width: 0;
74
+ align-self: flex-start;
75
+ }
76
+ .${t}-titles-stack {
77
+ position: relative;
78
+ display: flex;
79
+ flex-direction: row;
80
+ align-items: baseline;
81
+ align-self: flex-start;
82
+ min-width: 0;
83
+ }
84
+ .${t}-titles-row-two-row {
85
+ display: flex;
86
+ flex: 1;
87
+ height: 100%;
88
+ min-height: 0;
89
+ align-self: stretch;
90
+ flex-direction: column;
91
+ width: 100%;
92
+ }
93
+ .${t}-titles-row-top {
94
+ display: flex;
95
+ flex-direction: row;
96
+ align-items: baseline;
97
+ width: 100%;
98
+ flex-shrink: 0;
99
+ margin-bottom: 0;
100
+ }
101
+ .${t}-titles-row-top .${t}-title-cell[data-title="title1"] {
102
+ flex: 0 0 auto;
103
+ min-width: 0;
104
+ }
105
+ .${t}-titles-row-bottom-wrap {
106
+ display: flex;
107
+ flex-direction: column;
108
+ width: 100%;
109
+ margin-top: auto;
110
+ flex-shrink: 0;
111
+ }
112
+ .${t}-titles-row-bottom-area {
113
+ position: relative;
114
+ flex: 1;
115
+ min-height: 0;
116
+ display: flex;
117
+ flex-direction: column;
118
+ width: 100%;
119
+ }
120
+ .${t}-titles-row-bottom {
121
+ position: relative;
122
+ display: flex;
123
+ flex-direction: row;
124
+ align-items: flex-end;
125
+ width: 100%;
126
+ }
127
+ .${t}-titles-row-bottom .${t}-title-cell {
128
+ flex: 0 0 auto;
129
+ }
130
+ .${t}-title-cell {
131
+ position: relative;
132
+ flex: 0 0 auto;
133
+ min-width: 0;
134
+ box-sizing: border-box;
135
+ }
136
+ .${t}-text-bar-cell {
137
+ position: relative;
138
+ flex: 0 1 auto;
139
+ min-width: 0;
140
+ display: flex;
141
+ align-items: baseline;
142
+ }
143
+ .${t}-title1,
144
+ .${t}-title2,
145
+ .${t}-title3 {
146
+ margin: 0;
147
+ min-width: 0;
148
+ }
149
+ .${t}-title-resize-handle {
150
+ background: transparent;
151
+ }
152
+ .${t}-lightbox {
153
+ position: fixed;
154
+ inset: 0;
155
+ z-index: 9997;
156
+ overscroll-behavior: none;
157
+ overflow: hidden;
158
+ }
159
+ .${t}-lightbox-editor {
160
+ inset: auto;
161
+ top: var(--cntrl-article-top, 0);
162
+ left: var(--cntrl-article-left, 0);
163
+ width: var(--cntrl-article-width, 100vw) !important;
164
+ height: var(--cntrl-viewport-height, 100vh) !important;
165
+ }
166
+ .${t}-lightbox-edit-mode {
167
+ z-index: 1;
168
+ }
169
+ .${t}-lightbox-dismiss-area {
170
+ position: relative;
171
+ width: 100%;
172
+ height: 100%;
173
+ }
174
+ .${t}-lightbox-overlay-content {
175
+ position: absolute;
176
+ inset: 0;
177
+ z-index: 3;
178
+ pointer-events: none;
179
+ display: flex;
180
+ flex-direction: column;
181
+ isolation: isolate;
182
+ }
183
+ .${t}-lightbox-content-area {
184
+ position: relative;
185
+ display: flex;
186
+ flex-direction: row;
187
+ align-items: flex-start;
188
+ flex: 1;
189
+ min-width: 0;
190
+ min-height: 0;
191
+ }
192
+ .${t}-lightbox-content-area-stacked {
193
+ align-items: stretch;
194
+ align-self: stretch;
195
+ }
196
+ .${t}-text-bar-cell-stacked {
197
+ align-self: stretch;
198
+ flex: 1;
199
+ min-width: 0;
200
+ min-height: 0;
201
+ height: 100%;
202
+ flex-direction: column;
203
+ align-items: stretch;
204
+ }
205
+ .${t}-control {
206
+ position: relative;
207
+ z-index: 2;
208
+ pointer-events: auto;
209
+ flex-shrink: 0;
210
+ }
211
+ `;
212
+ }
213
+ const Q = 500, jt = 650, M = "cubic-bezier(0.22, 1, 0.36, 1)", yn = 72, xn = 50, $n = 1e4, bn = 650, Sn = 500;
214
+ function In(t, e) {
215
+ const r = t.width / e.width, o = t.height / e.height, i = t.left - e.left, l = t.top - e.top;
216
+ return `translate(${i}px, ${l}px) scale(${r}, ${o})`;
217
+ }
218
+ function Xe(t, e) {
219
+ if (e === "contain" && t instanceof HTMLImageElement) {
220
+ const o = dn(t);
221
+ return { left: o.x, top: o.y, width: o.width, height: o.height };
222
+ }
223
+ const r = t.getBoundingClientRect();
224
+ return { left: r.left, top: r.top, width: r.width, height: r.height };
225
+ }
226
+ function Ln(t, e, r) {
227
+ const o = t.querySelector(`[data-waterfall-index="${e}"]`);
228
+ return o instanceof HTMLElement ? Xe(o, r) : null;
229
+ }
230
+ function Tn(t) {
231
+ return t.reduce((e, r, o) => {
232
+ var i;
233
+ return (i = r.image) != null && i.assetId && e.push({
234
+ gridIndex: o,
235
+ items: [r.image],
236
+ entry: {
237
+ title1: r.title ?? "",
238
+ title2: r.subtitle ?? "",
239
+ title3: r.caption ?? ""
240
+ }
241
+ }), e;
242
+ }, []);
243
+ }
244
+ function Mt(t, e, r) {
245
+ var i;
246
+ if (t.length <= 1) return null;
247
+ const o = (e + r + t.length) % t.length;
248
+ return ((i = t[o]) == null ? void 0 : i.items[0]) ?? null;
249
+ }
250
+ function Me(t, e, r) {
251
+ if (t.length <= 2) return null;
252
+ const o = (e + r + t.length) % t.length;
253
+ return Mt(t, o, r);
254
+ }
255
+ const kn = 0.03;
256
+ function qe(t) {
257
+ return t.width * kn;
258
+ }
259
+ const ve = {
260
+ left: 0,
261
+ top: 0,
262
+ width: typeof window < "u" ? window.innerWidth : 1440,
263
+ height: typeof window < "u" ? window.innerHeight : 900
264
+ };
265
+ function ee(t, e) {
266
+ return {
267
+ left: t.left - e.left,
268
+ top: t.top - e.top,
269
+ width: t.width,
270
+ height: t.height
271
+ };
272
+ }
273
+ function Ve(t) {
274
+ const e = t.getBoundingClientRect();
275
+ return { width: e.width, height: e.height, left: e.left, top: e.top };
276
+ }
277
+ function Hn(t) {
278
+ return t instanceof HTMLVideoElement ? { width: t.videoWidth, height: t.videoHeight } : { width: t.naturalWidth, height: t.naturalHeight };
279
+ }
280
+ function xe(t, e, r) {
281
+ const o = t.getBoundingClientRect(), i = o.width, l = o.height, p = e / r, c = i / l;
282
+ if (p > c) {
283
+ const b = i / p;
284
+ return { width: i, height: b, left: o.left, top: o.top + (l - b) / 2 };
285
+ }
286
+ const z = l * p;
287
+ return { width: z, height: l, left: o.left + (i - z) / 2, top: o.top };
288
+ }
289
+ function An(t, e) {
290
+ return !t || !(e != null && e.width) || !(e != null && e.height) ? null : xe(t, e.width, e.height);
291
+ }
292
+ function Rn(t, e) {
293
+ if (Lt(t)) {
294
+ e(t.assetId, Ge(t), 1);
295
+ return;
296
+ }
297
+ if (ie(t)) {
298
+ const o = document.createElement("video"), i = () => {
299
+ o.videoWidth > 0 && o.videoHeight > 0 && e(t.assetId, o.videoWidth, o.videoHeight), o.removeEventListener("loadedmetadata", i);
300
+ };
301
+ o.addEventListener("loadedmetadata", i), o.preload = "auto", o.src = t.assetId, o.load();
302
+ return;
303
+ }
304
+ const r = new Image();
305
+ r.onload = () => {
306
+ r.naturalWidth > 0 && r.naturalHeight > 0 && e(t.assetId, r.naturalWidth, r.naturalHeight);
307
+ }, r.src = t.assetId;
308
+ }
309
+ function En(t) {
310
+ const e = /* @__PURE__ */ new Set(), r = [];
311
+ for (const o of t) {
312
+ const i = o.image;
313
+ !(i != null && i.assetId) || e.has(i.assetId) || (e.add(i.assetId), r.push(i));
314
+ }
315
+ return r;
316
+ }
317
+ function Cn({ mediaList: t }) {
318
+ const [e, r] = $(null);
319
+ mn(e, { preload: "metadata" });
320
+ const o = t.filter((i) => !Lt(i));
321
+ return o.length === 0 ? null : /* @__PURE__ */ h(
322
+ "div",
323
+ {
324
+ ref: r,
325
+ "aria-hidden": !0,
326
+ style: {
327
+ position: "absolute",
328
+ width: 0,
329
+ height: 0,
330
+ overflow: "hidden",
331
+ opacity: 0,
332
+ pointerEvents: "none"
333
+ },
334
+ children: o.map((i) => ie(i) ? /* @__PURE__ */ h(
335
+ "video",
336
+ {
337
+ src: i.assetId,
338
+ preload: "none",
339
+ muted: !0,
340
+ playsInline: !0
341
+ },
342
+ i.assetId
343
+ ) : /* @__PURE__ */ h(
344
+ "img",
345
+ {
346
+ src: i.assetId,
347
+ alt: ""
348
+ },
349
+ i.assetId
350
+ ))
351
+ }
352
+ );
353
+ }
354
+ function Nt(t, e, r) {
355
+ const { width: o, height: i, top: l } = t, { left: p, width: c } = r, z = qe(r);
356
+ return e === "left" ? {
357
+ left: p + z - o,
358
+ top: l,
359
+ width: o,
360
+ height: i
361
+ } : {
362
+ left: p + c - z,
363
+ top: l,
364
+ width: o,
365
+ height: i
366
+ };
367
+ }
368
+ function oe(t, e, r) {
369
+ const o = Nt(t, e, r);
370
+ return {
371
+ ...o,
372
+ left: 2 * o.left - t.left
373
+ };
374
+ }
375
+ function Fn(t, e, r) {
376
+ const { left: o, width: i } = r, l = qe(r);
377
+ return e === "left" ? {
378
+ left: o,
379
+ top: t.top,
380
+ width: l,
381
+ height: t.height
382
+ } : {
383
+ left: o + i - l,
384
+ top: t.top,
385
+ width: l,
386
+ height: t.height
387
+ };
388
+ }
389
+ function Ye(t, e, r, o) {
390
+ const i = Nt(t, "left", o), l = Nt(t, "right", o), p = oe(t, "left", o), c = oe(t, "right", o);
391
+ if (r === 1)
392
+ switch (e) {
393
+ case "center":
394
+ return { start: t, end: i };
395
+ case "right-adjacent":
396
+ return { start: l, end: t };
397
+ case "left-adjacent":
398
+ return { start: i, end: p };
399
+ case "far-right":
400
+ return { start: c, end: l };
401
+ default:
402
+ return { start: t, end: t };
403
+ }
404
+ switch (e) {
405
+ case "center":
406
+ return { start: t, end: l };
407
+ case "left-adjacent":
408
+ return { start: i, end: t };
409
+ case "right-adjacent":
410
+ return { start: l, end: c };
411
+ case "far-left":
412
+ return { start: p, end: i };
413
+ default:
414
+ return { start: t, end: t };
415
+ }
416
+ }
417
+ function Nn(t, e, r, o) {
418
+ const { start: i, end: l } = Ye(t, e, r, o);
419
+ return {
420
+ x: l.left - i.left,
421
+ y: l.top - i.top
422
+ };
423
+ }
424
+ function Wn(t, e, r) {
425
+ const o = Nt(t, e, r), i = oe(t, e, r);
426
+ return {
427
+ x: i.left - o.left,
428
+ y: i.top - o.top
429
+ };
430
+ }
431
+ function ie(t) {
432
+ return Lt(t) ? !1 : t.type === "video" ? !0 : /\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(t.assetId);
433
+ }
434
+ function zn({
435
+ src: t,
436
+ onMediaElement: e,
437
+ wrapperStyle: r,
438
+ videoStyle: o,
439
+ onLoadedMetadata: i,
440
+ onTransitionEnd: l
441
+ }) {
442
+ const p = y(null);
443
+ return W(() => {
444
+ const c = p.current;
445
+ return e == null || e(c ?? null), () => {
446
+ c == null || c.pause(), e == null || e(null);
447
+ };
448
+ }, [t, e]), /* @__PURE__ */ h("div", { style: r, onTransitionEnd: l, children: /* @__PURE__ */ h(
449
+ "video",
450
+ {
451
+ ref: p,
452
+ src: t,
453
+ muted: !0,
454
+ autoPlay: !0,
455
+ loop: !0,
456
+ playsInline: !0,
457
+ preload: "auto",
458
+ onLoadedMetadata: i,
459
+ style: o
460
+ },
461
+ t
462
+ ) });
463
+ }
464
+ function ne({
465
+ media: t,
466
+ style: e,
467
+ onTransitionEnd: r,
468
+ onMeasure: o
469
+ }) {
470
+ return Lt(t) ? /* @__PURE__ */ h("img", { src: t.thumbnail, alt: t.name, style: e, onTransitionEnd: r }) : ie(t) ? /* @__PURE__ */ h(
471
+ "video",
472
+ {
473
+ src: t.assetId,
474
+ muted: !0,
475
+ autoPlay: !0,
476
+ loop: !0,
477
+ playsInline: !0,
478
+ preload: "auto",
479
+ style: e,
480
+ onLoadedMetadata: (i) => {
481
+ const l = i.currentTarget;
482
+ l.videoWidth > 0 && l.videoHeight > 0 && (o == null || o(t.assetId, l.videoWidth, l.videoHeight));
483
+ },
484
+ onTransitionEnd: r
485
+ }
486
+ ) : /* @__PURE__ */ h(
487
+ "img",
488
+ {
489
+ src: t.assetId,
490
+ alt: t.name,
491
+ style: e,
492
+ onLoad: (i) => {
493
+ const l = i.currentTarget;
494
+ l.naturalWidth > 0 && l.naturalHeight > 0 && (o == null || o(t.assetId, l.naturalWidth, l.naturalHeight));
495
+ },
496
+ onTransitionEnd: r
497
+ }
498
+ );
499
+ }
500
+ function On({
501
+ prefix: t,
502
+ items: e,
503
+ index: r,
504
+ entry: o,
505
+ settings: i,
506
+ isEditor: l,
507
+ isEditMode: p,
508
+ isPreviewMode: c,
509
+ canNavigate: z,
510
+ lightboxEntries: b,
511
+ entryIdx: P,
512
+ layoutId: ae,
513
+ sourceRect: ct,
514
+ resolveCloseSourceRect: wt,
515
+ onClose: Vt,
516
+ onPrev: G,
517
+ onNext: Tt
518
+ }) {
519
+ const Wt = y(null), V = y(null), X = y(null), tt = y(/* @__PURE__ */ new Map()), [st, Bt] = $(0), et = y(null), nt = y(0), T = y(0), R = y("none"), F = y(!1), vt = y(!1), yt = y(!1), ut = y(null), O = y(null), kt = y(null), rt = y(() => {
520
+ }), ft = y(null), dt = y(null), ht = y(null), ot = y(!1), [E, xt] = $(null), [N, Gt] = $(ve), [_, le] = $(0), [w, Ht] = $("opening"), [it, $t] = $(0), [zt, s] = $(0), [g, C] = $(!1), [S, B] = $(null), [bt, q] = $(null), [Xt, At] = $(null), [Ue, ce] = $(!1), [Ze, Ke] = $(null), [$e, se] = $(!1), qt = y(!1), [Y, Rt] = $(!1), [Je, be] = $(!1), Se = y(r), Ie = y(void 0), f = e[r], Le = f ? ie(f) : !1, Te = f ? Lt(f) : !1, pt = zt !== 0 || g, ue = !p && (!l || !!c), at = z && !p, gt = b.length > 1, Et = v((n, a) => e.length <= 1 ? null : e[(n + a + e.length) % e.length] ?? null, [e]), k = gt ? Mt(b, P, -1) : Et(r, -1), H = gt ? Mt(b, P, 1) : Et(r, 1), fe = S === -1 && pt ? gt && bt !== null ? Mt(b, bt, -1) : Xt !== null ? Et(Xt, -1) : null : null, de = S === 1 && pt ? gt && bt !== null ? Mt(b, bt, 1) : Xt !== null ? Et(Xt, 1) : null : null, Qe = fe && fe.assetId !== (k == null ? void 0 : k.assetId) ? fe : null, Pe = de && de.assetId !== (H == null ? void 0 : H.assetId) ? de : null, tn = k && at ? (() => {
521
+ const n = gt ? Me(b, P, -1) : e.length > 2 ? Et((r - 1 + e.length) % e.length, -1) : null;
522
+ return n && n.assetId !== k.assetId ? n : null;
523
+ })() : null, en = H && at ? (() => {
524
+ const n = gt ? Me(b, P, 1) : e.length > 2 ? Et((r + 1) % e.length, 1) : null;
525
+ return n && n.assetId !== H.assetId ? n : null;
526
+ })() : null, Yt = Qe ?? tn, Ut = Pe ?? en, mt = v((n, a, d) => {
527
+ if (!n || !a || !d) return;
528
+ const u = tt.current, x = u.get(n);
529
+ (x == null ? void 0 : x.width) === a && (x == null ? void 0 : x.height) === d || (u.set(n, { width: a, height: d }), Bt((j) => j + 1));
530
+ }, []), Ct = v((n) => {
531
+ if (!(n != null && n.assetId)) return null;
532
+ const a = tt.current.get(n.assetId);
533
+ return An(V.current, a);
534
+ }, [st, _]), Zt = v(() => {
535
+ if (!f) return;
536
+ const n = Ct(f);
537
+ if (n) {
538
+ xt(n);
539
+ return;
540
+ }
541
+ const a = V.current;
542
+ a && xt(Ve(a));
543
+ }, [f, Ct]), Kt = v((n) => {
544
+ if (gt) {
545
+ const a = b.length;
546
+ q((P + n + a) % a), At(null);
547
+ return;
548
+ }
549
+ e.length > 1 && (At((r + n + e.length) % e.length), q(null));
550
+ }, [gt, b.length, P, e.length, r]), A = v((n) => {
551
+ yt.current = n, C(n);
552
+ }, []), I = v(() => {
553
+ ut.current !== null && (window.clearTimeout(ut.current), ut.current = null);
554
+ }, []), ke = v(() => {
555
+ I(), ut.current = window.setTimeout(() => {
556
+ I(), A(!1);
557
+ }, jt + 32);
558
+ }, [I, A]), He = v(() => {
559
+ const n = Wt.current;
560
+ if (!n) {
561
+ Gt({
562
+ left: 0,
563
+ top: 0,
564
+ width: typeof window < "u" ? window.innerWidth : ve.width,
565
+ height: typeof window < "u" ? window.innerHeight : ve.height
566
+ });
567
+ return;
568
+ }
569
+ const a = n.getBoundingClientRect();
570
+ Gt({
571
+ left: a.left,
572
+ top: a.top,
573
+ width: a.width,
574
+ height: a.height
575
+ });
576
+ }, []), Ae = v((n, a) => {
577
+ if (pt) {
578
+ if (Y && !g)
579
+ return `translate(${zt}px, 0px)`;
580
+ if (g && S !== null) {
581
+ const d = Ct(n);
582
+ if (!d) return;
583
+ const { x: u, y: x } = Nn(d, a, S, N);
584
+ return `translate(${u}px, ${x}px)`;
585
+ }
586
+ if (g)
587
+ return "translate(0px, 0px)";
588
+ }
589
+ }, [
590
+ pt,
591
+ Y,
592
+ g,
593
+ zt,
594
+ S,
595
+ N,
596
+ Ct
597
+ ]), Ft = v(() => {
598
+ const n = O.current;
599
+ O.current = null, I(), A(!1), B(null), q(null), At(null), s(0), Rt(!1), F.current = !1, T.current = 0, R.current = "none", n === -1 ? G() : n === 1 && Tt();
600
+ }, [I, A, G, Tt]), Jt = v(() => {
601
+ I(), ut.current = window.setTimeout(() => {
602
+ O.current !== null && Ft();
603
+ }, jt + 32);
604
+ }, [I, Ft]), Re = v(() => {
605
+ I(), O.current = null, A(!1), B(null), q(null), At(null), s(0), Rt(!1), F.current = !1, T.current = 0, R.current = "none";
606
+ }, [I, A]), Ee = v((n) => {
607
+ if (!(!at || !E)) {
608
+ if (yt.current) {
609
+ if (O.current === n) {
610
+ kt.current = n, Ft();
611
+ return;
612
+ }
613
+ Re();
614
+ }
615
+ I(), Kt(n), O.current = n, B(n), A(!0), Jt();
616
+ }
617
+ }, [
618
+ at,
619
+ E,
620
+ Ft,
621
+ Re,
622
+ I,
623
+ Kt,
624
+ A,
625
+ Jt
626
+ ]);
627
+ rt.current = Ee;
628
+ const lt = v(() => {
629
+ ft.current = null, ot.current = !1, dt.current !== null && (window.clearInterval(dt.current), dt.current = null), ht.current !== null && (window.clearTimeout(ht.current), ht.current = null);
630
+ }, []), he = v((n) => {
631
+ dt.current !== null && window.clearInterval(dt.current);
632
+ const a = ot.current ? Sn : bn;
633
+ dt.current = window.setInterval(() => {
634
+ rt.current(n);
635
+ }, a);
636
+ }, []), Ce = v((n) => {
637
+ ft.current !== n && (lt(), ft.current = n, ot.current = !1, rt.current(n), he(n), ht.current = window.setTimeout(() => {
638
+ ht.current = null, ft.current === n && (ot.current = !0, he(n));
639
+ }, $n));
640
+ }, [lt, he]), U = v(() => {
641
+ const n = V.current;
642
+ if (!n) return;
643
+ const a = f == null ? void 0 : f.assetId, d = a ? tt.current.get(a) : void 0;
644
+ if (d != null && d.width && (d != null && d.height)) {
645
+ xt(xe(n, d.width, d.height));
646
+ return;
647
+ }
648
+ const u = X.current;
649
+ if (u && a && (u.src === a || u.currentSrc === a)) {
650
+ const { width: j, height: m } = Hn(u);
651
+ if (j && m) {
652
+ mt(a, j, m), xt(xe(n, j, m));
653
+ return;
654
+ }
655
+ }
656
+ const x = Ve(n);
657
+ !x.width || !x.height || xt(x);
658
+ }, [f == null ? void 0 : f.assetId, mt]), Fe = v((n) => {
659
+ if (X.current = n, !!n) {
660
+ if (n instanceof HTMLVideoElement) {
661
+ n.readyState >= 1 && n.videoWidth > 0 && U();
662
+ return;
663
+ }
664
+ n.complete && n.naturalWidth > 0 && U();
665
+ }
666
+ }, [U]), Ot = v(() => {
667
+ He(), U(), le((n) => n + 1);
668
+ }, [He, U]);
669
+ W(() => {
670
+ Ot();
671
+ const n = V.current, a = Wt.current, d = new ResizeObserver(() => Ot());
672
+ return n && d.observe(n), a && d.observe(a), window.addEventListener("resize", Ot), () => {
673
+ d.disconnect(), window.removeEventListener("resize", Ot);
674
+ };
675
+ }, [Ot, r, ae]), te(() => {
676
+ if (!f) return;
677
+ const n = X.current;
678
+ if (n) {
679
+ if (n instanceof HTMLImageElement && n.complete && n.naturalWidth > 0) {
680
+ U();
681
+ return;
682
+ }
683
+ n instanceof HTMLVideoElement && n.readyState >= 1 && n.videoWidth > 0 && U();
684
+ }
685
+ }, [f == null ? void 0 : f.assetId, r, U]), W(() => {
686
+ Zt();
687
+ }, [Zt, st]), W(() => {
688
+ const n = /* @__PURE__ */ new Set(), a = [], d = (u) => {
689
+ !(u != null && u.assetId) || n.has(u.assetId) || (n.add(u.assetId), a.push(u));
690
+ };
691
+ e.forEach(d), b.forEach((u) => u.items.forEach(d)), a.forEach((u) => {
692
+ tt.current.has(u.assetId) || Rn(u, mt);
693
+ });
694
+ }, [e, b, mt]), W(() => {
695
+ if (w !== "opening" || !E) return;
696
+ if (!ct) {
697
+ Ht("open");
698
+ return;
699
+ }
700
+ ce(!1);
701
+ const n = requestAnimationFrame(() => {
702
+ requestAnimationFrame(() => {
703
+ ce(!0), Ht("open");
704
+ });
705
+ });
706
+ return () => cancelAnimationFrame(n);
707
+ }, [w, E, ct]), W(() => {
708
+ if (w !== "closing") return;
709
+ const n = setTimeout(() => Vt(), Q);
710
+ return () => clearTimeout(n);
711
+ }, [w, Vt]), W(() => () => {
712
+ I();
713
+ }, [I]), te(() => {
714
+ Se.current === r && Ie.current === (f == null ? void 0 : f.assetId) || (I(), O.current = null, B(null), q(null), At(null), $t(0), s(0), A(!1), be(!1), Rt(!1), nt.current = 0, T.current = 0, R.current = "none", F.current = !1, et.current = null, vt.current = !1, X.current = null, Zt(), Se.current = r, Ie.current = f == null ? void 0 : f.assetId);
715
+ }, [r, f == null ? void 0 : f.assetId, A, I, Zt]), te(() => {
716
+ const n = kt.current;
717
+ n !== null && (kt.current = null, requestAnimationFrame(() => {
718
+ rt.current(n);
719
+ }));
720
+ }, [r, P, f == null ? void 0 : f.assetId]), te(() => {
721
+ if (w === "opening") {
722
+ qt.current = !1, se(!1);
723
+ return;
724
+ }
725
+ if (w !== "open" || qt.current) return;
726
+ if (!k && !H) {
727
+ qt.current = !0;
728
+ return;
729
+ }
730
+ se(!1);
731
+ const n = requestAnimationFrame(() => {
732
+ requestAnimationFrame(() => {
733
+ se(!0), qt.current = !0;
734
+ });
735
+ });
736
+ return () => cancelAnimationFrame(n);
737
+ }, [w, k == null ? void 0 : k.assetId, H == null ? void 0 : H.assetId]), W(() => {
738
+ if (w !== "open") return;
739
+ const n = () => {
740
+ const m = (L) => {
741
+ L.stopPropagation(), L.preventDefault(), document.removeEventListener("click", m, !0);
742
+ };
743
+ document.addEventListener("click", m, !0);
744
+ }, a = (m) => {
745
+ const L = m < 0 ? 1 : -1;
746
+ I(), Kt(L), O.current = L, B(L), A(!0), Jt();
747
+ }, d = (m) => {
748
+ if (Math.abs(m) > xn && at) {
749
+ a(m);
750
+ return;
751
+ }
752
+ O.current = null, B(null), q(null), At(null), A(!0), s(0), ke();
753
+ }, u = (m) => {
754
+ if (m.touches.length !== 1 || yt.current) return;
755
+ const L = m.touches[0];
756
+ vt.current = !0, et.current = { x: L.clientX, y: L.clientY }, R.current = "none", T.current = 0, F.current = !1;
757
+ }, x = (m) => {
758
+ if (!et.current || m.touches.length !== 1 || yt.current) return;
759
+ const L = m.touches[0], K = L.clientX - et.current.x, J = L.clientY - et.current.y;
760
+ if (R.current === "none") {
761
+ if (Math.abs(K) < 10 && Math.abs(J) < 10) return;
762
+ if (Math.abs(K) > Math.abs(J)) {
763
+ if (!at) return;
764
+ R.current = "horizontal";
765
+ } else if (J > 0) {
766
+ if (!ue) return;
767
+ R.current = "vertical";
768
+ } else
769
+ return;
770
+ }
771
+ if (R.current === "horizontal") {
772
+ F.current = !0, Rt(!0), T.current = K, s(K), m.preventDefault();
773
+ return;
774
+ }
775
+ R.current === "vertical" && (F.current = !0, Rt(!0), nt.current = J, $t(J), m.preventDefault());
776
+ }, j = () => {
777
+ if (!et.current) return;
778
+ const m = R.current, L = F.current;
779
+ if (L && m === "horizontal")
780
+ d(T.current), n();
781
+ else if (L && m === "vertical") {
782
+ const K = nt.current;
783
+ if (ue && K > yn) {
784
+ const J = window.innerHeight;
785
+ nt.current = J, be(!0), $t(J), Ht("closing");
786
+ } else
787
+ nt.current = 0, $t(0);
788
+ n();
789
+ } else m === "horizontal" && Math.abs(T.current) > 0 && (d(T.current), n());
790
+ et.current = null, R.current = "none", T.current = 0, F.current = !1, Rt(!1);
791
+ };
792
+ return document.addEventListener("touchstart", u, { passive: !0 }), document.addEventListener("touchmove", x, { passive: !1 }), document.addEventListener("touchend", j), document.addEventListener("touchcancel", j), () => {
793
+ document.removeEventListener("touchstart", u), document.removeEventListener("touchmove", x), document.removeEventListener("touchend", j), document.removeEventListener("touchcancel", j);
794
+ };
795
+ }, [w, at, A, ke, I, ue, Jt, Kt]);
796
+ const pe = v(() => {
797
+ const n = (wt == null ? void 0 : wt()) ?? ct ?? null;
798
+ n && E && (Ke(n), ce(!0)), Ht("closing");
799
+ }, [wt, ct, E]);
800
+ W(() => {
801
+ const n = (u) => {
802
+ if (u.key === "Escape") {
803
+ if (l && c || w === "closing") return;
804
+ lt(), pe();
805
+ return;
806
+ }
807
+ if (u.key !== "ArrowLeft" && u.key !== "ArrowRight" || w !== "open" || !at) return;
808
+ u.preventDefault();
809
+ const x = u.key === "ArrowLeft" ? -1 : 1;
810
+ u.repeat && ft.current === x || Ce(x);
811
+ }, a = (u) => {
812
+ if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
813
+ const x = u.key === "ArrowLeft" ? -1 : 1;
814
+ ft.current === x && lt();
815
+ }, d = () => {
816
+ lt();
817
+ };
818
+ return window.addEventListener("keydown", n), window.addEventListener("keyup", a), window.addEventListener("blur", d), () => {
819
+ window.removeEventListener("keydown", n), window.removeEventListener("keyup", a), window.removeEventListener("blur", d), lt();
820
+ };
821
+ }, [
822
+ w,
823
+ l,
824
+ c,
825
+ pe,
826
+ at,
827
+ Ce,
828
+ lt
829
+ ]), W(() => {
830
+ w !== "open" && lt();
831
+ }, [w, lt]);
832
+ const Ne = () => {
833
+ w === "closing" || p || pe();
834
+ }, Z = w === "open", Qt = w === "closing", nn = it > 0 ? Math.max(0, 1 - it / 500) : 1, rn = it > 0 ? Math.max(0.35, 1 - it / 500) : 1, St = v((n) => {
835
+ if (!(n.propertyName !== "transform" || !yt.current)) {
836
+ if (O.current !== null) {
837
+ Ft();
838
+ return;
839
+ }
840
+ I(), A(!1);
841
+ }
842
+ }, [I, A, Ft]), ge = w === "closing" ? Ze ?? ct : ct, on = ge && E && (w === "opening" || Qt) ? In(ge, E) : void 0, an = pt && f ? Ae(f, "center") : it > 0 ? `translateY(${it}px)` : on, D = E ? ee(E, N) : null, We = !!(ge && E), ln = We && (w === "closing" || w === "open" && Ue), me = {
843
+ position: "absolute",
844
+ top: D == null ? void 0 : D.top,
845
+ left: D == null ? void 0 : D.left,
846
+ width: D == null ? void 0 : D.width,
847
+ height: D == null ? void 0 : D.height,
848
+ objectFit: "contain",
849
+ transformOrigin: "top left",
850
+ transform: an,
851
+ opacity: it > 0 ? rn : We ? 1 : w === "opening" || Qt ? 0 : 1,
852
+ transition: Y && !g ? "none" : g ? `transform ${jt}ms ${M}` : Je ? `transform ${Q}ms ${M}, opacity ${Q}ms ${M}` : ln ? `transform ${Q}ms ${M}` : w === "opening" || Qt ? `opacity ${Q}ms ${M}` : "none",
853
+ pointerEvents: "none",
854
+ zIndex: 1,
855
+ overflow: Le || Te ? "hidden" : void 0
856
+ }, ze = {
857
+ width: "100%",
858
+ height: "100%",
859
+ display: "block",
860
+ objectFit: "contain",
861
+ pointerEvents: "none"
862
+ }, Pt = (n, a, d = "adjacent") => {
863
+ const u = Ct(n);
864
+ if (!u) return { display: "none" };
865
+ const x = d === "far" ? a === "left" ? "far-left" : "far-right" : a === "left" ? "left-adjacent" : "right-adjacent", { start: j } = S !== null ? Ye(u, x, S, N) : {
866
+ start: d === "far" ? oe(u, a, N) : Nt(u, a, N)
867
+ }, m = ee(j, N), L = Ae(n, x), K = !pt && d === "adjacent" && Z && !$e ? Wn(u, a, N) : null, J = d === "far" && pt && S === (a === "left" ? -1 : 1), cn = Y && !g ? !1 : g, sn = d === "adjacent" && Z && $e && !pt;
868
+ return {
869
+ position: "absolute",
870
+ top: m.top,
871
+ left: m.left,
872
+ width: m.width,
873
+ height: m.height,
874
+ objectFit: "contain",
875
+ transform: L ?? (K ? `translate(${K.x}px, ${K.y}px)` : void 0),
876
+ opacity: d === "far" ? Z && J ? 1 : 0 : Z ? 1 : 0,
877
+ transition: cn ? d === "far" ? `transform ${jt}ms ${M}` : `transform ${jt}ms ${M}, opacity ${Q}ms ${M}` : sn ? `transform ${Q}ms ${M}` : w === "opening" || Qt ? `opacity ${Q}ms ${M}` : "none",
878
+ pointerEvents: "none",
879
+ zIndex: 1
880
+ };
881
+ }, Oe = (n, a) => {
882
+ const d = Ct(n);
883
+ return d ? Fn(Nt(d, a, N), a, N) : null;
884
+ }, _e = (n) => (a) => {
885
+ if (!p) {
886
+ if (vt.current) {
887
+ vt.current = !1;
888
+ return;
889
+ }
890
+ a.stopPropagation(), Ee(n);
891
+ }
892
+ }, De = k ? Oe(k, "left") : null, je = H ? Oe(H, "right") : null, _t = De ? ee(De, N) : null, Dt = je ? ee(je, N) : null;
893
+ return /* @__PURE__ */ It(
894
+ "div",
895
+ {
896
+ ref: Wt,
897
+ className: [
898
+ `${t}-lightbox`,
899
+ l ? `${t}-lightbox-editor` : "",
900
+ p ? `${t}-lightbox-edit-mode` : ""
901
+ ].filter(Boolean).join(" "),
902
+ style: {
903
+ touchAction: w === "open" ? "none" : void 0
904
+ },
905
+ onClick: Ne,
906
+ children: [
907
+ /* @__PURE__ */ h(
908
+ "div",
909
+ {
910
+ style: {
911
+ position: "absolute",
912
+ inset: 0,
913
+ background: i.backgroundColor ?? "#FFFFFF",
914
+ opacity: Z ? nn : 0,
915
+ transition: Y ? "none" : `opacity ${Q}ms ${M}`,
916
+ pointerEvents: "none"
917
+ }
918
+ }
919
+ ),
920
+ /* @__PURE__ */ It("div", { className: `${t}-lightbox-dismiss-area`, children: [
921
+ /* @__PURE__ */ It(
922
+ "div",
923
+ {
924
+ style: {
925
+ position: "relative",
926
+ width: "100%",
927
+ height: "100%",
928
+ display: "flex",
929
+ flexDirection: "column",
930
+ alignItems: "center",
931
+ justifyContent: "center"
932
+ },
933
+ children: [
934
+ /* @__PURE__ */ h("div", { style: { height: "10%" } }),
935
+ /* @__PURE__ */ h(
936
+ "div",
937
+ {
938
+ style: {
939
+ width: "70%",
940
+ height: "80%",
941
+ display: "flex",
942
+ justifyContent: "center",
943
+ alignItems: "center"
944
+ },
945
+ children: /* @__PURE__ */ h("div", { ref: V, style: { width: "100%", height: "100%" } })
946
+ }
947
+ ),
948
+ /* @__PURE__ */ h("div", { style: { height: "10%" } })
949
+ ]
950
+ }
951
+ ),
952
+ /* @__PURE__ */ h(
953
+ "div",
954
+ {
955
+ style: {
956
+ position: "absolute",
957
+ inset: 0,
958
+ opacity: Z ? 1 : 0,
959
+ transition: Y ? "none" : `opacity ${Q}ms ${M}`,
960
+ pointerEvents: "none"
961
+ },
962
+ children: /* @__PURE__ */ h(
963
+ wn,
964
+ {
965
+ prefix: t,
966
+ entry: o,
967
+ settings: i,
968
+ isEditor: l,
969
+ isEditMode: p,
970
+ isPreviewMode: c,
971
+ onClose: Ne
972
+ }
973
+ )
974
+ }
975
+ )
976
+ ] }),
977
+ Z && Yt && /* @__PURE__ */ h(
978
+ ne,
979
+ {
980
+ media: Yt,
981
+ style: Pt(Yt, "left", "far"),
982
+ onMeasure: mt,
983
+ onTransitionEnd: St
984
+ },
985
+ `far-prev-${Yt.assetId}`
986
+ ),
987
+ Z && k && /* @__PURE__ */ It(ye, { children: [
988
+ /* @__PURE__ */ h(
989
+ ne,
990
+ {
991
+ media: k,
992
+ style: Pt(k, "left"),
993
+ onMeasure: mt,
994
+ onTransitionEnd: St
995
+ },
996
+ `prev-${k.assetId}`
997
+ ),
998
+ _t && /* @__PURE__ */ h(
999
+ "div",
1000
+ {
1001
+ style: {
1002
+ position: "absolute",
1003
+ top: _t.top,
1004
+ left: _t.left,
1005
+ width: _t.width,
1006
+ height: _t.height,
1007
+ cursor: p || Y ? "default" : "pointer",
1008
+ pointerEvents: p || Y ? "none" : "auto",
1009
+ zIndex: 3
1010
+ },
1011
+ onClick: _e(-1)
1012
+ }
1013
+ )
1014
+ ] }),
1015
+ Z && H && /* @__PURE__ */ It(ye, { children: [
1016
+ /* @__PURE__ */ h(
1017
+ ne,
1018
+ {
1019
+ media: H,
1020
+ style: Pt(H, "right"),
1021
+ onMeasure: mt,
1022
+ onTransitionEnd: St
1023
+ },
1024
+ `next-${H.assetId}`
1025
+ ),
1026
+ Dt && /* @__PURE__ */ h(
1027
+ "div",
1028
+ {
1029
+ style: {
1030
+ position: "absolute",
1031
+ top: Dt.top,
1032
+ left: Dt.left,
1033
+ width: Dt.width,
1034
+ height: Dt.height,
1035
+ cursor: p || Y ? "default" : "pointer",
1036
+ pointerEvents: p || Y ? "none" : "auto",
1037
+ zIndex: 3
1038
+ },
1039
+ onClick: _e(1)
1040
+ }
1041
+ )
1042
+ ] }),
1043
+ Z && Ut && /* @__PURE__ */ h(
1044
+ ne,
1045
+ {
1046
+ media: Ut,
1047
+ style: Pt(Ut, "right", "far"),
1048
+ onMeasure: mt,
1049
+ onTransitionEnd: St
1050
+ },
1051
+ `far-next-${Ut.assetId}`
1052
+ ),
1053
+ E && f && (Te ? /* @__PURE__ */ h("div", { style: me, onTransitionEnd: St, children: /* @__PURE__ */ h(
1054
+ Be,
1055
+ {
1056
+ media: f,
1057
+ fit: "contain",
1058
+ lazy: !1,
1059
+ startsAtOnce: !0,
1060
+ style: ze
1061
+ }
1062
+ ) }, `${r}-${f.assetId}`) : Le ? /* @__PURE__ */ h(
1063
+ zn,
1064
+ {
1065
+ src: f.assetId,
1066
+ onMediaElement: Fe,
1067
+ wrapperStyle: me,
1068
+ videoStyle: ze,
1069
+ onLoadedMetadata: U,
1070
+ onTransitionEnd: St
1071
+ },
1072
+ `${r}-${f.assetId}`
1073
+ ) : /* @__PURE__ */ h(
1074
+ "img",
1075
+ {
1076
+ ref: Fe,
1077
+ src: f.assetId,
1078
+ alt: f.name,
1079
+ onLoad: U,
1080
+ onTransitionEnd: St,
1081
+ style: me
1082
+ },
1083
+ `${r}-${f.assetId}`
1084
+ ))
1085
+ ]
1086
+ }
1087
+ );
1088
+ }
1089
+ const _n = 20, Dn = 0.18;
1090
+ function jn(t) {
1091
+ return `
1092
+ .${t}-wrapper {
1093
+ box-sizing: border-box;
1094
+ max-width: 100%;
1095
+ overflow: visible;
1096
+ overflow-wrap: anywhere;
1097
+ word-break: break-word;
1098
+ }
1099
+ .${t}-item {
1100
+ display: inline;
1101
+ white-space: normal;
1102
+ max-width: 100%;
1103
+ }
1104
+ .${t}-item-title {
1105
+ display: inline;
1106
+ white-space: pre-wrap;
1107
+ overflow-wrap: anywhere;
1108
+ word-break: break-word;
1109
+ }
1110
+ .${t}-type-a.${t}-wrapper,
1111
+ .${t}-type-a .${t}-item-title {
1112
+ text-align: left;
1113
+ }
1114
+ .${t}-type-b.${t}-wrapper,
1115
+ .${t}-type-b .${t}-item-title {
1116
+ text-align: center;
1117
+ }
1118
+ .${t}-type-c.${t}-wrapper,
1119
+ .${t}-type-c .${t}-item-title {
1120
+ text-align: right;
1121
+ }
1122
+ .${t}-item-image {
1123
+ display: inline-block;
1124
+ vertical-align: baseline;
1125
+ position: relative;
1126
+ z-index: 1;
1127
+ height: 0;
1128
+ width: calc(1cap * var(--${t}-image-aspect));
1129
+ margin: 0 var(--${t}-image-inline-gap);
1130
+ }
1131
+ .${t}-item-image-fit {
1132
+ width: calc(1cap * var(--${t}-item-media-aspect, var(--${t}-image-aspect)));
1133
+ }
1134
+ .${t}-item-image img,
1135
+ .${t}-item-image video {
1136
+ position: absolute;
1137
+ left: 0;
1138
+ bottom: 0;
1139
+ display: block;
1140
+ height: 1cap;
1141
+ width: 100%;
1142
+ max-height: none;
1143
+ object-position: bottom;
1144
+ }
1145
+ .${t}-item-image-hover-scale img,
1146
+ .${t}-item-image-hover-scale video,
1147
+ .${t}-item-image-hover-scale [data-embed-frame] {
1148
+ transition: transform 0.3s ease;
1149
+ }
1150
+ .${t}-item-image-hover-scale:hover {
1151
+ z-index: 10;
1152
+ }
1153
+ .${t}-item-image-hover-scale:hover img,
1154
+ .${t}-item-image-hover-scale:hover video {
1155
+ transform: scale(var(--${t}-image-hover-scale, 1.2));
1156
+ }
1157
+ .${t}-item-image-hover-saturate img,
1158
+ .${t}-item-image-hover-saturate video {
1159
+ filter: grayscale(100%);
1160
+ transition: filter 0.3s ease;
1161
+ }
1162
+ .${t}-item-image-hover-saturate:hover img,
1163
+ .${t}-item-image-hover-saturate:hover video {
1164
+ filter: grayscale(0%);
1165
+ }
1166
+ .${t}-item-gap-host {
1167
+ display: inline-block;
1168
+ vertical-align: top;
1169
+ height: var(--${t}-line-height);
1170
+ position: relative;
1171
+ flex-shrink: 0;
1172
+ }
1173
+ .${t}-item-gap-control {
1174
+ position: absolute;
1175
+ top: 0;
1176
+ z-index: 2;
1177
+ pointer-events: auto;
1178
+ }
1179
+ ${vn(t)}
1180
+ `;
1181
+ }
1182
+ function Mn(t) {
1183
+ const { imageDisplay: e } = t ?? {}, r = (e == null ? void 0 : e.ratioValue) ?? "1:1", o = (e == null ? void 0 : e.reversed) ?? !1, [i, l] = r.split(":").map(Number), p = o ? l : i, c = o ? i : l;
1184
+ return c > 0 ? p / c : 1;
1185
+ }
1186
+ function Vn(t) {
1187
+ const e = t instanceof HTMLVideoElement ? t.videoWidth : t.naturalWidth, r = t instanceof HTMLVideoElement ? t.videoHeight : t.naturalHeight;
1188
+ return !e || !r ? null : e / r;
1189
+ }
1190
+ function Bn(t, e, r) {
1191
+ const o = (t == null ? void 0 : t.titleFontSize) ?? 0.07, i = (t == null ? void 0 : t.titleLineHeight) ?? o;
1192
+ return {
1193
+ [`--${e}-line-height`]: re(i, r ?? !1),
1194
+ [`--${e}-image-inline-gap`]: re(o * Dn, r ?? !1),
1195
+ [`--${e}-image-aspect`]: Mn(t)
1196
+ };
1197
+ }
1198
+ function Gn(t, e) {
1199
+ var o, i;
1200
+ const r = {
1201
+ fontSettings: {
1202
+ fontFamily: (t == null ? void 0 : t.titleFontFamily) ?? "Arial",
1203
+ fontWeight: ((o = t == null ? void 0 : t.titleFontSettings) == null ? void 0 : o.fontWeight) ?? 400,
1204
+ fontStyle: ((i = t == null ? void 0 : t.titleFontSettings) == null ? void 0 : i.fontStyle) ?? "normal"
1205
+ },
1206
+ fontSize: (t == null ? void 0 : t.titleFontSize) ?? 0.07,
1207
+ lineHeight: t == null ? void 0 : t.titleLineHeight,
1208
+ letterSpacing: (t == null ? void 0 : t.titleLetterSpacing) ?? 0,
1209
+ wordSpacing: (t == null ? void 0 : t.titleWordSpacing) ?? 0,
1210
+ textAppearance: t == null ? void 0 : t.titleTextAppearance,
1211
+ color: (t == null ? void 0 : t.titleColor) ?? "#000000"
1212
+ };
1213
+ return gn(r, e);
1214
+ }
1215
+ function Xn(t) {
1216
+ var i;
1217
+ const e = ((i = t == null ? void 0 : t.imageDisplay) == null ? void 0 : i.display) === "cover", r = ((t == null ? void 0 : t.lightbox) ?? "on") === "on", o = {
1218
+ objectFit: e ? "cover" : "contain",
1219
+ pointerEvents: "auto",
1220
+ ...r ? { cursor: "pointer" } : null
1221
+ };
1222
+ return {
1223
+ objectFitMode: e ? "cover" : "contain",
1224
+ imageStyle: o
1225
+ };
1226
+ }
1227
+ function qn(t, e, r, o, i, l) {
1228
+ if (!(!t || !e))
1229
+ return (p) => {
1230
+ var z;
1231
+ const c = ((z = p.currentTarget.closest(`.${o}-item`)) == null ? void 0 : z.querySelector(
1232
+ `[data-waterfall-index="${r}"]`
1233
+ )) ?? (p.currentTarget instanceof HTMLImageElement || p.currentTarget instanceof HTMLVideoElement ? p.currentTarget : null);
1234
+ l(
1235
+ r,
1236
+ c ? Xe(c, i) : void 0
1237
+ );
1238
+ };
1239
+ }
1240
+ function or({
1241
+ settings: t,
1242
+ content: e,
1243
+ isEditor: r,
1244
+ isPreviewMode: o,
1245
+ isEditMode: i,
1246
+ layoutId: l,
1247
+ portalId: p
1248
+ }) {
1249
+ const { prefix: c } = fn(), z = we(() => jn(c), [c]), b = e ?? [], P = (t == null ? void 0 : t.type) ?? "a", ae = typeof (t == null ? void 0 : t.wrapperWidth) == "number" ? t.wrapperWidth : 1, ct = typeof (t == null ? void 0 : t.horizontalGap) == "number" ? t.horizontalGap : 0, wt = re(ct, r ?? !1), Vt = `max(${wt}, ${_n}px)`, { objectFitMode: G, imageStyle: Tt } = Xn(t), Wt = Gn(t, r), V = y(null), [X, tt] = $(!1), [st, Bt] = $([]), [et, nt] = $(0), [T, R] = $(0), [F, vt] = $(null), [yt, ut] = $({ title1: "", title2: "", title3: "" }), O = (!r || o) && !X, kt = (t == null ? void 0 : t.imageHoverEffect) ?? { sizeType: "none", value: 120 }, rt = kt.sizeType ?? "none", ft = O && rt !== "none" ? `${c}-item-image-hover-${rt}` : void 0, dt = (kt.value ?? 120) / 100, ht = v((s) => {
1250
+ !s || rt !== "scale" || (s.style.transformOrigin = hn(s));
1251
+ }, [rt]), ot = v((s) => {
1252
+ if (s) {
1253
+ if (G === "contain") {
1254
+ const g = Vn(s);
1255
+ if (g) {
1256
+ const C = s.closest(`.${c}-item-image`);
1257
+ C instanceof HTMLElement && C.style.setProperty(`--${c}-item-media-aspect`, String(g));
1258
+ }
1259
+ }
1260
+ ht(s);
1261
+ }
1262
+ }, [c, ht, G]), E = {
1263
+ width: re(ae, r ?? !1),
1264
+ ...Wt,
1265
+ ...Bn(t, c, r),
1266
+ [`--${c}-image-hover-scale`]: String(dt)
1267
+ }, xt = (() => {
1268
+ const s = {}, g = V.current ? getComputedStyle(V.current).getPropertyValue("--cntrl-article-width").trim() : "";
1269
+ return g && (s["--cntrl-article-width"] = g), s;
1270
+ })(), Gt = ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && (!r || o || i), _ = we(() => Tn(b), [b]), le = we(() => En(b), [b]), w = (s, g) => {
1271
+ if (((t == null ? void 0 : t.lightbox) ?? "on") === "off" || r && !i && !o) return;
1272
+ const C = _.findIndex((B) => B.gridIndex === s);
1273
+ if (C < 0) return;
1274
+ const S = _[C];
1275
+ R(C), Bt(S.items), nt(0), ut(S.entry), vt(g ?? null), tt(!0);
1276
+ }, Ht = v(() => {
1277
+ tt(!1), vt(null);
1278
+ }, []), it = v(() => {
1279
+ const s = _[T];
1280
+ return !s || !V.current ? F : Ln(V.current, s.gridIndex, G) ?? F;
1281
+ }, [_, T, F, G]), $t = v((s) => {
1282
+ if (_.length > 1) {
1283
+ const g = _.length, C = (T + s + g) % g, S = _[C];
1284
+ R(C), Bt(S.items), nt(0), ut(S.entry);
1285
+ return;
1286
+ }
1287
+ nt((g) => (g + s + st.length) % st.length);
1288
+ }, [_, T, st.length]), zt = _.length > 1 || st.length > 1;
1289
+ return W(() => {
1290
+ if (!X || typeof document > "u") return;
1291
+ const s = document.body.style.overflow;
1292
+ return document.body.style.overflow = "hidden", () => {
1293
+ document.body.style.overflow = s;
1294
+ };
1295
+ }, [X]), W(() => {
1296
+ !r || i || o || tt(!1);
1297
+ }, [r, i, o]), W(() => {
1298
+ ((t == null ? void 0 : t.lightbox) ?? "on") === "off" && tt(!1);
1299
+ }, [t == null ? void 0 : t.lightbox]), /* @__PURE__ */ It(ye, { children: [
1300
+ /* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: z } }),
1301
+ /* @__PURE__ */ h(Cn, { mediaList: le }),
1302
+ /* @__PURE__ */ h("div", { ref: V, className: `${c}-wrapper ${c}-type-${P}`, style: E, children: b.map((s, g) => {
1303
+ var B, bt;
1304
+ const C = !!((B = s.image) != null && B.assetId), S = qn(
1305
+ !!Gt,
1306
+ C,
1307
+ g,
1308
+ c,
1309
+ G,
1310
+ w
1311
+ );
1312
+ return /* @__PURE__ */ It(
1313
+ "div",
1314
+ {
1315
+ className: `${c}-item`,
1316
+ children: [
1317
+ s.title ? /* @__PURE__ */ h(
1318
+ "span",
1319
+ {
1320
+ className: `${c}-item-title`,
1321
+ onClick: S,
1322
+ style: S ? { cursor: "pointer" } : void 0,
1323
+ children: s.title
1324
+ }
1325
+ ) : null,
1326
+ (bt = s.image) != null && bt.assetId ? /* @__PURE__ */ h(
1327
+ "span",
1328
+ {
1329
+ className: [
1330
+ `${c}-item-image`,
1331
+ G === "contain" ? `${c}-item-image-fit` : void 0,
1332
+ ft
1333
+ ].filter(Boolean).join(" "),
1334
+ style: Lt(s.image) ? { [`--${c}-item-media-aspect`]: String(Ge(s.image)) } : void 0,
1335
+ children: Lt(s.image) ? /* @__PURE__ */ h(
1336
+ Be,
1337
+ {
1338
+ media: s.image,
1339
+ fit: G,
1340
+ silentLoop: C,
1341
+ "data-waterfall-index": g,
1342
+ style: { ...Tt, position: "absolute", left: 0, bottom: 0, width: "100%", height: "1cap" },
1343
+ onClick: S
1344
+ }
1345
+ ) : s.image.type === "video" ? /* @__PURE__ */ h(
1346
+ pn,
1347
+ {
1348
+ ref: ot,
1349
+ src: s.image.assetId,
1350
+ "data-waterfall-index": g,
1351
+ style: Tt,
1352
+ playsInline: !0,
1353
+ muted: !0,
1354
+ loop: !0,
1355
+ autoPlay: !0,
1356
+ onClick: S,
1357
+ onLoadedMetadata: (q) => ot(q.currentTarget)
1358
+ }
1359
+ ) : /* @__PURE__ */ h(
1360
+ "img",
1361
+ {
1362
+ ref: ot,
1363
+ src: s.image.assetId,
1364
+ alt: s.image.name ?? "",
1365
+ "data-waterfall-index": g,
1366
+ style: Tt,
1367
+ onClick: S,
1368
+ onLoad: (q) => ot(q.currentTarget)
1369
+ }
1370
+ )
1371
+ }
1372
+ ) : null,
1373
+ g < b.length - 1 && /* @__PURE__ */ h(
1374
+ "div",
1375
+ {
1376
+ className: `${c}-item-gap-host`,
1377
+ style: { width: wt },
1378
+ children: i && !X && /* @__PURE__ */ h(
1379
+ "div",
1380
+ {
1381
+ "data-controls": "horizontalGap",
1382
+ "data-controls-axis": "x",
1383
+ "data-controls-min": "0",
1384
+ className: `${c}-item-gap-control`,
1385
+ style: {
1386
+ left: "50%",
1387
+ transform: "translateX(-50%)",
1388
+ width: Vt,
1389
+ height: "100%"
1390
+ }
1391
+ }
1392
+ )
1393
+ }
1394
+ )
1395
+ ]
1396
+ },
1397
+ g
1398
+ );
1399
+ }) }),
1400
+ X && ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && typeof document < "u" && t && (() => {
1401
+ const s = (p ? document.getElementById(p) : null) ?? document.body;
1402
+ return un(
1403
+ /* @__PURE__ */ h("div", { style: xt, "data-selection": "none", children: /* @__PURE__ */ h(
1404
+ On,
1405
+ {
1406
+ prefix: c,
1407
+ items: st,
1408
+ index: et,
1409
+ entry: yt,
1410
+ settings: t,
1411
+ isEditor: r,
1412
+ isEditMode: i,
1413
+ isPreviewMode: o,
1414
+ canNavigate: zt,
1415
+ lightboxEntries: _,
1416
+ entryIdx: T,
1417
+ layoutId: l,
1418
+ sourceRect: F,
1419
+ resolveCloseSourceRect: it,
1420
+ onClose: Ht,
1421
+ onPrev: () => $t(-1),
1422
+ onNext: () => $t(1)
1423
+ }
1424
+ ) }),
1425
+ s
1426
+ );
1427
+ })()
1428
+ ] });
1429
+ }
1430
+ export {
1431
+ or as Waterfall
1432
+ };