@coolms/ui-react 0.1.0-alpha.31 → 0.1.0-alpha.33

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,18 +1,18 @@
1
- import { jsx as e, jsxs as c, Fragment as E } from "react/jsx-runtime";
2
- import { useId as G, useState as A, useRef as H, useEffect as Y, useCallback as we, useMemo as je, useContext as qe, createContext as Ye, useLayoutEffect as fe } from "react";
3
- import { createPortal as De } from "react-dom";
4
- function be(n, l) {
1
+ import { jsx as e, jsxs as i, Fragment as A } from "react/jsx-runtime";
2
+ import { useId as se, useState as T, useRef as H, useEffect as Q, useCallback as be, useMemo as ln, useContext as tn, createContext as sn, useLayoutEffect as ve, Fragment as an } from "react";
3
+ import { createPortal as Pe } from "react-dom";
4
+ function ye(n, l) {
5
5
  const t = { ...n };
6
- for (const i of Object.keys(l ?? {})) {
7
- const o = l == null ? void 0 : l[i];
8
- o !== void 0 && (t[i] = o);
6
+ for (const r of Object.keys(l ?? {})) {
7
+ const c = l == null ? void 0 : l[r];
8
+ c !== void 0 && (t[r] = c);
9
9
  }
10
10
  return t;
11
11
  }
12
- function $(...n) {
12
+ function F(...n) {
13
13
  return n.filter(Boolean).join(" ");
14
14
  }
15
- function V({ name: n }) {
15
+ function G({ name: n }) {
16
16
  const l = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
17
17
  switch (n) {
18
18
  case "lock":
@@ -31,430 +31,430 @@ function V({ name: n }) {
31
31
  return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
32
32
  }
33
33
  }
34
- function se({
34
+ function he({
35
35
  variant: n = "secondary",
36
36
  busy: l = !1,
37
37
  busyLabel: t,
38
- locked: i = !1,
39
- lockedReason: o,
38
+ locked: r = !1,
39
+ lockedReason: c,
40
40
  icon: s,
41
- disabled: d,
41
+ disabled: u,
42
42
  className: a,
43
43
  children: m,
44
44
  type: v = "button",
45
- title: u,
46
- ...f
45
+ title: o,
46
+ ...p
47
47
  }) {
48
- const r = !!d || l;
49
- return /* @__PURE__ */ c(
48
+ const h = !!u || l;
49
+ return /* @__PURE__ */ i(
50
50
  "button",
51
51
  {
52
- ...f,
52
+ ...p,
53
53
  type: v,
54
- className: $("cms-button", `cms-button--${n}`, l && "is-busy", i && "is-locked", a),
55
- disabled: r,
54
+ className: F("cms-button", `cms-button--${n}`, l && "is-busy", r && "is-locked", a),
55
+ disabled: h,
56
56
  "aria-busy": l || void 0,
57
- title: i ? o ?? u : u,
57
+ title: r ? c ?? o : o,
58
58
  children: [
59
- l ? /* @__PURE__ */ e(V, { name: "spinner" }) : i ? /* @__PURE__ */ e(V, { name: "lock" }) : s,
59
+ l ? /* @__PURE__ */ e(G, { name: "spinner" }) : r ? /* @__PURE__ */ e(G, { name: "lock" }) : s,
60
60
  /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : m }),
61
- i && o ? /* @__PURE__ */ c("span", { className: "cms-visually-hidden", children: [
61
+ r && c ? /* @__PURE__ */ i("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
- o
63
+ c
64
64
  ] }) : null
65
65
  ]
66
66
  }
67
67
  );
68
68
  }
69
- function Le({ id: n, label: l, help: t, error: i, pinned: o, children: s }) {
70
- return /* @__PURE__ */ c("div", { className: $("cms-field", i != null && "is-invalid"), children: [
69
+ function Fe({ id: n, label: l, help: t, error: r, pinned: c, children: s }) {
70
+ return /* @__PURE__ */ i("div", { className: F("cms-field", r != null && "is-invalid"), children: [
71
71
  /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
72
72
  s,
73
- o != null ? /* @__PURE__ */ c("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
- /* @__PURE__ */ e(V, { name: "lock" }),
73
+ c != null ? /* @__PURE__ */ i("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
+ /* @__PURE__ */ e(G, { name: "lock" }),
75
75
  " ",
76
- o
76
+ c
77
77
  ] }) : null,
78
- i != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: i }) : null,
78
+ r != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: r }) : null,
79
79
  t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
80
80
  ] });
81
81
  }
82
- function $e(n, l) {
82
+ function Be(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 Ge = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Xe = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
- function Je(n, l, t) {
88
- const i = (s, d, a, m = 0, v = 0, u = 0) => {
89
- const f = new Date(Date.UTC(s, d - 1, a, m, v, u));
90
- return f.setUTCFullYear(s), f.getUTCFullYear() === s && f.getUTCMonth() === d - 1 && f.getUTCDate() === a && f.getUTCHours() === m && f.getUTCMinutes() === v && f.getUTCSeconds() === u ? f : null;
91
- }, o = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
86
+ const rn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, cn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
+ function on(n, l, t) {
88
+ const r = (s, u, a, m = 0, v = 0, o = 0) => {
89
+ const p = new Date(Date.UTC(s, u - 1, a, m, v, o));
90
+ return p.setUTCFullYear(s), p.getUTCFullYear() === s && p.getUTCMonth() === u - 1 && p.getUTCDate() === a && p.getUTCHours() === m && p.getUTCMinutes() === v && p.getUTCSeconds() === o ? p : null;
91
+ }, c = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
92
92
  try {
93
93
  if (n === "time") {
94
- const d = l.match(Xe);
95
- if (d === null) return l;
96
- const a = o(d), m = i(2e3, 1, 1, a.hour, a.minute, a.second);
97
- return m === null ? l : new Intl.DateTimeFormat(t, { timeStyle: d[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
94
+ const u = l.match(cn);
95
+ if (u === null) return l;
96
+ const a = c(u), m = r(2e3, 1, 1, a.hour, a.minute, a.second);
97
+ return m === null ? l : new Intl.DateTimeFormat(t, { timeStyle: u[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
98
98
  }
99
- const s = l.match(Ge);
99
+ const s = l.match(rn);
100
100
  if (s === null) return l;
101
101
  if (n === "date" && s[4] === void 0) {
102
- const d = i(Number(s[1]), Number(s[2]), Number(s[3]));
103
- return d === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(d);
102
+ const u = r(Number(s[1]), Number(s[2]), Number(s[3]));
103
+ return u === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(u);
104
104
  }
105
105
  if (n === "datetime-local" && s[4] !== void 0) {
106
- const d = i(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
107
- return d === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(d);
106
+ const u = r(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
107
+ return u === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
108
108
  }
109
109
  } catch {
110
110
  return l;
111
111
  }
112
112
  return l;
113
113
  }
114
- const Qe = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
- function qn({ label: n, help: l, error: t, disabled: i, readOnly: o, pinned: s, value: d, onChange: a, placeholder: m, type: v = "text", name: u, locale: f, min: r, max: h, step: _, minLength: N, maxLength: y, required: k }) {
116
- const C = G(), M = o === !0 || s != null, b = M && Qe.has(v), w = v === "number" && (_ === "any" || typeof _ == "number" && !Number.isInteger(_));
117
- return /* @__PURE__ */ e(Le, { id: C, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
114
+ const dn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
+ function il({ label: n, help: l, error: t, disabled: r, readOnly: c, pinned: s, value: u, onChange: a, placeholder: m, type: v = "text", name: o, locale: p, min: h, max: f, step: d, minLength: g, maxLength: k, required: x }) {
116
+ const C = se(), w = c === !0 || s != null, b = w && dn.has(v), y = v === "number" && (d === "any" || typeof d == "number" && !Number.isInteger(d));
117
+ return /* @__PURE__ */ e(Fe, { id: C, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
118
118
  "input",
119
119
  {
120
120
  id: C,
121
- name: u,
121
+ name: o,
122
122
  type: b ? "text" : v,
123
123
  className: "cms-input",
124
- value: b ? Je(v, d, f) : d,
125
- ...b ? { "data-value": d } : {},
126
- lang: f,
124
+ value: b ? on(v, u, p) : u,
125
+ ...b ? { "data-value": u } : {},
126
+ lang: p,
127
127
  placeholder: m,
128
- disabled: i,
129
- readOnly: M,
130
- required: k,
131
- "aria-required": k || void 0,
132
- min: b ? void 0 : r,
133
- max: b ? void 0 : h,
134
- step: b ? void 0 : _,
135
- minLength: N,
136
- maxLength: y,
137
- inputMode: v === "number" ? w ? "decimal" : "numeric" : void 0,
128
+ disabled: r,
129
+ readOnly: w,
130
+ required: x,
131
+ "aria-required": x || void 0,
132
+ min: b ? void 0 : h,
133
+ max: b ? void 0 : f,
134
+ step: b ? void 0 : d,
135
+ minLength: g,
136
+ maxLength: k,
137
+ inputMode: v === "number" ? y ? "decimal" : "numeric" : void 0,
138
138
  "aria-invalid": t != null || void 0,
139
- "aria-describedby": $e(C, { help: l, error: t, pinned: s }),
140
- onChange: (T) => a == null ? void 0 : a(T.target.value)
139
+ "aria-describedby": Be(C, { help: l, error: t, pinned: s }),
140
+ onChange: (D) => a == null ? void 0 : a(D.target.value)
141
141
  }
142
142
  ) });
143
143
  }
144
- function Yn({ label: n, help: l, error: t, disabled: i, readOnly: o, pinned: s, value: d, onChange: a, placeholder: m, rows: v = 4, name: u, locale: f, minLength: r, maxLength: h, required: _ }) {
145
- const N = G();
146
- return /* @__PURE__ */ e(Le, { id: N, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
144
+ function ol({ label: n, help: l, error: t, disabled: r, readOnly: c, pinned: s, value: u, onChange: a, placeholder: m, rows: v = 4, name: o, locale: p, minLength: h, maxLength: f, required: d }) {
145
+ const g = se();
146
+ return /* @__PURE__ */ e(Fe, { id: g, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
147
147
  "textarea",
148
148
  {
149
- id: N,
150
- name: u,
149
+ id: g,
150
+ name: o,
151
151
  className: "cms-input cms-textarea",
152
152
  rows: v,
153
- value: d,
154
- lang: f,
153
+ value: u,
154
+ lang: p,
155
155
  placeholder: m,
156
- disabled: i,
157
- readOnly: o === !0 || s != null,
158
- required: _,
159
- "aria-required": _ || void 0,
160
- minLength: r,
161
- maxLength: h,
156
+ disabled: r,
157
+ readOnly: c === !0 || s != null,
158
+ required: d,
159
+ "aria-required": d || void 0,
160
+ minLength: h,
161
+ maxLength: f,
162
162
  "aria-invalid": t != null || void 0,
163
- "aria-describedby": $e(N, { help: l, error: t, pinned: s }),
164
- onChange: (y) => a == null ? void 0 : a(y.target.value)
163
+ "aria-describedby": Be(g, { help: l, error: t, pinned: s }),
164
+ onChange: (k) => a == null ? void 0 : a(k.target.value)
165
165
  }
166
166
  ) });
167
167
  }
168
- function Gn({ label: n, help: l, error: t, disabled: i, readOnly: o, value: s, options: d, onChange: a, emptyText: m = "Nothing to choose from yet.", name: v }) {
169
- const u = G(), f = d.length === 0;
170
- return /* @__PURE__ */ e(Le, { id: u, label: n, help: f ? m : l, error: t, children: /* @__PURE__ */ e(
168
+ function dl({ label: n, help: l, error: t, disabled: r, readOnly: c, value: s, options: u, onChange: a, emptyText: m = "Nothing to choose from yet.", name: v }) {
169
+ const o = se(), p = u.length === 0;
170
+ return /* @__PURE__ */ e(Fe, { id: o, label: n, help: p ? m : l, error: t, children: /* @__PURE__ */ e(
171
171
  "select",
172
172
  {
173
- id: u,
173
+ id: o,
174
174
  name: v,
175
175
  className: "cms-input cms-select",
176
176
  value: s,
177
- disabled: i || f,
178
- "aria-readonly": o || void 0,
177
+ disabled: r || p,
178
+ "aria-readonly": c || void 0,
179
179
  "aria-invalid": t != null || void 0,
180
- "aria-describedby": $e(u, { help: f ? m : l, error: t }),
181
- onChange: (r) => {
182
- o || a == null || a(r.target.value);
180
+ "aria-describedby": Be(o, { help: p ? m : l, error: t }),
181
+ onChange: (h) => {
182
+ c || a == null || a(h.target.value);
183
183
  },
184
- children: d.map((r) => /* @__PURE__ */ e("option", { value: r.value, disabled: o && r.value !== s, children: r.label }, r.value))
184
+ children: u.map((h) => /* @__PURE__ */ e("option", { value: h.value, disabled: c && h.value !== s, children: h.label }, h.value))
185
185
  }
186
186
  ) });
187
187
  }
188
- function Xn({ label: n, checked: l, onChange: t, disabled: i, readOnly: o, help: s }) {
189
- const d = G();
190
- return /* @__PURE__ */ c("div", { className: "cms-toggle-row", children: [
188
+ function ul({ label: n, checked: l, onChange: t, disabled: r, readOnly: c, help: s }) {
189
+ const u = se();
190
+ return /* @__PURE__ */ i("div", { className: "cms-toggle-row", children: [
191
191
  /* @__PURE__ */ e(
192
192
  "button",
193
193
  {
194
- id: d,
194
+ id: u,
195
195
  type: "button",
196
196
  role: "switch",
197
- className: $("cms-toggle", l && "is-on"),
197
+ className: F("cms-toggle", l && "is-on"),
198
198
  "aria-checked": l,
199
- "aria-readonly": o || void 0,
200
- "aria-describedby": s != null ? `${d}-help` : void 0,
201
- disabled: i,
199
+ "aria-readonly": c || void 0,
200
+ "aria-describedby": s != null ? `${u}-help` : void 0,
201
+ disabled: r,
202
202
  onClick: () => {
203
- o || t == null || t(!l);
203
+ c || t == null || t(!l);
204
204
  },
205
205
  children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
206
206
  }
207
207
  ),
208
- /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: d, children: n }),
209
- s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${d}-help`, children: s }) : null
208
+ /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: u, children: n }),
209
+ s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${u}-help`, children: s }) : null
210
210
  ] });
211
211
  }
212
- const en = 150;
213
- function ze({ open: n, title: l, onClose: t, dirty: i = !1, onDirtyClose: o, children: s, footer: d, closeLabel: a = "Close", initialFocus: m, className: v }) {
214
- const [u, f] = A(n), [r, h] = A(!1), _ = H(null), N = H(null), y = G();
215
- if (Y(() => {
212
+ const un = 150;
213
+ function je({ open: n, title: l, onClose: t, dirty: r = !1, onDirtyClose: c, children: s, footer: u, closeLabel: a = "Close", initialFocus: m, className: v }) {
214
+ const [o, p] = T(n), [h, f] = T(!1), d = H(null), g = H(null), k = se();
215
+ if (Q(() => {
216
216
  if (n) {
217
- N.current = document.activeElement, f(!0), h(!1);
217
+ g.current = document.activeElement, p(!0), f(!1);
218
218
  return;
219
219
  }
220
- if (!u) return;
221
- h(!0);
220
+ if (!o) return;
221
+ f(!0);
222
222
  const C = window.setTimeout(() => {
223
- var M, b;
224
- f(!1), h(!1), (b = (M = N.current) == null ? void 0 : M.focus) == null || b.call(M);
225
- }, en);
223
+ var w, b;
224
+ p(!1), f(!1), (b = (w = g.current) == null ? void 0 : w.focus) == null || b.call(w);
225
+ }, un);
226
226
  return () => window.clearTimeout(C);
227
- }, [n, u]), Y(() => {
228
- var C, M;
229
- if (n && u) {
227
+ }, [n, o]), Q(() => {
228
+ var C, w;
229
+ if (n && o) {
230
230
  const b = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
231
- (M = (m == null ? void 0 : m.current) ?? ((C = _.current) == null ? void 0 : C.querySelector(`.cms-modal__body :is(${b}), .cms-modal__foot :is(${b})`)) ?? _.current) == null || M.focus();
231
+ (w = (m == null ? void 0 : m.current) ?? ((C = d.current) == null ? void 0 : C.querySelector(`.cms-modal__body :is(${b}), .cms-modal__foot :is(${b})`)) ?? d.current) == null || w.focus();
232
232
  }
233
- }, [n, u, m]), !u) return null;
234
- const k = () => {
235
- i ? o == null || o() : t();
233
+ }, [n, o, m]), !o) return null;
234
+ const x = () => {
235
+ r ? c == null || c() : t();
236
236
  };
237
- return De(
238
- /* @__PURE__ */ e("div", { className: $("cms-modal-scrim", r && "is-closing"), onMouseDown: (C) => {
239
- C.target === C.currentTarget && k();
240
- }, children: /* @__PURE__ */ c(
237
+ return Pe(
238
+ /* @__PURE__ */ e("div", { className: F("cms-modal-scrim", h && "is-closing"), onMouseDown: (C) => {
239
+ C.target === C.currentTarget && x();
240
+ }, children: /* @__PURE__ */ i(
241
241
  "div",
242
242
  {
243
- ref: _,
244
- className: $("cms-modal", v, r && "is-closing", i && "is-dirty"),
243
+ ref: d,
244
+ className: F("cms-modal", v, h && "is-closing", r && "is-dirty"),
245
245
  role: "dialog",
246
246
  "aria-modal": "true",
247
- "aria-labelledby": y,
247
+ "aria-labelledby": k,
248
248
  tabIndex: -1,
249
249
  onKeyDown: (C) => {
250
- var M;
250
+ var w;
251
251
  if (C.key === "Escape")
252
- C.stopPropagation(), k();
252
+ C.stopPropagation(), x();
253
253
  else if (C.key === "Tab") {
254
- const b = (M = _.current) == null ? void 0 : M.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
254
+ const b = (w = d.current) == null ? void 0 : w.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
255
255
  if (!b || b.length === 0) return;
256
- const w = b[0], T = b[b.length - 1];
257
- C.shiftKey && document.activeElement === w ? (C.preventDefault(), T.focus()) : !C.shiftKey && document.activeElement === T && (C.preventDefault(), w.focus());
256
+ const y = b[0], D = b[b.length - 1];
257
+ C.shiftKey && document.activeElement === y ? (C.preventDefault(), D.focus()) : !C.shiftKey && document.activeElement === D && (C.preventDefault(), y.focus());
258
258
  }
259
259
  },
260
260
  children: [
261
- /* @__PURE__ */ c("header", { className: "cms-modal__head", children: [
262
- /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: y, children: l }),
263
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a, onClick: k, children: /* @__PURE__ */ e(V, { name: "close" }) })
261
+ /* @__PURE__ */ i("header", { className: "cms-modal__head", children: [
262
+ /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: k, children: l }),
263
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a, onClick: x, children: /* @__PURE__ */ e(G, { name: "close" }) })
264
264
  ] }),
265
265
  /* @__PURE__ */ e("div", { className: "cms-modal__body", children: s }),
266
- d != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: d }) : null
266
+ u != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: u }) : null
267
267
  ]
268
268
  }
269
269
  ) }),
270
270
  document.body
271
271
  );
272
272
  }
273
- function Jn({ open: n, title: l, message: t, kind: i = "default", confirmLabel: o, cancelLabel: s, closeLabel: d, onConfirm: a, onCancel: m }) {
274
- const v = i === "discard-changes";
273
+ function ml({ open: n, title: l, message: t, kind: r = "default", confirmLabel: c, cancelLabel: s, closeLabel: u, onConfirm: a, onCancel: m }) {
274
+ const v = r === "discard-changes";
275
275
  return /* @__PURE__ */ e(
276
- ze,
276
+ je,
277
277
  {
278
278
  open: n,
279
279
  title: l,
280
280
  onClose: m,
281
- ...d === void 0 ? {} : { closeLabel: d },
282
- footer: /* @__PURE__ */ c(E, { children: [
283
- /* @__PURE__ */ e(se, { onClick: m, children: s ?? (v ? "Keep editing" : "Cancel") }),
284
- /* @__PURE__ */ e(se, { variant: i === "default" ? "primary" : "danger", onClick: a, children: o ?? (v ? "Discard changes" : "Confirm") })
281
+ ...u === void 0 ? {} : { closeLabel: u },
282
+ footer: /* @__PURE__ */ i(A, { children: [
283
+ /* @__PURE__ */ e(he, { onClick: m, children: s ?? (v ? "Keep editing" : "Cancel") }),
284
+ /* @__PURE__ */ e(he, { variant: r === "default" ? "primary" : "danger", onClick: a, children: c ?? (v ? "Discard changes" : "Confirm") })
285
285
  ] }),
286
- children: i !== "default" ? /* @__PURE__ */ c("p", { className: "cms-confirm__warning", children: [
287
- /* @__PURE__ */ e(V, { name: "warning" }),
286
+ children: r !== "default" ? /* @__PURE__ */ i("p", { className: "cms-confirm__warning", children: [
287
+ /* @__PURE__ */ e(G, { name: "warning" }),
288
288
  " ",
289
289
  t
290
290
  ] }) : /* @__PURE__ */ e("p", { children: t })
291
291
  }
292
292
  );
293
293
  }
294
- function Qn({ kind: n, message: l, action: t, onDismiss: i, dismissLabel: o = "Dismiss" }) {
295
- return /* @__PURE__ */ c("div", { className: $("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
296
- /* @__PURE__ */ e(V, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
294
+ function hl({ kind: n, message: l, action: t, onDismiss: r, dismissLabel: c = "Dismiss" }) {
295
+ return /* @__PURE__ */ i("div", { className: F("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
296
+ /* @__PURE__ */ e(G, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
297
297
  /* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
298
- t ? /* @__PURE__ */ e(se, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
299
- i ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": o, onClick: i, children: /* @__PURE__ */ e(V, { name: "close" }) }) : null
298
+ t ? /* @__PURE__ */ e(he, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
299
+ r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: r, children: /* @__PURE__ */ e(G, { name: "close" }) }) : null
300
300
  ] });
301
301
  }
302
- function el({ children: n }) {
302
+ function fl({ children: n }) {
303
303
  return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
304
304
  }
305
- function nn({ what: n, layout: l = "inline" }) {
306
- return /* @__PURE__ */ c("div", { className: $("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
307
- /* @__PURE__ */ e(V, { name: "spinner" }),
305
+ function mn({ what: n, layout: l = "inline" }) {
306
+ return /* @__PURE__ */ i("div", { className: F("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
307
+ /* @__PURE__ */ e(G, { name: "spinner" }),
308
308
  /* @__PURE__ */ e("span", { children: n })
309
309
  ] });
310
310
  }
311
- function ln({ title: n, hint: l, action: t }) {
312
- return /* @__PURE__ */ c("div", { className: "cms-empty", children: [
311
+ function hn({ title: n, hint: l, action: t }) {
312
+ return /* @__PURE__ */ i("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 tn({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
- return /* @__PURE__ */ c("div", { className: "cms-error-banner", role: "alert", children: [
320
- /* @__PURE__ */ e(V, { name: "warning" }),
318
+ function fn({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
+ return /* @__PURE__ */ i("div", { className: "cms-error-banner", role: "alert", children: [
320
+ /* @__PURE__ */ e(G, { name: "warning" }),
321
321
  /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
322
- l ? /* @__PURE__ */ e(se, { onClick: l, children: t }) : null
322
+ l ? /* @__PURE__ */ e(he, { onClick: l, children: t }) : null
323
323
  ] });
324
324
  }
325
- const Ke = {
326
- mail: /* @__PURE__ */ c(E, { children: [
325
+ const Ge = {
326
+ mail: /* @__PURE__ */ i(A, { children: [
327
327
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
328
328
  /* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
329
329
  ] }),
330
330
  // A gear: a ring with eight short teeth, the hole in its middle.
331
- settings: /* @__PURE__ */ c(E, { children: [
331
+ settings: /* @__PURE__ */ i(A, { children: [
332
332
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" }),
333
333
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "7" }),
334
334
  /* @__PURE__ */ e("path", { d: "M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1" })
335
335
  ] }),
336
336
  // The envelope with its flap open above it: a message read, or the message itself again.
337
- "mail-open": /* @__PURE__ */ c(E, { children: [
337
+ "mail-open": /* @__PURE__ */ i(A, { children: [
338
338
  /* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
339
339
  /* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
340
340
  /* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
341
341
  ] }),
342
342
  // A clipboard: copy what is shown.
343
- copy: /* @__PURE__ */ c(E, { children: [
343
+ copy: /* @__PURE__ */ i(A, { children: [
344
344
  /* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
345
345
  /* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
346
346
  /* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
347
347
  ] }),
348
348
  chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
349
349
  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" }),
350
- calendar: /* @__PURE__ */ c(E, { children: [
350
+ calendar: /* @__PURE__ */ i(A, { children: [
351
351
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
352
352
  /* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
353
353
  ] }),
354
- file: /* @__PURE__ */ c(E, { children: [
354
+ file: /* @__PURE__ */ i(A, { children: [
355
355
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
356
356
  /* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
357
357
  ] }),
358
358
  // The file, with code's angle brackets in place of its lines: a message's source.
359
- "file-code": /* @__PURE__ */ c(E, { children: [
359
+ "file-code": /* @__PURE__ */ i(A, { children: [
360
360
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
361
361
  /* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
362
362
  /* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
363
363
  ] }),
364
- image: /* @__PURE__ */ c(E, { children: [
364
+ image: /* @__PURE__ */ i(A, { children: [
365
365
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
366
366
  /* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
367
367
  /* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
368
368
  ] }),
369
- search: /* @__PURE__ */ c(E, { children: [
369
+ search: /* @__PURE__ */ i(A, { children: [
370
370
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
371
371
  /* @__PURE__ */ e("path", { d: "m20 20-4-4" })
372
372
  ] }),
373
- bell: /* @__PURE__ */ c(E, { children: [
373
+ bell: /* @__PURE__ */ i(A, { children: [
374
374
  /* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
375
375
  /* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
376
376
  ] }),
377
- pencil: /* @__PURE__ */ c(E, { children: [
377
+ pencil: /* @__PURE__ */ i(A, { children: [
378
378
  /* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
379
379
  /* @__PURE__ */ e("path", { d: "m13 7 4 4" })
380
380
  ] }),
381
- download: /* @__PURE__ */ c(E, { children: [
381
+ download: /* @__PURE__ */ i(A, { children: [
382
382
  /* @__PURE__ */ e("path", { d: "M12 4v11" }),
383
383
  /* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
384
384
  /* @__PURE__ */ e("path", { d: "M4 20h16" })
385
385
  ] }),
386
386
  // Download's arrow turned up, from the line: a file sent up.
387
- upload: /* @__PURE__ */ c(E, { children: [
387
+ upload: /* @__PURE__ */ i(A, { children: [
388
388
  /* @__PURE__ */ e("path", { d: "M12 20V9" }),
389
389
  /* @__PURE__ */ e("path", { d: "m7 13 5-5 5 5" }),
390
390
  /* @__PURE__ */ e("path", { d: "M4 4h16" })
391
391
  ] }),
392
- print: /* @__PURE__ */ c(E, { children: [
392
+ print: /* @__PURE__ */ i(A, { children: [
393
393
  /* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
394
394
  /* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
395
395
  /* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
396
396
  ] }),
397
- "open-separately": /* @__PURE__ */ c(E, { children: [
397
+ "open-separately": /* @__PURE__ */ i(A, { children: [
398
398
  /* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
399
399
  /* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
400
400
  /* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
401
401
  ] }),
402
402
  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" }),
403
- send: /* @__PURE__ */ c(E, { children: [
403
+ send: /* @__PURE__ */ i(A, { children: [
404
404
  /* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
405
405
  /* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
406
406
  ] }),
407
- inbox: /* @__PURE__ */ c(E, { children: [
407
+ inbox: /* @__PURE__ */ i(A, { children: [
408
408
  /* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
409
409
  /* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
410
410
  ] }),
411
- archive: /* @__PURE__ */ c(E, { children: [
411
+ archive: /* @__PURE__ */ i(A, { children: [
412
412
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
413
413
  /* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
414
414
  ] }),
415
- trash: /* @__PURE__ */ c(E, { children: [
415
+ trash: /* @__PURE__ */ i(A, { children: [
416
416
  /* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
417
417
  /* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
418
418
  ] }),
419
419
  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" }),
420
- mic: /* @__PURE__ */ c(E, { children: [
420
+ mic: /* @__PURE__ */ i(A, { children: [
421
421
  /* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
422
422
  /* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
423
423
  ] }),
424
- speaker: /* @__PURE__ */ c(E, { children: [
424
+ speaker: /* @__PURE__ */ i(A, { children: [
425
425
  /* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
426
426
  /* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
427
427
  ] }),
428
- "user-plus": /* @__PURE__ */ c(E, { children: [
428
+ "user-plus": /* @__PURE__ */ i(A, { children: [
429
429
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
430
430
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
431
431
  ] }),
432
432
  // A person, nothing more: one whose account is gone.
433
- user: /* @__PURE__ */ c(E, { children: [
433
+ user: /* @__PURE__ */ i(A, { children: [
434
434
  /* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
435
435
  /* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
436
436
  ] }),
437
437
  // A person with a tick: someone allowed.
438
- "user-check": /* @__PURE__ */ c(E, { children: [
438
+ "user-check": /* @__PURE__ */ i(A, { children: [
439
439
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
440
440
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" })
441
441
  ] }),
442
442
  // A person with a cross: someone no longer allowed.
443
- "user-x": /* @__PURE__ */ c(E, { children: [
443
+ "user-x": /* @__PURE__ */ i(A, { children: [
444
444
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
445
445
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" })
446
446
  ] }),
447
447
  // Two people: the members of a group.
448
- users: /* @__PURE__ */ c(E, { children: [
448
+ users: /* @__PURE__ */ i(A, { children: [
449
449
  /* @__PURE__ */ e("circle", { cx: "9", cy: "8", r: "3.5" }),
450
450
  /* @__PURE__ */ e("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14a6.5 6.5 0 0 1 3.5 6" })
451
451
  ] }),
452
452
  "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" }),
453
- video: /* @__PURE__ */ c(E, { children: [
453
+ video: /* @__PURE__ */ i(A, { children: [
454
454
  /* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
455
455
  /* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
456
456
  ] }),
457
- info: /* @__PURE__ */ c(E, { children: [
457
+ info: /* @__PURE__ */ i(A, { children: [
458
458
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
459
459
  /* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
460
460
  ] }),
@@ -463,17 +463,17 @@ const Ke = {
463
463
  plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
464
464
  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" }),
465
465
  // The folder with a plus inside: a new folder.
466
- "folder-plus": /* @__PURE__ */ c(E, { children: [
466
+ "folder-plus": /* @__PURE__ */ i(A, { children: [
467
467
  /* @__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" }),
468
468
  /* @__PURE__ */ e("path", { d: "M12 10.5v6M9 13.5h6" })
469
469
  ] }),
470
470
  // The folder with a cross inside: a folder removed.
471
- "folder-x": /* @__PURE__ */ c(E, { children: [
471
+ "folder-x": /* @__PURE__ */ i(A, { children: [
472
472
  /* @__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" }),
473
473
  /* @__PURE__ */ e("path", { d: "m9.5 11 5 5M14.5 11l-5 5" })
474
474
  ] }),
475
475
  check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
476
- server: /* @__PURE__ */ c(E, { children: [
476
+ server: /* @__PURE__ */ i(A, { children: [
477
477
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
478
478
  /* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
479
479
  /* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
@@ -485,6 +485,8 @@ const Ke = {
485
485
  more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
486
486
  // A number sign: a channel, by its name.
487
487
  hash: /* @__PURE__ */ e("path", { d: "M10 4 8 20M16 4l-2 16M5 9h15M4 15h15" }),
488
+ // A funnel: a list's filter.
489
+ funnel: /* @__PURE__ */ e("path", { d: "M4 5h16l-6 8v6l-4-2v-4Z" }),
488
490
  important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
489
491
  };
490
492
  function L({ name: n, size: l = 20, label: t }) {
@@ -502,11 +504,11 @@ function L({ name: n, size: l = 20, label: t }) {
502
504
  strokeLinejoin: "round",
503
505
  focusable: !1,
504
506
  ...t ? { role: "img", "aria-label": t } : { "aria-hidden": !0 },
505
- children: Ke[n]
507
+ children: Ge[n]
506
508
  }
507
509
  );
508
510
  }
509
- const nl = Object.keys(Ke), Be = {
511
+ const pl = Object.keys(Ge), Ke = {
510
512
  reply: "reply",
511
513
  "reply-all": "reply",
512
514
  forward: "forward",
@@ -546,189 +548,190 @@ const nl = Object.keys(Ke), Be = {
546
548
  "chat-dots": "chat",
547
549
  images: "image",
548
550
  paperclip: "paperclip",
549
- hash: "hash"
551
+ hash: "hash",
552
+ funnel: "funnel"
550
553
  };
551
- function de(n) {
552
- return Object.prototype.hasOwnProperty.call(Be, n) ? Be[n] : null;
554
+ function we(n) {
555
+ return Object.prototype.hasOwnProperty.call(Ke, n) ? Ke[n] : null;
553
556
  }
554
- function an() {
557
+ function pn() {
555
558
  try {
556
559
  return process.env.NODE_ENV !== "production";
557
560
  } catch {
558
561
  return !1;
559
562
  }
560
563
  }
561
- const Re = /* @__PURE__ */ new Set();
562
- function sn({ name: n, size: l = 18 }) {
564
+ const Ve = /* @__PURE__ */ new Set();
565
+ function _n({ name: n, size: l = 18 }) {
563
566
  if (n === "") return null;
564
- const t = de(n);
565
- return t !== null ? /* @__PURE__ */ e(L, { name: t, size: l }) : (!Re.has(n) && an() && (Re.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
567
+ const t = we(n);
568
+ return t !== null ? /* @__PURE__ */ e(L, { name: t, size: l }) : (!Ve.has(n) && pn() && (Ve.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
566
569
  }
567
- const Ce = 300;
568
- function rn() {
569
- if (typeof window > "u" || typeof getComputedStyle != "function") return Ce;
570
+ const Te = 300;
571
+ function bn() {
572
+ if (typeof window > "u" || typeof getComputedStyle != "function") return Te;
570
573
  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;
571
- return Number.isFinite(l) && l >= 0 ? l : Ce;
574
+ return Number.isFinite(l) && l >= 0 ? l : Te;
572
575
  }
573
- function cn() {
574
- return /* @__PURE__ */ c("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
576
+ function vn() {
577
+ return /* @__PURE__ */ i("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
575
578
  /* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
576
579
  /* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
577
580
  ] });
578
581
  }
579
- function ae({ kind: n, title: l, description: t, action: i, placement: o = "block", icon: s }) {
580
- const [d, a] = A(n !== "loading");
581
- return Y(() => {
582
+ function me({ kind: n, title: l, description: t, action: r, placement: c = "block", icon: s }) {
583
+ const [u, a] = T(n !== "loading");
584
+ return Q(() => {
582
585
  if (n !== "loading") {
583
586
  a(!0);
584
587
  return;
585
588
  }
586
589
  a(!1);
587
- const m = window.setTimeout(() => a(!0), rn());
590
+ const m = window.setTimeout(() => a(!0), bn());
588
591
  return () => window.clearTimeout(m);
589
- }, [n]), /* @__PURE__ */ c(
592
+ }, [n]), /* @__PURE__ */ i(
590
593
  "div",
591
594
  {
592
- className: $("cms-state", `cms-state--${n}`, `cms-state--${o}`, !d && "is-waiting"),
595
+ className: F("cms-state", `cms-state--${n}`, `cms-state--${c}`, !u && "is-waiting"),
593
596
  role: "status",
594
597
  "aria-live": "polite",
595
598
  "data-kind": n,
596
599
  children: [
597
- n === "loading" ? /* @__PURE__ */ e(cn, {}) : null,
598
- n === "error" || n === "denied" ? /* @__PURE__ */ e(V, { name: n === "error" ? "warning" : "lock" }) : null,
599
- n === "empty" && s !== void 0 && de(s) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(sn, { name: s, size: o === "page" ? 32 : 24 }) }) : null,
600
- /* @__PURE__ */ c("span", { className: "cms-state__text", children: [
600
+ n === "loading" ? /* @__PURE__ */ e(vn, {}) : null,
601
+ n === "error" || n === "denied" ? /* @__PURE__ */ e(G, { name: n === "error" ? "warning" : "lock" }) : null,
602
+ n === "empty" && s !== void 0 && we(s) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(_n, { name: s, size: c === "page" ? 32 : 24 }) }) : null,
603
+ /* @__PURE__ */ i("span", { className: "cms-state__text", children: [
601
604
  /* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
602
605
  t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
603
606
  ] }),
604
- i !== void 0 && n !== "denied" ? /* @__PURE__ */ e(se, { className: "cms-state__action", onClick: i.onAction, children: i.label }) : null
607
+ r !== void 0 && n !== "denied" ? /* @__PURE__ */ e(he, { className: "cms-state__action", onClick: r.onAction, children: r.label }) : null
605
608
  ]
606
609
  }
607
610
  );
608
611
  }
609
- const on = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', dn = 60;
610
- function un(n) {
612
+ const gn = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', Nn = 60;
613
+ function wn(n) {
611
614
  return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
612
615
  }
613
- function mn(n) {
616
+ function yn(n) {
614
617
  return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
615
618
  }
616
- function hn(n) {
619
+ function kn(n) {
617
620
  return n.getClientRects().length > 0;
618
621
  }
619
- function ll(n) {
620
- const { name: l, badge: t, closeLabel: i, onClose: o, actions: s = [], moreLabel: d = "More", edit: a, editing: m, state: v, siblings: u, bar: f, thumbnails: r, strip: h, onZoom: _, children: N } = n, y = H(null), k = H(null), C = G(), [M, b] = A(!1), w = H(null);
621
- Y(() => {
622
- var B;
623
- const x = document.activeElement, D = document.body.style.overflow;
624
- return document.body.style.overflow = "hidden", (B = k.current) == null || B.focus(), () => {
622
+ function _l(n) {
623
+ const { name: l, badge: t, closeLabel: r, onClose: c, actions: s = [], moreLabel: u = "More", edit: a, editing: m, state: v, siblings: o, bar: p, thumbnails: h, strip: f, onZoom: d, children: g } = n, k = H(null), x = H(null), C = se(), [w, b] = T(!1), y = H(null);
624
+ Q(() => {
625
+ var z;
626
+ const M = document.activeElement, R = document.body.style.overflow;
627
+ return document.body.style.overflow = "hidden", (z = x.current) == null || z.focus(), () => {
625
628
  var q;
626
- document.body.style.overflow = D, (q = x == null ? void 0 : x.focus) == null || q.call(x);
629
+ document.body.style.overflow = R, (q = M == null ? void 0 : M.focus) == null || q.call(M);
627
630
  };
628
631
  }, []);
629
- const T = () => {
630
- m != null && m.dirty ? m.onDirtyClose() : o();
631
- }, O = (x) => {
632
- const D = x.touches.length === 1 ? x.touches[0] : void 0;
633
- w.current = D === void 0 || m !== void 0 || mn(x.target) ? null : { x: D.clientX, y: D.clientY };
634
- }, U = (x) => {
635
- var z, J;
636
- const D = w.current, B = x.changedTouches[0];
637
- if (w.current = null, D === null || B === void 0) return;
638
- const q = B.clientX - D.x;
639
- Math.abs(q) < dn || Math.abs(q) < Math.abs(B.clientY - D.y) || (q > 0 ? (z = u == null ? void 0 : u.onPrevious) == null || z.call(u) : (J = u == null ? void 0 : u.onNext) == null || J.call(u));
632
+ const D = () => {
633
+ m != null && m.dirty ? m.onDirtyClose() : c();
634
+ }, Z = (M) => {
635
+ const R = M.touches.length === 1 ? M.touches[0] : void 0;
636
+ y.current = R === void 0 || m !== void 0 || yn(M.target) ? null : { x: R.clientX, y: R.clientY };
637
+ }, V = (M) => {
638
+ var U, j;
639
+ const R = y.current, z = M.changedTouches[0];
640
+ if (y.current = null, R === null || z === void 0) return;
641
+ const q = z.clientX - R.x;
642
+ Math.abs(q) < Nn || Math.abs(q) < Math.abs(z.clientY - R.y) || (q > 0 ? (U = o == null ? void 0 : o.onPrevious) == null || U.call(o) : (j = o == null ? void 0 : o.onNext) == null || j.call(o));
640
643
  };
641
- return De(
642
- /* @__PURE__ */ c(
644
+ return Pe(
645
+ /* @__PURE__ */ i(
643
646
  "div",
644
647
  {
645
- ref: y,
646
- className: $("cms-viewer", m !== void 0 && "is-editing"),
648
+ ref: k,
649
+ className: F("cms-viewer", m !== void 0 && "is-editing"),
647
650
  role: "dialog",
648
651
  "aria-modal": "true",
649
652
  "aria-labelledby": C,
650
653
  tabIndex: -1,
651
- onKeyDown: (x) => {
652
- var D, B, q;
653
- if (x.key === "Escape") {
654
+ onKeyDown: (M) => {
655
+ var R, z, q;
656
+ if (M.key === "Escape") {
654
657
  if (m !== void 0) return;
655
- x.stopPropagation(), M ? b(!1) : o();
656
- } else if (x.key === "Tab") {
657
- const z = Array.from(((D = y.current) == null ? void 0 : D.querySelectorAll(on)) ?? []).filter(hn);
658
- if (z.length === 0) return;
659
- const J = z[0], Q = z[z.length - 1];
660
- x.shiftKey && document.activeElement === J ? (x.preventDefault(), Q.focus()) : !x.shiftKey && document.activeElement === Q && (x.preventDefault(), J.focus());
661
- } else m === void 0 && !un(x.target) && !x.ctrlKey && !x.metaKey && !x.altKey && (x.key === "ArrowLeft" ? (B = u == null ? void 0 : u.onPrevious) == null || B.call(u) : x.key === "ArrowRight" ? (q = u == null ? void 0 : u.onNext) == null || q.call(u) : x.key === "+" || x.key === "=" ? _ == null || _("in") : x.key === "-" ? _ == null || _("out") : x.key === "0" && (_ == null || _("reset")));
658
+ M.stopPropagation(), w ? b(!1) : c();
659
+ } else if (M.key === "Tab") {
660
+ const U = Array.from(((R = k.current) == null ? void 0 : R.querySelectorAll(gn)) ?? []).filter(kn);
661
+ if (U.length === 0) return;
662
+ const j = U[0], le = U[U.length - 1];
663
+ M.shiftKey && document.activeElement === j ? (M.preventDefault(), le.focus()) : !M.shiftKey && document.activeElement === le && (M.preventDefault(), j.focus());
664
+ } else m === void 0 && !wn(M.target) && !M.ctrlKey && !M.metaKey && !M.altKey && (M.key === "ArrowLeft" ? (z = o == null ? void 0 : o.onPrevious) == null || z.call(o) : M.key === "ArrowRight" ? (q = o == null ? void 0 : o.onNext) == null || q.call(o) : M.key === "+" || M.key === "=" ? d == null || d("in") : M.key === "-" ? d == null || d("out") : M.key === "0" && (d == null || d("reset")));
662
665
  },
663
666
  children: [
664
- u !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${u.position}` }) : null,
665
- /* @__PURE__ */ c("header", { className: "cms-viewer__top", children: [
666
- /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": i, onClick: T, children: /* @__PURE__ */ e(V, { name: "close" }) }),
667
+ o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${o.position}` }) : null,
668
+ /* @__PURE__ */ i("header", { className: "cms-viewer__top", children: [
669
+ /* @__PURE__ */ e("button", { ref: x, type: "button", className: "cms-viewer__icon", "aria-label": r, onClick: D, children: /* @__PURE__ */ e(G, { name: "close" }) }),
667
670
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
668
671
  /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: C, title: l, children: l }),
669
- u !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: u.position }) : null,
672
+ o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: o.position }) : null,
670
673
  /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
671
- m !== void 0 ? /* @__PURE__ */ c(E, { children: [
674
+ m !== void 0 ? /* @__PURE__ */ i(A, { children: [
672
675
  /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: m.status }),
673
676
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.onDone, children: m.doneLabel })
674
- ] }) : /* @__PURE__ */ c(E, { children: [
675
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((x) => /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button", onClick: x.onSelect, children: [
676
- x.icon,
677
- x.label
678
- ] }, x.label)) }),
679
- a !== void 0 ? /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": a.label, onClick: a.onEdit, children: [
677
+ ] }) : /* @__PURE__ */ i(A, { children: [
678
+ /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((M) => /* @__PURE__ */ i("button", { type: "button", className: "cms-viewer__button", onClick: M.onSelect, children: [
679
+ M.icon,
680
+ M.label
681
+ ] }, M.label)) }),
682
+ a !== void 0 ? /* @__PURE__ */ i("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": a.label, onClick: a.onEdit, children: [
680
683
  a.icon,
681
684
  /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: a.label })
682
685
  ] }) : null,
683
- s.length > 0 ? /* @__PURE__ */ c("span", { className: "cms-viewer__more", children: [
684
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": d, "aria-expanded": M, onClick: () => b((x) => !x), children: /* @__PURE__ */ e(L, { name: "more" }) }),
685
- M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((x) => /* @__PURE__ */ c(
686
+ s.length > 0 ? /* @__PURE__ */ i("span", { className: "cms-viewer__more", children: [
687
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": u, "aria-expanded": w, onClick: () => b((M) => !M), children: /* @__PURE__ */ e(L, { name: "more" }) }),
688
+ w ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((M) => /* @__PURE__ */ i(
686
689
  "button",
687
690
  {
688
691
  type: "button",
689
692
  className: "cms-viewer__button",
690
693
  onClick: () => {
691
- b(!1), x.onSelect();
694
+ b(!1), M.onSelect();
692
695
  },
693
696
  children: [
694
- x.icon,
695
- x.label
697
+ M.icon,
698
+ M.label
696
699
  ]
697
700
  },
698
- x.label
701
+ M.label
699
702
  )) }) : null
700
703
  ] }) : null
701
704
  ] })
702
705
  ] }),
703
- /* @__PURE__ */ c("div", { className: "cms-viewer__body", children: [
704
- r != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: r }) : null,
705
- /* @__PURE__ */ c("div", { className: "cms-viewer__content", onTouchStart: O, onTouchEnd: U, children: [
706
- (m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ c("div", { className: "cms-viewer__conflict", role: "alert", children: [
706
+ /* @__PURE__ */ i("div", { className: "cms-viewer__body", children: [
707
+ h != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
708
+ /* @__PURE__ */ i("div", { className: "cms-viewer__content", onTouchStart: Z, onTouchEnd: V, children: [
709
+ (m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ i("div", { className: "cms-viewer__conflict", role: "alert", children: [
707
710
  /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: m.conflict.message }),
708
711
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: m.conflict.onOverwrite, children: m.conflict.overwriteLabel }),
709
712
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.conflict.onKeepBoth, children: m.conflict.keepBothLabel })
710
713
  ] }) : null,
711
- v === void 0 ? N : /* @__PURE__ */ e(fn, { state: v }),
712
- m === void 0 && (u != null && u.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": u.previousLabel, title: u.previousLabel, onClick: u.onPrevious, children: /* @__PURE__ */ e(V, { name: "back" }) }) : null,
713
- m === void 0 && (u != null && u.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": u.nextLabel, title: u.nextLabel, onClick: u.onNext, children: /* @__PURE__ */ e(V, { name: "back" }) }) : null,
714
- m === void 0 && u !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(u.total, 7) }, (x, D) => /* @__PURE__ */ e("i", { className: D === Math.min(u.index, 6) ? "is-current" : void 0 }, D)) }) : null
714
+ v === void 0 ? g : /* @__PURE__ */ e(xn, { state: v }),
715
+ m === void 0 && (o != null && o.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": o.previousLabel, title: o.previousLabel, onClick: o.onPrevious, children: /* @__PURE__ */ e(G, { name: "back" }) }) : null,
716
+ m === void 0 && (o != null && o.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": o.nextLabel, title: o.nextLabel, onClick: o.onNext, children: /* @__PURE__ */ e(G, { name: "back" }) }) : null,
717
+ m === void 0 && o !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(o.total, 7) }, (M, R) => /* @__PURE__ */ e("i", { className: R === Math.min(o.index, 6) ? "is-current" : void 0 }, R)) }) : null
715
718
  ] })
716
719
  ] }),
717
- m === void 0 && h != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: h }) : null,
718
- f != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: f }) : null
720
+ m === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
721
+ p != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: p }) : null
719
722
  ]
720
723
  }
721
724
  ),
722
725
  document.body
723
726
  );
724
727
  }
725
- function fn({ state: n }) {
728
+ function xn({ state: n }) {
726
729
  switch (n.kind) {
727
730
  case "loading":
728
- return /* @__PURE__ */ e(ae, { kind: "loading", title: n.title, placement: "page" });
731
+ return /* @__PURE__ */ e(me, { kind: "loading", title: n.title, placement: "page" });
729
732
  case "error":
730
733
  return /* @__PURE__ */ e(
731
- ae,
734
+ me,
732
735
  {
733
736
  kind: "error",
734
737
  title: n.title,
@@ -739,7 +742,7 @@ function fn({ state: n }) {
739
742
  );
740
743
  case "no-preview":
741
744
  return /* @__PURE__ */ e(
742
- ae,
745
+ me,
743
746
  {
744
747
  kind: "empty",
745
748
  title: n.title,
@@ -750,179 +753,179 @@ function fn({ state: n }) {
750
753
  );
751
754
  }
752
755
  }
753
- class pn extends Error {
756
+ class Mn extends Error {
754
757
  constructor(l = "denied") {
755
758
  super(l), this.name = "FilePickerDenied";
756
759
  }
757
760
  }
758
- class bn extends Error {
761
+ class Cn extends Error {
759
762
  constructor(l = "restart") {
760
763
  super(l), this.name = "FilePickerRestart";
761
764
  }
762
765
  }
763
- const Me = (n, l) => `${n}
764
- ${l}`, _n = (n, l) => n === "" ? l : `${n}/${l}`, vn = 48;
765
- function tl(n) {
766
- var P, j;
767
- const { open: l, spaces: t, list: i, disabledReason: o, budget: s, formatSize: d, labels: a, onConfirm: m, onCancel: v } = n, [u, f] = A(((P = t[0]) == null ? void 0 : P.id) ?? ""), [r, h] = A(""), [_, N] = A({ status: "loading" }), [y, k] = A(0), [C, M] = A(/* @__PURE__ */ new Map()), [b, w] = A(0), [T, O] = A(!1), U = H(null), x = H(!1);
768
- Y(() => {
769
- x.current = !1;
770
- }, [l, u, r]);
771
- const D = G();
772
- Y(() => {
773
- var g;
774
- l && (f(((g = t[0]) == null ? void 0 : g.id) ?? ""), h(""), M(/* @__PURE__ */ new Map()), O(!1));
775
- }, [l]), Y(() => {
776
- if (!l || u === "") return;
777
- let g = !0;
778
- return N({ status: "loading" }), w(0), i(u, r).then(
779
- (S) => g && N({ status: "ready", entries: S.entries, next: S.next ?? null, paging: !1 }),
780
- (S) => g && N({ status: S instanceof pn ? "denied" : "error" })
766
+ const Ae = (n, l) => `${n}
767
+ ${l}`, Sn = (n, l) => n === "" ? l : `${n}/${l}`, En = 48;
768
+ function bl(n) {
769
+ var I, X;
770
+ const { open: l, spaces: t, list: r, disabledReason: c, budget: s, formatSize: u, labels: a, onConfirm: m, onCancel: v } = n, [o, p] = T(((I = t[0]) == null ? void 0 : I.id) ?? ""), [h, f] = T(""), [d, g] = T({ status: "loading" }), [k, x] = T(0), [C, w] = T(/* @__PURE__ */ new Map()), [b, y] = T(0), [D, Z] = T(!1), V = H(null), M = H(!1);
771
+ Q(() => {
772
+ M.current = !1;
773
+ }, [l, o, h]);
774
+ const R = se();
775
+ Q(() => {
776
+ var N;
777
+ l && (p(((N = t[0]) == null ? void 0 : N.id) ?? ""), f(""), w(/* @__PURE__ */ new Map()), Z(!1));
778
+ }, [l]), Q(() => {
779
+ if (!l || o === "") return;
780
+ let N = !0;
781
+ return g({ status: "loading" }), y(0), r(o, h).then(
782
+ (S) => N && g({ status: "ready", entries: S.entries, next: S.next ?? null, paging: !1 }),
783
+ (S) => N && g({ status: S instanceof Mn ? "denied" : "error" })
781
784
  ), () => {
782
- g = !1;
785
+ N = !1;
783
786
  };
784
- }, [l, u, r, i, y]);
785
- const B = we(() => {
786
- if (_.status !== "ready" || _.next === null || _.paging) return;
787
- const g = _.next, S = _.entries;
788
- N({ ..._, paging: !0 }), i(u, r, g).then(
789
- (R) => {
790
- x.current = !1, N({ status: "ready", entries: [...S, ...R.entries], next: R.next ?? null, paging: !1 });
787
+ }, [l, o, h, r, k]);
788
+ const z = be(() => {
789
+ if (d.status !== "ready" || d.next === null || d.paging) return;
790
+ const N = d.next, S = d.entries;
791
+ g({ ...d, paging: !0 }), r(o, h, N).then(
792
+ (O) => {
793
+ M.current = !1, g({ status: "ready", entries: [...S, ...O.entries], next: O.next ?? null, paging: !1 });
791
794
  },
792
- (R) => {
793
- if (!(R instanceof bn)) {
794
- N({ status: "ready", entries: S, next: g, paging: !1 });
795
+ (O) => {
796
+ if (!(O instanceof Cn)) {
797
+ g({ status: "ready", entries: S, next: N, paging: !1 });
795
798
  return;
796
799
  }
797
- if (x.current) {
798
- N({ status: "error" });
800
+ if (M.current) {
801
+ g({ status: "error" });
799
802
  return;
800
803
  }
801
- x.current = !0, k((W) => W + 1);
804
+ M.current = !0, x((Y) => Y + 1);
802
805
  }
803
806
  );
804
- }, [_, i, u, r]), q = we((g) => {
807
+ }, [d, r, o, h]), q = be((N) => {
805
808
  var S;
806
- return ((S = s == null ? void 0 : s.cost) == null ? void 0 : S.call(s, g)) ?? g.size ?? 0;
807
- }, [s]), z = je(() => [...C.values()], [C]), J = z.reduce((g, S) => g + (S.size ?? 0), 0), Q = s === void 0 ? null : s.limitBytes - s.usedBytes - z.reduce((g, S) => g + q(S), 0), ne = Q !== null && Q < 0, re = (g) => {
808
- if (g.kind !== "file") return null;
809
- const S = o == null ? void 0 : o(g);
810
- return S || (Q !== null && !C.has(Me(u, g.id)) && q(g) > Q ? a.overBudget : null);
811
- }, _e = (g) => {
812
- const S = Me(u, g.id);
813
- !C.has(S) && re(g) !== null || M((R) => {
814
- const W = new Map(R);
815
- return W.has(S) ? W.delete(S) : W.set(S, { ...g, space: u, path: r }), W;
809
+ return ((S = s == null ? void 0 : s.cost) == null ? void 0 : S.call(s, N)) ?? N.size ?? 0;
810
+ }, [s]), U = ln(() => [...C.values()], [C]), j = U.reduce((N, S) => N + (S.size ?? 0), 0), le = s === void 0 ? null : s.limitBytes - s.usedBytes - U.reduce((N, S) => N + q(S), 0), ae = le !== null && le < 0, re = (N) => {
811
+ if (N.kind !== "file") return null;
812
+ const S = c == null ? void 0 : c(N);
813
+ return S || (le !== null && !C.has(Ae(o, N.id)) && q(N) > le ? a.overBudget : null);
814
+ }, ie = (N) => {
815
+ const S = Ae(o, N.id);
816
+ !C.has(S) && re(N) !== null || w((O) => {
817
+ const Y = new Map(O);
818
+ return Y.has(S) ? Y.delete(S) : Y.set(S, { ...N, space: o, path: h }), Y;
816
819
  });
817
- }, ve = (g) => h(_n(r, g.name)), le = () => h(r.includes("/") ? r.slice(0, r.lastIndexOf("/")) : ""), ke = (g) => M((S) => {
818
- const R = new Map(S);
819
- return R.delete(g), R;
820
- }), te = _.status === "ready" ? _.entries : [], p = (g) => {
821
- const S = te[b];
822
- if (g.key === "ArrowDown" || g.key === "ArrowUp" || g.key === "Home" || g.key === "End") {
823
- g.preventDefault();
824
- const R = te.length - 1, W = g.key === "Home" ? 0 : g.key === "End" ? R : Math.min(R, Math.max(0, b + (g.key === "ArrowDown" ? 1 : -1)));
825
- w(W), W >= R - 1 && B();
826
- } else g.key === "Enter" && (S == null ? void 0 : S.kind) === "folder" ? (g.preventDefault(), ve(S)) : g.key === " " && (S == null ? void 0 : S.kind) === "file" ? (g.preventDefault(), _e(S)) : g.key === "Backspace" && r !== "" && (g.preventDefault(), le());
827
- }, I = r === "" ? [] : r.split("/"), K = ((j = t.find((g) => g.id === u)) == null ? void 0 : j.name) ?? "", X = (g) => `${D}-entry-${String(g)}`;
828
- return /* @__PURE__ */ c(
829
- ze,
820
+ }, oe = (N) => f(Sn(h, N.name)), J = () => f(h.includes("/") ? h.slice(0, h.lastIndexOf("/")) : ""), fe = (N) => w((S) => {
821
+ const O = new Map(S);
822
+ return O.delete(N), O;
823
+ }), ee = d.status === "ready" ? d.entries : [], _ = (N) => {
824
+ const S = ee[b];
825
+ if (N.key === "ArrowDown" || N.key === "ArrowUp" || N.key === "Home" || N.key === "End") {
826
+ N.preventDefault();
827
+ const O = ee.length - 1, Y = N.key === "Home" ? 0 : N.key === "End" ? O : Math.min(O, Math.max(0, b + (N.key === "ArrowDown" ? 1 : -1)));
828
+ y(Y), Y >= O - 1 && z();
829
+ } else N.key === "Enter" && (S == null ? void 0 : S.kind) === "folder" ? (N.preventDefault(), oe(S)) : N.key === " " && (S == null ? void 0 : S.kind) === "file" ? (N.preventDefault(), ie(S)) : N.key === "Backspace" && h !== "" && (N.preventDefault(), J());
830
+ }, $ = h === "" ? [] : h.split("/"), B = ((X = t.find((N) => N.id === o)) == null ? void 0 : X.name) ?? "", ne = (N) => `${R}-entry-${String(N)}`;
831
+ return /* @__PURE__ */ i(
832
+ je,
830
833
  {
831
834
  open: l,
832
835
  title: a.title,
833
836
  onClose: v,
834
837
  closeLabel: a.close,
835
- initialFocus: U,
838
+ initialFocus: V,
836
839
  className: "cms-file-picker",
837
- footer: /* @__PURE__ */ c("div", { className: "cms-file-picker__foot", children: [
838
- /* @__PURE__ */ c("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
839
- z.length > 0 ? /* @__PURE__ */ e("span", { children: a.total(z.length, d(J)) }) : null,
840
- s !== void 0 && Q !== null ? /* @__PURE__ */ e("span", { className: $(ne && "is-over"), children: ne ? a.overBudget : a.left(d(Math.max(0, Q)), d(s.limitBytes)) }) : null
840
+ footer: /* @__PURE__ */ i("div", { className: "cms-file-picker__foot", children: [
841
+ /* @__PURE__ */ i("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
842
+ U.length > 0 ? /* @__PURE__ */ e("span", { children: a.total(U.length, u(j)) }) : null,
843
+ s !== void 0 && le !== null ? /* @__PURE__ */ e("span", { className: F(ae && "is-over"), children: ae ? a.overBudget : a.left(u(Math.max(0, le)), u(s.limitBytes)) }) : null
841
844
  ] }),
842
- /* @__PURE__ */ c("div", { className: "cms-file-picker__actions", children: [
843
- /* @__PURE__ */ e(se, { variant: "secondary", onClick: v, children: a.cancel }),
844
- /* @__PURE__ */ e(se, { variant: "primary", disabled: z.length === 0 || ne, onClick: () => m(z), children: a.confirm(z.length) })
845
+ /* @__PURE__ */ i("div", { className: "cms-file-picker__actions", children: [
846
+ /* @__PURE__ */ e(he, { variant: "secondary", onClick: v, children: a.cancel }),
847
+ /* @__PURE__ */ e(he, { variant: "primary", disabled: U.length === 0 || ae, onClick: () => m(U), children: a.confirm(U.length) })
845
848
  ] })
846
849
  ] }),
847
850
  children: [
848
- /* @__PURE__ */ c("div", { className: "cms-file-picker__top", children: [
849
- t.length > 1 ? /* @__PURE__ */ c("label", { className: "cms-file-picker__space", children: [
851
+ /* @__PURE__ */ i("div", { className: "cms-file-picker__top", children: [
852
+ t.length > 1 ? /* @__PURE__ */ i("label", { className: "cms-file-picker__space", children: [
850
853
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: a.space }),
851
- /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: u, onChange: (g) => {
852
- f(g.target.value), h("");
853
- }, children: t.map((g) => /* @__PURE__ */ e("option", { value: g.id, children: g.name }, g.id)) })
854
+ /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: o, onChange: (N) => {
855
+ p(N.target.value), f("");
856
+ }, children: t.map((N) => /* @__PURE__ */ e("option", { value: N.id, children: N.name }, N.id)) })
854
857
  ] }) : null,
855
- /* @__PURE__ */ c("nav", { className: "cms-file-picker__path", "aria-label": a.path, children: [
856
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.up, disabled: r === "", onClick: le, children: /* @__PURE__ */ e(L, { name: "chevron-left" }) }),
857
- /* @__PURE__ */ c("ol", { children: [
858
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": r === "" ? "location" : void 0, onClick: () => h(""), children: K }) }),
859
- I.map((g, S) => {
860
- const R = I.slice(0, S + 1).join("/");
861
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": R === r ? "location" : void 0, onClick: () => h(R), children: g }) }, R);
858
+ /* @__PURE__ */ i("nav", { className: "cms-file-picker__path", "aria-label": a.path, children: [
859
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.up, disabled: h === "", onClick: J, children: /* @__PURE__ */ e(L, { name: "chevron-left" }) }),
860
+ /* @__PURE__ */ i("ol", { children: [
861
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": h === "" ? "location" : void 0, onClick: () => f(""), children: B }) }),
862
+ $.map((N, S) => {
863
+ const O = $.slice(0, S + 1).join("/");
864
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": O === h ? "location" : void 0, onClick: () => f(O), children: N }) }, O);
862
865
  })
863
866
  ] })
864
867
  ] }),
865
- z.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": T, onClick: () => O((g) => !g), children: a.selected(z.length) }) : null
868
+ U.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": D, onClick: () => Z((N) => !N), children: a.selected(U.length) }) : null
866
869
  ] }),
867
- T && z.length > 0 ? /* @__PURE__ */ c("div", { className: "cms-file-picker__chosen", children: [
868
- /* @__PURE__ */ e("ul", { children: [...C.entries()].map(([g, S]) => /* @__PURE__ */ c("li", { children: [
870
+ D && U.length > 0 ? /* @__PURE__ */ i("div", { className: "cms-file-picker__chosen", children: [
871
+ /* @__PURE__ */ e("ul", { children: [...C.entries()].map(([N, S]) => /* @__PURE__ */ i("li", { children: [
869
872
  /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: S.name }),
870
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.remove(S.name), onClick: () => ke(g), children: /* @__PURE__ */ e(V, { name: "close" }) })
871
- ] }, g)) }),
872
- /* @__PURE__ */ e(se, { variant: "secondary", onClick: () => {
873
- M(/* @__PURE__ */ new Map()), O(!1);
873
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.remove(S.name), onClick: () => fe(N), children: /* @__PURE__ */ e(G, { name: "close" }) })
874
+ ] }, N)) }),
875
+ /* @__PURE__ */ e(he, { variant: "secondary", onClick: () => {
876
+ w(/* @__PURE__ */ new Map()), Z(!1);
874
877
  }, children: a.clear })
875
878
  ] }) : null,
876
- /* @__PURE__ */ c("div", { className: "cms-file-picker__list", onScroll: (g) => {
877
- const S = g.currentTarget;
878
- S.scrollTop + S.clientHeight >= S.scrollHeight - vn && B();
879
+ /* @__PURE__ */ i("div", { className: "cms-file-picker__list", onScroll: (N) => {
880
+ const S = N.currentTarget;
881
+ S.scrollTop + S.clientHeight >= S.scrollHeight - En && z();
879
882
  }, children: [
880
- _.status === "loading" ? /* @__PURE__ */ e(ae, { kind: "loading", title: a.loading, placement: "block" }) : null,
881
- _.status === "error" ? /* @__PURE__ */ e(ae, { kind: "error", title: a.error, placement: "block", action: { label: a.retry, onAction: () => {
882
- x.current = !1, k((g) => g + 1);
883
+ d.status === "loading" ? /* @__PURE__ */ e(me, { kind: "loading", title: a.loading, placement: "block" }) : null,
884
+ d.status === "error" ? /* @__PURE__ */ e(me, { kind: "error", title: a.error, placement: "block", action: { label: a.retry, onAction: () => {
885
+ M.current = !1, x((N) => N + 1);
883
886
  } } }) : null,
884
- _.status === "denied" ? /* @__PURE__ */ e(ae, { kind: "denied", title: a.denied, placement: "block" }) : null,
885
- _.status === "ready" && te.length === 0 ? /* @__PURE__ */ e(ae, { kind: "empty", title: a.empty, placement: "block" }) : null,
886
- /* @__PURE__ */ c(
887
+ d.status === "denied" ? /* @__PURE__ */ e(me, { kind: "denied", title: a.denied, placement: "block" }) : null,
888
+ d.status === "ready" && ee.length === 0 ? /* @__PURE__ */ e(me, { kind: "empty", title: a.empty, placement: "block" }) : null,
889
+ /* @__PURE__ */ i(
887
890
  "div",
888
891
  {
889
- ref: U,
892
+ ref: V,
890
893
  role: "listbox",
891
894
  "aria-multiselectable": "true",
892
895
  "aria-label": a.files,
893
- "aria-activedescendant": te.length > 0 ? X(b) : void 0,
896
+ "aria-activedescendant": ee.length > 0 ? ne(b) : void 0,
894
897
  tabIndex: 0,
895
898
  className: "cms-file-picker__entries",
896
- hidden: _.status !== "ready" || te.length === 0,
897
- onKeyDown: p,
899
+ hidden: d.status !== "ready" || ee.length === 0,
900
+ onKeyDown: _,
898
901
  children: [
899
- te.map((g, S) => {
900
- const R = g.kind === "file" && C.has(Me(u, g.id)), W = re(g);
901
- return /* @__PURE__ */ c(
902
+ ee.map((N, S) => {
903
+ const O = N.kind === "file" && C.has(Ae(o, N.id)), Y = re(N);
904
+ return /* @__PURE__ */ i(
902
905
  "div",
903
906
  {
904
- id: X(S),
907
+ id: ne(S),
905
908
  role: "option",
906
- "aria-selected": g.kind === "file" ? R : void 0,
907
- "aria-disabled": W !== null || void 0,
908
- className: $("cms-file-picker__entry", S === b && "is-active", R && "is-ticked", W !== null && "is-disabled"),
909
+ "aria-selected": N.kind === "file" ? O : void 0,
910
+ "aria-disabled": Y !== null || void 0,
911
+ className: F("cms-file-picker__entry", S === b && "is-active", O && "is-ticked", Y !== null && "is-disabled"),
909
912
  onClick: () => {
910
- w(S), g.kind === "folder" ? ve(g) : _e(g);
913
+ y(S), N.kind === "folder" ? oe(N) : ie(N);
911
914
  },
912
915
  children: [
913
- /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: R ? /* @__PURE__ */ e(L, { name: "check" }) : null }),
914
- /* @__PURE__ */ e(L, { name: g.kind === "folder" ? "folder" : "file" }),
915
- /* @__PURE__ */ c("span", { className: "cms-file-picker__text", children: [
916
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: g.name }),
917
- W !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: W }) : null
916
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: O ? /* @__PURE__ */ e(L, { name: "check" }) : null }),
917
+ /* @__PURE__ */ e(L, { name: N.kind === "folder" ? "folder" : "file" }),
918
+ /* @__PURE__ */ i("span", { className: "cms-file-picker__text", children: [
919
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: N.name }),
920
+ Y !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: Y }) : null
918
921
  ] }),
919
- g.kind === "file" && g.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: d(g.size) }) : null
922
+ N.kind === "file" && N.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: u(N.size) }) : null
920
923
  ]
921
924
  },
922
- g.id
925
+ N.id
923
926
  );
924
927
  }),
925
- _.status === "ready" && _.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ae, { kind: "loading", title: a.loading, placement: "inline" }) }) : null
928
+ d.status === "ready" && d.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(me, { kind: "loading", title: a.loading, placement: "inline" }) }) : null
926
929
  ]
927
930
  }
928
931
  )
@@ -931,196 +934,208 @@ function tl(n) {
931
934
  }
932
935
  );
933
936
  }
934
- const Se = 64;
935
- function gn(n, l) {
937
+ const De = 64;
938
+ function An(n, l) {
936
939
  for (let t = n instanceof Element ? n : null; t !== null; t = t.parentElement) {
937
940
  if (t instanceof HTMLElement && t.scrollTop > 0) return !1;
938
941
  if (t === l) return !0;
939
942
  }
940
943
  return l.scrollTop <= 0;
941
944
  }
942
- function Nn(n, l) {
943
- const [t, i] = A(0), o = H(l);
944
- return o.current = l, Y(() => {
945
+ function Tn(n, l) {
946
+ const [t, r] = T(0), c = H(l);
947
+ return c.current = l, Q(() => {
945
948
  const s = n.current;
946
949
  if (s === null) return;
947
- let d = null, a = 0;
948
- const m = (f) => {
949
- d = gn(f.target, s) && f.touches.length === 1 ? f.touches[0].clientY : null, a = 0;
950
- }, v = (f) => {
951
- if (d === null || o.current === null) return;
952
- const r = f.touches[0].clientY - d;
953
- if (r <= 0) {
954
- d = null, i(0);
950
+ let u = null, a = 0;
951
+ const m = (p) => {
952
+ u = An(p.target, s) && p.touches.length === 1 ? p.touches[0].clientY : null, a = 0;
953
+ }, v = (p) => {
954
+ if (u === null || c.current === null) return;
955
+ const h = p.touches[0].clientY - u;
956
+ if (h <= 0) {
957
+ u = null, r(0);
955
958
  return;
956
959
  }
957
- f.cancelable && f.preventDefault(), a = Math.min(r * 0.6, Se * 1.5), i(a);
958
- }, u = () => {
959
- var f;
960
- d !== null && a >= Se && ((f = o.current) == null || f.call(o)), d = null, a = 0, i(0);
960
+ p.cancelable && p.preventDefault(), a = Math.min(h * 0.6, De * 1.5), r(a);
961
+ }, o = () => {
962
+ var p;
963
+ u !== null && a >= De && ((p = c.current) == null || p.call(c)), u = null, a = 0, r(0);
961
964
  };
962
- return s.addEventListener("touchstart", m, { passive: !0 }), s.addEventListener("touchmove", v, { passive: !1 }), s.addEventListener("touchend", u), s.addEventListener("touchcancel", u), () => {
963
- s.removeEventListener("touchstart", m), s.removeEventListener("touchmove", v), s.removeEventListener("touchend", u), s.removeEventListener("touchcancel", u);
965
+ return s.addEventListener("touchstart", m, { passive: !0 }), s.addEventListener("touchmove", v, { passive: !1 }), s.addEventListener("touchend", o), s.addEventListener("touchcancel", o), () => {
966
+ s.removeEventListener("touchstart", m), s.removeEventListener("touchmove", v), s.removeEventListener("touchend", o), s.removeEventListener("touchcancel", o);
964
967
  };
965
968
  }, [n]), t;
966
969
  }
967
- const Ze = Ye(null);
968
- function wn() {
969
- return qe(Ze);
970
- }
971
- function al({ label: n, rows: l, error: t, onRetry: i, loadingText: o = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: d, selected: a, onOpen: m, onRowMenu: v }) {
972
- const u = H([]), f = wn();
973
- if (t != null) return /* @__PURE__ */ e(tn, { message: t, onRetry: i });
974
- if (l === null) return /* @__PURE__ */ e(nn, { what: o, layout: "block" });
975
- if (l.length === 0) return /* @__PURE__ */ e(ln, { title: s, hint: d });
976
- const r = (h, _, N) => {
977
- var y;
978
- if (h.key === "ArrowDown" || h.key === "ArrowUp")
979
- h.preventDefault(), (y = u.current[Math.min(l.length - 1, Math.max(0, _ + (h.key === "ArrowDown" ? 1 : -1)))]) == null || y.focus();
980
- else if (h.key === "Enter")
981
- m == null || m(N);
982
- else if ((h.key === "ContextMenu" || h.shiftKey && h.key === "F10") && v) {
983
- h.preventDefault();
984
- const k = h.currentTarget.getBoundingClientRect();
985
- v(N, { x: k.left + 16, y: k.bottom });
970
+ const Ye = sn(null);
971
+ function Dn() {
972
+ return tn(Ye);
973
+ }
974
+ function vl({ label: n, rows: l, error: t, onRetry: r, loadingText: c = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: u, selected: a, onOpen: m, onRowMenu: v }) {
975
+ const o = H([]), p = Dn();
976
+ if (t != null) return /* @__PURE__ */ e(fn, { message: t, onRetry: r });
977
+ if (l === null) return /* @__PURE__ */ e(mn, { what: c, layout: "block" });
978
+ if (l.length === 0) return /* @__PURE__ */ e(hn, { title: s, hint: u });
979
+ const h = (f, d, g) => {
980
+ var k;
981
+ if (f.key === "ArrowDown" || f.key === "ArrowUp")
982
+ f.preventDefault(), (k = o.current[Math.min(l.length - 1, Math.max(0, d + (f.key === "ArrowDown" ? 1 : -1)))]) == null || k.focus();
983
+ else if (f.key === "Enter")
984
+ m == null || m(g);
985
+ else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && v) {
986
+ f.preventDefault();
987
+ const x = f.currentTarget.getBoundingClientRect();
988
+ v(g, { x: x.left + 16, y: x.bottom });
986
989
  }
987
990
  };
988
- return /* @__PURE__ */ c(E, { children: [
989
- f !== null && (f.distance > 0 || f.refreshing) ? /* @__PURE__ */ c("div", { className: "cms-list__pull", role: "status", style: { height: f.refreshing ? void 0 : f.distance }, "data-ready": f.distance >= Se ? "" : void 0, children: [
990
- f.refreshing ? /* @__PURE__ */ e(V, { name: "spinner" }) : null,
991
- f.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: f.text }) : null
991
+ return /* @__PURE__ */ i(A, { children: [
992
+ p !== null && (p.distance > 0 || p.refreshing) ? /* @__PURE__ */ i("div", { className: "cms-list__pull", role: "status", style: { height: p.refreshing ? void 0 : p.distance }, "data-ready": p.distance >= De ? "" : void 0, children: [
993
+ p.refreshing ? /* @__PURE__ */ e(G, { name: "spinner" }) : null,
994
+ p.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: p.text }) : null
992
995
  ] }) : null,
993
- /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((h, _) => {
994
- const N = h.id === a;
995
- return /* @__PURE__ */ c(
996
+ /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((f, d) => {
997
+ const g = f.id === a;
998
+ return /* @__PURE__ */ i(
996
999
  "li",
997
1000
  {
998
- ref: (y) => {
999
- u.current[_] = y;
1001
+ ref: (k) => {
1002
+ o.current[d] = k;
1000
1003
  },
1001
1004
  role: "option",
1002
- "aria-selected": N,
1003
- tabIndex: N || a == null && _ === 0 ? 0 : -1,
1004
- className: $("cms-list__row", N && "is-selected"),
1005
- onClick: () => m == null ? void 0 : m(h.id),
1006
- onKeyDown: (y) => r(y, _, h.id),
1007
- onContextMenu: v ? (y) => {
1008
- y.preventDefault(), v(h.id, { x: y.clientX, y: y.clientY });
1005
+ "aria-selected": g,
1006
+ tabIndex: g || a == null && d === 0 ? 0 : -1,
1007
+ className: F("cms-list__row", g && "is-selected"),
1008
+ onClick: () => m == null ? void 0 : m(f.id),
1009
+ onKeyDown: (k) => h(k, d, f.id),
1010
+ onContextMenu: v ? (k) => {
1011
+ k.preventDefault(), v(f.id, { x: k.clientX, y: k.clientY });
1009
1012
  } : void 0,
1010
1013
  children: [
1011
- h.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: h.lead }) : null,
1012
- /* @__PURE__ */ c("span", { className: "cms-list__text", children: [
1013
- /* @__PURE__ */ e("span", { className: $("cms-list__primary", h.unread === !0 && "is-unread"), children: h.primary }),
1014
- h.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: h.secondary }) : null
1014
+ f.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: f.lead }) : null,
1015
+ /* @__PURE__ */ i("span", { className: "cms-list__text", children: [
1016
+ /* @__PURE__ */ e("span", { className: F("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
1017
+ f.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: f.secondary }) : null
1015
1018
  ] }),
1016
- h.meta != null || h.count !== void 0 ? /* @__PURE__ */ c("span", { className: "cms-list__end", children: [
1017
- h.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: h.meta }) : null,
1018
- h.count !== void 0 && h.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: h.count }) : null
1019
+ f.meta != null || f.count !== void 0 ? /* @__PURE__ */ i("span", { className: "cms-list__end", children: [
1020
+ f.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: f.meta }) : null,
1021
+ f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: f.count }) : null
1019
1022
  ] }) : null
1020
1023
  ]
1021
1024
  },
1022
- h.id
1025
+ f.id
1023
1026
  );
1024
1027
  }) })
1025
1028
  ] });
1026
1029
  }
1027
- function pe({ at: n, items: l, onClose: t, label: i = "Actions", focus: o = "first" }) {
1028
- const s = H(null), d = H(null), a = G(), [m, v] = A(n), u = l.filter((r) => r.offer.offered);
1029
- if (fe(() => {
1030
+ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "current" }) {
1031
+ const s = H(null), u = H(null), a = se(), [m, v] = T(n), o = l.filter((d) => d.offer.offered);
1032
+ if (ve(() => {
1030
1033
  if (!n) return;
1031
- const r = s.current, h = (r == null ? void 0 : r.offsetWidth) ?? 0, _ = (r == null ? void 0 : r.offsetHeight) ?? 0;
1032
- v({ x: Math.max(0, Math.min(n.x, window.innerWidth - h)), y: Math.max(0, Math.min(n.y, window.innerHeight - _)) });
1033
- }, [n]), Y(() => {
1034
- var _, N;
1034
+ const d = s.current, g = (d == null ? void 0 : d.offsetWidth) ?? 0, k = (d == null ? void 0 : d.offsetHeight) ?? 0;
1035
+ v({ x: Math.max(0, Math.min(n.x, window.innerWidth - g)), y: Math.max(0, Math.min(n.y, window.innerHeight - k)) });
1036
+ }, [n]), Q(() => {
1037
+ var x, C;
1035
1038
  if (!n) return;
1036
- d.current = document.activeElement;
1037
- const r = Array.from(((_ = s.current) == null ? void 0 : _.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1038
- (N = o === "last" ? r[r.length - 1] : r[0]) == null || N.focus();
1039
- const h = (y) => {
1040
- var k;
1041
- (k = s.current) != null && k.contains(y.target) || t();
1039
+ u.current = document.activeElement;
1040
+ const d = Array.from(((x = s.current) == null ? void 0 : x.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), g = c === "current" ? d.find((w) => w.getAttribute("aria-checked") === "true") : void 0;
1041
+ (C = c === "last" ? d[d.length - 1] : g ?? d[0]) == null || C.focus();
1042
+ const k = (w) => {
1043
+ var b;
1044
+ (b = s.current) != null && b.contains(w.target) || t();
1042
1045
  };
1043
- return document.addEventListener("mousedown", h), () => {
1044
- var y, k;
1045
- document.removeEventListener("mousedown", h), (k = (y = d.current) == null ? void 0 : y.focus) == null || k.call(y);
1046
+ return document.addEventListener("mousedown", k), () => {
1047
+ var w, b;
1048
+ document.removeEventListener("mousedown", k), (b = (w = u.current) == null ? void 0 : w.focus) == null || b.call(w);
1046
1049
  };
1047
- }, [n, t, o]), !n || u.length === 0) return null;
1048
- const f = (r) => {
1049
- var N, y;
1050
- const h = Array.from(((N = s.current) == null ? void 0 : N.querySelectorAll('[role="menuitem"]')) ?? []), _ = h.indexOf(document.activeElement);
1051
- if (r.key === "Escape" || r.key === "Tab")
1052
- r.preventDefault(), t();
1053
- else if (r.key === "ArrowDown" || r.key === "ArrowUp") {
1054
- r.preventDefault();
1055
- const k = r.key === "ArrowDown" ? 1 : -1;
1056
- (y = h[(_ + k + h.length) % h.length]) == null || y.focus();
1050
+ }, [n, t, c]), !n || o.length === 0) return null;
1051
+ const p = (d) => {
1052
+ var x, C;
1053
+ const g = Array.from(((x = s.current) == null ? void 0 : x.querySelectorAll('[role^="menuitem"]')) ?? []), k = g.indexOf(document.activeElement);
1054
+ if (d.key === "Escape" || d.key === "Tab")
1055
+ d.preventDefault(), t();
1056
+ else if (d.key === "ArrowDown" || d.key === "ArrowUp") {
1057
+ d.preventDefault();
1058
+ const w = d.key === "ArrowDown" ? 1 : -1;
1059
+ (C = g[(k + w + g.length) % g.length]) == null || C.focus();
1057
1060
  }
1058
- };
1059
- return De(
1061
+ }, h = (d) => {
1062
+ const g = d.offer.refusal !== void 0;
1063
+ return /* @__PURE__ */ i(
1064
+ "div",
1065
+ {
1066
+ role: d.checked === void 0 ? "menuitem" : "menuitemradio",
1067
+ "aria-checked": d.checked,
1068
+ tabIndex: -1,
1069
+ "aria-disabled": g || void 0,
1070
+ "aria-describedby": g ? `${a}-${d.id}` : void 0,
1071
+ title: g ? d.offer.refusal : void 0,
1072
+ className: F("cms-menu__item", d.danger && "is-danger", d.offer.locked && "is-locked", g && "is-refused"),
1073
+ onClick: () => {
1074
+ g || (t(), d.onSelect());
1075
+ },
1076
+ onKeyDown: (k) => {
1077
+ (k.key === "Enter" || k.key === " ") && !g && (k.preventDefault(), t(), d.onSelect());
1078
+ },
1079
+ children: [
1080
+ d.checked !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-menu__check", children: d.checked ? /* @__PURE__ */ e(G, { name: "check" }) : null }) : null,
1081
+ d.offer.locked ? /* @__PURE__ */ e(G, { name: "lock" }) : null,
1082
+ /* @__PURE__ */ e("span", { className: "cms-menu__label", children: d.label }),
1083
+ g ? /* @__PURE__ */ e("span", { id: `${a}-${d.id}`, className: "cms-menu__refusal", children: d.offer.refusal }) : null
1084
+ ]
1085
+ },
1086
+ d.id
1087
+ );
1088
+ }, f = [];
1089
+ for (const d of o) {
1090
+ const g = f[f.length - 1];
1091
+ g !== void 0 && g.group === d.group ? g.items.push(d) : f.push({ group: d.group, items: [d] });
1092
+ }
1093
+ return Pe(
1060
1094
  /* @__PURE__ */ e(
1061
1095
  "div",
1062
1096
  {
1063
1097
  ref: s,
1064
1098
  className: "cms-menu",
1065
1099
  role: "menu",
1066
- "aria-label": i,
1100
+ "aria-label": r,
1067
1101
  style: { left: (m ?? n).x, top: (m ?? n).y },
1068
- onKeyDown: f,
1069
- onContextMenu: (r) => r.preventDefault(),
1070
- children: u.map((r) => {
1071
- const h = r.offer.refusal !== void 0;
1072
- return /* @__PURE__ */ c(
1073
- "div",
1074
- {
1075
- role: "menuitem",
1076
- tabIndex: -1,
1077
- "aria-disabled": h || void 0,
1078
- "aria-describedby": h ? `${a}-${r.id}` : void 0,
1079
- title: h ? r.offer.refusal : void 0,
1080
- className: $("cms-menu__item", r.danger && "is-danger", r.offer.locked && "is-locked", h && "is-refused"),
1081
- onClick: () => {
1082
- h || (t(), r.onSelect());
1083
- },
1084
- onKeyDown: (_) => {
1085
- (_.key === "Enter" || _.key === " ") && !h && (_.preventDefault(), t(), r.onSelect());
1086
- },
1087
- children: [
1088
- r.offer.locked ? /* @__PURE__ */ e(V, { name: "lock" }) : null,
1089
- /* @__PURE__ */ e("span", { className: "cms-menu__label", children: r.label }),
1090
- h ? /* @__PURE__ */ e("span", { id: `${a}-${r.id}`, className: "cms-menu__refusal", children: r.offer.refusal }) : null
1091
- ]
1092
- },
1093
- r.id
1094
- );
1095
- })
1102
+ onKeyDown: p,
1103
+ onContextMenu: (d) => d.preventDefault(),
1104
+ children: f.map((d, g) => /* @__PURE__ */ i(an, { children: [
1105
+ g > 0 ? /* @__PURE__ */ e("div", { className: "cms-menu__separator", role: "separator" }) : null,
1106
+ d.group === void 0 ? d.items.map(h) : /* @__PURE__ */ i("div", { role: "group", "aria-label": d.group, children: [
1107
+ /* @__PURE__ */ e("div", { className: "cms-menu__group", "aria-hidden": "true", children: d.group }),
1108
+ d.items.map(h)
1109
+ ] })
1110
+ ] }, g))
1096
1111
  }
1097
1112
  ),
1098
1113
  document.body
1099
1114
  );
1100
1115
  }
1101
- function sl({ title: n, icon: l, primary: t, more: i = [], moreLabel: o, context: s, fullWidth: d = !1 }) {
1102
- var y, k, C;
1103
- const [a, m] = A(null), v = G(), u = i.filter((M) => M.offer.offered), f = (y = t == null ? void 0 : t.offer) == null ? void 0 : y.refusal, r = t !== void 0 && (((k = t.offer) == null ? void 0 : k.offered) === !1 || f !== void 0), h = t !== void 0 && "menu" in t ? t.menu.filter((M) => M.offer.offered) : [], _ = t !== void 0 && "menu" in t && h.length > 0 ? t : null, N = (M, b) => {
1104
- const w = b.getBoundingClientRect();
1105
- m((a == null ? void 0 : a.which) === M ? null : { which: M, x: w.left, y: w.bottom + 4 });
1116
+ function gl({ title: n, icon: l, primary: t, more: r = [], moreLabel: c, context: s, fullWidth: u = !1 }) {
1117
+ var k, x, C;
1118
+ const [a, m] = T(null), v = se(), o = r.filter((w) => w.offer.offered), p = (k = t == null ? void 0 : t.offer) == null ? void 0 : k.refusal, h = t !== void 0 && (((x = t.offer) == null ? void 0 : x.offered) === !1 || p !== void 0), f = t !== void 0 && "menu" in t ? t.menu.filter((w) => w.offer.offered) : [], d = t !== void 0 && "menu" in t && f.length > 0 ? t : null, g = (w, b) => {
1119
+ const y = b.getBoundingClientRect();
1120
+ m((a == null ? void 0 : a.which) === w ? null : { which: w, x: y.left, y: y.bottom + 4 });
1106
1121
  };
1107
- return /* @__PURE__ */ c("header", { className: `cms-section-header${d ? " cms-section-header--full" : ""}`, children: [
1108
- /* @__PURE__ */ c("div", { className: "cms-section-header__row", "data-row": "1", children: [
1122
+ return /* @__PURE__ */ i("header", { className: `cms-section-header${u ? " cms-section-header--full" : ""}`, children: [
1123
+ /* @__PURE__ */ i("div", { className: "cms-section-header__row", "data-row": "1", children: [
1109
1124
  l !== void 0 ? /* @__PURE__ */ e(L, { name: l }) : null,
1110
1125
  /* @__PURE__ */ e("h1", { className: "cms-section-header__title", title: n, children: n }),
1111
- /* @__PURE__ */ c("div", { className: "cms-section-header__actions", children: [
1112
- t !== void 0 && ((C = t.offer) == null ? void 0 : C.offered) !== !1 ? /* @__PURE__ */ c("span", { className: `cms-section-header__primary${_ !== null ? " cms-section-header__primary--split" : ""}`, children: [
1113
- /* @__PURE__ */ c(
1126
+ /* @__PURE__ */ i("div", { className: "cms-section-header__actions", children: [
1127
+ t !== void 0 && ((C = t.offer) == null ? void 0 : C.offered) !== !1 ? /* @__PURE__ */ i("span", { className: `cms-section-header__primary${d !== null ? " cms-section-header__primary--split" : ""}`, children: [
1128
+ /* @__PURE__ */ i(
1114
1129
  "button",
1115
1130
  {
1116
1131
  type: "button",
1117
1132
  className: "cms-button cms-button--primary",
1118
1133
  "data-action": "primary",
1119
- "aria-disabled": r ? "true" : void 0,
1120
- "aria-describedby": f !== void 0 ? v : void 0,
1121
- title: f,
1134
+ "aria-disabled": h ? "true" : void 0,
1135
+ "aria-describedby": p !== void 0 ? v : void 0,
1136
+ title: p,
1122
1137
  onClick: () => {
1123
- r || t.onPress();
1138
+ h || t.onPress();
1124
1139
  },
1125
1140
  children: [
1126
1141
  /* @__PURE__ */ e(L, { name: t.icon }),
@@ -1129,7 +1144,7 @@ function sl({ title: n, icon: l, primary: t, more: i = [], moreLabel: o, context
1129
1144
  ]
1130
1145
  }
1131
1146
  ),
1132
- _ !== null ? /* @__PURE__ */ e(
1147
+ d !== null ? /* @__PURE__ */ e(
1133
1148
  "button",
1134
1149
  {
1135
1150
  type: "button",
@@ -1137,14 +1152,14 @@ function sl({ title: n, icon: l, primary: t, more: i = [], moreLabel: o, context
1137
1152
  "data-action": "primary-menu",
1138
1153
  "aria-haspopup": "menu",
1139
1154
  "aria-expanded": (a == null ? void 0 : a.which) === "primary",
1140
- "aria-label": _.menuLabel,
1141
- onClick: (M) => N("primary", M.currentTarget),
1155
+ "aria-label": d.menuLabel,
1156
+ onClick: (w) => g("primary", w.currentTarget),
1142
1157
  children: /* @__PURE__ */ e(L, { name: "chevron-down" })
1143
1158
  }
1144
1159
  ) : null,
1145
- f !== void 0 ? /* @__PURE__ */ e("span", { id: v, className: "cms-visually-hidden", children: f }) : null
1160
+ p !== void 0 ? /* @__PURE__ */ e("span", { id: v, className: "cms-visually-hidden", children: p }) : null
1146
1161
  ] }) : null,
1147
- u.length > 0 ? /* @__PURE__ */ e(
1162
+ o.length > 0 ? /* @__PURE__ */ e(
1148
1163
  "button",
1149
1164
  {
1150
1165
  type: "button",
@@ -1152,38 +1167,38 @@ function sl({ title: n, icon: l, primary: t, more: i = [], moreLabel: o, context
1152
1167
  "data-action": "more",
1153
1168
  "aria-haspopup": "menu",
1154
1169
  "aria-expanded": (a == null ? void 0 : a.which) === "more",
1155
- "aria-label": o,
1156
- title: o,
1157
- onClick: (M) => N("more", M.currentTarget),
1170
+ "aria-label": c,
1171
+ title: c,
1172
+ onClick: (w) => g("more", w.currentTarget),
1158
1173
  children: /* @__PURE__ */ e(L, { name: "more" })
1159
1174
  }
1160
1175
  ) : null
1161
1176
  ] })
1162
1177
  ] }),
1163
1178
  s != null ? /* @__PURE__ */ e("div", { className: "cms-section-header__context", "data-row": "2", children: s }) : null,
1164
- _ !== null ? /* @__PURE__ */ e(pe, { at: (a == null ? void 0 : a.which) === "primary" ? a : null, items: h, onClose: () => m(null), label: _.menuLabel }) : null,
1165
- /* @__PURE__ */ e(pe, { at: (a == null ? void 0 : a.which) === "more" ? a : null, items: i, onClose: () => m(null), label: o })
1179
+ d !== null ? /* @__PURE__ */ e(ge, { at: (a == null ? void 0 : a.which) === "primary" ? a : null, items: f, onClose: () => m(null), label: d.menuLabel }) : null,
1180
+ /* @__PURE__ */ e(ge, { at: (a == null ? void 0 : a.which) === "more" ? a : null, items: r, onClose: () => m(null), label: c })
1166
1181
  ] });
1167
1182
  }
1168
- function rl({ title: n, scope: l, actions: t, backLink: i }) {
1169
- return /* @__PURE__ */ c("header", { className: "cms-page-header", children: [
1170
- i ? /* @__PURE__ */ c(
1183
+ function Nl({ title: n, scope: l, actions: t, backLink: r }) {
1184
+ return /* @__PURE__ */ i("header", { className: "cms-page-header", children: [
1185
+ r ? /* @__PURE__ */ i(
1171
1186
  "a",
1172
1187
  {
1173
1188
  className: "cms-page-header__back",
1174
- href: i.href ?? "#",
1175
- onClick: (o) => {
1176
- i.onBack && (o.preventDefault(), i.onBack());
1189
+ href: r.href ?? "#",
1190
+ onClick: (c) => {
1191
+ r.onBack && (c.preventDefault(), r.onBack());
1177
1192
  },
1178
1193
  children: [
1179
- /* @__PURE__ */ e(V, { name: "back" }),
1194
+ /* @__PURE__ */ e(G, { name: "back" }),
1180
1195
  " ",
1181
- i.label
1196
+ r.label
1182
1197
  ]
1183
1198
  }
1184
1199
  ) : null,
1185
- /* @__PURE__ */ c("div", { className: "cms-page-header__row", children: [
1186
- /* @__PURE__ */ c("div", { className: "cms-page-header__titles", children: [
1200
+ /* @__PURE__ */ i("div", { className: "cms-page-header__row", children: [
1201
+ /* @__PURE__ */ i("div", { className: "cms-page-header__titles", children: [
1187
1202
  /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
1188
1203
  l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
1189
1204
  ] }),
@@ -1191,73 +1206,73 @@ function rl({ title: n, scope: l, actions: t, backLink: i }) {
1191
1206
  ] })
1192
1207
  ] });
1193
1208
  }
1194
- function il({ tabs: n, active: l, onSelect: t, label: i }) {
1195
- const o = H([]), s = (d, a) => {
1196
- var f;
1197
- const m = n.length - 1, v = d.key === "ArrowRight" ? a === m ? 0 : a + 1 : d.key === "ArrowLeft" ? a === 0 ? m : a - 1 : d.key === "Home" ? 0 : d.key === "End" ? m : null;
1209
+ function wl({ tabs: n, active: l, onSelect: t, label: r }) {
1210
+ const c = H([]), s = (u, a) => {
1211
+ var p;
1212
+ const m = n.length - 1, v = u.key === "ArrowRight" ? a === m ? 0 : a + 1 : u.key === "ArrowLeft" ? a === 0 ? m : a - 1 : u.key === "Home" ? 0 : u.key === "End" ? m : null;
1198
1213
  if (v === null) return;
1199
- d.preventDefault();
1200
- const u = n[v];
1201
- u && (t(u.id), (f = o.current[v]) == null || f.focus());
1214
+ u.preventDefault();
1215
+ const o = n[v];
1216
+ o && (t(o.id), (p = c.current[v]) == null || p.focus());
1202
1217
  };
1203
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": i, children: n.map((d, a) => {
1204
- const m = d.id === l;
1205
- return /* @__PURE__ */ c(
1218
+ return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": r, children: n.map((u, a) => {
1219
+ const m = u.id === l;
1220
+ return /* @__PURE__ */ i(
1206
1221
  "button",
1207
1222
  {
1208
1223
  ref: (v) => {
1209
- o.current[a] = v;
1224
+ c.current[a] = v;
1210
1225
  },
1211
1226
  type: "button",
1212
1227
  role: "tab",
1213
- className: $("cms-tab", m && "is-active"),
1228
+ className: F("cms-tab", m && "is-active"),
1214
1229
  "aria-selected": m,
1215
1230
  tabIndex: m ? 0 : -1,
1216
- onClick: () => t(d.id),
1231
+ onClick: () => t(u.id),
1217
1232
  onKeyDown: (v) => s(v, a),
1218
1233
  children: [
1219
- d.label,
1220
- d.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: d.count }) : null
1234
+ u.label,
1235
+ u.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: u.count }) : null
1221
1236
  ]
1222
1237
  },
1223
- d.id
1238
+ u.id
1224
1239
  );
1225
1240
  }) });
1226
1241
  }
1227
- function yn(n) {
1228
- const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (o) => {
1242
+ function Ln(n) {
1243
+ const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (c) => {
1229
1244
  var s;
1230
- return (s = o == null ? void 0 : o.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
1245
+ return (s = c == null ? void 0 : c.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
1231
1246
  };
1232
1247
  return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
1233
1248
  }
1234
- function kn(n) {
1249
+ function $n(n) {
1235
1250
  let l = 0;
1236
1251
  for (const t of n.trim().toLowerCase())
1237
1252
  l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
1238
1253
  return l % 6 + 1;
1239
1254
  }
1240
- function ye({ name: n, pictureUrl: l, presence: t, connection: i, deleted: o = !1, size: s = 32 }) {
1241
- const d = i !== void 0 ? `is-${i.state === "offline" ? "disconnected" : i.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, a = i !== void 0 ? `${n}, ${i.label}` : t ? `${n}, ${t}` : n;
1242
- return /* @__PURE__ */ c(
1255
+ function Se({ name: n, pictureUrl: l, presence: t, connection: r, deleted: c = !1, size: s = 32 }) {
1256
+ const u = r !== void 0 ? `is-${r.state === "offline" ? "disconnected" : r.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, a = r !== void 0 ? `${n}, ${r.label}` : t ? `${n}, ${t}` : n;
1257
+ return /* @__PURE__ */ i(
1243
1258
  "span",
1244
1259
  {
1245
- className: $("cms-avatar", o ? "cms-avatar--deleted" : `cms-avatar--tint-${kn(n)}`),
1260
+ className: F("cms-avatar", c ? "cms-avatar--deleted" : `cms-avatar--tint-${$n(n)}`),
1246
1261
  style: { width: s, height: s, fontSize: Math.round(s * 0.4) },
1247
1262
  role: "img",
1248
1263
  "aria-label": a,
1249
- ...i === void 0 ? {} : { title: i.label },
1264
+ ...r === void 0 ? {} : { title: r.label },
1250
1265
  children: [
1251
- o ? /* @__PURE__ */ e(L, { name: "user", size: Math.round(s * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: yn(n) }),
1252
- d === null ? null : /* @__PURE__ */ e("span", { className: $("cms-avatar__presence", d), "aria-hidden": "true" })
1266
+ c ? /* @__PURE__ */ e(L, { name: "user", size: Math.round(s * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: Ln(n) }),
1267
+ u === null ? null : /* @__PURE__ */ e("span", { className: F("cms-avatar__presence", u), "aria-hidden": "true" })
1253
1268
  ]
1254
1269
  }
1255
1270
  );
1256
1271
  }
1257
- const xn = 64, Ie = "cms-splitter:";
1258
- function Ee(n) {
1272
+ const In = 64, Re = "cms-splitter:";
1273
+ function Le(n) {
1259
1274
  try {
1260
- const l = window.localStorage.getItem(Ie + n);
1275
+ const l = window.localStorage.getItem(Re + n);
1261
1276
  if (l === null) return null;
1262
1277
  const t = Number(l);
1263
1278
  return Number.isFinite(t) ? t : null;
@@ -1265,40 +1280,40 @@ function Ee(n) {
1265
1280
  return null;
1266
1281
  }
1267
1282
  }
1268
- function Mn(n, l) {
1283
+ function Pn(n, l) {
1269
1284
  if (n !== void 0)
1270
1285
  try {
1271
- window.localStorage.setItem(Ie + n, String(l));
1286
+ window.localStorage.setItem(Re + n, String(l));
1272
1287
  } catch {
1273
1288
  }
1274
1289
  }
1275
- function Cn(n) {
1290
+ function Fn(n) {
1276
1291
  if (n !== void 0)
1277
1292
  try {
1278
- window.localStorage.removeItem(Ie + n);
1293
+ window.localStorage.removeItem(Re + n);
1279
1294
  } catch {
1280
1295
  }
1281
1296
  }
1282
- function Sn({ storageKey: n, value: l, default: t, min: i, max: o, step: s = 16, label: d, onChange: a, className: m, style: v }) {
1283
- const u = Math.max(i, o), f = (b) => Math.round(Math.min(Math.max(b, i), u)), [r, h] = A(() => {
1284
- const b = n === void 0 ? null : Ee(n);
1285
- return f(b ?? t);
1286
- }), _ = f(l ?? r), N = H(null), [y, k] = A(!1);
1287
- fe(() => {
1297
+ function Bn({ storageKey: n, value: l, default: t, min: r, max: c, step: s = 16, label: u, onChange: a, className: m, style: v }) {
1298
+ const o = Math.max(r, c), p = (b) => Math.round(Math.min(Math.max(b, r), o)), [h, f] = T(() => {
1299
+ const b = n === void 0 ? null : Le(n);
1300
+ return p(b ?? t);
1301
+ }), d = p(l ?? h), g = H(null), [k, x] = T(!1);
1302
+ ve(() => {
1288
1303
  if (n === void 0) return;
1289
- const b = Ee(n);
1304
+ const b = Le(n);
1290
1305
  if (b === null) return;
1291
- const w = f(b);
1292
- (l === void 0 || w !== f(l)) && (h(w), a(w, !0));
1293
- }, []), fe(() => {
1294
- l !== void 0 && f(l) !== l && a(f(l), !0);
1295
- }, [l, i, u]);
1296
- const C = (b, w) => {
1297
- const T = f(b);
1298
- h(T), w && Mn(n, T), a(T, w);
1299
- }, M = () => {
1300
- const b = N.current;
1301
- N.current = null, k(!1), b !== null && b.last !== b.from && C(b.last, !0);
1306
+ const y = p(b);
1307
+ (l === void 0 || y !== p(l)) && (f(y), a(y, !0));
1308
+ }, []), ve(() => {
1309
+ l !== void 0 && p(l) !== l && a(p(l), !0);
1310
+ }, [l, r, o]);
1311
+ const C = (b, y) => {
1312
+ const D = p(b);
1313
+ f(D), y && Pn(n, D), a(D, y);
1314
+ }, w = () => {
1315
+ const b = g.current;
1316
+ g.current = null, x(!1), b !== null && b.last !== b.from && C(b.last, !0);
1302
1317
  };
1303
1318
  return /* @__PURE__ */ e(
1304
1319
  "div",
@@ -1306,87 +1321,87 @@ function Sn({ storageKey: n, value: l, default: t, min: i, max: o, step: s = 16,
1306
1321
  role: "separator",
1307
1322
  tabIndex: 0,
1308
1323
  "aria-orientation": "vertical",
1309
- "aria-label": d,
1310
- "aria-valuenow": _,
1311
- "aria-valuemin": i,
1312
- "aria-valuemax": u,
1313
- className: $("cms-splitter", y && "is-dragging", _ <= i && "is-at-min", _ >= u && "is-at-max", m),
1324
+ "aria-label": u,
1325
+ "aria-valuenow": d,
1326
+ "aria-valuemin": r,
1327
+ "aria-valuemax": o,
1328
+ className: F("cms-splitter", k && "is-dragging", d <= r && "is-at-min", d >= o && "is-at-max", m),
1314
1329
  style: v,
1315
1330
  onPointerDown: (b) => {
1316
- var T, O;
1331
+ var D, Z;
1317
1332
  if (b.button > 0) return;
1318
- b.preventDefault(), (O = (T = b.currentTarget).setPointerCapture) == null || O.call(T, b.pointerId);
1319
- const w = getComputedStyle(b.currentTarget).direction === "rtl" ? -1 : 1;
1320
- N.current = { x: b.clientX, from: _, last: _, sign: w }, k(!0);
1333
+ b.preventDefault(), (Z = (D = b.currentTarget).setPointerCapture) == null || Z.call(D, b.pointerId);
1334
+ const y = getComputedStyle(b.currentTarget).direction === "rtl" ? -1 : 1;
1335
+ g.current = { x: b.clientX, from: d, last: d, sign: y }, x(!0);
1321
1336
  },
1322
1337
  onPointerMove: (b) => {
1323
- const w = N.current;
1324
- w === null || !Number.isFinite(b.clientX) || (w.last = f(w.from + w.sign * (b.clientX - w.x)), C(w.last, !1));
1338
+ const y = g.current;
1339
+ y === null || !Number.isFinite(b.clientX) || (y.last = p(y.from + y.sign * (b.clientX - y.x)), C(y.last, !1));
1325
1340
  },
1326
- onPointerUp: M,
1327
- onPointerCancel: M,
1341
+ onPointerUp: w,
1342
+ onPointerCancel: w,
1328
1343
  onDoubleClick: () => {
1329
- Cn(n);
1330
- const b = f(t);
1331
- h(b), a(b, !0);
1344
+ Fn(n);
1345
+ const b = p(t);
1346
+ f(b), a(b, !0);
1332
1347
  },
1333
1348
  onKeyDown: (b) => {
1334
- const w = b.shiftKey ? xn : s, T = getComputedStyle(b.currentTarget).direction === "rtl" ? -1 : 1, O = b.key === "ArrowLeft" ? _ - T * w : b.key === "ArrowRight" ? _ + T * w : b.key === "Home" ? i : b.key === "End" ? u : null;
1335
- O !== null && (b.preventDefault(), C(O, !0));
1349
+ const y = b.shiftKey ? In : s, D = getComputedStyle(b.currentTarget).direction === "rtl" ? -1 : 1, Z = b.key === "ArrowLeft" ? d - D * y : b.key === "ArrowRight" ? d + D * y : b.key === "Home" ? r : b.key === "End" ? o : null;
1350
+ Z !== null && (b.preventDefault(), C(Z, !0));
1336
1351
  }
1337
1352
  }
1338
1353
  );
1339
1354
  }
1340
- function En({ count: n, label: l, max: t = 99 }) {
1341
- return n <= 0 ? null : /* @__PURE__ */ c("span", { className: "cms-badge", children: [
1355
+ function Rn({ count: n, label: l, max: t = 99 }) {
1356
+ return n <= 0 ? null : /* @__PURE__ */ i("span", { className: "cms-badge", children: [
1342
1357
  /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
1343
1358
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
1344
1359
  ] });
1345
1360
  }
1346
- function cl({ product: n, mark: l, rail: t, active: i, onNavigate: o, server: s, search: d, account: a, children: m, railLabel: v = "Sections" }) {
1347
- return /* @__PURE__ */ c("div", { className: "cms-shell", children: [
1348
- /* @__PURE__ */ c("nav", { className: "cms-shell__rail", "aria-label": v, children: [
1361
+ function yl({ product: n, mark: l, rail: t, active: r, onNavigate: c, server: s, search: u, account: a, children: m, railLabel: v = "Sections" }) {
1362
+ return /* @__PURE__ */ i("div", { className: "cms-shell", children: [
1363
+ /* @__PURE__ */ i("nav", { className: "cms-shell__rail", "aria-label": v, children: [
1349
1364
  /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
1350
- /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((u) => {
1351
- const f = u.id === i;
1352
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
1365
+ /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((o) => {
1366
+ const p = o.id === r;
1367
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1353
1368
  "a",
1354
1369
  {
1355
- href: u.href,
1356
- className: $("cms-shell__item", f && "is-active"),
1357
- "aria-current": f ? "page" : void 0,
1358
- title: u.label,
1359
- onClick: (r) => {
1360
- o && (r.preventDefault(), o(u.id));
1370
+ href: o.href,
1371
+ className: F("cms-shell__item", p && "is-active"),
1372
+ "aria-current": p ? "page" : void 0,
1373
+ title: o.label,
1374
+ onClick: (h) => {
1375
+ c && (h.preventDefault(), c(o.id));
1361
1376
  },
1362
1377
  children: [
1363
- /* @__PURE__ */ c("span", { className: "cms-shell__icon", children: [
1364
- /* @__PURE__ */ e(L, { name: u.icon, size: 22 }),
1365
- u.badge ? /* @__PURE__ */ e(En, { count: u.badge.count, label: u.badge.label }) : null
1378
+ /* @__PURE__ */ i("span", { className: "cms-shell__icon", children: [
1379
+ /* @__PURE__ */ e(L, { name: o.icon, size: 22 }),
1380
+ o.badge ? /* @__PURE__ */ e(Rn, { count: o.badge.count, label: o.badge.label }) : null
1366
1381
  ] }),
1367
- /* @__PURE__ */ e("span", { className: "cms-shell__label", children: u.label })
1382
+ /* @__PURE__ */ e("span", { className: "cms-shell__label", children: o.label })
1368
1383
  ]
1369
1384
  }
1370
- ) }, u.id);
1385
+ ) }, o.id);
1371
1386
  }) })
1372
1387
  ] }),
1373
- /* @__PURE__ */ c("header", { className: "cms-shell__top", children: [
1388
+ /* @__PURE__ */ i("header", { className: "cms-shell__top", children: [
1374
1389
  /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
1375
1390
  s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
1376
- d != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: d }) : null,
1391
+ u != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: u }) : null,
1377
1392
  a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: a }) : null
1378
1393
  ] }),
1379
1394
  /* @__PURE__ */ e("main", { className: "cms-shell__main", children: m })
1380
1395
  ] });
1381
1396
  }
1382
- function ol({ label: n, placeholder: l, value: t, onChange: i, onSearch: o }) {
1383
- return /* @__PURE__ */ c(
1397
+ function kl({ label: n, placeholder: l, value: t, onChange: r, onSearch: c }) {
1398
+ return /* @__PURE__ */ i(
1384
1399
  "form",
1385
1400
  {
1386
1401
  role: "search",
1387
1402
  className: "cms-search",
1388
1403
  onSubmit: (s) => {
1389
- s.preventDefault(), o == null || o(t);
1404
+ s.preventDefault(), c == null || c(t);
1390
1405
  },
1391
1406
  children: [
1392
1407
  /* @__PURE__ */ e(L, { name: "search", size: 18 }),
@@ -1398,102 +1413,69 @@ function ol({ label: n, placeholder: l, value: t, onChange: i, onSearch: o }) {
1398
1413
  "aria-label": n,
1399
1414
  placeholder: l,
1400
1415
  value: t,
1401
- onChange: (s) => i(s.target.value)
1416
+ onChange: (s) => r(s.target.value)
1402
1417
  }
1403
1418
  )
1404
1419
  ]
1405
1420
  }
1406
1421
  );
1407
1422
  }
1408
- function An({ options: n, value: l, onChange: t, label: i }) {
1409
- const o = H([]), s = (d, a) => {
1410
- var f;
1411
- const m = n.length - 1, v = d.key === "ArrowRight" || d.key === "ArrowDown" ? a === m ? 0 : a + 1 : d.key === "ArrowLeft" || d.key === "ArrowUp" ? a === 0 ? m : a - 1 : null;
1412
- if (v === null) return;
1413
- d.preventDefault();
1414
- const u = n[v];
1415
- u && (t(u.id), (f = o.current[v]) == null || f.focus());
1416
- };
1417
- return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": i, children: n.map((d, a) => {
1418
- const m = d.id === l;
1419
- return /* @__PURE__ */ c(
1420
- "button",
1421
- {
1422
- ref: (v) => {
1423
- o.current[a] = v;
1424
- },
1425
- type: "button",
1426
- role: "radio",
1427
- "aria-checked": m,
1428
- tabIndex: m ? 0 : -1,
1429
- className: $("cms-chip", m && "is-on"),
1430
- onClick: () => t(d.id),
1431
- onKeyDown: (v) => s(v, a),
1432
- children: [
1433
- m ? /* @__PURE__ */ e(L, { name: "check", size: 16 }) : null,
1434
- d.label
1435
- ]
1436
- },
1437
- d.id
1438
- );
1439
- }) });
1440
- }
1441
- function Tn(n, l, t) {
1442
- const i = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
1443
- let o = i.reduce((s, d) => s + d, 0) + t - l;
1444
- for (let s = i.length - 1; s >= 0 && o > 0; s -= 1) {
1445
- const d = Math.min(o, i[s] - n[s].min);
1446
- i[s] = i[s] - d, o -= d;
1423
+ function Hn(n, l, t) {
1424
+ const r = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
1425
+ let c = r.reduce((s, u) => s + u, 0) + t - l;
1426
+ for (let s = r.length - 1; s >= 0 && c > 0; s -= 1) {
1427
+ const u = Math.min(c, r[s] - n[s].min);
1428
+ r[s] = r[s] - u, c -= u;
1447
1429
  }
1448
- return i;
1430
+ return r;
1449
1431
  }
1450
- function dl({ panes: n, active: l, back: t, sizes: i, lastMin: o = 360, onResize: s, storageKey: d }) {
1451
- const a = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), m = H(null), [v, u] = A(0), f = (i ?? []).slice(0, n.length - 1), [r, h] = A(() => d === void 0 ? [] : f.map((b, w) => Ee(`${d}:${String(w)}`) ?? void 0)), [_, N] = A(!1), y = f.map((b, w) => b !== void 0 && r[w] !== void 0 ? { ...b, width: r[w] } : b), k = y.length === n.length - 1 && y.every((b) => b !== void 0);
1452
- fe(() => {
1432
+ function xl({ panes: n, active: l, back: t, sizes: r, lastMin: c = 360, onResize: s, storageKey: u }) {
1433
+ const a = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), m = H(null), [v, o] = T(0), p = (r ?? []).slice(0, n.length - 1), [h, f] = T(() => u === void 0 ? [] : p.map((b, y) => Le(`${u}:${String(y)}`) ?? void 0)), [d, g] = T(!1), k = p.map((b, y) => b !== void 0 && h[y] !== void 0 ? { ...b, width: h[y] } : b), x = k.length === n.length - 1 && k.every((b) => b !== void 0);
1434
+ ve(() => {
1453
1435
  const b = m.current;
1454
- if (b === null || !k) return;
1455
- const w = () => u(b.clientWidth);
1456
- if (w(), typeof ResizeObserver > "u") return;
1457
- const T = new ResizeObserver(w);
1458
- return T.observe(b), () => T.disconnect();
1459
- }, [k]);
1460
- const C = k ? Tn(y, v > 0 ? v : Number.POSITIVE_INFINITY, o) : [], M = k ? Object.fromEntries(C.flatMap((b, w) => [
1461
- [`--split-pane-${String(w)}`, `${String(b)}px`],
1462
- [`--split-pane-end-${String(w)}`, `${String(C.slice(0, w + 1).reduce((T, O) => T + O, 0))}px`]
1436
+ if (b === null || !x) return;
1437
+ const y = () => o(b.clientWidth);
1438
+ if (y(), typeof ResizeObserver > "u") return;
1439
+ const D = new ResizeObserver(y);
1440
+ return D.observe(b), () => D.disconnect();
1441
+ }, [x]);
1442
+ const C = x ? Hn(k, v > 0 ? v : Number.POSITIVE_INFINITY, c) : [], w = x ? Object.fromEntries(C.flatMap((b, y) => [
1443
+ [`--split-pane-${String(y)}`, `${String(b)}px`],
1444
+ [`--split-pane-end-${String(y)}`, `${String(C.slice(0, y + 1).reduce((D, Z) => D + Z, 0))}px`]
1463
1445
  ])) : void 0;
1464
- return /* @__PURE__ */ c(
1446
+ return /* @__PURE__ */ i(
1465
1447
  "div",
1466
1448
  {
1467
1449
  ref: m,
1468
- className: $("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", k && "cms-panes--sized", _ && "is-resizing"),
1450
+ className: F("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", x && "cms-panes--sized", d && "is-resizing"),
1469
1451
  "data-active": a,
1470
- style: M,
1452
+ style: w,
1471
1453
  children: [
1472
- n.map((b, w) => /* @__PURE__ */ c("section", { className: "cms-panes__pane", "aria-label": b.label, "data-offset": a - w, children: [
1473
- w === a && t ? /* @__PURE__ */ c("a", { className: "cms-panes__back", href: t.href, children: [
1454
+ n.map((b, y) => /* @__PURE__ */ i("section", { className: "cms-panes__pane", "aria-label": b.label, "data-offset": a - y, children: [
1455
+ y === a && t ? /* @__PURE__ */ i("a", { className: "cms-panes__back", href: t.href, children: [
1474
1456
  /* @__PURE__ */ e(L, { name: "chevron-left", size: 18 }),
1475
1457
  t.label
1476
1458
  ] }) : null,
1477
1459
  b.content
1478
1460
  ] }, b.label)),
1479
- k ? y.map((b, w) => {
1480
- const T = C.reduce((U, x, D) => D === w ? U : U + x, 0), O = Math.max(b.min, Math.min(b.max, v > 0 ? v - T - o : b.max));
1461
+ x ? k.map((b, y) => {
1462
+ const D = C.reduce((V, M, R) => R === y ? V : V + M, 0), Z = Math.max(b.min, Math.min(b.max, v > 0 ? v - D - c : b.max));
1481
1463
  return /* @__PURE__ */ e(
1482
- Sn,
1464
+ Bn,
1483
1465
  {
1484
- ...d === void 0 ? {} : { storageKey: `${d}:${String(w)}` },
1485
- value: C[w],
1466
+ ...u === void 0 ? {} : { storageKey: `${u}:${String(y)}` },
1467
+ value: C[y],
1486
1468
  default: b.reset,
1487
1469
  min: b.min,
1488
- max: O,
1470
+ max: Z,
1489
1471
  label: b.label,
1490
1472
  className: "cms-panes__splitter",
1491
- style: { "--split-at": `var(--split-pane-end-${String(w)})` },
1492
- onChange: (U, x) => {
1493
- d !== void 0 && h((D) => {
1494
- const B = [...D];
1495
- return B[w] = U, B;
1496
- }), N(!x), s == null || s(w, U, x);
1473
+ style: { "--split-at": `var(--split-pane-end-${String(y)})` },
1474
+ onChange: (V, M) => {
1475
+ u !== void 0 && f((R) => {
1476
+ const z = [...R];
1477
+ return z[y] = V, z;
1478
+ }), g(!M), s == null || s(y, V, M);
1497
1479
  }
1498
1480
  },
1499
1481
  b.label
@@ -1503,12 +1485,12 @@ function dl({ panes: n, active: l, back: t, sizes: i, lastMin: o = 360, onResize
1503
1485
  }
1504
1486
  );
1505
1487
  }
1506
- const Dn = { attachment: "Has an attachment", unread: "Unread" };
1507
- function ul({ from: n, subject: l, preview: t, time: i, unread: o, hasAttachment: s, selected: d, onOpen: a, check: m, selecting: v, labels: u }) {
1508
- const f = be(Dn, u), r = /* @__PURE__ */ e(ye, { name: n, size: 40 });
1509
- return /* @__PURE__ */ c("div", { className: $("cms-mail-row", o && "is-unread", d && "is-selected", v && "is-selecting", (m == null ? void 0 : m.checked) && "is-checked"), children: [
1510
- m !== void 0 ? /* @__PURE__ */ c("span", { className: "cms-mail-row__lead", children: [
1511
- r,
1488
+ const On = { attachment: "Has an attachment", unread: "Unread" };
1489
+ function Ml({ from: n, subject: l, preview: t, time: r, unread: c, hasAttachment: s, selected: u, onOpen: a, check: m, selecting: v, labels: o }) {
1490
+ const p = ye(On, o), h = /* @__PURE__ */ e(Se, { name: n, size: 40 });
1491
+ return /* @__PURE__ */ i("div", { className: F("cms-mail-row", c && "is-unread", u && "is-selected", v && "is-selecting", (m == null ? void 0 : m.checked) && "is-checked"), children: [
1492
+ m !== void 0 ? /* @__PURE__ */ i("span", { className: "cms-mail-row__lead", children: [
1493
+ h,
1512
1494
  /* @__PURE__ */ e(
1513
1495
  "input",
1514
1496
  {
@@ -1521,34 +1503,34 @@ function ul({ from: n, subject: l, preview: t, time: i, unread: o, hasAttachment
1521
1503
  "aria-label": m.label,
1522
1504
  onChange: () => {
1523
1505
  },
1524
- onClick: (h) => {
1525
- if (h.stopPropagation(), m.pending) {
1526
- h.preventDefault();
1506
+ onClick: (f) => {
1507
+ if (f.stopPropagation(), m.pending) {
1508
+ f.preventDefault();
1527
1509
  return;
1528
1510
  }
1529
- m.onCheck({ shift: h.shiftKey, toggle: h.ctrlKey || h.metaKey });
1511
+ m.onCheck({ shift: f.shiftKey, toggle: f.ctrlKey || f.metaKey });
1530
1512
  }
1531
1513
  }
1532
1514
  )
1533
1515
  ] }) : null,
1534
- /* @__PURE__ */ c(
1516
+ /* @__PURE__ */ i(
1535
1517
  "button",
1536
1518
  {
1537
1519
  type: "button",
1538
1520
  className: "cms-mail-row__open",
1539
- "aria-current": d ? "true" : void 0,
1521
+ "aria-current": u ? "true" : void 0,
1540
1522
  onClick: a,
1541
1523
  children: [
1542
- m === void 0 ? r : null,
1543
- /* @__PURE__ */ c("span", { className: "cms-mail-row__body", children: [
1544
- /* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
1524
+ m === void 0 ? h : null,
1525
+ /* @__PURE__ */ i("span", { className: "cms-mail-row__body", children: [
1526
+ /* @__PURE__ */ i("span", { className: "cms-mail-row__line", children: [
1545
1527
  /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
1546
- s ? /* @__PURE__ */ e(L, { name: "paperclip", size: 16, label: f.attachment }) : null,
1547
- /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: i })
1528
+ s ? /* @__PURE__ */ e(L, { name: "paperclip", size: 16, label: p.attachment }) : null,
1529
+ /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: r })
1548
1530
  ] }),
1549
- /* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
1531
+ /* @__PURE__ */ i("span", { className: "cms-mail-row__line", children: [
1550
1532
  /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
1551
- o ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": f.unread }) : null
1533
+ c ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": p.unread }) : null
1552
1534
  ] }),
1553
1535
  /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
1554
1536
  ] })
@@ -1557,49 +1539,49 @@ function ul({ from: n, subject: l, preview: t, time: i, unread: o, hasAttachment
1557
1539
  )
1558
1540
  ] });
1559
1541
  }
1560
- function ml({ direction: n, children: l, time: t, read: i, readLabel: o = "Read" }) {
1561
- return /* @__PURE__ */ c("div", { className: $("cms-bubble", `cms-bubble--${n}`), children: [
1542
+ function Cl({ direction: n, children: l, time: t, read: r, readLabel: c = "Read" }) {
1543
+ return /* @__PURE__ */ i("div", { className: F("cms-bubble", `cms-bubble--${n}`), children: [
1562
1544
  /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
1563
- /* @__PURE__ */ c("div", { className: "cms-bubble__meta", children: [
1545
+ /* @__PURE__ */ i("div", { className: "cms-bubble__meta", children: [
1564
1546
  t,
1565
- n === "out" && i ? /* @__PURE__ */ c(E, { children: [
1547
+ n === "out" && r ? /* @__PURE__ */ i(A, { children: [
1566
1548
  " · ",
1567
- o
1549
+ c
1568
1550
  ] }) : null
1569
1551
  ] })
1570
1552
  ] });
1571
1553
  }
1572
- function hl({ label: n, value: l, onChange: t, onSend: i, onAttach: o, placeholder: s, variant: d = "chat", sendLabel: a = "Send", attachLabel: m = "Attach a file", leading: v, canSend: u }) {
1573
- const f = G(), r = u ?? l.trim() !== "", h = (N) => {
1574
- N.preventDefault(), r && i();
1575
- }, _ = o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: o, children: /* @__PURE__ */ e(L, { name: "paperclip" }) }) : null;
1576
- return /* @__PURE__ */ c("form", { className: $("cms-composer", `cms-composer--${d}`), onSubmit: h, children: [
1577
- /* @__PURE__ */ e("label", { htmlFor: f, className: d === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1578
- d === "chat" ? _ : null,
1554
+ function Sl({ label: n, value: l, onChange: t, onSend: r, onAttach: c, placeholder: s, variant: u = "chat", sendLabel: a = "Send", attachLabel: m = "Attach a file", leading: v, canSend: o }) {
1555
+ const p = se(), h = o ?? l.trim() !== "", f = (g) => {
1556
+ g.preventDefault(), h && r();
1557
+ }, d = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: c, children: /* @__PURE__ */ e(L, { name: "paperclip" }) }) : null;
1558
+ return /* @__PURE__ */ i("form", { className: F("cms-composer", `cms-composer--${u}`), onSubmit: f, children: [
1559
+ /* @__PURE__ */ e("label", { htmlFor: p, className: u === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1560
+ u === "chat" ? d : null,
1579
1561
  /* @__PURE__ */ e(
1580
1562
  "textarea",
1581
1563
  {
1582
- id: f,
1564
+ id: p,
1583
1565
  className: "cms-composer__input",
1584
- rows: d === "reply" ? 3 : 1,
1566
+ rows: u === "reply" ? 3 : 1,
1585
1567
  placeholder: s,
1586
1568
  value: l,
1587
- onChange: (N) => t(N.target.value),
1588
- onKeyDown: (N) => {
1589
- N.nativeEvent.isComposing || N.keyCode === 229 || d === "chat" && N.key === "Enter" && !N.shiftKey && (N.preventDefault(), r && i());
1569
+ onChange: (g) => t(g.target.value),
1570
+ onKeyDown: (g) => {
1571
+ g.nativeEvent.isComposing || g.keyCode === 229 || u === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), h && r());
1590
1572
  }
1591
1573
  }
1592
1574
  ),
1593
- d === "reply" && v !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: v }) : null,
1594
- d === "reply" ? _ : null,
1595
- d === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": a, disabled: !r, children: /* @__PURE__ */ e(L, { name: "send" }) }) : /* @__PURE__ */ c("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !r, children: [
1575
+ u === "reply" && v !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: v }) : null,
1576
+ u === "reply" ? d : null,
1577
+ u === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": a, disabled: !h, children: /* @__PURE__ */ e(L, { name: "send" }) }) : /* @__PURE__ */ i("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !h, children: [
1596
1578
  a,
1597
1579
  " ",
1598
1580
  /* @__PURE__ */ e(L, { name: "send", size: 18 })
1599
1581
  ] })
1600
1582
  ] });
1601
1583
  }
1602
- const Pe = {
1584
+ const He = {
1603
1585
  incomingAudio: "Incoming audio call",
1604
1586
  incomingVideo: "Incoming video call",
1605
1587
  incomingFrom: (n, l) => `${n} from ${l}`,
@@ -1620,25 +1602,25 @@ const Pe = {
1620
1602
  onCallWith: (n) => `On a call with ${n}`,
1621
1603
  returnToCall: "Return to call"
1622
1604
  };
1623
- function fl({ name: n, media: l, onAccept: t, onDecline: i, labels: o }) {
1624
- const s = be(Pe, o), d = l === "video" ? s.incomingVideo : s.incomingAudio;
1625
- return /* @__PURE__ */ c("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(d, n), children: [
1626
- /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ye, { name: n, size: 112 }) }),
1605
+ function El({ name: n, media: l, onAccept: t, onDecline: r, labels: c }) {
1606
+ const s = ye(He, c), u = l === "video" ? s.incomingVideo : s.incomingAudio;
1607
+ return /* @__PURE__ */ i("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(u, n), children: [
1608
+ /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(Se, { name: n, size: 112 }) }),
1627
1609
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
1628
- /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: d }),
1629
- /* @__PURE__ */ c("div", { className: "cms-call-incoming__actions", children: [
1630
- /* @__PURE__ */ e(ce, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: i }),
1631
- /* @__PURE__ */ e(ce, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
1610
+ /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: u }),
1611
+ /* @__PURE__ */ i("div", { className: "cms-call-incoming__actions", children: [
1612
+ /* @__PURE__ */ e(_e, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: r }),
1613
+ /* @__PURE__ */ e(_e, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
1632
1614
  ] })
1633
1615
  ] });
1634
1616
  }
1635
- function ce({ icon: n, label: l, onClick: t, tone: i = "plain", pressed: o }) {
1636
- return /* @__PURE__ */ c(
1617
+ function _e({ icon: n, label: l, onClick: t, tone: r = "plain", pressed: c }) {
1618
+ return /* @__PURE__ */ i(
1637
1619
  "button",
1638
1620
  {
1639
1621
  type: "button",
1640
- className: $("cms-call-button", `cms-call-button--${i}`, o && "is-pressed"),
1641
- "aria-pressed": o,
1622
+ className: F("cms-call-button", `cms-call-button--${r}`, c && "is-pressed"),
1623
+ "aria-pressed": c,
1642
1624
  onClick: t,
1643
1625
  children: [
1644
1626
  /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(L, { name: n, size: 24 }) }),
@@ -1647,64 +1629,64 @@ function ce({ icon: n, label: l, onClick: t, tone: i = "plain", pressed: o }) {
1647
1629
  }
1648
1630
  );
1649
1631
  }
1650
- function pl({ name: n, duration: l, connection: t, you: i, muted: o, speaker: s, onToggleMute: d, onToggleSpeaker: a, onAddPerson: m, onChat: v, onHangUp: u, labels: f }) {
1651
- const r = be(Pe, f);
1652
- return /* @__PURE__ */ c("section", { className: "cms-call-panel", "aria-label": r.callWith(n), children: [
1653
- /* @__PURE__ */ c("div", { className: "cms-call-panel__head", children: [
1654
- /* @__PURE__ */ e(ye, { name: n, size: 64 }),
1655
- /* @__PURE__ */ c("div", { className: "cms-call-panel__who", children: [
1632
+ function Al({ name: n, duration: l, connection: t, you: r, muted: c, speaker: s, onToggleMute: u, onToggleSpeaker: a, onAddPerson: m, onChat: v, onHangUp: o, labels: p }) {
1633
+ const h = ye(He, p);
1634
+ return /* @__PURE__ */ i("section", { className: "cms-call-panel", "aria-label": h.callWith(n), children: [
1635
+ /* @__PURE__ */ i("div", { className: "cms-call-panel__head", children: [
1636
+ /* @__PURE__ */ e(Se, { name: n, size: 64 }),
1637
+ /* @__PURE__ */ i("div", { className: "cms-call-panel__who", children: [
1656
1638
  /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1657
- /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": r.callTime(l), children: l })
1639
+ /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": h.callTime(l), children: l })
1658
1640
  ] }),
1659
- /* @__PURE__ */ e("span", { className: $("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? r.goodConnection : r.poorConnection })
1641
+ /* @__PURE__ */ e("span", { className: F("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? h.goodConnection : h.poorConnection })
1660
1642
  ] }),
1661
- /* @__PURE__ */ c("div", { className: "cms-call-panel__you", children: [
1662
- /* @__PURE__ */ e(ye, { name: i.name, size: 36 }),
1663
- /* @__PURE__ */ e("span", { children: r.you }),
1664
- i.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": r.speaking }) : null
1643
+ /* @__PURE__ */ i("div", { className: "cms-call-panel__you", children: [
1644
+ /* @__PURE__ */ e(Se, { name: r.name, size: 36 }),
1645
+ /* @__PURE__ */ e("span", { children: h.you }),
1646
+ r.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": h.speaking }) : null
1665
1647
  ] }),
1666
- /* @__PURE__ */ c("div", { className: "cms-call-panel__controls", children: [
1667
- /* @__PURE__ */ e(ce, { icon: "mic", label: o ? r.unmute : r.mute, pressed: o, onClick: d }),
1668
- /* @__PURE__ */ e(ce, { icon: "speaker", label: r.speaker, pressed: s, onClick: a }),
1669
- m ? /* @__PURE__ */ e(ce, { icon: "user-plus", label: r.addPerson, onClick: m }) : null,
1670
- v ? /* @__PURE__ */ e(ce, { icon: "chat", label: r.chat, onClick: v }) : null,
1671
- /* @__PURE__ */ e(ce, { icon: "phone-off", label: r.hangUp, tone: "hang-up", onClick: u })
1648
+ /* @__PURE__ */ i("div", { className: "cms-call-panel__controls", children: [
1649
+ /* @__PURE__ */ e(_e, { icon: "mic", label: c ? h.unmute : h.mute, pressed: c, onClick: u }),
1650
+ /* @__PURE__ */ e(_e, { icon: "speaker", label: h.speaker, pressed: s, onClick: a }),
1651
+ m ? /* @__PURE__ */ e(_e, { icon: "user-plus", label: h.addPerson, onClick: m }) : null,
1652
+ v ? /* @__PURE__ */ e(_e, { icon: "chat", label: h.chat, onClick: v }) : null,
1653
+ /* @__PURE__ */ e(_e, { icon: "phone-off", label: h.hangUp, tone: "hang-up", onClick: o })
1672
1654
  ] })
1673
1655
  ] });
1674
1656
  }
1675
- function bl({ name: n, duration: l, muted: t, onToggleMute: i, onReturn: o, onHangUp: s, labels: d }) {
1676
- const a = be(Pe, d);
1677
- return /* @__PURE__ */ c("section", { className: "cms-call-bar", "aria-label": a.callWith(n), children: [
1657
+ function Tl({ name: n, duration: l, muted: t, onToggleMute: r, onReturn: c, onHangUp: s, labels: u }) {
1658
+ const a = ye(He, u);
1659
+ return /* @__PURE__ */ i("section", { className: "cms-call-bar", "aria-label": a.callWith(n), children: [
1678
1660
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1679
1661
  /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: a.onCallWith(n) }),
1680
1662
  /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
1681
- /* @__PURE__ */ c("span", { className: "cms-call-bar__actions", children: [
1682
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? a.unmute : a.mute, "aria-pressed": t, onClick: i, children: /* @__PURE__ */ e(L, { name: "mic" }) }),
1683
- /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: o, children: a.returnToCall }),
1663
+ /* @__PURE__ */ i("span", { className: "cms-call-bar__actions", children: [
1664
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? a.unmute : a.mute, "aria-pressed": t, onClick: r, children: /* @__PURE__ */ e(L, { name: "mic" }) }),
1665
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children: a.returnToCall }),
1684
1666
  /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": a.hangUp, onClick: s, children: /* @__PURE__ */ e(L, { name: "phone-off" }) })
1685
1667
  ] })
1686
1668
  ] });
1687
1669
  }
1688
- function _l({ mark: n, product: l, headline: t, lead: i, features: o = [], children: s }) {
1689
- return /* @__PURE__ */ c("div", { className: "cms-signin", children: [
1690
- /* @__PURE__ */ c("aside", { className: "cms-signin__brand", children: [
1691
- /* @__PURE__ */ c("p", { className: "cms-signin__logo", children: [
1670
+ function Dl({ mark: n, product: l, headline: t, lead: r, features: c = [], children: s }) {
1671
+ return /* @__PURE__ */ i("div", { className: "cms-signin", children: [
1672
+ /* @__PURE__ */ i("aside", { className: "cms-signin__brand", children: [
1673
+ /* @__PURE__ */ i("p", { className: "cms-signin__logo", children: [
1692
1674
  /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
1693
1675
  l
1694
1676
  ] }),
1695
- /* @__PURE__ */ c("div", { className: "cms-signin__pitch", children: [
1677
+ /* @__PURE__ */ i("div", { className: "cms-signin__pitch", children: [
1696
1678
  /* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
1697
- /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: i }),
1698
- o.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: o.map((d) => /* @__PURE__ */ c("li", { children: [
1699
- /* @__PURE__ */ e(L, { name: d.icon, size: 18 }),
1700
- d.label
1701
- ] }, d.label)) }) : null
1679
+ /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: r }),
1680
+ c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((u) => /* @__PURE__ */ i("li", { children: [
1681
+ /* @__PURE__ */ e(L, { name: u.icon, size: 18 }),
1682
+ u.label
1683
+ ] }, u.label)) }) : null
1702
1684
  ] })
1703
1685
  ] }),
1704
1686
  /* @__PURE__ */ e("main", { className: "cms-signin__form", children: s })
1705
1687
  ] });
1706
1688
  }
1707
- const Ln = {
1689
+ const Un = {
1708
1690
  title: "Sign in",
1709
1691
  identifier: "Email or username",
1710
1692
  identifierPlaceholder: "name@example.com",
@@ -1716,13 +1698,13 @@ const Ln = {
1716
1698
  newHere: "New here?",
1717
1699
  create: "Create an account"
1718
1700
  };
1719
- function vl({ server: n, onSubmit: l, forgotHref: t, createHref: i, error: o, busy: s, labels: d }) {
1720
- const a = be(Ln, d), m = G(), [v, u] = A(""), [f, r] = A(""), [h, _] = A(!1);
1721
- return /* @__PURE__ */ c("form", { className: "cms-signin-form", onSubmit: (y) => {
1722
- y.preventDefault(), l(v, f);
1723
- }, "aria-describedby": o ? `${m}-error` : void 0, children: [
1701
+ function Ll({ server: n, onSubmit: l, forgotHref: t, createHref: r, error: c, busy: s, labels: u }) {
1702
+ const a = ye(Un, u), m = se(), [v, o] = T(""), [p, h] = T(""), [f, d] = T(!1);
1703
+ return /* @__PURE__ */ i("form", { className: "cms-signin-form", onSubmit: (k) => {
1704
+ k.preventDefault(), l(v, p);
1705
+ }, "aria-describedby": c ? `${m}-error` : void 0, children: [
1724
1706
  /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: a.title }),
1725
- /* @__PURE__ */ c("p", { className: "cms-signin-form__server", children: [
1707
+ /* @__PURE__ */ i("p", { className: "cms-signin-form__server", children: [
1726
1708
  /* @__PURE__ */ e(L, { name: "server", size: 18 }),
1727
1709
  n
1728
1710
  ] }),
@@ -1736,307 +1718,399 @@ function vl({ server: n, onSubmit: l, forgotHref: t, createHref: i, error: o, bu
1736
1718
  autoComplete: "username",
1737
1719
  placeholder: a.identifierPlaceholder,
1738
1720
  value: v,
1739
- onChange: (y) => u(y.target.value),
1721
+ onChange: (k) => o(k.target.value),
1740
1722
  required: !0
1741
1723
  }
1742
1724
  ),
1743
1725
  /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children: a.password }),
1744
- /* @__PURE__ */ c("span", { className: "cms-signin-form__password", children: [
1726
+ /* @__PURE__ */ i("span", { className: "cms-signin-form__password", children: [
1745
1727
  /* @__PURE__ */ e(
1746
1728
  "input",
1747
1729
  {
1748
1730
  id: `${m}-password`,
1749
1731
  className: "cms-signin-form__input",
1750
- type: h ? "text" : "password",
1732
+ type: f ? "text" : "password",
1751
1733
  autoComplete: "current-password",
1752
- value: f,
1753
- onChange: (y) => r(y.target.value),
1734
+ value: p,
1735
+ onChange: (k) => h(k.target.value),
1754
1736
  required: !0
1755
1737
  }
1756
1738
  ),
1757
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": h, onClick: () => _((y) => !y), children: h ? a.hide : a.show })
1739
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => d((k) => !k), children: f ? a.hide : a.show })
1758
1740
  ] }),
1759
1741
  t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: a.forgot }) : null,
1760
- o ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: o }) : null,
1742
+ c ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: c }) : null,
1761
1743
  /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: a.submit }),
1762
- i ? /* @__PURE__ */ c(E, { children: [
1744
+ r ? /* @__PURE__ */ i(A, { children: [
1763
1745
  /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: a.newHere }) }),
1764
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: i, children: a.create })
1746
+ /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: r, children: a.create })
1765
1747
  ] }) : null
1766
1748
  ] });
1767
1749
  }
1768
- const He = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, Oe = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
1769
- function $n(n) {
1750
+ const zn = { name: (n, l) => `${n}: ${l}` };
1751
+ function Xe(n) {
1752
+ const l = Oe(n);
1753
+ return l === Ue(n.options, n.defaultValue) ? null : l ?? null;
1754
+ }
1755
+ function Oe({ options: n, value: l, defaultValue: t }) {
1756
+ return n.find((r) => r.id === l) ?? Ue(n, t);
1757
+ }
1758
+ function Je(n) {
1759
+ var l;
1760
+ return ye(zn, n.labels).name(n.label, ((l = Oe(n)) == null ? void 0 : l.label) ?? "");
1761
+ }
1762
+ function Qe(n, l) {
1763
+ const t = Oe(n);
1764
+ return n.options.map((r) => ({
1765
+ id: r.id,
1766
+ label: r.label,
1767
+ offer: { offered: !0, locked: !1 },
1768
+ checked: r === t,
1769
+ ...l === void 0 ? {} : { group: l },
1770
+ onSelect: () => {
1771
+ r !== t && n.onChange(r.id);
1772
+ }
1773
+ }));
1774
+ }
1775
+ function Ue(n, l) {
1776
+ return n.find((t) => t.id === l) ?? n[0];
1777
+ }
1778
+ function en(n) {
1779
+ var s;
1780
+ const l = H(null), t = (n == null ? void 0 : n.value) ?? null, c = n === void 0 || n.options.some((u) => u.id === n.value) ? null : ((s = Ue(n.options, n.defaultValue)) == null ? void 0 : s.id) ?? null;
1781
+ Q(() => {
1782
+ c === null ? l.current = null : l.current !== t && (l.current = t, n == null || n.onChange(c));
1783
+ }, [c, t]);
1784
+ }
1785
+ function nn({ iconOnly: n = !1, onOpenChange: l, ...t }) {
1786
+ return t.options.length < 2 ? null : /* @__PURE__ */ e(Kn, { ...t, iconOnly: n, onOpenChange: l });
1787
+ }
1788
+ function Kn({ iconOnly: n, onOpenChange: l, ...t }) {
1789
+ const [r, c] = T(null), s = be(() => c(null), []), u = H(!1), a = r !== null;
1790
+ Q(() => (l == null || l(a), () => l == null ? void 0 : l(!1)), [a, l]);
1791
+ const m = Xe(t), v = m !== null && !n, o = Je(t), p = (h, f) => {
1792
+ const d = h.getBoundingClientRect();
1793
+ c({ x: d.left, y: d.bottom + 4, focus: f });
1794
+ };
1795
+ return /* @__PURE__ */ i(A, { children: [
1796
+ /* @__PURE__ */ e(
1797
+ "button",
1798
+ {
1799
+ type: "button",
1800
+ className: F("cms-filter-menu", m !== null && "cms-filter-menu--active", v && "cms-filter-menu--named"),
1801
+ "aria-haspopup": "menu",
1802
+ "aria-expanded": a,
1803
+ "aria-label": o,
1804
+ title: o,
1805
+ onMouseDown: () => {
1806
+ u.current = a;
1807
+ },
1808
+ onClick: (h) => {
1809
+ a || u.current ? s() : p(h.currentTarget, "current"), u.current = !1;
1810
+ },
1811
+ onKeyDown: (h) => {
1812
+ u.current = !1, (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), p(h.currentTarget, h.key === "ArrowUp" ? "last" : "current"));
1813
+ },
1814
+ children: v ? /* @__PURE__ */ i(A, { children: [
1815
+ /* @__PURE__ */ e("span", { className: "cms-filter-menu__choice", children: m.label }),
1816
+ /* @__PURE__ */ e(L, { name: "chevron-down", size: 16 })
1817
+ ] }) : /* @__PURE__ */ e(L, { name: "funnel" })
1818
+ }
1819
+ ),
1820
+ /* @__PURE__ */ e(
1821
+ ge,
1822
+ {
1823
+ at: r,
1824
+ items: Qe(t),
1825
+ onClose: s,
1826
+ label: t.label,
1827
+ focus: r == null ? void 0 : r.focus
1828
+ }
1829
+ )
1830
+ ] });
1831
+ }
1832
+ function Vn(n) {
1833
+ return en(n), /* @__PURE__ */ e(nn, { ...n });
1834
+ }
1835
+ function $l({ leading: n, name: l, filter: t }) {
1836
+ return /* @__PURE__ */ i("div", { className: "cms-list-head", children: [
1837
+ n != null ? /* @__PURE__ */ e("span", { className: "cms-list-head__leading", children: n }) : null,
1838
+ /* @__PURE__ */ e("h2", { className: "cms-list-head__name", title: l, children: l }),
1839
+ t !== void 0 ? /* @__PURE__ */ e(Vn, { ...t }) : null
1840
+ ] });
1841
+ }
1842
+ const Ze = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, We = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
1843
+ function Zn(n) {
1770
1844
  const l = /* @__PURE__ */ new Map();
1771
1845
  for (const t of n) l.set(t.group, [...l.get(t.group) ?? [], t]);
1772
1846
  return [...l.values()];
1773
1847
  }
1774
- function In(n) {
1848
+ function Wn(n) {
1775
1849
  const l = /* @__PURE__ */ new Map();
1776
1850
  for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
1777
- return [...l.entries()].sort(([t], [i]) => t - i).map(([, t]) => t);
1778
- }
1779
- function gl({ label: n, actions: l, onAction: t, status: i, moreLabel: o, leading: s }) {
1780
- const d = l.filter((p) => p.entries === void 0 || p.entries.length > 0), a = H(null), m = H(null), v = H(null), [u, f] = A(He), [r, h] = A(null), [_, N] = A("first"), [y, k] = A(null), [C, M] = A(null), b = $n(d), w = In(d), T = b.flat(), O = T.filter((p) => p.overflow === 0), U = T.filter((p) => p.overflow !== 0), x = JSON.stringify([d.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.entries !== void 0]), i ?? "", s !== void 0]), D = we(() => {
1781
- const p = a.current, I = m.current;
1782
- if (p === null || I === null) return;
1783
- const K = getComputedStyle(p), X = parseFloat(K.columnGap || "0") || 0, P = p.clientWidth - (parseFloat(K.paddingLeft) || 0) - (parseFloat(K.paddingRight) || 0), j = (F) => {
1784
- var Z;
1785
- return ((Z = I.querySelector(F)) == null ? void 0 : Z.getBoundingClientRect().width) ?? 0;
1786
- }, g = j('[data-measure="leading"]'), S = j('[data-measure="separator"]'), R = j('[data-measure="more"]'), W = (F, Z) => j(`[data-measure="${Z ? "full" : "icon"}"][data-measure-action="${CSS.escape(F)}"]`), ue = (F, Z) => {
1787
- const ee = /* @__PURE__ */ new Set([...O.map((ie) => ie.id), ...Z]), oe = b.map((ie) => ie.filter((Ne) => !ee.has(Ne.id))).filter((ie) => ie.length > 0), ge = oe.flat(), We = ge.length + (oe.length - 1) + (ee.size > 0 ? 1 : 0) + (g > 0 ? 1 : 0);
1788
- return g + ge.reduce((ie, Ne) => ie + W(Ne.id, !F.has(Ne.id)), 0) + S * Math.max(0, oe.length - 1) + (ee.size > 0 ? R : 0) + X * Math.max(0, We - 1);
1789
- }, Fe = U.filter((F) => !w.some((Z) => Z.includes(F.id))).map((F) => F.id), Ve = [...w, ...[...Fe].reverse().map((F) => [F])];
1790
- let me = null;
1791
- if (ue(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= P) me = He;
1851
+ return [...l.entries()].sort(([t], [r]) => t - r).map(([, t]) => t);
1852
+ }
1853
+ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leading: s }) {
1854
+ const u = l.filter((_) => _.entries === void 0 || _.entries.length > 0), a = H(null), m = H(null), v = H(null), [o, p] = T(Ze), [h, f] = T(null), [d, g] = T("first"), [k, x] = T(null), [C, w] = T(null), b = Zn(u), y = Wn(u), D = b.flat(), Z = D.filter((_) => _.overflow === 0), V = D.filter((_) => _.overflow !== 0), M = JSON.stringify([u.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null, _.entries !== void 0]), r ?? "", s !== void 0]), R = be(() => {
1855
+ const _ = a.current, $ = m.current;
1856
+ if (_ === null || $ === null) return;
1857
+ const B = getComputedStyle(_), ne = parseFloat(B.columnGap || "0") || 0, I = _.clientWidth - (parseFloat(B.paddingLeft) || 0) - (parseFloat(B.paddingRight) || 0), X = (E) => {
1858
+ var K;
1859
+ return ((K = $.querySelector(E)) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
1860
+ }, N = X('[data-measure="leading"]'), S = X('[data-measure="separator"]'), O = X('[data-measure="more"]'), Y = (E, K) => X(`[data-measure="${K ? "full" : "icon"}"][data-measure-action="${CSS.escape(E)}"]`), de = (E, K) => {
1861
+ const W = /* @__PURE__ */ new Set([...Z.map((ce) => ce.id), ...K]), te = b.map((ce) => ce.filter((Ne) => !W.has(Ne.id))).filter((ce) => ce.length > 0), pe = te.flat(), Ce = pe.length + (te.length - 1) + (W.size > 0 ? 1 : 0) + (N > 0 ? 1 : 0);
1862
+ return N + pe.reduce((ce, Ne) => ce + Y(Ne.id, !E.has(Ne.id)), 0) + S * Math.max(0, te.length - 1) + (W.size > 0 ? O : 0) + ne * Math.max(0, Ce - 1);
1863
+ }, Me = V.filter((E) => !y.some((K) => K.includes(E.id))).map((E) => E.id), Ee = [...y, ...[...Me].reverse().map((E) => [E])];
1864
+ let ue = null;
1865
+ if (de(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= I) ue = Ze;
1792
1866
  else {
1793
- const F = /* @__PURE__ */ new Set();
1794
- for (const Z of Ve) {
1795
- for (const ee of Z) F.add(ee);
1796
- if (ue(F, /* @__PURE__ */ new Set()) <= P) {
1797
- me = { bare: F, hidden: /* @__PURE__ */ new Set() };
1867
+ const E = /* @__PURE__ */ new Set();
1868
+ for (const K of Ee) {
1869
+ for (const W of K) E.add(W);
1870
+ if (de(E, /* @__PURE__ */ new Set()) <= I) {
1871
+ ue = { bare: E, hidden: /* @__PURE__ */ new Set() };
1798
1872
  break;
1799
1873
  }
1800
1874
  }
1801
1875
  }
1802
- if (me === null) {
1803
- const F = new Set(U.map((ee) => ee.id)), Z = /* @__PURE__ */ new Set();
1804
- for (const ee of w) {
1805
- for (const oe of ee) U.some((ge) => ge.id === oe) && Z.add(oe);
1806
- if (Z.size >= 2 && ue(F, Z) <= P) break;
1876
+ if (ue === null) {
1877
+ const E = new Set(V.map((W) => W.id)), K = /* @__PURE__ */ new Set();
1878
+ for (const W of y) {
1879
+ for (const te of W) V.some((pe) => pe.id === te) && K.add(te);
1880
+ if (K.size >= 2 && de(E, K) <= I) break;
1807
1881
  }
1808
- if (ue(F, Z) > P) {
1809
- for (const ee of [...Fe].reverse())
1810
- if (Z.add(ee), ue(F, Z) <= P) break;
1882
+ if (de(E, K) > I) {
1883
+ for (const W of [...Me].reverse())
1884
+ if (K.add(W), de(E, K) <= I) break;
1811
1885
  }
1812
- me = { bare: F, hidden: Z };
1886
+ ue = { bare: E, hidden: K };
1813
1887
  }
1814
- const xe = me;
1815
- f((F) => Oe(F.bare, xe.bare) && Oe(F.hidden, xe.hidden) ? F : xe);
1816
- }, [x]);
1817
- fe(D, [D]), Y(() => {
1818
- const p = a.current;
1819
- if (p === null || typeof ResizeObserver > "u") return;
1820
- const I = new ResizeObserver(() => D());
1821
- return I.observe(p), () => I.disconnect();
1822
- }, [D]);
1823
- const B = /* @__PURE__ */ new Set([...O.map((p) => p.id), ...u.hidden]), z = b.map((p) => p.filter((I) => !B.has(I.id))).filter((p) => p.length > 0).flat(), J = [
1824
- ...O,
1825
- ...w.flat().map((p) => T.find((I) => I.id === p)).filter((p) => p !== void 0 && u.hidden.has(p.id)),
1888
+ const P = ue;
1889
+ p((E) => We(E.bare, P.bare) && We(E.hidden, P.hidden) ? E : P);
1890
+ }, [M]);
1891
+ ve(R, [R]), Q(() => {
1892
+ const _ = a.current;
1893
+ if (_ === null || typeof ResizeObserver > "u") return;
1894
+ const $ = new ResizeObserver(() => R());
1895
+ return $.observe(_), () => $.disconnect();
1896
+ }, [R]);
1897
+ const z = /* @__PURE__ */ new Set([...Z.map((_) => _.id), ...o.hidden]), U = b.map((_) => _.filter(($) => !z.has($.id))).filter((_) => _.length > 0).flat(), j = [
1898
+ ...Z,
1899
+ ...y.flat().map((_) => D.find(($) => $.id === _)).filter((_) => _ !== void 0 && o.hidden.has(_.id)),
1826
1900
  // The pinned that a row too narrow for them sent behind ..., in the row's order.
1827
- ...U.filter((p) => u.hidden.has(p.id) && !w.some((I) => I.includes(p.id)))
1828
- ], Q = new Set(U.filter((p) => !w.some((I) => I.includes(p.id))).map((p) => p.id)), ne = [...z.map((p) => p.id), ...J.length > 0 ? ["more"] : []], re = y !== null && ne.includes(y) ? y : ne[0] ?? null, _e = (p) => {
1829
- var P, j;
1830
- const I = ne.indexOf(re ?? "");
1831
- let K = null;
1832
- if (p.key === "ArrowRight" ? K = Math.min(ne.length - 1, I + 1) : p.key === "ArrowLeft" ? K = Math.max(0, I - 1) : p.key === "Home" ? K = 0 : p.key === "End" ? K = ne.length - 1 : p.key === "Escape" && M(re), K === null) return;
1833
- p.preventDefault();
1834
- const X = ne[K] ?? null;
1835
- k(X), (j = (P = a.current) == null ? void 0 : P.querySelector(`[data-stop="${CSS.escape(X ?? "")}"]`)) == null || j.focus();
1836
- }, ve = J.map((p) => ({
1837
- id: p.id,
1838
- label: /* @__PURE__ */ c(E, { children: [
1839
- /* @__PURE__ */ e(he, { name: p.icon }),
1840
- p.label
1901
+ ...V.filter((_) => o.hidden.has(_.id) && !y.some(($) => $.includes(_.id)))
1902
+ ], le = new Set(V.filter((_) => !y.some(($) => $.includes(_.id))).map((_) => _.id)), ae = [...U.map((_) => _.id), ...j.length > 0 ? ["more"] : []], re = k !== null && ae.includes(k) ? k : ae[0] ?? null, ie = (_) => {
1903
+ var I, X;
1904
+ const $ = ae.indexOf(re ?? "");
1905
+ let B = null;
1906
+ if (_.key === "ArrowRight" ? B = Math.min(ae.length - 1, $ + 1) : _.key === "ArrowLeft" ? B = Math.max(0, $ - 1) : _.key === "Home" ? B = 0 : _.key === "End" ? B = ae.length - 1 : _.key === "Escape" && w(re), B === null) return;
1907
+ _.preventDefault();
1908
+ const ne = ae[B] ?? null;
1909
+ x(ne), (X = (I = a.current) == null ? void 0 : I.querySelector(`[data-stop="${CSS.escape(ne ?? "")}"]`)) == null || X.focus();
1910
+ }, oe = j.map((_) => ({
1911
+ id: _.id,
1912
+ label: /* @__PURE__ */ i(A, { children: [
1913
+ /* @__PURE__ */ e(xe, { name: _.icon }),
1914
+ _.label
1841
1915
  ] }),
1842
- offer: p.disabled ? { offered: !0, locked: !1, refusal: p.reason ?? "" } : { offered: !0, locked: !1 },
1843
- ...p.danger ? { danger: !0 } : {},
1916
+ offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
1917
+ ..._.danger ? { danger: !0 } : {},
1844
1918
  onSelect: () => {
1845
- var K;
1846
- if (p.disabled || p.busy) return;
1847
- if (p.entries === void 0) {
1848
- t(p.id);
1919
+ var B;
1920
+ if (_.disabled || _.busy) return;
1921
+ if (_.entries === void 0) {
1922
+ t(_.id);
1849
1923
  return;
1850
1924
  }
1851
- const I = (K = v.current) == null ? void 0 : K.getBoundingClientRect();
1852
- N("first"), h({ which: p.id, x: (I == null ? void 0 : I.left) ?? 0, y: (I == null ? void 0 : I.bottom) ?? 0 });
1925
+ const $ = (B = v.current) == null ? void 0 : B.getBoundingClientRect();
1926
+ g("first"), f({ which: _.id, x: ($ == null ? void 0 : $.left) ?? 0, y: ($ == null ? void 0 : $.bottom) ?? 0 });
1853
1927
  }
1854
- })), le = r === null || r.which === "more" ? void 0 : T.find((p) => p.id === r.which), ke = ((le == null ? void 0 : le.entries) ?? []).map((p) => ({
1855
- id: p.id,
1856
- label: /* @__PURE__ */ c(E, { children: [
1857
- p.icon !== void 0 ? /* @__PURE__ */ e(he, { name: p.icon }) : null,
1858
- p.label
1928
+ })), J = h === null || h.which === "more" ? void 0 : D.find((_) => _.id === h.which), fe = ((J == null ? void 0 : J.entries) ?? []).map((_) => ({
1929
+ id: _.id,
1930
+ label: /* @__PURE__ */ i(A, { children: [
1931
+ _.icon !== void 0 ? /* @__PURE__ */ e(xe, { name: _.icon }) : null,
1932
+ _.label
1859
1933
  ] }),
1860
- offer: p.disabled ? { offered: !0, locked: !1, refusal: p.reason ?? "" } : { offered: !0, locked: !1 },
1861
- ...p.danger ? { danger: !0 } : {},
1934
+ offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
1935
+ ..._.danger ? { danger: !0 } : {},
1862
1936
  onSelect: () => {
1863
- p.disabled || t(p.id);
1937
+ _.disabled || t(_.id);
1864
1938
  }
1865
- })), te = (p, I, K) => {
1866
- const X = I.getBoundingClientRect();
1867
- N(K), h({ which: p, x: X.left, y: X.bottom });
1939
+ })), ee = (_, $, B) => {
1940
+ const ne = $.getBoundingClientRect();
1941
+ g(B), f({ which: _, x: ne.left, y: ne.bottom });
1868
1942
  };
1869
- return /* @__PURE__ */ c(
1943
+ return /* @__PURE__ */ i(
1870
1944
  "div",
1871
1945
  {
1872
1946
  ref: a,
1873
1947
  role: "toolbar",
1874
1948
  "aria-label": n,
1875
- className: $(
1949
+ className: F(
1876
1950
  "cms-pane-toolbar",
1877
- U.length > 0 && u.bare.size >= U.length && "cms-pane-toolbar--labels-hidden",
1878
- u.bare.size > 0 && u.bare.size < U.length && "cms-pane-toolbar--labels-partly-hidden"
1951
+ V.length > 0 && o.bare.size >= V.length && "cms-pane-toolbar--labels-hidden",
1952
+ o.bare.size > 0 && o.bare.size < V.length && "cms-pane-toolbar--labels-partly-hidden"
1879
1953
  ),
1880
- onKeyDown: _e,
1954
+ onKeyDown: ie,
1881
1955
  children: [
1882
1956
  s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
1883
- b.map((p, I) => {
1884
- const K = p.filter((P) => !B.has(P.id)), X = b.slice(0, I).some((P) => P.some((j) => !B.has(j.id)));
1885
- return /* @__PURE__ */ c("div", { className: "cms-pane-toolbar__group-wrap", children: [
1886
- K.length > 0 && X ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1887
- /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: K.length === 0, children: p.map((P) => /* @__PURE__ */ e(
1888
- Pn,
1957
+ b.map((_, $) => {
1958
+ const B = _.filter((I) => !z.has(I.id)), ne = b.slice(0, $).some((I) => I.some((X) => !z.has(X.id)));
1959
+ return /* @__PURE__ */ i("div", { className: "cms-pane-toolbar__group-wrap", children: [
1960
+ B.length > 0 && ne ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1961
+ /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: B.length === 0, children: _.map((I) => /* @__PURE__ */ e(
1962
+ qn,
1889
1963
  {
1890
- action: P,
1891
- labels: !u.bare.has(P.id),
1892
- overflowed: B.has(P.id),
1893
- pinned: Q.has(P.id),
1894
- tabbable: re === P.id,
1895
- tipOff: C === P.id,
1896
- menuOpen: (r == null ? void 0 : r.which) === P.id,
1897
- onChoose: (j, g) => {
1898
- P.entries === void 0 ? t(P.id) : (r == null ? void 0 : r.which) === P.id && g === null ? h(null) : te(P.id, j, g ?? "first");
1964
+ action: I,
1965
+ labels: !o.bare.has(I.id),
1966
+ overflowed: z.has(I.id),
1967
+ pinned: le.has(I.id),
1968
+ tabbable: re === I.id,
1969
+ tipOff: C === I.id,
1970
+ menuOpen: (h == null ? void 0 : h.which) === I.id,
1971
+ onChoose: (X, N) => {
1972
+ I.entries === void 0 ? t(I.id) : (h == null ? void 0 : h.which) === I.id && N === null ? f(null) : ee(I.id, X, N ?? "first");
1899
1973
  },
1900
1974
  onFocus: () => {
1901
- k(P.id), M(null);
1975
+ x(I.id), w(null);
1902
1976
  }
1903
1977
  },
1904
- P.id
1978
+ I.id
1905
1979
  )) })
1906
- ] }, I);
1980
+ ] }, $);
1907
1981
  }),
1908
- J.length > 0 ? /* @__PURE__ */ e(
1982
+ j.length > 0 ? /* @__PURE__ */ e(
1909
1983
  "button",
1910
1984
  {
1911
1985
  ref: v,
1912
1986
  type: "button",
1913
1987
  className: "cms-icon-button cms-pane-toolbar__more",
1914
1988
  "data-stop": "more",
1915
- "aria-label": o,
1916
- title: o,
1989
+ "aria-label": c,
1990
+ title: c,
1917
1991
  "aria-haspopup": "menu",
1918
- "aria-expanded": (r == null ? void 0 : r.which) === "more",
1992
+ "aria-expanded": (h == null ? void 0 : h.which) === "more",
1919
1993
  tabIndex: re === "more" ? 0 : -1,
1920
- onFocus: () => k("more"),
1921
- onClick: (p) => {
1922
- (r == null ? void 0 : r.which) === "more" ? h(null) : te("more", p.currentTarget, "first");
1994
+ onFocus: () => x("more"),
1995
+ onClick: (_) => {
1996
+ (h == null ? void 0 : h.which) === "more" ? f(null) : ee("more", _.currentTarget, "first");
1923
1997
  },
1924
- onKeyDown: (p) => {
1925
- (p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), te("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
1998
+ onKeyDown: (_) => {
1999
+ (_.key === "ArrowDown" || _.key === "ArrowUp") && (_.preventDefault(), _.stopPropagation(), ee("more", _.currentTarget, _.key === "ArrowUp" ? "last" : "first"));
1926
2000
  },
1927
2001
  children: /* @__PURE__ */ e(L, { name: "more" })
1928
2002
  }
1929
2003
  ) : null,
1930
- i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: i, children: i }) : null,
1931
- /* @__PURE__ */ e(pe, { at: (r == null ? void 0 : r.which) === "more" ? r : null, items: ve, onClose: () => h(null), label: o, focus: _ }),
1932
- /* @__PURE__ */ e(pe, { at: le !== void 0 ? r : null, items: ke, onClose: () => h(null), label: (le == null ? void 0 : le.label) ?? "", focus: _ }),
1933
- /* @__PURE__ */ c("div", { ref: m, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
2004
+ r !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: r, children: r }) : null,
2005
+ /* @__PURE__ */ e(ge, { at: (h == null ? void 0 : h.which) === "more" ? h : null, items: oe, onClose: () => f(null), label: c, focus: d }),
2006
+ /* @__PURE__ */ e(ge, { at: J !== void 0 ? h : null, items: fe, onClose: () => f(null), label: (J == null ? void 0 : J.label) ?? "", focus: d }),
2007
+ /* @__PURE__ */ i("div", { ref: m, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1934
2008
  s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
1935
2009
  /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
1936
2010
  /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(L, { name: "more" }) }),
1937
- T.map((p) => /* @__PURE__ */ c("span", { children: [
1938
- /* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-action": p.id, className: $("cms-pane-toolbar__action", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
1939
- /* @__PURE__ */ e(he, { name: p.icon }),
1940
- /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: p.label }),
1941
- p.entries !== void 0 ? /* @__PURE__ */ e(Ae, {}) : null
2011
+ D.map((_) => /* @__PURE__ */ i("span", { children: [
2012
+ /* @__PURE__ */ i("span", { "data-measure": "full", "data-measure-action": _.id, className: F("cms-pane-toolbar__action", _.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2013
+ /* @__PURE__ */ e(xe, { name: _.icon }),
2014
+ /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }),
2015
+ _.entries !== void 0 ? /* @__PURE__ */ e($e, {}) : null
1942
2016
  ] }),
1943
- /* @__PURE__ */ c("span", { "data-measure": "icon", "data-measure-action": p.id, className: $("cms-pane-toolbar__action", de(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
1944
- de(p.icon) !== null ? /* @__PURE__ */ e(he, { name: p.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: p.label }),
1945
- p.entries !== void 0 ? /* @__PURE__ */ e(Ae, {}) : null
2017
+ /* @__PURE__ */ i("span", { "data-measure": "icon", "data-measure-action": _.id, className: F("cms-pane-toolbar__action", we(_.icon) !== null && "cms-pane-toolbar__action--bare", _.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2018
+ we(_.icon) !== null ? /* @__PURE__ */ e(xe, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }),
2019
+ _.entries !== void 0 ? /* @__PURE__ */ e($e, {}) : null
1946
2020
  ] })
1947
- ] }, p.id))
2021
+ ] }, _.id))
1948
2022
  ] })
1949
2023
  ]
1950
2024
  }
1951
2025
  );
1952
2026
  }
1953
- function Pn({ action: n, labels: l, overflowed: t, pinned: i, tabbable: o, tipOff: s, menuOpen: d, onChoose: a, onFocus: m }) {
1954
- const [v, u] = A(!1);
1955
- Y(() => {
2027
+ function qn({ action: n, labels: l, overflowed: t, pinned: r, tabbable: c, tipOff: s, menuOpen: u, onChoose: a, onFocus: m }) {
2028
+ const [v, o] = T(!1);
2029
+ Q(() => {
1956
2030
  if (!n.busy) {
1957
- u(!1);
2031
+ o(!1);
1958
2032
  return;
1959
2033
  }
1960
- const M = setTimeout(() => u(!0), Ce);
1961
- return () => clearTimeout(M);
2034
+ const w = setTimeout(() => o(!0), Te);
2035
+ return () => clearTimeout(w);
1962
2036
  }, [n.busy]);
1963
- const f = de(n.icon) === null, r = l || f, h = n.disabled && n.reason ? n.reason : null, _ = h ?? (r ? null : n.label), N = G(), [y, k] = A(!1), C = n.entries !== void 0;
1964
- return /* @__PURE__ */ c(
2037
+ const p = we(n.icon) === null, h = l || p, f = n.disabled && n.reason ? n.reason : null, d = f ?? (h ? null : n.label), g = se(), [k, x] = T(!1), C = n.entries !== void 0;
2038
+ return /* @__PURE__ */ i(
1965
2039
  "button",
1966
2040
  {
1967
2041
  type: "button",
1968
- className: $("cms-pane-toolbar__action", !r && "cms-pane-toolbar__action--bare", f && "cms-pane-toolbar__action--text", C && "cms-pane-toolbar__action--menu", n.danger && "is-danger"),
2042
+ className: F("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", p && "cms-pane-toolbar__action--text", C && "cms-pane-toolbar__action--menu", n.danger && "is-danger"),
1969
2043
  "data-action": n.id,
1970
2044
  "data-stop": n.id,
1971
2045
  ...t ? { "data-overflowed": "" } : {},
1972
- ...i ? { "data-pinned": "" } : {},
2046
+ ...r ? { "data-pinned": "" } : {},
1973
2047
  hidden: t,
1974
2048
  "aria-label": n.label,
1975
2049
  "aria-disabled": n.disabled || void 0,
1976
2050
  "aria-busy": n.busy || void 0,
1977
- ...C ? { "aria-haspopup": "menu", "aria-expanded": d } : {},
1978
- ...h === null ? {} : { "aria-describedby": N },
1979
- ...y && h !== null ? { "data-reason-shown": "" } : {},
1980
- tabIndex: o ? 0 : -1,
2051
+ ...C ? { "aria-haspopup": "menu", "aria-expanded": u } : {},
2052
+ ...f === null ? {} : { "aria-describedby": g },
2053
+ ...k && f !== null ? { "data-reason-shown": "" } : {},
2054
+ tabIndex: c ? 0 : -1,
1981
2055
  onFocus: m,
1982
- onBlur: () => k(!1),
1983
- onKeyDown: (M) => {
1984
- M.key === "Escape" && k(!1), C && (M.key === "ArrowDown" || M.key === "ArrowUp") && (M.preventDefault(), h !== null ? k(!0) : !n.disabled && !n.busy && a(M.currentTarget, M.key === "ArrowUp" ? "last" : "first"));
2056
+ onBlur: () => x(!1),
2057
+ onKeyDown: (w) => {
2058
+ w.key === "Escape" && x(!1), C && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), f !== null ? x(!0) : !n.disabled && !n.busy && a(w.currentTarget, w.key === "ArrowUp" ? "last" : "first"));
1985
2059
  },
1986
- onClick: (M) => {
1987
- h !== null ? k(!0) : !n.disabled && !n.busy && a(M.currentTarget, null);
2060
+ onClick: (w) => {
2061
+ f !== null ? x(!0) : !n.disabled && !n.busy && a(w.currentTarget, null);
1988
2062
  },
1989
2063
  children: [
1990
- v ? /* @__PURE__ */ e(V, { name: "spinner" }) : /* @__PURE__ */ e(he, { name: n.icon }),
1991
- r ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1992
- C ? /* @__PURE__ */ e(Ae, {}) : null,
1993
- h !== null || _ !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: N, children: _ }) : null
2064
+ v ? /* @__PURE__ */ e(G, { name: "spinner" }) : /* @__PURE__ */ e(xe, { name: n.icon }),
2065
+ h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
2066
+ C ? /* @__PURE__ */ e($e, {}) : null,
2067
+ f !== null || d !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: g, children: d }) : null
1994
2068
  ]
1995
2069
  }
1996
2070
  );
1997
2071
  }
1998
- function Ae() {
2072
+ function $e() {
1999
2073
  return /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(L, { name: "chevron-down", size: 14 }) });
2000
2074
  }
2001
- function he({ name: n }) {
2002
- const l = de(n);
2075
+ function xe({ name: n }) {
2076
+ const l = we(n);
2003
2077
  return l === null ? null : /* @__PURE__ */ e(L, { name: l, size: 18 });
2004
2078
  }
2005
- function Nl({ title: n, body: l = null, time: t = null, unread: i, unreadLabel: o, expandLabel: s, collapseLabel: d, action: a = null, onRead: m, leading: v }) {
2006
- const [u, f] = A(!1), r = G(), h = () => {
2007
- i && m();
2008
- }, _ = (a == null ? void 0 : a.presentation) === "row" && a.onAction !== void 0, N = (a == null ? void 0 : a.presentation) === "button" && a.onAction !== void 0 ? a : null, y = () => {
2009
- var k;
2010
- h(), _ && ((k = a.onAction) == null || k.call(a));
2079
+ function Pl({ title: n, body: l = null, time: t = null, unread: r, unreadLabel: c, expandLabel: s, collapseLabel: u, action: a = null, onRead: m, leading: v }) {
2080
+ const [o, p] = T(!1), h = se(), f = () => {
2081
+ r && m();
2082
+ }, d = (a == null ? void 0 : a.presentation) === "row" && a.onAction !== void 0, g = (a == null ? void 0 : a.presentation) === "button" && a.onAction !== void 0 ? a : null, k = () => {
2083
+ var x;
2084
+ f(), d && ((x = a.onAction) == null || x.call(a));
2011
2085
  };
2012
- return /* @__PURE__ */ c("article", { className: $("cms-notification", i && "is-unread", u && "is-expanded", _ && "is-row-action"), "data-state": i ? "unread" : "read", children: [
2013
- /* @__PURE__ */ c(
2086
+ return /* @__PURE__ */ i("article", { className: F("cms-notification", r && "is-unread", o && "is-expanded", d && "is-row-action"), "data-state": r ? "unread" : "read", children: [
2087
+ /* @__PURE__ */ i(
2014
2088
  "div",
2015
2089
  {
2016
2090
  className: "cms-notification__row",
2017
2091
  role: "button",
2018
2092
  tabIndex: 0,
2019
- "aria-describedby": l === null ? void 0 : r,
2020
- onClick: y,
2021
- onKeyDown: (k) => {
2022
- k.target !== k.currentTarget || k.key !== "Enter" && k.key !== " " || (k.preventDefault(), y());
2093
+ "aria-describedby": l === null ? void 0 : h,
2094
+ onClick: k,
2095
+ onKeyDown: (x) => {
2096
+ x.target !== x.currentTarget || x.key !== "Enter" && x.key !== " " || (x.preventDefault(), k());
2023
2097
  },
2024
2098
  children: [
2025
2099
  v != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: v }) : null,
2026
- /* @__PURE__ */ c("span", { className: "cms-notification__text", children: [
2027
- /* @__PURE__ */ c("span", { className: "cms-notification__head", children: [
2028
- /* @__PURE__ */ c("span", { className: "cms-notification__title", children: [
2029
- i ? /* @__PURE__ */ c("span", { className: "cms-visually-hidden", children: [
2030
- o,
2100
+ /* @__PURE__ */ i("span", { className: "cms-notification__text", children: [
2101
+ /* @__PURE__ */ i("span", { className: "cms-notification__head", children: [
2102
+ /* @__PURE__ */ i("span", { className: "cms-notification__title", children: [
2103
+ r ? /* @__PURE__ */ i("span", { className: "cms-visually-hidden", children: [
2104
+ c,
2031
2105
  " "
2032
2106
  ] }) : null,
2033
2107
  n
2034
2108
  ] }),
2035
2109
  t !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: t }) : null
2036
2110
  ] }),
2037
- l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: r, children: l }) : null
2111
+ l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: h, children: l }) : null
2038
2112
  ] }),
2039
- i ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
2113
+ r ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
2040
2114
  ]
2041
2115
  }
2042
2116
  ),
@@ -2045,35 +2119,35 @@ function Nl({ title: n, body: l = null, time: t = null, unread: i, unreadLabel:
2045
2119
  {
2046
2120
  type: "button",
2047
2121
  className: "cms-notification__chevron",
2048
- "aria-expanded": u,
2049
- "aria-controls": r,
2050
- "aria-label": u ? d : s,
2051
- title: u ? d : s,
2122
+ "aria-expanded": o,
2123
+ "aria-controls": h,
2124
+ "aria-label": o ? u : s,
2125
+ title: o ? u : s,
2052
2126
  onClick: () => {
2053
- u || h(), f((k) => !k);
2127
+ o || f(), p((x) => !x);
2054
2128
  },
2055
2129
  children: /* @__PURE__ */ e(L, { name: "chevron-down", size: 18 })
2056
2130
  }
2057
2131
  ) : null,
2058
- N !== null ? /* @__PURE__ */ e(
2132
+ g !== null ? /* @__PURE__ */ e(
2059
2133
  "button",
2060
2134
  {
2061
2135
  type: "button",
2062
2136
  className: "cms-button cms-notification__action",
2063
2137
  onClick: () => {
2064
- var k;
2065
- h(), (k = N.onAction) == null || k.call(N);
2138
+ var x;
2139
+ f(), (x = g.onAction) == null || x.call(g);
2066
2140
  },
2067
- children: N.label
2141
+ children: g.label
2068
2142
  }
2069
2143
  ) : null
2070
2144
  ] });
2071
2145
  }
2072
- function Fn(n) {
2146
+ function jn(n) {
2073
2147
  return n === "allowed" || n === "elevate" || n === "denied";
2074
2148
  }
2075
- function wl(n, l) {
2076
- if (!Fn(n))
2149
+ function Fl(n, l) {
2150
+ if (!jn(n))
2077
2151
  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 };
2078
2152
  switch (n) {
2079
2153
  case "allowed":
@@ -2084,220 +2158,317 @@ function wl(n, l) {
2084
2158
  return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
2085
2159
  }
2086
2160
  }
2087
- function Bn(n, l) {
2161
+ function Gn(n, l) {
2088
2162
  if (!n) return;
2089
2163
  if (typeof n.get == "function") return n.get(l) ?? void 0;
2090
- const t = n, i = Object.keys(t).find((o) => o.toLowerCase() === l.toLowerCase());
2091
- return i === void 0 ? void 0 : t[i];
2164
+ const t = n, r = Object.keys(t).find((c) => c.toLowerCase() === l.toLowerCase());
2165
+ return r === void 0 ? void 0 : t[r];
2092
2166
  }
2093
- function Rn(n) {
2167
+ function Yn(n) {
2094
2168
  if (n && typeof n == "object") {
2095
2169
  const l = n;
2096
2170
  if (typeof l.detail == "string" && l.detail !== "") return l.detail;
2097
2171
  if (typeof l.title == "string" && l.title !== "") return l.title;
2098
2172
  }
2099
2173
  }
2100
- function yl(n, l, t, i) {
2174
+ function Bl(n, l, t, r) {
2101
2175
  if (n !== 403) return { kind: "none" };
2102
- const o = Rn(t);
2103
- return Bn(l, "X-Elevation-Required") !== void 0 ? i.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." };
2176
+ const c = Yn(t);
2177
+ return Gn(l, "X-Elevation-Required") !== void 0 ? r.elevates ? { kind: "elevation-required", message: c ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: c ?? "The server refused this." };
2104
2178
  }
2105
- const Te = "coolms-kit:reread";
2106
- function kl() {
2107
- window.dispatchEvent(new Event(Te));
2179
+ const Ie = "coolms-kit:reread";
2180
+ function Rl() {
2181
+ window.dispatchEvent(new Event(Ie));
2108
2182
  }
2109
- function xl(n) {
2110
- const [l, t] = A(void 0), [i, o] = A(void 0), [s, d] = A(!0), a = H(n);
2183
+ function Hl(n) {
2184
+ const [l, t] = T(void 0), [r, c] = T(void 0), [s, u] = T(!0), a = H(n);
2111
2185
  a.current = n;
2112
- const m = H(0), v = we(() => {
2113
- const u = ++m.current;
2114
- d(!0), a.current().then(
2115
- (f) => {
2116
- u === m.current && (t(f), o(void 0), d(!1));
2186
+ const m = H(0), v = be(() => {
2187
+ const o = ++m.current;
2188
+ u(!0), a.current().then(
2189
+ (p) => {
2190
+ o === m.current && (t(p), c(void 0), u(!1));
2117
2191
  },
2118
- (f) => {
2119
- u === m.current && (o(f), d(!1));
2192
+ (p) => {
2193
+ o === m.current && (c(p), u(!1));
2120
2194
  }
2121
2195
  );
2122
2196
  }, []);
2123
- return Y(() => {
2197
+ return Q(() => {
2124
2198
  v();
2125
- const u = () => v();
2126
- return window.addEventListener("focus", u), window.addEventListener(Te, u), () => {
2127
- window.removeEventListener("focus", u), window.removeEventListener(Te, u);
2199
+ const o = () => v();
2200
+ return window.addEventListener("focus", o), window.addEventListener(Ie, o), () => {
2201
+ window.removeEventListener("focus", o), window.removeEventListener(Ie, o);
2128
2202
  };
2129
- }, [v]), { value: l, error: i, loading: s, reread: v };
2203
+ }, [v]), { value: l, error: r, loading: s, reread: v };
2130
2204
  }
2131
- function Ml(n) {
2205
+ function Ol(n) {
2132
2206
  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 };
2133
2207
  }
2134
- const Hn = "/errors/client-update-required";
2135
- function On(n, l) {
2136
- const t = n.split(".").map((o) => Number.parseInt(o, 10) || 0), i = l.split(".").map((o) => Number.parseInt(o, 10) || 0);
2137
- for (let o = 0; o < Math.max(t.length, i.length); o++) {
2138
- const s = t[o] ?? 0, d = i[o] ?? 0;
2139
- if (s !== d) return s < d;
2208
+ const Xn = "/errors/client-update-required";
2209
+ function Jn(n, l) {
2210
+ const t = n.split(".").map((c) => Number.parseInt(c, 10) || 0), r = l.split(".").map((c) => Number.parseInt(c, 10) || 0);
2211
+ for (let c = 0; c < Math.max(t.length, r.length); c++) {
2212
+ const s = t[c] ?? 0, u = r[c] ?? 0;
2213
+ if (s !== u) return s < u;
2140
2214
  }
2141
2215
  return !1;
2142
2216
  }
2143
- function Cl(n) {
2144
- return n.problemType !== void 0 && n.problemType.endsWith(Hn) ? !0 : n.minimumVersion !== void 0 && On(n.version, n.minimumVersion);
2217
+ function Ul(n) {
2218
+ return n.problemType !== void 0 && n.problemType.endsWith(Xn) ? !0 : n.minimumVersion !== void 0 && Jn(n.version, n.minimumVersion);
2145
2219
  }
2146
- const Ue = 4, Un = 48, zn = 800, Kn = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
2147
- function Zn(n, l) {
2148
- const [t, i] = A(!1);
2149
- return Y(() => {
2150
- const o = n.current;
2151
- if (o === null || !l) {
2152
- i(!1);
2220
+ const qe = 4, Qn = 48, el = 800, nl = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
2221
+ function ll(n, l) {
2222
+ const [t, r] = T(!1);
2223
+ return Q(() => {
2224
+ const c = n.current;
2225
+ if (c === null || !l) {
2226
+ r(!1);
2153
2227
  return;
2154
2228
  }
2155
2229
  const s = /* @__PURE__ */ new WeakMap();
2156
- let d = Number.NEGATIVE_INFINITY, a = null;
2157
- const m = (r) => {
2158
- d = performance.now(), a = r.target;
2159
- }, v = (r) => {
2160
- const h = r.target;
2161
- !(h instanceof HTMLElement && (h.isContentEditable || h.closest("input, textarea, select") !== null)) && Kn.has(r.key) && m(r);
2162
- }, u = (r) => {
2163
- const h = r.target;
2164
- if (!(h instanceof HTMLElement)) return;
2165
- const _ = h.scrollTop, N = s.get(h) ?? 0;
2166
- if (s.set(h, _), _ <= 0) {
2167
- i(!1);
2230
+ let u = Number.NEGATIVE_INFINITY, a = null;
2231
+ const m = (h) => {
2232
+ u = performance.now(), a = h.target;
2233
+ }, v = (h) => {
2234
+ const f = h.target;
2235
+ !(f instanceof HTMLElement && (f.isContentEditable || f.closest("input, textarea, select") !== null)) && nl.has(h.key) && m(h);
2236
+ }, o = (h) => {
2237
+ const f = h.target;
2238
+ if (!(f instanceof HTMLElement)) return;
2239
+ const d = f.scrollTop, g = s.get(f) ?? 0;
2240
+ if (s.set(f, d), d <= 0) {
2241
+ r(!1);
2168
2242
  return;
2169
2243
  }
2170
- performance.now() - d > zn || !(a === o || a === document.body || a instanceof Node && h.contains(a)) || (_ < N - Ue ? i(!1) : _ > N + Ue && _ > Un && i(!0));
2171
- }, f = [["wheel", m], ["touchmove", m], ["pointerdown", m], ["keydown", v]];
2172
- for (const [r, h] of f) o.addEventListener(r, h, { capture: !0, passive: !0 });
2173
- return o.addEventListener("scroll", u, { capture: !0, passive: !0 }), () => {
2174
- for (const [r, h] of f) o.removeEventListener(r, h, { capture: !0 });
2175
- o.removeEventListener("scroll", u, { capture: !0 });
2244
+ performance.now() - u > el || !(a === c || a === document.body || a instanceof Node && f.contains(a)) || (d < g - qe ? r(!1) : d > g + qe && d > Qn && r(!0));
2245
+ }, p = [["wheel", m], ["touchmove", m], ["pointerdown", m], ["keydown", v]];
2246
+ for (const [h, f] of p) c.addEventListener(h, f, { capture: !0, passive: !0 });
2247
+ return c.addEventListener("scroll", o, { capture: !0, passive: !0 }), () => {
2248
+ for (const [h, f] of p) c.removeEventListener(h, f, { capture: !0 });
2249
+ c.removeEventListener("scroll", o, { capture: !0 });
2176
2250
  };
2177
- }, [n, l]), [t, i];
2178
- }
2179
- function Sl({ title: n, back: l, navigation: t, search: i, searching: o, globals: s, filters: d, primary: a, onRefresh: m, pullText: v, barHidden: u, children: f }) {
2180
- const r = a !== void 0 && "menu" in a && !a.menu.some((D) => D.offer.offered) ? void 0 : a, h = H(null), _ = H(null), [N, y] = A(!1), [k, C] = A(null), b = Nn(_, m === void 0 ? null : () => {
2181
- N || (y(!0), m().finally(() => y(!1)));
2182
- }), w = m === void 0 ? null : { distance: b, refreshing: N, text: v ?? null }, T = o !== void 0 || b > 0 || N, [O, U] = Zn(h, u === void 0 && !T), x = !T && (u ?? O);
2183
- return /* @__PURE__ */ c(
2251
+ }, [n, l]), [t, r];
2252
+ }
2253
+ const tl = 64;
2254
+ function sl({ bar: n, leading: l, gap: t, icon: r, iconGap: c, search: s, more: u, globals: a, name: m, choice: v }) {
2255
+ const o = [...s ? [r] : [], r, r, ...a], p = o.reduce((f, d) => f + d, 0) + c * (o.length - 1);
2256
+ return n - (l > 0 ? l + t : 0) - t - p + 0.01 < Math.min(tl, m) + v;
2257
+ }
2258
+ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s = [], moreLabel: u = "More actions", globals: a, filter: m, primary: v, onRefresh: o, pullText: p, barHidden: h, children: f }) {
2259
+ const d = v !== void 0 && "menu" in v && !v.menu.some((P) => P.offer.offered) ? void 0 : v, g = H(null), k = H(null), [x, C] = T(!1), [w, b] = T(null), [y, D] = T(null), Z = be(() => D(null), []), V = H(!1), M = H(null), R = H(null), z = H(null), q = s.some((P) => P.offer.offered), U = y !== null && q && c === void 0;
2260
+ en(m);
2261
+ const j = m === void 0 ? null : Xe(m), [le, ae] = T(!1), re = H(!1), ie = H(!1), oe = H(null), J = m === void 0 ? void 0 : {
2262
+ ...m,
2263
+ onChange: (P) => {
2264
+ re.current = !0, m.onChange(P);
2265
+ }
2266
+ }, fe = j === null ? "" : ` · ${j.label}`, ee = m !== void 0 && m.options.length >= 2, [_, $] = T(!1), B = ee && q && _, ne = JSON.stringify([ee, q, B, r !== void 0, c !== void 0, l !== void 0, n, fe]), I = be(() => {
2267
+ const P = M.current, E = R.current, K = z.current;
2268
+ if (P === null || E === null || K === null || !ee) return null;
2269
+ const W = (ke) => parseFloat(ke) || 0, te = getComputedStyle(P), pe = P.getBoundingClientRect().width;
2270
+ if (pe === 0) return null;
2271
+ const Ce = (ke) => {
2272
+ var ze;
2273
+ return ((ze = P.querySelector(`.cms-screen__ruler > [data-ruler="${ke}"]`)) == null ? void 0 : ze.getBoundingClientRect().width) ?? 0;
2274
+ }, ce = P.querySelector(".cms-screen__leading"), Ne = (r !== void 0 ? 1 : 0) + (B ? 0 : 1) + 1;
2275
+ return sl({
2276
+ bar: pe - W(te.paddingLeft) - W(te.paddingRight),
2277
+ leading: ce === null || ce.childNodes.length === 0 ? 0 : W(getComputedStyle(ce).minWidth),
2278
+ gap: W(te.columnGap),
2279
+ icon: K.getBoundingClientRect().width,
2280
+ iconGap: W(getComputedStyle(E).columnGap),
2281
+ search: r !== void 0,
2282
+ more: !0,
2283
+ globals: Array.from(E.children).slice(Ne).map((ke) => ke.getBoundingClientRect().width),
2284
+ name: Ce("name"),
2285
+ choice: Ce("choice")
2286
+ });
2287
+ }, [ne]);
2288
+ ve(() => {
2289
+ const P = I() ?? _;
2290
+ P !== _ && re.current && (ie.current = !0), re.current = !1, $(P);
2291
+ }, [I]), Q(() => {
2292
+ if (M.current === null || typeof ResizeObserver > "u") return;
2293
+ const P = new ResizeObserver(() => {
2294
+ const E = I();
2295
+ E !== null && $(E);
2296
+ });
2297
+ for (const E of [M.current, R.current, ...M.current.querySelectorAll(".cms-screen__ruler > span")]) E !== null && P.observe(E);
2298
+ return () => P.disconnect();
2299
+ }, [I]);
2300
+ const X = H(B);
2301
+ ve(() => {
2302
+ var K, W, te;
2303
+ if (X.current === B) return;
2304
+ X.current = B, D(null);
2305
+ const P = document.activeElement;
2306
+ (P === document.body && oe.current !== null && !oe.current.isConnected || ie.current && (P === document.body || ((K = M.current) == null ? void 0 : K.contains(P)) === !0)) && ((te = B ? z.current : (W = R.current) == null ? void 0 : W.querySelector(".cms-filter-menu")) == null || te.focus()), ie.current = !1;
2307
+ }, [B]);
2308
+ const N = B && j !== null && m !== void 0 ? `${u}, ${Je(m)}` : u, O = Tn(k, o === void 0 ? null : () => {
2309
+ x || (C(!0), o().finally(() => C(!1)));
2310
+ }), Y = o === void 0 ? null : { distance: O, refreshing: x, text: p ?? null }, de = c !== void 0 || O > 0 || x || U || le, [Me, Ee] = ll(g, h === void 0 && !de), ue = !de && (h ?? Me);
2311
+ return /* @__PURE__ */ i(
2184
2312
  "div",
2185
2313
  {
2186
- ref: h,
2187
- className: $("cms-screen", r !== void 0 && "cms-screen--with-primary"),
2188
- "data-bar-hidden": x ? "" : void 0,
2189
- onFocus: (D) => {
2190
- x && D.target instanceof Element && D.target.closest(".cms-screen__bar, .cms-screen__filters") !== null && U(!1);
2314
+ ref: g,
2315
+ className: F("cms-screen", d !== void 0 && "cms-screen--with-primary"),
2316
+ "data-bar-hidden": ue ? "" : void 0,
2317
+ onFocus: (P) => {
2318
+ oe.current = P.target, ue && P.target instanceof Element && P.target.closest(".cms-screen__bar") !== null && Ee(!1);
2191
2319
  },
2192
2320
  children: [
2193
- o !== void 0 ? /* @__PURE__ */ c("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
2194
- /* @__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(L, { name: "chevron-left" }) }),
2195
- /* @__PURE__ */ e("div", { className: "cms-screen__search", children: o.field })
2196
- ] }) : /* @__PURE__ */ c("header", { className: "cms-screen__bar", children: [
2197
- /* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ c("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
2321
+ c !== void 0 ? /* @__PURE__ */ i("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
2322
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": c.closeLabel, title: c.closeLabel, onClick: c.onClose, children: /* @__PURE__ */ e(L, { name: "chevron-left" }) }),
2323
+ /* @__PURE__ */ e("div", { className: "cms-screen__search", children: c.field })
2324
+ ] }) : /* @__PURE__ */ i("header", { ref: M, className: "cms-screen__bar", children: [
2325
+ /* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ i("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
2198
2326
  /* @__PURE__ */ e(L, { name: "chevron-left" }),
2199
2327
  /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
2200
- ] }) : /* @__PURE__ */ c("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
2328
+ ] }) : /* @__PURE__ */ i("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
2201
2329
  /* @__PURE__ */ e(L, { name: "chevron-left" }),
2202
2330
  /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
2203
2331
  ] }) : t }),
2204
- /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
2205
- /* @__PURE__ */ c("div", { className: "cms-screen__trailing", children: [
2206
- i !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": i.label, title: i.label, onClick: i.onOpen, children: /* @__PURE__ */ e(L, { name: "search" }) }) : null,
2207
- s
2332
+ j === null ? /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }) : /* @__PURE__ */ i("h1", { className: "cms-screen__title cms-screen__title--filtered", title: n + fe, children: [
2333
+ /* @__PURE__ */ i("span", { className: "cms-screen__title-place", children: [
2334
+ /* @__PURE__ */ e("span", { className: "cms-screen__title-name", children: n }),
2335
+ /* @__PURE__ */ e("span", { className: "cms-screen__title-dot", children: " · " })
2336
+ ] }),
2337
+ /* @__PURE__ */ e("span", { className: "cms-screen__title-choice", children: j.label })
2338
+ ] }),
2339
+ ee && q ? /* @__PURE__ */ i("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
2340
+ /* @__PURE__ */ e("span", { "data-ruler": "name", children: n }),
2341
+ j !== null ? /* @__PURE__ */ e("span", { "data-ruler": "choice", children: fe }) : null
2342
+ ] }) : null,
2343
+ /* @__PURE__ */ i("div", { ref: R, className: "cms-screen__trailing", children: [
2344
+ r !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": r.label, title: r.label, onClick: r.onOpen, children: /* @__PURE__ */ e(L, { name: "search" }) }) : null,
2345
+ J !== void 0 && !B ? /* @__PURE__ */ e(nn, { ...J, iconOnly: !0, onOpenChange: ae }) : null,
2346
+ q ? /* @__PURE__ */ e(
2347
+ "button",
2348
+ {
2349
+ ref: z,
2350
+ type: "button",
2351
+ className: F("cms-icon-button cms-screen__icon", B && j !== null && "cms-screen__icon--active"),
2352
+ "data-action": "more",
2353
+ "aria-haspopup": "menu",
2354
+ "aria-expanded": U,
2355
+ "aria-label": N,
2356
+ title: N,
2357
+ onMouseDown: () => {
2358
+ V.current = U;
2359
+ },
2360
+ onClick: (P) => {
2361
+ const E = P.currentTarget.getBoundingClientRect();
2362
+ D(V.current ? null : { x: E.left, y: E.bottom + 4 }), V.current = !1;
2363
+ },
2364
+ children: /* @__PURE__ */ e(L, { name: "more" })
2365
+ }
2366
+ ) : null,
2367
+ a
2208
2368
  ] })
2209
2369
  ] }),
2210
- d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(An, { label: d.label, options: d.options, value: d.selected, onChange: d.onSelect }) }) : null,
2211
- /* @__PURE__ */ e("div", { ref: _, className: "cms-screen__content", "data-pulling": b > 0 ? "" : void 0, "data-refreshing": N ? "" : void 0, children: /* @__PURE__ */ e(Ze.Provider, { value: w, children: f }) }),
2212
- r !== void 0 ? /* @__PURE__ */ e(
2370
+ /* @__PURE__ */ e("div", { ref: k, className: "cms-screen__content", "data-pulling": O > 0 ? "" : void 0, "data-refreshing": x ? "" : void 0, children: /* @__PURE__ */ e(Ye.Provider, { value: Y, children: f }) }),
2371
+ d !== void 0 ? /* @__PURE__ */ e(
2213
2372
  "button",
2214
2373
  {
2215
2374
  type: "button",
2216
2375
  className: "cms-button cms-button--primary cms-screen__primary",
2217
- "aria-label": r.label,
2218
- title: r.label,
2219
- ..."menu" in r ? { "aria-haspopup": "menu", "aria-expanded": k !== null } : {},
2220
- onClick: (D) => {
2221
- if ("menu" in r) {
2222
- const B = D.currentTarget.getBoundingClientRect();
2223
- C(k === null ? { x: B.left, y: B.top } : null);
2376
+ "aria-label": d.label,
2377
+ title: d.label,
2378
+ ..."menu" in d ? { "aria-haspopup": "menu", "aria-expanded": w !== null } : {},
2379
+ onClick: (P) => {
2380
+ if ("menu" in d) {
2381
+ const E = P.currentTarget.getBoundingClientRect();
2382
+ b(w === null ? { x: E.left, y: E.top } : null);
2224
2383
  } else
2225
- r.onPress();
2384
+ d.onPress();
2226
2385
  },
2227
- children: /* @__PURE__ */ e(L, { name: r.icon, size: 24 })
2386
+ children: /* @__PURE__ */ e(L, { name: d.icon, size: 24 })
2228
2387
  }
2229
2388
  ) : null,
2230
- r !== void 0 && "menu" in r ? /* @__PURE__ */ e(pe, { at: k, items: r.menu, onClose: () => C(null), label: r.label }) : null
2389
+ /* @__PURE__ */ e(
2390
+ ge,
2391
+ {
2392
+ at: U ? y : null,
2393
+ items: B && J !== void 0 ? [...s, ...Qe(J, J.label)] : s,
2394
+ onClose: Z,
2395
+ label: u,
2396
+ focus: "first"
2397
+ }
2398
+ ),
2399
+ d !== void 0 && "menu" in d ? /* @__PURE__ */ e(ge, { at: w, items: d.menu, onClose: () => b(null), label: d.label }) : null
2231
2400
  ]
2232
2401
  }
2233
2402
  );
2234
2403
  }
2235
2404
  export {
2236
- cl as AppShell,
2237
- ye as Avatar,
2238
- Be as BOOTSTRAP_ICONS,
2239
- En as Badge,
2240
- se as Button,
2241
- Pe as CALL_LABELS,
2242
- Hn as CLIENT_UPDATE_REQUIRED,
2243
- bl as CallBar,
2244
- pl as CallPanel,
2245
- ml as ChatBubble,
2246
- hl as Composer,
2247
- Jn as ConfirmDialog,
2248
- pe as ContextMenu,
2249
- ln as EmptyState,
2250
- tn as ErrorBanner,
2251
- tl as FilePicker,
2252
- pn as FilePickerDenied,
2253
- bn as FilePickerRestart,
2254
- ll as FileViewer,
2255
- An as FilterChips,
2256
- nl as ICON_NAMES,
2405
+ yl as AppShell,
2406
+ Se as Avatar,
2407
+ Ke as BOOTSTRAP_ICONS,
2408
+ Rn as Badge,
2409
+ he as Button,
2410
+ He as CALL_LABELS,
2411
+ Xn as CLIENT_UPDATE_REQUIRED,
2412
+ Tl as CallBar,
2413
+ Al as CallPanel,
2414
+ Cl as ChatBubble,
2415
+ Sl as Composer,
2416
+ ml as ConfirmDialog,
2417
+ ge as ContextMenu,
2418
+ hn as EmptyState,
2419
+ fn as ErrorBanner,
2420
+ zn as FILTER_MENU_LABELS,
2421
+ bl as FilePicker,
2422
+ Mn as FilePickerDenied,
2423
+ Cn as FilePickerRestart,
2424
+ _l as FileViewer,
2425
+ Vn as FilterMenu,
2426
+ pl as ICON_NAMES,
2257
2427
  L as Icon,
2258
- fl as IncomingCall,
2259
- al as List,
2260
- nn as Loading,
2261
- Dn as MAIL_ROW_LABELS,
2262
- en as MODAL_CLOSE_MS,
2263
- ul as MailRow,
2264
- ze as Modal,
2265
- sn as NamedIcon,
2266
- Nl as Notification,
2267
- Se as PULL_AT,
2268
- rl as PageHeader,
2269
- gl as PaneToolbar,
2270
- Ln as SIGN_IN_LABELS,
2271
- Ce as STATE_DELAY_MS,
2272
- Sl as ScreenShell,
2273
- ol as SearchField,
2274
- sl as SectionHeader,
2275
- Gn as Select,
2276
- vl as SignInForm,
2277
- _l as SignInLayout,
2278
- dl as SplitPanes,
2279
- Sn as Splitter,
2280
- ae as State,
2281
- il as TabStrip,
2282
- Yn as TextArea,
2283
- qn as TextField,
2284
- Qn as Toast,
2285
- el as ToastRegion,
2286
- Xn as Toggle,
2287
- Tn as fitPanes,
2288
- de as iconForName,
2289
- yn as initialsOf,
2290
- Fn as isCapability,
2291
- Cl as needsClientUpdate,
2292
- wl as offerFor,
2293
- Ml as readConflict,
2294
- yl as readRefusal,
2295
- Rn as refusalText,
2296
- kl as rereadAll,
2297
- kn as tintOf,
2298
- Nn as usePull,
2299
- wn as usePullState,
2300
- xl as useReread,
2301
- On as versionBelow,
2302
- Je as writtenOut
2428
+ El as IncomingCall,
2429
+ vl as List,
2430
+ $l as ListHead,
2431
+ mn as Loading,
2432
+ On as MAIL_ROW_LABELS,
2433
+ un as MODAL_CLOSE_MS,
2434
+ Ml as MailRow,
2435
+ je as Modal,
2436
+ _n as NamedIcon,
2437
+ Pl as Notification,
2438
+ De as PULL_AT,
2439
+ Nl as PageHeader,
2440
+ Il as PaneToolbar,
2441
+ Un as SIGN_IN_LABELS,
2442
+ Te as STATE_DELAY_MS,
2443
+ zl as ScreenShell,
2444
+ kl as SearchField,
2445
+ gl as SectionHeader,
2446
+ dl as Select,
2447
+ Ll as SignInForm,
2448
+ Dl as SignInLayout,
2449
+ xl as SplitPanes,
2450
+ Bn as Splitter,
2451
+ me as State,
2452
+ wl as TabStrip,
2453
+ ol as TextArea,
2454
+ il as TextField,
2455
+ hl as Toast,
2456
+ fl as ToastRegion,
2457
+ ul as Toggle,
2458
+ Hn as fitPanes,
2459
+ we as iconForName,
2460
+ Ln as initialsOf,
2461
+ jn as isCapability,
2462
+ Ul as needsClientUpdate,
2463
+ Fl as offerFor,
2464
+ Ol as readConflict,
2465
+ Bl as readRefusal,
2466
+ Yn as refusalText,
2467
+ Rl as rereadAll,
2468
+ $n as tintOf,
2469
+ Tn as usePull,
2470
+ Dn as usePullState,
2471
+ Hl as useReread,
2472
+ Jn as versionBelow,
2473
+ on as writtenOut
2303
2474
  };