@cntrl-site/components 1.0.108-alpha.0 → 1.0.108-alpha.1
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/Chronicles-D7E1yVzl.mjs +721 -0
- package/dist/Chronicles-hsVYwlUI.js +198 -0
- package/dist/{ChroniclesComponent-DILYPR6b.js → ChroniclesComponent-9M_JIJlG.js} +1 -1
- package/dist/{ChroniclesComponent-9Fi2A06B.mjs → ChroniclesComponent-DrFDru99.mjs} +1 -1
- package/dist/{components-BJdVsqb6.js → components-BDWmQ4M_.js} +1 -1
- package/dist/{components-Qpn7IZ0W.mjs → components-D6aHWqNw.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +1 -1
- 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 +22 -3
- package/dist/sources.mjs +22 -3
- package/package.json +1 -1
- package/dist/Chronicles-DBM6UcTB.mjs +0 -711
- package/dist/Chronicles-DTjRzRhE.js +0 -198
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import { jsx as p, jsxs as E, Fragment as _t } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as se, useRef as I, useState as f, useEffect as v, useCallback as zt, useLayoutEffect as ce, Fragment as kt } from "react";
|
|
3
|
+
import { createPortal as At } from "react-dom";
|
|
4
|
+
import C from "classnames";
|
|
5
|
+
import { s as Ht } from "./scalingValue-C9JH5L6O.mjs";
|
|
6
|
+
import { b as Ft } from "./buildColorVars-CLyWQm5K.mjs";
|
|
7
|
+
import { u as Bt } from "./useScopedStyles-DhBG3557.mjs";
|
|
8
|
+
import { b as Wt } from "./LinkWrapper-CFEH047t.mjs";
|
|
9
|
+
import { o as Xe, t as Ye } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
|
+
import { u as Vt } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
11
|
+
const Dt = ["title2", "title3", "title4"], Y = ["column1Width", "column2Width", "column3Width", "column4Width"], jt = ["column1", "column2", "column3", "column4", "column5"], Gt = ["title", ...Dt], Qe = {
|
|
12
|
+
center: { x: "50%", y: "50%" },
|
|
13
|
+
"left-top": { x: "0%", y: "0%" },
|
|
14
|
+
"top-center": { x: "50%", y: "0%" },
|
|
15
|
+
"top-right": { x: "100%", y: "0%" },
|
|
16
|
+
"left-center": { x: "0%", y: "50%" },
|
|
17
|
+
"right-center": { x: "100%", y: "50%" },
|
|
18
|
+
"left-bottom": { x: "0%", y: "100%" },
|
|
19
|
+
"bottom-center": { x: "50%", y: "100%" },
|
|
20
|
+
"right-bottom": { x: "100%", y: "100%" }
|
|
21
|
+
}, mo = Object.keys(Qe), W = 300, de = 300, q = 4e-3, Kt = 20, qe = /\.(mp4|webm|ogg|mov)(\?|$)/i, Pe = [
|
|
22
|
+
"--cntrl-article-width",
|
|
23
|
+
"--cntrl-article-top",
|
|
24
|
+
"--cntrl-article-left",
|
|
25
|
+
"--cntrl-viewport-height"
|
|
26
|
+
], Ut = {
|
|
27
|
+
triggerColor: "trigger-color",
|
|
28
|
+
triggerHoverColor: "trigger-hover-color",
|
|
29
|
+
closeColor: "close-color",
|
|
30
|
+
closeHoverColor: "close-hover-color",
|
|
31
|
+
panelColor: "panel-color",
|
|
32
|
+
textColor: "text-color",
|
|
33
|
+
textHoverColor: "text-hover-color",
|
|
34
|
+
overlayColor: "overlay-color"
|
|
35
|
+
}, Xt = [
|
|
36
|
+
{ side: "top", axis: "y", variant: "row-padding" },
|
|
37
|
+
{ side: "bottom", axis: "y", variant: "row-padding", reverse: !0 },
|
|
38
|
+
{ side: "left", axis: "x", variant: "column-padding", opposite: "right" },
|
|
39
|
+
{ side: "right", axis: "x", variant: "column-padding", opposite: "left", reverse: !0 }
|
|
40
|
+
];
|
|
41
|
+
function et({ columns: e, columnGap: o, panelWidth: n, panelPadding: a }) {
|
|
42
|
+
return Math.max(0, n - a.left - a.right - (e - 1) * o);
|
|
43
|
+
}
|
|
44
|
+
function Yt(e) {
|
|
45
|
+
const o = et(e) / e.columns;
|
|
46
|
+
return Object.fromEntries(Y.slice(0, e.columns - 1).map((n) => [n, o]));
|
|
47
|
+
}
|
|
48
|
+
function fo(e, o) {
|
|
49
|
+
return typeof e.columns != "number" || e.columns === o.columns ? e : { ...e, ...Yt({ ...o, ...e }) };
|
|
50
|
+
}
|
|
51
|
+
function qt(e) {
|
|
52
|
+
const o = et(e), n = Y.slice(0, e.columns - 1).map((c) => {
|
|
53
|
+
const d = e[c];
|
|
54
|
+
return typeof d == "number" ? Math.max(0, d) : o / e.columns;
|
|
55
|
+
}), a = n.reduce((c, d) => c + d, 0), l = a > o ? o / a : 1;
|
|
56
|
+
return [...n.map((c) => c * l), Math.max(0, o - a * l)];
|
|
57
|
+
}
|
|
58
|
+
function Zt(e) {
|
|
59
|
+
const o = e.reduce((n, a) => n + a, 0);
|
|
60
|
+
return e.map((n) => `minmax(0, ${o > 0 ? n / o * 100 : 1}fr)`).join(" ");
|
|
61
|
+
}
|
|
62
|
+
function Jt(e) {
|
|
63
|
+
const o = [];
|
|
64
|
+
return e.forEach((n, a) => {
|
|
65
|
+
var d;
|
|
66
|
+
const l = ((d = n.group) == null ? void 0 : d.trim()) ?? "", c = o[o.length - 1];
|
|
67
|
+
if (!c || l !== "" && l !== c.label) {
|
|
68
|
+
o.push({ label: l, rows: [{ item: n, index: a }] });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
c.rows.push({ item: n, index: a });
|
|
72
|
+
}), o;
|
|
73
|
+
}
|
|
74
|
+
function X(e) {
|
|
75
|
+
return ((e == null ? void 0 : e.image) ?? []).filter((o) => !!(o != null && o.assetId));
|
|
76
|
+
}
|
|
77
|
+
function Ze(e, o, n) {
|
|
78
|
+
return `${e}-${o}-${n}`;
|
|
79
|
+
}
|
|
80
|
+
function tt({ type: e, name: o, assetId: n }) {
|
|
81
|
+
return e ? e === "video" : qe.test(o ?? "") || qe.test(n);
|
|
82
|
+
}
|
|
83
|
+
function ot(e) {
|
|
84
|
+
for (let o = e; o; o = o.parentElement)
|
|
85
|
+
if (getComputedStyle(o).getPropertyValue("--cntrl-article-width").trim()) return o;
|
|
86
|
+
return e;
|
|
87
|
+
}
|
|
88
|
+
function ue(e) {
|
|
89
|
+
const o = ot(e);
|
|
90
|
+
if (!o) return {};
|
|
91
|
+
const n = getComputedStyle(o);
|
|
92
|
+
return Object.fromEntries(
|
|
93
|
+
Pe.map((a) => [a, n.getPropertyValue(a).trim()]).filter(([, a]) => a)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function Je(e, o) {
|
|
97
|
+
const n = (a) => e[`${o}${a}`];
|
|
98
|
+
return {
|
|
99
|
+
fontSettings: { fontFamily: n("FontFamily"), ...n("FontSettings") },
|
|
100
|
+
fontSize: n("FontSize"),
|
|
101
|
+
lineHeight: n("LineHeight"),
|
|
102
|
+
letterSpacing: n("LetterSpacing"),
|
|
103
|
+
wordSpacing: n("WordSpacing"),
|
|
104
|
+
textAlign: n("TextAlign"),
|
|
105
|
+
textAppearance: n("TextAppearance"),
|
|
106
|
+
color: "#000000"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function Qt(e) {
|
|
110
|
+
return `
|
|
111
|
+
.${e}-trigger,
|
|
112
|
+
.${e}-close {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
margin: 0;
|
|
115
|
+
padding: 0;
|
|
116
|
+
border: 0;
|
|
117
|
+
background: none;
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
transition: color 150ms ease;
|
|
121
|
+
-webkit-appearance: none;
|
|
122
|
+
appearance: none;
|
|
123
|
+
-webkit-tap-highlight-color: transparent;
|
|
124
|
+
}
|
|
125
|
+
.${e}-trigger {
|
|
126
|
+
color: var(--${e}-trigger-color);
|
|
127
|
+
transition: color 150ms ease, opacity ${W}ms ease;
|
|
128
|
+
}
|
|
129
|
+
.${e}-trigger-hidden {
|
|
130
|
+
opacity: 0;
|
|
131
|
+
}
|
|
132
|
+
.${e}-close {
|
|
133
|
+
position: absolute;
|
|
134
|
+
z-index: 2;
|
|
135
|
+
color: var(--${e}-close-color);
|
|
136
|
+
}
|
|
137
|
+
.${e}-trigger:focus,
|
|
138
|
+
.${e}-close:focus {
|
|
139
|
+
outline: none;
|
|
140
|
+
}
|
|
141
|
+
.${e}-trigger:focus-visible,
|
|
142
|
+
.${e}-close:focus-visible {
|
|
143
|
+
outline: 1px solid currentColor;
|
|
144
|
+
outline-offset: 2px;
|
|
145
|
+
}
|
|
146
|
+
.${e}-interactive .${e}-trigger:hover,
|
|
147
|
+
.${e}-state-hover .${e}-trigger {
|
|
148
|
+
color: var(--${e}-trigger-hover-color, var(--${e}-trigger-color));
|
|
149
|
+
}
|
|
150
|
+
.${e}-close:hover {
|
|
151
|
+
color: var(--${e}-close-hover-color, var(--${e}-close-color));
|
|
152
|
+
}
|
|
153
|
+
.${e}-editor .${e}-trigger {
|
|
154
|
+
cursor: default;
|
|
155
|
+
}
|
|
156
|
+
.${e}-overlay {
|
|
157
|
+
position: fixed;
|
|
158
|
+
inset: 0;
|
|
159
|
+
z-index: 9997;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
overscroll-behavior: none;
|
|
162
|
+
opacity: 0;
|
|
163
|
+
pointer-events: none;
|
|
164
|
+
transition: opacity ${W}ms ease;
|
|
165
|
+
}
|
|
166
|
+
.${e}-inline-layer {
|
|
167
|
+
position: fixed;
|
|
168
|
+
inset: 0;
|
|
169
|
+
z-index: 9997;
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
}
|
|
173
|
+
.${e}-overlay-editor {
|
|
174
|
+
inset: auto;
|
|
175
|
+
top: var(--cntrl-article-top, 0);
|
|
176
|
+
left: var(--cntrl-article-left, 0);
|
|
177
|
+
width: var(--cntrl-article-width, 100vw) !important;
|
|
178
|
+
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
179
|
+
}
|
|
180
|
+
.${e}-overlay-edit-mode {
|
|
181
|
+
z-index: 1;
|
|
182
|
+
}
|
|
183
|
+
.${e}-overlay-active {
|
|
184
|
+
opacity: 1;
|
|
185
|
+
pointer-events: auto;
|
|
186
|
+
}
|
|
187
|
+
.${e}-backdrop {
|
|
188
|
+
position: absolute;
|
|
189
|
+
inset: 0;
|
|
190
|
+
background-color: var(--${e}-overlay-color);
|
|
191
|
+
}
|
|
192
|
+
.${e}-media-layer {
|
|
193
|
+
position: absolute;
|
|
194
|
+
inset: 0;
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
}
|
|
197
|
+
.${e}-media {
|
|
198
|
+
position: absolute;
|
|
199
|
+
inset: 0;
|
|
200
|
+
width: 100%;
|
|
201
|
+
height: 100%;
|
|
202
|
+
object-fit: cover;
|
|
203
|
+
opacity: 0;
|
|
204
|
+
}
|
|
205
|
+
.${e}-media-contain {
|
|
206
|
+
object-fit: contain;
|
|
207
|
+
}
|
|
208
|
+
.${e}-media-visible,
|
|
209
|
+
.${e}-media-fading {
|
|
210
|
+
transition: opacity ${de}ms cubic-bezier(0, 0, 0.58, 1);
|
|
211
|
+
}
|
|
212
|
+
.${e}-media-visible {
|
|
213
|
+
z-index: 1;
|
|
214
|
+
opacity: 1;
|
|
215
|
+
}
|
|
216
|
+
.${e}-media-covered {
|
|
217
|
+
opacity: 1;
|
|
218
|
+
}
|
|
219
|
+
.${e}-media-fading {
|
|
220
|
+
opacity: 0;
|
|
221
|
+
}
|
|
222
|
+
.${e}-media-layer-instant .${e}-media {
|
|
223
|
+
transition: none;
|
|
224
|
+
}
|
|
225
|
+
.${e}-panel {
|
|
226
|
+
position: absolute;
|
|
227
|
+
top: var(--${e}-panel-y);
|
|
228
|
+
left: var(--${e}-panel-x);
|
|
229
|
+
z-index: 1;
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
max-width: 100%;
|
|
232
|
+
max-height: 100%;
|
|
233
|
+
overflow-y: auto;
|
|
234
|
+
transform: translate(calc(-1 * var(--${e}-panel-x)), calc(-1 * var(--${e}-panel-y) + 12px));
|
|
235
|
+
background-color: var(--${e}-panel-color);
|
|
236
|
+
color: var(--${e}-text-color);
|
|
237
|
+
overscroll-behavior: contain;
|
|
238
|
+
transition: transform ${W}ms cubic-bezier(0, 0, 0.58, 1);
|
|
239
|
+
}
|
|
240
|
+
.${e}-overlay-active .${e}-panel {
|
|
241
|
+
transform: translate(calc(-1 * var(--${e}-panel-x)), calc(-1 * var(--${e}-panel-y)));
|
|
242
|
+
}
|
|
243
|
+
.${e}-panel-settled {
|
|
244
|
+
transition: none;
|
|
245
|
+
}
|
|
246
|
+
.${e}-panel-inline {
|
|
247
|
+
position: relative;
|
|
248
|
+
top: auto;
|
|
249
|
+
left: auto;
|
|
250
|
+
max-height: none;
|
|
251
|
+
transform: none;
|
|
252
|
+
transition: none;
|
|
253
|
+
}
|
|
254
|
+
.${e}-panel-copy {
|
|
255
|
+
position: absolute;
|
|
256
|
+
pointer-events: none;
|
|
257
|
+
}
|
|
258
|
+
@media (prefers-reduced-motion: reduce) {
|
|
259
|
+
.${e}-panel {
|
|
260
|
+
transition: none;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
.${e}-group {
|
|
264
|
+
display: grid;
|
|
265
|
+
grid-template-columns: var(--${e}-grid-columns);
|
|
266
|
+
column-gap: var(--${e}-column-gap);
|
|
267
|
+
}
|
|
268
|
+
.${e}-group ~ .${e}-group {
|
|
269
|
+
margin-top: var(--${e}-group-gap);
|
|
270
|
+
}
|
|
271
|
+
.${e}-group-label {
|
|
272
|
+
grid-column: 1;
|
|
273
|
+
align-self: start;
|
|
274
|
+
min-width: 0;
|
|
275
|
+
overflow-wrap: anywhere;
|
|
276
|
+
}
|
|
277
|
+
.${e}-row {
|
|
278
|
+
grid-column: 2 / -1;
|
|
279
|
+
display: grid;
|
|
280
|
+
grid-template-columns: subgrid;
|
|
281
|
+
align-items: baseline;
|
|
282
|
+
}
|
|
283
|
+
a.${e}-row {
|
|
284
|
+
color: inherit;
|
|
285
|
+
text-decoration: none;
|
|
286
|
+
}
|
|
287
|
+
.${e}-group-unlabeled .${e}-row {
|
|
288
|
+
grid-column: 1 / -1;
|
|
289
|
+
}
|
|
290
|
+
.${e}-title {
|
|
291
|
+
min-width: 0;
|
|
292
|
+
overflow-wrap: anywhere;
|
|
293
|
+
white-space: pre-line;
|
|
294
|
+
transition: color 150ms cubic-bezier(0, 0, 0.58, 1);
|
|
295
|
+
}
|
|
296
|
+
.${e}-interactive .${e}-row:hover .${e}-title,
|
|
297
|
+
.${e}-row:focus-visible .${e}-title,
|
|
298
|
+
.${e}-panel-copy .${e}-row-active .${e}-title,
|
|
299
|
+
.${e}-state-hover .${e}-row:first-of-type .${e}-title {
|
|
300
|
+
color: var(--${e}-text-hover-color, var(--${e}-text-color));
|
|
301
|
+
}
|
|
302
|
+
.${e}-control-anchor {
|
|
303
|
+
position: absolute;
|
|
304
|
+
pointer-events: none;
|
|
305
|
+
z-index: 2;
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
}
|
|
309
|
+
function Pt({ P: e, media: o, isVisible: n, isLoaded: a, isCovered: l, isFading: c, onLoad: d }) {
|
|
310
|
+
const x = I(null), L = tt(o), r = C(
|
|
311
|
+
`${e}-media`,
|
|
312
|
+
o.objectFit === "contain" && `${e}-media-contain`,
|
|
313
|
+
n && a && `${e}-media-visible`,
|
|
314
|
+
l && `${e}-media-covered`,
|
|
315
|
+
c && `${e}-media-fading`
|
|
316
|
+
);
|
|
317
|
+
return v(() => {
|
|
318
|
+
var k;
|
|
319
|
+
const z = x.current;
|
|
320
|
+
z && (n ? (k = z.play()) == null || k.catch(() => {
|
|
321
|
+
}) : z.pause());
|
|
322
|
+
}, [n]), L ? /* @__PURE__ */ p(
|
|
323
|
+
"video",
|
|
324
|
+
{
|
|
325
|
+
ref: x,
|
|
326
|
+
className: r,
|
|
327
|
+
src: o.assetId,
|
|
328
|
+
muted: !0,
|
|
329
|
+
loop: !0,
|
|
330
|
+
playsInline: !0,
|
|
331
|
+
preload: "auto",
|
|
332
|
+
onLoadedData: d
|
|
333
|
+
}
|
|
334
|
+
) : /* @__PURE__ */ p("img", { className: r, src: o.assetId, alt: "", decoding: "async", onLoad: d });
|
|
335
|
+
}
|
|
336
|
+
function eo(e, o, n, a, l) {
|
|
337
|
+
const c = o[o.length - 1];
|
|
338
|
+
let d = n;
|
|
339
|
+
return o.slice(0, -1).map((x, L) => {
|
|
340
|
+
const r = d + x + a / 2;
|
|
341
|
+
return d += x + a, /* @__PURE__ */ p(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
"data-controls": Y[L],
|
|
345
|
+
"data-controls-axis": "x",
|
|
346
|
+
"data-controls-variant": "column-width",
|
|
347
|
+
"data-controls-min": String(Kt),
|
|
348
|
+
"data-controls-max-fraction": String(x + c),
|
|
349
|
+
className: `${e}-control-anchor`,
|
|
350
|
+
style: { top: 0, left: l(r - q / 2), width: l(q), height: "100%" }
|
|
351
|
+
},
|
|
352
|
+
Y[L]
|
|
353
|
+
);
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
function to(e, o, n, a) {
|
|
357
|
+
return Xt.map((l) => {
|
|
358
|
+
const c = a(Math.max(n[l.side], q)), d = l.axis === "x";
|
|
359
|
+
return /* @__PURE__ */ p(
|
|
360
|
+
"div",
|
|
361
|
+
{
|
|
362
|
+
"data-controls": `panelPadding.${l.side}`,
|
|
363
|
+
"data-controls-axis": l.axis,
|
|
364
|
+
"data-controls-variant": l.variant,
|
|
365
|
+
"data-controls-reverse": "reverse" in l ? "" : void 0,
|
|
366
|
+
"data-controls-min": "0",
|
|
367
|
+
"data-controls-max-fraction": "opposite" in l ? String(Math.max(0, o - n[l.opposite])) : void 0,
|
|
368
|
+
className: `${e}-control-anchor`,
|
|
369
|
+
style: {
|
|
370
|
+
[l.side]: 0,
|
|
371
|
+
...d ? { top: 0, width: c, height: "100%" } : { left: 0, width: "100%", height: c }
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
l.side
|
|
375
|
+
);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function go({
|
|
379
|
+
settings: e,
|
|
380
|
+
content: o,
|
|
381
|
+
isEditor: n,
|
|
382
|
+
isEditMode: a,
|
|
383
|
+
isPreviewMode: l,
|
|
384
|
+
activeEvent: c,
|
|
385
|
+
portalId: d,
|
|
386
|
+
currentState: x,
|
|
387
|
+
unavailableStates: L
|
|
388
|
+
}) {
|
|
389
|
+
var Ge;
|
|
390
|
+
const { prefix: r } = Bt(), {
|
|
391
|
+
type: z,
|
|
392
|
+
triggerLabel: k,
|
|
393
|
+
closeLabel: nt,
|
|
394
|
+
columns: Z,
|
|
395
|
+
columnGap: pe,
|
|
396
|
+
hoverInterval: me,
|
|
397
|
+
panelPosition: rt,
|
|
398
|
+
panelWidth: fe,
|
|
399
|
+
panelPadding: O,
|
|
400
|
+
panelRadius: it,
|
|
401
|
+
groupGap: ge,
|
|
402
|
+
triggerColor: at,
|
|
403
|
+
triggerHoverColor: lt,
|
|
404
|
+
closeColor: st,
|
|
405
|
+
closeHoverColor: ct,
|
|
406
|
+
panelColor: ut,
|
|
407
|
+
textColor: dt,
|
|
408
|
+
textHoverColor: pt,
|
|
409
|
+
overlayColor: mt
|
|
410
|
+
} = e, S = se(() => o ?? [], [o]), V = I(null), J = I(null), Q = I(null), ve = I(null), he = I(null), $e = I(null), ye = I(null), [ft, D] = f(!1), [N, we] = f(!1), [A, be] = f(!1), [Ce, xe] = f(!1), [g, T] = f(null), [Le, Se] = f(0), [P, gt] = f(() => /* @__PURE__ */ new Set()), [Re, vt] = f(() => /* @__PURE__ */ new Set()), [j, Ie] = f(null), [ht, $t] = f(null), [M, yt] = f(null), [ee, te] = f({}), [oe, ne] = f(null), [wt, Me] = f(!1), _ = !!(n && !l), y = !_, m = z === "a", bt = _ && x === "open" && !(L != null && L.includes("open")), w = !m && (bt || (y || !!a) && ft), Ee = y && (m || w), h = (t) => Ht(t, n ?? !1), Ct = se(() => Qt(r), [r]), Oe = Qe[rt], Ne = qt(e), xt = Gt.slice(0, Z - 1), H = Z > 1, Lt = se(() => H ? Jt(S) : [{ label: "", rows: S.map((t, i) => ({ item: t, index: i })) }], [S, H]), G = g === null ? [] : X(S[g]), Te = G[Le], R = g !== null && Te ? Ze(g, Le, Te.assetId) : null, _e = R !== null && Re.has(R);
|
|
411
|
+
Vt(w && !_), v(() => {
|
|
412
|
+
_ && !a && D(!1);
|
|
413
|
+
}, [_, a]), v(() => {
|
|
414
|
+
if (w) {
|
|
415
|
+
te(ue(V.current)), we(!0);
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
be(!1), T(null);
|
|
419
|
+
const t = window.setTimeout(() => we(!1), W);
|
|
420
|
+
return () => window.clearTimeout(t);
|
|
421
|
+
}, [w]), v(() => {
|
|
422
|
+
var i;
|
|
423
|
+
if (!w || !N) return;
|
|
424
|
+
(i = Q.current) == null || i.getBoundingClientRect();
|
|
425
|
+
const t = requestAnimationFrame(() => be(!0));
|
|
426
|
+
return () => cancelAnimationFrame(t);
|
|
427
|
+
}, [w, N]), v(() => {
|
|
428
|
+
if (!A) {
|
|
429
|
+
xe(!1);
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const t = window.setTimeout(() => xe(!0), W);
|
|
433
|
+
return () => window.clearTimeout(t);
|
|
434
|
+
}, [A]);
|
|
435
|
+
const K = zt(() => {
|
|
436
|
+
const t = J.current, i = Q.current;
|
|
437
|
+
if (!t || !i) return;
|
|
438
|
+
const u = t.getBoundingClientRect(), s = i.getBoundingClientRect();
|
|
439
|
+
yt({ top: u.top - s.top, left: u.left - s.left });
|
|
440
|
+
}, []), ze = N || m && P.size > 0;
|
|
441
|
+
v(() => {
|
|
442
|
+
const t = V.current;
|
|
443
|
+
if (!ze || !t || typeof ResizeObserver > "u") return;
|
|
444
|
+
const i = () => te(($) => {
|
|
445
|
+
const b = ue(t);
|
|
446
|
+
return Pe.every((U) => $[U] === b[U]) ? $ : b;
|
|
447
|
+
}), u = new ResizeObserver(i);
|
|
448
|
+
u.observe(t);
|
|
449
|
+
const s = ot(t);
|
|
450
|
+
return s && s !== t && u.observe(s), () => u.disconnect();
|
|
451
|
+
}, [ze]), ce(() => {
|
|
452
|
+
if (N)
|
|
453
|
+
return K(), window.addEventListener("resize", K), () => window.removeEventListener("resize", K);
|
|
454
|
+
}, [N, ee, K]), v(() => {
|
|
455
|
+
var i;
|
|
456
|
+
if (!w || !y) return;
|
|
457
|
+
(i = ve.current) == null || i.focus({ preventScroll: !0 });
|
|
458
|
+
const t = (u) => {
|
|
459
|
+
u.key === "Escape" && D(!1);
|
|
460
|
+
};
|
|
461
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
462
|
+
}, [w, y]), ce(() => {
|
|
463
|
+
if (!m || g === null) return;
|
|
464
|
+
const t = he.current, i = $e.current;
|
|
465
|
+
if (!t || !i) return;
|
|
466
|
+
const u = t.getBoundingClientRect(), s = i.getBoundingClientRect();
|
|
467
|
+
ne({ top: u.top - s.top, left: u.left - s.left, width: u.width });
|
|
468
|
+
}, [m, g]), v(() => {
|
|
469
|
+
if (g !== null) return;
|
|
470
|
+
const t = window.setTimeout(() => ne(null), de);
|
|
471
|
+
return () => window.clearTimeout(t);
|
|
472
|
+
}, [g]);
|
|
473
|
+
const ke = oe !== null;
|
|
474
|
+
v(() => {
|
|
475
|
+
if (!m || !ke) return;
|
|
476
|
+
const t = () => {
|
|
477
|
+
Me(!0), T(null), ne(null);
|
|
478
|
+
};
|
|
479
|
+
return document.addEventListener("scroll", t, { capture: !0, passive: !0 }), window.addEventListener("resize", t), () => {
|
|
480
|
+
document.removeEventListener("scroll", t, { capture: !0 }), window.removeEventListener("resize", t);
|
|
481
|
+
};
|
|
482
|
+
}, [m, ke]), v(() => {
|
|
483
|
+
Ee && S.forEach((t) => X(t).forEach((i) => {
|
|
484
|
+
tt(i) || (new Image().src = i.assetId);
|
|
485
|
+
}));
|
|
486
|
+
}, [Ee, S]), v(() => {
|
|
487
|
+
if (G.length < 2) return;
|
|
488
|
+
const t = window.setInterval(() => {
|
|
489
|
+
Se((i) => (i + 1) % G.length);
|
|
490
|
+
}, me);
|
|
491
|
+
return () => window.clearInterval(t);
|
|
492
|
+
}, [g, G.length, me]), ce(() => {
|
|
493
|
+
const t = ye.current;
|
|
494
|
+
ye.current = R, R !== null && ($t(R), Ie(t));
|
|
495
|
+
}, [R]), v(() => {
|
|
496
|
+
if (!_e || j === null) return;
|
|
497
|
+
const t = window.setTimeout(() => Ie(null), de);
|
|
498
|
+
return () => window.clearTimeout(t);
|
|
499
|
+
}, [_e, j]);
|
|
500
|
+
const Ae = () => {
|
|
501
|
+
var t;
|
|
502
|
+
y && (D(!1), (t = J.current) == null || t.focus({ preventScroll: !0 }));
|
|
503
|
+
}, He = (t) => {
|
|
504
|
+
if (!y || X(S[t]).length === 0) {
|
|
505
|
+
T(null);
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
gt((i) => i.has(t) ? i : new Set(i).add(t)), m && g === null && te(ue(V.current)), g !== t && Se(0), Me(!1), T(t);
|
|
509
|
+
}, Fe = (t) => {
|
|
510
|
+
T((i) => i === t ? null : i);
|
|
511
|
+
}, St = (t) => {
|
|
512
|
+
!y && t.target.closest("a") && t.preventDefault();
|
|
513
|
+
}, Be = Xe(Ye(Je(e, "trigger"), n)), F = jt.slice(0, Z).map((t) => Xe(Ye(Je(e, t), n))), We = F[0].lineHeight, Ve = (Ge = F[1]) == null ? void 0 : Ge.lineHeight, Rt = We !== void 0 && Ve !== void 0 ? `calc((${Ve} - ${We}) / 2)` : void 0, re = Ft(r, {
|
|
514
|
+
triggerColor: at,
|
|
515
|
+
triggerHoverColor: lt,
|
|
516
|
+
closeColor: st,
|
|
517
|
+
closeHoverColor: ct,
|
|
518
|
+
panelColor: ut,
|
|
519
|
+
textColor: dt,
|
|
520
|
+
textHoverColor: pt,
|
|
521
|
+
overlayColor: mt
|
|
522
|
+
}, Ut, []), ie = c && c !== "default" ? `${r}-state-${c}` : "", ae = y ? `${r}-interactive` : "", It = !!a && (m || Ce), De = /* @__PURE__ */ p("div", { className: C(`${r}-media-layer`, wt && `${r}-media-layer-instant`), "aria-hidden": "true", children: [...P].flatMap((t) => X(S[t]).map((i, u) => {
|
|
523
|
+
const s = Ze(t, u, i.assetId);
|
|
524
|
+
return /* @__PURE__ */ p(
|
|
525
|
+
Pt,
|
|
526
|
+
{
|
|
527
|
+
P: r,
|
|
528
|
+
media: i,
|
|
529
|
+
isVisible: s === R,
|
|
530
|
+
isLoaded: Re.has(s),
|
|
531
|
+
isCovered: s === j,
|
|
532
|
+
isFading: R === null && (s === ht || s === j),
|
|
533
|
+
onLoad: () => vt(($) => $.has(s) ? $ : new Set($).add(s))
|
|
534
|
+
},
|
|
535
|
+
s
|
|
536
|
+
);
|
|
537
|
+
})) }), le = (t) => {
|
|
538
|
+
const i = !t && It;
|
|
539
|
+
return /* @__PURE__ */ E(
|
|
540
|
+
"div",
|
|
541
|
+
{
|
|
542
|
+
ref: t ? void 0 : he,
|
|
543
|
+
className: C(
|
|
544
|
+
`${r}-panel`,
|
|
545
|
+
A && Ce && `${r}-panel-settled`,
|
|
546
|
+
m && `${r}-panel-inline`,
|
|
547
|
+
t && `${r}-panel-copy`
|
|
548
|
+
),
|
|
549
|
+
style: {
|
|
550
|
+
width: h(fe),
|
|
551
|
+
paddingTop: h(O.top),
|
|
552
|
+
paddingRight: h(O.right),
|
|
553
|
+
paddingBottom: h(O.bottom),
|
|
554
|
+
paddingLeft: h(O.left),
|
|
555
|
+
borderRadius: h(it),
|
|
556
|
+
[`--${r}-group-gap`]: h(ge),
|
|
557
|
+
[`--${r}-panel-x`]: Oe.x,
|
|
558
|
+
[`--${r}-panel-y`]: Oe.y,
|
|
559
|
+
[`--${r}-grid-columns`]: Zt(Ne),
|
|
560
|
+
[`--${r}-column-gap`]: h(pe),
|
|
561
|
+
...t && oe
|
|
562
|
+
},
|
|
563
|
+
"data-lightbox-scrollable": m ? void 0 : "",
|
|
564
|
+
"aria-hidden": t || void 0,
|
|
565
|
+
onMouseLeave: t ? void 0 : () => T(null),
|
|
566
|
+
onClickCapture: t ? void 0 : St,
|
|
567
|
+
children: [
|
|
568
|
+
i && to(r, fe, O, h),
|
|
569
|
+
i && eo(r, Ne, O.left, pe, h),
|
|
570
|
+
Lt.map((u, s) => /* @__PURE__ */ E(kt, { children: [
|
|
571
|
+
i && s > 0 && /* @__PURE__ */ p(
|
|
572
|
+
"div",
|
|
573
|
+
{
|
|
574
|
+
"data-controls": "groupGap",
|
|
575
|
+
"data-controls-paired": "",
|
|
576
|
+
"data-controls-axis": "y",
|
|
577
|
+
"data-controls-reverse": "",
|
|
578
|
+
"data-controls-min": "0",
|
|
579
|
+
className: `${r}-control-anchor`,
|
|
580
|
+
style: { left: 0, width: "100%", height: h(Math.max(ge, q)) }
|
|
581
|
+
}
|
|
582
|
+
),
|
|
583
|
+
/* @__PURE__ */ E(
|
|
584
|
+
"div",
|
|
585
|
+
{
|
|
586
|
+
className: C(`${r}-group`, !H && `${r}-group-unlabeled`),
|
|
587
|
+
style: { gridTemplateRows: `repeat(${u.rows.length}, auto) 1fr` },
|
|
588
|
+
children: [
|
|
589
|
+
H && /* @__PURE__ */ p(
|
|
590
|
+
"span",
|
|
591
|
+
{
|
|
592
|
+
className: `${r}-group-label`,
|
|
593
|
+
style: { ...F[0], gridRow: `1 / span ${u.rows.length + 1}`, marginTop: Rt },
|
|
594
|
+
children: u.label
|
|
595
|
+
}
|
|
596
|
+
),
|
|
597
|
+
u.rows.map(({ item: $, index: b }) => {
|
|
598
|
+
var Ke;
|
|
599
|
+
const B = !t && ((Ke = $.link) != null && Ke.value) ? $.link : void 0, U = B ? "a" : "div", Ot = B ? {
|
|
600
|
+
href: Wt(B.value),
|
|
601
|
+
...B.target === "blank" && { target: "_blank", rel: "noreferrer" }
|
|
602
|
+
} : {}, Nt = t ? {} : {
|
|
603
|
+
onMouseEnter: () => He(b),
|
|
604
|
+
onMouseLeave: () => Fe(b),
|
|
605
|
+
onFocus: () => He(b),
|
|
606
|
+
onBlur: () => Fe(b)
|
|
607
|
+
};
|
|
608
|
+
return /* @__PURE__ */ E(
|
|
609
|
+
U,
|
|
610
|
+
{
|
|
611
|
+
className: C(`${r}-row`, t && b === g && `${r}-row-active`),
|
|
612
|
+
...Ot,
|
|
613
|
+
...Nt,
|
|
614
|
+
children: [
|
|
615
|
+
!H && /* @__PURE__ */ p("div", { className: `${r}-title`, style: F[0], children: $.group }),
|
|
616
|
+
xt.map((Ue, Tt) => /* @__PURE__ */ p("div", { className: `${r}-title`, style: F[Tt + 1], children: $[Ue] }, Ue))
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
b
|
|
620
|
+
);
|
|
621
|
+
})
|
|
622
|
+
]
|
|
623
|
+
}
|
|
624
|
+
)
|
|
625
|
+
] }, s))
|
|
626
|
+
]
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
}, Mt = N && !m ? /* @__PURE__ */ E(
|
|
630
|
+
"div",
|
|
631
|
+
{
|
|
632
|
+
ref: Q,
|
|
633
|
+
className: C(
|
|
634
|
+
`${r}-overlay`,
|
|
635
|
+
n && `${r}-overlay-editor`,
|
|
636
|
+
a && `${r}-overlay-edit-mode`,
|
|
637
|
+
A && `${r}-overlay-active`,
|
|
638
|
+
ae,
|
|
639
|
+
ie
|
|
640
|
+
),
|
|
641
|
+
style: { ...re, ...ee },
|
|
642
|
+
role: "dialog",
|
|
643
|
+
"aria-modal": "true",
|
|
644
|
+
"aria-label": k,
|
|
645
|
+
"data-selection": "none",
|
|
646
|
+
children: [
|
|
647
|
+
/* @__PURE__ */ p("div", { className: `${r}-backdrop`, "aria-hidden": "true", onClick: Ae }),
|
|
648
|
+
De,
|
|
649
|
+
/* @__PURE__ */ p(
|
|
650
|
+
"button",
|
|
651
|
+
{
|
|
652
|
+
ref: ve,
|
|
653
|
+
type: "button",
|
|
654
|
+
className: `${r}-close`,
|
|
655
|
+
style: {
|
|
656
|
+
...Be,
|
|
657
|
+
top: (M == null ? void 0 : M.top) ?? 0,
|
|
658
|
+
left: (M == null ? void 0 : M.left) ?? 0,
|
|
659
|
+
visibility: M ? "visible" : "hidden"
|
|
660
|
+
},
|
|
661
|
+
onClick: Ae,
|
|
662
|
+
children: nt
|
|
663
|
+
}
|
|
664
|
+
),
|
|
665
|
+
le(!1)
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
) : null, Et = m && P.size > 0 ? /* @__PURE__ */ E(
|
|
669
|
+
"div",
|
|
670
|
+
{
|
|
671
|
+
ref: $e,
|
|
672
|
+
className: C(`${r}-inline-layer`, n && `${r}-overlay-editor`, ae, ie),
|
|
673
|
+
style: { ...re, ...ee },
|
|
674
|
+
"aria-hidden": "true",
|
|
675
|
+
"data-selection": "none",
|
|
676
|
+
children: [
|
|
677
|
+
De,
|
|
678
|
+
oe && le(!0)
|
|
679
|
+
]
|
|
680
|
+
}
|
|
681
|
+
) : null, je = Mt ?? Et;
|
|
682
|
+
return /* @__PURE__ */ E(_t, { children: [
|
|
683
|
+
/* @__PURE__ */ p("style", { dangerouslySetInnerHTML: { __html: Ct } }),
|
|
684
|
+
/* @__PURE__ */ p(
|
|
685
|
+
"div",
|
|
686
|
+
{
|
|
687
|
+
ref: V,
|
|
688
|
+
className: C(_ && `${r}-editor`, ae, ie),
|
|
689
|
+
style: re,
|
|
690
|
+
children: m ? le(!1) : /* @__PURE__ */ p(
|
|
691
|
+
"button",
|
|
692
|
+
{
|
|
693
|
+
ref: J,
|
|
694
|
+
type: "button",
|
|
695
|
+
className: C(`${r}-trigger`, A && `${r}-trigger-hidden`),
|
|
696
|
+
style: Be,
|
|
697
|
+
"aria-haspopup": "dialog",
|
|
698
|
+
"aria-expanded": w,
|
|
699
|
+
onClick: () => {
|
|
700
|
+
y && D(!0);
|
|
701
|
+
},
|
|
702
|
+
children: k
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
}
|
|
706
|
+
),
|
|
707
|
+
je && typeof document < "u" && At(
|
|
708
|
+
je,
|
|
709
|
+
(d ? document.getElementById(d) : null) ?? document.body
|
|
710
|
+
)
|
|
711
|
+
] });
|
|
712
|
+
}
|
|
713
|
+
export {
|
|
714
|
+
jt as CHRONICLES_COLUMN_STYLE_PREFIXES,
|
|
715
|
+
Y as CHRONICLES_COLUMN_WIDTH_KEYS,
|
|
716
|
+
Dt as CHRONICLES_EXTRA_TITLE_KEYS,
|
|
717
|
+
mo as CHRONICLES_PANEL_POSITIONS,
|
|
718
|
+
go as Chronicles,
|
|
719
|
+
fo as applyChroniclesColumnCountChange,
|
|
720
|
+
Yt as getChroniclesEqualColumnWidths
|
|
721
|
+
};
|