@cntrl-site/components 1.0.105 → 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 (88) 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/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  17. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  18. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  19. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  20. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  21. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  22. package/dist/Grid-CFHTP3mb.js +378 -0
  23. package/dist/Grid-e-gLfsji.mjs +1590 -0
  24. package/dist/Helix-BpLo9FD3.js +43 -0
  25. package/dist/Helix-CidI3ucE.mjs +324 -0
  26. package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
  27. package/dist/Hive-D1j6wZpV.js +321 -0
  28. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  29. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  30. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  31. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  32. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  33. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  34. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  35. package/dist/List-DVvpQ24J.js +377 -0
  36. package/dist/Marquee-DByooiWP.mjs +578 -0
  37. package/dist/Marquee-DfIP-tIN.js +133 -0
  38. package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
  39. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  40. package/dist/Mercury-B-s2Kvuq.js +267 -0
  41. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  42. package/dist/PretextComponent-Dnbenstn.js +1 -0
  43. package/dist/{PretextComponent-j-OsRZTx.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
  44. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  45. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  46. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  47. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  48. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  49. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  50. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  51. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  52. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  53. package/dist/Waterfall-DII4-WV5.js +288 -0
  54. package/dist/{components-D2LyuDm-.mjs → components-BRmbflgg.mjs} +15 -15
  55. package/dist/components-nvbH4l0S.js +1 -0
  56. package/dist/content/postFieldBindings.d.ts +29 -0
  57. package/dist/elements.js +1 -1
  58. package/dist/elements.mjs +16 -16
  59. package/dist/elements.node.js +1 -1
  60. package/dist/elements.node.mjs +1 -1
  61. package/dist/index.d.ts +3 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +52 -15
  64. package/dist/sources.js +312 -212
  65. package/dist/sources.mjs +312 -212
  66. package/dist/types/SchemaV1.d.ts +53 -1
  67. package/dist/utils.js +1 -1
  68. package/dist/utils.mjs +30 -20
  69. package/package.json +1 -1
  70. package/dist/ClickGallerie-D7g093HX.js +0 -36
  71. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  72. package/dist/Grid-BBpdl60K.js +0 -374
  73. package/dist/Grid-DS53S_gA.mjs +0 -1576
  74. package/dist/Helix-BPn9V1sg.mjs +0 -315
  75. package/dist/Helix-DcgsCc4D.js +0 -43
  76. package/dist/Hive-n8Fz-j3o.js +0 -321
  77. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  78. package/dist/List-C32WImI3.js +0 -377
  79. package/dist/Marquee-DOIRRCu4.js +0 -133
  80. package/dist/Marquee-O_PDwlIb.mjs +0 -564
  81. package/dist/MarqueeText-DkaO2lQ5.js +0 -132
  82. package/dist/Mercury-C9D10TTT.mjs +0 -1702
  83. package/dist/Mercury-DynO-NxY.js +0 -267
  84. package/dist/PretextComponent-BnsS2zJ6.js +0 -1
  85. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  86. package/dist/Waterfall-DC2WQ3GT.js +0 -287
  87. package/dist/Waterfall-Yud2VR62.mjs +0 -1404
  88. package/dist/components-B9Vdjf0w.js +0 -1
@@ -1,315 +0,0 @@
1
- import { jsxs as ce, Fragment as ie, jsx as h } from "react/jsx-runtime";
2
- import { useRef as V, useMemo as y, useEffect as Ee } from "react";
3
- import { s as ae } from "./scalingValue-C9JH5L6O.mjs";
4
- import { u as xe } from "./useScopedStyles-DhBG3557.mjs";
5
- import { L as Re } from "./LazyVideo-CdAWymKO.mjs";
6
- const Te = 10, _e = 400, Se = 1, Fe = 1120 / 1440, Ae = 140 / 1440, we = 550 / 1440, Ne = 13, De = 4, $e = 38 / 100, Ce = 28 / 100, de = 2.8, Le = 0.9, fe = 0.22, He = 0.5, Pe = 1, Ue = 1.5, ge = 0, ze = 0.85;
7
- function We(e) {
8
- return `
9
- .${e}-wrapper {
10
- position: relative;
11
- box-sizing: border-box;
12
- overflow: hidden;
13
- isolation: isolate;
14
- contain: layout paint;
15
- }
16
- .${e}-item {
17
- position: absolute;
18
- left: 0;
19
- width: var(--helix-base-w);
20
- overflow: hidden;
21
- transform-origin: center center;
22
- }
23
- .${e}-item-cover {
24
- height: var(--helix-base-h);
25
- }
26
- .${e}-media {
27
- display: block;
28
- width: 100%;
29
- max-width: 100%;
30
- height: auto;
31
- vertical-align: top;
32
- user-select: none;
33
- pointer-events: none;
34
- }
35
- .${e}-cover {
36
- display: block;
37
- width: 100%;
38
- height: 100%;
39
- overflow: hidden;
40
- position: relative;
41
- }
42
- .${e}-cover .${e}-media {
43
- position: absolute;
44
- inset: 0;
45
- width: 100%;
46
- height: 100%;
47
- object-fit: cover;
48
- object-position: center;
49
- }
50
- `;
51
- }
52
- function me(e) {
53
- return Number(e.toFixed(4));
54
- }
55
- function le(e, t, o, r) {
56
- const a = (typeof e == "string" ? Number(e) : e) ?? t;
57
- return Number.isFinite(a) ? Math.min(r, Math.max(o, Math.round(a))) : t;
58
- }
59
- function j(e, t, o = 0, r = 9999) {
60
- const a = (typeof e == "string" ? Number(e) : e) ?? t;
61
- return Number.isFinite(a) ? Math.min(r, Math.max(o, a)) : t;
62
- }
63
- function Be(e) {
64
- return typeof e == "string" ? {
65
- display: e.toLowerCase() === "cover" ? "cover" : "fit",
66
- ratioValue: "2:3",
67
- reversed: !1
68
- } : {
69
- display: (typeof (e == null ? void 0 : e.display) == "string" ? e.display.toLowerCase() : "") === "cover" ? "cover" : "fit",
70
- ratioValue: (e == null ? void 0 : e.ratioValue) ?? "2:3",
71
- reversed: (e == null ? void 0 : e.reversed) ?? !1
72
- };
73
- }
74
- function Ge(e) {
75
- const [t, o] = e.ratioValue.split(":").map(Number), r = e.reversed ? o : t;
76
- return (e.reversed ? t : o) / r;
77
- }
78
- function Ve(e) {
79
- return e.type === "video" ? !0 : e.type === "image" ? !1 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name ?? "") || /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId ?? "");
80
- }
81
- function he(e, t) {
82
- return (1 - e) / (1 - e * Math.cos(t));
83
- }
84
- function je(e) {
85
- let t = 0;
86
- for (let o = 0; o < 360; o += 1) {
87
- const r = o * Math.PI / 180;
88
- t = Math.max(t, Math.abs(Math.sin(r) * he(e, r)));
89
- }
90
- return t || 1;
91
- }
92
- function ke(e, t) {
93
- return e ? 1 : 1 + fe * (0.35 + t);
94
- }
95
- function Xe(e, t, o, r) {
96
- const n = t * ke(o, r);
97
- return Math.max(0, (e - n) / 2);
98
- }
99
- function Je(e, t, o) {
100
- const r = he(e, o);
101
- return {
102
- offset: Math.sin(o) * r / t,
103
- scale: r
104
- };
105
- }
106
- function Ye(e, t, o) {
107
- return e / 2 + t * o;
108
- }
109
- function Ze(e, t, o) {
110
- return `translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${me(o)})`;
111
- }
112
- function qe(e) {
113
- return Math.round(e * 1e3);
114
- }
115
- function pe(e, t, o) {
116
- const r = Math.cos(e), n = Math.cos(ze * Math.PI / 2);
117
- if (r >= n)
118
- return o;
119
- const a = (r + 1) / (n + 1);
120
- return me(t + (o - t) * a);
121
- }
122
- function Ke(e) {
123
- return pe(e, He, Pe);
124
- }
125
- function Qe(e) {
126
- return pe(e, Ue, ge);
127
- }
128
- function et(e, t) {
129
- if (!t) return "none";
130
- const o = Qe(e);
131
- return o <= 0 ? "none" : `blur(${o}px)`;
132
- }
133
- function se(e, t) {
134
- const o = t * Math.PI * 2, { offset: r, scale: n } = Je(e.depthFactor, e.spreadFactor, o), a = Ye(e.width, e.orbitRadius, r);
135
- return {
136
- transform: Ze(e.scaled, a, n),
137
- zIndex: qe(n),
138
- opacity: Ke(o),
139
- filter: et(o, e.blurEnabled)
140
- };
141
- }
142
- function be(e, t) {
143
- return (e % t + t) % t;
144
- }
145
- function tt(e, t) {
146
- return k(e, t) / t;
147
- }
148
- function k(e, t) {
149
- return be(e, t);
150
- }
151
- function ot(e, t) {
152
- return Math.floor(e / t);
153
- }
154
- function rt(e, t, o, r) {
155
- return ot(e, t) * o + k(e, t) * r;
156
- }
157
- function ue(e) {
158
- const t = Math.sin(e * 12.9898) * 43758.5453;
159
- return t - Math.floor(t);
160
- }
161
- function H(e) {
162
- const t = e % 1;
163
- return t < 0 ? t + 1 : t;
164
- }
165
- function nt(e, t, o) {
166
- const r = t / de, n = o === "left" ? -e * r : e * r;
167
- return H(n);
168
- }
169
- function dt({
170
- settings: e,
171
- content: t,
172
- isEditor: o,
173
- isPreviewMode: r
174
- }) {
175
- const { prefix: n } = xe(), a = V(null), M = j(
176
- (e == null ? void 0 : e.width) ?? (e == null ? void 0 : e.spread) ?? (e == null ? void 0 : e.wrapperWidth),
177
- Fe
178
- ), _ = j(e == null ? void 0 : e.imageWidth, Ae), P = j(e == null ? void 0 : e.turnHeight, we), f = le(e == null ? void 0 : e.itemsPerTurn, Ne, 3, 40), U = le(e == null ? void 0 : e.turns, De, 1, 30), S = Math.min(Le, Math.max(0, $e)), E = Math.min(1, Math.max(0, Ce)), F = Math.max(0, (e == null ? void 0 : e.speed) ?? de), g = (e == null ? void 0 : e.direction) === "left" ? "left" : "right", X = (e == null ? void 0 : e.playback) === "scroll" ? "scroll" : "autoplay", J = (e == null ? void 0 : e.cornerRadius) ?? 0, Y = (e == null ? void 0 : e.blur) !== "off", Z = y(() => Be(e == null ? void 0 : e.imageDisplay), [e == null ? void 0 : e.imageDisplay]), p = Z.display === "cover", b = (i) => ae(i, o ?? !1), q = y(() => je(S), [S]), K = y(
179
- () => Xe(M, _, p, E),
180
- [M, _, p, E]
181
- ), Q = y(() => We(n), [n]), z = y(
182
- () => ({
183
- scaled: (i) => ae(i, o ?? !1),
184
- width: M,
185
- orbitRadius: K,
186
- depthFactor: S,
187
- spreadFactor: q,
188
- blurEnabled: Y
189
- }),
190
- [o, M, K, S, q, Y]
191
- ), ee = V([]), x = V(0), A = y(
192
- () => (t ?? []).filter((i) => {
193
- var s;
194
- return !!((s = i.image) != null && s.assetId);
195
- }),
196
- [t]
197
- ), W = P / f, ve = _ * Ge(Z), ye = Math.min(_e, U * f), w = Se * f, te = ye + w * 2, Me = Math.max(0, U - 1) * P + (f - 1) * W, oe = F > 0, N = X === "scroll" && oe, D = X === "autoplay" && oe && (o ? !!r : !0), re = D ? 360 / (F * Te) : 0, ne = A.length === 0 ? 0 : te, B = y(
198
- () => Array.from({ length: ne }, (i, s) => tt(s - w, f)),
199
- [ne, w, f]
200
- );
201
- Ee(() => {
202
- if (!D && !N) return;
203
- const i = a.current;
204
- if (!i) return;
205
- const s = (c) => {
206
- x.current = c, B.forEach((l, O) => {
207
- const d = ee.current[O];
208
- if (!d) return;
209
- const u = se(z, H(l + c));
210
- d.style.transform = u.transform, d.style.zIndex = String(u.zIndex), d.style.opacity = String(u.opacity), d.style.filter = u.filter;
211
- });
212
- };
213
- if (N) {
214
- const c = i.ownerDocument.defaultView ?? window, l = () => {
215
- const d = i.getBoundingClientRect(), u = c.innerHeight || i.ownerDocument.documentElement.clientHeight, T = u + d.height;
216
- if (T <= 0) return;
217
- const L = Math.min(1, Math.max(0, (u - d.top) / T));
218
- s(nt(L, F, g));
219
- };
220
- l(), c.addEventListener("scroll", l, { passive: !0, capture: !0 }), c.addEventListener("resize", l);
221
- const O = new ResizeObserver(l);
222
- return O.observe(i), () => {
223
- c.removeEventListener("scroll", l, { capture: !0 }), c.removeEventListener("resize", l), O.disconnect();
224
- };
225
- }
226
- const I = g === "left" ? -1 : 1;
227
- let v = null, m = null;
228
- const R = (c) => {
229
- if (m !== null) {
230
- const l = (c - m) / 1e3 / re * I;
231
- x.current = H(x.current + l);
232
- }
233
- m = c, s(x.current), v = requestAnimationFrame(R);
234
- }, G = () => {
235
- v === null && (m = null, v = requestAnimationFrame(R));
236
- }, $ = () => {
237
- v !== null && cancelAnimationFrame(v), v = null;
238
- }, C = new IntersectionObserver(([c]) => {
239
- c != null && c.isIntersecting ? G() : $();
240
- });
241
- return C.observe(i), () => {
242
- $(), C.disconnect();
243
- };
244
- }, [D, N, B, z, re, F, g]);
245
- const Ie = D || N ? x.current : 0;
246
- return A.length === 0 ? /* @__PURE__ */ ce(ie, { children: [
247
- /* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: Q } }),
248
- /* @__PURE__ */ h("div", { className: `${n}-wrapper`, style: { width: b(M) } })
249
- ] }) : /* @__PURE__ */ ce(ie, { children: [
250
- /* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: Q } }),
251
- /* @__PURE__ */ h(
252
- "div",
253
- {
254
- ref: a,
255
- className: `${n}-wrapper`,
256
- style: {
257
- width: b(M),
258
- height: b(Me)
259
- },
260
- children: Array.from({ length: te }, (i, s) => {
261
- const I = s - w, m = A[be(I, A.length)].image, R = k(I, f), G = B[s], $ = rt(I, f, P, W), C = E === 0 ? 0 : (ue(R + 7.3) - 0.5) * E * W, c = p ? 1 : 1 + (ue(R + 3.1) - 0.5) * 2 * fe * (0.35 + E), l = _ * c, O = {
262
- "--helix-base-w": b(l),
263
- ...p ? { "--helix-base-h": b(ve) } : {}
264
- }, d = {
265
- top: b($ + C),
266
- ...O,
267
- ...se(z, H(G + Ie))
268
- }, u = J > 0 ? { borderRadius: b(J) } : {}, T = p ? {
269
- ...u,
270
- width: "100%",
271
- height: "100%",
272
- objectFit: "cover",
273
- objectPosition: "center"
274
- } : u, L = Ve(m) ? /* @__PURE__ */ h(
275
- Re,
276
- {
277
- className: `${n}-media`,
278
- style: T,
279
- src: m.assetId,
280
- muted: !0,
281
- loop: !0,
282
- autoPlay: !0,
283
- playsInline: !0
284
- }
285
- ) : /* @__PURE__ */ h(
286
- "img",
287
- {
288
- className: `${n}-media`,
289
- style: T,
290
- src: m.assetId,
291
- alt: m.name ?? "",
292
- loading: "lazy",
293
- decoding: "async"
294
- }
295
- );
296
- return /* @__PURE__ */ h(
297
- "div",
298
- {
299
- ref: (Oe) => {
300
- ee.current[s] = Oe;
301
- },
302
- className: p ? `${n}-item ${n}-item-cover` : `${n}-item`,
303
- style: d,
304
- children: p ? /* @__PURE__ */ h("div", { className: `${n}-cover`, style: u, children: L }) : L
305
- },
306
- `${U}-${f}-${I}`
307
- );
308
- })
309
- }
310
- )
311
- ] });
312
- }
313
- export {
314
- dt as Helix
315
- };
@@ -1,43 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),f=require("react"),ne=require("./scalingValue-CSHYgTZl.js"),Me=require("./useScopedStyles-Bf6yohVQ.js"),xe=require("./LazyVideo-imbU18js.js"),Ie=10,Oe=400,Re=1,Ee=1120/1440,Se=140/1440,Te=550/1440,_e=13,Fe=4,Ae=38/100,we=28/100,se=2.8,Ne=.9,le=.22,De=.5,$e=1,Ce=1.5,He=0,Le=.85;function Pe(e){return`
2
- .${e}-wrapper {
3
- position: relative;
4
- box-sizing: border-box;
5
- overflow: hidden;
6
- isolation: isolate;
7
- contain: layout paint;
8
- }
9
- .${e}-item {
10
- position: absolute;
11
- left: 0;
12
- width: var(--helix-base-w);
13
- overflow: hidden;
14
- transform-origin: center center;
15
- }
16
- .${e}-item-cover {
17
- height: var(--helix-base-h);
18
- }
19
- .${e}-media {
20
- display: block;
21
- width: 100%;
22
- max-width: 100%;
23
- height: auto;
24
- vertical-align: top;
25
- user-select: none;
26
- pointer-events: none;
27
- }
28
- .${e}-cover {
29
- display: block;
30
- width: 100%;
31
- height: 100%;
32
- overflow: hidden;
33
- position: relative;
34
- }
35
- .${e}-cover .${e}-media {
36
- position: absolute;
37
- inset: 0;
38
- width: 100%;
39
- height: 100%;
40
- object-fit: cover;
41
- object-position: center;
42
- }
43
- `}function ue(e){return Number(e.toFixed(4))}function ce(e,t,o,r){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,Math.round(a))):t}function B(e,t,o=0,r=9999){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,a)):t}function ge(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Ue(e){const[t,o]=e.ratioValue.split(":").map(Number),r=e.reversed?o:t;return(e.reversed?t:o)/r}function je(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId??"")}function de(e,t){return(1-e)/(1-e*Math.cos(t))}function ze(e){let t=0;for(let o=0;o<360;o+=1){const r=o*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(r)*de(e,r)))}return t||1}function We(e,t){return e?1:1+le*(.35+t)}function Ve(e,t,o,r){const n=t*We(o,r);return Math.max(0,(e-n)/2)}function Be(e,t,o){const r=de(e,o);return{offset:Math.sin(o)*r/t,scale:r}}function Ge(e,t,o){return e/2+t*o}function qe(e,t,o){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${ue(o)})`}function ke(e){return Math.round(e*1e3)}function fe(e,t,o){const r=Math.cos(e),n=Math.cos(Le*Math.PI/2);if(r>=n)return o;const a=(r+1)/(n+1);return ue(t+(o-t)*a)}function Xe(e){return fe(e,De,$e)}function Je(e){return fe(e,Ce,He)}function Ye(e,t){if(!t)return"none";const o=Je(e);return o<=0?"none":`blur(${o}px)`}function ie(e,t){const o=t*Math.PI*2,{offset:r,scale:n}=Be(e.depthFactor,e.spreadFactor,o),a=Ge(e.width,e.orbitRadius,r);return{transform:qe(e.scaled,a,n),zIndex:ke(n),opacity:Xe(o),filter:Ye(o,e.blurEnabled)}}function me(e,t){return(e%t+t)%t}function Ze(e,t){return G(e,t)/t}function G(e,t){return me(e,t)}function Ke(e,t){return Math.floor(e/t)}function Qe(e,t,o,r){return Ke(e,t)*o+G(e,t)*r}function ae(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function L(e){const t=e%1;return t<0?t+1:t}function et(e,t,o){const r=t/se,n=o==="left"?-e*r:e*r;return L(n)}function tt({settings:e,content:t,isEditor:o,isPreviewMode:r}){const{prefix:n}=Me.useScopedStyles(),a=f.useRef(null),M=B((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Ee),T=B(e==null?void 0:e.imageWidth,Se),P=B(e==null?void 0:e.turnHeight,Te),h=ce(e==null?void 0:e.itemsPerTurn,_e,3,40),g=ce(e==null?void 0:e.turns,Fe,1,30),_=Math.min(Ne,Math.max(0,Ae)),O=Math.min(1,Math.max(0,we)),F=Math.max(0,(e==null?void 0:e.speed)??se),U=(e==null?void 0:e.direction)==="left"?"left":"right",q=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",k=(e==null?void 0:e.cornerRadius)??0,X=(e==null?void 0:e.blur)!=="off",J=f.useMemo(()=>ge(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),b=J.display==="cover",v=i=>ne.scalingValue(i,o??!1),Y=f.useMemo(()=>ze(_),[_]),Z=f.useMemo(()=>Ve(M,T,b,O),[M,T,b,O]),K=f.useMemo(()=>Pe(n),[n]),j=f.useMemo(()=>({scaled:i=>ne.scalingValue(i,o??!1),width:M,orbitRadius:Z,depthFactor:_,spreadFactor:Y,blurEnabled:X}),[o,M,Z,_,Y,X]),Q=f.useRef([]),R=f.useRef(0),A=f.useMemo(()=>(t??[]).filter(i=>{var u;return!!((u=i.image)!=null&&u.assetId)}),[t]),z=P/h,he=T*Ue(J),pe=Math.min(Oe,g*h),w=Re*h,ee=pe+w*2,be=Math.max(0,g-1)*P+(h-1)*z,te=F>0,N=q==="scroll"&&te,D=q==="autoplay"&&te&&(o?!!r:!0),oe=D?360/(F*Ie):0,re=A.length===0?0:ee,W=f.useMemo(()=>Array.from({length:re},(i,u)=>Ze(u-w,h)),[re,w,h]);f.useEffect(()=>{if(!D&&!N)return;const i=a.current;if(!i)return;const u=c=>{R.current=c,W.forEach((s,I)=>{const m=Q.current[I];if(!m)return;const d=ie(j,L(s+c));m.style.transform=d.transform,m.style.zIndex=String(d.zIndex),m.style.opacity=String(d.opacity),m.style.filter=d.filter})};if(N){const c=i.ownerDocument.defaultView??window,s=()=>{const m=i.getBoundingClientRect(),d=c.innerHeight||i.ownerDocument.documentElement.clientHeight,S=d+m.height;if(S<=0)return;const H=Math.min(1,Math.max(0,(d-m.top)/S));u(et(H,F,U))};s(),c.addEventListener("scroll",s,{passive:!0,capture:!0}),c.addEventListener("resize",s);const I=new ResizeObserver(s);return I.observe(i),()=>{c.removeEventListener("scroll",s,{capture:!0}),c.removeEventListener("resize",s),I.disconnect()}}const x=U==="left"?-1:1;let y=null,p=null;const E=c=>{if(p!==null){const s=(c-p)/1e3/oe*x;R.current=L(R.current+s)}p=c,u(R.current),y=requestAnimationFrame(E)},V=()=>{y===null&&(p=null,y=requestAnimationFrame(E))},$=()=>{y!==null&&cancelAnimationFrame(y),y=null},C=new IntersectionObserver(([c])=>{c!=null&&c.isIntersecting?V():$()});return C.observe(i),()=>{$(),C.disconnect()}},[D,N,W,j,oe,F,U]);const ve=D||N?R.current:0;return A.length===0?l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:K}}),l.jsx("div",{className:`${n}-wrapper`,style:{width:v(M)}})]}):l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:K}}),l.jsx("div",{ref:a,className:`${n}-wrapper`,style:{width:v(M),height:v(be)},children:Array.from({length:ee},(i,u)=>{const x=u-w,p=A[me(x,A.length)].image,E=G(x,h),V=W[u],$=Qe(x,h,P,z),C=O===0?0:(ae(E+7.3)-.5)*O*z,c=b?1:1+(ae(E+3.1)-.5)*2*le*(.35+O),s=T*c,I={"--helix-base-w":v(s),...b?{"--helix-base-h":v(he)}:{}},m={top:v($+C),...I,...ie(j,L(V+ve))},d=k>0?{borderRadius:v(k)}:{},S=b?{...d,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:d,H=je(p)?l.jsx(xe.LazyVideo,{className:`${n}-media`,style:S,src:p.assetId,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):l.jsx("img",{className:`${n}-media`,style:S,src:p.assetId,alt:p.name??"",loading:"lazy",decoding:"async"});return l.jsx("div",{ref:ye=>{Q.current[u]=ye},className:b?`${n}-item ${n}-item-cover`:`${n}-item`,style:m,children:b?l.jsx("div",{className:`${n}-cover`,style:d,children:H}):H},`${g}-${h}-${x}`)})})]})}exports.Helix=tt;