@cntrl-site/components 1.0.109 → 1.0.110

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