@cntrl-site/components 1.0.107-alpha.3 → 1.0.107-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- import { jsx as s, jsxs as L, Fragment as De } from "react/jsx-runtime";
2
- import { useRef as A, useState as g, useMemo as Ne, useEffect as $, useCallback as wt, useLayoutEffect as Te, Fragment as Ct } from "react";
3
- import { createPortal as bt } from "react-dom";
1
+ import { jsx as s, jsxs as x, Fragment as Be } from "react/jsx-runtime";
2
+ import { useRef as A, useState as f, useMemo as Ne, useEffect as $, useCallback as Ct, useLayoutEffect as Te, Fragment as bt } from "react";
3
+ import { createPortal as xt } from "react-dom";
4
4
  import C from "classnames";
5
- import { s as xt } from "./scalingValue-C9JH5L6O.mjs";
6
- import { b as Lt } from "./buildColorVars-CLyWQm5K.mjs";
7
- import { u as At } from "./useScopedStyles-DhBG3557.mjs";
8
- import { R as _t } from "./RichTextRenderer-BptwNpbJ.mjs";
5
+ import { s as Lt } from "./scalingValue-C9JH5L6O.mjs";
6
+ import { b as At } from "./buildColorVars-CLyWQm5K.mjs";
7
+ import { u as _t } from "./useScopedStyles-DhBG3557.mjs";
8
+ import { R as It } from "./RichTextRenderer-BptwNpbJ.mjs";
9
9
  import { o as Oe, t as Fe } from "./textStylesToCss-05Mn6I_2.mjs";
