@cntrl-site/components 1.0.116-alpha.0 → 1.0.116

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