@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
@@ -1,563 +0,0 @@
1
- import { jsxs as le, jsx as x } from "react/jsx-runtime";
2
- import { useState as J, useMemo as Z, useRef as _, useLayoutEffect as U, useEffect as be, useCallback as we } from "react";
3
- import te from "classnames";
4
- import { s as _e } from "./scalingValue-C9JH5L6O.mjs";
5
- import { u as We } from "./useScopedStyles-DhBG3557.mjs";
6
- import { o as $e, N as Me, p as xe, r as Re, a as Ie } from "./useLazyVideos-CZLyNolX.mjs";
7
- function Te(e, n) {
8
- const r = n > 0 ? `${n}px` : "0px";
9
- return `
10
- .${e}-marquee-wrapper {
11
- overflow: hidden;
12
- width: 100%;
13
- height: auto;
14
- }
15
-
16
- @keyframes ${e}-marquee-left {
17
- from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
18
- to { -webkit-transform: translate3d(-${r}, 0, 0); transform: translate3d(-${r}, 0, 0); }
19
- }
20
-
21
- @keyframes ${e}-marquee-right {
22
- from { -webkit-transform: translate3d(-${r}, 0, 0); transform: translate3d(-${r}, 0, 0); }
23
- to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
24
- }
25
-
26
- .${e}-marquee-track {
27
- display: flex;
28
- flex-direction: row;
29
- width: max-content;
30
- will-change: transform;
31
- backface-visibility: hidden;
32
- -webkit-backface-visibility: hidden;
33
- flex-wrap: nowrap;
34
- -webkit-animation-timing-function: linear;
35
- animation-timing-function: linear;
36
- -webkit-animation-iteration-count: infinite;
37
- animation-iteration-count: infinite;
38
- }
39
-
40
- .${e}-marquee-track[data-direction="left"] {
41
- -webkit-animation-name: ${e}-marquee-left;
42
- animation-name: ${e}-marquee-left;
43
- }
44
-
45
- .${e}-marquee-track[data-direction="right"] {
46
- -webkit-animation-name: ${e}-marquee-right;
47
- animation-name: ${e}-marquee-right;
48
- }
49
- .${e}-marquee-row {
50
- display: flex;
51
- flex-direction: row;
52
- align-items: flex-start;
53
- }
54
- .${e}-marquee-set {
55
- flex: 0 0 auto;
56
- }
57
- .${e}-marquee-static {
58
- justify-content: center;
59
- overflow-x: auto;
60
- }
61
- .${e}-marquee-card {
62
- position: relative;
63
- flex: 0 0 auto;
64
- align-self: flex-start;
65
- }
66
- .${e}-wrapper {
67
- position: relative;
68
- width: 100%;
69
- height: 100%;
70
- order: 1;
71
- }
72
- .${e}-cover {
73
- position: absolute;
74
- width: 100%;
75
- height: 100%;
76
- top: 0;
77
- left: 0;
78
- }
79
- .${e}-elements-overlay {
80
- position: relative;
81
- inset: 0;
82
- display: flex;
83
- flex-direction: column;
84
- pointer-events: none;
85
- }
86
- .${e}-control {
87
- position: relative;
88
- z-index: 2;
89
- width: 100%;
90
- }
91
-
92
- .${e}-marquee-link {
93
- display: flex;
94
- flex-direction: column;
95
- justify-content: center;
96
- align-items: center;
97
- width: 100%;
98
- height: 100%;
99
- text-decoration: none;
100
- color: inherit;
101
- }
102
- .${e}-marquee-link-contain {
103
- width: auto;
104
- height: auto;
105
- }
106
-
107
- .${e}-control::before {
108
- content: "";
109
- position: absolute;
110
- top: 0;
111
- left: 0;
112
- width: 100%;
113
- height: 100%;
114
- min-height: 20px;
115
- pointer-events: auto;
116
- z-index: 10;
117
- }
118
-
119
- .${e}-gap-control {
120
- position: relative;
121
- z-index: 2;
122
- pointer-events: auto;
123
- height: 100%;
124
- }
125
- .${e}-image-hover-brightness img,
126
- .${e}-image-hover-brightness video {
127
- transition: filter 0.3s ease;
128
- }
129
- .${e}-image-hover-brightness:hover img,
130
- .${e}-image-hover-brightness:hover video {
131
- filter: brightness(1.25);
132
- }
133
- .${e}-image-hover-grayscale img,
134
- .${e}-image-hover-grayscale video {
135
- transition: filter 0.3s ease;
136
- }
137
- .${e}-image-hover-grayscale:hover img,
138
- .${e}-image-hover-grayscale:hover video {
139
- filter: grayscale(100%);
140
- }
141
- `;
142
- }
143
- const Ve = 30, He = 20, ue = 3, Oe = 12, Be = 32, Le = 3, ze = 250, je = 0.5, Ue = (e) => {
144
- e.style.setProperty("animation-name", "none"), e.style.setProperty("-webkit-animation-name", "none"), e.offsetHeight, e.style.removeProperty("animation-name"), e.style.removeProperty("-webkit-animation-name");
145
- }, Fe = (e, n) => Array.from({ length: n }, () => e).flat(), Ge = (e) => typeof e == "string" ? {
146
- display: e.toLowerCase() === "cover" ? "cover" : "fit",
147
- ratioValue: "16:9",
148
- reversed: !1
149
- } : {
150
- display: (typeof (e == null ? void 0 : e.display) == "string" ? e.display.toLowerCase() : "") === "cover" ? "cover" : "fit",
151
- ratioValue: (e == null ? void 0 : e.ratioValue) ?? "16:9",
152
- reversed: (e == null ? void 0 : e.reversed) ?? !1
153
- }, qe = (e) => e.reduce(
154
- (n, r) => n + (r.offsetWidth || r.getBoundingClientRect().width),
155
- 0
156
- ), Ce = (e, n) => {
157
- if (n <= 0 || e.children.length < n) return 0;
158
- const r = e.children[0], d = e.children[n - 1];
159
- if (!r || !d) return 0;
160
- const p = getComputedStyle(e), u = Number.parseFloat(p.columnGap || p.gap || "0") || 0, v = d.getBoundingClientRect().right - r.getBoundingClientRect().left;
161
- if (v > 0) return v;
162
- const R = Array.from({ length: n }, (b, W) => e.children[W]), f = qe(R);
163
- return f <= 0 ? 0 : f + u * Math.max(0, n - 1);
164
- }, Xe = (e) => {
165
- const n = e.getBoundingClientRect().width;
166
- if (n > 0) return n;
167
- const r = e.offsetWidth;
168
- if (r > 0) return r;
169
- const d = qe(Array.from(e.children));
170
- if (d <= 0) return 0;
171
- const p = getComputedStyle(e), u = Number.parseFloat(p.columnGap || p.gap || "0") || 0, v = Number.parseFloat(p.paddingRight) || 0;
172
- return d + u * Math.max(0, e.children.length - 1) + v;
173
- }, De = (e, n) => {
174
- const r = n.getBoundingClientRect(), d = e.getBoundingClientRect();
175
- return d.right > r.left && d.left < r.right;
176
- }, Ke = (e, n) => {
177
- const r = e.querySelectorAll(`[data-marquee-item-index="${n}"]`);
178
- return Array.from(r).some((d) => De(d, e));
179
- }, Qe = (e) => {
180
- if (e.type === "video") return !0;
181
- if (e.type === "image") return !1;
182
- const n = e.name ?? "";
183
- return /\.(mp4|webm|ogg|mov)(\?|$)/i.test(n) ? !0 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId ?? "");
184
- }, Ye = (e) => e ? e instanceof HTMLVideoElement ? e.readyState >= 1 : e.complete : !1, Je = ({
185
- item: e,
186
- prefix: n,
187
- imageFit: r,
188
- imageMaxWidth: d,
189
- imageMaxHeight: p,
190
- cornerRadius: u,
191
- imageHoverClass: v,
192
- isFirstSet: R,
193
- scaled: f,
194
- onFirstSetImageDone: b
195
- }) => {
196
- var S, N, O, B;
197
- const W = _(null), F = !!((S = e.image) != null && S.assetId && Qe(e.image));
198
- U(() => {
199
- R && Ye(W.current) && (b == null || b());
200
- }, [R, (N = e.image) == null ? void 0 : N.assetId, b]);
201
- const V = r.display === "cover", q = r.ratioValue ?? "1:1", G = r.reversed ?? !1, [X, C] = q.split(":").map(Number), D = (G ? C : X) / (G ? X : C), E = d / D, K = E > p ? p : E, M = E > p ? p * D : d, P = f(M), k = f(K), ee = {
202
- borderRadius: f(u)
203
- }, y = V ? {
204
- pointerEvents: "auto",
205
- display: "block",
206
- width: "100%",
207
- height: "100%",
208
- objectFit: "cover",
209
- ...ee
210
- } : {
211
- pointerEvents: "auto",
212
- display: "block",
213
- width: "auto",
214
- height: "auto",
215
- maxWidth: f(d),
216
- maxHeight: f(p),
217
- objectFit: "contain",
218
- ...ee
219
- }, I = ((O = e.image) == null ? void 0 : O.assetId) && (F ? /* @__PURE__ */ x(
220
- "video",
221
- {
222
- ref: (T) => {
223
- W.current = T;
224
- },
225
- src: e.image.assetId,
226
- style: y,
227
- muted: !0,
228
- loop: !0,
229
- playsInline: !0,
230
- preload: "none",
231
- onLoadedMetadata: R ? b : void 0,
232
- onError: R ? b : void 0
233
- }
234
- ) : /* @__PURE__ */ x(
235
- "img",
236
- {
237
- ref: (T) => {
238
- W.current = T;
239
- },
240
- src: e.image.assetId,
241
- alt: ((B = e.image) == null ? void 0 : B.name) ?? "",
242
- style: y,
243
- onLoad: R ? b : void 0,
244
- onError: R ? b : void 0
245
- }
246
- ));
247
- return /* @__PURE__ */ x(
248
- "div",
249
- {
250
- style: {
251
- display: "flex",
252
- flexDirection: "column",
253
- alignItems: "start",
254
- ...V ? { width: P } : { width: "max-content", maxWidth: f(d), minWidth: 0 }
255
- },
256
- children: /* @__PURE__ */ x(
257
- "div",
258
- {
259
- className: v,
260
- style: {
261
- display: "flex",
262
- flexDirection: "column",
263
- justifyContent: "center",
264
- alignItems: "center",
265
- flexShrink: 0,
266
- ...V ? {
267
- width: P,
268
- height: k,
269
- overflow: "hidden",
270
- ...ee
271
- } : {
272
- width: "max-content",
273
- maxWidth: f(d),
274
- height: f(p)
275
- }
276
- },
277
- children: I && e.link ? /* @__PURE__ */ x("a", { href: e.link, target: "_self", rel: "noopener noreferrer", className: te(`${n}-marquee-link`, !V && `${n}-marquee-link-contain`), children: I }) : I
278
- }
279
- )
280
- }
281
- );
282
- }, at = ({ settings: e, content: n, isEditor: r, isPreviewMode: d, isEditMode: p }) => {
283
- const { prefix: u } = We(), [v, R] = J(0), f = v > 0 ? Math.round(v) : 0, b = Z(() => Te(u, f), [u, f]), {
284
- speed: W,
285
- direction: F,
286
- pauseOnHover: V,
287
- gap: q,
288
- imageMaxWidth: G,
289
- imageMaxHeight: X,
290
- hoverEffect: C,
291
- cornerRadius: de = 0
292
- } = e, H = Z(() => Ge(e.imageFit), [e.imageFit]), D = H.display !== "cover", E = (n == null ? void 0 : n.length) ?? 0, K = !!p, M = !r || !!d, P = M && C !== "off" && C !== "randomize" ? `${u}-image-hover-${C}` : void 0, k = r ? !!d : !0, y = ((n == null ? void 0 : n.length) ?? 0) > 0 && (k || !!r), I = Math.max(0, W) * Ve, S = (t) => _e(t, r ?? !1), N = _(null), O = _(null), B = _(null), [T, fe] = J(0), ne = k && V === "on", [Ee, me] = J(!1), [L, re] = J({}), ae = _(L);
293
- ae.current = L;
294
- const ie = _(null), oe = _(0), Q = _(null), he = Z(() => (n ?? []).map((t) => {
295
- var a;
296
- return ((a = t.image) == null ? void 0 : a.assetId) ?? "";
297
- }).join("\0"), [n]), [z, pe] = J(ue), se = Z(() => {
298
- const t = n ?? [];
299
- return t.length === 0 || !(k || !!r) ? t : Fe(t, z);
300
- }, [n, k, z, r]), ge = Z(
301
- () => (n ?? []).filter((t) => {
302
- var a;
303
- return !!((a = t.image) != null && a.assetId);
304
- }).length,
305
- [n]
306
- ), ve = y ? Le : 1;
307
- U(() => {
308
- oe.current = 0, re({}), ie.current = null, pe(ue), R(0);
309
- }, [he]), be(() => {
310
- if (!M || C !== "randomize") return;
311
- const t = N.current;
312
- if (!t) return;
313
- const a = (s) => {
314
- re((c) => {
315
- const g = Array.from(s).filter(
316
- (h) => h in c && !Ke(t, h)
317
- );
318
- if (g.length === 0) return c;
319
- const m = { ...c };
320
- return g.forEach((h) => {
321
- delete m[h];
322
- }), m;
323
- });
324
- }, i = new IntersectionObserver((s) => {
325
- const c = /* @__PURE__ */ new Set();
326
- for (const g of s) {
327
- const m = g.target.dataset.marqueeItemIndex, h = m !== void 0 ? Number(m) : NaN;
328
- Number.isNaN(h) || c.add(h);
329
- }
330
- c.size > 0 && a(c);
331
- }, { root: t, threshold: 0 });
332
- Object.keys(L).forEach((s) => {
333
- const c = Number(s);
334
- t.querySelectorAll(`[data-marquee-item-index="${c}"]`).forEach((g) => i.observe(g));
335
- });
336
- const l = { current: 0 }, o = () => {
337
- const s = Object.keys(ae.current);
338
- s.length !== 0 && (a(s.map(Number)), l.current = requestAnimationFrame(o));
339
- };
340
- return Object.keys(ae.current).length > 0 && (l.current = requestAnimationFrame(o)), () => {
341
- cancelAnimationFrame(l.current), i.disconnect();
342
- };
343
- }, [C, L, M]), be(() => {
344
- const t = N.current;
345
- if (!t || typeof IntersectionObserver > "u") return;
346
- let a = !1, i = !1, l;
347
- const o = () => {
348
- const m = t.querySelectorAll("video");
349
- if (!a) {
350
- m.forEach(xe);
351
- return;
352
- }
353
- const h = t.getBoundingClientRect(), A = h.width * je;
354
- m.forEach((w) => {
355
- const Y = w.getBoundingClientRect(), j = Y.right > h.left && Y.left < h.right;
356
- Y.right > h.left - A && Y.left < h.right + A ? Re(w, "auto") : D && Re(w, "metadata"), i && j ? w.paused && Ie(w) : xe(w);
357
- });
358
- }, s = () => {
359
- a && l === void 0 ? l = setInterval(o, ze) : !a && l !== void 0 && (clearInterval(l), l = void 0), o();
360
- }, c = $e(t, Me, (m) => {
361
- a = m, s();
362
- }), g = $e(t, "0px", (m) => {
363
- i = m, s();
364
- });
365
- return () => {
366
- c(), g(), clearInterval(l);
367
- };
368
- }, [y, D]), U(() => {
369
- if (!y) return;
370
- const t = N.current, a = B.current;
371
- if (!t || !a) return;
372
- const i = { current: 0 }, l = () => {
373
- const c = t.getBoundingClientRect().width || t.offsetWidth, g = Xe(a), m = ie.current, h = typeof m == "number" && Math.abs(m - g) <= 0.25;
374
- ie.current = g;
375
- let A = z, w = 0;
376
- if ((k || r) && E > 0 && c > 0) {
377
- const $ = Ce(a, E);
378
- if ($ >= Be) {
379
- w = $;
380
- const ce = Math.min(
381
- Oe,
382
- Math.max(
383
- ue,
384
- Math.ceil(c / $) + 1
385
- )
386
- );
387
- A = ce, ce !== z && pe(ce);
388
- }
389
- }
390
- const j = A !== z && w > 0 ? w * A : g > 0 ? g : w > 0 ? w * A : (() => {
391
- const $ = Ce(a, E);
392
- return $ > 0 ? $ * A : 0;
393
- })();
394
- j > 0 ? R(($) => $ <= 0 ? j : !h || Math.round($) === Math.round(j) ? $ : j) : !h && v <= 0 && (cancelAnimationFrame(i.current), i.current = requestAnimationFrame(l));
395
- }, o = () => {
396
- cancelAnimationFrame(i.current), i.current = requestAnimationFrame(l);
397
- };
398
- Q.current = o, o();
399
- const s = new ResizeObserver(o);
400
- return s.observe(t), s.observe(a), () => {
401
- Q.current = null, cancelAnimationFrame(i.current), s.disconnect();
402
- };
403
- }, [k, y, v, he, z, E, r]), U(() => {
404
- if (!y || f <= 0) return;
405
- const t = O.current;
406
- t && Ue(t);
407
- }, [y, f, F, I]), U(() => {
408
- if (!y || v <= 0) {
409
- fe(0);
410
- return;
411
- }
412
- const t = O.current, a = B.current;
413
- if (!t || !a) return;
414
- const i = () => {
415
- const o = t.offsetHeight || t.getBoundingClientRect().height, s = Array.from(a.children).reduce(
416
- (g, m) => Math.max(g, m.offsetHeight || m.getBoundingClientRect().height),
417
- 0
418
- ), c = o > 0 ? o : s;
419
- fe(c > 0 ? c : 0);
420
- };
421
- i();
422
- const l = new ResizeObserver(i);
423
- return l.observe(t), l.observe(a), () => l.disconnect();
424
- }, [y, ve, se, r, q, G, X, v, H, L]), U(() => {
425
- if (!r || !K || !y || typeof window > "u") return;
426
- const t = requestAnimationFrame(() => {
427
- window.dispatchEvent(new Event("scroll"));
428
- });
429
- return () => cancelAnimationFrame(t);
430
- }, [r, K, y, F, v, T, q, se]);
431
- const ke = () => {
432
- ne && me(!0);
433
- }, Se = () => {
434
- ne && me(!1);
435
- }, Ne = we(() => {
436
- var t;
437
- oe.current = Math.min(
438
- ge,
439
- oe.current + 1
440
- ), (t = Q.current) == null || t.call(Q);
441
- }, [ge]), Ae = we((t, a) => {
442
- re((i) => {
443
- const l = i[t] ?? a, o = (n ?? []).filter((c) => c !== l);
444
- if (o.length === 0) return i;
445
- const s = o[Math.floor(Math.random() * o.length)];
446
- return { ...i, [t]: s };
447
- });
448
- }, [n]), ye = (t, a, i, l) => {
449
- const o = M && C === "randomize" && H.display === "cover" ? L[i] ?? t : t, s = `max(${S(q)}, ${He}px)`, c = `calc(-0.5 * (${s} + ${S(q)}))`;
450
- return /* @__PURE__ */ le(
451
- "div",
452
- {
453
- className: `${u}-marquee-card`,
454
- "data-marquee-item-index": i,
455
- onMouseEnter: M && C === "randomize" && H.display === "cover" ? () => Ae(i, t) : void 0,
456
- children: [
457
- /* @__PURE__ */ x(
458
- Je,
459
- {
460
- item: o,
461
- prefix: u,
462
- imageFit: H,
463
- imageMaxWidth: G,
464
- imageMaxHeight: X,
465
- cornerRadius: de,
466
- imageHoverClass: P,
467
- isEditor: r,
468
- isFirstSet: l,
469
- scaled: S,
470
- onFirstSetImageDone: Ne
471
- }
472
- ),
473
- K && /* @__PURE__ */ x(
474
- "div",
475
- {
476
- "data-controls": "gap",
477
- "data-controls-axis": "x",
478
- className: `${u}-gap-control`,
479
- style: {
480
- position: "absolute",
481
- top: 0,
482
- right: c,
483
- width: s,
484
- height: "100%"
485
- }
486
- }
487
- )
488
- ]
489
- },
490
- `${a}-${i}`
491
- );
492
- };
493
- if (y) {
494
- const t = k ? ne && Ee ? "paused" : "running" : "paused", a = f > 0 && I > 0 ? f / I * 1e3 : 0, i = `${Math.max(0, a) / 1e3}s`;
495
- return /* @__PURE__ */ le(
496
- "div",
497
- {
498
- ref: N,
499
- className: te(`${u}-wrapper`, `${u}-marquee-wrapper`),
500
- "aria-label": "Marquee",
501
- style: T > 0 ? { height: T } : void 0,
502
- children: [
503
- /* @__PURE__ */ x("style", { dangerouslySetInnerHTML: { __html: b } }),
504
- /* @__PURE__ */ x(
505
- "div",
506
- {
507
- ref: O,
508
- className: `${u}-marquee-track`,
509
- "data-direction": F,
510
- onMouseEnter: ke,
511
- onMouseLeave: Se,
512
- style: {
513
- WebkitAnimationDuration: i,
514
- animationDuration: i,
515
- WebkitAnimationPlayState: t,
516
- animationPlayState: t
517
- },
518
- children: Array.from({ length: ve }, (l, o) => /* @__PURE__ */ x(
519
- "div",
520
- {
521
- ref: o === 0 ? B : void 0,
522
- className: te(`${u}-marquee-row`, `${u}-marquee-set`),
523
- style: {
524
- gap: S(q),
525
- paddingRight: S(q)
526
- },
527
- "aria-hidden": o > 0,
528
- children: se.map(
529
- (s, c) => ye(
530
- s,
531
- o,
532
- c,
533
- o === 0 && c < E
534
- )
535
- )
536
- },
537
- `set-${o}`
538
- ))
539
- }
540
- )
541
- ]
542
- }
543
- );
544
- }
545
- return /* @__PURE__ */ le("div", { ref: N, className: `${u}-wrapper`, children: [
546
- /* @__PURE__ */ x("style", { dangerouslySetInnerHTML: { __html: b } }),
547
- /* @__PURE__ */ x(
548
- "div",
549
- {
550
- className: te(`${u}-marquee-row`, `${u}-marquee-static`),
551
- style: { gap: S(q), transform: "none" },
552
- "aria-label": "Marquee",
553
- children: n == null ? void 0 : n.map(
554
- (t, a) => ye(t, 0, a)
555
- )
556
- },
557
- "marquee-static"
558
- )
559
- ] });
560
- };
561
- export {
562
- at as Marquee
563
- };