10
- import { u as It } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
11
- const Q = 2, Rt = 5, St = ["title2", "title3", "title4"], B = ["column1Width", "column2Width", "column3Width", "column4Width"], P = {
10
+ import { u as Rt } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
11
+ const St = 1, De = 2, Et = 5, Mt = ["title2", "title3", "title4"], B = ["column1Width", "column2Width", "column3Width", "column4Width"], ee = {
12
12
  center: { x: "50%", y: "50%" },
13
13
  "left-top": { x: "0%", y: "0%" },
14
14
  "top-center": { x: "50%", y: "0%" },
@@ -18,7 +18,7 @@ const Q = 2, Rt = 5, St = ["title2", "title3", "title4"], B = ["column1Width", "
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
- }, to = Object.keys(P), Et = ["column1", "column2", "column3", "column4", "column5"], Mt = {
21
+ }, no = Object.keys(ee), Nt = ["column1", "column2", "column3", "column4", "column5"], Tt = {
22
22
  triggerColor: "trigger-color",
23
23
  triggerHoverColor: "trigger-hover-color",
24
24
  closeColor: "close-color",
@@ -27,38 +27,38 @@ const Q = 2, Rt = 5, St = ["title2", "title3", "title4"], B = ["column1Width", "
27
27
  textColor: "text-color",
28
28
  textHoverColor: "text-hover-color",
29
29
  overlayColor: "overlay-color"
30
- }, Nt = ["hover", "open"], T = 300, Ue = 4e-3, He = 4e-3, Tt = 20, Ve = 0.0139, We = 0.3194, ke = { top: 972e-5, right: 972e-5, bottom: 972e-5, left: 972e-5 }, Ge = 300, Ot = 1e3, Ft = [
30
+ }, Ot = ["hover", "open"], F = 300, Ve = 4e-3, He = 4e-3, Ft = 20, We = 0.0139, ke = 0.3194, Ge = { top: 972e-5, right: 972e-5, bottom: 972e-5, left: 972e-5 }, je = 300, Ht = 1e3, Ut = [
31
31
  "--cntrl-article-width",
32
32
  "--cntrl-article-top",
33
33
  "--cntrl-article-left",
34
34
  "--cntrl-viewport-height"
35
35
  ];
36
36
  function D(e) {
37
- return Math.min(Math.max(Math.round(e ?? Q), Q), Rt);
37
+ return Math.min(Math.max(Math.round(e ?? De), St), Et);
38
38
  }
39
- function je(e) {
40
- const { panelWidth: o = We, panelPadding: n = ke, columnGap: i = Ve } = e, a = (D(e.columns) - 1) * i;
39
+ function Ke(e) {
40
+ const { panelWidth: o = ke, panelPadding: n = Ge, columnGap: i = We } = e, a = (D(e.columns) - 1) * i;
41
41
  return Math.max(0, o - n.left - n.right - a);
42
42
  }
43
- function Ht(e) {
44
- const o = D(e.columns), n = je(e) / o;
43
+ function zt(e) {
44
+ const o = D(e.columns), n = Ke(e) / o;
45
45
  return Object.fromEntries(B.slice(0, o - 1).map((i) => [i, n]));
46
46
  }
47
- function zt(e) {
48
- const o = D(e.columns), n = je(e), i = B.slice(0, o - 1).map((p) => {
47
+ function Bt(e) {
48
+ const o = D(e.columns), n = Ke(e), i = B.slice(0, o - 1).map((p) => {
49
49
  const d = e[p];
50
50
  return typeof d == "number" ? Math.max(0, d) : n / o;
51
51
  }), a = i.reduce((p, d) => p + d, 0), c = a > n ? n / a : 1;
52
52
  return [...i.map((p) => p * c), Math.max(0, n - a * c)];
53
53
  }
54
- function oo(e, o) {
55
- return typeof e.columns != "number" || e.columns === o.columns ? e : { ...e, ...Ht({ ...o, ...e }) };
54
+ function ro(e, o) {
55
+ return typeof e.columns != "number" || e.columns === o.columns ? e : { ...e, ...zt({ ...o, ...e }) };
56
56
  }
57
- function Bt(e) {
57
+ function Dt(e) {
58
58
  const o = e.reduce((n, i) => n + i, 0);
59
59
  return e.map((n) => `minmax(0, ${o > 0 ? n / o * 100 : 1}fr)`).join(" ");
60
60
  }
61
- function Dt(e) {
61
+ function Vt(e) {
62
62
  const o = [];
63
63
  return e.forEach((n, i) => {
64
64
  var u;
@@ -74,10 +74,10 @@ function z(e) {
74
74
  const { image: o } = e ?? {};
75
75
  return (Array.isArray(o) ? o : o ? [o] : []).filter((n) => !!(n != null && n.assetId));
76
76
  }
77
- function Ke(e) {
77
+ function Xe(e) {
78
78
  return e.type === "video" ? !0 : e.type === "image" ? !1 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name ?? "") || /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId);
79
79
  }
80
- function Ut(e) {
80
+ function Wt(e) {
81
81
  let o = e;
82
82
  for (; o; ) {
83
83
  if (getComputedStyle(o).getPropertyValue("--cntrl-article-width").trim())
@@ -86,17 +86,17 @@ function Ut(e) {
86
86
  }
87
87
  return e;
88
88
  }
89
- function ze(e) {
90
- const o = {}, n = Ut(e);
89
+ function Ue(e) {
90
+ const o = {}, n = Wt(e);
91
91
  if (!n) return o;
92
92
  const i = getComputedStyle(n);
93
- for (const a of Ft) {
93
+ for (const a of Ut) {
94
94
  const c = i.getPropertyValue(a).trim();
95
95
  c && (o[a] = c);
96
96
  }
97
97
  return o;
98
98
  }
99
- function Be(e, o, n) {
99
+ function ze(e, o, n) {
100
100
  const i = e, a = (u) => i[`${o}${u}`] ?? (n ? i[`${n}${u}`] : void 0), c = a("FontSettings");
101
101
  return {
102
102
  fontSettings: {
@@ -113,7 +113,7 @@ function Be(e, o, n) {
113
113
  color: "#000000"
114
114
  };
115
115
  }
116
- function Vt(e) {
116
+ function kt(e) {
117
117
  return `
118
118
  .${e}-trigger,
119
119
  .${e}-close {
@@ -131,7 +131,7 @@ function Vt(e) {
131
131
  }
132
132
  .${e}-trigger {
133
133
  color: var(--${e}-trigger-color);
134
- transition: color 150ms ease, opacity ${T}ms ease;
134
+ transition: color 150ms ease, opacity ${F}ms ease;
135
135
  }
136
136
  .${e}-trigger-hidden {
137
137
  opacity: 0;
@@ -166,7 +166,7 @@ function Vt(e) {
166
166
  overscroll-behavior: none;
167
167
  opacity: 0;
168
168
  pointer-events: none;
169
- transition: opacity ${T}ms ease;
169
+ transition: opacity ${F}ms ease;
170
170
  }
171
171
  .${e}-inline-layer {
172
172
  position: fixed;
@@ -206,7 +206,7 @@ function Vt(e) {
206
206
  height: 100%;
207
207
  object-fit: cover;
208
208
  opacity: 0;
209
- transition: opacity ${Ge}ms cubic-bezier(0, 0, 0.58, 1);
209
+ transition: opacity ${je}ms cubic-bezier(0, 0, 0.58, 1);
210
210
  }
211
211
  .${e}-media-contain {
212
212
  object-fit: contain;
@@ -231,7 +231,7 @@ function Vt(e) {
231
231
  background-color: var(--${e}-panel-color);
232
232
  color: var(--${e}-text-color);
233
233
  overscroll-behavior: contain;
234
- transition: transform ${T}ms cubic-bezier(0, 0, 0.58, 1);
234
+ transition: transform ${F}ms cubic-bezier(0, 0, 0.58, 1);
235
235
  }
236
236
  .${e}-overlay-active .${e}-panel {
237
237
  transform: translate(calc(-1 * var(--${e}-panel-x)), calc(-1 * var(--${e}-panel-y)));
@@ -276,6 +276,9 @@ function Vt(e) {
276
276
  grid-template-columns: subgrid;
277
277
  align-items: baseline;
278
278
  }
279
+ .${e}-group-unlabeled .${e}-row {
280
+ grid-column: 1 / -1;
281
+ }
279
282
  .${e}-group-label {
280
283
  grid-column: 1;
281
284
  align-self: start;
@@ -297,17 +300,17 @@ function Vt(e) {
297
300
  }
298
301
  .${e}-interactive .${e}-row:hover .${e}-title,
299
302
  .${e}-row:focus-within .${e}-title,
300
- .${e}-state-hover .${e}-group-label + .${e}-row .${e}-title {
303
+ .${e}-state-hover .${e}-row:first-of-type .${e}-title {
301
304
  color: var(--${e}-text-hover-color, var(--${e}-text-color));
302
305
  }
303
306
  `;
304
307
  }
305
- function Wt({
308
+ function Gt({
306
309
  P: e,
307
310
  media: o,
308
311
  isVisible: n
309
312
  }) {
310
- const i = A(null), [a, c] = g(!1), u = Ke(o), p = C(
313
+ const i = A(null), [a, c] = f(!1), u = Xe(o), p = C(
311
314
  `${e}-media`,
312
315
  o.objectFit === "contain" && `${e}-media-contain`,
313
316
  n && a && `${e}-media-visible`
@@ -340,7 +343,7 @@ function Wt({
340
343
  }
341
344
  );
342
345
  }
343
- function kt(e, o, n, i, a) {
346
+ function jt(e, o, n, i, a) {
344
347
  const c = o[o.length - 1];
345
348
  let u = n;
346
349
  return o.slice(0, -1).map((p, d) => {
@@ -351,7 +354,7 @@ function kt(e, o, n, i, a) {
351
354
  "data-controls": B[d],
352
355
  "data-controls-axis": "x",
353
356
  "data-controls-variant": "column-width",
354
- "data-controls-min": String(Tt),
357
+ "data-controls-min": String(Ft),
355
358
  "data-controls-max-fraction": String(p + c),
356
359
  className: `${e}-control-anchor`,
357
360
  style: { top: 0, left: a(r - He / 2), width: a(He), height: "100%" }
@@ -360,9 +363,9 @@ function kt(e, o, n, i, a) {
360
363
  );
361
364
  });
362
365
  }
363
- function Gt(e, o, n, i) {
364
- const a = (c) => i(Math.max(c, Ue));
365
- return /* @__PURE__ */ L(De, { children: [
366
+ function Kt(e, o, n, i) {
367
+ const a = (c) => i(Math.max(c, Ve));
368
+ return /* @__PURE__ */ x(Be, { children: [
366
369
  /* @__PURE__ */ s(
367
370
  "div",
368
371
  {
@@ -413,7 +416,7 @@ function Gt(e, o, n, i) {
413
416
  )
414
417
  ] });
415
418
  }
416
- function no({
419
+ function ao({
417
420
  settings: e,
418
421
  content: o,
419
422
  isEditor: n,
@@ -425,167 +428,167 @@ function no({
425
428
  unavailableStates: d
426
429
  }) {
427
430
  var Ee;
428
- const { prefix: r } = At(), {
429
- type: Xe = "b",
430
- triggerLabel: ee = "Archive",
431
- closeLabel: Ye = "Close",
432
- columns: qe = Q,
433
- columnGap: te = Ve,
434
- hoverInterval: oe = Ot,
435
- panelPosition: Ze,
436
- panelWidth: ne = We,
437
- panelPadding: _ = ke,
438
- panelRadius: Je = 0,
439
- groupGap: re = 0.0139,
440
- triggerColor: Qe = "#000000",
441
- triggerHoverColor: Pe = "#666666",
442
- closeColor: et = "#000000",
443
- closeHoverColor: tt = "#666666",
444
- panelColor: ot = "#FFFFFF",
445
- textColor: nt = "#333132",
446
- textHoverColor: rt = "#BBBBBB",
447
- overlayColor: at = "#FFFFFFE6"
448
- } = e, U = o ?? [], V = A(null), W = A(null), k = A(null), ae = A(null), le = A(null), ie = A(null), [lt, O] = g(!1), [E, ce] = g(!1), [M, se] = g(!1), [ue, de] = g(!1), [v, I] = g(null), [it, pe] = g(0), [me, ct] = g(() => /* @__PURE__ */ new Set()), [b, st] = g(null), [fe, ge] = g({}), [R, G] = g(null), [ut, ve] = g(!1), N = !!(n && !a), y = !n || !!a, f = Xe === "a", dt = N && p === "open" && !(d != null && d.includes("open")), w = !f && (dt || (y || !!i) && lt), h = (t) => xt(t, n ?? !1), pt = Ne(() => Vt(r), [r]), mt = Ne(() => Dt(o ?? []), [o]), he = P[Ze] ?? P.center, $e = D(qe), ye = zt(e), ft = ["title", ...St].slice(0, $e - 1);
449
- It(w && !N), $(() => {
450
- N && !i && O(!1);
431
+ const { prefix: r } = _t(), {
432
+ type: Ye = "b",
433
+ triggerLabel: te = "Archive",
434
+ closeLabel: qe = "Close",
435
+ columns: Ze = De,
436
+ columnGap: oe = We,
437
+ hoverInterval: ne = Ht,
438
+ panelPosition: Je,
439
+ panelWidth: re = ke,
440
+ panelPadding: _ = Ge,
441
+ panelRadius: Qe = 0,
442
+ groupGap: ae = 0.0139,
443
+ triggerColor: Pe = "#000000",
444
+ triggerHoverColor: et = "#666666",
445
+ closeColor: tt = "#000000",
446
+ closeHoverColor: ot = "#666666",
447
+ panelColor: nt = "#FFFFFF",
448
+ textColor: rt = "#333132",
449
+ textHoverColor: at = "#BBBBBB",
450
+ overlayColor: lt = "#FFFFFFE6"
451
+ } = e, V = o ?? [], W = A(null), k = A(null), G = A(null), le = A(null), ie = A(null), ce = A(null), [it, H] = f(!1), [E, se] = f(!1), [M, ue] = f(!1), [de, pe] = f(!1), [h, I] = f(null), [ct, me] = f(0), [ge, st] = f(() => /* @__PURE__ */ new Set()), [L, ut] = f(null), [fe, he] = f({}), [R, j] = f(null), [dt, ve] = f(!1), N = !!(n && !a), y = !n || !!a, g = Ye === "a", pt = N && p === "open" && !(d != null && d.includes("open")), w = !g && (pt || (y || !!i) && it), v = (t) => Lt(t, n ?? !1), mt = Ne(() => kt(r), [r]), $e = ee[Je] ?? ee.center, K = D(Ze), ye = Bt(e), gt = ["title", ...Mt].slice(0, K - 1), T = K > 1, ft = Ne(() => T ? Vt(o ?? []) : [{ label: "", rows: (o ?? []).map((t, l) => ({ item: t, index: l })) }], [o, T]);
452
+ Rt(w && !N), $(() => {
453
+ N && !i && H(!1);
451
454
  }, [N, i]), $(() => {
452
455
  if (w) {
453
- ge(ze(V.current)), ce(!0);
456
+ he(Ue(W.current)), se(!0);
454
457
  return;
455
458
  }
456
- se(!1), I(null);
457
- const t = window.setTimeout(() => ce(!1), T);
459
+ ue(!1), I(null);
460
+ const t = window.setTimeout(() => se(!1), F);
458
461
  return () => window.clearTimeout(t);
459
462
  }, [w]), $(() => {
460
463
  var l;
461
464
  if (!w || !E) return;
462
- (l = k.current) == null || l.getBoundingClientRect();
463
- const t = requestAnimationFrame(() => se(!0));
465
+ (l = G.current) == null || l.getBoundingClientRect();
466
+ const t = requestAnimationFrame(() => ue(!0));
464
467
  return () => cancelAnimationFrame(t);
465
468
  }, [w, E]), $(() => {
466
469
  if (!M) {
467
- de(!1);
470
+ pe(!1);
468
471
  return;
469
472
  }
470
- const t = window.setTimeout(() => de(!0), T);
473
+ const t = window.setTimeout(() => pe(!0), F);
471
474
  return () => window.clearTimeout(t);
472
475
  }, [M]);
473
- const F = wt(() => {
474
- const t = W.current, l = k.current;
476
+ const U = Ct(() => {
477
+ const t = k.current, l = G.current;
475
478
  if (!t || !l) return;
476
- const m = t.getBoundingClientRect(), x = l.getBoundingClientRect();
477
- st({ top: m.top - x.top, left: m.left - x.left });
479
+ const m = t.getBoundingClientRect(), b = l.getBoundingClientRect();
480
+ ut({ top: m.top - b.top, left: m.left - b.left });
478
481
  }, []);
479
482
  Te(() => {
480
483
  if (E)
481
- return F(), window.addEventListener("resize", F), () => window.removeEventListener("resize", F);
482
- }, [E, F]), $(() => {
484
+ return U(), window.addEventListener("resize", U), () => window.removeEventListener("resize", U);
485
+ }, [E, U]), $(() => {
483
486
  var l;
484
487
  if (!w || !y) return;
485
- (l = ae.current) == null || l.focus({ preventScroll: !0 });
488
+ (l = le.current) == null || l.focus({ preventScroll: !0 });
486
489
  const t = (m) => {
487
- m.key === "Escape" && O(!1);
490
+ m.key === "Escape" && H(!1);
488
491
  };
489
492
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
490
493
  }, [w, y]), Te(() => {
491
- if (!f || v === null) return;
492
- const t = le.current, l = ie.current;
494
+ if (!g || h === null) return;
495
+ const t = ie.current, l = ce.current;
493
496
  if (!t || !l) return;
494
- const m = t.getBoundingClientRect(), x = l.getBoundingClientRect();
495
- G({ top: m.top - x.top, left: m.left - x.left, width: m.width });
496
- }, [f, v]), $(() => {
497
- if (v !== null) return;
498
- const t = window.setTimeout(() => G(null), Ge);
497
+ const m = t.getBoundingClientRect(), b = l.getBoundingClientRect();
498
+ j({ top: m.top - b.top, left: m.left - b.left, width: m.width });
499
+ }, [g, h]), $(() => {
500
+ if (h !== null) return;
501
+ const t = window.setTimeout(() => j(null), je);
499
502
  return () => window.clearTimeout(t);
500
- }, [v]);
503
+ }, [h]);
501
504
  const we = R !== null;
502
505
  $(() => {
503
- if (!f || !we) return;
506
+ if (!g || !we) return;
504
507
  const t = () => {
505
- ve(!0), I(null), G(null);
508
+ ve(!0), I(null), j(null);
506
509
  };
507
510
  return document.addEventListener("scroll", t, { capture: !0, passive: !0 }), window.addEventListener("resize", t), () => {
508
511
  document.removeEventListener("scroll", t, { capture: !0 }), window.removeEventListener("resize", t);
509
512
  };
510
- }, [f, we]);
513
+ }, [g, we]);
511
514
  const Ce = () => {
512
515
  var t;
513
- y && (O(!1), (t = W.current) == null || t.focus({ preventScroll: !0 }));
514
- }, be = y && (f || w);
516
+ y && (H(!1), (t = k.current) == null || t.focus({ preventScroll: !0 }));
517
+ }, be = y && (g || w);
515
518
  $(() => {
516
519
  be && (o ?? []).forEach((t) => z(t).forEach((l) => {
517
- Ke(l) || (new Image().src = l.assetId);
520
+ Xe(l) || (new Image().src = l.assetId);
518
521
  }));
519
522
  }, [be, o]);
520
- const j = v === null ? 0 : z(U[v]).length;
523
+ const X = h === null ? 0 : z(V[h]).length;
521
524
  $(() => {
522
- if (j < 2) return;
525
+ if (X < 2) return;
523
526
  const t = window.setInterval(() => {
524
- pe((l) => (l + 1) % j);
525
- }, Math.max(100, oe));
527
+ me((l) => (l + 1) % X);
528
+ }, Math.max(100, ne));
526
529
  return () => window.clearInterval(t);
527
- }, [v, j, oe]);
530
+ }, [h, X, ne]);
528
531
  const xe = (t) => {
529
- if (!y || z(U[t]).length === 0) {
532
+ if (!y || z(V[t]).length === 0) {
530
533
  I(null);
531
534
  return;
532
535
  }
533
- ct((l) => l.has(t) ? l : new Set(l).add(t)), f && v === null && ge(ze(V.current)), v !== t && pe(0), ve(!1), I(t);
536
+ st((l) => l.has(t) ? l : new Set(l).add(t)), g && h === null && he(Ue(W.current)), h !== t && me(0), ve(!1), I(t);
534
537
  }, Le = (t) => {
535
538
  I((l) => l === t ? null : l);
536
- }, gt = (t) => {
539
+ }, ht = (t) => {
537
540
  !y && t.target.closest("a") && t.preventDefault();
538
- }, Ae = Oe(Fe(Be(e, "trigger"), n)), H = Et.slice(0, $e).map((t) => Oe(Fe(Be(e, t, "list"), n))), _e = H[0].lineHeight, Ie = (Ee = H[1]) == null ? void 0 : Ee.lineHeight, vt = _e !== void 0 && Ie !== void 0 ? `calc((${Ie} - ${_e}) / 2)` : void 0, K = Lt(r, {
539
- triggerColor: Qe,
540
- triggerHoverColor: Pe,
541
- closeColor: et,
542
- closeHoverColor: tt,
543
- panelColor: ot,
544
- textColor: nt,
545
- textHoverColor: rt,
546
- overlayColor: at
547
- }, Mt, Nt), X = c && c !== "default" ? `${r}-state-${c}` : "", Y = y ? `${r}-interactive` : "", Re = /* @__PURE__ */ s("div", { className: C(`${r}-media-layer`, ut && `${r}-media-layer-instant`), "aria-hidden": "true", children: [...me].flatMap((t) => z(U[t]).map((l, m) => /* @__PURE__ */ s(
548
- Wt,
541
+ }, Ae = Oe(Fe(ze(e, "trigger"), n)), O = Nt.slice(0, K).map((t) => Oe(Fe(ze(e, t, "list"), n))), _e = O[0].lineHeight, Ie = (Ee = O[1]) == null ? void 0 : Ee.lineHeight, vt = _e !== void 0 && Ie !== void 0 ? `calc((${Ie} - ${_e}) / 2)` : void 0, Y = At(r, {
542
+ triggerColor: Pe,
543
+ triggerHoverColor: et,
544
+ closeColor: tt,
545
+ closeHoverColor: ot,
546
+ panelColor: nt,
547
+ textColor: rt,
548
+ textHoverColor: at,
549
+ overlayColor: lt
550
+ }, Tt, Ot), q = c && c !== "default" ? `${r}-state-${c}` : "", Z = y ? `${r}-interactive` : "", Re = /* @__PURE__ */ s("div", { className: C(`${r}-media-layer`, dt && `${r}-media-layer-instant`), "aria-hidden": "true", children: [...ge].flatMap((t) => z(V[t]).map((l, m) => /* @__PURE__ */ s(
551
+ Gt,
549
552
  {
550
553
  P: r,
551
554
  media: l,
552
- isVisible: v === t && it === m
555
+ isVisible: h === t && ct === m
553
556
  },
554
557
  `${t}-${m}-${l.assetId}`
555
- ))) }), q = !!i && (f || ue), Z = (t) => /* @__PURE__ */ L(
558
+ ))) }), J = !!i && (g || de), Q = (t) => /* @__PURE__ */ x(
556
559
  "div",
557
560
  {
558
- ref: t ? void 0 : le,
561
+ ref: t ? void 0 : ie,
559
562
  className: C(
560
563
  `${r}-panel`,
561
564
  // Only the open and close slide; once open, a new position or size moves the panel straight there.
562
- M && ue && `${r}-panel-settled`,
563
- f && `${r}-panel-inline`,
565
+ M && de && `${r}-panel-settled`,
566
+ g && `${r}-panel-inline`,
564
567
  t && `${r}-panel-copy`
565
568
  ),
566
569
  style: {
567
- width: h(ne),
568
- paddingTop: h(_.top),
569
- paddingRight: h(_.right),
570
- paddingBottom: h(_.bottom),
571
- paddingLeft: h(_.left),
572
- borderRadius: h(Je),
573
- [`--${r}-group-gap`]: h(re),
574
- [`--${r}-panel-x`]: he.x,
575
- [`--${r}-panel-y`]: he.y,
576
- [`--${r}-grid-columns`]: Bt(ye),
577
- [`--${r}-column-gap`]: h(te),
570
+ width: v(re),
571
+ paddingTop: v(_.top),
572
+ paddingRight: v(_.right),
573
+ paddingBottom: v(_.bottom),
574
+ paddingLeft: v(_.left),
575
+ borderRadius: v(Qe),
576
+ [`--${r}-group-gap`]: v(ae),
577
+ [`--${r}-panel-x`]: $e.x,
578
+ [`--${r}-panel-y`]: $e.y,
579
+ [`--${r}-grid-columns`]: Dt(ye),
580
+ [`--${r}-column-gap`]: v(oe),
578
581
  ...t && R ? { top: R.top, left: R.left, width: R.width } : {}
579
582
  },
580
- "data-lightbox-scrollable": f ? void 0 : "",
583
+ "data-lightbox-scrollable": g ? void 0 : "",
581
584
  "aria-hidden": t || void 0,
582
585
  onMouseLeave: t ? void 0 : () => I(null),
583
- onClickCapture: t ? void 0 : gt,
586
+ onClickCapture: t ? void 0 : ht,
584
587
  children: [
585
- !t && q && Gt(r, ne, _, h),
586
- !t && q && kt(r, ye, _.left, te, h),
587
- mt.map((l, m) => /* @__PURE__ */ L(Ct, { children: [
588
- !t && q && m > 0 && // Left at its static top, the anchor sits right where the gap above this group starts.
588
+ !t && J && Kt(r, re, _, v),
589
+ !t && J && jt(r, ye, _.left, oe, v),
590
+ ft.map((l, m) => /* @__PURE__ */ x(bt, { children: [
591
+ !t && J && m > 0 && // Left at its static top, the anchor sits right where the gap above this group starts.
589
592
  /* @__PURE__ */ s(
590
593
  "div",
591
594
  {
@@ -595,55 +598,65 @@ function no({
595
598
  "data-controls-reverse": "",
596
599
  "data-controls-min": "0",
597
600
  className: `${r}-control-anchor`,
598
- style: { left: 0, width: "100%", height: h(Math.max(re, Ue)) }
601
+ style: { left: 0, width: "100%", height: v(Math.max(ae, Ve)) }
599
602
  }
600
603
  ),
601
- /* @__PURE__ */ L("div", { className: `${r}-group`, style: { gridTemplateRows: `repeat(${l.rows.length}, auto) 1fr` }, children: [
602
- /* @__PURE__ */ s(
603
- "span",
604
- {
605
- className: `${r}-group-label`,
606
- style: { ...H[0], gridRow: `1 / span ${l.rows.length + 1}`, marginTop: vt },
607
- children: l.label
608
- }
609
- ),
610
- l.rows.map(({ item: x, index: S }) => /* @__PURE__ */ s(
611
- "div",
612
- {
613
- className: C(`${r}-row`, t && S === v && `${r}-row-active`),
614
- ...t ? {} : {
615
- onMouseEnter: () => xe(S),
616
- onMouseLeave: () => Le(S),
617
- onFocus: () => xe(S),
618
- onBlur: () => Le(S)
619
- },
620
- children: ft.map((Me, yt) => {
621
- const J = x[Me];
622
- return /* @__PURE__ */ s("div", { className: `${r}-title`, style: H[yt + 1], children: Array.isArray(J) ? /* @__PURE__ */ s(_t, { content: J }) : J }, Me);
623
- })
624
- },
625
- S
626
- ))
627
- ] })
604
+ /* @__PURE__ */ x(
605
+ "div",
606
+ {
607
+ className: C(`${r}-group`, !T && `${r}-group-unlabeled`),
608
+ style: { gridTemplateRows: `repeat(${l.rows.length}, auto) 1fr` },
609
+ children: [
610
+ T && /* @__PURE__ */ s(
611
+ "span",
612
+ {
613
+ className: `${r}-group-label`,
614
+ style: { ...O[0], gridRow: `1 / span ${l.rows.length + 1}`, marginTop: vt },
615
+ children: l.label
616
+ }
617
+ ),
618
+ l.rows.map(({ item: b, index: S }) => /* @__PURE__ */ x(
619
+ "div",
620
+ {
621
+ className: C(`${r}-row`, t && S === h && `${r}-row-active`),
622
+ ...t ? {} : {
623
+ onMouseEnter: () => xe(S),
624
+ onMouseLeave: () => Le(S),
625
+ onFocus: () => xe(S),
626
+ onBlur: () => Le(S)
627
+ },
628
+ children: [
629
+ !T && /* @__PURE__ */ s("div", { className: `${r}-title`, style: O[0], children: b.group }),
630
+ gt.map((Me, wt) => {
631
+ const P = b[Me];
632
+ return /* @__PURE__ */ s("div", { className: `${r}-title`, style: O[wt + 1], children: Array.isArray(P) ? /* @__PURE__ */ s(It, { content: P }) : P }, Me);
633
+ })
634
+ ]
635
+ },
636
+ S
637
+ ))
638
+ ]
639
+ }
640
+ )
628
641
  ] }, m))
629
642
  ]
630
643
  }
631
- ), ht = E ? /* @__PURE__ */ L(
644
+ ), $t = E ? /* @__PURE__ */ x(
632
645
  "div",
633
646
  {
634
- ref: k,
647
+ ref: G,
635
648
  className: C(
636
649
  `${r}-overlay`,
637
650
  n && `${r}-overlay-editor`,
638
651
  i && `${r}-overlay-edit-mode`,
639
652
  M && `${r}-overlay-active`,
640
- Y,
641
- X
653
+ Z,
654
+ q
642
655
  ),
643
- style: { ...K, ...fe },
656
+ style: { ...Y, ...fe },
644
657
  role: "dialog",
645
658
  "aria-modal": "true",
646
- "aria-label": ee,
659
+ "aria-label": te,
647
660
  "data-selection": "none",
648
661
  children: [
649
662
  /* @__PURE__ */ s("div", { className: `${r}-backdrop`, "aria-hidden": "true", onClick: Ce }),
@@ -651,82 +664,83 @@ function no({
651
664
  /* @__PURE__ */ s(
652
665
  "button",
653
666
  {
654
- ref: ae,
667
+ ref: le,
655
668
  type: "button",
656
669
  className: `${r}-close`,
657
670
  style: {
658
671
  ...Ae,
659
- top: (b == null ? void 0 : b.top) ?? 0,
660
- left: (b == null ? void 0 : b.left) ?? 0,
661
- visibility: b ? "visible" : "hidden"
672
+ top: (L == null ? void 0 : L.top) ?? 0,
673
+ left: (L == null ? void 0 : L.left) ?? 0,
674
+ visibility: L ? "visible" : "hidden"
662
675
  },
663
676
  onClick: Ce,
664
- children: Ye
677
+ children: qe
665
678
  }
666
679
  ),
667
- Z(!1)
680
+ Q(!1)
668
681
  ]
669
682
  }
670
- ) : null, $t = f && me.size > 0 ? /* @__PURE__ */ L(
683
+ ) : null, yt = g && ge.size > 0 ? /* @__PURE__ */ x(
671
684
  "div",
672
685
  {
673
- ref: ie,
674
- className: C(`${r}-inline-layer`, n && `${r}-overlay-editor`, Y, X),
675
- style: { ...K, ...fe },
686
+ ref: ce,
687
+ className: C(`${r}-inline-layer`, n && `${r}-overlay-editor`, Z, q),
688
+ style: { ...Y, ...fe },
676
689
  "aria-hidden": "true",
677
690
  "data-selection": "none",
678
691
  children: [
679
692
  Re,
680
- R && Z(!0)
693
+ R && Q(!0)
681
694
  ]
682
695
  }
683
- ) : null, Se = ht ?? $t;
684
- return /* @__PURE__ */ L(De, { children: [
685
- /* @__PURE__ */ s("style", { dangerouslySetInnerHTML: { __html: pt } }),
696
+ ) : null, Se = $t ?? yt;
697
+ return /* @__PURE__ */ x(Be, { children: [
698
+ /* @__PURE__ */ s("style", { dangerouslySetInnerHTML: { __html: mt } }),
686
699
  /* @__PURE__ */ s(
687
700
  "div",
688
701
  {
689
- ref: V,
690
- className: C(N && `${r}-editor`, Y, X),
691
- style: K,
692
- children: f ? Z(!1) : (
702
+ ref: W,
703
+ className: C(N && `${r}-editor`, Z, q),
704
+ style: Y,
705
+ children: g ? Q(!1) : (
693
706
  // The overlay lets the page show through, so the label fades out with it rather than sit under the close.
694
707
  // Only faded, it keeps the component's size and can still take focus back on close.
695
708
  /* @__PURE__ */ s(
696
709
  "button",
697
710
  {
698
- ref: W,
711
+ ref: k,
699
712
  type: "button",
700
713
  className: C(`${r}-trigger`, M && `${r}-trigger-hidden`),
701
714
  style: Ae,
702
715
  "aria-haspopup": "dialog",
703
716
  "aria-expanded": w,
704
717
  onClick: () => {
705
- y && O(!0);
718
+ y && H(!0);
706
719
  },
707
- children: ee
720
+ children: te
708
721
  }
709
722
  )
710
723
  )
711
724
  }
712
725
  ),
713
- Se && typeof document < "u" && bt(
726
+ Se && typeof document < "u" && xt(
714
727
  Se,
715
728
  (u ? document.getElementById(u) : null) ?? document.body
716
729
  )
717
730
  ] });
718
731
  }
719
732
  export {
720
- Et as ARCHIVE_POPUP_COLUMN_STYLE_PREFIXES,
733
+ Nt as ARCHIVE_POPUP_COLUMN_STYLE_PREFIXES,
721
734
  B as ARCHIVE_POPUP_COLUMN_WIDTH_KEYS,
722
- St as ARCHIVE_POPUP_EXTRA_TITLE_KEYS,
723
- Rt as ARCHIVE_POPUP_MAX_COLUMNS,
724
- Q as ARCHIVE_POPUP_MIN_COLUMNS,
725
- to as ARCHIVE_POPUP_PANEL_POSITIONS,
726
- no as ArchivePopup,
727
- oo as applyArchivePopupColumnCountChange,
728
- Ht as getArchivePopupEqualColumnWidths,
735
+ De as ARCHIVE_POPUP_DEFAULT_COLUMNS,
736
+ Mt as ARCHIVE_POPUP_EXTRA_TITLE_KEYS,
737
+ Et as ARCHIVE_POPUP_MAX_COLUMNS,
738
+ St as ARCHIVE_POPUP_MIN_COLUMNS,
739
+ no as ARCHIVE_POPUP_PANEL_POSITIONS,
740
+ ao as ArchivePopup,
741
+ ro as applyArchivePopupColumnCountChange,
742
+ zt as getArchivePopupEqualColumnWidths,
729
743
  z as getArchivePopupRowMedia,
730
- Dt as groupArchiveRows,
731
- zt as resolveArchivePopupColumnWidths
744
+ Vt as groupArchiveRows,
745
+ Bt as resolveArchivePopupColumnWidths
732
746
  };