@cntrl-site/components 1.0.118-alpha.2 → 1.0.118-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/{Burger-C3yVbQcq.js → Burger-B4kXX9aY.js} +1 -1
  2. package/dist/{Burger-BkVgNMGU.mjs → Burger-DyORh_vF.mjs} +1 -1
  3. package/dist/{ChroniclesComponent-Ds59v_47.mjs → ChroniclesComponent-DVoJ0kdT.mjs} +442 -512
  4. package/dist/ChroniclesComponent-Nm_yIRmr.js +1 -0
  5. package/dist/Components/Grid/Grid.d.ts +7 -25
  6. package/dist/Components/PopupMenu/PopupMenu.d.ts +73 -0
  7. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +594 -0
  8. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +203 -0
  9. package/dist/Components/PopupMenu/popupMenuSnap.d.ts +61 -0
  10. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +7 -0
  11. package/dist/{ControlSlider-DqKfaKMG.mjs → ControlSlider-3w-bHQEg.mjs} +1 -1
  12. package/dist/{ControlSlider-C8ckUIDm.js → ControlSlider-DB4nbVLT.js} +1 -1
  13. package/dist/{FAQ-DLh63Utr.js → FAQ-7HEkaoU6.js} +1 -1
  14. package/dist/{FAQ-CJHCMSBa.mjs → FAQ-GmiwRdFq.mjs} +1 -1
  15. package/dist/Grid-BuRdth9A.mjs +1622 -0
  16. package/dist/Grid-tqSSYh2-.js +408 -0
  17. package/dist/{Hive-CzabuuCc.js → Hive-34KvKNsa.js} +1 -1
  18. package/dist/{Hive-DyxYd5eg.mjs → Hive-7xHXyMM1.mjs} +1 -1
  19. package/dist/{HiveLightboxTitles-DhEeFKWs.mjs → HiveLightboxTitles-BCoL46-V.mjs} +1 -1
  20. package/dist/{HiveLightboxTitles-DlyptAaK.js → HiveLightboxTitles-DEeyQGcf.js} +1 -1
  21. package/dist/{Lightbox-DZckgBzK.js → Lightbox-Cb7lyaNt.js} +1 -1
  22. package/dist/{Lightbox-BY99NS14.mjs → Lightbox-DzPqgKP4.mjs} +1 -1
  23. package/dist/{LightboxJournal-Bf_rZzmz.js → LightboxJournal-B-vul_be.js} +1 -1
  24. package/dist/{LightboxJournal-BDUs6T0B.mjs → LightboxJournal-DisD2DLv.mjs} +1 -1
  25. package/dist/{LightboxStrip-RA4ABUC-.js → LightboxStrip-YDyEPEb6.js} +1 -1
  26. package/dist/{LightboxStrip-Cuhb2fIR.mjs → LightboxStrip-wCHUhAqN.mjs} +1 -1
  27. package/dist/{Mercury-B-s2Kvuq.js → Mercury-BmhtFYOw.js} +1 -1
  28. package/dist/{Mercury-CCW0Es-s.mjs → Mercury-Q788wrYQ.mjs} +1 -1
  29. package/dist/{OnelinerForm-C2Y_XMCY.js → OnelinerForm-CUmY-bXL.js} +1 -1
  30. package/dist/{OnelinerForm-BEu7_sho.mjs → OnelinerForm-D8WIB9Qy.mjs} +1 -1
  31. package/dist/PopupMenu-CYdDyzEt.mjs +1372 -0
  32. package/dist/PopupMenu-Di1fHgho.js +409 -0
  33. package/dist/{SimpleButton-C-o2W9bS.mjs → SimpleButton-DTpzfmb6.mjs} +1 -1
  34. package/dist/{SimpleButton-nGEcO2gB.js → SimpleButton-DtaCYa3y.js} +1 -1
  35. package/dist/{Slider20-DUi6qwnd.mjs → Slider20-CKngROrc.mjs} +1 -1
  36. package/dist/{Slider20-BOmjDRf2.js → Slider20-q0iGgnE3.js} +1 -1
  37. package/dist/SvgImage-CwRq9-ec.mjs +56 -0
  38. package/dist/SvgImage-_QN8ngad.js +1 -0
  39. package/dist/{TestimonialSingle-DrnyReim.mjs → TestimonialSingle-Bax71Hyo.mjs} +1 -1
  40. package/dist/{TestimonialSingle-BORQom3u.js → TestimonialSingle-CpEUendN.js} +1 -1
  41. package/dist/{Waterfall-DII4-WV5.js → Waterfall-B9YWMhrg.js} +1 -1
  42. package/dist/{Waterfall-3kKioKh2.mjs → Waterfall-znaoynn5.mjs} +1 -1
  43. package/dist/components-BYoTPJk3.js +1 -0
  44. package/dist/{components-MVf3iei3.mjs → components-eK82xypT.mjs} +653 -30
  45. package/dist/elements.js +1 -1
  46. package/dist/elements.mjs +24 -24
  47. package/dist/elements.node.js +1 -1
  48. package/dist/elements.node.mjs +1 -1
  49. package/dist/index.d.ts +3 -1
  50. package/dist/index.js +1 -1
  51. package/dist/index.mjs +63 -36
  52. package/dist/loadSvgMaskUrl-B6kHUyof.js +1 -0
  53. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +39 -0
  54. package/dist/sources.js +48 -250
  55. package/dist/sources.mjs +87 -290
  56. package/dist/types/Component.d.ts +7 -0
  57. package/dist/types/SchemaV1.d.ts +3 -0
  58. package/package.json +1 -1
  59. package/dist/ChroniclesComponent--pzhQXVD.js +0 -1
  60. package/dist/Components/Grid/CustomGridComponent.d.ts +0 -41
  61. package/dist/Grid-B0NOfgEm.mjs +0 -1713
  62. package/dist/Grid-DNaBgqZo.js +0 -415
  63. package/dist/SvgImage-B5mR9y6q.mjs +0 -51
  64. package/dist/SvgImage-DFlmxAoL.js +0 -1
  65. package/dist/components-tuVRZ0WY.js +0 -1
  66. package/dist/loadSvgMaskUrl-DfF7ay6h.js +0 -1
  67. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +0 -20
