@coolms/ui-react 0.1.0-alpha.21 → 0.1.0-alpha.23
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 +13 -0
- package/dist/index.js +741 -726
- package/package.json +1 -1
- package/src/kit.css +1 -0
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useId as
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useId as G, useState as E, useRef as R, useEffect as Y, useCallback as be, useMemo as Oe, useLayoutEffect as xe, useContext as Ke, createContext as Ue } from "react";
|
|
3
3
|
import { createPortal as Me } from "react-dom";
|
|
4
4
|
function ce(n, l) {
|
|
5
5
|
const t = { ...n };
|
|
6
6
|
for (const o of Object.keys(l ?? {})) {
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const i = l == null ? void 0 : l[o];
|
|
8
|
+
i !== void 0 && (t[o] = i);
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function A(...n) {
|
|
13
13
|
return n.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
15
|
function z({ name: n }) {
|
|
@@ -36,44 +36,44 @@ function le({
|
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: t,
|
|
38
38
|
locked: o = !1,
|
|
39
|
-
lockedReason:
|
|
40
|
-
icon:
|
|
39
|
+
lockedReason: i,
|
|
40
|
+
icon: s,
|
|
41
41
|
disabled: r,
|
|
42
|
-
className:
|
|
42
|
+
className: a,
|
|
43
43
|
children: m,
|
|
44
|
-
type:
|
|
45
|
-
title:
|
|
44
|
+
type: _ = "button",
|
|
45
|
+
title: d,
|
|
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
|
-
type:
|
|
54
|
-
className:
|
|
55
|
-
disabled:
|
|
53
|
+
type: _,
|
|
54
|
+
className: A("cms-button", `cms-button--${n}`, l && "is-busy", o && "is-locked", a),
|
|
55
|
+
disabled: c,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
|
-
title: o ?
|
|
57
|
+
title: o ? i ?? d : d,
|
|
58
58
|
children: [
|
|
59
|
-
l ? /* @__PURE__ */ e(z, { name: "spinner" }) : o ? /* @__PURE__ */ e(z, { name: "lock" }) :
|
|
59
|
+
l ? /* @__PURE__ */ e(z, { name: "spinner" }) : o ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
|
|
60
60
|
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : m }),
|
|
61
|
-
o &&
|
|
61
|
+
o && i ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
|
-
|
|
63
|
+
i
|
|
64
64
|
] }) : null
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function Ce({ id: n, label: l, help: t, error: o, pinned:
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
function Ce({ id: n, label: l, help: t, error: o, pinned: i, children: s }) {
|
|
70
|
+
return /* @__PURE__ */ u("div", { className: A("cms-field", o != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
s,
|
|
73
|
+
i != null ? /* @__PURE__ */ u("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
74
74
|
/* @__PURE__ */ e(z, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
|
-
|
|
76
|
+
i
|
|
77
77
|
] }) : null,
|
|
78
78
|
o != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: o }) : null,
|
|
79
79
|
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
|
|
@@ -85,26 +85,26 @@ function Se(n, l) {
|
|
|
85
85
|
}
|
|
86
86
|
const ze = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Ze = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
87
|
function Ve(n, l, t) {
|
|
88
|
-
const o = (
|
|
89
|
-
const h = new Date(Date.UTC(
|
|
90
|
-
return h.setUTCFullYear(
|
|
91
|
-
},
|
|
88
|
+
const o = (s, r, a, m = 0, _ = 0, d = 0) => {
|
|
89
|
+
const h = new Date(Date.UTC(s, r - 1, a, m, _, d));
|
|
90
|
+
return h.setUTCFullYear(s), h.getUTCFullYear() === s && h.getUTCMonth() === r - 1 && h.getUTCDate() === a && h.getUTCHours() === m && h.getUTCMinutes() === _ && h.getUTCSeconds() === d ? h : null;
|
|
91
|
+
}, i = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
|
|
92
92
|
try {
|
|
93
93
|
if (n === "time") {
|
|
94
94
|
const r = l.match(Ze);
|
|
95
95
|
if (r === null) return l;
|
|
96
|
-
const
|
|
96
|
+
const a = i(r), m = o(2e3, 1, 1, a.hour, a.minute, a.second);
|
|
97
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 = o(Number(
|
|
99
|
+
const s = l.match(ze);
|
|
100
|
+
if (s === null) return l;
|
|
101
|
+
if (n === "date" && s[4] === void 0) {
|
|
102
|
+
const r = o(Number(s[1]), Number(s[2]), Number(s[3]));
|
|
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 = o(Number(
|
|
107
|
-
return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle:
|
|
105
|
+
if (n === "datetime-local" && s[4] !== void 0) {
|
|
106
|
+
const r = o(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
|
|
107
|
+
return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(r);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
110
110
|
return l;
|
|
@@ -112,16 +112,16 @@ function Ve(n, l, t) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
const We = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
-
function
|
|
116
|
-
const x =
|
|
117
|
-
return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned:
|
|
115
|
+
function Bn({ label: n, help: l, error: t, disabled: o, readOnly: i, pinned: s, value: r, onChange: a, placeholder: m, type: _ = "text", name: d, locale: h, min: c, max: f, step: p, minLength: g, maxLength: N, required: w }) {
|
|
116
|
+
const x = G(), S = i === !0 || s != null, C = S && We.has(_), F = _ === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
|
|
117
|
+
return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
118
118
|
"input",
|
|
119
119
|
{
|
|
120
120
|
id: x,
|
|
121
|
-
name:
|
|
122
|
-
type: C ? "text" :
|
|
121
|
+
name: d,
|
|
122
|
+
type: C ? "text" : _,
|
|
123
123
|
className: "cms-input",
|
|
124
|
-
value: C ? Ve(
|
|
124
|
+
value: C ? Ve(_, r, h) : r,
|
|
125
125
|
...C ? { "data-value": r } : {},
|
|
126
126
|
lang: h,
|
|
127
127
|
placeholder: m,
|
|
@@ -129,119 +129,119 @@ function Pn({ label: n, help: l, error: t, disabled: o, readOnly: c, pinned: a,
|
|
|
129
129
|
readOnly: S,
|
|
130
130
|
required: w,
|
|
131
131
|
"aria-required": w || void 0,
|
|
132
|
-
min: C ? void 0 :
|
|
133
|
-
max: C ? void 0 :
|
|
134
|
-
step: C ? void 0 :
|
|
132
|
+
min: C ? void 0 : c,
|
|
133
|
+
max: C ? void 0 : f,
|
|
134
|
+
step: C ? void 0 : p,
|
|
135
135
|
minLength: g,
|
|
136
136
|
maxLength: N,
|
|
137
|
-
inputMode:
|
|
137
|
+
inputMode: _ === "number" ? F ? "decimal" : "numeric" : void 0,
|
|
138
138
|
"aria-invalid": t != null || void 0,
|
|
139
|
-
"aria-describedby": Se(x, { help: l, error: t, pinned:
|
|
140
|
-
onChange: (H) =>
|
|
139
|
+
"aria-describedby": Se(x, { help: l, error: t, pinned: s }),
|
|
140
|
+
onChange: (H) => a == null ? void 0 : a(H.target.value)
|
|
141
141
|
}
|
|
142
142
|
) });
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const g =
|
|
146
|
-
return /* @__PURE__ */ e(Ce, { id: g, label: n, help: l, error: t, pinned:
|
|
144
|
+
function Fn({ label: n, help: l, error: t, disabled: o, readOnly: i, pinned: s, value: r, onChange: a, placeholder: m, rows: _ = 4, name: d, locale: h, minLength: c, maxLength: f, required: p }) {
|
|
145
|
+
const g = G();
|
|
146
|
+
return /* @__PURE__ */ e(Ce, { id: g, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
147
147
|
"textarea",
|
|
148
148
|
{
|
|
149
149
|
id: g,
|
|
150
|
-
name:
|
|
150
|
+
name: d,
|
|
151
151
|
className: "cms-input cms-textarea",
|
|
152
|
-
rows:
|
|
152
|
+
rows: _,
|
|
153
153
|
value: r,
|
|
154
154
|
lang: h,
|
|
155
155
|
placeholder: m,
|
|
156
156
|
disabled: o,
|
|
157
|
-
readOnly:
|
|
158
|
-
required:
|
|
159
|
-
"aria-required":
|
|
160
|
-
minLength:
|
|
161
|
-
maxLength:
|
|
157
|
+
readOnly: i === !0 || s != null,
|
|
158
|
+
required: p,
|
|
159
|
+
"aria-required": p || void 0,
|
|
160
|
+
minLength: c,
|
|
161
|
+
maxLength: f,
|
|
162
162
|
"aria-invalid": t != null || void 0,
|
|
163
|
-
"aria-describedby": Se(g, { help: l, error: t, pinned:
|
|
164
|
-
onChange: (N) =>
|
|
163
|
+
"aria-describedby": Se(g, { help: l, error: t, pinned: s }),
|
|
164
|
+
onChange: (N) => a == null ? void 0 : a(N.target.value)
|
|
165
165
|
}
|
|
166
166
|
) });
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
return /* @__PURE__ */ e(Ce, { id:
|
|
168
|
+
function Hn({ label: n, help: l, error: t, disabled: o, readOnly: i, value: s, options: r, onChange: a, emptyText: m = "Nothing to choose from yet.", name: _ }) {
|
|
169
|
+
const d = G(), h = r.length === 0;
|
|
170
|
+
return /* @__PURE__ */ e(Ce, { id: d, label: n, help: h ? m : l, error: t, children: /* @__PURE__ */ e(
|
|
171
171
|
"select",
|
|
172
172
|
{
|
|
173
|
-
id:
|
|
174
|
-
name:
|
|
173
|
+
id: d,
|
|
174
|
+
name: _,
|
|
175
175
|
className: "cms-input cms-select",
|
|
176
|
-
value:
|
|
176
|
+
value: s,
|
|
177
177
|
disabled: o || h,
|
|
178
|
-
"aria-readonly":
|
|
178
|
+
"aria-readonly": i || void 0,
|
|
179
179
|
"aria-invalid": t != null || void 0,
|
|
180
|
-
"aria-describedby": Se(
|
|
181
|
-
onChange: (
|
|
182
|
-
|
|
180
|
+
"aria-describedby": Se(d, { help: h ? m : l, error: t }),
|
|
181
|
+
onChange: (c) => {
|
|
182
|
+
i || a == null || a(c.target.value);
|
|
183
183
|
},
|
|
184
|
-
children: r.map((
|
|
184
|
+
children: r.map((c) => /* @__PURE__ */ e("option", { value: c.value, disabled: i && c.value !== s, children: c.label }, c.value))
|
|
185
185
|
}
|
|
186
186
|
) });
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
const r =
|
|
190
|
-
return /* @__PURE__ */
|
|
188
|
+
function Rn({ label: n, checked: l, onChange: t, disabled: o, readOnly: i, help: s }) {
|
|
189
|
+
const r = G();
|
|
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: A("cms-toggle", l && "is-on"),
|
|
198
198
|
"aria-checked": l,
|
|
199
|
-
"aria-readonly":
|
|
200
|
-
"aria-describedby":
|
|
199
|
+
"aria-readonly": i || void 0,
|
|
200
|
+
"aria-describedby": s != null ? `${r}-help` : void 0,
|
|
201
201
|
disabled: o,
|
|
202
202
|
onClick: () => {
|
|
203
|
-
|
|
203
|
+
i || 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
|
+
s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${r}-help`, children: s }) : null
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
212
|
const je = 150;
|
|
213
|
-
function
|
|
214
|
-
const [
|
|
213
|
+
function Pe({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: i, children: s, footer: r, closeLabel: a = "Close", initialFocus: m, className: _ }) {
|
|
214
|
+
const [d, h] = E(n), [c, f] = E(!1), p = R(null), g = R(null), N = G();
|
|
215
215
|
if (Y(() => {
|
|
216
216
|
if (n) {
|
|
217
|
-
g.current = document.activeElement, h(!0),
|
|
217
|
+
g.current = document.activeElement, h(!0), f(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
if (!
|
|
221
|
-
|
|
220
|
+
if (!d) return;
|
|
221
|
+
f(!0);
|
|
222
222
|
const x = window.setTimeout(() => {
|
|
223
223
|
var S, C;
|
|
224
|
-
h(!1),
|
|
224
|
+
h(!1), f(!1), (C = (S = g.current) == null ? void 0 : S.focus) == null || C.call(S);
|
|
225
225
|
}, je);
|
|
226
226
|
return () => window.clearTimeout(x);
|
|
227
|
-
}, [n,
|
|
227
|
+
}, [n, d]), Y(() => {
|
|
228
228
|
var x, S;
|
|
229
|
-
if (n &&
|
|
229
|
+
if (n && d) {
|
|
230
230
|
const C = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
231
|
-
(S = (m == null ? void 0 : m.current) ?? ((x =
|
|
231
|
+
(S = (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 || S.focus();
|
|
232
232
|
}
|
|
233
|
-
}, [n,
|
|
233
|
+
}, [n, d, m]), !d) return null;
|
|
234
234
|
const w = () => {
|
|
235
|
-
o ?
|
|
235
|
+
o ? i == null || i() : t();
|
|
236
236
|
};
|
|
237
237
|
return Me(
|
|
238
|
-
/* @__PURE__ */ e("div", { className:
|
|
238
|
+
/* @__PURE__ */ e("div", { className: A("cms-modal-scrim", c && "is-closing"), onMouseDown: (x) => {
|
|
239
239
|
x.target === x.currentTarget && w();
|
|
240
|
-
}, children: /* @__PURE__ */
|
|
240
|
+
}, children: /* @__PURE__ */ u(
|
|
241
241
|
"div",
|
|
242
242
|
{
|
|
243
|
-
ref:
|
|
244
|
-
className:
|
|
243
|
+
ref: p,
|
|
244
|
+
className: A("cms-modal", _, c && "is-closing", o && "is-dirty"),
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
247
|
"aria-labelledby": N,
|
|
@@ -251,18 +251,18 @@ function Ie({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: c, chi
|
|
|
251
251
|
if (x.key === "Escape")
|
|
252
252
|
x.stopPropagation(), w();
|
|
253
253
|
else if (x.key === "Tab") {
|
|
254
|
-
const C = (S =
|
|
254
|
+
const C = (S = p.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
255
255
|
if (!C || C.length === 0) return;
|
|
256
256
|
const F = C[0], H = C[C.length - 1];
|
|
257
257
|
x.shiftKey && document.activeElement === F ? (x.preventDefault(), H.focus()) : !x.shiftKey && document.activeElement === H && (x.preventDefault(), F.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": a, onClick: w, 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: s }),
|
|
266
266
|
r != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: r }) : null
|
|
267
267
|
]
|
|
268
268
|
}
|
|
@@ -270,20 +270,20 @@ function Ie({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: c, chi
|
|
|
270
270
|
document.body
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
const
|
|
273
|
+
function On({ open: n, title: l, message: t, kind: o = "default", confirmLabel: i, cancelLabel: s, closeLabel: r, onConfirm: a, onCancel: m }) {
|
|
274
|
+
const _ = o === "discard-changes";
|
|
275
275
|
return /* @__PURE__ */ e(
|
|
276
|
-
|
|
276
|
+
Pe,
|
|
277
277
|
{
|
|
278
278
|
open: n,
|
|
279
279
|
title: l,
|
|
280
280
|
onClose: m,
|
|
281
281
|
...r === void 0 ? {} : { closeLabel: r },
|
|
282
|
-
footer: /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */ e(le, { onClick: m, children:
|
|
284
|
-
/* @__PURE__ */ e(le, { variant: o === "default" ? "primary" : "danger", onClick:
|
|
282
|
+
footer: /* @__PURE__ */ u(M, { children: [
|
|
283
|
+
/* @__PURE__ */ e(le, { onClick: m, children: s ?? (_ ? "Keep editing" : "Cancel") }),
|
|
284
|
+
/* @__PURE__ */ e(le, { variant: o === "default" ? "primary" : "danger", onClick: a, children: i ?? (_ ? "Discard changes" : "Confirm") })
|
|
285
285
|
] }),
|
|
286
|
-
children: o !== "default" ? /* @__PURE__ */
|
|
286
|
+
children: o !== "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 Hn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function Kn({ kind: n, message: l, action: t, onDismiss: o, dismissLabel:
|
|
295
|
-
return /* @__PURE__ */
|
|
294
|
+
function Kn({ kind: n, message: l, action: t, onDismiss: o, dismissLabel: i = "Dismiss" }) {
|
|
295
|
+
return /* @__PURE__ */ u("div", { className: A("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(le, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
|
|
299
|
-
o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
299
|
+
o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: o, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
|
|
300
300
|
] });
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Un({ children: n }) {
|
|
303
303
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
|
|
304
304
|
}
|
|
305
305
|
function qe({ what: n, layout: l = "inline" }) {
|
|
306
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ u("div", { className: A("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
|
|
307
307
|
/* @__PURE__ */ e(z, { name: "spinner" }),
|
|
308
308
|
/* @__PURE__ */ e("span", { children: n })
|
|
309
309
|
] });
|
|
310
310
|
}
|
|
311
311
|
function Ye({ title: n, hint: l, action: t }) {
|
|
312
|
-
return /* @__PURE__ */
|
|
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 Ge({ 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(le, { onClick: l, children: t }) : null
|
|
323
323
|
] });
|
|
324
324
|
}
|
|
325
325
|
const ye = 300;
|
|
326
|
-
function
|
|
326
|
+
function Xe() {
|
|
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
331
|
function Je() {
|
|
332
|
-
return /* @__PURE__ */
|
|
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 ne({ kind: n, title: l, description: t, action: o, placement:
|
|
338
|
-
const [
|
|
337
|
+
function ne({ kind: n, title: l, description: t, action: o, placement: i = "block" }) {
|
|
338
|
+
const [s, r] = E(n !== "loading");
|
|
339
339
|
return Y(() => {
|
|
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 a = window.setTimeout(() => r(!0), Xe());
|
|
346
|
+
return () => window.clearTimeout(a);
|
|
347
|
+
}, [n]), /* @__PURE__ */ u(
|
|
348
348
|
"div",
|
|
349
349
|
{
|
|
350
|
-
className:
|
|
350
|
+
className: A("cms-state", `cms-state--${n}`, `cms-state--${i}`, !s && "is-waiting"),
|
|
351
351
|
role: "status",
|
|
352
352
|
"aria-live": "polite",
|
|
353
353
|
"data-kind": n,
|
|
354
354
|
children: [
|
|
355
355
|
n === "loading" ? /* @__PURE__ */ e(Je, {}) : 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
|
] }),
|
|
@@ -364,132 +364,132 @@ function ne({ kind: n, title: l, description: t, action: o, placement: c = "bloc
|
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
const Be = {
|
|
367
|
-
mail: /* @__PURE__ */
|
|
367
|
+
mail: /* @__PURE__ */ u(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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(M, { 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
421
|
// Download's arrow turned up, from the line: a file sent up.
|
|
422
|
-
upload: /* @__PURE__ */
|
|
422
|
+
upload: /* @__PURE__ */ u(M, { children: [
|
|
423
423
|
/* @__PURE__ */ e("path", { d: "M12 20V9" }),
|
|
424
424
|
/* @__PURE__ */ e("path", { d: "m7 13 5-5 5 5" }),
|
|
425
425
|
/* @__PURE__ */ e("path", { d: "M4 4h16" })
|
|
426
426
|
] }),
|
|
427
|
-
print: /* @__PURE__ */
|
|
427
|
+
print: /* @__PURE__ */ u(M, { children: [
|
|
428
428
|
/* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
|
|
429
429
|
/* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
|
|
430
430
|
/* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
|
|
431
431
|
] }),
|
|
432
|
-
"open-separately": /* @__PURE__ */
|
|
432
|
+
"open-separately": /* @__PURE__ */ u(M, { children: [
|
|
433
433
|
/* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
|
|
434
434
|
/* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
|
|
435
435
|
/* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
|
|
436
436
|
] }),
|
|
437
437
|
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" }),
|
|
438
|
-
send: /* @__PURE__ */
|
|
438
|
+
send: /* @__PURE__ */ u(M, { children: [
|
|
439
439
|
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
440
440
|
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
441
441
|
] }),
|
|
442
|
-
inbox: /* @__PURE__ */
|
|
442
|
+
inbox: /* @__PURE__ */ u(M, { children: [
|
|
443
443
|
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
444
444
|
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
445
445
|
] }),
|
|
446
|
-
archive: /* @__PURE__ */
|
|
446
|
+
archive: /* @__PURE__ */ u(M, { children: [
|
|
447
447
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
448
448
|
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
449
449
|
] }),
|
|
450
|
-
trash: /* @__PURE__ */
|
|
450
|
+
trash: /* @__PURE__ */ u(M, { children: [
|
|
451
451
|
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
452
452
|
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
453
453
|
] }),
|
|
454
454
|
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" }),
|
|
455
|
-
mic: /* @__PURE__ */
|
|
455
|
+
mic: /* @__PURE__ */ u(M, { children: [
|
|
456
456
|
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
457
457
|
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
458
458
|
] }),
|
|
459
|
-
speaker: /* @__PURE__ */
|
|
459
|
+
speaker: /* @__PURE__ */ u(M, { children: [
|
|
460
460
|
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
461
461
|
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
462
462
|
] }),
|
|
463
|
-
"user-plus": /* @__PURE__ */
|
|
463
|
+
"user-plus": /* @__PURE__ */ u(M, { children: [
|
|
464
464
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
465
465
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
466
466
|
] }),
|
|
467
467
|
// A person, nothing more: one whose account is gone.
|
|
468
|
-
user: /* @__PURE__ */
|
|
468
|
+
user: /* @__PURE__ */ u(M, { children: [
|
|
469
469
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
|
|
470
470
|
/* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
|
|
471
471
|
] }),
|
|
472
472
|
// A person with a tick: someone allowed.
|
|
473
|
-
"user-check": /* @__PURE__ */
|
|
473
|
+
"user-check": /* @__PURE__ */ u(M, { children: [
|
|
474
474
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
475
475
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" })
|
|
476
476
|
] }),
|
|
477
477
|
// A person with a cross: someone no longer allowed.
|
|
478
|
-
"user-x": /* @__PURE__ */
|
|
478
|
+
"user-x": /* @__PURE__ */ u(M, { children: [
|
|
479
479
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
480
480
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" })
|
|
481
481
|
] }),
|
|
482
482
|
// Two people: the members of a group.
|
|
483
|
-
users: /* @__PURE__ */
|
|
483
|
+
users: /* @__PURE__ */ u(M, { children: [
|
|
484
484
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "8", r: "3.5" }),
|
|
485
485
|
/* @__PURE__ */ e("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14a6.5 6.5 0 0 1 3.5 6" })
|
|
486
486
|
] }),
|
|
487
487
|
"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" }),
|
|
488
|
-
video: /* @__PURE__ */
|
|
488
|
+
video: /* @__PURE__ */ u(M, { children: [
|
|
489
489
|
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
490
490
|
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
491
491
|
] }),
|
|
492
|
-
info: /* @__PURE__ */
|
|
492
|
+
info: /* @__PURE__ */ u(M, { children: [
|
|
493
493
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
494
494
|
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
495
495
|
] }),
|
|
@@ -498,17 +498,17 @@ const Be = {
|
|
|
498
498
|
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
499
499
|
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" }),
|
|
500
500
|
// The folder with a plus inside: a new folder.
|
|
501
|
-
"folder-plus": /* @__PURE__ */
|
|
501
|
+
"folder-plus": /* @__PURE__ */ u(M, { children: [
|
|
502
502
|
/* @__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" }),
|
|
503
503
|
/* @__PURE__ */ e("path", { d: "M12 10.5v6M9 13.5h6" })
|
|
504
504
|
] }),
|
|
505
505
|
// The folder with a cross inside: a folder removed.
|
|
506
|
-
"folder-x": /* @__PURE__ */
|
|
506
|
+
"folder-x": /* @__PURE__ */ u(M, { children: [
|
|
507
507
|
/* @__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" }),
|
|
508
508
|
/* @__PURE__ */ e("path", { d: "m9.5 11 5 5M14.5 11l-5 5" })
|
|
509
509
|
] }),
|
|
510
510
|
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
511
|
-
server: /* @__PURE__ */
|
|
511
|
+
server: /* @__PURE__ */ u(M, { children: [
|
|
512
512
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
513
513
|
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
514
514
|
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
@@ -539,7 +539,7 @@ function L({ name: n, size: l = 20, label: t }) {
|
|
|
539
539
|
}
|
|
540
540
|
);
|
|
541
541
|
}
|
|
542
|
-
const
|
|
542
|
+
const zn = Object.keys(Be), Ae = {
|
|
543
543
|
reply: "reply",
|
|
544
544
|
"reply-all": "reply",
|
|
545
545
|
forward: "forward",
|
|
@@ -572,7 +572,7 @@ const Rn = Object.keys(Be), Ee = {
|
|
|
572
572
|
"file-earmark-spreadsheet": "file"
|
|
573
573
|
};
|
|
574
574
|
function re(n) {
|
|
575
|
-
return Object.prototype.hasOwnProperty.call(
|
|
575
|
+
return Object.prototype.hasOwnProperty.call(Ae, n) ? Ae[n] : null;
|
|
576
576
|
}
|
|
577
577
|
function Qe() {
|
|
578
578
|
try {
|
|
@@ -582,7 +582,7 @@ function Qe() {
|
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
const Te = /* @__PURE__ */ new Set();
|
|
585
|
-
function
|
|
585
|
+
function Zn({ name: n, size: l = 18 }) {
|
|
586
586
|
if (n === "") return null;
|
|
587
587
|
const t = re(n);
|
|
588
588
|
return t !== null ? /* @__PURE__ */ e(L, { name: t, size: l }) : (!Te.has(n) && Qe() && (Te.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
|
|
@@ -597,73 +597,73 @@ function tn(n) {
|
|
|
597
597
|
function an(n) {
|
|
598
598
|
return n.getClientRects().length > 0;
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
const { name: l, badge: t, closeLabel: o, onClose:
|
|
600
|
+
function Vn(n) {
|
|
601
|
+
const { name: l, badge: t, closeLabel: o, onClose: i, actions: s = [], moreLabel: r = "More", edit: a, editing: m, state: _, siblings: d, bar: h, thumbnails: c, strip: f, onZoom: p, children: g } = n, N = R(null), w = R(null), x = G(), [S, C] = E(!1), F = R(null);
|
|
602
602
|
Y(() => {
|
|
603
603
|
var V;
|
|
604
|
-
const y = document.activeElement,
|
|
604
|
+
const y = document.activeElement, P = document.body.style.overflow;
|
|
605
605
|
return document.body.style.overflow = "hidden", (V = w.current) == null || V.focus(), () => {
|
|
606
606
|
var D;
|
|
607
|
-
document.body.style.overflow =
|
|
607
|
+
document.body.style.overflow = P, (D = y == null ? void 0 : y.focus) == null || D.call(y);
|
|
608
608
|
};
|
|
609
609
|
}, []);
|
|
610
610
|
const H = () => {
|
|
611
|
-
m != null && m.dirty ? m.onDirtyClose() :
|
|
611
|
+
m != null && m.dirty ? m.onDirtyClose() : i();
|
|
612
612
|
}, ee = (y) => {
|
|
613
|
-
const
|
|
614
|
-
F.current =
|
|
613
|
+
const P = y.touches.length === 1 ? y.touches[0] : void 0;
|
|
614
|
+
F.current = P === void 0 || m !== void 0 || tn(y.target) ? null : { x: P.clientX, y: P.clientY };
|
|
615
615
|
}, j = (y) => {
|
|
616
|
-
var
|
|
617
|
-
const
|
|
618
|
-
if (F.current = null,
|
|
619
|
-
const D = V.clientX -
|
|
620
|
-
Math.abs(D) < nn || Math.abs(D) < Math.abs(V.clientY -
|
|
616
|
+
var X, O;
|
|
617
|
+
const P = F.current, V = y.changedTouches[0];
|
|
618
|
+
if (F.current = null, P === null || V === void 0) return;
|
|
619
|
+
const D = V.clientX - P.x;
|
|
620
|
+
Math.abs(D) < nn || Math.abs(D) < Math.abs(V.clientY - P.y) || (D > 0 ? (X = d == null ? void 0 : d.onPrevious) == null || X.call(d) : (O = d == null ? void 0 : d.onNext) == null || O.call(d));
|
|
621
621
|
};
|
|
622
622
|
return Me(
|
|
623
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ u(
|
|
624
624
|
"div",
|
|
625
625
|
{
|
|
626
626
|
ref: N,
|
|
627
|
-
className:
|
|
627
|
+
className: A("cms-viewer", m !== void 0 && "is-editing"),
|
|
628
628
|
role: "dialog",
|
|
629
629
|
"aria-modal": "true",
|
|
630
630
|
"aria-labelledby": x,
|
|
631
631
|
tabIndex: -1,
|
|
632
632
|
onKeyDown: (y) => {
|
|
633
|
-
var
|
|
633
|
+
var P, V, D;
|
|
634
634
|
if (y.key === "Escape") {
|
|
635
635
|
if (m !== void 0) return;
|
|
636
|
-
y.stopPropagation(), S ? C(!1) :
|
|
636
|
+
y.stopPropagation(), S ? C(!1) : i();
|
|
637
637
|
} else if (y.key === "Tab") {
|
|
638
|
-
const
|
|
639
|
-
if (
|
|
640
|
-
const O =
|
|
638
|
+
const X = Array.from(((P = N.current) == null ? void 0 : P.querySelectorAll(en)) ?? []).filter(an);
|
|
639
|
+
if (X.length === 0) return;
|
|
640
|
+
const O = X[0], J = X[X.length - 1];
|
|
641
641
|
y.shiftKey && document.activeElement === O ? (y.preventDefault(), J.focus()) : !y.shiftKey && document.activeElement === J && (y.preventDefault(), O.focus());
|
|
642
|
-
} else m === void 0 && !ln(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V =
|
|
642
|
+
} else m === void 0 && !ln(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V = d == null ? void 0 : d.onPrevious) == null || V.call(d) : y.key === "ArrowRight" ? (D = d == null ? void 0 : d.onNext) == null || D.call(d) : y.key === "+" || y.key === "=" ? p == null || p("in") : y.key === "-" ? p == null || p("out") : y.key === "0" && (p == null || p("reset")));
|
|
643
643
|
},
|
|
644
644
|
children: [
|
|
645
|
-
|
|
646
|
-
/* @__PURE__ */
|
|
645
|
+
d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${d.position}` }) : null,
|
|
646
|
+
/* @__PURE__ */ u("header", { className: "cms-viewer__top", children: [
|
|
647
647
|
/* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label": o, onClick: H, children: /* @__PURE__ */ e(z, { name: "close" }) }),
|
|
648
648
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
|
|
649
649
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
|
|
650
|
-
|
|
650
|
+
d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: d.position }) : null,
|
|
651
651
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
652
|
-
m !== void 0 ? /* @__PURE__ */
|
|
652
|
+
m !== void 0 ? /* @__PURE__ */ u(M, { children: [
|
|
653
653
|
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: m.status }),
|
|
654
654
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.onDone, children: m.doneLabel })
|
|
655
|
-
] }) : /* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children:
|
|
655
|
+
] }) : /* @__PURE__ */ u(M, { children: [
|
|
656
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
|
|
657
657
|
y.icon,
|
|
658
658
|
y.label
|
|
659
659
|
] }, y.label)) }),
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children:
|
|
660
|
+
a !== void 0 ? /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": a.label, onClick: a.onEdit, children: [
|
|
661
|
+
a.icon,
|
|
662
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: a.label })
|
|
663
663
|
] }) : null,
|
|
664
|
-
|
|
664
|
+
s.length > 0 ? /* @__PURE__ */ u("span", { className: "cms-viewer__more", children: [
|
|
665
665
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": S, onClick: () => C((y) => !y), children: /* @__PURE__ */ e(L, { name: "more" }) }),
|
|
666
|
-
S ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children:
|
|
666
|
+
S ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ u(
|
|
667
667
|
"button",
|
|
668
668
|
{
|
|
669
669
|
type: "button",
|
|
@@ -681,21 +681,21 @@ function zn(n) {
|
|
|
681
681
|
] }) : null
|
|
682
682
|
] })
|
|
683
683
|
] }),
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
(m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ u("div", { className: "cms-viewer__body", children: [
|
|
685
|
+
c != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: c }) : null,
|
|
686
|
+
/* @__PURE__ */ u("div", { className: "cms-viewer__content", onTouchStart: ee, onTouchEnd: j, children: [
|
|
687
|
+
(m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ u("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
688
688
|
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: m.conflict.message }),
|
|
689
689
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: m.conflict.onOverwrite, children: m.conflict.overwriteLabel }),
|
|
690
690
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.conflict.onKeepBoth, children: m.conflict.keepBothLabel })
|
|
691
691
|
] }) : null,
|
|
692
|
-
|
|
693
|
-
m === void 0 && (
|
|
694
|
-
m === void 0 && (
|
|
695
|
-
m === void 0 &&
|
|
692
|
+
_ === void 0 ? g : /* @__PURE__ */ e(sn, { state: _ }),
|
|
693
|
+
m === void 0 && (d != null && d.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": d.previousLabel, title: d.previousLabel, onClick: d.onPrevious, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
|
|
694
|
+
m === void 0 && (d != null && d.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": d.nextLabel, title: d.nextLabel, onClick: d.onNext, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
|
|
695
|
+
m === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (y, P) => /* @__PURE__ */ e("i", { className: P === Math.min(d.index, 6) ? "is-current" : void 0 }, P)) }) : null
|
|
696
696
|
] })
|
|
697
697
|
] }),
|
|
698
|
-
m === void 0 &&
|
|
698
|
+
m === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
|
|
699
699
|
h != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: h }) : null
|
|
700
700
|
]
|
|
701
701
|
}
|
|
@@ -738,141 +738,141 @@ class rn extends Error {
|
|
|
738
738
|
}
|
|
739
739
|
const Ne = (n, l) => `${n}
|
|
740
740
|
${l}`, cn = (n, l) => n === "" ? l : `${n}/${l}`, on = 48;
|
|
741
|
-
function
|
|
741
|
+
function Wn(n) {
|
|
742
742
|
var me, he;
|
|
743
|
-
const { open: l, spaces: t, list: o, disabledReason:
|
|
743
|
+
const { open: l, spaces: t, list: o, disabledReason: i, budget: s, formatSize: r, labels: a, onConfirm: m, onCancel: _ } = n, [d, h] = E(((me = t[0]) == null ? void 0 : me.id) ?? ""), [c, f] = E(""), [p, g] = E({ status: "loading" }), [N, w] = E(0), [x, S] = E(/* @__PURE__ */ new Map()), [C, F] = E(0), [H, ee] = E(!1), j = R(null), y = G();
|
|
744
744
|
Y(() => {
|
|
745
745
|
var b;
|
|
746
|
-
l && (h(((b = t[0]) == null ? void 0 : b.id) ?? ""),
|
|
746
|
+
l && (h(((b = t[0]) == null ? void 0 : b.id) ?? ""), f(""), S(/* @__PURE__ */ new Map()), ee(!1));
|
|
747
747
|
}, [l]), Y(() => {
|
|
748
|
-
if (!l ||
|
|
748
|
+
if (!l || d === "") return;
|
|
749
749
|
let b = !0;
|
|
750
|
-
return g({ status: "loading" }), F(0), o(
|
|
750
|
+
return g({ status: "loading" }), F(0), o(d, c).then(
|
|
751
751
|
(k) => b && g({ status: "ready", entries: k.entries, next: k.next ?? null, paging: !1 }),
|
|
752
752
|
(k) => b && g({ status: k instanceof rn ? "denied" : "error" })
|
|
753
753
|
), () => {
|
|
754
754
|
b = !1;
|
|
755
755
|
};
|
|
756
|
-
}, [l,
|
|
757
|
-
const
|
|
758
|
-
if (
|
|
759
|
-
const b =
|
|
760
|
-
g({ ...
|
|
756
|
+
}, [l, d, c, o, N]);
|
|
757
|
+
const P = be(() => {
|
|
758
|
+
if (p.status !== "ready" || p.next === null || p.paging) return;
|
|
759
|
+
const b = p.next, k = p.entries;
|
|
760
|
+
g({ ...p, paging: !0 }), o(d, c, b).then(
|
|
761
761
|
(B) => g({ status: "ready", entries: [...k, ...B.entries], next: B.next ?? null, paging: !1 }),
|
|
762
762
|
() => g({ status: "ready", entries: k, next: b, paging: !1 })
|
|
763
763
|
);
|
|
764
|
-
}, [
|
|
764
|
+
}, [p, o, d, c]), V = be((b) => {
|
|
765
765
|
var k;
|
|
766
|
-
return ((k =
|
|
767
|
-
}, [
|
|
766
|
+
return ((k = s == null ? void 0 : s.cost) == null ? void 0 : k.call(s, b)) ?? b.size ?? 0;
|
|
767
|
+
}, [s]), D = Oe(() => [...x.values()], [x]), X = D.reduce((b, k) => b + (k.size ?? 0), 0), O = s === void 0 ? null : s.limitBytes - s.usedBytes - D.reduce((b, k) => b + V(k), 0), J = O !== null && O < 0, ie = (b) => {
|
|
768
768
|
if (b.kind !== "file") return null;
|
|
769
|
-
const k =
|
|
770
|
-
return k || (O !== null && !x.has(Ne(
|
|
769
|
+
const k = i == null ? void 0 : i(b);
|
|
770
|
+
return k || (O !== null && !x.has(Ne(d, b.id)) && V(b) > O ? a.overBudget : null);
|
|
771
771
|
}, oe = (b) => {
|
|
772
|
-
const k = Ne(
|
|
772
|
+
const k = Ne(d, b.id);
|
|
773
773
|
!x.has(k) && ie(b) !== null || S((B) => {
|
|
774
|
-
const
|
|
775
|
-
return
|
|
774
|
+
const K = new Map(B);
|
|
775
|
+
return K.has(k) ? K.delete(k) : K.set(k, { ...b, space: d, path: c }), K;
|
|
776
776
|
});
|
|
777
|
-
}, v = (b) =>
|
|
777
|
+
}, v = (b) => f(cn(c, b.name)), T = () => f(c.includes("/") ? c.slice(0, c.lastIndexOf("/")) : ""), Z = (b) => S((k) => {
|
|
778
778
|
const B = new Map(k);
|
|
779
779
|
return B.delete(b), B;
|
|
780
|
-
}), W =
|
|
780
|
+
}), W = p.status === "ready" ? p.entries : [], $ = (b) => {
|
|
781
781
|
const k = W[C];
|
|
782
782
|
if (b.key === "ArrowDown" || b.key === "ArrowUp" || b.key === "Home" || b.key === "End") {
|
|
783
783
|
b.preventDefault();
|
|
784
|
-
const B = W.length - 1,
|
|
785
|
-
F(
|
|
786
|
-
} else b.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (b.preventDefault(), v(k)) : b.key === " " && (k == null ? void 0 : k.kind) === "file" ? (b.preventDefault(), oe(k)) : b.key === "Backspace" &&
|
|
787
|
-
}, q =
|
|
788
|
-
return /* @__PURE__ */
|
|
789
|
-
|
|
784
|
+
const B = W.length - 1, K = b.key === "Home" ? 0 : b.key === "End" ? B : Math.min(B, Math.max(0, C + (b.key === "ArrowDown" ? 1 : -1)));
|
|
785
|
+
F(K), K >= B - 1 && P();
|
|
786
|
+
} else b.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (b.preventDefault(), v(k)) : b.key === " " && (k == null ? void 0 : k.kind) === "file" ? (b.preventDefault(), oe(k)) : b.key === "Backspace" && c !== "" && (b.preventDefault(), T());
|
|
787
|
+
}, q = c === "" ? [] : c.split("/"), de = ((he = t.find((b) => b.id === d)) == null ? void 0 : he.name) ?? "", ue = (b) => `${y}-entry-${String(b)}`;
|
|
788
|
+
return /* @__PURE__ */ u(
|
|
789
|
+
Pe,
|
|
790
790
|
{
|
|
791
791
|
open: l,
|
|
792
|
-
title:
|
|
793
|
-
onClose:
|
|
794
|
-
closeLabel:
|
|
792
|
+
title: a.title,
|
|
793
|
+
onClose: _,
|
|
794
|
+
closeLabel: a.close,
|
|
795
795
|
initialFocus: j,
|
|
796
796
|
className: "cms-file-picker",
|
|
797
|
-
footer: /* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
D.length > 0 ? /* @__PURE__ */ e("span", { children:
|
|
800
|
-
|
|
797
|
+
footer: /* @__PURE__ */ u("div", { className: "cms-file-picker__foot", children: [
|
|
798
|
+
/* @__PURE__ */ u("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
799
|
+
D.length > 0 ? /* @__PURE__ */ e("span", { children: a.total(D.length, r(X)) }) : null,
|
|
800
|
+
s !== void 0 && O !== null ? /* @__PURE__ */ e("span", { className: A(J && "is-over"), children: J ? a.overBudget : a.left(r(Math.max(0, O)), r(s.limitBytes)) }) : null
|
|
801
801
|
] }),
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */ e(le, { variant: "secondary", onClick:
|
|
804
|
-
/* @__PURE__ */ e(le, { variant: "primary", disabled: D.length === 0 || J, onClick: () => m(D), children:
|
|
802
|
+
/* @__PURE__ */ u("div", { className: "cms-file-picker__actions", children: [
|
|
803
|
+
/* @__PURE__ */ e(le, { variant: "secondary", onClick: _, children: a.cancel }),
|
|
804
|
+
/* @__PURE__ */ e(le, { variant: "primary", disabled: D.length === 0 || J, onClick: () => m(D), children: a.confirm(D.length) })
|
|
805
805
|
] })
|
|
806
806
|
] }),
|
|
807
807
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
t.length > 1 ? /* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children:
|
|
811
|
-
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value:
|
|
812
|
-
h(b.target.value),
|
|
808
|
+
/* @__PURE__ */ u("div", { className: "cms-file-picker__top", children: [
|
|
809
|
+
t.length > 1 ? /* @__PURE__ */ u("label", { className: "cms-file-picker__space", children: [
|
|
810
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: a.space }),
|
|
811
|
+
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: d, onChange: (b) => {
|
|
812
|
+
h(b.target.value), f("");
|
|
813
813
|
}, children: t.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.name }, b.id)) })
|
|
814
814
|
] }) : null,
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
817
|
-
/* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
815
|
+
/* @__PURE__ */ u("nav", { className: "cms-file-picker__path", "aria-label": a.path, children: [
|
|
816
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.up, disabled: c === "", onClick: T, children: /* @__PURE__ */ e(L, { name: "chevron-left" }) }),
|
|
817
|
+
/* @__PURE__ */ u("ol", { children: [
|
|
818
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": c === "" ? "location" : void 0, onClick: () => f(""), children: de }) }),
|
|
819
819
|
q.map((b, k) => {
|
|
820
820
|
const B = q.slice(0, k + 1).join("/");
|
|
821
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": B ===
|
|
821
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": B === c ? "location" : void 0, onClick: () => f(B), children: b }) }, B);
|
|
822
822
|
})
|
|
823
823
|
] })
|
|
824
824
|
] }),
|
|
825
|
-
D.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ee((b) => !b), children:
|
|
825
|
+
D.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ee((b) => !b), children: a.selected(D.length) }) : null
|
|
826
826
|
] }),
|
|
827
|
-
H && D.length > 0 ? /* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([b, k]) => /* @__PURE__ */
|
|
827
|
+
H && D.length > 0 ? /* @__PURE__ */ u("div", { className: "cms-file-picker__chosen", children: [
|
|
828
|
+
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([b, k]) => /* @__PURE__ */ u("li", { children: [
|
|
829
829
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: k.name }),
|
|
830
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
830
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.remove(k.name), onClick: () => Z(b), children: /* @__PURE__ */ e(z, { name: "close" }) })
|
|
831
831
|
] }, b)) }),
|
|
832
832
|
/* @__PURE__ */ e(le, { variant: "secondary", onClick: () => {
|
|
833
833
|
S(/* @__PURE__ */ new Map()), ee(!1);
|
|
834
|
-
}, children:
|
|
834
|
+
}, children: a.clear })
|
|
835
835
|
] }) : null,
|
|
836
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ u("div", { className: "cms-file-picker__list", onScroll: (b) => {
|
|
837
837
|
const k = b.currentTarget;
|
|
838
|
-
k.scrollTop + k.clientHeight >= k.scrollHeight - on &&
|
|
838
|
+
k.scrollTop + k.clientHeight >= k.scrollHeight - on && P();
|
|
839
839
|
}, children: [
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
/* @__PURE__ */
|
|
840
|
+
p.status === "loading" ? /* @__PURE__ */ e(ne, { kind: "loading", title: a.loading, placement: "block" }) : null,
|
|
841
|
+
p.status === "error" ? /* @__PURE__ */ e(ne, { kind: "error", title: a.error, placement: "block", action: { label: a.retry, onAction: () => w((b) => b + 1) } }) : null,
|
|
842
|
+
p.status === "denied" ? /* @__PURE__ */ e(ne, { kind: "denied", title: a.denied, placement: "block" }) : null,
|
|
843
|
+
p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ne, { kind: "empty", title: a.empty, placement: "block" }) : null,
|
|
844
|
+
/* @__PURE__ */ u(
|
|
845
845
|
"div",
|
|
846
846
|
{
|
|
847
847
|
ref: j,
|
|
848
848
|
role: "listbox",
|
|
849
849
|
"aria-multiselectable": "true",
|
|
850
|
-
"aria-label":
|
|
850
|
+
"aria-label": a.files,
|
|
851
851
|
"aria-activedescendant": W.length > 0 ? ue(C) : void 0,
|
|
852
852
|
tabIndex: 0,
|
|
853
853
|
className: "cms-file-picker__entries",
|
|
854
|
-
hidden:
|
|
854
|
+
hidden: p.status !== "ready" || W.length === 0,
|
|
855
855
|
onKeyDown: $,
|
|
856
856
|
children: [
|
|
857
857
|
W.map((b, k) => {
|
|
858
|
-
const B = b.kind === "file" && x.has(Ne(
|
|
859
|
-
return /* @__PURE__ */
|
|
858
|
+
const B = b.kind === "file" && x.has(Ne(d, b.id)), K = ie(b);
|
|
859
|
+
return /* @__PURE__ */ u(
|
|
860
860
|
"div",
|
|
861
861
|
{
|
|
862
862
|
id: ue(k),
|
|
863
863
|
role: "option",
|
|
864
864
|
"aria-selected": b.kind === "file" ? B : void 0,
|
|
865
|
-
"aria-disabled":
|
|
866
|
-
className:
|
|
865
|
+
"aria-disabled": K !== null || void 0,
|
|
866
|
+
className: A("cms-file-picker__entry", k === C && "is-active", B && "is-ticked", K !== null && "is-disabled"),
|
|
867
867
|
onClick: () => {
|
|
868
868
|
F(k), b.kind === "folder" ? v(b) : oe(b);
|
|
869
869
|
},
|
|
870
870
|
children: [
|
|
871
871
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: B ? /* @__PURE__ */ e(L, { name: "check" }) : null }),
|
|
872
872
|
/* @__PURE__ */ e(L, { name: b.kind === "folder" ? "folder" : "file" }),
|
|
873
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ u("span", { className: "cms-file-picker__text", children: [
|
|
874
874
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: b.name }),
|
|
875
|
-
|
|
875
|
+
K !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: K }) : null
|
|
876
876
|
] }),
|
|
877
877
|
b.kind === "file" && b.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(b.size) }) : null
|
|
878
878
|
]
|
|
@@ -880,7 +880,7 @@ function Zn(n) {
|
|
|
880
880
|
b.id
|
|
881
881
|
);
|
|
882
882
|
}),
|
|
883
|
-
|
|
883
|
+
p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ne, { kind: "loading", title: a.loading, placement: "inline" }) }) : null
|
|
884
884
|
]
|
|
885
885
|
}
|
|
886
886
|
)
|
|
@@ -889,15 +889,15 @@ function Zn(n) {
|
|
|
889
889
|
}
|
|
890
890
|
);
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
return /* @__PURE__ */
|
|
894
|
-
o ? /* @__PURE__ */
|
|
892
|
+
function jn({ title: n, scope: l, actions: t, backLink: o }) {
|
|
893
|
+
return /* @__PURE__ */ u("header", { className: "cms-page-header", children: [
|
|
894
|
+
o ? /* @__PURE__ */ u(
|
|
895
895
|
"a",
|
|
896
896
|
{
|
|
897
897
|
className: "cms-page-header__back",
|
|
898
898
|
href: o.href ?? "#",
|
|
899
|
-
onClick: (
|
|
900
|
-
o.onBack && (
|
|
899
|
+
onClick: (i) => {
|
|
900
|
+
o.onBack && (i.preventDefault(), o.onBack());
|
|
901
901
|
},
|
|
902
902
|
children: [
|
|
903
903
|
/* @__PURE__ */ e(z, { name: "back" }),
|
|
@@ -906,8 +906,8 @@ function Vn({ title: n, scope: l, actions: t, backLink: o }) {
|
|
|
906
906
|
]
|
|
907
907
|
}
|
|
908
908
|
) : null,
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ u("div", { className: "cms-page-header__row", children: [
|
|
910
|
+
/* @__PURE__ */ u("div", { className: "cms-page-header__titles", children: [
|
|
911
911
|
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
|
|
912
912
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
|
|
913
913
|
] }),
|
|
@@ -915,30 +915,30 @@ function Vn({ title: n, scope: l, actions: t, backLink: o }) {
|
|
|
915
915
|
] })
|
|
916
916
|
] });
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
const
|
|
918
|
+
function qn({ tabs: n, active: l, onSelect: t, label: o }) {
|
|
919
|
+
const i = R([]), s = (r, a) => {
|
|
920
920
|
var h;
|
|
921
|
-
const m = n.length - 1,
|
|
922
|
-
if (
|
|
921
|
+
const m = n.length - 1, _ = r.key === "ArrowRight" ? a === m ? 0 : a + 1 : r.key === "ArrowLeft" ? a === 0 ? m : a - 1 : r.key === "Home" ? 0 : r.key === "End" ? m : null;
|
|
922
|
+
if (_ === null) return;
|
|
923
923
|
r.preventDefault();
|
|
924
|
-
const
|
|
925
|
-
|
|
924
|
+
const d = n[_];
|
|
925
|
+
d && (t(d.id), (h = i.current[_]) == null || h.focus());
|
|
926
926
|
};
|
|
927
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": o, children: n.map((r,
|
|
927
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": o, children: n.map((r, a) => {
|
|
928
928
|
const m = r.id === l;
|
|
929
|
-
return /* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ u(
|
|
930
930
|
"button",
|
|
931
931
|
{
|
|
932
|
-
ref: (
|
|
933
|
-
|
|
932
|
+
ref: (_) => {
|
|
933
|
+
i.current[a] = _;
|
|
934
934
|
},
|
|
935
935
|
type: "button",
|
|
936
936
|
role: "tab",
|
|
937
|
-
className:
|
|
937
|
+
className: A("cms-tab", m && "is-active"),
|
|
938
938
|
"aria-selected": m,
|
|
939
939
|
tabIndex: m ? 0 : -1,
|
|
940
940
|
onClick: () => t(r.id),
|
|
941
|
-
onKeyDown: (
|
|
941
|
+
onKeyDown: (_) => s(_, a),
|
|
942
942
|
children: [
|
|
943
943
|
r.label,
|
|
944
944
|
r.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: r.count }) : null
|
|
@@ -949,9 +949,9 @@ function Wn({ tabs: n, active: l, onSelect: t, label: o }) {
|
|
|
949
949
|
}) });
|
|
950
950
|
}
|
|
951
951
|
function dn(n) {
|
|
952
|
-
const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (
|
|
953
|
-
var
|
|
954
|
-
return (
|
|
952
|
+
const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (i) => {
|
|
953
|
+
var s;
|
|
954
|
+
return (s = i == null ? void 0 : i.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
|
|
955
955
|
};
|
|
956
956
|
return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
|
|
957
957
|
}
|
|
@@ -961,73 +961,73 @@ function un(n) {
|
|
|
961
961
|
l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
|
|
962
962
|
return l % 6 + 1;
|
|
963
963
|
}
|
|
964
|
-
function ve({ name: n, pictureUrl: l, presence: t, connection: o, deleted:
|
|
965
|
-
const r = o !== void 0 ? `is-${o.state === "offline" ? "disconnected" : o.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`,
|
|
966
|
-
return /* @__PURE__ */
|
|
964
|
+
function ve({ name: n, pictureUrl: l, presence: t, connection: o, deleted: i = !1, size: s = 32 }) {
|
|
965
|
+
const r = o !== void 0 ? `is-${o.state === "offline" ? "disconnected" : o.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, a = o !== void 0 ? `${n}, ${o.label}` : t ? `${n}, ${t}` : n;
|
|
966
|
+
return /* @__PURE__ */ u(
|
|
967
967
|
"span",
|
|
968
968
|
{
|
|
969
|
-
className:
|
|
970
|
-
style: { width:
|
|
969
|
+
className: A("cms-avatar", i ? "cms-avatar--deleted" : `cms-avatar--tint-${un(n)}`),
|
|
970
|
+
style: { width: s, height: s, fontSize: Math.round(s * 0.4) },
|
|
971
971
|
role: "img",
|
|
972
|
-
"aria-label":
|
|
972
|
+
"aria-label": a,
|
|
973
973
|
...o === void 0 ? {} : { title: o.label },
|
|
974
974
|
children: [
|
|
975
|
-
|
|
976
|
-
r === null ? null : /* @__PURE__ */ e("span", { className:
|
|
975
|
+
i ? /* @__PURE__ */ e(L, { name: "user", size: Math.round(s * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: dn(n) }),
|
|
976
|
+
r === null ? null : /* @__PURE__ */ e("span", { className: A("cms-avatar__presence", r), "aria-hidden": "true" })
|
|
977
977
|
]
|
|
978
978
|
}
|
|
979
979
|
);
|
|
980
980
|
}
|
|
981
981
|
function mn({ count: n, label: l, max: t = 99 }) {
|
|
982
|
-
return n <= 0 ? null : /* @__PURE__ */
|
|
982
|
+
return n <= 0 ? null : /* @__PURE__ */ u("span", { className: "cms-badge", children: [
|
|
983
983
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
|
|
984
984
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
985
985
|
] });
|
|
986
986
|
}
|
|
987
|
-
function
|
|
988
|
-
return /* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
987
|
+
function Yn({ product: n, mark: l, rail: t, active: o, onNavigate: i, server: s, search: r, account: a, children: m, railLabel: _ = "Sections" }) {
|
|
988
|
+
return /* @__PURE__ */ u("div", { className: "cms-shell", children: [
|
|
989
|
+
/* @__PURE__ */ u("nav", { className: "cms-shell__rail", "aria-label": _, children: [
|
|
990
990
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
991
|
-
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((
|
|
992
|
-
const h =
|
|
993
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((d) => {
|
|
992
|
+
const h = d.id === o;
|
|
993
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(
|
|
994
994
|
"a",
|
|
995
995
|
{
|
|
996
|
-
href:
|
|
997
|
-
className:
|
|
996
|
+
href: d.href,
|
|
997
|
+
className: A("cms-shell__item", h && "is-active"),
|
|
998
998
|
"aria-current": h ? "page" : void 0,
|
|
999
|
-
title:
|
|
1000
|
-
onClick: (
|
|
1001
|
-
|
|
999
|
+
title: d.label,
|
|
1000
|
+
onClick: (c) => {
|
|
1001
|
+
i && (c.preventDefault(), i(d.id));
|
|
1002
1002
|
},
|
|
1003
1003
|
children: [
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */ e(L, { name:
|
|
1006
|
-
|
|
1004
|
+
/* @__PURE__ */ u("span", { className: "cms-shell__icon", children: [
|
|
1005
|
+
/* @__PURE__ */ e(L, { name: d.icon, size: 22 }),
|
|
1006
|
+
d.badge ? /* @__PURE__ */ e(mn, { count: d.badge.count, label: d.badge.label }) : null
|
|
1007
1007
|
] }),
|
|
1008
|
-
/* @__PURE__ */ e("span", { className: "cms-shell__label", children:
|
|
1008
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: d.label })
|
|
1009
1009
|
]
|
|
1010
1010
|
}
|
|
1011
|
-
) },
|
|
1011
|
+
) }, d.id);
|
|
1012
1012
|
}) })
|
|
1013
1013
|
] }),
|
|
1014
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ u("header", { className: "cms-shell__top", children: [
|
|
1015
1015
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
1016
|
-
|
|
1016
|
+
s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
|
|
1017
1017
|
r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: r }) : null,
|
|
1018
|
-
|
|
1018
|
+
a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: a }) : null
|
|
1019
1019
|
] }),
|
|
1020
1020
|
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: m })
|
|
1021
1021
|
] });
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1024
|
-
return /* @__PURE__ */
|
|
1023
|
+
function Gn({ label: n, placeholder: l, value: t, onChange: o, onSearch: i }) {
|
|
1024
|
+
return /* @__PURE__ */ u(
|
|
1025
1025
|
"form",
|
|
1026
1026
|
{
|
|
1027
1027
|
role: "search",
|
|
1028
1028
|
className: "cms-search",
|
|
1029
|
-
onSubmit: (
|
|
1030
|
-
|
|
1029
|
+
onSubmit: (s) => {
|
|
1030
|
+
s.preventDefault(), i == null || i(t);
|
|
1031
1031
|
},
|
|
1032
1032
|
children: [
|
|
1033
1033
|
/* @__PURE__ */ e(L, { name: "search", size: 18 }),
|
|
@@ -1039,7 +1039,7 @@ function qn({ label: n, placeholder: l, value: t, onChange: o, onSearch: c }) {
|
|
|
1039
1039
|
"aria-label": n,
|
|
1040
1040
|
placeholder: l,
|
|
1041
1041
|
value: t,
|
|
1042
|
-
onChange: (
|
|
1042
|
+
onChange: (s) => o(s.target.value)
|
|
1043
1043
|
}
|
|
1044
1044
|
)
|
|
1045
1045
|
]
|
|
@@ -1047,29 +1047,29 @@ function qn({ label: n, placeholder: l, value: t, onChange: o, onSearch: c }) {
|
|
|
1047
1047
|
);
|
|
1048
1048
|
}
|
|
1049
1049
|
function hn({ options: n, value: l, onChange: t, label: o }) {
|
|
1050
|
-
const
|
|
1050
|
+
const i = R([]), s = (r, a) => {
|
|
1051
1051
|
var h;
|
|
1052
|
-
const m = n.length - 1,
|
|
1053
|
-
if (
|
|
1052
|
+
const m = n.length - 1, _ = r.key === "ArrowRight" || r.key === "ArrowDown" ? a === m ? 0 : a + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? a === 0 ? m : a - 1 : null;
|
|
1053
|
+
if (_ === null) return;
|
|
1054
1054
|
r.preventDefault();
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1055
|
+
const d = n[_];
|
|
1056
|
+
d && (t(d.id), (h = i.current[_]) == null || h.focus());
|
|
1057
1057
|
};
|
|
1058
|
-
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": o, children: n.map((r,
|
|
1058
|
+
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": o, children: n.map((r, a) => {
|
|
1059
1059
|
const m = r.id === l;
|
|
1060
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ u(
|
|
1061
1061
|
"button",
|
|
1062
1062
|
{
|
|
1063
|
-
ref: (
|
|
1064
|
-
|
|
1063
|
+
ref: (_) => {
|
|
1064
|
+
i.current[a] = _;
|
|
1065
1065
|
},
|
|
1066
1066
|
type: "button",
|
|
1067
1067
|
role: "radio",
|
|
1068
1068
|
"aria-checked": m,
|
|
1069
1069
|
tabIndex: m ? 0 : -1,
|
|
1070
|
-
className:
|
|
1070
|
+
className: A("cms-chip", m && "is-on"),
|
|
1071
1071
|
onClick: () => t(r.id),
|
|
1072
|
-
onKeyDown: (
|
|
1072
|
+
onKeyDown: (_) => s(_, a),
|
|
1073
1073
|
children: [
|
|
1074
1074
|
m ? /* @__PURE__ */ e(L, { name: "check", size: 16 }) : null,
|
|
1075
1075
|
r.label
|
|
@@ -1081,16 +1081,16 @@ function hn({ options: n, value: l, onChange: t, label: o }) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
const Le = 16;
|
|
1083
1083
|
function fn(n, l, t) {
|
|
1084
|
-
const o = n.map((
|
|
1085
|
-
let
|
|
1086
|
-
for (let
|
|
1087
|
-
const r = Math.min(
|
|
1088
|
-
o[
|
|
1084
|
+
const o = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
|
|
1085
|
+
let i = o.reduce((s, r) => s + r, 0) + t - l;
|
|
1086
|
+
for (let s = o.length - 1; s >= 0 && i > 0; s -= 1) {
|
|
1087
|
+
const r = Math.min(i, o[s] - n[s].min);
|
|
1088
|
+
o[s] = o[s] - r, i -= r;
|
|
1089
1089
|
}
|
|
1090
1090
|
return o;
|
|
1091
1091
|
}
|
|
1092
|
-
function pn({ index: n, size: l, shown: t, others: o, room:
|
|
1093
|
-
const
|
|
1092
|
+
function pn({ index: n, size: l, shown: t, others: o, room: i, lastMin: s, onResize: r }) {
|
|
1093
|
+
const a = Math.max(l.min, Math.min(l.max, i > 0 ? i - o - s : l.max)), m = (h) => Math.round(Math.min(Math.max(h, l.min), a)), _ = R(null), d = (h, c) => r == null ? void 0 : r(n, m(h), c);
|
|
1094
1094
|
return /* @__PURE__ */ e(
|
|
1095
1095
|
"div",
|
|
1096
1096
|
{
|
|
@@ -1100,102 +1100,102 @@ function pn({ index: n, size: l, shown: t, others: o, room: c, lastMin: a, onRes
|
|
|
1100
1100
|
"aria-label": l.label,
|
|
1101
1101
|
"aria-valuenow": t,
|
|
1102
1102
|
"aria-valuemin": l.min,
|
|
1103
|
-
"aria-valuemax":
|
|
1103
|
+
"aria-valuemax": a,
|
|
1104
1104
|
className: "cms-panes__splitter",
|
|
1105
1105
|
style: { "--split-at": `var(--split-pane-end-${String(n)})` },
|
|
1106
1106
|
onPointerDown: (h) => {
|
|
1107
|
-
var
|
|
1108
|
-
h.button > 0 || (h.preventDefault(), (
|
|
1107
|
+
var c, f, p;
|
|
1108
|
+
h.button > 0 || (h.preventDefault(), (f = (c = h.currentTarget).setPointerCapture) == null || f.call(c, h.pointerId), _.current = { x: h.clientX, from: t, last: t }, (p = h.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
|
|
1109
1109
|
},
|
|
1110
1110
|
onPointerMove: (h) => {
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1111
|
+
const c = _.current;
|
|
1112
|
+
c === null || !Number.isFinite(h.clientX) || (c.last = m(c.from + h.clientX - c.x), d(c.last, !1));
|
|
1113
1113
|
},
|
|
1114
1114
|
onPointerUp: (h) => {
|
|
1115
|
-
var
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1115
|
+
var f;
|
|
1116
|
+
const c = _.current;
|
|
1117
|
+
c !== null && (_.current = null, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), d(c.last, !0));
|
|
1118
1118
|
},
|
|
1119
1119
|
onPointerCancel: (h) => {
|
|
1120
|
-
var
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1120
|
+
var f;
|
|
1121
|
+
const c = _.current;
|
|
1122
|
+
_.current = null, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), c !== null && d(c.last, !0);
|
|
1123
1123
|
},
|
|
1124
|
-
onDoubleClick: () =>
|
|
1124
|
+
onDoubleClick: () => d(l.reset, !0),
|
|
1125
1125
|
onKeyDown: (h) => {
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1126
|
+
const c = h.key === "ArrowLeft" ? t - Le : h.key === "ArrowRight" ? t + Le : h.key === "Home" ? l.min : h.key === "End" ? a : h.key === "Enter" ? l.reset : null;
|
|
1127
|
+
c !== null && (h.preventDefault(), d(c, !0));
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
1130
|
);
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1),
|
|
1132
|
+
function Xn({ panes: n, active: l, back: t, sizes: o, lastMin: i = 360, onResize: s }) {
|
|
1133
|
+
const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), a = R(null), [m, _] = E(0), d = (o ?? []).slice(0, n.length - 1), h = d.length === n.length - 1 && d.every((p) => p !== void 0);
|
|
1134
1134
|
xe(() => {
|
|
1135
|
-
const
|
|
1136
|
-
if (
|
|
1137
|
-
const g = () =>
|
|
1135
|
+
const p = a.current;
|
|
1136
|
+
if (p === null || !h) return;
|
|
1137
|
+
const g = () => _(p.clientWidth);
|
|
1138
1138
|
if (g(), typeof ResizeObserver > "u") return;
|
|
1139
1139
|
const N = new ResizeObserver(g);
|
|
1140
|
-
return N.observe(
|
|
1140
|
+
return N.observe(p), () => N.disconnect();
|
|
1141
1141
|
}, [h]);
|
|
1142
|
-
const
|
|
1143
|
-
[`--split-pane-${String(g)}`, `${String(
|
|
1144
|
-
[`--split-pane-end-${String(g)}`, `${String(
|
|
1142
|
+
const c = h ? fn(d, m > 0 ? m : Number.POSITIVE_INFINITY, i) : [], f = h ? Object.fromEntries(c.flatMap((p, g) => [
|
|
1143
|
+
[`--split-pane-${String(g)}`, `${String(p)}px`],
|
|
1144
|
+
[`--split-pane-end-${String(g)}`, `${String(c.slice(0, g + 1).reduce((N, w) => N + w, 0))}px`]
|
|
1145
1145
|
])) : void 0;
|
|
1146
|
-
return /* @__PURE__ */
|
|
1146
|
+
return /* @__PURE__ */ u(
|
|
1147
1147
|
"div",
|
|
1148
1148
|
{
|
|
1149
|
-
ref:
|
|
1150
|
-
className:
|
|
1149
|
+
ref: a,
|
|
1150
|
+
className: A("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
|
|
1151
1151
|
"data-active": r,
|
|
1152
|
-
style:
|
|
1152
|
+
style: f,
|
|
1153
1153
|
children: [
|
|
1154
|
-
n.map((
|
|
1155
|
-
g === r && t ? /* @__PURE__ */
|
|
1154
|
+
n.map((p, g) => /* @__PURE__ */ u("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - g, children: [
|
|
1155
|
+
g === r && t ? /* @__PURE__ */ u("a", { className: "cms-panes__back", href: t.href, children: [
|
|
1156
1156
|
/* @__PURE__ */ e(L, { name: "chevron-left", size: 18 }),
|
|
1157
1157
|
t.label
|
|
1158
1158
|
] }) : null,
|
|
1159
|
-
|
|
1160
|
-
] },
|
|
1161
|
-
h ?
|
|
1159
|
+
p.content
|
|
1160
|
+
] }, p.label)),
|
|
1161
|
+
h ? d.map((p, g) => /* @__PURE__ */ e(
|
|
1162
1162
|
pn,
|
|
1163
1163
|
{
|
|
1164
1164
|
index: g,
|
|
1165
|
-
size:
|
|
1166
|
-
shown:
|
|
1167
|
-
others:
|
|
1165
|
+
size: p,
|
|
1166
|
+
shown: c[g],
|
|
1167
|
+
others: c.reduce((N, w, x) => x === g ? N : N + w, 0),
|
|
1168
1168
|
room: m,
|
|
1169
|
-
lastMin:
|
|
1170
|
-
onResize:
|
|
1169
|
+
lastMin: i,
|
|
1170
|
+
onResize: s
|
|
1171
1171
|
},
|
|
1172
|
-
|
|
1172
|
+
p.label
|
|
1173
1173
|
)) : null
|
|
1174
1174
|
]
|
|
1175
1175
|
}
|
|
1176
1176
|
);
|
|
1177
1177
|
}
|
|
1178
1178
|
const _n = { attachment: "Has an attachment", unread: "Unread" };
|
|
1179
|
-
function
|
|
1180
|
-
const
|
|
1181
|
-
return /* @__PURE__ */
|
|
1179
|
+
function Jn({ from: n, subject: l, preview: t, time: o, unread: i, hasAttachment: s, selected: r, onOpen: a, labels: m }) {
|
|
1180
|
+
const _ = ce(_n, m);
|
|
1181
|
+
return /* @__PURE__ */ u(
|
|
1182
1182
|
"button",
|
|
1183
1183
|
{
|
|
1184
1184
|
type: "button",
|
|
1185
|
-
className:
|
|
1185
|
+
className: A("cms-mail-row", i && "is-unread", r && "is-selected"),
|
|
1186
1186
|
"aria-current": r ? "true" : void 0,
|
|
1187
|
-
onClick:
|
|
1187
|
+
onClick: a,
|
|
1188
1188
|
children: [
|
|
1189
1189
|
/* @__PURE__ */ e(ve, { name: n, size: 40 }),
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ u("span", { className: "cms-mail-row__body", children: [
|
|
1191
|
+
/* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
|
|
1192
1192
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
1193
|
-
|
|
1193
|
+
s ? /* @__PURE__ */ e(L, { name: "paperclip", size: 16, label: _.attachment }) : null,
|
|
1194
1194
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: o })
|
|
1195
1195
|
] }),
|
|
1196
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
|
|
1197
1197
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
1198
|
-
|
|
1198
|
+
i ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": _.unread }) : null
|
|
1199
1199
|
] }),
|
|
1200
1200
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
|
|
1201
1201
|
] })
|
|
@@ -1203,49 +1203,49 @@ function Xn({ from: n, subject: l, preview: t, time: o, unread: c, hasAttachment
|
|
|
1203
1203
|
}
|
|
1204
1204
|
);
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return /* @__PURE__ */
|
|
1206
|
+
function Qn({ direction: n, children: l, time: t, read: o, readLabel: i = "Read" }) {
|
|
1207
|
+
return /* @__PURE__ */ u("div", { className: A("cms-bubble", `cms-bubble--${n}`), children: [
|
|
1208
1208
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ u("div", { className: "cms-bubble__meta", children: [
|
|
1210
1210
|
t,
|
|
1211
|
-
n === "out" && o ? /* @__PURE__ */
|
|
1211
|
+
n === "out" && o ? /* @__PURE__ */ u(M, { children: [
|
|
1212
1212
|
" · ",
|
|
1213
|
-
|
|
1213
|
+
i
|
|
1214
1214
|
] }) : null
|
|
1215
1215
|
] })
|
|
1216
1216
|
] });
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
const h =
|
|
1220
|
-
g.preventDefault(),
|
|
1221
|
-
},
|
|
1222
|
-
return /* @__PURE__ */
|
|
1218
|
+
function el({ label: n, value: l, onChange: t, onSend: o, onAttach: i, placeholder: s, variant: r = "chat", sendLabel: a = "Send", attachLabel: m = "Attach a file", leading: _, canSend: d }) {
|
|
1219
|
+
const h = G(), c = d ?? l.trim() !== "", f = (g) => {
|
|
1220
|
+
g.preventDefault(), c && o();
|
|
1221
|
+
}, p = i ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: i, children: /* @__PURE__ */ e(L, { name: "paperclip" }) }) : null;
|
|
1222
|
+
return /* @__PURE__ */ u("form", { className: A("cms-composer", `cms-composer--${r}`), onSubmit: f, children: [
|
|
1223
1223
|
/* @__PURE__ */ e("label", { htmlFor: h, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1224
|
-
r === "chat" ?
|
|
1224
|
+
r === "chat" ? p : null,
|
|
1225
1225
|
/* @__PURE__ */ e(
|
|
1226
1226
|
"textarea",
|
|
1227
1227
|
{
|
|
1228
1228
|
id: h,
|
|
1229
1229
|
className: "cms-composer__input",
|
|
1230
1230
|
rows: r === "reply" ? 3 : 1,
|
|
1231
|
-
placeholder:
|
|
1231
|
+
placeholder: s,
|
|
1232
1232
|
value: l,
|
|
1233
1233
|
onChange: (g) => t(g.target.value),
|
|
1234
1234
|
onKeyDown: (g) => {
|
|
1235
|
-
g.nativeEvent.isComposing || g.keyCode === 229 || r === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(),
|
|
1235
|
+
g.nativeEvent.isComposing || g.keyCode === 229 || r === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), c && o());
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
1238
|
),
|
|
1239
|
-
r === "reply" &&
|
|
1240
|
-
r === "reply" ?
|
|
1241
|
-
r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label":
|
|
1242
|
-
|
|
1239
|
+
r === "reply" && _ !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: _ }) : null,
|
|
1240
|
+
r === "reply" ? p : null,
|
|
1241
|
+
r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": a, disabled: !c, children: /* @__PURE__ */ e(L, { name: "send" }) }) : /* @__PURE__ */ u("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !c, children: [
|
|
1242
|
+
a,
|
|
1243
1243
|
" ",
|
|
1244
1244
|
/* @__PURE__ */ e(L, { name: "send", size: 18 })
|
|
1245
1245
|
] })
|
|
1246
1246
|
] });
|
|
1247
1247
|
}
|
|
1248
|
-
const
|
|
1248
|
+
const Ee = {
|
|
1249
1249
|
incomingAudio: "Incoming audio call",
|
|
1250
1250
|
incomingVideo: "Incoming video call",
|
|
1251
1251
|
incomingFrom: (n, l) => `${n} from ${l}`,
|
|
@@ -1266,25 +1266,25 @@ const Ae = {
|
|
|
1266
1266
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1267
1267
|
returnToCall: "Return to call"
|
|
1268
1268
|
};
|
|
1269
|
-
function
|
|
1270
|
-
const
|
|
1271
|
-
return /* @__PURE__ */
|
|
1269
|
+
function nl({ name: n, media: l, onAccept: t, onDecline: o, labels: i }) {
|
|
1270
|
+
const s = ce(Ee, i), r = l === "video" ? s.incomingVideo : s.incomingAudio;
|
|
1271
|
+
return /* @__PURE__ */ u("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(r, n), children: [
|
|
1272
1272
|
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
|
|
1273
1273
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1274
1274
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: r }),
|
|
1275
|
-
/* @__PURE__ */
|
|
1276
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label:
|
|
1277
|
-
/* @__PURE__ */ e(ae, { icon: "phone", label:
|
|
1275
|
+
/* @__PURE__ */ u("div", { className: "cms-call-incoming__actions", children: [
|
|
1276
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: o }),
|
|
1277
|
+
/* @__PURE__ */ e(ae, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
|
|
1278
1278
|
] })
|
|
1279
1279
|
] });
|
|
1280
1280
|
}
|
|
1281
|
-
function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed:
|
|
1282
|
-
return /* @__PURE__ */
|
|
1281
|
+
function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: i }) {
|
|
1282
|
+
return /* @__PURE__ */ u(
|
|
1283
1283
|
"button",
|
|
1284
1284
|
{
|
|
1285
1285
|
type: "button",
|
|
1286
|
-
className:
|
|
1287
|
-
"aria-pressed":
|
|
1286
|
+
className: A("cms-call-button", `cms-call-button--${o}`, i && "is-pressed"),
|
|
1287
|
+
"aria-pressed": i,
|
|
1288
1288
|
onClick: t,
|
|
1289
1289
|
children: [
|
|
1290
1290
|
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(L, { name: n, size: 24 }) }),
|
|
@@ -1293,61 +1293,61 @@ function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: c }) {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
);
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1297
|
-
const
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1296
|
+
function ll({ name: n, duration: l, connection: t, you: o, muted: i, speaker: s, onToggleMute: r, onToggleSpeaker: a, onAddPerson: m, onChat: _, onHangUp: d, labels: h }) {
|
|
1297
|
+
const c = ce(Ee, h);
|
|
1298
|
+
return /* @__PURE__ */ u("section", { className: "cms-call-panel", "aria-label": c.callWith(n), children: [
|
|
1299
|
+
/* @__PURE__ */ u("div", { className: "cms-call-panel__head", children: [
|
|
1300
1300
|
/* @__PURE__ */ e(ve, { name: n, size: 64 }),
|
|
1301
|
-
/* @__PURE__ */
|
|
1301
|
+
/* @__PURE__ */ u("div", { className: "cms-call-panel__who", children: [
|
|
1302
1302
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1303
|
-
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label":
|
|
1303
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": c.callTime(l), children: l })
|
|
1304
1304
|
] }),
|
|
1305
|
-
/* @__PURE__ */ e("span", { className:
|
|
1305
|
+
/* @__PURE__ */ e("span", { className: A("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? c.goodConnection : c.poorConnection })
|
|
1306
1306
|
] }),
|
|
1307
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ u("div", { className: "cms-call-panel__you", children: [
|
|
1308
1308
|
/* @__PURE__ */ e(ve, { name: o.name, size: 36 }),
|
|
1309
|
-
/* @__PURE__ */ e("span", { children:
|
|
1310
|
-
o.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label":
|
|
1309
|
+
/* @__PURE__ */ e("span", { children: c.you }),
|
|
1310
|
+
o.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": c.speaking }) : null
|
|
1311
1311
|
] }),
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
/* @__PURE__ */ e(ae, { icon: "mic", label:
|
|
1314
|
-
/* @__PURE__ */ e(ae, { icon: "speaker", label:
|
|
1315
|
-
m ? /* @__PURE__ */ e(ae, { icon: "user-plus", label:
|
|
1316
|
-
|
|
1317
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label:
|
|
1312
|
+
/* @__PURE__ */ u("div", { className: "cms-call-panel__controls", children: [
|
|
1313
|
+
/* @__PURE__ */ e(ae, { icon: "mic", label: i ? c.unmute : c.mute, pressed: i, onClick: r }),
|
|
1314
|
+
/* @__PURE__ */ e(ae, { icon: "speaker", label: c.speaker, pressed: s, onClick: a }),
|
|
1315
|
+
m ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: c.addPerson, onClick: m }) : null,
|
|
1316
|
+
_ ? /* @__PURE__ */ e(ae, { icon: "chat", label: c.chat, onClick: _ }) : null,
|
|
1317
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: c.hangUp, tone: "hang-up", onClick: d })
|
|
1318
1318
|
] })
|
|
1319
1319
|
] });
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1322
|
-
const
|
|
1323
|
-
return /* @__PURE__ */
|
|
1321
|
+
function tl({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: i, onHangUp: s, labels: r }) {
|
|
1322
|
+
const a = ce(Ee, r);
|
|
1323
|
+
return /* @__PURE__ */ u("section", { className: "cms-call-bar", "aria-label": a.callWith(n), children: [
|
|
1324
1324
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1325
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
1325
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: a.onCallWith(n) }),
|
|
1326
1326
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ?
|
|
1329
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick:
|
|
1330
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1327
|
+
/* @__PURE__ */ u("span", { className: "cms-call-bar__actions", children: [
|
|
1328
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? a.unmute : a.mute, "aria-pressed": t, onClick: o, children: /* @__PURE__ */ e(L, { name: "mic" }) }),
|
|
1329
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: i, children: a.returnToCall }),
|
|
1330
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": a.hangUp, onClick: s, children: /* @__PURE__ */ e(L, { name: "phone-off" }) })
|
|
1331
1331
|
] })
|
|
1332
1332
|
] });
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1337
|
-
/* @__PURE__ */
|
|
1334
|
+
function al({ mark: n, product: l, headline: t, lead: o, features: i = [], children: s }) {
|
|
1335
|
+
return /* @__PURE__ */ u("div", { className: "cms-signin", children: [
|
|
1336
|
+
/* @__PURE__ */ u("aside", { className: "cms-signin__brand", children: [
|
|
1337
|
+
/* @__PURE__ */ u("p", { className: "cms-signin__logo", children: [
|
|
1338
1338
|
/* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
|
|
1339
1339
|
l
|
|
1340
1340
|
] }),
|
|
1341
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ u("div", { className: "cms-signin__pitch", children: [
|
|
1342
1342
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
|
|
1343
1343
|
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: o }),
|
|
1344
|
-
|
|
1344
|
+
i.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: i.map((r) => /* @__PURE__ */ u("li", { children: [
|
|
1345
1345
|
/* @__PURE__ */ e(L, { name: r.icon, size: 18 }),
|
|
1346
1346
|
r.label
|
|
1347
1347
|
] }, r.label)) }) : null
|
|
1348
1348
|
] })
|
|
1349
1349
|
] }),
|
|
1350
|
-
/* @__PURE__ */ e("main", { className: "cms-signin__form", children:
|
|
1350
|
+
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: s })
|
|
1351
1351
|
] });
|
|
1352
1352
|
}
|
|
1353
1353
|
const bn = {
|
|
@@ -1362,17 +1362,17 @@ const bn = {
|
|
|
1362
1362
|
newHere: "New here?",
|
|
1363
1363
|
create: "Create an account"
|
|
1364
1364
|
};
|
|
1365
|
-
function
|
|
1366
|
-
const
|
|
1367
|
-
return /* @__PURE__ */
|
|
1368
|
-
N.preventDefault(), l(
|
|
1369
|
-
}, "aria-describedby":
|
|
1370
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
1371
|
-
/* @__PURE__ */
|
|
1365
|
+
function sl({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: i, busy: s, labels: r }) {
|
|
1366
|
+
const a = ce(bn, r), m = G(), [_, d] = E(""), [h, c] = E(""), [f, p] = E(!1);
|
|
1367
|
+
return /* @__PURE__ */ u("form", { className: "cms-signin-form", onSubmit: (N) => {
|
|
1368
|
+
N.preventDefault(), l(_, h);
|
|
1369
|
+
}, "aria-describedby": i ? `${m}-error` : void 0, children: [
|
|
1370
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: a.title }),
|
|
1371
|
+
/* @__PURE__ */ u("p", { className: "cms-signin-form__server", children: [
|
|
1372
1372
|
/* @__PURE__ */ e(L, { name: "server", size: 18 }),
|
|
1373
1373
|
n
|
|
1374
1374
|
] }),
|
|
1375
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-identifier`, children:
|
|
1375
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-identifier`, children: a.identifier }),
|
|
1376
1376
|
/* @__PURE__ */ e(
|
|
1377
1377
|
"input",
|
|
1378
1378
|
{
|
|
@@ -1380,34 +1380,34 @@ function tl({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: c, bu
|
|
|
1380
1380
|
className: "cms-signin-form__input",
|
|
1381
1381
|
type: "text",
|
|
1382
1382
|
autoComplete: "username",
|
|
1383
|
-
placeholder:
|
|
1384
|
-
value:
|
|
1385
|
-
onChange: (N) =>
|
|
1383
|
+
placeholder: a.identifierPlaceholder,
|
|
1384
|
+
value: _,
|
|
1385
|
+
onChange: (N) => d(N.target.value),
|
|
1386
1386
|
required: !0
|
|
1387
1387
|
}
|
|
1388
1388
|
),
|
|
1389
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children:
|
|
1390
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children: a.password }),
|
|
1390
|
+
/* @__PURE__ */ u("span", { className: "cms-signin-form__password", children: [
|
|
1391
1391
|
/* @__PURE__ */ e(
|
|
1392
1392
|
"input",
|
|
1393
1393
|
{
|
|
1394
1394
|
id: `${m}-password`,
|
|
1395
1395
|
className: "cms-signin-form__input",
|
|
1396
|
-
type:
|
|
1396
|
+
type: f ? "text" : "password",
|
|
1397
1397
|
autoComplete: "current-password",
|
|
1398
1398
|
value: h,
|
|
1399
|
-
onChange: (N) =>
|
|
1399
|
+
onChange: (N) => c(N.target.value),
|
|
1400
1400
|
required: !0
|
|
1401
1401
|
}
|
|
1402
1402
|
),
|
|
1403
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed":
|
|
1403
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => p((N) => !N), children: f ? a.hide : a.show })
|
|
1404
1404
|
] }),
|
|
1405
|
-
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children:
|
|
1406
|
-
|
|
1407
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled:
|
|
1408
|
-
o ? /* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
1410
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: o, children:
|
|
1405
|
+
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: a.forgot }) : null,
|
|
1406
|
+
i ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: i }) : null,
|
|
1407
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: a.submit }),
|
|
1408
|
+
o ? /* @__PURE__ */ u(M, { children: [
|
|
1409
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: a.newHere }) }),
|
|
1410
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: o, children: a.create })
|
|
1411
1411
|
] }) : null
|
|
1412
1412
|
] });
|
|
1413
1413
|
}
|
|
@@ -1420,157 +1420,157 @@ function vn(n, l) {
|
|
|
1420
1420
|
return l.scrollTop <= 0;
|
|
1421
1421
|
}
|
|
1422
1422
|
function gn(n, l) {
|
|
1423
|
-
const [t, o] =
|
|
1424
|
-
return
|
|
1425
|
-
const
|
|
1426
|
-
if (
|
|
1427
|
-
let r = null,
|
|
1423
|
+
const [t, o] = E(0), i = R(l);
|
|
1424
|
+
return i.current = l, Y(() => {
|
|
1425
|
+
const s = n.current;
|
|
1426
|
+
if (s === null) return;
|
|
1427
|
+
let r = null, a = 0;
|
|
1428
1428
|
const m = (h) => {
|
|
1429
|
-
r = vn(h.target,
|
|
1430
|
-
},
|
|
1431
|
-
if (r === null ||
|
|
1432
|
-
const
|
|
1433
|
-
if (
|
|
1429
|
+
r = vn(h.target, s) && h.touches.length === 1 ? h.touches[0].clientY : null, a = 0;
|
|
1430
|
+
}, _ = (h) => {
|
|
1431
|
+
if (r === null || i.current === null) return;
|
|
1432
|
+
const c = h.touches[0].clientY - r;
|
|
1433
|
+
if (c <= 0) {
|
|
1434
1434
|
r = null, o(0);
|
|
1435
1435
|
return;
|
|
1436
1436
|
}
|
|
1437
|
-
h.cancelable && h.preventDefault(),
|
|
1438
|
-
},
|
|
1437
|
+
h.cancelable && h.preventDefault(), a = Math.min(c * 0.6, we * 1.5), o(a);
|
|
1438
|
+
}, d = () => {
|
|
1439
1439
|
var h;
|
|
1440
|
-
r !== null &&
|
|
1440
|
+
r !== null && a >= we && ((h = i.current) == null || h.call(i)), r = null, a = 0, o(0);
|
|
1441
1441
|
};
|
|
1442
|
-
return
|
|
1443
|
-
|
|
1442
|
+
return s.addEventListener("touchstart", m, { passive: !0 }), s.addEventListener("touchmove", _, { passive: !1 }), s.addEventListener("touchend", d), s.addEventListener("touchcancel", d), () => {
|
|
1443
|
+
s.removeEventListener("touchstart", m), s.removeEventListener("touchmove", _), s.removeEventListener("touchend", d), s.removeEventListener("touchcancel", d);
|
|
1444
1444
|
};
|
|
1445
1445
|
}, [n]), t;
|
|
1446
1446
|
}
|
|
1447
1447
|
const Fe = Ue(null);
|
|
1448
1448
|
function Nn() {
|
|
1449
|
-
return
|
|
1450
|
-
}
|
|
1451
|
-
function
|
|
1452
|
-
const
|
|
1453
|
-
if (t != null) return /* @__PURE__ */ e(
|
|
1454
|
-
if (l === null) return /* @__PURE__ */ e(qe, { what:
|
|
1455
|
-
if (l.length === 0) return /* @__PURE__ */ e(Ye, { title:
|
|
1456
|
-
const
|
|
1449
|
+
return Ke(Fe);
|
|
1450
|
+
}
|
|
1451
|
+
function rl({ label: n, rows: l, error: t, onRetry: o, loadingText: i = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: a, onOpen: m, onRowMenu: _ }) {
|
|
1452
|
+
const d = R([]), h = Nn();
|
|
1453
|
+
if (t != null) return /* @__PURE__ */ e(Ge, { message: t, onRetry: o });
|
|
1454
|
+
if (l === null) return /* @__PURE__ */ e(qe, { what: i, layout: "block" });
|
|
1455
|
+
if (l.length === 0) return /* @__PURE__ */ e(Ye, { title: s, hint: r });
|
|
1456
|
+
const c = (f, p, g) => {
|
|
1457
1457
|
var N;
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
else if (
|
|
1458
|
+
if (f.key === "ArrowDown" || f.key === "ArrowUp")
|
|
1459
|
+
f.preventDefault(), (N = d.current[Math.min(l.length - 1, Math.max(0, p + (f.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
|
|
1460
|
+
else if (f.key === "Enter")
|
|
1461
1461
|
m == null || m(g);
|
|
1462
|
-
else if ((
|
|
1463
|
-
|
|
1464
|
-
const w =
|
|
1465
|
-
|
|
1462
|
+
else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && _) {
|
|
1463
|
+
f.preventDefault();
|
|
1464
|
+
const w = f.currentTarget.getBoundingClientRect();
|
|
1465
|
+
_(g, { x: w.left + 16, y: w.bottom });
|
|
1466
1466
|
}
|
|
1467
1467
|
};
|
|
1468
|
-
return /* @__PURE__ */
|
|
1469
|
-
h !== null && (h.distance > 0 || h.refreshing) ? /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ u(M, { children: [
|
|
1469
|
+
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: [
|
|
1470
1470
|
h.refreshing ? /* @__PURE__ */ e(z, { name: "spinner" }) : null,
|
|
1471
1471
|
h.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: h.text }) : null
|
|
1472
1472
|
] }) : null,
|
|
1473
|
-
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((
|
|
1474
|
-
const g =
|
|
1475
|
-
return /* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((f, p) => {
|
|
1474
|
+
const g = f.id === a;
|
|
1475
|
+
return /* @__PURE__ */ u(
|
|
1476
1476
|
"li",
|
|
1477
1477
|
{
|
|
1478
1478
|
ref: (N) => {
|
|
1479
|
-
|
|
1479
|
+
d.current[p] = N;
|
|
1480
1480
|
},
|
|
1481
1481
|
role: "option",
|
|
1482
1482
|
"aria-selected": g,
|
|
1483
|
-
tabIndex: g ||
|
|
1484
|
-
className:
|
|
1485
|
-
onClick: () => m == null ? void 0 : m(
|
|
1486
|
-
onKeyDown: (N) =>
|
|
1487
|
-
onContextMenu:
|
|
1488
|
-
N.preventDefault(), f
|
|
1483
|
+
tabIndex: g || a == null && p === 0 ? 0 : -1,
|
|
1484
|
+
className: A("cms-list__row", g && "is-selected"),
|
|
1485
|
+
onClick: () => m == null ? void 0 : m(f.id),
|
|
1486
|
+
onKeyDown: (N) => c(N, p, f.id),
|
|
1487
|
+
onContextMenu: _ ? (N) => {
|
|
1488
|
+
N.preventDefault(), _(f.id, { x: N.clientX, y: N.clientY });
|
|
1489
1489
|
} : void 0,
|
|
1490
1490
|
children: [
|
|
1491
|
-
|
|
1492
|
-
/* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */ e("span", { className:
|
|
1494
|
-
|
|
1491
|
+
f.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: f.lead }) : null,
|
|
1492
|
+
/* @__PURE__ */ u("span", { className: "cms-list__text", children: [
|
|
1493
|
+
/* @__PURE__ */ e("span", { className: A("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
|
|
1494
|
+
f.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: f.secondary }) : null
|
|
1495
1495
|
] }),
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1496
|
+
f.meta != null || f.count !== void 0 ? /* @__PURE__ */ u("span", { className: "cms-list__end", children: [
|
|
1497
|
+
f.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: f.meta }) : null,
|
|
1498
|
+
f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: f.count }) : null
|
|
1499
1499
|
] }) : null
|
|
1500
1500
|
]
|
|
1501
1501
|
},
|
|
1502
|
-
|
|
1502
|
+
f.id
|
|
1503
1503
|
);
|
|
1504
1504
|
}) })
|
|
1505
1505
|
] });
|
|
1506
1506
|
}
|
|
1507
|
-
function He({ at: n, items: l, onClose: t, label: o = "Actions", focus:
|
|
1508
|
-
const
|
|
1507
|
+
function He({ at: n, items: l, onClose: t, label: o = "Actions", focus: i = "first" }) {
|
|
1508
|
+
const s = R(null), r = R(null), a = G(), [m, _] = E(n), d = l.filter((c) => c.offer.offered);
|
|
1509
1509
|
if (xe(() => {
|
|
1510
1510
|
if (!n) return;
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1511
|
+
const c = s.current, f = (c == null ? void 0 : c.offsetWidth) ?? 0, p = (c == null ? void 0 : c.offsetHeight) ?? 0;
|
|
1512
|
+
_({ x: Math.max(0, Math.min(n.x, window.innerWidth - f)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
|
|
1513
1513
|
}, [n]), Y(() => {
|
|
1514
|
-
var
|
|
1514
|
+
var p, g;
|
|
1515
1515
|
if (!n) return;
|
|
1516
1516
|
r.current = document.activeElement;
|
|
1517
|
-
const
|
|
1518
|
-
(g =
|
|
1519
|
-
const
|
|
1517
|
+
const c = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1518
|
+
(g = i === "last" ? c[c.length - 1] : c[0]) == null || g.focus();
|
|
1519
|
+
const f = (N) => {
|
|
1520
1520
|
var w;
|
|
1521
|
-
(w =
|
|
1521
|
+
(w = s.current) != null && w.contains(N.target) || t();
|
|
1522
1522
|
};
|
|
1523
|
-
return document.addEventListener("mousedown",
|
|
1523
|
+
return document.addEventListener("mousedown", f), () => {
|
|
1524
1524
|
var N, w;
|
|
1525
|
-
document.removeEventListener("mousedown",
|
|
1525
|
+
document.removeEventListener("mousedown", f), (w = (N = r.current) == null ? void 0 : N.focus) == null || w.call(N);
|
|
1526
1526
|
};
|
|
1527
|
-
}, [n, t,
|
|
1528
|
-
const h = (
|
|
1527
|
+
}, [n, t, i]), !n || d.length === 0) return null;
|
|
1528
|
+
const h = (c) => {
|
|
1529
1529
|
var g, N;
|
|
1530
|
-
const
|
|
1531
|
-
if (
|
|
1532
|
-
|
|
1533
|
-
else if (
|
|
1534
|
-
|
|
1535
|
-
const w =
|
|
1536
|
-
(N =
|
|
1530
|
+
const f = Array.from(((g = s.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]')) ?? []), p = f.indexOf(document.activeElement);
|
|
1531
|
+
if (c.key === "Escape" || c.key === "Tab")
|
|
1532
|
+
c.preventDefault(), t();
|
|
1533
|
+
else if (c.key === "ArrowDown" || c.key === "ArrowUp") {
|
|
1534
|
+
c.preventDefault();
|
|
1535
|
+
const w = c.key === "ArrowDown" ? 1 : -1;
|
|
1536
|
+
(N = f[(p + w + f.length) % f.length]) == null || N.focus();
|
|
1537
1537
|
}
|
|
1538
1538
|
};
|
|
1539
1539
|
return Me(
|
|
1540
1540
|
/* @__PURE__ */ e(
|
|
1541
1541
|
"div",
|
|
1542
1542
|
{
|
|
1543
|
-
ref:
|
|
1543
|
+
ref: s,
|
|
1544
1544
|
className: "cms-menu",
|
|
1545
1545
|
role: "menu",
|
|
1546
1546
|
"aria-label": o,
|
|
1547
1547
|
style: { left: (m ?? n).x, top: (m ?? n).y },
|
|
1548
1548
|
onKeyDown: h,
|
|
1549
|
-
onContextMenu: (
|
|
1550
|
-
children:
|
|
1551
|
-
const
|
|
1552
|
-
return /* @__PURE__ */
|
|
1549
|
+
onContextMenu: (c) => c.preventDefault(),
|
|
1550
|
+
children: d.map((c) => {
|
|
1551
|
+
const f = c.offer.refusal !== void 0;
|
|
1552
|
+
return /* @__PURE__ */ u(
|
|
1553
1553
|
"div",
|
|
1554
1554
|
{
|
|
1555
1555
|
role: "menuitem",
|
|
1556
1556
|
tabIndex: -1,
|
|
1557
|
-
"aria-disabled":
|
|
1558
|
-
"aria-describedby":
|
|
1559
|
-
title:
|
|
1560
|
-
className:
|
|
1557
|
+
"aria-disabled": f || void 0,
|
|
1558
|
+
"aria-describedby": f ? `${a}-${c.id}` : void 0,
|
|
1559
|
+
title: f ? c.offer.refusal : void 0,
|
|
1560
|
+
className: A("cms-menu__item", c.danger && "is-danger", c.offer.locked && "is-locked", f && "is-refused"),
|
|
1561
1561
|
onClick: () => {
|
|
1562
|
-
|
|
1562
|
+
f || (t(), c.onSelect());
|
|
1563
1563
|
},
|
|
1564
|
-
onKeyDown: (
|
|
1565
|
-
(
|
|
1564
|
+
onKeyDown: (p) => {
|
|
1565
|
+
(p.key === "Enter" || p.key === " ") && !f && (p.preventDefault(), t(), c.onSelect());
|
|
1566
1566
|
},
|
|
1567
1567
|
children: [
|
|
1568
|
-
|
|
1569
|
-
/* @__PURE__ */ e("span", { className: "cms-menu__label", children:
|
|
1570
|
-
|
|
1568
|
+
c.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
|
|
1569
|
+
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: c.label }),
|
|
1570
|
+
f ? /* @__PURE__ */ e("span", { id: `${a}-${c.id}`, className: "cms-menu__refusal", children: c.offer.refusal }) : null
|
|
1571
1571
|
]
|
|
1572
1572
|
},
|
|
1573
|
-
|
|
1573
|
+
c.id
|
|
1574
1574
|
);
|
|
1575
1575
|
})
|
|
1576
1576
|
}
|
|
@@ -1589,43 +1589,43 @@ function wn(n) {
|
|
|
1589
1589
|
for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
|
|
1590
1590
|
return [...l.entries()].sort(([t], [o]) => t - o).map(([, t]) => t);
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1593
|
-
const r =
|
|
1594
|
-
const v = r.current, T =
|
|
1592
|
+
function cl({ label: n, actions: l, onAction: t, status: o, moreLabel: i, leading: s }) {
|
|
1593
|
+
const r = R(null), a = R(null), [m, _] = E(De), [d, h] = E(null), [c, f] = E("first"), [p, g] = E(null), [N, w] = E(null), x = yn(l), S = wn(l), C = x.flat(), F = C.filter((v) => v.overflow === 0), H = C.filter((v) => v.overflow !== 0), ee = JSON.stringify([l.map((v) => [v.id, v.label, v.icon, v.group, v.overflow ?? null]), o ?? "", s !== void 0]), j = be(() => {
|
|
1594
|
+
const v = r.current, T = a.current;
|
|
1595
1595
|
if (v === null || T === null) return;
|
|
1596
|
-
const Z = getComputedStyle(v), W = parseFloat(Z.columnGap || "0") || 0, $ = v.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), q = (
|
|
1596
|
+
const Z = getComputedStyle(v), W = parseFloat(Z.columnGap || "0") || 0, $ = v.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), q = (I) => {
|
|
1597
1597
|
var U;
|
|
1598
|
-
return ((U = T.querySelector(
|
|
1599
|
-
}, de = q('[data-measure="leading"]'), ue = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), he = (
|
|
1600
|
-
const Q = /* @__PURE__ */ new Set([...F.map((te) => te.id), ...U]), se = x.map((te) => te.filter((pe) => !Q.has(pe.id))).filter((te) => te.length > 0), fe = se.flat(),
|
|
1601
|
-
return de + fe.reduce((te, pe) => te + he(pe.id, !
|
|
1602
|
-
}, k = H.filter((
|
|
1603
|
-
let
|
|
1604
|
-
if (b(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $)
|
|
1598
|
+
return ((U = T.querySelector(I)) == null ? void 0 : U.getBoundingClientRect().width) ?? 0;
|
|
1599
|
+
}, de = q('[data-measure="leading"]'), ue = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), he = (I, U) => q(`[data-measure="${U ? "full" : "icon"}"][data-measure-action="${CSS.escape(I)}"]`), b = (I, U) => {
|
|
1600
|
+
const Q = /* @__PURE__ */ new Set([...F.map((te) => te.id), ...U]), se = x.map((te) => te.filter((pe) => !Q.has(pe.id))).filter((te) => te.length > 0), fe = se.flat(), Re = fe.length + (se.length - 1) + (Q.size > 0 ? 1 : 0) + (de > 0 ? 1 : 0);
|
|
1601
|
+
return de + fe.reduce((te, pe) => te + he(pe.id, !I.has(pe.id)), 0) + ue * Math.max(0, se.length - 1) + (Q.size > 0 ? me : 0) + W * Math.max(0, Re - 1);
|
|
1602
|
+
}, k = H.filter((I) => !S.some((U) => U.includes(I.id))).map((I) => I.id), B = [...S, ...[...k].reverse().map((I) => [I])];
|
|
1603
|
+
let K = null;
|
|
1604
|
+
if (b(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) K = De;
|
|
1605
1605
|
else {
|
|
1606
|
-
const
|
|
1606
|
+
const I = /* @__PURE__ */ new Set();
|
|
1607
1607
|
for (const U of B) {
|
|
1608
|
-
for (const Q of U)
|
|
1609
|
-
if (b(
|
|
1610
|
-
|
|
1608
|
+
for (const Q of U) I.add(Q);
|
|
1609
|
+
if (b(I, /* @__PURE__ */ new Set()) <= $) {
|
|
1610
|
+
K = { bare: I, hidden: /* @__PURE__ */ new Set() };
|
|
1611
1611
|
break;
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
|
-
if (
|
|
1616
|
-
const
|
|
1615
|
+
if (K === null) {
|
|
1616
|
+
const I = new Set(H.map((Q) => Q.id)), U = /* @__PURE__ */ new Set();
|
|
1617
1617
|
for (const Q of S) {
|
|
1618
1618
|
for (const se of Q) H.some((fe) => fe.id === se) && U.add(se);
|
|
1619
|
-
if (U.size >= 2 && b(
|
|
1619
|
+
if (U.size >= 2 && b(I, U) <= $) break;
|
|
1620
1620
|
}
|
|
1621
|
-
if (b(
|
|
1621
|
+
if (b(I, U) > $) {
|
|
1622
1622
|
for (const Q of [...k].reverse())
|
|
1623
|
-
if (U.add(Q), b(
|
|
1623
|
+
if (U.add(Q), b(I, U) <= $) break;
|
|
1624
1624
|
}
|
|
1625
|
-
|
|
1625
|
+
K = { bare: I, hidden: U };
|
|
1626
1626
|
}
|
|
1627
|
-
const ge =
|
|
1628
|
-
|
|
1627
|
+
const ge = K;
|
|
1628
|
+
_((I) => $e(I.bare, ge.bare) && $e(I.hidden, ge.hidden) ? I : ge);
|
|
1629
1629
|
}, [ee]);
|
|
1630
1630
|
xe(j, [j]), Y(() => {
|
|
1631
1631
|
const v = r.current;
|
|
@@ -1638,7 +1638,7 @@ function sl({ label: n, actions: l, onAction: t, status: o, moreLabel: c, leadin
|
|
|
1638
1638
|
...S.flat().map((v) => C.find((T) => T.id === v)).filter((v) => v !== void 0 && m.hidden.has(v.id)),
|
|
1639
1639
|
// The pinned that a row too narrow for them sent behind ..., in the row's order.
|
|
1640
1640
|
...H.filter((v) => m.hidden.has(v.id) && !S.some((T) => T.includes(v.id)))
|
|
1641
|
-
],
|
|
1641
|
+
], X = new Set(H.filter((v) => !S.some((T) => T.includes(v.id))).map((v) => v.id)), O = [...V.map((v) => v.id), ...D.length > 0 ? ["more"] : []], J = p !== null && O.includes(p) ? p : O[0] ?? null, ie = (v) => {
|
|
1642
1642
|
var $, q;
|
|
1643
1643
|
const T = O.indexOf(J ?? "");
|
|
1644
1644
|
let Z = null;
|
|
@@ -1648,7 +1648,7 @@ function sl({ label: n, actions: l, onAction: t, status: o, moreLabel: c, leadin
|
|
|
1648
1648
|
g(W), (q = ($ = r.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || q.focus();
|
|
1649
1649
|
}, oe = D.map((v) => ({
|
|
1650
1650
|
id: v.id,
|
|
1651
|
-
label: /* @__PURE__ */
|
|
1651
|
+
label: /* @__PURE__ */ u(M, { children: [
|
|
1652
1652
|
/* @__PURE__ */ e(_e, { name: v.icon }),
|
|
1653
1653
|
v.label
|
|
1654
1654
|
] }),
|
|
@@ -1658,23 +1658,23 @@ function sl({ label: n, actions: l, onAction: t, status: o, moreLabel: c, leadin
|
|
|
1658
1658
|
!v.disabled && !v.busy && t(v.id);
|
|
1659
1659
|
}
|
|
1660
1660
|
}));
|
|
1661
|
-
return /* @__PURE__ */
|
|
1661
|
+
return /* @__PURE__ */ u(
|
|
1662
1662
|
"div",
|
|
1663
1663
|
{
|
|
1664
1664
|
ref: r,
|
|
1665
1665
|
role: "toolbar",
|
|
1666
1666
|
"aria-label": n,
|
|
1667
|
-
className:
|
|
1667
|
+
className: A(
|
|
1668
1668
|
"cms-pane-toolbar",
|
|
1669
1669
|
H.length > 0 && m.bare.size >= H.length && "cms-pane-toolbar--labels-hidden",
|
|
1670
1670
|
m.bare.size > 0 && m.bare.size < H.length && "cms-pane-toolbar--labels-partly-hidden"
|
|
1671
1671
|
),
|
|
1672
1672
|
onKeyDown: ie,
|
|
1673
1673
|
children: [
|
|
1674
|
-
|
|
1674
|
+
s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
|
|
1675
1675
|
x.map((v, T) => {
|
|
1676
1676
|
const Z = v.filter(($) => !y.has($.id)), W = x.slice(0, T).some(($) => $.some((q) => !y.has(q.id)));
|
|
1677
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ u("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1678
1678
|
Z.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1679
1679
|
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: v.map(($) => /* @__PURE__ */ e(
|
|
1680
1680
|
kn,
|
|
@@ -1682,7 +1682,7 @@ function sl({ label: n, actions: l, onAction: t, status: o, moreLabel: c, leadin
|
|
|
1682
1682
|
action: $,
|
|
1683
1683
|
labels: !m.bare.has($.id),
|
|
1684
1684
|
overflowed: y.has($.id),
|
|
1685
|
-
pinned:
|
|
1685
|
+
pinned: X.has($.id),
|
|
1686
1686
|
tabbable: J === $.id,
|
|
1687
1687
|
tipOff: N === $.id,
|
|
1688
1688
|
onChoose: () => t($.id),
|
|
@@ -1700,60 +1700,60 @@ function sl({ label: n, actions: l, onAction: t, status: o, moreLabel: c, leadin
|
|
|
1700
1700
|
type: "button",
|
|
1701
1701
|
className: "cms-icon-button cms-pane-toolbar__more",
|
|
1702
1702
|
"data-stop": "more",
|
|
1703
|
-
"aria-label":
|
|
1704
|
-
title:
|
|
1703
|
+
"aria-label": i,
|
|
1704
|
+
title: i,
|
|
1705
1705
|
"aria-haspopup": "menu",
|
|
1706
|
-
"aria-expanded":
|
|
1706
|
+
"aria-expanded": d !== null,
|
|
1707
1707
|
tabIndex: J === "more" ? 0 : -1,
|
|
1708
1708
|
onFocus: () => g("more"),
|
|
1709
1709
|
onClick: (v) => {
|
|
1710
1710
|
const T = v.currentTarget.getBoundingClientRect();
|
|
1711
|
-
|
|
1711
|
+
f("first"), h(d === null ? { x: T.left, y: T.bottom } : null);
|
|
1712
1712
|
},
|
|
1713
1713
|
onKeyDown: (v) => {
|
|
1714
1714
|
if (v.key === "ArrowDown" || v.key === "ArrowUp") {
|
|
1715
1715
|
v.preventDefault(), v.stopPropagation();
|
|
1716
1716
|
const T = v.currentTarget.getBoundingClientRect();
|
|
1717
|
-
|
|
1717
|
+
f(v.key === "ArrowUp" ? "last" : "first"), h({ x: T.left, y: T.bottom });
|
|
1718
1718
|
}
|
|
1719
1719
|
},
|
|
1720
1720
|
children: /* @__PURE__ */ e(L, { name: "more" })
|
|
1721
1721
|
}
|
|
1722
1722
|
) : null,
|
|
1723
1723
|
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: o, children: o }) : null,
|
|
1724
|
-
/* @__PURE__ */ e(He, { at:
|
|
1725
|
-
/* @__PURE__ */
|
|
1726
|
-
|
|
1724
|
+
/* @__PURE__ */ e(He, { at: d, items: oe, onClose: () => h(null), label: i, focus: c }),
|
|
1725
|
+
/* @__PURE__ */ u("div", { ref: a, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
1726
|
+
s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
|
|
1727
1727
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
1728
1728
|
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(L, { name: "more" }) }),
|
|
1729
|
-
C.map((v) => /* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1729
|
+
C.map((v) => /* @__PURE__ */ u("span", { children: [
|
|
1730
|
+
/* @__PURE__ */ u("span", { "data-measure": "full", "data-measure-action": v.id, className: "cms-pane-toolbar__action", children: [
|
|
1731
1731
|
/* @__PURE__ */ e(_e, { name: v.icon }),
|
|
1732
1732
|
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label })
|
|
1733
1733
|
] }),
|
|
1734
|
-
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": v.id, className:
|
|
1734
|
+
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": v.id, className: A("cms-pane-toolbar__action", re(v.icon) !== null && "cms-pane-toolbar__action--bare"), children: re(v.icon) !== null ? /* @__PURE__ */ e(_e, { name: v.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label }) })
|
|
1735
1735
|
] }, v.id))
|
|
1736
1736
|
] })
|
|
1737
1737
|
]
|
|
1738
1738
|
}
|
|
1739
1739
|
);
|
|
1740
1740
|
}
|
|
1741
|
-
function kn({ action: n, labels: l, overflowed: t, pinned: o, tabbable:
|
|
1742
|
-
const [m,
|
|
1741
|
+
function kn({ action: n, labels: l, overflowed: t, pinned: o, tabbable: i, tipOff: s, onChoose: r, onFocus: a }) {
|
|
1742
|
+
const [m, _] = E(!1);
|
|
1743
1743
|
Y(() => {
|
|
1744
1744
|
if (!n.busy) {
|
|
1745
|
-
|
|
1745
|
+
_(!1);
|
|
1746
1746
|
return;
|
|
1747
1747
|
}
|
|
1748
|
-
const w = setTimeout(() =>
|
|
1748
|
+
const w = setTimeout(() => _(!0), ye);
|
|
1749
1749
|
return () => clearTimeout(w);
|
|
1750
1750
|
}, [n.busy]);
|
|
1751
|
-
const
|
|
1752
|
-
return /* @__PURE__ */
|
|
1751
|
+
const d = re(n.icon) === null, h = l || d, c = n.disabled && n.reason ? n.reason : null, f = c ?? (h ? null : n.label), p = G(), [g, N] = E(!1);
|
|
1752
|
+
return /* @__PURE__ */ u(
|
|
1753
1753
|
"button",
|
|
1754
1754
|
{
|
|
1755
1755
|
type: "button",
|
|
1756
|
-
className:
|
|
1756
|
+
className: A("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", d && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
|
|
1757
1757
|
"data-action": n.id,
|
|
1758
1758
|
"data-stop": n.id,
|
|
1759
1759
|
...t ? { "data-overflowed": "" } : {},
|
|
@@ -1762,21 +1762,21 @@ function kn({ action: n, labels: l, overflowed: t, pinned: o, tabbable: c, tipOf
|
|
|
1762
1762
|
"aria-label": n.label,
|
|
1763
1763
|
"aria-disabled": n.disabled || void 0,
|
|
1764
1764
|
"aria-busy": n.busy || void 0,
|
|
1765
|
-
...
|
|
1766
|
-
...g &&
|
|
1767
|
-
tabIndex:
|
|
1768
|
-
onFocus:
|
|
1765
|
+
...c === null ? {} : { "aria-describedby": p },
|
|
1766
|
+
...g && c !== null ? { "data-reason-shown": "" } : {},
|
|
1767
|
+
tabIndex: i ? 0 : -1,
|
|
1768
|
+
onFocus: a,
|
|
1769
1769
|
onBlur: () => N(!1),
|
|
1770
1770
|
onKeyDown: (w) => {
|
|
1771
1771
|
w.key === "Escape" && N(!1);
|
|
1772
1772
|
},
|
|
1773
1773
|
onClick: () => {
|
|
1774
|
-
|
|
1774
|
+
c !== null ? N(!0) : !n.disabled && !n.busy && r();
|
|
1775
1775
|
},
|
|
1776
1776
|
children: [
|
|
1777
1777
|
m ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(_e, { name: n.icon }),
|
|
1778
1778
|
h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
|
|
1779
|
-
|
|
1779
|
+
c !== null || f !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: f }) : null
|
|
1780
1780
|
]
|
|
1781
1781
|
}
|
|
1782
1782
|
);
|
|
@@ -1785,39 +1785,39 @@ function _e({ name: n }) {
|
|
|
1785
1785
|
const l = re(n);
|
|
1786
1786
|
return l === null ? null : /* @__PURE__ */ e(L, { name: l, size: 18 });
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const [
|
|
1788
|
+
function il({ title: n, body: l = null, time: t = null, unread: o, unreadLabel: i, expandLabel: s, collapseLabel: r, action: a = null, onRead: m, leading: _ }) {
|
|
1789
|
+
const [d, h] = E(!1), c = G(), f = () => {
|
|
1790
1790
|
o && m();
|
|
1791
|
-
},
|
|
1791
|
+
}, p = (a == null ? void 0 : a.presentation) === "row" && a.onAction !== void 0, g = (a == null ? void 0 : a.presentation) === "button" && a.onAction !== void 0 ? a : null, N = () => {
|
|
1792
1792
|
var w;
|
|
1793
|
-
|
|
1793
|
+
f(), p && ((w = a.onAction) == null || w.call(a));
|
|
1794
1794
|
};
|
|
1795
|
-
return /* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ u("article", { className: A("cms-notification", o && "is-unread", d && "is-expanded", p && "is-row-action"), "data-state": o ? "unread" : "read", children: [
|
|
1796
|
+
/* @__PURE__ */ u(
|
|
1797
1797
|
"div",
|
|
1798
1798
|
{
|
|
1799
1799
|
className: "cms-notification__row",
|
|
1800
1800
|
role: "button",
|
|
1801
1801
|
tabIndex: 0,
|
|
1802
|
-
"aria-describedby": l === null ? void 0 :
|
|
1802
|
+
"aria-describedby": l === null ? void 0 : c,
|
|
1803
1803
|
onClick: N,
|
|
1804
1804
|
onKeyDown: (w) => {
|
|
1805
1805
|
w.target !== w.currentTarget || w.key !== "Enter" && w.key !== " " || (w.preventDefault(), N());
|
|
1806
1806
|
},
|
|
1807
1807
|
children: [
|
|
1808
|
-
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
o ? /* @__PURE__ */
|
|
1813
|
-
|
|
1808
|
+
_ != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: _ }) : null,
|
|
1809
|
+
/* @__PURE__ */ u("span", { className: "cms-notification__text", children: [
|
|
1810
|
+
/* @__PURE__ */ u("span", { className: "cms-notification__head", children: [
|
|
1811
|
+
/* @__PURE__ */ u("span", { className: "cms-notification__title", children: [
|
|
1812
|
+
o ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
|
|
1813
|
+
i,
|
|
1814
1814
|
" "
|
|
1815
1815
|
] }) : null,
|
|
1816
1816
|
n
|
|
1817
1817
|
] }),
|
|
1818
1818
|
t !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: t }) : null
|
|
1819
1819
|
] }),
|
|
1820
|
-
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id:
|
|
1820
|
+
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: c, children: l }) : null
|
|
1821
1821
|
] }),
|
|
1822
1822
|
o ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
1823
1823
|
]
|
|
@@ -1828,12 +1828,12 @@ function rl({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1828
1828
|
{
|
|
1829
1829
|
type: "button",
|
|
1830
1830
|
className: "cms-notification__chevron",
|
|
1831
|
-
"aria-expanded":
|
|
1832
|
-
"aria-controls":
|
|
1833
|
-
"aria-label":
|
|
1834
|
-
title:
|
|
1831
|
+
"aria-expanded": d,
|
|
1832
|
+
"aria-controls": c,
|
|
1833
|
+
"aria-label": d ? r : s,
|
|
1834
|
+
title: d ? r : s,
|
|
1835
1835
|
onClick: () => {
|
|
1836
|
-
|
|
1836
|
+
d || f(), h((w) => !w);
|
|
1837
1837
|
},
|
|
1838
1838
|
children: /* @__PURE__ */ e(L, { name: "chevron-down", size: 18 })
|
|
1839
1839
|
}
|
|
@@ -1845,7 +1845,7 @@ function rl({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1845
1845
|
className: "cms-button cms-notification__action",
|
|
1846
1846
|
onClick: () => {
|
|
1847
1847
|
var w;
|
|
1848
|
-
|
|
1848
|
+
f(), (w = g.onAction) == null || w.call(g);
|
|
1849
1849
|
},
|
|
1850
1850
|
children: g.label
|
|
1851
1851
|
}
|
|
@@ -1855,7 +1855,7 @@ function rl({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1855
1855
|
function xn(n) {
|
|
1856
1856
|
return n === "allowed" || n === "elevate" || n === "denied";
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1858
|
+
function ol(n, l) {
|
|
1859
1859
|
if (!xn(n))
|
|
1860
1860
|
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 };
|
|
1861
1861
|
switch (n) {
|
|
@@ -1870,7 +1870,7 @@ function cl(n, l) {
|
|
|
1870
1870
|
function Mn(n, l) {
|
|
1871
1871
|
if (!n) return;
|
|
1872
1872
|
if (typeof n.get == "function") return n.get(l) ?? void 0;
|
|
1873
|
-
const t = n, o = Object.keys(t).find((
|
|
1873
|
+
const t = n, o = Object.keys(t).find((i) => i.toLowerCase() === l.toLowerCase());
|
|
1874
1874
|
return o === void 0 ? void 0 : t[o];
|
|
1875
1875
|
}
|
|
1876
1876
|
function Cn(n) {
|
|
@@ -1880,189 +1880,204 @@ function Cn(n) {
|
|
|
1880
1880
|
if (typeof l.title == "string" && l.title !== "") return l.title;
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1883
|
+
function dl(n, l, t, o) {
|
|
1884
1884
|
if (n !== 403) return { kind: "none" };
|
|
1885
|
-
const
|
|
1886
|
-
return Mn(l, "X-Elevation-Required") !== void 0 ? o.elevates ? { kind: "elevation-required", message:
|
|
1885
|
+
const i = Cn(t);
|
|
1886
|
+
return Mn(l, "X-Elevation-Required") !== void 0 ? o.elevates ? { kind: "elevation-required", message: i ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: i ?? "The server refused this." };
|
|
1887
1887
|
}
|
|
1888
1888
|
const ke = "coolms-kit:reread";
|
|
1889
|
-
function
|
|
1889
|
+
function ul() {
|
|
1890
1890
|
window.dispatchEvent(new Event(ke));
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1893
|
-
const [l, t] =
|
|
1894
|
-
|
|
1895
|
-
const m =
|
|
1896
|
-
const
|
|
1897
|
-
r(!0),
|
|
1892
|
+
function ml(n) {
|
|
1893
|
+
const [l, t] = E(void 0), [o, i] = E(void 0), [s, r] = E(!0), a = R(n);
|
|
1894
|
+
a.current = n;
|
|
1895
|
+
const m = R(0), _ = be(() => {
|
|
1896
|
+
const d = ++m.current;
|
|
1897
|
+
r(!0), a.current().then(
|
|
1898
1898
|
(h) => {
|
|
1899
|
-
|
|
1899
|
+
d === m.current && (t(h), i(void 0), r(!1));
|
|
1900
1900
|
},
|
|
1901
1901
|
(h) => {
|
|
1902
|
-
|
|
1902
|
+
d === m.current && (i(h), r(!1));
|
|
1903
1903
|
}
|
|
1904
1904
|
);
|
|
1905
1905
|
}, []);
|
|
1906
1906
|
return Y(() => {
|
|
1907
|
-
|
|
1908
|
-
const
|
|
1909
|
-
return window.addEventListener("focus",
|
|
1910
|
-
window.removeEventListener("focus",
|
|
1907
|
+
_();
|
|
1908
|
+
const d = () => _();
|
|
1909
|
+
return window.addEventListener("focus", d), window.addEventListener(ke, d), () => {
|
|
1910
|
+
window.removeEventListener("focus", d), window.removeEventListener(ke, d);
|
|
1911
1911
|
};
|
|
1912
|
-
}, [
|
|
1912
|
+
}, [_]), { value: l, error: o, loading: s, reread: _ };
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1914
|
+
function hl(n) {
|
|
1915
1915
|
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 };
|
|
1916
1916
|
}
|
|
1917
1917
|
const Sn = "/errors/client-update-required";
|
|
1918
|
-
function
|
|
1919
|
-
const t = n.split(".").map((
|
|
1920
|
-
for (let
|
|
1921
|
-
const
|
|
1922
|
-
if (
|
|
1918
|
+
function En(n, l) {
|
|
1919
|
+
const t = n.split(".").map((i) => Number.parseInt(i, 10) || 0), o = l.split(".").map((i) => Number.parseInt(i, 10) || 0);
|
|
1920
|
+
for (let i = 0; i < Math.max(t.length, o.length); i++) {
|
|
1921
|
+
const s = t[i] ?? 0, r = o[i] ?? 0;
|
|
1922
|
+
if (s !== r) return s < r;
|
|
1923
1923
|
}
|
|
1924
1924
|
return !1;
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1927
|
-
return n.problemType !== void 0 && n.problemType.endsWith(Sn) ? !0 : n.minimumVersion !== void 0 &&
|
|
1926
|
+
function fl(n) {
|
|
1927
|
+
return n.problemType !== void 0 && n.problemType.endsWith(Sn) ? !0 : n.minimumVersion !== void 0 && En(n.version, n.minimumVersion);
|
|
1928
1928
|
}
|
|
1929
|
-
const
|
|
1930
|
-
function
|
|
1931
|
-
const [t, o] =
|
|
1929
|
+
const Ie = 4, An = 48, Tn = 800, Ln = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
1930
|
+
function Dn(n, l) {
|
|
1931
|
+
const [t, o] = E(!1);
|
|
1932
1932
|
return Y(() => {
|
|
1933
|
-
const
|
|
1934
|
-
if (
|
|
1933
|
+
const i = n.current;
|
|
1934
|
+
if (i === null || !l) {
|
|
1935
1935
|
o(!1);
|
|
1936
1936
|
return;
|
|
1937
1937
|
}
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1938
|
+
const s = /* @__PURE__ */ new WeakMap();
|
|
1939
|
+
let r = Number.NEGATIVE_INFINITY, a = null;
|
|
1940
|
+
const m = (c) => {
|
|
1941
|
+
r = performance.now(), a = c.target;
|
|
1942
|
+
}, _ = (c) => {
|
|
1943
|
+
const f = c.target;
|
|
1944
|
+
!(f instanceof HTMLElement && (f.isContentEditable || f.closest("input, textarea, select") !== null)) && Ln.has(c.key) && m(c);
|
|
1945
|
+
}, d = (c) => {
|
|
1946
|
+
const f = c.target;
|
|
1947
|
+
if (!(f instanceof HTMLElement)) return;
|
|
1948
|
+
const p = f.scrollTop, g = s.get(f) ?? 0;
|
|
1949
|
+
if (s.set(f, p), p <= 0) {
|
|
1950
|
+
o(!1);
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
performance.now() - r > Tn || !(a === i || a === document.body || a instanceof Node && f.contains(a)) || (p < g - Ie ? o(!1) : p > g + Ie && p > An && o(!0));
|
|
1954
|
+
}, h = [["wheel", m], ["touchmove", m], ["pointerdown", m], ["keydown", _]];
|
|
1955
|
+
for (const [c, f] of h) i.addEventListener(c, f, { capture: !0, passive: !0 });
|
|
1956
|
+
return i.addEventListener("scroll", d, { capture: !0, passive: !0 }), () => {
|
|
1957
|
+
for (const [c, f] of h) i.removeEventListener(c, f, { capture: !0 });
|
|
1958
|
+
i.removeEventListener("scroll", d, { capture: !0 });
|
|
1943
1959
|
};
|
|
1944
|
-
return c.addEventListener("scroll", r, { capture: !0, passive: !0 }), () => c.removeEventListener("scroll", r, { capture: !0 });
|
|
1945
1960
|
}, [n, l]), [t, o];
|
|
1946
1961
|
}
|
|
1947
|
-
function
|
|
1948
|
-
const
|
|
1949
|
-
|
|
1950
|
-
}), C = m === void 0 ? null : { distance: S, refreshing:
|
|
1951
|
-
return /* @__PURE__ */
|
|
1962
|
+
function pl({ title: n, back: l, navigation: t, search: o, searching: i, globals: s, filters: r, primary: a, onRefresh: m, pullText: _, barHidden: d, children: h }) {
|
|
1963
|
+
const c = R(null), f = R(null), [p, g] = E(!1), [N, w] = E(null), S = gn(f, m === void 0 ? null : () => {
|
|
1964
|
+
p || (g(!0), m().finally(() => g(!1)));
|
|
1965
|
+
}), C = m === void 0 ? null : { distance: S, refreshing: p, text: _ ?? null }, F = i !== void 0 || S > 0 || p, [H, ee] = Dn(c, d === void 0 && !F), j = !F && (d ?? H);
|
|
1966
|
+
return /* @__PURE__ */ u(
|
|
1952
1967
|
"div",
|
|
1953
1968
|
{
|
|
1954
|
-
ref:
|
|
1955
|
-
className:
|
|
1969
|
+
ref: c,
|
|
1970
|
+
className: A("cms-screen", a !== void 0 && "cms-screen--with-primary"),
|
|
1956
1971
|
"data-bar-hidden": j ? "" : void 0,
|
|
1957
1972
|
onFocus: (y) => {
|
|
1958
1973
|
j && y.target instanceof Element && y.target.closest(".cms-screen__bar, .cms-screen__filters") !== null && ee(!1);
|
|
1959
1974
|
},
|
|
1960
1975
|
children: [
|
|
1961
|
-
|
|
1962
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label":
|
|
1963
|
-
/* @__PURE__ */ e("div", { className: "cms-screen__search", children:
|
|
1964
|
-
] }) : /* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */
|
|
1976
|
+
i !== void 0 ? /* @__PURE__ */ u("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
|
|
1977
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": i.closeLabel, title: i.closeLabel, onClick: i.onClose, children: /* @__PURE__ */ e(L, { name: "chevron-left" }) }),
|
|
1978
|
+
/* @__PURE__ */ e("div", { className: "cms-screen__search", children: i.field })
|
|
1979
|
+
] }) : /* @__PURE__ */ u("header", { className: "cms-screen__bar", children: [
|
|
1980
|
+
/* @__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: [
|
|
1966
1981
|
/* @__PURE__ */ e(L, { name: "chevron-left" }),
|
|
1967
1982
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
|
|
1968
|
-
] }) : /* @__PURE__ */
|
|
1983
|
+
] }) : /* @__PURE__ */ u("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
|
|
1969
1984
|
/* @__PURE__ */ e(L, { name: "chevron-left" }),
|
|
1970
1985
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
|
|
1971
1986
|
] }) : t }),
|
|
1972
1987
|
/* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
|
|
1973
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ u("div", { className: "cms-screen__trailing", children: [
|
|
1974
1989
|
o !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": o.label, title: o.label, onClick: o.onOpen, children: /* @__PURE__ */ e(L, { name: "search" }) }) : null,
|
|
1975
|
-
|
|
1990
|
+
s
|
|
1976
1991
|
] })
|
|
1977
1992
|
] }),
|
|
1978
1993
|
r !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(hn, { label: r.label, options: r.options, value: r.selected, onChange: r.onSelect }) }) : null,
|
|
1979
|
-
/* @__PURE__ */ e("div", { ref:
|
|
1980
|
-
|
|
1994
|
+
/* @__PURE__ */ e("div", { ref: f, className: "cms-screen__content", "data-pulling": S > 0 ? "" : void 0, "data-refreshing": p ? "" : void 0, children: /* @__PURE__ */ e(Fe.Provider, { value: C, children: h }) }),
|
|
1995
|
+
a !== void 0 ? /* @__PURE__ */ e(
|
|
1981
1996
|
"button",
|
|
1982
1997
|
{
|
|
1983
1998
|
type: "button",
|
|
1984
1999
|
className: "cms-button cms-button--primary cms-screen__primary",
|
|
1985
|
-
"aria-label":
|
|
1986
|
-
title:
|
|
1987
|
-
..."menu" in
|
|
2000
|
+
"aria-label": a.label,
|
|
2001
|
+
title: a.label,
|
|
2002
|
+
..."menu" in a ? { "aria-haspopup": "menu", "aria-expanded": N !== null } : {},
|
|
1988
2003
|
onClick: (y) => {
|
|
1989
|
-
if ("menu" in
|
|
1990
|
-
const
|
|
1991
|
-
w(N === null ? { x:
|
|
2004
|
+
if ("menu" in a) {
|
|
2005
|
+
const P = y.currentTarget.getBoundingClientRect();
|
|
2006
|
+
w(N === null ? { x: P.left, y: P.top } : null);
|
|
1992
2007
|
} else
|
|
1993
|
-
|
|
2008
|
+
a.onPress();
|
|
1994
2009
|
},
|
|
1995
|
-
children: /* @__PURE__ */ e(L, { name:
|
|
2010
|
+
children: /* @__PURE__ */ e(L, { name: a.icon, size: 24 })
|
|
1996
2011
|
}
|
|
1997
2012
|
) : null,
|
|
1998
|
-
|
|
2013
|
+
a !== void 0 && "menu" in a ? /* @__PURE__ */ e(He, { at: N, items: a.menu, onClose: () => w(null), label: a.label }) : null
|
|
1999
2014
|
]
|
|
2000
2015
|
}
|
|
2001
2016
|
);
|
|
2002
2017
|
}
|
|
2003
2018
|
export {
|
|
2004
|
-
|
|
2019
|
+
Yn as AppShell,
|
|
2005
2020
|
ve as Avatar,
|
|
2006
|
-
|
|
2021
|
+
Ae as BOOTSTRAP_ICONS,
|
|
2007
2022
|
mn as Badge,
|
|
2008
2023
|
le as Button,
|
|
2009
|
-
|
|
2024
|
+
Ee as CALL_LABELS,
|
|
2010
2025
|
Sn as CLIENT_UPDATE_REQUIRED,
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2026
|
+
tl as CallBar,
|
|
2027
|
+
ll as CallPanel,
|
|
2028
|
+
Qn as ChatBubble,
|
|
2029
|
+
el as Composer,
|
|
2030
|
+
On as ConfirmDialog,
|
|
2016
2031
|
He as ContextMenu,
|
|
2017
2032
|
Ye as EmptyState,
|
|
2018
|
-
|
|
2019
|
-
|
|
2033
|
+
Ge as ErrorBanner,
|
|
2034
|
+
Wn as FilePicker,
|
|
2020
2035
|
rn as FilePickerDenied,
|
|
2021
|
-
|
|
2036
|
+
Vn as FileViewer,
|
|
2022
2037
|
hn as FilterChips,
|
|
2023
|
-
|
|
2038
|
+
zn as ICON_NAMES,
|
|
2024
2039
|
L as Icon,
|
|
2025
|
-
|
|
2026
|
-
|
|
2040
|
+
nl as IncomingCall,
|
|
2041
|
+
rl as List,
|
|
2027
2042
|
qe as Loading,
|
|
2028
2043
|
_n as MAIL_ROW_LABELS,
|
|
2029
2044
|
je as MODAL_CLOSE_MS,
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2045
|
+
Jn as MailRow,
|
|
2046
|
+
Pe as Modal,
|
|
2047
|
+
Zn as NamedIcon,
|
|
2048
|
+
il as Notification,
|
|
2034
2049
|
we as PULL_AT,
|
|
2035
|
-
|
|
2036
|
-
|
|
2050
|
+
jn as PageHeader,
|
|
2051
|
+
cl as PaneToolbar,
|
|
2037
2052
|
bn as SIGN_IN_LABELS,
|
|
2038
2053
|
ye as STATE_DELAY_MS,
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2054
|
+
pl as ScreenShell,
|
|
2055
|
+
Gn as SearchField,
|
|
2056
|
+
Hn as Select,
|
|
2057
|
+
sl as SignInForm,
|
|
2058
|
+
al as SignInLayout,
|
|
2059
|
+
Xn as SplitPanes,
|
|
2045
2060
|
ne as State,
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2061
|
+
qn as TabStrip,
|
|
2062
|
+
Fn as TextArea,
|
|
2063
|
+
Bn as TextField,
|
|
2049
2064
|
Kn as Toast,
|
|
2050
|
-
|
|
2051
|
-
|
|
2065
|
+
Un as ToastRegion,
|
|
2066
|
+
Rn as Toggle,
|
|
2052
2067
|
fn as fitPanes,
|
|
2053
2068
|
re as iconForName,
|
|
2054
2069
|
dn as initialsOf,
|
|
2055
2070
|
xn as isCapability,
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2071
|
+
fl as needsClientUpdate,
|
|
2072
|
+
ol as offerFor,
|
|
2073
|
+
hl as readConflict,
|
|
2074
|
+
dl as readRefusal,
|
|
2060
2075
|
Cn as refusalText,
|
|
2061
|
-
|
|
2076
|
+
ul as rereadAll,
|
|
2062
2077
|
un as tintOf,
|
|
2063
2078
|
gn as usePull,
|
|
2064
2079
|
Nn as usePullState,
|
|
2065
|
-
|
|
2066
|
-
|
|
2080
|
+
ml as useReread,
|
|
2081
|
+
En as versionBelow,
|
|
2067
2082
|
Ve as writtenOut
|
|
2068
2083
|
};
|