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