@cntrl-site/components 1.0.103 → 1.0.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
  2. package/dist/Components/utils/index.d.ts +1 -0
  3. package/dist/Components/utils/useLazyVideos.d.ts +15 -0
  4. package/dist/Grid-B2_o1dvz.mjs +1576 -0
  5. package/dist/Grid-Bq6bk2AQ.js +374 -0
  6. package/dist/{Helix-2Vr-9WBa.js → Helix-B7rxlvKq.js} +2 -2
  7. package/dist/{Helix-BmkAKT1G.mjs → Helix-BrKQzGX5.mjs} +53 -53
  8. package/dist/{Hive-BGMWinrW.mjs → Hive-BusARSOi.mjs} +114 -111
  9. package/dist/Hive-Dh5nKPGm.js +321 -0
  10. package/dist/LazyVideo-Cn_vmMq8.js +1 -0
  11. package/dist/LazyVideo-D8eVYFyw.mjs +15 -0
  12. package/dist/Marquee-CdtAqhQE.mjs +563 -0
  13. package/dist/Marquee-DUN8wUax.js +133 -0
  14. package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-BRqlbk4i.mjs} +55 -54
  15. package/dist/Mercury-C-O2VGkK.js +267 -0
  16. package/dist/{PretextComponent-CGycuNNn.js → PretextComponent-D5P0AjnL.js} +1 -1
  17. package/dist/{PretextComponent-DN8cyZ8x.mjs → PretextComponent-s4DDfmzY.mjs} +6 -6
  18. package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-DKuh4bnv.mjs} +299 -295
  19. package/dist/Waterfall-fdiHR0Rc.js +287 -0
  20. package/dist/{components-DTCDEBo0.js → components-DzNixU7Q.js} +1 -1
  21. package/dist/{components-BFJINCME.mjs → components-Yf9Zjska.mjs} +1 -1
  22. package/dist/elements.js +1 -1
  23. package/dist/elements.mjs +6 -6
  24. package/dist/elements.node.js +1 -1
  25. package/dist/elements.node.mjs +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index.mjs +2 -2
  28. package/dist/sources.js +125 -49
  29. package/dist/sources.mjs +129 -53
  30. package/dist/useLazyVideos-BbgdvELi.js +1 -0
  31. package/dist/useLazyVideos-CZLyNolX.mjs +72 -0
  32. package/dist/utils.js +1 -1
  33. package/dist/utils.mjs +14 -12
  34. package/package.json +5 -3
  35. package/dist/Grid-CemGhf3F.js +0 -374
  36. package/dist/Grid-cfQsXW3b.mjs +0 -1553
  37. package/dist/Hive-BC6zQBsv.js +0 -321
  38. package/dist/Marquee-BYClHHws.mjs +0 -551
  39. package/dist/Marquee-vmHaTGIP.js +0 -133
  40. package/dist/Mercury-BwF_XW2w.js +0 -267
  41. package/dist/Waterfall-DnPDHbCL.js +0 -287
