@coolms/ui-react 0.1.0-alpha.11 → 0.1.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as s, Fragment as x } from "react/jsx-runtime";
2
- import { useId as ee, useState as D, useRef as O, useEffect as G, useCallback as _e, useMemo as Ie, useLayoutEffect as Ae } from "react";
2
+ import { useId as J, useState as D, useRef as Z, useEffect as G, useCallback as _e, useMemo as Ie, useLayoutEffect as Ae } from "react";
3
3
  import { createPortal as ke } from "react-dom";
4
4
  function re(n, l) {
5
5
  const a = { ...n };
@@ -31,7 +31,7 @@ function F({ name: n }) {
31
31
  return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
32
32
  }
33
33
  }
34
- function Q({
34
+ function ee({
35
35
  variant: n = "secondary",
36
36
  busy: l = !1,
37
37
  busyLabel: a,
@@ -39,20 +39,20 @@ function Q({
39
39
  lockedReason: r,
40
40
  icon: m,
41
41
  disabled: o,
42
- className: c,
42
+ className: i,
43
43
  children: u,
44
44
  type: d = "button",
45
45
  title: _,
46
46
  ...h
47
47
  }) {
48
- const i = !!o || l;
48
+ const c = !!o || l;
49
49
  return /* @__PURE__ */ s(
50
50
  "button",
51
51
  {
52
52
  ...h,
53
53
  type: d,
54
- className: C("cms-button", `cms-button--${n}`, l && "is-busy", t && "is-locked", c),
55
- disabled: i,
54
+ className: C("cms-button", `cms-button--${n}`, l && "is-busy", t && "is-locked", i),
55
+ disabled: c,
56
56
  "aria-busy": l || void 0,
57
57
  title: t ? r ?? _ : _,
58
58
  children: [
@@ -83,8 +83,8 @@ function Ee(n, l) {
83
83
  const a = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
84
84
  return a === "" ? void 0 : a;
85
85
  }
86
- function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m, value: o, onChange: c, placeholder: u, type: d = "text", name: _ }) {
87
- const h = ee();
86
+ function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m, value: o, onChange: i, placeholder: u, type: d = "text", name: _ }) {
87
+ const h = J();
88
88
  return /* @__PURE__ */ e(De, { id: h, label: n, help: l, error: a, pinned: m, children: /* @__PURE__ */ e(
89
89
  "input",
90
90
  {
@@ -98,12 +98,12 @@ function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m,
98
98
  readOnly: r || m != null,
99
99
  "aria-invalid": a != null || void 0,
100
100
  "aria-describedby": Ee(h, { help: l, error: a, pinned: m }),
101
- onChange: (i) => c == null ? void 0 : c(i.target.value)
101
+ onChange: (c) => i == null ? void 0 : i(c.target.value)
102
102
  }
103
103
  ) });
104
104
  }
105
- function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, options: o, onChange: c, emptyText: u = "Nothing to choose from yet.", name: d }) {
106
- const _ = ee(), h = o.length === 0;
105
+ function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, options: o, onChange: i, emptyText: u = "Nothing to choose from yet.", name: d }) {
106
+ const _ = J(), h = o.length === 0;
107
107
  return /* @__PURE__ */ e(De, { id: _, label: n, help: h ? u : l, error: a, children: /* @__PURE__ */ e(
108
108
  "select",
109
109
  {
@@ -115,15 +115,15 @@ function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, o
115
115
  "aria-readonly": r || void 0,
116
116
  "aria-invalid": a != null || void 0,
117
117
  "aria-describedby": Ee(_, { help: h ? u : l, error: a }),
118
- onChange: (i) => {
119
- r || c == null || c(i.target.value);
118
+ onChange: (c) => {
119
+ r || i == null || i(c.target.value);
120
120
  },
121
- children: o.map((i) => /* @__PURE__ */ e("option", { value: i.value, disabled: r && i.value !== m, children: i.label }, i.value))
121
+ children: o.map((c) => /* @__PURE__ */ e("option", { value: c.value, disabled: r && c.value !== m, children: c.label }, c.value))
122
122
  }
123
123
  ) });
124
124
  }
125
125
  function fn({ label: n, checked: l, onChange: a, disabled: t, readOnly: r, help: m }) {
126
- const o = ee();
126
+ const o = J();
127
127
  return /* @__PURE__ */ s("div", { className: "cms-toggle-row", children: [
128
128
  /* @__PURE__ */ e(
129
129
  "button",
@@ -147,57 +147,57 @@ function fn({ label: n, checked: l, onChange: a, disabled: t, readOnly: r, help:
147
147
  ] });
148
148
  }
149
149
  const Pe = 150;
150
- function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, children: m, footer: o, closeLabel: c = "Close", initialFocus: u, className: d }) {
151
- const [_, h] = D(n), [i, v] = D(!1), y = O(null), g = O(null), k = ee();
150
+ function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, children: m, footer: o, closeLabel: i = "Close", initialFocus: u, className: d }) {
151
+ const [_, h] = D(n), [c, g] = D(!1), N = Z(null), b = Z(null), w = J();
152
152
  if (G(() => {
153
153
  if (n) {
154
- g.current = document.activeElement, h(!0), v(!1);
154
+ b.current = document.activeElement, h(!0), g(!1);
155
155
  return;
156
156
  }
157
157
  if (!_) return;
158
- v(!0);
159
- const w = window.setTimeout(() => {
158
+ g(!0);
159
+ const k = window.setTimeout(() => {
160
160
  var S, A;
161
- h(!1), v(!1), (A = (S = g.current) == null ? void 0 : S.focus) == null || A.call(S);
161
+ h(!1), g(!1), (A = (S = b.current) == null ? void 0 : S.focus) == null || A.call(S);
162
162
  }, Pe);
163
- return () => window.clearTimeout(w);
163
+ return () => window.clearTimeout(k);
164
164
  }, [n, _]), G(() => {
165
- var w, S;
165
+ var k, S;
166
166
  if (n && _) {
167
167
  const A = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
168
- (S = (u == null ? void 0 : u.current) ?? ((w = y.current) == null ? void 0 : w.querySelector(`.cms-modal__body :is(${A}), .cms-modal__foot :is(${A})`)) ?? y.current) == null || S.focus();
168
+ (S = (u == null ? void 0 : u.current) ?? ((k = N.current) == null ? void 0 : k.querySelector(`.cms-modal__body :is(${A}), .cms-modal__foot :is(${A})`)) ?? N.current) == null || S.focus();
169
169
  }
170
170
  }, [n, _, u]), !_) return null;
171
- const q = () => {
171
+ const H = () => {
172
172
  t ? r == null || r() : a();
173
173
  };
174
174
  return ke(
175
- /* @__PURE__ */ e("div", { className: C("cms-modal-scrim", i && "is-closing"), onMouseDown: (w) => {
176
- w.target === w.currentTarget && q();
175
+ /* @__PURE__ */ e("div", { className: C("cms-modal-scrim", c && "is-closing"), onMouseDown: (k) => {
176
+ k.target === k.currentTarget && H();
177
177
  }, children: /* @__PURE__ */ s(
178
178
  "div",
179
179
  {
180
- ref: y,
181
- className: C("cms-modal", d, i && "is-closing", t && "is-dirty"),
180
+ ref: N,
181
+ className: C("cms-modal", d, c && "is-closing", t && "is-dirty"),
182
182
  role: "dialog",
183
183
  "aria-modal": "true",
184
- "aria-labelledby": k,
184
+ "aria-labelledby": w,
185
185
  tabIndex: -1,
186
- onKeyDown: (w) => {
186
+ onKeyDown: (k) => {
187
187
  var S;
188
- if (w.key === "Escape")
189
- w.stopPropagation(), q();
190
- else if (w.key === "Tab") {
191
- const A = (S = y.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
188
+ if (k.key === "Escape")
189
+ k.stopPropagation(), H();
190
+ else if (k.key === "Tab") {
191
+ const A = (S = N.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
192
192
  if (!A || A.length === 0) return;
193
- const V = A[0], H = A[A.length - 1];
194
- w.shiftKey && document.activeElement === V ? (w.preventDefault(), H.focus()) : !w.shiftKey && document.activeElement === H && (w.preventDefault(), V.focus());
193
+ const U = A[0], R = A[A.length - 1];
194
+ k.shiftKey && document.activeElement === U ? (k.preventDefault(), R.focus()) : !k.shiftKey && document.activeElement === R && (k.preventDefault(), U.focus());
195
195
  }
196
196
  },
197
197
  children: [
198
198
  /* @__PURE__ */ s("header", { className: "cms-modal__head", children: [
199
- /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: k, children: l }),
200
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: q, children: /* @__PURE__ */ e(F, { name: "close" }) })
199
+ /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: w, children: l }),
200
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: H, children: /* @__PURE__ */ e(F, { name: "close" }) })
201
201
  ] }),
202
202
  /* @__PURE__ */ e("div", { className: "cms-modal__body", children: m }),
203
203
  o != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: o }) : null
@@ -207,7 +207,7 @@ function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, chi
207
207
  document.body
208
208
  );
209
209
  }
210
- function _n({ open: n, title: l, message: a, kind: t = "default", confirmLabel: r, cancelLabel: m, closeLabel: o, onConfirm: c, onCancel: u }) {
210
+ function _n({ open: n, title: l, message: a, kind: t = "default", confirmLabel: r, cancelLabel: m, closeLabel: o, onConfirm: i, onCancel: u }) {
211
211
  const d = t === "discard-changes";
212
212
  return /* @__PURE__ */ e(
213
213
  Le,
@@ -217,8 +217,8 @@ function _n({ open: n, title: l, message: a, kind: t = "default", confirmLabel:
217
217
  onClose: u,
218
218
  ...o === void 0 ? {} : { closeLabel: o },
219
219
  footer: /* @__PURE__ */ s(x, { children: [
220
- /* @__PURE__ */ e(Q, { onClick: u, children: m ?? (d ? "Keep editing" : "Cancel") }),
221
- /* @__PURE__ */ e(Q, { variant: t === "default" ? "primary" : "danger", onClick: c, children: r ?? (d ? "Discard changes" : "Confirm") })
220
+ /* @__PURE__ */ e(ee, { onClick: u, children: m ?? (d ? "Keep editing" : "Cancel") }),
221
+ /* @__PURE__ */ e(ee, { variant: t === "default" ? "primary" : "danger", onClick: i, children: r ?? (d ? "Discard changes" : "Confirm") })
222
222
  ] }),
223
223
  children: t !== "default" ? /* @__PURE__ */ s("p", { className: "cms-confirm__warning", children: [
224
224
  /* @__PURE__ */ e(F, { name: "warning" }),
@@ -232,7 +232,7 @@ function bn({ kind: n, message: l, action: a, onDismiss: t, dismissLabel: r = "D
232
232
  return /* @__PURE__ */ s("div", { className: C("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
233
233
  /* @__PURE__ */ e(F, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
234
234
  /* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
235
- a ? /* @__PURE__ */ e(Q, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
235
+ a ? /* @__PURE__ */ e(ee, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
236
236
  t ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r, onClick: t, children: /* @__PURE__ */ e(F, { name: "close" }) }) : null
237
237
  ] });
238
238
  }
@@ -256,7 +256,7 @@ function ze({ message: n, onRetry: l, retryLabel: a = "Try again" }) {
256
256
  return /* @__PURE__ */ s("div", { className: "cms-error-banner", role: "alert", children: [
257
257
  /* @__PURE__ */ e(F, { name: "warning" }),
258
258
  /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
259
- l ? /* @__PURE__ */ e(Q, { onClick: l, children: a }) : null
259
+ l ? /* @__PURE__ */ e(ee, { onClick: l, children: a }) : null
260
260
  ] });
261
261
  }
262
262
  const ye = 300;
@@ -279,8 +279,8 @@ function te({ kind: n, title: l, description: a, action: t, placement: r = "bloc
279
279
  return;
280
280
  }
281
281
  o(!1);
282
- const c = window.setTimeout(() => o(!0), Ke());
283
- return () => window.clearTimeout(c);
282
+ const i = window.setTimeout(() => o(!0), Ke());
283
+ return () => window.clearTimeout(i);
284
284
  }, [n]), /* @__PURE__ */ s(
285
285
  "div",
286
286
  {
@@ -295,7 +295,7 @@ function te({ kind: n, title: l, description: a, action: t, placement: r = "bloc
295
295
  /* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
296
296
  a !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: a }) : null
297
297
  ] }),
298
- t !== void 0 && n !== "denied" ? /* @__PURE__ */ e(Q, { className: "cms-state__action", onClick: t.onAction, children: t.label }) : null
298
+ t !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ee, { className: "cms-state__action", onClick: t.onAction, children: t.label }) : null
299
299
  ]
300
300
  }
301
301
  );
@@ -460,99 +460,99 @@ function Ue(n) {
460
460
  return n.getClientRects().length > 0;
461
461
  }
462
462
  function Nn(n) {
463
- const { name: l, badge: a, closeLabel: t, onClose: r, actions: m = [], moreLabel: o = "More", edit: c, editing: u, siblings: d, bar: _, thumbnails: h, strip: i, onZoom: v, children: y } = n, g = O(null), k = O(null), q = ee(), [w, S] = D(!1), A = O(null);
463
+ const { name: l, badge: a, closeLabel: t, onClose: r, actions: m = [], moreLabel: o = "More", edit: i, editing: u, siblings: d, bar: _, thumbnails: h, strip: c, onZoom: g, children: N } = n, b = Z(null), w = Z(null), H = J(), [k, S] = D(!1), A = Z(null);
464
464
  G(() => {
465
- var U;
466
- const b = document.activeElement, E = document.body.style.overflow;
467
- return document.body.style.overflow = "hidden", (U = k.current) == null || U.focus(), () => {
468
- var Z;
469
- document.body.style.overflow = E, (Z = b == null ? void 0 : b.focus) == null || Z.call(b);
465
+ var W;
466
+ const v = document.activeElement, E = document.body.style.overflow;
467
+ return document.body.style.overflow = "hidden", (W = w.current) == null || W.focus(), () => {
468
+ var V;
469
+ document.body.style.overflow = E, (V = v == null ? void 0 : v.focus) == null || V.call(v);
470
470
  };
471
471
  }, []);
472
- const V = () => {
472
+ const U = () => {
473
473
  u != null && u.dirty ? u.onDirtyClose() : r();
474
- }, H = (b) => {
475
- const E = b.touches.length === 1 ? b.touches[0] : void 0;
476
- A.current = E === void 0 || u !== void 0 || Ve(b.target) ? null : { x: E.clientX, y: E.clientY };
477
- }, ne = (b) => {
474
+ }, R = (v) => {
475
+ const E = v.touches.length === 1 ? v.touches[0] : void 0;
476
+ A.current = E === void 0 || u !== void 0 || Ve(v.target) ? null : { x: E.clientX, y: E.clientY };
477
+ }, ne = (v) => {
478
478
  var L, X;
479
- const E = A.current, U = b.changedTouches[0];
480
- if (A.current = null, E === null || U === void 0) return;
481
- const Z = U.clientX - E.x;
482
- Math.abs(Z) < Oe || Math.abs(Z) < Math.abs(U.clientY - E.y) || (Z > 0 ? (L = d == null ? void 0 : d.onPrevious) == null || L.call(d) : (X = d == null ? void 0 : d.onNext) == null || X.call(d));
479
+ const E = A.current, W = v.changedTouches[0];
480
+ if (A.current = null, E === null || W === void 0) return;
481
+ const V = W.clientX - E.x;
482
+ Math.abs(V) < Oe || Math.abs(V) < Math.abs(W.clientY - E.y) || (V > 0 ? (L = d == null ? void 0 : d.onPrevious) == null || L.call(d) : (X = d == null ? void 0 : d.onNext) == null || X.call(d));
483
483
  };
484
484
  return ke(
485
485
  /* @__PURE__ */ s(
486
486
  "div",
487
487
  {
488
- ref: g,
488
+ ref: b,
489
489
  className: C("cms-viewer", u !== void 0 && "is-editing"),
490
490
  role: "dialog",
491
491
  "aria-modal": "true",
492
- "aria-labelledby": q,
492
+ "aria-labelledby": H,
493
493
  tabIndex: -1,
494
- onKeyDown: (b) => {
495
- var E, U, Z;
496
- if (b.key === "Escape") {
494
+ onKeyDown: (v) => {
495
+ var E, W, V;
496
+ if (v.key === "Escape") {
497
497
  if (u !== void 0) return;
498
- b.stopPropagation(), w ? S(!1) : r();
499
- } else if (b.key === "Tab") {
500
- const L = Array.from(((E = g.current) == null ? void 0 : E.querySelectorAll(Re)) ?? []).filter(Ue);
498
+ v.stopPropagation(), k ? S(!1) : r();
499
+ } else if (v.key === "Tab") {
500
+ const L = Array.from(((E = b.current) == null ? void 0 : E.querySelectorAll(Re)) ?? []).filter(Ue);
501
501
  if (L.length === 0) return;
502
502
  const X = L[0], z = L[L.length - 1];
503
- b.shiftKey && document.activeElement === X ? (b.preventDefault(), z.focus()) : !b.shiftKey && document.activeElement === z && (b.preventDefault(), X.focus());
504
- } else u === void 0 && !Ze(b.target) && !b.ctrlKey && !b.metaKey && !b.altKey && (b.key === "ArrowLeft" ? (U = d == null ? void 0 : d.onPrevious) == null || U.call(d) : b.key === "ArrowRight" ? (Z = d == null ? void 0 : d.onNext) == null || Z.call(d) : b.key === "+" || b.key === "=" ? v == null || v("in") : b.key === "-" ? v == null || v("out") : b.key === "0" && (v == null || v("reset")));
503
+ v.shiftKey && document.activeElement === X ? (v.preventDefault(), z.focus()) : !v.shiftKey && document.activeElement === z && (v.preventDefault(), X.focus());
504
+ } else u === void 0 && !Ze(v.target) && !v.ctrlKey && !v.metaKey && !v.altKey && (v.key === "ArrowLeft" ? (W = d == null ? void 0 : d.onPrevious) == null || W.call(d) : v.key === "ArrowRight" ? (V = d == null ? void 0 : d.onNext) == null || V.call(d) : v.key === "+" || v.key === "=" ? g == null || g("in") : v.key === "-" ? g == null || g("out") : v.key === "0" && (g == null || g("reset")));
505
505
  },
506
506
  children: [
507
507
  d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${d.position}` }) : null,
508
508
  /* @__PURE__ */ s("header", { className: "cms-viewer__top", children: [
509
- /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": t, onClick: V, children: /* @__PURE__ */ e(F, { name: "close" }) }),
509
+ /* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label": t, onClick: U, children: /* @__PURE__ */ e(F, { name: "close" }) }),
510
510
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: a }),
511
- /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: q, title: l, children: l }),
511
+ /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: H, title: l, children: l }),
512
512
  d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: d.position }) : null,
513
513
  /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
514
514
  u !== void 0 ? /* @__PURE__ */ s(x, { children: [
515
515
  /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
516
516
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
517
517
  ] }) : /* @__PURE__ */ s(x, { children: [
518
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: m.map((b) => /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button", onClick: b.onSelect, children: [
519
- b.icon,
520
- b.label
521
- ] }, b.label)) }),
522
- c !== void 0 ? /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": c.label, onClick: c.onEdit, children: [
523
- c.icon,
524
- /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: c.label })
518
+ /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: m.map((v) => /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button", onClick: v.onSelect, children: [
519
+ v.icon,
520
+ v.label
521
+ ] }, v.label)) }),
522
+ i !== void 0 ? /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": i.label, onClick: i.onEdit, children: [
523
+ i.icon,
524
+ /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: i.label })
525
525
  ] }) : null,
526
526
  m.length > 0 ? /* @__PURE__ */ s("span", { className: "cms-viewer__more", children: [
527
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": o, "aria-expanded": w, onClick: () => S((b) => !b), children: /* @__PURE__ */ e(P, { name: "more" }) }),
528
- w ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: m.map((b) => /* @__PURE__ */ s(
527
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": o, "aria-expanded": k, onClick: () => S((v) => !v), children: /* @__PURE__ */ e(P, { name: "more" }) }),
528
+ k ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: m.map((v) => /* @__PURE__ */ s(
529
529
  "button",
530
530
  {
531
531
  type: "button",
532
532
  className: "cms-viewer__button",
533
533
  onClick: () => {
534
- S(!1), b.onSelect();
534
+ S(!1), v.onSelect();
535
535
  },
536
536
  children: [
537
- b.icon,
538
- b.label
537
+ v.icon,
538
+ v.label
539
539
  ]
540
540
  },
541
- b.label
541
+ v.label
542
542
  )) }) : null
543
543
  ] }) : null
544
544
  ] })
545
545
  ] }),
546
546
  /* @__PURE__ */ s("div", { className: "cms-viewer__body", children: [
547
547
  h != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
548
- /* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart: H, onTouchEnd: ne, children: [
549
- y,
548
+ /* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart: R, onTouchEnd: ne, children: [
549
+ N,
550
550
  u === void 0 && (d != null && d.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": d.previousLabel, onClick: d.onPrevious, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
551
551
  u === void 0 && (d != null && d.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": d.nextLabel, onClick: d.onNext, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
552
- u === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (b, E) => /* @__PURE__ */ e("i", { className: E === Math.min(d.index, 6) ? "is-current" : void 0 }, E)) }) : null
552
+ u === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (v, E) => /* @__PURE__ */ e("i", { className: E === Math.min(d.index, 6) ? "is-current" : void 0 }, E)) }) : null
553
553
  ] })
554
554
  ] }),
555
- u === void 0 && i != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: i }) : null,
555
+ u === void 0 && c != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: c }) : null,
556
556
  _ != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: _ }) : null
557
557
  ]
558
558
  }
@@ -569,132 +569,132 @@ const Ne = (n, l) => `${n}
569
569
  ${l}`, je = (n, l) => n === "" ? l : `${n}/${l}`, qe = 48;
570
570
  function yn(n) {
571
571
  var me, ue;
572
- const { open: l, spaces: a, list: t, disabledReason: r, budget: m, formatSize: o, labels: c, onConfirm: u, onCancel: d } = n, [_, h] = D(((me = a[0]) == null ? void 0 : me.id) ?? ""), [i, v] = D(""), [y, g] = D({ status: "loading" }), [k, q] = D(0), [w, S] = D(/* @__PURE__ */ new Map()), [A, V] = D(0), [H, ne] = D(!1), b = O(null), E = ee();
572
+ const { open: l, spaces: a, list: t, disabledReason: r, budget: m, formatSize: o, labels: i, onConfirm: u, onCancel: d } = n, [_, h] = D(((me = a[0]) == null ? void 0 : me.id) ?? ""), [c, g] = D(""), [N, b] = D({ status: "loading" }), [w, H] = D(0), [k, S] = D(/* @__PURE__ */ new Map()), [A, U] = D(0), [R, ne] = D(!1), v = Z(null), E = J();
573
573
  G(() => {
574
574
  var p;
575
- l && (h(((p = a[0]) == null ? void 0 : p.id) ?? ""), v(""), S(/* @__PURE__ */ new Map()), ne(!1));
575
+ l && (h(((p = a[0]) == null ? void 0 : p.id) ?? ""), g(""), S(/* @__PURE__ */ new Map()), ne(!1));
576
576
  }, [l]), G(() => {
577
577
  if (!l || _ === "") return;
578
578
  let p = !0;
579
- return g({ status: "loading" }), V(0), t(_, i).then(
580
- (N) => p && g({ status: "ready", entries: N.entries, next: N.next ?? null, paging: !1 }),
581
- (N) => p && g({ status: N instanceof We ? "denied" : "error" })
579
+ return b({ status: "loading" }), U(0), t(_, c).then(
580
+ (y) => p && b({ status: "ready", entries: y.entries, next: y.next ?? null, paging: !1 }),
581
+ (y) => p && b({ status: y instanceof We ? "denied" : "error" })
582
582
  ), () => {
583
583
  p = !1;
584
584
  };
585
- }, [l, _, i, t, k]);
586
- const U = _e(() => {
587
- if (y.status !== "ready" || y.next === null || y.paging) return;
588
- const p = y.next, N = y.entries;
589
- g({ ...y, paging: !0 }), t(_, i, p).then(
590
- (I) => g({ status: "ready", entries: [...N, ...I.entries], next: I.next ?? null, paging: !1 }),
591
- () => g({ status: "ready", entries: N, next: p, paging: !1 })
585
+ }, [l, _, c, t, w]);
586
+ const W = _e(() => {
587
+ if (N.status !== "ready" || N.next === null || N.paging) return;
588
+ const p = N.next, y = N.entries;
589
+ b({ ...N, paging: !0 }), t(_, c, p).then(
590
+ (I) => b({ status: "ready", entries: [...y, ...I.entries], next: I.next ?? null, paging: !1 }),
591
+ () => b({ status: "ready", entries: y, next: p, paging: !1 })
592
592
  );
593
- }, [y, t, _, i]), Z = _e((p) => {
594
- var N;
595
- return ((N = m == null ? void 0 : m.cost) == null ? void 0 : N.call(m, p)) ?? p.size ?? 0;
596
- }, [m]), L = Ie(() => [...w.values()], [w]), X = L.reduce((p, N) => p + (N.size ?? 0), 0), z = m === void 0 ? null : m.limitBytes - m.usedBytes - L.reduce((p, N) => p + Z(N), 0), J = z !== null && z < 0, ce = (p) => {
593
+ }, [N, t, _, c]), V = _e((p) => {
594
+ var y;
595
+ return ((y = m == null ? void 0 : m.cost) == null ? void 0 : y.call(m, p)) ?? p.size ?? 0;
596
+ }, [m]), L = Ie(() => [...k.values()], [k]), X = L.reduce((p, y) => p + (y.size ?? 0), 0), z = m === void 0 ? null : m.limitBytes - m.usedBytes - L.reduce((p, y) => p + V(y), 0), Q = z !== null && z < 0, ce = (p) => {
597
597
  if (p.kind !== "file") return null;
598
- const N = r == null ? void 0 : r(p);
599
- return N || (z !== null && !w.has(Ne(_, p.id)) && Z(p) > z ? c.overBudget : null);
598
+ const y = r == null ? void 0 : r(p);
599
+ return y || (z !== null && !k.has(Ne(_, p.id)) && V(p) > z ? i.overBudget : null);
600
600
  }, ie = (p) => {
601
- const N = Ne(_, p.id);
602
- !w.has(N) && ce(p) !== null || S((I) => {
601
+ const y = Ne(_, p.id);
602
+ !k.has(y) && ce(p) !== null || S((I) => {
603
603
  const B = new Map(I);
604
- return B.has(N) ? B.delete(N) : B.set(N, { ...p, space: _, path: i }), B;
604
+ return B.has(y) ? B.delete(y) : B.set(y, { ...p, space: _, path: c }), B;
605
605
  });
606
- }, f = (p) => v(je(i, p.name)), M = () => v(i.includes("/") ? i.slice(0, i.lastIndexOf("/")) : ""), R = (p) => S((N) => {
607
- const I = new Map(N);
606
+ }, f = (p) => g(je(c, p.name)), M = () => g(c.includes("/") ? c.slice(0, c.lastIndexOf("/")) : ""), O = (p) => S((y) => {
607
+ const I = new Map(y);
608
608
  return I.delete(p), I;
609
- }), W = y.status === "ready" ? y.entries : [], $ = (p) => {
610
- const N = W[A];
609
+ }), j = N.status === "ready" ? N.entries : [], $ = (p) => {
610
+ const y = j[A];
611
611
  if (p.key === "ArrowDown" || p.key === "ArrowUp" || p.key === "Home" || p.key === "End") {
612
612
  p.preventDefault();
613
- const I = W.length - 1, B = p.key === "Home" ? 0 : p.key === "End" ? I : Math.min(I, Math.max(0, A + (p.key === "ArrowDown" ? 1 : -1)));
614
- V(B), B >= I - 1 && U();
615
- } else p.key === "Enter" && (N == null ? void 0 : N.kind) === "folder" ? (p.preventDefault(), f(N)) : p.key === " " && (N == null ? void 0 : N.kind) === "file" ? (p.preventDefault(), ie(N)) : p.key === "Backspace" && i !== "" && (p.preventDefault(), M());
616
- }, j = i === "" ? [] : i.split("/"), oe = ((ue = a.find((p) => p.id === _)) == null ? void 0 : ue.name) ?? "", de = (p) => `${E}-entry-${String(p)}`;
613
+ const I = j.length - 1, B = p.key === "Home" ? 0 : p.key === "End" ? I : Math.min(I, Math.max(0, A + (p.key === "ArrowDown" ? 1 : -1)));
614
+ U(B), B >= I - 1 && W();
615
+ } else p.key === "Enter" && (y == null ? void 0 : y.kind) === "folder" ? (p.preventDefault(), f(y)) : p.key === " " && (y == null ? void 0 : y.kind) === "file" ? (p.preventDefault(), ie(y)) : p.key === "Backspace" && c !== "" && (p.preventDefault(), M());
616
+ }, q = c === "" ? [] : c.split("/"), oe = ((ue = a.find((p) => p.id === _)) == null ? void 0 : ue.name) ?? "", de = (p) => `${E}-entry-${String(p)}`;
617
617
  return /* @__PURE__ */ s(
618
618
  Le,
619
619
  {
620
620
  open: l,
621
- title: c.title,
621
+ title: i.title,
622
622
  onClose: d,
623
- closeLabel: c.close,
624
- initialFocus: b,
623
+ closeLabel: i.close,
624
+ initialFocus: v,
625
625
  className: "cms-file-picker",
626
626
  footer: /* @__PURE__ */ s("div", { className: "cms-file-picker__foot", children: [
627
627
  /* @__PURE__ */ s("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
628
- L.length > 0 ? /* @__PURE__ */ e("span", { children: c.total(L.length, o(X)) }) : null,
629
- m !== void 0 && z !== null ? /* @__PURE__ */ e("span", { className: C(J && "is-over"), children: J ? c.overBudget : c.left(o(Math.max(0, z)), o(m.limitBytes)) }) : null
628
+ L.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(L.length, o(X)) }) : null,
629
+ m !== void 0 && z !== null ? /* @__PURE__ */ e("span", { className: C(Q && "is-over"), children: Q ? i.overBudget : i.left(o(Math.max(0, z)), o(m.limitBytes)) }) : null
630
630
  ] }),
631
631
  /* @__PURE__ */ s("div", { className: "cms-file-picker__actions", children: [
632
- /* @__PURE__ */ e(Q, { variant: "secondary", onClick: d, children: c.cancel }),
633
- /* @__PURE__ */ e(Q, { variant: "primary", disabled: L.length === 0 || J, onClick: () => u(L), children: c.confirm(L.length) })
632
+ /* @__PURE__ */ e(ee, { variant: "secondary", onClick: d, children: i.cancel }),
633
+ /* @__PURE__ */ e(ee, { variant: "primary", disabled: L.length === 0 || Q, onClick: () => u(L), children: i.confirm(L.length) })
634
634
  ] })
635
635
  ] }),
636
636
  children: [
637
637
  /* @__PURE__ */ s("div", { className: "cms-file-picker__top", children: [
638
638
  a.length > 1 ? /* @__PURE__ */ s("label", { className: "cms-file-picker__space", children: [
639
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: c.space }),
639
+ /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: i.space }),
640
640
  /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: _, onChange: (p) => {
641
- h(p.target.value), v("");
641
+ h(p.target.value), g("");
642
642
  }, children: a.map((p) => /* @__PURE__ */ e("option", { value: p.id, children: p.name }, p.id)) })
643
643
  ] }) : null,
644
- /* @__PURE__ */ s("nav", { className: "cms-file-picker__path", "aria-label": c.path, children: [
645
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c.up, disabled: i === "", onClick: M, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
644
+ /* @__PURE__ */ s("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
645
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: c === "", onClick: M, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
646
646
  /* @__PURE__ */ s("ol", { children: [
647
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": i === "" ? "location" : void 0, onClick: () => v(""), children: oe }) }),
648
- j.map((p, N) => {
649
- const I = j.slice(0, N + 1).join("/");
650
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === i ? "location" : void 0, onClick: () => v(I), children: p }) }, I);
647
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": c === "" ? "location" : void 0, onClick: () => g(""), children: oe }) }),
648
+ q.map((p, y) => {
649
+ const I = q.slice(0, y + 1).join("/");
650
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === c ? "location" : void 0, onClick: () => g(I), children: p }) }, I);
651
651
  })
652
652
  ] })
653
653
  ] }),
654
- L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ne((p) => !p), children: c.selected(L.length) }) : null
654
+ L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": R, onClick: () => ne((p) => !p), children: i.selected(L.length) }) : null
655
655
  ] }),
656
- H && L.length > 0 ? /* @__PURE__ */ s("div", { className: "cms-file-picker__chosen", children: [
657
- /* @__PURE__ */ e("ul", { children: [...w.entries()].map(([p, N]) => /* @__PURE__ */ s("li", { children: [
658
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: N.name }),
659
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c.remove(N.name), onClick: () => R(p), children: /* @__PURE__ */ e(F, { name: "close" }) })
656
+ R && L.length > 0 ? /* @__PURE__ */ s("div", { className: "cms-file-picker__chosen", children: [
657
+ /* @__PURE__ */ e("ul", { children: [...k.entries()].map(([p, y]) => /* @__PURE__ */ s("li", { children: [
658
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: y.name }),
659
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(y.name), onClick: () => O(p), children: /* @__PURE__ */ e(F, { name: "close" }) })
660
660
  ] }, p)) }),
661
- /* @__PURE__ */ e(Q, { variant: "secondary", onClick: () => {
661
+ /* @__PURE__ */ e(ee, { variant: "secondary", onClick: () => {
662
662
  S(/* @__PURE__ */ new Map()), ne(!1);
663
- }, children: c.clear })
663
+ }, children: i.clear })
664
664
  ] }) : null,
665
665
  /* @__PURE__ */ s("div", { className: "cms-file-picker__list", onScroll: (p) => {
666
- const N = p.currentTarget;
667
- N.scrollTop + N.clientHeight >= N.scrollHeight - qe && U();
666
+ const y = p.currentTarget;
667
+ y.scrollTop + y.clientHeight >= y.scrollHeight - qe && W();
668
668
  }, children: [
669
- y.status === "loading" ? /* @__PURE__ */ e(te, { kind: "loading", title: c.loading, placement: "block" }) : null,
670
- y.status === "error" ? /* @__PURE__ */ e(te, { kind: "error", title: c.error, placement: "block", action: { label: c.retry, onAction: () => q((p) => p + 1) } }) : null,
671
- y.status === "denied" ? /* @__PURE__ */ e(te, { kind: "denied", title: c.denied, placement: "block" }) : null,
672
- y.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(te, { kind: "empty", title: c.empty, placement: "block" }) : null,
669
+ N.status === "loading" ? /* @__PURE__ */ e(te, { kind: "loading", title: i.loading, placement: "block" }) : null,
670
+ N.status === "error" ? /* @__PURE__ */ e(te, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => H((p) => p + 1) } }) : null,
671
+ N.status === "denied" ? /* @__PURE__ */ e(te, { kind: "denied", title: i.denied, placement: "block" }) : null,
672
+ N.status === "ready" && j.length === 0 ? /* @__PURE__ */ e(te, { kind: "empty", title: i.empty, placement: "block" }) : null,
673
673
  /* @__PURE__ */ s(
674
674
  "div",
675
675
  {
676
- ref: b,
676
+ ref: v,
677
677
  role: "listbox",
678
678
  "aria-multiselectable": "true",
679
- "aria-label": c.files,
680
- "aria-activedescendant": W.length > 0 ? de(A) : void 0,
679
+ "aria-label": i.files,
680
+ "aria-activedescendant": j.length > 0 ? de(A) : void 0,
681
681
  tabIndex: 0,
682
682
  className: "cms-file-picker__entries",
683
- hidden: y.status !== "ready" || W.length === 0,
683
+ hidden: N.status !== "ready" || j.length === 0,
684
684
  onKeyDown: $,
685
685
  children: [
686
- W.map((p, N) => {
687
- const I = p.kind === "file" && w.has(Ne(_, p.id)), B = ce(p);
686
+ j.map((p, y) => {
687
+ const I = p.kind === "file" && k.has(Ne(_, p.id)), B = ce(p);
688
688
  return /* @__PURE__ */ s(
689
689
  "div",
690
690
  {
691
- id: de(N),
691
+ id: de(y),
692
692
  role: "option",
693
693
  "aria-selected": p.kind === "file" ? I : void 0,
694
694
  "aria-disabled": B !== null || void 0,
695
- className: C("cms-file-picker__entry", N === A && "is-active", I && "is-ticked", B !== null && "is-disabled"),
695
+ className: C("cms-file-picker__entry", y === A && "is-active", I && "is-ticked", B !== null && "is-disabled"),
696
696
  onClick: () => {
697
- V(N), p.kind === "folder" ? f(p) : ie(p);
697
+ U(y), p.kind === "folder" ? f(p) : ie(p);
698
698
  },
699
699
  children: [
700
700
  /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
@@ -709,7 +709,7 @@ function yn(n) {
709
709
  p.id
710
710
  );
711
711
  }),
712
- y.status === "ready" && y.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(te, { kind: "loading", title: c.loading, placement: "inline" }) }) : null
712
+ N.status === "ready" && N.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(te, { kind: "loading", title: i.loading, placement: "inline" }) }) : null
713
713
  ]
714
714
  }
715
715
  )
@@ -745,21 +745,21 @@ function wn({ title: n, scope: l, actions: a, backLink: t }) {
745
745
  ] });
746
746
  }
747
747
  function kn({ tabs: n, active: l, onSelect: a, label: t }) {
748
- const r = O([]), m = (o, c) => {
748
+ const r = Z([]), m = (o, i) => {
749
749
  var h;
750
- const u = n.length - 1, d = o.key === "ArrowRight" ? c === u ? 0 : c + 1 : o.key === "ArrowLeft" ? c === 0 ? u : c - 1 : o.key === "Home" ? 0 : o.key === "End" ? u : null;
750
+ const u = n.length - 1, d = o.key === "ArrowRight" ? i === u ? 0 : i + 1 : o.key === "ArrowLeft" ? i === 0 ? u : i - 1 : o.key === "Home" ? 0 : o.key === "End" ? u : null;
751
751
  if (d === null) return;
752
752
  o.preventDefault();
753
753
  const _ = n[d];
754
754
  _ && (a(_.id), (h = r.current[d]) == null || h.focus());
755
755
  };
756
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: n.map((o, c) => {
756
+ return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: n.map((o, i) => {
757
757
  const u = o.id === l;
758
758
  return /* @__PURE__ */ s(
759
759
  "button",
760
760
  {
761
761
  ref: (d) => {
762
- r.current[c] = d;
762
+ r.current[i] = d;
763
763
  },
764
764
  type: "button",
765
765
  role: "tab",
@@ -767,7 +767,7 @@ function kn({ tabs: n, active: l, onSelect: a, label: t }) {
767
767
  "aria-selected": u,
768
768
  tabIndex: u ? 0 : -1,
769
769
  onClick: () => a(o.id),
770
- onKeyDown: (d) => m(d, c),
770
+ onKeyDown: (d) => m(d, i),
771
771
  children: [
772
772
  o.label,
773
773
  o.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: o.count }) : null
@@ -809,7 +809,7 @@ function Ye({ count: n, label: l, max: a = 99 }) {
809
809
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
810
810
  ] });
811
811
  }
812
- function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m, search: o, account: c, children: u, railLabel: d = "Sections" }) {
812
+ function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m, search: o, account: i, children: u, railLabel: d = "Sections" }) {
813
813
  return /* @__PURE__ */ s("div", { className: "cms-shell", children: [
814
814
  /* @__PURE__ */ s("nav", { className: "cms-shell__rail", "aria-label": d, children: [
815
815
  /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
@@ -822,8 +822,8 @@ function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m,
822
822
  className: C("cms-shell__item", h && "is-active"),
823
823
  "aria-current": h ? "page" : void 0,
824
824
  title: _.label,
825
- onClick: (i) => {
826
- r && (i.preventDefault(), r(_.id));
825
+ onClick: (c) => {
826
+ r && (c.preventDefault(), r(_.id));
827
827
  },
828
828
  children: [
829
829
  /* @__PURE__ */ s("span", { className: "cms-shell__icon", children: [
@@ -840,7 +840,7 @@ function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m,
840
840
  /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
841
841
  m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: m }) : null,
842
842
  o != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: o }) : null,
843
- c != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: c }) : null
843
+ i != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: i }) : null
844
844
  ] }),
845
845
  /* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
846
846
  ] });
@@ -872,21 +872,21 @@ function Mn({ label: n, placeholder: l, value: a, onChange: t, onSearch: r }) {
872
872
  );
873
873
  }
874
874
  function Cn({ options: n, value: l, onChange: a, label: t }) {
875
- const r = O([]), m = (o, c) => {
875
+ const r = Z([]), m = (o, i) => {
876
876
  var h;
877
- const u = n.length - 1, d = o.key === "ArrowRight" || o.key === "ArrowDown" ? c === u ? 0 : c + 1 : o.key === "ArrowLeft" || o.key === "ArrowUp" ? c === 0 ? u : c - 1 : null;
877
+ const u = n.length - 1, d = o.key === "ArrowRight" || o.key === "ArrowDown" ? i === u ? 0 : i + 1 : o.key === "ArrowLeft" || o.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
878
878
  if (d === null) return;
879
879
  o.preventDefault();
880
880
  const _ = n[d];
881
881
  _ && (a(_.id), (h = r.current[d]) == null || h.focus());
882
882
  };
883
- return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: n.map((o, c) => {
883
+ return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: n.map((o, i) => {
884
884
  const u = o.id === l;
885
885
  return /* @__PURE__ */ s(
886
886
  "button",
887
887
  {
888
888
  ref: (d) => {
889
- r.current[c] = d;
889
+ r.current[i] = d;
890
890
  },
891
891
  type: "button",
892
892
  role: "radio",
@@ -894,7 +894,7 @@ function Cn({ options: n, value: l, onChange: a, label: t }) {
894
894
  tabIndex: u ? 0 : -1,
895
895
  className: C("cms-chip", u && "is-on"),
896
896
  onClick: () => a(o.id),
897
- onKeyDown: (d) => m(d, c),
897
+ onKeyDown: (d) => m(d, i),
898
898
  children: [
899
899
  u ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
900
900
  o.label
@@ -915,7 +915,7 @@ function Sn({ panes: n, active: l, back: a }) {
915
915
  ] }, r.label)) });
916
916
  }
917
917
  const Je = { attachment: "Has an attachment", unread: "Unread" };
918
- function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment: m, selected: o, onOpen: c, labels: u }) {
918
+ function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment: m, selected: o, onOpen: i, labels: u }) {
919
919
  const d = re(Je, u);
920
920
  return /* @__PURE__ */ s(
921
921
  "button",
@@ -923,7 +923,7 @@ function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment
923
923
  type: "button",
924
924
  className: C("cms-mail-row", r && "is-unread", o && "is-selected"),
925
925
  "aria-current": o ? "true" : void 0,
926
- onClick: c,
926
+ onClick: i,
927
927
  children: [
928
928
  /* @__PURE__ */ e(ve, { name: n, size: 40 }),
929
929
  /* @__PURE__ */ s("span", { className: "cms-mail-row__body", children: [
@@ -954,13 +954,13 @@ function Dn({ direction: n, children: l, time: a, read: t, readLabel: r = "Read"
954
954
  ] })
955
955
  ] });
956
956
  }
957
- function En({ label: n, value: l, onChange: a, onSend: t, onAttach: r, placeholder: m, variant: o = "chat", sendLabel: c = "Send", attachLabel: u = "Attach a file", leading: d, canSend: _ }) {
958
- const h = ee(), i = _ ?? l.trim() !== "", v = (g) => {
959
- g.preventDefault(), i && t();
960
- }, y = r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: r, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
961
- return /* @__PURE__ */ s("form", { className: C("cms-composer", `cms-composer--${o}`), onSubmit: v, children: [
957
+ function En({ label: n, value: l, onChange: a, onSend: t, onAttach: r, placeholder: m, variant: o = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: d, canSend: _ }) {
958
+ const h = J(), c = _ ?? l.trim() !== "", g = (b) => {
959
+ b.preventDefault(), c && t();
960
+ }, N = r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: r, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
961
+ return /* @__PURE__ */ s("form", { className: C("cms-composer", `cms-composer--${o}`), onSubmit: g, children: [
962
962
  /* @__PURE__ */ e("label", { htmlFor: h, className: o === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
963
- o === "chat" ? y : null,
963
+ o === "chat" ? N : null,
964
964
  /* @__PURE__ */ e(
965
965
  "textarea",
966
966
  {
@@ -969,16 +969,16 @@ function En({ label: n, value: l, onChange: a, onSend: t, onAttach: r, placehold
969
969
  rows: o === "reply" ? 3 : 1,
970
970
  placeholder: m,
971
971
  value: l,
972
- onChange: (g) => a(g.target.value),
973
- onKeyDown: (g) => {
974
- g.nativeEvent.isComposing || g.keyCode === 229 || o === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), i && t());
972
+ onChange: (b) => a(b.target.value),
973
+ onKeyDown: (b) => {
974
+ b.nativeEvent.isComposing || b.keyCode === 229 || o === "chat" && b.key === "Enter" && !b.shiftKey && (b.preventDefault(), c && t());
975
975
  }
976
976
  }
977
977
  ),
978
978
  o === "reply" && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: d }) : null,
979
- o === "reply" ? y : null,
980
- o === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !i, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ s("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !i, children: [
981
- c,
979
+ o === "reply" ? N : null,
980
+ o === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !c, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ s("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !c, children: [
981
+ i,
982
982
  " ",
983
983
  /* @__PURE__ */ e(P, { name: "send", size: 18 })
984
984
  ] })
@@ -1032,41 +1032,41 @@ function ae({ icon: n, label: l, onClick: a, tone: t = "plain", pressed: r }) {
1032
1032
  }
1033
1033
  );
1034
1034
  }
1035
- function $n({ name: n, duration: l, connection: a, you: t, muted: r, speaker: m, onToggleMute: o, onToggleSpeaker: c, onAddPerson: u, onChat: d, onHangUp: _, labels: h }) {
1036
- const i = re(xe, h);
1037
- return /* @__PURE__ */ s("section", { className: "cms-call-panel", "aria-label": i.callWith(n), children: [
1035
+ function $n({ name: n, duration: l, connection: a, you: t, muted: r, speaker: m, onToggleMute: o, onToggleSpeaker: i, onAddPerson: u, onChat: d, onHangUp: _, labels: h }) {
1036
+ const c = re(xe, h);
1037
+ return /* @__PURE__ */ s("section", { className: "cms-call-panel", "aria-label": c.callWith(n), children: [
1038
1038
  /* @__PURE__ */ s("div", { className: "cms-call-panel__head", children: [
1039
1039
  /* @__PURE__ */ e(ve, { name: n, size: 64 }),
1040
1040
  /* @__PURE__ */ s("div", { className: "cms-call-panel__who", children: [
1041
1041
  /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1042
- /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": i.callTime(l), children: l })
1042
+ /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": c.callTime(l), children: l })
1043
1043
  ] }),
1044
- /* @__PURE__ */ e("span", { className: C("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? i.goodConnection : i.poorConnection })
1044
+ /* @__PURE__ */ e("span", { className: C("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? c.goodConnection : c.poorConnection })
1045
1045
  ] }),
1046
1046
  /* @__PURE__ */ s("div", { className: "cms-call-panel__you", children: [
1047
1047
  /* @__PURE__ */ e(ve, { name: t.name, size: 36 }),
1048
- /* @__PURE__ */ e("span", { children: i.you }),
1049
- t.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": i.speaking }) : null
1048
+ /* @__PURE__ */ e("span", { children: c.you }),
1049
+ t.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": c.speaking }) : null
1050
1050
  ] }),
1051
1051
  /* @__PURE__ */ s("div", { className: "cms-call-panel__controls", children: [
1052
- /* @__PURE__ */ e(ae, { icon: "mic", label: r ? i.unmute : i.mute, pressed: r, onClick: o }),
1053
- /* @__PURE__ */ e(ae, { icon: "speaker", label: i.speaker, pressed: m, onClick: c }),
1054
- u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: i.addPerson, onClick: u }) : null,
1055
- d ? /* @__PURE__ */ e(ae, { icon: "chat", label: i.chat, onClick: d }) : null,
1056
- /* @__PURE__ */ e(ae, { icon: "phone-off", label: i.hangUp, tone: "hang-up", onClick: _ })
1052
+ /* @__PURE__ */ e(ae, { icon: "mic", label: r ? c.unmute : c.mute, pressed: r, onClick: o }),
1053
+ /* @__PURE__ */ e(ae, { icon: "speaker", label: c.speaker, pressed: m, onClick: i }),
1054
+ u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: c.addPerson, onClick: u }) : null,
1055
+ d ? /* @__PURE__ */ e(ae, { icon: "chat", label: c.chat, onClick: d }) : null,
1056
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: c.hangUp, tone: "hang-up", onClick: _ })
1057
1057
  ] })
1058
1058
  ] });
1059
1059
  }
1060
1060
  function Tn({ name: n, duration: l, muted: a, onToggleMute: t, onReturn: r, onHangUp: m, labels: o }) {
1061
- const c = re(xe, o);
1062
- return /* @__PURE__ */ s("section", { className: "cms-call-bar", "aria-label": c.callWith(n), children: [
1061
+ const i = re(xe, o);
1062
+ return /* @__PURE__ */ s("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
1063
1063
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1064
- /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: c.onCallWith(n) }),
1064
+ /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: i.onCallWith(n) }),
1065
1065
  /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
1066
1066
  /* @__PURE__ */ s("span", { className: "cms-call-bar__actions", children: [
1067
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? c.unmute : c.mute, "aria-pressed": a, onClick: t, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1068
- /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: r, children: c.returnToCall }),
1069
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": c.hangUp, onClick: m, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
1067
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? i.unmute : i.mute, "aria-pressed": a, onClick: t, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1068
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: r, children: i.returnToCall }),
1069
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": i.hangUp, onClick: m, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
1070
1070
  ] })
1071
1071
  ] });
1072
1072
  }
@@ -1102,16 +1102,16 @@ const Qe = {
1102
1102
  create: "Create an account"
1103
1103
  };
1104
1104
  function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, busy: m, labels: o }) {
1105
- const c = re(Qe, o), u = ee(), [d, _] = D(""), [h, i] = D(""), [v, y] = D(!1);
1106
- return /* @__PURE__ */ s("form", { className: "cms-signin-form", onSubmit: (k) => {
1107
- k.preventDefault(), l(d, h);
1105
+ const i = re(Qe, o), u = J(), [d, _] = D(""), [h, c] = D(""), [g, N] = D(!1);
1106
+ return /* @__PURE__ */ s("form", { className: "cms-signin-form", onSubmit: (w) => {
1107
+ w.preventDefault(), l(d, h);
1108
1108
  }, "aria-describedby": r ? `${u}-error` : void 0, children: [
1109
- /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: c.title }),
1109
+ /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
1110
1110
  /* @__PURE__ */ s("p", { className: "cms-signin-form__server", children: [
1111
1111
  /* @__PURE__ */ e(P, { name: "server", size: 18 }),
1112
1112
  n
1113
1113
  ] }),
1114
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: c.identifier }),
1114
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: i.identifier }),
1115
1115
  /* @__PURE__ */ e(
1116
1116
  "input",
1117
1117
  {
@@ -1119,114 +1119,114 @@ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, bu
1119
1119
  className: "cms-signin-form__input",
1120
1120
  type: "text",
1121
1121
  autoComplete: "username",
1122
- placeholder: c.identifierPlaceholder,
1122
+ placeholder: i.identifierPlaceholder,
1123
1123
  value: d,
1124
- onChange: (k) => _(k.target.value),
1124
+ onChange: (w) => _(w.target.value),
1125
1125
  required: !0
1126
1126
  }
1127
1127
  ),
1128
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: c.password }),
1128
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: i.password }),
1129
1129
  /* @__PURE__ */ s("span", { className: "cms-signin-form__password", children: [
1130
1130
  /* @__PURE__ */ e(
1131
1131
  "input",
1132
1132
  {
1133
1133
  id: `${u}-password`,
1134
1134
  className: "cms-signin-form__input",
1135
- type: v ? "text" : "password",
1135
+ type: g ? "text" : "password",
1136
1136
  autoComplete: "current-password",
1137
1137
  value: h,
1138
- onChange: (k) => i(k.target.value),
1138
+ onChange: (w) => c(w.target.value),
1139
1139
  required: !0
1140
1140
  }
1141
1141
  ),
1142
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": v, onClick: () => y((k) => !k), children: v ? c.hide : c.show })
1142
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => N((w) => !w), children: g ? i.hide : i.show })
1143
1143
  ] }),
1144
- a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: c.forgot }) : null,
1144
+ a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: i.forgot }) : null,
1145
1145
  r ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: r }) : null,
1146
- /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children: c.submit }),
1146
+ /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children: i.submit }),
1147
1147
  t ? /* @__PURE__ */ s(x, { children: [
1148
- /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: c.newHere }) }),
1149
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children: c.create })
1148
+ /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: i.newHere }) }),
1149
+ /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children: i.create })
1150
1150
  ] }) : null
1151
1151
  ] });
1152
1152
  }
1153
- function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading", emptyTitle: m = "Nothing here yet", emptyHint: o, selected: c, onOpen: u, onRowMenu: d }) {
1154
- const _ = O([]);
1153
+ function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading", emptyTitle: m = "Nothing here yet", emptyHint: o, selected: i, onOpen: u, onRowMenu: d }) {
1154
+ const _ = Z([]);
1155
1155
  if (a != null) return /* @__PURE__ */ e(ze, { message: a, onRetry: t });
1156
1156
  if (l === null) return /* @__PURE__ */ e(Be, { what: r, layout: "block" });
1157
1157
  if (l.length === 0) return /* @__PURE__ */ e(Fe, { title: m, hint: o });
1158
- const h = (i, v, y) => {
1159
- var g;
1160
- if (i.key === "ArrowDown" || i.key === "ArrowUp")
1161
- i.preventDefault(), (g = _.current[Math.min(l.length - 1, Math.max(0, v + (i.key === "ArrowDown" ? 1 : -1)))]) == null || g.focus();
1162
- else if (i.key === "Enter")
1163
- u == null || u(y);
1164
- else if ((i.key === "ContextMenu" || i.shiftKey && i.key === "F10") && d) {
1165
- i.preventDefault();
1166
- const k = i.currentTarget.getBoundingClientRect();
1167
- d(y, { x: k.left + 16, y: k.bottom });
1158
+ const h = (c, g, N) => {
1159
+ var b;
1160
+ if (c.key === "ArrowDown" || c.key === "ArrowUp")
1161
+ c.preventDefault(), (b = _.current[Math.min(l.length - 1, Math.max(0, g + (c.key === "ArrowDown" ? 1 : -1)))]) == null || b.focus();
1162
+ else if (c.key === "Enter")
1163
+ u == null || u(N);
1164
+ else if ((c.key === "ContextMenu" || c.shiftKey && c.key === "F10") && d) {
1165
+ c.preventDefault();
1166
+ const w = c.currentTarget.getBoundingClientRect();
1167
+ d(N, { x: w.left + 16, y: w.bottom });
1168
1168
  }
1169
1169
  };
1170
- return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((i, v) => {
1171
- const y = i.id === c;
1170
+ return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((c, g) => {
1171
+ const N = c.id === i;
1172
1172
  return /* @__PURE__ */ s(
1173
1173
  "li",
1174
1174
  {
1175
- ref: (g) => {
1176
- _.current[v] = g;
1175
+ ref: (b) => {
1176
+ _.current[g] = b;
1177
1177
  },
1178
1178
  role: "option",
1179
- "aria-selected": y,
1180
- tabIndex: y || c == null && v === 0 ? 0 : -1,
1181
- className: C("cms-list__row", y && "is-selected"),
1182
- onClick: () => u == null ? void 0 : u(i.id),
1183
- onKeyDown: (g) => h(g, v, i.id),
1184
- onContextMenu: d ? (g) => {
1185
- g.preventDefault(), d(i.id, { x: g.clientX, y: g.clientY });
1179
+ "aria-selected": N,
1180
+ tabIndex: N || i == null && g === 0 ? 0 : -1,
1181
+ className: C("cms-list__row", N && "is-selected"),
1182
+ onClick: () => u == null ? void 0 : u(c.id),
1183
+ onKeyDown: (b) => h(b, g, c.id),
1184
+ onContextMenu: d ? (b) => {
1185
+ b.preventDefault(), d(c.id, { x: b.clientX, y: b.clientY });
1186
1186
  } : void 0,
1187
1187
  children: [
1188
- i.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: i.lead }) : null,
1188
+ c.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: c.lead }) : null,
1189
1189
  /* @__PURE__ */ s("span", { className: "cms-list__text", children: [
1190
- /* @__PURE__ */ e("span", { className: "cms-list__primary", children: i.primary }),
1191
- i.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: i.secondary }) : null
1190
+ /* @__PURE__ */ e("span", { className: "cms-list__primary", children: c.primary }),
1191
+ c.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: c.secondary }) : null
1192
1192
  ] }),
1193
- i.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: i.meta }) : null
1193
+ c.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: c.meta }) : null
1194
1194
  ]
1195
1195
  },
1196
- i.id
1196
+ c.id
1197
1197
  );
1198
1198
  }) });
1199
1199
  }
1200
1200
  function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "first" }) {
1201
- const m = O(null), o = O(null), [c, u] = D(n), d = l.filter((h) => h.offer.offered);
1201
+ const m = Z(null), o = Z(null), [i, u] = D(n), d = l.filter((h) => h.offer.offered);
1202
1202
  if (Ae(() => {
1203
1203
  if (!n) return;
1204
- const h = m.current, i = (h == null ? void 0 : h.offsetWidth) ?? 0, v = (h == null ? void 0 : h.offsetHeight) ?? 0;
1205
- u({ x: Math.max(0, Math.min(n.x, window.innerWidth - i)), y: Math.max(0, Math.min(n.y, window.innerHeight - v)) });
1204
+ const h = m.current, c = (h == null ? void 0 : h.offsetWidth) ?? 0, g = (h == null ? void 0 : h.offsetHeight) ?? 0;
1205
+ u({ x: Math.max(0, Math.min(n.x, window.innerWidth - c)), y: Math.max(0, Math.min(n.y, window.innerHeight - g)) });
1206
1206
  }, [n]), G(() => {
1207
- var v, y;
1207
+ var g, N;
1208
1208
  if (!n) return;
1209
1209
  o.current = document.activeElement;
1210
- const h = Array.from(((v = m.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1211
- (y = r === "last" ? h[h.length - 1] : h[0]) == null || y.focus();
1212
- const i = (g) => {
1213
- var k;
1214
- (k = m.current) != null && k.contains(g.target) || a();
1210
+ const h = Array.from(((g = m.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1211
+ (N = r === "last" ? h[h.length - 1] : h[0]) == null || N.focus();
1212
+ const c = (b) => {
1213
+ var w;
1214
+ (w = m.current) != null && w.contains(b.target) || a();
1215
1215
  };
1216
- return document.addEventListener("mousedown", i), () => {
1217
- var g, k;
1218
- document.removeEventListener("mousedown", i), (k = (g = o.current) == null ? void 0 : g.focus) == null || k.call(g);
1216
+ return document.addEventListener("mousedown", c), () => {
1217
+ var b, w;
1218
+ document.removeEventListener("mousedown", c), (w = (b = o.current) == null ? void 0 : b.focus) == null || w.call(b);
1219
1219
  };
1220
1220
  }, [n, a, r]), !n || d.length === 0) return null;
1221
1221
  const _ = (h) => {
1222
- var y, g;
1223
- const i = Array.from(((y = m.current) == null ? void 0 : y.querySelectorAll('[role="menuitem"]')) ?? []), v = i.indexOf(document.activeElement);
1222
+ var N, b;
1223
+ const c = Array.from(((N = m.current) == null ? void 0 : N.querySelectorAll('[role="menuitem"]')) ?? []), g = c.indexOf(document.activeElement);
1224
1224
  if (h.key === "Escape" || h.key === "Tab")
1225
1225
  h.preventDefault(), a();
1226
1226
  else if (h.key === "ArrowDown" || h.key === "ArrowUp") {
1227
1227
  h.preventDefault();
1228
- const k = h.key === "ArrowDown" ? 1 : -1;
1229
- (g = i[(v + k + i.length) % i.length]) == null || g.focus();
1228
+ const w = h.key === "ArrowDown" ? 1 : -1;
1229
+ (b = c[(g + w + c.length) % c.length]) == null || b.focus();
1230
1230
  }
1231
1231
  };
1232
1232
  return ke(
@@ -1237,29 +1237,29 @@ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "fir
1237
1237
  className: "cms-menu",
1238
1238
  role: "menu",
1239
1239
  "aria-label": t,
1240
- style: { left: (c ?? n).x, top: (c ?? n).y },
1240
+ style: { left: (i ?? n).x, top: (i ?? n).y },
1241
1241
  onKeyDown: _,
1242
1242
  onContextMenu: (h) => h.preventDefault(),
1243
1243
  children: d.map((h) => {
1244
- const i = h.offer.refusal !== void 0;
1244
+ const c = h.offer.refusal !== void 0;
1245
1245
  return /* @__PURE__ */ s(
1246
1246
  "div",
1247
1247
  {
1248
1248
  role: "menuitem",
1249
1249
  tabIndex: -1,
1250
- "aria-disabled": i || void 0,
1251
- title: i ? h.offer.refusal : void 0,
1252
- className: C("cms-menu__item", h.danger && "is-danger", h.offer.locked && "is-locked", i && "is-refused"),
1250
+ "aria-disabled": c || void 0,
1251
+ title: c ? h.offer.refusal : void 0,
1252
+ className: C("cms-menu__item", h.danger && "is-danger", h.offer.locked && "is-locked", c && "is-refused"),
1253
1253
  onClick: () => {
1254
- i || (a(), h.onSelect());
1254
+ c || (a(), h.onSelect());
1255
1255
  },
1256
- onKeyDown: (v) => {
1257
- (v.key === "Enter" || v.key === " ") && !i && (v.preventDefault(), a(), h.onSelect());
1256
+ onKeyDown: (g) => {
1257
+ (g.key === "Enter" || g.key === " ") && !c && (g.preventDefault(), a(), h.onSelect());
1258
1258
  },
1259
1259
  children: [
1260
1260
  h.offer.locked ? /* @__PURE__ */ e(F, { name: "lock" }) : null,
1261
1261
  /* @__PURE__ */ e("span", { className: "cms-menu__label", children: h.label }),
1262
- i ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: h.offer.refusal }) : null
1262
+ c ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: h.offer.refusal }) : null
1263
1263
  ]
1264
1264
  },
1265
1265
  h.id
@@ -1282,16 +1282,16 @@ function ln(n) {
1282
1282
  return [...l.entries()].sort(([a], [t]) => a - t).map(([, a]) => a);
1283
1283
  }
1284
1284
  function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leading: m }) {
1285
- const o = O(null), c = O(null), [u, d] = D(Ce), [_, h] = D(null), [i, v] = D("first"), [y, g] = D(null), [k, q] = D(null), w = nn(l), S = ln(l), A = w.flat(), V = A.filter((f) => f.overflow === 0), H = A.filter((f) => f.overflow !== 0), ne = JSON.stringify([l.map((f) => [f.id, f.label, f.icon, f.group, f.overflow ?? null]), t ?? "", m !== void 0]), b = _e(() => {
1286
- const f = o.current, M = c.current;
1285
+ const o = Z(null), i = Z(null), [u, d] = D(Ce), [_, h] = D(null), [c, g] = D("first"), [N, b] = D(null), [w, H] = D(null), k = nn(l), S = ln(l), A = k.flat(), U = A.filter((f) => f.overflow === 0), R = A.filter((f) => f.overflow !== 0), ne = JSON.stringify([l.map((f) => [f.id, f.label, f.icon, f.group, f.overflow ?? null]), t ?? "", m !== void 0]), v = _e(() => {
1286
+ const f = o.current, M = i.current;
1287
1287
  if (f === null || M === null) return;
1288
- const R = getComputedStyle(f), W = parseFloat(R.columnGap || "0") || 0, $ = f.clientWidth - (parseFloat(R.paddingLeft) || 0) - (parseFloat(R.paddingRight) || 0), j = (T) => {
1288
+ const O = getComputedStyle(f), j = parseFloat(O.columnGap || "0") || 0, $ = f.clientWidth - (parseFloat(O.paddingLeft) || 0) - (parseFloat(O.paddingRight) || 0), q = (T) => {
1289
1289
  var K;
1290
1290
  return ((K = M.querySelector(T)) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
1291
- }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), ue = (T, K) => j(`[data-measure="${K ? "full" : "icon"}"][data-measure-action="${CSS.escape(T)}"]`), p = (T, K) => {
1292
- const Y = /* @__PURE__ */ new Set([...V.map((le) => le.id), ...K]), se = w.map((le) => le.filter((pe) => !Y.has(pe.id))).filter((le) => le.length > 0), he = se.flat(), Te = he.length + (se.length - 1) + (Y.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1293
- return oe + he.reduce((le, pe) => le + ue(pe.id, !T.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) + W * Math.max(0, Te - 1);
1294
- }, N = H.filter((T) => !S.some((K) => K.includes(T.id))).map((T) => T.id), I = [...S, ...[...N].reverse().map((T) => [T])];
1291
+ }, oe = q('[data-measure="leading"]'), de = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), ue = (T, K) => q(`[data-measure="${K ? "full" : "icon"}"][data-measure-action="${CSS.escape(T)}"]`), p = (T, K) => {
1292
+ const Y = /* @__PURE__ */ new Set([...U.map((le) => le.id), ...K]), se = k.map((le) => le.filter((pe) => !Y.has(pe.id))).filter((le) => le.length > 0), he = se.flat(), Te = he.length + (se.length - 1) + (Y.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1293
+ return oe + he.reduce((le, pe) => le + ue(pe.id, !T.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) + j * Math.max(0, Te - 1);
1294
+ }, y = R.filter((T) => !S.some((K) => K.includes(T.id))).map((T) => T.id), I = [...S, ...[...y].reverse().map((T) => [T])];
1295
1295
  let B = null;
1296
1296
  if (p(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) B = Ce;
1297
1297
  else {
@@ -1305,9 +1305,9 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
1305
1305
  }
1306
1306
  }
1307
1307
  if (B === null) {
1308
- const T = new Set(H.map((Y) => Y.id)), K = /* @__PURE__ */ new Set();
1308
+ const T = new Set(R.map((Y) => Y.id)), K = /* @__PURE__ */ new Set();
1309
1309
  for (const Y of S) {
1310
- for (const se of Y) H.some((he) => he.id === se) && K.add(se);
1310
+ for (const se of Y) R.some((he) => he.id === se) && K.add(se);
1311
1311
  if (K.size >= 2 && p(T, K) <= $) break;
1312
1312
  }
1313
1313
  B = { bare: T, hidden: K.size >= 2 ? K : /* @__PURE__ */ new Set() };
@@ -1315,23 +1315,23 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
1315
1315
  const ge = B;
1316
1316
  d((T) => Se(T.bare, ge.bare) && Se(T.hidden, ge.hidden) ? T : ge);
1317
1317
  }, [ne]);
1318
- Ae(b, [b]), G(() => {
1318
+ Ae(v, [v]), G(() => {
1319
1319
  const f = o.current;
1320
1320
  if (f === null || typeof ResizeObserver > "u") return;
1321
- const M = new ResizeObserver(() => b());
1321
+ const M = new ResizeObserver(() => v());
1322
1322
  return M.observe(f), () => M.disconnect();
1323
- }, [b]);
1324
- const E = /* @__PURE__ */ new Set([...V.map((f) => f.id), ...u.hidden]), Z = w.map((f) => f.filter((M) => !E.has(M.id))).filter((f) => f.length > 0).flat(), L = [
1325
- ...V,
1323
+ }, [v]);
1324
+ const E = /* @__PURE__ */ new Set([...U.map((f) => f.id), ...u.hidden]), V = k.map((f) => f.filter((M) => !E.has(M.id))).filter((f) => f.length > 0).flat(), L = [
1325
+ ...U,
1326
1326
  ...S.flat().map((f) => A.find((M) => M.id === f)).filter((f) => f !== void 0 && u.hidden.has(f.id))
1327
- ], X = new Set(H.filter((f) => !S.some((M) => M.includes(f.id))).map((f) => f.id)), z = [...Z.map((f) => f.id), ...L.length > 0 ? ["more"] : []], J = y !== null && z.includes(y) ? y : z[0] ?? null, ce = (f) => {
1328
- var $, j;
1329
- const M = z.indexOf(J ?? "");
1330
- let R = null;
1331
- if (f.key === "ArrowRight" ? R = Math.min(z.length - 1, M + 1) : f.key === "ArrowLeft" ? R = Math.max(0, M - 1) : f.key === "Home" ? R = 0 : f.key === "End" ? R = z.length - 1 : f.key === "Escape" && q(J), R === null) return;
1327
+ ], X = new Set(R.filter((f) => !S.some((M) => M.includes(f.id))).map((f) => f.id)), z = [...V.map((f) => f.id), ...L.length > 0 ? ["more"] : []], Q = N !== null && z.includes(N) ? N : z[0] ?? null, ce = (f) => {
1328
+ var $, q;
1329
+ const M = z.indexOf(Q ?? "");
1330
+ let O = null;
1331
+ if (f.key === "ArrowRight" ? O = Math.min(z.length - 1, M + 1) : f.key === "ArrowLeft" ? O = Math.max(0, M - 1) : f.key === "Home" ? O = 0 : f.key === "End" ? O = z.length - 1 : f.key === "Escape" && H(Q), O === null) return;
1332
1332
  f.preventDefault();
1333
- const W = z[R] ?? null;
1334
- g(W), (j = ($ = o.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1333
+ const j = z[O] ?? null;
1334
+ b(j), (q = ($ = o.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(j ?? "")}"]`)) == null || q.focus();
1335
1335
  }, ie = L.map((f) => ({
1336
1336
  id: f.id,
1337
1337
  label: /* @__PURE__ */ s(x, { children: [
@@ -1352,28 +1352,28 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
1352
1352
  "aria-label": n,
1353
1353
  className: C(
1354
1354
  "cms-pane-toolbar",
1355
- H.length > 0 && u.bare.size >= H.length && "cms-pane-toolbar--labels-hidden",
1356
- u.bare.size > 0 && u.bare.size < H.length && "cms-pane-toolbar--labels-partly-hidden"
1355
+ R.length > 0 && u.bare.size >= R.length && "cms-pane-toolbar--labels-hidden",
1356
+ u.bare.size > 0 && u.bare.size < R.length && "cms-pane-toolbar--labels-partly-hidden"
1357
1357
  ),
1358
1358
  onKeyDown: ce,
1359
1359
  children: [
1360
1360
  m !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: m }) : null,
1361
- w.map((f, M) => {
1362
- const R = f.filter(($) => !E.has($.id)), W = w.slice(0, M).some(($) => $.some((j) => !E.has(j.id)));
1361
+ k.map((f, M) => {
1362
+ const O = f.filter(($) => !E.has($.id)), j = k.slice(0, M).some(($) => $.some((q) => !E.has(q.id)));
1363
1363
  return /* @__PURE__ */ s("div", { className: "cms-pane-toolbar__group-wrap", children: [
1364
- R.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1365
- /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: R.length === 0, children: f.map(($) => /* @__PURE__ */ e(
1364
+ O.length > 0 && j ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1365
+ /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: O.length === 0, children: f.map(($) => /* @__PURE__ */ e(
1366
1366
  an,
1367
1367
  {
1368
1368
  action: $,
1369
1369
  labels: !u.bare.has($.id),
1370
1370
  overflowed: E.has($.id),
1371
1371
  pinned: X.has($.id),
1372
- tabbable: J === $.id,
1373
- tipOff: k === $.id,
1372
+ tabbable: Q === $.id,
1373
+ tipOff: w === $.id,
1374
1374
  onChoose: () => a($.id),
1375
1375
  onFocus: () => {
1376
- g($.id), q(null);
1376
+ b($.id), H(null);
1377
1377
  }
1378
1378
  },
1379
1379
  $.id
@@ -1390,25 +1390,25 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
1390
1390
  title: r,
1391
1391
  "aria-haspopup": "menu",
1392
1392
  "aria-expanded": _ !== null,
1393
- tabIndex: J === "more" ? 0 : -1,
1394
- onFocus: () => g("more"),
1393
+ tabIndex: Q === "more" ? 0 : -1,
1394
+ onFocus: () => b("more"),
1395
1395
  onClick: (f) => {
1396
1396
  const M = f.currentTarget.getBoundingClientRect();
1397
- v("first"), h(_ === null ? { x: M.left, y: M.bottom } : null);
1397
+ g("first"), h(_ === null ? { x: M.left, y: M.bottom } : null);
1398
1398
  },
1399
1399
  onKeyDown: (f) => {
1400
1400
  if (f.key === "ArrowDown" || f.key === "ArrowUp") {
1401
1401
  f.preventDefault(), f.stopPropagation();
1402
1402
  const M = f.currentTarget.getBoundingClientRect();
1403
- v(f.key === "ArrowUp" ? "last" : "first"), h({ x: M.left, y: M.bottom });
1403
+ g(f.key === "ArrowUp" ? "last" : "first"), h({ x: M.left, y: M.bottom });
1404
1404
  }
1405
1405
  },
1406
1406
  children: /* @__PURE__ */ e(P, { name: "more" })
1407
1407
  }
1408
1408
  ) : null,
1409
1409
  t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: t, children: t }) : null,
1410
- /* @__PURE__ */ e(en, { at: _, items: ie, onClose: () => h(null), label: r, focus: i }),
1411
- /* @__PURE__ */ s("div", { ref: c, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1410
+ /* @__PURE__ */ e(en, { at: _, items: ie, onClose: () => h(null), label: r, focus: c }),
1411
+ /* @__PURE__ */ s("div", { ref: i, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1412
1412
  m !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: m }) : null,
1413
1413
  /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
1414
1414
  /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
@@ -1424,17 +1424,17 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
1424
1424
  }
1425
1425
  );
1426
1426
  }
1427
- function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOff: m, onChoose: o, onFocus: c }) {
1427
+ function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOff: m, onChoose: o, onFocus: i }) {
1428
1428
  const [u, d] = D(!1);
1429
1429
  G(() => {
1430
1430
  if (!n.busy) {
1431
1431
  d(!1);
1432
1432
  return;
1433
1433
  }
1434
- const v = setTimeout(() => d(!0), ye);
1435
- return () => clearTimeout(v);
1434
+ const H = setTimeout(() => d(!0), ye);
1435
+ return () => clearTimeout(H);
1436
1436
  }, [n.busy]);
1437
- const _ = be(n.icon) === null, h = l || _, i = n.disabled && n.reason ? n.reason : h ? null : n.label;
1437
+ const _ = be(n.icon) === null, h = l || _, c = n.disabled && n.reason ? n.reason : null, g = c ?? (h ? null : n.label), N = J(), [b, w] = D(!1);
1438
1438
  return /* @__PURE__ */ s(
1439
1439
  "button",
1440
1440
  {
@@ -1448,15 +1448,21 @@ function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOf
1448
1448
  "aria-label": n.label,
1449
1449
  "aria-disabled": n.disabled || void 0,
1450
1450
  "aria-busy": n.busy || void 0,
1451
+ ...c === null ? {} : { "aria-describedby": N },
1452
+ ...b && c !== null ? { "data-reason-shown": "" } : {},
1451
1453
  tabIndex: r ? 0 : -1,
1452
- onFocus: c,
1454
+ onFocus: i,
1455
+ onBlur: () => w(!1),
1456
+ onKeyDown: (H) => {
1457
+ H.key === "Escape" && w(!1);
1458
+ },
1453
1459
  onClick: () => {
1454
- !n.disabled && !n.busy && o();
1460
+ c !== null ? w(!0) : !n.disabled && !n.busy && o();
1455
1461
  },
1456
1462
  children: [
1457
1463
  u ? /* @__PURE__ */ e(F, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
1458
1464
  h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1459
- i !== null && !m ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", children: i }) : null
1465
+ c !== null || g !== null && !m ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: N, children: g }) : null
1460
1466
  ]
1461
1467
  }
1462
1468
  );
@@ -1503,11 +1509,11 @@ function Hn() {
1503
1509
  window.dispatchEvent(new Event(we));
1504
1510
  }
1505
1511
  function Rn(n) {
1506
- const [l, a] = D(void 0), [t, r] = D(void 0), [m, o] = D(!0), c = O(n);
1507
- c.current = n;
1508
- const u = O(0), d = _e(() => {
1512
+ const [l, a] = D(void 0), [t, r] = D(void 0), [m, o] = D(!0), i = Z(n);
1513
+ i.current = n;
1514
+ const u = Z(0), d = _e(() => {
1509
1515
  const _ = ++u.current;
1510
- o(!0), c.current().then(
1516
+ o(!0), i.current().then(
1511
1517
  (h) => {
1512
1518
  _ === u.current && (a(h), r(void 0), o(!1));
1513
1519
  },
@@ -1544,7 +1550,7 @@ export {
1544
1550
  ve as Avatar,
1545
1551
  Me as BOOTSTRAP_ICONS,
1546
1552
  Ye as Badge,
1547
- Q as Button,
1553
+ ee as Button,
1548
1554
  xe as CALL_LABELS,
1549
1555
  cn as CLIENT_UPDATE_REQUIRED,
1550
1556
  Tn as CallBar,