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

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,15 +1,15 @@
1
- import { jsx as e, jsxs as d, Fragment as S } from "react/jsx-runtime";
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
- import { createPortal as xe } from "react-dom";
1
+ import { jsx as e, jsxs as u, Fragment as S } from "react/jsx-runtime";
2
+ import { useId as q, useState as A, useRef as K, useEffect as J, useCallback as be, useMemo as Ke, useLayoutEffect as xe, useContext as Oe, createContext as Ue } from "react";
3
+ import { createPortal as Ce } from "react-dom";
4
4
  function re(n, l) {
5
5
  const t = { ...n };
6
- for (const o of Object.keys(l ?? {})) {
7
- const m = l == null ? void 0 : l[o];
8
- m !== void 0 && (t[o] = m);
6
+ for (const d of Object.keys(l ?? {})) {
7
+ const o = l == null ? void 0 : l[d];
8
+ o !== void 0 && (t[d] = o);
9
9
  }
10
10
  return t;
11
11
  }
12
- function T(...n) {
12
+ function E(...n) {
13
13
  return n.filter(Boolean).join(" ");
14
14
  }
15
15
  function z({ name: n }) {
@@ -35,213 +35,213 @@ function ne({
35
35
  variant: n = "secondary",
36
36
  busy: l = !1,
37
37
  busyLabel: t,
38
- locked: o = !1,
39
- lockedReason: m,
40
- icon: s,
38
+ locked: d = !1,
39
+ lockedReason: o,
40
+ icon: a,
41
41
  disabled: r,
42
- className: i,
43
- children: u,
42
+ className: s,
43
+ children: m,
44
44
  type: b = "button",
45
- title: c,
45
+ title: i,
46
46
  ...h
47
47
  }) {
48
- const a = !!r || l;
49
- return /* @__PURE__ */ d(
48
+ const c = !!r || l;
49
+ return /* @__PURE__ */ u(
50
50
  "button",
51
51
  {
52
52
  ...h,
53
53
  type: b,
54
- className: T("cms-button", `cms-button--${n}`, l && "is-busy", o && "is-locked", i),
55
- disabled: a,
54
+ className: E("cms-button", `cms-button--${n}`, l && "is-busy", d && "is-locked", s),
55
+ disabled: c,
56
56
  "aria-busy": l || void 0,
57
- title: o ? m ?? c : c,
57
+ title: d ? o ?? i : i,
58
58
  children: [
59
- l ? /* @__PURE__ */ e(z, { name: "spinner" }) : o ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
60
- /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : u }),
61
- o && m ? /* @__PURE__ */ d("span", { className: "cms-visually-hidden", children: [
59
+ l ? /* @__PURE__ */ e(z, { name: "spinner" }) : d ? /* @__PURE__ */ e(z, { name: "lock" }) : a,
60
+ /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : m }),
61
+ d && o ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
- m
63
+ o
64
64
  ] }) : null
65
65
  ]
66
66
  }
67
67
  );
68
68
  }
69
- function Ce({ id: n, label: l, help: t, error: o, pinned: m, children: s }) {
70
- return /* @__PURE__ */ d("div", { className: T("cms-field", o != null && "is-invalid"), children: [
69
+ function Me({ id: n, label: l, help: t, error: d, pinned: o, children: a }) {
70
+ return /* @__PURE__ */ u("div", { className: E("cms-field", d != null && "is-invalid"), children: [
71
71
  /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
72
- s,
73
- m != null ? /* @__PURE__ */ d("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
72
+ a,
73
+ o != null ? /* @__PURE__ */ u("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
74
  /* @__PURE__ */ e(z, { name: "lock" }),
75
75
  " ",
76
- m
76
+ o
77
77
  ] }) : null,
78
- o != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: o }) : null,
78
+ d != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: d }) : null,
79
79
  t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
80
80
  ] });
81
81
  }
