@cntrl-site/components 1.0.103 → 1.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
- package/dist/Components/utils/index.d.ts +1 -0
- package/dist/Components/utils/useLazyVideos.d.ts +15 -0
- package/dist/Grid-B2_o1dvz.mjs +1576 -0
- package/dist/Grid-Bq6bk2AQ.js +374 -0
- package/dist/{Helix-2Vr-9WBa.js → Helix-B7rxlvKq.js} +2 -2
- package/dist/{Helix-BmkAKT1G.mjs → Helix-BrKQzGX5.mjs} +53 -53
- package/dist/{Hive-BGMWinrW.mjs → Hive-BusARSOi.mjs} +114 -111
- package/dist/Hive-Dh5nKPGm.js +321 -0
- package/dist/LazyVideo-Cn_vmMq8.js +1 -0
- package/dist/LazyVideo-D8eVYFyw.mjs +15 -0
- package/dist/Marquee-CdtAqhQE.mjs +563 -0
- package/dist/Marquee-DUN8wUax.js +133 -0
- package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-BRqlbk4i.mjs} +55 -54
- package/dist/Mercury-C-O2VGkK.js +267 -0
- package/dist/{PretextComponent-CGycuNNn.js → PretextComponent-D5P0AjnL.js} +1 -1
- package/dist/{PretextComponent-DN8cyZ8x.mjs → PretextComponent-s4DDfmzY.mjs} +6 -6
- package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-DKuh4bnv.mjs} +299 -295
- package/dist/Waterfall-fdiHR0Rc.js +287 -0
- package/dist/{components-DTCDEBo0.js → components-DzNixU7Q.js} +1 -1
- package/dist/{components-BFJINCME.mjs → components-Yf9Zjska.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +6 -6
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/sources.js +125 -49
- package/dist/sources.mjs +129 -53
- package/dist/useLazyVideos-BbgdvELi.js +1 -0
- package/dist/useLazyVideos-CZLyNolX.mjs +72 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +14 -12
- package/package.json +5 -3
- package/dist/Grid-CemGhf3F.js +0 -374
- package/dist/Grid-cfQsXW3b.mjs +0 -1553
- package/dist/Hive-BC6zQBsv.js +0 -321
- package/dist/Marquee-BYClHHws.mjs +0 -551
- package/dist/Marquee-vmHaTGIP.js +0 -133
- package/dist/Mercury-BwF_XW2w.js +0 -267
- package/dist/Waterfall-DnPDHbCL.js +0 -287
package/dist/Mercury-BwF_XW2w.js
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),Ve=require("react-dom"),at=require("./scalingValue-CSHYgTZl.js"),_e=require("./buildColorVars-CE2D5cQV.js"),Be=require("./useScopedStyles-Bf6yohVQ.js"),wt=require("./textStylesToCss-CNN3zZTV.js"),Ge=require("./SvgImage-DFlmxAoL.js"),bt=300/1440,Xe=8/1440,lt=.004;function qe(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Qt(t,e,o,r){return e!==void 0&&e<(t??.01)?`${o} ${r}`:o}function Pt(t,e,o,r,l="title-leading-gap"){const h=t??.01;return e===void 0||e>=h?{}:{[`--${o}-${l}`]:at.scalingValue((h-e)/2,r)}}function Ke(t){return`
|
|
2
|
-
.${t}-wrapper {
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
position: relative;
|
|
7
|
-
width: 100%;
|
|
8
|
-
min-height: ${qe(48)};
|
|
9
|
-
}
|
|
10
|
-
.${t}-single-title-layer {
|
|
11
|
-
position: absolute;
|
|
12
|
-
inset: 0;
|
|
13
|
-
z-index: 2;
|
|
14
|
-
pointer-events: none;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
justify-content: flex-start;
|
|
18
|
-
}
|
|
19
|
-
.${t}-single-title {
|
|
20
|
-
pointer-events: none;
|
|
21
|
-
}
|
|
22
|
-
.${t}-item {
|
|
23
|
-
position: relative;
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
width: 100%;
|
|
27
|
-
}
|
|
28
|
-
.${t}-item-a {
|
|
29
|
-
flex-direction: row;
|
|
30
|
-
}
|
|
31
|
-
.${t}-item-b {
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
}
|
|
34
|
-
.${t}-item-c {
|
|
35
|
-
flex-direction: row-reverse;
|
|
36
|
-
}
|
|
37
|
-
.${t}-title {
|
|
38
|
-
align-self: flex-start;
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-shrink: 0;
|
|
41
|
-
min-width: 0;
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
position: sticky;
|
|
44
|
-
z-index: 2;
|
|
45
|
-
overflow: visible;
|
|
46
|
-
color: var(--${t}-title-color);
|
|
47
|
-
}
|
|
48
|
-
.${t}-title-text,
|
|
49
|
-
.${t}-description-text {
|
|
50
|
-
display: block;
|
|
51
|
-
width: 100%;
|
|
52
|
-
white-space: pre-wrap;
|
|
53
|
-
overflow-wrap: anywhere;
|
|
54
|
-
word-break: break-word;
|
|
55
|
-
}
|
|
56
|
-
.${t}-description-text {
|
|
57
|
-
color: var(--${t}-description-color);
|
|
58
|
-
}
|
|
59
|
-
.${t}-title-texts {
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
width: 100%;
|
|
63
|
-
min-width: 0;
|
|
64
|
-
}
|
|
65
|
-
.${t}-title-texts-gap {
|
|
66
|
-
position: relative;
|
|
67
|
-
width: 100%;
|
|
68
|
-
flex-shrink: 0;
|
|
69
|
-
}
|
|
70
|
-
.${t}-title-text-inner {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
flex-shrink: 0;
|
|
74
|
-
box-sizing: border-box;
|
|
75
|
-
outline: 1px solid #FF5C02;
|
|
76
|
-
}
|
|
77
|
-
.${t}-title-text-inner-hidden {
|
|
78
|
-
display: flex;
|
|
79
|
-
flex-direction: column;
|
|
80
|
-
flex-shrink: 0;
|
|
81
|
-
box-sizing: border-box;
|
|
82
|
-
}
|
|
83
|
-
.${t}-title-text-stack {
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
min-width: 0;
|
|
88
|
-
position: relative;
|
|
89
|
-
box-sizing: border-box;
|
|
90
|
-
}
|
|
91
|
-
.${t}-item-a .${t}-title-v-top .${t}-title-text-stack,
|
|
92
|
-
.${t}-item-b .${t}-title-v-top .${t}-title-text-stack,
|
|
93
|
-
.${t}-item-c .${t}-title-v-top .${t}-title-text-stack,
|
|
94
|
-
.${t}-single-title-layer .${t}-title-v-top .${t}-title-text-stack {
|
|
95
|
-
padding-top: var(--${t}-title-top-padding, 0);
|
|
96
|
-
}
|
|
97
|
-
.${t}-item-a .${t}-title-v-bottom .${t}-title-text-stack,
|
|
98
|
-
.${t}-item-b .${t}-title-v-bottom .${t}-title-text-stack,
|
|
99
|
-
.${t}-item-c .${t}-title-v-bottom .${t}-title-text-stack,
|
|
100
|
-
.${t}-single-title-layer .${t}-title-v-bottom .${t}-title-text-stack {
|
|
101
|
-
padding-bottom: var(--${t}-title-bottom-padding, 0);
|
|
102
|
-
}
|
|
103
|
-
.${t}-title-v-center {
|
|
104
|
-
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) / 2 - (var(--${t}-title-height, 0px) / 2));
|
|
105
|
-
align-items: center;
|
|
106
|
-
}
|
|
107
|
-
.${t}-title-v-top {
|
|
108
|
-
top: var(--cntrl-article-top, 0px);
|
|
109
|
-
bottom: auto;
|
|
110
|
-
align-self: flex-start;
|
|
111
|
-
}
|
|
112
|
-
.${t}-title-v-bottom {
|
|
113
|
-
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) - var(--${t}-title-height, 0px));
|
|
114
|
-
align-items: center;
|
|
115
|
-
}
|
|
116
|
-
.${t}-title-h-left {
|
|
117
|
-
justify-content: flex-start;
|
|
118
|
-
}
|
|
119
|
-
.${t}-item-a .${t}-title-h-left,
|
|
120
|
-
.${t}-item-b .${t}-title-h-left,
|
|
121
|
-
.${t}-item-c .${t}-title-h-left,
|
|
122
|
-
.${t}-single-title-layer .${t}-title-h-left {
|
|
123
|
-
padding-left: var(--${t}-title-left-padding, 0);
|
|
124
|
-
}
|
|
125
|
-
.${t}-title-h-center {
|
|
126
|
-
justify-content: center;
|
|
127
|
-
}
|
|
128
|
-
.${t}-title-h-right {
|
|
129
|
-
justify-content: flex-end;
|
|
130
|
-
}
|
|
131
|
-
.${t}-item-a .${t}-title-h-right,
|
|
132
|
-
.${t}-item-b .${t}-title-h-right,
|
|
133
|
-
.${t}-item-c .${t}-title-h-right,
|
|
134
|
-
.${t}-single-title-layer .${t}-title-h-right {
|
|
135
|
-
padding-right: var(--${t}-title-right-padding, 0);
|
|
136
|
-
}
|
|
137
|
-
.${t}-item-a .${t}-title,
|
|
138
|
-
.${t}-item-c .${t}-title {
|
|
139
|
-
flex: 1;
|
|
140
|
-
width: auto;
|
|
141
|
-
min-width: 0;
|
|
142
|
-
overflow: visible;
|
|
143
|
-
}
|
|
144
|
-
.${t}-item-b .${t}-title,
|
|
145
|
-
.${t}-single-title-layer .${t}-title {
|
|
146
|
-
width: 100%;
|
|
147
|
-
pointer-events: none;
|
|
148
|
-
}
|
|
149
|
-
.${t}-gallery {
|
|
150
|
-
display: flex;
|
|
151
|
-
flex-direction: column;
|
|
152
|
-
align-items: center;
|
|
153
|
-
flex-shrink: 0;
|
|
154
|
-
box-sizing: border-box;
|
|
155
|
-
}
|
|
156
|
-
.${t}-item-b .${t}-gallery {
|
|
157
|
-
display: grid;
|
|
158
|
-
width: 100%;
|
|
159
|
-
}
|
|
160
|
-
.${t}-item-b .${t}-gallery-media {
|
|
161
|
-
grid-area: 1 / 1;
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
164
|
-
align-items: center;
|
|
165
|
-
width: 100%;
|
|
166
|
-
min-width: 0;
|
|
167
|
-
}
|
|
168
|
-
.${t}-item-b .${t}-title-layer {
|
|
169
|
-
grid-area: 1 / 1;
|
|
170
|
-
align-self: stretch;
|
|
171
|
-
width: 100%;
|
|
172
|
-
min-width: 0;
|
|
173
|
-
z-index: 2;
|
|
174
|
-
overflow: visible;
|
|
175
|
-
pointer-events: none;
|
|
176
|
-
display: flex;
|
|
177
|
-
flex-direction: column;
|
|
178
|
-
justify-content: flex-start;
|
|
179
|
-
}
|
|
180
|
-
.${t}-gallery-item {
|
|
181
|
-
position: relative;
|
|
182
|
-
display: flex;
|
|
183
|
-
flex-direction: column;
|
|
184
|
-
align-items: center;
|
|
185
|
-
width: 100%;
|
|
186
|
-
}
|
|
187
|
-
.${t}-gallery-image,
|
|
188
|
-
.${t}-gallery-video {
|
|
189
|
-
display: block;
|
|
190
|
-
max-width: 100%;
|
|
191
|
-
height: auto;
|
|
192
|
-
}
|
|
193
|
-
.${t}-gallery-controls {
|
|
194
|
-
position: relative;
|
|
195
|
-
display: flex;
|
|
196
|
-
flex-shrink: 0;
|
|
197
|
-
box-sizing: border-box;
|
|
198
|
-
z-index: 1;
|
|
199
|
-
}
|
|
200
|
-
.${t}-gallery-edge-spacer {
|
|
201
|
-
flex-shrink: 0;
|
|
202
|
-
}
|
|
203
|
-
.${t}-control-anchor {
|
|
204
|
-
position: absolute;
|
|
205
|
-
pointer-events: none;
|
|
206
|
-
z-index: 2;
|
|
207
|
-
}
|
|
208
|
-
.${t}-padding-handle {
|
|
209
|
-
width: 100%;
|
|
210
|
-
flex-shrink: 0;
|
|
211
|
-
background: transparent;
|
|
212
|
-
}
|
|
213
|
-
.${t}-text-tight-leading {
|
|
214
|
-
flex-shrink: 0;
|
|
215
|
-
padding-top: var(--${t}-title-leading-gap, 0);
|
|
216
|
-
padding-bottom: var(--${t}-title-leading-gap, 0);
|
|
217
|
-
}
|
|
218
|
-
.${t}-description-tight-leading {
|
|
219
|
-
flex-shrink: 0;
|
|
220
|
-
padding-top: var(--${t}-description-leading-gap, 0);
|
|
221
|
-
padding-bottom: var(--${t}-description-leading-gap, 0);
|
|
222
|
-
}
|
|
223
|
-
.${t}-lightbox-counter {
|
|
224
|
-
margin: 0;
|
|
225
|
-
color: var(--${t}-lightbox-counter-color);
|
|
226
|
-
}
|
|
227
|
-
.${t}-lightbox {
|
|
228
|
-
position: fixed;
|
|
229
|
-
inset: 0;
|
|
230
|
-
z-index: 9997;
|
|
231
|
-
overscroll-behavior: none;
|
|
232
|
-
overflow: hidden;
|
|
233
|
-
}
|
|
234
|
-
.${t}-lightbox-editor {
|
|
235
|
-
inset: auto;
|
|
236
|
-
top: var(--cntrl-article-top, 0);
|
|
237
|
-
left: var(--cntrl-article-left, 0);
|
|
238
|
-
width: var(--cntrl-article-width, 100vw) !important;
|
|
239
|
-
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
240
|
-
}
|
|
241
|
-
.${t}-close-icon {
|
|
242
|
-
position: relative;
|
|
243
|
-
flex-shrink: 0;
|
|
244
|
-
pointer-events: auto;
|
|
245
|
-
z-index: 2;
|
|
246
|
-
display: flex;
|
|
247
|
-
align-items: center;
|
|
248
|
-
justify-content: center;
|
|
249
|
-
border: none;
|
|
250
|
-
background-color: transparent;
|
|
251
|
-
padding: 0;
|
|
252
|
-
}
|
|
253
|
-
.${t}-close-icon-inner {
|
|
254
|
-
all: unset;
|
|
255
|
-
position: relative;
|
|
256
|
-
cursor: pointer;
|
|
257
|
-
width: 100%;
|
|
258
|
-
height: 100%;
|
|
259
|
-
pointer-events: auto;
|
|
260
|
-
}
|
|
261
|
-
.${t}-close-icon-img {
|
|
262
|
-
position: absolute;
|
|
263
|
-
top: 50%;
|
|
264
|
-
left: 50%;
|
|
265
|
-
transform: translate(-50%, -50%);
|
|
266
|
-
}
|
|
267
|
-
`}const be={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function Ue(t){return t in be}function Ye(t){if(t&&Ue(t))return t;switch(t){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function ne(t){return be[t]}const Ze="rgba(28,31,34,0.9)",rt=500,ft="cubic-bezier(0.22, 1, 0.36, 1)",Je=72,Qe=50,Pe={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},tn=[];function en(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return e!==null&&typeof e=="object"&&"media"in e&&Array.isArray(e.media)}function nn(t){const[e,o]=t.media;return o!=null&&o.assetId?o:e!=null&&e.assetId?e:null}function on(t){const[e]=t.media;return e!=null&&e.assetId?e:null}function rn(t){if(!Array.isArray(t)||t.length===0)return[];if(en(t)){const e=[];for(const o of t){const r=nn(o);if(!r)continue;const l=on(o);e.push({displayMedia:r,lightboxMedia:l!=null&&l.assetId?l:null})}return e}return t.filter(e=>e==null?void 0:e.assetId).map(e=>({displayMedia:e,lightboxMedia:e}))}function ee(t){return t.type==="video"}function ln(t){t.pause(),t.removeAttribute("src"),t.load()}function Ht(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height,left:e.left,top:e.top}}function an(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:{width:t.naturalWidth,height:t.naturalHeight}}const sn=1140/1440;function cn(t){return typeof t=="string"?{display:t.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(t==null?void 0:t.display)=="string"?t.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(t==null?void 0:t.ratioValue)??"2:3",reversed:(t==null?void 0:t.reversed)??!1}}function dn(t){const e=t.ratioValue??"1:1",o=t.reversed??!1,[r,l]=e.split(":").map(Number);return`${o?l:r} / ${o?r:l}`}function hn(t){return typeof t=="string"?t==="cover"?"cover":"fit":(t==null?void 0:t.display)==="cover"?"cover":"fit"}function un({src:t,phase:e,mediaRef:o,mediaStyle:r,onLoadedMetadata:l,onClick:h,onMouseMove:i,onTransitionEnd:p}){return a.useEffect(()=>{const s=o.current;if(s)return()=>{ln(s)}},[t,o]),n.jsx("video",{ref:o,src:t,controls:e==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:h,onMouseMove:i,onTransitionEnd:p,style:r})}const pn="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",fn=.004;function gn({prefix:t,closeIcon:e=pn,closeIconMaxWidth:o=.0125,closeIconColor:r="#FFFFFF",closeIconHoverColor:l="#999999",iconMarginRight:h=.01,contentMarginTop:i=.01,isEditor:p,isPreviewMode:s,isEditMode:u,visible:d,onClose:v}){if(!e)return null;const I=at.scalingValue(o,p),G=at.scalingValue(h,p),N=at.scalingValue(i,p),z=at.scalingValue(Math.max(i,fn),p);return n.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:d?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[n.jsx("div",{style:{position:"relative",width:"100%",height:N,flexShrink:0},children:u&&n.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${t}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:z,pointerEvents:d?"auto":"none"}})}),n.jsxs("div",{className:`${t}-close-icon`,style:{width:I,height:I,marginRight:G,pointerEvents:d?"auto":"none"},onClick:M=>M.stopPropagation(),children:[n.jsx("button",{type:"button",className:`${t}-close-icon-inner`,"aria-label":"Close",onClick:M=>{M.stopPropagation(),v()},children:n.jsx(Ge.SvgImage,{url:e,fill:r,hoverFill:p&&!s?r:l,className:`${t}-close-icon-img`})}),u&&n.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${t}-control`,style:{position:"absolute",top:0,left:"100%",width:G,height:"100%",pointerEvents:d?"auto":"none"}})]})]})}function mn({prefix:t,items:e,index:o,imageDisplay:r,isEditor:l,isPreviewMode:h,isEditMode:i,onClose:p,onPrev:s,onNext:u,counterClassName:d,counterStyle:v,backgroundColor:I,closeIcon:G,closeIconMaxWidth:N,closeIconColor:z,closeIconHoverColor:M,iconMarginRight:O,contentMarginTop:st}){const ct=r==="cover",D=a.useRef(null),E=a.useRef(null),L=a.useRef(null),b=a.useRef(0),m=a.useRef(0),$=a.useRef("none"),X=a.useRef(!1),A=a.useRef(!1),q=a.useRef(!1),K=a.useRef(null),[f,V]=a.useState(null),[w,R]=a.useState("opening"),[Q,gt]=a.useState(0),[jt,P]=a.useState(0),[T,tt]=a.useState(!1),[et,U]=a.useState(!1),[x,Vt]=a.useState(!1),Lt=a.useRef(o),Y=e[o],mt=Y?ee(Y):!1,xt=jt!==0||T,Z=a.useCallback(c=>{q.current=c,tt(c)},[]),F=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),St=a.useCallback(()=>{F(),K.current=window.setTimeout(()=>{F(),Z(!1)},rt+32)},[F,Z]),dt=a.useCallback(()=>{const c=D.current,g=E.current;if(!c)return;const C=c.getBoundingClientRect(),k=C.width,W=C.height;if(!k||!W)return;if(r==="cover"){V({width:k,height:W,left:C.left,top:C.top});return}if(!g){V(Ht(c));return}const{width:_,height:ot}=an(g);if(!_||!ot){V(Ht(c));return}const B=_/ot,y=k/W;if(B>y){const S=k/B;V({width:k,height:S,left:C.left,top:C.top+(W-S)/2})}else{const S=W*B;V({width:S,height:W,left:C.left+(k-S)/2,top:C.top})}},[r]);a.useEffect(()=>{dt();const c=D.current;if(!c)return;const g=new ResizeObserver(()=>dt());return g.observe(c),()=>g.disconnect()},[dt,o]),a.useEffect(()=>{w==="opening"&&f&&R("open")},[w,f]),a.useEffect(()=>{if(w!=="closing")return;const c=setTimeout(()=>p(),rt);return()=>clearTimeout(c)},[w,p]),a.useEffect(()=>()=>{F()},[F]),a.useLayoutEffect(()=>{if(Lt.current===o)return;F(),gt(0),P(0),Z(!1),Vt(!1),U(!1),b.current=0,m.current=0,$.current="none",X.current=!1,L.current=null,A.current=!1;const c=D.current;c&&V(Ht(c)),Lt.current=o},[o,Z,F]),a.useEffect(()=>{if(w!=="open")return;let c=null;const g=()=>{c&&(document.removeEventListener("click",c,!0),c=null)},C=()=>{g(),c=y=>{y.stopPropagation(),y.preventDefault(),g()},document.addEventListener("click",c,!0)},k=y=>{F(),q.current=!1,tt(!1),P(0),U(!1),X.current=!1,m.current=0,$.current="none";const S=D.current;S&&V(Ht(S)),y<0?u():s()},W=y=>{if(Math.abs(y)>Qe&&e.length>1){k(y);return}Z(!0),P(0),St()},_=y=>{if(y.touches.length!==1||q.current)return;const S=y.touches[0];A.current=!0,L.current={x:S.clientX,y:S.clientY},$.current="none",m.current=0,X.current=!1},ot=y=>{if(!L.current||y.touches.length!==1||q.current)return;const S=y.touches[0],pt=S.clientX-L.current.x,J=S.clientY-L.current.y;if($.current==="none"){if(Math.abs(pt)<10&&Math.abs(J)<10)return;if(Math.abs(pt)>Math.abs(J)){if(e.length<=1)return;$.current="horizontal"}else if(J>0)$.current="vertical";else return}if($.current==="horizontal"){X.current=!0,U(!0),m.current=pt,P(pt),y.preventDefault();return}$.current==="vertical"&&(X.current=!0,U(!0),b.current=J,gt(J),y.preventDefault())},B=()=>{if(!L.current)return;const y=$.current,S=X.current;if(S&&y==="horizontal")W(m.current),C();else if(S&&y==="vertical")if(b.current>Je){const J=window.innerHeight;b.current=J,Vt(!0),gt(J),R("closing")}else b.current=0,gt(0),C();else y==="horizontal"&&Math.abs(m.current)>0&&(W(m.current),C());L.current=null,$.current="none",m.current=0,X.current=!1,U(!1)};return document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",B),document.addEventListener("touchcancel",B),()=>{document.removeEventListener("touchstart",_),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",B),document.removeEventListener("touchcancel",B),g()}},[w,e.length,u,s,Z,St,F]),a.useEffect(()=>{const c=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),w!=="closing"&&R("closing"))};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[w]);const Rt=()=>{w!=="closing"&&R("closing")},nt=w==="open",kt=w==="closing",_t=Q>0?Math.max(0,1-Q/500):1,Nt=Q>0?Math.max(.35,1-Q/500):1,Mt=c=>{if(c.stopPropagation(),A.current){A.current=!1;return}if(e.length<=1)return;const g=c.currentTarget.getBoundingClientRect(),C=c.clientY-g.top,k=Math.min(52,g.height*.2);if(!(C>g.height-k)){if(c.clientX-g.left<g.width/2){s();return}u()}},zt=c=>{if(e.length<=1)return;const g=c.currentTarget.getBoundingClientRect(),C=c.clientX-g.left,k=c.clientY-g.top,W=Math.min(52,g.height*.2);if(k>g.height-W){c.currentTarget.style.cursor="default";return}c.currentTarget.style.cursor=C<g.width/2?"w-resize":"e-resize"},Dt=a.useCallback(c=>{c.propertyName!=="transform"||!q.current||(F(),Z(!1))},[F,Z]),Bt=xt?`translateX(${jt}px)`:Q>0?`translateY(${Q}px)`:void 0,ht={position:"fixed",top:f==null?void 0:f.top,left:f==null?void 0:f.left,width:f==null?void 0:f.width,height:f==null?void 0:f.height,objectFit:r==="cover"?"cover":"contain",transform:Bt,opacity:Q>0?Nt:w==="opening"||kt?0:1,transition:et&&!T?"none":T?`transform ${rt}ms ${ft}`:x?`transform ${rt}ms ${ft}, opacity ${rt}ms ${ft}`:w==="opening"||kt?`opacity ${rt}ms ${ft}`:"none",pointerEvents:mt&&nt&&!xt?"auto":"none",touchAction:mt&&nt?"none":void 0,zIndex:9998},ut=f?{position:"fixed",top:f.top,height:f.height,width:f.width/2,zIndex:9999}:null;return n.jsxs("div",{className:[`${t}-lightbox`,l?`${t}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:Rt,children:[n.jsx("div",{style:{position:"absolute",inset:0,background:I,opacity:nt?_t:0,transition:et?"none":`opacity ${rt}ms ${ft}`,pointerEvents:"none"}}),n.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:ct?n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:D,style:{position:"absolute",inset:0}}),n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:nt?1:0,transition:`opacity ${rt}ms ${ft}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&n.jsxs("p",{className:d,style:v,children:[o+1," / ",e.length]})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{height:"10%"}}),n.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsx("div",{ref:D,style:{width:"100%",height:"100%"}})}),n.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:nt?1:0,transition:`opacity ${rt}ms ${ft}`},children:e.length>1&&n.jsxs("p",{className:d,style:v,children:[o+1," / ",e.length]})})]})}),f&&Y&&(mt?n.jsx(un,{src:Y.assetId,phase:w,mediaRef:E,mediaStyle:ht,onLoadedMetadata:dt,onClick:Mt,onMouseMove:zt,onTransitionEnd:Dt},`${o}-${Y.assetId}`):n.jsx("img",{ref:E,src:Y.assetId,alt:Y.name,onLoad:dt,onTransitionEnd:Dt,style:ht},`${o}-${Y.assetId}`)),nt&&ut&&e.length>1&&!mt&&n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{...ut,left:f.left,cursor:"w-resize",pointerEvents:xt?"none":"auto"},onClick:c=>{if(A.current){A.current=!1;return}c.stopPropagation(),s()}}),n.jsx("div",{style:{...ut,left:f.left+f.width/2,cursor:"e-resize",pointerEvents:xt?"none":"auto"},onClick:c=>{if(A.current){A.current=!1;return}c.stopPropagation(),u()}})]}),n.jsx(gn,{prefix:t,closeIcon:G,closeIconMaxWidth:N,closeIconColor:z,closeIconHoverColor:M,iconMarginRight:O,contentMarginTop:st,isEditor:l,isPreviewMode:h,isEditMode:i,visible:nt,onClose:Rt})]})}function xe({P:t,media:e,imgWidth:o,cornerRadius:r,fillGalleryWidth:l,imageDisplay:h,isEditor:i,galleryPaddingBetween:p=0,showPaddingAfter:s=!1,showControls:u=!1,onMediaClick:d}){const v=`${t}-gallery-${ee(e)?"video":"image"}`,I=h.display==="cover",G=dn(h),N=m=>at.scalingValue(m,i??!1),z=o??bt,M=l?{width:"100%",maxWidth:"100%"}:{width:N(z),maxWidth:"100%"},O=r?{borderRadius:N(r)}:{},st={...M,...I?{aspectRatio:G,height:"auto",overflow:"hidden"}:{},...O},ct={...I?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:l?"100%":N(z)},...d?{cursor:"pointer",pointerEvents:"auto"}:{},...I?{}:O},E={className:v,style:ct,onClick:d?m=>{m.stopPropagation(),d()}:void 0},L=Math.max(p,lt),b=ee(e)?n.jsx("video",{...E,src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):n.jsx("img",{...E,src:e.assetId,alt:e.name??""});return n.jsxs("div",{className:`${t}-gallery-item`,children:[I?n.jsx("div",{style:st,children:b}):b,s&&p>0&&n.jsx("div",{className:`${t}-padding-handle`,style:{height:N(p)},"aria-hidden":"true"}),u&&s&&n.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:N(L)}})]})}function xn({P:t,layoutType:e,galleryWidthStyle:o,galleryPaddingRight:r,galleryPaddingLeft:l,galleryPaddingRightWidth:h,galleryPaddingLeftWidth:i,galleryPaddingMaxFraction:p,showControls:s,scaled:u,children:d}){const v=e==="a"?r:e==="c"?l:0,I=v>0||s;return n.jsxs("div",{className:`${t}-gallery-controls`,children:[e==="c"&&I&&n.jsx("div",{className:`${t}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),s&&e==="c"&&n.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(p),className:`${t}-control-anchor`,style:{top:0,left:0,width:u(i),height:"100%"}}),n.jsx("div",{className:`${t}-gallery`,style:o,children:d}),e==="a"&&I&&n.jsx("div",{className:`${t}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),s&&e==="a"&&n.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(p),className:`${t}-control-anchor`,style:{top:0,right:0,width:u(h),height:"100%"}})]})}function yn(t){switch(t){case"fade":case"retype":case"scroll":return t;case"default":return"scroll";default:return"scroll"}}function Ot({P:t,controlKey:e,scaled:o,height:r,paired:l,side:h}){return n.jsx("div",{"data-controls":e,...l?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{...h==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:o(r)}})}function ye({P:t,controlKey:e,scaled:o,width:r,maxFraction:l,side:h,paired:i,anchorStyle:p}){return n.jsx("div",{"data-controls":e,...i?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...h==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(l),className:`${t}-control-anchor`,style:{top:0,...h==="left"?{left:0}:{right:0},width:o(r),height:"100%",...p}})}function te({P:t,title:e,description:o,position:r,titleRef:l,titleClassName:h,titleContainerStyle:i,titleTextBoxStyle:p,titleStyle:s,descriptionClassName:u,descriptionStyle:d,descriptionPadding:v,showTextBoxOutline:I=!1,showDescriptionPaddingControl:G=!1,descriptionPaddingPaired:N=!1,topPaddingControl:z,bottomPaddingControl:M}){const O=a.useRef(null),[st,ct]=a.useState(0),D=e??"",E=o??"",L=E.length>0,{horizontal:b,vertical:m}=ne(r),$=m==="center"||m==="bottom",X=m==="bottom";a.useLayoutEffect(()=>{if(!$)return;const f=O.current;if(!f||typeof ResizeObserver>"u")return;const V=()=>ct(f.offsetHeight);V();const w=new ResizeObserver(V);return w.observe(f),()=>w.disconnect()},[D,E,$]);const A=n.jsx("span",{className:`${t}-title-text`,style:s,children:D}),q=L?n.jsx("span",{className:u,style:d,children:E}):null,K=L?n.jsx("div",{className:`${t}-title-texts-gap`,style:{height:v},children:G&&n.jsx("div",{"data-controls":"titleDescriptionPadding",...N?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return n.jsx("div",{ref:f=>{O.current=f,l(f)},className:[h,`${t}-title-h-${b}`,`${t}-title-v-${m}`].join(" "),style:{...$?{[`--${t}-title-height`]:`${st}px`}:{},...i},children:n.jsxs("div",{className:`${t}-title-text-stack`,style:p,children:[z,n.jsx("div",{className:I?`${t}-title-text-inner`:`${t}-title-text-inner-hidden`,style:{width:"100%"},children:n.jsx("div",{className:`${t}-title-texts`,children:X?n.jsxs(n.Fragment,{children:[q,K,A]}):n.jsxs(n.Fragment,{children:[A,K,q]})})}),M]})})}const ve=45;function $e(t,e,o){let r=t;for(;r;){const l=getComputedStyle(r).getPropertyValue(e).trim();if(l){const h=parseFloat(l);if(!Number.isNaN(h))return h}r=r.parentElement}return o}function vn(t){const e=$e(t,"--cntrl-viewport-height",window.innerHeight),o=$e(t,"--cntrl-article-top",0);return{top:o,height:e,centerY:o+e/2}}function $n(t,e,o){const{vertical:r}=ne(e),{top:l,height:h,centerY:i}=vn(o);if(r==="top"){const s=o&&parseFloat(getComputedStyle(o).top)||l;return Math.abs(t.top-s)}if(r==="bottom")return Math.abs(t.bottom-(l+h));const p=t.top+t.height/2;return Math.abs(p-i)}function wn(t,e,o){const r=Array.from({length:e},(i,p)=>{const s=t.current[p];if(!s)return 0;const u=s.getBoundingClientRect(),d=$n(u,o,s);return Math.exp(-(d*d)/(2*ve*ve))});let l=0,h=-1;return r.forEach((i,p)=>{i>h&&(h=i,l=p)}),{opacities:r,dominantIndex:l}}function bn(t,e,o){const r=a.useRef([]),[{opacities:l,dominantIndex:h},i]=a.useState(()=>({opacities:Array.from({length:t},(s,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!e||t===0){i({opacities:Array.from({length:t},()=>1),dominantIndex:0});return}let s=0;const u=()=>{i(wn(r,t,o))},d=()=>{s||(s=window.requestAnimationFrame(()=>{s=0,u()}))};return u(),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d,{passive:!0}),()=>{s&&window.cancelAnimationFrame(s),window.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[e,t,o]),{setTitleRef:s=>u=>{r.current[s]=u},opacities:l,dominantIndex:h}}function we(t,e){const[o,r]=a.useState(t),l=a.useRef(t);return a.useEffect(()=>{if(!e){l.current=t,r(t);return}const h=Array.from(l.current),i=Array.from(t),p=Math.max(h.length,i.length);if(p===0||l.current===t)return;let s=0;const u=window.setInterval(()=>{s+=1;const d=[...i.slice(0,s),...h.slice(s)].join("");l.current=d,r(d),s>=p&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[e,t]),o}function Sn({settings:t,content:e,isEditor:o,isPreviewMode:r,isEditMode:l,portalId:h}){var pe,fe;const{prefix:i}=Be.useScopedStyles(),p=a.useMemo(()=>Ke(i),[i]),s=e??[],u=(t==null?void 0:t.wrapperWidth)??1,d=(t==null?void 0:t.type)??"a",v=(t==null?void 0:t.imgWidth)??bt,I=(t==null?void 0:t.titleWidth)??sn,G=cn(t==null?void 0:t.imageDisplay),N=(t==null?void 0:t.cornerRadius)??Xe,z=Ye(t==null?void 0:t.position),{horizontal:M,vertical:O}=ne(z),st=(t==null?void 0:t.titleTopPadding)??0,ct=(t==null?void 0:t.titleBottomPadding)??0,D=(t==null?void 0:t.titleLeftPadding)??0,E=(t==null?void 0:t.titleRightPadding)??0,L=(t==null?void 0:t.titleDescriptionPadding)??0,b=yn(t==null?void 0:t.transition),m=(t==null?void 0:t.lightbox)??"on",$=d==="b",X=b==="fade"||b==="retype",{setTitleRef:A,dominantIndex:q}=bn(s.length,X,z),K=((pe=s[q])==null?void 0:pe.title)??"",f=((fe=s[q])==null?void 0:fe.description)??"",V=we(K,b==="retype"),w=we(f,b==="retype"),R=b==="fade"||b==="retype",Q=b==="retype"?V:K,gt=b==="retype"?w:f,jt=$?void 0:{width:at.scalingValue(v,o??!1)},P=m==="on"&&(!o||r||l),T=l??!1,tt=(t==null?void 0:t.galleryPaddingRight)??0,et=(t==null?void 0:t.galleryPaddingLeft)??0,U=(t==null?void 0:t.galleryPaddingBetween)??0,x=j=>at.scalingValue(j,o??!1),Lt={width:x(I)},Y=d==="a"?tt:et,mt=$?{width:"100%"}:{width:`calc(100% - ${x(v)} - ${x(Y)})`,...d==="c"?{marginLeft:"auto"}:{}},xt=Math.max(tt,lt),Z=Math.max(et,lt),F=Math.max(U,lt),St=Math.max(st,lt),dt=Math.max(ct,lt),Rt=Math.max(D,lt),nt=Math.max(E,lt),kt=Math.max(L,lt),_t=Math.max(0,(u??1)-(v??bt)),Nt=d==="a"?Math.max(0,(u??1)-(v??bt)-tt):d==="c"?Math.max(0,(u??1)-(v??bt)-et):d==="b"?u??1:1,Mt=T&&O==="top",zt=T&&O==="bottom",Dt=T&&M==="left",Bt=T&&M==="right",ht=s.length>1,ut=$?void 0:x((d==="c"?et:tt)+(v??bt)),c=d==="c"&&ut?{left:ut}:void 0,g=d==="a"&&ut?{right:ut}:void 0,C=$?{left:0,width:"100%"}:d==="a"?{right:x(tt),width:x(v)}:{left:x(et),width:x(v)},{titleColor:k,titleFontFamily:W,titleFontSettings:_,titleFontSize:ot,titleLineHeight:B,titleLetterSpacing:y,titleWordSpacing:S,titleAlign:pt,titleTextAppearance:J,descriptionColor:oe,descriptionFontFamily:Se,descriptionFontSettings:yt,descriptionFontSize:Gt,descriptionLineHeight:Xt,descriptionLetterSpacing:Ce,descriptionWordSpacing:Te,descriptionAlign:Ie,descriptionTextAppearance:je,lightboxCounterColor:ie,lightboxCounterFontFamily:Le,lightboxCounterFontSettings:vt,lightboxCounterFontSize:qt,lightboxCounterLineHeight:Kt,lightboxCounterLetterSpacing:Re,lightboxCounterWordSpacing:ke,lightboxCounterTextAppearance:Ne}=t??{},Me={fontSettings:{fontFamily:W,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:ot??.01,lineHeight:B,letterSpacing:y??0,wordSpacing:S??0,textAlign:pt??"left",textAppearance:J,color:k??"#000000"},re=wt.omitTextColors(wt.textStylesToCss(Me,o)),le=Lt,ae={...Pt(ot,B,i,o),...Pt(Gt,Xt,i,o,"description-leading-gap")},se=Qt(ot,B,`${i}-title`,`${i}-text-tight-leading`),ze={fontSettings:{fontFamily:Se,fontWeight:(yt==null?void 0:yt.fontWeight)??400,fontStyle:(yt==null?void 0:yt.fontStyle)??"normal"},fontSize:Gt??.01,lineHeight:Xt,letterSpacing:Ce??0,wordSpacing:Te??0,textAlign:Ie??"left",textAppearance:je,color:oe??"#000000"},ce=wt.omitTextColors(wt.textStylesToCss(ze,o)),de=Qt(Gt,Xt,`${i}-description-text`,`${i}-description-tight-leading`),he=x(T?kt:L),De={fontSettings:{fontFamily:Le,fontWeight:(vt==null?void 0:vt.fontWeight)??400,fontStyle:(vt==null?void 0:vt.fontStyle)??"normal"},fontSize:qt??.01,lineHeight:Kt,letterSpacing:Re??0,wordSpacing:ke??0,textAppearance:Ne,color:ie??"#DEDDDD"},Ee={...wt.omitTextColors(wt.textStylesToCss(De,o)),...Pt(qt,Kt,i,o)},Ae=Qt(qt,Kt,`${i}-lightbox-counter`,`${i}-text-tight-leading`),Ut=_e.buildColorVars(i,{titleColor:k??"#000000",descriptionColor:oe??"#000000",lightboxCounterColor:ie??"#DEDDDD"},Pe,tn),Yt=a.useRef(null),[Et,At]=a.useState(!1),[Ft,Fe]=a.useState([]),[We,Zt]=a.useState(0),ue=a.useCallback((j,H)=>{P&&(Fe(j),Zt(H),At(!0))},[P]),He=a.useCallback(()=>{At(!1)},[]),Oe=a.useMemo(()=>{const j={...Ut},H=Yt.current?getComputedStyle(Yt.current).getPropertyValue("--cntrl-article-width").trim():"";return H&&(j["--cntrl-article-width"]=H),j},[Ut,Et]);return a.useEffect(()=>{if(!Et||m!=="on"||typeof document>"u")return;const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}},[Et,m]),a.useEffect(()=>{!o||l||r||At(!1)},[o,l,r]),a.useEffect(()=>{m==="off"&&At(!1)},[m]),n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:p}}),n.jsx("div",{style:Ut,children:n.jsxs("div",{ref:Yt,className:`${i}-wrapper`,style:{width:at.scalingValue(u,o??!1),[`--${i}-title-top-padding`]:O==="top"?x(st):void 0,[`--${i}-title-bottom-padding`]:O==="bottom"?x(ct):void 0,[`--${i}-title-left-padding`]:M==="left"?x(D):void 0,[`--${i}-title-right-padding`]:M==="right"?x(E):void 0},children:[R&&n.jsx("div",{className:`${i}-single-title-layer`,children:n.jsx(te,{P:i,title:Q,description:gt,position:z,titleRef:()=>{},titleClassName:`${se} ${i}-single-title`,titleContainerStyle:{...ae,...mt},titleTextBoxStyle:le,titleStyle:re,descriptionClassName:de,descriptionStyle:ce,descriptionPadding:he,showTextBoxOutline:T,showDescriptionPaddingControl:T,topPaddingControl:Mt?Ot({P:i,controlKey:"titleTopPadding",scaled:x,height:St,paired:!1,side:"top"}):void 0,bottomPaddingControl:zt?Ot({P:i,controlKey:"titleBottomPadding",scaled:x,height:dt,paired:!1,side:"bottom"}):void 0})}),s.map((j,H)=>{const $t=rn(j.gallery),ge=H<s.length-1,Wt=$t.filter(it=>it.lightboxMedia).map(it=>it.lightboxMedia),me={P:i,position:z,titleRef:A(H),titleClassName:se,titleContainerStyle:ae,titleTextBoxStyle:R?{maxWidth:"100%"}:le,titleStyle:re,descriptionClassName:de,descriptionStyle:ce,descriptionPadding:he,showTextBoxOutline:T&&!R,showDescriptionPaddingControl:T&&!R,descriptionPaddingPaired:ht,topPaddingControl:Mt&&!R?Ot({P:i,controlKey:"titleTopPadding",scaled:x,height:St,paired:ht,side:"top"}):void 0,bottomPaddingControl:zt&&!R?Ot({P:i,controlKey:"titleBottomPadding",scaled:x,height:dt,paired:ht,side:"bottom"}):void 0};return n.jsxs("div",{"data-item-index":H,className:`${i}-item ${i}-item-${d}`,style:{paddingBottom:ge?x(U):void 0},children:[Dt&&ye({P:i,controlKey:"titleLeftPadding",scaled:x,width:Rt,maxFraction:Nt,side:"left",paired:ht,anchorStyle:c}),Bt&&ye({P:i,controlKey:"titleRightPadding",scaled:x,width:nt,maxFraction:Nt,side:"right",paired:ht,anchorStyle:g}),T&&ge&&n.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${i}-control-anchor`,style:{bottom:0,height:x(F),...C}}),$?n.jsxs("div",{className:`${i}-gallery`,children:[n.jsx("div",{className:`${i}-gallery-media`,children:$t.map(({displayMedia:it,lightboxMedia:Ct},Tt)=>{const It=Ct?Wt.findIndex(Jt=>Jt.assetId===Ct.assetId):-1;return n.jsx(xe,{P:i,media:it,imgWidth:v||void 0,cornerRadius:N||void 0,imageDisplay:G,isEditor:o,galleryPaddingBetween:U,showPaddingAfter:Tt<$t.length-1,showControls:T,onMediaClick:P&&It>=0?()=>ue(Wt,It):void 0},`${it.assetId}-${Tt}`)})}),n.jsx("div",{className:`${i}-title-layer`,children:n.jsx(te,{...me,title:R?"":j.title,description:R?"":j.description})})]}):n.jsxs(n.Fragment,{children:[n.jsx(te,{...me,title:R?"":j.title,description:R?"":j.description}),$t.length>0&&n.jsx(xn,{P:i,layoutType:d,galleryWidthStyle:jt,galleryPaddingRight:tt,galleryPaddingLeft:et,galleryPaddingRightWidth:xt,galleryPaddingLeftWidth:Z,galleryPaddingMaxFraction:_t,showControls:T,scaled:x,children:$t.map(({displayMedia:it,lightboxMedia:Ct},Tt)=>{const It=Ct?Wt.findIndex(Jt=>Jt.assetId===Ct.assetId):-1;return n.jsx(xe,{P:i,media:it,cornerRadius:N||void 0,fillGalleryWidth:!0,imageDisplay:G,isEditor:o,galleryPaddingBetween:U,showPaddingAfter:Tt<$t.length-1,showControls:T,onMediaClick:P&&It>=0?()=>ue(Wt,It):void 0},`${it.assetId}-${Tt}`)})})]})]},H)})]})}),Et&&m==="on"&&typeof document<"u"&&t&&(()=>{const j=(h?document.getElementById(h):null)??document.body;return Ve.createPortal(n.jsx("div",{style:Oe,"data-selection":"none",children:n.jsx(mn,{prefix:i,items:Ft,index:We,imageDisplay:hn(t.lightboxImageDisplay),isEditor:o,isPreviewMode:r,isEditMode:l,closeIcon:t.closeIcon,closeIconMaxWidth:t.closeIconMaxWidth,closeIconColor:t.closeIconColor,closeIconHoverColor:t.closeIconHoverColor,iconMarginRight:t.iconMarginRight,contentMarginTop:t.contentMarginTop,onClose:He,onPrev:()=>Zt(H=>(H-1+Ft.length)%Ft.length),onNext:()=>Zt(H=>(H+1)%Ft.length),counterClassName:Ae,counterStyle:Ee,backgroundColor:t.backgroundColor??Ze})}),j)})()]})}exports.Mercury=Sn;
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),Pt=require("react-dom"),Et=require("./getImageRect-BQhQXvT8.js"),Je=require("./scalingValue-CSHYgTZl.js"),en=require("./useScopedStyles-Bf6yohVQ.js"),tn=require("./textStylesToCss-CNN3zZTV.js"),nn=require("./HiveLightboxTitles-DlyptAaK.js");function rn(e){return`
|
|
2
|
-
.${e}-titles-row {
|
|
3
|
-
position: relative;
|
|
4
|
-
flex: 0 1 auto;
|
|
5
|
-
z-index: 2;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
word-break: break-word;
|
|
9
|
-
min-width: 0;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: row;
|
|
12
|
-
align-items: baseline;
|
|
13
|
-
}
|
|
14
|
-
.${e}-titles-row-header {
|
|
15
|
-
flex: 1;
|
|
16
|
-
align-items: baseline;
|
|
17
|
-
}
|
|
18
|
-
.${e}-titles-row-header-controls {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: row;
|
|
21
|
-
align-items: baseline;
|
|
22
|
-
flex-shrink: 0;
|
|
23
|
-
}
|
|
24
|
-
.${e}-close-icon {
|
|
25
|
-
position: relative;
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
align-self: center;
|
|
28
|
-
pointer-events: auto;
|
|
29
|
-
z-index: 2;
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
border: none;
|
|
34
|
-
background-color: transparent;
|
|
35
|
-
padding: 0;
|
|
36
|
-
}
|
|
37
|
-
.${e}-close-icon-inner {
|
|
38
|
-
all: unset;
|
|
39
|
-
position: relative;
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
pointer-events: auto;
|
|
44
|
-
}
|
|
45
|
-
.${e}-close-icon-img {
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 50%;
|
|
48
|
-
left: 50%;
|
|
49
|
-
transform: translate(-50%, -50%);
|
|
50
|
-
}
|
|
51
|
-
.${e}-titles-baseline-strut {
|
|
52
|
-
width: 0;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
flex-shrink: 0;
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
white-space: nowrap;
|
|
57
|
-
}
|
|
58
|
-
.${e}-titles-row-titles {
|
|
59
|
-
position: relative;
|
|
60
|
-
flex: 1;
|
|
61
|
-
min-width: 0;
|
|
62
|
-
align-self: flex-start;
|
|
63
|
-
}
|
|
64
|
-
.${e}-titles-stack {
|
|
65
|
-
position: relative;
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: row;
|
|
68
|
-
align-items: baseline;
|
|
69
|
-
align-self: flex-start;
|
|
70
|
-
min-width: 0;
|
|
71
|
-
}
|
|
72
|
-
.${e}-titles-row-two-row {
|
|
73
|
-
display: flex;
|
|
74
|
-
flex: 1;
|
|
75
|
-
height: 100%;
|
|
76
|
-
min-height: 0;
|
|
77
|
-
align-self: stretch;
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
width: 100%;
|
|
80
|
-
}
|
|
81
|
-
.${e}-titles-row-top {
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: row;
|
|
84
|
-
align-items: baseline;
|
|
85
|
-
width: 100%;
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
margin-bottom: 0;
|
|
88
|
-
}
|
|
89
|
-
.${e}-titles-row-top .${e}-title-cell[data-title="title1"] {
|
|
90
|
-
flex: 0 0 auto;
|
|
91
|
-
min-width: 0;
|
|
92
|
-
}
|
|
93
|
-
.${e}-titles-row-bottom-wrap {
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
width: 100%;
|
|
97
|
-
margin-top: auto;
|
|
98
|
-
flex-shrink: 0;
|
|
99
|
-
}
|
|
100
|
-
.${e}-titles-row-bottom-area {
|
|
101
|
-
position: relative;
|
|
102
|
-
flex: 1;
|
|
103
|
-
min-height: 0;
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-direction: column;
|
|
106
|
-
width: 100%;
|
|
107
|
-
}
|
|
108
|
-
.${e}-titles-row-bottom {
|
|
109
|
-
position: relative;
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: row;
|
|
112
|
-
align-items: flex-end;
|
|
113
|
-
width: 100%;
|
|
114
|
-
}
|
|
115
|
-
.${e}-titles-row-bottom .${e}-title-cell {
|
|
116
|
-
flex: 0 0 auto;
|
|
117
|
-
}
|
|
118
|
-
.${e}-title-cell {
|
|
119
|
-
position: relative;
|
|
120
|
-
flex: 0 0 auto;
|
|
121
|
-
min-width: 0;
|
|
122
|
-
box-sizing: border-box;
|
|
123
|
-
}
|
|
124
|
-
.${e}-text-bar-cell {
|
|
125
|
-
position: relative;
|
|
126
|
-
flex: 0 1 auto;
|
|
127
|
-
min-width: 0;
|
|
128
|
-
display: flex;
|
|
129
|
-
align-items: baseline;
|
|
130
|
-
}
|
|
131
|
-
.${e}-title1,
|
|
132
|
-
.${e}-title2,
|
|
133
|
-
.${e}-title3 {
|
|
134
|
-
margin: 0;
|
|
135
|
-
min-width: 0;
|
|
136
|
-
}
|
|
137
|
-
.${e}-title-resize-handle {
|
|
138
|
-
background: transparent;
|
|
139
|
-
}
|
|
140
|
-
.${e}-lightbox {
|
|
141
|
-
position: fixed;
|
|
142
|
-
inset: 0;
|
|
143
|
-
z-index: 9997;
|
|
144
|
-
overscroll-behavior: none;
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
}
|
|
147
|
-
.${e}-lightbox-editor {
|
|
148
|
-
inset: auto;
|
|
149
|
-
top: var(--cntrl-article-top, 0);
|
|
150
|
-
left: var(--cntrl-article-left, 0);
|
|
151
|
-
width: var(--cntrl-article-width, 100vw) !important;
|
|
152
|
-
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
153
|
-
}
|
|
154
|
-
.${e}-lightbox-edit-mode {
|
|
155
|
-
z-index: 1;
|
|
156
|
-
}
|
|
157
|
-
.${e}-lightbox-dismiss-area {
|
|
158
|
-
position: relative;
|
|
159
|
-
width: 100%;
|
|
160
|
-
height: 100%;
|
|
161
|
-
}
|
|
162
|
-
.${e}-lightbox-overlay-content {
|
|
163
|
-
position: absolute;
|
|
164
|
-
inset: 0;
|
|
165
|
-
z-index: 3;
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
isolation: isolate;
|
|
170
|
-
}
|
|
171
|
-
.${e}-lightbox-content-area {
|
|
172
|
-
position: relative;
|
|
173
|
-
display: flex;
|
|
174
|
-
flex-direction: row;
|
|
175
|
-
align-items: flex-start;
|
|
176
|
-
flex: 1;
|
|
177
|
-
min-width: 0;
|
|
178
|
-
min-height: 0;
|
|
179
|
-
}
|
|
180
|
-
.${e}-lightbox-content-area-stacked {
|
|
181
|
-
align-items: stretch;
|
|
182
|
-
align-self: stretch;
|
|
183
|
-
}
|
|
184
|
-
.${e}-text-bar-cell-stacked {
|
|
185
|
-
align-self: stretch;
|
|
186
|
-
flex: 1;
|
|
187
|
-
min-width: 0;
|
|
188
|
-
min-height: 0;
|
|
189
|
-
height: 100%;
|
|
190
|
-
flex-direction: column;
|
|
191
|
-
align-items: stretch;
|
|
192
|
-
}
|
|
193
|
-
.${e}-control {
|
|
194
|
-
position: relative;
|
|
195
|
-
z-index: 2;
|
|
196
|
-
pointer-events: auto;
|
|
197
|
-
flex-shrink: 0;
|
|
198
|
-
}
|
|
199
|
-
`}const Z=500,Ne=650,_="cubic-bezier(0.22, 1, 0.36, 1)",on=72,an=50,ln=1e4,cn=650,sn=500;function un(e,t){const r=e.width/t.width,i=e.height/t.height,a=e.left-t.left,c=e.top-t.top;return`translate(${a}px, ${c}px) scale(${r}, ${i})`}function Ft(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Et.getDisplayedImageRect(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const r=e.getBoundingClientRect();return{left:r.left,top:r.top,width:r.width,height:r.height}}function fn(e,t,r){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Ft(i,r):null}function dn(e){return e.reduce((t,r,i)=>{var a;return(a=r.image)!=null&&a.assetId&&t.push({gridIndex:i,items:[r.image],entry:{title1:r.title??"",title2:r.subtitle??"",title3:r.caption??""}}),t},[])}function We(e,t,r){var a;if(e.length<=1)return null;const i=(t+r+e.length)%e.length;return((a=e[i])==null?void 0:a.items[0])??null}function Ht(e,t,r){if(e.length<=2)return null;const i=(t+r+e.length)%e.length;return We(e,i,r)}const hn=.03;function Nt(e){return e.width*hn}const ft={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Ze(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function At(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function pn(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function dt(e,t,r){const i=e.getBoundingClientRect(),a=i.width,c=i.height,g=t/r,f=a/c;if(g>f){const y=a/g;return{width:a,height:y,left:i.left,top:i.top+(c-y)/2}}const $=c*g;return{width:$,height:c,left:i.left+(a-$)/2,top:i.top}}function gn(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:dt(e,t.width,t.height)}function mn(e,t){if(Pe(e)){const i=document.createElement("video"),a=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",a)};i.addEventListener("loadedmetadata",a),i.preload="auto",i.src=e.assetId,i.load();return}const r=new Image;r.onload=()=>{r.naturalWidth>0&&r.naturalHeight>0&&t(e.assetId,r.naturalWidth,r.naturalHeight)},r.src=e.assetId}function wn(e){const t=new Set,r=[];for(const i of e){const a=i.image;!(a!=null&&a.assetId)||t.has(a.assetId)||(t.add(a.assetId),r.push(a))}return r}function vn({mediaList:e}){return e.length===0?null:s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Pe(t)?s.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):s.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Ce(e,t,r){const{width:i,height:a,top:c}=e,{left:g,width:f}=r,$=Nt(r);return t==="left"?{left:g+$-i,top:c,width:i,height:a}:{left:g+f-$,top:c,width:i,height:a}}function Qe(e,t,r){const i=Ce(e,t,r);return{...i,left:2*i.left-e.left}}function xn(e,t,r){const{left:i,width:a}=r,c=Nt(r);return t==="left"?{left:i,top:e.top,width:c,height:e.height}:{left:i+a-c,top:e.top,width:c,height:e.height}}function Wt(e,t,r,i){const a=Ce(e,"left",i),c=Ce(e,"right",i),g=Qe(e,"left",i),f=Qe(e,"right",i);if(r===1)switch(t){case"center":return{start:e,end:a};case"right-adjacent":return{start:c,end:e};case"left-adjacent":return{start:a,end:g};case"far-right":return{start:f,end:c};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:c};case"left-adjacent":return{start:a,end:e};case"right-adjacent":return{start:c,end:f};case"far-left":return{start:g,end:a};default:return{start:e,end:e}}}function yn(e,t,r,i){const{start:a,end:c}=Wt(e,t,r,i);return{x:c.left-a.left,y:c.top-a.top}}function bn(e,t,r){const i=Ce(e,t,r),a=Qe(e,t,r);return{x:a.left-i.left,y:a.top-i.top}}function Pe(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function $n({src:e,phase:t,onMediaElement:r,wrapperStyle:i,videoStyle:a,onLoadedMetadata:c,onTransitionEnd:g}){const f=o.useRef(null);return o.useEffect(()=>{const $=f.current;return r==null||r($??null),()=>{$==null||$.pause(),r==null||r(null)}},[e,r]),s.jsx("div",{style:i,onTransitionEnd:g,children:s.jsx("video",{ref:f,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:c,onClick:$=>$.stopPropagation(),style:a},e)})}function Ke({media:e,style:t,onTransitionEnd:r,onMeasure:i}){return Pe(e)?s.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:a=>{const c=a.currentTarget;c.videoWidth>0&&c.videoHeight>0&&(i==null||i(e.assetId,c.videoWidth,c.videoHeight))},onTransitionEnd:r}):s.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:a=>{const c=a.currentTarget;c.naturalWidth>0&&c.naturalHeight>0&&(i==null||i(e.assetId,c.naturalWidth,c.naturalHeight))},onTransitionEnd:r})}function Sn({prefix:e,items:t,index:r,entry:i,settings:a,isEditor:c,isEditMode:g,isPreviewMode:f,canNavigate:$,lightboxEntries:y,entryIdx:K,layoutId:et,sourceRect:ae,resolveCloseSourceRect:ge,onClose:Oe,onPrev:J,onNext:je}){const He=o.useRef(null),V=o.useRef(null),M=o.useRef(null),Q=o.useRef(new Map),[le,ze]=o.useState(0),P=o.useRef(null),ee=o.useRef(0),k=o.useRef(0),C=o.useRef("none"),A=o.useRef(!1),me=o.useRef(!1),we=o.useRef(!1),ce=o.useRef(null),W=o.useRef(null),xe=o.useRef(null),te=o.useRef(()=>{}),se=o.useRef(null),ue=o.useRef(null),fe=o.useRef(null),ne=o.useRef(!1),[j,ve]=o.useState(null),[H,E]=o.useState(ft),[tt,nt]=o.useState(0),[m,ye]=o.useState("opening"),[B,be]=o.useState(0),[h,v]=o.useState(0),[b,O]=o.useState(!1),[F,re]=o.useState(null),[de,$e]=o.useState(null),[De,Se]=o.useState(null),[Ot,rt]=o.useState(!1),[zt,Dt]=o.useState(null),[ht,ot]=o.useState(!1),_e=o.useRef(!1),[q,Ie]=o.useState(!1),[_t,pt]=o.useState(!1),gt=o.useRef(r),mt=o.useRef(void 0),p=t[r],Ve=p?Pe(p):!1,G=h!==0||b,it=!g&&(!c||!!f),oe=$&&!g,he=y.length>1,ke=o.useCallback((n,l)=>t.length<=1?null:t[(n+l+t.length)%t.length]??null,[t]),L=he?We(y,K,-1):ke(r,-1),R=he?We(y,K,1):ke(r,1),at=F===-1&&G?he&&de!==null?We(y,de,-1):De!==null?ke(De,-1):null:null,lt=F===1&&G?he&&de!==null?We(y,de,1):De!==null?ke(De,1):null:null,Vt=at&&at.assetId!==(L==null?void 0:L.assetId)?at:null,Mt=lt&<.assetId!==(R==null?void 0:R.assetId)?lt:null,Bt=L&&oe?(()=>{const n=he?Ht(y,K,-1):t.length>2?ke((r-1+t.length)%t.length,-1):null;return n&&n.assetId!==L.assetId?n:null})():null,qt=R&&oe?(()=>{const n=he?Ht(y,K,1):t.length>2?ke((r+1)%t.length,1):null;return n&&n.assetId!==R.assetId?n:null})():null,Me=Vt??Bt,Be=Mt??qt,pe=o.useCallback((n,l,d)=>{if(!n||!l||!d)return;const u=Q.current,x=u.get(n);(x==null?void 0:x.width)===l&&(x==null?void 0:x.height)===d||(u.set(n,{width:l,height:d}),ze(D=>D+1))},[]),Le=o.useCallback(n=>{if(!(n!=null&&n.assetId))return null;const l=Q.current.get(n.assetId);return gn(V.current,l)},[le,tt]),qe=o.useCallback(()=>{if(!p)return;const n=Le(p);if(n){ve(n);return}const l=V.current;l&&ve(At(l))},[p,Le]),Ge=o.useCallback(n=>{if(he){const l=y.length;$e((K+n+l)%l),Se(null);return}t.length>1&&(Se((r+n+t.length)%t.length),$e(null))},[he,y.length,K,t.length,r]),T=o.useCallback(n=>{we.current=n,O(n)},[]),S=o.useCallback(()=>{ce.current!==null&&(window.clearTimeout(ce.current),ce.current=null)},[]),wt=o.useCallback(()=>{S(),ce.current=window.setTimeout(()=>{S(),T(!1)},Ne+32)},[S,T]),vt=o.useCallback(()=>{const n=He.current;if(!n){E({left:0,top:0,width:typeof window<"u"?window.innerWidth:ft.width,height:typeof window<"u"?window.innerHeight:ft.height});return}const l=n.getBoundingClientRect();E({left:l.left,top:l.top,width:l.width,height:l.height})},[]),xt=o.useCallback((n,l)=>{if(G){if(q&&!b)return`translate(${h}px, 0px)`;if(b&&F!==null){const d=Le(n);if(!d)return;const{x:u,y:x}=yn(d,l,F,H);return`translate(${u}px, ${x}px)`}if(b)return"translate(0px, 0px)"}},[G,q,b,h,F,H,Le]),Re=o.useCallback(()=>{const n=W.current;W.current=null,S(),T(!1),re(null),$e(null),Se(null),v(0),Ie(!1),A.current=!1,k.current=0,C.current="none",n===-1?J():n===1&&je()},[S,T,J,je]),Xe=o.useCallback(()=>{S(),ce.current=window.setTimeout(()=>{W.current!==null&&Re()},Ne+32)},[S,Re]),yt=o.useCallback(()=>{S(),W.current=null,T(!1),re(null),$e(null),Se(null),v(0),Ie(!1),A.current=!1,k.current=0,C.current="none"},[S,T]),bt=o.useCallback(n=>{if(!(!oe||!j)){if(we.current){if(W.current===n){xe.current=n,Re();return}yt()}S(),Ge(n),W.current=n,re(n),T(!0),Xe()}},[oe,j,Re,yt,S,Ge,T,Xe]);te.current=bt;const ie=o.useCallback(()=>{se.current=null,ne.current=!1,ue.current!==null&&(window.clearInterval(ue.current),ue.current=null),fe.current!==null&&(window.clearTimeout(fe.current),fe.current=null)},[]),ct=o.useCallback(n=>{ue.current!==null&&window.clearInterval(ue.current);const l=ne.current?sn:cn;ue.current=window.setInterval(()=>{te.current(n)},l)},[]),$t=o.useCallback(n=>{se.current!==n&&(ie(),se.current=n,ne.current=!1,te.current(n),ct(n),fe.current=window.setTimeout(()=>{fe.current=null,se.current===n&&(ne.current=!0,ct(n))},ln))},[ie,ct]),X=o.useCallback(()=>{const n=V.current;if(!n)return;const l=p==null?void 0:p.assetId,d=l?Q.current.get(l):void 0;if(d!=null&&d.width&&(d!=null&&d.height)){ve(dt(n,d.width,d.height));return}const u=M.current;if(u&&l&&(u.src===l||u.currentSrc===l)){const{width:D,height:w}=pn(u);if(D&&w){pe(l,D,w),ve(dt(n,D,w));return}}const x=At(n);!x.width||!x.height||ve(x)},[p==null?void 0:p.assetId,pe]),St=o.useCallback(n=>{if(M.current=n,!!n){if(n instanceof HTMLVideoElement){n.readyState>=1&&n.videoWidth>0&&X();return}n.complete&&n.naturalWidth>0&&X()}},[X]),Ae=o.useCallback(()=>{vt(),X(),nt(n=>n+1)},[vt,X]);o.useEffect(()=>{Ae();const n=V.current,l=He.current,d=new ResizeObserver(()=>Ae());return n&&d.observe(n),l&&d.observe(l),window.addEventListener("resize",Ae),()=>{d.disconnect(),window.removeEventListener("resize",Ae)}},[Ae,r,et]),o.useLayoutEffect(()=>{if(!p)return;const n=M.current;if(n){if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0){X();return}n instanceof HTMLVideoElement&&n.readyState>=1&&n.videoWidth>0&&X()}},[p==null?void 0:p.assetId,r,X]),o.useEffect(()=>{qe()},[qe,le]),o.useEffect(()=>{const n=new Set,l=[],d=u=>{!(u!=null&&u.assetId)||n.has(u.assetId)||(n.add(u.assetId),l.push(u))};t.forEach(d),y.forEach(u=>u.items.forEach(d)),l.forEach(u=>{Q.current.has(u.assetId)||mn(u,pe)})},[t,y,pe]),o.useEffect(()=>{if(m!=="opening"||!j)return;if(!ae){ye("open");return}rt(!1);const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{rt(!0),ye("open")})});return()=>cancelAnimationFrame(n)},[m,j,ae]),o.useEffect(()=>{if(m!=="closing")return;const n=setTimeout(()=>Oe(),Z);return()=>clearTimeout(n)},[m,Oe]),o.useEffect(()=>()=>{S()},[S]),o.useLayoutEffect(()=>{gt.current===r&&mt.current===(p==null?void 0:p.assetId)||(S(),W.current=null,re(null),$e(null),Se(null),be(0),v(0),T(!1),pt(!1),Ie(!1),ee.current=0,k.current=0,C.current="none",A.current=!1,P.current=null,me.current=!1,M.current=null,qe(),gt.current=r,mt.current=p==null?void 0:p.assetId)},[r,p==null?void 0:p.assetId,T,S,qe]),o.useLayoutEffect(()=>{const n=xe.current;n!==null&&(xe.current=null,requestAnimationFrame(()=>{te.current(n)}))},[r,K,p==null?void 0:p.assetId]),o.useLayoutEffect(()=>{if(m==="opening"){_e.current=!1,ot(!1);return}if(m!=="open"||_e.current)return;if(!L&&!R){_e.current=!0;return}ot(!1);const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ot(!0),_e.current=!0})});return()=>cancelAnimationFrame(n)},[m,L==null?void 0:L.assetId,R==null?void 0:R.assetId]),o.useEffect(()=>{if(m!=="open")return;const n=()=>{const w=I=>{I.stopPropagation(),I.preventDefault(),document.removeEventListener("click",w,!0)};document.addEventListener("click",w,!0)},l=w=>{const I=w<0?1:-1;S(),Ge(I),W.current=I,re(I),T(!0),Xe()},d=w=>{if(Math.abs(w)>an&&oe){l(w);return}W.current=null,re(null),$e(null),Se(null),T(!0),v(0),wt()},u=w=>{if(w.touches.length!==1||we.current)return;const I=w.touches[0];me.current=!0,P.current={x:I.clientX,y:I.clientY},C.current="none",k.current=0,A.current=!1},x=w=>{if(!P.current||w.touches.length!==1||we.current)return;const I=w.touches[0],Y=I.clientX-P.current.x,U=I.clientY-P.current.y;if(C.current==="none"){if(Math.abs(Y)<10&&Math.abs(U)<10)return;if(Math.abs(Y)>Math.abs(U)){if(!oe)return;C.current="horizontal"}else if(U>0){if(!it)return;C.current="vertical"}else return}if(C.current==="horizontal"){A.current=!0,Ie(!0),k.current=Y,v(Y),w.preventDefault();return}C.current==="vertical"&&(A.current=!0,Ie(!0),ee.current=U,be(U),w.preventDefault())},D=()=>{if(!P.current)return;const w=C.current,I=A.current;if(I&&w==="horizontal")d(k.current),n();else if(I&&w==="vertical"){const Y=ee.current;if(it&&Y>on){const U=window.innerHeight;ee.current=U,pt(!0),be(U),ye("closing")}else ee.current=0,be(0);n()}else w==="horizontal"&&Math.abs(k.current)>0&&(d(k.current),n());P.current=null,C.current="none",k.current=0,A.current=!1,Ie(!1)};return document.addEventListener("touchstart",u,{passive:!0}),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",D),document.addEventListener("touchcancel",D),()=>{document.removeEventListener("touchstart",u),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",D),document.removeEventListener("touchcancel",D)}},[m,oe,T,wt,S,it,Xe,Ge]);const st=o.useCallback(()=>{const n=(ge==null?void 0:ge())??ae??null;n&&j&&(Dt(n),rt(!0)),ye("closing")},[ge,ae,j]);o.useEffect(()=>{const n=u=>{if(u.key==="Escape"){if(c&&f||m==="closing")return;ie(),st();return}if(u.key!=="ArrowLeft"&&u.key!=="ArrowRight"||m!=="open"||!oe)return;u.preventDefault();const x=u.key==="ArrowLeft"?-1:1;u.repeat&&se.current===x||$t(x)},l=u=>{if(u.key!=="ArrowLeft"&&u.key!=="ArrowRight")return;const x=u.key==="ArrowLeft"?-1:1;se.current===x&&ie()},d=()=>{ie()};return window.addEventListener("keydown",n),window.addEventListener("keyup",l),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",l),window.removeEventListener("blur",d),ie()}},[m,c,f,st,oe,$t,ie]),o.useEffect(()=>{m!=="open"&&ie()},[m,ie]);const It=()=>{m==="closing"||g||st()},N=m==="open",Ye=m==="closing",Gt=B>0?Math.max(0,1-B/500):1,Xt=B>0?Math.max(.35,1-B/500):1,Te=o.useCallback(n=>{if(!(n.propertyName!=="transform"||!we.current)){if(W.current!==null){Re();return}S(),T(!1)}},[S,T,Re]),ut=m==="closing"?zt??ae:ae,Yt=ut&&j&&(m==="opening"||Ye)?un(ut,j):void 0,Ut=G&&p?xt(p,"center"):B>0?`translateY(${B}px)`:Yt,z=j?Ze(j,H):null,kt=!!(ut&&j),Zt=kt&&(m==="closing"||m==="open"&&Ot),Lt={position:"absolute",top:z==null?void 0:z.top,left:z==null?void 0:z.left,width:z==null?void 0:z.width,height:z==null?void 0:z.height,objectFit:"contain",transformOrigin:"top left",transform:Ut,opacity:B>0?Xt:kt?1:m==="opening"||Ye?0:1,transition:q&&!b?"none":b?`transform ${Ne}ms ${_}`:_t?`transform ${Z}ms ${_}, opacity ${Z}ms ${_}`:Zt?`transform ${Z}ms ${_}`:m==="opening"||Ye?`opacity ${Z}ms ${_}`:"none",pointerEvents:Ve&&N&&!G?"auto":"none",touchAction:Ve&&N?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:N&&!G?"auto":"none"},Ue=(n,l,d="adjacent")=>{const u=Le(n);if(!u)return{display:"none"};const x=d==="far"?l==="left"?"far-left":"far-right":l==="left"?"left-adjacent":"right-adjacent",{start:D}=F!==null?Wt(u,x,F,H):{start:d==="far"?Qe(u,l,H):Ce(u,l,H)},w=Ze(D,H),I=xt(n,x),Y=!G&&d==="adjacent"&&N&&!ht?bn(u,l,H):null,U=d==="far"&&G&&F===(l==="left"?-1:1),Jt=q&&!b?!1:b,Qt=d==="adjacent"&&N&&ht&&!G;return{position:"absolute",top:w.top,left:w.left,width:w.width,height:w.height,objectFit:"contain",transform:I??(Y?`translate(${Y.x}px, ${Y.y}px)`:void 0),opacity:d==="far"?N&&U?1:0:N?1:0,transition:Jt?d==="far"?`transform ${Ne}ms ${_}`:`transform ${Ne}ms ${_}, opacity ${Z}ms ${_}`:Qt?`transform ${Z}ms ${_}`:m==="opening"||Ye?`opacity ${Z}ms ${_}`:"none",pointerEvents:"none",zIndex:1}},Rt=(n,l)=>{const d=Le(n);return d?xn(Ce(d,l,H),l,H):null},Tt=n=>l=>{if(!g){if(me.current){me.current=!1;return}l.stopPropagation(),bt(n)}},Ct=L?Rt(L,"left"):null,jt=R?Rt(R,"right"):null,Ee=Ct?Ze(Ct,H):null,Fe=jt?Ze(jt,H):null;return s.jsxs("div",{ref:He,className:[`${e}-lightbox`,c?`${e}-lightbox-editor`:"",g?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:m==="open"?"none":void 0},onClick:It,children:[s.jsx("div",{style:{position:"absolute",inset:0,background:a.backgroundColor??"#FFFFFF",opacity:N?Gt:0,transition:q?"none":`opacity ${Z}ms ${_}`,pointerEvents:"none"}}),s.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[s.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[s.jsx("div",{style:{height:"10%"}}),s.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsx("div",{ref:V,style:{width:"100%",height:"100%"}})}),s.jsx("div",{style:{height:"10%"}})]}),s.jsx("div",{style:{position:"absolute",inset:0,opacity:N?1:0,transition:q?"none":`opacity ${Z}ms ${_}`,pointerEvents:"none"},children:s.jsx(nn.HiveLightboxTitles,{prefix:e,entry:i,settings:a,isEditor:c,isEditMode:g,isPreviewMode:f,onClose:It})})]}),N&&Me&&s.jsx(Ke,{media:Me,style:Ue(Me,"left","far"),onMeasure:pe,onTransitionEnd:Te},`far-prev-${Me.assetId}`),N&&L&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{media:L,style:Ue(L,"left"),onMeasure:pe,onTransitionEnd:Te},`prev-${L.assetId}`),Ee&&s.jsx("div",{style:{position:"absolute",top:Ee.top,left:Ee.left,width:Ee.width,height:Ee.height,cursor:g||q?"default":"pointer",pointerEvents:g||q?"none":"auto",zIndex:3},onClick:Tt(-1)})]}),N&&R&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{media:R,style:Ue(R,"right"),onMeasure:pe,onTransitionEnd:Te},`next-${R.assetId}`),Fe&&s.jsx("div",{style:{position:"absolute",top:Fe.top,left:Fe.left,width:Fe.width,height:Fe.height,cursor:g||q?"default":"pointer",pointerEvents:g||q?"none":"auto",zIndex:3},onClick:Tt(1)})]}),N&&Be&&s.jsx(Ke,{media:Be,style:Ue(Be,"right","far"),onMeasure:pe,onTransitionEnd:Te},`far-next-${Be.assetId}`),j&&p&&(Ve?s.jsx($n,{src:p.assetId,phase:m,onMediaElement:St,wrapperStyle:Lt,videoStyle:Kt,onLoadedMetadata:X,onTransitionEnd:Te},`${r}-${p.assetId}`):s.jsx("img",{ref:St,src:p.assetId,alt:p.name,onLoad:X,onTransitionEnd:Te,style:Lt},`${r}-${p.assetId}`))]})}const In=20,kn=.18;function Ln(e){return`
|
|
200
|
-
.${e}-wrapper {
|
|
201
|
-
box-sizing: border-box;
|
|
202
|
-
max-width: 100%;
|
|
203
|
-
overflow: visible;
|
|
204
|
-
overflow-wrap: anywhere;
|
|
205
|
-
word-break: break-word;
|
|
206
|
-
}
|
|
207
|
-
.${e}-item {
|
|
208
|
-
display: inline;
|
|
209
|
-
white-space: normal;
|
|
210
|
-
max-width: 100%;
|
|
211
|
-
}
|
|
212
|
-
.${e}-item-title {
|
|
213
|
-
display: inline;
|
|
214
|
-
white-space: pre-wrap;
|
|
215
|
-
overflow-wrap: anywhere;
|
|
216
|
-
word-break: break-word;
|
|
217
|
-
}
|
|
218
|
-
.${e}-type-a.${e}-wrapper,
|
|
219
|
-
.${e}-type-a .${e}-item-title {
|
|
220
|
-
text-align: left;
|
|
221
|
-
}
|
|
222
|
-
.${e}-type-b.${e}-wrapper,
|
|
223
|
-
.${e}-type-b .${e}-item-title {
|
|
224
|
-
text-align: center;
|
|
225
|
-
}
|
|
226
|
-
.${e}-type-c.${e}-wrapper,
|
|
227
|
-
.${e}-type-c .${e}-item-title {
|
|
228
|
-
text-align: right;
|
|
229
|
-
}
|
|
230
|
-
.${e}-item-image {
|
|
231
|
-
display: inline-block;
|
|
232
|
-
vertical-align: baseline;
|
|
233
|
-
position: relative;
|
|
234
|
-
z-index: 1;
|
|
235
|
-
height: 0;
|
|
236
|
-
width: calc(1cap * var(--${e}-image-aspect));
|
|
237
|
-
margin: 0 var(--${e}-image-inline-gap);
|
|
238
|
-
}
|
|
239
|
-
.${e}-item-image-fit {
|
|
240
|
-
width: calc(1cap * var(--${e}-item-media-aspect, var(--${e}-image-aspect)));
|
|
241
|
-
}
|
|
242
|
-
.${e}-item-image img,
|
|
243
|
-
.${e}-item-image video {
|
|
244
|
-
position: absolute;
|
|
245
|
-
left: 0;
|
|
246
|
-
bottom: 0;
|
|
247
|
-
display: block;
|
|
248
|
-
height: 1cap;
|
|
249
|
-
width: 100%;
|
|
250
|
-
max-height: none;
|
|
251
|
-
object-position: bottom;
|
|
252
|
-
}
|
|
253
|
-
.${e}-item-image-hover-scale img,
|
|
254
|
-
.${e}-item-image-hover-scale video {
|
|
255
|
-
transition: transform 0.3s ease;
|
|
256
|
-
}
|
|
257
|
-
.${e}-item-image-hover-scale:hover {
|
|
258
|
-
z-index: 10;
|
|
259
|
-
}
|
|
260
|
-
.${e}-item-image-hover-scale:hover img,
|
|
261
|
-
.${e}-item-image-hover-scale:hover video {
|
|
262
|
-
transform: scale(var(--${e}-image-hover-scale, 1.2));
|
|
263
|
-
}
|
|
264
|
-
.${e}-item-image-hover-saturate img,
|
|
265
|
-
.${e}-item-image-hover-saturate video {
|
|
266
|
-
filter: grayscale(100%);
|
|
267
|
-
transition: filter 0.3s ease;
|
|
268
|
-
}
|
|
269
|
-
.${e}-item-image-hover-saturate:hover img,
|
|
270
|
-
.${e}-item-image-hover-saturate:hover video {
|
|
271
|
-
filter: grayscale(0%);
|
|
272
|
-
}
|
|
273
|
-
.${e}-item-gap-host {
|
|
274
|
-
display: inline-block;
|
|
275
|
-
vertical-align: top;
|
|
276
|
-
height: var(--${e}-line-height);
|
|
277
|
-
position: relative;
|
|
278
|
-
flex-shrink: 0;
|
|
279
|
-
}
|
|
280
|
-
.${e}-item-gap-control {
|
|
281
|
-
position: absolute;
|
|
282
|
-
top: 0;
|
|
283
|
-
z-index: 2;
|
|
284
|
-
pointer-events: auto;
|
|
285
|
-
}
|
|
286
|
-
${rn(e)}
|
|
287
|
-
`}function Rn(e){const{imageDisplay:t}=e??{},r=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[a,c]=r.split(":").map(Number),g=i?c:a,f=i?a:c;return f>0?g/f:1}function Tn(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!r?null:t/r}function Cn(e,t,r){const i=(e==null?void 0:e.titleFontSize)??.07,a=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:Je.scalingValue(a,r??!1),[`--${t}-image-inline-gap`]:Je.scalingValue(i*kn,r??!1),[`--${t}-image-aspect`]:Rn(e)}}function jn(e,t){var i,a;const r={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((a=e==null?void 0:e.titleFontSettings)==null?void 0:a.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return tn.textStylesToCss(r,t)}function Hn(e){var a;const t=((a=e==null?void 0:e.imageDisplay)==null?void 0:a.display)==="cover",r=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...r?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function An(e,t,r,i,a,c){if(!(!e||!t))return g=>{var $;const f=(($=g.currentTarget.closest(`.${i}-item`))==null?void 0:$.querySelector(`[data-waterfall-index="${r}"]`))??(g.currentTarget instanceof HTMLImageElement||g.currentTarget instanceof HTMLVideoElement?g.currentTarget:null);c(r,f?Ft(f,a):void 0)}}function En({settings:e,content:t,isEditor:r,isPreviewMode:i,isEditMode:a,layoutId:c,portalId:g}){const{prefix:f}=en.useScopedStyles(),$=o.useMemo(()=>Ln(f),[f]),y=t??[],K=(e==null?void 0:e.type)??"a",et=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,ae=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,ge=Je.scalingValue(ae,r??!1),Oe=`max(${ge}, ${In}px)`,{objectFitMode:J,imageStyle:je}=Hn(e),He=jn(e,r),V=o.useRef(null),[M,Q]=o.useState(!1),[le,ze]=o.useState([]),[P,ee]=o.useState(0),[k,C]=o.useState(0),[A,me]=o.useState(null),[we,ce]=o.useState({title1:"",title2:"",title3:""}),W=(!r||i)&&!M,xe=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},te=xe.sizeType??"none",se=W&&te!=="none"?`${f}-item-image-hover-${te}`:void 0,ue=(xe.value??120)/100,fe=o.useCallback(h=>{!h||te!=="scale"||(h.style.transformOrigin=Et.getContainedMediaTransformOrigin(h))},[te]),ne=o.useCallback(h=>{if(h){if(J==="contain"){const v=Tn(h);if(v){const b=h.closest(`.${f}-item-image`);b instanceof HTMLElement&&b.style.setProperty(`--${f}-item-media-aspect`,String(v))}}fe(h)}},[f,fe,J]),j={width:Je.scalingValue(et,r??!1),...He,...Cn(e,f,r),[`--${f}-image-hover-scale`]:String(ue)},ve=(()=>{const h={},v=V.current?getComputedStyle(V.current).getPropertyValue("--cntrl-article-width").trim():"";return v&&(h["--cntrl-article-width"]=v),h})(),H=((e==null?void 0:e.lightbox)??"on")==="on"&&(!r||i||a),E=o.useMemo(()=>dn(y),[y]),tt=o.useMemo(()=>wn(y),[y]),nt=(h,v)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||r&&!a&&!i)return;const b=E.findIndex(F=>F.gridIndex===h);if(b<0)return;const O=E[b];C(b),ze(O.items),ee(0),ce(O.entry),me(v??null),Q(!0)},m=o.useCallback(()=>{Q(!1),me(null)},[]),ye=o.useCallback(()=>{const h=E[k];return!h||!V.current?A:fn(V.current,h.gridIndex,J)??A},[E,k,A,J]),B=o.useCallback(h=>{if(E.length>1){const v=E.length,b=(k+h+v)%v,O=E[b];C(b),ze(O.items),ee(0),ce(O.entry);return}ee(v=>(v+h+le.length)%le.length)},[E,k,le.length]),be=E.length>1||le.length>1;return o.useEffect(()=>{if(!M||typeof document>"u")return;const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}},[M]),o.useEffect(()=>{!r||a||i||Q(!1)},[r,a,i]),o.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&Q(!1)},[e==null?void 0:e.lightbox]),s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),s.jsx(vn,{mediaList:tt}),s.jsx("div",{ref:V,className:`${f}-wrapper ${f}-type-${K}`,style:j,children:y.map((h,v)=>{var F,re;const b=!!((F=h.image)!=null&&F.assetId),O=An(!!H,b,v,f,J,nt);return s.jsxs("div",{className:`${f}-item`,children:[h.title?s.jsx("span",{className:`${f}-item-title`,onClick:O,style:O?{cursor:"pointer"}:void 0,children:h.title}):null,(re=h.image)!=null&&re.assetId?s.jsx("span",{className:[`${f}-item-image`,J==="contain"?`${f}-item-image-fit`:void 0,se].filter(Boolean).join(" "),children:h.image.type==="video"?s.jsx("video",{ref:ne,src:h.image.assetId,"data-waterfall-index":v,style:je,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:O,onLoadedData:de=>ne(de.currentTarget)}):s.jsx("img",{ref:ne,src:h.image.assetId,alt:h.image.name??"","data-waterfall-index":v,style:je,onClick:O,onLoad:de=>ne(de.currentTarget)})}):null,v<y.length-1&&s.jsx("div",{className:`${f}-item-gap-host`,style:{width:ge},children:a&&!M&&s.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${f}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:Oe,height:"100%"}})})]},v)})}),M&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const h=(g?document.getElementById(g):null)??document.body;return Pt.createPortal(s.jsx("div",{style:ve,"data-selection":"none",children:s.jsx(Sn,{prefix:f,items:le,index:P,entry:we,settings:e,isEditor:r,isEditMode:a,isPreviewMode:i,canNavigate:be,lightboxEntries:E,entryIdx:k,layoutId:c,sourceRect:A,resolveCloseSourceRect:ye,onClose:m,onPrev:()=>B(-1),onNext:()=>B(1)})}),h)})()]})}exports.Waterfall=En;
|