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