@coolms/ui-react 0.1.0-alpha.17 → 0.1.0-alpha.18
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/CHANGELOG.md +6 -0
- package/dist/components/Structure.d.ts +4 -1
- package/dist/index.js +234 -232
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useId as q, useState as D, useRef as R, useEffect as J, useCallback as be, useMemo as Pe, useLayoutEffect as ke } from "react";
|
|
3
3
|
import { createPortal as xe } from "react-dom";
|
|
4
4
|
function re(n, l) {
|
|
5
5
|
const t = { ...n };
|
|
6
|
-
for (const
|
|
7
|
-
const m = l == null ? void 0 : l[
|
|
8
|
-
m !== void 0 && (t[
|
|
6
|
+
for (const d of Object.keys(l ?? {})) {
|
|
7
|
+
const m = l == null ? void 0 : l[d];
|
|
8
|
+
m !== void 0 && (t[d] = m);
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
@@ -35,7 +35,7 @@ function ne({
|
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: t,
|
|
38
|
-
locked:
|
|
38
|
+
locked: d = !1,
|
|
39
39
|
lockedReason: m,
|
|
40
40
|
icon: s,
|
|
41
41
|
disabled: r,
|
|
@@ -46,19 +46,19 @@ function ne({
|
|
|
46
46
|
...h
|
|
47
47
|
}) {
|
|
48
48
|
const a = !!r || l;
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ o(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...h,
|
|
53
53
|
type: b,
|
|
54
|
-
className: T("cms-button", `cms-button--${n}`, l && "is-busy",
|
|
54
|
+
className: T("cms-button", `cms-button--${n}`, l && "is-busy", d && "is-locked", i),
|
|
55
55
|
disabled: a,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
|
-
title:
|
|
57
|
+
title: d ? m ?? c : c,
|
|
58
58
|
children: [
|
|
59
|
-
l ? /* @__PURE__ */ e(z, { name: "spinner" }) :
|
|
59
|
+
l ? /* @__PURE__ */ e(z, { name: "spinner" }) : d ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
|
|
60
60
|
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : u }),
|
|
61
|
-
|
|
61
|
+
d && m ? /* @__PURE__ */ o("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
m
|
|
64
64
|
] }) : null
|
|
@@ -66,16 +66,16 @@ function ne({
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function Ce({ id: n, label: l, help: t, error:
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
function Ce({ id: n, label: l, help: t, error: d, pinned: m, children: s }) {
|
|
70
|
+
return /* @__PURE__ */ o("div", { className: T("cms-field", d != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
|
|
72
72
|
s,
|
|
73
|
-
m != null ? /* @__PURE__ */
|
|
73
|
+
m != null ? /* @__PURE__ */ o("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
74
74
|
/* @__PURE__ */ e(z, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
76
|
m
|
|
77
77
|
] }) : null,
|
|
78
|
-
|
|
78
|
+
d != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: d }) : null,
|
|
79
79
|
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
@@ -85,7 +85,7 @@ function Me(n, l) {
|
|
|
85
85
|
}
|
|
86
86
|
const Fe = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Be = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
87
|
function Ke(n, l, t) {
|
|
88
|
-
const
|
|
88
|
+
const d = (s, r, i, u = 0, b = 0, c = 0) => {
|
|
89
89
|
const h = new Date(Date.UTC(s, r - 1, i, u, b, c));
|
|
90
90
|
return h.setUTCFullYear(s), h.getUTCFullYear() === s && h.getUTCMonth() === r - 1 && h.getUTCDate() === i && h.getUTCHours() === u && h.getUTCMinutes() === b && h.getUTCSeconds() === c ? h : null;
|
|
91
91
|
}, m = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
|
|
@@ -93,17 +93,17 @@ function Ke(n, l, t) {
|
|
|
93
93
|
if (n === "time") {
|
|
94
94
|
const r = l.match(Be);
|
|
95
95
|
if (r === null) return l;
|
|
96
|
-
const i = m(r), u =
|
|
96
|
+
const i = m(r), u = d(2e3, 1, 1, i.hour, i.minute, i.second);
|
|
97
97
|
return u === null ? l : new Intl.DateTimeFormat(t, { timeStyle: r[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
|
|
98
98
|
}
|
|
99
99
|
const s = l.match(Fe);
|
|
100
100
|
if (s === null) return l;
|
|
101
101
|
if (n === "date" && s[4] === void 0) {
|
|
102
|
-
const r =
|
|
102
|
+
const r = d(Number(s[1]), Number(s[2]), Number(s[3]));
|
|
103
103
|
return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(r);
|
|
104
104
|
}
|
|
105
105
|
if (n === "datetime-local" && s[4] !== void 0) {
|
|
106
|
-
const r =
|
|
106
|
+
const r = d(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
|
|
107
107
|
return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(r);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
@@ -112,7 +112,7 @@ function Ke(n, l, t) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
const He = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
-
function yn({ label: n, help: l, error: t, disabled:
|
|
115
|
+
function yn({ label: n, help: l, error: t, disabled: d, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, type: b = "text", name: c, locale: h, min: a, max: g, step: p, minLength: v, maxLength: N, required: k }) {
|
|
116
116
|
const x = q(), M = m === !0 || s != null, C = M && He.has(b), U = b === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
|
|
117
117
|
return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
118
118
|
"input",
|
|
@@ -125,7 +125,7 @@ function yn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
|
|
|
125
125
|
...C ? { "data-value": r } : {},
|
|
126
126
|
lang: h,
|
|
127
127
|
placeholder: u,
|
|
128
|
-
disabled:
|
|
128
|
+
disabled: d,
|
|
129
129
|
readOnly: M,
|
|
130
130
|
required: k,
|
|
131
131
|
"aria-required": k || void 0,
|
|
@@ -141,7 +141,7 @@ function yn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
|
|
|
141
141
|
}
|
|
142
142
|
) });
|
|
143
143
|
}
|
|
144
|
-
function wn({ label: n, help: l, error: t, disabled:
|
|
144
|
+
function wn({ label: n, help: l, error: t, disabled: d, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, rows: b = 4, name: c, locale: h, minLength: a, maxLength: g, required: p }) {
|
|
145
145
|
const v = q();
|
|
146
146
|
return /* @__PURE__ */ e(Ce, { id: v, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
147
147
|
"textarea",
|
|
@@ -153,7 +153,7 @@ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
|
|
|
153
153
|
value: r,
|
|
154
154
|
lang: h,
|
|
155
155
|
placeholder: u,
|
|
156
|
-
disabled:
|
|
156
|
+
disabled: d,
|
|
157
157
|
readOnly: m === !0 || s != null,
|
|
158
158
|
required: p,
|
|
159
159
|
"aria-required": p || void 0,
|
|
@@ -165,7 +165,7 @@ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
|
|
|
165
165
|
}
|
|
166
166
|
) });
|
|
167
167
|
}
|
|
168
|
-
function kn({ label: n, help: l, error: t, disabled:
|
|
168
|
+
function kn({ label: n, help: l, error: t, disabled: d, readOnly: m, value: s, options: r, onChange: i, emptyText: u = "Nothing to choose from yet.", name: b }) {
|
|
169
169
|
const c = q(), h = r.length === 0;
|
|
170
170
|
return /* @__PURE__ */ e(Ce, { id: c, label: n, help: h ? u : l, error: t, children: /* @__PURE__ */ e(
|
|
171
171
|
"select",
|
|
@@ -174,7 +174,7 @@ function kn({ label: n, help: l, error: t, disabled: o, readOnly: m, value: s, o
|
|
|
174
174
|
name: b,
|
|
175
175
|
className: "cms-input cms-select",
|
|
176
176
|
value: s,
|
|
177
|
-
disabled:
|
|
177
|
+
disabled: d || h,
|
|
178
178
|
"aria-readonly": m || void 0,
|
|
179
179
|
"aria-invalid": t != null || void 0,
|
|
180
180
|
"aria-describedby": Me(c, { help: h ? u : l, error: t }),
|
|
@@ -185,9 +185,9 @@ function kn({ label: n, help: l, error: t, disabled: o, readOnly: m, value: s, o
|
|
|
185
185
|
}
|
|
186
186
|
) });
|
|
187
187
|
}
|
|
188
|
-
function xn({ label: n, checked: l, onChange: t, disabled:
|
|
188
|
+
function xn({ label: n, checked: l, onChange: t, disabled: d, readOnly: m, help: s }) {
|
|
189
189
|
const r = q();
|
|
190
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ o("div", { className: "cms-toggle-row", children: [
|
|
191
191
|
/* @__PURE__ */ e(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
@@ -198,7 +198,7 @@ function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help:
|
|
|
198
198
|
"aria-checked": l,
|
|
199
199
|
"aria-readonly": m || void 0,
|
|
200
200
|
"aria-describedby": s != null ? `${r}-help` : void 0,
|
|
201
|
-
disabled:
|
|
201
|
+
disabled: d,
|
|
202
202
|
onClick: () => {
|
|
203
203
|
m || t == null || t(!l);
|
|
204
204
|
},
|
|
@@ -210,7 +210,7 @@ function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help:
|
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
212
|
const Oe = 150;
|
|
213
|
-
function Le({ open: n, title: l, onClose: t, dirty:
|
|
213
|
+
function Le({ open: n, title: l, onClose: t, dirty: d = !1, onDirtyClose: m, children: s, footer: r, closeLabel: i = "Close", initialFocus: u, className: b }) {
|
|
214
214
|
const [c, h] = D(n), [a, g] = D(!1), p = R(null), v = R(null), N = q();
|
|
215
215
|
if (J(() => {
|
|
216
216
|
if (n) {
|
|
@@ -232,16 +232,16 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
|
|
|
232
232
|
}
|
|
233
233
|
}, [n, c, u]), !c) return null;
|
|
234
234
|
const k = () => {
|
|
235
|
-
|
|
235
|
+
d ? m == null || m() : t();
|
|
236
236
|
};
|
|
237
237
|
return xe(
|
|
238
238
|
/* @__PURE__ */ e("div", { className: T("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
|
|
239
239
|
x.target === x.currentTarget && k();
|
|
240
|
-
}, children: /* @__PURE__ */
|
|
240
|
+
}, children: /* @__PURE__ */ o(
|
|
241
241
|
"div",
|
|
242
242
|
{
|
|
243
243
|
ref: p,
|
|
244
|
-
className: T("cms-modal", b, a && "is-closing",
|
|
244
|
+
className: T("cms-modal", b, a && "is-closing", d && "is-dirty"),
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
247
|
"aria-labelledby": N,
|
|
@@ -258,7 +258,7 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
|
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ o("header", { className: "cms-modal__head", children: [
|
|
262
262
|
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, children: l }),
|
|
263
263
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: k, children: /* @__PURE__ */ e(z, { name: "close" }) })
|
|
264
264
|
] }),
|
|
@@ -270,8 +270,8 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
|
|
|
270
270
|
document.body
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function Cn({ open: n, title: l, message: t, kind:
|
|
274
|
-
const b =
|
|
273
|
+
function Cn({ open: n, title: l, message: t, kind: d = "default", confirmLabel: m, cancelLabel: s, closeLabel: r, onConfirm: i, onCancel: u }) {
|
|
274
|
+
const b = d === "discard-changes";
|
|
275
275
|
return /* @__PURE__ */ e(
|
|
276
276
|
Le,
|
|
277
277
|
{
|
|
@@ -279,11 +279,11 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
|
|
|
279
279
|
title: l,
|
|
280
280
|
onClose: u,
|
|
281
281
|
...r === void 0 ? {} : { closeLabel: r },
|
|
282
|
-
footer: /* @__PURE__ */
|
|
282
|
+
footer: /* @__PURE__ */ o(S, { children: [
|
|
283
283
|
/* @__PURE__ */ e(ne, { onClick: u, children: s ?? (b ? "Keep editing" : "Cancel") }),
|
|
284
|
-
/* @__PURE__ */ e(ne, { variant:
|
|
284
|
+
/* @__PURE__ */ e(ne, { variant: d === "default" ? "primary" : "danger", onClick: i, children: m ?? (b ? "Discard changes" : "Confirm") })
|
|
285
285
|
] }),
|
|
286
|
-
children:
|
|
286
|
+
children: d !== "default" ? /* @__PURE__ */ o("p", { className: "cms-confirm__warning", children: [
|
|
287
287
|
/* @__PURE__ */ e(z, { name: "warning" }),
|
|
288
288
|
" ",
|
|
289
289
|
t
|
|
@@ -291,32 +291,32 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function Mn({ kind: n, message: l, action: t, onDismiss:
|
|
295
|
-
return /* @__PURE__ */
|
|
294
|
+
function Mn({ kind: n, message: l, action: t, onDismiss: d, dismissLabel: m = "Dismiss" }) {
|
|
295
|
+
return /* @__PURE__ */ o("div", { className: T("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
296
296
|
/* @__PURE__ */ e(z, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
297
297
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
|
|
298
298
|
t ? /* @__PURE__ */ e(ne, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
|
|
299
|
-
|
|
299
|
+
d ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": m, onClick: d, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
|
|
300
300
|
] });
|
|
301
301
|
}
|
|
302
302
|
function Sn({ children: n }) {
|
|
303
303
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
|
|
304
304
|
}
|
|
305
305
|
function Ue({ what: n, layout: l = "inline" }) {
|
|
306
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ o("div", { className: T("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
|
|
307
307
|
/* @__PURE__ */ e(z, { name: "spinner" }),
|
|
308
308
|
/* @__PURE__ */ e("span", { children: n })
|
|
309
309
|
] });
|
|
310
310
|
}
|
|
311
311
|
function Re({ title: n, hint: l, action: t }) {
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ o("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
318
|
function ze({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
|
|
319
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ o("div", { className: "cms-error-banner", role: "alert", children: [
|
|
320
320
|
/* @__PURE__ */ e(z, { name: "warning" }),
|
|
321
321
|
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
|
|
322
322
|
l ? /* @__PURE__ */ e(ne, { onClick: l, children: t }) : null
|
|
@@ -329,12 +329,12 @@ function Ze() {
|
|
|
329
329
|
return Number.isFinite(l) && l >= 0 ? l : ye;
|
|
330
330
|
}
|
|
331
331
|
function Ve() {
|
|
332
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ o("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
333
333
|
/* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
|
|
334
334
|
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
335
335
|
] });
|
|
336
336
|
}
|
|
337
|
-
function ee({ kind: n, title: l, description: t, action:
|
|
337
|
+
function ee({ kind: n, title: l, description: t, action: d, placement: m = "block" }) {
|
|
338
338
|
const [s, r] = D(n !== "loading");
|
|
339
339
|
return J(() => {
|
|
340
340
|
if (n !== "loading") {
|
|
@@ -344,7 +344,7 @@ function ee({ kind: n, title: l, description: t, action: o, placement: m = "bloc
|
|
|
344
344
|
r(!1);
|
|
345
345
|
const i = window.setTimeout(() => r(!0), Ze());
|
|
346
346
|
return () => window.clearTimeout(i);
|
|
347
|
-
}, [n]), /* @__PURE__ */
|
|
347
|
+
}, [n]), /* @__PURE__ */ o(
|
|
348
348
|
"div",
|
|
349
349
|
{
|
|
350
350
|
className: T("cms-state", `cms-state--${n}`, `cms-state--${m}`, !s && "is-waiting"),
|
|
@@ -354,116 +354,116 @@ function ee({ kind: n, title: l, description: t, action: o, placement: m = "bloc
|
|
|
354
354
|
children: [
|
|
355
355
|
n === "loading" ? /* @__PURE__ */ e(Ve, {}) : null,
|
|
356
356
|
n === "error" || n === "denied" ? /* @__PURE__ */ e(z, { name: n === "error" ? "warning" : "lock" }) : null,
|
|
357
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ o("span", { className: "cms-state__text", children: [
|
|
358
358
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
|
|
359
359
|
t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
|
|
360
360
|
] }),
|
|
361
|
-
|
|
361
|
+
d !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ne, { className: "cms-state__action", onClick: d.onAction, children: d.label }) : null
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
const $e = {
|
|
367
|
-
mail: /* @__PURE__ */
|
|
367
|
+
mail: /* @__PURE__ */ o(S, { children: [
|
|
368
368
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
369
369
|
/* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
|
|
370
370
|
] }),
|
|
371
371
|
// The envelope with its flap open above it: a message read, or the message itself again.
|
|
372
|
-
"mail-open": /* @__PURE__ */
|
|
372
|
+
"mail-open": /* @__PURE__ */ o(S, { children: [
|
|
373
373
|
/* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
|
|
374
374
|
/* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
|
|
375
375
|
/* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
|
|
376
376
|
] }),
|
|
377
377
|
// A clipboard: copy what is shown.
|
|
378
|
-
copy: /* @__PURE__ */
|
|
378
|
+
copy: /* @__PURE__ */ o(S, { children: [
|
|
379
379
|
/* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
|
|
380
380
|
/* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
|
|
381
381
|
/* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
|
|
382
382
|
] }),
|
|
383
383
|
chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
|
|
384
384
|
phone: /* @__PURE__ */ e("path", { d: "M5 3h3l2 5-2.5 1.5a11 11 0 0 0 7 7L16 14l5 2v3a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2Z" }),
|
|
385
|
-
calendar: /* @__PURE__ */
|
|
385
|
+
calendar: /* @__PURE__ */ o(S, { children: [
|
|
386
386
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
|
|
387
387
|
/* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
|
|
388
388
|
] }),
|
|
389
|
-
file: /* @__PURE__ */
|
|
389
|
+
file: /* @__PURE__ */ o(S, { children: [
|
|
390
390
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
391
391
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
392
392
|
] }),
|
|
393
393
|
// The file, with code's angle brackets in place of its lines: a message's source.
|
|
394
|
-
"file-code": /* @__PURE__ */
|
|
394
|
+
"file-code": /* @__PURE__ */ o(S, { children: [
|
|
395
395
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
396
396
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
|
|
397
397
|
/* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
|
|
398
398
|
] }),
|
|
399
|
-
image: /* @__PURE__ */
|
|
399
|
+
image: /* @__PURE__ */ o(S, { children: [
|
|
400
400
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
401
401
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
|
|
402
402
|
/* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
|
|
403
403
|
] }),
|
|
404
|
-
search: /* @__PURE__ */
|
|
404
|
+
search: /* @__PURE__ */ o(S, { children: [
|
|
405
405
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
|
|
406
406
|
/* @__PURE__ */ e("path", { d: "m20 20-4-4" })
|
|
407
407
|
] }),
|
|
408
|
-
bell: /* @__PURE__ */
|
|
408
|
+
bell: /* @__PURE__ */ o(S, { children: [
|
|
409
409
|
/* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
|
|
410
410
|
/* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
|
|
411
411
|
] }),
|
|
412
|
-
pencil: /* @__PURE__ */
|
|
412
|
+
pencil: /* @__PURE__ */ o(S, { children: [
|
|
413
413
|
/* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
|
|
414
414
|
/* @__PURE__ */ e("path", { d: "m13 7 4 4" })
|
|
415
415
|
] }),
|
|
416
|
-
download: /* @__PURE__ */
|
|
416
|
+
download: /* @__PURE__ */ o(S, { children: [
|
|
417
417
|
/* @__PURE__ */ e("path", { d: "M12 4v11" }),
|
|
418
418
|
/* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
|
|
419
419
|
/* @__PURE__ */ e("path", { d: "M4 20h16" })
|
|
420
420
|
] }),
|
|
421
|
-
print: /* @__PURE__ */
|
|
421
|
+
print: /* @__PURE__ */ o(S, { children: [
|
|
422
422
|
/* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
|
|
423
423
|
/* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
|
|
424
424
|
/* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
|
|
425
425
|
] }),
|
|
426
|
-
"open-separately": /* @__PURE__ */
|
|
426
|
+
"open-separately": /* @__PURE__ */ o(S, { children: [
|
|
427
427
|
/* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
|
|
428
428
|
/* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
|
|
429
429
|
/* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
|
|
430
430
|
] }),
|
|
431
431
|
star: /* @__PURE__ */ e("path", { d: "m12 3 2.8 5.8 6.2.9-4.5 4.4 1 6.2L12 17.4l-5.5 2.9 1-6.2L3 9.7l6.2-.9Z" }),
|
|
432
|
-
send: /* @__PURE__ */
|
|
432
|
+
send: /* @__PURE__ */ o(S, { children: [
|
|
433
433
|
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
434
434
|
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
435
435
|
] }),
|
|
436
|
-
inbox: /* @__PURE__ */
|
|
436
|
+
inbox: /* @__PURE__ */ o(S, { children: [
|
|
437
437
|
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
438
438
|
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
439
439
|
] }),
|
|
440
|
-
archive: /* @__PURE__ */
|
|
440
|
+
archive: /* @__PURE__ */ o(S, { children: [
|
|
441
441
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
442
442
|
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
443
443
|
] }),
|
|
444
|
-
trash: /* @__PURE__ */
|
|
444
|
+
trash: /* @__PURE__ */ o(S, { children: [
|
|
445
445
|
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
446
446
|
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
447
447
|
] }),
|
|
448
448
|
paperclip: /* @__PURE__ */ e("path", { d: "m20 11-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L14 7" }),
|
|
449
|
-
mic: /* @__PURE__ */
|
|
449
|
+
mic: /* @__PURE__ */ o(S, { children: [
|
|
450
450
|
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
451
451
|
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
452
452
|
] }),
|
|
453
|
-
speaker: /* @__PURE__ */
|
|
453
|
+
speaker: /* @__PURE__ */ o(S, { children: [
|
|
454
454
|
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
455
455
|
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
456
456
|
] }),
|
|
457
|
-
"user-plus": /* @__PURE__ */
|
|
457
|
+
"user-plus": /* @__PURE__ */ o(S, { children: [
|
|
458
458
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
459
459
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
460
460
|
] }),
|
|
461
461
|
"phone-off": /* @__PURE__ */ e("path", { d: "M3 14c5-5 13-5 18 0l-2 3-4-1v-3a10 10 0 0 0-6 0v3l-4 1Z" }),
|
|
462
|
-
video: /* @__PURE__ */
|
|
462
|
+
video: /* @__PURE__ */ o(S, { children: [
|
|
463
463
|
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
464
464
|
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
465
465
|
] }),
|
|
466
|
-
info: /* @__PURE__ */
|
|
466
|
+
info: /* @__PURE__ */ o(S, { children: [
|
|
467
467
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
468
468
|
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
469
469
|
] }),
|
|
@@ -472,7 +472,7 @@ const $e = {
|
|
|
472
472
|
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
473
473
|
folder: /* @__PURE__ */ e("path", { d: "M3 6a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" }),
|
|
474
474
|
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
475
|
-
server: /* @__PURE__ */
|
|
475
|
+
server: /* @__PURE__ */ o(S, { children: [
|
|
476
476
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
477
477
|
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
478
478
|
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
@@ -536,7 +536,7 @@ function Ge(n) {
|
|
|
536
536
|
return n.getClientRects().length > 0;
|
|
537
537
|
}
|
|
538
538
|
function Dn(n) {
|
|
539
|
-
const { name: l, badge: t, closeLabel:
|
|
539
|
+
const { name: l, badge: t, closeLabel: d, onClose: m, actions: s = [], moreLabel: r = "More", edit: i, editing: u, state: b, siblings: c, bar: h, thumbnails: a, strip: g, onZoom: p, children: v } = n, N = R(null), k = R(null), x = q(), [M, C] = D(!1), U = R(null);
|
|
540
540
|
J(() => {
|
|
541
541
|
var V;
|
|
542
542
|
const y = document.activeElement, F = document.body.style.overflow;
|
|
@@ -558,7 +558,7 @@ function Dn(n) {
|
|
|
558
558
|
Math.abs(E) < je || Math.abs(E) < Math.abs(V.clientY - F.y) || (E > 0 ? (X = c == null ? void 0 : c.onPrevious) == null || X.call(c) : (B = c == null ? void 0 : c.onNext) == null || B.call(c));
|
|
559
559
|
};
|
|
560
560
|
return xe(
|
|
561
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ o(
|
|
562
562
|
"div",
|
|
563
563
|
{
|
|
564
564
|
ref: N,
|
|
@@ -581,27 +581,27 @@ function Dn(n) {
|
|
|
581
581
|
},
|
|
582
582
|
children: [
|
|
583
583
|
c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${c.position}` }) : null,
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label":
|
|
584
|
+
/* @__PURE__ */ o("header", { className: "cms-viewer__top", children: [
|
|
585
|
+
/* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": d, onClick: K, children: /* @__PURE__ */ e(z, { name: "close" }) }),
|
|
586
586
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
|
|
587
587
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
|
|
588
588
|
c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: c.position }) : null,
|
|
589
589
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
590
|
-
u !== void 0 ? /* @__PURE__ */
|
|
590
|
+
u !== void 0 ? /* @__PURE__ */ o(S, { children: [
|
|
591
591
|
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
|
|
592
592
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
|
|
593
|
-
] }) : /* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */
|
|
593
|
+
] }) : /* @__PURE__ */ o(S, { children: [
|
|
594
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ o("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
|
|
595
595
|
y.icon,
|
|
596
596
|
y.label
|
|
597
597
|
] }, y.label)) }),
|
|
598
|
-
i !== void 0 ? /* @__PURE__ */
|
|
598
|
+
i !== void 0 ? /* @__PURE__ */ o("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": i.label, onClick: i.onEdit, children: [
|
|
599
599
|
i.icon,
|
|
600
600
|
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: i.label })
|
|
601
601
|
] }) : null,
|
|
602
|
-
s.length > 0 ? /* @__PURE__ */
|
|
602
|
+
s.length > 0 ? /* @__PURE__ */ o("span", { className: "cms-viewer__more", children: [
|
|
603
603
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": M, onClick: () => C((y) => !y), children: /* @__PURE__ */ e(P, { name: "more" }) }),
|
|
604
|
-
M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */
|
|
604
|
+
M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ o(
|
|
605
605
|
"button",
|
|
606
606
|
{
|
|
607
607
|
type: "button",
|
|
@@ -619,10 +619,10 @@ function Dn(n) {
|
|
|
619
619
|
] }) : null
|
|
620
620
|
] })
|
|
621
621
|
] }),
|
|
622
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ o("div", { className: "cms-viewer__body", children: [
|
|
623
623
|
a != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: a }) : null,
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
(u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ o("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: Q, children: [
|
|
625
|
+
(u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ o("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
626
626
|
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
|
|
627
627
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
|
|
628
628
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
|
|
@@ -678,28 +678,28 @@ const Ne = (n, l) => `${n}
|
|
|
678
678
|
${l}`, Qe = (n, l) => n === "" ? l : `${n}/${l}`, en = 48;
|
|
679
679
|
function Tn(n) {
|
|
680
680
|
var me, ue;
|
|
681
|
-
const { open: l, spaces: t, list:
|
|
681
|
+
const { open: l, spaces: t, list: d, disabledReason: m, budget: s, formatSize: r, labels: i, onConfirm: u, onCancel: b } = n, [c, h] = D(((me = t[0]) == null ? void 0 : me.id) ?? ""), [a, g] = D(""), [p, v] = D({ status: "loading" }), [N, k] = D(0), [x, M] = D(/* @__PURE__ */ new Map()), [C, U] = D(0), [K, le] = D(!1), Q = R(null), y = q();
|
|
682
682
|
J(() => {
|
|
683
683
|
var f;
|
|
684
684
|
l && (h(((f = t[0]) == null ? void 0 : f.id) ?? ""), g(""), M(/* @__PURE__ */ new Map()), le(!1));
|
|
685
685
|
}, [l]), J(() => {
|
|
686
686
|
if (!l || c === "") return;
|
|
687
687
|
let f = !0;
|
|
688
|
-
return v({ status: "loading" }), U(0),
|
|
688
|
+
return v({ status: "loading" }), U(0), d(c, a).then(
|
|
689
689
|
(w) => f && v({ status: "ready", entries: w.entries, next: w.next ?? null, paging: !1 }),
|
|
690
690
|
(w) => f && v({ status: w instanceof Je ? "denied" : "error" })
|
|
691
691
|
), () => {
|
|
692
692
|
f = !1;
|
|
693
693
|
};
|
|
694
|
-
}, [l, c, a,
|
|
694
|
+
}, [l, c, a, d, N]);
|
|
695
695
|
const F = be(() => {
|
|
696
696
|
if (p.status !== "ready" || p.next === null || p.paging) return;
|
|
697
697
|
const f = p.next, w = p.entries;
|
|
698
|
-
v({ ...p, paging: !0 }),
|
|
698
|
+
v({ ...p, paging: !0 }), d(c, a, f).then(
|
|
699
699
|
(I) => v({ status: "ready", entries: [...w, ...I.entries], next: I.next ?? null, paging: !1 }),
|
|
700
700
|
() => v({ status: "ready", entries: w, next: f, paging: !1 })
|
|
701
701
|
);
|
|
702
|
-
}, [p,
|
|
702
|
+
}, [p, d, c, a]), V = be((f) => {
|
|
703
703
|
var w;
|
|
704
704
|
return ((w = s == null ? void 0 : s.cost) == null ? void 0 : w.call(s, f)) ?? f.size ?? 0;
|
|
705
705
|
}, [s]), E = Pe(() => [...x.values()], [x]), X = E.reduce((f, w) => f + (w.size ?? 0), 0), B = s === void 0 ? null : s.limitBytes - s.usedBytes - E.reduce((f, w) => f + V(w), 0), G = B !== null && B < 0, ie = (f) => {
|
|
@@ -723,7 +723,7 @@ function Tn(n) {
|
|
|
723
723
|
U(H), H >= I - 1 && F();
|
|
724
724
|
} else f.key === "Enter" && (w == null ? void 0 : w.kind) === "folder" ? (f.preventDefault(), _(w)) : f.key === " " && (w == null ? void 0 : w.kind) === "file" ? (f.preventDefault(), ce(w)) : f.key === "Backspace" && a !== "" && (f.preventDefault(), A());
|
|
725
725
|
}, j = a === "" ? [] : a.split("/"), oe = ((ue = t.find((f) => f.id === c)) == null ? void 0 : ue.name) ?? "", de = (f) => `${y}-entry-${String(f)}`;
|
|
726
|
-
return /* @__PURE__ */
|
|
726
|
+
return /* @__PURE__ */ o(
|
|
727
727
|
Le,
|
|
728
728
|
{
|
|
729
729
|
open: l,
|
|
@@ -732,27 +732,27 @@ function Tn(n) {
|
|
|
732
732
|
closeLabel: i.close,
|
|
733
733
|
initialFocus: Q,
|
|
734
734
|
className: "cms-file-picker",
|
|
735
|
-
footer: /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
735
|
+
footer: /* @__PURE__ */ o("div", { className: "cms-file-picker__foot", children: [
|
|
736
|
+
/* @__PURE__ */ o("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
737
737
|
E.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(E.length, r(X)) }) : null,
|
|
738
738
|
s !== void 0 && B !== null ? /* @__PURE__ */ e("span", { className: T(G && "is-over"), children: G ? i.overBudget : i.left(r(Math.max(0, B)), r(s.limitBytes)) }) : null
|
|
739
739
|
] }),
|
|
740
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ o("div", { className: "cms-file-picker__actions", children: [
|
|
741
741
|
/* @__PURE__ */ e(ne, { variant: "secondary", onClick: b, children: i.cancel }),
|
|
742
742
|
/* @__PURE__ */ e(ne, { variant: "primary", disabled: E.length === 0 || G, onClick: () => u(E), children: i.confirm(E.length) })
|
|
743
743
|
] })
|
|
744
744
|
] }),
|
|
745
745
|
children: [
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
t.length > 1 ? /* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ o("div", { className: "cms-file-picker__top", children: [
|
|
747
|
+
t.length > 1 ? /* @__PURE__ */ o("label", { className: "cms-file-picker__space", children: [
|
|
748
748
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: i.space }),
|
|
749
749
|
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: c, onChange: (f) => {
|
|
750
750
|
h(f.target.value), g("");
|
|
751
751
|
}, children: t.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.name }, f.id)) })
|
|
752
752
|
] }) : null,
|
|
753
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ o("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
|
|
754
754
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: a === "", onClick: A, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
|
|
755
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ o("ol", { children: [
|
|
756
756
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": a === "" ? "location" : void 0, onClick: () => g(""), children: oe }) }),
|
|
757
757
|
j.map((f, w) => {
|
|
758
758
|
const I = j.slice(0, w + 1).join("/");
|
|
@@ -762,8 +762,8 @@ function Tn(n) {
|
|
|
762
762
|
] }),
|
|
763
763
|
E.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": K, onClick: () => le((f) => !f), children: i.selected(E.length) }) : null
|
|
764
764
|
] }),
|
|
765
|
-
K && E.length > 0 ? /* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([f, w]) => /* @__PURE__ */
|
|
765
|
+
K && E.length > 0 ? /* @__PURE__ */ o("div", { className: "cms-file-picker__chosen", children: [
|
|
766
|
+
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([f, w]) => /* @__PURE__ */ o("li", { children: [
|
|
767
767
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: w.name }),
|
|
768
768
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(w.name), onClick: () => Z(f), children: /* @__PURE__ */ e(z, { name: "close" }) })
|
|
769
769
|
] }, f)) }),
|
|
@@ -771,7 +771,7 @@ function Tn(n) {
|
|
|
771
771
|
M(/* @__PURE__ */ new Map()), le(!1);
|
|
772
772
|
}, children: i.clear })
|
|
773
773
|
] }) : null,
|
|
774
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ o("div", { className: "cms-file-picker__list", onScroll: (f) => {
|
|
775
775
|
const w = f.currentTarget;
|
|
776
776
|
w.scrollTop + w.clientHeight >= w.scrollHeight - en && F();
|
|
777
777
|
}, children: [
|
|
@@ -779,7 +779,7 @@ function Tn(n) {
|
|
|
779
779
|
p.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => k((f) => f + 1) } }) : null,
|
|
780
780
|
p.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: i.denied, placement: "block" }) : null,
|
|
781
781
|
p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: i.empty, placement: "block" }) : null,
|
|
782
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ o(
|
|
783
783
|
"div",
|
|
784
784
|
{
|
|
785
785
|
ref: Q,
|
|
@@ -794,7 +794,7 @@ function Tn(n) {
|
|
|
794
794
|
children: [
|
|
795
795
|
W.map((f, w) => {
|
|
796
796
|
const I = f.kind === "file" && x.has(Ne(c, f.id)), H = ie(f);
|
|
797
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ o(
|
|
798
798
|
"div",
|
|
799
799
|
{
|
|
800
800
|
id: de(w),
|
|
@@ -808,7 +808,7 @@ function Tn(n) {
|
|
|
808
808
|
children: [
|
|
809
809
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
|
|
810
810
|
/* @__PURE__ */ e(P, { name: f.kind === "folder" ? "folder" : "file" }),
|
|
811
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ o("span", { className: "cms-file-picker__text", children: [
|
|
812
812
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: f.name }),
|
|
813
813
|
H !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: H }) : null
|
|
814
814
|
] }),
|
|
@@ -827,25 +827,25 @@ function Tn(n) {
|
|
|
827
827
|
}
|
|
828
828
|
);
|
|
829
829
|
}
|
|
830
|
-
function En({ title: n, scope: l, actions: t, backLink:
|
|
831
|
-
return /* @__PURE__ */
|
|
832
|
-
|
|
830
|
+
function En({ title: n, scope: l, actions: t, backLink: d }) {
|
|
831
|
+
return /* @__PURE__ */ o("header", { className: "cms-page-header", children: [
|
|
832
|
+
d ? /* @__PURE__ */ o(
|
|
833
833
|
"a",
|
|
834
834
|
{
|
|
835
835
|
className: "cms-page-header__back",
|
|
836
|
-
href:
|
|
836
|
+
href: d.href ?? "#",
|
|
837
837
|
onClick: (m) => {
|
|
838
|
-
|
|
838
|
+
d.onBack && (m.preventDefault(), d.onBack());
|
|
839
839
|
},
|
|
840
840
|
children: [
|
|
841
841
|
/* @__PURE__ */ e(z, { name: "back" }),
|
|
842
842
|
" ",
|
|
843
|
-
|
|
843
|
+
d.label
|
|
844
844
|
]
|
|
845
845
|
}
|
|
846
846
|
) : null,
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ o("div", { className: "cms-page-header__row", children: [
|
|
848
|
+
/* @__PURE__ */ o("div", { className: "cms-page-header__titles", children: [
|
|
849
849
|
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
|
|
850
850
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
|
|
851
851
|
] }),
|
|
@@ -853,7 +853,7 @@ function En({ title: n, scope: l, actions: t, backLink: o }) {
|
|
|
853
853
|
] })
|
|
854
854
|
] });
|
|
855
855
|
}
|
|
856
|
-
function Ln({ tabs: n, active: l, onSelect: t, label:
|
|
856
|
+
function Ln({ tabs: n, active: l, onSelect: t, label: d }) {
|
|
857
857
|
const m = R([]), s = (r, i) => {
|
|
858
858
|
var h;
|
|
859
859
|
const u = n.length - 1, b = r.key === "ArrowRight" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" ? i === 0 ? u : i - 1 : r.key === "Home" ? 0 : r.key === "End" ? u : null;
|
|
@@ -862,9 +862,9 @@ function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
|
|
|
862
862
|
const c = n[b];
|
|
863
863
|
c && (t(c.id), (h = m.current[b]) == null || h.focus());
|
|
864
864
|
};
|
|
865
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label":
|
|
865
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": d, children: n.map((r, i) => {
|
|
866
866
|
const u = r.id === l;
|
|
867
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ o(
|
|
868
868
|
"button",
|
|
869
869
|
{
|
|
870
870
|
ref: (b) => {
|
|
@@ -887,9 +887,11 @@ function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
|
|
|
887
887
|
}) });
|
|
888
888
|
}
|
|
889
889
|
function nn(n) {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
890
|
+
const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (m) => {
|
|
891
|
+
var s;
|
|
892
|
+
return (s = m == null ? void 0 : m.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
|
|
893
|
+
};
|
|
894
|
+
return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
|
|
893
895
|
}
|
|
894
896
|
function ln(n) {
|
|
895
897
|
let l = 0;
|
|
@@ -897,12 +899,12 @@ function ln(n) {
|
|
|
897
899
|
l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
|
|
898
900
|
return l % 6 + 1;
|
|
899
901
|
}
|
|
900
|
-
function ve({ name: n, pictureUrl: l, presence: t, size:
|
|
901
|
-
return /* @__PURE__ */
|
|
902
|
+
function ve({ name: n, pictureUrl: l, presence: t, size: d = 32 }) {
|
|
903
|
+
return /* @__PURE__ */ o(
|
|
902
904
|
"span",
|
|
903
905
|
{
|
|
904
906
|
className: `cms-avatar cms-avatar--tint-${ln(n)}`,
|
|
905
|
-
style: { width:
|
|
907
|
+
style: { width: d, height: d, fontSize: Math.round(d * 0.4) },
|
|
906
908
|
role: "img",
|
|
907
909
|
"aria-label": t ? `${n}, ${t}` : n,
|
|
908
910
|
children: [
|
|
@@ -913,18 +915,18 @@ function ve({ name: n, pictureUrl: l, presence: t, size: o = 32 }) {
|
|
|
913
915
|
);
|
|
914
916
|
}
|
|
915
917
|
function tn({ count: n, label: l, max: t = 99 }) {
|
|
916
|
-
return n <= 0 ? null : /* @__PURE__ */
|
|
918
|
+
return n <= 0 ? null : /* @__PURE__ */ o("span", { className: "cms-badge", children: [
|
|
917
919
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
|
|
918
920
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
919
921
|
] });
|
|
920
922
|
}
|
|
921
|
-
function $n({ product: n, mark: l, rail: t, active:
|
|
922
|
-
return /* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
923
|
+
function $n({ product: n, mark: l, rail: t, active: d, onNavigate: m, server: s, search: r, account: i, children: u, railLabel: b = "Sections" }) {
|
|
924
|
+
return /* @__PURE__ */ o("div", { className: "cms-shell", children: [
|
|
925
|
+
/* @__PURE__ */ o("nav", { className: "cms-shell__rail", "aria-label": b, children: [
|
|
924
926
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
925
927
|
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((c) => {
|
|
926
|
-
const h = c.id ===
|
|
927
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
928
|
+
const h = c.id === d;
|
|
929
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
|
|
928
930
|
"a",
|
|
929
931
|
{
|
|
930
932
|
href: c.href,
|
|
@@ -935,7 +937,7 @@ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s,
|
|
|
935
937
|
m && (a.preventDefault(), m(c.id));
|
|
936
938
|
},
|
|
937
939
|
children: [
|
|
938
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ o("span", { className: "cms-shell__icon", children: [
|
|
939
941
|
/* @__PURE__ */ e(P, { name: c.icon, size: 22 }),
|
|
940
942
|
c.badge ? /* @__PURE__ */ e(tn, { count: c.badge.count, label: c.badge.label }) : null
|
|
941
943
|
] }),
|
|
@@ -945,7 +947,7 @@ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s,
|
|
|
945
947
|
) }, c.id);
|
|
946
948
|
}) })
|
|
947
949
|
] }),
|
|
948
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ o("header", { className: "cms-shell__top", children: [
|
|
949
951
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
950
952
|
s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
|
|
951
953
|
r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: r }) : null,
|
|
@@ -954,8 +956,8 @@ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s,
|
|
|
954
956
|
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
|
|
955
957
|
] });
|
|
956
958
|
}
|
|
957
|
-
function In({ label: n, placeholder: l, value: t, onChange:
|
|
958
|
-
return /* @__PURE__ */
|
|
959
|
+
function In({ label: n, placeholder: l, value: t, onChange: d, onSearch: m }) {
|
|
960
|
+
return /* @__PURE__ */ o(
|
|
959
961
|
"form",
|
|
960
962
|
{
|
|
961
963
|
role: "search",
|
|
@@ -973,14 +975,14 @@ function In({ label: n, placeholder: l, value: t, onChange: o, onSearch: m }) {
|
|
|
973
975
|
"aria-label": n,
|
|
974
976
|
placeholder: l,
|
|
975
977
|
value: t,
|
|
976
|
-
onChange: (s) =>
|
|
978
|
+
onChange: (s) => d(s.target.value)
|
|
977
979
|
}
|
|
978
980
|
)
|
|
979
981
|
]
|
|
980
982
|
}
|
|
981
983
|
);
|
|
982
984
|
}
|
|
983
|
-
function Pn({ options: n, value: l, onChange: t, label:
|
|
985
|
+
function Pn({ options: n, value: l, onChange: t, label: d }) {
|
|
984
986
|
const m = R([]), s = (r, i) => {
|
|
985
987
|
var h;
|
|
986
988
|
const u = n.length - 1, b = r.key === "ArrowRight" || r.key === "ArrowDown" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
|
|
@@ -989,9 +991,9 @@ function Pn({ options: n, value: l, onChange: t, label: o }) {
|
|
|
989
991
|
const c = n[b];
|
|
990
992
|
c && (t(c.id), (h = m.current[b]) == null || h.focus());
|
|
991
993
|
};
|
|
992
|
-
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label":
|
|
994
|
+
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": d, children: n.map((r, i) => {
|
|
993
995
|
const u = r.id === l;
|
|
994
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ o(
|
|
995
997
|
"button",
|
|
996
998
|
{
|
|
997
999
|
ref: (b) => {
|
|
@@ -1015,16 +1017,16 @@ function Pn({ options: n, value: l, onChange: t, label: o }) {
|
|
|
1015
1017
|
}
|
|
1016
1018
|
const De = 16;
|
|
1017
1019
|
function an(n, l, t) {
|
|
1018
|
-
const
|
|
1019
|
-
let m =
|
|
1020
|
-
for (let s =
|
|
1021
|
-
const r = Math.min(m,
|
|
1022
|
-
|
|
1020
|
+
const d = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
|
|
1021
|
+
let m = d.reduce((s, r) => s + r, 0) + t - l;
|
|
1022
|
+
for (let s = d.length - 1; s >= 0 && m > 0; s -= 1) {
|
|
1023
|
+
const r = Math.min(m, d[s] - n[s].min);
|
|
1024
|
+
d[s] = d[s] - r, m -= r;
|
|
1023
1025
|
}
|
|
1024
|
-
return
|
|
1026
|
+
return d;
|
|
1025
1027
|
}
|
|
1026
|
-
function sn({ index: n, size: l, shown: t, others:
|
|
1027
|
-
const i = Math.max(l.min, Math.min(l.max, m > 0 ? m -
|
|
1028
|
+
function sn({ index: n, size: l, shown: t, others: d, room: m, lastMin: s, onResize: r }) {
|
|
1029
|
+
const i = Math.max(l.min, Math.min(l.max, m > 0 ? m - d - s : l.max)), u = (h) => Math.round(Math.min(Math.max(h, l.min), i)), b = R(null), c = (h, a) => r == null ? void 0 : r(n, u(h), a);
|
|
1028
1030
|
return /* @__PURE__ */ e(
|
|
1029
1031
|
"div",
|
|
1030
1032
|
{
|
|
@@ -1063,8 +1065,8 @@ function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onRes
|
|
|
1063
1065
|
}
|
|
1064
1066
|
);
|
|
1065
1067
|
}
|
|
1066
|
-
function Fn({ panes: n, active: l, back: t, sizes:
|
|
1067
|
-
const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), i = R(null), [u, b] = D(0), c = (
|
|
1068
|
+
function Fn({ panes: n, active: l, back: t, sizes: d, lastMin: m = 360, onResize: s }) {
|
|
1069
|
+
const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), i = R(null), [u, b] = D(0), c = (d ?? []).slice(0, n.length - 1), h = c.length === n.length - 1 && c.every((p) => p !== void 0);
|
|
1068
1070
|
ke(() => {
|
|
1069
1071
|
const p = i.current;
|
|
1070
1072
|
if (p === null || !h) return;
|
|
@@ -1077,7 +1079,7 @@ function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize
|
|
|
1077
1079
|
[`--split-pane-${String(v)}`, `${String(p)}px`],
|
|
1078
1080
|
[`--split-pane-end-${String(v)}`, `${String(a.slice(0, v + 1).reduce((N, k) => N + k, 0))}px`]
|
|
1079
1081
|
])) : void 0;
|
|
1080
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ o(
|
|
1081
1083
|
"div",
|
|
1082
1084
|
{
|
|
1083
1085
|
ref: i,
|
|
@@ -1085,8 +1087,8 @@ function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize
|
|
|
1085
1087
|
"data-active": r,
|
|
1086
1088
|
style: g,
|
|
1087
1089
|
children: [
|
|
1088
|
-
n.map((p, v) => /* @__PURE__ */
|
|
1089
|
-
v === r && t ? /* @__PURE__ */
|
|
1090
|
+
n.map((p, v) => /* @__PURE__ */ o("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - v, children: [
|
|
1091
|
+
v === r && t ? /* @__PURE__ */ o("a", { className: "cms-panes__back", href: t.href, children: [
|
|
1090
1092
|
/* @__PURE__ */ e(P, { name: "chevron-left", size: 18 }),
|
|
1091
1093
|
t.label
|
|
1092
1094
|
] }) : null,
|
|
@@ -1110,9 +1112,9 @@ function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize
|
|
|
1110
1112
|
);
|
|
1111
1113
|
}
|
|
1112
1114
|
const rn = { attachment: "Has an attachment", unread: "Unread" };
|
|
1113
|
-
function Bn({ from: n, subject: l, preview: t, time:
|
|
1115
|
+
function Bn({ from: n, subject: l, preview: t, time: d, unread: m, hasAttachment: s, selected: r, onOpen: i, labels: u }) {
|
|
1114
1116
|
const b = re(rn, u);
|
|
1115
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ o(
|
|
1116
1118
|
"button",
|
|
1117
1119
|
{
|
|
1118
1120
|
type: "button",
|
|
@@ -1121,13 +1123,13 @@ function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment
|
|
|
1121
1123
|
onClick: i,
|
|
1122
1124
|
children: [
|
|
1123
1125
|
/* @__PURE__ */ e(ve, { name: n, size: 40 }),
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ o("span", { className: "cms-mail-row__body", children: [
|
|
1127
|
+
/* @__PURE__ */ o("span", { className: "cms-mail-row__line", children: [
|
|
1126
1128
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
1127
1129
|
s ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: b.attachment }) : null,
|
|
1128
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children:
|
|
1130
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: d })
|
|
1129
1131
|
] }),
|
|
1130
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ o("span", { className: "cms-mail-row__line", children: [
|
|
1131
1133
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
1132
1134
|
m ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": b.unread }) : null
|
|
1133
1135
|
] }),
|
|
@@ -1137,23 +1139,23 @@ function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment
|
|
|
1137
1139
|
}
|
|
1138
1140
|
);
|
|
1139
1141
|
}
|
|
1140
|
-
function Kn({ direction: n, children: l, time: t, read:
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
+
function Kn({ direction: n, children: l, time: t, read: d, readLabel: m = "Read" }) {
|
|
1143
|
+
return /* @__PURE__ */ o("div", { className: T("cms-bubble", `cms-bubble--${n}`), children: [
|
|
1142
1144
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
|
|
1143
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ o("div", { className: "cms-bubble__meta", children: [
|
|
1144
1146
|
t,
|
|
1145
|
-
n === "out" &&
|
|
1147
|
+
n === "out" && d ? /* @__PURE__ */ o(S, { children: [
|
|
1146
1148
|
" · ",
|
|
1147
1149
|
m
|
|
1148
1150
|
] }) : null
|
|
1149
1151
|
] })
|
|
1150
1152
|
] });
|
|
1151
1153
|
}
|
|
1152
|
-
function Hn({ label: n, value: l, onChange: t, onSend:
|
|
1154
|
+
function Hn({ label: n, value: l, onChange: t, onSend: d, onAttach: m, placeholder: s, variant: r = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: b, canSend: c }) {
|
|
1153
1155
|
const h = q(), a = c ?? l.trim() !== "", g = (v) => {
|
|
1154
|
-
v.preventDefault(), a &&
|
|
1156
|
+
v.preventDefault(), a && d();
|
|
1155
1157
|
}, p = m ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: m, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
|
|
1156
|
-
return /* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ o("form", { className: T("cms-composer", `cms-composer--${r}`), onSubmit: g, children: [
|
|
1157
1159
|
/* @__PURE__ */ e("label", { htmlFor: h, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1158
1160
|
r === "chat" ? p : null,
|
|
1159
1161
|
/* @__PURE__ */ e(
|
|
@@ -1166,13 +1168,13 @@ function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placehold
|
|
|
1166
1168
|
value: l,
|
|
1167
1169
|
onChange: (v) => t(v.target.value),
|
|
1168
1170
|
onKeyDown: (v) => {
|
|
1169
|
-
v.nativeEvent.isComposing || v.keyCode === 229 || r === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a &&
|
|
1171
|
+
v.nativeEvent.isComposing || v.keyCode === 229 || r === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a && d());
|
|
1170
1172
|
}
|
|
1171
1173
|
}
|
|
1172
1174
|
),
|
|
1173
1175
|
r === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
|
|
1174
1176
|
r === "reply" ? p : null,
|
|
1175
|
-
r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !a, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */
|
|
1177
|
+
r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !a, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ o("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !a, children: [
|
|
1176
1178
|
i,
|
|
1177
1179
|
" ",
|
|
1178
1180
|
/* @__PURE__ */ e(P, { name: "send", size: 18 })
|
|
@@ -1200,24 +1202,24 @@ const Se = {
|
|
|
1200
1202
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1201
1203
|
returnToCall: "Return to call"
|
|
1202
1204
|
};
|
|
1203
|
-
function On({ name: n, media: l, onAccept: t, onDecline:
|
|
1205
|
+
function On({ name: n, media: l, onAccept: t, onDecline: d, labels: m }) {
|
|
1204
1206
|
const s = re(Se, m), r = l === "video" ? s.incomingVideo : s.incomingAudio;
|
|
1205
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ o("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(r, n), children: [
|
|
1206
1208
|
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
|
|
1207
1209
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1208
1210
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: r }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick:
|
|
1211
|
+
/* @__PURE__ */ o("div", { className: "cms-call-incoming__actions", children: [
|
|
1212
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: d }),
|
|
1211
1213
|
/* @__PURE__ */ e(ae, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
|
|
1212
1214
|
] })
|
|
1213
1215
|
] });
|
|
1214
1216
|
}
|
|
1215
|
-
function ae({ icon: n, label: l, onClick: t, tone:
|
|
1216
|
-
return /* @__PURE__ */
|
|
1217
|
+
function ae({ icon: n, label: l, onClick: t, tone: d = "plain", pressed: m }) {
|
|
1218
|
+
return /* @__PURE__ */ o(
|
|
1217
1219
|
"button",
|
|
1218
1220
|
{
|
|
1219
1221
|
type: "button",
|
|
1220
|
-
className: T("cms-call-button", `cms-call-button--${
|
|
1222
|
+
className: T("cms-call-button", `cms-call-button--${d}`, m && "is-pressed"),
|
|
1221
1223
|
"aria-pressed": m,
|
|
1222
1224
|
onClick: t,
|
|
1223
1225
|
children: [
|
|
@@ -1227,23 +1229,23 @@ function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: m }) {
|
|
|
1227
1229
|
}
|
|
1228
1230
|
);
|
|
1229
1231
|
}
|
|
1230
|
-
function Un({ name: n, duration: l, connection: t, you:
|
|
1232
|
+
function Un({ name: n, duration: l, connection: t, you: d, muted: m, speaker: s, onToggleMute: r, onToggleSpeaker: i, onAddPerson: u, onChat: b, onHangUp: c, labels: h }) {
|
|
1231
1233
|
const a = re(Se, h);
|
|
1232
|
-
return /* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
+
return /* @__PURE__ */ o("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
|
|
1235
|
+
/* @__PURE__ */ o("div", { className: "cms-call-panel__head", children: [
|
|
1234
1236
|
/* @__PURE__ */ e(ve, { name: n, size: 64 }),
|
|
1235
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ o("div", { className: "cms-call-panel__who", children: [
|
|
1236
1238
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1237
1239
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": a.callTime(l), children: l })
|
|
1238
1240
|
] }),
|
|
1239
1241
|
/* @__PURE__ */ e("span", { className: T("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
|
|
1240
1242
|
] }),
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */ e(ve, { name:
|
|
1243
|
+
/* @__PURE__ */ o("div", { className: "cms-call-panel__you", children: [
|
|
1244
|
+
/* @__PURE__ */ e(ve, { name: d.name, size: 36 }),
|
|
1243
1245
|
/* @__PURE__ */ e("span", { children: a.you }),
|
|
1244
|
-
|
|
1246
|
+
d.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": a.speaking }) : null
|
|
1245
1247
|
] }),
|
|
1246
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ o("div", { className: "cms-call-panel__controls", children: [
|
|
1247
1249
|
/* @__PURE__ */ e(ae, { icon: "mic", label: m ? a.unmute : a.mute, pressed: m, onClick: r }),
|
|
1248
1250
|
/* @__PURE__ */ e(ae, { icon: "speaker", label: a.speaker, pressed: s, onClick: i }),
|
|
1249
1251
|
u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: a.addPerson, onClick: u }) : null,
|
|
@@ -1252,30 +1254,30 @@ function Un({ name: n, duration: l, connection: t, you: o, muted: m, speaker: s,
|
|
|
1252
1254
|
] })
|
|
1253
1255
|
] });
|
|
1254
1256
|
}
|
|
1255
|
-
function Rn({ name: n, duration: l, muted: t, onToggleMute:
|
|
1257
|
+
function Rn({ name: n, duration: l, muted: t, onToggleMute: d, onReturn: m, onHangUp: s, labels: r }) {
|
|
1256
1258
|
const i = re(Se, r);
|
|
1257
|
-
return /* @__PURE__ */
|
|
1259
|
+
return /* @__PURE__ */ o("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
|
|
1258
1260
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1259
1261
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: i.onCallWith(n) }),
|
|
1260
1262
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? i.unmute : i.mute, "aria-pressed": t, onClick:
|
|
1263
|
+
/* @__PURE__ */ o("span", { className: "cms-call-bar__actions", children: [
|
|
1264
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? i.unmute : i.mute, "aria-pressed": t, onClick: d, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
|
|
1263
1265
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: m, children: i.returnToCall }),
|
|
1264
1266
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": i.hangUp, onClick: s, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
|
|
1265
1267
|
] })
|
|
1266
1268
|
] });
|
|
1267
1269
|
}
|
|
1268
|
-
function zn({ mark: n, product: l, headline: t, lead:
|
|
1269
|
-
return /* @__PURE__ */
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
/* @__PURE__ */
|
|
1270
|
+
function zn({ mark: n, product: l, headline: t, lead: d, features: m = [], children: s }) {
|
|
1271
|
+
return /* @__PURE__ */ o("div", { className: "cms-signin", children: [
|
|
1272
|
+
/* @__PURE__ */ o("aside", { className: "cms-signin__brand", children: [
|
|
1273
|
+
/* @__PURE__ */ o("p", { className: "cms-signin__logo", children: [
|
|
1272
1274
|
/* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
|
|
1273
1275
|
l
|
|
1274
1276
|
] }),
|
|
1275
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ o("div", { className: "cms-signin__pitch", children: [
|
|
1276
1278
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
|
|
1277
|
-
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children:
|
|
1278
|
-
m.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: m.map((r) => /* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: d }),
|
|
1280
|
+
m.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: m.map((r) => /* @__PURE__ */ o("li", { children: [
|
|
1279
1281
|
/* @__PURE__ */ e(P, { name: r.icon, size: 18 }),
|
|
1280
1282
|
r.label
|
|
1281
1283
|
] }, r.label)) }) : null
|
|
@@ -1296,13 +1298,13 @@ const cn = {
|
|
|
1296
1298
|
newHere: "New here?",
|
|
1297
1299
|
create: "Create an account"
|
|
1298
1300
|
};
|
|
1299
|
-
function Zn({ server: n, onSubmit: l, forgotHref: t, createHref:
|
|
1301
|
+
function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: d, error: m, busy: s, labels: r }) {
|
|
1300
1302
|
const i = re(cn, r), u = q(), [b, c] = D(""), [h, a] = D(""), [g, p] = D(!1);
|
|
1301
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ o("form", { className: "cms-signin-form", onSubmit: (N) => {
|
|
1302
1304
|
N.preventDefault(), l(b, h);
|
|
1303
1305
|
}, "aria-describedby": m ? `${u}-error` : void 0, children: [
|
|
1304
1306
|
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ o("p", { className: "cms-signin-form__server", children: [
|
|
1306
1308
|
/* @__PURE__ */ e(P, { name: "server", size: 18 }),
|
|
1307
1309
|
n
|
|
1308
1310
|
] }),
|
|
@@ -1321,7 +1323,7 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
|
|
|
1321
1323
|
}
|
|
1322
1324
|
),
|
|
1323
1325
|
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: i.password }),
|
|
1324
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ o("span", { className: "cms-signin-form__password", children: [
|
|
1325
1327
|
/* @__PURE__ */ e(
|
|
1326
1328
|
"input",
|
|
1327
1329
|
{
|
|
@@ -1339,15 +1341,15 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
|
|
|
1339
1341
|
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: i.forgot }) : null,
|
|
1340
1342
|
m ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: m }) : null,
|
|
1341
1343
|
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: i.submit }),
|
|
1342
|
-
|
|
1344
|
+
d ? /* @__PURE__ */ o(S, { children: [
|
|
1343
1345
|
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: i.newHere }) }),
|
|
1344
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href:
|
|
1346
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: d, children: i.create })
|
|
1345
1347
|
] }) : null
|
|
1346
1348
|
] });
|
|
1347
1349
|
}
|
|
1348
|
-
function Vn({ label: n, rows: l, error: t, onRetry:
|
|
1350
|
+
function Vn({ label: n, rows: l, error: t, onRetry: d, loadingText: m = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: i, onOpen: u, onRowMenu: b }) {
|
|
1349
1351
|
const c = R([]);
|
|
1350
|
-
if (t != null) return /* @__PURE__ */ e(ze, { message: t, onRetry:
|
|
1352
|
+
if (t != null) return /* @__PURE__ */ e(ze, { message: t, onRetry: d });
|
|
1351
1353
|
if (l === null) return /* @__PURE__ */ e(Ue, { what: m, layout: "block" });
|
|
1352
1354
|
if (l.length === 0) return /* @__PURE__ */ e(Re, { title: s, hint: r });
|
|
1353
1355
|
const h = (a, g, p) => {
|
|
@@ -1364,7 +1366,7 @@ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading
|
|
|
1364
1366
|
};
|
|
1365
1367
|
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((a, g) => {
|
|
1366
1368
|
const p = a.id === i;
|
|
1367
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ o(
|
|
1368
1370
|
"li",
|
|
1369
1371
|
{
|
|
1370
1372
|
ref: (v) => {
|
|
@@ -1381,7 +1383,7 @@ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading
|
|
|
1381
1383
|
} : void 0,
|
|
1382
1384
|
children: [
|
|
1383
1385
|
a.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: a.lead }) : null,
|
|
1384
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ o("span", { className: "cms-list__text", children: [
|
|
1385
1387
|
/* @__PURE__ */ e("span", { className: "cms-list__primary", children: a.primary }),
|
|
1386
1388
|
a.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: a.secondary }) : null
|
|
1387
1389
|
] }),
|
|
@@ -1392,7 +1394,7 @@ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading
|
|
|
1392
1394
|
);
|
|
1393
1395
|
}) });
|
|
1394
1396
|
}
|
|
1395
|
-
function on({ at: n, items: l, onClose: t, label:
|
|
1397
|
+
function on({ at: n, items: l, onClose: t, label: d = "Actions", focus: m = "first" }) {
|
|
1396
1398
|
const s = R(null), r = R(null), i = q(), [u, b] = D(n), c = l.filter((a) => a.offer.offered);
|
|
1397
1399
|
if (ke(() => {
|
|
1398
1400
|
if (!n) return;
|
|
@@ -1431,13 +1433,13 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
|
|
|
1431
1433
|
ref: s,
|
|
1432
1434
|
className: "cms-menu",
|
|
1433
1435
|
role: "menu",
|
|
1434
|
-
"aria-label":
|
|
1436
|
+
"aria-label": d,
|
|
1435
1437
|
style: { left: (u ?? n).x, top: (u ?? n).y },
|
|
1436
1438
|
onKeyDown: h,
|
|
1437
1439
|
onContextMenu: (a) => a.preventDefault(),
|
|
1438
1440
|
children: c.map((a) => {
|
|
1439
1441
|
const g = a.offer.refusal !== void 0;
|
|
1440
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ o(
|
|
1441
1443
|
"div",
|
|
1442
1444
|
{
|
|
1443
1445
|
role: "menuitem",
|
|
@@ -1475,10 +1477,10 @@ function dn(n) {
|
|
|
1475
1477
|
function mn(n) {
|
|
1476
1478
|
const l = /* @__PURE__ */ new Map();
|
|
1477
1479
|
for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
|
|
1478
|
-
return [...l.entries()].sort(([t], [
|
|
1480
|
+
return [...l.entries()].sort(([t], [d]) => t - d).map(([, t]) => t);
|
|
1479
1481
|
}
|
|
1480
|
-
function Wn({ label: n, actions: l, onAction: t, status:
|
|
1481
|
-
const r = R(null), i = R(null), [u, b] = D(Te), [c, h] = D(null), [a, g] = D("first"), [p, v] = D(null), [N, k] = D(null), x = dn(l), M = mn(l), C = x.flat(), U = C.filter((_) => _.overflow === 0), K = C.filter((_) => _.overflow !== 0), le = JSON.stringify([l.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]),
|
|
1482
|
+
function Wn({ label: n, actions: l, onAction: t, status: d, moreLabel: m, leading: s }) {
|
|
1483
|
+
const r = R(null), i = R(null), [u, b] = D(Te), [c, h] = D(null), [a, g] = D("first"), [p, v] = D(null), [N, k] = D(null), x = dn(l), M = mn(l), C = x.flat(), U = C.filter((_) => _.overflow === 0), K = C.filter((_) => _.overflow !== 0), le = JSON.stringify([l.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]), d ?? "", s !== void 0]), Q = be(() => {
|
|
1482
1484
|
const _ = r.current, A = i.current;
|
|
1483
1485
|
if (_ === null || A === null) return;
|
|
1484
1486
|
const Z = getComputedStyle(_), W = parseFloat(Z.columnGap || "0") || 0, L = _.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), j = ($) => {
|
|
@@ -1536,7 +1538,7 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
|
|
|
1536
1538
|
v(W), (j = (L = r.current) == null ? void 0 : L.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
|
|
1537
1539
|
}, ce = E.map((_) => ({
|
|
1538
1540
|
id: _.id,
|
|
1539
|
-
label: /* @__PURE__ */
|
|
1541
|
+
label: /* @__PURE__ */ o(S, { children: [
|
|
1540
1542
|
/* @__PURE__ */ e(fe, { name: _.icon }),
|
|
1541
1543
|
_.label
|
|
1542
1544
|
] }),
|
|
@@ -1546,7 +1548,7 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
|
|
|
1546
1548
|
!_.disabled && !_.busy && t(_.id);
|
|
1547
1549
|
}
|
|
1548
1550
|
}));
|
|
1549
|
-
return /* @__PURE__ */
|
|
1551
|
+
return /* @__PURE__ */ o(
|
|
1550
1552
|
"div",
|
|
1551
1553
|
{
|
|
1552
1554
|
ref: r,
|
|
@@ -1562,7 +1564,7 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
|
|
|
1562
1564
|
s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
|
|
1563
1565
|
x.map((_, A) => {
|
|
1564
1566
|
const Z = _.filter((L) => !y.has(L.id)), W = x.slice(0, A).some((L) => L.some((j) => !y.has(j.id)));
|
|
1565
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ o("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1566
1568
|
Z.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1567
1569
|
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: _.map((L) => /* @__PURE__ */ e(
|
|
1568
1570
|
un,
|
|
@@ -1608,14 +1610,14 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
|
|
|
1608
1610
|
children: /* @__PURE__ */ e(P, { name: "more" })
|
|
1609
1611
|
}
|
|
1610
1612
|
) : null,
|
|
1611
|
-
|
|
1613
|
+
d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: d, children: d }) : null,
|
|
1612
1614
|
/* @__PURE__ */ e(on, { at: c, items: ce, onClose: () => h(null), label: m, focus: a }),
|
|
1613
|
-
/* @__PURE__ */
|
|
1615
|
+
/* @__PURE__ */ o("div", { ref: i, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
1614
1616
|
s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
|
|
1615
1617
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
1616
1618
|
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
|
|
1617
|
-
C.map((_) => /* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
+
C.map((_) => /* @__PURE__ */ o("span", { children: [
|
|
1620
|
+
/* @__PURE__ */ o("span", { "data-measure": "full", "data-measure-action": _.id, className: "cms-pane-toolbar__action", children: [
|
|
1619
1621
|
/* @__PURE__ */ e(fe, { name: _.icon }),
|
|
1620
1622
|
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label })
|
|
1621
1623
|
] }),
|
|
@@ -1626,7 +1628,7 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
|
|
|
1626
1628
|
}
|
|
1627
1629
|
);
|
|
1628
1630
|
}
|
|
1629
|
-
function un({ action: n, labels: l, overflowed: t, pinned:
|
|
1631
|
+
function un({ action: n, labels: l, overflowed: t, pinned: d, tabbable: m, tipOff: s, onChoose: r, onFocus: i }) {
|
|
1630
1632
|
const [u, b] = D(!1);
|
|
1631
1633
|
J(() => {
|
|
1632
1634
|
if (!n.busy) {
|
|
@@ -1637,7 +1639,7 @@ function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOf
|
|
|
1637
1639
|
return () => clearTimeout(k);
|
|
1638
1640
|
}, [n.busy]);
|
|
1639
1641
|
const c = _e(n.icon) === null, h = l || c, a = n.disabled && n.reason ? n.reason : null, g = a ?? (h ? null : n.label), p = q(), [v, N] = D(!1);
|
|
1640
|
-
return /* @__PURE__ */
|
|
1642
|
+
return /* @__PURE__ */ o(
|
|
1641
1643
|
"button",
|
|
1642
1644
|
{
|
|
1643
1645
|
type: "button",
|
|
@@ -1645,7 +1647,7 @@ function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOf
|
|
|
1645
1647
|
"data-action": n.id,
|
|
1646
1648
|
"data-stop": n.id,
|
|
1647
1649
|
...t ? { "data-overflowed": "" } : {},
|
|
1648
|
-
...
|
|
1650
|
+
...d ? { "data-pinned": "" } : {},
|
|
1649
1651
|
hidden: t,
|
|
1650
1652
|
"aria-label": n.label,
|
|
1651
1653
|
"aria-disabled": n.disabled || void 0,
|
|
@@ -1673,15 +1675,15 @@ function fe({ name: n }) {
|
|
|
1673
1675
|
const l = _e(n);
|
|
1674
1676
|
return l === null ? null : /* @__PURE__ */ e(P, { name: l, size: 18 });
|
|
1675
1677
|
}
|
|
1676
|
-
function jn({ title: n, body: l = null, time: t = null, unread:
|
|
1678
|
+
function jn({ title: n, body: l = null, time: t = null, unread: d, unreadLabel: m, expandLabel: s, collapseLabel: r, action: i = null, onRead: u, leading: b }) {
|
|
1677
1679
|
const [c, h] = D(!1), a = q(), g = () => {
|
|
1678
|
-
|
|
1680
|
+
d && u();
|
|
1679
1681
|
}, p = (i == null ? void 0 : i.presentation) === "row" && i.onAction !== void 0, v = (i == null ? void 0 : i.presentation) === "button" && i.onAction !== void 0 ? i : null, N = () => {
|
|
1680
1682
|
var k;
|
|
1681
1683
|
g(), p && ((k = i.onAction) == null || k.call(i));
|
|
1682
1684
|
};
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ o("article", { className: T("cms-notification", d && "is-unread", c && "is-expanded", p && "is-row-action"), "data-state": d ? "unread" : "read", children: [
|
|
1686
|
+
/* @__PURE__ */ o(
|
|
1685
1687
|
"div",
|
|
1686
1688
|
{
|
|
1687
1689
|
className: "cms-notification__row",
|
|
@@ -1694,10 +1696,10 @@ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1694
1696
|
},
|
|
1695
1697
|
children: [
|
|
1696
1698
|
b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
|
|
1699
|
+
/* @__PURE__ */ o("span", { className: "cms-notification__text", children: [
|
|
1700
|
+
/* @__PURE__ */ o("span", { className: "cms-notification__head", children: [
|
|
1701
|
+
/* @__PURE__ */ o("span", { className: "cms-notification__title", children: [
|
|
1702
|
+
d ? /* @__PURE__ */ o("span", { className: "cms-visually-hidden", children: [
|
|
1701
1703
|
m,
|
|
1702
1704
|
" "
|
|
1703
1705
|
] }) : null,
|
|
@@ -1707,7 +1709,7 @@ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1707
1709
|
] }),
|
|
1708
1710
|
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: a, children: l }) : null
|
|
1709
1711
|
] }),
|
|
1710
|
-
|
|
1712
|
+
d ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
1711
1713
|
]
|
|
1712
1714
|
}
|
|
1713
1715
|
),
|
|
@@ -1758,8 +1760,8 @@ function qn(n, l) {
|
|
|
1758
1760
|
function pn(n, l) {
|
|
1759
1761
|
if (!n) return;
|
|
1760
1762
|
if (typeof n.get == "function") return n.get(l) ?? void 0;
|
|
1761
|
-
const t = n,
|
|
1762
|
-
return
|
|
1763
|
+
const t = n, d = Object.keys(t).find((m) => m.toLowerCase() === l.toLowerCase());
|
|
1764
|
+
return d === void 0 ? void 0 : t[d];
|
|
1763
1765
|
}
|
|
1764
1766
|
function fn(n) {
|
|
1765
1767
|
if (n && typeof n == "object") {
|
|
@@ -1768,17 +1770,17 @@ function fn(n) {
|
|
|
1768
1770
|
if (typeof l.title == "string" && l.title !== "") return l.title;
|
|
1769
1771
|
}
|
|
1770
1772
|
}
|
|
1771
|
-
function Xn(n, l, t,
|
|
1773
|
+
function Xn(n, l, t, d) {
|
|
1772
1774
|
if (n !== 403) return { kind: "none" };
|
|
1773
1775
|
const m = fn(t);
|
|
1774
|
-
return pn(l, "X-Elevation-Required") !== void 0 ?
|
|
1776
|
+
return pn(l, "X-Elevation-Required") !== void 0 ? d.elevates ? { kind: "elevation-required", message: m ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: m ?? "The server refused this." };
|
|
1775
1777
|
}
|
|
1776
1778
|
const we = "coolms-kit:reread";
|
|
1777
1779
|
function Gn() {
|
|
1778
1780
|
window.dispatchEvent(new Event(we));
|
|
1779
1781
|
}
|
|
1780
1782
|
function Yn(n) {
|
|
1781
|
-
const [l, t] = D(void 0), [
|
|
1783
|
+
const [l, t] = D(void 0), [d, m] = D(void 0), [s, r] = D(!0), i = R(n);
|
|
1782
1784
|
i.current = n;
|
|
1783
1785
|
const u = R(0), b = be(() => {
|
|
1784
1786
|
const c = ++u.current;
|
|
@@ -1797,16 +1799,16 @@ function Yn(n) {
|
|
|
1797
1799
|
return window.addEventListener("focus", c), window.addEventListener(we, c), () => {
|
|
1798
1800
|
window.removeEventListener("focus", c), window.removeEventListener(we, c);
|
|
1799
1801
|
};
|
|
1800
|
-
}, [b]), { value: l, error:
|
|
1802
|
+
}, [b]), { value: l, error: d, loading: s, reread: b };
|
|
1801
1803
|
}
|
|
1802
1804
|
function Jn(n) {
|
|
1803
1805
|
return n === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
|
|
1804
1806
|
}
|
|
1805
1807
|
const bn = "/errors/client-update-required";
|
|
1806
1808
|
function _n(n, l) {
|
|
1807
|
-
const t = n.split(".").map((m) => Number.parseInt(m, 10) || 0),
|
|
1808
|
-
for (let m = 0; m < Math.max(t.length,
|
|
1809
|
-
const s = t[m] ?? 0, r =
|
|
1809
|
+
const t = n.split(".").map((m) => Number.parseInt(m, 10) || 0), d = l.split(".").map((m) => Number.parseInt(m, 10) || 0);
|
|
1810
|
+
for (let m = 0; m < Math.max(t.length, d.length); m++) {
|
|
1811
|
+
const s = t[m] ?? 0, r = d[m] ?? 0;
|
|
1810
1812
|
if (s !== r) return s < r;
|
|
1811
1813
|
}
|
|
1812
1814
|
return !1;
|