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