82
- function Me(n, l) {
82
+ function Se(n, l) {
83
83
  const t = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
84
84
  return t === "" ? void 0 : t;
85
85
  }
86
- const Fe = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Be = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
- function Ke(n, l, t) {
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
- }, m = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
86
+ const He = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, ze = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
+ function Re(n, l, t) {
88
+ const d = (a, r, s, m = 0, b = 0, i = 0) => {
89
+ const h = new Date(Date.UTC(a, r - 1, s, m, b, i));
90
+ return h.setUTCFullYear(a), h.getUTCFullYear() === a && h.getUTCMonth() === r - 1 && h.getUTCDate() === s && h.getUTCHours() === m && h.getUTCMinutes() === b && h.getUTCSeconds() === i ? h : null;
91
+ }, o = (a) => ({ hour: Number(a[1]), minute: Number(a[2]), second: Number(a[3] ?? 0) });
92
92
  try {
93
93
  if (n === "time") {
94
- const r = l.match(Be);
94
+ const r = l.match(ze);
95
95
  if (r === null) return l;
96
- const i = m(r), u = o(2e3, 1, 1, i.hour, i.minute, i.second);
97
- return u === null ? l : new Intl.DateTimeFormat(t, { timeStyle: r[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
96
+ const s = o(r), m = d(2e3, 1, 1, s.hour, s.minute, s.second);
97
+ return m === null ? l : new Intl.DateTimeFormat(t, { timeStyle: r[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
98
98
  }
99
- const s = l.match(Fe);
100
- if (s === null) return l;
101
- if (n === "date" && s[4] === void 0) {
102
- const r = o(Number(s[1]), Number(s[2]), Number(s[3]));
99
+ const a = l.match(He);
100
+ if (a === null) return l;
101
+ if (n === "date" && a[4] === void 0) {
102
+ const r = d(Number(a[1]), Number(a[2]), Number(a[3]));
103
103
  return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(r);
104
104
  }
105
- if (n === "datetime-local" && s[4] !== void 0) {
106
- const r = o(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
107
- return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(r);
105
+ if (n === "datetime-local" && a[4] !== void 0) {
106
+ const r = d(Number(a[1]), Number(a[2]), Number(a[3]), Number(a[4]), Number(a[5]), Number(a[6] ?? 0));
107
+ return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: a[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(r);
108
108
  }
109
109
  } catch {
110
110
  return l;
111
111
  }
112
112
  return l;
113
113
  }
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: 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
- return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
114
+ const Ze = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
+ function An({ label: n, help: l, error: t, disabled: d, readOnly: o, pinned: a, value: r, onChange: s, placeholder: m, type: b = "text", name: i, locale: h, min: c, max: f, step: p, minLength: g, maxLength: N, required: y }) {
116
+ const x = q(), M = o === !0 || a != null, C = M && Ze.has(b), R = b === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
117
+ return /* @__PURE__ */ e(Me, { id: x, label: n, help: l, error: t, pinned: a, children: /* @__PURE__ */ e(
118
118
  "input",
119
119
  {
120
120
  id: x,
121
- name: c,
121
+ name: i,
122
122
  type: C ? "text" : b,
123
123
  className: "cms-input",
124
- value: C ? Ke(b, r, h) : r,
124
+ value: C ? Re(b, r, h) : r,
125
125
  ...C ? { "data-value": r } : {},
126
126
  lang: h,
127
- placeholder: u,
128
- disabled: o,
127
+ placeholder: m,
128
+ disabled: d,
129
129
  readOnly: M,
130
- required: k,
131
- "aria-required": k || void 0,
132
- min: C ? void 0 : a,
133
- max: C ? void 0 : g,
130
+ required: y,
131
+ "aria-required": y || void 0,
132
+ min: C ? void 0 : c,
133
+ max: C ? void 0 : f,
134
134
  step: C ? void 0 : p,
135
- minLength: v,
135
+ minLength: g,
136
136
  maxLength: N,
137
- inputMode: b === "number" ? U ? "decimal" : "numeric" : void 0,
137
+ inputMode: b === "number" ? R ? "decimal" : "numeric" : void 0,
138
138
  "aria-invalid": t != null || void 0,
139
- "aria-describedby": Me(x, { help: l, error: t, pinned: s }),
140
- onChange: (K) => i == null ? void 0 : i(K.target.value)
139
+ "aria-describedby": Se(x, { help: l, error: t, pinned: a }),
140
+ onChange: (O) => s == null ? void 0 : s(O.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: b = 4, name: c, locale: h, minLength: a, maxLength: g, required: p }) {
145
- const v = q();
146
- return /* @__PURE__ */ e(Ce, { id: v, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
144
+ function En({ label: n, help: l, error: t, disabled: d, readOnly: o, pinned: a, value: r, onChange: s, placeholder: m, rows: b = 4, name: i, locale: h, minLength: c, maxLength: f, required: p }) {
145
+ const g = q();
146
+ return /* @__PURE__ */ e(Me, { id: g, label: n, help: l, error: t, pinned: a, children: /* @__PURE__ */ e(
147
147
  "textarea",
148
148
  {
149
- id: v,
150
- name: c,
149
+ id: g,
150
+ name: i,
151
151
  className: "cms-input cms-textarea",
152
152
  rows: b,
153
153
  value: r,
154
154
  lang: h,
155
- placeholder: u,
156
- disabled: o,
157
- readOnly: m === !0 || s != null,
155
+ placeholder: m,
156
+ disabled: d,
157
+ readOnly: o === !0 || a != null,
158
158
  required: p,
159
159
  "aria-required": p || void 0,
160
- minLength: a,
161
- maxLength: g,
160
+ minLength: c,
161
+ maxLength: f,
162
162
  "aria-invalid": t != null || void 0,
163
- "aria-describedby": Me(v, { help: l, error: t, pinned: s }),
164
- onChange: (N) => i == null ? void 0 : i(N.target.value)
163
+ "aria-describedby": Se(g, { help: l, error: t, pinned: a }),
164
+ onChange: (N) => s == null ? void 0 : s(N.target.value)
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: b }) {
169
- const c = q(), h = r.length === 0;
170
- return /* @__PURE__ */ e(Ce, { id: c, label: n, help: h ? u : l, error: t, children: /* @__PURE__ */ e(
168
+ function Dn({ label: n, help: l, error: t, disabled: d, readOnly: o, value: a, options: r, onChange: s, emptyText: m = "Nothing to choose from yet.", name: b }) {
169
+ const i = q(), h = r.length === 0;
170
+ return /* @__PURE__ */ e(Me, { id: i, label: n, help: h ? m : l, error: t, children: /* @__PURE__ */ e(
171
171
  "select",
172
172
  {
173
- id: c,
173
+ id: i,
174
174
  name: b,
175
175
  className: "cms-input cms-select",
176
- value: s,
177
- disabled: o || h,
178
- "aria-readonly": m || void 0,
176
+ value: a,
177
+ disabled: d || h,
178
+ "aria-readonly": o || void 0,
179
179
  "aria-invalid": t != null || void 0,
180
- "aria-describedby": Me(c, { help: h ? u : l, error: t }),
181
- onChange: (a) => {
182
- m || i == null || i(a.target.value);
180
+ "aria-describedby": Se(i, { help: h ? m : l, error: t }),
181
+ onChange: (c) => {
182
+ o || s == null || s(c.target.value);
183
183
  },
184
- children: r.map((a) => /* @__PURE__ */ e("option", { value: a.value, disabled: m && a.value !== s, children: a.label }, a.value))
184
+ children: r.map((c) => /* @__PURE__ */ e("option", { value: c.value, disabled: o && c.value !== a, children: c.label }, c.value))
185
185
  }
186
186
  ) });
187
187
  }
188
- function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help: s }) {
188
+ function Tn({ label: n, checked: l, onChange: t, disabled: d, readOnly: o, help: a }) {
189
189
  const r = q();
190
- return /* @__PURE__ */ d("div", { className: "cms-toggle-row", children: [
190
+ return /* @__PURE__ */ u("div", { className: "cms-toggle-row", children: [
191
191
  /* @__PURE__ */ e(
192
192
  "button",
193
193
  {
194
194
  id: r,
195
195
  type: "button",
196
196
  role: "switch",
197
- className: T("cms-toggle", l && "is-on"),
197
+ className: E("cms-toggle", l && "is-on"),
198
198
  "aria-checked": l,
199
- "aria-readonly": m || void 0,
200
- "aria-describedby": s != null ? `${r}-help` : void 0,
201
- disabled: o,
199
+ "aria-readonly": o || void 0,
200
+ "aria-describedby": a != null ? `${r}-help` : void 0,
201
+ disabled: d,
202
202
  onClick: () => {
203
- m || t == null || t(!l);
203
+ o || t == null || t(!l);
204
204
  },
205
205
  children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
206
206
  }
207
207
  ),
208
208
  /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: r, children: n }),
209
- s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${r}-help`, children: s }) : null
209
+ a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${r}-help`, children: a }) : null
210
210
  ] });
211
211
  }
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: b }) {
214
- const [c, h] = D(n), [a, g] = D(!1), p = R(null), v = R(null), N = q();
212
+ const Ve = 150;
213
+ function $e({ open: n, title: l, onClose: t, dirty: d = !1, onDirtyClose: o, children: a, footer: r, closeLabel: s = "Close", initialFocus: m, className: b }) {
214
+ const [i, h] = A(n), [c, f] = A(!1), p = K(null), g = K(null), N = q();
215
215
  if (J(() => {
216
216
  if (n) {
217
- v.current = document.activeElement, h(!0), g(!1);
217
+ g.current = document.activeElement, h(!0), f(!1);
218
218
  return;
219
219
  }
220
- if (!c) return;
221
- g(!0);
220
+ if (!i) return;
221
+ f(!0);
222
222
  const x = window.setTimeout(() => {
223
223
  var M, C;
224
- h(!1), g(!1), (C = (M = v.current) == null ? void 0 : M.focus) == null || C.call(M);
225
- }, Oe);
224
+ h(!1), f(!1), (C = (M = g.current) == null ? void 0 : M.focus) == null || C.call(M);
225
+ }, Ve);
226
226
  return () => window.clearTimeout(x);
227
- }, [n, c]), J(() => {
227
+ }, [n, i]), J(() => {
228
228
  var x, M;
229
- if (n && c) {
229
+ if (n && i) {
230
230
  const C = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
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();
231
+ (M = (m == null ? void 0 : m.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
- }, [n, c, u]), !c) return null;
234
- const k = () => {
235
- o ? m == null || m() : t();
233
+ }, [n, i, m]), !i) return null;
234
+ const y = () => {
235
+ d ? o == null || o() : t();
236
236
  };
237
- return xe(
238
- /* @__PURE__ */ e("div", { className: T("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
239
- x.target === x.currentTarget && k();
240
- }, children: /* @__PURE__ */ d(
237
+ return Ce(
238
+ /* @__PURE__ */ e("div", { className: E("cms-modal-scrim", c && "is-closing"), onMouseDown: (x) => {
239
+ x.target === x.currentTarget && y();
240
+ }, children: /* @__PURE__ */ u(
241
241
  "div",
242
242
  {
243
243
  ref: p,
244
- className: T("cms-modal", b, a && "is-closing", o && "is-dirty"),
244
+ className: E("cms-modal", b, c && "is-closing", d && "is-dirty"),
245
245
  role: "dialog",
246
246
  "aria-modal": "true",
247
247
  "aria-labelledby": N,
@@ -249,20 +249,20 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
249
249
  onKeyDown: (x) => {
250
250
  var M;
251
251
  if (x.key === "Escape")
252
- x.stopPropagation(), k();
252
+ x.stopPropagation(), y();
253
253
  else if (x.key === "Tab") {
254
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 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());
256
+ const R = C[0], O = C[C.length - 1];
257
+ x.shiftKey && document.activeElement === R ? (x.preventDefault(), O.focus()) : !x.shiftKey && document.activeElement === O && (x.preventDefault(), R.focus());
258
258
  }
259
259
  },
260
260
  children: [
261
- /* @__PURE__ */ d("header", { className: "cms-modal__head", children: [
261
+ /* @__PURE__ */ u("header", { className: "cms-modal__head", children: [
262
262
  /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, children: l }),
263
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: k, children: /* @__PURE__ */ e(z, { name: "close" }) })
263
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: y, children: /* @__PURE__ */ e(z, { name: "close" }) })
264
264
  ] }),
265
- /* @__PURE__ */ e("div", { className: "cms-modal__body", children: s }),
265
+ /* @__PURE__ */ e("div", { className: "cms-modal__body", children: a }),
266
266
  r != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: r }) : null
267
267
  ]
268
268
  }
@@ -270,20 +270,20 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
270
270
  document.body
271
271
  );
272
272
  }
273
- function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel: m, cancelLabel: s, closeLabel: r, onConfirm: i, onCancel: u }) {
274
- const b = o === "discard-changes";
273
+ function Ln({ open: n, title: l, message: t, kind: d = "default", confirmLabel: o, cancelLabel: a, closeLabel: r, onConfirm: s, onCancel: m }) {
274
+ const b = d === "discard-changes";
275
275
  return /* @__PURE__ */ e(
276
- Le,
276
+ $e,
277
277
  {
278
278
  open: n,
279
279
  title: l,
280
- onClose: u,
280
+ onClose: m,
281
281
  ...r === void 0 ? {} : { closeLabel: r },
282
- footer: /* @__PURE__ */ d(S, { children: [
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") })
282
+ footer: /* @__PURE__ */ u(S, { children: [
283
+ /* @__PURE__ */ e(ne, { onClick: m, children: a ?? (b ? "Keep editing" : "Cancel") }),
284
+ /* @__PURE__ */ e(ne, { variant: d === "default" ? "primary" : "danger", onClick: s, children: o ?? (b ? "Discard changes" : "Confirm") })
285
285
  ] }),
286
- children: o !== "default" ? /* @__PURE__ */ d("p", { className: "cms-confirm__warning", children: [
286
+ children: d !== "default" ? /* @__PURE__ */ u("p", { className: "cms-confirm__warning", children: [
287
287
  /* @__PURE__ */ e(z, { name: "warning" }),
288
288
  " ",
289
289
  t
@@ -291,179 +291,184 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
291
291
  }
292
292
  );
293
293
  }
294
- function Mn({ kind: n, message: l, action: t, onDismiss: o, dismissLabel: m = "Dismiss" }) {
295
- return /* @__PURE__ */ d("div", { className: T("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
294
+ function $n({ kind: n, message: l, action: t, onDismiss: d, dismissLabel: o = "Dismiss" }) {
295
+ return /* @__PURE__ */ u("div", { className: E("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,
299
- o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": m, onClick: o, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
299
+ d ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": o, onClick: d, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
300
300
  ] });
301
301
  }
302
- function Sn({ children: n }) {
302
+ function Pn({ children: n }) {
303
303
  return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
304
304
  }
305
- function Ue({ what: n, layout: l = "inline" }) {
306
- return /* @__PURE__ */ d("div", { className: T("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
305
+ function We({ what: n, layout: l = "inline" }) {
306
+ return /* @__PURE__ */ u("div", { className: E("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 Re({ title: n, hint: l, action: t }) {
312
- return /* @__PURE__ */ d("div", { className: "cms-empty", children: [
311
+ function je({ title: n, hint: l, action: t }) {
312
+ return /* @__PURE__ */ u("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 ze({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
- return /* @__PURE__ */ d("div", { className: "cms-error-banner", role: "alert", children: [
318
+ function qe({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
+ return /* @__PURE__ */ u("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 }),
322
322
  l ? /* @__PURE__ */ e(ne, { onClick: l, children: t }) : null
323
323
  ] });
324
324
  }
325
325
  const ye = 300;
326
- function Ze() {
326
+ function Ye() {
327
327
  if (typeof window > "u" || typeof getComputedStyle != "function") return ye;
328
328
  const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), l = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
329
329
  return Number.isFinite(l) && l >= 0 ? l : ye;
330
330
  }
331
- function Ve() {
332
- return /* @__PURE__ */ d("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
331
+ function Xe() {
332
+ return /* @__PURE__ */ u("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
333
333
  /* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
334
334
  /* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
335
335
  ] });
336
336
  }
337
- function ee({ kind: n, title: l, description: t, action: o, placement: m = "block" }) {
338
- const [s, r] = D(n !== "loading");
337
+ function ee({ kind: n, title: l, description: t, action: d, placement: o = "block" }) {
338
+ const [a, r] = A(n !== "loading");
339
339
  return J(() => {
340
340
  if (n !== "loading") {
341
341
  r(!0);
342
342
  return;
343
343
  }
344
344
  r(!1);
345
- const i = window.setTimeout(() => r(!0), Ze());
346
- return () => window.clearTimeout(i);
347
- }, [n]), /* @__PURE__ */ d(
345
+ const s = window.setTimeout(() => r(!0), Ye());
346
+ return () => window.clearTimeout(s);
347
+ }, [n]), /* @__PURE__ */ u(
348
348
  "div",
349
349
  {
350
- className: T("cms-state", `cms-state--${n}`, `cms-state--${m}`, !s && "is-waiting"),
350
+ className: E("cms-state", `cms-state--${n}`, `cms-state--${o}`, !a && "is-waiting"),
351
351
  role: "status",
352
352
  "aria-live": "polite",
353
353
  "data-kind": n,
354
354
  children: [
355
- n === "loading" ? /* @__PURE__ */ e(Ve, {}) : null,
355
+ n === "loading" ? /* @__PURE__ */ e(Xe, {}) : null,
356
356
  n === "error" || n === "denied" ? /* @__PURE__ */ e(z, { name: n === "error" ? "warning" : "lock" }) : null,
357
- /* @__PURE__ */ d("span", { className: "cms-state__text", children: [
357
+ /* @__PURE__ */ u("span", { className: "cms-state__text", children: [
358
358
  /* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
359
359
  t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
360
360
  ] }),
361
- o !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ne, { className: "cms-state__action", onClick: o.onAction, children: o.label }) : null
361
+ d !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ne, { className: "cms-state__action", onClick: d.onAction, children: d.label }) : null
362
362
  ]
363
363
  }
364
364
  );
365
365
  }
366
- const $e = {
367
- mail: /* @__PURE__ */ d(S, { children: [
366
+ const Pe = {
367
+ mail: /* @__PURE__ */ u(S, { children: [
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
371
  // The envelope with its flap open above it: a message read, or the message itself again.
372
- "mail-open": /* @__PURE__ */ d(S, { children: [
372
+ "mail-open": /* @__PURE__ */ u(S, { children: [
373
373
  /* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
374
374
  /* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
375
375
  /* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
376
376
  ] }),
377
377
  // A clipboard: copy what is shown.
378
- copy: /* @__PURE__ */ d(S, { children: [
378
+ copy: /* @__PURE__ */ u(S, { children: [
379
379
  /* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
380
380
  /* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
381
381
  /* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
382
382
  ] }),
383
383
  chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
384
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" }),
385
- calendar: /* @__PURE__ */ d(S, { children: [
385
+ calendar: /* @__PURE__ */ u(S, { children: [
386
386
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
387
387
  /* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
388
388
  ] }),
389
- file: /* @__PURE__ */ d(S, { children: [
389
+ file: /* @__PURE__ */ u(S, { children: [
390
390
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
391
391
  /* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
392
392
  ] }),
393
393
  // The file, with code's angle brackets in place of its lines: a message's source.
394
- "file-code": /* @__PURE__ */ d(S, { children: [
394
+ "file-code": /* @__PURE__ */ u(S, { children: [
395
395
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
396
396
  /* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
397
397
  /* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
398
398
  ] }),
399
- image: /* @__PURE__ */ d(S, { children: [
399
+ image: /* @__PURE__ */ u(S, { children: [
400
400
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
401
401
  /* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
402
402
  /* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
403
403
  ] }),
404
- search: /* @__PURE__ */ d(S, { children: [
404
+ search: /* @__PURE__ */ u(S, { children: [
405
405
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
406
406
  /* @__PURE__ */ e("path", { d: "m20 20-4-4" })
407
407
  ] }),
408
- bell: /* @__PURE__ */ d(S, { children: [
408
+ bell: /* @__PURE__ */ u(S, { children: [
409
409
  /* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
410
410
  /* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
411
411
  ] }),
412
- pencil: /* @__PURE__ */ d(S, { children: [
412
+ pencil: /* @__PURE__ */ u(S, { children: [
413
413
  /* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
414
414
  /* @__PURE__ */ e("path", { d: "m13 7 4 4" })
415
415
  ] }),
416
- download: /* @__PURE__ */ d(S, { children: [
416
+ download: /* @__PURE__ */ u(S, { children: [
417
417
  /* @__PURE__ */ e("path", { d: "M12 4v11" }),
418
418
  /* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
419
419
  /* @__PURE__ */ e("path", { d: "M4 20h16" })
420
420
  ] }),
421
- print: /* @__PURE__ */ d(S, { children: [
421
+ print: /* @__PURE__ */ u(S, { children: [
422
422
  /* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
423
423
  /* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
424
424
  /* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
425
425
  ] }),
426
- "open-separately": /* @__PURE__ */ d(S, { children: [
426
+ "open-separately": /* @__PURE__ */ u(S, { children: [
427
427
  /* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
428
428
  /* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
429
429
  /* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
430
430
  ] }),
431
431
  star: /* @__PURE__ */ e("path", { d: "m12 3 2.8 5.8 6.2.9-4.5 4.4 1 6.2L12 17.4l-5.5 2.9 1-6.2L3 9.7l6.2-.9Z" }),
432
- send: /* @__PURE__ */ d(S, { children: [
432
+ send: /* @__PURE__ */ u(S, { children: [
433
433
  /* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
434
434
  /* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
435
435
  ] }),
436
- inbox: /* @__PURE__ */ d(S, { children: [
436
+ inbox: /* @__PURE__ */ u(S, { children: [
437
437
  /* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
438
438
  /* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
439
439
  ] }),
440
- archive: /* @__PURE__ */ d(S, { children: [
440
+ archive: /* @__PURE__ */ u(S, { children: [
441
441
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
442
442
  /* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
443
443
  ] }),
444
- trash: /* @__PURE__ */ d(S, { children: [
444
+ trash: /* @__PURE__ */ u(S, { children: [
445
445
  /* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
446
446
  /* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
447
447
  ] }),
448
448
  paperclip: /* @__PURE__ */ e("path", { d: "m20 11-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L14 7" }),
449
- mic: /* @__PURE__ */ d(S, { children: [
449
+ mic: /* @__PURE__ */ u(S, { children: [
450
450
  /* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
451
451
  /* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
452
452
  ] }),
453
- speaker: /* @__PURE__ */ d(S, { children: [
453
+ speaker: /* @__PURE__ */ u(S, { children: [
454
454
  /* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
455
455
  /* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
456
456
  ] }),
457
- "user-plus": /* @__PURE__ */ d(S, { children: [
457
+ "user-plus": /* @__PURE__ */ u(S, { children: [
458
458
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
459
459
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
460
460
  ] }),
461
+ // A person, nothing more: one whose account is gone.
462
+ user: /* @__PURE__ */ u(S, { children: [
463
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
464
+ /* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
465
+ ] }),
461
466
  "phone-off": /* @__PURE__ */ e("path", { d: "M3 14c5-5 13-5 18 0l-2 3-4-1v-3a10 10 0 0 0-6 0v3l-4 1Z" }),
462
- video: /* @__PURE__ */ d(S, { children: [
467
+ video: /* @__PURE__ */ u(S, { children: [
463
468
  /* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
464
469
  /* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
465
470
  ] }),
466
- info: /* @__PURE__ */ d(S, { children: [
471
+ info: /* @__PURE__ */ u(S, { children: [
467
472
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
468
473
  /* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
469
474
  ] }),
@@ -472,7 +477,7 @@ const $e = {
472
477
  plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
473
478
  folder: /* @__PURE__ */ e("path", { d: "M3 6a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" }),
474
479
  check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
475
- server: /* @__PURE__ */ d(S, { children: [
480
+ server: /* @__PURE__ */ u(S, { children: [
476
481
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
477
482
  /* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
478
483
  /* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
@@ -484,7 +489,7 @@ const $e = {
484
489
  more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
485
490
  important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
486
491
  };
487
- function P({ name: n, size: l = 20, label: t }) {
492
+ function T({ name: n, size: l = 20, label: t }) {
488
493
  return /* @__PURE__ */ e(
489
494
  "svg",
490
495
  {
@@ -499,11 +504,11 @@ function P({ name: n, size: l = 20, label: t }) {
499
504
  strokeLinejoin: "round",
500
505
  focusable: !1,
501
506
  ...t ? { role: "img", "aria-label": t } : { "aria-hidden": !0 },
502
- children: $e[n]
507
+ children: Pe[n]
503
508
  }
504
509
  );
505
510
  }
506
- const An = Object.keys($e), Ae = {
511
+ const In = Object.keys(Pe), Ee = {
507
512
  reply: "reply",
508
513
  "reply-all": "reply",
509
514
  forward: "forward",
@@ -523,117 +528,117 @@ const An = Object.keys($e), Ae = {
523
528
  "three-dots": "more"
524
529
  };
525
530
  function _e(n) {
526
- return Object.prototype.hasOwnProperty.call(Ae, n) ? Ae[n] : null;
531
+ return Object.prototype.hasOwnProperty.call(Ee, n) ? Ee[n] : null;
527
532
  }
528
- const We = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', je = 60;
529
- function qe(n) {
533
+ const Ge = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', Je = 60;
534
+ function Qe(n) {
530
535
  return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
531
536
  }
532
- function Xe(n) {
537
+ function en(n) {
533
538
  return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
534
539
  }
535
- function Ge(n) {
540
+ function nn(n) {
536
541
  return n.getClientRects().length > 0;
537
542
  }
538
- function Dn(n) {
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);
543
+ function Bn(n) {
544
+ const { name: l, badge: t, closeLabel: d, onClose: o, actions: a = [], moreLabel: r = "More", edit: s, editing: m, state: b, siblings: i, bar: h, thumbnails: c, strip: f, onZoom: p, children: g } = n, N = K(null), y = K(null), x = q(), [M, C] = A(!1), R = K(null);
540
545
  J(() => {
541
546
  var V;
542
- const y = document.activeElement, F = document.body.style.overflow;
543
- return document.body.style.overflow = "hidden", (V = k.current) == null || V.focus(), () => {
544
- var E;
545
- document.body.style.overflow = F, (E = y == null ? void 0 : y.focus) == null || E.call(y);
547
+ const w = document.activeElement, B = document.body.style.overflow;
548
+ return document.body.style.overflow = "hidden", (V = y.current) == null || V.focus(), () => {
549
+ var L;
550
+ document.body.style.overflow = B, (L = w == null ? void 0 : w.focus) == null || L.call(w);
546
551
  };
547
552
  }, []);
548
- const K = () => {
549
- u != null && u.dirty ? u.onDirtyClose() : m();
550
- }, le = (y) => {
551
- const F = y.touches.length === 1 ? y.touches[0] : void 0;
552
- U.current = F === void 0 || u !== void 0 || Xe(y.target) ? null : { x: F.clientX, y: F.clientY };
553
- }, Q = (y) => {
554
- var X, B;
555
- const F = U.current, V = y.changedTouches[0];
556
- if (U.current = null, F === null || V === void 0) return;
557
- const E = V.clientX - F.x;
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));
553
+ const O = () => {
554
+ m != null && m.dirty ? m.onDirtyClose() : o();
555
+ }, le = (w) => {
556
+ const B = w.touches.length === 1 ? w.touches[0] : void 0;
557
+ R.current = B === void 0 || m !== void 0 || en(w.target) ? null : { x: B.clientX, y: B.clientY };
558
+ }, Q = (w) => {
559
+ var Y, F;
560
+ const B = R.current, V = w.changedTouches[0];
561
+ if (R.current = null, B === null || V === void 0) return;
562
+ const L = V.clientX - B.x;
563
+ Math.abs(L) < Je || Math.abs(L) < Math.abs(V.clientY - B.y) || (L > 0 ? (Y = i == null ? void 0 : i.onPrevious) == null || Y.call(i) : (F = i == null ? void 0 : i.onNext) == null || F.call(i));
559
564
  };
560
- return xe(
561
- /* @__PURE__ */ d(
565
+ return Ce(
566
+ /* @__PURE__ */ u(
562
567
  "div",
563
568
  {
564
569
  ref: N,
565
- className: T("cms-viewer", u !== void 0 && "is-editing"),
570
+ className: E("cms-viewer", m !== void 0 && "is-editing"),
566
571
  role: "dialog",
567
572
  "aria-modal": "true",
568
573
  "aria-labelledby": x,
569
574
  tabIndex: -1,
570
- onKeyDown: (y) => {
571
- var F, V, E;
572
- if (y.key === "Escape") {
573
- if (u !== void 0) return;
574
- y.stopPropagation(), M ? C(!1) : m();
575
- } else if (y.key === "Tab") {
576
- const X = Array.from(((F = N.current) == null ? void 0 : F.querySelectorAll(We)) ?? []).filter(Ge);
577
- if (X.length === 0) return;
578
- const B = X[0], G = X[X.length - 1];
579
- y.shiftKey && document.activeElement === B ? (y.preventDefault(), G.focus()) : !y.shiftKey && document.activeElement === G && (y.preventDefault(), B.focus());
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")));
575
+ onKeyDown: (w) => {
576
+ var B, V, L;
577
+ if (w.key === "Escape") {
578
+ if (m !== void 0) return;
579
+ w.stopPropagation(), M ? C(!1) : o();
580
+ } else if (w.key === "Tab") {
581
+ const Y = Array.from(((B = N.current) == null ? void 0 : B.querySelectorAll(Ge)) ?? []).filter(nn);
582
+ if (Y.length === 0) return;
583
+ const F = Y[0], X = Y[Y.length - 1];
584
+ w.shiftKey && document.activeElement === F ? (w.preventDefault(), X.focus()) : !w.shiftKey && document.activeElement === X && (w.preventDefault(), F.focus());
585
+ } else m === void 0 && !Qe(w.target) && !w.ctrlKey && !w.metaKey && !w.altKey && (w.key === "ArrowLeft" ? (V = i == null ? void 0 : i.onPrevious) == null || V.call(i) : w.key === "ArrowRight" ? (L = i == null ? void 0 : i.onNext) == null || L.call(i) : w.key === "+" || w.key === "=" ? p == null || p("in") : w.key === "-" ? p == null || p("out") : w.key === "0" && (p == null || p("reset")));
581
586
  },
582
587
  children: [
583
- c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${c.position}` }) : null,
584
- /* @__PURE__ */ d("header", { className: "cms-viewer__top", children: [
585
- /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": o, onClick: K, children: /* @__PURE__ */ e(z, { name: "close" }) }),
588
+ i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${i.position}` }) : null,
589
+ /* @__PURE__ */ u("header", { className: "cms-viewer__top", children: [
590
+ /* @__PURE__ */ e("button", { ref: y, type: "button", className: "cms-viewer__icon", "aria-label": d, onClick: O, children: /* @__PURE__ */ e(z, { name: "close" }) }),
586
591
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
587
592
  /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
588
- c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: c.position }) : null,
593
+ i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: i.position }) : null,
589
594
  /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
590
- u !== void 0 ? /* @__PURE__ */ d(S, { children: [
591
- /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
592
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
593
- ] }) : /* @__PURE__ */ d(S, { children: [
594
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ d("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
595
- y.icon,
596
- y.label
597
- ] }, y.label)) }),
598
- i !== void 0 ? /* @__PURE__ */ d("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": i.label, onClick: i.onEdit, children: [
599
- i.icon,
600
- /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: i.label })
595
+ m !== void 0 ? /* @__PURE__ */ u(S, { children: [
596
+ /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: m.status }),
597
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.onDone, children: m.doneLabel })
598
+ ] }) : /* @__PURE__ */ u(S, { children: [
599
+ /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: a.map((w) => /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button", onClick: w.onSelect, children: [
600
+ w.icon,
601
+ w.label
602
+ ] }, w.label)) }),
603
+ s !== void 0 ? /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": s.label, onClick: s.onEdit, children: [
604
+ s.icon,
605
+ /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: s.label })
601
606
  ] }) : null,
602
- s.length > 0 ? /* @__PURE__ */ d("span", { className: "cms-viewer__more", children: [
603
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": M, onClick: () => C((y) => !y), children: /* @__PURE__ */ e(P, { name: "more" }) }),
604
- M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ d(
607
+ a.length > 0 ? /* @__PURE__ */ u("span", { className: "cms-viewer__more", children: [
608
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": M, onClick: () => C((w) => !w), children: /* @__PURE__ */ e(T, { name: "more" }) }),
609
+ M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: a.map((w) => /* @__PURE__ */ u(
605
610
  "button",
606
611
  {
607
612
  type: "button",
608
613
  className: "cms-viewer__button",
609
614
  onClick: () => {
610
- C(!1), y.onSelect();
615
+ C(!1), w.onSelect();
611
616
  },
612
617
  children: [
613
- y.icon,
614
- y.label
618
+ w.icon,
619
+ w.label
615
620
  ]
616
621
  },
617
- y.label
622
+ w.label
618
623
  )) }) : null
619
624
  ] }) : null
620
625
  ] })
621
626
  ] }),
622
- /* @__PURE__ */ d("div", { className: "cms-viewer__body", children: [
623
- a != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: a }) : null,
624
- /* @__PURE__ */ d("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: Q, children: [
625
- (u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ d("div", { className: "cms-viewer__conflict", role: "alert", children: [
626
- /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
627
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
628
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
627
+ /* @__PURE__ */ u("div", { className: "cms-viewer__body", children: [
628
+ c != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: c }) : null,
629
+ /* @__PURE__ */ u("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: Q, children: [
630
+ (m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ u("div", { className: "cms-viewer__conflict", role: "alert", children: [
631
+ /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: m.conflict.message }),
632
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: m.conflict.onOverwrite, children: m.conflict.overwriteLabel }),
633
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.conflict.onKeepBoth, children: m.conflict.keepBothLabel })
629
634
  ] }) : null,
630
- b === void 0 ? v : /* @__PURE__ */ e(Ye, { state: b }),
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,
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,
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
635
+ b === void 0 ? g : /* @__PURE__ */ e(ln, { state: b }),
636
+ m === void 0 && (i != null && i.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": i.previousLabel, title: i.previousLabel, onClick: i.onPrevious, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
637
+ m === void 0 && (i != null && i.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": i.nextLabel, title: i.nextLabel, onClick: i.onNext, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
638
+ m === void 0 && i !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(i.total, 7) }, (w, B) => /* @__PURE__ */ e("i", { className: B === Math.min(i.index, 6) ? "is-current" : void 0 }, B)) }) : null
634
639
  ] })
635
640
  ] }),
636
- u === void 0 && g != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: g }) : null,
641
+ m === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
637
642
  h != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: h }) : null
638
643
  ]
639
644
  }
@@ -641,7 +646,7 @@ function Dn(n) {
641
646
  document.body
642
647
  );
643
648
  }
644
- function Ye({ state: n }) {
649
+ function ln({ state: n }) {
645
650
  switch (n.kind) {
646
651
  case "loading":
647
652
  return /* @__PURE__ */ e(ee, { kind: "loading", title: n.title, placement: "page" });
@@ -669,156 +674,156 @@ function Ye({ state: n }) {
669
674
  );
670
675
  }
671
676
  }
672
- class Je extends Error {
677
+ class tn extends Error {
673
678
  constructor(l = "denied") {
674
679
  super(l), this.name = "FilePickerDenied";
675
680
  }
676
681
  }
677
682
  const Ne = (n, l) => `${n}
678
- ${l}`, Qe = (n, l) => n === "" ? l : `${n}/${l}`, en = 48;
679
- function Tn(n) {
680
- var me, ue;
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();
683
+ ${l}`, an = (n, l) => n === "" ? l : `${n}/${l}`, sn = 48;
684
+ function Fn(n) {
685
+ var ue, me;
686
+ const { open: l, spaces: t, list: d, disabledReason: o, budget: a, formatSize: r, labels: s, onConfirm: m, onCancel: b } = n, [i, h] = A(((ue = t[0]) == null ? void 0 : ue.id) ?? ""), [c, f] = A(""), [p, g] = A({ status: "loading" }), [N, y] = A(0), [x, M] = A(/* @__PURE__ */ new Map()), [C, R] = A(0), [O, le] = A(!1), Q = K(null), w = q();
682
687
  J(() => {
683
- var f;
684
- l && (h(((f = t[0]) == null ? void 0 : f.id) ?? ""), g(""), M(/* @__PURE__ */ new Map()), le(!1));
688
+ var _;
689
+ l && (h(((_ = t[0]) == null ? void 0 : _.id) ?? ""), f(""), M(/* @__PURE__ */ new Map()), le(!1));
685
690
  }, [l]), J(() => {
686
- if (!l || c === "") return;
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" })
691
+ if (!l || i === "") return;
692
+ let _ = !0;
693
+ return g({ status: "loading" }), R(0), d(i, c).then(
694
+ (k) => _ && g({ status: "ready", entries: k.entries, next: k.next ?? null, paging: !1 }),
695
+ (k) => _ && g({ status: k instanceof tn ? "denied" : "error" })
691
696
  ), () => {
692
- f = !1;
697
+ _ = !1;
693
698
  };
694
- }, [l, c, a, o, N]);
695
- const F = be(() => {
699
+ }, [l, i, c, d, N]);
700
+ const B = be(() => {
696
701
  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(
699
- (I) => v({ status: "ready", entries: [...w, ...I.entries], next: I.next ?? null, paging: !1 }),
700
- () => v({ status: "ready", entries: w, next: f, paging: !1 })
702
+ const _ = p.next, k = p.entries;
703
+ g({ ...p, paging: !0 }), d(i, c, _).then(
704
+ (I) => g({ status: "ready", entries: [...k, ...I.entries], next: I.next ?? null, paging: !1 }),
705
+ () => g({ status: "ready", entries: k, next: _, paging: !1 })
701
706
  );
702
- }, [p, o, c, a]), V = be((f) => {
703
- var w;
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;
707
+ }, [p, d, i, c]), V = be((_) => {
708
+ var k;
709
+ return ((k = a == null ? void 0 : a.cost) == null ? void 0 : k.call(a, _)) ?? _.size ?? 0;
710
+ }, [a]), L = Ke(() => [...x.values()], [x]), Y = L.reduce((_, k) => _ + (k.size ?? 0), 0), F = a === void 0 ? null : a.limitBytes - a.usedBytes - L.reduce((_, k) => _ + V(k), 0), X = F !== null && F < 0, ie = (_) => {
711
+ if (_.kind !== "file") return null;
712
+ const k = o == null ? void 0 : o(_);
713
+ return k || (F !== null && !x.has(Ne(i, _.id)) && V(_) > F ? s.overBudget : null);
714
+ }, ce = (_) => {
715
+ const k = Ne(i, _.id);
716
+ !x.has(k) && ie(_) !== null || M((I) => {
717
+ const U = new Map(I);
718
+ return U.has(k) ? U.delete(k) : U.set(k, { ..._, space: i, path: c }), U;
714
719
  });
715
- }, _ = (f) => g(Qe(a, f.name)), A = () => g(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), Z = (f) => M((w) => {
716
- const I = new Map(w);
717
- return I.delete(f), I;
718
- }), W = p.status === "ready" ? p.entries : [], L = (f) => {
719
- const w = W[C];
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)}`;
726
- return /* @__PURE__ */ d(
727
- Le,
720
+ }, v = (_) => f(an(c, _.name)), D = () => f(c.includes("/") ? c.slice(0, c.lastIndexOf("/")) : ""), Z = (_) => M((k) => {
721
+ const I = new Map(k);
722
+ return I.delete(_), I;
723
+ }), W = p.status === "ready" ? p.entries : [], $ = (_) => {
724
+ const k = W[C];
725
+ if (_.key === "ArrowDown" || _.key === "ArrowUp" || _.key === "Home" || _.key === "End") {
726
+ _.preventDefault();
727
+ const I = W.length - 1, U = _.key === "Home" ? 0 : _.key === "End" ? I : Math.min(I, Math.max(0, C + (_.key === "ArrowDown" ? 1 : -1)));
728
+ R(U), U >= I - 1 && B();
729
+ } else _.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (_.preventDefault(), v(k)) : _.key === " " && (k == null ? void 0 : k.kind) === "file" ? (_.preventDefault(), ce(k)) : _.key === "Backspace" && c !== "" && (_.preventDefault(), D());
730
+ }, j = c === "" ? [] : c.split("/"), oe = ((me = t.find((_) => _.id === i)) == null ? void 0 : me.name) ?? "", de = (_) => `${w}-entry-${String(_)}`;
731
+ return /* @__PURE__ */ u(
732
+ $e,
728
733
  {
729
734
  open: l,
730
- title: i.title,
735
+ title: s.title,
731
736
  onClose: b,
732
- closeLabel: i.close,
737
+ closeLabel: s.close,
733
738
  initialFocus: Q,
734
739
  className: "cms-file-picker",
735
- footer: /* @__PURE__ */ d("div", { className: "cms-file-picker__foot", children: [
736
- /* @__PURE__ */ d("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
737
- E.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(E.length, r(X)) }) : 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
740
+ footer: /* @__PURE__ */ u("div", { className: "cms-file-picker__foot", children: [
741
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
742
+ L.length > 0 ? /* @__PURE__ */ e("span", { children: s.total(L.length, r(Y)) }) : null,
743
+ a !== void 0 && F !== null ? /* @__PURE__ */ e("span", { className: E(X && "is-over"), children: X ? s.overBudget : s.left(r(Math.max(0, F)), r(a.limitBytes)) }) : null
739
744
  ] }),
740
- /* @__PURE__ */ d("div", { className: "cms-file-picker__actions", children: [
741
- /* @__PURE__ */ e(ne, { variant: "secondary", onClick: b, children: i.cancel }),
742
- /* @__PURE__ */ e(ne, { variant: "primary", disabled: E.length === 0 || G, onClick: () => u(E), children: i.confirm(E.length) })
745
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__actions", children: [
746
+ /* @__PURE__ */ e(ne, { variant: "secondary", onClick: b, children: s.cancel }),
747
+ /* @__PURE__ */ e(ne, { variant: "primary", disabled: L.length === 0 || X, onClick: () => m(L), children: s.confirm(L.length) })
743
748
  ] })
744
749
  ] }),
745
750
  children: [
746
- /* @__PURE__ */ d("div", { className: "cms-file-picker__top", children: [
747
- t.length > 1 ? /* @__PURE__ */ d("label", { className: "cms-file-picker__space", children: [
748
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: i.space }),
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)) })
751
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__top", children: [
752
+ t.length > 1 ? /* @__PURE__ */ u("label", { className: "cms-file-picker__space", children: [
753
+ /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: s.space }),
754
+ /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: i, onChange: (_) => {
755
+ h(_.target.value), f("");
756
+ }, children: t.map((_) => /* @__PURE__ */ e("option", { value: _.id, children: _.name }, _.id)) })
752
757
  ] }) : null,
753
- /* @__PURE__ */ d("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
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" }) }),
755
- /* @__PURE__ */ d("ol", { children: [
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 }) }),
757
- j.map((f, w) => {
758
- const I = j.slice(0, w + 1).join("/");
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);
758
+ /* @__PURE__ */ u("nav", { className: "cms-file-picker__path", "aria-label": s.path, children: [
759
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s.up, disabled: c === "", onClick: D, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
760
+ /* @__PURE__ */ u("ol", { children: [
761
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": c === "" ? "location" : void 0, onClick: () => f(""), children: oe }) }),
762
+ j.map((_, k) => {
763
+ const I = j.slice(0, k + 1).join("/");
764
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === c ? "location" : void 0, onClick: () => f(I), children: _ }) }, I);
760
765
  })
761
766
  ] })
762
767
  ] }),
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
768
+ L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": O, onClick: () => le((_) => !_), children: s.selected(L.length) }) : null
764
769
  ] }),
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: [
767
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: w.name }),
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)) }),
770
+ O && L.length > 0 ? /* @__PURE__ */ u("div", { className: "cms-file-picker__chosen", children: [
771
+ /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([_, k]) => /* @__PURE__ */ u("li", { children: [
772
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: k.name }),
773
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s.remove(k.name), onClick: () => Z(_), children: /* @__PURE__ */ e(z, { name: "close" }) })
774
+ ] }, _)) }),
770
775
  /* @__PURE__ */ e(ne, { variant: "secondary", onClick: () => {
771
776
  M(/* @__PURE__ */ new Map()), le(!1);
772
- }, children: i.clear })
777
+ }, children: s.clear })
773
778
  ] }) : null,
774
- /* @__PURE__ */ d("div", { className: "cms-file-picker__list", onScroll: (f) => {
775
- const w = f.currentTarget;
776
- w.scrollTop + w.clientHeight >= w.scrollHeight - en && F();
779
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__list", onScroll: (_) => {
780
+ const k = _.currentTarget;
781
+ k.scrollTop + k.clientHeight >= k.scrollHeight - sn && B();
777
782
  }, children: [
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,
782
- /* @__PURE__ */ d(
783
+ p.status === "loading" ? /* @__PURE__ */ e(ee, { kind: "loading", title: s.loading, placement: "block" }) : null,
784
+ p.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: s.error, placement: "block", action: { label: s.retry, onAction: () => y((_) => _ + 1) } }) : null,
785
+ p.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: s.denied, placement: "block" }) : null,
786
+ p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: s.empty, placement: "block" }) : null,
787
+ /* @__PURE__ */ u(
783
788
  "div",
784
789
  {
785
790
  ref: Q,
786
791
  role: "listbox",
787
792
  "aria-multiselectable": "true",
788
- "aria-label": i.files,
793
+ "aria-label": s.files,
789
794
  "aria-activedescendant": W.length > 0 ? de(C) : void 0,
790
795
  tabIndex: 0,
791
796
  className: "cms-file-picker__entries",
792
797
  hidden: p.status !== "ready" || W.length === 0,
793
- onKeyDown: L,
798
+ onKeyDown: $,
794
799
  children: [
795
- W.map((f, w) => {
796
- const I = f.kind === "file" && x.has(Ne(c, f.id)), H = ie(f);
797
- return /* @__PURE__ */ d(
800
+ W.map((_, k) => {
801
+ const I = _.kind === "file" && x.has(Ne(i, _.id)), U = ie(_);
802
+ return /* @__PURE__ */ u(
798
803
  "div",
799
804
  {
800
- id: de(w),
805
+ id: de(k),
801
806
  role: "option",
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"),
807
+ "aria-selected": _.kind === "file" ? I : void 0,
808
+ "aria-disabled": U !== null || void 0,
809
+ className: E("cms-file-picker__entry", k === C && "is-active", I && "is-ticked", U !== null && "is-disabled"),
805
810
  onClick: () => {
806
- U(w), f.kind === "folder" ? _(f) : ce(f);
811
+ R(k), _.kind === "folder" ? v(_) : ce(_);
807
812
  },
808
813
  children: [
809
- /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
810
- /* @__PURE__ */ e(P, { name: f.kind === "folder" ? "folder" : "file" }),
811
- /* @__PURE__ */ d("span", { className: "cms-file-picker__text", children: [
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
814
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(T, { name: "check" }) : null }),
815
+ /* @__PURE__ */ e(T, { name: _.kind === "folder" ? "folder" : "file" }),
816
+ /* @__PURE__ */ u("span", { className: "cms-file-picker__text", children: [
817
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: _.name }),
818
+ U !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: U }) : null
814
819
  ] }),
815
- f.kind === "file" && f.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(f.size) }) : null
820
+ _.kind === "file" && _.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(_.size) }) : null
816
821
  ]
817
822
  },
818
- f.id
823
+ _.id
819
824
  );
820
825
  }),
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
826
+ p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ee, { kind: "loading", title: s.loading, placement: "inline" }) }) : null
822
827
  ]
823
828
  }
824
829
  )
@@ -827,25 +832,25 @@ function Tn(n) {
827
832
  }
828
833
  );
829
834
  }
830
- function En({ title: n, scope: l, actions: t, backLink: o }) {
831
- return /* @__PURE__ */ d("header", { className: "cms-page-header", children: [
832
- o ? /* @__PURE__ */ d(
835
+ function Kn({ title: n, scope: l, actions: t, backLink: d }) {
836
+ return /* @__PURE__ */ u("header", { className: "cms-page-header", children: [
837
+ d ? /* @__PURE__ */ u(
833
838
  "a",
834
839
  {
835
840
  className: "cms-page-header__back",
836
- href: o.href ?? "#",
837
- onClick: (m) => {
838
- o.onBack && (m.preventDefault(), o.onBack());
841
+ href: d.href ?? "#",
842
+ onClick: (o) => {
843
+ d.onBack && (o.preventDefault(), d.onBack());
839
844
  },
840
845
  children: [
841
846
  /* @__PURE__ */ e(z, { name: "back" }),
842
847
  " ",
843
- o.label
848
+ d.label
844
849
  ]
845
850
  }
846
851
  ) : null,
847
- /* @__PURE__ */ d("div", { className: "cms-page-header__row", children: [
848
- /* @__PURE__ */ d("div", { className: "cms-page-header__titles", children: [
852
+ /* @__PURE__ */ u("div", { className: "cms-page-header__row", children: [
853
+ /* @__PURE__ */ u("div", { className: "cms-page-header__titles", children: [
849
854
  /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
850
855
  l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
851
856
  ] }),
@@ -853,30 +858,30 @@ function En({ title: n, scope: l, actions: t, backLink: o }) {
853
858
  ] })
854
859
  ] });
855
860
  }
856
- function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
857
- const m = R([]), s = (r, i) => {
861
+ function On({ tabs: n, active: l, onSelect: t, label: d }) {
862
+ const o = K([]), a = (r, s) => {
858
863
  var h;
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;
864
+ const m = n.length - 1, b = r.key === "ArrowRight" ? s === m ? 0 : s + 1 : r.key === "ArrowLeft" ? s === 0 ? m : s - 1 : r.key === "Home" ? 0 : r.key === "End" ? m : null;
860
865
  if (b === null) return;
861
866
  r.preventDefault();
862
- const c = n[b];
863
- c && (t(c.id), (h = m.current[b]) == null || h.focus());
867
+ const i = n[b];
868
+ i && (t(i.id), (h = o.current[b]) == null || h.focus());
864
869
  };
865
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": o, children: n.map((r, i) => {
866
- const u = r.id === l;
867
- return /* @__PURE__ */ d(
870
+ return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": d, children: n.map((r, s) => {
871
+ const m = r.id === l;
872
+ return /* @__PURE__ */ u(
868
873
  "button",
869
874
  {
870
875
  ref: (b) => {
871
- m.current[i] = b;
876
+ o.current[s] = b;
872
877
  },
873
878
  type: "button",
874
879
  role: "tab",
875
- className: T("cms-tab", u && "is-active"),
876
- "aria-selected": u,
877
- tabIndex: u ? 0 : -1,
880
+ className: E("cms-tab", m && "is-active"),
881
+ "aria-selected": m,
882
+ tabIndex: m ? 0 : -1,
878
883
  onClick: () => t(r.id),
879
- onKeyDown: (b) => s(b, i),
884
+ onKeyDown: (b) => a(b, s),
880
885
  children: [
881
886
  r.label,
882
887
  r.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: r.count }) : null
@@ -886,85 +891,89 @@ function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
886
891
  );
887
892
  }) });
888
893
  }
889
- function nn(n) {
890
- var o;
891
- const l = n.trim().split(/\s+/).filter(Boolean);
892
- return (l.length > 1 ? [l[0][0], l[l.length - 1][0]] : [(o = l[0]) == null ? void 0 : o[0]]).filter(Boolean).join("").toUpperCase();
894
+ function rn(n) {
895
+ const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (o) => {
896
+ var a;
897
+ return (a = o == null ? void 0 : o.match(/[\p{L}\p{N}]/u)) == null ? void 0 : a[0];
898
+ };
899
+ return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
893
900
  }
894
- function ln(n) {
901
+ function cn(n) {
895
902
  let l = 0;
896
903
  for (const t of n.trim().toLowerCase())
897
904
  l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
898
905
  return l % 6 + 1;
899
906
  }
900
- function ve({ name: n, pictureUrl: l, presence: t, size: o = 32 }) {
901
- return /* @__PURE__ */ d(
907
+ function ve({ name: n, pictureUrl: l, presence: t, connection: d, deleted: o = !1, size: a = 32 }) {
908
+ const r = d !== void 0 ? `is-${d.state === "offline" ? "disconnected" : d.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, s = d !== void 0 ? `${n}, ${d.label}` : t ? `${n}, ${t}` : n;
909
+ return /* @__PURE__ */ u(
902
910
  "span",
903
911
  {
904
- className: `cms-avatar cms-avatar--tint-${ln(n)}`,
905
- style: { width: o, height: o, fontSize: Math.round(o * 0.4) },
912
+ className: E("cms-avatar", o ? "cms-avatar--deleted" : `cms-avatar--tint-${cn(n)}`),
913
+ style: { width: a, height: a, fontSize: Math.round(a * 0.4) },
906
914
  role: "img",
907
- "aria-label": t ? `${n}, ${t}` : n,
915
+ "aria-label": s,
916
+ ...d === void 0 ? {} : { title: d.label },
908
917
  children: [
909
- l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: nn(n) }),
910
- t ? /* @__PURE__ */ e("span", { className: T("cms-avatar__presence", `is-${t}`), "aria-hidden": "true" }) : null
918
+ o ? /* @__PURE__ */ e(T, { name: "user", size: Math.round(a * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: rn(n) }),
919
+ r === null ? null : /* @__PURE__ */ e("span", { className: E("cms-avatar__presence", r), "aria-hidden": "true" })
911
920
  ]
912
921
  }
913
922
  );
914
923
  }
915
- function tn({ count: n, label: l, max: t = 99 }) {
916
- return n <= 0 ? null : /* @__PURE__ */ d("span", { className: "cms-badge", children: [
924
+ function on({ count: n, label: l, max: t = 99 }) {
925
+ return n <= 0 ? null : /* @__PURE__ */ u("span", { className: "cms-badge", children: [
917
926
  /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
918
927
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
919
928
  ] });
920
929
  }
921
- function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s, search: r, account: i, children: u, railLabel: b = "Sections" }) {
922
- return /* @__PURE__ */ d("div", { className: "cms-shell", children: [
923
- /* @__PURE__ */ d("nav", { className: "cms-shell__rail", "aria-label": b, children: [
930
+ function Un({ product: n, mark: l, rail: t, active: d, onNavigate: o, server: a, search: r, account: s, children: m, railLabel: b = "Sections" }) {
931
+ return /* @__PURE__ */ u("div", { className: "cms-shell", children: [
932
+ /* @__PURE__ */ u("nav", { className: "cms-shell__rail", "aria-label": b, children: [
924
933
  /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
925
- /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((c) => {
926
- const h = c.id === o;
927
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
934
+ /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((i) => {
935
+ const h = i.id === d;
936
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(
928
937
  "a",
929
938
  {
930
- href: c.href,
931
- className: T("cms-shell__item", h && "is-active"),
939
+ href: i.href,
940
+ className: E("cms-shell__item", h && "is-active"),
932
941
  "aria-current": h ? "page" : void 0,
933
- title: c.label,
934
- onClick: (a) => {
935
- m && (a.preventDefault(), m(c.id));
942
+ title: i.label,
943
+ onClick: (c) => {
944
+ o && (c.preventDefault(), o(i.id));
936
945
  },
937
946
  children: [
938
- /* @__PURE__ */ d("span", { className: "cms-shell__icon", children: [
939
- /* @__PURE__ */ e(P, { name: c.icon, size: 22 }),
940
- c.badge ? /* @__PURE__ */ e(tn, { count: c.badge.count, label: c.badge.label }) : null
947
+ /* @__PURE__ */ u("span", { className: "cms-shell__icon", children: [
948
+ /* @__PURE__ */ e(T, { name: i.icon, size: 22 }),
949
+ i.badge ? /* @__PURE__ */ e(on, { count: i.badge.count, label: i.badge.label }) : null
941
950
  ] }),
942
- /* @__PURE__ */ e("span", { className: "cms-shell__label", children: c.label })
951
+ /* @__PURE__ */ e("span", { className: "cms-shell__label", children: i.label })
943
952
  ]
944
953
  }
945
- ) }, c.id);
954
+ ) }, i.id);
946
955
  }) })
947
956
  ] }),
948
- /* @__PURE__ */ d("header", { className: "cms-shell__top", children: [
957
+ /* @__PURE__ */ u("header", { className: "cms-shell__top", children: [
949
958
  /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
950
- s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
959
+ a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: a }) : null,
951
960
  r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: r }) : null,
952
- i != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: i }) : null
961
+ s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: s }) : null
953
962
  ] }),
954
- /* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
963
+ /* @__PURE__ */ e("main", { className: "cms-shell__main", children: m })
955
964
  ] });
956
965
  }
957
- function In({ label: n, placeholder: l, value: t, onChange: o, onSearch: m }) {
958
- return /* @__PURE__ */ d(
966
+ function Hn({ label: n, placeholder: l, value: t, onChange: d, onSearch: o }) {
967
+ return /* @__PURE__ */ u(
959
968
  "form",
960
969
  {
961
970
  role: "search",
962
971
  className: "cms-search",
963
- onSubmit: (s) => {
964
- s.preventDefault(), m == null || m(t);
972
+ onSubmit: (a) => {
973
+ a.preventDefault(), o == null || o(t);
965
974
  },
966
975
  children: [
967
- /* @__PURE__ */ e(P, { name: "search", size: 18 }),
976
+ /* @__PURE__ */ e(T, { name: "search", size: 18 }),
968
977
  /* @__PURE__ */ e(
969
978
  "input",
970
979
  {
@@ -973,39 +982,39 @@ function In({ label: n, placeholder: l, value: t, onChange: o, onSearch: m }) {
973
982
  "aria-label": n,
974
983
  placeholder: l,
975
984
  value: t,
976
- onChange: (s) => o(s.target.value)
985
+ onChange: (a) => d(a.target.value)
977
986
  }
978
987
  )
979
988
  ]
980
989
  }
981
990
  );
982
991
  }
983
- function Pn({ options: n, value: l, onChange: t, label: o }) {
984
- const m = R([]), s = (r, i) => {
992
+ function dn({ options: n, value: l, onChange: t, label: d }) {
993
+ const o = K([]), a = (r, s) => {
985
994
  var h;
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;
995
+ const m = n.length - 1, b = r.key === "ArrowRight" || r.key === "ArrowDown" ? s === m ? 0 : s + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? s === 0 ? m : s - 1 : null;
987
996
  if (b === null) return;
988
997
  r.preventDefault();
989
- const c = n[b];
990
- c && (t(c.id), (h = m.current[b]) == null || h.focus());
998
+ const i = n[b];
999
+ i && (t(i.id), (h = o.current[b]) == null || h.focus());
991
1000
  };
992
- return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": o, children: n.map((r, i) => {
993
- const u = r.id === l;
994
- return /* @__PURE__ */ d(
1001
+ return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": d, children: n.map((r, s) => {
1002
+ const m = r.id === l;
1003
+ return /* @__PURE__ */ u(
995
1004
  "button",
996
1005
  {
997
1006
  ref: (b) => {
998
- m.current[i] = b;
1007
+ o.current[s] = b;
999
1008
  },
1000
1009
  type: "button",
1001
1010
  role: "radio",
1002
- "aria-checked": u,
1003
- tabIndex: u ? 0 : -1,
1004
- className: T("cms-chip", u && "is-on"),
1011
+ "aria-checked": m,
1012
+ tabIndex: m ? 0 : -1,
1013
+ className: E("cms-chip", m && "is-on"),
1005
1014
  onClick: () => t(r.id),
1006
- onKeyDown: (b) => s(b, i),
1015
+ onKeyDown: (b) => a(b, s),
1007
1016
  children: [
1008
- u ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
1017
+ m ? /* @__PURE__ */ e(T, { name: "check", size: 16 }) : null,
1009
1018
  r.label
1010
1019
  ]
1011
1020
  },
@@ -1014,17 +1023,17 @@ function Pn({ options: n, value: l, onChange: t, label: o }) {
1014
1023
  }) });
1015
1024
  }
1016
1025
  const De = 16;
1017
- function an(n, l, t) {
1018
- const o = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
1019
- let m = o.reduce((s, r) => s + r, 0) + t - l;
1020
- for (let s = o.length - 1; s >= 0 && m > 0; s -= 1) {
1021
- const r = Math.min(m, o[s] - n[s].min);
1022
- o[s] = o[s] - r, m -= r;
1026
+ function un(n, l, t) {
1027
+ const d = n.map((a) => Math.min(Math.max(a.width, a.min), a.max));
1028
+ let o = d.reduce((a, r) => a + r, 0) + t - l;
1029
+ for (let a = d.length - 1; a >= 0 && o > 0; a -= 1) {
1030
+ const r = Math.min(o, d[a] - n[a].min);
1031
+ d[a] = d[a] - r, o -= r;
1023
1032
  }
1024
- return o;
1033
+ return d;
1025
1034
  }
1026
- function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onResize: r }) {
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);
1035
+ function mn({ index: n, size: l, shown: t, others: d, room: o, lastMin: a, onResize: r }) {
1036
+ const s = Math.max(l.min, Math.min(l.max, o > 0 ? o - d - a : l.max)), m = (h) => Math.round(Math.min(Math.max(h, l.min), s)), b = K(null), i = (h, c) => r == null ? void 0 : r(n, m(h), c);
1028
1037
  return /* @__PURE__ */ e(
1029
1038
  "div",
1030
1039
  {
@@ -1034,74 +1043,74 @@ function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onRes
1034
1043
  "aria-label": l.label,
1035
1044
  "aria-valuenow": t,
1036
1045
  "aria-valuemin": l.min,
1037
- "aria-valuemax": i,
1046
+ "aria-valuemax": s,
1038
1047
  className: "cms-panes__splitter",
1039
1048
  style: { "--split-at": `var(--split-pane-end-${String(n)})` },
1040
1049
  onPointerDown: (h) => {
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"));
1050
+ var c, f, p;
1051
+ h.button > 0 || (h.preventDefault(), (f = (c = h.currentTarget).setPointerCapture) == null || f.call(c, h.pointerId), b.current = { x: h.clientX, from: t, last: t }, (p = h.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
1043
1052
  },
1044
1053
  onPointerMove: (h) => {
1045
- const a = b.current;
1046
- a === null || !Number.isFinite(h.clientX) || (a.last = u(a.from + h.clientX - a.x), c(a.last, !1));
1054
+ const c = b.current;
1055
+ c === null || !Number.isFinite(h.clientX) || (c.last = m(c.from + h.clientX - c.x), i(c.last, !1));
1047
1056
  },
1048
1057
  onPointerUp: (h) => {
1049
- var g;
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));
1058
+ var f;
1059
+ const c = b.current;
1060
+ c !== null && (b.current = null, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), i(c.last, !0));
1052
1061
  },
1053
1062
  onPointerCancel: (h) => {
1054
- var g;
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);
1063
+ var f;
1064
+ const c = b.current;
1065
+ b.current = null, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), c !== null && i(c.last, !0);
1057
1066
  },
1058
- onDoubleClick: () => c(l.reset, !0),
1067
+ onDoubleClick: () => i(l.reset, !0),
1059
1068
  onKeyDown: (h) => {
1060
- const a = h.key === "ArrowLeft" ? t - De : h.key === "ArrowRight" ? t + De : h.key === "Home" ? l.min : h.key === "End" ? i : h.key === "Enter" ? l.reset : null;
1061
- a !== null && (h.preventDefault(), c(a, !0));
1069
+ const c = h.key === "ArrowLeft" ? t - De : h.key === "ArrowRight" ? t + De : h.key === "Home" ? l.min : h.key === "End" ? s : h.key === "Enter" ? l.reset : null;
1070
+ c !== null && (h.preventDefault(), i(c, !0));
1062
1071
  }
1063
1072
  }
1064
1073
  );
1065
1074
  }
1066
- function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize: s }) {
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);
1068
- ke(() => {
1069
- const p = i.current;
1075
+ function zn({ panes: n, active: l, back: t, sizes: d, lastMin: o = 360, onResize: a }) {
1076
+ const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), s = K(null), [m, b] = A(0), i = (d ?? []).slice(0, n.length - 1), h = i.length === n.length - 1 && i.every((p) => p !== void 0);
1077
+ xe(() => {
1078
+ const p = s.current;
1070
1079
  if (p === null || !h) return;
1071
- const v = () => b(p.clientWidth);
1072
- if (v(), typeof ResizeObserver > "u") return;
1073
- const N = new ResizeObserver(v);
1080
+ const g = () => b(p.clientWidth);
1081
+ if (g(), typeof ResizeObserver > "u") return;
1082
+ const N = new ResizeObserver(g);
1074
1083
  return N.observe(p), () => N.disconnect();
1075
1084
  }, [h]);
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`],
1078
- [`--split-pane-end-${String(v)}`, `${String(a.slice(0, v + 1).reduce((N, k) => N + k, 0))}px`]
1085
+ const c = h ? un(i, m > 0 ? m : Number.POSITIVE_INFINITY, o) : [], f = h ? Object.fromEntries(c.flatMap((p, g) => [
1086
+ [`--split-pane-${String(g)}`, `${String(p)}px`],
1087
+ [`--split-pane-end-${String(g)}`, `${String(c.slice(0, g + 1).reduce((N, y) => N + y, 0))}px`]
1079
1088
  ])) : void 0;
1080
- return /* @__PURE__ */ d(
1089
+ return /* @__PURE__ */ u(
1081
1090
  "div",
1082
1091
  {
1083
- ref: i,
1084
- className: T("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1092
+ ref: s,
1093
+ className: E("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1085
1094
  "data-active": r,
1086
- style: g,
1095
+ style: f,
1087
1096
  children: [
1088
- n.map((p, v) => /* @__PURE__ */ d("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - v, children: [
1089
- v === r && t ? /* @__PURE__ */ d("a", { className: "cms-panes__back", href: t.href, children: [
1090
- /* @__PURE__ */ e(P, { name: "chevron-left", size: 18 }),
1097
+ n.map((p, g) => /* @__PURE__ */ u("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - g, children: [
1098
+ g === r && t ? /* @__PURE__ */ u("a", { className: "cms-panes__back", href: t.href, children: [
1099
+ /* @__PURE__ */ e(T, { name: "chevron-left", size: 18 }),
1091
1100
  t.label
1092
1101
  ] }) : null,
1093
1102
  p.content
1094
1103
  ] }, p.label)),
1095
- h ? c.map((p, v) => /* @__PURE__ */ e(
1096
- sn,
1104
+ h ? i.map((p, g) => /* @__PURE__ */ e(
1105
+ mn,
1097
1106
  {
1098
- index: v,
1107
+ index: g,
1099
1108
  size: p,
1100
- shown: a[v],
1101
- others: a.reduce((N, k, x) => x === v ? N : N + k, 0),
1102
- room: u,
1103
- lastMin: m,
1104
- onResize: s
1109
+ shown: c[g],
1110
+ others: c.reduce((N, y, x) => x === g ? N : N + y, 0),
1111
+ room: m,
1112
+ lastMin: o,
1113
+ onResize: a
1105
1114
  },
1106
1115
  p.label
1107
1116
  )) : null
@@ -1109,27 +1118,27 @@ function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize
1109
1118
  }
1110
1119
  );
1111
1120
  }
1112
- const rn = { attachment: "Has an attachment", unread: "Unread" };
1113
- function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment: s, selected: r, onOpen: i, labels: u }) {
1114
- const b = re(rn, u);
1115
- return /* @__PURE__ */ d(
1121
+ const hn = { attachment: "Has an attachment", unread: "Unread" };
1122
+ function Rn({ from: n, subject: l, preview: t, time: d, unread: o, hasAttachment: a, selected: r, onOpen: s, labels: m }) {
1123
+ const b = re(hn, m);
1124
+ return /* @__PURE__ */ u(
1116
1125
  "button",
1117
1126
  {
1118
1127
  type: "button",
1119
- className: T("cms-mail-row", m && "is-unread", r && "is-selected"),
1128
+ className: E("cms-mail-row", o && "is-unread", r && "is-selected"),
1120
1129
  "aria-current": r ? "true" : void 0,
1121
- onClick: i,
1130
+ onClick: s,
1122
1131
  children: [
1123
1132
  /* @__PURE__ */ e(ve, { name: n, size: 40 }),
1124
- /* @__PURE__ */ d("span", { className: "cms-mail-row__body", children: [
1125
- /* @__PURE__ */ d("span", { className: "cms-mail-row__line", children: [
1133
+ /* @__PURE__ */ u("span", { className: "cms-mail-row__body", children: [
1134
+ /* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
1126
1135
  /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
1127
- s ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: b.attachment }) : null,
1128
- /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: o })
1136
+ a ? /* @__PURE__ */ e(T, { name: "paperclip", size: 16, label: b.attachment }) : null,
1137
+ /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: d })
1129
1138
  ] }),
1130
- /* @__PURE__ */ d("span", { className: "cms-mail-row__line", children: [
1139
+ /* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
1131
1140
  /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
1132
- m ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": b.unread }) : null
1141
+ o ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": b.unread }) : null
1133
1142
  ] }),
1134
1143
  /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
1135
1144
  ] })
@@ -1137,23 +1146,23 @@ function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment
1137
1146
  }
1138
1147
  );
1139
1148
  }
1140
- function Kn({ direction: n, children: l, time: t, read: o, readLabel: m = "Read" }) {
1141
- return /* @__PURE__ */ d("div", { className: T("cms-bubble", `cms-bubble--${n}`), children: [
1149
+ function Zn({ direction: n, children: l, time: t, read: d, readLabel: o = "Read" }) {
1150
+ return /* @__PURE__ */ u("div", { className: E("cms-bubble", `cms-bubble--${n}`), children: [
1142
1151
  /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
1143
- /* @__PURE__ */ d("div", { className: "cms-bubble__meta", children: [
1152
+ /* @__PURE__ */ u("div", { className: "cms-bubble__meta", children: [
1144
1153
  t,
1145
- n === "out" && o ? /* @__PURE__ */ d(S, { children: [
1154
+ n === "out" && d ? /* @__PURE__ */ u(S, { children: [
1146
1155
  " · ",
1147
- m
1156
+ o
1148
1157
  ] }) : null
1149
1158
  ] })
1150
1159
  ] });
1151
1160
  }
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 }) {
1153
- const h = q(), a = c ?? l.trim() !== "", g = (v) => {
1154
- v.preventDefault(), a && o();
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: [
1161
+ function Vn({ label: n, value: l, onChange: t, onSend: d, onAttach: o, placeholder: a, variant: r = "chat", sendLabel: s = "Send", attachLabel: m = "Attach a file", leading: b, canSend: i }) {
1162
+ const h = q(), c = i ?? l.trim() !== "", f = (g) => {
1163
+ g.preventDefault(), c && d();
1164
+ }, p = o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: o, children: /* @__PURE__ */ e(T, { name: "paperclip" }) }) : null;
1165
+ return /* @__PURE__ */ u("form", { className: E("cms-composer", `cms-composer--${r}`), onSubmit: f, children: [
1157
1166
  /* @__PURE__ */ e("label", { htmlFor: h, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1158
1167
  r === "chat" ? p : null,
1159
1168
  /* @__PURE__ */ e(
@@ -1162,24 +1171,24 @@ function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placehold
1162
1171
  id: h,
1163
1172
  className: "cms-composer__input",
1164
1173
  rows: r === "reply" ? 3 : 1,
1165
- placeholder: s,
1174
+ placeholder: a,
1166
1175
  value: l,
1167
- onChange: (v) => t(v.target.value),
1168
- onKeyDown: (v) => {
1169
- v.nativeEvent.isComposing || v.keyCode === 229 || r === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a && o());
1176
+ onChange: (g) => t(g.target.value),
1177
+ onKeyDown: (g) => {
1178
+ g.nativeEvent.isComposing || g.keyCode === 229 || r === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), c && d());
1170
1179
  }
1171
1180
  }
1172
1181
  ),
1173
1182
  r === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
1174
1183
  r === "reply" ? p : null,
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: [
1176
- i,
1184
+ r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": s, disabled: !c, children: /* @__PURE__ */ e(T, { name: "send" }) }) : /* @__PURE__ */ u("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !c, children: [
1185
+ s,
1177
1186
  " ",
1178
- /* @__PURE__ */ e(P, { name: "send", size: 18 })
1187
+ /* @__PURE__ */ e(T, { name: "send", size: 18 })
1179
1188
  ] })
1180
1189
  ] });
1181
1190
  }
1182
- const Se = {
1191
+ const Ae = {
1183
1192
  incomingAudio: "Incoming audio call",
1184
1193
  incomingVideo: "Incoming video call",
1185
1194
  incomingFrom: (n, l) => `${n} from ${l}`,
@@ -1200,91 +1209,91 @@ const Se = {
1200
1209
  onCallWith: (n) => `On a call with ${n}`,
1201
1210
  returnToCall: "Return to call"
1202
1211
  };
1203
- function On({ name: n, media: l, onAccept: t, onDecline: o, labels: m }) {
1204
- const s = re(Se, m), r = l === "video" ? s.incomingVideo : s.incomingAudio;
1205
- return /* @__PURE__ */ d("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(r, n), children: [
1212
+ function Wn({ name: n, media: l, onAccept: t, onDecline: d, labels: o }) {
1213
+ const a = re(Ae, o), r = l === "video" ? a.incomingVideo : a.incomingAudio;
1214
+ return /* @__PURE__ */ u("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": a.incomingFrom(r, n), children: [
1206
1215
  /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
1207
1216
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
1208
1217
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: r }),
1209
- /* @__PURE__ */ d("div", { className: "cms-call-incoming__actions", children: [
1210
- /* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: o }),
1211
- /* @__PURE__ */ e(ae, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
1218
+ /* @__PURE__ */ u("div", { className: "cms-call-incoming__actions", children: [
1219
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: a.decline, tone: "hang-up", onClick: d }),
1220
+ /* @__PURE__ */ e(ae, { icon: "phone", label: a.accept, tone: "accept", onClick: t })
1212
1221
  ] })
1213
1222
  ] });
1214
1223
  }
1215
- function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: m }) {
1216
- return /* @__PURE__ */ d(
1224
+ function ae({ icon: n, label: l, onClick: t, tone: d = "plain", pressed: o }) {
1225
+ return /* @__PURE__ */ u(
1217
1226
  "button",
1218
1227
  {
1219
1228
  type: "button",
1220
- className: T("cms-call-button", `cms-call-button--${o}`, m && "is-pressed"),
1221
- "aria-pressed": m,
1229
+ className: E("cms-call-button", `cms-call-button--${d}`, o && "is-pressed"),
1230
+ "aria-pressed": o,
1222
1231
  onClick: t,
1223
1232
  children: [
1224
- /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(P, { name: n, size: 24 }) }),
1233
+ /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(T, { name: n, size: 24 }) }),
1225
1234
  /* @__PURE__ */ e("span", { className: "cms-call-button__label", children: l })
1226
1235
  ]
1227
1236
  }
1228
1237
  );
1229
1238
  }
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 }) {
1231
- const a = re(Se, h);
1232
- return /* @__PURE__ */ d("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
1233
- /* @__PURE__ */ d("div", { className: "cms-call-panel__head", children: [
1239
+ function jn({ name: n, duration: l, connection: t, you: d, muted: o, speaker: a, onToggleMute: r, onToggleSpeaker: s, onAddPerson: m, onChat: b, onHangUp: i, labels: h }) {
1240
+ const c = re(Ae, h);
1241
+ return /* @__PURE__ */ u("section", { className: "cms-call-panel", "aria-label": c.callWith(n), children: [
1242
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__head", children: [
1234
1243
  /* @__PURE__ */ e(ve, { name: n, size: 64 }),
1235
- /* @__PURE__ */ d("div", { className: "cms-call-panel__who", children: [
1244
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__who", children: [
1236
1245
  /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1237
- /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": a.callTime(l), children: l })
1246
+ /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": c.callTime(l), children: l })
1238
1247
  ] }),
1239
- /* @__PURE__ */ e("span", { className: T("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
1248
+ /* @__PURE__ */ e("span", { className: E("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? c.goodConnection : c.poorConnection })
1240
1249
  ] }),
1241
- /* @__PURE__ */ d("div", { className: "cms-call-panel__you", children: [
1242
- /* @__PURE__ */ e(ve, { name: o.name, size: 36 }),
1243
- /* @__PURE__ */ e("span", { children: a.you }),
1244
- o.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": a.speaking }) : null
1250
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__you", children: [
1251
+ /* @__PURE__ */ e(ve, { name: d.name, size: 36 }),
1252
+ /* @__PURE__ */ e("span", { children: c.you }),
1253
+ d.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": c.speaking }) : null
1245
1254
  ] }),
1246
- /* @__PURE__ */ d("div", { className: "cms-call-panel__controls", children: [
1247
- /* @__PURE__ */ e(ae, { icon: "mic", label: m ? a.unmute : a.mute, pressed: m, onClick: r }),
1248
- /* @__PURE__ */ e(ae, { icon: "speaker", label: a.speaker, pressed: s, onClick: i }),
1249
- u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: a.addPerson, onClick: u }) : null,
1250
- b ? /* @__PURE__ */ e(ae, { icon: "chat", label: a.chat, onClick: b }) : null,
1251
- /* @__PURE__ */ e(ae, { icon: "phone-off", label: a.hangUp, tone: "hang-up", onClick: c })
1255
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__controls", children: [
1256
+ /* @__PURE__ */ e(ae, { icon: "mic", label: o ? c.unmute : c.mute, pressed: o, onClick: r }),
1257
+ /* @__PURE__ */ e(ae, { icon: "speaker", label: c.speaker, pressed: a, onClick: s }),
1258
+ m ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: c.addPerson, onClick: m }) : null,
1259
+ b ? /* @__PURE__ */ e(ae, { icon: "chat", label: c.chat, onClick: b }) : null,
1260
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: c.hangUp, tone: "hang-up", onClick: i })
1252
1261
  ] })
1253
1262
  ] });
1254
1263
  }
1255
- function Rn({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: m, onHangUp: s, labels: r }) {
1256
- const i = re(Se, r);
1257
- return /* @__PURE__ */ d("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
1264
+ function qn({ name: n, duration: l, muted: t, onToggleMute: d, onReturn: o, onHangUp: a, labels: r }) {
1265
+ const s = re(Ae, r);
1266
+ return /* @__PURE__ */ u("section", { className: "cms-call-bar", "aria-label": s.callWith(n), children: [
1258
1267
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1259
- /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: i.onCallWith(n) }),
1268
+ /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: s.onCallWith(n) }),
1260
1269
  /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
1261
- /* @__PURE__ */ d("span", { className: "cms-call-bar__actions", children: [
1262
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? i.unmute : i.mute, "aria-pressed": t, onClick: o, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1263
- /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: m, children: i.returnToCall }),
1264
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": i.hangUp, onClick: s, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
1270
+ /* @__PURE__ */ u("span", { className: "cms-call-bar__actions", children: [
1271
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? s.unmute : s.mute, "aria-pressed": t, onClick: d, children: /* @__PURE__ */ e(T, { name: "mic" }) }),
1272
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: o, children: s.returnToCall }),
1273
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": s.hangUp, onClick: a, children: /* @__PURE__ */ e(T, { name: "phone-off" }) })
1265
1274
  ] })
1266
1275
  ] });
1267
1276
  }
1268
- function zn({ mark: n, product: l, headline: t, lead: o, features: m = [], children: s }) {
1269
- return /* @__PURE__ */ d("div", { className: "cms-signin", children: [
1270
- /* @__PURE__ */ d("aside", { className: "cms-signin__brand", children: [
1271
- /* @__PURE__ */ d("p", { className: "cms-signin__logo", children: [
1277
+ function Yn({ mark: n, product: l, headline: t, lead: d, features: o = [], children: a }) {
1278
+ return /* @__PURE__ */ u("div", { className: "cms-signin", children: [
1279
+ /* @__PURE__ */ u("aside", { className: "cms-signin__brand", children: [
1280
+ /* @__PURE__ */ u("p", { className: "cms-signin__logo", children: [
1272
1281
  /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
1273
1282
  l
1274
1283
  ] }),
1275
- /* @__PURE__ */ d("div", { className: "cms-signin__pitch", children: [
1284
+ /* @__PURE__ */ u("div", { className: "cms-signin__pitch", children: [
1276
1285
  /* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
1277
- /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: o }),
1278
- m.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: m.map((r) => /* @__PURE__ */ d("li", { children: [
1279
- /* @__PURE__ */ e(P, { name: r.icon, size: 18 }),
1286
+ /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: d }),
1287
+ o.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: o.map((r) => /* @__PURE__ */ u("li", { children: [
1288
+ /* @__PURE__ */ e(T, { name: r.icon, size: 18 }),
1280
1289
  r.label
1281
1290
  ] }, r.label)) }) : null
1282
1291
  ] })
1283
1292
  ] }),
1284
- /* @__PURE__ */ e("main", { className: "cms-signin__form", children: s })
1293
+ /* @__PURE__ */ e("main", { className: "cms-signin__form", children: a })
1285
1294
  ] });
1286
1295
  }
1287
- const cn = {
1296
+ const fn = {
1288
1297
  title: "Sign in",
1289
1298
  identifier: "Email or username",
1290
1299
  identifierPlaceholder: "name@example.com",
@@ -1296,169 +1305,208 @@ const cn = {
1296
1305
  newHere: "New here?",
1297
1306
  create: "Create an account"
1298
1307
  };
1299
- function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, busy: s, labels: r }) {
1300
- const i = re(cn, r), u = q(), [b, c] = D(""), [h, a] = D(""), [g, p] = D(!1);
1301
- return /* @__PURE__ */ d("form", { className: "cms-signin-form", onSubmit: (N) => {
1308
+ function Xn({ server: n, onSubmit: l, forgotHref: t, createHref: d, error: o, busy: a, labels: r }) {
1309
+ const s = re(fn, r), m = q(), [b, i] = A(""), [h, c] = A(""), [f, p] = A(!1);
1310
+ return /* @__PURE__ */ u("form", { className: "cms-signin-form", onSubmit: (N) => {
1302
1311
  N.preventDefault(), l(b, h);
1303
- }, "aria-describedby": m ? `${u}-error` : void 0, children: [
1304
- /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
1305
- /* @__PURE__ */ d("p", { className: "cms-signin-form__server", children: [
1306
- /* @__PURE__ */ e(P, { name: "server", size: 18 }),
1312
+ }, "aria-describedby": o ? `${m}-error` : void 0, children: [
1313
+ /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: s.title }),
1314
+ /* @__PURE__ */ u("p", { className: "cms-signin-form__server", children: [
1315
+ /* @__PURE__ */ e(T, { name: "server", size: 18 }),
1307
1316
  n
1308
1317
  ] }),
1309
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: i.identifier }),
1318
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-identifier`, children: s.identifier }),
1310
1319
  /* @__PURE__ */ e(
1311
1320
  "input",
1312
1321
  {
1313
- id: `${u}-identifier`,
1322
+ id: `${m}-identifier`,
1314
1323
  className: "cms-signin-form__input",
1315
1324
  type: "text",
1316
1325
  autoComplete: "username",
1317
- placeholder: i.identifierPlaceholder,
1326
+ placeholder: s.identifierPlaceholder,
1318
1327
  value: b,
1319
- onChange: (N) => c(N.target.value),
1328
+ onChange: (N) => i(N.target.value),
1320
1329
  required: !0
1321
1330
  }
1322
1331
  ),
1323
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: i.password }),
1324
- /* @__PURE__ */ d("span", { className: "cms-signin-form__password", children: [
1332
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children: s.password }),
1333
+ /* @__PURE__ */ u("span", { className: "cms-signin-form__password", children: [
1325
1334
  /* @__PURE__ */ e(
1326
1335
  "input",
1327
1336
  {
1328
- id: `${u}-password`,
1337
+ id: `${m}-password`,
1329
1338
  className: "cms-signin-form__input",
1330
- type: g ? "text" : "password",
1339
+ type: f ? "text" : "password",
1331
1340
  autoComplete: "current-password",
1332
1341
  value: h,
1333
- onChange: (N) => a(N.target.value),
1342
+ onChange: (N) => c(N.target.value),
1334
1343
  required: !0
1335
1344
  }
1336
1345
  ),
1337
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => p((N) => !N), children: g ? i.hide : i.show })
1346
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => p((N) => !N), children: f ? s.hide : s.show })
1338
1347
  ] }),
1339
- t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: i.forgot }) : null,
1340
- m ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: m }) : null,
1341
- /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: i.submit }),
1342
- o ? /* @__PURE__ */ d(S, { children: [
1343
- /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: i.newHere }) }),
1344
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: o, children: i.create })
1348
+ t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: s.forgot }) : null,
1349
+ o ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: o }) : null,
1350
+ /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: a, "aria-busy": a || void 0, children: s.submit }),
1351
+ d ? /* @__PURE__ */ u(S, { children: [
1352
+ /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: s.newHere }) }),
1353
+ /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: d, children: s.create })
1345
1354
  ] }) : null
1346
1355
  ] });
1347
1356
  }
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 });
1351
- if (l === null) return /* @__PURE__ */ e(Ue, { what: m, layout: "block" });
1352
- if (l.length === 0) return /* @__PURE__ */ e(Re, { title: s, hint: r });
1353
- const h = (a, g, p) => {
1354
- var v;
1355
- if (a.key === "ArrowDown" || a.key === "ArrowUp")
1356
- a.preventDefault(), (v = c.current[Math.min(l.length - 1, Math.max(0, g + (a.key === "ArrowDown" ? 1 : -1)))]) == null || v.focus();
1357
- else if (a.key === "Enter")
1358
- u == null || u(p);
1359
- else if ((a.key === "ContextMenu" || a.shiftKey && a.key === "F10") && b) {
1360
- a.preventDefault();
1361
- const N = a.currentTarget.getBoundingClientRect();
1362
- b(p, { x: N.left + 16, y: N.bottom });
1357
+ const we = 64;
1358
+ function pn(n, l) {
1359
+ const [t, d] = A(0), o = K(l);
1360
+ return o.current = l, J(() => {
1361
+ const a = n.current;
1362
+ if (a === null) return;
1363
+ let r = null, s = 0;
1364
+ const m = (h) => {
1365
+ r = a.scrollTop <= 0 && h.touches.length === 1 ? h.touches[0].clientY : null, s = 0;
1366
+ }, b = (h) => {
1367
+ if (r === null || o.current === null) return;
1368
+ const c = h.touches[0].clientY - r;
1369
+ if (c <= 0) {
1370
+ r = null, d(0);
1371
+ return;
1372
+ }
1373
+ h.cancelable && h.preventDefault(), s = Math.min(c * 0.6, we * 1.5), d(s);
1374
+ }, i = () => {
1375
+ var h;
1376
+ r !== null && s >= we && ((h = o.current) == null || h.call(o)), r = null, s = 0, d(0);
1377
+ };
1378
+ return a.addEventListener("touchstart", m, { passive: !0 }), a.addEventListener("touchmove", b, { passive: !1 }), a.addEventListener("touchend", i), a.addEventListener("touchcancel", i), () => {
1379
+ a.removeEventListener("touchstart", m), a.removeEventListener("touchmove", b), a.removeEventListener("touchend", i), a.removeEventListener("touchcancel", i);
1380
+ };
1381
+ }, [n]), t;
1382
+ }
1383
+ const Ie = Ue(null);
1384
+ function bn() {
1385
+ return Oe(Ie);
1386
+ }
1387
+ function Gn({ label: n, rows: l, error: t, onRetry: d, loadingText: o = "Loading", emptyTitle: a = "Nothing here yet", emptyHint: r, selected: s, onOpen: m, onRowMenu: b }) {
1388
+ const i = K([]), h = bn();
1389
+ if (t != null) return /* @__PURE__ */ e(qe, { message: t, onRetry: d });
1390
+ if (l === null) return /* @__PURE__ */ e(We, { what: o, layout: "block" });
1391
+ if (l.length === 0) return /* @__PURE__ */ e(je, { title: a, hint: r });
1392
+ const c = (f, p, g) => {
1393
+ var N;
1394
+ if (f.key === "ArrowDown" || f.key === "ArrowUp")
1395
+ f.preventDefault(), (N = i.current[Math.min(l.length - 1, Math.max(0, p + (f.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
1396
+ else if (f.key === "Enter")
1397
+ m == null || m(g);
1398
+ else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && b) {
1399
+ f.preventDefault();
1400
+ const y = f.currentTarget.getBoundingClientRect();
1401
+ b(g, { x: y.left + 16, y: y.bottom });
1363
1402
  }
1364
1403
  };
1365
- return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((a, g) => {
1366
- const p = a.id === i;
1367
- return /* @__PURE__ */ d(
1368
- "li",
1369
- {
1370
- ref: (v) => {
1371
- c.current[g] = v;
1404
+ return /* @__PURE__ */ u(S, { children: [
1405
+ h !== null && (h.distance > 0 || h.refreshing) ? /* @__PURE__ */ u("div", { className: "cms-list__pull", role: "status", style: { height: h.refreshing ? void 0 : h.distance }, "data-ready": h.distance >= we ? "" : void 0, children: [
1406
+ h.refreshing ? /* @__PURE__ */ e(z, { name: "spinner" }) : null,
1407
+ h.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: h.text }) : null
1408
+ ] }) : null,
1409
+ /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((f, p) => {
1410
+ const g = f.id === s;
1411
+ return /* @__PURE__ */ u(
1412
+ "li",
1413
+ {
1414
+ ref: (N) => {
1415
+ i.current[p] = N;
1416
+ },
1417
+ role: "option",
1418
+ "aria-selected": g,
1419
+ tabIndex: g || s == null && p === 0 ? 0 : -1,
1420
+ className: E("cms-list__row", g && "is-selected"),
1421
+ onClick: () => m == null ? void 0 : m(f.id),
1422
+ onKeyDown: (N) => c(N, p, f.id),
1423
+ onContextMenu: b ? (N) => {
1424
+ N.preventDefault(), b(f.id, { x: N.clientX, y: N.clientY });
1425
+ } : void 0,
1426
+ children: [
1427
+ f.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: f.lead }) : null,
1428
+ /* @__PURE__ */ u("span", { className: "cms-list__text", children: [
1429
+ /* @__PURE__ */ e("span", { className: E("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
1430
+ f.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: f.secondary }) : null
1431
+ ] }),
1432
+ f.meta != null || f.count !== void 0 ? /* @__PURE__ */ u("span", { className: "cms-list__end", children: [
1433
+ f.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: f.meta }) : null,
1434
+ f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: f.count }) : null
1435
+ ] }) : null
1436
+ ]
1372
1437
  },
1373
- role: "option",
1374
- "aria-selected": p,
1375
- tabIndex: p || i == null && g === 0 ? 0 : -1,
1376
- className: T("cms-list__row", p && "is-selected"),
1377
- onClick: () => u == null ? void 0 : u(a.id),
1378
- onKeyDown: (v) => h(v, g, a.id),
1379
- onContextMenu: b ? (v) => {
1380
- v.preventDefault(), b(a.id, { x: v.clientX, y: v.clientY });
1381
- } : void 0,
1382
- children: [
1383
- a.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: a.lead }) : null,
1384
- /* @__PURE__ */ d("span", { className: "cms-list__text", children: [
1385
- /* @__PURE__ */ e("span", { className: "cms-list__primary", children: a.primary }),
1386
- a.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: a.secondary }) : null
1387
- ] }),
1388
- a.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: a.meta }) : null
1389
- ]
1390
- },
1391
- a.id
1392
- );
1393
- }) });
1438
+ f.id
1439
+ );
1440
+ }) })
1441
+ ] });
1394
1442
  }
1395
- function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "first" }) {
1396
- const s = R(null), r = R(null), i = q(), [u, b] = D(n), c = l.filter((a) => a.offer.offered);
1397
- if (ke(() => {
1443
+ function Be({ at: n, items: l, onClose: t, label: d = "Actions", focus: o = "first" }) {
1444
+ const a = K(null), r = K(null), s = q(), [m, b] = A(n), i = l.filter((c) => c.offer.offered);
1445
+ if (xe(() => {
1398
1446
  if (!n) return;
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)) });
1447
+ const c = a.current, f = (c == null ? void 0 : c.offsetWidth) ?? 0, p = (c == null ? void 0 : c.offsetHeight) ?? 0;
1448
+ b({ x: Math.max(0, Math.min(n.x, window.innerWidth - f)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
1401
1449
  }, [n]), J(() => {
1402
- var p, v;
1450
+ var p, g;
1403
1451
  if (!n) return;
1404
1452
  r.current = document.activeElement;
1405
- const a = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1406
- (v = m === "last" ? a[a.length - 1] : a[0]) == null || v.focus();
1407
- const g = (N) => {
1408
- var k;
1409
- (k = s.current) != null && k.contains(N.target) || t();
1453
+ const c = Array.from(((p = a.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1454
+ (g = o === "last" ? c[c.length - 1] : c[0]) == null || g.focus();
1455
+ const f = (N) => {
1456
+ var y;
1457
+ (y = a.current) != null && y.contains(N.target) || t();
1410
1458
  };
1411
- return document.addEventListener("mousedown", g), () => {
1412
- var N, k;
1413
- document.removeEventListener("mousedown", g), (k = (N = r.current) == null ? void 0 : N.focus) == null || k.call(N);
1459
+ return document.addEventListener("mousedown", f), () => {
1460
+ var N, y;
1461
+ document.removeEventListener("mousedown", f), (y = (N = r.current) == null ? void 0 : N.focus) == null || y.call(N);
1414
1462
  };
1415
- }, [n, t, m]), !n || c.length === 0) return null;
1416
- const h = (a) => {
1417
- var v, N;
1418
- const g = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), p = g.indexOf(document.activeElement);
1419
- if (a.key === "Escape" || a.key === "Tab")
1420
- a.preventDefault(), t();
1421
- else if (a.key === "ArrowDown" || a.key === "ArrowUp") {
1422
- a.preventDefault();
1423
- const k = a.key === "ArrowDown" ? 1 : -1;
1424
- (N = g[(p + k + g.length) % g.length]) == null || N.focus();
1463
+ }, [n, t, o]), !n || i.length === 0) return null;
1464
+ const h = (c) => {
1465
+ var g, N;
1466
+ const f = Array.from(((g = a.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]')) ?? []), p = f.indexOf(document.activeElement);
1467
+ if (c.key === "Escape" || c.key === "Tab")
1468
+ c.preventDefault(), t();
1469
+ else if (c.key === "ArrowDown" || c.key === "ArrowUp") {
1470
+ c.preventDefault();
1471
+ const y = c.key === "ArrowDown" ? 1 : -1;
1472
+ (N = f[(p + y + f.length) % f.length]) == null || N.focus();
1425
1473
  }
1426
1474
  };
1427
- return xe(
1475
+ return Ce(
1428
1476
  /* @__PURE__ */ e(
1429
1477
  "div",
1430
1478
  {
1431
- ref: s,
1479
+ ref: a,
1432
1480
  className: "cms-menu",
1433
1481
  role: "menu",
1434
- "aria-label": o,
1435
- style: { left: (u ?? n).x, top: (u ?? n).y },
1482
+ "aria-label": d,
1483
+ style: { left: (m ?? n).x, top: (m ?? n).y },
1436
1484
  onKeyDown: h,
1437
- onContextMenu: (a) => a.preventDefault(),
1438
- children: c.map((a) => {
1439
- const g = a.offer.refusal !== void 0;
1440
- return /* @__PURE__ */ d(
1485
+ onContextMenu: (c) => c.preventDefault(),
1486
+ children: i.map((c) => {
1487
+ const f = c.offer.refusal !== void 0;
1488
+ return /* @__PURE__ */ u(
1441
1489
  "div",
1442
1490
  {
1443
1491
  role: "menuitem",
1444
1492
  tabIndex: -1,
1445
- "aria-disabled": g || void 0,
1446
- "aria-describedby": g ? `${i}-${a.id}` : void 0,
1447
- title: g ? a.offer.refusal : void 0,
1448
- className: T("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", g && "is-refused"),
1493
+ "aria-disabled": f || void 0,
1494
+ "aria-describedby": f ? `${s}-${c.id}` : void 0,
1495
+ title: f ? c.offer.refusal : void 0,
1496
+ className: E("cms-menu__item", c.danger && "is-danger", c.offer.locked && "is-locked", f && "is-refused"),
1449
1497
  onClick: () => {
1450
- g || (t(), a.onSelect());
1498
+ f || (t(), c.onSelect());
1451
1499
  },
1452
1500
  onKeyDown: (p) => {
1453
- (p.key === "Enter" || p.key === " ") && !g && (p.preventDefault(), t(), a.onSelect());
1501
+ (p.key === "Enter" || p.key === " ") && !f && (p.preventDefault(), t(), c.onSelect());
1454
1502
  },
1455
1503
  children: [
1456
- a.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
1457
- /* @__PURE__ */ e("span", { className: "cms-menu__label", children: a.label }),
1458
- g ? /* @__PURE__ */ e("span", { id: `${i}-${a.id}`, className: "cms-menu__refusal", children: a.offer.refusal }) : null
1504
+ c.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
1505
+ /* @__PURE__ */ e("span", { className: "cms-menu__label", children: c.label }),
1506
+ f ? /* @__PURE__ */ e("span", { id: `${s}-${c.id}`, className: "cms-menu__refusal", children: c.offer.refusal }) : null
1459
1507
  ]
1460
1508
  },
1461
- a.id
1509
+ c.id
1462
1510
  );
1463
1511
  })
1464
1512
  }
@@ -1466,248 +1514,248 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
1466
1514
  document.body
1467
1515
  );
1468
1516
  }
1469
- const Te = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, Ee = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
1470
- function dn(n) {
1517
+ const Te = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, Le = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
1518
+ function _n(n) {
1471
1519
  const l = /* @__PURE__ */ new Map();
1472
1520
  for (const t of n) l.set(t.group, [...l.get(t.group) ?? [], t]);
1473
1521
  return [...l.values()];
1474
1522
  }
1475
- function mn(n) {
1523
+ function vn(n) {
1476
1524
  const l = /* @__PURE__ */ new Map();
1477
1525
  for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
1478
- return [...l.entries()].sort(([t], [o]) => t - o).map(([, t]) => t);
1479
- }
1480
- function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leading: s }) {
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;
1484
- const Z = getComputedStyle(_), W = parseFloat(Z.columnGap || "0") || 0, L = _.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), j = ($) => {
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;
1526
+ return [...l.entries()].sort(([t], [d]) => t - d).map(([, t]) => t);
1527
+ }
1528
+ function Jn({ label: n, actions: l, onAction: t, status: d, moreLabel: o, leading: a }) {
1529
+ const r = K(null), s = K(null), [m, b] = A(Te), [i, h] = A(null), [c, f] = A("first"), [p, g] = A(null), [N, y] = A(null), x = _n(l), M = vn(l), C = x.flat(), R = C.filter((v) => v.overflow === 0), O = C.filter((v) => v.overflow !== 0), le = JSON.stringify([l.map((v) => [v.id, v.label, v.icon, v.group, v.overflow ?? null]), d ?? "", a !== void 0]), Q = be(() => {
1530
+ const v = r.current, D = s.current;
1531
+ if (v === null || D === null) return;
1532
+ const Z = getComputedStyle(v), W = parseFloat(Z.columnGap || "0") || 0, $ = v.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), j = (P) => {
1533
+ var H;
1534
+ return ((H = D.querySelector(P)) == null ? void 0 : H.getBoundingClientRect().width) ?? 0;
1535
+ }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), ue = j('[data-measure="more"]'), me = (P, H) => j(`[data-measure="${H ? "full" : "icon"}"][data-measure-action="${CSS.escape(P)}"]`), _ = (P, H) => {
1536
+ const G = /* @__PURE__ */ new Set([...R.map((te) => te.id), ...H]), se = x.map((te) => te.filter((fe) => !G.has(fe.id))).filter((te) => te.length > 0), he = se.flat(), Fe = he.length + (se.length - 1) + (G.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1537
+ return oe + he.reduce((te, fe) => te + me(fe.id, !P.has(fe.id)), 0) + de * Math.max(0, se.length - 1) + (G.size > 0 ? ue : 0) + W * Math.max(0, Fe - 1);
1538
+ }, k = O.filter((P) => !M.some((H) => H.includes(P.id))).map((P) => P.id), I = [...M, ...[...k].reverse().map((P) => [P])];
1539
+ let U = null;
1540
+ if (_(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) U = Te;
1493
1541
  else {
1494
- const $ = /* @__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() };
1542
+ const P = /* @__PURE__ */ new Set();
1543
+ for (const H of I) {
1544
+ for (const G of H) P.add(G);
1545
+ if (_(P, /* @__PURE__ */ new Set()) <= $) {
1546
+ U = { bare: P, hidden: /* @__PURE__ */ new Set() };
1499
1547
  break;
1500
1548
  }
1501
1549
  }
1502
1550
  }
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;
1551
+ if (U === null) {
1552
+ const P = new Set(O.map((G) => G.id)), H = /* @__PURE__ */ new Set();
1553
+ for (const G of M) {
1554
+ for (const se of G) O.some((he) => he.id === se) && H.add(se);
1555
+ if (H.size >= 2 && _(P, H) <= $) break;
1508
1556
  }
1509
- if (f($, O) > L) {
1510
- for (const Y of [...w].reverse())
1511
- if (O.add(Y), f($, O) <= L) break;
1557
+ if (_(P, H) > $) {
1558
+ for (const G of [...k].reverse())
1559
+ if (H.add(G), _(P, H) <= $) break;
1512
1560
  }
1513
- H = { bare: $, hidden: O };
1561
+ U = { bare: P, hidden: H };
1514
1562
  }
1515
- const ge = H;
1516
- b(($) => Ee($.bare, ge.bare) && Ee($.hidden, ge.hidden) ? $ : ge);
1563
+ const ge = U;
1564
+ b((P) => Le(P.bare, ge.bare) && Le(P.hidden, ge.hidden) ? P : ge);
1517
1565
  }, [le]);
1518
- ke(Q, [Q]), J(() => {
1519
- const _ = r.current;
1520
- if (_ === null || typeof ResizeObserver > "u") return;
1521
- const A = new ResizeObserver(() => Q());
1522
- return A.observe(_), () => A.disconnect();
1566
+ xe(Q, [Q]), J(() => {
1567
+ const v = r.current;
1568
+ if (v === null || typeof ResizeObserver > "u") return;
1569
+ const D = new ResizeObserver(() => Q());
1570
+ return D.observe(v), () => D.disconnect();
1523
1571
  }, [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)),
1572
+ const w = /* @__PURE__ */ new Set([...R.map((v) => v.id), ...m.hidden]), V = x.map((v) => v.filter((D) => !w.has(D.id))).filter((v) => v.length > 0).flat(), L = [
1573
+ ...R,
1574
+ ...M.flat().map((v) => C.find((D) => D.id === v)).filter((v) => v !== void 0 && m.hidden.has(v.id)),
1527
1575
  // 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 = (_) => {
1530
- var L, j;
1531
- const A = B.indexOf(G ?? "");
1576
+ ...O.filter((v) => m.hidden.has(v.id) && !M.some((D) => D.includes(v.id)))
1577
+ ], Y = new Set(O.filter((v) => !M.some((D) => D.includes(v.id))).map((v) => v.id)), F = [...V.map((v) => v.id), ...L.length > 0 ? ["more"] : []], X = p !== null && F.includes(p) ? p : F[0] ?? null, ie = (v) => {
1578
+ var $, j;
1579
+ const D = F.indexOf(X ?? "");
1532
1580
  let Z = null;
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;
1534
- _.preventDefault();
1535
- const W = B[Z] ?? null;
1536
- v(W), (j = (L = r.current) == null ? void 0 : L.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1537
- }, ce = E.map((_) => ({
1538
- id: _.id,
1539
- label: /* @__PURE__ */ d(S, { children: [
1540
- /* @__PURE__ */ e(fe, { name: _.icon }),
1541
- _.label
1581
+ if (v.key === "ArrowRight" ? Z = Math.min(F.length - 1, D + 1) : v.key === "ArrowLeft" ? Z = Math.max(0, D - 1) : v.key === "Home" ? Z = 0 : v.key === "End" ? Z = F.length - 1 : v.key === "Escape" && y(X), Z === null) return;
1582
+ v.preventDefault();
1583
+ const W = F[Z] ?? null;
1584
+ g(W), (j = ($ = r.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1585
+ }, ce = L.map((v) => ({
1586
+ id: v.id,
1587
+ label: /* @__PURE__ */ u(S, { children: [
1588
+ /* @__PURE__ */ e(pe, { name: v.icon }),
1589
+ v.label
1542
1590
  ] }),
1543
- offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
1544
- ..._.danger ? { danger: !0 } : {},
1591
+ offer: v.disabled ? { offered: !0, locked: !1, refusal: v.reason ?? "" } : { offered: !0, locked: !1 },
1592
+ ...v.danger ? { danger: !0 } : {},
1545
1593
  onSelect: () => {
1546
- !_.disabled && !_.busy && t(_.id);
1594
+ !v.disabled && !v.busy && t(v.id);
1547
1595
  }
1548
1596
  }));
1549
- return /* @__PURE__ */ d(
1597
+ return /* @__PURE__ */ u(
1550
1598
  "div",
1551
1599
  {
1552
1600
  ref: r,
1553
1601
  role: "toolbar",
1554
1602
  "aria-label": n,
1555
- className: T(
1603
+ className: E(
1556
1604
  "cms-pane-toolbar",
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"
1605
+ O.length > 0 && m.bare.size >= O.length && "cms-pane-toolbar--labels-hidden",
1606
+ m.bare.size > 0 && m.bare.size < O.length && "cms-pane-toolbar--labels-partly-hidden"
1559
1607
  ),
1560
1608
  onKeyDown: ie,
1561
1609
  children: [
1562
- s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
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)));
1565
- return /* @__PURE__ */ d("div", { className: "cms-pane-toolbar__group-wrap", children: [
1610
+ a !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: a }) : null,
1611
+ x.map((v, D) => {
1612
+ const Z = v.filter(($) => !w.has($.id)), W = x.slice(0, D).some(($) => $.some((j) => !w.has(j.id)));
1613
+ return /* @__PURE__ */ u("div", { className: "cms-pane-toolbar__group-wrap", children: [
1566
1614
  Z.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1567
- /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: _.map((L) => /* @__PURE__ */ e(
1568
- un,
1615
+ /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: v.map(($) => /* @__PURE__ */ e(
1616
+ gn,
1569
1617
  {
1570
- action: L,
1571
- labels: !u.bare.has(L.id),
1572
- overflowed: y.has(L.id),
1573
- pinned: X.has(L.id),
1574
- tabbable: G === L.id,
1575
- tipOff: N === L.id,
1576
- onChoose: () => t(L.id),
1618
+ action: $,
1619
+ labels: !m.bare.has($.id),
1620
+ overflowed: w.has($.id),
1621
+ pinned: Y.has($.id),
1622
+ tabbable: X === $.id,
1623
+ tipOff: N === $.id,
1624
+ onChoose: () => t($.id),
1577
1625
  onFocus: () => {
1578
- v(L.id), k(null);
1626
+ g($.id), y(null);
1579
1627
  }
1580
1628
  },
1581
- L.id
1629
+ $.id
1582
1630
  )) })
1583
- ] }, A);
1631
+ ] }, D);
1584
1632
  }),
1585
- E.length > 0 ? /* @__PURE__ */ e(
1633
+ L.length > 0 ? /* @__PURE__ */ e(
1586
1634
  "button",
1587
1635
  {
1588
1636
  type: "button",
1589
1637
  className: "cms-icon-button cms-pane-toolbar__more",
1590
1638
  "data-stop": "more",
1591
- "aria-label": m,
1592
- title: m,
1639
+ "aria-label": o,
1640
+ title: o,
1593
1641
  "aria-haspopup": "menu",
1594
- "aria-expanded": c !== null,
1595
- tabIndex: G === "more" ? 0 : -1,
1596
- onFocus: () => v("more"),
1597
- onClick: (_) => {
1598
- const A = _.currentTarget.getBoundingClientRect();
1599
- g("first"), h(c === null ? { x: A.left, y: A.bottom } : null);
1642
+ "aria-expanded": i !== null,
1643
+ tabIndex: X === "more" ? 0 : -1,
1644
+ onFocus: () => g("more"),
1645
+ onClick: (v) => {
1646
+ const D = v.currentTarget.getBoundingClientRect();
1647
+ f("first"), h(i === null ? { x: D.left, y: D.bottom } : null);
1600
1648
  },
1601
- onKeyDown: (_) => {
1602
- if (_.key === "ArrowDown" || _.key === "ArrowUp") {
1603
- _.preventDefault(), _.stopPropagation();
1604
- const A = _.currentTarget.getBoundingClientRect();
1605
- g(_.key === "ArrowUp" ? "last" : "first"), h({ x: A.left, y: A.bottom });
1649
+ onKeyDown: (v) => {
1650
+ if (v.key === "ArrowDown" || v.key === "ArrowUp") {
1651
+ v.preventDefault(), v.stopPropagation();
1652
+ const D = v.currentTarget.getBoundingClientRect();
1653
+ f(v.key === "ArrowUp" ? "last" : "first"), h({ x: D.left, y: D.bottom });
1606
1654
  }
1607
1655
  },
1608
- children: /* @__PURE__ */ e(P, { name: "more" })
1656
+ children: /* @__PURE__ */ e(T, { name: "more" })
1609
1657
  }
1610
1658
  ) : null,
1611
- o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: o, children: o }) : null,
1612
- /* @__PURE__ */ e(on, { at: c, items: ce, onClose: () => h(null), label: m, focus: a }),
1613
- /* @__PURE__ */ d("div", { ref: i, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1614
- s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
1659
+ d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: d, children: d }) : null,
1660
+ /* @__PURE__ */ e(Be, { at: i, items: ce, onClose: () => h(null), label: o, focus: c }),
1661
+ /* @__PURE__ */ u("div", { ref: s, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1662
+ a !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: a }) : null,
1615
1663
  /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
1616
- /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
1617
- C.map((_) => /* @__PURE__ */ d("span", { children: [
1618
- /* @__PURE__ */ d("span", { "data-measure": "full", "data-measure-action": _.id, className: "cms-pane-toolbar__action", children: [
1619
- /* @__PURE__ */ e(fe, { name: _.icon }),
1620
- /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label })
1664
+ /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(T, { name: "more" }) }),
1665
+ C.map((v) => /* @__PURE__ */ u("span", { children: [
1666
+ /* @__PURE__ */ u("span", { "data-measure": "full", "data-measure-action": v.id, className: "cms-pane-toolbar__action", children: [
1667
+ /* @__PURE__ */ e(pe, { name: v.icon }),
1668
+ /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label })
1621
1669
  ] }),
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 }) })
1623
- ] }, _.id))
1670
+ /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": v.id, className: E("cms-pane-toolbar__action", _e(v.icon) !== null && "cms-pane-toolbar__action--bare"), children: _e(v.icon) !== null ? /* @__PURE__ */ e(pe, { name: v.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label }) })
1671
+ ] }, v.id))
1624
1672
  ] })
1625
1673
  ]
1626
1674
  }
1627
1675
  );
1628
1676
  }
1629
- function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOff: s, onChoose: r, onFocus: i }) {
1630
- const [u, b] = D(!1);
1677
+ function gn({ action: n, labels: l, overflowed: t, pinned: d, tabbable: o, tipOff: a, onChoose: r, onFocus: s }) {
1678
+ const [m, b] = A(!1);
1631
1679
  J(() => {
1632
1680
  if (!n.busy) {
1633
1681
  b(!1);
1634
1682
  return;
1635
1683
  }
1636
- const k = setTimeout(() => b(!0), ye);
1637
- return () => clearTimeout(k);
1684
+ const y = setTimeout(() => b(!0), ye);
1685
+ return () => clearTimeout(y);
1638
1686
  }, [n.busy]);
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);
1640
- return /* @__PURE__ */ d(
1687
+ const i = _e(n.icon) === null, h = l || i, c = n.disabled && n.reason ? n.reason : null, f = c ?? (h ? null : n.label), p = q(), [g, N] = A(!1);
1688
+ return /* @__PURE__ */ u(
1641
1689
  "button",
1642
1690
  {
1643
1691
  type: "button",
1644
- className: T("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", c && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1692
+ className: E("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", i && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1645
1693
  "data-action": n.id,
1646
1694
  "data-stop": n.id,
1647
1695
  ...t ? { "data-overflowed": "" } : {},
1648
- ...o ? { "data-pinned": "" } : {},
1696
+ ...d ? { "data-pinned": "" } : {},
1649
1697
  hidden: t,
1650
1698
  "aria-label": n.label,
1651
1699
  "aria-disabled": n.disabled || void 0,
1652
1700
  "aria-busy": n.busy || void 0,
1653
- ...a === null ? {} : { "aria-describedby": p },
1654
- ...v && a !== null ? { "data-reason-shown": "" } : {},
1655
- tabIndex: m ? 0 : -1,
1656
- onFocus: i,
1701
+ ...c === null ? {} : { "aria-describedby": p },
1702
+ ...g && c !== null ? { "data-reason-shown": "" } : {},
1703
+ tabIndex: o ? 0 : -1,
1704
+ onFocus: s,
1657
1705
  onBlur: () => N(!1),
1658
- onKeyDown: (k) => {
1659
- k.key === "Escape" && N(!1);
1706
+ onKeyDown: (y) => {
1707
+ y.key === "Escape" && N(!1);
1660
1708
  },
1661
1709
  onClick: () => {
1662
- a !== null ? N(!0) : !n.disabled && !n.busy && r();
1710
+ c !== null ? N(!0) : !n.disabled && !n.busy && r();
1663
1711
  },
1664
1712
  children: [
1665
- u ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
1713
+ m ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(pe, { name: n.icon }),
1666
1714
  h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1667
- a !== null || g !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: g }) : null
1715
+ c !== null || f !== null && !a ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: f }) : null
1668
1716
  ]
1669
1717
  }
1670
1718
  );
1671
1719
  }
1672
- function fe({ name: n }) {
1720
+ function pe({ name: n }) {
1673
1721
  const l = _e(n);
1674
- return l === null ? null : /* @__PURE__ */ e(P, { name: l, size: 18 });
1675
- }
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 = () => {
1678
- o && u();
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 = () => {
1680
- var k;
1681
- g(), p && ((k = i.onAction) == null || k.call(i));
1722
+ return l === null ? null : /* @__PURE__ */ e(T, { name: l, size: 18 });
1723
+ }
1724
+ function Qn({ title: n, body: l = null, time: t = null, unread: d, unreadLabel: o, expandLabel: a, collapseLabel: r, action: s = null, onRead: m, leading: b }) {
1725
+ const [i, h] = A(!1), c = q(), f = () => {
1726
+ d && m();
1727
+ }, p = (s == null ? void 0 : s.presentation) === "row" && s.onAction !== void 0, g = (s == null ? void 0 : s.presentation) === "button" && s.onAction !== void 0 ? s : null, N = () => {
1728
+ var y;
1729
+ f(), p && ((y = s.onAction) == null || y.call(s));
1682
1730
  };
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: [
1684
- /* @__PURE__ */ d(
1731
+ return /* @__PURE__ */ u("article", { className: E("cms-notification", d && "is-unread", i && "is-expanded", p && "is-row-action"), "data-state": d ? "unread" : "read", children: [
1732
+ /* @__PURE__ */ u(
1685
1733
  "div",
1686
1734
  {
1687
1735
  className: "cms-notification__row",
1688
1736
  role: "button",
1689
1737
  tabIndex: 0,
1690
- "aria-describedby": l === null ? void 0 : a,
1738
+ "aria-describedby": l === null ? void 0 : c,
1691
1739
  onClick: N,
1692
- onKeyDown: (k) => {
1693
- k.target !== k.currentTarget || k.key !== "Enter" && k.key !== " " || (k.preventDefault(), N());
1740
+ onKeyDown: (y) => {
1741
+ y.target !== y.currentTarget || y.key !== "Enter" && y.key !== " " || (y.preventDefault(), N());
1694
1742
  },
1695
1743
  children: [
1696
1744
  b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
1697
- /* @__PURE__ */ d("span", { className: "cms-notification__text", children: [
1698
- /* @__PURE__ */ d("span", { className: "cms-notification__head", children: [
1699
- /* @__PURE__ */ d("span", { className: "cms-notification__title", children: [
1700
- o ? /* @__PURE__ */ d("span", { className: "cms-visually-hidden", children: [
1701
- m,
1745
+ /* @__PURE__ */ u("span", { className: "cms-notification__text", children: [
1746
+ /* @__PURE__ */ u("span", { className: "cms-notification__head", children: [
1747
+ /* @__PURE__ */ u("span", { className: "cms-notification__title", children: [
1748
+ d ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
1749
+ o,
1702
1750
  " "
1703
1751
  ] }) : null,
1704
1752
  n
1705
1753
  ] }),
1706
1754
  t !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: t }) : null
1707
1755
  ] }),
1708
- l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: a, children: l }) : null
1756
+ l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: c, children: l }) : null
1709
1757
  ] }),
1710
- o ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
1758
+ d ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
1711
1759
  ]
1712
1760
  }
1713
1761
  ),
@@ -1716,35 +1764,35 @@ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
1716
1764
  {
1717
1765
  type: "button",
1718
1766
  className: "cms-notification__chevron",
1719
- "aria-expanded": c,
1720
- "aria-controls": a,
1721
- "aria-label": c ? r : s,
1722
- title: c ? r : s,
1767
+ "aria-expanded": i,
1768
+ "aria-controls": c,
1769
+ "aria-label": i ? r : a,
1770
+ title: i ? r : a,
1723
1771
  onClick: () => {
1724
- c || g(), h((k) => !k);
1772
+ i || f(), h((y) => !y);
1725
1773
  },
1726
- children: /* @__PURE__ */ e(P, { name: "chevron-down", size: 18 })
1774
+ children: /* @__PURE__ */ e(T, { name: "chevron-down", size: 18 })
1727
1775
  }
1728
1776
  ) : null,
1729
- v !== null ? /* @__PURE__ */ e(
1777
+ g !== null ? /* @__PURE__ */ e(
1730
1778
  "button",
1731
1779
  {
1732
1780
  type: "button",
1733
1781
  className: "cms-button cms-notification__action",
1734
1782
  onClick: () => {
1735
- var k;
1736
- g(), (k = v.onAction) == null || k.call(v);
1783
+ var y;
1784
+ f(), (y = g.onAction) == null || y.call(g);
1737
1785
  },
1738
- children: v.label
1786
+ children: g.label
1739
1787
  }
1740
1788
  ) : null
1741
1789
  ] });
1742
1790
  }
1743
- function hn(n) {
1791
+ function Nn(n) {
1744
1792
  return n === "allowed" || n === "elevate" || n === "denied";
1745
1793
  }
1746
- function qn(n, l) {
1747
- if (!hn(n))
1794
+ function el(n, l) {
1795
+ if (!Nn(n))
1748
1796
  return l.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
1749
1797
  switch (n) {
1750
1798
  case "allowed":
@@ -1755,123 +1803,172 @@ function qn(n, l) {
1755
1803
  return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
1756
1804
  }
1757
1805
  }
1758
- function pn(n, l) {
1806
+ function yn(n, l) {
1759
1807
  if (!n) return;
1760
1808
  if (typeof n.get == "function") return n.get(l) ?? void 0;
1761
- const t = n, o = Object.keys(t).find((m) => m.toLowerCase() === l.toLowerCase());
1762
- return o === void 0 ? void 0 : t[o];
1809
+ const t = n, d = Object.keys(t).find((o) => o.toLowerCase() === l.toLowerCase());
1810
+ return d === void 0 ? void 0 : t[d];
1763
1811
  }
1764
- function fn(n) {
1812
+ function wn(n) {
1765
1813
  if (n && typeof n == "object") {
1766
1814
  const l = n;
1767
1815
  if (typeof l.detail == "string" && l.detail !== "") return l.detail;
1768
1816
  if (typeof l.title == "string" && l.title !== "") return l.title;
1769
1817
  }
1770
1818
  }
1771
- function Xn(n, l, t, o) {
1819
+ function nl(n, l, t, d) {
1772
1820
  if (n !== 403) return { kind: "none" };
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." };
1775
- }
1776
- const we = "coolms-kit:reread";
1777
- function Gn() {
1778
- window.dispatchEvent(new Event(we));
1779
- }
1780
- function Yn(n) {
1781
- const [l, t] = D(void 0), [o, m] = D(void 0), [s, r] = D(!0), i = R(n);
1782
- i.current = n;
1783
- const u = R(0), b = be(() => {
1784
- const c = ++u.current;
1785
- r(!0), i.current().then(
1821
+ const o = wn(t);
1822
+ return yn(l, "X-Elevation-Required") !== void 0 ? d.elevates ? { kind: "elevation-required", message: o ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: o ?? "The server refused this." };
1823
+ }
1824
+ const ke = "coolms-kit:reread";
1825
+ function ll() {
1826
+ window.dispatchEvent(new Event(ke));
1827
+ }
1828
+ function tl(n) {
1829
+ const [l, t] = A(void 0), [d, o] = A(void 0), [a, r] = A(!0), s = K(n);
1830
+ s.current = n;
1831
+ const m = K(0), b = be(() => {
1832
+ const i = ++m.current;
1833
+ r(!0), s.current().then(
1786
1834
  (h) => {
1787
- c === u.current && (t(h), m(void 0), r(!1));
1835
+ i === m.current && (t(h), o(void 0), r(!1));
1788
1836
  },
1789
1837
  (h) => {
1790
- c === u.current && (m(h), r(!1));
1838
+ i === m.current && (o(h), r(!1));
1791
1839
  }
1792
1840
  );
1793
1841
  }, []);
1794
1842
  return J(() => {
1795
1843
  b();
1796
- const c = () => b();
1797
- return window.addEventListener("focus", c), window.addEventListener(we, c), () => {
1798
- window.removeEventListener("focus", c), window.removeEventListener(we, c);
1844
+ const i = () => b();
1845
+ return window.addEventListener("focus", i), window.addEventListener(ke, i), () => {
1846
+ window.removeEventListener("focus", i), window.removeEventListener(ke, i);
1799
1847
  };
1800
- }, [b]), { value: l, error: o, loading: s, reread: b };
1848
+ }, [b]), { value: l, error: d, loading: a, reread: b };
1801
1849
  }
1802
- function Jn(n) {
1850
+ function al(n) {
1803
1851
  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 };
1804
1852
  }
1805
- const bn = "/errors/client-update-required";
1806
- function _n(n, l) {
1807
- const t = n.split(".").map((m) => Number.parseInt(m, 10) || 0), o = l.split(".").map((m) => Number.parseInt(m, 10) || 0);
1808
- for (let m = 0; m < Math.max(t.length, o.length); m++) {
1809
- const s = t[m] ?? 0, r = o[m] ?? 0;
1810
- if (s !== r) return s < r;
1853
+ const kn = "/errors/client-update-required";
1854
+ function xn(n, l) {
1855
+ const t = n.split(".").map((o) => Number.parseInt(o, 10) || 0), d = l.split(".").map((o) => Number.parseInt(o, 10) || 0);
1856
+ for (let o = 0; o < Math.max(t.length, d.length); o++) {
1857
+ const a = t[o] ?? 0, r = d[o] ?? 0;
1858
+ if (a !== r) return a < r;
1811
1859
  }
1812
1860
  return !1;
1813
1861
  }
1814
- function Qn(n) {
1815
- return n.problemType !== void 0 && n.problemType.endsWith(bn) ? !0 : n.minimumVersion !== void 0 && _n(n.version, n.minimumVersion);
1862
+ function sl(n) {
1863
+ return n.problemType !== void 0 && n.problemType.endsWith(kn) ? !0 : n.minimumVersion !== void 0 && xn(n.version, n.minimumVersion);
1864
+ }
1865
+ function rl({ title: n, back: l, navigation: t, search: d, searching: o, globals: a, filters: r, primary: s, onRefresh: m, pullText: b, children: i }) {
1866
+ const h = K(null), [c, f] = A(!1), [p, g] = A(null), y = pn(h, m === void 0 ? null : () => {
1867
+ c || (f(!0), m().finally(() => f(!1)));
1868
+ }), x = m === void 0 ? null : { distance: y, refreshing: c, text: b ?? null };
1869
+ return /* @__PURE__ */ u("div", { className: E("cms-screen", s !== void 0 && "cms-screen--with-primary"), children: [
1870
+ o !== void 0 ? /* @__PURE__ */ u("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
1871
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": o.closeLabel, title: o.closeLabel, onClick: o.onClose, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
1872
+ /* @__PURE__ */ e("div", { className: "cms-screen__search", children: o.field })
1873
+ ] }) : /* @__PURE__ */ u("header", { className: "cms-screen__bar", children: [
1874
+ /* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ u("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
1875
+ /* @__PURE__ */ e(T, { name: "chevron-left" }),
1876
+ /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
1877
+ ] }) : /* @__PURE__ */ u("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
1878
+ /* @__PURE__ */ e(T, { name: "chevron-left" }),
1879
+ /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
1880
+ ] }) : t }),
1881
+ /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
1882
+ /* @__PURE__ */ u("div", { className: "cms-screen__trailing", children: [
1883
+ d !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": d.label, title: d.label, onClick: d.onOpen, children: /* @__PURE__ */ e(T, { name: "search" }) }) : null,
1884
+ a
1885
+ ] })
1886
+ ] }),
1887
+ r !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(dn, { label: r.label, options: r.options, value: r.selected, onChange: r.onSelect }) }) : null,
1888
+ /* @__PURE__ */ e("div", { ref: h, className: "cms-screen__content", "data-pulling": y > 0 ? "" : void 0, "data-refreshing": c ? "" : void 0, children: /* @__PURE__ */ e(Ie.Provider, { value: x, children: i }) }),
1889
+ s !== void 0 ? /* @__PURE__ */ e(
1890
+ "button",
1891
+ {
1892
+ type: "button",
1893
+ className: "cms-button cms-button--primary cms-screen__primary",
1894
+ "aria-label": s.label,
1895
+ title: s.label,
1896
+ ..."menu" in s ? { "aria-haspopup": "menu", "aria-expanded": p !== null } : {},
1897
+ onClick: (M) => {
1898
+ if ("menu" in s) {
1899
+ const C = M.currentTarget.getBoundingClientRect();
1900
+ g(p === null ? { x: C.left, y: C.top } : null);
1901
+ } else
1902
+ s.onPress();
1903
+ },
1904
+ children: /* @__PURE__ */ e(T, { name: s.icon, size: 24 })
1905
+ }
1906
+ ) : null,
1907
+ s !== void 0 && "menu" in s ? /* @__PURE__ */ e(Be, { at: p, items: s.menu, onClose: () => g(null), label: s.label }) : null
1908
+ ] });
1816
1909
  }
1817
1910
  export {
1818
- $n as AppShell,
1911
+ Un as AppShell,
1819
1912
  ve as Avatar,
1820
- Ae as BOOTSTRAP_ICONS,
1821
- tn as Badge,
1913
+ Ee as BOOTSTRAP_ICONS,
1914
+ on as Badge,
1822
1915
  ne as Button,
1823
- Se as CALL_LABELS,
1824
- bn as CLIENT_UPDATE_REQUIRED,
1825
- Rn as CallBar,
1826
- Un as CallPanel,
1827
- Kn as ChatBubble,
1828
- Hn as Composer,
1829
- Cn as ConfirmDialog,
1830
- on as ContextMenu,
1831
- Re as EmptyState,
1832
- ze as ErrorBanner,
1833
- Tn as FilePicker,
1834
- Je as FilePickerDenied,
1835
- Dn as FileViewer,
1836
- Pn as FilterChips,
1837
- An as ICON_NAMES,
1838
- P as Icon,
1839
- On as IncomingCall,
1840
- Vn as List,
1841
- Ue as Loading,
1842
- rn as MAIL_ROW_LABELS,
1843
- Oe as MODAL_CLOSE_MS,
1844
- Bn as MailRow,
1845
- Le as Modal,
1846
- jn as Notification,
1847
- En as PageHeader,
1848
- Wn as PaneToolbar,
1849
- cn as SIGN_IN_LABELS,
1916
+ Ae as CALL_LABELS,
1917
+ kn as CLIENT_UPDATE_REQUIRED,
1918
+ qn as CallBar,
1919
+ jn as CallPanel,
1920
+ Zn as ChatBubble,
1921
+ Vn as Composer,
1922
+ Ln as ConfirmDialog,
1923
+ Be as ContextMenu,
1924
+ je as EmptyState,
1925
+ qe as ErrorBanner,
1926
+ Fn as FilePicker,
1927
+ tn as FilePickerDenied,
1928
+ Bn as FileViewer,
1929
+ dn as FilterChips,
1930
+ In as ICON_NAMES,
1931
+ T as Icon,
1932
+ Wn as IncomingCall,
1933
+ Gn as List,
1934
+ We as Loading,
1935
+ hn as MAIL_ROW_LABELS,
1936
+ Ve as MODAL_CLOSE_MS,
1937
+ Rn as MailRow,
1938
+ $e as Modal,
1939
+ Qn as Notification,
1940
+ we as PULL_AT,
1941
+ Kn as PageHeader,
1942
+ Jn as PaneToolbar,
1943
+ fn as SIGN_IN_LABELS,
1850
1944
  ye as STATE_DELAY_MS,
1851
- In as SearchField,
1852
- kn as Select,
1853
- Zn as SignInForm,
1854
- zn as SignInLayout,
1855
- Fn as SplitPanes,
1945
+ rl as ScreenShell,
1946
+ Hn as SearchField,
1947
+ Dn as Select,
1948
+ Xn as SignInForm,
1949
+ Yn as SignInLayout,
1950
+ zn as SplitPanes,
1856
1951
  ee as State,
1857
- Ln as TabStrip,
1858
- wn as TextArea,
1859
- yn as TextField,
1860
- Mn as Toast,
1861
- Sn as ToastRegion,
1862
- xn as Toggle,
1863
- an as fitPanes,
1952
+ On as TabStrip,
1953
+ En as TextArea,
1954
+ An as TextField,
1955
+ $n as Toast,
1956
+ Pn as ToastRegion,
1957
+ Tn as Toggle,
1958
+ un as fitPanes,
1864
1959
  _e as iconForName,
1865
- nn as initialsOf,
1866
- hn as isCapability,
1867
- Qn as needsClientUpdate,
1868
- qn as offerFor,
1869
- Jn as readConflict,
1870
- Xn as readRefusal,
1871
- fn as refusalText,
1872
- Gn as rereadAll,
1873
- ln as tintOf,
1874
- Yn as useReread,
1875
- _n as versionBelow,
1876
- Ke as writtenOut
1960
+ rn as initialsOf,
1961
+ Nn as isCapability,
1962
+ sl as needsClientUpdate,
1963
+ el as offerFor,
1964
+ al as readConflict,
1965
+ nl as readRefusal,
1966
+ wn as refusalText,
1967
+ ll as rereadAll,
1968
+ cn as tintOf,
1969
+ pn as usePull,
1970
+ bn as usePullState,
1971
+ tl as useReread,
1972
+ xn as versionBelow,
1973
+ Re as writtenOut
1877
1974
  };