@@ -0,0 +1,408 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Mt=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const f=require("./scalingValue-CSHYgTZl.js"),ii=require("./buildColorVars-CE2D5cQV.js"),ni=require("./useScopedStyles-Bf6yohVQ.js"),Dt=require("./useLazyVideos-CdCbc2j0.js"),ct=require("./LinkWrapper-CTqM1ucO.js"),H=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),ri=require("react-dom"),Ne=require("./textStylesToCss-CNN3zZTV.js"),si=require("./SvgImage-_QN8ngad.js"),Ht=require("./LazyVideo-imbU18js.js");function oi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ot(e){return((e==null?void 0:e.trim().length)??0)>0}function St(e,i,n,a){return i!==void 0&&i<(e??.01)?`${n} ${a}`:n}function jt(e,i,n,a){const o=e??.01;return i===void 0||i>=o?{}:{[`--${n}-title-leading-gap`]:f.scalingValue((o-i)/2,a)}}const Ct=400,It="cubic-bezier(0.25, 0.1, 0.25, 1)",li=1.1,qt="--grid-media-radius";function ai(e){return`
2
+ .${e}-wrapper {
3
+ display: grid;
4
+ align-items: start;
5
+ justify-content: center;
6
+ min-height: ${oi(48)};
7
+ }
8
+ .${e}-item {
9
+ display: flex;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ align-items: center;
13
+ }
14
+ .${e}-item-inner {
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ outline: 1px solid #FF5C02;
19
+ }
20
+ .${e}-item-inner-hidden {
21
+ display: flex;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ }
25
+ .${e}-item-image-wrapper {
26
+ display: flex;
27
+ justify-content: center;
28
+ align-items: center;
29
+ align-self: center;
30
+ }
31
+ .${e}-item-image-wrapper-fit-slider {
32
+ display: grid;
33
+ overflow: hidden;
34
+ position: relative;
35
+ }
36
+ .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer {
37
+ grid-area: 1 / 1;
38
+ width: 100%;
39
+ display: grid;
40
+ visibility: hidden;
41
+ pointer-events: none;
42
+ }
43
+ .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer img {
44
+ grid-area: 1 / 1;
45
+ width: auto;
46
+ height: auto;
47
+ max-width: 100%;
48
+ object-fit: contain;
49
+ }
50
+ .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer video {
51
+ grid-area: 1 / 1;
52
+ width: auto;
53
+ height: auto;
54
+ max-width: 100%;
55
+ object-fit: contain;
56
+ }
57
+ .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer div {
58
+ grid-area: 1 / 1;
59
+ width: 100%;
60
+ }
61
+ .${e}-item-image-wrapper-fit-slider > .${e}-item-slider {
62
+ position: absolute;
63
+ inset: 0;
64
+ width: 100%;
65
+ overflow: hidden;
66
+ }
67
+ .${e}-item-slider .splide__track {
68
+ overflow: hidden;
69
+ }
70
+ .${e}-item-image-link {
71
+ width: 100%;
72
+ display: flex;
73
+ flex-direction: column;
74
+ align-items: center;
75
+ }
76
+ .${e}-item-text-link {
77
+ display: flex;
78
+ flex-direction: column;
79
+ align-items: center;
80
+ width: 100%;
81
+ color: inherit;
82
+ text-decoration: none;
83
+ }
84
+ .${e}-item-image {
85
+ width: 100%;
86
+ height: 100%;
87
+ display: block;
88
+ max-width: 100%;
89
+ }
90
+ .${e}-item-video {
91
+ width: 100%;
92
+ height: 100%;
93
+ display: block;
94
+ max-width: 100%;
95
+ }
96
+ .${e}-item-slider,
97
+ .${e}-item-slider .splide__track,
98
+ .${e}-item-slider .splide__list,
99
+ .${e}-item-slider .splide__slide {
100
+ width: 100%;
101
+ height: 100%;
102
+ }
103
+ .${e}-item-slider .splide__slide {
104
+ display: flex;
105
+ justify-content: center;
106
+ align-items: center;
107
+ }
108
+ .${e}-item-title {
109
+ white-space: normal;
110
+ overflow-wrap: anywhere;
111
+ word-break: break-word;
112
+ text-align: center;
113
+ margin-bottom: 0px;
114
+ margin-top: 0px;
115
+ color: var(--${e}-title-color);
116
+ }
117
+ .${e}-item-subtitle {
118
+ white-space: normal;
119
+ overflow-wrap: anywhere;
120
+ word-break: break-word;
121
+ text-align: center;
122
+ margin-bottom: 0px;
123
+ margin-top: 0px;
124
+ color: var(--${e}-subtitle-color);
125
+ }
126
+ .${e}-text-tight-leading {
127
+ display: block;
128
+ flex-shrink: 0;
129
+ padding-top: var(--${e}-title-leading-gap, 0);
130
+ padding-bottom: var(--${e}-title-leading-gap, 0);
131
+ }
132
+ .${e}-show-text-hover .${e}-item-title,
133
+ .${e}-show-text-hover .${e}-item-subtitle {
134
+ opacity: 0;
135
+ transition: opacity 250ms;
136
+ }
137
+ .${e}-show-text-hover .${e}-item-inner:hover .${e}-item-title,
138
+ .${e}-show-text-hover .${e}-item-inner:hover .${e}-item-subtitle,
139
+ .${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-title,
140
+ .${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-subtitle {
141
+ opacity: 1;
142
+ }
143
+ @property --${e}-hover-zoom {
144
+ syntax: '<number>';
145
+ inherits: false;
146
+ initial-value: 1;
147
+ }
148
+ .${e}-hover-zoom-in .${e}-item-image,
149
+ .${e}-hover-zoom-in .${e}-item-video {
150
+ transform: scale(var(--${e}-hover-zoom));
151
+ clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)) round calc(var(${qt}, 0px) / var(--${e}-hover-zoom)));
152
+ transition: --${e}-hover-zoom ${Ct}ms ${It};
153
+ }
154
+ .${e}-hover-scale-down .${e}-item-image,
155
+ .${e}-hover-scale-down .${e}-item-video {
156
+ transition: transform ${Ct}ms ${It};
157
+ }
158
+ .${e}-hover-greyscale .${e}-item-image-wrapper {
159
+ transition: filter ${Ct}ms ${It};
160
+ }
161
+ @media (hover: hover) {
162
+ .${e}-hover-zoom-in .${e}-item-image-wrapper:has(.${e}-item-image:hover, .${e}-item-video:hover) :is(.${e}-item-image, .${e}-item-video) {
163
+ --${e}-hover-zoom: ${li};
164
+ }
165
+ .${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-image,
166
+ .${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-video {
167
+ transform: scale(0.9);
168
+ }
169
+ .${e}-hover-greyscale:has(.${e}-item-image:hover, .${e}-item-video:hover) .${e}-item-image-wrapper:not(:has(.${e}-item-image:hover, .${e}-item-video:hover)) {
170
+ filter: grayscale(1);
171
+ }
172
+ }
173
+ .${e}-type-a .${e}-item-inner,
174
+ .${e}-type-a .${e}-item-inner-hidden,
175
+ .${e}-type-d .${e}-item-inner,
176
+ .${e}-type-d .${e}-item-inner-hidden {
177
+ align-items: flex-start;
178
+ }
179
+ .${e}-type-b .${e}-item-inner,
180
+ .${e}-type-b .${e}-item-inner-hidden,
181
+ .${e}-type-e .${e}-item-inner,
182
+ .${e}-type-e .${e}-item-inner-hidden {
183
+ align-items: center;
184
+ }
185
+ .${e}-type-c .${e}-item-inner,
186
+ .${e}-type-c .${e}-item-inner-hidden,
187
+ .${e}-type-f .${e}-item-inner,
188
+ .${e}-type-f .${e}-item-inner-hidden {
189
+ align-items: flex-end;
190
+ }
191
+ .${e}-type-a .${e}-item-image-link,
192
+ .${e}-type-b .${e}-item-image-link,
193
+ .${e}-type-c .${e}-item-image-link,
194
+ .${e}-type-d .${e}-item-image-link,
195
+ .${e}-type-e .${e}-item-image-link,
196
+ .${e}-type-f .${e}-item-image-link {
197
+ align-items: center;
198
+ }
199
+ .${e}-type-a .${e}-item-title,
200
+ .${e}-type-a .${e}-item-subtitle,
201
+ .${e}-type-d .${e}-item-title,
202
+ .${e}-type-d .${e}-item-subtitle {
203
+ text-align: left;
204
+ }
205
+ .${e}-type-b .${e}-item-title,
206
+ .${e}-type-b .${e}-item-subtitle,
207
+ .${e}-type-e .${e}-item-title,
208
+ .${e}-type-e .${e}-item-subtitle {
209
+ text-align: center;
210
+ }
211
+ .${e}-type-c .${e}-item-title,
212
+ .${e}-type-c .${e}-item-subtitle,
213
+ .${e}-type-f .${e}-item-title,
214
+ .${e}-type-f .${e}-item-subtitle {
215
+ text-align: right;
216
+ }
217
+ .${e}-item-text-block {
218
+ display: flex;
219
+ flex-direction: column;
220
+ align-items: flex-start;
221
+ width: 100%;
222
+ flex-shrink: 0;
223
+ }
224
+ .${e}-type-d .${e}-item-text-block {
225
+ align-items: flex-start;
226
+ }
227
+ .${e}-type-e .${e}-item-text-block {
228
+ align-items: center;
229
+ }
230
+ .${e}-type-f .${e}-item-text-block {
231
+ align-items: flex-end;
232
+ }
233
+ .${e}-type-a .${e}-item-text-link,
234
+ .${e}-type-d .${e}-item-text-link {
235
+ align-items: flex-start;
236
+ }
237
+ .${e}-type-b .${e}-item-text-link,
238
+ .${e}-type-e .${e}-item-text-link {
239
+ align-items: center;
240
+ }
241
+ .${e}-type-c .${e}-item-text-link,
242
+ .${e}-type-f .${e}-item-text-link {
243
+ align-items: flex-end;
244
+ }
245
+ .${e}-image-align-top .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
246
+ align-items: flex-start;
247
+ }
248
+ .${e}-image-align-center .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
249
+ align-items: center;
250
+ }
251
+ .${e}-image-align-bottom .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
252
+ align-items: flex-end;
253
+ }
254
+ .${e}-image-align-top .${e}-item-slider .splide__slide {
255
+ align-items: flex-start;
256
+ }
257
+ .${e}-image-align-center .${e}-item-slider .splide__slide {
258
+ align-items: center;
259
+ }
260
+ .${e}-image-align-bottom .${e}-item-slider .splide__slide {
261
+ align-items: flex-end;
262
+ }
263
+ .${e}-align-entries .${e}-item {
264
+ display: contents;
265
+ }
266
+ .${e}-align-entries .${e}-item-inner,
267
+ .${e}-align-entries .${e}-item-inner-hidden {
268
+ display: grid;
269
+ grid-template-rows: subgrid;
270
+ grid-row: span 3;
271
+ justify-self: center;
272
+ margin-bottom: var(--${e}-align-entries-row-gap, 0);
273
+ }
274
+ .${e}-align-entries .${e}-item-inner-last-row {
275
+ margin-bottom: 0;
276
+ }
277
+ .${e}-align-entries .${e}-item-text-link {
278
+ display: contents;
279
+ }
280
+ .${e}-align-entries .${e}-item-title-row,
281
+ .${e}-align-entries .${e}-item-subtitle-row {
282
+ display: flex;
283
+ flex-direction: column;
284
+ align-items: flex-start;
285
+ width: 100%;
286
+ min-height: 100%;
287
+ }
288
+ .${e}-type-a.${e}-align-entries .${e}-item-title-row,
289
+ .${e}-type-a.${e}-align-entries .${e}-item-subtitle-row,
290
+ .${e}-type-d.${e}-align-entries .${e}-item-title-row,
291
+ .${e}-type-d.${e}-align-entries .${e}-item-subtitle-row {
292
+ align-items: flex-start;
293
+ }
294
+ .${e}-type-b.${e}-align-entries .${e}-item-title-row,
295
+ .${e}-type-b.${e}-align-entries .${e}-item-subtitle-row,
296
+ .${e}-type-e.${e}-align-entries .${e}-item-title-row,
297
+ .${e}-type-e.${e}-align-entries .${e}-item-subtitle-row {
298
+ align-items: center;
299
+ }
300
+ .${e}-type-c.${e}-align-entries .${e}-item-title-row,
301
+ .${e}-type-c.${e}-align-entries .${e}-item-subtitle-row,
302
+ .${e}-type-f.${e}-align-entries .${e}-item-title-row,
303
+ .${e}-type-f.${e}-align-entries .${e}-item-subtitle-row {
304
+ align-items: flex-end;
305
+ }
306
+ .${e}-align-entries .${e}-item-image-link {
307
+ width: 100%;
308
+ height: 100%;
309
+ min-height: 100%;
310
+ display: flex;
311
+ flex-direction: column;
312
+ align-items: center;
313
+ justify-content: flex-start;
314
+ }
315
+ .${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
316
+ flex-shrink: 0;
317
+ height: auto;
318
+ align-self: auto;
319
+ }
320
+ .${e}-image-align-top.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
321
+ margin-top: 0;
322
+ margin-bottom: auto;
323
+ }
324
+ .${e}-image-align-center.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
325
+ margin-top: auto;
326
+ margin-bottom: auto;
327
+ }
328
+ .${e}-image-align-bottom.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
329
+ margin-top: auto;
330
+ margin-bottom: 0;
331
+ }
332
+ .${e}-image-align-top.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
333
+ align-items: flex-start;
334
+ }
335
+ .${e}-image-align-center.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
336
+ align-items: center;
337
+ }
338
+ .${e}-image-align-bottom.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
339
+ align-items: flex-end;
340
+ }
341
+ .${e}-image-align-top.${e}-align-entries .${e}-item-slider .splide__slide {
342
+ align-items: flex-start;
343
+ }
344
+ .${e}-image-align-center.${e}-align-entries .${e}-item-slider .splide__slide {
345
+ align-items: center;
346
+ }
347
+ .${e}-image-align-bottom.${e}-align-entries .${e}-item-slider .splide__slide {
348
+ align-items: flex-end;
349
+ }
350
+ .${e}-image-align-top.${e}-align-entries .${e}-item-image-link {
351
+ justify-content: flex-start;
352
+ }
353
+ .${e}-image-align-center.${e}-align-entries .${e}-item-image-link {
354
+ justify-content: center;
355
+ }
356
+ .${e}-image-align-bottom.${e}-align-entries .${e}-item-image-link {
357
+ justify-content: flex-end;
358
+ }
359
+ .${e}-lightbox-counter {
360
+ margin: 0;
361
+ color: var(--${e}-lightbox-counter-color);
362
+ }
363
+ .${e}-lightbox {
364
+ position: fixed;
365
+ inset: 0;
366
+ z-index: 9997;
367
+ overscroll-behavior: none;
368
+ overflow: hidden;
369
+ }
370
+ .${e}-lightbox-editor {
371
+ inset: auto;
372
+ top: var(--cntrl-article-top, 0);
373
+ left: var(--cntrl-article-left, 0);
374
+ width: var(--cntrl-article-width, 100vw) !important;
375
+ height: var(--cntrl-viewport-height, 100vh) !important;
376
+ }
377
+ .${e}-control {
378
+ position: relative;
379
+ z-index: 2;
380
+ width: 100%;
381
+ }
382
+ .${e}-close-icon {
383
+ position: relative;
384
+ flex-shrink: 0;
385
+ pointer-events: auto;
386
+ z-index: 2;
387
+ display: flex;
388
+ align-items: center;
389
+ justify-content: center;
390
+ border: none;
391
+ background-color: transparent;
392
+ padding: 0;
393
+ }
394
+ .${e}-close-icon-inner {
395
+ all: unset;
396
+ position: relative;
397
+ cursor: pointer;
398
+ width: 100%;
399
+ height: 100%;
400
+ pointer-events: auto;
401
+ }
402
+ .${e}-close-icon-img {
403
+ position: absolute;
404
+ top: 50%;
405
+ left: 50%;
406
+ transform: translate(-50%, -50%);
407
+ }
408
+ `}function ci(){return Math.random()<.5?"ltr":"ttb"}function di(e){const i=e.Components.Autoplay;i&&(i.pause(!1),i.play())}function ui(e){const i=ci();e.options.direction!==i&&(e.options={...e.options,direction:i}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{di(e)})})}const D=500,mi=750,le="cubic-bezier(0.22, 1, 0.36, 1)",gi=72,hi=50;function pi(e){if(!Array.isArray(e)||e.length===0)return!1;const i=e[0];return i!==null&&typeof i=="object"&&"media"in i&&Array.isArray(i.media)}function fi(e){const[i,n]=e.media;return n!=null&&n.assetId?n:i!=null&&i.assetId?i:null}function $i(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function Bt(e){return!Array.isArray(e)||e.length===0?[]:pi(e)?e.flatMap(i=>{const n=fi(i);if(!n)return[];const a=$i(i);return[{displayMedia:n,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function xe(e){return!H.isEmbedMedia(e)&&e.type==="video"}function yi(e){const i=new Set,n=[];for(const a of e){const o=Bt(a.gallery);for(const x of o){const y=x.lightboxMedia;y!=null&&y.assetId&&!i.has(y.assetId)&&(i.add(y.assetId),n.push(y))}}return n}function xi({mediaList:e}){const[i,n]=r.useState(null);Dt.useLazyVideos(i,{preload:"metadata"});const a=e.filter(o=>!H.isEmbedMedia(o));return a.length===0?null:t.jsx("div",{ref:n,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:a.map(o=>xe(o)?t.jsx("video",{src:o.assetId,preload:"none",muted:!0,playsInline:!0},o.assetId):t.jsx("img",{src:o.assetId,alt:""},o.assetId))})}function vi(e){e.pause(),e.removeAttribute("src"),e.load()}const wi=".splide__slide video";function bi(e){var o;if(e.closest(".splide--fade, .splide__slide.is-active:not(.splide__slide--clone), .splide__slide.is-next"))return!0;const i=e.closest(".splide__slide");if(!i||i.classList.contains("splide__slide--clone"))return!1;const n=i.dataset.slideIndex,a=(o=i.parentElement)==null?void 0:o.querySelector(".splide__slide.is-next");return n!==void 0&&(a==null?void 0:a.dataset.slideIndex)===n}function Wt({media:e,className:i,style:n,hasLightbox:a,isSplideSlide:o=!1,onMediaClick:x}){if(H.isEmbedMedia(e))return t.jsx(H.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x});if(xe(e)){const y={src:e.assetId,className:i,style:{...n,cursor:x?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:x};return o?t.jsx("video",{...y,preload:"none"}):t.jsx(Ht.LazyVideo,{...y,autoPlay:!0})}return t.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x})}function Si({className:e,style:i,children:n}){const[a,o]=r.useState(null);return Dt.useLazyVideos(a,{autoPlay:!0,selector:wi,shouldPlay:bi}),t.jsx("div",{ref:o,className:e,style:i,children:n})}function Et(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function ji(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const n=i.width/i.height,a=e.width/e.height;if(n>a){const x=e.width/n;return{width:e.width,height:x,left:e.left,top:e.top+(e.height-x)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Ci({src:e,mediaRef:i,mediaStyle:n,onLoadedMetadata:a}){return r.useEffect(()=>{const o=i.current;if(o)return()=>{vi(o)}},[e,i]),t.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:n})}const Ii="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",ki=.004;function Ti({prefix:e,closeIcon:i=Ii,closeIconMaxWidth:n=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:x=.01,contentMarginTop:y=.01,isEditor:q,isPreviewMode:ae,isEditMode:s,visible:V,onClose:Z}){if(!i)return null;const J=f.scalingValue(n,q),ce=f.scalingValue(x,q),ve=f.scalingValue(y,q),S=f.scalingValue(Math.max(y,ki),q);return t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:V?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[t.jsx("div",{style:{position:"relative",width:"100%",height:ve,flexShrink:0},children:s&&t.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:S,pointerEvents:V?"auto":"none"}})}),t.jsxs("div",{className:`${e}-close-icon`,style:{width:J,height:J,marginRight:ce,pointerEvents:V?"auto":"none"},onClick:j=>j.stopPropagation(),children:[t.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:j=>{j.stopPropagation(),Z()},children:t.jsx(si.SvgImage,{url:i,fill:a,hoverFill:q&&!ae?a:o,className:`${e}-close-icon-img`})}),s&&t.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:V?"auto":"none"}})]})]})}function Li({prefix:e,items:i,index:n,imageDisplay:a,isEditor:o,isPreviewMode:x,isEditMode:y,onClose:q,onPrev:ae,onNext:s,counterClassName:V,counterStyle:Z,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe}){const we=a==="cover",Re=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),L=r.useRef(null),B=r.useRef(0),_=r.useRef(0),z=r.useRef("none"),G=r.useRef(!1),Q=r.useRef(!1),Ue=r.useRef(null),k=r.useRef(0),M=r.useRef(null),N=r.useRef(!1),ie=r.useRef(null),X=r.useRef(null),Fe=r.useRef(null),Ye=r.useRef(()=>{}),[m,Ve]=r.useState(null),[c,dt]=r.useState(null),[w,be]=r.useState("opening"),[P,O]=r.useState(0),[me,W]=r.useState(0),[Ae,ne]=r.useState(null),[Me,ge]=r.useState(!1),[Se,he]=r.useState(!1),[ut,Ke]=r.useState(!1),[mt,Ze]=r.useState(null),Oe=r.useRef(n),Je=r.useRef(void 0),d=i[n],gt=d?xe(d):!1,Qe=d?H.isEmbedMedia(d):!1,je=Ae!==null,Pe=r.useCallback(l=>{const u=l.currentTarget,I=u instanceof HTMLVideoElement?{width:u.videoWidth,height:u.videoHeight}:{width:u.naturalWidth,height:u.naturalHeight};!I.width||!I.height||Ze(I)},[]);r.useEffect(()=>{Ue.current=c},[c]),r.useEffect(()=>{const l=Re.current;if(!l)return;const u=()=>dt(Et(l));u();const I=new ResizeObserver(u);return I.observe(l),()=>I.disconnect()},[]);const C=r.useCallback(()=>{ie.current!==null&&(window.clearTimeout(ie.current),ie.current=null)},[]),U=r.useCallback(()=>{const l=X.current;X.current=null,C(),M.current=null,N.current=!1,ne(null),ge(!1),W(0),k.current=0,he(!1),G.current=!1,_.current=0,z.current="none",l===1?s():l===-1&&ae()},[C,s,ae]),Ce=r.useCallback(()=>{C(),X.current=null,M.current=null,N.current=!1,ne(null),ge(!1),W(0),k.current=0},[C]),ht=r.useCallback(()=>{C(),ie.current=window.setTimeout(()=>{X.current!==null&&U()},D+32)},[C,U]),pe=r.useCallback((l,u)=>{var ee;const I=((ee=Ue.current)==null?void 0:ee.width)??0;if(C(),M.current=l,ne(l),N.current=!0,ge(!0),u){X.current=l;const se=-l*I;k.current=se,W(se),ht();return}k.current=0,W(0),ie.current=window.setTimeout(()=>{ie.current=null,Ce()},D+32)},[C,Ce,ht]),fe=r.useCallback(l=>{if(!(i.length<=1)){if(N.current){if(X.current===l){Fe.current=l,U();return}Ce()}C(),M.current=l,ne(l),N.current=!1,ge(!1),k.current=0,W(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(l,!0)})})}},[i.length,pe,U,Ce,C]);Ye.current=fe;const Ie=r.useCallback(l=>{l.propertyName!=="transform"||!N.current||X.current!==null&&U()},[U]),$e=r.useCallback(()=>{const l=de.current;if(!l)return;const u=Et(l);!u.width||!u.height||Ve(u)},[]);r.useEffect(()=>{$e();const l=de.current;if(!l)return;const u=new ResizeObserver(()=>$e());return u.observe(l),()=>u.disconnect()},[$e]),r.useEffect(()=>{w==="opening"&&m&&be("open")},[w,m]),r.useEffect(()=>{if(w!=="closing")return;const l=setTimeout(()=>q(),D);return()=>clearTimeout(l)},[w,q]),r.useEffect(()=>()=>{C()},[C]),r.useLayoutEffect(()=>{Oe.current===n&&Je.current===(d==null?void 0:d.assetId)||(C(),X.current=null,ne(null),O(0),W(0),ge(!1),Ke(!1),he(!1),Ze(null),B.current=0,_.current=0,z.current="none",G.current=!1,N.current=!1,k.current=0,M.current=null,L.current=null,Q.current=!1,Oe.current=n,Je.current=d==null?void 0:d.assetId)},[n,d==null?void 0:d.assetId,C]),r.useLayoutEffect(()=>{const l=Fe.current;l!==null&&(Fe.current=null,requestAnimationFrame(()=>{Ye.current(l)}))},[n,d==null?void 0:d.assetId]),r.useEffect(()=>{if(w!=="open")return;let l=null;const u=()=>{l&&(document.removeEventListener("click",l,!0),l=null)},I=()=>{u(),l=h=>{h.stopPropagation(),h.preventDefault(),u()},document.addEventListener("click",l,!0)},ee=h=>{const R=h<0?1:-1;if(Math.abs(h)>hi&&i.length>1){pe(R,!0);return}pe(R,!1)},se=h=>{if(h.touches.length!==1||N.current)return;const R=h.touches[0];Q.current=!0,L.current={x:R.clientX,y:R.clientY},z.current="none",_.current=0,G.current=!1},He=h=>{if(!L.current||h.touches.length!==1||N.current)return;const R=h.touches[0],te=R.clientX-L.current.x,v=R.clientY-L.current.y;if(z.current==="none"){if(Math.abs(te)<10&&Math.abs(v)<10)return;if(Math.abs(te)>Math.abs(v)){if(i.length<=1)return;z.current="horizontal"}else if(v>0)z.current="vertical";else return}if(z.current==="horizontal"){G.current=!0,he(!0),_.current=te;const F=te<0?1:-1;M.current!==F&&(M.current=F,ne(F)),k.current=te,W(te),h.preventDefault();return}z.current==="vertical"&&(G.current=!0,he(!0),B.current=v,O(v),h.preventDefault())},Le=()=>{if(!L.current)return;const h=z.current,R=G.current;if(R&&h==="horizontal")ee(_.current),I();else if(R&&h==="vertical")if(B.current>gi){const v=window.innerHeight;B.current=v,Ke(!0),O(v),be("closing")}else B.current=0,O(0),I();else h==="horizontal"&&Math.abs(_.current)>0&&(ee(_.current),I());L.current=null,z.current="none",_.current=0,G.current=!1,he(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",He,{passive:!1}),document.addEventListener("touchend",Le),document.addEventListener("touchcancel",Le),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",He),document.removeEventListener("touchend",Le),document.removeEventListener("touchcancel",Le),u()}},[w,i.length,pe]),r.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),w!=="closing"&&be("closing"))};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[w]);const ke=()=>{w!=="closing"&&be("closing")},ye=w==="open",We=w==="closing",pt=P>0?Math.max(0,1-P/500):1,ft=P>0?Math.max(.35,1-P/500):1,$t=Qe&&d?{width:H.getEmbedAspect(d),height:1}:mt,g=m?we?m:ji(m,$t):null,et={position:"fixed",top:c==null?void 0:c.top,left:c==null?void 0:c.left,width:c==null?void 0:c.width,height:c==null?void 0:c.height,zIndex:9998},Y=we?"cover":"contain",yt=me!==0||P>0?`translate(${me}px, ${P}px)`:void 0,Te=Se&&!Me?"none":Me?`transform ${D}ms ${le}`:ut?`transform ${D}ms ${le}, opacity ${D}ms ${le}`:w==="opening"||We?`opacity ${D}ms ${le}`:"none",Ee={...et,transform:yt,opacity:P>0?ft:w==="opening"||We?0:1,transition:Te,pointerEvents:"none"},De={position:"absolute",top:((g==null?void 0:g.top)??0)-((c==null?void 0:c.top)??0),left:((g==null?void 0:g.left)??0)-((c==null?void 0:c.left)??0),width:g==null?void 0:g.width,height:g==null?void 0:g.height,objectFit:Y,pointerEvents:"none"},tt=(c==null?void 0:c.width)??0,re=je?(n+Ae+i.length)%i.length:null,T=re!==null?i[re]:null,kt={...et,transform:je?`translateX(${Ae*tt+me}px)`:void 0,opacity:1,transition:Me?`transform ${D}ms ${le}`:"none",pointerEvents:"none"},it={position:"absolute",top:((m==null?void 0:m.top)??0)-((c==null?void 0:c.top)??0),left:((m==null?void 0:m.left)??0)-((c==null?void 0:c.left)??0),width:m==null?void 0:m.width,height:m==null?void 0:m.height,objectFit:Y,pointerEvents:"none"},xt=Qe&&d&&H.getEmbedPlayback(d).controls&&g?Math.min(52,g.height*.2):0,E=g?{position:"fixed",top:g.top,height:g.height-xt,width:g.width/2,zIndex:9999}:null;return t.jsxs("div",{ref:Re,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:ke,children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ye?pt:0,transition:Se?"none":`opacity ${D}ms ${le}`,pointerEvents:"none"}}),t.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:we?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:de,style:{position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:"10%"}}),t.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{ref:de,style:{width:"100%",height:"100%"}})}),t.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]})}),m&&c&&T&&t.jsx("div",{style:kt,onTransitionEnd:Ie,children:H.isEmbedMedia(T)?t.jsx("img",{src:T.thumbnail,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`):xe(T)?t.jsx("video",{src:T.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:it},`neighbor-${re}-${T.assetId}`):t.jsx("img",{src:T.assetId,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`)}),m&&c&&d&&t.jsx("div",{style:Ee,onTransitionEnd:Ie,children:Qe?t.jsx(H.EmbedMediaFrame,{media:d,fit:we?"cover":"contain",lazy:!1,startsAtOnce:!0,style:De},`${n}-${d.assetId}`):gt?t.jsx(Ci,{src:d.assetId,mediaRef:ue,mediaStyle:De,onLoadedMetadata:Pe},`${n}-${d.assetId}`):t.jsx("img",{ref:ue,src:d.assetId,alt:d.name,onLoad:Pe,style:De},`${n}-${d.assetId}`)}),ye&&E&&i.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...E,left:g.left,cursor:"w-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(-1)}}),t.jsx("div",{style:{...E,left:g.left+g.width/2,cursor:"e-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(1)}})]}),t.jsx(Ti,{prefix:e,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe,isEditor:o,isPreviewMode:x,isEditMode:y,visible:ye,onClose:ke})]})}function _i(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function zi({settings:e,content:i,isEditor:n,isPreviewMode:a,isEditMode:o,metadata:x,activeEvent:y,layoutId:q,portalId:ae}){const{prefix:s}=ni.useScopedStyles(),{type:V="a",gridLayout:Z,textBoxWidth:J=100,verticalGap:ce,entriesCount:ve,lightbox:S,imageDisplay:j,imageCorners:Xe,lightboxImageDisplay:we,slider:Re,sliderTiming:de,direction:ue,transition:L,titleMarginTop:B,subtitleMarginTop:_,titleColor:z,subtitleColor:G,lightboxCounterColor:Q,titleFontFamily:Ue,titleFontSettings:k,titleFontSize:M,titleLineHeight:N,titleLetterSpacing:ie,titleWordSpacing:X,titleTextAppearance:Fe,subtitleFontFamily:Ye,subtitleFontSettings:m,subtitleFontSize:Ve,subtitleLineHeight:c,subtitleLetterSpacing:dt,subtitleWordSpacing:w,subtitleTextAppearance:be,lightboxCounterFontFamily:P,lightboxCounterFontSettings:O,lightboxCounterFontSize:me,lightboxCounterLineHeight:W,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:ne,lightboxCounterTextAppearance:Me,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:ut,iconMarginRight:Ke,contentMarginTop:mt,showText:Ze="always",hover:Oe="none",alignEntries:Je="off",align:d="top"}=e,gt={fontSettings:{fontFamily:Ue,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:M??.01,lineHeight:N,letterSpacing:ie??0,wordSpacing:X??0,textAppearance:Fe,color:z},je={...Ne.omitTextColors(Ne.textStylesToCss(gt,n))},Pe={fontSettings:{fontFamily:Ye,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:Ve??.01,lineHeight:c,letterSpacing:dt??0,wordSpacing:w??0,textAppearance:be,color:G},U={...Ne.omitTextColors(Ne.textStylesToCss(Pe,n))},Ce={fontSettings:{fontFamily:P,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:me??.01,lineHeight:W,letterSpacing:Ae??0,wordSpacing:ne??0,textAppearance:Me,color:Q},pe={...Ne.omitTextColors(Ne.textStylesToCss(Ce,n)),...jt(me,W,s,n)},fe=St(M,N,`${s}-item-title`,`${s}-text-tight-leading`),Ie=St(Ve,c,`${s}-item-subtitle`,`${s}-text-tight-leading`),$e=jt(M,N,s,n),ke=jt(Ve,c,s,n),ye=St(me,W,`${s}-lightbox-counter`,`${s}-text-tight-leading`),We=ii.buildColorVars(s,{titleColor:z,subtitleColor:G,lightboxCounterColor:Q},Ni,Ri),pt=y&&y!=="default"?`${s}-state-${y}`:"",ft=Ze==="on hover"&&(!n||a),$t=Oe!=="none"&&(!n||a)?` ${s}-hover-${Oe}`:"",g=`${pt}${ft?` ${s}-show-text-hover`:""}${$t}`.trim(),et=ve===0?1/0:ve,Y=(i??[]).slice(0,et),yt=r.useMemo(()=>S==="on"?yi(Y):[],[Y,S]),Te=Z.entryWidth??.2,Ee=(j==null?void 0:j.display)==="cover",De=(j==null?void 0:j.ratioValue)??"1:1",tt=(j==null?void 0:j.reversed)??!1,[re,T]=De.split(":").map(Number),xt=`${tt?T:re} / ${tt?re:T}`,E=Z.columnsCount,l=f.scalingValue(Te??0,n),u=l,I=!Ee&&Re!=="off",ee=Y.length%E||E,se=ee<E&&Y.length>0,He=Y.length-ee,Le=se?Math.floor((E-ee)/2)+1:1,h=Xe?f.scalingValue(Xe,n):void 0,R={width:u,...Ee?{aspectRatio:xt,height:"auto",overflow:"hidden"}:{height:"auto"},...h?{borderRadius:h,overflow:"hidden"}:{}},te=`${s}-item-image-wrapper${I?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),v=V==="d"||V==="e"||V==="f",F=Je==="on",_e=`calc(${f.scalingValue(Te??0,n)} * (${J} / 100))`,oe=f.scalingValue(Te*J/100,n),Tt=h?{borderRadius:h,[qt]:h}:{},Lt=Ee?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Tt}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Tt},[Gt,Xt]=r.useState(0),nt=r.useRef(null),Ut=L==="fade"||ue==="horizontal"?"ltr":ue==="vertical"?"ttb":"ltr";r.useEffect(()=>{const p=nt.current;if(!p)return;const b=new ResizeObserver(A=>{Xt(Math.round(A[0].contentRect.width))});return b.observe(p),()=>b.disconnect()},[]);const Yt=(()=>{const p={...We},b=nt.current?getComputedStyle(nt.current).getPropertyValue("--cntrl-article-width").trim():"";return b&&(p["--cntrl-article-width"]=b),p})(),[vt,wt]=r.useState(!1),[rt,Kt]=r.useState([]),[Zt,bt]=r.useState(0),_t=S==="on"&&(!n||a),zt=(p,b)=>{n&&!a||S!=="off"&&(Kt(p),bt(b),wt(!0))};r.useEffect(()=>{if(!vt||S!=="on"||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[vt,S]),r.useEffect(()=>{!n||a||wt(!1)},[n,a]);const Jt=r.useMemo(()=>ai(s),[s]);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),S==="on"&&t.jsx(xi,{mediaList:yt}),t.jsx("div",{style:We,children:t.jsx("div",{ref:nt,className:`${s}-wrapper ${s}-type-${V}${F?` ${s}-align-entries`:""} ${s}-image-align-${d} ${g}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${l})`,rowGap:F?0:f.scalingValue(ce??0,n),columnGap:f.scalingValue(Z.horizontalGap??0,n),width:f.scalingValue(Z.wrapperWidth??0,n),...F?{[`--${s}-align-entries-row-gap`]:f.scalingValue(ce??0,n)}:{}},children:Y.map((p,b)=>{var At;const A=Ot(p.title),K=Ot(p.subtitle),ze=S==="off"&&((At=p.link)!=null&&At.value)?p.link:void 0,Qt=Math.floor(b/E)===Math.ceil(Y.length/E)-1,st=se&&b>=He?`${Le+(b-He)}`:void 0,Nt=v?t.jsxs("div",{className:`${s}-item-text-block`,children:[A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Pt=F?t.jsxs("div",{className:`${s}-item-title-row`,children:[!v&&t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),v&&A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}})]}):null,ei=F?t.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!v&&t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),v&&K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Rt=t.jsxs(ct.LinkWrapper,{link:ze,className:`${s}-item-text-link`,children:[Pt,ei]}),qe=Bt(p.gallery),ot=qe.filter($=>$.lightboxMedia).map($=>$.lightboxMedia),lt=t.jsx(Si,{className:te,style:R,children:qe.length===0?null:Re==="off"?(()=>{const{displayMedia:$,lightboxMedia:Be}=qe[0],Ge=Be?ot.findIndex(at=>at.assetId===Be.assetId):-1;return t.jsx(Wt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Lt,hasLightbox:S==="on",onMediaClick:_t&&Ge>=0?()=>zt(ot,Ge):void 0})})():t.jsxs(t.Fragment,{children:[I&&t.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qe.map(({displayMedia:$})=>H.isEmbedMedia($)?t.jsx("div",{style:{aspectRatio:`${H.getEmbedAspect($)}`}},`sizer-${$.assetId}`):xe($)?t.jsx(Ht.LazyVideo,{src:$.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${$.assetId}`):t.jsx("img",{src:$.assetId,alt:""},`sizer-${$.assetId}`))}),t.jsx(Mt.Splide2,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:de*1e3,width:"100%",height:"100%",speed:mi,type:L==="fade"?"fade":"loop",rewind:L==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Ut},onMoved:$=>{ue!=="random"||L==="fade"||ui($)},children:qe.map(({displayMedia:$,lightboxMedia:Be},Ge)=>{const at=Be?ot.findIndex(ti=>ti.assetId===Be.assetId):-1;return t.jsx(Mt.SplideSlide,{"data-slide-index":Ge,children:t.jsx(Wt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Lt,hasLightbox:S==="on",isSplideSlide:!0,onMediaClick:_t&&at>=0?()=>zt(ot,at):void 0})},Ge)})},`${L}-${Te}-${ue}-${de}-${Gt}-${q}`)]})}),Ft=v?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle})]}),Vt=ze?t.jsx(ct.LinkWrapper,{link:ze,className:`${s}-item-image-link`,children:lt}):t.jsx("a",{className:`${s}-item-image-link`,children:lt});return t.jsx("div",{className:`${s}-item`.trim(),style:st&&!F?{gridColumn:st}:void 0,children:t.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${F&&Qt?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(J??0)>100?`calc(${l} * (${J} / 100))`:l,...st&&F?{gridColumn:st}:{}},children:F?t.jsx(t.Fragment,{children:v?t.jsxs(t.Fragment,{children:[Rt,Vt]}):t.jsxs(t.Fragment,{children:[Vt,Rt]})}):ze?t.jsxs(t.Fragment,{children:[t.jsxs(ct.LinkWrapper,{link:ze,className:`${s}-item-image-link`,children:[Nt,lt]}),!v&&t.jsx(ct.LinkWrapper,{link:ze,className:`${s}-item-text-link`,children:Ft})]}):t.jsxs(t.Fragment,{children:[Nt,lt,Ft]})})},b)})})}),(!n||a)&&vt&&typeof document<"u"&&S==="on"&&(()=>{const p=(ae?document.getElementById(ae):null)??document.body;return ri.createPortal(t.jsx("div",{style:Yt,"data-selection":"none",children:t.jsx(Li,{prefix:s,items:rt,index:Zt,imageDisplay:_i(we),isEditor:n,isPreviewMode:a,isEditMode:o,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:ut,iconMarginRight:Ke,contentMarginTop:mt,onClose:()=>wt(!1),onPrev:()=>bt(b=>(b-1+rt.length)%rt.length),onNext:()=>bt(b=>(b+1)%rt.length),counterClassName:ye,counterStyle:pe})}),p)})()]})}const Ni={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ri=["hover","focus","filled","success","error"];exports.Grid=zi;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DlyptAaK.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DEeyQGcf.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
2
2
  .${t}-wrapper {
3
3
  display: grid;
4
4
  align-items: start;
@@ -6,7 +6,7 @@ import { i as Mt, E as Ke, g as pn } from "./EmbedMediaFrame-DwHeOAy5.mjs";
6
6
  import { L as mn } from "./LazyVideo-CdAWymKO.mjs";
7
7
  import { useMemo as de, useRef as y, useState as $, useCallback as v, useEffect as _, useLayoutEffect as fe } from "react";
8
8
  import { createPortal as wn } from "react-dom";
9
- import { H as vn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
9
+ import { H as vn } from "./HiveLightboxTitles-BCoL46-V.mjs";
10
10
  import { g as yn } from "./getImageRect-CBMhFNHM.mjs";
11
11
  import { t as xn } from "./textStylesToCss-05Mn6I_2.mjs";
12
12
  function $n(t) {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as x, jsx as r, Fragment as J } from "react/jsx-runtime";
2
2
  import { useMemo as w } from "react";
3
3
  import { s } from "./scalingValue-C9JH5L6O.mjs";
4
- import { S as Ft } from "./SvgImage-B5mR9y6q.mjs";
4
+ import { S as Ft } from "./SvgImage-CwRq9-ec.mjs";
5
5
  import { j as Z, r as q, D as Q, b as _, a as pt, g as wt, c as F, T as K, d as jt, e as b, f as R, h as At } from "./utils-FxC9rcxw.mjs";
6
6
  function Qt({
7
7
  prefix: i,
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-DFlmxAoL.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;
1
+ "use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-_QN8ngad.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;