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