@@ -1,1553 +0,0 @@
1
- import { jsxs as p, Fragment as B, jsx as i } from "react/jsx-runtime";
2
- import { S as Qe, a as Pe } from "./react-splide.esm-DQqds4PL.mjs";
3
- /* empty css */
4
- import { s as m } from "./scalingValue-C9JH5L6O.mjs";
5
- import { b as tn } from "./buildColorVars-CLyWQm5K.mjs";
6
- import { u as en } from "./useScopedStyles-DhBG3557.mjs";
7
- import { useMemo as Re, useState as N, useRef as $, useEffect as V, useCallback as ct, useLayoutEffect as He } from "react";
8
- import { createPortal as nn } from "react-dom";
9
- import { o as be, t as Se } from "./textStylesToCss-05Mn6I_2.mjs";
10
- import { S as rn } from "./SvgImage-B5mR9y6q.mjs";
11
- function on(t) {
12
- return `calc(var(--cntrl-article-width, 100vw) * ${t / 1440})`;
13
- }
14
- function je(t) {
15
- return ((t == null ? void 0 : t.trim().length) ?? 0) > 0;
16
- }
17
- function Ce(t, e, n, c) {
18
- return e !== void 0 && e < (t ?? 0.01) ? `${n} ${c}` : n;
19
- }
20
- function Ie(t, e, n, c) {
21
- const a = t ?? 0.01;
22
- return e === void 0 || e >= a ? {} : {
23
- [`--${n}-title-leading-gap`]: m((a - e) / 2, c)
24
- };
25
- }
26
- function ln(t) {
27
- return `
28
- .${t}-wrapper {
29
- display: grid;
30
- align-items: start;
31
- justify-content: center;
32
- min-height: ${on(48)};
33
- }
34
- .${t}-item {
35
- display: flex;
36
- flex-direction: column;
37
- justify-content: center;
38
- align-items: center;
39
- }
40
- .${t}-item-inner {
41
- display: flex;
42
- flex-direction: column;
43
- align-items: center;
44
- outline: 1px solid #FF5C02;
45
- }
46
- .${t}-item-inner-hidden {
47
- display: flex;
48
- flex-direction: column;
49
- align-items: center;
50
- }
51
- .${t}-item-image-wrapper {
52
- display: flex;
53
- justify-content: center;
54
- align-items: center;
55
- align-self: center;
56
- }
57
- .${t}-item-image-wrapper-fit-slider {
58
- display: grid;
59
- overflow: hidden;
60
- position: relative;
61
- }
62
- .${t}-item-image-wrapper-fit-slider > .${t}-item-image-wrapper-sizer {
63
- grid-area: 1 / 1;
64
- width: 100%;
65
- display: grid;
66
- visibility: hidden;
67
- pointer-events: none;
68
- }
69
- .${t}-item-image-wrapper-fit-slider > .${t}-item-image-wrapper-sizer img {
70
- grid-area: 1 / 1;
71
- width: auto;
72
- height: auto;
73
- max-width: 100%;
74
- object-fit: contain;
75
- }
76
- .${t}-item-image-wrapper-fit-slider > .${t}-item-image-wrapper-sizer video {
77
- grid-area: 1 / 1;
78
- width: auto;
79
- height: auto;
80
- max-width: 100%;
81
- object-fit: contain;
82
- }
83
- .${t}-item-image-wrapper-fit-slider > .${t}-item-slider {
84
- position: absolute;
85
- inset: 0;
86
- width: 100%;
87
- overflow: hidden;
88
- }
89
- .${t}-item-slider .splide__track {
90
- overflow: hidden;
91
- }
92
- .${t}-item-image-link {
93
- width: 100%;
94
- display: flex;
95
- flex-direction: column;
96
- align-items: center;
97
- }
98
- .${t}-item-text-link {
99
- display: flex;
100
- flex-direction: column;
101
- align-items: center;
102
- width: 100%;
103
- color: inherit;
104
- text-decoration: none;
105
- }
106
- .${t}-item-image {
107
- width: 100%;
108
- height: 100%;
109
- display: block;
110
- max-width: 100%;
111
- }
112
- .${t}-item-video {
113
- width: 100%;
114
- height: 100%;
115
- display: block;
116
- max-width: 100%;
117
- }
118
- .${t}-item-slider,
119
- .${t}-item-slider .splide__track,
120
- .${t}-item-slider .splide__list,
121
- .${t}-item-slider .splide__slide {
122
- width: 100%;
123
- height: 100%;
124
- }
125
- .${t}-item-slider .splide__slide {
126
- display: flex;
127
- justify-content: center;
128
- align-items: center;
129
- }
130
- .${t}-item-title {
131
- white-space: normal;
132
- overflow-wrap: anywhere;
133
- word-break: break-word;
134
- text-align: center;
135
- margin-bottom: 0px;
136
- margin-top: 0px;
137
- color: var(--${t}-title-color);
138
- }
139
- .${t}-item-subtitle {
140
- white-space: normal;
141
- overflow-wrap: anywhere;
142
- word-break: break-word;
143
- text-align: center;
144
- margin-bottom: 0px;
145
- margin-top: 0px;
146
- color: var(--${t}-subtitle-color);
147
- }
148
- .${t}-text-tight-leading {
149
- display: block;
150
- flex-shrink: 0;
151
- padding-top: var(--${t}-title-leading-gap, 0);
152
- padding-bottom: var(--${t}-title-leading-gap, 0);
153
- }
154
- .${t}-show-text-hover .${t}-item-title,
155
- .${t}-show-text-hover .${t}-item-subtitle {
156
- opacity: 0;
157
- transition: opacity 250ms;
158
- }
159
- .${t}-show-text-hover .${t}-item-inner:hover .${t}-item-title,
160
- .${t}-show-text-hover .${t}-item-inner:hover .${t}-item-subtitle,
161
- .${t}-show-text-hover .${t}-item-inner-hidden:hover .${t}-item-title,
162
- .${t}-show-text-hover .${t}-item-inner-hidden:hover .${t}-item-subtitle {
163
- opacity: 1;
164
- }
165
- .${t}-type-a .${t}-item-inner,
166
- .${t}-type-a .${t}-item-inner-hidden,
167
- .${t}-type-d .${t}-item-inner,
168
- .${t}-type-d .${t}-item-inner-hidden {
169
- align-items: flex-start;
170
- }
171
- .${t}-type-b .${t}-item-inner,
172
- .${t}-type-b .${t}-item-inner-hidden,
173
- .${t}-type-e .${t}-item-inner,
174
- .${t}-type-e .${t}-item-inner-hidden {
175
- align-items: center;
176
- }
177
- .${t}-type-c .${t}-item-inner,
178
- .${t}-type-c .${t}-item-inner-hidden,
179
- .${t}-type-f .${t}-item-inner,
180
- .${t}-type-f .${t}-item-inner-hidden {
181
- align-items: flex-end;
182
- }
183
- .${t}-type-a .${t}-item-image-link,
184
- .${t}-type-b .${t}-item-image-link,
185
- .${t}-type-c .${t}-item-image-link,
186
- .${t}-type-d .${t}-item-image-link,
187
- .${t}-type-e .${t}-item-image-link,
188
- .${t}-type-f .${t}-item-image-link {
189
- align-items: center;
190
- }
191
- .${t}-type-a .${t}-item-title,
192
- .${t}-type-a .${t}-item-subtitle,
193
- .${t}-type-d .${t}-item-title,
194
- .${t}-type-d .${t}-item-subtitle {
195
- text-align: left;
196
- }
197
- .${t}-type-b .${t}-item-title,
198
- .${t}-type-b .${t}-item-subtitle,
199
- .${t}-type-e .${t}-item-title,
200
- .${t}-type-e .${t}-item-subtitle {
201
- text-align: center;
202
- }
203
- .${t}-type-c .${t}-item-title,
204
- .${t}-type-c .${t}-item-subtitle,
205
- .${t}-type-f .${t}-item-title,
206
- .${t}-type-f .${t}-item-subtitle {
207
- text-align: right;
208
- }
209
- .${t}-item-text-block {
210
- display: flex;
211
- flex-direction: column;
212
- align-items: flex-start;
213
- width: 100%;
214
- flex-shrink: 0;
215
- }
216
- .${t}-type-d .${t}-item-text-block {
217
- align-items: flex-start;
218
- }
219
- .${t}-type-e .${t}-item-text-block {
220
- align-items: center;
221
- }
222
- .${t}-type-f .${t}-item-text-block {
223
- align-items: flex-end;
224
- }
225
- .${t}-type-a .${t}-item-text-link,
226
- .${t}-type-d .${t}-item-text-link {
227
- align-items: flex-start;
228
- }
229
- .${t}-type-b .${t}-item-text-link,
230
- .${t}-type-e .${t}-item-text-link {
231
- align-items: center;
232
- }
233
- .${t}-type-c .${t}-item-text-link,
234
- .${t}-type-f .${t}-item-text-link {
235
- align-items: flex-end;
236
- }
237
- .${t}-image-align-top .${t}-item-image-wrapper:not(.${t}-item-image-wrapper-fit-slider) {
238
- align-items: flex-start;
239
- }
240
- .${t}-image-align-center .${t}-item-image-wrapper:not(.${t}-item-image-wrapper-fit-slider) {
241
- align-items: center;
242
- }
243
- .${t}-image-align-bottom .${t}-item-image-wrapper:not(.${t}-item-image-wrapper-fit-slider) {
244
- align-items: flex-end;
245
- }
246
- .${t}-image-align-top .${t}-item-slider .splide__slide {
247
- align-items: flex-start;
248
- }
249
- .${t}-image-align-center .${t}-item-slider .splide__slide {
250
- align-items: center;
251
- }
252
- .${t}-image-align-bottom .${t}-item-slider .splide__slide {
253
- align-items: flex-end;
254
- }
255
- .${t}-align-entries .${t}-item {
256
- display: contents;
257
- }
258
- .${t}-align-entries .${t}-item-inner,
259
- .${t}-align-entries .${t}-item-inner-hidden {
260
- display: grid;
261
- grid-template-rows: subgrid;
262
- grid-row: span 3;
263
- justify-self: center;
264
- margin-bottom: var(--${t}-align-entries-row-gap, 0);
265
- }
266
- .${t}-align-entries .${t}-item-inner-last-row {
267
- margin-bottom: 0;
268
- }
269
- .${t}-align-entries .${t}-item-text-link {
270
- display: contents;
271
- }
272
- .${t}-align-entries .${t}-item-title-row,
273
- .${t}-align-entries .${t}-item-subtitle-row {
274
- display: flex;
275
- flex-direction: column;
276
- align-items: flex-start;
277
- width: 100%;
278
- min-height: 100%;
279
- }
280
- .${t}-type-a.${t}-align-entries .${t}-item-title-row,
281
- .${t}-type-a.${t}-align-entries .${t}-item-subtitle-row,
282
- .${t}-type-d.${t}-align-entries .${t}-item-title-row,
283
- .${t}-type-d.${t}-align-entries .${t}-item-subtitle-row {
284
- align-items: flex-start;
285
- }
286
- .${t}-type-b.${t}-align-entries .${t}-item-title-row,
287
- .${t}-type-b.${t}-align-entries .${t}-item-subtitle-row,
288
- .${t}-type-e.${t}-align-entries .${t}-item-title-row,
289
- .${t}-type-e.${t}-align-entries .${t}-item-subtitle-row {
290
- align-items: center;
291
- }
292
- .${t}-type-c.${t}-align-entries .${t}-item-title-row,
293
- .${t}-type-c.${t}-align-entries .${t}-item-subtitle-row,
294
- .${t}-type-f.${t}-align-entries .${t}-item-title-row,
295
- .${t}-type-f.${t}-align-entries .${t}-item-subtitle-row {
296
- align-items: flex-end;
297
- }
298
- .${t}-align-entries .${t}-item-image-link {
299
- width: 100%;
300
- height: 100%;
301
- min-height: 100%;
302
- display: flex;
303
- flex-direction: column;
304
- align-items: center;
305
- justify-content: flex-start;
306
- }
307
- .${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
308
- flex-shrink: 0;
309
- height: auto;
310
- align-self: auto;
311
- }
312
- .${t}-image-align-top.${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
313
- margin-top: 0;
314
- margin-bottom: auto;
315
- }
316
- .${t}-image-align-center.${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
317
- margin-top: auto;
318
- margin-bottom: auto;
319
- }
320
- .${t}-image-align-bottom.${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
321
- margin-top: auto;
322
- margin-bottom: 0;
323
- }
324
- .${t}-image-align-top.${t}-align-entries .${t}-item-image-wrapper:not(.${t}-item-image-wrapper-fit-slider) {
325
- align-items: flex-start;
326
- }
327
- .${t}-image-align-center.${t}-align-entries .${t}-item-image-wrapper:not(.${t}-item-image-wrapper-fit-slider) {
328
- align-items: center;
329
- }
330
- .${t}-image-align-bottom.${t}-align-entries .${t}-item-image-wrapper:not(.${t}-item-image-wrapper-fit-slider) {
331
- align-items: flex-end;
332
- }
333
- .${t}-image-align-top.${t}-align-entries .${t}-item-slider .splide__slide {
334
- align-items: flex-start;
335
- }
336
- .${t}-image-align-center.${t}-align-entries .${t}-item-slider .splide__slide {
337
- align-items: center;
338
- }
339
- .${t}-image-align-bottom.${t}-align-entries .${t}-item-slider .splide__slide {
340
- align-items: flex-end;
341
- }
342
- .${t}-image-align-top.${t}-align-entries .${t}-item-image-link {
343
- justify-content: flex-start;
344
- }
345
- .${t}-image-align-center.${t}-align-entries .${t}-item-image-link {
346
- justify-content: center;
347
- }
348
- .${t}-image-align-bottom.${t}-align-entries .${t}-item-image-link {
349
- justify-content: flex-end;
350
- }
351
- .${t}-lightbox-counter {
352
- margin: 0;
353
- color: var(--${t}-lightbox-counter-color);
354
- }
355
- .${t}-lightbox {
356
- position: fixed;
357
- inset: 0;
358
- z-index: 9997;
359
- overscroll-behavior: none;
360
- overflow: hidden;
361
- }
362
- .${t}-lightbox-editor {
363
- inset: auto;
364
- top: var(--cntrl-article-top, 0);
365
- left: var(--cntrl-article-left, 0);
366
- width: var(--cntrl-article-width, 100vw) !important;
367
- height: var(--cntrl-viewport-height, 100vh) !important;
368
- }
369
- .${t}-control {
370
- position: relative;
371
- z-index: 2;
372
- width: 100%;
373
- }
374
- .${t}-close-icon {
375
- position: relative;
376
- flex-shrink: 0;
377
- pointer-events: auto;
378
- z-index: 2;
379
- display: flex;
380
- align-items: center;
381
- justify-content: center;
382
- border: none;
383
- background-color: transparent;
384
- padding: 0;
385
- }
386
- .${t}-close-icon-inner {
387
- all: unset;
388
- position: relative;
389
- cursor: pointer;
390
- width: 100%;
391
- height: 100%;
392
- pointer-events: auto;
393
- }
394
- .${t}-close-icon-img {
395
- position: absolute;
396
- top: 50%;
397
- left: 50%;
398
- transform: translate(-50%, -50%);
399
- }
400
- `;
401
- }
402
- function sn() {
403
- return Math.random() < 0.5 ? "ltr" : "ttb";
404
- }
405
- function an(t) {
406
- const e = t.Components.Autoplay;
407
- e && (e.pause(!1), e.play());
408
- }
409
- function cn(t) {
410
- const e = sn();
411
- t.options.direction !== e && (t.options = { ...t.options, direction: e }), requestAnimationFrame(() => {
412
- requestAnimationFrame(() => {
413
- an(t);
414
- });
415
- });
416
- }
417
- const U = 500, dn = 750, mt = "cubic-bezier(0.22, 1, 0.36, 1)", un = 72, hn = 50;
418
- function gn(t) {
419
- if (!Array.isArray(t) || t.length === 0) return !1;
420
- const e = t[0];
421
- return e !== null && typeof e == "object" && "media" in e && Array.isArray(e.media);
422
- }
423
- function mn(t) {
424
- const [e, n] = t.media;
425
- return n != null && n.assetId ? n : e != null && e.assetId ? e : null;
426
- }
427
- function pn(t) {
428
- const [e] = t.media;
429
- return e != null && e.assetId ? e : null;
430
- }
431
- function Ve(t) {
432
- return !Array.isArray(t) || t.length === 0 ? [] : gn(t) ? t.flatMap((e) => {
433
- const n = mn(e);
434
- if (!n) return [];
435
- const c = pn(e);
436
- return [{
437
- displayMedia: n,
438
- lightboxMedia: c != null && c.assetId ? c : null
439
- }];
440
- }) : t.filter((e) => e == null ? void 0 : e.assetId).map((e) => ({
441
- displayMedia: e,
442
- lightboxMedia: e
443
- }));
444
- }
445
- function It(t) {
446
- return t.type === "video";
447
- }
448
- function fn(t) {
449
- const e = /* @__PURE__ */ new Set(), n = [];
450
- for (const c of t) {
451
- const a = Ve(c.gallery);
452
- for (const W of a) {
453
- const x = W.lightboxMedia;
454
- x != null && x.assetId && !e.has(x.assetId) && (e.add(x.assetId), n.push(x));
455
- }
456
- }
457
- return n;
458
- }
459
- function $n({ mediaList: t }) {
460
- return t.length === 0 ? null : /* @__PURE__ */ i(
461
- "div",
462
- {
463
- "aria-hidden": !0,
464
- style: {
465
- position: "absolute",
466
- width: 0,
467
- height: 0,
468
- overflow: "hidden",
469
- opacity: 0,
470
- pointerEvents: "none"
471
- },
472
- children: t.map((e) => It(e) ? /* @__PURE__ */ i(
473
- "video",
474
- {
475
- src: e.assetId,
476
- preload: "auto",
477
- muted: !0,
478
- playsInline: !0
479
- },
480
- e.assetId
481
- ) : /* @__PURE__ */ i(
482
- "img",
483
- {
484
- src: e.assetId,
485
- alt: ""
486
- },
487
- e.assetId
488
- ))
489
- }
490
- );
491
- }
492
- function yn(t) {
493
- t.pause(), t.removeAttribute("src"), t.load();
494
- }
495
- function De({
496
- media: t,
497
- className: e,
498
- style: n,
499
- onMediaClick: c
500
- }) {
501
- return It(t) ? /* @__PURE__ */ i(
502
- "video",
503
- {
504
- src: t.assetId,
505
- className: e,
506
- style: {
507
- ...n,
508
- cursor: c ? "pointer" : "default"
509
- },
510
- muted: !0,
511
- autoPlay: !0,
512
- loop: !0,
513
- playsInline: !0,
514
- onClick: c
515
- }
516
- ) : /* @__PURE__ */ i(
517
- "img",
518
- {
519
- src: t.assetId,
520
- alt: t.name,
521
- className: e,
522
- style: {
523
- ...n,
524
- cursor: c ? "pointer" : "default"
525
- },
526
- onClick: c
527
- }
528
- );
529
- }
530
- function Be(t) {
531
- const e = t.getBoundingClientRect();
532
- return { width: e.width, height: e.height, left: e.left, top: e.top };
533
- }
534
- function wn(t, e) {
535
- if (!e || !e.width || !e.height || !t.width || !t.height) return t;
536
- const n = e.width / e.height, c = t.width / t.height;
537
- if (n > c) {
538
- const W = t.width / n;
539
- return { width: t.width, height: W, left: t.left, top: t.top + (t.height - W) / 2 };
540
- }
541
- const a = t.height * n;
542
- return { width: a, height: t.height, left: t.left + (t.width - a) / 2, top: t.top };
543
- }
544
- function vn({
545
- src: t,
546
- phase: e,
547
- mediaRef: n,
548
- mediaStyle: c,
549
- onLoadedMetadata: a,
550
- onClick: W,
551
- onMouseMove: x
552
- }) {
553
- return V(() => {
554
- const _ = n.current;
555
- if (_)
556
- return () => {
557
- yn(_);
558
- };
559
- }, [t, n]), /* @__PURE__ */ i(
560
- "video",
561
- {
562
- ref: n,
563
- src: t,
564
- controls: e === "open",
565
- playsInline: !0,
566
- preload: "auto",
567
- onLoadedMetadata: a,
568
- onClick: W,
569
- onMouseMove: x,
570
- style: c
571
- }
572
- );
573
- }
574
- const xn = "https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg", bn = 4e-3;
575
- function Sn({
576
- prefix: t,
577
- closeIcon: e = xn,
578
- closeIconMaxWidth: n = 0.0125,
579
- closeIconColor: c = "#FFFFFF",
580
- closeIconHoverColor: a = "#999999",
581
- iconMarginRight: W = 0.01,
582
- contentMarginTop: x = 0.01,
583
- isEditor: _,
584
- isPreviewMode: pt,
585
- isEditMode: o,
586
- visible: R,
587
- onClose: P
588
- }) {
589
- if (!e) return null;
590
- const tt = m(n, _), ft = m(W, _), kt = m(x, _), z = m(Math.max(x, bn), _);
591
- return /* @__PURE__ */ p(
592
- "div",
593
- {
594
- style: {
595
- position: "absolute",
596
- top: 0,
597
- left: 0,
598
- right: 0,
599
- zIndex: 1e4,
600
- display: "flex",
601
- flexDirection: "column",
602
- alignItems: "flex-end",
603
- pointerEvents: "none",
604
- opacity: R ? 1 : 0,
605
- transition: "opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"
606
- },
607
- children: [
608
- /* @__PURE__ */ i(
609
- "div",
610
- {
611
- style: {
612
- position: "relative",
613
- width: "100%",
614
- height: kt,
615
- flexShrink: 0
616
- },
617
- children: o && /* @__PURE__ */ i(
618
- "div",
619
- {
620
- "data-controls": "contentMarginTop",
621
- "data-controls-axis": "y",
622
- "data-controls-min": "0",
623
- className: `${t}-control`,
624
- style: {
625
- position: "absolute",
626
- top: 0,
627
- left: 0,
628
- width: "100%",
629
- height: z,
630
- pointerEvents: R ? "auto" : "none"
631
- }
632
- }
633
- )
634
- }
635
- ),
636
- /* @__PURE__ */ p(
637
- "div",
638
- {
639
- className: `${t}-close-icon`,
640
- style: {
641
- width: tt,
642
- height: tt,
643
- marginRight: ft,
644
- pointerEvents: R ? "auto" : "none"
645
- },
646
- onClick: (k) => k.stopPropagation(),
647
- children: [
648
- /* @__PURE__ */ i(
649
- "button",
650
- {
651
- type: "button",
652
- className: `${t}-close-icon-inner`,
653
- "aria-label": "Close",
654
- onClick: (k) => {
655
- k.stopPropagation(), P();
656
- },
657
- children: /* @__PURE__ */ i(
658
- rn,
659
- {
660
- url: e,
661
- fill: c,
662
- hoverFill: _ && !pt ? c : a,
663
- className: `${t}-close-icon-img`
664
- }
665
- )
666
- }
667
- ),
668
- o && /* @__PURE__ */ i(
669
- "div",
670
- {
671
- "data-controls": "iconMarginRight",
672
- "data-controls-axis": "x",
673
- "data-controls-reverse": "",
674
- className: `${t}-control`,
675
- style: {
676
- position: "absolute",
677
- top: 0,
678
- left: "100%",
679
- width: ft,
680
- height: "100%",
681
- pointerEvents: R ? "auto" : "none"
682
- }
683
- }
684
- )
685
- ]
686
- }
687
- )
688
- ]
689
- }
690
- );
691
- }
692
- function Cn({
693
- prefix: t,
694
- items: e,
695
- index: n,
696
- imageDisplay: c,
697
- isEditor: a,
698
- isPreviewMode: W,
699
- isEditMode: x,
700
- onClose: _,
701
- onPrev: pt,
702
- onNext: o,
703
- counterClassName: R,
704
- counterStyle: P,
705
- closeIcon: tt,
706
- closeIconMaxWidth: ft,
707
- closeIconColor: kt,
708
- closeIconHoverColor: z,
709
- iconMarginRight: k,
710
- contentMarginTop: qt
711
- }) {
712
- const Mt = c === "cover", Ft = $(null), $t = $(null), yt = $(null), A = $(null), K = $(0), M = $(0), F = $("none"), Z = $(!1), G = $(!1), Ut = $(null), L = $(0), X = $(null), O = $(!1), dt = $(null), E = $(null), Ot = $(null), Kt = $(() => {
713
- }), [d, Wt] = N(null), [s, ue] = N(null), [b, Tt] = N("opening"), [et, Y] = N(0), [ut, q] = N(0), [Rt, ht] = N(null), [Lt, wt] = N(!1), [Nt, vt] = N(!1), [he, Zt] = N(!1), [ge, Et] = N(null), Jt = $(n), Qt = $(void 0), g = e[n], Ht = g ? It(g) : !1, jt = ut !== 0 || Lt, Pt = Rt !== null, me = ct((r) => {
714
- const l = r.currentTarget, y = l instanceof HTMLVideoElement ? { width: l.videoWidth, height: l.videoHeight } : { width: l.naturalWidth, height: l.naturalHeight };
715
- !y.width || !y.height || Et(y);
716
- }, []);
717
- V(() => {
718
- Ut.current = s;
719
- }, [s]), V(() => {
720
- const r = Ft.current;
721
- if (!r) return;
722
- const l = () => ue(Be(r));
723
- l();
724
- const y = new ResizeObserver(l);
725
- return y.observe(r), () => y.disconnect();
726
- }, []);
727
- const v = ct(() => {
728
- dt.current !== null && (window.clearTimeout(dt.current), dt.current = null);
729
- }, []), gt = ct(() => {
730
- const r = E.current;
731
- E.current = null, v(), X.current = null, O.current = !1, ht(null), wt(!1), q(0), L.current = 0, vt(!1), Z.current = !1, M.current = 0, F.current = "none", r === 1 ? o() : r === -1 && pt();
732
- }, [v, o, pt]), Dt = ct(() => {
733
- v(), E.current = null, X.current = null, O.current = !1, ht(null), wt(!1), q(0), L.current = 0;
734
- }, [v]), te = ct(() => {
735
- v(), dt.current = window.setTimeout(() => {
736
- E.current !== null && gt();
737
- }, U + 32);
738
- }, [v, gt]), nt = ct((r, l) => {
739
- var H;
740
- const y = ((H = Ut.current) == null ? void 0 : H.width) ?? 0;
741
- if (v(), X.current = r, ht(r), O.current = !0, wt(!0), l) {
742
- E.current = r;
743
- const st = -r * y;
744
- L.current = st, q(st), te();
745
- return;
746
- }
747
- L.current = 0, q(0), dt.current = window.setTimeout(() => {
748
- dt.current = null, Dt();
749
- }, U + 32);
750
- }, [v, Dt, te]), it = ct((r) => {
751
- if (!(e.length <= 1)) {
752
- if (O.current) {
753
- if (E.current === r) {
754
- Ot.current = r, gt();
755
- return;
756
- }
757
- Dt();
758
- }
759
- v(), X.current = r, ht(r), O.current = !1, wt(!1), L.current = 0, q(0), requestAnimationFrame(() => {
760
- requestAnimationFrame(() => {
761
- nt(r, !0);
762
- });
763
- });
764
- }
765
- }, [e.length, nt, gt, Dt, v]);
766
- Kt.current = it;
767
- const _t = ct((r) => {
768
- r.propertyName !== "transform" || !O.current || E.current !== null && gt();
769
- }, [gt]), xt = ct(() => {
770
- const r = $t.current;
771
- if (!r) return;
772
- const l = Be(r);
773
- !l.width || !l.height || Wt(l);
774
- }, []);
775
- V(() => {
776
- xt();
777
- const r = $t.current;
778
- if (!r) return;
779
- const l = new ResizeObserver(() => xt());
780
- return l.observe(r), () => l.disconnect();
781
- }, [xt]), V(() => {
782
- b === "opening" && d && Tt("open");
783
- }, [b, d]), V(() => {
784
- if (b !== "closing") return;
785
- const r = setTimeout(() => _(), U);
786
- return () => clearTimeout(r);
787
- }, [b, _]), V(() => () => {
788
- v();
789
- }, [v]), He(() => {
790
- Jt.current === n && Qt.current === (g == null ? void 0 : g.assetId) || (v(), E.current = null, ht(null), Y(0), q(0), wt(!1), Zt(!1), vt(!1), Et(null), K.current = 0, M.current = 0, F.current = "none", Z.current = !1, O.current = !1, L.current = 0, X.current = null, A.current = null, G.current = !1, Jt.current = n, Qt.current = g == null ? void 0 : g.assetId);
791
- }, [n, g == null ? void 0 : g.assetId, v]), He(() => {
792
- const r = Ot.current;
793
- r !== null && (Ot.current = null, requestAnimationFrame(() => {
794
- Kt.current(r);
795
- }));
796
- }, [n, g == null ? void 0 : g.assetId]), V(() => {
797
- if (b !== "open") return;
798
- let r = null;
799
- const l = () => {
800
- r && (document.removeEventListener("click", r, !0), r = null);
801
- }, y = () => {
802
- l(), r = (w) => {
803
- w.stopPropagation(), w.preventDefault(), l();
804
- }, document.addEventListener("click", r, !0);
805
- }, H = (w) => {
806
- const f = w < 0 ? 1 : -1;
807
- if (Math.abs(w) > hn && e.length > 1) {
808
- nt(f, !0);
809
- return;
810
- }
811
- nt(f, !1);
812
- }, st = (w) => {
813
- if (w.touches.length !== 1 || O.current) return;
814
- const f = w.touches[0];
815
- G.current = !0, A.current = { x: f.clientX, y: f.clientY }, F.current = "none", M.current = 0, Z.current = !1;
816
- }, at = (w) => {
817
- if (!A.current || w.touches.length !== 1 || O.current) return;
818
- const f = w.touches[0], S = f.clientX - A.current.x, T = f.clientY - A.current.y;
819
- if (F.current === "none") {
820
- if (Math.abs(S) < 10 && Math.abs(T) < 10) return;
821
- if (Math.abs(S) > Math.abs(T)) {
822
- if (e.length <= 1) return;
823
- F.current = "horizontal";
824
- } else if (T > 0)
825
- F.current = "vertical";
826
- else
827
- return;
828
- }
829
- if (F.current === "horizontal") {
830
- Z.current = !0, vt(!0), M.current = S;
831
- const j = S < 0 ? 1 : -1;
832
- X.current !== j && (X.current = j, ht(j)), L.current = S, q(S), w.preventDefault();
833
- return;
834
- }
835
- F.current === "vertical" && (Z.current = !0, vt(!0), K.current = T, Y(T), w.preventDefault());
836
- }, At = () => {
837
- if (!A.current) return;
838
- const w = F.current, f = Z.current;
839
- if (f && w === "horizontal")
840
- H(M.current), y();
841
- else if (f && w === "vertical")
842
- if (K.current > un) {
843
- const T = window.innerHeight;
844
- K.current = T, Zt(!0), Y(T), Tt("closing");
845
- } else
846
- K.current = 0, Y(0), y();
847
- else w === "horizontal" && Math.abs(M.current) > 0 && (H(M.current), y());
848
- A.current = null, F.current = "none", M.current = 0, Z.current = !1, vt(!1);
849
- };
850
- return document.addEventListener("touchstart", st, { passive: !0 }), document.addEventListener("touchmove", at, { passive: !1 }), document.addEventListener("touchend", At), document.addEventListener("touchcancel", At), () => {
851
- document.removeEventListener("touchstart", st), document.removeEventListener("touchmove", at), document.removeEventListener("touchend", At), document.removeEventListener("touchcancel", At), l();
852
- };
853
- }, [b, e.length, nt]), V(() => {
854
- const r = (l) => {
855
- l.key === "Escape" && (l.preventDefault(), l.stopPropagation(), b !== "closing" && Tt("closing"));
856
- };
857
- return window.addEventListener("keydown", r, !0), () => window.removeEventListener("keydown", r, !0);
858
- }, [b]);
859
- const ee = () => {
860
- b !== "closing" && Tt("closing");
861
- }, J = b === "open", pe = b === "closing", ke = et > 0 ? Math.max(0, 1 - et / 500) : 1, fe = et > 0 ? Math.max(0.35, 1 - et / 500) : 1, u = d ? Mt ? d : wn(d, ge) : null, rt = (r) => {
862
- if (r.stopPropagation(), G.current) {
863
- G.current = !1;
864
- return;
865
- }
866
- if (e.length <= 1) return;
867
- const l = u ?? r.currentTarget.getBoundingClientRect(), y = r.clientY - l.top, H = Math.min(52, l.height * 0.2);
868
- if (!(y > l.height - H)) {
869
- if (r.clientX - l.left < l.width / 2) {
870
- it(-1);
871
- return;
872
- }
873
- it(1);
874
- }
875
- }, $e = (r) => {
876
- if (e.length <= 1) return;
877
- const l = u ?? r.currentTarget.getBoundingClientRect(), y = r.clientX - l.left, H = r.clientY - l.top, st = Math.min(52, l.height * 0.2);
878
- if (H > l.height - st) {
879
- r.currentTarget.style.cursor = "default";
880
- return;
881
- }
882
- r.currentTarget.style.cursor = y < l.width / 2 ? "w-resize" : "e-resize";
883
- }, bt = {
884
- position: "fixed",
885
- top: s == null ? void 0 : s.top,
886
- left: s == null ? void 0 : s.left,
887
- width: s == null ? void 0 : s.width,
888
- height: s == null ? void 0 : s.height,
889
- zIndex: 9998
890
- }, zt = Mt ? "cover" : "contain", ye = ut !== 0 || et > 0 ? `translate(${ut}px, ${et}px)` : void 0, ne = Nt && !Lt ? "none" : Lt ? `transform ${U}ms ${mt}` : he ? `transform ${U}ms ${mt}, opacity ${U}ms ${mt}` : b === "opening" || pe ? `opacity ${U}ms ${mt}` : "none", ie = {
891
- ...bt,
892
- transform: ye,
893
- opacity: et > 0 ? fe : b === "opening" || pe ? 0 : 1,
894
- transition: ne,
895
- pointerEvents: "none"
896
- }, Bt = {
897
- position: "absolute",
898
- top: ((u == null ? void 0 : u.top) ?? 0) - ((s == null ? void 0 : s.top) ?? 0),
899
- left: ((u == null ? void 0 : u.left) ?? 0) - ((s == null ? void 0 : s.left) ?? 0),
900
- width: u == null ? void 0 : u.width,
901
- height: u == null ? void 0 : u.height,
902
- objectFit: zt,
903
- pointerEvents: Ht && J && !jt ? "auto" : "none",
904
- touchAction: Ht && J ? "none" : void 0
905
- }, Te = (s == null ? void 0 : s.width) ?? 0, Vt = Pt ? (n + Rt + e.length) % e.length : null, ot = Vt !== null ? e[Vt] : null, lt = {
906
- ...bt,
907
- transform: Pt ? `translateX(${Rt * Te + ut}px)` : void 0,
908
- opacity: 1,
909
- transition: Lt ? `transform ${U}ms ${mt}` : "none",
910
- pointerEvents: "none"
911
- }, St = {
912
- position: "absolute",
913
- top: ((d == null ? void 0 : d.top) ?? 0) - ((s == null ? void 0 : s.top) ?? 0),
914
- left: ((d == null ? void 0 : d.left) ?? 0) - ((s == null ? void 0 : s.left) ?? 0),
915
- width: d == null ? void 0 : d.width,
916
- height: d == null ? void 0 : d.height,
917
- objectFit: zt,
918
- pointerEvents: "none"
919
- }, Gt = u ? {
920
- position: "fixed",
921
- top: u.top,
922
- height: u.height,
923
- width: u.width / 2,
924
- zIndex: 9999
925
- } : null;
926
- return /* @__PURE__ */ p(
927
- "div",
928
- {
929
- ref: Ft,
930
- className: [
931
- `${t}-lightbox`,
932
- a ? `${t}-lightbox-editor` : ""
933
- ].filter(Boolean).join(" "),
934
- style: {
935
- touchAction: b === "open" ? "none" : void 0
936
- },
937
- onClick: ee,
938
- children: [
939
- /* @__PURE__ */ i(
940
- "div",
941
- {
942
- style: {
943
- position: "absolute",
944
- inset: 0,
945
- background: "rgba(28,31,34,0.9)",
946
- opacity: J ? ke : 0,
947
- transition: Nt ? "none" : `opacity ${U}ms ${mt}`,
948
- pointerEvents: "none"
949
- }
950
- }
951
- ),
952
- /* @__PURE__ */ i(
953
- "div",
954
- {
955
- style: {
956
- position: "relative",
957
- width: "100%",
958
- height: "100%",
959
- display: "flex",
960
- flexDirection: "column",
961
- alignItems: "center",
962
- justifyContent: "center"
963
- },
964
- children: Mt ? /* @__PURE__ */ p(B, { children: [
965
- /* @__PURE__ */ i("div", { ref: $t, style: { position: "absolute", inset: 0 } }),
966
- /* @__PURE__ */ i(
967
- "div",
968
- {
969
- style: {
970
- position: "absolute",
971
- bottom: 0,
972
- left: 0,
973
- right: 0,
974
- display: "flex",
975
- flexDirection: "row",
976
- justifyContent: "center",
977
- alignItems: "center",
978
- height: "10%",
979
- opacity: J ? 1 : 0,
980
- transition: `opacity ${U}ms ${mt}`,
981
- pointerEvents: "none",
982
- zIndex: 9999
983
- },
984
- children: e.length > 1 && /* @__PURE__ */ p("p", { className: R, style: P, children: [
985
- n + 1,
986
- " / ",
987
- e.length
988
- ] })
989
- }
990
- )
991
- ] }) : /* @__PURE__ */ p(B, { children: [
992
- /* @__PURE__ */ i("div", { style: { height: "10%" } }),
993
- /* @__PURE__ */ i(
994
- "div",
995
- {
996
- style: {
997
- width: "70%",
998
- height: "80%",
999
- display: "flex",
1000
- justifyContent: "center",
1001
- alignItems: "center"
1002
- },
1003
- children: /* @__PURE__ */ i("div", { ref: $t, style: { width: "100%", height: "100%" } })
1004
- }
1005
- ),
1006
- /* @__PURE__ */ i(
1007
- "div",
1008
- {
1009
- style: {
1010
- display: "flex",
1011
- flexDirection: "row",
1012
- justifyContent: "center",
1013
- alignItems: "center",
1014
- height: "10%",
1015
- opacity: J ? 1 : 0,
1016
- transition: `opacity ${U}ms ${mt}`
1017
- },
1018
- children: e.length > 1 && /* @__PURE__ */ p("p", { className: R, style: P, children: [
1019
- n + 1,
1020
- " / ",
1021
- e.length
1022
- ] })
1023
- }
1024
- )
1025
- ] })
1026
- }
1027
- ),
1028
- d && s && ot && /* @__PURE__ */ i("div", { style: lt, onTransitionEnd: _t, children: It(ot) ? /* @__PURE__ */ i(
1029
- "video",
1030
- {
1031
- src: ot.assetId,
1032
- muted: !0,
1033
- playsInline: !0,
1034
- preload: "auto",
1035
- style: St
1036
- },
1037
- `neighbor-${Vt}-${ot.assetId}`
1038
- ) : /* @__PURE__ */ i(
1039
- "img",
1040
- {
1041
- src: ot.assetId,
1042
- alt: ot.name,
1043
- style: St
1044
- },
1045
- `neighbor-${Vt}-${ot.assetId}`
1046
- ) }),
1047
- d && s && g && /* @__PURE__ */ i("div", { style: ie, onTransitionEnd: _t, children: Ht ? /* @__PURE__ */ i(
1048
- vn,
1049
- {
1050
- src: g.assetId,
1051
- phase: b,
1052
- mediaRef: yt,
1053
- mediaStyle: Bt,
1054
- onLoadedMetadata: me,
1055
- onClick: rt,
1056
- onMouseMove: $e
1057
- },
1058
- `${n}-${g.assetId}`
1059
- ) : /* @__PURE__ */ i(
1060
- "img",
1061
- {
1062
- ref: yt,
1063
- src: g.assetId,
1064
- alt: g.name,
1065
- onLoad: me,
1066
- style: Bt
1067
- },
1068
- `${n}-${g.assetId}`
1069
- ) }),
1070
- J && Gt && e.length > 1 && !Ht && /* @__PURE__ */ p(B, { children: [
1071
- /* @__PURE__ */ i(
1072
- "div",
1073
- {
1074
- style: {
1075
- ...Gt,
1076
- left: u.left,
1077
- cursor: "w-resize",
1078
- pointerEvents: Nt ? "none" : "auto"
1079
- },
1080
- onClick: (r) => {
1081
- if (G.current) {
1082
- G.current = !1;
1083
- return;
1084
- }
1085
- r.stopPropagation(), it(-1);
1086
- }
1087
- }
1088
- ),
1089
- /* @__PURE__ */ i(
1090
- "div",
1091
- {
1092
- style: {
1093
- ...Gt,
1094
- left: u.left + u.width / 2,
1095
- cursor: "e-resize",
1096
- pointerEvents: Nt ? "none" : "auto"
1097
- },
1098
- onClick: (r) => {
1099
- if (G.current) {
1100
- G.current = !1;
1101
- return;
1102
- }
1103
- r.stopPropagation(), it(1);
1104
- }
1105
- }
1106
- )
1107
- ] }),
1108
- /* @__PURE__ */ i(
1109
- Sn,
1110
- {
1111
- prefix: t,
1112
- closeIcon: tt,
1113
- closeIconMaxWidth: ft,
1114
- closeIconColor: kt,
1115
- closeIconHoverColor: z,
1116
- iconMarginRight: k,
1117
- contentMarginTop: qt,
1118
- isEditor: a,
1119
- isPreviewMode: W,
1120
- isEditMode: x,
1121
- visible: J,
1122
- onClose: ee
1123
- }
1124
- )
1125
- ]
1126
- }
1127
- );
1128
- }
1129
- function In(t) {
1130
- return typeof t == "string" ? t === "cover" ? "cover" : "fit" : (t == null ? void 0 : t.display) === "cover" ? "cover" : "fit";
1131
- }
1132
- function Hn({ settings: t, content: e, isEditor: n, isPreviewMode: c, isEditMode: a, metadata: W, activeEvent: x, layoutId: _, portalId: pt }) {
1133
- const { prefix: o } = en(), {
1134
- type: R = "a",
1135
- gridLayout: P,
1136
- textBoxWidth: tt = 100,
1137
- verticalGap: ft,
1138
- entriesCount: kt,
1139
- lightbox: z,
1140
- imageDisplay: k,
1141
- imageCorners: qt,
1142
- lightboxImageDisplay: Mt,
1143
- slider: Ft,
1144
- sliderTiming: $t,
1145
- direction: yt,
1146
- transition: A,
1147
- titleMarginTop: K,
1148
- subtitleMarginTop: M,
1149
- titleColor: F,
1150
- subtitleColor: Z,
1151
- lightboxCounterColor: G,
1152
- titleFontFamily: Ut,
1153
- titleFontSettings: L,
1154
- titleFontSize: X,
1155
- titleLineHeight: O,
1156
- titleLetterSpacing: dt,
1157
- titleWordSpacing: E,
1158
- titleTextAppearance: Ot,
1159
- subtitleFontFamily: Kt,
1160
- subtitleFontSettings: d,
1161
- subtitleFontSize: Wt,
1162
- subtitleLineHeight: s,
1163
- subtitleLetterSpacing: ue,
1164
- subtitleWordSpacing: b,
1165
- subtitleTextAppearance: Tt,
1166
- lightboxCounterFontFamily: et,
1167
- lightboxCounterFontSettings: Y,
1168
- lightboxCounterFontSize: ut,
1169
- lightboxCounterLineHeight: q,
1170
- lightboxCounterLetterSpacing: Rt,
1171
- lightboxCounterWordSpacing: ht,
1172
- lightboxCounterTextAppearance: Lt,
1173
- closeIcon: wt,
1174
- closeIconMaxWidth: Nt,
1175
- closeIconColor: vt,
1176
- closeIconHoverColor: he,
1177
- iconMarginRight: Zt,
1178
- contentMarginTop: ge,
1179
- showText: Et = "always",
1180
- alignEntries: Jt = "off",
1181
- align: Qt = "top"
1182
- } = t, g = {
1183
- fontSettings: {
1184
- fontFamily: Ut,
1185
- fontWeight: (L == null ? void 0 : L.fontWeight) ?? 400,
1186
- fontStyle: (L == null ? void 0 : L.fontStyle) ?? "normal"
1187
- },
1188
- fontSize: X ?? 0.01,
1189
- lineHeight: O,
1190
- letterSpacing: dt ?? 0,
1191
- wordSpacing: E ?? 0,
1192
- textAppearance: Ot,
1193
- color: F
1194
- }, jt = {
1195
- ...be(Se(g, n))
1196
- }, Pt = {
1197
- fontSettings: {
1198
- fontFamily: Kt,
1199
- fontWeight: (d == null ? void 0 : d.fontWeight) ?? 400,
1200
- fontStyle: (d == null ? void 0 : d.fontStyle) ?? "normal"
1201
- },
1202
- fontSize: Wt ?? 0.01,
1203
- lineHeight: s,
1204
- letterSpacing: ue ?? 0,
1205
- wordSpacing: b ?? 0,
1206
- textAppearance: Tt,
1207
- color: Z
1208
- }, v = {
1209
- ...be(Se(Pt, n))
1210
- }, gt = {
1211
- fontSettings: {
1212
- fontFamily: et,
1213
- fontWeight: (Y == null ? void 0 : Y.fontWeight) ?? 400,
1214
- fontStyle: (Y == null ? void 0 : Y.fontStyle) ?? "normal"
1215
- },
1216
- fontSize: ut ?? 0.01,
1217
- lineHeight: q,
1218
- letterSpacing: Rt ?? 0,
1219
- wordSpacing: ht ?? 0,
1220
- textAppearance: Lt,
1221
- color: G
1222
- }, te = {
1223
- ...be(Se(gt, n)),
1224
- ...Ie(ut, q, o, n)
1225
- }, nt = Ce(
1226
- X,
1227
- O,
1228
- `${o}-item-title`,
1229
- `${o}-text-tight-leading`
1230
- ), it = Ce(
1231
- Wt,
1232
- s,
1233
- `${o}-item-subtitle`,
1234
- `${o}-text-tight-leading`
1235
- ), _t = Ie(X, O, o, n), xt = Ie(Wt, s, o, n), ee = Ce(
1236
- ut,
1237
- q,
1238
- `${o}-lightbox-counter`,
1239
- `${o}-text-tight-leading`
1240
- ), J = tn(o, {
1241
- titleColor: F,
1242
- subtitleColor: Z,
1243
- lightboxCounterColor: G
1244
- }, kn, Tn), fe = `${x && x !== "default" ? `${o}-state-${x}` : ""}${Et === "on hover" && (!n || c) ? ` ${o}-show-text-hover` : ""}`.trim(), u = kt === 0 ? 1 / 0 : kt, rt = (e ?? []).slice(0, u), $e = Re(
1245
- () => z === "on" ? fn(rt) : [],
1246
- [rt, z]
1247
- ), bt = P.entryWidth ?? 0.2, zt = (k == null ? void 0 : k.display) === "cover", ye = (k == null ? void 0 : k.ratioValue) ?? "1:1", ne = (k == null ? void 0 : k.reversed) ?? !1, [ie, Bt] = ye.split(":").map(Number), ot = `${ne ? Bt : ie} / ${ne ? ie : Bt}`, lt = P.columnsCount, St = m(bt ?? 0, n), Gt = St, r = !zt && Ft !== "off", l = rt.length % lt || lt, y = l < lt && rt.length > 0, H = rt.length - l, st = y ? Math.floor((lt - l) / 2) + 1 : 1, at = qt ? m(qt, n) : void 0, At = {
1248
- width: Gt,
1249
- ...zt ? { aspectRatio: ot, height: "auto", overflow: "hidden" } : { height: "auto" },
1250
- ...at ? { borderRadius: at, overflow: "hidden" } : {}
1251
- }, w = `${o}-item-image-wrapper${r ? ` ${o}-item-image-wrapper-fit-slider` : ""}`.trim(), f = R === "d" || R === "e" || R === "f", S = Jt === "on", T = `calc(${m(bt ?? 0, n)} * (${tt} / 100))`, j = m(bt * tt / 100, n), Le = zt ? {
1252
- objectFit: "cover",
1253
- pointerEvents: "auto",
1254
- width: "100%",
1255
- height: "100%",
1256
- maxWidth: "100%",
1257
- ...at ? { borderRadius: at } : {}
1258
- } : {
1259
- objectFit: "contain",
1260
- pointerEvents: "auto",
1261
- width: "auto",
1262
- height: "auto",
1263
- maxWidth: "100%",
1264
- ...at ? { borderRadius: at } : {}
1265
- }, [Ge, Xe] = N(0), re = $(null), Ye = A === "fade" || yt === "horizontal" ? "ltr" : yt === "vertical" ? "ttb" : "ltr";
1266
- V(() => {
1267
- const h = re.current;
1268
- if (!h) return;
1269
- const I = new ResizeObserver((D) => {
1270
- Xe(Math.round(D[0].contentRect.width));
1271
- });
1272
- return I.observe(h), () => I.disconnect();
1273
- }, []);
1274
- const qe = (() => {
1275
- const h = { ...J }, I = re.current ? getComputedStyle(re.current).getPropertyValue("--cntrl-article-width").trim() : "";
1276
- return I && (h["--cntrl-article-width"] = I), h;
1277
- })(), [we, ve] = N(!1), [oe, Ue] = N([]), [Ke, xe] = N(0), Ne = z === "on" && (!n || c), _e = (h, I) => {
1278
- n && !c || z !== "off" && (Ue(h), xe(I), ve(!0));
1279
- };
1280
- V(() => {
1281
- if (!we || z !== "on" || typeof document > "u") return;
1282
- const h = document.body.style.overflow;
1283
- return document.body.style.overflow = "hidden", () => {
1284
- document.body.style.overflow = h;
1285
- };
1286
- }, [we, z]), V(() => {
1287
- !n || c || ve(!1);
1288
- }, [n, c]);
1289
- const Ze = Re(() => ln(o), [o]);
1290
- return /* @__PURE__ */ p(B, { children: [
1291
- /* @__PURE__ */ i("style", { dangerouslySetInnerHTML: { __html: Ze } }),
1292
- z === "on" && /* @__PURE__ */ i($n, { mediaList: $e }),
1293
- /* @__PURE__ */ i("div", { style: J, children: /* @__PURE__ */ i(
1294
- "div",
1295
- {
1296
- ref: re,
1297
- className: `${o}-wrapper ${o}-type-${R}${S ? ` ${o}-align-entries` : ""} ${o}-image-align-${Qt} ${fe}`.trim(),
1298
- style: {
1299
- gridTemplateColumns: `repeat(${lt}, ${St})`,
1300
- rowGap: S ? 0 : m(ft ?? 0, n),
1301
- columnGap: m(P.horizontalGap ?? 0, n),
1302
- width: m(P.wrapperWidth ?? 0, n),
1303
- ...S ? { [`--${o}-align-entries-row-gap`]: m(ft ?? 0, n) } : {}
1304
- },
1305
- children: rt.map((h, I) => {
1306
- var We;
1307
- const D = je(h.title), Q = je(h.subtitle), Ct = (((We = h.link) == null ? void 0 : We.length) ?? 0) > 0 && z === "off" ? h.link : void 0, Ee = Math.floor(I / lt) === Math.ceil(rt.length / lt) - 1, le = y && I >= H ? `${st + (I - H)}` : void 0, ze = f ? /* @__PURE__ */ p("div", { className: `${o}-item-text-block`, children: [
1308
- D && /* @__PURE__ */ i("p", { className: nt, style: { width: T, ...jt, ..._t }, children: h.title }),
1309
- D && /* @__PURE__ */ i(
1310
- "div",
1311
- {
1312
- "data-controls": a ? "titleMarginTop" : void 0,
1313
- className: a ? `${o}-control` : void 0,
1314
- style: {
1315
- height: m(K ?? 0, n),
1316
- width: j
1317
- }
1318
- }
1319
- ),
1320
- Q && /* @__PURE__ */ i("p", { className: it, style: { width: T, ...v, ...xt }, children: h.subtitle }),
1321
- Q && /* @__PURE__ */ i(
1322
- "div",
1323
- {
1324
- "data-controls": a ? "subtitleMarginTop" : void 0,
1325
- className: a ? `${o}-control` : void 0,
1326
- style: {
1327
- height: m(M ?? 0, n),
1328
- width: j
1329
- }
1330
- }
1331
- )
1332
- ] }) : null, Ae = S ? /* @__PURE__ */ p("div", { className: `${o}-item-title-row`, children: [
1333
- !f && /* @__PURE__ */ i(
1334
- "div",
1335
- {
1336
- "data-controls": a && D ? "titleMarginTop" : void 0,
1337
- className: a && D ? `${o}-control` : void 0,
1338
- style: {
1339
- height: D ? m(K ?? 0, n) : 0,
1340
- width: j
1341
- }
1342
- }
1343
- ),
1344
- D && /* @__PURE__ */ i("p", { className: nt, style: { width: T, ...jt, ..._t }, children: h.title }),
1345
- f && D && /* @__PURE__ */ i(
1346
- "div",
1347
- {
1348
- "data-controls": a ? "titleMarginTop" : void 0,
1349
- className: a ? `${o}-control` : void 0,
1350
- style: {
1351
- height: m(K ?? 0, n),
1352
- width: j
1353
- }
1354
- }
1355
- )
1356
- ] }) : null, Me = S ? /* @__PURE__ */ p("div", { className: `${o}-item-subtitle-row`, children: [
1357
- !f && /* @__PURE__ */ i(
1358
- "div",
1359
- {
1360
- "data-controls": a && Q ? "subtitleMarginTop" : void 0,
1361
- className: a && Q ? `${o}-control` : void 0,
1362
- style: {
1363
- height: Q ? m(M ?? 0, n) : 0,
1364
- width: j
1365
- }
1366
- }
1367
- ),
1368
- Q && /* @__PURE__ */ i("p", { className: it, style: { width: T, ...v, ...xt }, children: h.subtitle }),
1369
- f && Q && /* @__PURE__ */ i(
1370
- "div",
1371
- {
1372
- "data-controls": a ? "subtitleMarginTop" : void 0,
1373
- className: a ? `${o}-control` : void 0,
1374
- style: {
1375
- height: m(M ?? 0, n),
1376
- width: j
1377
- }
1378
- }
1379
- )
1380
- ] }) : null, Fe = Ct ? /* @__PURE__ */ p("a", { href: Ct, target: "_blank", className: `${o}-item-text-link`, children: [
1381
- Ae,
1382
- Me
1383
- ] }) : /* @__PURE__ */ p(B, { children: [
1384
- Ae,
1385
- Me
1386
- ] }), Xt = Ve(h.gallery), se = Xt.filter((C) => C.lightboxMedia).map((C) => C.lightboxMedia), ae = /* @__PURE__ */ i("div", { className: w, style: At, children: Xt.length === 0 ? null : Ft === "off" ? (() => {
1387
- const { displayMedia: C, lightboxMedia: Yt } = Xt[0], ce = Yt ? se.findIndex((de) => de.assetId === Yt.assetId) : -1;
1388
- return /* @__PURE__ */ i(
1389
- De,
1390
- {
1391
- media: C,
1392
- className: `${o}-item-${It(C) ? "video" : "image"}`.trim(),
1393
- style: Le,
1394
- onMediaClick: Ne && ce >= 0 ? () => _e(se, ce) : void 0
1395
- }
1396
- );
1397
- })() : /* @__PURE__ */ p(B, { children: [
1398
- r && /* @__PURE__ */ i("div", { className: `${o}-item-image-wrapper-sizer`, "aria-hidden": "true", children: Xt.map(({ displayMedia: C }) => It(C) ? /* @__PURE__ */ i("video", { src: C.assetId, muted: !0, playsInline: !0 }, `sizer-${C.assetId}`) : /* @__PURE__ */ i("img", { src: C.assetId, alt: "" }, `sizer-${C.assetId}`)) }),
1399
- /* @__PURE__ */ i(
1400
- Qe,
1401
- {
1402
- className: `${o}-item-slider`,
1403
- options: {
1404
- arrows: !1,
1405
- pagination: !1,
1406
- drag: !1,
1407
- perPage: 1,
1408
- autoplay: !0,
1409
- interval: $t * 1e3,
1410
- width: "100%",
1411
- height: "100%",
1412
- speed: dn,
1413
- type: A === "fade" ? "fade" : "loop",
1414
- rewind: A === "fade",
1415
- pauseOnHover: !1,
1416
- pauseOnFocus: !1,
1417
- direction: Ye
1418
- },
1419
- onMoved: (C) => {
1420
- yt !== "random" || A === "fade" || cn(C);
1421
- },
1422
- children: Xt.map(({ displayMedia: C, lightboxMedia: Yt }, ce) => {
1423
- const de = Yt ? se.findIndex((Je) => Je.assetId === Yt.assetId) : -1;
1424
- return /* @__PURE__ */ i(Pe, { children: /* @__PURE__ */ i(
1425
- De,
1426
- {
1427
- media: C,
1428
- className: `${o}-item-${It(C) ? "video" : "image"}`.trim(),
1429
- style: Le,
1430
- onMediaClick: Ne && de >= 0 ? () => _e(se, de) : void 0
1431
- }
1432
- ) }, ce);
1433
- })
1434
- },
1435
- `${A}-${bt}-${yt}-${$t}-${Ge}-${_}`
1436
- )
1437
- ] }) }), Oe = f ? null : /* @__PURE__ */ p(B, { children: [
1438
- /* @__PURE__ */ i(
1439
- "div",
1440
- {
1441
- "data-controls": a && D ? "titleMarginTop" : void 0,
1442
- className: a && D ? `${o}-control` : void 0,
1443
- style: {
1444
- height: D ? m(K ?? 0, n) : 0,
1445
- width: j
1446
- }
1447
- }
1448
- ),
1449
- /* @__PURE__ */ i(
1450
- "p",
1451
- {
1452
- className: nt,
1453
- style: { width: T, ...jt, ..._t },
1454
- children: h.title
1455
- }
1456
- ),
1457
- /* @__PURE__ */ i(
1458
- "div",
1459
- {
1460
- "data-controls": a && Q ? "subtitleMarginTop" : void 0,
1461
- className: a && Q ? `${o}-control` : void 0,
1462
- style: {
1463
- height: Q ? m(M ?? 0, n) : 0,
1464
- width: j
1465
- }
1466
- }
1467
- ),
1468
- /* @__PURE__ */ i(
1469
- "p",
1470
- {
1471
- className: it,
1472
- style: { width: T, ...v, ...xt },
1473
- children: h.subtitle
1474
- }
1475
- )
1476
- ] });
1477
- return /* @__PURE__ */ i(
1478
- "div",
1479
- {
1480
- className: `${o}-item`.trim(),
1481
- style: le && !S ? { gridColumn: le } : void 0,
1482
- children: /* @__PURE__ */ i(
1483
- "div",
1484
- {
1485
- className: `${a ? `${o}-item-inner` : `${o}-item-inner-hidden`}${S && Ee ? ` ${o}-item-inner-last-row` : ""}`.trim(),
1486
- style: {
1487
- width: (tt ?? 0) > 100 ? `calc(${St} * (${tt} / 100))` : St,
1488
- ...le && S ? { gridColumn: le } : {}
1489
- },
1490
- children: S ? /* @__PURE__ */ i(B, { children: f ? /* @__PURE__ */ p(B, { children: [
1491
- Fe,
1492
- /* @__PURE__ */ i("a", { href: Ct, target: "_blank", className: `${o}-item-image-link`, children: ae })
1493
- ] }) : /* @__PURE__ */ p(B, { children: [
1494
- /* @__PURE__ */ i("a", { href: Ct, target: "_blank", className: `${o}-item-image-link`, children: ae }),
1495
- Fe
1496
- ] }) }) : Ct ? /* @__PURE__ */ p(B, { children: [
1497
- /* @__PURE__ */ p("a", { href: Ct, target: "_blank", className: `${o}-item-image-link`, children: [
1498
- ze,
1499
- ae
1500
- ] }),
1501
- !f && /* @__PURE__ */ i("a", { href: Ct, target: "_blank", className: `${o}-item-text-link`, children: Oe })
1502
- ] }) : /* @__PURE__ */ p(B, { children: [
1503
- ze,
1504
- ae,
1505
- Oe
1506
- ] })
1507
- }
1508
- )
1509
- },
1510
- I
1511
- );
1512
- })
1513
- }
1514
- ) }),
1515
- (!n || c) && we && typeof document < "u" && z === "on" && (() => {
1516
- const h = (pt ? document.getElementById(pt) : null) ?? document.body;
1517
- return nn(
1518
- /* @__PURE__ */ i("div", { style: qe, "data-selection": "none", children: /* @__PURE__ */ i(
1519
- Cn,
1520
- {
1521
- prefix: o,
1522
- items: oe,
1523
- index: Ke,
1524
- imageDisplay: In(Mt),
1525
- isEditor: n,
1526
- isPreviewMode: c,
1527
- isEditMode: a,
1528
- closeIcon: wt,
1529
- closeIconMaxWidth: Nt,
1530
- closeIconColor: vt,
1531
- closeIconHoverColor: he,
1532
- iconMarginRight: Zt,
1533
- contentMarginTop: ge,
1534
- onClose: () => ve(!1),
1535
- onPrev: () => xe((I) => (I - 1 + oe.length) % oe.length),
1536
- onNext: () => xe((I) => (I + 1) % oe.length),
1537
- counterClassName: ee,
1538
- counterStyle: te
1539
- }
1540
- ) }),
1541
- h
1542
- );
1543
- })()
1544
- ] });
1545
- }
1546
- const kn = {
1547
- titleColor: "title-color",
1548
- subtitleColor: "subtitle-color",
1549
- lightboxCounterColor: "lightbox-counter-color"
1550
- }, Tn = ["hover", "focus", "filled", "success", "error"];
1551
- export {
1552
- Hn as Grid
1553
- };