@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.
@@ -1,711 +0,0 @@
1
- import { jsx as p, jsxs as M, Fragment as Nt } from "react/jsx-runtime";
2
- import { useMemo as re, useRef as I, useState as m, useEffect as h, useCallback as Ot, useLayoutEffect as le, Fragment as Tt } from "react";
3
- import { createPortal as _t } from "react-dom";
4
- import w from "classnames";
5
- import { s as kt } from "./scalingValue-C9JH5L6O.mjs";
6
- import { b as At } from "./buildColorVars-CLyWQm5K.mjs";
7
- import { u as zt } from "./useScopedStyles-DhBG3557.mjs";
8
- import { b as Ht } from "./LinkWrapper-CFEH047t.mjs";
9
- import { o as Ge, t as Ke } from "./textStylesToCss-05Mn6I_2.mjs";
10
- import { u as Ft } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
11
- const Bt = ["title2", "title3", "title4"], U = ["column1Width", "column2Width", "column3Width", "column4Width"], Wt = ["column1", "column2", "column3", "column4", "column5"], Vt = ["title", ...Bt], Ze = {
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
- }, po = Object.keys(Ze), B = 300, ae = 300, X = 4e-3, Dt = 20, Ue = /\.(mp4|webm|ogg|mov)(\?|$)/i, jt = [
22
- "--cntrl-article-width",
23
- "--cntrl-article-top",
24
- "--cntrl-article-left",
25
- "--cntrl-viewport-height"
26
- ], Gt = {
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
- }, Kt = [
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 Je({ columns: e, columnGap: o, panelWidth: n, panelPadding: a }) {
42
- return Math.max(0, n - a.left - a.right - (e - 1) * o);
43
- }
44
- function Ut(e) {
45
- const o = Je(e) / e.columns;
46
- return Object.fromEntries(U.slice(0, e.columns - 1).map((n) => [n, o]));
47
- }
48
- function mo(e, o) {
49
- return typeof e.columns != "number" || e.columns === o.columns ? e : { ...e, ...Ut({ ...o, ...e }) };
50
- }
51
- function Xt(e) {
52
- const o = Je(e), n = U.slice(0, e.columns - 1).map((s) => {
53
- const c = e[s];
54
- return typeof c == "number" ? Math.max(0, c) : o / e.columns;
55
- }), a = n.reduce((s, c) => s + c, 0), i = a > o ? o / a : 1;
56
- return [...n.map((s) => s * i), Math.max(0, o - a * i)];
57
- }
58
- function Yt(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 qt(e) {
63
- const o = [];
64
- return e.forEach((n, a) => {
65
- var c;
66
- const i = ((c = n.group) == null ? void 0 : c.trim()) ?? "", s = o[o.length - 1];
67
- if (!s || i !== "" && i !== s.label) {
68
- o.push({ label: i, rows: [{ item: n, index: a }] });
69
- return;
70
- }
71
- s.rows.push({ item: n, index: a });
72
- }), o;
73
- }
74
- function K(e) {
75
- return ((e == null ? void 0 : e.image) ?? []).filter((o) => !!(o != null && o.assetId));
76
- }
77
- function Xe(e, o, n) {
78
- return `${e}-${o}-${n}`;
79
- }
80
- function Qe({ type: e, name: o, assetId: n }) {
81
- return e ? e === "video" : Ue.test(o ?? "") || Ue.test(n);
82
- }
83
- function Zt(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 Ye(e) {
89
- const o = Zt(e);
90
- if (!o) return {};
91
- const n = getComputedStyle(o);
92
- return Object.fromEntries(
93
- jt.map((a) => [a, n.getPropertyValue(a).trim()]).filter(([, a]) => a)
94
- );
95
- }
96
- function qe(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 Jt(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 ${B}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 ${B}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 ${ae}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 ${B}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 Qt({ P: e, media: o, isVisible: n, isLoaded: a, isCovered: i, isFading: s, onLoad: c }) {
310
- const C = I(null), b = Qe(o), r = w(
311
- `${e}-media`,
312
- o.objectFit === "contain" && `${e}-media-contain`,
313
- n && a && `${e}-media-visible`,
314
- i && `${e}-media-covered`,
315
- s && `${e}-media-fading`
316
- );
317
- return h(() => {
318
- var k;
319
- const _ = C.current;
320
- _ && (n ? (k = _.play()) == null || k.catch(() => {
321
- }) : _.pause());
322
- }, [n]), b ? /* @__PURE__ */ p(
323
- "video",
324
- {
325
- ref: C,
326
- className: r,
327
- src: o.assetId,
328
- muted: !0,
329
- loop: !0,
330
- playsInline: !0,
331
- preload: "auto",
332
- onLoadedData: c
333
- }
334
- ) : /* @__PURE__ */ p("img", { className: r, src: o.assetId, alt: "", decoding: "async", onLoad: c });
335
- }
336
- function Pt(e, o, n, a, i) {
337
- const s = o[o.length - 1];
338
- let c = n;
339
- return o.slice(0, -1).map((C, b) => {
340
- const r = c + C + a / 2;
341
- return c += C + a, /* @__PURE__ */ p(
342
- "div",
343
- {
344
- "data-controls": U[b],
345
- "data-controls-axis": "x",
346
- "data-controls-variant": "column-width",
347
- "data-controls-min": String(Dt),
348
- "data-controls-max-fraction": String(C + s),
349
- className: `${e}-control-anchor`,
350
- style: { top: 0, left: i(r - X / 2), width: i(X), height: "100%" }
351
- },
352
- U[b]
353
- );
354
- });
355
- }
356
- function eo(e, o, n, a) {
357
- return Kt.map((i) => {
358
- const s = a(Math.max(n[i.side], X)), c = i.axis === "x";
359
- return /* @__PURE__ */ p(
360
- "div",
361
- {
362
- "data-controls": `panelPadding.${i.side}`,
363
- "data-controls-axis": i.axis,
364
- "data-controls-variant": i.variant,
365
- "data-controls-reverse": "reverse" in i ? "" : void 0,
366
- "data-controls-min": "0",
367
- "data-controls-max-fraction": "opposite" in i ? String(Math.max(0, o - n[i.opposite])) : void 0,
368
- className: `${e}-control-anchor`,
369
- style: {
370
- [i.side]: 0,
371
- ...c ? { top: 0, width: s, height: "100%" } : { left: 0, width: "100%", height: s }
372
- }
373
- },
374
- i.side
375
- );
376
- });
377
- }
378
- function fo({
379
- settings: e,
380
- content: o,
381
- isEditor: n,
382
- isEditMode: a,
383
- isPreviewMode: i,
384
- activeEvent: s,
385
- portalId: c,
386
- currentState: C,
387
- unavailableStates: b
388
- }) {
389
- var Ve;
390
- const { prefix: r } = zt(), {
391
- type: _,
392
- triggerLabel: k,
393
- closeLabel: Pe,
394
- columns: Y,
395
- columnGap: ie,
396
- hoverInterval: se,
397
- panelPosition: et,
398
- panelWidth: ce,
399
- panelPadding: E,
400
- panelRadius: tt,
401
- groupGap: ue,
402
- triggerColor: ot,
403
- triggerHoverColor: nt,
404
- closeColor: rt,
405
- closeHoverColor: lt,
406
- panelColor: at,
407
- textColor: it,
408
- textHoverColor: st,
409
- overlayColor: ct
410
- } = e, x = re(() => o ?? [], [o]), q = I(null), Z = I(null), J = I(null), de = I(null), pe = I(null), me = I(null), fe = I(null), [ut, W] = m(!1), [A, ge] = m(!1), [z, ve] = m(!1), [he, $e] = m(!1), [f, N] = m(null), [ye, we] = m(0), [Ce, dt] = m(() => /* @__PURE__ */ new Set()), [be, pt] = m(() => /* @__PURE__ */ new Set()), [V, xe] = m(null), [mt, ft] = m(null), [R, gt] = m(null), [Le, Se] = m({}), [Q, P] = m(null), [vt, Ie] = m(!1), O = !!(n && !i), $ = !O, g = _ === "a", ht = O && C === "open" && !(b != null && b.includes("open")), y = !g && (ht || ($ || !!a) && ut), Re = $ && (g || y), v = (t) => kt(t, n ?? !1), $t = re(() => Jt(r), [r]), Me = Ze[et], Ee = Xt(e), yt = Vt.slice(0, Y - 1), H = Y > 1, wt = re(() => H ? qt(x) : [{ label: "", rows: x.map((t, l) => ({ item: t, index: l })) }], [x, H]), D = f === null ? [] : K(x[f]), Ne = D[ye], L = f !== null && Ne ? Xe(f, ye, Ne.assetId) : null, Oe = L !== null && be.has(L);
411
- Ft(y && !O), h(() => {
412
- O && !a && W(!1);
413
- }, [O, a]), h(() => {
414
- if (y) {
415
- Se(Ye(q.current)), ge(!0);
416
- return;
417
- }
418
- ve(!1), N(null);
419
- const t = window.setTimeout(() => ge(!1), B);
420
- return () => window.clearTimeout(t);
421
- }, [y]), h(() => {
422
- var l;
423
- if (!y || !A) return;
424
- (l = J.current) == null || l.getBoundingClientRect();
425
- const t = requestAnimationFrame(() => ve(!0));
426
- return () => cancelAnimationFrame(t);
427
- }, [y, A]), h(() => {
428
- if (!z) {
429
- $e(!1);
430
- return;
431
- }
432
- const t = window.setTimeout(() => $e(!0), B);
433
- return () => window.clearTimeout(t);
434
- }, [z]);
435
- const j = Ot(() => {
436
- const t = Z.current, l = J.current;
437
- if (!t || !l) return;
438
- const d = t.getBoundingClientRect(), u = l.getBoundingClientRect();
439
- gt({ top: d.top - u.top, left: d.left - u.left });
440
- }, []);
441
- le(() => {
442
- if (A)
443
- return j(), window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
444
- }, [A, j]), h(() => {
445
- var l;
446
- if (!y || !$) return;
447
- (l = de.current) == null || l.focus({ preventScroll: !0 });
448
- const t = (d) => {
449
- d.key === "Escape" && W(!1);
450
- };
451
- return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
452
- }, [y, $]), le(() => {
453
- if (!g || f === null) return;
454
- const t = pe.current, l = me.current;
455
- if (!t || !l) return;
456
- const d = t.getBoundingClientRect(), u = l.getBoundingClientRect();
457
- P({ top: d.top - u.top, left: d.left - u.left, width: d.width });
458
- }, [g, f]), h(() => {
459
- if (f !== null) return;
460
- const t = window.setTimeout(() => P(null), ae);
461
- return () => window.clearTimeout(t);
462
- }, [f]);
463
- const Te = Q !== null;
464
- h(() => {
465
- if (!g || !Te) return;
466
- const t = () => {
467
- Ie(!0), N(null), P(null);
468
- };
469
- return document.addEventListener("scroll", t, { capture: !0, passive: !0 }), window.addEventListener("resize", t), () => {
470
- document.removeEventListener("scroll", t, { capture: !0 }), window.removeEventListener("resize", t);
471
- };
472
- }, [g, Te]), h(() => {
473
- Re && x.forEach((t) => K(t).forEach((l) => {
474
- Qe(l) || (new Image().src = l.assetId);
475
- }));
476
- }, [Re, x]), h(() => {
477
- if (D.length < 2) return;
478
- const t = window.setInterval(() => {
479
- we((l) => (l + 1) % D.length);
480
- }, se);
481
- return () => window.clearInterval(t);
482
- }, [f, D.length, se]), le(() => {
483
- const t = fe.current;
484
- fe.current = L, L !== null && (ft(L), xe(t));
485
- }, [L]), h(() => {
486
- if (!Oe || V === null) return;
487
- const t = window.setTimeout(() => xe(null), ae);
488
- return () => window.clearTimeout(t);
489
- }, [Oe, V]);
490
- const _e = () => {
491
- var t;
492
- $ && (W(!1), (t = Z.current) == null || t.focus({ preventScroll: !0 }));
493
- }, ke = (t) => {
494
- if (!$ || K(x[t]).length === 0) {
495
- N(null);
496
- return;
497
- }
498
- dt((l) => l.has(t) ? l : new Set(l).add(t)), g && f === null && Se(Ye(q.current)), f !== t && we(0), Ie(!1), N(t);
499
- }, Ae = (t) => {
500
- N((l) => l === t ? null : l);
501
- }, Ct = (t) => {
502
- !$ && t.target.closest("a") && t.preventDefault();
503
- }, ze = Ge(Ke(qe(e, "trigger"), n)), F = Wt.slice(0, Y).map((t) => Ge(Ke(qe(e, t), n))), He = F[0].lineHeight, Fe = (Ve = F[1]) == null ? void 0 : Ve.lineHeight, bt = He !== void 0 && Fe !== void 0 ? `calc((${Fe} - ${He}) / 2)` : void 0, ee = At(r, {
504
- triggerColor: ot,
505
- triggerHoverColor: nt,
506
- closeColor: rt,
507
- closeHoverColor: lt,
508
- panelColor: at,
509
- textColor: it,
510
- textHoverColor: st,
511
- overlayColor: ct
512
- }, Gt, []), te = s && s !== "default" ? `${r}-state-${s}` : "", oe = $ ? `${r}-interactive` : "", xt = !!a && (g || he), Be = /* @__PURE__ */ p("div", { className: w(`${r}-media-layer`, vt && `${r}-media-layer-instant`), "aria-hidden": "true", children: [...Ce].flatMap((t) => K(x[t]).map((l, d) => {
513
- const u = Xe(t, d, l.assetId);
514
- return /* @__PURE__ */ p(
515
- Qt,
516
- {
517
- P: r,
518
- media: l,
519
- isVisible: u === L,
520
- isLoaded: be.has(u),
521
- isCovered: u === V,
522
- isFading: L === null && (u === mt || u === V),
523
- onLoad: () => pt((S) => S.has(u) ? S : new Set(S).add(u))
524
- },
525
- u
526
- );
527
- })) }), ne = (t) => {
528
- const l = !t && xt;
529
- return /* @__PURE__ */ M(
530
- "div",
531
- {
532
- ref: t ? void 0 : pe,
533
- className: w(
534
- `${r}-panel`,
535
- z && he && `${r}-panel-settled`,
536
- g && `${r}-panel-inline`,
537
- t && `${r}-panel-copy`
538
- ),
539
- style: {
540
- width: v(ce),
541
- paddingTop: v(E.top),
542
- paddingRight: v(E.right),
543
- paddingBottom: v(E.bottom),
544
- paddingLeft: v(E.left),
545
- borderRadius: v(tt),
546
- [`--${r}-group-gap`]: v(ue),
547
- [`--${r}-panel-x`]: Me.x,
548
- [`--${r}-panel-y`]: Me.y,
549
- [`--${r}-grid-columns`]: Yt(Ee),
550
- [`--${r}-column-gap`]: v(ie),
551
- ...t && Q
552
- },
553
- "data-lightbox-scrollable": g ? void 0 : "",
554
- "aria-hidden": t || void 0,
555
- onMouseLeave: t ? void 0 : () => N(null),
556
- onClickCapture: t ? void 0 : Ct,
557
- children: [
558
- l && eo(r, ce, E, v),
559
- l && Pt(r, Ee, E.left, ie, v),
560
- wt.map((d, u) => /* @__PURE__ */ M(Tt, { children: [
561
- l && u > 0 && /* @__PURE__ */ p(
562
- "div",
563
- {
564
- "data-controls": "groupGap",
565
- "data-controls-paired": "",
566
- "data-controls-axis": "y",
567
- "data-controls-reverse": "",
568
- "data-controls-min": "0",
569
- className: `${r}-control-anchor`,
570
- style: { left: 0, width: "100%", height: v(Math.max(ue, X)) }
571
- }
572
- ),
573
- /* @__PURE__ */ M(
574
- "div",
575
- {
576
- className: w(`${r}-group`, !H && `${r}-group-unlabeled`),
577
- style: { gridTemplateRows: `repeat(${d.rows.length}, auto) 1fr` },
578
- children: [
579
- H && /* @__PURE__ */ p(
580
- "span",
581
- {
582
- className: `${r}-group-label`,
583
- style: { ...F[0], gridRow: `1 / span ${d.rows.length + 1}`, marginTop: bt },
584
- children: d.label
585
- }
586
- ),
587
- d.rows.map(({ item: S, index: T }) => {
588
- var De;
589
- const G = !t && ((De = S.link) != null && De.value) ? S.link : void 0, It = G ? "a" : "div", Rt = G ? {
590
- href: Ht(G.value),
591
- ...G.target === "blank" && { target: "_blank", rel: "noreferrer" }
592
- } : {}, Mt = t ? {} : {
593
- onMouseEnter: () => ke(T),
594
- onMouseLeave: () => Ae(T),
595
- onFocus: () => ke(T),
596
- onBlur: () => Ae(T)
597
- };
598
- return /* @__PURE__ */ M(
599
- It,
600
- {
601
- className: w(`${r}-row`, t && T === f && `${r}-row-active`),
602
- ...Rt,
603
- ...Mt,
604
- children: [
605
- !H && /* @__PURE__ */ p("div", { className: `${r}-title`, style: F[0], children: S.group }),
606
- yt.map((je, Et) => /* @__PURE__ */ p("div", { className: `${r}-title`, style: F[Et + 1], children: S[je] }, je))
607
- ]
608
- },
609
- T
610
- );
611
- })
612
- ]
613
- }
614
- )
615
- ] }, u))
616
- ]
617
- }
618
- );
619
- }, Lt = A ? /* @__PURE__ */ M(
620
- "div",
621
- {
622
- ref: J,
623
- className: w(
624
- `${r}-overlay`,
625
- n && `${r}-overlay-editor`,
626
- a && `${r}-overlay-edit-mode`,
627
- z && `${r}-overlay-active`,
628
- oe,
629
- te
630
- ),
631
- style: { ...ee, ...Le },
632
- role: "dialog",
633
- "aria-modal": "true",
634
- "aria-label": k,
635
- "data-selection": "none",
636
- children: [
637
- /* @__PURE__ */ p("div", { className: `${r}-backdrop`, "aria-hidden": "true", onClick: _e }),
638
- Be,
639
- /* @__PURE__ */ p(
640
- "button",
641
- {
642
- ref: de,
643
- type: "button",
644
- className: `${r}-close`,
645
- style: {
646
- ...ze,
647
- top: (R == null ? void 0 : R.top) ?? 0,
648
- left: (R == null ? void 0 : R.left) ?? 0,
649
- visibility: R ? "visible" : "hidden"
650
- },
651
- onClick: _e,
652
- children: Pe
653
- }
654
- ),
655
- ne(!1)
656
- ]
657
- }
658
- ) : null, St = g && Ce.size > 0 ? /* @__PURE__ */ M(
659
- "div",
660
- {
661
- ref: me,
662
- className: w(`${r}-inline-layer`, n && `${r}-overlay-editor`, oe, te),
663
- style: { ...ee, ...Le },
664
- "aria-hidden": "true",
665
- "data-selection": "none",
666
- children: [
667
- Be,
668
- Q && ne(!0)
669
- ]
670
- }
671
- ) : null, We = Lt ?? St;
672
- return /* @__PURE__ */ M(Nt, { children: [
673
- /* @__PURE__ */ p("style", { dangerouslySetInnerHTML: { __html: $t } }),
674
- /* @__PURE__ */ p(
675
- "div",
676
- {
677
- ref: q,
678
- className: w(O && `${r}-editor`, oe, te),
679
- style: ee,
680
- children: g ? ne(!1) : /* @__PURE__ */ p(
681
- "button",
682
- {
683
- ref: Z,
684
- type: "button",
685
- className: w(`${r}-trigger`, z && `${r}-trigger-hidden`),
686
- style: ze,
687
- "aria-haspopup": "dialog",
688
- "aria-expanded": y,
689
- onClick: () => {
690
- $ && W(!0);
691
- },
692
- children: k
693
- }
694
- )
695
- }
696
- ),
697
- We && typeof document < "u" && _t(
698
- We,
699
- (c ? document.getElementById(c) : null) ?? document.body
700
- )
701
- ] });
702
- }
703
- export {
704
- Wt as CHRONICLES_COLUMN_STYLE_PREFIXES,
705
- U as CHRONICLES_COLUMN_WIDTH_KEYS,
706
- Bt as CHRONICLES_EXTRA_TITLE_KEYS,
707
- po as CHRONICLES_PANEL_POSITIONS,
708
- fo as Chronicles,
709
- mo as applyChroniclesColumnCountChange,
710
- Ut as getChroniclesEqualColumnWidths
711
- };