@cntrl-site/components 0.1.26 → 0.1.27-0

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.
package/dist/index.js CHANGED
@@ -1,3694 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const reactSplide = require("@splidejs/react-splide");
6
- const cn = require("classnames");
7
- const reactDom = require("react-dom");
8
- const wrapper = "ControlSlider-module__wrapper___sHEkd";
9
- const hoverArrow = "ControlSlider-module__hoverArrow___A-dOH";
10
- const sliderItem = "ControlSlider-module__sliderItem___QQSkR";
11
- const sliderImage = "ControlSlider-module__sliderImage___9hRl-";
12
- const arrow$1 = "ControlSlider-module__arrow___05ghY";
13
- const arrowVertical$1 = "ControlSlider-module__arrowVertical___tBfVN";
14
- const nextArrow$1 = "ControlSlider-module__nextArrow___-30Yc";
15
- const arrowInner$1 = "ControlSlider-module__arrowInner___aEra3";
16
- const arrowIcon$1 = "ControlSlider-module__arrowIcon___S4ztF";
17
- const arrowImg$1 = "ControlSlider-module__arrowImg___2dwJW";
18
- const mirror$1 = "ControlSlider-module__mirror___brd6U";
19
- const pagination = "ControlSlider-module__pagination___bicLF";
20
- const paginationInner = "ControlSlider-module__paginationInner___bT-P-";
21
- const paginationVertical = "ControlSlider-module__paginationVertical___zYqKw";
22
- const paginationItem = "ControlSlider-module__paginationItem___nTRbk";
23
- const dot = "ControlSlider-module__dot___p1Qun";
24
- const activeDot = "ControlSlider-module__activeDot___LHFaj";
25
- const paginationInsideBottom = "ControlSlider-module__paginationInsideBottom___R3FWn";
26
- const paginationInsideTop = "ControlSlider-module__paginationInsideTop___V-qb-";
27
- const paginationOutsideBottom = "ControlSlider-module__paginationOutsideBottom___14w8D";
28
- const paginationOutsideTop = "ControlSlider-module__paginationOutsideTop___SCLqB";
29
- const paginationInsideLeft = "ControlSlider-module__paginationInsideLeft___yOBRZ";
30
- const paginationInsideRight = "ControlSlider-module__paginationInsideRight___Rtt3o";
31
- const paginationOutsideLeft = "ControlSlider-module__paginationOutsideLeft___lahaw";
32
- const paginationOutsideRight = "ControlSlider-module__paginationOutsideRight___EtuQa";
33
- const imgWrapper$1 = "ControlSlider-module__imgWrapper___UjEgB";
34
- const captionBlock = "ControlSlider-module__captionBlock___dJ6-j";
35
- const captionTextWrapper = "ControlSlider-module__captionTextWrapper___HFlpf";
36
- const captionText = "ControlSlider-module__captionText___uGBVc";
37
- const active = "ControlSlider-module__active___WZK4G";
38
- const withPointerEvents = "ControlSlider-module__withPointerEvents___t-18M";
39
- const topLeftAlignment = "ControlSlider-module__topLeftAlignment___zjnGM";
40
- const topCenterAlignment = "ControlSlider-module__topCenterAlignment___gD1xW";
41
- const topRightAlignment = "ControlSlider-module__topRightAlignment___NMapS";
42
- const middleLeftAlignment = "ControlSlider-module__middleLeftAlignment___OnUrY";
43
- const middleCenterAlignment = "ControlSlider-module__middleCenterAlignment___Tdkl0";
44
- const middleRightAlignment = "ControlSlider-module__middleRightAlignment___wEbfX";
45
- const bottomLeftAlignment = "ControlSlider-module__bottomLeftAlignment___cTP2-";
46
- const bottomCenterAlignment = "ControlSlider-module__bottomCenterAlignment___c54fB";
47
- const bottomRightAlignment = "ControlSlider-module__bottomRightAlignment___kEwrz";
48
- const clickOverlay = "ControlSlider-module__clickOverlay___DZA28";
49
- const contain$1 = "ControlSlider-module__contain___pLyq7";
50
- const cover$1 = "ControlSlider-module__cover___KdDat";
51
- const styles$3 = {
52
- wrapper,
53
- hoverArrow,
54
- sliderItem,
55
- sliderImage,
56
- arrow: arrow$1,
57
- arrowVertical: arrowVertical$1,
58
- nextArrow: nextArrow$1,
59
- arrowInner: arrowInner$1,
60
- arrowIcon: arrowIcon$1,
61
- arrowImg: arrowImg$1,
62
- mirror: mirror$1,
63
- pagination,
64
- paginationInner,
65
- paginationVertical,
66
- paginationItem,
67
- dot,
68
- activeDot,
69
- paginationInsideBottom,
70
- paginationInsideTop,
71
- paginationOutsideBottom,
72
- paginationOutsideTop,
73
- paginationInsideLeft,
74
- paginationInsideRight,
75
- paginationOutsideLeft,
76
- paginationOutsideRight,
77
- imgWrapper: imgWrapper$1,
78
- captionBlock,
79
- captionTextWrapper,
80
- captionText,
81
- active,
82
- withPointerEvents,
83
- topLeftAlignment,
84
- topCenterAlignment,
85
- topRightAlignment,
86
- middleLeftAlignment,
87
- middleCenterAlignment,
88
- middleRightAlignment,
89
- bottomLeftAlignment,
90
- bottomCenterAlignment,
91
- bottomRightAlignment,
92
- clickOverlay,
93
- contain: contain$1,
94
- cover: cover$1
95
- };
96
- const link$1 = "RichTextRenderer-module__link___BWeZ2";
97
- const styles$2 = {
98
- link: link$1
99
- };
100
- const RichTextRenderer = ({ content }) => {
101
- const getChildren = (children) => {
102
- return children.map((child, i) => {
103
- if (child.type === "link") {
104
- return /* @__PURE__ */ jsxRuntime.jsx("a", { className: styles$2.link, href: child.value, target: child.target, children: getChildren(child.children) }, i);
105
- }
106
- return /* @__PURE__ */ jsxRuntime.jsx("span", { style: getLeafCss(child), children: child.text }, i);
107
- });
108
- };
109
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: content.map((block, i) => {
110
- const children = block.children;
111
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: getChildren(children) }, i);
112
- }) });
113
- };
114
- function getLeafCss(leaf) {
115
- return {
116
- ...leaf.fontFamily && { fontFamily: leaf.fontFamily },
117
- ...leaf.fontWeight && { fontWeight: leaf.fontWeight },
118
- ...leaf.fontStyle && { fontStyle: leaf.fontStyle },
119
- ...leaf.textDecoration && { textDecoration: leaf.textDecoration },
120
- ...leaf.textTransform && { textTransform: leaf.textTransform },
121
- ...leaf.fontVariant && { fontVariant: leaf.fontVariant },
122
- ...leaf.verticalAlign && {
123
- verticalAlign: leaf.verticalAlign,
124
- lineHeight: "0px"
125
- }
126
- };
127
- }
128
- function scalingValue(value, isEditor = false) {
129
- return isEditor ? `calc(var(--cntrl-article-width) * ${value})` : `${value * 100}vw`;
130
- }
131
- const svg = "SvgImage-module__svg___q3xE-";
132
- const img = "SvgImage-module__img___VsTm-";
133
- const styles$1 = {
134
- svg,
135
- img
136
- };
137
- const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = "" }) => {
138
- const [supportsMask, setSupportsMask] = react.useState(true);
139
- react.useEffect(() => {
140
- if (typeof window !== "undefined" && window.CSS) {
141
- const supported = CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")');
142
- setSupportsMask(supported);
143
- }
144
- }, []);
145
- if (!url.endsWith(".svg") || !supportsMask) {
146
- return /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: "", className: cn(styles$1.img, className) });
147
- }
148
- return /* @__PURE__ */ jsxRuntime.jsx(
149
- "span",
150
- {
151
- "data-supports-mask": supportsMask,
152
- className: cn(styles$1.svg, className),
153
- style: {
154
- "--svg": `url(${url})`,
155
- "--fill": fill,
156
- "--hover-fill": hoverFill
157
- }
158
- }
159
- );
160
- };
161
- const alignmentClassName = {
162
- "top-left": styles$3.topLeftAlignment,
163
- "top-center": styles$3.topCenterAlignment,
164
- "top-right": styles$3.topRightAlignment,
165
- "middle-left": styles$3.middleLeftAlignment,
166
- "middle-center": styles$3.middleCenterAlignment,
167
- "middle-right": styles$3.middleRightAlignment,
168
- "bottom-left": styles$3.bottomLeftAlignment,
169
- "bottom-center": styles$3.bottomCenterAlignment,
170
- "bottom-right": styles$3.bottomRightAlignment
171
- };
172
- function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
173
- const [sliderRef, setSliderRef] = react.useState(null);
174
- const { widthSettings, fontSettings, letterSpacing, textAlign, wordSpacing, fontSizeLineHeight, textAppearance, color } = sliderStyles.imageCaption;
175
- const [sliderDimensions, setSliderDimensions] = react.useState(void 0);
176
- const [wrapperRef, setWrapperRef] = react.useState(null);
177
- const [currentSlideIndex, setCurrentSlideIndex] = react.useState(0);
178
- const [key, setKey] = react.useState(0);
179
- const { direction, transition, controls, pagination: pagination2, imageCaption, triggers } = settings;
180
- const prevSliderTypeRef = react.useRef(transition.type);
181
- const { x: controlsOffsetX, y: controlsOffsetY } = settings.controls.offset;
182
- const handleArrowClick = (dir) => {
183
- if (sliderRef) {
184
- sliderRef.go(dir);
185
- }
186
- };
187
- react.useEffect(() => {
188
- if (!wrapperRef) return;
189
- const observer = new ResizeObserver((entries) => {
190
- if (!sliderRef) return;
191
- const [wrapper2] = entries;
192
- setSliderDimensions({
193
- width: Math.round(wrapper2.contentRect.width),
194
- height: Math.round(wrapper2.contentRect.height)
195
- });
196
- });
197
- observer.observe(wrapperRef);
198
- return () => observer.unobserve(wrapperRef);
199
- }, [wrapperRef]);
200
- react.useEffect(() => {
201
- if (!sliderRef || prevSliderTypeRef.current === transition.type) return;
202
- setKey((prev) => prev + 1);
203
- prevSliderTypeRef.current = transition.type;
204
- }, [transition.type]);
205
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(styles$3.wrapper, { [styles$3.editor]: isEditor }), ref: setWrapperRef, children: /* @__PURE__ */ jsxRuntime.jsxs(
206
- "div",
207
- {
208
- className: styles$3.sliderInner,
209
- style: {
210
- width: sliderDimensions ? sliderDimensions.width : "100%",
211
- height: sliderDimensions ? sliderDimensions.height : "100%",
212
- backgroundColor: transition.backgroundColor && transition.type === "fade in" ? transition.backgroundColor : "transparent"
213
- },
214
- children: [
215
- settings.imageCaption.isActive && /* @__PURE__ */ jsxRuntime.jsx(
216
- "div",
217
- {
218
- className: cn(styles$3.captionBlock),
219
- children: /* @__PURE__ */ jsxRuntime.jsx(
220
- "div",
221
- {
222
- className: styles$3.captionTextWrapper,
223
- children: content.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
224
- "div",
225
- {
226
- className: cn(styles$3.captionText, alignmentClassName[imageCaption.alignment], {
227
- [styles$3.withPointerEvents]: index === currentSlideIndex && isEditor,
228
- [styles$3.active]: index === currentSlideIndex
229
- }),
230
- style: {
231
- fontFamily: fontSettings.fontFamily,
232
- fontWeight: fontSettings.fontWeight,
233
- fontStyle: fontSettings.fontStyle,
234
- width: widthSettings.sizing === "auto" ? "max-content" : scalingValue(widthSettings.width, isEditor),
235
- letterSpacing: scalingValue(letterSpacing, isEditor),
236
- wordSpacing: scalingValue(wordSpacing, isEditor),
237
- textAlign,
238
- fontSize: scalingValue(fontSizeLineHeight.fontSize, isEditor),
239
- lineHeight: scalingValue(fontSizeLineHeight.lineHeight, isEditor),
240
- textTransform: textAppearance.textTransform ?? "none",
241
- textDecoration: textAppearance.textDecoration ?? "none",
242
- fontVariant: textAppearance.fontVariant ?? "normal",
243
- color,
244
- transitionDuration: transition.duration ? `${Math.round(parseInt(transition.duration) / 2)}ms` : "500ms"
245
- },
246
- children: /* @__PURE__ */ jsxRuntime.jsx(
247
- "div",
248
- {
249
- "data-styles": "imageCaption",
250
- className: styles$3.captionTextInner,
251
- style: {
252
- "--link-hover-color": imageCaption.hover,
253
- position: "relative",
254
- top: scalingValue(imageCaption.offset.y, isEditor),
255
- left: scalingValue(imageCaption.offset.x, isEditor)
256
- },
257
- children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: item.imageCaption })
258
- }
259
- )
260
- },
261
- index
262
- ))
263
- }
264
- )
265
- }
266
- ),
267
- /* @__PURE__ */ jsxRuntime.jsx(
268
- reactSplide.Splide,
269
- {
270
- onMove: (e) => {
271
- setCurrentSlideIndex(e.index);
272
- },
273
- ref: setSliderRef,
274
- options: {
275
- arrows: false,
276
- speed: transition.duration ? parseInt(transition.duration) : 500,
277
- autoplay: triggers.autoPlay !== null,
278
- ...triggers.autoPlay !== null && {
279
- interval: parseInt(triggers.autoPlay) * 1e3
280
- },
281
- direction: direction === "horiz" || transition.type === "fade in" ? "ltr" : "ttb",
282
- pagination: false,
283
- drag: triggers.triggersList.drag,
284
- perPage: 1,
285
- width: sliderDimensions ? sliderDimensions.width : "100%",
286
- height: sliderDimensions ? sliderDimensions.height : "100%",
287
- type: transition.type === "fade in" ? "fade" : "loop",
288
- rewind: true
289
- },
290
- children: content.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsx(
291
- "div",
292
- {
293
- className: styles$3.sliderItem,
294
- children: /* @__PURE__ */ jsxRuntime.jsx(
295
- "div",
296
- {
297
- className: styles$3.imgWrapper,
298
- children: /* @__PURE__ */ jsxRuntime.jsx(
299
- "img",
300
- {
301
- className: cn(styles$3.sliderImage, {
302
- [styles$3.contain]: item.image.objectFit === "contain",
303
- [styles$3.cover]: item.image.objectFit === "cover"
304
- }),
305
- src: item.image.url,
306
- alt: item.image.name ?? ""
307
- }
308
- )
309
- }
310
- )
311
- }
312
- ) }, index))
313
- },
314
- key
315
- ),
316
- controls.isActive && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
317
- /* @__PURE__ */ jsxRuntime.jsx(
318
- "div",
319
- {
320
- className: cn(styles$3.arrow, {
321
- [styles$3.arrowVertical]: direction === "vert",
322
- [styles$3.hoverArrow]: controls.show === "on hover"
323
- }),
324
- style: {
325
- color: controls.color,
326
- ["--arrow-hover-color"]: controls.hover
327
- },
328
- children: /* @__PURE__ */ jsxRuntime.jsxs(
329
- "button",
330
- {
331
- onClick: () => {
332
- handleArrowClick("-1");
333
- },
334
- className: styles$3.arrowInner,
335
- style: {
336
- transform: `translate(${scalingValue(controlsOffsetX, isEditor)}, ${scalingValue(controlsOffsetY * (direction === "horiz" ? 1 : -1), isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
337
- },
338
- children: [
339
- controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
340
- SvgImage,
341
- {
342
- url: controls.arrowsImgUrl,
343
- fill: controls.color,
344
- hoverFill: controls.hover,
345
- className: cn(styles$3.arrowImg, styles$3.mirror)
346
- }
347
- ),
348
- !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon$1, { color: controls.color, className: cn(styles$3.arrowIcon, styles$3.arrowImg, styles$3.mirror) })
349
- ]
350
- }
351
- )
352
- }
353
- ),
354
- /* @__PURE__ */ jsxRuntime.jsx(
355
- "div",
356
- {
357
- className: cn(styles$3.arrow, styles$3.nextArrow, {
358
- [styles$3.arrowVertical]: direction === "vert",
359
- [styles$3.hoverArrow]: controls.show === "on hover"
360
- }),
361
- style: {
362
- color: controls.color,
363
- ["--arrow-hover-color"]: controls.hover
364
- },
365
- children: /* @__PURE__ */ jsxRuntime.jsxs(
366
- "button",
367
- {
368
- className: styles$3.arrowInner,
369
- onClick: () => handleArrowClick("+1"),
370
- style: {
371
- transform: `translate(${scalingValue(controlsOffsetX * (direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controlsOffsetY, isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
372
- },
373
- children: [
374
- controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
375
- SvgImage,
376
- {
377
- url: controls.arrowsImgUrl,
378
- fill: controls.color,
379
- hoverFill: controls.hover,
380
- className: styles$3.arrowImg
381
- }
382
- ),
383
- !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon$1, { color: controls.color, className: cn(styles$3.arrowIcon, styles$3.arrowImg) })
384
- ]
385
- }
386
- )
387
- }
388
- )
389
- ] }),
390
- triggers.triggersList.click && /* @__PURE__ */ jsxRuntime.jsx(
391
- "div",
392
- {
393
- className: styles$3.clickOverlay,
394
- onClick: () => {
395
- if (sliderRef) {
396
- sliderRef.go("+1");
397
- }
398
- }
399
- }
400
- ),
401
- pagination2.isActive && /* @__PURE__ */ jsxRuntime.jsx(
402
- "div",
403
- {
404
- className: cn(styles$3.pagination, {
405
- [styles$3.paginationInsideBottom]: pagination2.position === "inside-1" && direction === "horiz",
406
- [styles$3.paginationInsideTop]: pagination2.position === "inside-2" && direction === "horiz",
407
- [styles$3.paginationOutsideBottom]: pagination2.position === "outside-1" && direction === "horiz",
408
- [styles$3.paginationOutsideTop]: pagination2.position === "outside-2" && direction === "horiz",
409
- [styles$3.paginationInsideLeft]: pagination2.position === "inside-1" && direction === "vert",
410
- [styles$3.paginationInsideRight]: pagination2.position === "inside-2" && direction === "vert",
411
- [styles$3.paginationOutsideLeft]: pagination2.position === "outside-1" && direction === "vert",
412
- [styles$3.paginationOutsideRight]: pagination2.position === "outside-2" && direction === "vert",
413
- [styles$3.paginationVertical]: direction === "vert"
414
- }),
415
- children: /* @__PURE__ */ jsxRuntime.jsx(
416
- "div",
417
- {
418
- className: styles$3.paginationInner,
419
- style: {
420
- backgroundColor: pagination2.colors[2],
421
- transform: `scale(${pagination2.scale / 100}) translate(${scalingValue(pagination2.offset.x, isEditor)}, ${scalingValue(pagination2.offset.y, isEditor)}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
422
- },
423
- children: content.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
424
- "button",
425
- {
426
- onClick: () => {
427
- if (sliderRef) {
428
- sliderRef.go(index);
429
- }
430
- },
431
- className: cn(styles$3.paginationItem),
432
- children: /* @__PURE__ */ jsxRuntime.jsx(
433
- "div",
434
- {
435
- className: cn(styles$3.dot, {
436
- [styles$3.activeDot]: index === currentSlideIndex
437
- }),
438
- style: {
439
- backgroundColor: index === currentSlideIndex ? pagination2.colors[0] : pagination2.colors[1],
440
- ["--pagination-hover-color"]: pagination2.hover
441
- }
442
- }
443
- )
444
- },
445
- index
446
- ))
447
- }
448
- )
449
- }
450
- )
451
- ]
452
- }
453
- ) });
454
- }
455
- function ArrowIcon$1({ color, className }) {
456
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("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: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
457
- }
458
- const ControlSliderComponent = {
459
- element: ControlSlider,
460
- id: "control-slider",
461
- name: "Slider",
462
- preview: {
463
- type: "video",
464
- url: "https://cdn.cntrl.site/component-assets/Control-slider-preview.mp4"
465
- },
466
- defaultSize: {
467
- width: 400,
468
- height: 400
469
- },
470
- schema: {
471
- type: "object",
472
- properties: {
473
- settings: {
474
- layoutBased: true,
475
- type: "object",
476
- display: {
477
- type: "settings-block"
478
- },
479
- properties: {
480
- triggers: {
481
- title: "triggers",
482
- icon: "target",
483
- tooltip: "Triggers",
484
- type: "object",
485
- properties: {
486
- triggersList: {
487
- type: "object",
488
- display: {
489
- type: "toggle-ratio-group"
490
- },
491
- properties: {
492
- click: {
493
- type: "boolean"
494
- },
495
- drag: {
496
- type: "boolean"
497
- }
498
- }
499
- },
500
- autoPlay: {
501
- type: ["string", "null"],
502
- label: "Auto",
503
- display: {
504
- type: "step-selector"
505
- },
506
- enum: [null, "1s", "2s", "3s", "4s", "5s"]
507
- }
508
- }
509
- },
510
- direction: {
511
- icon: "horizontal-resize",
512
- tooltip: "Direction",
513
- type: "string",
514
- display: {
515
- type: "ratio-group"
516
- },
517
- enum: ["horiz", "vert"]
518
- },
519
- transition: {
520
- title: "transit",
521
- icon: "transition",
522
- tooltip: "Transition",
523
- type: "object",
524
- properties: {
525
- type: {
526
- type: "string",
527
- display: {
528
- type: "ratio-group"
529
- },
530
- enum: ["slide", "fade in"]
531
- },
532
- backgroundColor: {
533
- type: ["string", "null"],
534
- title: "BG Color",
535
- display: {
536
- visible: false,
537
- type: "settings-color-picker",
538
- format: "single"
539
- }
540
- },
541
- duration: {
542
- type: "string",
543
- label: "icon:hourglass",
544
- display: {
545
- type: "step-selector"
546
- },
547
- enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
548
- }
549
- }
550
- },
551
- controls: {
552
- title: "controls",
553
- icon: "controls",
554
- tooltip: "Controls",
555
- type: "object",
556
- properties: {
557
- isActive: {
558
- type: "boolean",
559
- display: {
560
- type: "setting-toggle"
561
- }
562
- },
563
- arrowsImgUrl: {
564
- type: ["string", "null"],
565
- display: {
566
- type: "settings-image-input"
567
- }
568
- },
569
- offset: {
570
- type: "object",
571
- title: "Offset",
572
- display: {
573
- type: "group"
574
- },
575
- properties: {
576
- x: {
577
- type: "number",
578
- label: "X",
579
- scalingEnabled: true,
580
- display: {
581
- type: "numeric-input",
582
- visible: true
583
- }
584
- },
585
- y: {
586
- type: "number",
587
- label: "Y",
588
- scalingEnabled: true,
589
- display: {
590
- type: "numeric-input",
591
- visible: true
592
- }
593
- }
594
- }
595
- },
596
- scale: {
597
- type: "number",
598
- title: "scale",
599
- min: 50,
600
- max: 600,
601
- display: {
602
- type: "range-control"
603
- }
604
- },
605
- color: {
606
- title: "color",
607
- type: "string",
608
- display: {
609
- type: "settings-color-picker",
610
- format: "single"
611
- }
612
- },
613
- hover: {
614
- title: "hover",
615
- type: "string",
616
- display: {
617
- type: "settings-color-picker",
618
- format: "single"
619
- }
620
- },
621
- show: {
622
- title: "Show",
623
- type: "string",
624
- display: {
625
- type: "ratio-group"
626
- },
627
- enum: ["always", "on hover"]
628
- }
629
- }
630
- },
631
- pagination: {
632
- title: "nav",
633
- icon: "pagination",
634
- tooltip: "Navigation",
635
- type: "object",
636
- properties: {
637
- isActive: {
638
- type: "boolean",
639
- display: {
640
- type: "setting-toggle"
641
- }
642
- },
643
- position: {
644
- display: {
645
- type: "socket",
646
- direction: "horizontal"
647
- },
648
- type: "string",
649
- enum: ["outside-1", "outside-2", "inside-1", "inside-2"]
650
- },
651
- offset: {
652
- type: "object",
653
- title: "Offset",
654
- display: {
655
- type: "group"
656
- },
657
- properties: {
658
- x: {
659
- type: "number",
660
- label: "X",
661
- scalingEnabled: true,
662
- display: {
663
- type: "numeric-input",
664
- visible: true
665
- }
666
- },
667
- y: {
668
- type: "number",
669
- label: "Y",
670
- scalingEnabled: true,
671
- display: {
672
- type: "numeric-input",
673
- visible: true
674
- }
675
- }
676
- }
677
- },
678
- scale: {
679
- type: "number",
680
- title: "scale",
681
- min: 10,
682
- max: 400,
683
- display: {
684
- type: "range-control"
685
- }
686
- },
687
- colors: {
688
- display: {
689
- type: "settings-color-picker",
690
- format: "multiple"
691
- },
692
- title: "color",
693
- type: "array",
694
- items: {
695
- type: "string"
696
- }
697
- },
698
- hover: {
699
- title: "hover",
700
- type: "string",
701
- display: {
702
- type: "settings-color-picker",
703
- format: "single"
704
- }
705
- }
706
- }
707
- },
708
- imageCaption: {
709
- title: "Caption",
710
- icon: "text-icon",
711
- tooltip: "Caption",
712
- type: "object",
713
- properties: {
714
- isActive: {
715
- type: "boolean",
716
- display: {
717
- type: "setting-toggle"
718
- }
719
- },
720
- alignment: {
721
- type: "string",
722
- display: {
723
- type: "align-grid"
724
- },
725
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
726
- },
727
- offset: {
728
- type: "object",
729
- title: "Offset",
730
- display: {
731
- type: "group"
732
- },
733
- properties: {
734
- x: {
735
- type: "number",
736
- label: "X",
737
- scalingEnabled: true,
738
- display: {
739
- type: "numeric-input",
740
- visible: true
741
- }
742
- },
743
- y: {
744
- type: "number",
745
- label: "Y",
746
- scalingEnabled: true,
747
- display: {
748
- type: "numeric-input",
749
- visible: true
750
- }
751
- }
752
- }
753
- },
754
- hover: {
755
- title: "Link Hover",
756
- type: "string",
757
- display: {
758
- type: "settings-color-picker",
759
- format: "single"
760
- }
761
- }
762
- }
763
- }
764
- },
765
- default: {
766
- triggers: {
767
- triggersList: {
768
- click: false,
769
- drag: true
770
- },
771
- autoPlay: null
772
- },
773
- controls: {
774
- isActive: true,
775
- arrowsImgUrl: null,
776
- offset: {
777
- x: 0,
778
- y: 0
779
- },
780
- scale: 100,
781
- color: "#000000",
782
- hover: "#cccccc",
783
- show: "always"
784
- },
785
- transition: {
786
- type: "slide",
787
- duration: "500ms",
788
- backgroundColor: null
789
- },
790
- pagination: {
791
- isActive: true,
792
- scale: 50,
793
- position: "outside-1",
794
- offset: {
795
- x: 0,
796
- y: 0
797
- },
798
- colors: ["#cccccc", "#cccccc", "#000000"],
799
- hover: "#cccccc"
800
- },
801
- direction: "horiz",
802
- imageCaption: {
803
- offset: {
804
- x: 0,
805
- y: 0
806
- },
807
- isActive: true,
808
- alignment: "middle-center",
809
- hover: "#cccccc"
810
- }
811
- },
812
- displayRules: [
813
- {
814
- if: {
815
- name: "direction",
816
- value: "vert"
817
- },
818
- then: {
819
- name: "properties.pagination.properties.position.display.direction",
820
- value: "vertical"
821
- }
822
- },
823
- {
824
- if: {
825
- name: "transition.type",
826
- value: "fade in"
827
- },
828
- then: {
829
- name: "properties.transition.properties.backgroundColor.display.visible",
830
- value: true
831
- }
832
- }
833
- ]
834
- },
835
- content: {
836
- layoutBased: false,
837
- type: "array",
838
- settings: {
839
- addItemFromFileExplorer: true,
840
- defaultWidth: 500
841
- },
842
- items: {
843
- type: "object",
844
- properties: {
845
- image: {
846
- type: "object",
847
- label: "Image",
848
- display: {
849
- minWidth: 58,
850
- maxWidth: 108,
851
- type: "media-input"
852
- },
853
- properties: {
854
- url: {
855
- type: "string"
856
- },
857
- name: {
858
- type: "string"
859
- },
860
- objectFit: {
861
- type: "string",
862
- enum: ["cover", "contain"]
863
- }
864
- },
865
- required: ["url", "name"]
866
- },
867
- imageCaption: {
868
- placeholder: "Add Caption...",
869
- label: "Description",
870
- display: {
871
- type: "rich-text",
872
- minWidth: 300,
873
- maxWidth: 550
874
- }
875
- }
876
- },
877
- required: ["image"]
878
- },
879
- default: [
880
- {
881
- image: {
882
- objectFit: "cover",
883
- url: "https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",
884
- name: "Slider-1.png"
885
- },
886
- imageCaption: [
887
- {
888
- type: "paragraph",
889
- children: [{ text: "" }]
890
- }
891
- ]
892
- },
893
- {
894
- image: {
895
- objectFit: "cover",
896
- url: "https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",
897
- name: "Slider-2.png"
898
- },
899
- imageCaption: [
900
- {
901
- type: "paragraph",
902
- children: [{ text: "" }]
903
- }
904
- ]
905
- },
906
- {
907
- image: {
908
- objectFit: "cover",
909
- url: "https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",
910
- name: "Slider-3.png"
911
- },
912
- imageCaption: [
913
- {
914
- type: "paragraph",
915
- children: [{ text: "" }]
916
- }
917
- ]
918
- }
919
- ]
920
- },
921
- styles: {
922
- layoutBased: true,
923
- type: "object",
924
- properties: {
925
- imageCaption: {
926
- dataName: "caption",
927
- type: "object",
928
- properties: {
929
- fontSettings: {
930
- type: "object",
931
- display: {
932
- type: "font-settings"
933
- },
934
- properties: {
935
- fontFamily: {
936
- type: "string"
937
- },
938
- fontWeight: {
939
- type: "number"
940
- },
941
- fontStyle: {
942
- type: "string"
943
- }
944
- }
945
- },
946
- widthSettings: {
947
- display: {
948
- type: "text-width-control"
949
- },
950
- type: "object",
951
- properties: {
952
- width: {
953
- type: "number"
954
- },
955
- sizing: {
956
- type: "string",
957
- enum: ["auto", "manual"]
958
- }
959
- }
960
- },
961
- fontSizeLineHeight: {
962
- type: "object",
963
- display: {
964
- type: "font-size-line-height"
965
- },
966
- properties: {
967
- fontSize: {
968
- type: "number"
969
- },
970
- lineHeight: {
971
- type: "number"
972
- }
973
- }
974
- },
975
- letterSpacing: {
976
- display: {
977
- type: "letter-spacing-input"
978
- },
979
- type: "number"
980
- },
981
- wordSpacing: {
982
- display: {
983
- type: "word-spacing-input"
984
- },
985
- type: "number"
986
- },
987
- textAlign: {
988
- display: {
989
- type: "text-align-control"
990
- },
991
- type: "string",
992
- enum: ["left", "center", "right", "justify"]
993
- },
994
- textAppearance: {
995
- display: {
996
- type: "text-appearance"
997
- },
998
- properties: {
999
- textTransform: {
1000
- type: "string",
1001
- enum: ["none", "uppercase", "lowercase", "capitalize"]
1002
- },
1003
- textDecoration: {
1004
- type: "string",
1005
- enum: ["none", "underline"]
1006
- },
1007
- fontVariant: {
1008
- type: "string",
1009
- enum: ["normal", "small-caps"]
1010
- }
1011
- }
1012
- },
1013
- color: {
1014
- display: {
1015
- type: "style-panel-color-picker"
1016
- },
1017
- type: "string"
1018
- }
1019
- }
1020
- }
1021
- },
1022
- default: {
1023
- imageCaption: {
1024
- widthSettings: {
1025
- width: 0.13,
1026
- sizing: "auto"
1027
- },
1028
- fontSettings: {
1029
- fontFamily: "Arial",
1030
- fontWeight: 400,
1031
- fontStyle: "normal"
1032
- },
1033
- fontSizeLineHeight: {
1034
- fontSize: 0.02,
1035
- lineHeight: 0.02
1036
- },
1037
- letterSpacing: 0,
1038
- wordSpacing: 0,
1039
- textAlign: "left",
1040
- textAppearance: {
1041
- textTransform: "none",
1042
- textDecoration: "none",
1043
- fontVariant: "normal"
1044
- },
1045
- color: "#000000"
1046
- }
1047
- }
1048
- }
1049
- },
1050
- required: ["settings", "content", "styles"]
1051
- }
1052
- };
1053
- const imageRevealSlider = "ImageRevealSlider-module__imageRevealSlider___UE5Ob";
1054
- const image = "ImageRevealSlider-module__image___Qjt-e";
1055
- const link = "ImageRevealSlider-module__link___N-iLG";
1056
- const cursor = "ImageRevealSlider-module__cursor___2U03d";
1057
- const styles = {
1058
- imageRevealSlider,
1059
- image,
1060
- link,
1061
- cursor
1062
- };
1063
- function isMouseOverImage(mouseX, mouseY, placedImages) {
1064
- for (const img2 of placedImages) {
1065
- const imgEl = new Image();
1066
- imgEl.src = img2.url;
1067
- const imgWidth = img2.width ? Number.parseFloat(img2.width) : imgEl.naturalWidth;
1068
- const imgHeight = imgEl.naturalHeight / imgEl.naturalWidth * imgWidth;
1069
- const halfW = imgWidth / 2;
1070
- const halfH = imgHeight / 2;
1071
- if (mouseX >= img2.x - halfW && mouseX <= img2.x + halfW && mouseY >= img2.y - halfH && mouseY <= img2.y + halfH) {
1072
- return true;
1073
- }
1074
- }
1075
- return false;
1076
- }
1077
- function getImageSize(url) {
1078
- return new Promise((resolve) => {
1079
- const img2 = new Image();
1080
- img2.src = url;
1081
- img2.onload = () => {
1082
- resolve({ width: img2.naturalWidth, height: img2.naturalHeight });
1083
- };
1084
- });
1085
- }
1086
- async function calculateImageWidthHeight(imgUrl, sizeType, customWidth, randomRange) {
1087
- let width;
1088
- let height;
1089
- if (sizeType === "custom") {
1090
- width = customWidth;
1091
- const size = await getImageSize(imgUrl);
1092
- height = size.height / size.width * width;
1093
- } else if (sizeType === "random") {
1094
- width = Math.random() * (randomRange.max - randomRange.min) + randomRange.min;
1095
- const size = await getImageSize(imgUrl);
1096
- height = size.height / size.width * width;
1097
- } else {
1098
- const size = await getImageSize(imgUrl);
1099
- width = size.width;
1100
- height = size.height;
1101
- }
1102
- return { width, height, finalWidth: `${width}px` };
1103
- }
1104
- function ImageRevealSlider({ settings, content, isEditor }) {
1105
- const [divRef, setDivRef] = react.useState(null);
1106
- const [placedImages, setPlacedImages] = react.useState([]);
1107
- const [counter, setCounter] = react.useState(0);
1108
- const imageIdCounter = react.useRef(0);
1109
- const [cursorCenter, setCursorCenter] = react.useState({ x: 0, y: 0 });
1110
- const [cursorScale, setCursorScale] = react.useState(1);
1111
- const [customCursorImg, setCustomCursorImg] = react.useState("none");
1112
- const lastMousePos = react.useRef({ x: 0, y: 0 });
1113
- const [isInside, setIsInside] = react.useState(false);
1114
- const { sizeType, imageWidth: customWidth, randomRangeImageWidth: randomRange } = settings.imageSize;
1115
- const { revealPosition, visible } = settings.position;
1116
- const { cursorType, target, defaultCursorScale, defaultCursor, hoverCursorScale, hoverCursor } = settings.cursor;
1117
- react.useEffect(() => {
1118
- if (!divRef) return;
1119
- const updateCursorPosition = (clientX, clientY) => {
1120
- const rect = divRef.getBoundingClientRect();
1121
- const x = clientX - rect.left;
1122
- const y = clientY - rect.top;
1123
- setCursorCenter({ x, y });
1124
- if (cursorType === "system") {
1125
- setCustomCursorImg("none");
1126
- setCursorScale(1);
1127
- return;
1128
- }
1129
- const cx = x;
1130
- const cy = y;
1131
- const el = document.elementFromPoint(rect.left + cx, rect.top + cy);
1132
- if (el && el.closest("a")) {
1133
- setCustomCursorImg("none");
1134
- setCursorScale(1);
1135
- return;
1136
- }
1137
- const next = isMouseOverImage(cx, cy, placedImages) || target === "area" ? { img: hoverCursor ?? "none", scale: hoverCursorScale } : { img: defaultCursor ?? "none", scale: defaultCursorScale };
1138
- setCustomCursorImg(next.img);
1139
- setCursorScale(next.scale);
1140
- };
1141
- const mouseMove = (e) => {
1142
- e.stopPropagation();
1143
- lastMousePos.current = { x: e.clientX, y: e.clientY };
1144
- updateCursorPosition(e.clientX, e.clientY);
1145
- };
1146
- const handleScroll = () => {
1147
- if (!isInside) return;
1148
- updateCursorPosition(lastMousePos.current.x, lastMousePos.current.y);
1149
- };
1150
- divRef.addEventListener("mousemove", mouseMove);
1151
- window.addEventListener("scroll", handleScroll, true);
1152
- return () => {
1153
- divRef.removeEventListener("mousemove", mouseMove);
1154
- window.removeEventListener("scroll", handleScroll, true);
1155
- };
1156
- }, [
1157
- divRef,
1158
- isInside,
1159
- cursorCenter,
1160
- cursorType,
1161
- target,
1162
- hoverCursor,
1163
- defaultCursor,
1164
- hoverCursorScale,
1165
- defaultCursorScale,
1166
- placedImages
1167
- ]);
1168
- react.useEffect(() => {
1169
- if (!isInside) {
1170
- setCustomCursorImg("none");
1171
- setCursorScale(0);
1172
- }
1173
- }, [isInside]);
1174
- const createNewImage = async (imgData, containerWidth, containerHeight, position = {}) => {
1175
- const { width, height, finalWidth } = await calculateImageWidthHeight(
1176
- imgData.image.url,
1177
- sizeType,
1178
- customWidth,
1179
- randomRange
1180
- );
1181
- let x = 0, y = 0;
1182
- if (revealPosition === "same") {
1183
- x = containerWidth / 2;
1184
- y = containerHeight / 2;
1185
- } else {
1186
- x = position.x ?? Math.random() * containerWidth;
1187
- y = position.y ?? Math.random() * containerHeight;
1188
- }
1189
- const adjustedX = Math.min(Math.max(x, width / 2), containerWidth - width / 2);
1190
- const adjustedY = Math.min(Math.max(y, height / 2), containerHeight - height / 2);
1191
- return {
1192
- id: imageIdCounter.current++,
1193
- url: imgData.image.url,
1194
- link: imgData.link,
1195
- name: imgData.image.name,
1196
- x: adjustedX,
1197
- y: adjustedY,
1198
- width: finalWidth
1199
- };
1200
- };
1201
- react.useEffect(() => {
1202
- if (!divRef || content.length === 0) return;
1203
- const rect = divRef.getBoundingClientRect();
1204
- const containerWidth = rect.width;
1205
- const containerHeight = rect.height;
1206
- const defaultPlaced = [];
1207
- const placeImages = async () => {
1208
- const imgData = content[0];
1209
- const newImg = await createNewImage(imgData, containerWidth, containerHeight);
1210
- defaultPlaced.push(newImg);
1211
- setPlacedImages(defaultPlaced);
1212
- setCounter(1);
1213
- };
1214
- placeImages();
1215
- }, [sizeType, customWidth, randomRange, revealPosition, divRef]);
1216
- react.useEffect(() => {
1217
- if (visible === "last One") {
1218
- setPlacedImages((prev) => prev.length > 0 ? [prev[prev.length - 1]] : []);
1219
- }
1220
- }, [visible]);
1221
- const handleClick = async (e) => {
1222
- if (!divRef) return;
1223
- const rect = divRef.getBoundingClientRect();
1224
- const clickX = e.clientX - rect.left;
1225
- const clickY = e.clientY - rect.top;
1226
- if (target === "image" && !isMouseOverImage(clickX, clickY, placedImages)) return;
1227
- let x = 0, y = 0;
1228
- if (revealPosition === "on Click") {
1229
- x = clickX;
1230
- y = clickY;
1231
- } else if (revealPosition === "same") {
1232
- x = rect.width / 2;
1233
- y = rect.height / 2;
1234
- } else {
1235
- x = Math.random() * rect.width;
1236
- y = Math.random() * rect.height;
1237
- }
1238
- const imgData = content[counter];
1239
- const newImage = await createNewImage(imgData, rect.width, rect.height, { x, y });
1240
- setPlacedImages((prev) => visible === "all" ? [...prev, newImage] : [newImage]);
1241
- setCounter((prev) => prev >= content.length - 1 ? 0 : prev + 1);
1242
- };
1243
- return /* @__PURE__ */ jsxRuntime.jsxs(
1244
- "div",
1245
- {
1246
- ref: setDivRef,
1247
- onClick: handleClick,
1248
- onMouseEnter: () => setIsInside(true),
1249
- onMouseLeave: () => setIsInside(false),
1250
- className: styles.imageRevealSlider,
1251
- style: { cursor: customCursorImg === "none" ? "default" : "none" },
1252
- children: [
1253
- placedImages.map((img2) => /* @__PURE__ */ jsxRuntime.jsx(
1254
- "div",
1255
- {
1256
- className: styles.wrapper,
1257
- style: {
1258
- top: `${img2.y}px`,
1259
- left: `${img2.x}px`,
1260
- position: "absolute",
1261
- transform: "translate(-50%, -50%)",
1262
- width: img2.width ?? "auto",
1263
- height: "auto",
1264
- cursor: customCursorImg === "none" ? "default" : "none"
1265
- },
1266
- children: target === "area" && img2.link ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsxRuntime.jsx(
1267
- "img",
1268
- {
1269
- src: img2.url,
1270
- alt: img2.name,
1271
- className: styles.image
1272
- },
1273
- img2.id
1274
- ) }) : /* @__PURE__ */ jsxRuntime.jsx(
1275
- "img",
1276
- {
1277
- src: img2.url,
1278
- alt: img2.name,
1279
- className: styles.image
1280
- },
1281
- img2.id
1282
- )
1283
- },
1284
- img2.id
1285
- )),
1286
- isInside && /* @__PURE__ */ jsxRuntime.jsx(
1287
- "div",
1288
- {
1289
- className: styles.cursor,
1290
- style: {
1291
- left: `${cursorCenter.x}px`,
1292
- top: `${cursorCenter.y}px`,
1293
- transform: `translate(-50%, -50%) scale(${cursorScale})`,
1294
- backgroundImage: `url('${customCursorImg}')`,
1295
- backgroundSize: "cover",
1296
- backgroundPosition: "center",
1297
- position: "absolute",
1298
- pointerEvents: "none"
1299
- }
1300
- }
1301
- )
1302
- ]
1303
- }
1304
- );
1305
- }
1306
- const ControlImageRevealSliderComponent = {
1307
- element: ImageRevealSlider,
1308
- id: "control-image-reveal",
1309
- name: "Click Gallery",
1310
- preview: {
1311
- type: "video",
1312
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"
1313
- },
1314
- defaultSize: {
1315
- width: "100%",
1316
- height: "100%"
1317
- },
1318
- schema: {
1319
- type: "object",
1320
- properties: {
1321
- settings: {
1322
- layoutBased: true,
1323
- type: "object",
1324
- display: {
1325
- type: "settings-block"
1326
- },
1327
- properties: {
1328
- imageSize: {
1329
- title: "IMG SIZE",
1330
- icon: "size",
1331
- tooltip: "IMG SIZE",
1332
- type: "object",
1333
- properties: {
1334
- sizeType: {
1335
- type: "string",
1336
- display: {
1337
- type: "ratio-group"
1338
- },
1339
- enum: ["as Is", "custom", "random"]
1340
- },
1341
- imageWidth: {
1342
- type: "number",
1343
- label: "W",
1344
- display: {
1345
- type: "numeric-input",
1346
- visible: false
1347
- }
1348
- },
1349
- randomRangeImageWidth: {
1350
- type: "object",
1351
- display: {
1352
- type: "random-range-controls",
1353
- visible: false
1354
- },
1355
- properties: {
1356
- min: {
1357
- type: "number"
1358
- },
1359
- max: {
1360
- type: "number"
1361
- }
1362
- }
1363
- }
1364
- }
1365
- },
1366
- cursor: {
1367
- title: "cursor",
1368
- icon: "cursor",
1369
- tooltip: "cursor",
1370
- type: "object",
1371
- properties: {
1372
- cursorType: {
1373
- type: "string",
1374
- display: {
1375
- type: "ratio-group"
1376
- },
1377
- enum: ["system", "custom"]
1378
- },
1379
- target: {
1380
- type: "string",
1381
- title: "Target",
1382
- display: {
1383
- type: "ratio-group"
1384
- },
1385
- enum: ["area", "image"]
1386
- },
1387
- defaultCursor: {
1388
- type: ["string", "null"],
1389
- title: "Default",
1390
- display: {
1391
- type: "settings-image-input",
1392
- visible: false
1393
- }
1394
- },
1395
- defaultCursorScale: {
1396
- type: "number",
1397
- title: "Scale",
1398
- min: 1,
1399
- max: 5,
1400
- step: 0.1,
1401
- display: {
1402
- type: "range-control",
1403
- visible: false
1404
- }
1405
- },
1406
- hoverCursor: {
1407
- type: ["string", "null"],
1408
- title: "Hover",
1409
- display: {
1410
- type: "settings-image-input",
1411
- visible: false
1412
- }
1413
- },
1414
- hoverCursorScale: {
1415
- type: "number",
1416
- title: "Scale",
1417
- min: 1,
1418
- max: 5,
1419
- step: 0.1,
1420
- display: {
1421
- type: "range-control",
1422
- visible: false
1423
- }
1424
- }
1425
- }
1426
- },
1427
- position: {
1428
- title: "position",
1429
- icon: "transition",
1430
- tooltip: "Position",
1431
- type: "object",
1432
- properties: {
1433
- revealPosition: {
1434
- type: "string",
1435
- display: {
1436
- type: "ratio-group"
1437
- },
1438
- enum: ["random", "same", "on Click"]
1439
- },
1440
- visible: {
1441
- type: "string",
1442
- title: "Visible",
1443
- display: {
1444
- type: "ratio-group"
1445
- },
1446
- enum: ["all", "last One"]
1447
- }
1448
- }
1449
- }
1450
- },
1451
- default: {
1452
- imageSize: {
1453
- sizeType: "custom",
1454
- imageWidth: 500,
1455
- randomRangeImageWidth: {
1456
- min: 100,
1457
- max: 1e3
1458
- }
1459
- },
1460
- cursor: {
1461
- cursorType: "system",
1462
- target: "area",
1463
- defaultCursor: null,
1464
- defaultCursorScale: 2,
1465
- hoverCursor: null,
1466
- hoverCursorScale: 2
1467
- },
1468
- position: {
1469
- revealPosition: "random",
1470
- visible: "all"
1471
- }
1472
- },
1473
- displayRules: [
1474
- {
1475
- if: {
1476
- name: "imageSize.sizeType",
1477
- value: "custom"
1478
- },
1479
- then: {
1480
- name: "properties.imageSize.properties.imageWidth.display.visible",
1481
- value: true
1482
- }
1483
- },
1484
- {
1485
- if: {
1486
- name: "imageSize.sizeType",
1487
- value: "random"
1488
- },
1489
- then: {
1490
- name: "properties.imageSize.properties.randomRangeImageWidth.display.visible",
1491
- value: true
1492
- }
1493
- },
1494
- {
1495
- if: [
1496
- { name: "cursor.target", value: "image" },
1497
- { name: "cursor.cursorType", value: "custom" }
1498
- ],
1499
- then: {
1500
- name: "properties.cursor.properties.defaultCursor.display.visible",
1501
- value: true
1502
- }
1503
- },
1504
- {
1505
- if: [
1506
- { name: "cursor.target", value: "image" },
1507
- { name: "cursor.cursorType", value: "custom" },
1508
- { name: "cursor.defaultCursor", value: null, isNotEqual: true }
1509
- ],
1510
- then: {
1511
- name: "properties.cursor.properties.defaultCursorScale.display.visible",
1512
- value: true
1513
- }
1514
- },
1515
- {
1516
- if: {
1517
- name: "cursor.cursorType",
1518
- value: "custom"
1519
- },
1520
- then: {
1521
- name: "properties.cursor.properties.hoverCursor.display.visible",
1522
- value: true
1523
- }
1524
- },
1525
- {
1526
- if: [
1527
- { name: "cursor.cursorType", value: "custom" },
1528
- { name: "cursor.hoverCursor", value: null, isNotEqual: true }
1529
- ],
1530
- then: {
1531
- name: "properties.cursor.properties.hoverCursorScale.display.visible",
1532
- value: true
1533
- }
1534
- }
1535
- ]
1536
- },
1537
- content: {
1538
- layoutBased: false,
1539
- type: "array",
1540
- settings: {
1541
- addItemFromFileExplorer: true,
1542
- defaultWidth: 500
1543
- },
1544
- items: {
1545
- type: "object",
1546
- properties: {
1547
- image: {
1548
- type: "object",
1549
- label: "Image",
1550
- display: {
1551
- isObjectFitEditable: false,
1552
- minWidth: 58,
1553
- maxWidth: 108,
1554
- type: "media-input"
1555
- },
1556
- properties: {
1557
- url: {
1558
- type: "string"
1559
- },
1560
- name: {
1561
- type: "string"
1562
- },
1563
- objectFit: {
1564
- type: "string",
1565
- enum: ["cover", "contain"]
1566
- }
1567
- },
1568
- required: ["url", "name"]
1569
- },
1570
- link: {
1571
- label: "URL",
1572
- placeholder: "Enter link...",
1573
- display: {
1574
- type: "text-input",
1575
- minWidth: 300,
1576
- maxWidth: 550
1577
- }
1578
- }
1579
- },
1580
- required: ["image"]
1581
- },
1582
- default: [
1583
- {
1584
- image: {
1585
- objectFit: "cover",
1586
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",
1587
- name: "Slider-1.png"
1588
- },
1589
- link: ""
1590
- },
1591
- {
1592
- image: {
1593
- objectFit: "cover",
1594
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",
1595
- name: "Slider-2.png"
1596
- },
1597
- link: ""
1598
- },
1599
- {
1600
- image: {
1601
- objectFit: "cover",
1602
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",
1603
- name: "Slider-3.png"
1604
- },
1605
- link: ""
1606
- },
1607
- {
1608
- image: {
1609
- objectFit: "cover",
1610
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",
1611
- name: "Slider-4.png"
1612
- },
1613
- link: ""
1614
- }
1615
- ]
1616
- }
1617
- }
1618
- }
1619
- };
1620
- const hidden = "LightBox-module__hidden___9s-9x";
1621
- const heroImage = "LightBox-module__heroImage___sTxNF";
1622
- const background = "LightBox-module__background___rm9ml";
1623
- const editor = "LightBox-module__editor___4ACaY";
1624
- const contentStyle = "LightBox-module__contentStyle___Bgnsq";
1625
- const imageStyle = "LightBox-module__imageStyle___tLIlB";
1626
- const imgWrapper = "LightBox-module__imgWrapper___LuFUp";
1627
- const contain = "LightBox-module__contain___8-yaS";
1628
- const cover = "LightBox-module__cover___hNvOG";
1629
- const caption = "LightBox-module__caption___b6L2I";
1630
- const captionTextInner = "LightBox-module__captionTextInner___rCGNH";
1631
- const lightboxSplide = "LightBox-module__lightboxSplide___XFuWC";
1632
- const arrow = "LightBox-module__arrow___iz38X";
1633
- const arrowVertical = "LightBox-module__arrowVertical___Zfz81";
1634
- const nextArrow = "LightBox-module__nextArrow___zkAQN";
1635
- const arrowInner = "LightBox-module__arrowInner___p48sW";
1636
- const arrowIcon = "LightBox-module__arrowIcon___3VaFf";
1637
- const arrowImg = "LightBox-module__arrowImg___pNV88";
1638
- const mirror = "LightBox-module__mirror___pjeXc";
1639
- const thumbsWrapper = "LightBox-module__thumbsWrapper___GB-nU";
1640
- const thumbsContainerVertical = "LightBox-module__thumbsContainerVertical___wttk5";
1641
- const thumbsContainer = "LightBox-module__thumbsContainer___osSma";
1642
- const thumbsAlignStart = "LightBox-module__thumbsAlignStart___MO6tY";
1643
- const thumbsAlignCenter = "LightBox-module__thumbsAlignCenter___Q4sUx";
1644
- const thumbsAlignEnd = "LightBox-module__thumbsAlignEnd___p4y9R";
1645
- const thumbItem = "LightBox-module__thumbItem___HvnF3";
1646
- const closeButton = "LightBox-module__closeButton___g2khP";
1647
- const fadeIn = "LightBox-module__fadeIn___0m5GW";
1648
- const slideInLeft = "LightBox-module__slideInLeft___gPYwC";
1649
- const slideInRight = "LightBox-module__slideInRight___S-pPp";
1650
- const slideInTop = "LightBox-module__slideInTop___DFdAj";
1651
- const slideInBottom = "LightBox-module__slideInBottom___m27kZ";
1652
- const fadeOut = "LightBox-module__fadeOut___55qBR";
1653
- const slideOutLeft = "LightBox-module__slideOutLeft___NvU7P";
1654
- const slideOutRight = "LightBox-module__slideOutRight___SK7eC";
1655
- const slideOutTop = "LightBox-module__slideOutTop___Vgg0z";
1656
- const slideOutBottom = "LightBox-module__slideOutBottom___nJ0Ef";
1657
- const scaleSlide = "LightBox-module__scaleSlide___vZriG";
1658
- const classes = {
1659
- hidden,
1660
- heroImage,
1661
- background,
1662
- editor,
1663
- contentStyle,
1664
- imageStyle,
1665
- imgWrapper,
1666
- contain,
1667
- cover,
1668
- caption,
1669
- captionTextInner,
1670
- lightboxSplide,
1671
- arrow,
1672
- arrowVertical,
1673
- nextArrow,
1674
- arrowInner,
1675
- arrowIcon,
1676
- arrowImg,
1677
- mirror,
1678
- thumbsWrapper,
1679
- thumbsContainerVertical,
1680
- thumbsContainer,
1681
- thumbsAlignStart,
1682
- thumbsAlignCenter,
1683
- thumbsAlignEnd,
1684
- thumbItem,
1685
- closeButton,
1686
- fadeIn,
1687
- slideInLeft,
1688
- slideInRight,
1689
- slideInTop,
1690
- slideInBottom,
1691
- fadeOut,
1692
- slideOutLeft,
1693
- slideOutRight,
1694
- slideOutTop,
1695
- slideOutBottom,
1696
- scaleSlide
1697
- };
1698
- const getPositionStyles = (position, offset, isEditor) => {
1699
- const styles2 = {};
1700
- const [vertical, horizontal] = position.split("-");
1701
- if (vertical === "top") {
1702
- styles2.top = "0";
1703
- styles2.bottom = "auto";
1704
- } else if (vertical === "middle") {
1705
- styles2.top = "50%";
1706
- styles2.bottom = "auto";
1707
- } else if (vertical === "bottom") {
1708
- styles2.top = "auto";
1709
- styles2.bottom = "0";
1710
- }
1711
- if (horizontal === "left") {
1712
- styles2.left = "0";
1713
- styles2.right = "auto";
1714
- } else if (horizontal === "center") {
1715
- styles2.left = "50%";
1716
- styles2.right = "auto";
1717
- } else if (horizontal === "right") {
1718
- styles2.left = "auto";
1719
- styles2.right = "0";
1720
- }
1721
- if (vertical === "middle" && horizontal === "center") {
1722
- styles2.transform = `translate(calc(-50% + ${scalingValue(offset.x, isEditor)}), calc(-50% + ${scalingValue(offset.y, isEditor)}))`;
1723
- } else if (vertical === "middle") {
1724
- styles2.transform = `translate(${scalingValue(offset.x, isEditor)}, calc(-50% + ${scalingValue(offset.y, isEditor)}))`;
1725
- } else if (horizontal === "center") {
1726
- styles2.transform = `translate(calc(-50% + ${scalingValue(offset.x, isEditor)}), ${scalingValue(offset.y, isEditor)})`;
1727
- } else {
1728
- styles2.transform = `translate(${scalingValue(offset.x, isEditor)}, ${scalingValue(offset.y, isEditor)})`;
1729
- }
1730
- return styles2;
1731
- };
1732
- function getPaddingValues(img2) {
1733
- const style = window.getComputedStyle(img2);
1734
- return {
1735
- top: parseFloat(style.paddingTop) || 0,
1736
- right: parseFloat(style.paddingRight) || 0,
1737
- bottom: parseFloat(style.paddingBottom) || 0,
1738
- left: parseFloat(style.paddingLeft) || 0
1739
- };
1740
- }
1741
- function getDisplayedImageRect(img2) {
1742
- const container = img2.getBoundingClientRect();
1743
- const padding = getPaddingValues(img2);
1744
- const containerW = Math.max(0, container.width - padding.left - padding.right);
1745
- const containerH = Math.max(0, container.height - padding.top - padding.bottom);
1746
- const imgW = img2.naturalWidth;
1747
- const imgH = img2.naturalHeight;
1748
- const containerRatio = containerW / containerH;
1749
- const imgRatio = imgW / imgH;
1750
- let renderedW, renderedH;
1751
- if (imgRatio > containerRatio) {
1752
- renderedW = containerW;
1753
- renderedH = containerW / imgRatio;
1754
- } else {
1755
- renderedH = containerH;
1756
- renderedW = containerH * imgRatio;
1757
- }
1758
- const contentLeft = container.left + padding.left;
1759
- const contentTop = container.top + padding.top;
1760
- const offsetX = (containerW - renderedW) / 2 + contentLeft;
1761
- const offsetY = (containerH - renderedH) / 2 + contentTop;
1762
- return {
1763
- x: offsetX,
1764
- y: offsetY,
1765
- width: renderedW,
1766
- height: renderedH
1767
- };
1768
- }
1769
- function getPaddedContainerBounds(img2) {
1770
- const container = img2.getBoundingClientRect();
1771
- const padding = getPaddingValues(img2);
1772
- return {
1773
- left: container.left + padding.left,
1774
- right: container.right - padding.right,
1775
- top: container.top + padding.top,
1776
- bottom: container.bottom - padding.bottom
1777
- };
1778
- }
1779
- function getColorAlpha(color) {
1780
- const rgbaMatch = color.match(/rgba?\(([^)]+)\)/);
1781
- if (rgbaMatch) {
1782
- const values = rgbaMatch[1].split(",").map((v) => parseFloat(v.trim()));
1783
- if (values.length === 4) {
1784
- return values[3];
1785
- }
1786
- return 1;
1787
- }
1788
- const hexMatch = color.match(/^#([0-9a-fA-F]{8})$/);
1789
- if (hexMatch) {
1790
- const alphaHex = hexMatch[1].substring(6, 8);
1791
- return parseInt(alphaHex, 16) / 255;
1792
- }
1793
- if (color.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/)) {
1794
- return 1;
1795
- }
1796
- return 1;
1797
- }
1798
- function getAnimationClasses(type, direction) {
1799
- const appearClass = (() => {
1800
- if (type === "fade in") return classes.fadeIn;
1801
- if (type === "slide in" || type === "mix") {
1802
- switch (direction) {
1803
- case "left":
1804
- return classes.slideInLeft;
1805
- case "right":
1806
- return classes.slideInRight;
1807
- case "top":
1808
- return classes.slideInTop;
1809
- case "bottom":
1810
- return classes.slideInBottom;
1811
- default:
1812
- return classes.slideInRight;
1813
- }
1814
- }
1815
- return classes.fadeIn;
1816
- })();
1817
- const backdropAppearClass = (() => {
1818
- if (type === "fade in" || type === "mix") return classes.fadeIn;
1819
- if (type === "slide in") {
1820
- switch (direction) {
1821
- case "left":
1822
- return classes.slideInLeft;
1823
- case "right":
1824
- return classes.slideInRight;
1825
- case "top":
1826
- return classes.slideInTop;
1827
- case "bottom":
1828
- return classes.slideInBottom;
1829
- default:
1830
- return classes.slideInRight;
1831
- }
1832
- }
1833
- return classes.fadeIn;
1834
- })();
1835
- const backdropDisappearClass = (() => {
1836
- if (type === "fade in" || type === "mix") return classes.fadeOut;
1837
- if (type === "slide in") {
1838
- switch (direction) {
1839
- case "left":
1840
- return classes.slideOutLeft;
1841
- case "right":
1842
- return classes.slideOutRight;
1843
- case "top":
1844
- return classes.slideOutTop;
1845
- case "bottom":
1846
- return classes.slideOutBottom;
1847
- default:
1848
- return classes.slideOutRight;
1849
- }
1850
- }
1851
- return classes.fadeOut;
1852
- })();
1853
- const disappearClass = (() => {
1854
- if (type === "fade in") return classes.fadeOut;
1855
- if (type === "slide in" || type === "mix") {
1856
- switch (direction) {
1857
- case "left":
1858
- return classes.slideOutLeft;
1859
- case "right":
1860
- return classes.slideOutRight;
1861
- case "top":
1862
- return classes.slideOutTop;
1863
- case "bottom":
1864
- return classes.slideOutBottom;
1865
- default:
1866
- return classes.slideOutRight;
1867
- }
1868
- }
1869
- return classes.fadeOut;
1870
- })();
1871
- return { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass };
1872
- }
1873
- const LightboxGallery = ({ settings, content, styles: styles2, portalId, activeEvent, isEditor }) => {
1874
- const [open, setOpen] = react.useState(false);
1875
- const { url } = settings.thumbnailBlock.cover;
1876
- react.useEffect(() => {
1877
- if (activeEvent === "close") {
1878
- setOpen(false);
1879
- }
1880
- if (activeEvent === "open") {
1881
- setOpen(true);
1882
- }
1883
- }, [activeEvent]);
1884
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1885
- /* @__PURE__ */ jsxRuntime.jsx(
1886
- "img",
1887
- {
1888
- src: url,
1889
- alt: "Cover",
1890
- className: classes.heroImage,
1891
- onClick: () => setOpen(true)
1892
- }
1893
- ),
1894
- /* @__PURE__ */ jsxRuntime.jsx(
1895
- Lightbox,
1896
- {
1897
- isOpen: open,
1898
- onClose: () => setOpen(false),
1899
- content,
1900
- settings,
1901
- lightboxStyles: styles2,
1902
- portalId,
1903
- isEditor
1904
- }
1905
- )
1906
- ] });
1907
- };
1908
- const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId, isEditor, metadata }) => {
1909
- var _a;
1910
- const [currentIndex, setCurrentIndex] = react.useState(0);
1911
- const [splideKey, setSplideKey] = react.useState(0);
1912
- const [isClosing, setIsClosing] = react.useState(false);
1913
- const [animationFinished, setAnimationFinished] = react.useState(false);
1914
- const [thumbnailDimensions, setThumbnailDimensions] = react.useState({});
1915
- const lightboxRef = react.useRef(null);
1916
- const prevSliderTypeRef = react.useRef(null);
1917
- const imageRef = react.useRef(null);
1918
- const isClosingRef = react.useRef(false);
1919
- const animationTargetRef = react.useRef(null);
1920
- const animationEndHandlerRef = react.useRef(null);
1921
- const appearAnimationEndHandlerRef = react.useRef(null);
1922
- const dragStartRef = react.useRef(null);
1923
- const hasDraggedRef = react.useRef(false);
1924
- const thumbsWrapperRef = react.useRef(null);
1925
- const [hasThumbsOverflow, setHasThumbsOverflow] = react.useState(false);
1926
- const { appear, triggers, slider, thumbnail, controls, area, caption: caption2, layout } = settings.lightboxBlock;
1927
- const { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass } = getAnimationClasses(appear.type, appear.direction);
1928
- const itemId = (metadata == null ? void 0 : metadata.itemId) ?? null;
1929
- react.useEffect(() => {
1930
- const handleLayoutChange = () => {
1931
- setTimeout(() => {
1932
- var _a2, _b;
1933
- (_b = (_a2 = lightboxRef.current) == null ? void 0 : _a2.splide) == null ? void 0 : _b.refresh();
1934
- }, 16);
1935
- };
1936
- const handleComponentContentChange = () => {
1937
- setSplideKey((prev) => prev + 1);
1938
- };
1939
- window.addEventListener("ArticleEditor.Layout:change", handleLayoutChange);
1940
- window.addEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
1941
- return () => {
1942
- window.removeEventListener("ArticleEditor.Layout:change", handleLayoutChange);
1943
- window.removeEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
1944
- };
1945
- }, []);
1946
- react.useEffect(() => {
1947
- if (!isOpen || !thumbnail.isActive) {
1948
- setHasThumbsOverflow(false);
1949
- return;
1950
- }
1951
- const ref = thumbsWrapperRef.current;
1952
- if (!ref) return;
1953
- const checkOverflow = () => {
1954
- if (slider.direction === "horiz") {
1955
- setHasThumbsOverflow(ref.scrollWidth > ref.clientWidth);
1956
- } else {
1957
- setHasThumbsOverflow(ref.scrollHeight > ref.clientHeight);
1958
- }
1959
- };
1960
- checkOverflow();
1961
- const observer = new ResizeObserver(checkOverflow);
1962
- observer.observe(ref);
1963
- return () => observer.disconnect();
1964
- }, [isOpen, thumbnail.isActive, content.length, thumbnailDimensions, slider.direction]);
1965
- const handleClose = react.useCallback(() => {
1966
- const isMobile = window.matchMedia("(max-width: 768px)").matches;
1967
- const colorAlpha = getColorAlpha(area.color);
1968
- if (isMobile && !isEditor && colorAlpha > 0.9) {
1969
- document.body.style.backgroundColor = "";
1970
- }
1971
- setIsClosing(true);
1972
- isClosingRef.current = true;
1973
- const handleAnimationEnd = (e) => {
1974
- if (e.target === animationTargetRef.current && e.animationName) {
1975
- if (animationTargetRef.current && animationEndHandlerRef.current) {
1976
- animationTargetRef.current.removeEventListener("animationend", animationEndHandlerRef.current);
1977
- }
1978
- animationEndHandlerRef.current = null;
1979
- if (isClosingRef.current) {
1980
- isClosingRef.current = false;
1981
- onClose();
1982
- }
1983
- setIsClosing(false);
1984
- }
1985
- };
1986
- if (animationTargetRef.current) {
1987
- animationEndHandlerRef.current = handleAnimationEnd;
1988
- animationTargetRef.current.addEventListener("animationend", handleAnimationEnd);
1989
- }
1990
- }, [onClose, area.color, isEditor]);
1991
- const handleTriggerClick = (img2, clientX, clientY) => {
1992
- var _a2, _b;
1993
- if (!img2) return;
1994
- if (triggers.type === "click" && triggers.switch === "image") {
1995
- if (triggers.repeat === "close" && currentIndex === content.length - 1) {
1996
- handleClose();
1997
- } else {
1998
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go("+1");
1999
- }
2000
- } else if (triggers.type === "click" && triggers.switch === "50/50") {
2001
- const rect = img2.getBoundingClientRect();
2002
- const clickX = clientX - rect.left;
2003
- const clickY = clientY - rect.top;
2004
- const imgWidth = rect.width;
2005
- const imgHeight = rect.height;
2006
- let dir;
2007
- if (slider.direction === "horiz") {
2008
- dir = clickX < imgWidth / 2 ? "-1" : "+1";
2009
- } else {
2010
- dir = clickY < imgHeight / 2 ? "-1" : "+1";
2011
- }
2012
- (_b = lightboxRef.current) == null ? void 0 : _b.go(dir);
2013
- }
2014
- };
2015
- const handleImageWrapperClick = (e) => {
2016
- if (hasDraggedRef.current) {
2017
- hasDraggedRef.current = false;
2018
- return;
2019
- }
2020
- const currentImage = content[currentIndex];
2021
- const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
2022
- let clientX;
2023
- let clientY;
2024
- if ("changedTouches" in e && e.changedTouches.length > 0) {
2025
- clientX = e.changedTouches[0].clientX;
2026
- clientY = e.changedTouches[0].clientY;
2027
- } else if ("clientX" in e) {
2028
- clientX = e.clientX;
2029
- clientY = e.clientY;
2030
- } else {
2031
- return;
2032
- }
2033
- let inside;
2034
- if (isCover && imageRef.current) {
2035
- const bounds = getPaddedContainerBounds(imageRef.current);
2036
- inside = clientX >= bounds.left && clientX <= bounds.right && clientY >= bounds.top && clientY <= bounds.bottom;
2037
- } else {
2038
- const rect = imageRef.current ? getDisplayedImageRect(imageRef.current) : null;
2039
- if (!rect) {
2040
- if (e.target === e.currentTarget) handleClose();
2041
- return;
2042
- }
2043
- inside = clientX >= rect.x && clientX <= rect.x + rect.width && clientY >= rect.y && clientY <= rect.y + rect.height;
2044
- }
2045
- if (inside) {
2046
- handleTriggerClick(imageRef.current, clientX, clientY);
2047
- } else {
2048
- handleClose();
2049
- }
2050
- };
2051
- const handleThumbWrapperClick = (e) => {
2052
- const target = e.target;
2053
- if (target.classList.contains(classes.thumbsWrapper) || target.classList.contains(classes.thumbsContainer)) {
2054
- handleImageWrapperClick(e);
2055
- }
2056
- };
2057
- react.useEffect(() => {
2058
- if (!isOpen) return;
2059
- const onKeyDown = (event) => {
2060
- var _a2, _b;
2061
- if (event.key === "Escape") {
2062
- handleClose();
2063
- return;
2064
- }
2065
- if (event.key === "ArrowRight") {
2066
- setCurrentIndex((prev) => (prev + 1) % Math.max(content.length, 1));
2067
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go("+1");
2068
- return;
2069
- }
2070
- if (event.key === "ArrowLeft") {
2071
- setCurrentIndex((prev) => (prev - 1 + Math.max(content.length, 1)) % Math.max(content.length, 1));
2072
- (_b = lightboxRef.current) == null ? void 0 : _b.go("-1");
2073
- }
2074
- };
2075
- window.addEventListener("keydown", onKeyDown);
2076
- return () => {
2077
- window.removeEventListener("keydown", onKeyDown);
2078
- };
2079
- }, [isOpen, handleClose, content.length]);
2080
- react.useEffect(() => {
2081
- if (isOpen) {
2082
- setCurrentIndex(0);
2083
- setSplideKey((prev) => prev + 1);
2084
- isClosingRef.current = false;
2085
- setIsClosing(false);
2086
- setAnimationFinished(false);
2087
- setThumbnailDimensions({});
2088
- if (!itemId) return;
2089
- const event = new CustomEvent("page-overlay", { detail: { itemId } });
2090
- window.dispatchEvent(event);
2091
- }
2092
- return () => {
2093
- if (animationTargetRef.current && animationEndHandlerRef.current) {
2094
- animationTargetRef.current.removeEventListener("animationend", animationEndHandlerRef.current);
2095
- animationEndHandlerRef.current = null;
2096
- }
2097
- setAnimationFinished(false);
2098
- };
2099
- }, [isOpen, itemId]);
2100
- react.useEffect(() => {
2101
- if (prevSliderTypeRef.current !== null && prevSliderTypeRef.current !== slider.type) {
2102
- setSplideKey((prev) => prev + 1);
2103
- }
2104
- prevSliderTypeRef.current = slider.type;
2105
- }, [slider.type]);
2106
- react.useEffect(() => {
2107
- if (!isOpen) return;
2108
- const originalOverflow = document.body.style.overflow;
2109
- const isMobile = window.matchMedia("(max-width: 768px)").matches;
2110
- const colorAlpha = getColorAlpha(area.color);
2111
- document.body.style.overflow = "hidden";
2112
- setAnimationFinished(false);
2113
- const handleAppearAnimationEnd = (e) => {
2114
- if (e.target === animationTargetRef.current && !isClosingRef.current && e.animationName) {
2115
- if (isMobile && !isEditor && colorAlpha > 0.9) {
2116
- document.body.style.backgroundColor = area.color;
2117
- }
2118
- setAnimationFinished(true);
2119
- if (animationTargetRef.current && appearAnimationEndHandlerRef.current) {
2120
- animationTargetRef.current.removeEventListener("animationend", appearAnimationEndHandlerRef.current);
2121
- }
2122
- appearAnimationEndHandlerRef.current = null;
2123
- }
2124
- };
2125
- if (animationTargetRef.current) {
2126
- appearAnimationEndHandlerRef.current = handleAppearAnimationEnd;
2127
- animationTargetRef.current.addEventListener("animationend", handleAppearAnimationEnd);
2128
- }
2129
- const preventScroll = (e) => {
2130
- const target = e.target;
2131
- if (target && (target.closest(`.${classes.thumbsWrapper}`) || target.closest(`.${classes.thumbsContainer}`))) {
2132
- return;
2133
- }
2134
- if (slider.type === "slide") {
2135
- return;
2136
- }
2137
- e.preventDefault();
2138
- };
2139
- document.addEventListener("touchmove", preventScroll, { passive: false });
2140
- return () => {
2141
- document.body.style.overflow = originalOverflow;
2142
- document.removeEventListener("touchmove", preventScroll);
2143
- if (animationTargetRef.current && appearAnimationEndHandlerRef.current) {
2144
- animationTargetRef.current.removeEventListener("animationend", appearAnimationEndHandlerRef.current);
2145
- appearAnimationEndHandlerRef.current = null;
2146
- }
2147
- setAnimationFinished(false);
2148
- };
2149
- }, [isOpen, isEditor, area.color, slider.type]);
2150
- react.useEffect(() => {
2151
- if (!isOpen) return;
2152
- const handleTouchEnd = (e) => {
2153
- var _a2, _b;
2154
- if (isClosingRef.current) {
2155
- e.stopPropagation();
2156
- return;
2157
- }
2158
- if (hasDraggedRef.current) {
2159
- hasDraggedRef.current = false;
2160
- return;
2161
- }
2162
- const target = e.target;
2163
- if (target && (target.closest(`.${classes.thumbsContainer}`) || target.closest(`.${classes.thumbItem}`))) {
2164
- return;
2165
- }
2166
- if (slider.type === "slide" && triggers.type === "drag" && ((_b = (_a2 = lightboxRef.current) == null ? void 0 : _a2.splide) == null ? void 0 : _b.root)) {
2167
- const splideContainer = lightboxRef.current.splide.root;
2168
- if (target && (splideContainer.contains(target) || splideContainer === target)) {
2169
- return;
2170
- }
2171
- }
2172
- if (e.touches.length === 0 && e.changedTouches.length > 0) {
2173
- const currentImage = content[currentIndex];
2174
- const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
2175
- const touch = e.changedTouches[0];
2176
- let inside;
2177
- if (isCover && imageRef.current) {
2178
- const bounds = getPaddedContainerBounds(imageRef.current);
2179
- inside = touch.clientX >= bounds.left && touch.clientX <= bounds.right && touch.clientY >= bounds.top && touch.clientY <= bounds.bottom;
2180
- } else {
2181
- const rect = imageRef.current ? getDisplayedImageRect(imageRef.current) : null;
2182
- if (!rect) return;
2183
- inside = touch.clientX >= rect.x && touch.clientX <= rect.x + rect.width && touch.clientY >= rect.y && touch.clientY <= rect.y + rect.height;
2184
- }
2185
- if (!inside) {
2186
- e.stopPropagation();
2187
- isClosingRef.current = true;
2188
- const blockNextClick = (clickEvent) => {
2189
- clickEvent.stopPropagation();
2190
- clickEvent.preventDefault();
2191
- document.removeEventListener("click", blockNextClick, true);
2192
- };
2193
- document.addEventListener("click", blockNextClick, true);
2194
- handleClose();
2195
- }
2196
- }
2197
- };
2198
- document.addEventListener("touchend", handleTouchEnd, { passive: true });
2199
- return () => {
2200
- document.removeEventListener("touchend", handleTouchEnd);
2201
- };
2202
- }, [isOpen, handleClose, currentIndex, content]);
2203
- const needsCustomVerticalDrag = (slider.type === "scale" || slider.type === "fade") && slider.direction === "vert" && triggers.type === "drag";
2204
- react.useEffect(() => {
2205
- var _a2, _b;
2206
- if (!isOpen || !needsCustomVerticalDrag || !((_b = (_a2 = lightboxRef.current) == null ? void 0 : _a2.splide) == null ? void 0 : _b.root)) return;
2207
- const container = lightboxRef.current.splide.root;
2208
- const DRAG_THRESHOLD = 30;
2209
- const handleMove = (clientX, clientY) => {
2210
- if (dragStartRef.current) {
2211
- const deltaX = Math.abs(clientX - dragStartRef.current.x);
2212
- const deltaY = Math.abs(clientY - dragStartRef.current.y);
2213
- if (deltaX > 0 || deltaY > 0) {
2214
- hasDraggedRef.current = true;
2215
- }
2216
- }
2217
- };
2218
- const handlePointerMove = (e) => {
2219
- if (dragStartRef.current) {
2220
- e.preventDefault();
2221
- handleMove(e.clientX, e.clientY);
2222
- }
2223
- };
2224
- const handleTouchMove = (e) => {
2225
- if (dragStartRef.current && e.touches.length > 0) {
2226
- e.preventDefault();
2227
- handleMove(e.touches[0].clientX, e.touches[0].clientY);
2228
- }
2229
- };
2230
- const handleUp = (clientX, clientY) => {
2231
- if (!dragStartRef.current || !lightboxRef.current) {
2232
- dragStartRef.current = null;
2233
- return;
2234
- }
2235
- const deltaX = Math.abs(clientX - dragStartRef.current.x);
2236
- const deltaY = Math.abs(clientY - dragStartRef.current.y);
2237
- if (deltaY > DRAG_THRESHOLD && deltaY > deltaX) {
2238
- lightboxRef.current.go(clientY < dragStartRef.current.y ? "+1" : "-1");
2239
- }
2240
- dragStartRef.current = null;
2241
- };
2242
- const handlePointerUp = (e) => {
2243
- if (dragStartRef.current) {
2244
- handleUp(e.clientX, e.clientY);
2245
- }
2246
- document.removeEventListener("pointerup", handlePointerUp);
2247
- document.removeEventListener("pointercancel", handlePointerUp);
2248
- document.removeEventListener("pointermove", handlePointerMove);
2249
- };
2250
- const handleTouchEnd = (e) => {
2251
- if (!dragStartRef.current) {
2252
- return;
2253
- }
2254
- if (e.changedTouches.length > 0) {
2255
- const touch = e.changedTouches[0];
2256
- handleUp(touch.clientX, touch.clientY);
2257
- }
2258
- document.removeEventListener("touchend", handleTouchEnd);
2259
- document.removeEventListener("touchcancel", handleTouchEnd);
2260
- document.removeEventListener("touchmove", handleTouchMove);
2261
- };
2262
- const handlePointerDown = (e) => {
2263
- dragStartRef.current = { x: e.clientX, y: e.clientY };
2264
- hasDraggedRef.current = false;
2265
- document.addEventListener("pointermove", handlePointerMove, { passive: false });
2266
- document.addEventListener("pointerup", handlePointerUp);
2267
- document.addEventListener("pointercancel", handlePointerUp);
2268
- };
2269
- const handleTouchStart = (e) => {
2270
- if (e.touches.length > 0) {
2271
- dragStartRef.current = { x: e.touches[0].clientX, y: e.touches[0].clientY };
2272
- hasDraggedRef.current = false;
2273
- document.addEventListener("touchmove", handleTouchMove, { passive: false });
2274
- document.addEventListener("touchend", handleTouchEnd);
2275
- document.addEventListener("touchcancel", handleTouchEnd);
2276
- }
2277
- };
2278
- container.addEventListener("pointerdown", handlePointerDown);
2279
- container.addEventListener("touchstart", handleTouchStart);
2280
- return () => {
2281
- container.removeEventListener("pointerdown", handlePointerDown);
2282
- container.removeEventListener("touchstart", handleTouchStart);
2283
- document.removeEventListener("pointermove", handlePointerMove);
2284
- document.removeEventListener("pointerup", handlePointerUp);
2285
- document.removeEventListener("pointercancel", handlePointerUp);
2286
- document.removeEventListener("touchmove", handleTouchMove);
2287
- document.removeEventListener("touchend", handleTouchEnd);
2288
- document.removeEventListener("touchcancel", handleTouchEnd);
2289
- dragStartRef.current = null;
2290
- hasDraggedRef.current = false;
2291
- };
2292
- }, [isOpen, needsCustomVerticalDrag, splideKey]);
2293
- const backdropStyles = {
2294
- backgroundColor: area.color,
2295
- backdropFilter: `blur(${area.blur}px)`,
2296
- animationDuration: `${parseInt(appear.duration)}ms`,
2297
- animationTimingFunction: "ease",
2298
- animationFillMode: "both"
2299
- };
2300
- if (!document.getElementById(portalId)) return null;
2301
- return reactDom.createPortal(
2302
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2303
- /* @__PURE__ */ jsxRuntime.jsx(
2304
- "div",
2305
- {
2306
- ref: !isEditor ? animationTargetRef : null,
2307
- className: cn(classes.background, isClosing ? backdropDisappearClass : backdropAppearClass, { [classes.editor]: isEditor }, { [classes.hidden]: !isOpen }),
2308
- style: {
2309
- ...backdropStyles,
2310
- ...animationFinished && !isEditor && !isClosing ? { position: "absolute" } : {}
2311
- }
2312
- }
2313
- ),
2314
- /* @__PURE__ */ jsxRuntime.jsxs(
2315
- "div",
2316
- {
2317
- ref: isEditor ? animationTargetRef : null,
2318
- className: cn(classes.contentStyle, !isClosing ? appearClass : disappearClass, { [classes.editor]: isEditor }, { [classes.hidden]: !isOpen }),
2319
- style: {
2320
- animationDuration: `${parseInt(appear.duration)}ms`,
2321
- animationTimingFunction: "ease",
2322
- animationFillMode: "both"
2323
- },
2324
- children: [
2325
- /* @__PURE__ */ jsxRuntime.jsx(
2326
- reactSplide.Splide,
2327
- {
2328
- onMove: (splide) => setCurrentIndex(splide.index),
2329
- ref: lightboxRef,
2330
- className: classes.lightboxSplide,
2331
- options: {
2332
- arrows: false,
2333
- speed: slider.duration ? parseInt(slider.duration) : 500,
2334
- direction: (() => {
2335
- const isHoriz = slider.direction === "horiz";
2336
- return isHoriz || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb";
2337
- })(),
2338
- pagination: false,
2339
- // Disable Splide's drag when we need custom vertical drag handling
2340
- drag: triggers.type === "drag" && !needsCustomVerticalDrag,
2341
- perPage: 1,
2342
- width: "100%",
2343
- height: "100%",
2344
- type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
2345
- padding: 0,
2346
- rewind: triggers.repeat !== "close",
2347
- start: 0
2348
- },
2349
- style: { "--splide-speed": slider.duration },
2350
- children: content.map((item, index) => {
2351
- const positionStyles = getPositionStyles(layout.position, layout.offset, isEditor);
2352
- const padding = `${scalingValue(layout.padding.top, isEditor)} ${scalingValue(layout.padding.right, isEditor)} ${scalingValue(layout.padding.bottom, isEditor)} ${scalingValue(layout.padding.left, isEditor)}`;
2353
- const imageStyle2 = slider.type === "scale" ? (() => {
2354
- const { transform, ...restStyles } = positionStyles;
2355
- return {
2356
- ...restStyles,
2357
- position: "absolute",
2358
- padding,
2359
- boxSizing: "border-box",
2360
- "--position-transform": transform || "none"
2361
- };
2362
- })() : { ...positionStyles, position: "absolute", padding, boxSizing: "border-box" };
2363
- return /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.imgWrapper, onClick: handleImageWrapperClick, children: /* @__PURE__ */ jsxRuntime.jsx(
2364
- "img",
2365
- {
2366
- ref: index === currentIndex ? imageRef : null,
2367
- className: cn(classes.imageStyle, {
2368
- [classes.contain]: item.image.objectFit === "contain",
2369
- [classes.cover]: item.image.objectFit === "cover",
2370
- [classes.scaleSlide]: slider.type === "scale"
2371
- }),
2372
- src: item.image.url,
2373
- alt: item.image.name ?? "",
2374
- style: { ...imageStyle2, pointerEvents: item.image.objectFit === "contain" ? "none" : "auto" }
2375
- }
2376
- ) }) }, index);
2377
- })
2378
- },
2379
- splideKey
2380
- ),
2381
- controls.isActive && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2382
- /* @__PURE__ */ jsxRuntime.jsx(
2383
- "div",
2384
- {
2385
- className: cn(classes.arrow, { [classes.arrowVertical]: slider.direction === "vert" }),
2386
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
2387
- children: /* @__PURE__ */ jsxRuntime.jsxs(
2388
- "button",
2389
- {
2390
- className: classes.arrowInner,
2391
- style: { transform: `translate(${scalingValue(controls.offset.x, isEditor)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1), isEditor)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})` },
2392
- onClick: () => {
2393
- var _a2;
2394
- return (_a2 = lightboxRef.current) == null ? void 0 : _a2.go("-1");
2395
- },
2396
- "aria-label": "Previous",
2397
- children: [
2398
- controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
2399
- SvgImage,
2400
- {
2401
- url: controls.arrowsImgUrl,
2402
- fill: controls.color,
2403
- hoverFill: controls.hover,
2404
- className: cn(classes.arrowImg, classes.mirror)
2405
- }
2406
- ),
2407
- !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon, { color: controls.color, className: cn(classes.arrowIcon, classes.arrowImg, classes.mirror) })
2408
- ]
2409
- }
2410
- )
2411
- }
2412
- ),
2413
- /* @__PURE__ */ jsxRuntime.jsx(
2414
- "div",
2415
- {
2416
- className: cn(classes.arrow, classes.nextArrow, { [classes.arrowVertical]: slider.direction === "vert" }),
2417
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
2418
- children: /* @__PURE__ */ jsxRuntime.jsxs(
2419
- "button",
2420
- {
2421
- className: classes.arrowInner,
2422
- style: { transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controls.offset.y, isEditor)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})` },
2423
- onClick: () => {
2424
- var _a2;
2425
- return (_a2 = lightboxRef.current) == null ? void 0 : _a2.go("+1");
2426
- },
2427
- "aria-label": "Next",
2428
- children: [
2429
- controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
2430
- SvgImage,
2431
- {
2432
- url: controls.arrowsImgUrl,
2433
- fill: controls.color,
2434
- hoverFill: controls.hover,
2435
- className: classes.arrowImg
2436
- }
2437
- ),
2438
- !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon, { color: controls.color, className: cn(classes.arrowIcon, classes.arrowImg) })
2439
- ]
2440
- }
2441
- )
2442
- }
2443
- )
2444
- ] }),
2445
- area.closeIconUrl && (() => {
2446
- const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset, isEditor);
2447
- const scaleTransform = `scale(${area.closeIconScale})`;
2448
- const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
2449
- return /* @__PURE__ */ jsxRuntime.jsx("button", { className: classes.closeButton, style: { ...positionStyles, transform: combinedTransform }, onClick: handleClose, "aria-label": "Close lightbox", children: /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { url: area.closeIconUrl, fill: area.closeIconColor ?? "#000000", hoverFill: area.closeIconHover ?? "#cccccc" }) });
2450
- })(),
2451
- caption2 && caption2.isActive && lightboxStyles.imageCaption && ((_a = content[currentIndex]) == null ? void 0 : _a.imageCaption) && (() => {
2452
- const { widthSettings, fontSettings, letterSpacing, textAlign, wordSpacing, fontSizeLineHeight, textAppearance, color } = lightboxStyles.imageCaption;
2453
- return /* @__PURE__ */ jsxRuntime.jsx(
2454
- "div",
2455
- {
2456
- className: classes.caption,
2457
- style: {
2458
- ...getPositionStyles(caption2.alignment, caption2.offset, isEditor),
2459
- fontFamily: fontSettings.fontFamily,
2460
- fontWeight: fontSettings.fontWeight,
2461
- fontStyle: fontSettings.fontStyle,
2462
- width: widthSettings.sizing === "auto" ? "max-content" : scalingValue(widthSettings.width, isEditor),
2463
- letterSpacing: scalingValue(letterSpacing, isEditor),
2464
- wordSpacing: scalingValue(wordSpacing, isEditor),
2465
- textAlign,
2466
- fontSize: scalingValue(fontSizeLineHeight.fontSize, isEditor),
2467
- lineHeight: scalingValue(fontSizeLineHeight.lineHeight, isEditor),
2468
- textTransform: textAppearance.textTransform ?? "none",
2469
- textDecoration: textAppearance.textDecoration ?? "none",
2470
- fontVariant: textAppearance.fontVariant ?? "normal",
2471
- color
2472
- },
2473
- onClick: (e) => e.stopPropagation(),
2474
- children: /* @__PURE__ */ jsxRuntime.jsx(
2475
- "div",
2476
- {
2477
- "data-styles": "imageCaption",
2478
- className: classes.captionTextInner,
2479
- style: { ["--link-hover-color"]: caption2.hover },
2480
- children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
2481
- }
2482
- )
2483
- }
2484
- );
2485
- })(),
2486
- thumbnail.isActive && (() => {
2487
- const [vertical, horizontal] = thumbnail.position.split("-");
2488
- const effectivePosition = slider.direction === "horiz" ? `${vertical}-left` : thumbnail.position;
2489
- const thumbsPositionStyles = getPositionStyles(effectivePosition, thumbnail.offset, isEditor);
2490
- const getJustifyContent = () => {
2491
- if (slider.direction === "horiz") {
2492
- if (horizontal === "left") return "flex-start";
2493
- if (horizontal === "center") return "center";
2494
- if (horizontal === "right") return "flex-end";
2495
- } else {
2496
- if (vertical === "top") return "flex-start";
2497
- if (vertical === "middle") return "center";
2498
- if (vertical === "bottom") return "flex-end";
2499
- }
2500
- return "flex-start";
2501
- };
2502
- return /* @__PURE__ */ jsxRuntime.jsx(
2503
- "div",
2504
- {
2505
- ref: thumbsWrapperRef,
2506
- className: classes.thumbsWrapper,
2507
- onClick: (e) => handleThumbWrapperClick(e),
2508
- style: {
2509
- position: isEditor ? "absolute" : "fixed",
2510
- ...thumbsPositionStyles,
2511
- ...slider.direction === "horiz" ? {
2512
- maxWidth: "100vw",
2513
- width: "100%",
2514
- overflowX: "auto",
2515
- overflowY: "hidden"
2516
- } : {
2517
- maxHeight: "100vh",
2518
- overflowY: "auto",
2519
- overflowX: "hidden"
2520
- }
2521
- },
2522
- children: /* @__PURE__ */ jsxRuntime.jsx(
2523
- "div",
2524
- {
2525
- className: cn(classes.thumbsContainer, {
2526
- [classes.thumbsContainerVertical]: slider.direction === "vert",
2527
- [classes.thumbsAlignStart]: thumbnail.align === "start",
2528
- [classes.thumbsAlignCenter]: thumbnail.align === "center",
2529
- [classes.thumbsAlignEnd]: thumbnail.align === "end"
2530
- }),
2531
- style: {
2532
- gap: scalingValue(thumbnail.grid.gap, isEditor),
2533
- justifyContent: hasThumbsOverflow ? "flex-start" : getJustifyContent()
2534
- },
2535
- children: content.map((item, index) => {
2536
- const isActive = index === currentIndex;
2537
- const thumbDims = thumbnailDimensions[index];
2538
- const baseSizeValue = thumbnail.grid.size;
2539
- const activeSizeValue = baseSizeValue * (isActive ? thumbnail.activeState.scale : 1);
2540
- const getFitDimensions = () => {
2541
- if (thumbnail.fit !== "fit") return {};
2542
- if (!thumbDims) {
2543
- if (slider.direction === "horiz") {
2544
- return { height: scalingValue(activeSizeValue, isEditor) };
2545
- } else {
2546
- return { width: scalingValue(activeSizeValue, isEditor) };
2547
- }
2548
- }
2549
- const aspectRatio = thumbDims.width / thumbDims.height;
2550
- if (slider.direction === "horiz") {
2551
- const heightValue = activeSizeValue;
2552
- const widthValue = heightValue * aspectRatio;
2553
- return {
2554
- width: scalingValue(widthValue, isEditor),
2555
- height: scalingValue(heightValue, isEditor)
2556
- };
2557
- } else {
2558
- const widthValue = activeSizeValue;
2559
- const heightValue = widthValue / aspectRatio;
2560
- return {
2561
- width: scalingValue(widthValue, isEditor),
2562
- height: scalingValue(heightValue, isEditor)
2563
- };
2564
- }
2565
- };
2566
- return /* @__PURE__ */ jsxRuntime.jsx(
2567
- "button",
2568
- {
2569
- className: classes.thumbItem,
2570
- style: {
2571
- ...slider.direction === "horiz" && thumbnail.fit !== "fit" ? { height: scalingValue(activeSizeValue, isEditor) } : {},
2572
- ...slider.direction === "vert" && thumbnail.fit !== "fit" ? { width: scalingValue(activeSizeValue, isEditor) } : {},
2573
- ...thumbnail.fit === "cover" ? { width: scalingValue(activeSizeValue, isEditor), height: scalingValue(activeSizeValue, isEditor) } : {},
2574
- ...getFitDimensions(),
2575
- transition: isActive ? "all 0.25s ease-out" : "none",
2576
- opacity: isActive ? thumbnail.activeState.opacity / 100 : thumbnail.opacity / 100,
2577
- ["--thumb-hover"]: thumbnail.activeState.opacity / 100
2578
- },
2579
- onClick: (e) => {
2580
- var _a2;
2581
- e.stopPropagation();
2582
- setCurrentIndex(index);
2583
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go(index);
2584
- },
2585
- onMouseEnter: () => {
2586
- var _a2;
2587
- if (thumbnail.triggers === "hov") {
2588
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go(index);
2589
- }
2590
- },
2591
- children: /* @__PURE__ */ jsxRuntime.jsx(
2592
- "img",
2593
- {
2594
- src: item.image.url,
2595
- alt: item.image.name ?? "",
2596
- onLoad: (e) => {
2597
- const img2 = e.currentTarget;
2598
- if (img2.naturalWidth && img2.naturalHeight) {
2599
- setThumbnailDimensions((prev) => ({
2600
- ...prev,
2601
- [index]: { width: img2.naturalWidth, height: img2.naturalHeight }
2602
- }));
2603
- }
2604
- },
2605
- style: {
2606
- objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
2607
- ...thumbnail.fit === "fit" ? { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } : {},
2608
- ...thumbnail.fit === "cover" ? { width: "100%", height: "100%" } : {}
2609
- }
2610
- }
2611
- )
2612
- },
2613
- `${item.image.name}-${index}`
2614
- );
2615
- })
2616
- }
2617
- )
2618
- }
2619
- );
2620
- })()
2621
- ]
2622
- }
2623
- )
2624
- ] }),
2625
- document.getElementById(portalId)
2626
- );
2627
- };
2628
- function ArrowIcon({ color, className }) {
2629
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("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: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
2630
- }
2631
- const LightboxComponent = {
2632
- element: LightboxGallery,
2633
- id: "lightbox",
2634
- name: "Lightbox",
2635
- preview: {
2636
- type: "video",
2637
- url: "https://cdn.cntrl.site/component-assets/lightbox.mp4"
2638
- },
2639
- defaultSize: {
2640
- width: 440,
2641
- height: 550
2642
- },
2643
- schema: {
2644
- type: "object",
2645
- properties: {
2646
- settings: {
2647
- layoutBased: true,
2648
- type: "object",
2649
- properties: {
2650
- thumbnailBlock: {
2651
- display: {
2652
- type: "settings-block",
2653
- triggerEvent: "close"
2654
- },
2655
- type: "object",
2656
- properties: {
2657
- cover: {
2658
- title: "COVER",
2659
- icon: "cover",
2660
- tooltip: "Cover Image",
2661
- type: "object",
2662
- properties: {
2663
- url: {
2664
- type: "string",
2665
- display: {
2666
- type: "cover-image-input"
2667
- }
2668
- }
2669
- }
2670
- }
2671
- }
2672
- },
2673
- lightboxBlock: {
2674
- display: {
2675
- type: "settings-block",
2676
- triggerEvent: "open"
2677
- },
2678
- type: "object",
2679
- properties: {
2680
- appear: {
2681
- title: "APPEAR",
2682
- icon: "transition",
2683
- tooltip: "Appearance",
2684
- type: "object",
2685
- properties: {
2686
- type: {
2687
- type: "string",
2688
- display: {
2689
- type: "ratio-group"
2690
- },
2691
- enum: ["slide in", "fade in", "mix"]
2692
- },
2693
- duration: {
2694
- type: "string",
2695
- label: "T",
2696
- display: {
2697
- type: "step-selector"
2698
- },
2699
- enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
2700
- },
2701
- direction: {
2702
- type: "string",
2703
- title: "From",
2704
- display: {
2705
- type: "direction-control"
2706
- },
2707
- enum: ["top", "left", "right", "bottom"]
2708
- }
2709
- }
2710
- },
2711
- triggers: {
2712
- title: "TRIGGERS",
2713
- icon: "target",
2714
- tooltip: "Triggers",
2715
- type: "object",
2716
- properties: {
2717
- type: {
2718
- type: "string",
2719
- display: {
2720
- type: "ratio-group"
2721
- },
2722
- enum: ["click", "drag"]
2723
- },
2724
- switch: {
2725
- type: "string",
2726
- display: {
2727
- type: "ratio-group"
2728
- },
2729
- enum: ["image", "50/50"]
2730
- },
2731
- repeat: {
2732
- type: "string",
2733
- title: "Repeat",
2734
- display: {
2735
- visible: false,
2736
- type: "ratio-group"
2737
- },
2738
- enum: ["close", "loop"]
2739
- }
2740
- }
2741
- },
2742
- slider: {
2743
- title: "SLIDER",
2744
- icon: "horizontal-resize",
2745
- tooltip: "Slider",
2746
- type: "object",
2747
- properties: {
2748
- type: {
2749
- type: "string",
2750
- display: {
2751
- type: "ratio-group"
2752
- },
2753
- enum: ["slide", "fade", "scale"]
2754
- },
2755
- direction: {
2756
- type: "string",
2757
- display: {
2758
- type: "ratio-group"
2759
- },
2760
- enum: ["horiz", "vert"]
2761
- },
2762
- duration: {
2763
- type: "string",
2764
- label: "T",
2765
- display: {
2766
- type: "step-selector"
2767
- },
2768
- enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
2769
- }
2770
- }
2771
- },
2772
- thumbnail: {
2773
- title: "THUMB",
2774
- icon: "thumbnail",
2775
- tooltip: "Thumbnail",
2776
- type: "object",
2777
- properties: {
2778
- isActive: {
2779
- type: "boolean",
2780
- display: {
2781
- type: "setting-toggle"
2782
- }
2783
- },
2784
- position: {
2785
- display: {
2786
- type: "align-grid"
2787
- },
2788
- type: "string",
2789
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2790
- },
2791
- fit: {
2792
- type: "string",
2793
- display: {
2794
- type: "ratio-group"
2795
- },
2796
- enum: ["cover", "fit"]
2797
- },
2798
- align: {
2799
- type: "string",
2800
- title: "Align",
2801
- display: {
2802
- type: "align-group",
2803
- direction: "horizontal"
2804
- },
2805
- enum: ["start", "center", "end"]
2806
- },
2807
- triggers: {
2808
- type: "string",
2809
- title: "Triggers",
2810
- display: {
2811
- type: "ratio-group",
2812
- direction: "horizontal"
2813
- },
2814
- enum: ["clk", "hov"]
2815
- },
2816
- grid: {
2817
- type: "object",
2818
- title: "Grid",
2819
- display: {
2820
- type: "group"
2821
- },
2822
- properties: {
2823
- size: {
2824
- type: "number",
2825
- label: "Box",
2826
- scalingEnabled: true,
2827
- display: {
2828
- type: "numeric-input",
2829
- visible: true
2830
- }
2831
- },
2832
- gap: {
2833
- type: "number",
2834
- label: "Gap",
2835
- scalingEnabled: true,
2836
- min: 0,
2837
- display: {
2838
- type: "numeric-input"
2839
- }
2840
- }
2841
- }
2842
- },
2843
- offset: {
2844
- type: "object",
2845
- title: "Offset",
2846
- display: {
2847
- type: "group"
2848
- },
2849
- properties: {
2850
- x: {
2851
- type: "number",
2852
- label: "X",
2853
- scalingEnabled: true,
2854
- display: {
2855
- type: "numeric-input",
2856
- visible: true
2857
- }
2858
- },
2859
- y: {
2860
- type: "number",
2861
- label: "Y",
2862
- scalingEnabled: true,
2863
- display: {
2864
- type: "numeric-input",
2865
- visible: true
2866
- }
2867
- }
2868
- }
2869
- },
2870
- opacity: {
2871
- type: "number",
2872
- title: "Opacity",
2873
- label: "icon:opacity",
2874
- min: 0,
2875
- max: 100,
2876
- step: 1,
2877
- display: {
2878
- type: "numeric-input"
2879
- }
2880
- },
2881
- activeState: {
2882
- type: "object",
2883
- title: "ACTIVE",
2884
- display: {
2885
- type: "group"
2886
- },
2887
- properties: {
2888
- scale: {
2889
- type: "number",
2890
- title: "Scale",
2891
- min: 1,
2892
- max: 5,
2893
- step: 0.1,
2894
- display: {
2895
- type: "range-control"
2896
- }
2897
- },
2898
- opacity: {
2899
- type: "number",
2900
- title: "Opacity",
2901
- label: "icon:opacity",
2902
- min: 0,
2903
- max: 100,
2904
- step: 1,
2905
- display: {
2906
- type: "numeric-input"
2907
- }
2908
- }
2909
- }
2910
- }
2911
- }
2912
- },
2913
- layout: {
2914
- title: "LAYOUT",
2915
- icon: "layout",
2916
- tooltip: "Layout",
2917
- type: "object",
2918
- properties: {
2919
- position: {
2920
- display: {
2921
- type: "align-grid"
2922
- },
2923
- type: "string",
2924
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2925
- },
2926
- offset: {
2927
- type: "object",
2928
- title: "Offset",
2929
- display: {
2930
- type: "group"
2931
- },
2932
- properties: {
2933
- x: {
2934
- type: "number",
2935
- label: "X",
2936
- scalingEnabled: true,
2937
- display: {
2938
- type: "numeric-input",
2939
- visible: true
2940
- }
2941
- },
2942
- y: {
2943
- type: "number",
2944
- label: "Y",
2945
- scalingEnabled: true,
2946
- display: {
2947
- type: "numeric-input",
2948
- visible: true
2949
- }
2950
- }
2951
- }
2952
- },
2953
- padding: {
2954
- type: "object",
2955
- title: "Padding",
2956
- display: {
2957
- type: "padding-controls"
2958
- },
2959
- properties: {
2960
- top: {
2961
- min: 0,
2962
- step: 1,
2963
- type: "number"
2964
- },
2965
- left: {
2966
- min: 0,
2967
- step: 1,
2968
- type: "number"
2969
- },
2970
- right: {
2971
- min: 0,
2972
- step: 1,
2973
- type: "number"
2974
- },
2975
- bottom: {
2976
- min: 0,
2977
- step: 1,
2978
- type: "number"
2979
- }
2980
- }
2981
- }
2982
- }
2983
- },
2984
- controls: {
2985
- title: "CONTROLS",
2986
- icon: "controls",
2987
- tooltip: "Controls",
2988
- type: "object",
2989
- properties: {
2990
- isActive: {
2991
- type: "boolean",
2992
- display: {
2993
- type: "setting-toggle"
2994
- }
2995
- },
2996
- arrowsImgUrl: {
2997
- type: ["string", "null"],
2998
- display: {
2999
- type: "settings-image-input"
3000
- }
3001
- },
3002
- offset: {
3003
- title: "Offset",
3004
- type: "object",
3005
- display: {
3006
- type: "group"
3007
- },
3008
- properties: {
3009
- x: {
3010
- type: "number",
3011
- label: "X",
3012
- scalingEnabled: true,
3013
- display: {
3014
- type: "numeric-input",
3015
- visible: true
3016
- }
3017
- },
3018
- y: {
3019
- type: "number",
3020
- label: "Y",
3021
- scalingEnabled: true,
3022
- display: {
3023
- type: "numeric-input",
3024
- visible: true
3025
- }
3026
- }
3027
- }
3028
- },
3029
- scale: {
3030
- type: "number",
3031
- title: "Scale",
3032
- min: 0.5,
3033
- max: 5,
3034
- step: 0.1,
3035
- display: {
3036
- type: "range-control"
3037
- }
3038
- },
3039
- color: {
3040
- title: "Color",
3041
- type: "string",
3042
- display: {
3043
- type: "settings-color-picker",
3044
- format: "single"
3045
- }
3046
- },
3047
- hover: {
3048
- title: "Hover",
3049
- type: "string",
3050
- display: {
3051
- type: "settings-color-picker",
3052
- format: "single"
3053
- }
3054
- }
3055
- }
3056
- },
3057
- area: {
3058
- title: "AREA",
3059
- icon: "area",
3060
- tooltip: "Area",
3061
- type: "object",
3062
- properties: {
3063
- color: {
3064
- type: "string",
3065
- display: {
3066
- type: "settings-color-picker",
3067
- format: "single"
3068
- }
3069
- },
3070
- blur: {
3071
- type: "number",
3072
- label: "icon:blur",
3073
- display: {
3074
- type: "numeric-input"
3075
- }
3076
- },
3077
- closeIconUrl: {
3078
- type: ["string", "null"],
3079
- title: "Close Icon",
3080
- display: {
3081
- type: "settings-image-input"
3082
- }
3083
- },
3084
- closeIconAlign: {
3085
- display: {
3086
- type: "align-grid",
3087
- direction: "horizontal"
3088
- },
3089
- type: "string",
3090
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
3091
- },
3092
- closeIconScale: {
3093
- type: "number",
3094
- title: "Scale",
3095
- min: 0.5,
3096
- max: 5,
3097
- step: 0.1,
3098
- display: {
3099
- type: "range-control"
3100
- }
3101
- },
3102
- closeIconOffset: {
3103
- type: "object",
3104
- title: "Offset",
3105
- display: {
3106
- type: "group"
3107
- },
3108
- properties: {
3109
- x: {
3110
- type: "number",
3111
- label: "X",
3112
- scalingEnabled: true,
3113
- display: {
3114
- type: "numeric-input",
3115
- visible: true
3116
- }
3117
- },
3118
- y: {
3119
- type: "number",
3120
- label: "Y",
3121
- scalingEnabled: true,
3122
- display: {
3123
- type: "numeric-input",
3124
- visible: true
3125
- }
3126
- }
3127
- }
3128
- },
3129
- closeIconColor: {
3130
- title: "Color",
3131
- type: "string",
3132
- display: {
3133
- type: "settings-color-picker",
3134
- format: "single"
3135
- }
3136
- },
3137
- closeIconHover: {
3138
- title: "Hover",
3139
- type: "string",
3140
- display: {
3141
- type: "settings-color-picker",
3142
- format: "single"
3143
- }
3144
- }
3145
- }
3146
- },
3147
- caption: {
3148
- title: "DESC",
3149
- icon: "text-icon",
3150
- tooltip: "Description",
3151
- type: "object",
3152
- properties: {
3153
- isActive: {
3154
- type: "boolean",
3155
- display: {
3156
- type: "setting-toggle"
3157
- }
3158
- },
3159
- alignment: {
3160
- type: "string",
3161
- display: {
3162
- type: "align-grid"
3163
- },
3164
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
3165
- },
3166
- offset: {
3167
- title: "Offset",
3168
- type: "object",
3169
- display: {
3170
- type: "group"
3171
- },
3172
- properties: {
3173
- x: {
3174
- type: "number",
3175
- label: "X",
3176
- scalingEnabled: true,
3177
- display: {
3178
- type: "numeric-input",
3179
- visible: true
3180
- }
3181
- },
3182
- y: {
3183
- type: "number",
3184
- label: "Y",
3185
- scalingEnabled: true,
3186
- display: {
3187
- type: "numeric-input",
3188
- visible: true
3189
- }
3190
- }
3191
- }
3192
- },
3193
- hover: {
3194
- title: "Link Hover",
3195
- type: "string",
3196
- display: {
3197
- type: "settings-color-picker",
3198
- format: "single"
3199
- }
3200
- }
3201
- }
3202
- }
3203
- }
3204
- }
3205
- },
3206
- default: {
3207
- "d": {
3208
- thumbnailBlock: {
3209
- cover: {
3210
- url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
3211
- }
3212
- },
3213
- lightboxBlock: {
3214
- appear: {
3215
- type: "slide in",
3216
- duration: "1000ms",
3217
- direction: "bottom"
3218
- },
3219
- triggers: {
3220
- type: "click",
3221
- switch: "image",
3222
- repeat: "loop"
3223
- },
3224
- slider: {
3225
- type: "slide",
3226
- direction: "vert",
3227
- duration: "1000ms"
3228
- },
3229
- thumbnail: {
3230
- isActive: true,
3231
- position: "middle-left",
3232
- fit: "fit",
3233
- align: "start",
3234
- triggers: "hov",
3235
- grid: {
3236
- size: 0.05,
3237
- gap: 0.01
3238
- },
3239
- offset: { x: 0.01, y: 0 },
3240
- opacity: 50,
3241
- activeState: {
3242
- scale: 1,
3243
- opacity: 100
3244
- }
3245
- },
3246
- layout: {
3247
- position: "middle-center",
3248
- offset: { x: 0, y: 0 },
3249
- padding: { top: 0.06, right: 0, bottom: 0.06, left: 0 }
3250
- },
3251
- controls: {
3252
- isActive: false,
3253
- arrowsImgUrl: null,
3254
- offset: { x: 0, y: 0 },
3255
- scale: 1,
3256
- color: "#000000",
3257
- hover: "#cccccc"
3258
- },
3259
- area: {
3260
- color: "rgba(28,31,34,0.9)",
3261
- blur: 0,
3262
- closeIconUrl: null,
3263
- closeIconColor: "#000000",
3264
- closeIconHover: "#cccccc",
3265
- closeIconAlign: "top-right",
3266
- closeIconOffset: { x: 0, y: 0 },
3267
- closeIconScale: 1
3268
- },
3269
- caption: {
3270
- isActive: true,
3271
- alignment: "middle-center",
3272
- offset: { x: 0, y: 0 },
3273
- hover: "#cccccc"
3274
- }
3275
- }
3276
- },
3277
- "m": {
3278
- thumbnailBlock: {
3279
- cover: {
3280
- url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
3281
- }
3282
- },
3283
- lightboxBlock: {
3284
- appear: {
3285
- type: "fade in",
3286
- duration: "500ms",
3287
- direction: "bottom"
3288
- },
3289
- triggers: {
3290
- type: "click",
3291
- switch: "image",
3292
- repeat: "loop"
3293
- },
3294
- slider: {
3295
- type: "slide",
3296
- direction: "horiz",
3297
- duration: "1000ms"
3298
- },
3299
- thumbnail: {
3300
- isActive: true,
3301
- position: "bottom-center",
3302
- fit: "fit",
3303
- align: "start",
3304
- triggers: "hov",
3305
- grid: {
3306
- size: 0.1,
3307
- gap: 0.05
3308
- },
3309
- offset: { x: 0.01, y: -0.05 },
3310
- opacity: 50,
3311
- activeState: {
3312
- scale: 1,
3313
- opacity: 100
3314
- }
3315
- },
3316
- layout: {
3317
- position: "middle-center",
3318
- offset: { x: 0, y: 0 },
3319
- padding: { top: 0.06, right: 0.05, bottom: 0.06, left: 0.05 }
3320
- },
3321
- controls: {
3322
- isActive: false,
3323
- arrowsImgUrl: null,
3324
- offset: { x: 0, y: 0 },
3325
- scale: 1,
3326
- color: "#000000",
3327
- hover: "#cccccc"
3328
- },
3329
- area: {
3330
- color: "rgba(28,31,34,0.9)",
3331
- blur: 0,
3332
- closeIconUrl: null,
3333
- closeIconColor: "#000000",
3334
- closeIconHover: "#cccccc",
3335
- closeIconAlign: "top-right",
3336
- closeIconOffset: { x: 0, y: 0 },
3337
- closeIconScale: 1
3338
- },
3339
- caption: {
3340
- isActive: true,
3341
- alignment: "middle-center",
3342
- offset: { x: 0, y: 0 },
3343
- hover: "#cccccc"
3344
- }
3345
- }
3346
- },
3347
- "t": {
3348
- thumbnailBlock: {
3349
- cover: {
3350
- url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
3351
- }
3352
- },
3353
- lightboxBlock: {
3354
- appear: {
3355
- type: "fade in",
3356
- duration: "500ms",
3357
- direction: "bottom"
3358
- },
3359
- triggers: {
3360
- type: "click",
3361
- switch: "image",
3362
- repeat: "loop"
3363
- },
3364
- slider: {
3365
- type: "slide",
3366
- direction: "vert",
3367
- duration: "1000ms"
3368
- },
3369
- thumbnail: {
3370
- isActive: true,
3371
- position: "middle-left",
3372
- fit: "fit",
3373
- align: "start",
3374
- triggers: "hov",
3375
- grid: {
3376
- size: 0.05,
3377
- gap: 0.01
3378
- },
3379
- offset: { x: 0.03, y: 0 },
3380
- opacity: 50,
3381
- activeState: {
3382
- scale: 1,
3383
- opacity: 100
3384
- }
3385
- },
3386
- layout: {
3387
- position: "middle-center",
3388
- offset: { x: 0, y: 0 },
3389
- padding: { top: 0.06, right: 0.1, bottom: 0.06, left: 0.1 }
3390
- },
3391
- controls: {
3392
- isActive: false,
3393
- arrowsImgUrl: null,
3394
- offset: { x: 0, y: 0 },
3395
- scale: 1,
3396
- color: "#000000",
3397
- hover: "#cccccc"
3398
- },
3399
- area: {
3400
- color: "rgba(28,31,34,0.9)",
3401
- blur: 0,
3402
- closeIconUrl: null,
3403
- closeIconColor: "#000000",
3404
- closeIconHover: "#cccccc",
3405
- closeIconAlign: "top-right",
3406
- closeIconOffset: { x: 0, y: 0 },
3407
- closeIconScale: 1
3408
- },
3409
- caption: {
3410
- isActive: true,
3411
- alignment: "middle-center",
3412
- offset: { x: 0, y: 0 },
3413
- hover: "#cccccc"
3414
- }
3415
- }
3416
- }
3417
- },
3418
- displayRules: [
3419
- {
3420
- if: {
3421
- name: "lightboxBlock.appear.type",
3422
- value: "slide in"
3423
- },
3424
- then: {
3425
- name: "properties.lightboxBlock.properties.appear.properties.direction.display.visible",
3426
- value: true
3427
- }
3428
- },
3429
- {
3430
- if: {
3431
- name: "lightboxBlock.slider.direction",
3432
- value: "vert"
3433
- },
3434
- then: {
3435
- name: "properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",
3436
- value: "vertical"
3437
- }
3438
- },
3439
- {
3440
- if: {
3441
- name: "lightboxBlock.appear.type",
3442
- value: "mix"
3443
- },
3444
- then: {
3445
- name: "properties.lightboxBlock.properties.appear.properties.direction.display.visible",
3446
- value: true
3447
- }
3448
- },
3449
- {
3450
- if: {
3451
- name: "lightboxBlock.appear.type",
3452
- value: "fade in"
3453
- },
3454
- then: {
3455
- name: "properties.lightboxBlock.properties.appear.properties.direction.display.visible",
3456
- value: false
3457
- }
3458
- },
3459
- {
3460
- if: [
3461
- { name: "lightboxBlock.triggers.type", value: "click" },
3462
- { name: "lightboxBlock.triggers.switch", value: "image" }
3463
- ],
3464
- then: {
3465
- name: "properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",
3466
- value: true
3467
- }
3468
- }
3469
- ]
3470
- },
3471
- content: {
3472
- layoutBased: false,
3473
- type: "array",
3474
- settings: {
3475
- addItemFromFileExplorer: true,
3476
- defaultWidth: 500
3477
- },
3478
- items: {
3479
- type: "object",
3480
- properties: {
3481
- image: {
3482
- type: "object",
3483
- label: "Image",
3484
- display: {
3485
- type: "media-input",
3486
- minWidth: 58,
3487
- maxWidth: 108
3488
- },
3489
- properties: {
3490
- url: {
3491
- type: "string"
3492
- },
3493
- name: {
3494
- type: "string"
3495
- },
3496
- objectFit: {
3497
- type: "string",
3498
- enum: ["cover", "contain"]
3499
- }
3500
- },
3501
- required: ["url", "name"]
3502
- },
3503
- imageCaption: {
3504
- label: "Description",
3505
- placeholder: "Add Caption...",
3506
- display: {
3507
- type: "rich-text",
3508
- minWidth: 300,
3509
- maxWidth: 550
3510
- }
3511
- }
3512
- },
3513
- required: ["image"]
3514
- },
3515
- default: [
3516
- {
3517
- image: {
3518
- objectFit: "contain",
3519
- url: "https://cdn.cntrl.site/component-assets/2.jpg",
3520
- name: "Slider-1.png"
3521
- },
3522
- imageCaption: [
3523
- {
3524
- type: "paragraph",
3525
- children: [{ text: "" }]
3526
- }
3527
- ]
3528
- },
3529
- {
3530
- image: {
3531
- objectFit: "contain",
3532
- url: "https://cdn.cntrl.site/component-assets/3.jpg",
3533
- name: "Slider-2.png"
3534
- },
3535
- imageCaption: [
3536
- {
3537
- type: "paragraph",
3538
- children: [{ text: "" }]
3539
- }
3540
- ]
3541
- },
3542
- {
3543
- image: {
3544
- objectFit: "contain",
3545
- url: "https://cdn.cntrl.site/component-assets/4.jpg",
3546
- name: "Slider-3.png"
3547
- },
3548
- imageCaption: [
3549
- {
3550
- type: "paragraph",
3551
- children: [{ text: "" }]
3552
- }
3553
- ]
3554
- }
3555
- ]
3556
- },
3557
- styles: {
3558
- layoutBased: true,
3559
- type: "object",
3560
- properties: {
3561
- imageCaption: {
3562
- dataName: "caption",
3563
- type: "object",
3564
- properties: {
3565
- fontSettings: {
3566
- type: "object",
3567
- display: {
3568
- type: "font-settings"
3569
- },
3570
- properties: {
3571
- fontFamily: {
3572
- type: "string"
3573
- },
3574
- fontWeight: {
3575
- type: "number"
3576
- },
3577
- fontStyle: {
3578
- type: "string"
3579
- }
3580
- }
3581
- },
3582
- widthSettings: {
3583
- display: {
3584
- type: "text-width-control"
3585
- },
3586
- type: "object",
3587
- properties: {
3588
- width: {
3589
- type: "number"
3590
- },
3591
- sizing: {
3592
- type: "string",
3593
- enum: ["auto", "manual"]
3594
- }
3595
- }
3596
- },
3597
- fontSizeLineHeight: {
3598
- type: "object",
3599
- display: {
3600
- type: "font-size-line-height"
3601
- },
3602
- properties: {
3603
- fontSize: {
3604
- type: "number"
3605
- },
3606
- lineHeight: {
3607
- type: "number"
3608
- }
3609
- }
3610
- },
3611
- letterSpacing: {
3612
- display: {
3613
- type: "letter-spacing-input"
3614
- },
3615
- type: "number"
3616
- },
3617
- wordSpacing: {
3618
- display: {
3619
- type: "word-spacing-input"
3620
- },
3621
- type: "number"
3622
- },
3623
- textAlign: {
3624
- display: {
3625
- type: "text-align-control"
3626
- },
3627
- type: "string",
3628
- enum: ["left", "center", "right", "justify"]
3629
- },
3630
- textAppearance: {
3631
- display: {
3632
- type: "text-appearance"
3633
- },
3634
- properties: {
3635
- textTransform: {
3636
- type: "string",
3637
- enum: ["none", "uppercase", "lowercase", "capitalize"]
3638
- },
3639
- textDecoration: {
3640
- type: "string",
3641
- enum: ["none", "underline"]
3642
- },
3643
- fontVariant: {
3644
- type: "string",
3645
- enum: ["normal", "small-caps"]
3646
- }
3647
- }
3648
- },
3649
- color: {
3650
- display: {
3651
- type: "style-panel-color-picker"
3652
- },
3653
- type: "string"
3654
- }
3655
- }
3656
- }
3657
- },
3658
- default: {
3659
- imageCaption: {
3660
- widthSettings: {
3661
- width: 0.13,
3662
- sizing: "auto"
3663
- },
3664
- fontSettings: {
3665
- fontFamily: "Arial",
3666
- fontWeight: 400,
3667
- fontStyle: "normal"
3668
- },
3669
- fontSizeLineHeight: {
3670
- fontSize: 0.02,
3671
- lineHeight: 0.02
3672
- },
3673
- letterSpacing: 0,
3674
- wordSpacing: 0,
3675
- textAlign: "left",
3676
- textAppearance: {
3677
- textTransform: "none",
3678
- textDecoration: "none",
3679
- fontVariant: "normal"
3680
- },
3681
- color: "#000000"
3682
- }
3683
- }
3684
- }
3685
- },
3686
- required: ["settings", "content", "styles"]
3687
- }
3688
- };
3689
- const components = [
3690
- ControlSliderComponent,
3691
- ControlImageRevealSliderComponent,
3692
- LightboxComponent
3693
- ];
3694
- exports.components = components;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react/jsx-runtime"),M=require("react"),se=require("classnames"),Pr=require("react-dom"),Br="ControlSlider-module__wrapper___sHEkd",zr="ControlSlider-module__hoverArrow___A-dOH",Fr="ControlSlider-module__sliderItem___QQSkR",Wr="ControlSlider-module__sliderImage___9hRl-",Mr="ControlSlider-module__arrow___05ghY",Vr="ControlSlider-module__arrowVertical___tBfVN",$r="ControlSlider-module__nextArrow___-30Yc",Hr="ControlSlider-module__arrowInner___aEra3",Ur="ControlSlider-module__arrowIcon___S4ztF",Yr="ControlSlider-module__arrowImg___2dwJW",Gr="ControlSlider-module__mirror___brd6U",Xr="ControlSlider-module__pagination___bicLF",Kr="ControlSlider-module__paginationInner___bT-P-",qr="ControlSlider-module__paginationVertical___zYqKw",Jr="ControlSlider-module__paginationItem___nTRbk",Zr="ControlSlider-module__dot___p1Qun",Qr="ControlSlider-module__activeDot___LHFaj",ei="ControlSlider-module__paginationInsideBottom___R3FWn",ti="ControlSlider-module__paginationInsideTop___V-qb-",ni="ControlSlider-module__paginationOutsideBottom___14w8D",ri="ControlSlider-module__paginationOutsideTop___SCLqB",ii="ControlSlider-module__paginationInsideLeft___yOBRZ",oi="ControlSlider-module__paginationInsideRight___Rtt3o",ai="ControlSlider-module__paginationOutsideLeft___lahaw",si="ControlSlider-module__paginationOutsideRight___EtuQa",li="ControlSlider-module__imgWrapper___UjEgB",ci="ControlSlider-module__captionBlock___dJ6-j",ui="ControlSlider-module__captionTextWrapper___HFlpf",di="ControlSlider-module__captionText___uGBVc",pi="ControlSlider-module__active___WZK4G",fi="ControlSlider-module__withPointerEvents___t-18M",gi="ControlSlider-module__topLeftAlignment___zjnGM",mi="ControlSlider-module__topCenterAlignment___gD1xW",hi="ControlSlider-module__topRightAlignment___NMapS",vi="ControlSlider-module__middleLeftAlignment___OnUrY",yi="ControlSlider-module__middleCenterAlignment___Tdkl0",_i="ControlSlider-module__middleRightAlignment___wEbfX",bi="ControlSlider-module__bottomLeftAlignment___cTP2-",Si="ControlSlider-module__bottomCenterAlignment___c54fB",Ei="ControlSlider-module__bottomRightAlignment___kEwrz",wi="ControlSlider-module__clickOverlay___DZA28",xi="ControlSlider-module__contain___pLyq7",Ci="ControlSlider-module__cover___KdDat",$={wrapper:Br,hoverArrow:zr,sliderItem:Fr,sliderImage:Wr,arrow:Mr,arrowVertical:Vr,nextArrow:$r,arrowInner:Hr,arrowIcon:Ur,arrowImg:Yr,mirror:Gr,pagination:Xr,paginationInner:Kr,paginationVertical:qr,paginationItem:Jr,dot:Zr,activeDot:Qr,paginationInsideBottom:ei,paginationInsideTop:ti,paginationOutsideBottom:ni,paginationOutsideTop:ri,paginationInsideLeft:ii,paginationInsideRight:oi,paginationOutsideLeft:ai,paginationOutsideRight:si,imgWrapper:li,captionBlock:ci,captionTextWrapper:ui,captionText:di,active:pi,withPointerEvents:fi,topLeftAlignment:gi,topCenterAlignment:mi,topRightAlignment:hi,middleLeftAlignment:vi,middleCenterAlignment:yi,middleRightAlignment:_i,bottomLeftAlignment:bi,bottomCenterAlignment:Si,bottomRightAlignment:Ei,clickOverlay:wi,contain:xi,cover:Ci};function Ai(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ii(e,n,t){return n&&Ai(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Tn="(prefers-reduced-motion: reduce)",Ke=1,Li=2,Ze=3,tt=4,mt=5,Lt=6,kt=7,Ti={CREATED:Ke,MOUNTED:Li,IDLE:Ze,MOVING:tt,SCROLLING:mt,DRAGGING:Lt,DESTROYED:kt};function Oe(e){e.length=0}function ze(e,n,t){return Array.prototype.slice.call(e,n,t)}function ie(e){return e.bind.apply(e,[null].concat(ze(arguments,1)))}var qn=setTimeout,Qt=function(){};function Rn(e){return requestAnimationFrame(e)}function Bt(e,n){return typeof n===e}function lt(e){return!un(e)&&Bt("object",e)}var cn=Array.isArray,Jn=ie(Bt,"function"),Pe=ie(Bt,"string"),ht=ie(Bt,"undefined");function un(e){return e===null}function Zn(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function vt(e){return cn(e)?e:[e]}function Se(e,n){vt(e).forEach(n)}function dn(e,n){return e.indexOf(n)>-1}function Tt(e,n){return e.push.apply(e,vt(n)),e}function Re(e,n,t){e&&Se(n,function(r){r&&e.classList[t?"add":"remove"](r)})}function Ce(e,n){Re(e,Pe(n)?n.split(" "):n,!0)}function yt(e,n){Se(n,e.appendChild.bind(e))}function pn(e,n){Se(e,function(t){var r=(n||t).parentNode;r&&r.insertBefore(t,n)})}function ct(e,n){return Zn(e)&&(e.msMatchesSelector||e.matches).call(e,n)}function Qn(e,n){var t=e?ze(e.children):[];return n?t.filter(function(r){return ct(r,n)}):t}function _t(e,n){return n?Qn(e,n)[0]:e.firstElementChild}var ut=Object.keys;function Ve(e,n,t){return e&&(t?ut(e).reverse():ut(e)).forEach(function(r){r!=="__proto__"&&n(e[r],r)}),e}function dt(e){return ze(arguments,1).forEach(function(n){Ve(n,function(t,r){e[r]=n[r]})}),e}function De(e){return ze(arguments,1).forEach(function(n){Ve(n,function(t,r){cn(t)?e[r]=t.slice():lt(t)?e[r]=De({},lt(e[r])?e[r]:{},t):e[r]=t})}),e}function Nn(e,n){Se(n||ut(e),function(t){delete e[t]})}function Ae(e,n){Se(e,function(t){Se(n,function(r){t&&t.removeAttribute(r)})})}function q(e,n,t){lt(n)?Ve(n,function(r,o){q(e,o,r)}):Se(e,function(r){un(t)||t===""?Ae(r,n):r.setAttribute(n,String(t))})}function qe(e,n,t){var r=document.createElement(e);return n&&(Pe(n)?Ce(r,n):q(r,n)),t&&yt(t,r),r}function Ee(e,n,t){if(ht(t))return getComputedStyle(e)[n];un(t)||(e.style[n]=""+t)}function pt(e,n){Ee(e,"display",n)}function er(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function we(e,n){return e.getAttribute(n)}function kn(e,n){return e&&e.classList.contains(n)}function _e(e){return e.getBoundingClientRect()}function $e(e){Se(e,function(n){n&&n.parentNode&&n.parentNode.removeChild(n)})}function tr(e){return _t(new DOMParser().parseFromString(e,"text/html").body)}function Te(e,n){e.preventDefault(),n&&(e.stopPropagation(),e.stopImmediatePropagation())}function nr(e,n){return e&&e.querySelector(n)}function fn(e,n){return n?ze(e.querySelectorAll(n)):[]}function Ne(e,n){Re(e,n,!1)}function en(e){return e.timeStamp}function Me(e){return Pe(e)?e:e?e+"px":""}var bt="splide",gn="data-"+bt;function ot(e,n){if(!e)throw new Error("["+bt+"] "+(n||""))}var Be=Math.min,Ot=Math.max,jt=Math.floor,ft=Math.ceil,ye=Math.abs;function rr(e,n,t){return ye(e-n)<t}function Rt(e,n,t,r){var o=Be(n,t),a=Ot(n,t);return r?o<e&&e<a:o<=e&&e<=a}function Ge(e,n,t){var r=Be(n,t),o=Ot(n,t);return Be(Ot(r,e),o)}function tn(e){return+(e>0)-+(e<0)}function nn(e,n){return Se(n,function(t){e=e.replace("%s",""+t)}),e}function mn(e){return e<10?"0"+e:""+e}var On={};function Ri(e){return""+e+mn(On[e]=(On[e]||0)+1)}function ir(){var e=[];function n(i,l,s,d){o(i,l,function(u,S,m){var v="addEventListener"in u,c=v?u.removeEventListener.bind(u,S,s,d):u.removeListener.bind(u,s);v?u.addEventListener(S,s,d):u.addListener(s),e.push([u,S,m,s,c])})}function t(i,l,s){o(i,l,function(d,u,S){e=e.filter(function(m){return m[0]===d&&m[1]===u&&m[2]===S&&(!s||m[3]===s)?(m[4](),!1):!0})})}function r(i,l,s){var d,u=!0;return typeof CustomEvent=="function"?d=new CustomEvent(l,{bubbles:u,detail:s}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(l,u,!1,s)),i.dispatchEvent(d),d}function o(i,l,s){Se(i,function(d){d&&Se(l,function(u){u.split(" ").forEach(function(S){var m=S.split(".");s(d,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),Oe(e)}return{bind:n,unbind:t,dispatch:r,destroy:a}}var Fe="mounted",rn="ready",je="move",nt="moved",hn="click",or="active",ar="inactive",sr="visible",lr="hidden",de="refresh",he="updated",Qe="resize",zt="resized",cr="drag",ur="dragging",dr="dragged",Ft="scroll",Ue="scrolled",Ni="overflow",vn="destroy",pr="arrows:mounted",fr="arrows:updated",gr="pagination:mounted",mr="pagination:updated",yn="navigation:mounted",_n="autoplay:play",hr="autoplay:playing",bn="autoplay:pause",Sn="lazyload:loaded",vr="sk",yr="sh",Dt="ei";function le(e){var n=e?e.event.bus:document.createDocumentFragment(),t=ir();function r(a,i){t.bind(n,vt(a).join(" "),function(l){i.apply(i,cn(l.detail)?l.detail:[])})}function o(a){t.dispatch(n,a,ze(arguments,1))}return e&&e.event.on(vn,t.destroy),dt(t,{bus:n,on:r,off:ie(t.unbind,n),emit:o})}function Wt(e,n,t,r){var o=Date.now,a,i=0,l,s=!0,d=0;function u(){if(!s){if(i=e?Be((o()-a)/e,1):1,t&&t(i),i>=1&&(n(),a=o(),r&&++d>=r))return m();l=Rn(u)}}function S(w){w||c(),a=o()-(w?i*e:0),s=!1,l=Rn(u)}function m(){s=!0}function v(){a=o(),i=0,t&&t(i)}function c(){l&&cancelAnimationFrame(l),i=0,l=0,s=!0}function p(w){e=w}function E(){return s}return{start:S,rewind:v,pause:m,cancel:c,set:p,isPaused:E}}function ki(e){var n=e;function t(o){n=o}function r(o){return dn(vt(o),n)}return{set:t,is:r}}function Oi(e,n){var t=Wt(0,e,null,1);return function(){t.isPaused()&&t.start()}}function ji(e,n,t){var r=e.state,o=t.breakpoints||{},a=t.reducedMotion||{},i=ir(),l=[];function s(){var c=t.mediaQuery==="min";ut(o).sort(function(p,E){return c?+p-+E:+E-+p}).forEach(function(p){u(o[p],"("+(c?"min":"max")+"-width:"+p+"px)")}),u(a,Tn),S()}function d(c){c&&i.destroy()}function u(c,p){var E=matchMedia(p);i.bind(E,"change",S),l.push([c,E])}function S(){var c=r.is(kt),p=t.direction,E=l.reduce(function(w,g){return De(w,g[1].matches?g[0]:{})},{});Nn(t),v(E),t.destroy?e.destroy(t.destroy==="completely"):c?(d(!0),e.mount()):p!==t.direction&&e.refresh()}function m(c){matchMedia(Tn).matches&&(c?De(t,a):Nn(t,ut(a)))}function v(c,p,E){De(t,c),p&&De(Object.getPrototypeOf(t),c),(E||!r.is(Ke))&&e.emit(he,t)}return{setup:s,destroy:d,reduce:m,set:v}}var Mt="Arrow",Vt=Mt+"Left",$t=Mt+"Right",_r=Mt+"Up",br=Mt+"Down",jn="rtl",Ht="ttb",Xt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[_r,$t],ArrowRight:[br,Vt]};function Di(e,n,t){function r(a,i,l){l=l||t.direction;var s=l===jn&&!i?1:l===Ht?0:-1;return Xt[a]&&Xt[a][s]||a.replace(/width|left|right/i,function(d,u){var S=Xt[d.toLowerCase()][s]||d;return u>0?S.charAt(0).toUpperCase()+S.slice(1):S})}function o(a){return a*(t.direction===jn?1:-1)}return{resolve:r,orient:o}}var ke="role",Je="tabindex",Pi="disabled",xe="aria-",St=xe+"controls",Sr=xe+"current",Dn=xe+"selected",be=xe+"label",En=xe+"labelledby",Er=xe+"hidden",wn=xe+"orientation",gt=xe+"roledescription",Pn=xe+"live",Bn=xe+"busy",zn=xe+"atomic",xn=[ke,Je,Pi,St,Sr,be,En,Er,wn,gt],Ie=bt+"__",We="is-",Kt=bt,Fn=Ie+"track",Bi=Ie+"list",Ut=Ie+"slide",wr=Ut+"--clone",zi=Ut+"__container",Cn=Ie+"arrows",Yt=Ie+"arrow",xr=Yt+"--prev",Cr=Yt+"--next",Gt=Ie+"pagination",Ar=Gt+"__page",Fi=Ie+"progress",Wi=Fi+"__bar",Mi=Ie+"toggle",Vi=Ie+"spinner",$i=Ie+"sr",Hi=We+"initialized",He=We+"active",Ir=We+"prev",Lr=We+"next",on=We+"visible",an=We+"loading",Tr=We+"focus-in",Rr=We+"overflow",Ui=[He,on,Ir,Lr,an,Tr,Rr],Yi={slide:Ut,clone:wr,arrows:Cn,arrow:Yt,prev:xr,next:Cr,pagination:Gt,page:Ar,spinner:Vi};function Gi(e,n){if(Jn(e.closest))return e.closest(n);for(var t=e;t&&t.nodeType===1&&!ct(t,n);)t=t.parentElement;return t}var Xi=5,Wn=200,Nr="touchstart mousedown",qt="touchmove mousemove",Jt="touchend touchcancel mouseup click";function Ki(e,n,t){var r=le(e),o=r.on,a=r.bind,i=e.root,l=t.i18n,s={},d=[],u=[],S=[],m,v,c;function p(){b(),W(),g()}function E(){o(de,w),o(de,p),o(he,g),a(document,Nr+" keydown",function(h){c=h.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Re(i,Tr,!!c)})}function w(h){var x=xn.concat("style");Oe(d),Ne(i,u),Ne(m,S),Ae([m,v],x),Ae(i,h?x:["style",gt])}function g(){Ne(i,u),Ne(m,S),u=A(Kt),S=A(Fn),Ce(i,u),Ce(m,S),q(i,be,t.label),q(i,En,t.labelledby)}function b(){m=B("."+Fn),v=_t(m,"."+Bi),ot(m&&v,"A track/list element is missing."),Tt(d,Qn(v,"."+Ut+":not(."+wr+")")),Ve({arrows:Cn,pagination:Gt,prev:xr,next:Cr,bar:Wi,toggle:Mi},function(h,x){s[x]=B("."+h)}),dt(s,{root:i,track:m,list:v,slides:d})}function W(){var h=i.id||Ri(bt),x=t.role;i.id=h,m.id=m.id||h+"-track",v.id=v.id||h+"-list",!we(i,ke)&&i.tagName!=="SECTION"&&x&&q(i,ke,x),q(i,gt,l.carousel),q(v,ke,"presentation")}function B(h){var x=nr(i,h);return x&&Gi(x,"."+Kt)===i?x:void 0}function A(h){return[h+"--"+t.type,h+"--"+t.direction,t.drag&&h+"--draggable",t.isNavigation&&h+"--nav",h===Kt&&He]}return dt(s,{setup:p,mount:E,destroy:w})}var et="slide",rt="loop",Et="fade";function qi(e,n,t,r){var o=le(e),a=o.on,i=o.emit,l=o.bind,s=e.Components,d=e.root,u=e.options,S=u.isNavigation,m=u.updateOnMove,v=u.i18n,c=u.pagination,p=u.slideFocus,E=s.Direction.resolve,w=we(r,"style"),g=we(r,be),b=t>-1,W=_t(r,"."+zi),B;function A(){b||(r.id=d.id+"-slide"+mn(n+1),q(r,ke,c?"tabpanel":"group"),q(r,gt,v.slide),q(r,be,g||nn(v.slideLabel,[n+1,e.length]))),h()}function h(){l(r,"click",ie(i,hn,I)),l(r,"keydown",ie(i,vr,I)),a([nt,yr,Ue],T),a(yn,k),m&&a(je,z)}function x(){B=!0,o.destroy(),Ne(r,Ui),Ae(r,xn),q(r,"style",w),q(r,be,g||"")}function k(){var L=e.splides.map(function(_){var O=_.splide.Components.Slides.getAt(n);return O?O.slide.id:""}).join(" ");q(r,be,nn(v.slideX,(b?t:n)+1)),q(r,St,L),q(r,ke,p?"button":""),p&&Ae(r,gt)}function z(){B||T()}function T(){if(!B){var L=e.index;j(),P(),Re(r,Ir,n===L-1),Re(r,Lr,n===L+1)}}function j(){var L=H();L!==kn(r,He)&&(Re(r,He,L),q(r,Sr,S&&L||""),i(L?or:ar,I))}function P(){var L=f(),_=!L&&(!H()||b);if(e.state.is([tt,mt])||q(r,Er,_||""),q(fn(r,u.focusableNodes||""),Je,_?-1:""),p&&q(r,Je,_?-1:0),L!==kn(r,on)&&(Re(r,on,L),i(L?sr:lr,I)),!L&&document.activeElement===r){var O=s.Slides.getAt(e.index);O&&er(O.slide)}}function U(L,_,O){Ee(O&&W||r,L,_)}function H(){var L=e.index;return L===n||u.cloneStatus&&L===t}function f(){if(e.is(Et))return H();var L=_e(s.Elements.track),_=_e(r),O=E("left",!0),X=E("right",!0);return jt(L[O])<=ft(_[O])&&jt(_[X])<=ft(L[X])}function R(L,_){var O=ye(L-n);return!b&&(u.rewind||e.is(rt))&&(O=Be(O,e.length-O)),O<=_}var I={index:n,slideIndex:t,slide:r,container:W,isClone:b,mount:A,destroy:x,update:T,style:U,isWithin:R};return I}function Ji(e,n,t){var r=le(e),o=r.on,a=r.emit,i=r.bind,l=n.Elements,s=l.slides,d=l.list,u=[];function S(){m(),o(de,v),o(de,m)}function m(){s.forEach(function(T,j){p(T,j,-1)})}function v(){B(function(T){T.destroy()}),Oe(u)}function c(){B(function(T){T.update()})}function p(T,j,P){var U=qi(e,j,P,T);U.mount(),u.push(U),u.sort(function(H,f){return H.index-f.index})}function E(T){return T?A(function(j){return!j.isClone}):u}function w(T){var j=n.Controller,P=j.toIndex(T),U=j.hasFocus()?1:t.perPage;return A(function(H){return Rt(H.index,P,P+U-1)})}function g(T){return A(T)[0]}function b(T,j){Se(T,function(P){if(Pe(P)&&(P=tr(P)),Zn(P)){var U=s[j];U?pn(P,U):yt(d,P),Ce(P,t.classes.slide),x(P,ie(a,Qe))}}),a(de)}function W(T){$e(A(T).map(function(j){return j.slide})),a(de)}function B(T,j){E(j).forEach(T)}function A(T){return u.filter(Jn(T)?T:function(j){return Pe(T)?ct(j.slide,T):dn(vt(T),j.index)})}function h(T,j,P){B(function(U){U.style(T,j,P)})}function x(T,j){var P=fn(T,"img"),U=P.length;U?P.forEach(function(H){i(H,"load error",function(){--U||j()})}):j()}function k(T){return T?s.length:u.length}function z(){return u.length>t.perPage}return{mount:S,destroy:v,update:c,register:p,get:E,getIn:w,getAt:g,add:b,remove:W,forEach:B,filter:A,style:h,getLength:k,isEnough:z}}function Zi(e,n,t){var r=le(e),o=r.on,a=r.bind,i=r.emit,l=n.Slides,s=n.Direction.resolve,d=n.Elements,u=d.root,S=d.track,m=d.list,v=l.getAt,c=l.style,p,E,w;function g(){b(),a(window,"resize load",Oi(ie(i,Qe))),o([he,de],b),o(Qe,W)}function b(){p=t.direction===Ht,Ee(u,"maxWidth",Me(t.width)),Ee(S,s("paddingLeft"),B(!1)),Ee(S,s("paddingRight"),B(!0)),W(!0)}function W(I){var L=_e(u);(I||E.width!==L.width||E.height!==L.height)&&(Ee(S,"height",A()),c(s("marginRight"),Me(t.gap)),c("width",x()),c("height",k(),!0),E=L,i(zt),w!==(w=R())&&(Re(u,Rr,w),i(Ni,w)))}function B(I){var L=t.padding,_=s(I?"right":"left");return L&&Me(L[_]||(lt(L)?0:L))||"0px"}function A(){var I="";return p&&(I=h(),ot(I,"height or heightRatio is missing."),I="calc("+I+" - "+B(!1)+" - "+B(!0)+")"),I}function h(){return Me(t.height||_e(m).width*t.heightRatio)}function x(){return t.autoWidth?null:Me(t.fixedWidth)||(p?"":z())}function k(){return Me(t.fixedHeight)||(p?t.autoHeight?null:z():h())}function z(){var I=Me(t.gap);return"calc((100%"+(I&&" + "+I)+")/"+(t.perPage||1)+(I&&" - "+I)+")"}function T(){return _e(m)[s("width")]}function j(I,L){var _=v(I||0);return _?_e(_.slide)[s("width")]+(L?0:H()):0}function P(I,L){var _=v(I);if(_){var O=_e(_.slide)[s("right")],X=_e(m)[s("left")];return ye(O-X)+(L?0:H())}return 0}function U(I){return P(e.length-1)-P(0)+j(0,I)}function H(){var I=v(0);return I&&parseFloat(Ee(I.slide,s("marginRight")))||0}function f(I){return parseFloat(Ee(S,s("padding"+(I?"Right":"Left"))))||0}function R(){return e.is(Et)||U(!0)>T()}return{mount:g,resize:W,listSize:T,slideSize:j,sliderSize:U,totalSize:P,getPadding:f,isOverflow:R}}var Qi=2;function eo(e,n,t){var r=le(e),o=r.on,a=n.Elements,i=n.Slides,l=n.Direction.resolve,s=[],d;function u(){o(de,S),o([he,Qe],v),(d=E())&&(c(d),n.Layout.resize(!0))}function S(){m(),u()}function m(){$e(s),Oe(s),r.destroy()}function v(){var w=E();d!==w&&(d<w||!w)&&r.emit(de)}function c(w){var g=i.get().slice(),b=g.length;if(b){for(;g.length<w;)Tt(g,g);Tt(g.slice(-w),g.slice(0,w)).forEach(function(W,B){var A=B<w,h=p(W.slide,B);A?pn(h,g[0].slide):yt(a.list,h),Tt(s,h),i.register(h,B-w+(A?0:b),W.index)})}}function p(w,g){var b=w.cloneNode(!0);return Ce(b,t.classes.clone),b.id=e.root.id+"-clone"+mn(g+1),b}function E(){var w=t.clones;if(!e.is(rt))w=0;else if(ht(w)){var g=t[l("fixedWidth")]&&n.Layout.slideSize(0),b=g&&ft(_e(a.track)[l("width")]/g);w=b||t[l("autoWidth")]&&e.length||t.perPage*Qi}return w}return{mount:u,destroy:m}}function to(e,n,t){var r=le(e),o=r.on,a=r.emit,i=e.state.set,l=n.Layout,s=l.slideSize,d=l.getPadding,u=l.totalSize,S=l.listSize,m=l.sliderSize,v=n.Direction,c=v.resolve,p=v.orient,E=n.Elements,w=E.list,g=E.track,b;function W(){b=n.Transition,o([Fe,zt,he,de],B)}function B(){n.Controller.isBusy()||(n.Scroll.cancel(),h(e.index),n.Slides.update())}function A(_,O,X,re){_!==O&&I(_>X)&&(T(),x(z(U(),_>X),!0)),i(tt),a(je,O,X,_),b.start(O,function(){i(Ze),a(nt,O,X,_),re&&re()})}function h(_){x(P(_,!0))}function x(_,O){if(!e.is(Et)){var X=O?_:k(_);Ee(w,"transform","translate"+c("X")+"("+X+"px)"),_!==X&&a(yr)}}function k(_){if(e.is(rt)){var O=j(_),X=O>n.Controller.getEnd(),re=O<0;(re||X)&&(_=z(_,X))}return _}function z(_,O){var X=_-R(O),re=m();return _-=p(re*(ft(ye(X)/re)||1))*(O?1:-1),_}function T(){x(U(),!0),b.cancel()}function j(_){for(var O=n.Slides.get(),X=0,re=1/0,te=0;te<O.length;te++){var me=O[te].index,C=ye(P(me,!0)-_);if(C<=re)re=C,X=me;else break}return X}function P(_,O){var X=p(u(_-1)-f(_));return O?H(X):X}function U(){var _=c("left");return _e(w)[_]-_e(g)[_]+p(d(!1))}function H(_){return t.trimSpace&&e.is(et)&&(_=Ge(_,0,p(m(!0)-S()))),_}function f(_){var O=t.focus;return O==="center"?(S()-s(_,!0))/2:+O*s(_)||0}function R(_){return P(_?n.Controller.getEnd():0,!!t.trimSpace)}function I(_){var O=p(z(U(),_));return _?O>=0:O<=w[c("scrollWidth")]-_e(g)[c("width")]}function L(_,O){O=ht(O)?U():O;var X=_!==!0&&p(O)<p(R(!1)),re=_!==!1&&p(O)>p(R(!0));return X||re}return{mount:W,move:A,jump:h,translate:x,shift:z,cancel:T,toIndex:j,toPosition:P,getPosition:U,getLimit:R,exceededLimit:L,reposition:B}}function no(e,n,t){var r=le(e),o=r.on,a=r.emit,i=n.Move,l=i.getPosition,s=i.getLimit,d=i.toPosition,u=n.Slides,S=u.isEnough,m=u.getLength,v=t.omitEnd,c=e.is(rt),p=e.is(et),E=ie(U,!1),w=ie(U,!0),g=t.start||0,b,W=g,B,A,h;function x(){k(),o([he,de,Dt],k),o(zt,z)}function k(){B=m(!0),A=t.perMove,h=t.perPage,b=I();var C=Ge(g,0,v?b:B-1);C!==g&&(g=C,i.reposition())}function z(){b!==I()&&a(Dt)}function T(C,J,ge){if(!me()){var oe=P(C),fe=R(oe);fe>-1&&(J||fe!==g)&&(X(fe),i.move(oe,fe,W,ge))}}function j(C,J,ge,oe){n.Scroll.scroll(C,J,ge,function(){var fe=R(i.toIndex(l()));X(v?Be(fe,b):fe),oe&&oe()})}function P(C){var J=g;if(Pe(C)){var ge=C.match(/([+\-<>])(\d+)?/)||[],oe=ge[1],fe=ge[2];oe==="+"||oe==="-"?J=H(g+ +(""+oe+(+fe||1)),g):oe===">"?J=fe?L(+fe):E(!0):oe==="<"&&(J=w(!0))}else J=c?C:Ge(C,0,b);return J}function U(C,J){var ge=A||(te()?1:h),oe=H(g+ge*(C?-1:1),g,!(A||te()));return oe===-1&&p&&!rr(l(),s(!C),1)?C?0:b:J?oe:R(oe)}function H(C,J,ge){if(S()||te()){var oe=f(C);oe!==C&&(J=C,C=oe,ge=!1),C<0||C>b?!A&&(Rt(0,C,J,!0)||Rt(b,J,C,!0))?C=L(_(C)):c?C=ge?C<0?-(B%h||h):B:C:t.rewind?C=C<0?b:0:C=-1:ge&&C!==J&&(C=L(_(J)+(C<J?-1:1)))}else C=-1;return C}function f(C){if(p&&t.trimSpace==="move"&&C!==g)for(var J=l();J===d(C,!0)&&Rt(C,0,e.length-1,!t.rewind);)C<g?--C:++C;return C}function R(C){return c?(C+B)%B||0:C}function I(){for(var C=B-(te()||c&&A?1:h);v&&C-- >0;)if(d(B-1,!0)!==d(C,!0)){C++;break}return Ge(C,0,B-1)}function L(C){return Ge(te()?C:h*C,0,b)}function _(C){return te()?Be(C,b):jt((C>=b?B-1:C)/h)}function O(C){var J=i.toIndex(C);return p?Ge(J,0,b):J}function X(C){C!==g&&(W=g,g=C)}function re(C){return C?W:g}function te(){return!ht(t.focus)||t.isNavigation}function me(){return e.state.is([tt,mt])&&!!t.waitForTransition}return{mount:x,go:T,scroll:j,getNext:E,getPrev:w,getAdjacent:U,getEnd:I,setIndex:X,getIndex:re,toIndex:L,toPage:_,toDest:O,hasFocus:te,isBusy:me}}var ro="http://www.w3.org/2000/svg",io="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",At=40;function oo(e,n,t){var r=le(e),o=r.on,a=r.bind,i=r.emit,l=t.classes,s=t.i18n,d=n.Elements,u=n.Controller,S=d.arrows,m=d.track,v=S,c=d.prev,p=d.next,E,w,g={};function b(){B(),o(he,W)}function W(){A(),b()}function B(){var j=t.arrows;j&&!(c&&p)&&k(),c&&p&&(dt(g,{prev:c,next:p}),pt(v,j?"":"none"),Ce(v,w=Cn+"--"+t.direction),j&&(h(),T(),q([c,p],St,m.id),i(pr,c,p)))}function A(){r.destroy(),Ne(v,w),E?($e(S?[c,p]:v),c=p=null):Ae([c,p],xn)}function h(){o([Fe,nt,de,Ue,Dt],T),a(p,"click",ie(x,">")),a(c,"click",ie(x,"<"))}function x(j){u.go(j,!0)}function k(){v=S||qe("div",l.arrows),c=z(!0),p=z(!1),E=!0,yt(v,[c,p]),!S&&pn(v,m)}function z(j){var P='<button class="'+l.arrow+" "+(j?l.prev:l.next)+'" type="button"><svg xmlns="'+ro+'" viewBox="0 0 '+At+" "+At+'" width="'+At+'" height="'+At+'" focusable="false"><path d="'+(t.arrowPath||io)+'" />';return tr(P)}function T(){if(c&&p){var j=e.index,P=u.getPrev(),U=u.getNext(),H=P>-1&&j<P?s.last:s.prev,f=U>-1&&j>U?s.first:s.next;c.disabled=P<0,p.disabled=U<0,q(c,be,H),q(p,be,f),i(fr,c,p,P,U)}}return{arrows:g,mount:b,destroy:A,update:T}}var ao=gn+"-interval";function so(e,n,t){var r=le(e),o=r.on,a=r.bind,i=r.emit,l=Wt(t.interval,e.go.bind(e,">"),h),s=l.isPaused,d=n.Elements,u=n.Elements,S=u.root,m=u.toggle,v=t.autoplay,c,p,E=v==="pause";function w(){v&&(g(),m&&q(m,St,d.track.id),E||b(),A())}function g(){t.pauseOnHover&&a(S,"mouseenter mouseleave",function(k){c=k.type==="mouseenter",B()}),t.pauseOnFocus&&a(S,"focusin focusout",function(k){p=k.type==="focusin",B()}),m&&a(m,"click",function(){E?b():W(!0)}),o([je,Ft,de],l.rewind),o(je,x)}function b(){s()&&n.Slides.isEnough()&&(l.start(!t.resetProgress),p=c=E=!1,A(),i(_n))}function W(k){k===void 0&&(k=!0),E=!!k,A(),s()||(l.pause(),i(bn))}function B(){E||(c||p?W(!1):b())}function A(){m&&(Re(m,He,!E),q(m,be,t.i18n[E?"play":"pause"]))}function h(k){var z=d.bar;z&&Ee(z,"width",k*100+"%"),i(hr,k)}function x(k){var z=n.Slides.getAt(k);l.set(z&&+we(z.slide,ao)||t.interval)}return{mount:w,destroy:l.cancel,play:b,pause:W,isPaused:s}}function lo(e,n,t){var r=le(e),o=r.on;function a(){t.cover&&(o(Sn,ie(l,!0)),o([Fe,he,de],ie(i,!0)))}function i(s){n.Slides.forEach(function(d){var u=_t(d.container||d.slide,"img");u&&u.src&&l(s,u,d)})}function l(s,d,u){u.style("background",s?'center/cover no-repeat url("'+d.src+'")':"",!0),pt(d,s?"none":"")}return{mount:a,destroy:ie(i,!1)}}var co=10,uo=600,po=.6,fo=1.5,go=800;function mo(e,n,t){var r=le(e),o=r.on,a=r.emit,i=e.state.set,l=n.Move,s=l.getPosition,d=l.getLimit,u=l.exceededLimit,S=l.translate,m=e.is(et),v,c,p=1;function E(){o(je,W),o([he,de],B)}function w(h,x,k,z,T){var j=s();if(W(),k&&(!m||!u())){var P=n.Layout.sliderSize(),U=tn(h)*P*jt(ye(h)/P)||0;h=l.toPosition(n.Controller.toDest(h%P))+U}var H=rr(j,h,1);p=1,x=H?0:x||Ot(ye(h-j)/fo,go),c=z,v=Wt(x,g,ie(b,j,h,T),1),i(mt),a(Ft),v.start()}function g(){i(Ze),c&&c(),a(Ue)}function b(h,x,k,z){var T=s(),j=h+(x-h)*A(z),P=(j-T)*p;S(T+P),m&&!k&&u()&&(p*=po,ye(P)<co&&w(d(u(!0)),uo,!1,c,!0))}function W(){v&&v.cancel()}function B(){v&&!v.isPaused()&&(W(),g())}function A(h){var x=t.easingFunc;return x?x(h):1-Math.pow(1-h,4)}return{mount:E,destroy:W,scroll:w,cancel:B}}var Xe={passive:!1,capture:!0};function ho(e,n,t){var r=le(e),o=r.on,a=r.emit,i=r.bind,l=r.unbind,s=e.state,d=n.Move,u=n.Scroll,S=n.Controller,m=n.Elements.track,v=n.Media.reduce,c=n.Direction,p=c.resolve,E=c.orient,w=d.getPosition,g=d.exceededLimit,b,W,B,A,h,x=!1,k,z,T;function j(){i(m,qt,Qt,Xe),i(m,Jt,Qt,Xe),i(m,Nr,U,Xe),i(m,"click",R,{capture:!0}),i(m,"dragstart",Te),o([Fe,he],P)}function P(){var F=t.drag;wt(!F),A=F==="free"}function U(F){if(k=!1,!z){var y=fe(F);oe(F.target)&&(y||!F.button)&&(S.isBusy()?Te(F,!0):(T=y?m:window,h=s.is([tt,mt]),B=null,i(T,qt,H,Xe),i(T,Jt,f,Xe),d.cancel(),u.cancel(),I(F)))}}function H(F){if(s.is(Lt)||(s.set(Lt),a(cr)),F.cancelable)if(h){d.translate(b+ge(te(F)));var y=me(F)>Wn,V=x!==(x=g());(y||V)&&I(F),k=!0,a(ur),Te(F)}else O(F)&&(h=_(F),Te(F))}function f(F){s.is(Lt)&&(s.set(Ze),a(dr)),h&&(L(F),Te(F)),l(T,qt,H),l(T,Jt,f),h=!1}function R(F){!z&&k&&Te(F,!0)}function I(F){B=W,W=F,b=w()}function L(F){var y=X(F),V=re(y),G=t.rewind&&t.rewindByDrag;v(!1),A?S.scroll(V,0,t.snap):e.is(Et)?S.go(E(tn(y))<0?G?"<":"-":G?">":"+"):e.is(et)&&x&&G?S.go(g(!0)?">":"<"):S.go(S.toDest(V),!0),v(!0)}function _(F){var y=t.dragMinThreshold,V=lt(y),G=V&&y.mouse||0,Z=(V?y.touch:+y)||10;return ye(te(F))>(fe(F)?Z:G)}function O(F){return ye(te(F))>ye(te(F,!0))}function X(F){if(e.is(rt)||!x){var y=me(F);if(y&&y<Wn)return te(F)/y}return 0}function re(F){return w()+tn(F)*Be(ye(F)*(t.flickPower||600),A?1/0:n.Layout.listSize()*(t.flickMaxPages||1))}function te(F,y){return J(F,y)-J(C(F),y)}function me(F){return en(F)-en(C(F))}function C(F){return W===F&&B||W}function J(F,y){return(fe(F)?F.changedTouches[0]:F)["page"+p(y?"Y":"X")]}function ge(F){return F/(x&&e.is(et)?Xi:1)}function oe(F){var y=t.noDrag;return!ct(F,"."+Ar+", ."+Yt)&&(!y||!ct(F,y))}function fe(F){return typeof TouchEvent<"u"&&F instanceof TouchEvent}function it(){return h}function wt(F){z=F}return{mount:j,disable:wt,isDragging:it}}var vo={Spacebar:" ",Right:$t,Left:Vt,Up:_r,Down:br};function An(e){return e=Pe(e)?e:e.key,vo[e]||e}var Mn="keydown";function yo(e,n,t){var r=le(e),o=r.on,a=r.bind,i=r.unbind,l=e.root,s=n.Direction.resolve,d,u;function S(){m(),o(he,v),o(he,m),o(je,p)}function m(){var w=t.keyboard;w&&(d=w==="global"?window:l,a(d,Mn,E))}function v(){i(d,Mn)}function c(w){u=w}function p(){var w=u;u=!0,qn(function(){u=w})}function E(w){if(!u){var g=An(w);g===s(Vt)?e.go("<"):g===s($t)&&e.go(">")}}return{mount:S,destroy:v,disable:c}}var at=gn+"-lazy",Nt=at+"-srcset",_o="["+at+"], ["+Nt+"]";function bo(e,n,t){var r=le(e),o=r.on,a=r.off,i=r.bind,l=r.emit,s=t.lazyLoad==="sequential",d=[nt,Ue],u=[];function S(){t.lazyLoad&&(m(),o(de,m))}function m(){Oe(u),v(),s?w():(a(d),o(d,c),c())}function v(){n.Slides.forEach(function(g){fn(g.slide,_o).forEach(function(b){var W=we(b,at),B=we(b,Nt);if(W!==b.src||B!==b.srcset){var A=t.classes.spinner,h=b.parentElement,x=_t(h,"."+A)||qe("span",A,h);u.push([b,g,x]),b.src||pt(b,"none")}})})}function c(){u=u.filter(function(g){var b=t.perPage*((t.preloadPages||1)+1)-1;return g[1].isWithin(e.index,b)?p(g):!0}),u.length||a(d)}function p(g){var b=g[0];Ce(g[1].slide,an),i(b,"load error",ie(E,g)),q(b,"src",we(b,at)),q(b,"srcset",we(b,Nt)),Ae(b,at),Ae(b,Nt)}function E(g,b){var W=g[0],B=g[1];Ne(B.slide,an),b.type!=="error"&&($e(g[2]),pt(W,""),l(Sn,W,B),l(Qe)),s&&w()}function w(){u.length&&p(u.shift())}return{mount:S,destroy:ie(Oe,u),check:c}}function So(e,n,t){var r=le(e),o=r.on,a=r.emit,i=r.bind,l=n.Slides,s=n.Elements,d=n.Controller,u=d.hasFocus,S=d.getIndex,m=d.go,v=n.Direction.resolve,c=s.pagination,p=[],E,w;function g(){b(),o([he,de,Dt],g);var z=t.pagination;c&&pt(c,z?"":"none"),z&&(o([je,Ft,Ue],k),W(),k(),a(gr,{list:E,items:p},x(e.index)))}function b(){E&&($e(c?ze(E.children):E),Ne(E,w),Oe(p),E=null),r.destroy()}function W(){var z=e.length,T=t.classes,j=t.i18n,P=t.perPage,U=u()?d.getEnd()+1:ft(z/P);E=c||qe("ul",T.pagination,s.track.parentElement),Ce(E,w=Gt+"--"+h()),q(E,ke,"tablist"),q(E,be,j.select),q(E,wn,h()===Ht?"vertical":"");for(var H=0;H<U;H++){var f=qe("li",null,E),R=qe("button",{class:T.page,type:"button"},f),I=l.getIn(H).map(function(_){return _.slide.id}),L=!u()&&P>1?j.pageX:j.slideX;i(R,"click",ie(B,H)),t.paginationKeyboard&&i(R,"keydown",ie(A,H)),q(f,ke,"presentation"),q(R,ke,"tab"),q(R,St,I.join(" ")),q(R,be,nn(L,H+1)),q(R,Je,-1),p.push({li:f,button:R,page:H})}}function B(z){m(">"+z,!0)}function A(z,T){var j=p.length,P=An(T),U=h(),H=-1;P===v($t,!1,U)?H=++z%j:P===v(Vt,!1,U)?H=(--z+j)%j:P==="Home"?H=0:P==="End"&&(H=j-1);var f=p[H];f&&(er(f.button),m(">"+H),Te(T,!0))}function h(){return t.paginationDirection||t.direction}function x(z){return p[d.toPage(z)]}function k(){var z=x(S(!0)),T=x(S());if(z){var j=z.button;Ne(j,He),Ae(j,Dn),q(j,Je,-1)}if(T){var P=T.button;Ce(P,He),q(P,Dn,!0),q(P,Je,"")}a(mr,{list:E,items:p},z,T)}return{items:p,mount:g,destroy:b,getAt:x,update:k}}var Eo=[" ","Enter"];function wo(e,n,t){var r=t.isNavigation,o=t.slideFocus,a=[];function i(){e.splides.forEach(function(c){c.isParent||(d(e,c.splide),d(c.splide,e))}),r&&u()}function l(){a.forEach(function(c){c.destroy()}),Oe(a)}function s(){l(),i()}function d(c,p){var E=le(c);E.on(je,function(w,g,b){p.go(p.is(rt)?b:w)}),a.push(E)}function u(){var c=le(e),p=c.on;p(hn,m),p(vr,v),p([Fe,he],S),a.push(c),c.emit(yn,e.splides)}function S(){q(n.Elements.list,wn,t.direction===Ht?"vertical":"")}function m(c){e.go(c.index)}function v(c,p){dn(Eo,An(p))&&(m(c),Te(p))}return{setup:ie(n.Media.set,{slideFocus:ht(o)?r:o},!0),mount:i,destroy:l,remount:s}}function xo(e,n,t){var r=le(e),o=r.bind,a=0;function i(){t.wheel&&o(n.Elements.track,"wheel",l,Xe)}function l(d){if(d.cancelable){var u=d.deltaY,S=u<0,m=en(d),v=t.wheelMinThreshold||0,c=t.wheelSleep||0;ye(u)>v&&m-a>c&&(e.go(S?"<":">"),a=m),s(S)&&Te(d)}}function s(d){return!t.releaseWheel||e.state.is(tt)||n.Controller.getAdjacent(d)!==-1}return{mount:i}}var Co=90;function Ao(e,n,t){var r=le(e),o=r.on,a=n.Elements.track,i=t.live&&!t.isNavigation,l=qe("span",$i),s=Wt(Co,ie(u,!1));function d(){i&&(m(!n.Autoplay.isPaused()),q(a,zn,!0),l.textContent="…",o(_n,ie(m,!0)),o(bn,ie(m,!1)),o([nt,Ue],ie(u,!0)))}function u(v){q(a,Bn,v),v?(yt(a,l),s.start()):($e(l),s.cancel())}function S(){Ae(a,[Pn,zn,Bn]),$e(l)}function m(v){i&&q(a,Pn,v?"off":"polite")}return{mount:d,disable:m,destroy:S}}var Io=Object.freeze({__proto__:null,Media:ji,Direction:Di,Elements:Ki,Slides:Ji,Layout:Zi,Clones:eo,Move:to,Controller:no,Arrows:oo,Autoplay:so,Cover:lo,Scroll:mo,Drag:ho,Keyboard:yo,LazyLoad:bo,Pagination:So,Sync:wo,Wheel:xo,Live:Ao}),Lo={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},To={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Yi,i18n:Lo,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Ro(e,n,t){var r=n.Slides;function o(){le(e).on([Fe,de],a)}function a(){r.forEach(function(l){l.style("transform","translateX(-"+100*l.index+"%)")})}function i(l,s){r.style("transition","opacity "+t.speed+"ms "+t.easing),qn(s)}return{mount:o,start:i,cancel:Qt}}function No(e,n,t){var r=n.Move,o=n.Controller,a=n.Scroll,i=n.Elements.list,l=ie(Ee,i,"transition"),s;function d(){le(e).bind(i,"transitionend",function(v){v.target===i&&s&&(S(),s())})}function u(v,c){var p=r.toPosition(v,!0),E=r.getPosition(),w=m(v);ye(p-E)>=1&&w>=1?t.useScroll?a.scroll(p,w,!1,c):(l("transform "+w+"ms "+t.easing),r.translate(p,!0),s=c):(r.jump(v),c())}function S(){l(""),a.cancel()}function m(v){var c=t.rewindSpeed;if(e.is(et)&&c){var p=o.getIndex(!0),E=o.getEnd();if(p===0&&v>=E||p>=E&&v===0)return c}return t.speed}return{mount:d,start:u,cancel:S}}var ko=(function(){function e(t,r){this.event=le(),this.Components={},this.state=ki(Ke),this.splides=[],this._o={},this._E={};var o=Pe(t)?nr(document,t):t;ot(o,o+" is invalid."),this.root=o,r=De({label:we(o,be)||"",labelledby:we(o,En)||""},To,e.defaults,r||{});try{De(r,JSON.parse(we(o,gn)))}catch{ot(!1,"Invalid JSON")}this._o=Object.create(De({},r))}var n=e.prototype;return n.mount=function(r,o){var a=this,i=this.state,l=this.Components;ot(i.is([Ke,kt]),"Already mounted!"),i.set(Ke),this._C=l,this._T=o||this._T||(this.is(Et)?Ro:No),this._E=r||this._E;var s=dt({},Io,this._E,{Transition:this._T});return Ve(s,function(d,u){var S=d(a,l,a._o);l[u]=S,S.setup&&S.setup()}),Ve(l,function(d){d.mount&&d.mount()}),this.emit(Fe),Ce(this.root,Hi),i.set(Ze),this.emit(rn),this},n.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(Ze)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},n.go=function(r){return this._C.Controller.go(r),this},n.on=function(r,o){return this.event.on(r,o),this},n.off=function(r){return this.event.off(r),this},n.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(ze(arguments,1))),this},n.add=function(r,o){return this._C.Slides.add(r,o),this},n.remove=function(r){return this._C.Slides.remove(r),this},n.is=function(r){return this._o.type===r},n.refresh=function(){return this.emit(de),this},n.destroy=function(r){r===void 0&&(r=!0);var o=this.event,a=this.state;return a.is(Ke)?le(this).on(rn,this.destroy.bind(this,r)):(Ve(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(vn),o.destroy(),r&&Oe(this.splides),a.set(kt)),this},Ii(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),In=ko;In.defaults={};In.STATES=Ti;var Vn=[[Fe,"onMounted"],[rn,"onReady"],[je,"onMove"],[nt,"onMoved"],[hn,"onClick"],[or,"onActive"],[ar,"onInactive"],[sr,"onVisible"],[lr,"onHidden"],[de,"onRefresh"],[he,"onUpdated"],[Qe,"onResize"],[zt,"onResized"],[cr,"onDrag"],[ur,"onDragging"],[dr,"onDragged"],[Ft,"onScroll"],[Ue,"onScrolled"],[vn,"onDestroy"],[pr,"onArrowsMounted"],[fr,"onArrowsUpdated"],[gr,"onPaginationMounted"],[mr,"onPaginationUpdated"],[yn,"onNavigationMounted"],[_n,"onAutoplayPlay"],[hr,"onAutoplayPlaying"],[bn,"onAutoplayPause"],[Sn,"onLazyLoadLoaded"]];function Ln(...e){return e.filter(Boolean).join(" ")}function Pt(e){return e!==null&&typeof e=="object"}function sn(e,n){if(Array.isArray(e)&&Array.isArray(n))return e.length===n.length&&!e.some((t,r)=>!sn(t,n[r]));if(Pt(e)&&Pt(n)){const t=Object.keys(e),r=Object.keys(n);return t.length===r.length&&!t.some(o=>!Object.prototype.hasOwnProperty.call(n,o)||!sn(e[o],n[o]))}return e===n}function Oo(e,n){return e.length===n.length&&!e.some((t,r)=>t!==n[r])}function jo(e,n){if(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];if(o!=="__proto__"&&n(e[o],o)===!1)break}}return e}function ln(e,n){const t=e;return jo(n,(r,o)=>{Array.isArray(r)?t[o]=r.slice():Pt(r)?t[o]=ln(Pt(t[o])?t[o]:{},r):t[o]=r}),t}var Do=({children:e,className:n,...t})=>M.createElement("div",{className:Ln("splide__track",n),...t},M.createElement("ul",{className:"splide__list"},e)),kr=class extends M.Component{constructor(){super(...arguments),this.splideRef=M.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:n,transition:t}=this.props,{current:r}=this.splideRef;r&&(this.splide=new In(r,e),this.bind(this.splide),this.splide.mount(n,t),this.options=ln({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!sn(this.options,e)&&(this.splide.options=e,this.options=ln({},e));const n=this.getSlides();Oo(this.slides,n)||(this.splide.refresh(),this.slides=n)}sync(e){var n;(n=this.splide)==null||n.sync(e)}go(e){var n;(n=this.splide)==null||n.go(e)}getSlides(){var e;if(this.splide){const n=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return n&&Array.prototype.slice.call(n)||[]}return[]}bind(e){Vn.forEach(([n,t])=>{const r=this.props[t];typeof r=="function"&&e.on(n,(...o)=>{r(e,...o)})})}omit(e,n){return n.forEach(t=>{Object.prototype.hasOwnProperty.call(e,t)&&delete e[t]}),e}render(){const{className:e,tag:n="div",hasTrack:t=!0,children:r,...o}=this.props;return M.createElement(n,{className:Ln("splide",e),ref:this.splideRef,...this.omit(o,["options",...Vn.map(a=>a[1])])},t?M.createElement(Do,null,r):r)}},Or=({children:e,className:n,...t})=>M.createElement("li",{className:Ln("splide__slide",n),...t},e);/*!
2
+ * Splide.js
3
+ * Version : 4.1.3
4
+ * License : MIT
5
+ * Copyright: 2022 Naotoshi Fujita
6
+ */const Po="RichTextRenderer-module__link___BWeZ2",Bo={link:Po},jr=({content:e})=>{const n=t=>t.map((r,o)=>r.type==="link"?N.jsx("a",{className:Bo.link,href:r.value,target:r.target,children:n(r.children)},o):N.jsx("span",{style:zo(r),children:r.text},o));return N.jsx(N.Fragment,{children:e.map((t,r)=>{const o=t.children;return N.jsx("div",{children:n(o)},r)})})};function zo(e){return{...e.fontFamily&&{fontFamily:e.fontFamily},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function Y(e,n=!1){return n?`calc(var(--cntrl-article-width) * ${e})`:`${e*100}vw`}const Fo="SvgImage-module__svg___q3xE-",Wo="SvgImage-module__img___VsTm-",$n={svg:Fo,img:Wo},st=({url:e,fill:n="#000000",hoverFill:t="#CCCCCC",className:r=""})=>{const[o,a]=M.useState(!0);return M.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!e.endsWith(".svg")||!o?N.jsx("img",{src:e,alt:"",className:se($n.img,r)}):N.jsx("span",{"data-supports-mask":o,className:se($n.svg,r),style:{"--svg":`url(${e})`,"--fill":n,"--hover-fill":t}})},Mo={"top-left":$.topLeftAlignment,"top-center":$.topCenterAlignment,"top-right":$.topRightAlignment,"middle-left":$.middleLeftAlignment,"middle-center":$.middleCenterAlignment,"middle-right":$.middleRightAlignment,"bottom-left":$.bottomLeftAlignment,"bottom-center":$.bottomCenterAlignment,"bottom-right":$.bottomRightAlignment};function Vo({settings:e,content:n,styles:t,isEditor:r}){const[o,a]=M.useState(null),{widthSettings:i,fontSettings:l,letterSpacing:s,textAlign:d,wordSpacing:u,fontSizeLineHeight:S,textAppearance:m,color:v}=t.imageCaption,[c,p]=M.useState(void 0),[E,w]=M.useState(null),[g,b]=M.useState(0),[W,B]=M.useState(0),{direction:A,transition:h,controls:x,pagination:k,imageCaption:z,triggers:T}=e,j=M.useRef(h.type),{x:P,y:U}=e.controls.offset,H=f=>{o&&o.go(f)};return M.useEffect(()=>{if(!E)return;const f=new ResizeObserver(R=>{if(!o)return;const[I]=R;p({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return f.observe(E),()=>f.unobserve(E)},[E]),M.useEffect(()=>{!o||j.current===h.type||(B(f=>f+1),j.current=h.type)},[h.type]),N.jsx("div",{className:se($.wrapper,{[$.editor]:r}),ref:w,children:N.jsxs("div",{className:$.sliderInner,style:{width:c?c.width:"100%",height:c?c.height:"100%",backgroundColor:h.backgroundColor&&h.type==="fade in"?h.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&N.jsx("div",{className:se($.captionBlock),children:N.jsx("div",{className:$.captionTextWrapper,children:n.map((f,R)=>N.jsx("div",{className:se($.captionText,Mo[z.alignment],{[$.withPointerEvents]:R===g&&r,[$.active]:R===g}),style:{fontFamily:l.fontFamily,fontWeight:l.fontWeight,fontStyle:l.fontStyle,width:i.sizing==="auto"?"max-content":Y(i.width,r),letterSpacing:Y(s,r),wordSpacing:Y(u,r),textAlign:d,fontSize:Y(S.fontSize,r),lineHeight:Y(S.lineHeight,r),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:v,transitionDuration:h.duration?`${Math.round(parseInt(h.duration)/2)}ms`:"500ms"},children:N.jsx("div",{"data-styles":"imageCaption",className:$.captionTextInner,style:{"--link-hover-color":z.hover,position:"relative",top:Y(z.offset.y,r),left:Y(z.offset.x,r)},children:N.jsx(jr,{content:f.imageCaption})})},R))})}),N.jsx(kr,{onMove:f=>{b(f.index)},ref:a,options:{arrows:!1,speed:h.duration?parseInt(h.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:A==="horiz"||h.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:c?c.width:"100%",height:c?c.height:"100%",type:h.type==="fade in"?"fade":"loop",rewind:!0},children:n.map((f,R)=>N.jsx(Or,{children:N.jsx("div",{className:$.sliderItem,children:N.jsx("div",{className:$.imgWrapper,children:N.jsx("img",{className:se($.sliderImage,{[$.contain]:f.image.objectFit==="contain",[$.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},R))},W),x.isActive&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:se($.arrow,{[$.arrowVertical]:A==="vert",[$.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:N.jsxs("button",{onClick:()=>{H("-1")},className:$.arrowInner,style:{transform:`translate(${Y(P,r)}, ${Y(U*(A==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&N.jsx(st,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:se($.arrowImg,$.mirror)}),!x.arrowsImgUrl&&N.jsx(Hn,{color:x.color,className:se($.arrowIcon,$.arrowImg,$.mirror)})]})}),N.jsx("div",{className:se($.arrow,$.nextArrow,{[$.arrowVertical]:A==="vert",[$.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:N.jsxs("button",{className:$.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${Y(P*(A==="horiz"?-1:1),r)}, ${Y(U,r)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&N.jsx(st,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:$.arrowImg}),!x.arrowsImgUrl&&N.jsx(Hn,{color:x.color,className:se($.arrowIcon,$.arrowImg)})]})})]}),T.triggersList.click&&N.jsx("div",{className:$.clickOverlay,onClick:()=>{o&&o.go("+1")}}),k.isActive&&N.jsx("div",{className:se($.pagination,{[$.paginationInsideBottom]:k.position==="inside-1"&&A==="horiz",[$.paginationInsideTop]:k.position==="inside-2"&&A==="horiz",[$.paginationOutsideBottom]:k.position==="outside-1"&&A==="horiz",[$.paginationOutsideTop]:k.position==="outside-2"&&A==="horiz",[$.paginationInsideLeft]:k.position==="inside-1"&&A==="vert",[$.paginationInsideRight]:k.position==="inside-2"&&A==="vert",[$.paginationOutsideLeft]:k.position==="outside-1"&&A==="vert",[$.paginationOutsideRight]:k.position==="outside-2"&&A==="vert",[$.paginationVertical]:A==="vert"}),children:N.jsx("div",{className:$.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${Y(k.offset.x,r)}, ${Y(k.offset.y,r)}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:n.map((f,R)=>N.jsx("button",{onClick:()=>{o&&o.go(R)},className:se($.paginationItem),children:N.jsx("div",{className:se($.dot,{[$.activeDot]:R===g}),style:{backgroundColor:R===g?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},R))})})]})})}function Hn({color:e,className:n}){return N.jsx("svg",{viewBox:"0 0 10 18",className:n,children:N.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:N.jsx("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)"})})})}const $o={element:Vo,id:"control-slider",name:"Slider",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/Control-slider-preview.mp4"},defaultSize:{width:400,height:400},schema:{type:"object",properties:{settings:{layoutBased:!0,type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},hover:{title:"Link Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"outside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",hover:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{layoutBased:!1,type:"array",settings:{addItemFromFileExplorer:!0,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{minWidth:58,maxWidth:108,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text",minWidth:300,maxWidth:550}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{layoutBased:!0,type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Ho="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Uo="ImageRevealSlider-module__image___Qjt-e",Yo="ImageRevealSlider-module__link___N-iLG",Go="ImageRevealSlider-module__cursor___2U03d",Ye={imageRevealSlider:Ho,image:Uo,link:Yo,cursor:Go};function Un(e,n,t){for(const r of t){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,l=a/2,s=i/2;if(e>=r.x-l&&e<=r.x+l&&n>=r.y-s&&n<=r.y+s)return!0}return!1}function Zt(e){return new Promise(n=>{const t=new Image;t.src=e,t.onload=()=>{n({width:t.naturalWidth,height:t.naturalHeight})}})}async function Xo(e,n,t,r){let o,a;if(n==="custom"){o=t;const i=await Zt(e);a=i.height/i.width*o}else if(n==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await Zt(e);a=i.height/i.width*o}else{const i=await Zt(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function Ko({settings:e,content:n,isEditor:t}){const[r,o]=M.useState(null),[a,i]=M.useState([]),[l,s]=M.useState(0),d=M.useRef(0),[u,S]=M.useState({x:0,y:0}),[m,v]=M.useState(1),[c,p]=M.useState("none"),E=M.useRef({x:0,y:0}),[w,g]=M.useState(!1),{sizeType:b,imageWidth:W,randomRangeImageWidth:B}=e.imageSize,{revealPosition:A,visible:h}=e.position,{cursorType:x,target:k,defaultCursorScale:z,defaultCursor:T,hoverCursorScale:j,hoverCursor:P}=e.cursor;M.useEffect(()=>{if(!r)return;const f=(L,_)=>{const O=r.getBoundingClientRect(),X=L-O.left,re=_-O.top;if(S({x:X,y:re}),x==="system"){p("none"),v(1);return}const te=X,me=re,C=document.elementFromPoint(O.left+te,O.top+me);if(C&&C.closest("a")){p("none"),v(1);return}const J=Un(te,me,a)||k==="area"?{img:P??"none",scale:j}:{img:T??"none",scale:z};p(J.img),v(J.scale)},R=L=>{L.stopPropagation(),E.current={x:L.clientX,y:L.clientY},f(L.clientX,L.clientY)},I=()=>{w&&f(E.current.x,E.current.y)};return r.addEventListener("mousemove",R),window.addEventListener("scroll",I,!0),()=>{r.removeEventListener("mousemove",R),window.removeEventListener("scroll",I,!0)}},[r,w,u,x,k,P,T,j,z,a]),M.useEffect(()=>{w||(p("none"),v(0))},[w]);const U=async(f,R,I,L={})=>{const{width:_,height:O,finalWidth:X}=await Xo(f.image.url,b,W,B);let re=0,te=0;A==="same"?(re=R/2,te=I/2):(re=L.x??Math.random()*R,te=L.y??Math.random()*I);const me=Math.min(Math.max(re,_/2),R-_/2),C=Math.min(Math.max(te,O/2),I-O/2);return{id:d.current++,url:f.image.url,link:f.link,name:f.image.name,x:me,y:C,width:X}};M.useEffect(()=>{if(!r||n.length===0)return;const f=r.getBoundingClientRect(),R=f.width,I=f.height,L=[];(async()=>{const O=n[0],X=await U(O,R,I);L.push(X),i(L),s(1)})()},[b,W,B,A,r]),M.useEffect(()=>{h==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[h]);const H=async f=>{if(!r)return;const R=r.getBoundingClientRect(),I=f.clientX-R.left,L=f.clientY-R.top;if(k==="image"&&!Un(I,L,a))return;let _=0,O=0;A==="on Click"?(_=I,O=L):A==="same"?(_=R.width/2,O=R.height/2):(_=Math.random()*R.width,O=Math.random()*R.height);const X=n[l],re=await U(X,R.width,R.height,{x:_,y:O});i(te=>h==="all"?[...te,re]:[re]),s(te=>te>=n.length-1?0:te+1)};return N.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:Ye.imageRevealSlider,style:{cursor:c==="none"?"default":"none"},children:[a.map(f=>N.jsx("div",{className:Ye.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:c==="none"?"default":"none"},children:k==="area"&&f.link?N.jsx("a",{href:f.link,target:"_blank",className:Ye.link,children:N.jsx("img",{src:f.url,alt:f.name,className:Ye.image},f.id)}):N.jsx("img",{src:f.url,alt:f.name,className:Ye.image},f.id)},f.id)),w&&N.jsx("div",{className:Ye.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${c}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const qo={element:Ko,id:"control-image-reveal",name:"Click Gallery",preview:{type:"video",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"},defaultSize:{width:"100%",height:"100%"},schema:{type:"object",properties:{settings:{layoutBased:!0,type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{layoutBased:!1,type:"array",settings:{addItemFromFileExplorer:!0,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,minWidth:58,maxWidth:108,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input",minWidth:300,maxWidth:550}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Jo="LightBox-module__hidden___9s-9x",Zo="LightBox-module__heroImage___sTxNF",Qo="LightBox-module__background___rm9ml",ea="LightBox-module__editor___4ACaY",ta="LightBox-module__contentStyle___Bgnsq",na="LightBox-module__imageStyle___tLIlB",ra="LightBox-module__imgWrapper___LuFUp",ia="LightBox-module__contain___8-yaS",oa="LightBox-module__cover___hNvOG",aa="LightBox-module__caption___b6L2I",sa="LightBox-module__captionTextInner___rCGNH",la="LightBox-module__lightboxSplide___XFuWC",ca="LightBox-module__arrow___iz38X",ua="LightBox-module__arrowVertical___Zfz81",da="LightBox-module__nextArrow___zkAQN",pa="LightBox-module__arrowInner___p48sW",fa="LightBox-module__arrowIcon___3VaFf",ga="LightBox-module__arrowImg___pNV88",ma="LightBox-module__mirror___pjeXc",ha="LightBox-module__thumbsWrapper___GB-nU",va="LightBox-module__thumbsContainerVertical___wttk5",ya="LightBox-module__thumbsContainer___osSma",_a="LightBox-module__thumbsAlignStart___MO6tY",ba="LightBox-module__thumbsAlignCenter___Q4sUx",Sa="LightBox-module__thumbsAlignEnd___p4y9R",Ea="LightBox-module__thumbItem___HvnF3",wa="LightBox-module__closeButton___g2khP",xa="LightBox-module__fadeIn___0m5GW",Ca="LightBox-module__slideInLeft___gPYwC",Aa="LightBox-module__slideInRight___S-pPp",Ia="LightBox-module__slideInTop___DFdAj",La="LightBox-module__slideInBottom___m27kZ",Ta="LightBox-module__fadeOut___55qBR",Ra="LightBox-module__slideOutLeft___NvU7P",Na="LightBox-module__slideOutRight___SK7eC",ka="LightBox-module__slideOutTop___Vgg0z",Oa="LightBox-module__slideOutBottom___nJ0Ef",ja="LightBox-module__scaleSlide___vZriG",D={hidden:Jo,heroImage:Zo,background:Qo,editor:ea,contentStyle:ta,imageStyle:na,imgWrapper:ra,contain:ia,cover:oa,caption:aa,captionTextInner:sa,lightboxSplide:la,arrow:ca,arrowVertical:ua,nextArrow:da,arrowInner:pa,arrowIcon:fa,arrowImg:ga,mirror:ma,thumbsWrapper:ha,thumbsContainerVertical:va,thumbsContainer:ya,thumbsAlignStart:_a,thumbsAlignCenter:ba,thumbsAlignEnd:Sa,thumbItem:Ea,closeButton:wa,fadeIn:xa,slideInLeft:Ca,slideInRight:Aa,slideInTop:Ia,slideInBottom:La,fadeOut:Ta,slideOutLeft:Ra,slideOutRight:Na,slideOutTop:ka,slideOutBottom:Oa,scaleSlide:ja},It=(e,n,t)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${Y(n.x,t)}), calc(-50% + ${Y(n.y,t)}))`:o==="middle"?r.transform=`translate(${Y(n.x,t)}, calc(-50% + ${Y(n.y,t)}))`:a==="center"?r.transform=`translate(calc(-50% + ${Y(n.x,t)}), ${Y(n.y,t)})`:r.transform=`translate(${Y(n.x,t)}, ${Y(n.y,t)})`,r};function Dr(e){const n=window.getComputedStyle(e);return{top:parseFloat(n.paddingTop)||0,right:parseFloat(n.paddingRight)||0,bottom:parseFloat(n.paddingBottom)||0,left:parseFloat(n.paddingLeft)||0}}function Yn(e){const n=e.getBoundingClientRect(),t=Dr(e),r=Math.max(0,n.width-t.left-t.right),o=Math.max(0,n.height-t.top-t.bottom),a=e.naturalWidth,i=e.naturalHeight,l=r/o,s=a/i;let d,u;s>l?(d=r,u=r/s):(u=o,d=o*s);const S=n.left+t.left,m=n.top+t.top,v=(r-d)/2+S,c=(o-u)/2+m;return{x:v,y:c,width:d,height:u}}function Gn(e){const n=e.getBoundingClientRect(),t=Dr(e);return{left:n.left+t.left,right:n.right-t.right,top:n.top+t.top,bottom:n.bottom-t.bottom}}function Xn(e){const n=e.match(/rgba?\(([^)]+)\)/);if(n){const r=n[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const t=e.match(/^#([0-9a-fA-F]{8})$/);if(t){const r=t[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Da(e,n){const t=(()=>{if(e==="fade in")return D.fadeIn;if(e==="slide in"||e==="mix")switch(n){case"left":return D.slideInLeft;case"right":return D.slideInRight;case"top":return D.slideInTop;case"bottom":return D.slideInBottom;default:return D.slideInRight}return D.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return D.fadeIn;if(e==="slide in")switch(n){case"left":return D.slideInLeft;case"right":return D.slideInRight;case"top":return D.slideInTop;case"bottom":return D.slideInBottom;default:return D.slideInRight}return D.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return D.fadeOut;if(e==="slide in")switch(n){case"left":return D.slideOutLeft;case"right":return D.slideOutRight;case"top":return D.slideOutTop;case"bottom":return D.slideOutBottom;default:return D.slideOutRight}return D.fadeOut})(),a=(()=>{if(e==="fade in")return D.fadeOut;if(e==="slide in"||e==="mix")switch(n){case"left":return D.slideOutLeft;case"right":return D.slideOutRight;case"top":return D.slideOutTop;case"bottom":return D.slideOutBottom;default:return D.slideOutRight}return D.fadeOut})();return{appearClass:t,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Pa=({settings:e,content:n,styles:t,portalId:r,activeEvent:o,isEditor:a})=>{const[i,l]=M.useState(!1),{url:s}=e.thumbnailBlock.cover;return M.useEffect(()=>{o==="close"&&l(!1),o==="open"&&l(!0)},[o]),N.jsxs(N.Fragment,{children:[N.jsx("img",{src:s,alt:"Cover",className:D.heroImage,onClick:()=>l(!0)}),N.jsx(Ba,{isOpen:i,onClose:()=>l(!1),content:n,settings:e,lightboxStyles:t,portalId:r,isEditor:a})]})},Ba=({isOpen:e,onClose:n,content:t,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:l})=>{var F;const[s,d]=M.useState(0),[u,S]=M.useState(0),[m,v]=M.useState(!1),[c,p]=M.useState(!1),[E,w]=M.useState({}),g=M.useRef(null),b=M.useRef(null),W=M.useRef(null),B=M.useRef(!1),A=M.useRef(null),h=M.useRef(null),x=M.useRef(null),k=M.useRef(null),z=M.useRef(!1),T=M.useRef(null),[j,P]=M.useState(!1),{appear:U,triggers:H,slider:f,thumbnail:R,controls:I,area:L,caption:_,layout:O}=o.lightboxBlock,{appearClass:X,backdropAppearClass:re,backdropDisappearClass:te,disappearClass:me}=Da(U.type,U.direction),C=(l==null?void 0:l.itemId)??null;M.useEffect(()=>{const y=()=>{setTimeout(()=>{var G,Z;(Z=(G=g.current)==null?void 0:G.splide)==null||Z.refresh()},16)},V=()=>{S(G=>G+1)};return window.addEventListener("ArticleEditor.Layout:change",y),window.addEventListener("ArticleEditor.ComponentContent:change",V),()=>{window.removeEventListener("ArticleEditor.Layout:change",y),window.removeEventListener("ArticleEditor.ComponentContent:change",V)}},[]),M.useEffect(()=>{if(!e||!R.isActive){P(!1);return}const y=T.current;if(!y)return;const V=()=>{f.direction==="horiz"?P(y.scrollWidth>y.clientWidth):P(y.scrollHeight>y.clientHeight)};V();const G=new ResizeObserver(V);return G.observe(y),()=>G.disconnect()},[e,R.isActive,t.length,E,f.direction]);const J=M.useCallback(()=>{const y=window.matchMedia("(max-width: 768px)").matches,V=Xn(L.color);y&&!i&&V>.9&&(document.body.style.backgroundColor=""),v(!0),B.current=!0;const G=Z=>{Z.target===A.current&&Z.animationName&&(A.current&&h.current&&A.current.removeEventListener("animationend",h.current),h.current=null,B.current&&(B.current=!1,n()),v(!1))};A.current&&(h.current=G,A.current.addEventListener("animationend",G))},[n,L.color,i]),ge=(y,V,G)=>{var Z,ne;if(y){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&s===t.length-1?J():(Z=g.current)==null||Z.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const Q=y.getBoundingClientRect(),K=V-Q.left,ae=G-Q.top,ve=Q.width,ce=Q.height;let pe;f.direction==="horiz"?pe=K<ve/2?"-1":"+1":pe=ae<ce/2?"-1":"+1",(ne=g.current)==null||ne.go(pe)}}},oe=y=>{if(z.current){z.current=!1;return}const V=t[s],G=(V==null?void 0:V.image.objectFit)==="cover";let Z,ne;if("changedTouches"in y&&y.changedTouches.length>0)Z=y.changedTouches[0].clientX,ne=y.changedTouches[0].clientY;else if("clientX"in y)Z=y.clientX,ne=y.clientY;else return;let Q;if(G&&W.current){const K=Gn(W.current);Q=Z>=K.left&&Z<=K.right&&ne>=K.top&&ne<=K.bottom}else{const K=W.current?Yn(W.current):null;if(!K){y.target===y.currentTarget&&J();return}Q=Z>=K.x&&Z<=K.x+K.width&&ne>=K.y&&ne<=K.y+K.height}Q?ge(W.current,Z,ne):J()},fe=y=>{const V=y.target;(V.classList.contains(D.thumbsWrapper)||V.classList.contains(D.thumbsContainer))&&oe(y)};M.useEffect(()=>{if(!e)return;const y=V=>{var G,Z;if(V.key==="Escape"){J();return}if(V.key==="ArrowRight"){d(ne=>(ne+1)%Math.max(t.length,1)),(G=g.current)==null||G.go("+1");return}V.key==="ArrowLeft"&&(d(ne=>(ne-1+Math.max(t.length,1))%Math.max(t.length,1)),(Z=g.current)==null||Z.go("-1"))};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}},[e,J,t.length]),M.useEffect(()=>{if(e){if(d(0),S(V=>V+1),B.current=!1,v(!1),p(!1),w({}),!C)return;const y=new CustomEvent("page-overlay",{detail:{itemId:C}});window.dispatchEvent(y)}return()=>{A.current&&h.current&&(A.current.removeEventListener("animationend",h.current),h.current=null),p(!1)}},[e,C]),M.useEffect(()=>{b.current!==null&&b.current!==f.type&&S(y=>y+1),b.current=f.type},[f.type]),M.useEffect(()=>{if(!e)return;const y=document.body.style.overflow,V=window.matchMedia("(max-width: 768px)").matches,G=Xn(L.color);document.body.style.overflow="hidden",p(!1);const Z=Q=>{Q.target===A.current&&!B.current&&Q.animationName&&(V&&!i&&G>.9&&(document.body.style.backgroundColor=L.color),p(!0),A.current&&x.current&&A.current.removeEventListener("animationend",x.current),x.current=null)};A.current&&(x.current=Z,A.current.addEventListener("animationend",Z));const ne=Q=>{const K=Q.target;K&&(K.closest(`.${D.thumbsWrapper}`)||K.closest(`.${D.thumbsContainer}`))||f.type!=="slide"&&Q.preventDefault()};return document.addEventListener("touchmove",ne,{passive:!1}),()=>{document.body.style.overflow=y,document.removeEventListener("touchmove",ne),A.current&&x.current&&(A.current.removeEventListener("animationend",x.current),x.current=null),p(!1)}},[e,i,L.color,f.type]),M.useEffect(()=>{if(!e)return;const y=V=>{var Z,ne;if(B.current){V.stopPropagation();return}if(z.current){z.current=!1;return}const G=V.target;if(!(G&&(G.closest(`.${D.thumbsContainer}`)||G.closest(`.${D.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((ne=(Z=g.current)==null?void 0:Z.splide)!=null&&ne.root)){const Q=g.current.splide.root;if(G&&(Q.contains(G)||Q===G))return}if(V.touches.length===0&&V.changedTouches.length>0){const Q=t[s],K=(Q==null?void 0:Q.image.objectFit)==="cover",ae=V.changedTouches[0];let ve;if(K&&W.current){const ce=Gn(W.current);ve=ae.clientX>=ce.left&&ae.clientX<=ce.right&&ae.clientY>=ce.top&&ae.clientY<=ce.bottom}else{const ce=W.current?Yn(W.current):null;if(!ce)return;ve=ae.clientX>=ce.x&&ae.clientX<=ce.x+ce.width&&ae.clientY>=ce.y&&ae.clientY<=ce.y+ce.height}if(!ve){V.stopPropagation(),B.current=!0;const ce=pe=>{pe.stopPropagation(),pe.preventDefault(),document.removeEventListener("click",ce,!0)};document.addEventListener("click",ce,!0),J()}}}};return document.addEventListener("touchend",y,{passive:!0}),()=>{document.removeEventListener("touchend",y)}},[e,J,s,t]);const it=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";M.useEffect(()=>{var pe,xt;if(!e||!it||!((xt=(pe=g.current)==null?void 0:pe.splide)!=null&&xt.root))return;const y=g.current.splide.root,V=30,G=(ee,ue)=>{if(k.current){const Le=Math.abs(ee-k.current.x),Ct=Math.abs(ue-k.current.y);(Le>0||Ct>0)&&(z.current=!0)}},Z=ee=>{k.current&&(ee.preventDefault(),G(ee.clientX,ee.clientY))},ne=ee=>{k.current&&ee.touches.length>0&&(ee.preventDefault(),G(ee.touches[0].clientX,ee.touches[0].clientY))},Q=(ee,ue)=>{if(!k.current||!g.current){k.current=null;return}const Le=Math.abs(ee-k.current.x),Ct=Math.abs(ue-k.current.y);Ct>V&&Ct>Le&&g.current.go(ue<k.current.y?"+1":"-1"),k.current=null},K=ee=>{k.current&&Q(ee.clientX,ee.clientY),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("pointermove",Z)},ae=ee=>{if(k.current){if(ee.changedTouches.length>0){const ue=ee.changedTouches[0];Q(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),document.removeEventListener("touchmove",ne)}},ve=ee=>{k.current={x:ee.clientX,y:ee.clientY},z.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",K),document.addEventListener("pointercancel",K)},ce=ee=>{ee.touches.length>0&&(k.current={x:ee.touches[0].clientX,y:ee.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae))};return y.addEventListener("pointerdown",ve),y.addEventListener("touchstart",ce),()=>{y.removeEventListener("pointerdown",ve),y.removeEventListener("touchstart",ce),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),k.current=null,z.current=!1}},[e,it,u]);const wt={backgroundColor:L.color,backdropFilter:`blur(${L.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Pr.createPortal(N.jsxs(N.Fragment,{children:[N.jsx("div",{ref:i?null:A,className:se(D.background,m?te:re,{[D.editor]:i},{[D.hidden]:!e}),style:{...wt,...c&&!i&&!m?{position:"absolute"}:{}}}),N.jsxs("div",{ref:i?A:null,className:se(D.contentStyle,m?me:X,{[D.editor]:i},{[D.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[N.jsx(kr,{onMove:y=>d(y.index),ref:g,className:D.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:H.type==="drag"&&!it,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:t.map((y,V)=>{const G=It(O.position,O.offset,i),Z=`${Y(O.padding.top,i)} ${Y(O.padding.right,i)} ${Y(O.padding.bottom,i)} ${Y(O.padding.left,i)}`,ne=f.type==="scale"?(()=>{const{transform:Q,...K}=G;return{...K,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":Q||"none"}})():{...G,position:"absolute",padding:Z,boxSizing:"border-box"};return N.jsx(Or,{children:N.jsx("div",{className:D.imgWrapper,onClick:oe,children:N.jsx("img",{ref:V===s?W:null,className:se(D.imageStyle,{[D.contain]:y.image.objectFit==="contain",[D.cover]:y.image.objectFit==="cover",[D.scaleSlide]:f.type==="scale"}),src:y.image.url,alt:y.image.name??"",style:{...ne,pointerEvents:y.image.objectFit==="contain"?"none":"auto"}})})},V)})},u),I.isActive&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:se(D.arrow,{[D.arrowVertical]:f.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:N.jsxs("button",{className:D.arrowInner,style:{transform:`translate(${Y(I.offset.x,i)}, ${Y(I.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${I.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=g.current)==null?void 0:y.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&N.jsx(st,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:se(D.arrowImg,D.mirror)}),!I.arrowsImgUrl&&N.jsx(Kn,{color:I.color,className:se(D.arrowIcon,D.arrowImg,D.mirror)})]})}),N.jsx("div",{className:se(D.arrow,D.nextArrow,{[D.arrowVertical]:f.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:N.jsxs("button",{className:D.arrowInner,style:{transform:`translate(${Y(I.offset.x*(f.direction==="horiz"?-1:1),i)}, ${Y(I.offset.y,i)}) scale(${I.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=g.current)==null?void 0:y.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&N.jsx(st,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:D.arrowImg}),!I.arrowsImgUrl&&N.jsx(Kn,{color:I.color,className:se(D.arrowIcon,D.arrowImg)})]})})]}),L.closeIconUrl&&(()=>{const y=It(L.closeIconAlign,L.closeIconOffset,i),V=`scale(${L.closeIconScale})`,G=y.transform?`${y.transform} ${V}`:V;return N.jsx("button",{className:D.closeButton,style:{...y,transform:G},onClick:J,"aria-label":"Close lightbox",children:N.jsx(st,{url:L.closeIconUrl,fill:L.closeIconColor??"#000000",hoverFill:L.closeIconHover??"#cccccc"})})})(),_&&_.isActive&&r.imageCaption&&((F=t[s])==null?void 0:F.imageCaption)&&(()=>{const{widthSettings:y,fontSettings:V,letterSpacing:G,textAlign:Z,wordSpacing:ne,fontSizeLineHeight:Q,textAppearance:K,color:ae}=r.imageCaption;return N.jsx("div",{className:D.caption,style:{...It(_.alignment,_.offset,i),fontFamily:V.fontFamily,fontWeight:V.fontWeight,fontStyle:V.fontStyle,width:y.sizing==="auto"?"max-content":Y(y.width,i),letterSpacing:Y(G,i),wordSpacing:Y(ne,i),textAlign:Z,fontSize:Y(Q.fontSize,i),lineHeight:Y(Q.lineHeight,i),textTransform:K.textTransform??"none",textDecoration:K.textDecoration??"none",fontVariant:K.fontVariant??"normal",color:ae},onClick:ve=>ve.stopPropagation(),children:N.jsx("div",{"data-styles":"imageCaption",className:D.captionTextInner,style:{"--link-hover-color":_.hover},children:N.jsx(jr,{content:t[s].imageCaption})})})})(),R.isActive&&(()=>{const[y,V]=R.position.split("-"),G=f.direction==="horiz"?`${y}-left`:R.position,Z=It(G,R.offset,i),ne=()=>{if(f.direction==="horiz"){if(V==="left")return"flex-start";if(V==="center")return"center";if(V==="right")return"flex-end"}else{if(y==="top")return"flex-start";if(y==="middle")return"center";if(y==="bottom")return"flex-end"}return"flex-start"};return N.jsx("div",{ref:T,className:D.thumbsWrapper,onClick:Q=>fe(Q),style:{position:i?"absolute":"fixed",...Z,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:N.jsx("div",{className:se(D.thumbsContainer,{[D.thumbsContainerVertical]:f.direction==="vert",[D.thumbsAlignStart]:R.align==="start",[D.thumbsAlignCenter]:R.align==="center",[D.thumbsAlignEnd]:R.align==="end"}),style:{gap:Y(R.grid.gap,i),justifyContent:j?"flex-start":ne()},children:t.map((Q,K)=>{const ae=K===s,ve=E[K],pe=R.grid.size*(ae?R.activeState.scale:1),xt=()=>{if(R.fit!=="fit")return{};if(!ve)return f.direction==="horiz"?{height:Y(pe,i)}:{width:Y(pe,i)};const ee=ve.width/ve.height;if(f.direction==="horiz"){const ue=pe,Le=ue*ee;return{width:Y(Le,i),height:Y(ue,i)}}else{const ue=pe,Le=ue/ee;return{width:Y(ue,i),height:Y(Le,i)}}};return N.jsx("button",{className:D.thumbItem,style:{...f.direction==="horiz"&&R.fit!=="fit"?{height:Y(pe,i)}:{},...f.direction==="vert"&&R.fit!=="fit"?{width:Y(pe,i)}:{},...R.fit==="cover"?{width:Y(pe,i),height:Y(pe,i)}:{},...xt(),transition:ae?"all 0.25s ease-out":"none",opacity:ae?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:ee=>{var ue;ee.stopPropagation(),d(K),(ue=g.current)==null||ue.go(K)},onMouseEnter:()=>{var ee;R.triggers==="hov"&&((ee=g.current)==null||ee.go(K))},children:N.jsx("img",{src:Q.image.url,alt:Q.image.name??"",onLoad:ee=>{const ue=ee.currentTarget;ue.naturalWidth&&ue.naturalHeight&&w(Le=>({...Le,[K]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Q.image.name}-${K}`)})})})})()]})]}),document.getElementById(a)):null};function Kn({color:e,className:n}){return N.jsx("svg",{viewBox:"0 0 10 18",className:n,children:N.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:N.jsx("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)"})})})}const za={element:Pa,id:"lightbox",name:"Lightbox",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/lightbox.mp4"},defaultSize:{width:440,height:550},schema:{type:"object",properties:{settings:{layoutBased:!0,type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},hover:{title:"Link Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{layoutBased:!1,type:"array",settings:{addItemFromFileExplorer:!0,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",minWidth:58,maxWidth:108},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text",minWidth:300,maxWidth:550}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{layoutBased:!0,type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Fa=[$o,qo,za];exports.components=Fa;