@coolms/ui-react 0.1.0-alpha.16 → 0.1.0-alpha.17

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 d, Fragment as S } from "react/jsx-runtime";
2
- import { useId as q, useState as A, useRef as U, useEffect as Y, useCallback as be, useMemo as Pe, useLayoutEffect as ke } from "react";
2
+ import { useId as q, useState as D, useRef as R, useEffect as J, useCallback as be, useMemo as Pe, useLayoutEffect as ke } from "react";
3
3
  import { createPortal as xe } from "react-dom";
4
4
  function re(n, l) {
5
5
  const t = { ...n };
@@ -9,7 +9,7 @@ function re(n, l) {
9
9
  }
10
10
  return t;
11
11
  }
12
- function D(...n) {
12
+ function T(...n) {
13
13
  return n.filter(Boolean).join(" ");
14
14
  }
15
15
  function z({ name: n }) {
@@ -41,7 +41,7 @@ function ne({
41
41
  disabled: r,
42
42
  className: i,
43
43
  children: u,
44
- type: p = "button",
44
+ type: b = "button",
45
45
  title: c,
46
46
  ...h
47
47
  }) {
@@ -50,8 +50,8 @@ function ne({
50
50
  "button",
51
51
  {
52
52
  ...h,
53
- type: p,
54
- className: D("cms-button", `cms-button--${n}`, l && "is-busy", o && "is-locked", i),
53
+ type: b,
54
+ className: T("cms-button", `cms-button--${n}`, l && "is-busy", o && "is-locked", i),
55
55
  disabled: a,
56
56
  "aria-busy": l || void 0,
57
57
  title: o ? m ?? c : c,
@@ -67,7 +67,7 @@ function ne({
67
67
  );
68
68
  }
69
69
  function Ce({ id: n, label: l, help: t, error: o, pinned: m, children: s }) {
70
- return /* @__PURE__ */ d("div", { className: D("cms-field", o != null && "is-invalid"), children: [
70
+ return /* @__PURE__ */ d("div", { className: T("cms-field", o != null && "is-invalid"), children: [
71
71
  /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
72
72
  s,
73
73
  m != null ? /* @__PURE__ */ d("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
@@ -85,9 +85,9 @@ function Me(n, l) {
85
85
  }
86
86
  const Fe = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Be = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
87
  function Ke(n, l, t) {
88
- const o = (s, r, i, u = 0, p = 0, c = 0) => {
89
- const h = new Date(Date.UTC(s, r - 1, i, u, p, c));
90
- return h.setUTCFullYear(s), h.getUTCFullYear() === s && h.getUTCMonth() === r - 1 && h.getUTCDate() === i && h.getUTCHours() === u && h.getUTCMinutes() === p && h.getUTCSeconds() === c ? h : null;
88
+ const o = (s, r, i, u = 0, b = 0, c = 0) => {
89
+ const h = new Date(Date.UTC(s, r - 1, i, u, b, c));
90
+ return h.setUTCFullYear(s), h.getUTCFullYear() === s && h.getUTCMonth() === r - 1 && h.getUTCDate() === i && h.getUTCHours() === u && h.getUTCMinutes() === b && h.getUTCSeconds() === c ? h : null;
91
91
  }, m = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
92
92
  try {
93
93
  if (n === "time") {
@@ -112,16 +112,16 @@ function Ke(n, l, t) {
112
112
  return l;
113
113
  }
114
114
  const He = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
- function yn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, type: p = "text", name: c, locale: h, min: a, max: g, step: f, minLength: v, maxLength: N, required: k }) {
116
- const x = q(), M = m === !0 || s != null, C = M && He.has(p), H = p === "number" && (f === "any" || typeof f == "number" && !Number.isInteger(f));
115
+ function yn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, type: b = "text", name: c, locale: h, min: a, max: g, step: p, minLength: v, maxLength: N, required: k }) {
116
+ const x = q(), M = m === !0 || s != null, C = M && He.has(b), U = b === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
117
117
  return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
118
118
  "input",
119
119
  {
120
120
  id: x,
121
121
  name: c,
122
- type: C ? "text" : p,
122
+ type: C ? "text" : b,
123
123
  className: "cms-input",
124
- value: C ? Ke(p, r, h) : r,
124
+ value: C ? Ke(b, r, h) : r,
125
125
  ...C ? { "data-value": r } : {},
126
126
  lang: h,
127
127
  placeholder: u,
@@ -131,17 +131,17 @@ function yn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
131
131
  "aria-required": k || void 0,
132
132
  min: C ? void 0 : a,
133
133
  max: C ? void 0 : g,
134
- step: C ? void 0 : f,
134
+ step: C ? void 0 : p,
135
135
  minLength: v,
136
136
  maxLength: N,
137
- inputMode: p === "number" ? H ? "decimal" : "numeric" : void 0,
137
+ inputMode: b === "number" ? U ? "decimal" : "numeric" : void 0,
138
138
  "aria-invalid": t != null || void 0,
139
139
  "aria-describedby": Me(x, { help: l, error: t, pinned: s }),
140
- onChange: (O) => i == null ? void 0 : i(O.target.value)
140
+ onChange: (K) => i == null ? void 0 : i(K.target.value)
141
141
  }
142
142
  ) });
143
143
  }
144
- function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, rows: p = 4, name: c, locale: h, minLength: a, maxLength: g, required: f }) {
144
+ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, rows: b = 4, name: c, locale: h, minLength: a, maxLength: g, required: p }) {
145
145
  const v = q();
146
146
  return /* @__PURE__ */ e(Ce, { id: v, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
147
147
  "textarea",
@@ -149,14 +149,14 @@ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
149
149
  id: v,
150
150
  name: c,
151
151
  className: "cms-input cms-textarea",
152
- rows: p,
152
+ rows: b,
153
153
  value: r,
154
154
  lang: h,
155
155
  placeholder: u,
156
156
  disabled: o,
157
157
  readOnly: m === !0 || s != null,
158
- required: f,
159
- "aria-required": f || void 0,
158
+ required: p,
159
+ "aria-required": p || void 0,
160
160
  minLength: a,
161
161
  maxLength: g,
162
162
  "aria-invalid": t != null || void 0,
@@ -165,13 +165,13 @@ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
165
165
  }
166
166
  ) });
167
167
  }
168
- function kn({ label: n, help: l, error: t, disabled: o, readOnly: m, value: s, options: r, onChange: i, emptyText: u = "Nothing to choose from yet.", name: p }) {
168
+ function kn({ label: n, help: l, error: t, disabled: o, readOnly: m, value: s, options: r, onChange: i, emptyText: u = "Nothing to choose from yet.", name: b }) {
169
169
  const c = q(), h = r.length === 0;
170
170
  return /* @__PURE__ */ e(Ce, { id: c, label: n, help: h ? u : l, error: t, children: /* @__PURE__ */ e(
171
171
  "select",
172
172
  {
173
173
  id: c,
174
- name: p,
174
+ name: b,
175
175
  className: "cms-input cms-select",
176
176
  value: s,
177
177
  disabled: o || h,
@@ -194,7 +194,7 @@ function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help:
194
194
  id: r,
195
195
  type: "button",
196
196
  role: "switch",
197
- className: D("cms-toggle", l && "is-on"),
197
+ className: T("cms-toggle", l && "is-on"),
198
198
  "aria-checked": l,
199
199
  "aria-readonly": m || void 0,
200
200
  "aria-describedby": s != null ? `${r}-help` : void 0,
@@ -210,9 +210,9 @@ function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help:
210
210
  ] });
211
211
  }
212
212
  const Oe = 150;
213
- function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, children: s, footer: r, closeLabel: i = "Close", initialFocus: u, className: p }) {
214
- const [c, h] = A(n), [a, g] = A(!1), f = U(null), v = U(null), N = q();
215
- if (Y(() => {
213
+ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, children: s, footer: r, closeLabel: i = "Close", initialFocus: u, className: b }) {
214
+ const [c, h] = D(n), [a, g] = D(!1), p = R(null), v = R(null), N = q();
215
+ if (J(() => {
216
216
  if (n) {
217
217
  v.current = document.activeElement, h(!0), g(!1);
218
218
  return;
@@ -224,24 +224,24 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
224
224
  h(!1), g(!1), (C = (M = v.current) == null ? void 0 : M.focus) == null || C.call(M);
225
225
  }, Oe);
226
226
  return () => window.clearTimeout(x);
227
- }, [n, c]), Y(() => {
227
+ }, [n, c]), J(() => {
228
228
  var x, M;
229
229
  if (n && c) {
230
230
  const C = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
231
- (M = (u == null ? void 0 : u.current) ?? ((x = f.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${C}), .cms-modal__foot :is(${C})`)) ?? f.current) == null || M.focus();
231
+ (M = (u == null ? void 0 : u.current) ?? ((x = p.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${C}), .cms-modal__foot :is(${C})`)) ?? p.current) == null || M.focus();
232
232
  }
233
233
  }, [n, c, u]), !c) return null;
234
234
  const k = () => {
235
235
  o ? m == null || m() : t();
236
236
  };
237
237
  return xe(
238
- /* @__PURE__ */ e("div", { className: D("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
238
+ /* @__PURE__ */ e("div", { className: T("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
239
239
  x.target === x.currentTarget && k();
240
240
  }, children: /* @__PURE__ */ d(
241
241
  "div",
242
242
  {
243
- ref: f,
244
- className: D("cms-modal", p, a && "is-closing", o && "is-dirty"),
243
+ ref: p,
244
+ className: T("cms-modal", b, a && "is-closing", o && "is-dirty"),
245
245
  role: "dialog",
246
246
  "aria-modal": "true",
247
247
  "aria-labelledby": N,
@@ -251,10 +251,10 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
251
251
  if (x.key === "Escape")
252
252
  x.stopPropagation(), k();
253
253
  else if (x.key === "Tab") {
254
- const C = (M = f.current) == null ? void 0 : M.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
254
+ const C = (M = p.current) == null ? void 0 : M.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
255
255
  if (!C || C.length === 0) return;
256
- const H = C[0], O = C[C.length - 1];
257
- x.shiftKey && document.activeElement === H ? (x.preventDefault(), O.focus()) : !x.shiftKey && document.activeElement === O && (x.preventDefault(), H.focus());
256
+ const U = C[0], K = C[C.length - 1];
257
+ x.shiftKey && document.activeElement === U ? (x.preventDefault(), K.focus()) : !x.shiftKey && document.activeElement === K && (x.preventDefault(), U.focus());
258
258
  }
259
259
  },
260
260
  children: [
@@ -271,7 +271,7 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
271
271
  );
272
272
  }
273
273
  function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel: m, cancelLabel: s, closeLabel: r, onConfirm: i, onCancel: u }) {
274
- const p = o === "discard-changes";
274
+ const b = o === "discard-changes";
275
275
  return /* @__PURE__ */ e(
276
276
  Le,
277
277
  {
@@ -280,8 +280,8 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
280
280
  onClose: u,
281
281
  ...r === void 0 ? {} : { closeLabel: r },
282
282
  footer: /* @__PURE__ */ d(S, { children: [
283
- /* @__PURE__ */ e(ne, { onClick: u, children: s ?? (p ? "Keep editing" : "Cancel") }),
284
- /* @__PURE__ */ e(ne, { variant: o === "default" ? "primary" : "danger", onClick: i, children: m ?? (p ? "Discard changes" : "Confirm") })
283
+ /* @__PURE__ */ e(ne, { onClick: u, children: s ?? (b ? "Keep editing" : "Cancel") }),
284
+ /* @__PURE__ */ e(ne, { variant: o === "default" ? "primary" : "danger", onClick: i, children: m ?? (b ? "Discard changes" : "Confirm") })
285
285
  ] }),
286
286
  children: o !== "default" ? /* @__PURE__ */ d("p", { className: "cms-confirm__warning", children: [
287
287
  /* @__PURE__ */ e(z, { name: "warning" }),
@@ -292,7 +292,7 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
292
292
  );
293
293
  }
294
294
  function Mn({ kind: n, message: l, action: t, onDismiss: o, dismissLabel: m = "Dismiss" }) {
295
- return /* @__PURE__ */ d("div", { className: D("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
295
+ return /* @__PURE__ */ d("div", { className: T("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
296
296
  /* @__PURE__ */ e(z, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
297
297
  /* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
298
298
  t ? /* @__PURE__ */ e(ne, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
@@ -303,19 +303,19 @@ function Sn({ children: n }) {
303
303
  return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
304
304
  }
305
305
  function Ue({ what: n, layout: l = "inline" }) {
306
- return /* @__PURE__ */ d("div", { className: D("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
306
+ return /* @__PURE__ */ d("div", { className: T("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
307
307
  /* @__PURE__ */ e(z, { name: "spinner" }),
308
308
  /* @__PURE__ */ e("span", { children: n })
309
309
  ] });
310
310
  }
311
- function ze({ title: n, hint: l, action: t }) {
311
+ function Re({ title: n, hint: l, action: t }) {
312
312
  return /* @__PURE__ */ d("div", { className: "cms-empty", children: [
313
313
  /* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
314
314
  l != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: l }) : null,
315
315
  t != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: t }) : null
316
316
  ] });
317
317
  }
318
- function Re({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
318
+ function ze({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
319
  return /* @__PURE__ */ d("div", { className: "cms-error-banner", role: "alert", children: [
320
320
  /* @__PURE__ */ e(z, { name: "warning" }),
321
321
  /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
@@ -335,8 +335,8 @@ function Ve() {
335
335
  ] });
336
336
  }
337
337
  function ee({ kind: n, title: l, description: t, action: o, placement: m = "block" }) {
338
- const [s, r] = A(n !== "loading");
339
- return Y(() => {
338
+ const [s, r] = D(n !== "loading");
339
+ return J(() => {
340
340
  if (n !== "loading") {
341
341
  r(!0);
342
342
  return;
@@ -347,7 +347,7 @@ function ee({ kind: n, title: l, description: t, action: o, placement: m = "bloc
347
347
  }, [n]), /* @__PURE__ */ d(
348
348
  "div",
349
349
  {
350
- className: D("cms-state", `cms-state--${n}`, `cms-state--${m}`, !s && "is-waiting"),
350
+ className: T("cms-state", `cms-state--${n}`, `cms-state--${m}`, !s && "is-waiting"),
351
351
  role: "status",
352
352
  "aria-live": "polite",
353
353
  "data-kind": n,
@@ -368,6 +368,18 @@ const $e = {
368
368
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
369
369
  /* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
370
370
  ] }),
371
+ // The envelope with its flap open above it: a message read, or the message itself again.
372
+ "mail-open": /* @__PURE__ */ d(S, { children: [
373
+ /* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
374
+ /* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
375
+ /* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
376
+ ] }),
377
+ // A clipboard: copy what is shown.
378
+ copy: /* @__PURE__ */ d(S, { children: [
379
+ /* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
380
+ /* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
381
+ /* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
382
+ ] }),
371
383
  chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
372
384
  phone: /* @__PURE__ */ e("path", { d: "M5 3h3l2 5-2.5 1.5a11 11 0 0 0 7 7L16 14l5 2v3a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2Z" }),
373
385
  calendar: /* @__PURE__ */ d(S, { children: [
@@ -496,7 +508,7 @@ const An = Object.keys($e), Ae = {
496
508
  "reply-all": "reply",
497
509
  forward: "forward",
498
510
  envelope: "mail",
499
- "envelope-open": "mail",
511
+ "envelope-open": "mail-open",
500
512
  star: "star",
501
513
  "star-fill": "star",
502
514
  "folder-symlink": "folder",
@@ -507,6 +519,7 @@ const An = Object.keys($e), Ae = {
507
519
  download: "download",
508
520
  printer: "print",
509
521
  "file-earmark-code": "file-code",
522
+ clipboard: "copy",
510
523
  "three-dots": "more"
511
524
  };
512
525
  function _e(n) {
@@ -523,8 +536,8 @@ function Ge(n) {
523
536
  return n.getClientRects().length > 0;
524
537
  }
525
538
  function Dn(n) {
526
- const { name: l, badge: t, closeLabel: o, onClose: m, actions: s = [], moreLabel: r = "More", edit: i, editing: u, state: p, siblings: c, bar: h, thumbnails: a, strip: g, onZoom: f, children: v } = n, N = U(null), k = U(null), x = q(), [M, C] = A(!1), H = U(null);
527
- Y(() => {
539
+ const { name: l, badge: t, closeLabel: o, onClose: m, actions: s = [], moreLabel: r = "More", edit: i, editing: u, state: b, siblings: c, bar: h, thumbnails: a, strip: g, onZoom: p, children: v } = n, N = R(null), k = R(null), x = q(), [M, C] = D(!1), U = R(null);
540
+ J(() => {
528
541
  var V;
529
542
  const y = document.activeElement, F = document.body.style.overflow;
530
543
  return document.body.style.overflow = "hidden", (V = k.current) == null || V.focus(), () => {
@@ -532,15 +545,15 @@ function Dn(n) {
532
545
  document.body.style.overflow = F, (E = y == null ? void 0 : y.focus) == null || E.call(y);
533
546
  };
534
547
  }, []);
535
- const O = () => {
548
+ const K = () => {
536
549
  u != null && u.dirty ? u.onDirtyClose() : m();
537
550
  }, le = (y) => {
538
551
  const F = y.touches.length === 1 ? y.touches[0] : void 0;
539
- H.current = F === void 0 || u !== void 0 || Xe(y.target) ? null : { x: F.clientX, y: F.clientY };
540
- }, J = (y) => {
552
+ U.current = F === void 0 || u !== void 0 || Xe(y.target) ? null : { x: F.clientX, y: F.clientY };
553
+ }, Q = (y) => {
541
554
  var X, B;
542
- const F = H.current, V = y.changedTouches[0];
543
- if (H.current = null, F === null || V === void 0) return;
555
+ const F = U.current, V = y.changedTouches[0];
556
+ if (U.current = null, F === null || V === void 0) return;
544
557
  const E = V.clientX - F.x;
545
558
  Math.abs(E) < je || Math.abs(E) < Math.abs(V.clientY - F.y) || (E > 0 ? (X = c == null ? void 0 : c.onPrevious) == null || X.call(c) : (B = c == null ? void 0 : c.onNext) == null || B.call(c));
546
559
  };
@@ -549,7 +562,7 @@ function Dn(n) {
549
562
  "div",
550
563
  {
551
564
  ref: N,
552
- className: D("cms-viewer", u !== void 0 && "is-editing"),
565
+ className: T("cms-viewer", u !== void 0 && "is-editing"),
553
566
  role: "dialog",
554
567
  "aria-modal": "true",
555
568
  "aria-labelledby": x,
@@ -564,12 +577,12 @@ function Dn(n) {
564
577
  if (X.length === 0) return;
565
578
  const B = X[0], G = X[X.length - 1];
566
579
  y.shiftKey && document.activeElement === B ? (y.preventDefault(), G.focus()) : !y.shiftKey && document.activeElement === G && (y.preventDefault(), B.focus());
567
- } else u === void 0 && !qe(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V = c == null ? void 0 : c.onPrevious) == null || V.call(c) : y.key === "ArrowRight" ? (E = c == null ? void 0 : c.onNext) == null || E.call(c) : y.key === "+" || y.key === "=" ? f == null || f("in") : y.key === "-" ? f == null || f("out") : y.key === "0" && (f == null || f("reset")));
580
+ } else u === void 0 && !qe(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V = c == null ? void 0 : c.onPrevious) == null || V.call(c) : y.key === "ArrowRight" ? (E = c == null ? void 0 : c.onNext) == null || E.call(c) : y.key === "+" || y.key === "=" ? p == null || p("in") : y.key === "-" ? p == null || p("out") : y.key === "0" && (p == null || p("reset")));
568
581
  },
569
582
  children: [
570
583
  c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${c.position}` }) : null,
571
584
  /* @__PURE__ */ d("header", { className: "cms-viewer__top", children: [
572
- /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": o, onClick: O, children: /* @__PURE__ */ e(z, { name: "close" }) }),
585
+ /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": o, onClick: K, children: /* @__PURE__ */ e(z, { name: "close" }) }),
573
586
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
574
587
  /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
575
588
  c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: c.position }) : null,
@@ -608,13 +621,13 @@ function Dn(n) {
608
621
  ] }),
609
622
  /* @__PURE__ */ d("div", { className: "cms-viewer__body", children: [
610
623
  a != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: a }) : null,
611
- /* @__PURE__ */ d("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: J, children: [
624
+ /* @__PURE__ */ d("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: Q, children: [
612
625
  (u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ d("div", { className: "cms-viewer__conflict", role: "alert", children: [
613
626
  /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
614
627
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
615
628
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
616
629
  ] }) : null,
617
- p === void 0 ? v : /* @__PURE__ */ e(Ye, { state: p }),
630
+ b === void 0 ? v : /* @__PURE__ */ e(Ye, { state: b }),
618
631
  u === void 0 && (c != null && c.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": c.previousLabel, title: c.previousLabel, onClick: c.onPrevious, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
619
632
  u === void 0 && (c != null && c.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": c.nextLabel, title: c.nextLabel, onClick: c.onNext, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
620
633
  u === void 0 && c !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(c.total, 7) }, (y, F) => /* @__PURE__ */ e("i", { className: F === Math.min(c.index, 6) ? "is-current" : void 0 }, F)) }) : null
@@ -665,67 +678,67 @@ const Ne = (n, l) => `${n}
665
678
  ${l}`, Qe = (n, l) => n === "" ? l : `${n}/${l}`, en = 48;
666
679
  function Tn(n) {
667
680
  var me, ue;
668
- const { open: l, spaces: t, list: o, disabledReason: m, budget: s, formatSize: r, labels: i, onConfirm: u, onCancel: p } = n, [c, h] = A(((me = t[0]) == null ? void 0 : me.id) ?? ""), [a, g] = A(""), [f, v] = A({ status: "loading" }), [N, k] = A(0), [x, M] = A(/* @__PURE__ */ new Map()), [C, H] = A(0), [O, le] = A(!1), J = U(null), y = q();
669
- Y(() => {
670
- var b;
671
- l && (h(((b = t[0]) == null ? void 0 : b.id) ?? ""), g(""), M(/* @__PURE__ */ new Map()), le(!1));
672
- }, [l]), Y(() => {
681
+ const { open: l, spaces: t, list: o, disabledReason: m, budget: s, formatSize: r, labels: i, onConfirm: u, onCancel: b } = n, [c, h] = D(((me = t[0]) == null ? void 0 : me.id) ?? ""), [a, g] = D(""), [p, v] = D({ status: "loading" }), [N, k] = D(0), [x, M] = D(/* @__PURE__ */ new Map()), [C, U] = D(0), [K, le] = D(!1), Q = R(null), y = q();
682
+ J(() => {
683
+ var f;
684
+ l && (h(((f = t[0]) == null ? void 0 : f.id) ?? ""), g(""), M(/* @__PURE__ */ new Map()), le(!1));
685
+ }, [l]), J(() => {
673
686
  if (!l || c === "") return;
674
- let b = !0;
675
- return v({ status: "loading" }), H(0), o(c, a).then(
676
- (w) => b && v({ status: "ready", entries: w.entries, next: w.next ?? null, paging: !1 }),
677
- (w) => b && v({ status: w instanceof Je ? "denied" : "error" })
687
+ let f = !0;
688
+ return v({ status: "loading" }), U(0), o(c, a).then(
689
+ (w) => f && v({ status: "ready", entries: w.entries, next: w.next ?? null, paging: !1 }),
690
+ (w) => f && v({ status: w instanceof Je ? "denied" : "error" })
678
691
  ), () => {
679
- b = !1;
692
+ f = !1;
680
693
  };
681
694
  }, [l, c, a, o, N]);
682
695
  const F = be(() => {
683
- if (f.status !== "ready" || f.next === null || f.paging) return;
684
- const b = f.next, w = f.entries;
685
- v({ ...f, paging: !0 }), o(c, a, b).then(
696
+ if (p.status !== "ready" || p.next === null || p.paging) return;
697
+ const f = p.next, w = p.entries;
698
+ v({ ...p, paging: !0 }), o(c, a, f).then(
686
699
  (I) => v({ status: "ready", entries: [...w, ...I.entries], next: I.next ?? null, paging: !1 }),
687
- () => v({ status: "ready", entries: w, next: b, paging: !1 })
700
+ () => v({ status: "ready", entries: w, next: f, paging: !1 })
688
701
  );
689
- }, [f, o, c, a]), V = be((b) => {
702
+ }, [p, o, c, a]), V = be((f) => {
690
703
  var w;
691
- return ((w = s == null ? void 0 : s.cost) == null ? void 0 : w.call(s, b)) ?? b.size ?? 0;
692
- }, [s]), E = Pe(() => [...x.values()], [x]), X = E.reduce((b, w) => b + (w.size ?? 0), 0), B = s === void 0 ? null : s.limitBytes - s.usedBytes - E.reduce((b, w) => b + V(w), 0), G = B !== null && B < 0, ie = (b) => {
693
- if (b.kind !== "file") return null;
694
- const w = m == null ? void 0 : m(b);
695
- return w || (B !== null && !x.has(Ne(c, b.id)) && V(b) > B ? i.overBudget : null);
696
- }, ce = (b) => {
697
- const w = Ne(c, b.id);
698
- !x.has(w) && ie(b) !== null || M((I) => {
699
- const K = new Map(I);
700
- return K.has(w) ? K.delete(w) : K.set(w, { ...b, space: c, path: a }), K;
704
+ return ((w = s == null ? void 0 : s.cost) == null ? void 0 : w.call(s, f)) ?? f.size ?? 0;
705
+ }, [s]), E = Pe(() => [...x.values()], [x]), X = E.reduce((f, w) => f + (w.size ?? 0), 0), B = s === void 0 ? null : s.limitBytes - s.usedBytes - E.reduce((f, w) => f + V(w), 0), G = B !== null && B < 0, ie = (f) => {
706
+ if (f.kind !== "file") return null;
707
+ const w = m == null ? void 0 : m(f);
708
+ return w || (B !== null && !x.has(Ne(c, f.id)) && V(f) > B ? i.overBudget : null);
709
+ }, ce = (f) => {
710
+ const w = Ne(c, f.id);
711
+ !x.has(w) && ie(f) !== null || M((I) => {
712
+ const H = new Map(I);
713
+ return H.has(w) ? H.delete(w) : H.set(w, { ...f, space: c, path: a }), H;
701
714
  });
702
- }, _ = (b) => g(Qe(a, b.name)), T = () => g(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), Z = (b) => M((w) => {
715
+ }, _ = (f) => g(Qe(a, f.name)), A = () => g(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), Z = (f) => M((w) => {
703
716
  const I = new Map(w);
704
- return I.delete(b), I;
705
- }), W = f.status === "ready" ? f.entries : [], L = (b) => {
717
+ return I.delete(f), I;
718
+ }), W = p.status === "ready" ? p.entries : [], L = (f) => {
706
719
  const w = W[C];
707
- if (b.key === "ArrowDown" || b.key === "ArrowUp" || b.key === "Home" || b.key === "End") {
708
- b.preventDefault();
709
- const I = W.length - 1, K = b.key === "Home" ? 0 : b.key === "End" ? I : Math.min(I, Math.max(0, C + (b.key === "ArrowDown" ? 1 : -1)));
710
- H(K), K >= I - 1 && F();
711
- } else b.key === "Enter" && (w == null ? void 0 : w.kind) === "folder" ? (b.preventDefault(), _(w)) : b.key === " " && (w == null ? void 0 : w.kind) === "file" ? (b.preventDefault(), ce(w)) : b.key === "Backspace" && a !== "" && (b.preventDefault(), T());
712
- }, j = a === "" ? [] : a.split("/"), oe = ((ue = t.find((b) => b.id === c)) == null ? void 0 : ue.name) ?? "", de = (b) => `${y}-entry-${String(b)}`;
720
+ if (f.key === "ArrowDown" || f.key === "ArrowUp" || f.key === "Home" || f.key === "End") {
721
+ f.preventDefault();
722
+ const I = W.length - 1, H = f.key === "Home" ? 0 : f.key === "End" ? I : Math.min(I, Math.max(0, C + (f.key === "ArrowDown" ? 1 : -1)));
723
+ U(H), H >= I - 1 && F();
724
+ } else f.key === "Enter" && (w == null ? void 0 : w.kind) === "folder" ? (f.preventDefault(), _(w)) : f.key === " " && (w == null ? void 0 : w.kind) === "file" ? (f.preventDefault(), ce(w)) : f.key === "Backspace" && a !== "" && (f.preventDefault(), A());
725
+ }, j = a === "" ? [] : a.split("/"), oe = ((ue = t.find((f) => f.id === c)) == null ? void 0 : ue.name) ?? "", de = (f) => `${y}-entry-${String(f)}`;
713
726
  return /* @__PURE__ */ d(
714
727
  Le,
715
728
  {
716
729
  open: l,
717
730
  title: i.title,
718
- onClose: p,
731
+ onClose: b,
719
732
  closeLabel: i.close,
720
- initialFocus: J,
733
+ initialFocus: Q,
721
734
  className: "cms-file-picker",
722
735
  footer: /* @__PURE__ */ d("div", { className: "cms-file-picker__foot", children: [
723
736
  /* @__PURE__ */ d("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
724
737
  E.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(E.length, r(X)) }) : null,
725
- s !== void 0 && B !== null ? /* @__PURE__ */ e("span", { className: D(G && "is-over"), children: G ? i.overBudget : i.left(r(Math.max(0, B)), r(s.limitBytes)) }) : null
738
+ s !== void 0 && B !== null ? /* @__PURE__ */ e("span", { className: T(G && "is-over"), children: G ? i.overBudget : i.left(r(Math.max(0, B)), r(s.limitBytes)) }) : null
726
739
  ] }),
727
740
  /* @__PURE__ */ d("div", { className: "cms-file-picker__actions", children: [
728
- /* @__PURE__ */ e(ne, { variant: "secondary", onClick: p, children: i.cancel }),
741
+ /* @__PURE__ */ e(ne, { variant: "secondary", onClick: b, children: i.cancel }),
729
742
  /* @__PURE__ */ e(ne, { variant: "primary", disabled: E.length === 0 || G, onClick: () => u(E), children: i.confirm(E.length) })
730
743
  ] })
731
744
  ] }),
@@ -733,79 +746,79 @@ function Tn(n) {
733
746
  /* @__PURE__ */ d("div", { className: "cms-file-picker__top", children: [
734
747
  t.length > 1 ? /* @__PURE__ */ d("label", { className: "cms-file-picker__space", children: [
735
748
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: i.space }),
736
- /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: c, onChange: (b) => {
737
- h(b.target.value), g("");
738
- }, children: t.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.name }, b.id)) })
749
+ /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: c, onChange: (f) => {
750
+ h(f.target.value), g("");
751
+ }, children: t.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.name }, f.id)) })
739
752
  ] }) : null,
740
753
  /* @__PURE__ */ d("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
741
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: a === "", onClick: T, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
754
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: a === "", onClick: A, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
742
755
  /* @__PURE__ */ d("ol", { children: [
743
756
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": a === "" ? "location" : void 0, onClick: () => g(""), children: oe }) }),
744
- j.map((b, w) => {
757
+ j.map((f, w) => {
745
758
  const I = j.slice(0, w + 1).join("/");
746
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === a ? "location" : void 0, onClick: () => g(I), children: b }) }, I);
759
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === a ? "location" : void 0, onClick: () => g(I), children: f }) }, I);
747
760
  })
748
761
  ] })
749
762
  ] }),
750
- E.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": O, onClick: () => le((b) => !b), children: i.selected(E.length) }) : null
763
+ E.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": K, onClick: () => le((f) => !f), children: i.selected(E.length) }) : null
751
764
  ] }),
752
- O && E.length > 0 ? /* @__PURE__ */ d("div", { className: "cms-file-picker__chosen", children: [
753
- /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([b, w]) => /* @__PURE__ */ d("li", { children: [
765
+ K && E.length > 0 ? /* @__PURE__ */ d("div", { className: "cms-file-picker__chosen", children: [
766
+ /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([f, w]) => /* @__PURE__ */ d("li", { children: [
754
767
  /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: w.name }),
755
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(w.name), onClick: () => Z(b), children: /* @__PURE__ */ e(z, { name: "close" }) })
756
- ] }, b)) }),
768
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(w.name), onClick: () => Z(f), children: /* @__PURE__ */ e(z, { name: "close" }) })
769
+ ] }, f)) }),
757
770
  /* @__PURE__ */ e(ne, { variant: "secondary", onClick: () => {
758
771
  M(/* @__PURE__ */ new Map()), le(!1);
759
772
  }, children: i.clear })
760
773
  ] }) : null,
761
- /* @__PURE__ */ d("div", { className: "cms-file-picker__list", onScroll: (b) => {
762
- const w = b.currentTarget;
774
+ /* @__PURE__ */ d("div", { className: "cms-file-picker__list", onScroll: (f) => {
775
+ const w = f.currentTarget;
763
776
  w.scrollTop + w.clientHeight >= w.scrollHeight - en && F();
764
777
  }, children: [
765
- f.status === "loading" ? /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "block" }) : null,
766
- f.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => k((b) => b + 1) } }) : null,
767
- f.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: i.denied, placement: "block" }) : null,
768
- f.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: i.empty, placement: "block" }) : null,
778
+ p.status === "loading" ? /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "block" }) : null,
779
+ p.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => k((f) => f + 1) } }) : null,
780
+ p.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: i.denied, placement: "block" }) : null,
781
+ p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: i.empty, placement: "block" }) : null,
769
782
  /* @__PURE__ */ d(
770
783
  "div",
771
784
  {
772
- ref: J,
785
+ ref: Q,
773
786
  role: "listbox",
774
787
  "aria-multiselectable": "true",
775
788
  "aria-label": i.files,
776
789
  "aria-activedescendant": W.length > 0 ? de(C) : void 0,
777
790
  tabIndex: 0,
778
791
  className: "cms-file-picker__entries",
779
- hidden: f.status !== "ready" || W.length === 0,
792
+ hidden: p.status !== "ready" || W.length === 0,
780
793
  onKeyDown: L,
781
794
  children: [
782
- W.map((b, w) => {
783
- const I = b.kind === "file" && x.has(Ne(c, b.id)), K = ie(b);
795
+ W.map((f, w) => {
796
+ const I = f.kind === "file" && x.has(Ne(c, f.id)), H = ie(f);
784
797
  return /* @__PURE__ */ d(
785
798
  "div",
786
799
  {
787
800
  id: de(w),
788
801
  role: "option",
789
- "aria-selected": b.kind === "file" ? I : void 0,
790
- "aria-disabled": K !== null || void 0,
791
- className: D("cms-file-picker__entry", w === C && "is-active", I && "is-ticked", K !== null && "is-disabled"),
802
+ "aria-selected": f.kind === "file" ? I : void 0,
803
+ "aria-disabled": H !== null || void 0,
804
+ className: T("cms-file-picker__entry", w === C && "is-active", I && "is-ticked", H !== null && "is-disabled"),
792
805
  onClick: () => {
793
- H(w), b.kind === "folder" ? _(b) : ce(b);
806
+ U(w), f.kind === "folder" ? _(f) : ce(f);
794
807
  },
795
808
  children: [
796
809
  /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
797
- /* @__PURE__ */ e(P, { name: b.kind === "folder" ? "folder" : "file" }),
810
+ /* @__PURE__ */ e(P, { name: f.kind === "folder" ? "folder" : "file" }),
798
811
  /* @__PURE__ */ d("span", { className: "cms-file-picker__text", children: [
799
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: b.name }),
800
- K !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: K }) : null
812
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: f.name }),
813
+ H !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: H }) : null
801
814
  ] }),
802
- b.kind === "file" && b.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(b.size) }) : null
815
+ f.kind === "file" && f.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(f.size) }) : null
803
816
  ]
804
817
  },
805
- b.id
818
+ f.id
806
819
  );
807
820
  }),
808
- f.status === "ready" && f.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "inline" }) }) : null
821
+ p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "inline" }) }) : null
809
822
  ]
810
823
  }
811
824
  )
@@ -841,29 +854,29 @@ function En({ title: n, scope: l, actions: t, backLink: o }) {
841
854
  ] });
842
855
  }
843
856
  function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
844
- const m = U([]), s = (r, i) => {
857
+ const m = R([]), s = (r, i) => {
845
858
  var h;
846
- const u = n.length - 1, p = r.key === "ArrowRight" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" ? i === 0 ? u : i - 1 : r.key === "Home" ? 0 : r.key === "End" ? u : null;
847
- if (p === null) return;
859
+ const u = n.length - 1, b = r.key === "ArrowRight" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" ? i === 0 ? u : i - 1 : r.key === "Home" ? 0 : r.key === "End" ? u : null;
860
+ if (b === null) return;
848
861
  r.preventDefault();
849
- const c = n[p];
850
- c && (t(c.id), (h = m.current[p]) == null || h.focus());
862
+ const c = n[b];
863
+ c && (t(c.id), (h = m.current[b]) == null || h.focus());
851
864
  };
852
865
  return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": o, children: n.map((r, i) => {
853
866
  const u = r.id === l;
854
867
  return /* @__PURE__ */ d(
855
868
  "button",
856
869
  {
857
- ref: (p) => {
858
- m.current[i] = p;
870
+ ref: (b) => {
871
+ m.current[i] = b;
859
872
  },
860
873
  type: "button",
861
874
  role: "tab",
862
- className: D("cms-tab", u && "is-active"),
875
+ className: T("cms-tab", u && "is-active"),
863
876
  "aria-selected": u,
864
877
  tabIndex: u ? 0 : -1,
865
878
  onClick: () => t(r.id),
866
- onKeyDown: (p) => s(p, i),
879
+ onKeyDown: (b) => s(b, i),
867
880
  children: [
868
881
  r.label,
869
882
  r.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: r.count }) : null
@@ -894,7 +907,7 @@ function ve({ name: n, pictureUrl: l, presence: t, size: o = 32 }) {
894
907
  "aria-label": t ? `${n}, ${t}` : n,
895
908
  children: [
896
909
  l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: nn(n) }),
897
- t ? /* @__PURE__ */ e("span", { className: D("cms-avatar__presence", `is-${t}`), "aria-hidden": "true" }) : null
910
+ t ? /* @__PURE__ */ e("span", { className: T("cms-avatar__presence", `is-${t}`), "aria-hidden": "true" }) : null
898
911
  ]
899
912
  }
900
913
  );
@@ -905,9 +918,9 @@ function tn({ count: n, label: l, max: t = 99 }) {
905
918
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
906
919
  ] });
907
920
  }
908
- function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s, search: r, account: i, children: u, railLabel: p = "Sections" }) {
921
+ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s, search: r, account: i, children: u, railLabel: b = "Sections" }) {
909
922
  return /* @__PURE__ */ d("div", { className: "cms-shell", children: [
910
- /* @__PURE__ */ d("nav", { className: "cms-shell__rail", "aria-label": p, children: [
923
+ /* @__PURE__ */ d("nav", { className: "cms-shell__rail", "aria-label": b, children: [
911
924
  /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
912
925
  /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((c) => {
913
926
  const h = c.id === o;
@@ -915,7 +928,7 @@ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s,
915
928
  "a",
916
929
  {
917
930
  href: c.href,
918
- className: D("cms-shell__item", h && "is-active"),
931
+ className: T("cms-shell__item", h && "is-active"),
919
932
  "aria-current": h ? "page" : void 0,
920
933
  title: c.label,
921
934
  onClick: (a) => {
@@ -968,29 +981,29 @@ function In({ label: n, placeholder: l, value: t, onChange: o, onSearch: m }) {
968
981
  );
969
982
  }
970
983
  function Pn({ options: n, value: l, onChange: t, label: o }) {
971
- const m = U([]), s = (r, i) => {
984
+ const m = R([]), s = (r, i) => {
972
985
  var h;
973
- const u = n.length - 1, p = r.key === "ArrowRight" || r.key === "ArrowDown" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
974
- if (p === null) return;
986
+ const u = n.length - 1, b = r.key === "ArrowRight" || r.key === "ArrowDown" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
987
+ if (b === null) return;
975
988
  r.preventDefault();
976
- const c = n[p];
977
- c && (t(c.id), (h = m.current[p]) == null || h.focus());
989
+ const c = n[b];
990
+ c && (t(c.id), (h = m.current[b]) == null || h.focus());
978
991
  };
979
992
  return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": o, children: n.map((r, i) => {
980
993
  const u = r.id === l;
981
994
  return /* @__PURE__ */ d(
982
995
  "button",
983
996
  {
984
- ref: (p) => {
985
- m.current[i] = p;
997
+ ref: (b) => {
998
+ m.current[i] = b;
986
999
  },
987
1000
  type: "button",
988
1001
  role: "radio",
989
1002
  "aria-checked": u,
990
1003
  tabIndex: u ? 0 : -1,
991
- className: D("cms-chip", u && "is-on"),
1004
+ className: T("cms-chip", u && "is-on"),
992
1005
  onClick: () => t(r.id),
993
- onKeyDown: (p) => s(p, i),
1006
+ onKeyDown: (b) => s(b, i),
994
1007
  children: [
995
1008
  u ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
996
1009
  r.label
@@ -1011,7 +1024,7 @@ function an(n, l, t) {
1011
1024
  return o;
1012
1025
  }
1013
1026
  function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onResize: r }) {
1014
- const i = Math.max(l.min, Math.min(l.max, m > 0 ? m - o - s : l.max)), u = (h) => Math.round(Math.min(Math.max(h, l.min), i)), p = U(null), c = (h, a) => r == null ? void 0 : r(n, u(h), a);
1027
+ const i = Math.max(l.min, Math.min(l.max, m > 0 ? m - o - s : l.max)), u = (h) => Math.round(Math.min(Math.max(h, l.min), i)), b = R(null), c = (h, a) => r == null ? void 0 : r(n, u(h), a);
1015
1028
  return /* @__PURE__ */ e(
1016
1029
  "div",
1017
1030
  {
@@ -1025,22 +1038,22 @@ function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onRes
1025
1038
  className: "cms-panes__splitter",
1026
1039
  style: { "--split-at": `var(--split-pane-end-${String(n)})` },
1027
1040
  onPointerDown: (h) => {
1028
- var a, g, f;
1029
- h.button > 0 || (h.preventDefault(), (g = (a = h.currentTarget).setPointerCapture) == null || g.call(a, h.pointerId), p.current = { x: h.clientX, from: t, last: t }, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.add("is-resizing"));
1041
+ var a, g, p;
1042
+ h.button > 0 || (h.preventDefault(), (g = (a = h.currentTarget).setPointerCapture) == null || g.call(a, h.pointerId), b.current = { x: h.clientX, from: t, last: t }, (p = h.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
1030
1043
  },
1031
1044
  onPointerMove: (h) => {
1032
- const a = p.current;
1045
+ const a = b.current;
1033
1046
  a === null || !Number.isFinite(h.clientX) || (a.last = u(a.from + h.clientX - a.x), c(a.last, !1));
1034
1047
  },
1035
1048
  onPointerUp: (h) => {
1036
1049
  var g;
1037
- const a = p.current;
1038
- a !== null && (p.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), c(a.last, !0));
1050
+ const a = b.current;
1051
+ a !== null && (b.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), c(a.last, !0));
1039
1052
  },
1040
1053
  onPointerCancel: (h) => {
1041
1054
  var g;
1042
- const a = p.current;
1043
- p.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), a !== null && c(a.last, !0);
1055
+ const a = b.current;
1056
+ b.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), a !== null && c(a.last, !0);
1044
1057
  },
1045
1058
  onDoubleClick: () => c(l.reset, !0),
1046
1059
  onKeyDown: (h) => {
@@ -1051,46 +1064,46 @@ function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onRes
1051
1064
  );
1052
1065
  }
1053
1066
  function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize: s }) {
1054
- const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), i = U(null), [u, p] = A(0), c = (o ?? []).slice(0, n.length - 1), h = c.length === n.length - 1 && c.every((f) => f !== void 0);
1067
+ const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), i = R(null), [u, b] = D(0), c = (o ?? []).slice(0, n.length - 1), h = c.length === n.length - 1 && c.every((p) => p !== void 0);
1055
1068
  ke(() => {
1056
- const f = i.current;
1057
- if (f === null || !h) return;
1058
- const v = () => p(f.clientWidth);
1069
+ const p = i.current;
1070
+ if (p === null || !h) return;
1071
+ const v = () => b(p.clientWidth);
1059
1072
  if (v(), typeof ResizeObserver > "u") return;
1060
1073
  const N = new ResizeObserver(v);
1061
- return N.observe(f), () => N.disconnect();
1074
+ return N.observe(p), () => N.disconnect();
1062
1075
  }, [h]);
1063
- const a = h ? an(c, u > 0 ? u : Number.POSITIVE_INFINITY, m) : [], g = h ? Object.fromEntries(a.flatMap((f, v) => [
1064
- [`--split-pane-${String(v)}`, `${String(f)}px`],
1076
+ const a = h ? an(c, u > 0 ? u : Number.POSITIVE_INFINITY, m) : [], g = h ? Object.fromEntries(a.flatMap((p, v) => [
1077
+ [`--split-pane-${String(v)}`, `${String(p)}px`],
1065
1078
  [`--split-pane-end-${String(v)}`, `${String(a.slice(0, v + 1).reduce((N, k) => N + k, 0))}px`]
1066
1079
  ])) : void 0;
1067
1080
  return /* @__PURE__ */ d(
1068
1081
  "div",
1069
1082
  {
1070
1083
  ref: i,
1071
- className: D("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1084
+ className: T("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1072
1085
  "data-active": r,
1073
1086
  style: g,
1074
1087
  children: [
1075
- n.map((f, v) => /* @__PURE__ */ d("section", { className: "cms-panes__pane", "aria-label": f.label, "data-offset": r - v, children: [
1088
+ n.map((p, v) => /* @__PURE__ */ d("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - v, children: [
1076
1089
  v === r && t ? /* @__PURE__ */ d("a", { className: "cms-panes__back", href: t.href, children: [
1077
1090
  /* @__PURE__ */ e(P, { name: "chevron-left", size: 18 }),
1078
1091
  t.label
1079
1092
  ] }) : null,
1080
- f.content
1081
- ] }, f.label)),
1082
- h ? c.map((f, v) => /* @__PURE__ */ e(
1093
+ p.content
1094
+ ] }, p.label)),
1095
+ h ? c.map((p, v) => /* @__PURE__ */ e(
1083
1096
  sn,
1084
1097
  {
1085
1098
  index: v,
1086
- size: f,
1099
+ size: p,
1087
1100
  shown: a[v],
1088
1101
  others: a.reduce((N, k, x) => x === v ? N : N + k, 0),
1089
1102
  room: u,
1090
1103
  lastMin: m,
1091
1104
  onResize: s
1092
1105
  },
1093
- f.label
1106
+ p.label
1094
1107
  )) : null
1095
1108
  ]
1096
1109
  }
@@ -1098,12 +1111,12 @@ function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize
1098
1111
  }
1099
1112
  const rn = { attachment: "Has an attachment", unread: "Unread" };
1100
1113
  function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment: s, selected: r, onOpen: i, labels: u }) {
1101
- const p = re(rn, u);
1114
+ const b = re(rn, u);
1102
1115
  return /* @__PURE__ */ d(
1103
1116
  "button",
1104
1117
  {
1105
1118
  type: "button",
1106
- className: D("cms-mail-row", m && "is-unread", r && "is-selected"),
1119
+ className: T("cms-mail-row", m && "is-unread", r && "is-selected"),
1107
1120
  "aria-current": r ? "true" : void 0,
1108
1121
  onClick: i,
1109
1122
  children: [
@@ -1111,12 +1124,12 @@ function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment
1111
1124
  /* @__PURE__ */ d("span", { className: "cms-mail-row__body", children: [
1112
1125
  /* @__PURE__ */ d("span", { className: "cms-mail-row__line", children: [
1113
1126
  /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
1114
- s ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: p.attachment }) : null,
1127
+ s ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: b.attachment }) : null,
1115
1128
  /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: o })
1116
1129
  ] }),
1117
1130
  /* @__PURE__ */ d("span", { className: "cms-mail-row__line", children: [
1118
1131
  /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
1119
- m ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": p.unread }) : null
1132
+ m ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": b.unread }) : null
1120
1133
  ] }),
1121
1134
  /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
1122
1135
  ] })
@@ -1125,7 +1138,7 @@ function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment
1125
1138
  );
1126
1139
  }
1127
1140
  function Kn({ direction: n, children: l, time: t, read: o, readLabel: m = "Read" }) {
1128
- return /* @__PURE__ */ d("div", { className: D("cms-bubble", `cms-bubble--${n}`), children: [
1141
+ return /* @__PURE__ */ d("div", { className: T("cms-bubble", `cms-bubble--${n}`), children: [
1129
1142
  /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
1130
1143
  /* @__PURE__ */ d("div", { className: "cms-bubble__meta", children: [
1131
1144
  t,
@@ -1136,13 +1149,13 @@ function Kn({ direction: n, children: l, time: t, read: o, readLabel: m = "Read"
1136
1149
  ] })
1137
1150
  ] });
1138
1151
  }
1139
- function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placeholder: s, variant: r = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: p, canSend: c }) {
1152
+ function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placeholder: s, variant: r = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: b, canSend: c }) {
1140
1153
  const h = q(), a = c ?? l.trim() !== "", g = (v) => {
1141
1154
  v.preventDefault(), a && o();
1142
- }, f = m ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: m, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
1143
- return /* @__PURE__ */ d("form", { className: D("cms-composer", `cms-composer--${r}`), onSubmit: g, children: [
1155
+ }, p = m ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: m, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
1156
+ return /* @__PURE__ */ d("form", { className: T("cms-composer", `cms-composer--${r}`), onSubmit: g, children: [
1144
1157
  /* @__PURE__ */ e("label", { htmlFor: h, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1145
- r === "chat" ? f : null,
1158
+ r === "chat" ? p : null,
1146
1159
  /* @__PURE__ */ e(
1147
1160
  "textarea",
1148
1161
  {
@@ -1157,8 +1170,8 @@ function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placehold
1157
1170
  }
1158
1171
  }
1159
1172
  ),
1160
- r === "reply" && p !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: p }) : null,
1161
- r === "reply" ? f : null,
1173
+ r === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
1174
+ r === "reply" ? p : null,
1162
1175
  r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !a, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ d("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !a, children: [
1163
1176
  i,
1164
1177
  " ",
@@ -1204,7 +1217,7 @@ function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: m }) {
1204
1217
  "button",
1205
1218
  {
1206
1219
  type: "button",
1207
- className: D("cms-call-button", `cms-call-button--${o}`, m && "is-pressed"),
1220
+ className: T("cms-call-button", `cms-call-button--${o}`, m && "is-pressed"),
1208
1221
  "aria-pressed": m,
1209
1222
  onClick: t,
1210
1223
  children: [
@@ -1214,7 +1227,7 @@ function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: m }) {
1214
1227
  }
1215
1228
  );
1216
1229
  }
1217
- function Un({ name: n, duration: l, connection: t, you: o, muted: m, speaker: s, onToggleMute: r, onToggleSpeaker: i, onAddPerson: u, onChat: p, onHangUp: c, labels: h }) {
1230
+ function Un({ name: n, duration: l, connection: t, you: o, muted: m, speaker: s, onToggleMute: r, onToggleSpeaker: i, onAddPerson: u, onChat: b, onHangUp: c, labels: h }) {
1218
1231
  const a = re(Se, h);
1219
1232
  return /* @__PURE__ */ d("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
1220
1233
  /* @__PURE__ */ d("div", { className: "cms-call-panel__head", children: [
@@ -1223,7 +1236,7 @@ function Un({ name: n, duration: l, connection: t, you: o, muted: m, speaker: s,
1223
1236
  /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1224
1237
  /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": a.callTime(l), children: l })
1225
1238
  ] }),
1226
- /* @__PURE__ */ e("span", { className: D("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
1239
+ /* @__PURE__ */ e("span", { className: T("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
1227
1240
  ] }),
1228
1241
  /* @__PURE__ */ d("div", { className: "cms-call-panel__you", children: [
1229
1242
  /* @__PURE__ */ e(ve, { name: o.name, size: 36 }),
@@ -1234,12 +1247,12 @@ function Un({ name: n, duration: l, connection: t, you: o, muted: m, speaker: s,
1234
1247
  /* @__PURE__ */ e(ae, { icon: "mic", label: m ? a.unmute : a.mute, pressed: m, onClick: r }),
1235
1248
  /* @__PURE__ */ e(ae, { icon: "speaker", label: a.speaker, pressed: s, onClick: i }),
1236
1249
  u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: a.addPerson, onClick: u }) : null,
1237
- p ? /* @__PURE__ */ e(ae, { icon: "chat", label: a.chat, onClick: p }) : null,
1250
+ b ? /* @__PURE__ */ e(ae, { icon: "chat", label: a.chat, onClick: b }) : null,
1238
1251
  /* @__PURE__ */ e(ae, { icon: "phone-off", label: a.hangUp, tone: "hang-up", onClick: c })
1239
1252
  ] })
1240
1253
  ] });
1241
1254
  }
1242
- function zn({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: m, onHangUp: s, labels: r }) {
1255
+ function Rn({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: m, onHangUp: s, labels: r }) {
1243
1256
  const i = re(Se, r);
1244
1257
  return /* @__PURE__ */ d("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
1245
1258
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
@@ -1252,7 +1265,7 @@ function zn({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: m, onHa
1252
1265
  ] })
1253
1266
  ] });
1254
1267
  }
1255
- function Rn({ mark: n, product: l, headline: t, lead: o, features: m = [], children: s }) {
1268
+ function zn({ mark: n, product: l, headline: t, lead: o, features: m = [], children: s }) {
1256
1269
  return /* @__PURE__ */ d("div", { className: "cms-signin", children: [
1257
1270
  /* @__PURE__ */ d("aside", { className: "cms-signin__brand", children: [
1258
1271
  /* @__PURE__ */ d("p", { className: "cms-signin__logo", children: [
@@ -1284,9 +1297,9 @@ const cn = {
1284
1297
  create: "Create an account"
1285
1298
  };
1286
1299
  function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, busy: s, labels: r }) {
1287
- const i = re(cn, r), u = q(), [p, c] = A(""), [h, a] = A(""), [g, f] = A(!1);
1300
+ const i = re(cn, r), u = q(), [b, c] = D(""), [h, a] = D(""), [g, p] = D(!1);
1288
1301
  return /* @__PURE__ */ d("form", { className: "cms-signin-form", onSubmit: (N) => {
1289
- N.preventDefault(), l(p, h);
1302
+ N.preventDefault(), l(b, h);
1290
1303
  }, "aria-describedby": m ? `${u}-error` : void 0, children: [
1291
1304
  /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
1292
1305
  /* @__PURE__ */ d("p", { className: "cms-signin-form__server", children: [
@@ -1302,7 +1315,7 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
1302
1315
  type: "text",
1303
1316
  autoComplete: "username",
1304
1317
  placeholder: i.identifierPlaceholder,
1305
- value: p,
1318
+ value: b,
1306
1319
  onChange: (N) => c(N.target.value),
1307
1320
  required: !0
1308
1321
  }
@@ -1321,7 +1334,7 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
1321
1334
  required: !0
1322
1335
  }
1323
1336
  ),
1324
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => f((N) => !N), children: g ? i.hide : i.show })
1337
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => p((N) => !N), children: g ? i.hide : i.show })
1325
1338
  ] }),
1326
1339
  t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: i.forgot }) : null,
1327
1340
  m ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: m }) : null,
@@ -1332,25 +1345,25 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
1332
1345
  ] }) : null
1333
1346
  ] });
1334
1347
  }
1335
- function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: i, onOpen: u, onRowMenu: p }) {
1336
- const c = U([]);
1337
- if (t != null) return /* @__PURE__ */ e(Re, { message: t, onRetry: o });
1348
+ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: i, onOpen: u, onRowMenu: b }) {
1349
+ const c = R([]);
1350
+ if (t != null) return /* @__PURE__ */ e(ze, { message: t, onRetry: o });
1338
1351
  if (l === null) return /* @__PURE__ */ e(Ue, { what: m, layout: "block" });
1339
- if (l.length === 0) return /* @__PURE__ */ e(ze, { title: s, hint: r });
1340
- const h = (a, g, f) => {
1352
+ if (l.length === 0) return /* @__PURE__ */ e(Re, { title: s, hint: r });
1353
+ const h = (a, g, p) => {
1341
1354
  var v;
1342
1355
  if (a.key === "ArrowDown" || a.key === "ArrowUp")
1343
1356
  a.preventDefault(), (v = c.current[Math.min(l.length - 1, Math.max(0, g + (a.key === "ArrowDown" ? 1 : -1)))]) == null || v.focus();
1344
1357
  else if (a.key === "Enter")
1345
- u == null || u(f);
1346
- else if ((a.key === "ContextMenu" || a.shiftKey && a.key === "F10") && p) {
1358
+ u == null || u(p);
1359
+ else if ((a.key === "ContextMenu" || a.shiftKey && a.key === "F10") && b) {
1347
1360
  a.preventDefault();
1348
1361
  const N = a.currentTarget.getBoundingClientRect();
1349
- p(f, { x: N.left + 16, y: N.bottom });
1362
+ b(p, { x: N.left + 16, y: N.bottom });
1350
1363
  }
1351
1364
  };
1352
1365
  return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((a, g) => {
1353
- const f = a.id === i;
1366
+ const p = a.id === i;
1354
1367
  return /* @__PURE__ */ d(
1355
1368
  "li",
1356
1369
  {
@@ -1358,13 +1371,13 @@ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading
1358
1371
  c.current[g] = v;
1359
1372
  },
1360
1373
  role: "option",
1361
- "aria-selected": f,
1362
- tabIndex: f || i == null && g === 0 ? 0 : -1,
1363
- className: D("cms-list__row", f && "is-selected"),
1374
+ "aria-selected": p,
1375
+ tabIndex: p || i == null && g === 0 ? 0 : -1,
1376
+ className: T("cms-list__row", p && "is-selected"),
1364
1377
  onClick: () => u == null ? void 0 : u(a.id),
1365
1378
  onKeyDown: (v) => h(v, g, a.id),
1366
- onContextMenu: p ? (v) => {
1367
- v.preventDefault(), p(a.id, { x: v.clientX, y: v.clientY });
1379
+ onContextMenu: b ? (v) => {
1380
+ v.preventDefault(), b(a.id, { x: v.clientX, y: v.clientY });
1368
1381
  } : void 0,
1369
1382
  children: [
1370
1383
  a.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: a.lead }) : null,
@@ -1380,16 +1393,16 @@ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading
1380
1393
  }) });
1381
1394
  }
1382
1395
  function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "first" }) {
1383
- const s = U(null), r = U(null), i = q(), [u, p] = A(n), c = l.filter((a) => a.offer.offered);
1396
+ const s = R(null), r = R(null), i = q(), [u, b] = D(n), c = l.filter((a) => a.offer.offered);
1384
1397
  if (ke(() => {
1385
1398
  if (!n) return;
1386
- const a = s.current, g = (a == null ? void 0 : a.offsetWidth) ?? 0, f = (a == null ? void 0 : a.offsetHeight) ?? 0;
1387
- p({ x: Math.max(0, Math.min(n.x, window.innerWidth - g)), y: Math.max(0, Math.min(n.y, window.innerHeight - f)) });
1388
- }, [n]), Y(() => {
1389
- var f, v;
1399
+ const a = s.current, g = (a == null ? void 0 : a.offsetWidth) ?? 0, p = (a == null ? void 0 : a.offsetHeight) ?? 0;
1400
+ b({ x: Math.max(0, Math.min(n.x, window.innerWidth - g)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
1401
+ }, [n]), J(() => {
1402
+ var p, v;
1390
1403
  if (!n) return;
1391
1404
  r.current = document.activeElement;
1392
- const a = Array.from(((f = s.current) == null ? void 0 : f.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1405
+ const a = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1393
1406
  (v = m === "last" ? a[a.length - 1] : a[0]) == null || v.focus();
1394
1407
  const g = (N) => {
1395
1408
  var k;
@@ -1402,13 +1415,13 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
1402
1415
  }, [n, t, m]), !n || c.length === 0) return null;
1403
1416
  const h = (a) => {
1404
1417
  var v, N;
1405
- const g = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), f = g.indexOf(document.activeElement);
1418
+ const g = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), p = g.indexOf(document.activeElement);
1406
1419
  if (a.key === "Escape" || a.key === "Tab")
1407
1420
  a.preventDefault(), t();
1408
1421
  else if (a.key === "ArrowDown" || a.key === "ArrowUp") {
1409
1422
  a.preventDefault();
1410
1423
  const k = a.key === "ArrowDown" ? 1 : -1;
1411
- (N = g[(f + k + g.length) % g.length]) == null || N.focus();
1424
+ (N = g[(p + k + g.length) % g.length]) == null || N.focus();
1412
1425
  }
1413
1426
  };
1414
1427
  return xe(
@@ -1432,12 +1445,12 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
1432
1445
  "aria-disabled": g || void 0,
1433
1446
  "aria-describedby": g ? `${i}-${a.id}` : void 0,
1434
1447
  title: g ? a.offer.refusal : void 0,
1435
- className: D("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", g && "is-refused"),
1448
+ className: T("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", g && "is-refused"),
1436
1449
  onClick: () => {
1437
1450
  g || (t(), a.onSelect());
1438
1451
  },
1439
- onKeyDown: (f) => {
1440
- (f.key === "Enter" || f.key === " ") && !g && (f.preventDefault(), t(), a.onSelect());
1452
+ onKeyDown: (p) => {
1453
+ (p.key === "Enter" || p.key === " ") && !g && (p.preventDefault(), t(), a.onSelect());
1441
1454
  },
1442
1455
  children: [
1443
1456
  a.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
@@ -1465,60 +1478,66 @@ function mn(n) {
1465
1478
  return [...l.entries()].sort(([t], [o]) => t - o).map(([, t]) => t);
1466
1479
  }
1467
1480
  function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leading: s }) {
1468
- const r = U(null), i = U(null), [u, p] = A(Te), [c, h] = A(null), [a, g] = A("first"), [f, v] = A(null), [N, k] = A(null), x = dn(l), M = mn(l), C = x.flat(), H = C.filter((_) => _.overflow === 0), O = C.filter((_) => _.overflow !== 0), le = JSON.stringify([l.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]), o ?? "", s !== void 0]), J = be(() => {
1469
- const _ = r.current, T = i.current;
1470
- if (_ === null || T === null) return;
1481
+ const r = R(null), i = R(null), [u, b] = D(Te), [c, h] = D(null), [a, g] = D("first"), [p, v] = D(null), [N, k] = D(null), x = dn(l), M = mn(l), C = x.flat(), U = C.filter((_) => _.overflow === 0), K = C.filter((_) => _.overflow !== 0), le = JSON.stringify([l.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]), o ?? "", s !== void 0]), Q = be(() => {
1482
+ const _ = r.current, A = i.current;
1483
+ if (_ === null || A === null) return;
1471
1484
  const Z = getComputedStyle(_), W = parseFloat(Z.columnGap || "0") || 0, L = _.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), j = ($) => {
1472
- var R;
1473
- return ((R = T.querySelector($)) == null ? void 0 : R.getBoundingClientRect().width) ?? 0;
1474
- }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), ue = ($, R) => j(`[data-measure="${R ? "full" : "icon"}"][data-measure-action="${CSS.escape($)}"]`), b = ($, R) => {
1475
- const Q = /* @__PURE__ */ new Set([...H.map((te) => te.id), ...R]), se = x.map((te) => te.filter((fe) => !Q.has(fe.id))).filter((te) => te.length > 0), he = se.flat(), Ie = he.length + (se.length - 1) + (Q.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1476
- return oe + he.reduce((te, fe) => te + ue(fe.id, !$.has(fe.id)), 0) + de * Math.max(0, se.length - 1) + (Q.size > 0 ? me : 0) + W * Math.max(0, Ie - 1);
1477
- }, w = O.filter(($) => !M.some((R) => R.includes($.id))).map(($) => $.id), I = [...M, ...[...w].reverse().map(($) => [$])];
1478
- let K = null;
1479
- if (b(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= L) K = Te;
1485
+ var O;
1486
+ return ((O = A.querySelector($)) == null ? void 0 : O.getBoundingClientRect().width) ?? 0;
1487
+ }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), ue = ($, O) => j(`[data-measure="${O ? "full" : "icon"}"][data-measure-action="${CSS.escape($)}"]`), f = ($, O) => {
1488
+ const Y = /* @__PURE__ */ new Set([...U.map((te) => te.id), ...O]), se = x.map((te) => te.filter((pe) => !Y.has(pe.id))).filter((te) => te.length > 0), he = se.flat(), Ie = he.length + (se.length - 1) + (Y.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1489
+ return oe + he.reduce((te, pe) => te + ue(pe.id, !$.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) + W * Math.max(0, Ie - 1);
1490
+ }, w = K.filter(($) => !M.some((O) => O.includes($.id))).map(($) => $.id), I = [...M, ...[...w].reverse().map(($) => [$])];
1491
+ let H = null;
1492
+ if (f(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= L) H = Te;
1480
1493
  else {
1481
1494
  const $ = /* @__PURE__ */ new Set();
1482
- for (const R of I) {
1483
- for (const Q of R) $.add(Q);
1484
- if (b($, /* @__PURE__ */ new Set()) <= L) {
1485
- K = { bare: $, hidden: /* @__PURE__ */ new Set() };
1495
+ for (const O of I) {
1496
+ for (const Y of O) $.add(Y);
1497
+ if (f($, /* @__PURE__ */ new Set()) <= L) {
1498
+ H = { bare: $, hidden: /* @__PURE__ */ new Set() };
1486
1499
  break;
1487
1500
  }
1488
1501
  }
1489
1502
  }
1490
- if (K === null) {
1491
- const $ = new Set(O.map((Q) => Q.id)), R = /* @__PURE__ */ new Set();
1492
- for (const Q of M) {
1493
- for (const se of Q) O.some((he) => he.id === se) && R.add(se);
1494
- if (R.size >= 2 && b($, R) <= L) break;
1503
+ if (H === null) {
1504
+ const $ = new Set(K.map((Y) => Y.id)), O = /* @__PURE__ */ new Set();
1505
+ for (const Y of M) {
1506
+ for (const se of Y) K.some((he) => he.id === se) && O.add(se);
1507
+ if (O.size >= 2 && f($, O) <= L) break;
1508
+ }
1509
+ if (f($, O) > L) {
1510
+ for (const Y of [...w].reverse())
1511
+ if (O.add(Y), f($, O) <= L) break;
1495
1512
  }
1496
- K = { bare: $, hidden: R.size >= 2 ? R : /* @__PURE__ */ new Set() };
1513
+ H = { bare: $, hidden: O };
1497
1514
  }
1498
- const ge = K;
1499
- p(($) => Ee($.bare, ge.bare) && Ee($.hidden, ge.hidden) ? $ : ge);
1515
+ const ge = H;
1516
+ b(($) => Ee($.bare, ge.bare) && Ee($.hidden, ge.hidden) ? $ : ge);
1500
1517
  }, [le]);
1501
- ke(J, [J]), Y(() => {
1518
+ ke(Q, [Q]), J(() => {
1502
1519
  const _ = r.current;
1503
1520
  if (_ === null || typeof ResizeObserver > "u") return;
1504
- const T = new ResizeObserver(() => J());
1505
- return T.observe(_), () => T.disconnect();
1506
- }, [J]);
1507
- const y = /* @__PURE__ */ new Set([...H.map((_) => _.id), ...u.hidden]), V = x.map((_) => _.filter((T) => !y.has(T.id))).filter((_) => _.length > 0).flat(), E = [
1508
- ...H,
1509
- ...M.flat().map((_) => C.find((T) => T.id === _)).filter((_) => _ !== void 0 && u.hidden.has(_.id))
1510
- ], X = new Set(O.filter((_) => !M.some((T) => T.includes(_.id))).map((_) => _.id)), B = [...V.map((_) => _.id), ...E.length > 0 ? ["more"] : []], G = f !== null && B.includes(f) ? f : B[0] ?? null, ie = (_) => {
1521
+ const A = new ResizeObserver(() => Q());
1522
+ return A.observe(_), () => A.disconnect();
1523
+ }, [Q]);
1524
+ const y = /* @__PURE__ */ new Set([...U.map((_) => _.id), ...u.hidden]), V = x.map((_) => _.filter((A) => !y.has(A.id))).filter((_) => _.length > 0).flat(), E = [
1525
+ ...U,
1526
+ ...M.flat().map((_) => C.find((A) => A.id === _)).filter((_) => _ !== void 0 && u.hidden.has(_.id)),
1527
+ // The pinned that a row too narrow for them sent behind ..., in the row's order.
1528
+ ...K.filter((_) => u.hidden.has(_.id) && !M.some((A) => A.includes(_.id)))
1529
+ ], X = new Set(K.filter((_) => !M.some((A) => A.includes(_.id))).map((_) => _.id)), B = [...V.map((_) => _.id), ...E.length > 0 ? ["more"] : []], G = p !== null && B.includes(p) ? p : B[0] ?? null, ie = (_) => {
1511
1530
  var L, j;
1512
- const T = B.indexOf(G ?? "");
1531
+ const A = B.indexOf(G ?? "");
1513
1532
  let Z = null;
1514
- if (_.key === "ArrowRight" ? Z = Math.min(B.length - 1, T + 1) : _.key === "ArrowLeft" ? Z = Math.max(0, T - 1) : _.key === "Home" ? Z = 0 : _.key === "End" ? Z = B.length - 1 : _.key === "Escape" && k(G), Z === null) return;
1533
+ if (_.key === "ArrowRight" ? Z = Math.min(B.length - 1, A + 1) : _.key === "ArrowLeft" ? Z = Math.max(0, A - 1) : _.key === "Home" ? Z = 0 : _.key === "End" ? Z = B.length - 1 : _.key === "Escape" && k(G), Z === null) return;
1515
1534
  _.preventDefault();
1516
1535
  const W = B[Z] ?? null;
1517
1536
  v(W), (j = (L = r.current) == null ? void 0 : L.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1518
1537
  }, ce = E.map((_) => ({
1519
1538
  id: _.id,
1520
1539
  label: /* @__PURE__ */ d(S, { children: [
1521
- /* @__PURE__ */ e(pe, { name: _.icon }),
1540
+ /* @__PURE__ */ e(fe, { name: _.icon }),
1522
1541
  _.label
1523
1542
  ] }),
1524
1543
  offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
@@ -1533,16 +1552,16 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1533
1552
  ref: r,
1534
1553
  role: "toolbar",
1535
1554
  "aria-label": n,
1536
- className: D(
1555
+ className: T(
1537
1556
  "cms-pane-toolbar",
1538
- O.length > 0 && u.bare.size >= O.length && "cms-pane-toolbar--labels-hidden",
1539
- u.bare.size > 0 && u.bare.size < O.length && "cms-pane-toolbar--labels-partly-hidden"
1557
+ K.length > 0 && u.bare.size >= K.length && "cms-pane-toolbar--labels-hidden",
1558
+ u.bare.size > 0 && u.bare.size < K.length && "cms-pane-toolbar--labels-partly-hidden"
1540
1559
  ),
1541
1560
  onKeyDown: ie,
1542
1561
  children: [
1543
1562
  s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
1544
- x.map((_, T) => {
1545
- const Z = _.filter((L) => !y.has(L.id)), W = x.slice(0, T).some((L) => L.some((j) => !y.has(j.id)));
1563
+ x.map((_, A) => {
1564
+ const Z = _.filter((L) => !y.has(L.id)), W = x.slice(0, A).some((L) => L.some((j) => !y.has(j.id)));
1546
1565
  return /* @__PURE__ */ d("div", { className: "cms-pane-toolbar__group-wrap", children: [
1547
1566
  Z.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1548
1567
  /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: _.map((L) => /* @__PURE__ */ e(
@@ -1561,7 +1580,7 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1561
1580
  },
1562
1581
  L.id
1563
1582
  )) })
1564
- ] }, T);
1583
+ ] }, A);
1565
1584
  }),
1566
1585
  E.length > 0 ? /* @__PURE__ */ e(
1567
1586
  "button",
@@ -1576,14 +1595,14 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1576
1595
  tabIndex: G === "more" ? 0 : -1,
1577
1596
  onFocus: () => v("more"),
1578
1597
  onClick: (_) => {
1579
- const T = _.currentTarget.getBoundingClientRect();
1580
- g("first"), h(c === null ? { x: T.left, y: T.bottom } : null);
1598
+ const A = _.currentTarget.getBoundingClientRect();
1599
+ g("first"), h(c === null ? { x: A.left, y: A.bottom } : null);
1581
1600
  },
1582
1601
  onKeyDown: (_) => {
1583
1602
  if (_.key === "ArrowDown" || _.key === "ArrowUp") {
1584
1603
  _.preventDefault(), _.stopPropagation();
1585
- const T = _.currentTarget.getBoundingClientRect();
1586
- g(_.key === "ArrowUp" ? "last" : "first"), h({ x: T.left, y: T.bottom });
1604
+ const A = _.currentTarget.getBoundingClientRect();
1605
+ g(_.key === "ArrowUp" ? "last" : "first"), h({ x: A.left, y: A.bottom });
1587
1606
  }
1588
1607
  },
1589
1608
  children: /* @__PURE__ */ e(P, { name: "more" })
@@ -1597,10 +1616,10 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1597
1616
  /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
1598
1617
  C.map((_) => /* @__PURE__ */ d("span", { children: [
1599
1618
  /* @__PURE__ */ d("span", { "data-measure": "full", "data-measure-action": _.id, className: "cms-pane-toolbar__action", children: [
1600
- /* @__PURE__ */ e(pe, { name: _.icon }),
1619
+ /* @__PURE__ */ e(fe, { name: _.icon }),
1601
1620
  /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label })
1602
1621
  ] }),
1603
- /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": _.id, className: D("cms-pane-toolbar__action", _e(_.icon) !== null && "cms-pane-toolbar__action--bare"), children: _e(_.icon) !== null ? /* @__PURE__ */ e(pe, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }) })
1622
+ /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": _.id, className: T("cms-pane-toolbar__action", _e(_.icon) !== null && "cms-pane-toolbar__action--bare"), children: _e(_.icon) !== null ? /* @__PURE__ */ e(fe, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }) })
1604
1623
  ] }, _.id))
1605
1624
  ] })
1606
1625
  ]
@@ -1608,21 +1627,21 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1608
1627
  );
1609
1628
  }
1610
1629
  function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOff: s, onChoose: r, onFocus: i }) {
1611
- const [u, p] = A(!1);
1612
- Y(() => {
1630
+ const [u, b] = D(!1);
1631
+ J(() => {
1613
1632
  if (!n.busy) {
1614
- p(!1);
1633
+ b(!1);
1615
1634
  return;
1616
1635
  }
1617
- const k = setTimeout(() => p(!0), ye);
1636
+ const k = setTimeout(() => b(!0), ye);
1618
1637
  return () => clearTimeout(k);
1619
1638
  }, [n.busy]);
1620
- const c = _e(n.icon) === null, h = l || c, a = n.disabled && n.reason ? n.reason : null, g = a ?? (h ? null : n.label), f = q(), [v, N] = A(!1);
1639
+ const c = _e(n.icon) === null, h = l || c, a = n.disabled && n.reason ? n.reason : null, g = a ?? (h ? null : n.label), p = q(), [v, N] = D(!1);
1621
1640
  return /* @__PURE__ */ d(
1622
1641
  "button",
1623
1642
  {
1624
1643
  type: "button",
1625
- className: D("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", c && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1644
+ className: T("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", c && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1626
1645
  "data-action": n.id,
1627
1646
  "data-stop": n.id,
1628
1647
  ...t ? { "data-overflowed": "" } : {},
@@ -1631,7 +1650,7 @@ function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOf
1631
1650
  "aria-label": n.label,
1632
1651
  "aria-disabled": n.disabled || void 0,
1633
1652
  "aria-busy": n.busy || void 0,
1634
- ...a === null ? {} : { "aria-describedby": f },
1653
+ ...a === null ? {} : { "aria-describedby": p },
1635
1654
  ...v && a !== null ? { "data-reason-shown": "" } : {},
1636
1655
  tabIndex: m ? 0 : -1,
1637
1656
  onFocus: i,
@@ -1643,25 +1662,25 @@ function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOf
1643
1662
  a !== null ? N(!0) : !n.disabled && !n.busy && r();
1644
1663
  },
1645
1664
  children: [
1646
- u ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(pe, { name: n.icon }),
1665
+ u ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
1647
1666
  h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1648
- a !== null || g !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: f, children: g }) : null
1667
+ a !== null || g !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: g }) : null
1649
1668
  ]
1650
1669
  }
1651
1670
  );
1652
1671
  }
1653
- function pe({ name: n }) {
1672
+ function fe({ name: n }) {
1654
1673
  const l = _e(n);
1655
1674
  return l === null ? null : /* @__PURE__ */ e(P, { name: l, size: 18 });
1656
1675
  }
1657
- function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel: m, expandLabel: s, collapseLabel: r, action: i = null, onRead: u, leading: p }) {
1658
- const [c, h] = A(!1), a = q(), g = () => {
1676
+ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel: m, expandLabel: s, collapseLabel: r, action: i = null, onRead: u, leading: b }) {
1677
+ const [c, h] = D(!1), a = q(), g = () => {
1659
1678
  o && u();
1660
- }, f = (i == null ? void 0 : i.presentation) === "row" && i.onAction !== void 0, v = (i == null ? void 0 : i.presentation) === "button" && i.onAction !== void 0 ? i : null, N = () => {
1679
+ }, p = (i == null ? void 0 : i.presentation) === "row" && i.onAction !== void 0, v = (i == null ? void 0 : i.presentation) === "button" && i.onAction !== void 0 ? i : null, N = () => {
1661
1680
  var k;
1662
- g(), f && ((k = i.onAction) == null || k.call(i));
1681
+ g(), p && ((k = i.onAction) == null || k.call(i));
1663
1682
  };
1664
- return /* @__PURE__ */ d("article", { className: D("cms-notification", o && "is-unread", c && "is-expanded", f && "is-row-action"), "data-state": o ? "unread" : "read", children: [
1683
+ return /* @__PURE__ */ d("article", { className: T("cms-notification", o && "is-unread", c && "is-expanded", p && "is-row-action"), "data-state": o ? "unread" : "read", children: [
1665
1684
  /* @__PURE__ */ d(
1666
1685
  "div",
1667
1686
  {
@@ -1674,7 +1693,7 @@ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
1674
1693
  k.target !== k.currentTarget || k.key !== "Enter" && k.key !== " " || (k.preventDefault(), N());
1675
1694
  },
1676
1695
  children: [
1677
- p != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: p }) : null,
1696
+ b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
1678
1697
  /* @__PURE__ */ d("span", { className: "cms-notification__text", children: [
1679
1698
  /* @__PURE__ */ d("span", { className: "cms-notification__head", children: [
1680
1699
  /* @__PURE__ */ d("span", { className: "cms-notification__title", children: [
@@ -1736,13 +1755,13 @@ function qn(n, l) {
1736
1755
  return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
1737
1756
  }
1738
1757
  }
1739
- function fn(n, l) {
1758
+ function pn(n, l) {
1740
1759
  if (!n) return;
1741
1760
  if (typeof n.get == "function") return n.get(l) ?? void 0;
1742
1761
  const t = n, o = Object.keys(t).find((m) => m.toLowerCase() === l.toLowerCase());
1743
1762
  return o === void 0 ? void 0 : t[o];
1744
1763
  }
1745
- function pn(n) {
1764
+ function fn(n) {
1746
1765
  if (n && typeof n == "object") {
1747
1766
  const l = n;
1748
1767
  if (typeof l.detail == "string" && l.detail !== "") return l.detail;
@@ -1751,17 +1770,17 @@ function pn(n) {
1751
1770
  }
1752
1771
  function Xn(n, l, t, o) {
1753
1772
  if (n !== 403) return { kind: "none" };
1754
- const m = pn(t);
1755
- return fn(l, "X-Elevation-Required") !== void 0 ? o.elevates ? { kind: "elevation-required", message: m ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: m ?? "The server refused this." };
1773
+ const m = fn(t);
1774
+ return pn(l, "X-Elevation-Required") !== void 0 ? o.elevates ? { kind: "elevation-required", message: m ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: m ?? "The server refused this." };
1756
1775
  }
1757
1776
  const we = "coolms-kit:reread";
1758
1777
  function Gn() {
1759
1778
  window.dispatchEvent(new Event(we));
1760
1779
  }
1761
1780
  function Yn(n) {
1762
- const [l, t] = A(void 0), [o, m] = A(void 0), [s, r] = A(!0), i = U(n);
1781
+ const [l, t] = D(void 0), [o, m] = D(void 0), [s, r] = D(!0), i = R(n);
1763
1782
  i.current = n;
1764
- const u = U(0), p = be(() => {
1783
+ const u = R(0), b = be(() => {
1765
1784
  const c = ++u.current;
1766
1785
  r(!0), i.current().then(
1767
1786
  (h) => {
@@ -1772,13 +1791,13 @@ function Yn(n) {
1772
1791
  }
1773
1792
  );
1774
1793
  }, []);
1775
- return Y(() => {
1776
- p();
1777
- const c = () => p();
1794
+ return J(() => {
1795
+ b();
1796
+ const c = () => b();
1778
1797
  return window.addEventListener("focus", c), window.addEventListener(we, c), () => {
1779
1798
  window.removeEventListener("focus", c), window.removeEventListener(we, c);
1780
1799
  };
1781
- }, [p]), { value: l, error: o, loading: s, reread: p };
1800
+ }, [b]), { value: l, error: o, loading: s, reread: b };
1782
1801
  }
1783
1802
  function Jn(n) {
1784
1803
  return n === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
@@ -1803,14 +1822,14 @@ export {
1803
1822
  ne as Button,
1804
1823
  Se as CALL_LABELS,
1805
1824
  bn as CLIENT_UPDATE_REQUIRED,
1806
- zn as CallBar,
1825
+ Rn as CallBar,
1807
1826
  Un as CallPanel,
1808
1827
  Kn as ChatBubble,
1809
1828
  Hn as Composer,
1810
1829
  Cn as ConfirmDialog,
1811
1830
  on as ContextMenu,
1812
- ze as EmptyState,
1813
- Re as ErrorBanner,
1831
+ Re as EmptyState,
1832
+ ze as ErrorBanner,
1814
1833
  Tn as FilePicker,
1815
1834
  Je as FilePickerDenied,
1816
1835
  Dn as FileViewer,
@@ -1832,7 +1851,7 @@ export {
1832
1851
  In as SearchField,
1833
1852
  kn as Select,
1834
1853
  Zn as SignInForm,
1835
- Rn as SignInLayout,
1854
+ zn as SignInLayout,
1836
1855
  Fn as SplitPanes,
1837
1856
  ee as State,
1838
1857
  Ln as TabStrip,
@@ -1849,7 +1868,7 @@ export {
1849
1868
  qn as offerFor,
1850
1869
  Jn as readConflict,
1851
1870
  Xn as readRefusal,
1852
- pn as refusalText,
1871
+ fn as refusalText,
1853
1872
  Gn as rereadAll,
1854
1873
  ln as tintOf,
1855
1874
  Yn as useReread,