@cntrl-site/components 1.0.120-alpha.1 → 1.0.120-alpha.2

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.
@@ -1,851 +0,0 @@
1
- import { jsxs as S, Fragment as Ge, jsx as s } from "react/jsx-runtime";
2
- import { useState as T, useRef as L, useCallback as D, useEffect as F } from "react";
3
- import w from "classnames";
4
- import { R as ho } from "./RichTextRenderer-D52Xto59.mjs";
5
- import { s as $ } from "./scalingValue-C9JH5L6O.mjs";
6
- import { S as Be } from "./SvgImage-B5mR9y6q.mjs";
7
- import { t as vo } from "./textStylesToCss-05Mn6I_2.mjs";
8
- import { u as $o } from "./useScopedStyles-DhBG3557.mjs";
9
- const yo = 500, wo = 1, xe = "cubic-bezier(0.25, 1, 0.5, 1)", xo = 300, bo = 40, Io = 5, So = 0.15, To = 0.4, ko = 100, X = 100, Ue = {
10
- color: "#000000",
11
- hover: "#cccccc"
12
- }, K = {
13
- offset: { x: 0, y: 0 },
14
- colors: {
15
- pagination: "#cccccc",
16
- inactive: "#cccccc",
17
- background: "#000000"
18
- }
19
- }, Co = {
20
- s: {
21
- paddingY: 5,
22
- paddingActive: 5,
23
- borderRadius: 9,
24
- dot: 4,
25
- activeDot: 8,
26
- gapInactive: 9,
27
- inset: 5
28
- },
29
- m: {
30
- paddingY: 7,
31
- paddingActive: 7,
32
- borderRadius: 17,
33
- dot: 8,
34
- activeDot: 20,
35
- gapInactive: 22,
36
- inset: 7
37
- },
38
- l: {
39
- paddingY: 10,
40
- paddingActive: 10,
41
- borderRadius: 29,
42
- dot: 20,
43
- activeDot: 38,
44
- gapInactive: 26,
45
- inset: 10
46
- }
47
- }, $e = {
48
- offset: { x: 0, y: 0 },
49
- linkColor: "#cccccc"
50
- }, Ve = {
51
- sizeType: "drag",
52
- value: 3
53
- }, Ao = "left";
54
- function go(e, n) {
55
- var x, v;
56
- const a = {
57
- fontSettings: {
58
- fontFamily: (e == null ? void 0 : e.titleFontFamily) ?? "Arial",
59
- fontWeight: ((x = e == null ? void 0 : e.titleFontSettings) == null ? void 0 : x.fontWeight) ?? 400,
60
- fontStyle: ((v = e == null ? void 0 : e.titleFontSettings) == null ? void 0 : v.fontStyle) ?? "normal"
61
- },
62
- fontSize: (e == null ? void 0 : e.titleFontSize) ?? 0.02,
63
- lineHeight: (e == null ? void 0 : e.titleLineHeight) ?? 0.02,
64
- letterSpacing: (e == null ? void 0 : e.titleLetterSpacing) ?? 0,
65
- wordSpacing: (e == null ? void 0 : e.titleWordSpacing) ?? 0,
66
- textAppearance: e == null ? void 0 : e.titleTextAppearance,
67
- textAlign: Ao,
68
- color: (e == null ? void 0 : e.titleColor) ?? "#000000"
69
- };
70
- return vo(a, n);
71
- }
72
- function H(e, n, a) {
73
- return `${e}: ${$(n / 1440, a)};`;
74
- }
75
- function le(e, n) {
76
- return n <= 0 ? 0 : (e % n + n) % n;
77
- }
78
- const Mo = 3;
79
- function ye(e, n, a) {
80
- return a ? `translate3d(calc(${-e * 100}% + ${n}px), 0, 0)` : `translate3d(0, calc(${-e * 100}% + ${n}px), 0)`;
81
- }
82
- function we(e, n) {
83
- return (Math.floor(e / n) - 1) * n;
84
- }
85
- function Ee(e, n) {
86
- const a = window.getComputedStyle(e);
87
- return parseFloat(n ? a.width : a.height) || 0;
88
- }
89
- function No(e, n) {
90
- const a = new DOMMatrixReadOnly(window.getComputedStyle(e).transform);
91
- return n ? a.m41 : a.m42;
92
- }
93
- function Ro(e, n) {
94
- const a = document.createElement("div");
95
- a.className = n, a.setAttribute("aria-hidden", "true"), e.appendChild(a);
96
- const x = (W, Z) => {
97
- a.style.transform = `translate(${W}px, ${Z}px)`;
98
- const G = a.getBoundingClientRect();
99
- return { x: G.left, y: G.top };
100
- }, v = x(0, 0), r = x(X, 0), j = x(0, X);
101
- e.removeChild(a);
102
- const I = {
103
- x: (r.x - v.x) / X,
104
- y: (r.y - v.y) / X
105
- }, i = {
106
- x: (j.x - v.x) / X,
107
- y: (j.y - v.y) / X
108
- }, q = I.x * i.y - i.x * I.y;
109
- return { ex: I, ey: i, det: q };
110
- }
111
- function Lo(e, n, a) {
112
- const { ex: x, ey: v, det: r } = e;
113
- return {
114
- x: (n * v.y - a * v.x) / r,
115
- y: (x.x * a - x.y * n) / r
116
- };
117
- }
118
- function Do(e) {
119
- const n = Math.min(Math.max(e, 0), 2);
120
- return Math.round(yo * Math.pow(4, 1 - n));
121
- }
122
- function zo(e, n, a) {
123
- return `
124
- .${e}-wrapper {
125
- position: relative;
126
- width: 100%;
127
- height: 100%;
128
- overflow: visible;
129
- }
130
- .${e}-wrapper:hover .${e}-hover-arrow {
131
- opacity: 1 !important;
132
- }
133
- .${e}-slider-inner {
134
- position: relative;
135
- width: 100%;
136
- height: 100%;
137
- }
138
- .${e}-track {
139
- position: absolute;
140
- top: 0;
141
- left: 0;
142
- width: 100%;
143
- height: 100%;
144
- overflow: hidden;
145
- }
146
- .${e}-axis-probe {
147
- position: absolute;
148
- top: 0;
149
- left: 0;
150
- width: 0;
151
- height: 0;
152
- pointer-events: none;
153
- visibility: hidden;
154
- }
155
- .${e}-track-draggable {
156
- touch-action: pan-y;
157
- }
158
- .${e}-track-draggable-vertical {
159
- touch-action: pan-x;
160
- }
161
- .${e}-track-draggable .${e}-list {
162
- user-select: none;
163
- -webkit-user-select: none;
164
- }
165
- .${e}-track-draggable .${e}-slider-image {
166
- -webkit-user-drag: none;
167
- }
168
- .${e}-list {
169
- position: relative;
170
- width: 100%;
171
- height: 100%;
172
- }
173
- .${e}-list-slide {
174
- display: flex;
175
- flex-direction: row;
176
- will-change: transform;
177
- }
178
- .${e}-list-slide-vertical {
179
- flex-direction: column;
180
- }
181
- .${e}-list-fade {
182
- display: block;
183
- /* Keeps the transition layers' z-index below the arrows, dots and click overlay. */
184
- isolation: isolate;
185
- }
186
- .${e}-slide {
187
- position: relative;
188
- flex: 0 0 100%;
189
- width: 100%;
190
- height: 100%;
191
- }
192
- .${e}-list-fade .${e}-slide {
193
- position: absolute;
194
- top: 0;
195
- left: 0;
196
- opacity: 0;
197
- }
198
- .${e}-list-fade .${e}-slide.${e}-is-layer {
199
- opacity: 1;
200
- }
201
- .${e}-slider-item {
202
- width: 100%;
203
- height: 100%;
204
- display: flex;
205
- position: relative;
206
- }
207
- .${e}-slider-image {
208
- width: 100%;
209
- height: 100%;
210
- object-fit: cover;
211
- }
212
- .${e}-arrow {
213
- position: absolute;
214
- display: flex;
215
- align-items: center;
216
- justify-content: center;
217
- border: none;
218
- background-color: transparent;
219
- top: 50%;
220
- z-index: 3;
221
- padding: 0;
222
- ${H("width", 30, a)}
223
- ${H("height", 30, a)}
224
- transition: opacity 0.15s ease-in-out;
225
- }
226
- .${e}-arrow-prev {
227
- ${H("left", -20, a)}
228
- transform: translate3d(-50%, -50%, 0);
229
- }
230
- .${e}-arrow-next {
231
- left: unset;
232
- ${H("right", -20, a)}
233
- transform: translate3d(50%, -50%, 0);
234
- }
235
- .${e}-arrow-prev-vertical {
236
- left: 50%;
237
- ${H("top", -20, a)}
238
- transform: translate3d(-50%, -50%, 0);
239
- }
240
- .${e}-arrow-next-vertical {
241
- left: 50%;
242
- right: unset;
243
- top: unset;
244
- ${H("bottom", -20, a)}
245
- transform: translate3d(-50%, 50%, 0);
246
- }
247
- .${e}-arrow-hidden {
248
- opacity: 0;
249
- pointer-events: none;
250
- }
251
- .${e}-hover-arrow {
252
- opacity: 0;
253
- transition: opacity 0.15s ease-in-out;
254
- }
255
- .${e}-hover-arrow:hover {
256
- opacity: 1;
257
- }
258
- .${e}-arrow-inner {
259
- all: unset;
260
- cursor: pointer;
261
- width: 100%;
262
- height: 100%;
263
- }
264
- .${e}-arrow-inner:hover .${e}-arrow-icon path {
265
- fill: var(--arrow-hover-color) !important;
266
- }
267
- .${e}-arrow-img {
268
- position: absolute;
269
- top: 50%;
270
- left: 50%;
271
- transform: translate(-50%, -50%);
272
- }
273
- .${e}-arrow-icon {
274
- width: 100%;
275
- height: 100%;
276
- overflow: visible;
277
- }
278
- .${e}-arrow-icon path {
279
- transition: fill 0.15s ease-in-out;
280
- }
281
- .${e}-mirror {
282
- transform: translate(-50%, -50%) scaleX(-1) !important;
283
- }
284
- .${e}-pagination {
285
- position: absolute;
286
- z-index: 3;
287
- border-radius: 50%;
288
- }
289
- .${e}-pagination-inner {
290
- display: flex;
291
- align-items: center;
292
- box-sizing: border-box;
293
- }
294
- .${e}-pagination-vertical {
295
- flex-direction: column;
296
- }
297
- .${e}-pagination-item {
298
- all: unset;
299
- flex-shrink: 0;
300
- position: relative;
301
- display: flex;
302
- align-items: center;
303
- justify-content: center;
304
- cursor: pointer;
305
- aspect-ratio: 1;
306
- height: auto;
307
- }
308
- .${e}-dot {
309
- border-radius: 50%;
310
- aspect-ratio: 1;
311
- height: auto;
312
- transition: background-color 0.3s ease-in-out;
313
- }
314
- .${e}-animate-dots .${e}-dot {
315
- transition: background-color 0.3s ease-in-out, width 0.3s ease-in-out;
316
- }
317
- .${e}-pagination-inside-bottom {
318
- left: 50%;
319
- transform: translate3d(-50%, 0, 0);
320
- }
321
- .${e}-pagination-inside-left {
322
- top: 50%;
323
- transform: translate3d(0, -50%, 0);
324
- }
325
- .${e}-img-wrapper {
326
- width: 100%;
327
- height: 100%;
328
- }
329
- .${e}-control {
330
- position: relative;
331
- z-index: 2;
332
- width: 100%;
333
- }
334
- .${e}-caption-block {
335
- pointer-events: none;
336
- position: absolute;
337
- top: 100%;
338
- left: 0;
339
- right: 0;
340
- z-index: 1;
341
- }
342
- .${e}-caption-text-wrapper {
343
- position: relative;
344
- width: 100%;
345
- }
346
- .${e}-caption-text {
347
- pointer-events: none;
348
- max-width: 100%;
349
- transition-property: opacity;
350
- transition-timing-function: ease-in-out;
351
- position: absolute;
352
- top: 0;
353
- left: 0;
354
- display: inline-block;
355
- white-space: pre-wrap;
356
- overflow-wrap: break-word;
357
- opacity: 0;
358
- }
359
- .${e}-caption-text.${e}-active {
360
- opacity: 1;
361
- }
362
- .${e}-with-pointer-events {
363
- pointer-events: auto;
364
- }
365
- .${e}-click-overlay {
366
- position: absolute;
367
- top: 0;
368
- left: 0;
369
- width: 100%;
370
- height: 100%;
371
- cursor: pointer;
372
- z-index: 2;
373
- }
374
- .${e}-transition-fade .${e}-slide.${e}-is-layer .${e}-slider-image {
375
- animation: ${e}-fade-in ${n}ms ${xe};
376
- }
377
- .${e}-transition-reveal .${e}-slide.${e}-is-layer .${e}-slider-image {
378
- animation: ${e}-reveal-horizontal ${n}ms ease;
379
- }
380
- .${e}-transition-reveal-vertical .${e}-slide.${e}-is-layer .${e}-slider-image {
381
- animation: ${e}-reveal-vertical ${n}ms ease;
382
- }
383
- @keyframes ${e}-fade-in {
384
- from { opacity: 0; }
385
- to { opacity: 1; }
386
- }
387
- @keyframes ${e}-reveal-horizontal {
388
- from { clip-path: inset(0 100% 0 0); }
389
- to { clip-path: inset(0 0 0 0); }
390
- }
391
- @keyframes ${e}-reveal-vertical {
392
- from { clip-path: inset(100% 0 0 0); }
393
- to { clip-path: inset(0 0 0 0); }
394
- }
395
- `;
396
- }
397
- function Bo({ settings: e, content: n, isEditor: a, isPreviewMode: x, isEditMode: v }) {
398
- const { prefix: r } = $o(), j = go(e, a), I = n ?? [], i = I.length, q = (e == null ? void 0 : e.trigger) ?? Ve, W = q.sizeType ?? "drag", Z = q.value ?? Ve.value, G = (e == null ? void 0 : e.direction) ?? "horizontal", ce = (e == null ? void 0 : e.transition) ?? "slide", je = typeof (e == null ? void 0 : e.transitionSpeed) == "number" ? e.transitionSpeed : wo, A = Do(je), qe = (e == null ? void 0 : e.nav) ?? "classic", be = (e == null ? void 0 : e.navSize) ?? "m", d = Co[be], Ze = typeof (e == null ? void 0 : e.navUnit) == "number" ? e.navUnit : 1 / 1440, m = (o) => $(o * Ze, a), Ie = (e == null ? void 0 : e.show) ?? "always", z = (e == null ? void 0 : e.controls) ?? null, Se = typeof (e == null ? void 0 : e.controlsMaxWidth) == "number" ? e.controlsMaxWidth : 65 / 1440, Te = typeof (e == null ? void 0 : e.paddingX) == "number" ? e.paddingX : 0, ke = typeof (e == null ? void 0 : e.paddingY) == "number" ? e.paddingY : 0, _ = (e == null ? void 0 : e.controlsColor) ?? Ue.color, J = (e == null ? void 0 : e.controlsHoverColor) ?? Ue.hover, Je = (e == null ? void 0 : e.navColor) ?? K.colors.inactive, Qe = (e == null ? void 0 : e.navPaginationColor) ?? K.colors.pagination, Pe = (e == null ? void 0 : e.navBackgroundColor) ?? K.colors.background, Ce = (e == null ? void 0 : e.linkColor) ?? $e.linkColor, eo = typeof (e == null ? void 0 : e.captionMarginTop) == "number" ? e.captionMarginTop : 0, Ae = typeof (e == null ? void 0 : e.imageCorners) == "number" ? e.imageCorners : 0, oo = Ae > 0 ? { borderRadius: $(Ae, a), isolation: "isolate" } : void 0, l = G === "horizontal", to = W === "click", se = W === "drag", ge = W === "auto" && (!a || !!x), Me = !a, h = ce === "slide", Ne = ce === "reveal", Re = !h, ro = qe === "classic", ao = Ie !== "never" && Se > 0, Le = Ie === "on hover", de = $(Se, a), Q = {
399
- width: de,
400
- height: de,
401
- maxWidth: de
402
- }, k = h && i > 1, [y, P] = T(0), [g, De] = T([{ index: y, key: 0 }]), ze = g[g.length - 1];
403
- if (Re && ze.index !== y) {
404
- const o = g.length >= bo ? [g[0], ...g.slice(2)] : g;
405
- De([...o, { index: y, key: ze.key + 1 }]);
406
- }
407
- const no = (o) => {
408
- De((t) => {
409
- const c = t.findIndex((p) => p.key === o);
410
- return c > 0 ? t.slice(c) : t;
411
- });
412
- }, _e = (o) => o && /* @__PURE__ */ s("div", { className: `${r}-slider-item`, children: /* @__PURE__ */ s("div", { className: `${r}-img-wrapper`, children: /* @__PURE__ */ s(
413
- "img",
414
- {
415
- className: `${r}-slider-image`,
416
- src: o.image.assetId,
417
- alt: o.image.name ?? "",
418
- draggable: !1
419
- }
420
- ) }) }), [O, ee] = T(k ? i : 0), [Oe, io] = T(!1), [pe, B] = T(!1), [lo, ue] = T(!1), [co, M] = T(0), [fe, me] = T(!1), [Ye, Fe] = T(!1), he = L(!1), U = L(O);
421
- U.current = O;
422
- const oe = L(null), te = L(null), Y = L(null), N = L(null), R = D((o) => {
423
- he.current = o, io(o);
424
- }, []), ve = D(() => {
425
- const o = te.current, t = o ? Ee(o, l) : 0;
426
- return !o || t <= 0 ? U.current : Math.round(-No(o, l) / t * 1e3) / 1e3;
427
- }, [l]), re = D((o) => {
428
- const t = ve(), c = we(t, i), p = o(t - c, c), u = te.current;
429
- if (c !== 0 && u) {
430
- const f = u.style.transition;
431
- u.style.transition = "none", u.style.transform = ye(t - c, 0, l), u.offsetWidth, u.style.transition = f && f !== "none" ? f : `transform ${A}ms ${xe}`, u.style.transform = ye(p, 0, l);
432
- }
433
- U.current = p, P(le(p, i)), B(!1), ee(p);
434
- }, [i, l, ve, A]), ae = D((o) => {
435
- if (!(i < 2 || o === 0)) {
436
- if (me(!0), R(!0), !h) {
437
- P((t) => le(t + o, i));
438
- return;
439
- }
440
- re((t, c) => {
441
- const p = U.current - c, u = Math.abs(p - t) < i ? p : Math.round(t), f = i - 1;
442
- return Math.min(Math.max(u + o, Math.ceil(t - f)), Math.floor(t + f));
443
- });
444
- }
445
- }, [i, h, re, R]), V = D((o) => {
446
- ae(o);
447
- }, [ae]), so = D((o) => {
448
- if (i < 2) return;
449
- const t = le(o, i);
450
- if (!(t === y && !he.current)) {
451
- if (me(!0), R(!0), !h) {
452
- P(t);
453
- return;
454
- }
455
- re(() => i + t);
456
- }
457
- }, [y, i, h, re, R]);
458
- F(() => {
459
- if (!Oe) return;
460
- const o = window.setTimeout(() => {
461
- if (R(!1), !k) return;
462
- const t = we(O, i);
463
- t !== 0 && (B(!0), ee(O - t));
464
- }, A);
465
- return () => window.clearTimeout(o);
466
- }, [i, k, Oe, R, O, A]), F(() => {
467
- if (!pe) return;
468
- let o = 0;
469
- const t = requestAnimationFrame(() => {
470
- o = requestAnimationFrame(() => B(!1));
471
- });
472
- return () => {
473
- cancelAnimationFrame(t), cancelAnimationFrame(o);
474
- };
475
- }, [pe]);
476
- const ne = `${k}:${i}`, Xe = L(ne);
477
- F(() => {
478
- if (Xe.current === ne) return;
479
- Xe.current = ne;
480
- const o = i > 0 ? Math.min(y, i - 1) : 0;
481
- Y.current = null, N.current = null, ue(!1), M(0), P(o), B(!0), ee(o + (k ? i : 0));
482
- }, [y, i, k, ne]), F(() => {
483
- if (!fe) return;
484
- const o = window.setTimeout(() => me(!1), xo);
485
- return () => window.clearTimeout(o);
486
- }, [fe, y]), F(() => {
487
- if (!ge || i < 2) return;
488
- const o = Math.max(Z, 0.1) * 1e3, t = window.setInterval(() => {
489
- Me && Ye || V(1);
490
- }, o);
491
- return () => window.clearInterval(t);
492
- }, [Z, i, V, ge, Ye, Me]);
493
- const E = D((o) => {
494
- const t = Y.current;
495
- if (!t || t.pointerId !== o.pointerId) return;
496
- Y.current = null, N.current = null;
497
- const c = oe.current;
498
- if (c != null && c.hasPointerCapture(o.pointerId) && c.releasePointerCapture(o.pointerId), !t.isActive) {
499
- h && M(0);
500
- return;
501
- }
502
- const u = !(o.timeStamp - t.lastTime > ko) && Math.abs(t.velocity) > To, f = t.size > 0 && Math.abs(t.offset - t.baseOffset) > t.size * So;
503
- if (ue(!1), !u && !f) {
504
- M(0);
505
- return;
506
- }
507
- const C = f ? t.offset - t.baseOffset : t.velocity;
508
- let b = 1;
509
- f && t.size > 0 && (b = Math.max(1, Math.round(Math.abs(C) / t.size))), M(0), ae(C < 0 ? b : -b);
510
- }, [ae, h]);
511
- F(() => {
512
- const o = (t) => {
513
- N.current === null || t.pointerId !== N.current || E(t);
514
- };
515
- return window.addEventListener("pointerup", o), window.addEventListener("pointercancel", o), () => {
516
- window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", o);
517
- };
518
- }, [E]);
519
- const po = (o) => {
520
- const t = oe.current;
521
- if (!se || i < 2 || !t || o.pointerType === "mouse" && o.button !== 0) return;
522
- he.current && R(!1);
523
- let c = 0;
524
- const p = te.current;
525
- if (h && p) {
526
- const u = Ee(p, l);
527
- if (u > 0) {
528
- const f = ve(), C = k ? f - we(f, i) : f, b = Math.round(C);
529
- c = (b - C) * u, U.current = b, B(!0), ee(b), M(c);
530
- }
531
- }
532
- t.setPointerCapture(o.pointerId), N.current = o.pointerId, Y.current = {
533
- pointerId: o.pointerId,
534
- startClientX: o.clientX,
535
- startClientY: o.clientY,
536
- axes: Ro(t, `${r}-axis-probe`),
537
- size: l ? t.offsetWidth : t.offsetHeight,
538
- isActive: !1,
539
- baseOffset: c,
540
- offset: c,
541
- lastTime: o.timeStamp,
542
- velocity: 0
543
- };
544
- }, uo = (o) => {
545
- const t = Y.current;
546
- if (!t || t.pointerId !== o.pointerId) return;
547
- if (o.pointerType === "mouse" && o.buttons === 0) {
548
- E(o);
549
- return;
550
- }
551
- const c = o.clientX - t.startClientX, p = o.clientY - t.startClientY, u = t.axes ? Lo(t.axes, c, p) : { x: c, y: p }, f = l ? u.x : u.y, C = l ? u.y : u.x, b = t.baseOffset + f;
552
- if (!t.isActive) {
553
- if (Math.max(Math.abs(f), Math.abs(C)) < Io) return;
554
- if (Math.abs(C) > Math.abs(f)) {
555
- const ie = oe.current;
556
- ie != null && ie.hasPointerCapture(t.pointerId) && ie.releasePointerCapture(t.pointerId), Y.current = null, N.current = null, h && M(0);
557
- return;
558
- }
559
- t.isActive = !0, ue(!0);
560
- }
561
- const We = o.timeStamp - t.lastTime;
562
- We > 0 && (t.velocity = (b - t.offset) / We, t.lastTime = o.timeStamp), t.offset = b, h && M(b);
563
- }, He = (o) => {
564
- E(o);
565
- }, fo = ye(O, co, l), mo = k ? Array.from({ length: Mo }, () => I).flat() : I;
566
- return /* @__PURE__ */ S(Ge, { children: [
567
- /* @__PURE__ */ s("style", { dangerouslySetInnerHTML: { __html: zo(r, A, a) } }),
568
- /* @__PURE__ */ S(
569
- "div",
570
- {
571
- className: w(`${r}-wrapper`, {
572
- [`${r}-transition-fade`]: ce === "fade in",
573
- [`${r}-transition-reveal`]: Ne,
574
- [`${r}-transition-reveal-vertical`]: Ne && !l
575
- }),
576
- "data-active-index": y,
577
- onMouseEnter: () => Fe(!0),
578
- onMouseLeave: () => Fe(!1),
579
- children: [
580
- /* @__PURE__ */ S(
581
- "div",
582
- {
583
- className: `${r}-slider-inner`,
584
- style: {
585
- backgroundColor: "transparent"
586
- },
587
- children: [
588
- /* @__PURE__ */ S(
589
- "div",
590
- {
591
- ref: oe,
592
- className: w(`${r}-track`, {
593
- [`${r}-track-draggable`]: se,
594
- [`${r}-track-draggable-vertical`]: se && !l
595
- }),
596
- style: oo,
597
- onPointerDown: po,
598
- onPointerMove: uo,
599
- onPointerUp: He,
600
- onPointerCancel: He,
601
- onLostPointerCapture: (o) => {
602
- N.current === o.pointerId && E(o);
603
- },
604
- children: [
605
- /* @__PURE__ */ S(
606
- "div",
607
- {
608
- ref: te,
609
- className: w(`${r}-list`, {
610
- [`${r}-list-slide`]: h,
611
- [`${r}-list-slide-vertical`]: h && !l,
612
- [`${r}-list-fade`]: !h
613
- }),
614
- style: h ? {
615
- transform: fo,
616
- transition: lo || pe ? "none" : `transform ${A}ms ${xe}`
617
- } : void 0,
618
- children: [
619
- mo.map((o, t) => {
620
- const c = le(t, i), p = `slide-${Math.floor(t / i)}-${c}`;
621
- return /* @__PURE__ */ s("div", { className: `${r}-slide`, children: _e(o) }, p);
622
- }),
623
- Re && g.map((o, t) => /* @__PURE__ */ s(
624
- "div",
625
- {
626
- className: w(`${r}-slide`, `${r}-is-layer`),
627
- style: { zIndex: t + 1 },
628
- onAnimationEnd: () => no(o.key),
629
- children: _e(I[o.index])
630
- },
631
- `layer-${o.key}`
632
- ))
633
- ]
634
- }
635
- ),
636
- to && /* @__PURE__ */ s(
637
- "div",
638
- {
639
- className: `${r}-click-overlay`,
640
- onClick: () => V(1)
641
- }
642
- )
643
- ]
644
- }
645
- ),
646
- ao && /* @__PURE__ */ S(Ge, { children: [
647
- /* @__PURE__ */ s(
648
- "div",
649
- {
650
- className: w(`${r}-arrow`, {
651
- [`${r}-arrow-prev`]: l,
652
- [`${r}-arrow-prev-vertical`]: !l,
653
- [`${r}-hover-arrow`]: Le
654
- }),
655
- style: {
656
- color: _,
657
- "--arrow-hover-color": J,
658
- ...Q
659
- },
660
- children: /* @__PURE__ */ S(
661
- "button",
662
- {
663
- onClick: (o) => {
664
- o.stopPropagation(), V(-1);
665
- },
666
- className: `${r}-arrow-inner`,
667
- style: {
668
- transform: `translate(${$(Te, a)}, ${$(ke * (l ? 1 : -1), a)}) rotate(${l ? "0deg" : "90deg"})`
669
- },
670
- children: [
671
- z && /* @__PURE__ */ s(
672
- Be,
673
- {
674
- url: z,
675
- fill: _,
676
- hoverFill: J,
677
- className: w(`${r}-arrow-img`, `${r}-mirror`),
678
- style: Q
679
- }
680
- ),
681
- !z && /* @__PURE__ */ s(
682
- Ke,
683
- {
684
- color: _,
685
- className: w(`${r}-arrow-icon`, `${r}-arrow-img`, `${r}-mirror`)
686
- }
687
- )
688
- ]
689
- }
690
- )
691
- }
692
- ),
693
- /* @__PURE__ */ s(
694
- "div",
695
- {
696
- className: w(`${r}-arrow`, {
697
- [`${r}-arrow-next`]: l,
698
- [`${r}-arrow-next-vertical`]: !l,
699
- [`${r}-hover-arrow`]: Le
700
- }),
701
- style: {
702
- color: _,
703
- "--arrow-hover-color": J,
704
- ...Q
705
- },
706
- children: /* @__PURE__ */ S(
707
- "button",
708
- {
709
- className: `${r}-arrow-inner`,
710
- onClick: (o) => {
711
- o.stopPropagation(), V(1);
712
- },
713
- style: {
714
- transform: `translate(${$(Te * (l ? -1 : 1), a)}, ${$(ke, a)}) rotate(${l ? "0deg" : "90deg"})`
715
- },
716
- children: [
717
- z && /* @__PURE__ */ s(
718
- Be,
719
- {
720
- url: z,
721
- fill: _,
722
- hoverFill: J,
723
- className: `${r}-arrow-img`,
724
- style: Q
725
- }
726
- ),
727
- !z && /* @__PURE__ */ s(Ke, { color: _, className: w(`${r}-arrow-icon`, `${r}-arrow-img`) })
728
- ]
729
- }
730
- )
731
- }
732
- )
733
- ] }),
734
- ro && /* @__PURE__ */ s(
735
- "div",
736
- {
737
- className: w(`${r}-pagination`, {
738
- [`${r}-pagination-inside-bottom`]: l,
739
- [`${r}-pagination-inside-left`]: !l
740
- }),
741
- style: l ? { bottom: m(d.inset) } : { left: m(d.inset) },
742
- children: /* @__PURE__ */ s(
743
- "div",
744
- {
745
- className: w(`${r}-pagination-inner`, {
746
- [`${r}-pagination-vertical`]: !l,
747
- [`${r}-animate-dots`]: fe
748
- }),
749
- style: {
750
- backgroundColor: Pe,
751
- gap: m(d.gapInactive - d.activeDot + d.dot),
752
- ...l ? {
753
- height: m(d.activeDot + d.paddingY * 2),
754
- paddingTop: m(d.paddingY),
755
- paddingBottom: m(d.paddingY),
756
- paddingLeft: m(d.paddingActive),
757
- paddingRight: m(d.paddingActive)
758
- } : {
759
- width: m(d.activeDot + d.paddingY * 2),
760
- paddingLeft: m(d.paddingY),
761
- paddingRight: m(d.paddingY),
762
- paddingTop: m(d.paddingActive),
763
- paddingBottom: m(d.paddingActive)
764
- },
765
- borderRadius: m(d.borderRadius),
766
- transform: `translate(${$(K.offset.x, a)}, ${$(K.offset.y, a)})`
767
- },
768
- children: I.map((o, t) => {
769
- const c = t === y, p = c ? d.activeDot : d.dot;
770
- return /* @__PURE__ */ s(
771
- "button",
772
- {
773
- onClick: () => so(t),
774
- className: `${r}-pagination-item`,
775
- style: {
776
- width: m(d.activeDot)
777
- },
778
- children: /* @__PURE__ */ s(
779
- "div",
780
- {
781
- className: `${r}-dot`,
782
- style: {
783
- backgroundColor: c ? Qe : Je,
784
- width: m(p)
785
- }
786
- }
787
- )
788
- },
789
- t
790
- );
791
- })
792
- },
793
- `${be}-${G}`
794
- )
795
- }
796
- )
797
- ]
798
- }
799
- ),
800
- /* @__PURE__ */ S("div", { className: `${r}-caption-block`, children: [
801
- /* @__PURE__ */ s(
802
- "div",
803
- {
804
- "data-controls": v ? "captionMarginTop" : void 0,
805
- className: v ? `${r}-control` : void 0,
806
- style: {
807
- height: $(eo, a)
808
- }
809
- }
810
- ),
811
- /* @__PURE__ */ s("div", { className: `${r}-caption-text-wrapper`, children: I.map((o, t) => /* @__PURE__ */ s(
812
- "div",
813
- {
814
- className: w(`${r}-caption-text`, {
815
- [`${r}-with-pointer-events`]: t === y && a,
816
- [`${r}-active`]: t === y
817
- }),
818
- style: {
819
- ...j,
820
- width: "max-content",
821
- transitionDuration: `${Math.round(A / 2)}ms`
822
- },
823
- children: /* @__PURE__ */ s(
824
- "div",
825
- {
826
- className: `${r}-caption-text-inner`,
827
- style: {
828
- "--link-color": Ce,
829
- "--link-hover-color": Ce,
830
- position: "relative",
831
- top: $($e.offset.y, a),
832
- left: $($e.offset.x, a)
833
- },
834
- children: /* @__PURE__ */ s(ho, { content: o.imageCaption })
835
- }
836
- )
837
- },
838
- t
839
- )) })
840
- ] })
841
- ]
842
- }
843
- )
844
- ] });
845
- }
846
- function Ke({ color: e, className: n }) {
847
- return /* @__PURE__ */ s("svg", { viewBox: "0 0 10 18", className: n, children: /* @__PURE__ */ s("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ s("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: e, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
848
- }
849
- export {
850
- Bo as Slider20
851
- };