@box/box-ai-agent-selector 1.39.32 → 1.39.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/box-ai-agent-selector.js +4374 -0
- package/dist/chunks/box-ai-agent.js +85 -0
- package/dist/chunks/types.js +6 -9
- package/dist/esm/index.js +10 -21
- package/dist/esm/lib/box-ai-agent-selector-with-api-container.js +19 -42
- package/dist/esm/lib/box-ai-agent-selector-with-api.js +69 -88
- package/dist/esm/lib/box-ai-agent-selector.js +2 -5279
- package/dist/esm/lib/box-ai-agent.js +2 -99
- package/dist/esm/lib/constants.js +11 -20
- package/dist/esm/lib/contexts/actions.js +4 -6
- package/dist/esm/lib/contexts/constants.js +6 -8
- package/dist/esm/lib/contexts/context.js +23 -36
- package/dist/esm/lib/contexts/index.js +3 -8
- package/dist/esm/lib/contexts/reducer.js +37 -42
- package/dist/esm/lib/hooks/__tests__/useLocalStorageAIAgents.tests.js +67 -97
- package/dist/esm/lib/hooks/index.js +2 -4
- package/dist/esm/lib/hooks/useLocalStorageAIAgents.js +22 -27
- package/dist/esm/lib/messages.js +34 -36
- package/dist/styles/box-ai-agent-selector.css +1 -1
- package/dist/styles/box-ai-agent.css +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,4374 @@
|
|
|
1
|
+
import { t as e } from "./box-ai-agent.js";
|
|
2
|
+
import t from "../esm/lib/messages.js";
|
|
3
|
+
import { AI_AGENTS_LOCAL_STORAGE_KEY as n, LOGGER_ACTION_CLICK as r, LOGGER_BASE_CONFIG as i, LOGGER_TARGET as a } from "../esm/lib/constants.js";
|
|
4
|
+
import { ACTIONS as o } from "../esm/lib/contexts/actions.js";
|
|
5
|
+
import { n as s, t as c } from "./types.js";
|
|
6
|
+
import { useAgentsDispatch as l } from "../esm/lib/contexts/context.js";
|
|
7
|
+
import u from "../esm/lib/hooks/useLocalStorageAIAgents.js";
|
|
8
|
+
import * as d from "react";
|
|
9
|
+
import { createContext as f, isValidElement as p, useCallback as m, useContext as h, useEffect as g, useLayoutEffect as _, useMemo as v, useReducer as y, useRef as b, useState as x } from "react";
|
|
10
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
11
|
+
import { createPortal as T, flushSync as E } from "react-dom";
|
|
12
|
+
import { Button as D, FilterChip as O, LoadingIndicator as k, Status as A, Tooltip as j, TooltipProvider as M, useFullTextTooltip as N } from "@box/blueprint-web";
|
|
13
|
+
import { AlertBadge as P } from "@box/blueprint-web-assets/icons/Fill";
|
|
14
|
+
import F from "clsx";
|
|
15
|
+
import { useIntl as ee } from "react-intl";
|
|
16
|
+
import '../styles/box-ai-agent-selector.css';var te = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), ne = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
17
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
18
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
19
|
+
});
|
|
20
|
+
function I(...e) {}
|
|
21
|
+
function re(e, t) {
|
|
22
|
+
return ie(e) ? e(ae(t) ? t() : t) : e;
|
|
23
|
+
}
|
|
24
|
+
function ie(e) {
|
|
25
|
+
return typeof e == "function";
|
|
26
|
+
}
|
|
27
|
+
function ae(e) {
|
|
28
|
+
return typeof e == "function";
|
|
29
|
+
}
|
|
30
|
+
function oe(e, t) {
|
|
31
|
+
return typeof Object.hasOwn == "function" ? Object.hasOwn(e, t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
32
|
+
}
|
|
33
|
+
function se(...e) {
|
|
34
|
+
return (...t) => {
|
|
35
|
+
for (let n of e) typeof n == "function" && n(...t);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function ce(e) {
|
|
39
|
+
return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
40
|
+
}
|
|
41
|
+
function le(e, t) {
|
|
42
|
+
let n = { ...e };
|
|
43
|
+
for (let e of t) oe(n, e) && delete n[e];
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function ue(e, t) {
|
|
47
|
+
let n = {};
|
|
48
|
+
for (let r of t) oe(e, r) && (n[r] = e[r]);
|
|
49
|
+
return n;
|
|
50
|
+
}
|
|
51
|
+
function de(e) {
|
|
52
|
+
return e;
|
|
53
|
+
}
|
|
54
|
+
function L(e, t) {
|
|
55
|
+
if (!e) throw Error(typeof t == "string" ? t : "Invariant failed");
|
|
56
|
+
}
|
|
57
|
+
function fe(e) {
|
|
58
|
+
return Object.keys(e);
|
|
59
|
+
}
|
|
60
|
+
function pe(e) {
|
|
61
|
+
return e.disabled || e["aria-disabled"] === !0 || e["aria-disabled"] === "true";
|
|
62
|
+
}
|
|
63
|
+
function R(e) {
|
|
64
|
+
let t = {};
|
|
65
|
+
for (let n in e) e[n] !== void 0 && (t[n] = e[n]);
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
function z(...e) {
|
|
69
|
+
for (let t of e) if (t !== void 0) return t;
|
|
70
|
+
}
|
|
71
|
+
function me(e, t) {
|
|
72
|
+
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
73
|
+
}
|
|
74
|
+
function he(e) {
|
|
75
|
+
return !e || !p(e) ? !1 : "ref" in e.props || "ref" in e;
|
|
76
|
+
}
|
|
77
|
+
function ge(e) {
|
|
78
|
+
return he(e) ? { ...e.props }.ref || e.ref : null;
|
|
79
|
+
}
|
|
80
|
+
function _e(e, t) {
|
|
81
|
+
let n = { ...e };
|
|
82
|
+
for (let r in t) {
|
|
83
|
+
if (!oe(t, r)) continue;
|
|
84
|
+
if (r === "className") {
|
|
85
|
+
let r = "className";
|
|
86
|
+
n[r] = e[r] ? `${e[r]} ${t[r]}` : t[r];
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (r === "style") {
|
|
90
|
+
let r = "style";
|
|
91
|
+
n[r] = e[r] ? {
|
|
92
|
+
...e[r],
|
|
93
|
+
...t[r]
|
|
94
|
+
} : t[r];
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
let i = t[r];
|
|
98
|
+
if (typeof i == "function" && r.startsWith("on")) {
|
|
99
|
+
let t = e[r];
|
|
100
|
+
if (typeof t == "function") {
|
|
101
|
+
n[r] = (...e) => {
|
|
102
|
+
i(...e), t(...e);
|
|
103
|
+
};
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
n[r] = i;
|
|
108
|
+
}
|
|
109
|
+
return n;
|
|
110
|
+
}
|
|
111
|
+
var ve = ye();
|
|
112
|
+
function ye() {
|
|
113
|
+
return typeof window < "u" && !!window.document?.createElement;
|
|
114
|
+
}
|
|
115
|
+
function B(e) {
|
|
116
|
+
return e ? "self" in e ? e.document : e.ownerDocument || document : document;
|
|
117
|
+
}
|
|
118
|
+
function be(e) {
|
|
119
|
+
return e ? "self" in e ? e.self : B(e).defaultView || window : self;
|
|
120
|
+
}
|
|
121
|
+
function xe(e, t = !1) {
|
|
122
|
+
let { activeElement: n } = B(e);
|
|
123
|
+
if (!n?.nodeName) return null;
|
|
124
|
+
if (Se(n) && n.contentDocument?.body) return xe(n.contentDocument.body, t);
|
|
125
|
+
if (t) {
|
|
126
|
+
let e = n.getAttribute("aria-activedescendant");
|
|
127
|
+
if (e) {
|
|
128
|
+
let t = B(n).getElementById(e);
|
|
129
|
+
if (t) return t;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return n;
|
|
133
|
+
}
|
|
134
|
+
function V(e, t) {
|
|
135
|
+
return e === t || e.contains(t);
|
|
136
|
+
}
|
|
137
|
+
function Se(e) {
|
|
138
|
+
return e.tagName === "IFRAME";
|
|
139
|
+
}
|
|
140
|
+
function Ce(e) {
|
|
141
|
+
let t = e.tagName.toLowerCase();
|
|
142
|
+
return t === "button" ? !0 : t === "input" && e.type ? we.indexOf(e.type) !== -1 : !1;
|
|
143
|
+
}
|
|
144
|
+
var we = [
|
|
145
|
+
"button",
|
|
146
|
+
"color",
|
|
147
|
+
"file",
|
|
148
|
+
"image",
|
|
149
|
+
"reset",
|
|
150
|
+
"submit"
|
|
151
|
+
];
|
|
152
|
+
function Te(e) {
|
|
153
|
+
if (typeof e.checkVisibility == "function") return e.checkVisibility();
|
|
154
|
+
let t = e;
|
|
155
|
+
return t.offsetWidth > 0 || t.offsetHeight > 0 || e.getClientRects().length > 0;
|
|
156
|
+
}
|
|
157
|
+
function Ee(e) {
|
|
158
|
+
try {
|
|
159
|
+
let t = e instanceof HTMLInputElement && e.selectionStart !== null, n = e.tagName === "TEXTAREA";
|
|
160
|
+
return t || n || !1;
|
|
161
|
+
} catch {
|
|
162
|
+
return !1;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function De(e) {
|
|
166
|
+
return e.isContentEditable || Ee(e);
|
|
167
|
+
}
|
|
168
|
+
function Oe(e) {
|
|
169
|
+
if (Ee(e)) return e.value;
|
|
170
|
+
if (e.isContentEditable) {
|
|
171
|
+
let t = B(e).createRange();
|
|
172
|
+
return t.selectNodeContents(e), t.toString();
|
|
173
|
+
}
|
|
174
|
+
return "";
|
|
175
|
+
}
|
|
176
|
+
function ke(e) {
|
|
177
|
+
let t = 0, n = 0;
|
|
178
|
+
if (Ee(e)) t = e.selectionStart || 0, n = e.selectionEnd || 0;
|
|
179
|
+
else if (e.isContentEditable) {
|
|
180
|
+
let r = B(e).getSelection();
|
|
181
|
+
if (r?.rangeCount && r.anchorNode && V(e, r.anchorNode) && r.focusNode && V(e, r.focusNode)) {
|
|
182
|
+
let i = r.getRangeAt(0), a = i.cloneRange();
|
|
183
|
+
a.selectNodeContents(e), a.setEnd(i.startContainer, i.startOffset), t = a.toString().length, a.setEnd(i.endContainer, i.endOffset), n = a.toString().length;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
start: t,
|
|
188
|
+
end: n
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function Ae(e, t) {
|
|
192
|
+
let n = [
|
|
193
|
+
"dialog",
|
|
194
|
+
"menu",
|
|
195
|
+
"listbox",
|
|
196
|
+
"tree",
|
|
197
|
+
"grid"
|
|
198
|
+
], r = e?.getAttribute("role");
|
|
199
|
+
return r && n.indexOf(r) !== -1 ? r : t;
|
|
200
|
+
}
|
|
201
|
+
function je(e, t) {
|
|
202
|
+
let n = {
|
|
203
|
+
menu: "menuitem",
|
|
204
|
+
listbox: "option",
|
|
205
|
+
tree: "treeitem"
|
|
206
|
+
}, r = Ae(e);
|
|
207
|
+
return r ? n[r] ?? t : t;
|
|
208
|
+
}
|
|
209
|
+
function Me(e) {
|
|
210
|
+
if (!e) return null;
|
|
211
|
+
let t = (e) => e === "auto" || e === "scroll";
|
|
212
|
+
if (e.clientHeight && e.scrollHeight > e.clientHeight) {
|
|
213
|
+
let { overflowY: n } = getComputedStyle(e);
|
|
214
|
+
if (t(n)) return e;
|
|
215
|
+
} else if (e.clientWidth && e.scrollWidth > e.clientWidth) {
|
|
216
|
+
let { overflowX: n } = getComputedStyle(e);
|
|
217
|
+
if (t(n)) return e;
|
|
218
|
+
}
|
|
219
|
+
return Me(e.parentElement) || document.scrollingElement || document.body;
|
|
220
|
+
}
|
|
221
|
+
function Ne(e, t) {
|
|
222
|
+
let n = e.map((e, t) => [t, e]), r = !1;
|
|
223
|
+
return n.sort(([e, n], [i, a]) => {
|
|
224
|
+
let o = t(n), s = t(a);
|
|
225
|
+
return o === s || !o || !s ? 0 : Pe(o, s) ? (e > i && (r = !0), -1) : (e < i && (r = !0), 1);
|
|
226
|
+
}), r ? n.map(([e, t]) => t) : e;
|
|
227
|
+
}
|
|
228
|
+
function Pe(e, t) {
|
|
229
|
+
return !!(t.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_PRECEDING);
|
|
230
|
+
}
|
|
231
|
+
function Fe() {
|
|
232
|
+
return ve && !!navigator.maxTouchPoints;
|
|
233
|
+
}
|
|
234
|
+
function Ie() {
|
|
235
|
+
return ve ? /mac|iphone|ipad|ipod/i.test(navigator.platform) : !1;
|
|
236
|
+
}
|
|
237
|
+
function Le() {
|
|
238
|
+
return ve && Ie() && /apple/i.test(navigator.vendor);
|
|
239
|
+
}
|
|
240
|
+
function Re() {
|
|
241
|
+
return ve && /firefox\//i.test(navigator.userAgent);
|
|
242
|
+
}
|
|
243
|
+
function ze() {
|
|
244
|
+
return ve && navigator.platform.startsWith("Mac") && !Fe();
|
|
245
|
+
}
|
|
246
|
+
function Be(e) {
|
|
247
|
+
return !!(e.currentTarget && !V(e.currentTarget, e.target));
|
|
248
|
+
}
|
|
249
|
+
function H(e) {
|
|
250
|
+
return e.target === e.currentTarget;
|
|
251
|
+
}
|
|
252
|
+
function Ve(e) {
|
|
253
|
+
let t = e.currentTarget;
|
|
254
|
+
if (!t) return !1;
|
|
255
|
+
let n = Ie();
|
|
256
|
+
if (n && !e.metaKey || !n && !e.ctrlKey) return !1;
|
|
257
|
+
let r = t.tagName.toLowerCase();
|
|
258
|
+
return r === "a" || r === "button" && t.type === "submit" || r === "input" && t.type === "submit";
|
|
259
|
+
}
|
|
260
|
+
function He(e) {
|
|
261
|
+
let t = e.currentTarget;
|
|
262
|
+
if (!t) return !1;
|
|
263
|
+
let n = t.tagName.toLowerCase();
|
|
264
|
+
return e.altKey ? n === "a" || n === "button" && t.type === "submit" || n === "input" && t.type === "submit" : !1;
|
|
265
|
+
}
|
|
266
|
+
function Ue(e, t) {
|
|
267
|
+
let n = new FocusEvent("blur", t), r = e.dispatchEvent(n), i = {
|
|
268
|
+
...t,
|
|
269
|
+
bubbles: !0
|
|
270
|
+
};
|
|
271
|
+
return e.dispatchEvent(new FocusEvent("focusout", i)), r;
|
|
272
|
+
}
|
|
273
|
+
function We(e, t, n) {
|
|
274
|
+
let r = new KeyboardEvent(t, n);
|
|
275
|
+
return e.dispatchEvent(r);
|
|
276
|
+
}
|
|
277
|
+
function Ge(e, t) {
|
|
278
|
+
let n = new MouseEvent("click", t);
|
|
279
|
+
return e.dispatchEvent(n);
|
|
280
|
+
}
|
|
281
|
+
function Ke(e, t) {
|
|
282
|
+
let n = t || e.currentTarget, r = e.relatedTarget;
|
|
283
|
+
return !r || !V(n, r);
|
|
284
|
+
}
|
|
285
|
+
function qe(e, t, n, r) {
|
|
286
|
+
let i = ((e) => {
|
|
287
|
+
if (r) {
|
|
288
|
+
let t = setTimeout(e, r);
|
|
289
|
+
return () => clearTimeout(t);
|
|
290
|
+
}
|
|
291
|
+
let t = requestAnimationFrame(e);
|
|
292
|
+
return () => cancelAnimationFrame(t);
|
|
293
|
+
})(() => {
|
|
294
|
+
e.removeEventListener(t, a, !0), n();
|
|
295
|
+
}), a = () => {
|
|
296
|
+
i(), n();
|
|
297
|
+
};
|
|
298
|
+
return e.addEventListener(t, a, {
|
|
299
|
+
once: !0,
|
|
300
|
+
capture: !0
|
|
301
|
+
}), i;
|
|
302
|
+
}
|
|
303
|
+
function Je(e, t, n, r = window) {
|
|
304
|
+
let i = [];
|
|
305
|
+
try {
|
|
306
|
+
r.document.addEventListener(e, t, n);
|
|
307
|
+
for (let a of Array.from(r.frames)) i.push(Je(e, t, n, a));
|
|
308
|
+
} catch {}
|
|
309
|
+
return () => {
|
|
310
|
+
try {
|
|
311
|
+
r.document.removeEventListener(e, t, n);
|
|
312
|
+
} catch {}
|
|
313
|
+
for (let e of i) e();
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
var Ye = { ...d }, Xe = Ye.useId;
|
|
317
|
+
Ye.useDeferredValue;
|
|
318
|
+
var Ze = Ye.useInsertionEffect, U = ve ? _ : g;
|
|
319
|
+
function Qe(e) {
|
|
320
|
+
let [t] = x(e);
|
|
321
|
+
return t;
|
|
322
|
+
}
|
|
323
|
+
function $e(e) {
|
|
324
|
+
let t = b(e);
|
|
325
|
+
return U(() => {
|
|
326
|
+
t.current = e;
|
|
327
|
+
}), t;
|
|
328
|
+
}
|
|
329
|
+
function W(e) {
|
|
330
|
+
let t = b(() => {
|
|
331
|
+
throw Error("Cannot call an event handler while rendering.");
|
|
332
|
+
});
|
|
333
|
+
return Ze ? Ze(() => {
|
|
334
|
+
t.current = e;
|
|
335
|
+
}) : t.current = e, m((...e) => t.current?.call(t, ...e), []);
|
|
336
|
+
}
|
|
337
|
+
function et(e) {
|
|
338
|
+
let [t, n] = x(null);
|
|
339
|
+
return U(() => {
|
|
340
|
+
if (t == null || !e) return;
|
|
341
|
+
let n = null;
|
|
342
|
+
return e((e) => (n = e, t)), () => {
|
|
343
|
+
e(n);
|
|
344
|
+
};
|
|
345
|
+
}, [t, e]), [t, n];
|
|
346
|
+
}
|
|
347
|
+
function G(...e) {
|
|
348
|
+
return v(() => {
|
|
349
|
+
if (e.some(Boolean)) return (t) => {
|
|
350
|
+
for (let n of e) me(n, t);
|
|
351
|
+
};
|
|
352
|
+
}, e);
|
|
353
|
+
}
|
|
354
|
+
function tt(e) {
|
|
355
|
+
if (Xe) {
|
|
356
|
+
let t = Xe();
|
|
357
|
+
return e || t;
|
|
358
|
+
}
|
|
359
|
+
let [t, n] = x(e);
|
|
360
|
+
return U(() => {
|
|
361
|
+
e || t || n(`id-${Math.random().toString(36).slice(2, 8)}`);
|
|
362
|
+
}, [e, t]), e || t;
|
|
363
|
+
}
|
|
364
|
+
function nt(e, t) {
|
|
365
|
+
let n = (e) => {
|
|
366
|
+
if (typeof e == "string") return e;
|
|
367
|
+
}, [r, i] = x(() => n(t));
|
|
368
|
+
return U(() => {
|
|
369
|
+
i((e && "current" in e ? e.current : e)?.tagName.toLowerCase() || n(t));
|
|
370
|
+
}, [e, t]), r;
|
|
371
|
+
}
|
|
372
|
+
function rt(e, t, n) {
|
|
373
|
+
let r = Qe(n), [i, a] = x(r);
|
|
374
|
+
return g(() => {
|
|
375
|
+
let n = e && "current" in e ? e.current : e;
|
|
376
|
+
if (!n) return;
|
|
377
|
+
let i = () => {
|
|
378
|
+
a(n.getAttribute(t) ?? r);
|
|
379
|
+
}, o = new MutationObserver(i);
|
|
380
|
+
return o.observe(n, { attributeFilter: [t] }), i(), () => o.disconnect();
|
|
381
|
+
}, [
|
|
382
|
+
e,
|
|
383
|
+
t,
|
|
384
|
+
r
|
|
385
|
+
]), i;
|
|
386
|
+
}
|
|
387
|
+
function it(e, t) {
|
|
388
|
+
let n = b(!1);
|
|
389
|
+
g(() => {
|
|
390
|
+
if (n.current) return e();
|
|
391
|
+
n.current = !0;
|
|
392
|
+
}, t), g(() => () => {
|
|
393
|
+
n.current = !1;
|
|
394
|
+
}, []);
|
|
395
|
+
}
|
|
396
|
+
function at() {
|
|
397
|
+
return y(() => [], []);
|
|
398
|
+
}
|
|
399
|
+
function K(e) {
|
|
400
|
+
return W(typeof e == "function" ? e : () => e);
|
|
401
|
+
}
|
|
402
|
+
function q(e, t, n = []) {
|
|
403
|
+
let r = m((n) => (e.wrapElement && (n = e.wrapElement(n)), t(n)), [...n, e.wrapElement]);
|
|
404
|
+
return {
|
|
405
|
+
...e,
|
|
406
|
+
wrapElement: r
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
function ot(e = !1, t) {
|
|
410
|
+
let [n, r] = x(null);
|
|
411
|
+
return {
|
|
412
|
+
portalRef: G(r, t),
|
|
413
|
+
portalNode: n,
|
|
414
|
+
domReady: !e || n
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
function st(e, t, n) {
|
|
418
|
+
let r = e.onLoadedMetadataCapture, i = v(() => Object.assign(() => {}, r, ...n === void 0 ? [] : [{ [t]: n }]), [
|
|
419
|
+
r,
|
|
420
|
+
t,
|
|
421
|
+
n
|
|
422
|
+
]);
|
|
423
|
+
return [r?.[t], { onLoadedMetadataCapture: i }];
|
|
424
|
+
}
|
|
425
|
+
var ct = !1;
|
|
426
|
+
function lt() {
|
|
427
|
+
return g(() => {
|
|
428
|
+
ct ||= (Je("mousemove", mt, !0), Je("mousedown", ht, !0), Je("mouseup", ht, !0), Je("keydown", ht, !0), Je("scroll", ht, !0), !0);
|
|
429
|
+
}, []), W(() => ut);
|
|
430
|
+
}
|
|
431
|
+
var ut = !1, dt = 0, ft = 0;
|
|
432
|
+
function pt(e) {
|
|
433
|
+
let t = e.movementX || e.screenX - dt, n = e.movementY || e.screenY - ft;
|
|
434
|
+
return dt = e.screenX, ft = e.screenY, t || n || process.env.NODE_ENV === "test";
|
|
435
|
+
}
|
|
436
|
+
function mt(e) {
|
|
437
|
+
pt(e) && (ut = !0);
|
|
438
|
+
}
|
|
439
|
+
function ht() {
|
|
440
|
+
ut = !1;
|
|
441
|
+
}
|
|
442
|
+
function J(e) {
|
|
443
|
+
let t = d.forwardRef((t, n) => e({
|
|
444
|
+
...t,
|
|
445
|
+
ref: n
|
|
446
|
+
}));
|
|
447
|
+
return t.displayName = e.displayName || e.name, t;
|
|
448
|
+
}
|
|
449
|
+
function gt(e, t) {
|
|
450
|
+
return d.memo(e, t);
|
|
451
|
+
}
|
|
452
|
+
function Y(e, t) {
|
|
453
|
+
let { wrapElement: n, render: r, ...i } = t, a = G(t.ref, ge(r)), o;
|
|
454
|
+
if (d.isValidElement(r)) {
|
|
455
|
+
let e = {
|
|
456
|
+
...r.props,
|
|
457
|
+
ref: a
|
|
458
|
+
};
|
|
459
|
+
o = d.cloneElement(r, _e(i, e));
|
|
460
|
+
} else o = r ? r(i) : /* @__PURE__ */ C(e, { ...i });
|
|
461
|
+
return n ? n(o) : o;
|
|
462
|
+
}
|
|
463
|
+
function X(e) {
|
|
464
|
+
let t = (t = {}) => e(t);
|
|
465
|
+
return t.displayName = e.name, t;
|
|
466
|
+
}
|
|
467
|
+
function _t(e = [], t = []) {
|
|
468
|
+
let n = d.createContext(void 0), r = d.createContext(void 0), i = () => d.useContext(n), a = (e = !1) => {
|
|
469
|
+
let t = d.useContext(r), n = i();
|
|
470
|
+
return e ? t : t || n;
|
|
471
|
+
}, o = () => {
|
|
472
|
+
let e = d.useContext(r), t = i();
|
|
473
|
+
if (!(e && e === t)) return t;
|
|
474
|
+
}, s = (t) => e.reduceRight((e, n) => /* @__PURE__ */ C(n, {
|
|
475
|
+
...t,
|
|
476
|
+
children: e
|
|
477
|
+
}), /* @__PURE__ */ C(n.Provider, { ...t }));
|
|
478
|
+
return {
|
|
479
|
+
context: n,
|
|
480
|
+
scopedContext: r,
|
|
481
|
+
useContext: i,
|
|
482
|
+
useScopedContext: a,
|
|
483
|
+
useProviderContext: o,
|
|
484
|
+
ContextProvider: s,
|
|
485
|
+
ScopedContextProvider: (e) => /* @__PURE__ */ C(s, {
|
|
486
|
+
...e,
|
|
487
|
+
children: t.reduceRight((t, n) => /* @__PURE__ */ C(n, {
|
|
488
|
+
...e,
|
|
489
|
+
children: t
|
|
490
|
+
}), /* @__PURE__ */ C(r.Provider, { ...e }))
|
|
491
|
+
})
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
var vt = _t();
|
|
495
|
+
vt.useContext, vt.useScopedContext;
|
|
496
|
+
var yt = vt.useProviderContext, bt = vt.ContextProvider, xt = vt.ScopedContextProvider, St = _t([bt], [xt]);
|
|
497
|
+
St.useContext, St.useScopedContext;
|
|
498
|
+
var Ct = St.useProviderContext, wt = St.ContextProvider, Tt = St.ScopedContextProvider, Et = f(void 0), Dt = f(void 0), Ot = _t([wt], [Tt]), kt = Ot.useContext;
|
|
499
|
+
Ot.useScopedContext;
|
|
500
|
+
var At = Ot.useProviderContext, jt = Ot.ContextProvider, Mt = Ot.ScopedContextProvider, Nt = _t(), Pt = Nt.useContext;
|
|
501
|
+
Nt.useScopedContext, Nt.useProviderContext;
|
|
502
|
+
var Ft = Nt.ContextProvider, It = Nt.ScopedContextProvider, Lt = _t([Ft], [It]), Rt = Lt.useContext;
|
|
503
|
+
Lt.useScopedContext;
|
|
504
|
+
var zt = Lt.useProviderContext, Bt = Lt.ContextProvider, Vt = Lt.ScopedContextProvider, Ht = f(void 0), Ut = f(void 0), Wt = _t([jt, Bt], [Mt, Vt]), Gt = Wt.useContext, Kt = Wt.useScopedContext, qt = Wt.useProviderContext, Jt = Wt.ContextProvider, Yt = Wt.ScopedContextProvider, Xt = f(!1), Zt = f(null);
|
|
505
|
+
function Qt(e, t) {
|
|
506
|
+
let n = e.__unstableInternals;
|
|
507
|
+
return L(n, "Invalid store"), n[t];
|
|
508
|
+
}
|
|
509
|
+
function $t(e, ...t) {
|
|
510
|
+
let n = e, r = n, i = /* @__PURE__ */ Symbol(), a = I, o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), p = (e) => (c.add(e), () => c.delete(e)), m = () => {
|
|
511
|
+
let e = o.size, r = /* @__PURE__ */ Symbol();
|
|
512
|
+
o.add(r);
|
|
513
|
+
let i = () => {
|
|
514
|
+
o.delete(r), !o.size && a();
|
|
515
|
+
};
|
|
516
|
+
if (e) return i;
|
|
517
|
+
let s = fe(n).map((e) => se(...t.map((t) => {
|
|
518
|
+
let n = (t?.getState)?.call(t);
|
|
519
|
+
if (n && oe(n, e)) return rn(t, [e], (t) => {
|
|
520
|
+
S(e, t[e], !0);
|
|
521
|
+
});
|
|
522
|
+
}))), l = [];
|
|
523
|
+
for (let e of c) l.push(e());
|
|
524
|
+
let u = t.map(tn);
|
|
525
|
+
return a = se(...s, ...l, ...u), i;
|
|
526
|
+
}, h = (e, t, n = l) => (n.add(t), f.set(t, e), () => {
|
|
527
|
+
var e;
|
|
528
|
+
(e = d.get(t)) == null || e(), d.delete(t), f.delete(t), n.delete(t);
|
|
529
|
+
}), g = (e, t) => h(e, t), _ = (e, t) => (d.set(t, t(n, n)), h(e, t)), v = (e, t) => (d.set(t, t(n, r)), h(e, t, u)), y = (e) => $t(ue(n, e), C), b = (e) => $t(le(n, e), C), x = () => n, S = (e, a, o = !1) => {
|
|
530
|
+
var c;
|
|
531
|
+
if (!oe(n, e)) return;
|
|
532
|
+
let p = re(a, n[e]);
|
|
533
|
+
if (p === n[e]) return;
|
|
534
|
+
if (!o) for (let n of t) (c = n?.setState) == null || c.call(n, e, p);
|
|
535
|
+
let m = n;
|
|
536
|
+
n = {
|
|
537
|
+
...n,
|
|
538
|
+
[e]: p
|
|
539
|
+
};
|
|
540
|
+
let h = /* @__PURE__ */ Symbol();
|
|
541
|
+
i = h, s.add(e);
|
|
542
|
+
let g = (t, r, i) => {
|
|
543
|
+
var a;
|
|
544
|
+
let o = f.get(t);
|
|
545
|
+
(!o || o.some((t) => i ? i.has(t) : t === e)) && ((a = d.get(t)) == null || a(), d.set(t, t(n, r)));
|
|
546
|
+
};
|
|
547
|
+
for (let e of l) g(e, m);
|
|
548
|
+
queueMicrotask(() => {
|
|
549
|
+
if (i !== h) return;
|
|
550
|
+
let e = n;
|
|
551
|
+
for (let e of u) g(e, r, s);
|
|
552
|
+
r = e, s.clear();
|
|
553
|
+
});
|
|
554
|
+
}, C = {
|
|
555
|
+
getState: x,
|
|
556
|
+
setState: S,
|
|
557
|
+
__unstableInternals: {
|
|
558
|
+
setup: p,
|
|
559
|
+
init: m,
|
|
560
|
+
subscribe: g,
|
|
561
|
+
sync: _,
|
|
562
|
+
batch: v,
|
|
563
|
+
pick: y,
|
|
564
|
+
omit: b
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
return C;
|
|
568
|
+
}
|
|
569
|
+
function en(e, ...t) {
|
|
570
|
+
if (e) return Qt(e, "setup")(...t);
|
|
571
|
+
}
|
|
572
|
+
function tn(e, ...t) {
|
|
573
|
+
if (e) return Qt(e, "init")(...t);
|
|
574
|
+
}
|
|
575
|
+
function nn(e, ...t) {
|
|
576
|
+
if (e) return Qt(e, "subscribe")(...t);
|
|
577
|
+
}
|
|
578
|
+
function rn(e, ...t) {
|
|
579
|
+
if (e) return Qt(e, "sync")(...t);
|
|
580
|
+
}
|
|
581
|
+
function an(e, ...t) {
|
|
582
|
+
if (e) return Qt(e, "batch")(...t);
|
|
583
|
+
}
|
|
584
|
+
function on(e, ...t) {
|
|
585
|
+
if (e) return Qt(e, "omit")(...t);
|
|
586
|
+
}
|
|
587
|
+
function sn(...e) {
|
|
588
|
+
let t = {};
|
|
589
|
+
for (let n of e) {
|
|
590
|
+
let e = (n?.getState)?.call(n);
|
|
591
|
+
e && Object.assign(t, e);
|
|
592
|
+
}
|
|
593
|
+
let n = $t(t, ...e);
|
|
594
|
+
return Object.assign({}, ...e, n);
|
|
595
|
+
}
|
|
596
|
+
function cn(e, t) {
|
|
597
|
+
if (process.env.NODE_ENV === "production" || !t) return;
|
|
598
|
+
let n = Object.entries(e).filter(([e, t]) => e.startsWith("default") && t !== void 0).map(([e]) => {
|
|
599
|
+
let t = e.replace("default", "");
|
|
600
|
+
return `${t[0]?.toLowerCase() || ""}${t.slice(1)}`;
|
|
601
|
+
});
|
|
602
|
+
if (!n.length) return;
|
|
603
|
+
let r = t.getState();
|
|
604
|
+
if (n.filter((e) => oe(r, e)).length) throw Error("Passing a store prop in conjunction with a default state is not supported.\n\nconst store = useSelectStore();\n<SelectProvider store={store} defaultValue=\"Apple\" />\n ^ ^\n\nInstead, pass the default state to the topmost store:\n\nconst store = useSelectStore({ defaultValue: \"Apple\" });\n<SelectProvider store={store} />\n\nSee https://github.com/ariakit/ariakit/pull/2745 for more details.\n\nIf there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit\n");
|
|
605
|
+
}
|
|
606
|
+
var ln = /* @__PURE__ */ te(((e) => {
|
|
607
|
+
var t = ne("react");
|
|
608
|
+
function n(e, t) {
|
|
609
|
+
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
610
|
+
}
|
|
611
|
+
var r = typeof Object.is == "function" ? Object.is : n, i = t.useState, a = t.useEffect, o = t.useLayoutEffect, s = t.useDebugValue;
|
|
612
|
+
function c(e, t) {
|
|
613
|
+
var n = t(), r = i({ inst: {
|
|
614
|
+
value: n,
|
|
615
|
+
getSnapshot: t
|
|
616
|
+
} }), c = r[0].inst, u = r[1];
|
|
617
|
+
return o(function() {
|
|
618
|
+
c.value = n, c.getSnapshot = t, l(c) && u({ inst: c });
|
|
619
|
+
}, [
|
|
620
|
+
e,
|
|
621
|
+
n,
|
|
622
|
+
t
|
|
623
|
+
]), a(function() {
|
|
624
|
+
return l(c) && u({ inst: c }), e(function() {
|
|
625
|
+
l(c) && u({ inst: c });
|
|
626
|
+
});
|
|
627
|
+
}, [e]), s(n), n;
|
|
628
|
+
}
|
|
629
|
+
function l(e) {
|
|
630
|
+
var t = e.getSnapshot;
|
|
631
|
+
e = e.value;
|
|
632
|
+
try {
|
|
633
|
+
var n = t();
|
|
634
|
+
return !r(e, n);
|
|
635
|
+
} catch {
|
|
636
|
+
return !0;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
function u(e, t) {
|
|
640
|
+
return t();
|
|
641
|
+
}
|
|
642
|
+
var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
|
|
643
|
+
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
|
|
644
|
+
})), un = /* @__PURE__ */ te(((e) => {
|
|
645
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
646
|
+
function t(e, t) {
|
|
647
|
+
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
648
|
+
}
|
|
649
|
+
function n(e, t) {
|
|
650
|
+
d || a.startTransition === void 0 || (d = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
651
|
+
var n = t();
|
|
652
|
+
if (!f) {
|
|
653
|
+
var i = t();
|
|
654
|
+
o(n, i) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0);
|
|
655
|
+
}
|
|
656
|
+
i = s({ inst: {
|
|
657
|
+
value: n,
|
|
658
|
+
getSnapshot: t
|
|
659
|
+
} });
|
|
660
|
+
var p = i[0].inst, m = i[1];
|
|
661
|
+
return l(function() {
|
|
662
|
+
p.value = n, p.getSnapshot = t, r(p) && m({ inst: p });
|
|
663
|
+
}, [
|
|
664
|
+
e,
|
|
665
|
+
n,
|
|
666
|
+
t
|
|
667
|
+
]), c(function() {
|
|
668
|
+
return r(p) && m({ inst: p }), e(function() {
|
|
669
|
+
r(p) && m({ inst: p });
|
|
670
|
+
});
|
|
671
|
+
}, [e]), u(n), n;
|
|
672
|
+
}
|
|
673
|
+
function r(e) {
|
|
674
|
+
var t = e.getSnapshot;
|
|
675
|
+
e = e.value;
|
|
676
|
+
try {
|
|
677
|
+
var n = t();
|
|
678
|
+
return !o(e, n);
|
|
679
|
+
} catch {
|
|
680
|
+
return !0;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function i(e, t) {
|
|
684
|
+
return t();
|
|
685
|
+
}
|
|
686
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
687
|
+
var a = ne("react"), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
688
|
+
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
689
|
+
})();
|
|
690
|
+
})), dn = (/* @__PURE__ */ te(((e, t) => {
|
|
691
|
+
process.env.NODE_ENV === "production" ? t.exports = ln() : t.exports = un();
|
|
692
|
+
})))(), fn = () => () => {};
|
|
693
|
+
function Z(e, t = de) {
|
|
694
|
+
let n = d.useCallback((t) => e ? nn(e, null, t) : fn(), [e]), r = () => {
|
|
695
|
+
let n = typeof t == "string" ? t : null, r = typeof t == "function" ? t : null, i = e?.getState();
|
|
696
|
+
if (r) return r(i);
|
|
697
|
+
if (i && n && oe(i, n)) return i[n];
|
|
698
|
+
};
|
|
699
|
+
return (0, dn.useSyncExternalStore)(n, r, r);
|
|
700
|
+
}
|
|
701
|
+
function pn(e, t) {
|
|
702
|
+
let n = d.useRef({}), r = d.useCallback((t) => e ? nn(e, null, t) : fn(), [e]), i = () => {
|
|
703
|
+
let r = e?.getState(), i = !1, a = n.current;
|
|
704
|
+
for (let e in t) {
|
|
705
|
+
let n = t[e];
|
|
706
|
+
if (typeof n == "function") {
|
|
707
|
+
let t = n(r);
|
|
708
|
+
t !== a[e] && (a[e] = t, i = !0);
|
|
709
|
+
}
|
|
710
|
+
if (typeof n == "string") {
|
|
711
|
+
if (!r || !oe(r, n)) continue;
|
|
712
|
+
let t = r[n];
|
|
713
|
+
t !== a[e] && (a[e] = t, i = !0);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return i && (n.current = { ...a }), n.current;
|
|
717
|
+
};
|
|
718
|
+
return (0, dn.useSyncExternalStore)(r, i, i);
|
|
719
|
+
}
|
|
720
|
+
function Q(e, t, n, r) {
|
|
721
|
+
let i = oe(t, n) ? t[n] : void 0, a = $e({
|
|
722
|
+
value: i,
|
|
723
|
+
setValue: r ? t[r] : void 0
|
|
724
|
+
});
|
|
725
|
+
U(() => rn(e, [n], (e, t) => {
|
|
726
|
+
let { value: r, setValue: i } = a.current;
|
|
727
|
+
i && e[n] !== t[n] && e[n] !== r && i(e[n]);
|
|
728
|
+
}), [e, n]), U(() => {
|
|
729
|
+
if (i !== void 0) return e.setState(n, i), an(e, [n], () => {
|
|
730
|
+
i !== void 0 && e.setState(n, i);
|
|
731
|
+
});
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
function mn(e, t) {
|
|
735
|
+
let [n, r] = d.useState(() => e(t));
|
|
736
|
+
U(() => tn(n), [n]);
|
|
737
|
+
let i = d.useCallback((e) => Z(n, e), [n]);
|
|
738
|
+
return [d.useMemo(() => ({
|
|
739
|
+
...n,
|
|
740
|
+
useState: i
|
|
741
|
+
}), [n, i]), W(() => {
|
|
742
|
+
r((n) => e({
|
|
743
|
+
...t,
|
|
744
|
+
...n.getState()
|
|
745
|
+
}));
|
|
746
|
+
})];
|
|
747
|
+
}
|
|
748
|
+
var hn = "span", gn = {
|
|
749
|
+
top: "4,10 8,6 12,10",
|
|
750
|
+
right: "6,4 10,8 6,12",
|
|
751
|
+
bottom: "4,6 8,10 12,6",
|
|
752
|
+
left: "10,4 6,8 10,12"
|
|
753
|
+
}, _n = X(function({ store: e, placement: t, ...n }) {
|
|
754
|
+
let r = kt();
|
|
755
|
+
e ||= r, L(e, process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component.");
|
|
756
|
+
let i = gn[Z(e, (e) => t || e.placement).split("-")[0]];
|
|
757
|
+
return n = {
|
|
758
|
+
children: v(() => /* @__PURE__ */ C("svg", {
|
|
759
|
+
display: "block",
|
|
760
|
+
fill: "none",
|
|
761
|
+
stroke: "currentColor",
|
|
762
|
+
strokeLinecap: "round",
|
|
763
|
+
strokeLinejoin: "round",
|
|
764
|
+
strokeWidth: 1.5,
|
|
765
|
+
viewBox: "0 0 16 16",
|
|
766
|
+
height: "1em",
|
|
767
|
+
width: "1em",
|
|
768
|
+
children: /* @__PURE__ */ C("polyline", { points: i })
|
|
769
|
+
}), [i]),
|
|
770
|
+
"aria-hidden": !0,
|
|
771
|
+
...n,
|
|
772
|
+
style: {
|
|
773
|
+
width: "1em",
|
|
774
|
+
height: "1em",
|
|
775
|
+
pointerEvents: "none",
|
|
776
|
+
...n.style
|
|
777
|
+
}
|
|
778
|
+
}, R(n);
|
|
779
|
+
});
|
|
780
|
+
J(function(e) {
|
|
781
|
+
return Y(hn, _n(e));
|
|
782
|
+
});
|
|
783
|
+
var vn = "span", yn = X(function({ store: e, ...t }) {
|
|
784
|
+
let n = Gt();
|
|
785
|
+
return e ||= n, t = _n({
|
|
786
|
+
store: e,
|
|
787
|
+
...t
|
|
788
|
+
}), t;
|
|
789
|
+
}), bn = J(function(e) {
|
|
790
|
+
return Y(vn, yn(e));
|
|
791
|
+
}), xn = { id: null };
|
|
792
|
+
function Sn(e, t, n = !1) {
|
|
793
|
+
let r = e.findIndex((e) => e.id === t);
|
|
794
|
+
return [
|
|
795
|
+
...e.slice(r + 1),
|
|
796
|
+
...n ? [xn] : [],
|
|
797
|
+
...e.slice(0, r)
|
|
798
|
+
];
|
|
799
|
+
}
|
|
800
|
+
function Cn(e, t) {
|
|
801
|
+
return e.find((e) => t ? !e.disabled && e.id !== t : !e.disabled);
|
|
802
|
+
}
|
|
803
|
+
function wn(e, t) {
|
|
804
|
+
return t && e.item(t) || null;
|
|
805
|
+
}
|
|
806
|
+
function Tn(e) {
|
|
807
|
+
let t = [];
|
|
808
|
+
for (let n of e) {
|
|
809
|
+
let e = t.find((e) => e[0]?.rowId === n.rowId);
|
|
810
|
+
e ? e.push(n) : t.push([n]);
|
|
811
|
+
}
|
|
812
|
+
return t;
|
|
813
|
+
}
|
|
814
|
+
function En(e, t = !1) {
|
|
815
|
+
if (Ee(e)) e.setSelectionRange(t ? e.value.length : 0, e.value.length);
|
|
816
|
+
else if (e.isContentEditable) {
|
|
817
|
+
let n = B(e).getSelection();
|
|
818
|
+
n?.selectAllChildren(e), t && n?.collapseToEnd();
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
var Dn = /* @__PURE__ */ Symbol("FOCUS_SILENTLY");
|
|
822
|
+
function On(e) {
|
|
823
|
+
e[Dn] = !0, e.focus({ preventScroll: !0 });
|
|
824
|
+
}
|
|
825
|
+
function kn(e) {
|
|
826
|
+
let t = e[Dn];
|
|
827
|
+
return delete e[Dn], t;
|
|
828
|
+
}
|
|
829
|
+
function An(e, t, n) {
|
|
830
|
+
if (!t || t === n) return !1;
|
|
831
|
+
let r = e.item(t.id);
|
|
832
|
+
return !(!r || n && r.element === n);
|
|
833
|
+
}
|
|
834
|
+
var jn = "div", Mn = "";
|
|
835
|
+
function Nn() {
|
|
836
|
+
Mn = "";
|
|
837
|
+
}
|
|
838
|
+
function Pn(e) {
|
|
839
|
+
let t = e.target;
|
|
840
|
+
return t && Ee(t) ? !1 : e.key === " " && Mn.length ? !0 : e.key.length === 1 && !e.ctrlKey && !e.altKey && !e.metaKey && /^[\p{Letter}\p{Number}]$/u.test(e.key);
|
|
841
|
+
}
|
|
842
|
+
function Fn(e, t) {
|
|
843
|
+
if (H(e)) return !0;
|
|
844
|
+
let n = e.target;
|
|
845
|
+
return n ? t.some((e) => e.element === n) : !1;
|
|
846
|
+
}
|
|
847
|
+
function In(e) {
|
|
848
|
+
return e.filter((e) => !e.disabled);
|
|
849
|
+
}
|
|
850
|
+
function Ln(e, t) {
|
|
851
|
+
let n = e.element?.textContent || e.children || "value" in e && e.value;
|
|
852
|
+
return n ? ce(n).trim().toLowerCase().startsWith(t.toLowerCase()) : !1;
|
|
853
|
+
}
|
|
854
|
+
function Rn(e, t, n) {
|
|
855
|
+
if (!n) return e;
|
|
856
|
+
let r = e.find((e) => e.id === n);
|
|
857
|
+
return !r || !Ln(r, t) || Mn !== t && Ln(r, Mn) ? e : (Mn = t, Sn(e.filter((e) => Ln(e, Mn)), n).filter((e) => e.id !== n));
|
|
858
|
+
}
|
|
859
|
+
var zn = X(function({ store: e, typeahead: t = !0, ...n }) {
|
|
860
|
+
let r = Rt();
|
|
861
|
+
e ||= r, L(e, process.env.NODE_ENV !== "production" && "CompositeTypeahead must be a Composite component");
|
|
862
|
+
let i = n.onKeyDownCapture, a = b(0), o = W((n) => {
|
|
863
|
+
if (i?.(n), n.defaultPrevented || !t || !e) return;
|
|
864
|
+
if (!Pn(n)) return Nn();
|
|
865
|
+
let { renderedItems: r, items: o, activeId: s, id: c } = e.getState(), l = In(o.length > r.length ? o : r), u = B(n.currentTarget), d = `[data-offscreen-id="${c}"]`, f = u.querySelectorAll(d);
|
|
866
|
+
for (let e of f) {
|
|
867
|
+
let t = e.ariaDisabled === "true" || "disabled" in e && !!e.disabled;
|
|
868
|
+
l.push({
|
|
869
|
+
id: e.id,
|
|
870
|
+
element: e,
|
|
871
|
+
disabled: t
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
if (f.length && (l = Ne(l, (e) => e.element)), !Fn(n, l)) return Nn();
|
|
875
|
+
n.preventDefault(), window.clearTimeout(a.current), a.current = window.setTimeout(() => {
|
|
876
|
+
Mn = "";
|
|
877
|
+
}, 500);
|
|
878
|
+
let p = n.key.toLowerCase();
|
|
879
|
+
Mn += p, l = Rn(l, p, s);
|
|
880
|
+
let m = l.find((e) => Ln(e, Mn));
|
|
881
|
+
m ? e.move(m.id) : Nn();
|
|
882
|
+
});
|
|
883
|
+
return n = {
|
|
884
|
+
...n,
|
|
885
|
+
onKeyDownCapture: o
|
|
886
|
+
}, R(n);
|
|
887
|
+
});
|
|
888
|
+
J(function(e) {
|
|
889
|
+
return Y(jn, zn(e));
|
|
890
|
+
});
|
|
891
|
+
var Bn = "div", Vn = X(function({ store: e, ...t }) {
|
|
892
|
+
let n = At();
|
|
893
|
+
return e ||= n, t = {
|
|
894
|
+
...t,
|
|
895
|
+
ref: G(e?.setAnchorElement, t.ref)
|
|
896
|
+
}, t;
|
|
897
|
+
});
|
|
898
|
+
J(function(e) {
|
|
899
|
+
return Y(Bn, Vn(e));
|
|
900
|
+
});
|
|
901
|
+
var Hn = f(!0), Un = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
|
|
902
|
+
function Wn(e) {
|
|
903
|
+
return Number.parseInt(e.getAttribute("tabindex") || "0", 10) < 0;
|
|
904
|
+
}
|
|
905
|
+
function Gn(e) {
|
|
906
|
+
return !(!e.matches(Un) || !Te(e) || e.closest("[inert]"));
|
|
907
|
+
}
|
|
908
|
+
function Kn(e) {
|
|
909
|
+
if (!Gn(e) || Wn(e)) return !1;
|
|
910
|
+
if (!("form" in e) || !e.form || e.checked || e.type !== "radio") return !0;
|
|
911
|
+
let t = e.form.elements.namedItem(e.name);
|
|
912
|
+
if (!t || !("length" in t)) return !0;
|
|
913
|
+
let n = xe(e);
|
|
914
|
+
return !n || n === e || !("form" in n) || n.form !== e.form || n.name !== e.name;
|
|
915
|
+
}
|
|
916
|
+
function qn(e, t) {
|
|
917
|
+
let n = Array.from(e.querySelectorAll(Un));
|
|
918
|
+
t && n.unshift(e);
|
|
919
|
+
let r = n.filter(Gn);
|
|
920
|
+
return r.forEach((e, t) => {
|
|
921
|
+
if (!Se(e)) return;
|
|
922
|
+
let n = e.contentDocument?.body;
|
|
923
|
+
n && r.splice(t, 1, ...qn(n));
|
|
924
|
+
}), r;
|
|
925
|
+
}
|
|
926
|
+
function Jn(e, t, n) {
|
|
927
|
+
let r = Array.from(e.querySelectorAll(Un)), i = r.filter(Kn);
|
|
928
|
+
return t && Kn(e) && i.unshift(e), i.forEach((e, t) => {
|
|
929
|
+
if (!Se(e)) return;
|
|
930
|
+
let r = e.contentDocument?.body;
|
|
931
|
+
if (!r) return;
|
|
932
|
+
let a = Jn(r, !1, n);
|
|
933
|
+
i.splice(t, 1, ...a);
|
|
934
|
+
}), !i.length && n ? r : i;
|
|
935
|
+
}
|
|
936
|
+
function Yn(e, t, n) {
|
|
937
|
+
let [r] = Jn(e, t, n);
|
|
938
|
+
return r || null;
|
|
939
|
+
}
|
|
940
|
+
function Xn(e, t, n, r) {
|
|
941
|
+
let i = xe(e), a = qn(e, t), o = a.indexOf(i), s = a.slice(o + 1);
|
|
942
|
+
return s.find(Kn) || (n ? a.find(Kn) : null) || (r ? s[0] : null) || null;
|
|
943
|
+
}
|
|
944
|
+
function Zn(e, t) {
|
|
945
|
+
return Xn(document.body, !1, e, t);
|
|
946
|
+
}
|
|
947
|
+
function Qn(e, t, n, r) {
|
|
948
|
+
let i = xe(e), a = qn(e, t).reverse(), o = a.indexOf(i), s = a.slice(o + 1);
|
|
949
|
+
return s.find(Kn) || (n ? a.find(Kn) : null) || (r ? s[0] : null) || null;
|
|
950
|
+
}
|
|
951
|
+
function $n(e, t) {
|
|
952
|
+
return Qn(document.body, !1, e, t);
|
|
953
|
+
}
|
|
954
|
+
function er(e) {
|
|
955
|
+
let t = xe(e);
|
|
956
|
+
if (!t) return !1;
|
|
957
|
+
if (t === e) return !0;
|
|
958
|
+
let n = t.getAttribute("aria-activedescendant");
|
|
959
|
+
return n ? n === e.id : !1;
|
|
960
|
+
}
|
|
961
|
+
function tr(e) {
|
|
962
|
+
let t = xe(e);
|
|
963
|
+
if (!t) return !1;
|
|
964
|
+
if (V(e, t)) return !0;
|
|
965
|
+
let n = t.getAttribute("aria-activedescendant");
|
|
966
|
+
return !n || !("id" in e) ? !1 : n === e.id ? !0 : !!e.querySelector(`#${CSS.escape(n)}`);
|
|
967
|
+
}
|
|
968
|
+
function nr(e) {
|
|
969
|
+
let t = e.getAttribute("tabindex") ?? "";
|
|
970
|
+
e.setAttribute("data-tabindex", t), e.setAttribute("tabindex", "-1");
|
|
971
|
+
}
|
|
972
|
+
function rr(e, t) {
|
|
973
|
+
let n = Jn(e, t);
|
|
974
|
+
for (let e of n) nr(e);
|
|
975
|
+
}
|
|
976
|
+
function ir(e) {
|
|
977
|
+
let t = e.querySelectorAll("[data-tabindex]"), n = (e) => {
|
|
978
|
+
let t = e.getAttribute("data-tabindex");
|
|
979
|
+
e.removeAttribute("data-tabindex"), t ? e.setAttribute("tabindex", t) : e.removeAttribute("tabindex");
|
|
980
|
+
};
|
|
981
|
+
e.hasAttribute("data-tabindex") && n(e);
|
|
982
|
+
for (let e of t) n(e);
|
|
983
|
+
}
|
|
984
|
+
function ar(e, t) {
|
|
985
|
+
"scrollIntoView" in e ? (e.focus({ preventScroll: !0 }), e.scrollIntoView({
|
|
986
|
+
block: "nearest",
|
|
987
|
+
inline: "nearest",
|
|
988
|
+
...t
|
|
989
|
+
})) : e.focus();
|
|
990
|
+
}
|
|
991
|
+
var or = "div", sr = /* @__PURE__ */ Symbol("accessibleWhenDisabled"), cr = Le(), lr = [
|
|
992
|
+
"text",
|
|
993
|
+
"search",
|
|
994
|
+
"url",
|
|
995
|
+
"tel",
|
|
996
|
+
"email",
|
|
997
|
+
"password",
|
|
998
|
+
"number",
|
|
999
|
+
"date",
|
|
1000
|
+
"month",
|
|
1001
|
+
"week",
|
|
1002
|
+
"time",
|
|
1003
|
+
"datetime",
|
|
1004
|
+
"datetime-local"
|
|
1005
|
+
];
|
|
1006
|
+
function ur(e) {
|
|
1007
|
+
let { tagName: t, readOnly: n, type: r } = e;
|
|
1008
|
+
return t === "TEXTAREA" && !n || t === "SELECT" && !n ? !0 : t === "INPUT" && !n ? lr.includes(r) : !!(e.isContentEditable || e.getAttribute("role") === "combobox" && e.dataset.name);
|
|
1009
|
+
}
|
|
1010
|
+
function dr(e) {
|
|
1011
|
+
return e ? e === "button" || e === "summary" || e === "input" || e === "select" || e === "textarea" || e === "a" : !0;
|
|
1012
|
+
}
|
|
1013
|
+
function fr(e) {
|
|
1014
|
+
return e ? e === "button" || e === "input" || e === "select" || e === "textarea" : !0;
|
|
1015
|
+
}
|
|
1016
|
+
var pr = [
|
|
1017
|
+
"button",
|
|
1018
|
+
"color",
|
|
1019
|
+
"file",
|
|
1020
|
+
"image",
|
|
1021
|
+
"reset",
|
|
1022
|
+
"submit"
|
|
1023
|
+
];
|
|
1024
|
+
function mr(e, t) {
|
|
1025
|
+
return e === "button" ? !0 : e === "input" && t ? t === "checkbox" || t === "radio" ? !0 : pr.includes(t) : !1;
|
|
1026
|
+
}
|
|
1027
|
+
function hr({ focusable: e, trulyDisabled: t, nativeTabbable: n, supportsDisabled: r, safariTabIndex: i, tabIndexProp: a }) {
|
|
1028
|
+
return e ? t ? n && !r ? -1 : void 0 : n ? i && a == null ? 0 : a : a ?? 0 : a;
|
|
1029
|
+
}
|
|
1030
|
+
function gr(e, t) {
|
|
1031
|
+
return W((n) => {
|
|
1032
|
+
e?.(n), !n.defaultPrevented && t && (n.stopPropagation(), n.preventDefault());
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
var _r = !1, vr = !0;
|
|
1036
|
+
function yr(e) {
|
|
1037
|
+
let t = e.target;
|
|
1038
|
+
t && "hasAttribute" in t && (t.hasAttribute("data-focus-visible") || (vr = !1));
|
|
1039
|
+
}
|
|
1040
|
+
function br(e) {
|
|
1041
|
+
e.metaKey || e.ctrlKey || e.altKey || (vr = !0);
|
|
1042
|
+
}
|
|
1043
|
+
var xr = X(function({ focusable: e = !0, accessibleWhenDisabled: t, autoFocus: n, onFocusVisible: r, ...i }) {
|
|
1044
|
+
let a = b(null), [o, s] = st(i, sr, t);
|
|
1045
|
+
t ??= o, g(() => {
|
|
1046
|
+
e && (_r ||= (Je("mousedown", yr, !0), Je("keydown", br, !0), !0));
|
|
1047
|
+
}, [e]);
|
|
1048
|
+
let c = e && pe(i), l = !!c && !t, [u, d] = x(!1);
|
|
1049
|
+
g(() => {
|
|
1050
|
+
e && l && u && d(!1);
|
|
1051
|
+
}, [
|
|
1052
|
+
e,
|
|
1053
|
+
l,
|
|
1054
|
+
u
|
|
1055
|
+
]), g(() => {
|
|
1056
|
+
if (!e || !u) return;
|
|
1057
|
+
let t = a.current;
|
|
1058
|
+
if (!t || typeof IntersectionObserver > "u") return;
|
|
1059
|
+
let n = new IntersectionObserver(() => {
|
|
1060
|
+
Gn(t) || d(!1);
|
|
1061
|
+
});
|
|
1062
|
+
return n.observe(t), () => n.disconnect();
|
|
1063
|
+
}, [e, u]);
|
|
1064
|
+
let f = gr(i.onKeyPressCapture, c), p = gr(i.onMouseDownCapture, c), m = gr(i.onClickCapture, c), _ = (t, n) => {
|
|
1065
|
+
if (n && (t.currentTarget = n), !e) return;
|
|
1066
|
+
let i = t.currentTarget;
|
|
1067
|
+
i && er(i) && (r?.(t), !t.defaultPrevented && (i.dataset.focusVisible = "true", d(!0)));
|
|
1068
|
+
}, y = i.onKeyDownCapture, S = W((t) => {
|
|
1069
|
+
if (y?.(t), t.defaultPrevented || !e || u || t.metaKey || t.altKey || t.ctrlKey || !H(t)) return;
|
|
1070
|
+
let n = t.currentTarget;
|
|
1071
|
+
qe(n, "focusout", () => _(t, n));
|
|
1072
|
+
}), C = i.onFocusCapture, w = W((t) => {
|
|
1073
|
+
if (C?.(t), t.defaultPrevented || !e) return;
|
|
1074
|
+
if (!H(t)) {
|
|
1075
|
+
d(!1);
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
let n = t.currentTarget;
|
|
1079
|
+
vr || ur(t.target) ? qe(t.target, "focusout", () => _(t, n)) : d(!1);
|
|
1080
|
+
}), T = i.onBlur, E = W((t) => {
|
|
1081
|
+
T?.(t), e && Ke(t) && (t.currentTarget.removeAttribute("data-focus-visible"), d(!1));
|
|
1082
|
+
}), D = h(Hn), O = W((t) => {
|
|
1083
|
+
e && n && t && D && queueMicrotask(() => {
|
|
1084
|
+
er(t) || Gn(t) && t.focus();
|
|
1085
|
+
});
|
|
1086
|
+
}), k = nt(a), A = e && dr(k), j = e && fr(k), [M, N] = x(!1);
|
|
1087
|
+
cr && g(() => {
|
|
1088
|
+
if (!e) return;
|
|
1089
|
+
let t = a.current;
|
|
1090
|
+
if (!t) return;
|
|
1091
|
+
let n = t.tagName.toLowerCase(), r = t.type;
|
|
1092
|
+
N(mr(n, r));
|
|
1093
|
+
}, [e]);
|
|
1094
|
+
let P = i.style, F = v(() => l ? {
|
|
1095
|
+
pointerEvents: "none",
|
|
1096
|
+
...P
|
|
1097
|
+
} : P, [l, P]);
|
|
1098
|
+
return i = {
|
|
1099
|
+
"data-focus-visible": e && u || void 0,
|
|
1100
|
+
"data-autofocus": n || void 0,
|
|
1101
|
+
"aria-disabled": c || void 0,
|
|
1102
|
+
...i,
|
|
1103
|
+
...s,
|
|
1104
|
+
ref: G(a, O, i.ref),
|
|
1105
|
+
style: F,
|
|
1106
|
+
tabIndex: hr({
|
|
1107
|
+
focusable: e,
|
|
1108
|
+
trulyDisabled: l,
|
|
1109
|
+
nativeTabbable: A,
|
|
1110
|
+
supportsDisabled: j,
|
|
1111
|
+
safariTabIndex: M,
|
|
1112
|
+
tabIndexProp: i.tabIndex
|
|
1113
|
+
}),
|
|
1114
|
+
disabled: j && l ? !0 : void 0,
|
|
1115
|
+
contentEditable: c ? void 0 : i.contentEditable,
|
|
1116
|
+
onKeyPressCapture: f,
|
|
1117
|
+
onClickCapture: m,
|
|
1118
|
+
onMouseDownCapture: p,
|
|
1119
|
+
onKeyDownCapture: S,
|
|
1120
|
+
onFocusCapture: w,
|
|
1121
|
+
onBlur: E
|
|
1122
|
+
}, R(i);
|
|
1123
|
+
});
|
|
1124
|
+
J(function(e) {
|
|
1125
|
+
return Y(or, xr(e));
|
|
1126
|
+
});
|
|
1127
|
+
var Sr = "button";
|
|
1128
|
+
function Cr(e) {
|
|
1129
|
+
if (!e.isTrusted) return !1;
|
|
1130
|
+
let t = e.currentTarget;
|
|
1131
|
+
return e.key === "Enter" ? Ce(t) || t.tagName === "SUMMARY" || t.tagName === "A" : e.key === " " ? Ce(t) || t.tagName === "SUMMARY" || t.tagName === "INPUT" || t.tagName === "SELECT" : !1;
|
|
1132
|
+
}
|
|
1133
|
+
var wr = /* @__PURE__ */ Symbol("command"), Tr = X(function({ clickOnEnter: e = !0, clickOnSpace: t = !0, ...n }) {
|
|
1134
|
+
let r = b(null), [i, a] = x(!1);
|
|
1135
|
+
g(() => {
|
|
1136
|
+
r.current && a(Ce(r.current));
|
|
1137
|
+
}, []);
|
|
1138
|
+
let [o, s] = x(!1), c = b(!1), l = pe(n), [u, d] = st(n, wr, !0), f = n.onKeyDown, p = W((n) => {
|
|
1139
|
+
f?.(n);
|
|
1140
|
+
let r = n.currentTarget;
|
|
1141
|
+
if (n.defaultPrevented || u || l || !H(n) || Ee(r) || r.isContentEditable) return;
|
|
1142
|
+
let i = e && n.key === "Enter", a = t && n.key === " ", o = n.key === "Enter" && !e, d = n.key === " " && !t;
|
|
1143
|
+
if (o || d) {
|
|
1144
|
+
n.preventDefault();
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
if (i || a) {
|
|
1148
|
+
let e = Cr(n);
|
|
1149
|
+
if (i) {
|
|
1150
|
+
if (!e) {
|
|
1151
|
+
n.preventDefault();
|
|
1152
|
+
let { view: e, ...t } = n, i = () => Ge(r, t);
|
|
1153
|
+
Re() ? qe(r, "keyup", i) : queueMicrotask(i);
|
|
1154
|
+
}
|
|
1155
|
+
} else a && (c.current = !0, e || (n.preventDefault(), s(!0)));
|
|
1156
|
+
}
|
|
1157
|
+
}), m = n.onKeyUp, h = W((e) => {
|
|
1158
|
+
if (m?.(e), e.defaultPrevented || u || l || e.metaKey) return;
|
|
1159
|
+
let n = t && e.key === " ";
|
|
1160
|
+
if (c.current && n && (c.current = !1, !Cr(e))) {
|
|
1161
|
+
e.preventDefault(), s(!1);
|
|
1162
|
+
let t = e.currentTarget, { view: n, ...r } = e;
|
|
1163
|
+
queueMicrotask(() => Ge(t, r));
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
return n = {
|
|
1167
|
+
"data-active": o || void 0,
|
|
1168
|
+
type: i ? "button" : void 0,
|
|
1169
|
+
...d,
|
|
1170
|
+
...n,
|
|
1171
|
+
ref: G(r, n.ref),
|
|
1172
|
+
onKeyDown: p,
|
|
1173
|
+
onKeyUp: h
|
|
1174
|
+
}, n = xr(n), n;
|
|
1175
|
+
});
|
|
1176
|
+
J(function(e) {
|
|
1177
|
+
return Y(Sr, Tr(e));
|
|
1178
|
+
});
|
|
1179
|
+
var Er = "button", Dr = X(function(e) {
|
|
1180
|
+
let t = b(null), n = nt(t, Er), [r, i] = x(() => !!n && Ce({
|
|
1181
|
+
tagName: n,
|
|
1182
|
+
type: e.type
|
|
1183
|
+
}));
|
|
1184
|
+
return g(() => {
|
|
1185
|
+
t.current && i(Ce(t.current));
|
|
1186
|
+
}, []), e = {
|
|
1187
|
+
role: !r && n !== "a" ? "button" : void 0,
|
|
1188
|
+
...e,
|
|
1189
|
+
ref: G(t, e.ref)
|
|
1190
|
+
}, e = Tr(e), e;
|
|
1191
|
+
});
|
|
1192
|
+
J(function(e) {
|
|
1193
|
+
return Y(Er, Dr(e));
|
|
1194
|
+
});
|
|
1195
|
+
var Or = "button", kr = /* @__PURE__ */ Symbol("disclosure"), Ar = X(function({ store: e, toggleOnClick: t = !0, ...n }) {
|
|
1196
|
+
let r = yt();
|
|
1197
|
+
e ||= r, L(e, process.env.NODE_ENV !== "production" && "Disclosure must receive a `store` prop or be wrapped in a DisclosureProvider component.");
|
|
1198
|
+
let i = b(null), [a, o] = x(!1), s = Z(e, "disclosureElement"), c = Z(e, "open");
|
|
1199
|
+
g(() => {
|
|
1200
|
+
let t = s === i.current;
|
|
1201
|
+
s?.isConnected || (e?.setDisclosureElement(i.current), t = !0), o(c && t);
|
|
1202
|
+
}, [
|
|
1203
|
+
s,
|
|
1204
|
+
e,
|
|
1205
|
+
c
|
|
1206
|
+
]);
|
|
1207
|
+
let l = n.onClick, u = K(t), [d, f] = st(n, kr, !0), p = W((t) => {
|
|
1208
|
+
l?.(t), !t.defaultPrevented && (d || u(t) && (e?.setDisclosureElement(t.currentTarget), e?.toggle()));
|
|
1209
|
+
});
|
|
1210
|
+
return n = {
|
|
1211
|
+
"aria-expanded": a,
|
|
1212
|
+
"aria-controls": Z(e, "contentElement")?.id,
|
|
1213
|
+
...f,
|
|
1214
|
+
...n,
|
|
1215
|
+
ref: G(i, n.ref),
|
|
1216
|
+
onClick: p
|
|
1217
|
+
}, n = Dr(n), n;
|
|
1218
|
+
});
|
|
1219
|
+
J(function(e) {
|
|
1220
|
+
return Y(Or, Ar(e));
|
|
1221
|
+
});
|
|
1222
|
+
var jr = "button", Mr = X(function({ store: e, ...t }) {
|
|
1223
|
+
let n = Ct();
|
|
1224
|
+
return e ||= n, L(e, process.env.NODE_ENV !== "production" && "DialogDisclosure must receive a `store` prop or be wrapped in a DialogProvider component."), t = {
|
|
1225
|
+
"aria-haspopup": Ae(Z(e, "contentElement"), "dialog"),
|
|
1226
|
+
...t
|
|
1227
|
+
}, t = Ar({
|
|
1228
|
+
store: e,
|
|
1229
|
+
...t
|
|
1230
|
+
}), t;
|
|
1231
|
+
});
|
|
1232
|
+
J(function(e) {
|
|
1233
|
+
return Y(jr, Mr(e));
|
|
1234
|
+
});
|
|
1235
|
+
var Nr = "button", Pr = X(function({ store: e, ...t }) {
|
|
1236
|
+
let n = At();
|
|
1237
|
+
e ||= n, L(e, process.env.NODE_ENV !== "production" && "PopoverDisclosure must receive a `store` prop or be wrapped in a PopoverProvider component.");
|
|
1238
|
+
let r = t.onClick, i = W((t) => {
|
|
1239
|
+
e?.setAnchorElement(t.currentTarget), r?.(t);
|
|
1240
|
+
});
|
|
1241
|
+
return t = q(t, (t) => /* @__PURE__ */ C(Mt, {
|
|
1242
|
+
value: e,
|
|
1243
|
+
children: t
|
|
1244
|
+
}), [e]), t = {
|
|
1245
|
+
...t,
|
|
1246
|
+
onClick: i
|
|
1247
|
+
}, t = Vn({
|
|
1248
|
+
store: e,
|
|
1249
|
+
...t
|
|
1250
|
+
}), t = Mr({
|
|
1251
|
+
store: e,
|
|
1252
|
+
...t
|
|
1253
|
+
}), t;
|
|
1254
|
+
});
|
|
1255
|
+
J(function(e) {
|
|
1256
|
+
return Y(Nr, Pr(e));
|
|
1257
|
+
});
|
|
1258
|
+
function Fr(e) {
|
|
1259
|
+
return Array.isArray(e) ? e : e === void 0 ? [] : [e];
|
|
1260
|
+
}
|
|
1261
|
+
function Ir(e) {
|
|
1262
|
+
let t = [];
|
|
1263
|
+
for (let n of e) t.push(...n);
|
|
1264
|
+
return t;
|
|
1265
|
+
}
|
|
1266
|
+
function Lr(e) {
|
|
1267
|
+
return e.slice().reverse();
|
|
1268
|
+
}
|
|
1269
|
+
var Rr = "button";
|
|
1270
|
+
function zr(e) {
|
|
1271
|
+
return Array.from(e.selectedOptions).map((e) => e.value);
|
|
1272
|
+
}
|
|
1273
|
+
function Br(e, t) {
|
|
1274
|
+
return () => {
|
|
1275
|
+
let n = t();
|
|
1276
|
+
if (!n) return;
|
|
1277
|
+
let r = 0, i = e.item(n), a = i;
|
|
1278
|
+
for (; i && i.value == null;) {
|
|
1279
|
+
let n = t(++r);
|
|
1280
|
+
if (!n) return;
|
|
1281
|
+
if (i = e.item(n), i === a) break;
|
|
1282
|
+
}
|
|
1283
|
+
return i?.id;
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
var Vr = X(function({ store: e, name: t, form: n, required: r, showOnKeyDown: i = !0, moveOnKeyDown: a = !0, toggleOnPress: o = !0, toggleOnClick: s = o, ...c }) {
|
|
1287
|
+
let l = qt();
|
|
1288
|
+
e ||= l, L(e, process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component.");
|
|
1289
|
+
let u = c.onKeyDown, d = K(i), f = K(a), p = Z(e, "placement").split("-")[0], m = Z(e, "value"), h = Array.isArray(m), _ = W((t) => {
|
|
1290
|
+
if (u?.(t), t.defaultPrevented || !e) return;
|
|
1291
|
+
let { orientation: n, items: r, activeId: i } = e.getState(), a = n !== "horizontal", o = n !== "vertical", s = !!r.find((e) => !e.disabled && e.value != null)?.rowId, c = {
|
|
1292
|
+
ArrowUp: (s || a) && Br(e, e.up),
|
|
1293
|
+
ArrowRight: (s || o) && Br(e, e.next),
|
|
1294
|
+
ArrowDown: (s || a) && Br(e, e.down),
|
|
1295
|
+
ArrowLeft: (s || o) && Br(e, e.previous)
|
|
1296
|
+
}[t.key];
|
|
1297
|
+
c && f(t) && (t.preventDefault(), e.move(c()));
|
|
1298
|
+
let l = p === "top" || p === "bottom";
|
|
1299
|
+
({
|
|
1300
|
+
ArrowDown: l,
|
|
1301
|
+
ArrowUp: l,
|
|
1302
|
+
ArrowLeft: p === "left",
|
|
1303
|
+
ArrowRight: p === "right"
|
|
1304
|
+
})[t.key] && d(t) && (t.preventDefault(), e.move(i), qe(t.currentTarget, "keyup", e.show));
|
|
1305
|
+
});
|
|
1306
|
+
c = q(c, (t) => /* @__PURE__ */ C(Yt, {
|
|
1307
|
+
value: e,
|
|
1308
|
+
children: t
|
|
1309
|
+
}), [e]);
|
|
1310
|
+
let [y, T] = x(!1), E = b(!1);
|
|
1311
|
+
g(() => {
|
|
1312
|
+
let e = E.current;
|
|
1313
|
+
E.current = !1, !e && T(!1);
|
|
1314
|
+
}, [m]);
|
|
1315
|
+
let D = Z(e, (e) => e.labelElement?.id), O = c["aria-label"], k = c["aria-labelledby"] || D, A = Z(e, (e) => {
|
|
1316
|
+
if (t) return e.items;
|
|
1317
|
+
}), j = v(() => [...new Set(A?.map((e) => e.value).filter((e) => e != null))], [A]);
|
|
1318
|
+
c = q(c, (i) => t ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w("select", {
|
|
1319
|
+
style: {
|
|
1320
|
+
border: 0,
|
|
1321
|
+
clip: "rect(0 0 0 0)",
|
|
1322
|
+
height: "1px",
|
|
1323
|
+
margin: "-1px",
|
|
1324
|
+
overflow: "hidden",
|
|
1325
|
+
padding: 0,
|
|
1326
|
+
position: "absolute",
|
|
1327
|
+
whiteSpace: "nowrap",
|
|
1328
|
+
width: "1px"
|
|
1329
|
+
},
|
|
1330
|
+
tabIndex: -1,
|
|
1331
|
+
"aria-hidden": !0,
|
|
1332
|
+
"aria-label": O,
|
|
1333
|
+
"aria-labelledby": O == null ? k : void 0,
|
|
1334
|
+
name: t,
|
|
1335
|
+
form: n,
|
|
1336
|
+
required: r,
|
|
1337
|
+
disabled: c.disabled,
|
|
1338
|
+
value: m,
|
|
1339
|
+
multiple: h,
|
|
1340
|
+
onFocus: () => (e?.getState().selectElement)?.focus(),
|
|
1341
|
+
onChange: (t) => {
|
|
1342
|
+
E.current = !0, T(!0), e?.setValue(h ? zr(t.target) : t.target.value);
|
|
1343
|
+
},
|
|
1344
|
+
children: [Fr(m).map((e) => e == null || j.includes(e) ? null : /* @__PURE__ */ C("option", {
|
|
1345
|
+
value: e,
|
|
1346
|
+
children: e
|
|
1347
|
+
}, e)), j.map((e) => /* @__PURE__ */ C("option", {
|
|
1348
|
+
value: e,
|
|
1349
|
+
children: e
|
|
1350
|
+
}, e))]
|
|
1351
|
+
}), i] }) : i, [
|
|
1352
|
+
e,
|
|
1353
|
+
O,
|
|
1354
|
+
k,
|
|
1355
|
+
t,
|
|
1356
|
+
n,
|
|
1357
|
+
r,
|
|
1358
|
+
m,
|
|
1359
|
+
h,
|
|
1360
|
+
j,
|
|
1361
|
+
c.disabled
|
|
1362
|
+
]);
|
|
1363
|
+
let M = /* @__PURE__ */ w(S, { children: [m, /* @__PURE__ */ C(bn, {})] }), N = Z(e, "contentElement");
|
|
1364
|
+
return c = {
|
|
1365
|
+
role: "combobox",
|
|
1366
|
+
"aria-autocomplete": "none",
|
|
1367
|
+
"aria-labelledby": c["aria-label"] == null ? D : void 0,
|
|
1368
|
+
"aria-haspopup": Ae(N, "listbox"),
|
|
1369
|
+
"data-autofill": y || void 0,
|
|
1370
|
+
"data-name": t,
|
|
1371
|
+
children: M,
|
|
1372
|
+
...c,
|
|
1373
|
+
ref: G(e.setSelectElement, c.ref),
|
|
1374
|
+
onKeyDown: _
|
|
1375
|
+
}, c = Pr({
|
|
1376
|
+
store: e,
|
|
1377
|
+
toggleOnClick: s,
|
|
1378
|
+
...c
|
|
1379
|
+
}), c = zn({
|
|
1380
|
+
store: e,
|
|
1381
|
+
...c
|
|
1382
|
+
}), c;
|
|
1383
|
+
}), Hr = J(function(e) {
|
|
1384
|
+
return Y(Rr, Vr(e));
|
|
1385
|
+
}), Ur = f(0), Wr = "div";
|
|
1386
|
+
function Gr(e) {
|
|
1387
|
+
let t = e.relatedTarget;
|
|
1388
|
+
return t?.nodeType === Node.ELEMENT_NODE ? t : null;
|
|
1389
|
+
}
|
|
1390
|
+
function Kr(e) {
|
|
1391
|
+
let t = Gr(e);
|
|
1392
|
+
return t ? V(e.currentTarget, t) : !1;
|
|
1393
|
+
}
|
|
1394
|
+
var qr = /* @__PURE__ */ Symbol("composite-hover");
|
|
1395
|
+
function Jr(e) {
|
|
1396
|
+
let t = Gr(e);
|
|
1397
|
+
if (!t) return !1;
|
|
1398
|
+
do {
|
|
1399
|
+
if (oe(t, qr) && t[qr]) return !0;
|
|
1400
|
+
t = t.parentElement;
|
|
1401
|
+
} while (t);
|
|
1402
|
+
return !1;
|
|
1403
|
+
}
|
|
1404
|
+
var Yr = X(function({ store: e, focusOnHover: t = !0, blurOnHoverEnd: n = !!t, ...r }) {
|
|
1405
|
+
let i = Rt();
|
|
1406
|
+
e ||= i, L(e, process.env.NODE_ENV !== "production" && "CompositeHover must be wrapped in a Composite component.");
|
|
1407
|
+
let a = lt(), o = r.onMouseMove, s = K(t), c = W((t) => {
|
|
1408
|
+
if (o?.(t), !t.defaultPrevented && a() && s(t)) {
|
|
1409
|
+
if (!tr(t.currentTarget)) {
|
|
1410
|
+
let t = e?.getState().baseElement;
|
|
1411
|
+
t && !er(t) && t.focus();
|
|
1412
|
+
}
|
|
1413
|
+
e?.setActiveId(t.currentTarget.id);
|
|
1414
|
+
}
|
|
1415
|
+
}), l = r.onMouseLeave, u = K(n), d = W((t) => {
|
|
1416
|
+
var n;
|
|
1417
|
+
l?.(t), !t.defaultPrevented && a() && (Kr(t) || Jr(t) || s(t) && u(t) && (e?.setActiveId(null), (n = e?.getState().baseElement) == null || n.focus()));
|
|
1418
|
+
}), f = m((e) => {
|
|
1419
|
+
e && (e[qr] = !0);
|
|
1420
|
+
}, []);
|
|
1421
|
+
return r = {
|
|
1422
|
+
...r,
|
|
1423
|
+
ref: G(f, r.ref),
|
|
1424
|
+
onMouseMove: c,
|
|
1425
|
+
onMouseLeave: d
|
|
1426
|
+
}, R(r);
|
|
1427
|
+
});
|
|
1428
|
+
gt(J(function(e) {
|
|
1429
|
+
return Y(Wr, Yr(e));
|
|
1430
|
+
}));
|
|
1431
|
+
var Xr = "div", Zr = X(function({ store: e, shouldRegisterItem: t = !0, getItem: n = de, element: r, ...i }) {
|
|
1432
|
+
let a = Pt();
|
|
1433
|
+
e ||= a;
|
|
1434
|
+
let o = tt(i.id), s = b(r);
|
|
1435
|
+
return g(() => {
|
|
1436
|
+
let r = s.current;
|
|
1437
|
+
if (!o || !r || !t) return;
|
|
1438
|
+
let i = n({
|
|
1439
|
+
id: o,
|
|
1440
|
+
element: r
|
|
1441
|
+
});
|
|
1442
|
+
return e?.renderItem(i);
|
|
1443
|
+
}, [
|
|
1444
|
+
o,
|
|
1445
|
+
t,
|
|
1446
|
+
n,
|
|
1447
|
+
e
|
|
1448
|
+
]), i = {
|
|
1449
|
+
...i,
|
|
1450
|
+
ref: G(s, i.ref)
|
|
1451
|
+
}, R(i);
|
|
1452
|
+
});
|
|
1453
|
+
J(function(e) {
|
|
1454
|
+
return Y(Xr, Zr(e));
|
|
1455
|
+
});
|
|
1456
|
+
var Qr = "button";
|
|
1457
|
+
function $r(e) {
|
|
1458
|
+
return De(e) ? !0 : e.tagName === "INPUT" && !Ce(e);
|
|
1459
|
+
}
|
|
1460
|
+
function ei(e, t = !1) {
|
|
1461
|
+
let n = e.clientHeight, { top: r } = e.getBoundingClientRect(), i = Math.max(n * .875, n - 40) * 1.5, a = t ? n - i + r : i + r;
|
|
1462
|
+
return e.tagName === "HTML" ? a + e.scrollTop : a;
|
|
1463
|
+
}
|
|
1464
|
+
function ti(e, t = !1) {
|
|
1465
|
+
let { top: n } = e.getBoundingClientRect();
|
|
1466
|
+
return t ? n + e.clientHeight : n;
|
|
1467
|
+
}
|
|
1468
|
+
function ni(e, t, n, r = !1) {
|
|
1469
|
+
if (!t || !n) return;
|
|
1470
|
+
let { renderedItems: i } = t.getState(), a = Me(e);
|
|
1471
|
+
if (!a) return;
|
|
1472
|
+
let o = ei(a, r), s, c;
|
|
1473
|
+
for (let e = 0; e < i.length; e += 1) {
|
|
1474
|
+
let i = s;
|
|
1475
|
+
if (s = n(e), !s) break;
|
|
1476
|
+
if (s === i) continue;
|
|
1477
|
+
let a = wn(t, s)?.element;
|
|
1478
|
+
if (!a) continue;
|
|
1479
|
+
let l = ti(a, r) - o, u = Math.abs(l);
|
|
1480
|
+
if (r && l <= 0 || !r && l >= 0) {
|
|
1481
|
+
c !== void 0 && c < u && (s = i);
|
|
1482
|
+
break;
|
|
1483
|
+
}
|
|
1484
|
+
c = u;
|
|
1485
|
+
}
|
|
1486
|
+
return s;
|
|
1487
|
+
}
|
|
1488
|
+
function ri(e, t) {
|
|
1489
|
+
return H(e) ? !1 : An(t, e.target);
|
|
1490
|
+
}
|
|
1491
|
+
var ii = X(function({ store: e, rowId: t, preventScrollOnKeyDown: n = !1, moveOnKeyPress: r = !0, tabbable: i = !1, getItem: a, "aria-setsize": o, "aria-posinset": s, ...c }) {
|
|
1492
|
+
let l = Rt();
|
|
1493
|
+
e ||= l;
|
|
1494
|
+
let u = tt(c.id), d = b(null), f = h(Ut), p = pe(c) && !c.accessibleWhenDisabled, { rowId: g, baseElement: _, isActiveItem: y, ariaSetSize: x, ariaPosInSet: S, isTabbable: w } = pn(e, {
|
|
1495
|
+
rowId(e) {
|
|
1496
|
+
if (t) return t;
|
|
1497
|
+
if (e && f?.baseElement && f.baseElement === e.baseElement) return f.id;
|
|
1498
|
+
},
|
|
1499
|
+
baseElement(e) {
|
|
1500
|
+
return e?.baseElement || void 0;
|
|
1501
|
+
},
|
|
1502
|
+
isActiveItem(e) {
|
|
1503
|
+
return !!e && e.activeId === u;
|
|
1504
|
+
},
|
|
1505
|
+
ariaSetSize(e) {
|
|
1506
|
+
if (o != null) return o;
|
|
1507
|
+
if (e && f?.ariaSetSize && f.baseElement === e.baseElement) return f.ariaSetSize;
|
|
1508
|
+
},
|
|
1509
|
+
ariaPosInSet(e) {
|
|
1510
|
+
if (s != null) return s;
|
|
1511
|
+
if (!e || !f?.ariaPosInSet || f.baseElement !== e.baseElement) return;
|
|
1512
|
+
let t = e.renderedItems.filter((e) => e.rowId === g);
|
|
1513
|
+
return f.ariaPosInSet + t.findIndex((e) => e.id === u);
|
|
1514
|
+
},
|
|
1515
|
+
isTabbable(t) {
|
|
1516
|
+
if (!t?.renderedItems.length) return !0;
|
|
1517
|
+
if (t.virtualFocus) return !1;
|
|
1518
|
+
if (i) return !0;
|
|
1519
|
+
if (t.activeId === null) return !1;
|
|
1520
|
+
let n = e?.item(t.activeId);
|
|
1521
|
+
return n?.disabled || !n?.element ? !0 : t.activeId === u;
|
|
1522
|
+
}
|
|
1523
|
+
}), T = m((e) => {
|
|
1524
|
+
let t = {
|
|
1525
|
+
...e,
|
|
1526
|
+
id: u || e.id,
|
|
1527
|
+
rowId: g,
|
|
1528
|
+
disabled: !!p,
|
|
1529
|
+
children: e.element?.textContent
|
|
1530
|
+
};
|
|
1531
|
+
return a ? a(t) : t;
|
|
1532
|
+
}, [
|
|
1533
|
+
u,
|
|
1534
|
+
g,
|
|
1535
|
+
p,
|
|
1536
|
+
a
|
|
1537
|
+
]), E = c.onFocus, D = b(!1), O = W((t) => {
|
|
1538
|
+
if (E?.(t), t.defaultPrevented || Be(t) || !u || !e || ri(t, e)) return;
|
|
1539
|
+
let { virtualFocus: n, baseElement: r } = e.getState();
|
|
1540
|
+
e.setActiveId(u), De(t.currentTarget) && En(t.currentTarget), n && H(t) && ($r(t.currentTarget) || r?.isConnected && (Le() && t.currentTarget.hasAttribute("data-autofocus") && t.currentTarget.scrollIntoView({
|
|
1541
|
+
block: "nearest",
|
|
1542
|
+
inline: "nearest"
|
|
1543
|
+
}), D.current = !0, t.relatedTarget === r || An(e, t.relatedTarget) ? On(r) : r.focus()));
|
|
1544
|
+
}), k = c.onBlurCapture, A = W((t) => {
|
|
1545
|
+
k?.(t), !t.defaultPrevented && e?.getState()?.virtualFocus && D.current && (D.current = !1, t.preventDefault(), t.stopPropagation());
|
|
1546
|
+
}), j = c.onKeyDown, M = K(n), N = K(r), P = W((t) => {
|
|
1547
|
+
if (j?.(t), t.defaultPrevented || !H(t) || !e) return;
|
|
1548
|
+
let { currentTarget: n } = t, r = e.getState(), i = !!e.item(u)?.rowId, a = r.orientation !== "horizontal", o = r.orientation !== "vertical", s = () => !!(i || o || !r.baseElement || !Ee(r.baseElement)), c = {
|
|
1549
|
+
ArrowUp: (i || a) && e.up,
|
|
1550
|
+
ArrowRight: (i || o) && e.next,
|
|
1551
|
+
ArrowDown: (i || a) && e.down,
|
|
1552
|
+
ArrowLeft: (i || o) && e.previous,
|
|
1553
|
+
Home: () => {
|
|
1554
|
+
if (s()) return !i || t.ctrlKey ? e?.first() : e?.previous(-1);
|
|
1555
|
+
},
|
|
1556
|
+
End: () => {
|
|
1557
|
+
if (s()) return !i || t.ctrlKey ? e?.last() : e?.next(-1);
|
|
1558
|
+
},
|
|
1559
|
+
PageUp: () => ni(n, e, e?.up, !0),
|
|
1560
|
+
PageDown: () => ni(n, e, e?.down)
|
|
1561
|
+
}[t.key];
|
|
1562
|
+
if (c) {
|
|
1563
|
+
if (De(n)) {
|
|
1564
|
+
let e = ke(n), r = o && t.key === "ArrowLeft", i = o && t.key === "ArrowRight", s = a && t.key === "ArrowUp", c = a && t.key === "ArrowDown";
|
|
1565
|
+
if (i || c) {
|
|
1566
|
+
let { length: t } = Oe(n);
|
|
1567
|
+
if (e.end !== t) return;
|
|
1568
|
+
} else if ((r || s) && e.start !== 0) return;
|
|
1569
|
+
}
|
|
1570
|
+
let r = c();
|
|
1571
|
+
if (M(t) || r !== void 0) {
|
|
1572
|
+
if (!N(t)) return;
|
|
1573
|
+
t.preventDefault(), e.move(r);
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
}), F = v(() => ({
|
|
1577
|
+
id: u,
|
|
1578
|
+
baseElement: _
|
|
1579
|
+
}), [u, _]);
|
|
1580
|
+
return c = q(c, (e) => /* @__PURE__ */ C(Ht.Provider, {
|
|
1581
|
+
value: F,
|
|
1582
|
+
children: e
|
|
1583
|
+
}), [F]), c = {
|
|
1584
|
+
"data-active-item": y || void 0,
|
|
1585
|
+
...c,
|
|
1586
|
+
id: u,
|
|
1587
|
+
ref: G(d, c.ref),
|
|
1588
|
+
tabIndex: w ? c.tabIndex : -1,
|
|
1589
|
+
onFocus: O,
|
|
1590
|
+
onBlurCapture: A,
|
|
1591
|
+
onKeyDown: P
|
|
1592
|
+
}, c = Tr(c), c = Zr({
|
|
1593
|
+
store: e,
|
|
1594
|
+
...c,
|
|
1595
|
+
getItem: T,
|
|
1596
|
+
shouldRegisterItem: u ? c.shouldRegisterItem : !1
|
|
1597
|
+
}), R({
|
|
1598
|
+
...c,
|
|
1599
|
+
"aria-setsize": x,
|
|
1600
|
+
"aria-posinset": S
|
|
1601
|
+
});
|
|
1602
|
+
});
|
|
1603
|
+
gt(J(function(e) {
|
|
1604
|
+
return Y(Qr, ii(e));
|
|
1605
|
+
}));
|
|
1606
|
+
var ai = "div";
|
|
1607
|
+
function oi(e, t) {
|
|
1608
|
+
if (t != null) return e == null ? !1 : Array.isArray(e) ? e.includes(t) : e === t;
|
|
1609
|
+
}
|
|
1610
|
+
var si = X(function({ store: e, value: t, getItem: n, hideOnClick: r, setValueOnClick: i = t != null, preventScrollOnKeyDown: a = !0, focusOnHover: o = !0, ...s }) {
|
|
1611
|
+
let c = Kt();
|
|
1612
|
+
e ||= c, L(e, process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component.");
|
|
1613
|
+
let l = tt(s.id), u = pe(s), { listElement: d, multiSelectable: f, selected: p, autoFocus: h } = pn(e, {
|
|
1614
|
+
listElement: "listElement",
|
|
1615
|
+
multiSelectable(e) {
|
|
1616
|
+
return Array.isArray(e.value);
|
|
1617
|
+
},
|
|
1618
|
+
selected(e) {
|
|
1619
|
+
return oi(e.value, t);
|
|
1620
|
+
},
|
|
1621
|
+
autoFocus(n) {
|
|
1622
|
+
return t == null || n.value == null || n.activeId !== l && e?.item(n.activeId) ? !1 : Array.isArray(n.value) ? n.value[n.value.length - 1] === t : n.value === t;
|
|
1623
|
+
}
|
|
1624
|
+
}), g = Z(e?.combobox, "virtualFocus"), _ = m((e) => {
|
|
1625
|
+
let r = {
|
|
1626
|
+
...e,
|
|
1627
|
+
value: u ? void 0 : t
|
|
1628
|
+
};
|
|
1629
|
+
return n ? n(r) : r;
|
|
1630
|
+
}, [
|
|
1631
|
+
u,
|
|
1632
|
+
t,
|
|
1633
|
+
n
|
|
1634
|
+
]);
|
|
1635
|
+
r ??= t != null && !f;
|
|
1636
|
+
let v = s.onClick, y = K(i), b = K(r), x = W((n) => {
|
|
1637
|
+
v?.(n), !n.defaultPrevented && (He(n) || Ve(n) || (y(n) && t != null && e?.setValue((e) => Array.isArray(e) ? e.includes(t) ? e.filter((e) => e !== t) : [...e, t] : t), b(n) && e?.hide()));
|
|
1638
|
+
});
|
|
1639
|
+
s = q(s, (e) => /* @__PURE__ */ C(Xt.Provider, {
|
|
1640
|
+
value: p ?? !1,
|
|
1641
|
+
children: e
|
|
1642
|
+
}), [p]);
|
|
1643
|
+
let S = s.autoFocus ?? h;
|
|
1644
|
+
s = {
|
|
1645
|
+
role: je(d),
|
|
1646
|
+
"aria-selected": p,
|
|
1647
|
+
children: t,
|
|
1648
|
+
...s,
|
|
1649
|
+
id: l,
|
|
1650
|
+
autoFocus: g === !1 ? !1 : S,
|
|
1651
|
+
"data-autofocus": S || void 0,
|
|
1652
|
+
onClick: x
|
|
1653
|
+
}, s = ii({
|
|
1654
|
+
store: e,
|
|
1655
|
+
getItem: _,
|
|
1656
|
+
preventScrollOnKeyDown: a,
|
|
1657
|
+
...s
|
|
1658
|
+
});
|
|
1659
|
+
let w = K(o);
|
|
1660
|
+
return s = Yr({
|
|
1661
|
+
store: e,
|
|
1662
|
+
...s,
|
|
1663
|
+
focusOnHover(t) {
|
|
1664
|
+
return w(t) ? !!e?.getState()?.open : !1;
|
|
1665
|
+
}
|
|
1666
|
+
}), s;
|
|
1667
|
+
}), ci = gt(J(function(e) {
|
|
1668
|
+
return Y(ai, si(e));
|
|
1669
|
+
})), li = "div";
|
|
1670
|
+
function ui(e, t) {
|
|
1671
|
+
let n = setTimeout(t, e);
|
|
1672
|
+
return () => clearTimeout(n);
|
|
1673
|
+
}
|
|
1674
|
+
function di(e) {
|
|
1675
|
+
let t = requestAnimationFrame(() => {
|
|
1676
|
+
t = requestAnimationFrame(e);
|
|
1677
|
+
});
|
|
1678
|
+
return () => cancelAnimationFrame(t);
|
|
1679
|
+
}
|
|
1680
|
+
function fi(...e) {
|
|
1681
|
+
return e.join(", ").split(", ").reduce((e, t) => {
|
|
1682
|
+
let n = t.endsWith("ms") ? 1 : 1e3, r = Number.parseFloat(t || "0s") * n;
|
|
1683
|
+
return r > e ? r : e;
|
|
1684
|
+
}, 0);
|
|
1685
|
+
}
|
|
1686
|
+
function pi(e, t, n) {
|
|
1687
|
+
return !n && t !== !1 && (!e || !!t);
|
|
1688
|
+
}
|
|
1689
|
+
var mi = X(function({ store: e, alwaysVisible: t, ...n }) {
|
|
1690
|
+
let r = yt();
|
|
1691
|
+
e ||= r, L(e, process.env.NODE_ENV !== "production" && "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component.");
|
|
1692
|
+
let i = b(null), a = tt(n.id), [o, s] = x(null), c = Z(e, "open"), l = Z(e, "mounted"), u = Z(e, "animated"), d = Z(e, "contentElement"), f = Z(e.disclosure, "contentElement");
|
|
1693
|
+
U(() => {
|
|
1694
|
+
i.current && e?.setContentElement(i.current);
|
|
1695
|
+
}, [e]), U(() => {
|
|
1696
|
+
let t;
|
|
1697
|
+
return e?.setState("animated", (e) => (t = e, !0)), () => {
|
|
1698
|
+
t !== void 0 && e?.setState("animated", t);
|
|
1699
|
+
};
|
|
1700
|
+
}, [e]), U(() => {
|
|
1701
|
+
if (u) {
|
|
1702
|
+
if (!d?.isConnected) {
|
|
1703
|
+
s(null);
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
return di(() => {
|
|
1707
|
+
s(c ? "enter" : l ? "leave" : null);
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
}, [
|
|
1711
|
+
u,
|
|
1712
|
+
d,
|
|
1713
|
+
c,
|
|
1714
|
+
l
|
|
1715
|
+
]), U(() => {
|
|
1716
|
+
if (!e || !u || !o || !d) return;
|
|
1717
|
+
let t = () => e?.setState("animating", !1), n = () => E(t);
|
|
1718
|
+
if (o === "leave" && c || o === "enter" && !c) return;
|
|
1719
|
+
if (typeof u == "number") return ui(u, n);
|
|
1720
|
+
let { transitionDuration: r, animationDuration: i, transitionDelay: a, animationDelay: s } = getComputedStyle(d), { transitionDuration: l = "0", animationDuration: p = "0", transitionDelay: m = "0", animationDelay: h = "0" } = f ? getComputedStyle(f) : {}, g = fi(a, s, m, h) + fi(r, i, l, p);
|
|
1721
|
+
if (!g) {
|
|
1722
|
+
o === "enter" && e.setState("animated", !1), t();
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
return ui(Math.max(g - 1e3 / 60, 0), n);
|
|
1726
|
+
}, [
|
|
1727
|
+
e,
|
|
1728
|
+
u,
|
|
1729
|
+
d,
|
|
1730
|
+
f,
|
|
1731
|
+
c,
|
|
1732
|
+
o
|
|
1733
|
+
]), n = q(n, (t) => /* @__PURE__ */ C(Tt, {
|
|
1734
|
+
value: e,
|
|
1735
|
+
children: t
|
|
1736
|
+
}), [e]);
|
|
1737
|
+
let p = pi(l, n.hidden, t), m = n.style, h = v(() => p ? {
|
|
1738
|
+
...m,
|
|
1739
|
+
display: "none"
|
|
1740
|
+
} : m, [p, m]);
|
|
1741
|
+
return n = {
|
|
1742
|
+
"data-open": c || void 0,
|
|
1743
|
+
"data-enter": o === "enter" || void 0,
|
|
1744
|
+
"data-leave": o === "leave" || void 0,
|
|
1745
|
+
hidden: p,
|
|
1746
|
+
...n,
|
|
1747
|
+
id: a,
|
|
1748
|
+
ref: G(a ? e.setContentElement : null, i, n.ref),
|
|
1749
|
+
style: h
|
|
1750
|
+
}, R(n);
|
|
1751
|
+
}), hi = J(function(e) {
|
|
1752
|
+
return Y(li, mi(e));
|
|
1753
|
+
});
|
|
1754
|
+
J(function({ unmountOnHide: e, ...t }) {
|
|
1755
|
+
let n = yt();
|
|
1756
|
+
return Z(t.store || n, (t) => !e || t?.mounted) === !1 ? null : /* @__PURE__ */ C(hi, { ...t });
|
|
1757
|
+
});
|
|
1758
|
+
var gi = "div";
|
|
1759
|
+
function _i(e) {
|
|
1760
|
+
return e.some((e) => !!e.rowId);
|
|
1761
|
+
}
|
|
1762
|
+
function vi(e) {
|
|
1763
|
+
let t = e.target;
|
|
1764
|
+
return t && !Ee(t) ? !1 : e.key.length === 1 && !e.ctrlKey && !e.metaKey;
|
|
1765
|
+
}
|
|
1766
|
+
function yi(e) {
|
|
1767
|
+
return e.key === "Shift" || e.key === "Control" || e.key === "Alt" || e.key === "Meta";
|
|
1768
|
+
}
|
|
1769
|
+
function bi(e, t, n) {
|
|
1770
|
+
return W((r) => {
|
|
1771
|
+
if (t?.(r), r.defaultPrevented || r.isPropagationStopped() || !H(r) || yi(r) || vi(r)) return;
|
|
1772
|
+
let i = wn(e, e.getState().activeId)?.element;
|
|
1773
|
+
if (!i) return;
|
|
1774
|
+
let { view: a, ...o } = r;
|
|
1775
|
+
i !== n?.current && i.focus(), We(i, r.type, o) || r.preventDefault(), r.currentTarget.contains(i) && r.stopPropagation();
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
function xi(e) {
|
|
1779
|
+
return Cn(Ir(Lr(Tn(e))));
|
|
1780
|
+
}
|
|
1781
|
+
function Si(e, t) {
|
|
1782
|
+
let { virtualFocus: n, baseElement: r } = e.getState();
|
|
1783
|
+
if (!n || !r || !Ee(r)) {
|
|
1784
|
+
t();
|
|
1785
|
+
return;
|
|
1786
|
+
}
|
|
1787
|
+
let i = r.scrollLeft, a = r.scrollTop;
|
|
1788
|
+
t(), r.scrollLeft = i, r.scrollTop = a;
|
|
1789
|
+
}
|
|
1790
|
+
function Ci(e) {
|
|
1791
|
+
let [t, n] = x(!1), r = m(() => n(!0), []), i = Z(e, (t) => wn(e, t.activeId));
|
|
1792
|
+
return g(() => {
|
|
1793
|
+
let r = i?.element;
|
|
1794
|
+
t && r && (n(!1), Si(e, () => {
|
|
1795
|
+
r.focus({ preventScroll: !0 });
|
|
1796
|
+
}));
|
|
1797
|
+
}, [
|
|
1798
|
+
e,
|
|
1799
|
+
i,
|
|
1800
|
+
t
|
|
1801
|
+
]), r;
|
|
1802
|
+
}
|
|
1803
|
+
var wi = X(function({ store: e, composite: t = !0, focusOnMove: n = t, moveOnKeyPress: r = !0, ...i }) {
|
|
1804
|
+
let a = zt();
|
|
1805
|
+
e ||= a, L(e, process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component.");
|
|
1806
|
+
let o = b(null), s = b(null), c = Ci(e), l = Z(e, "moves"), [, u] = et(t ? e.setBaseElement : null);
|
|
1807
|
+
g(() => {
|
|
1808
|
+
if (!e || !l || !t || !n) return;
|
|
1809
|
+
let { activeId: r } = e.getState(), i = wn(e, r)?.element;
|
|
1810
|
+
i && Si(e, () => ar(i));
|
|
1811
|
+
}, [
|
|
1812
|
+
e,
|
|
1813
|
+
l,
|
|
1814
|
+
t,
|
|
1815
|
+
n
|
|
1816
|
+
]), U(() => {
|
|
1817
|
+
if (!e || !l || !t) return;
|
|
1818
|
+
let { baseElement: n, activeId: r } = e.getState();
|
|
1819
|
+
if (r !== null || !n) return;
|
|
1820
|
+
let i = s.current;
|
|
1821
|
+
s.current = null, i && Ue(i, { relatedTarget: n }), er(n) || n.focus();
|
|
1822
|
+
}, [
|
|
1823
|
+
e,
|
|
1824
|
+
l,
|
|
1825
|
+
t
|
|
1826
|
+
]);
|
|
1827
|
+
let d = Z(e, "activeId"), f = Z(e, "virtualFocus");
|
|
1828
|
+
U(() => {
|
|
1829
|
+
if (!e || !t || !f) return;
|
|
1830
|
+
let n = s.current;
|
|
1831
|
+
if (s.current = null, !n) return;
|
|
1832
|
+
let r = wn(e, d)?.element || xe(n);
|
|
1833
|
+
r !== n && Ue(n, { relatedTarget: r });
|
|
1834
|
+
}, [
|
|
1835
|
+
e,
|
|
1836
|
+
d,
|
|
1837
|
+
f,
|
|
1838
|
+
t
|
|
1839
|
+
]);
|
|
1840
|
+
let p = bi(e, i.onKeyDownCapture, s), m = bi(e, i.onKeyUpCapture, s), h = i.onFocusCapture, _ = W((t) => {
|
|
1841
|
+
if (h?.(t), t.defaultPrevented || !e) return;
|
|
1842
|
+
let { virtualFocus: n } = e.getState();
|
|
1843
|
+
if (!n) return;
|
|
1844
|
+
let r = t.relatedTarget, i = kn(t.currentTarget);
|
|
1845
|
+
H(t) && i && (t.stopPropagation(), s.current = r);
|
|
1846
|
+
}), v = i.onFocus, y = W((n) => {
|
|
1847
|
+
if (v?.(n), n.defaultPrevented || !t || !e) return;
|
|
1848
|
+
let { relatedTarget: r } = n, { virtualFocus: i } = e.getState();
|
|
1849
|
+
i ? H(n) && !An(e, r) && queueMicrotask(c) : H(n) && e.setActiveId(null);
|
|
1850
|
+
}), x = i.onBlurCapture, S = W((t) => {
|
|
1851
|
+
if (x?.(t), t.defaultPrevented || !e) return;
|
|
1852
|
+
let { virtualFocus: n, activeId: r } = e.getState();
|
|
1853
|
+
if (!n) return;
|
|
1854
|
+
let i = wn(e, r)?.element, a = t.relatedTarget, o = An(e, a), c = s.current;
|
|
1855
|
+
s.current = null, H(t) && o ? (a === i ? c && c !== a && Ue(c, t) : i ? Ue(i, t) : c && Ue(c, t), t.stopPropagation()) : !An(e, t.target) && i && Ue(i, t);
|
|
1856
|
+
}), w = i.onKeyDown, T = K(r), E = W((t) => {
|
|
1857
|
+
if (w?.(t), t.nativeEvent.isComposing || t.defaultPrevented || !e || !H(t)) return;
|
|
1858
|
+
let { orientation: n, renderedItems: r, activeId: i } = e.getState();
|
|
1859
|
+
if (wn(e, i)?.element?.isConnected) return;
|
|
1860
|
+
let a = n !== "horizontal", o = n !== "vertical", s = _i(r);
|
|
1861
|
+
if ((t.key === "ArrowLeft" || t.key === "ArrowRight" || t.key === "Home" || t.key === "End") && Ee(t.currentTarget)) return;
|
|
1862
|
+
let c = {
|
|
1863
|
+
ArrowUp: (s || a) && (() => s ? xi(r)?.id : e?.last()),
|
|
1864
|
+
ArrowRight: (s || o) && e.first,
|
|
1865
|
+
ArrowDown: (s || a) && e.first,
|
|
1866
|
+
ArrowLeft: (s || o) && e.last,
|
|
1867
|
+
Home: e.first,
|
|
1868
|
+
End: e.last,
|
|
1869
|
+
PageUp: e.first,
|
|
1870
|
+
PageDown: e.last
|
|
1871
|
+
}[t.key];
|
|
1872
|
+
if (c) {
|
|
1873
|
+
let n = c();
|
|
1874
|
+
if (n !== void 0) {
|
|
1875
|
+
if (!T(t)) return;
|
|
1876
|
+
t.preventDefault(), e.move(n);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
});
|
|
1880
|
+
return i = q(i, (t) => /* @__PURE__ */ C(Bt, {
|
|
1881
|
+
value: e,
|
|
1882
|
+
children: t
|
|
1883
|
+
}), [e]), i = {
|
|
1884
|
+
"aria-activedescendant": Z(e, (n) => {
|
|
1885
|
+
if (e && t && n.virtualFocus) return wn(e, n.activeId)?.id;
|
|
1886
|
+
}),
|
|
1887
|
+
...i,
|
|
1888
|
+
ref: G(o, u, i.ref),
|
|
1889
|
+
onKeyDownCapture: p,
|
|
1890
|
+
onKeyUpCapture: m,
|
|
1891
|
+
onFocusCapture: _,
|
|
1892
|
+
onFocus: y,
|
|
1893
|
+
onBlurCapture: S,
|
|
1894
|
+
onKeyDown: E
|
|
1895
|
+
}, i = xr({
|
|
1896
|
+
focusable: Z(e, (e) => t && (e.virtualFocus || e.activeId === null)),
|
|
1897
|
+
...i
|
|
1898
|
+
}), i;
|
|
1899
|
+
});
|
|
1900
|
+
J(function(e) {
|
|
1901
|
+
return Y(gi, wi(e));
|
|
1902
|
+
});
|
|
1903
|
+
var Ti = "div", Ei = f(null), Di = X(function({ store: e, resetOnEscape: t = !0, hideOnEnter: n = !0, focusOnMove: r = !0, composite: i, alwaysVisible: a, ...o }) {
|
|
1904
|
+
let s = Gt();
|
|
1905
|
+
e ||= s, L(e, process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component.");
|
|
1906
|
+
let c = tt(o.id), l = Z(e, "value"), u = Array.isArray(l), [d, f] = x(l), p = Z(e, "mounted");
|
|
1907
|
+
g(() => {
|
|
1908
|
+
p || f(l);
|
|
1909
|
+
}, [p, l]), t &&= !u;
|
|
1910
|
+
let m = o.onKeyDown, _ = K(t), y = K(n), b = W((t) => {
|
|
1911
|
+
m?.(t), !t.defaultPrevented && (t.key === "Escape" && _(t) && e?.setValue(d), (t.key === " " || t.key === "Enter") && H(t) && y(t) && (t.preventDefault(), e?.hide()));
|
|
1912
|
+
}), S = h(Zt), w = x(), [T, E] = S || w, D = v(() => [T, E], [T, E]), [O, k] = x(null), A = h(Ei);
|
|
1913
|
+
g(() => {
|
|
1914
|
+
if (A) return A(e), () => A(null);
|
|
1915
|
+
}, [A, e]), o = q(o, (t) => /* @__PURE__ */ C(Yt, {
|
|
1916
|
+
value: e,
|
|
1917
|
+
children: /* @__PURE__ */ C(Ei.Provider, {
|
|
1918
|
+
value: k,
|
|
1919
|
+
children: /* @__PURE__ */ C(Zt.Provider, {
|
|
1920
|
+
value: D,
|
|
1921
|
+
children: t
|
|
1922
|
+
})
|
|
1923
|
+
})
|
|
1924
|
+
}), [e, D]);
|
|
1925
|
+
let j = !!e.combobox;
|
|
1926
|
+
i ??= !j && O !== e;
|
|
1927
|
+
let [M, N] = et(i ? e.setListElement : null), P = rt(M, "role", o.role), F = (i || P === "listbox" || P === "menu" || P === "tree" || P === "grid") && u || void 0, ee = pi(p, o.hidden, a), te = ee ? {
|
|
1928
|
+
...o.style,
|
|
1929
|
+
display: "none"
|
|
1930
|
+
} : o.style;
|
|
1931
|
+
i && (o = {
|
|
1932
|
+
role: "listbox",
|
|
1933
|
+
"aria-multiselectable": F,
|
|
1934
|
+
...o
|
|
1935
|
+
});
|
|
1936
|
+
let ne = Z(e, (e) => T || e.labelElement?.id);
|
|
1937
|
+
return o = {
|
|
1938
|
+
"aria-labelledby": o["aria-label"] == null ? ne : void 0,
|
|
1939
|
+
hidden: ee,
|
|
1940
|
+
...o,
|
|
1941
|
+
id: c,
|
|
1942
|
+
ref: G(N, o.ref),
|
|
1943
|
+
style: te,
|
|
1944
|
+
onKeyDown: b
|
|
1945
|
+
}, o = wi({
|
|
1946
|
+
store: e,
|
|
1947
|
+
...o,
|
|
1948
|
+
composite: i
|
|
1949
|
+
}), o = zn({
|
|
1950
|
+
store: e,
|
|
1951
|
+
typeahead: !j,
|
|
1952
|
+
...o
|
|
1953
|
+
}), o;
|
|
1954
|
+
}), Oi = J(function(e) {
|
|
1955
|
+
return Y(Ti, Di(e));
|
|
1956
|
+
}), ki = f(null), Ai = "span", ji = X(function(e) {
|
|
1957
|
+
return e = {
|
|
1958
|
+
...e,
|
|
1959
|
+
style: {
|
|
1960
|
+
border: 0,
|
|
1961
|
+
clip: "rect(0 0 0 0)",
|
|
1962
|
+
height: "1px",
|
|
1963
|
+
margin: "-1px",
|
|
1964
|
+
overflow: "hidden",
|
|
1965
|
+
padding: 0,
|
|
1966
|
+
position: "absolute",
|
|
1967
|
+
whiteSpace: "nowrap",
|
|
1968
|
+
width: "1px",
|
|
1969
|
+
...e.style
|
|
1970
|
+
}
|
|
1971
|
+
}, e;
|
|
1972
|
+
});
|
|
1973
|
+
J(function(e) {
|
|
1974
|
+
return Y(Ai, ji(e));
|
|
1975
|
+
});
|
|
1976
|
+
var Mi = "span", Ni = X(function(e) {
|
|
1977
|
+
return e = {
|
|
1978
|
+
"data-focus-trap": "",
|
|
1979
|
+
tabIndex: 0,
|
|
1980
|
+
"aria-hidden": !0,
|
|
1981
|
+
...e,
|
|
1982
|
+
style: {
|
|
1983
|
+
position: "fixed",
|
|
1984
|
+
top: 0,
|
|
1985
|
+
left: 0,
|
|
1986
|
+
...e.style
|
|
1987
|
+
}
|
|
1988
|
+
}, e = ji(e), e;
|
|
1989
|
+
}), Pi = J(function(e) {
|
|
1990
|
+
return Y(Mi, Ni(e));
|
|
1991
|
+
}), Fi = "div";
|
|
1992
|
+
function Ii(e) {
|
|
1993
|
+
return B(e).body;
|
|
1994
|
+
}
|
|
1995
|
+
function Li(e, t) {
|
|
1996
|
+
return t ? typeof t == "function" ? t(e) : t : B(e).createElement("div");
|
|
1997
|
+
}
|
|
1998
|
+
function Ri(e = "id") {
|
|
1999
|
+
return `${e ? `${e}-` : ""}${Math.random().toString(36).slice(2, 8)}`;
|
|
2000
|
+
}
|
|
2001
|
+
function zi(e) {
|
|
2002
|
+
queueMicrotask(() => {
|
|
2003
|
+
e?.focus();
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
var Bi = X(function({ preserveTabOrder: e, preserveTabOrderAnchor: t, portalElement: n, portalRef: r, portal: i = !0, ...a }) {
|
|
2007
|
+
let o = b(null), s = G(o, a.ref), c = h(ki), [l, u] = x(null), [d, f] = x(null), p = b(null), m = b(null), _ = b(null), v = b(null);
|
|
2008
|
+
return U(() => {
|
|
2009
|
+
let e = o.current;
|
|
2010
|
+
if (!e || !i) {
|
|
2011
|
+
u(null);
|
|
2012
|
+
return;
|
|
2013
|
+
}
|
|
2014
|
+
let t = Li(e, n);
|
|
2015
|
+
if (!t) {
|
|
2016
|
+
u(null);
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
let a = t.isConnected;
|
|
2020
|
+
if (a || (c || Ii(e)).appendChild(t), t.id ||= e.id ? `portal/${e.id}` : Ri(), u(t), me(r, t), !a) return () => {
|
|
2021
|
+
t.remove(), me(r, null);
|
|
2022
|
+
};
|
|
2023
|
+
}, [
|
|
2024
|
+
i,
|
|
2025
|
+
n,
|
|
2026
|
+
c,
|
|
2027
|
+
r
|
|
2028
|
+
]), U(() => {
|
|
2029
|
+
if (!i || !e || !t) return;
|
|
2030
|
+
let n = B(t).createElement("span");
|
|
2031
|
+
return n.style.position = "fixed", t.insertAdjacentElement("afterend", n), f(n), () => {
|
|
2032
|
+
n.remove(), f(null);
|
|
2033
|
+
};
|
|
2034
|
+
}, [
|
|
2035
|
+
i,
|
|
2036
|
+
e,
|
|
2037
|
+
t
|
|
2038
|
+
]), g(() => {
|
|
2039
|
+
if (!l || !e) return;
|
|
2040
|
+
let t = 0, n = (e) => {
|
|
2041
|
+
if (!Ke(e)) return;
|
|
2042
|
+
let n = e.type === "focusin";
|
|
2043
|
+
if (cancelAnimationFrame(t), n) return ir(l);
|
|
2044
|
+
t = requestAnimationFrame(() => {
|
|
2045
|
+
rr(l, !0);
|
|
2046
|
+
});
|
|
2047
|
+
};
|
|
2048
|
+
return l.addEventListener("focusin", n, !0), l.addEventListener("focusout", n, !0), () => {
|
|
2049
|
+
cancelAnimationFrame(t), l.removeEventListener("focusin", n, !0), l.removeEventListener("focusout", n, !0);
|
|
2050
|
+
};
|
|
2051
|
+
}, [l, e]), a = q(a, (t) => {
|
|
2052
|
+
if (t = /* @__PURE__ */ C(ki.Provider, {
|
|
2053
|
+
value: l || c,
|
|
2054
|
+
children: t
|
|
2055
|
+
}), !i) return t;
|
|
2056
|
+
if (!l) return /* @__PURE__ */ C("span", {
|
|
2057
|
+
ref: s,
|
|
2058
|
+
id: a.id,
|
|
2059
|
+
style: { position: "fixed" },
|
|
2060
|
+
hidden: !0
|
|
2061
|
+
});
|
|
2062
|
+
t = /* @__PURE__ */ w(S, { children: [
|
|
2063
|
+
e && l && /* @__PURE__ */ C(Pi, {
|
|
2064
|
+
ref: m,
|
|
2065
|
+
"data-focus-trap": a.id,
|
|
2066
|
+
className: "__focus-trap-inner-before",
|
|
2067
|
+
onFocus: (e) => {
|
|
2068
|
+
Ke(e, l) ? zi(Zn()) : zi(p.current);
|
|
2069
|
+
}
|
|
2070
|
+
}),
|
|
2071
|
+
t,
|
|
2072
|
+
e && l && /* @__PURE__ */ C(Pi, {
|
|
2073
|
+
ref: _,
|
|
2074
|
+
"data-focus-trap": a.id,
|
|
2075
|
+
className: "__focus-trap-inner-after",
|
|
2076
|
+
onFocus: (e) => {
|
|
2077
|
+
Ke(e, l) ? zi($n()) : zi(v.current);
|
|
2078
|
+
}
|
|
2079
|
+
})
|
|
2080
|
+
] }), l && (t = T(t, l));
|
|
2081
|
+
let n = /* @__PURE__ */ w(S, { children: [
|
|
2082
|
+
e && l && /* @__PURE__ */ C(Pi, {
|
|
2083
|
+
ref: p,
|
|
2084
|
+
"data-focus-trap": a.id,
|
|
2085
|
+
className: "__focus-trap-outer-before",
|
|
2086
|
+
onFocus: (e) => {
|
|
2087
|
+
e.relatedTarget !== v.current && Ke(e, l) ? zi(m.current) : zi($n());
|
|
2088
|
+
}
|
|
2089
|
+
}),
|
|
2090
|
+
e && /* @__PURE__ */ C("span", {
|
|
2091
|
+
"aria-owns": l?.id,
|
|
2092
|
+
style: { position: "fixed" }
|
|
2093
|
+
}),
|
|
2094
|
+
e && l && /* @__PURE__ */ C(Pi, {
|
|
2095
|
+
ref: v,
|
|
2096
|
+
"data-focus-trap": a.id,
|
|
2097
|
+
className: "__focus-trap-outer-after",
|
|
2098
|
+
onFocus: (e) => {
|
|
2099
|
+
if (Ke(e, l)) zi(_.current);
|
|
2100
|
+
else {
|
|
2101
|
+
let e = Zn();
|
|
2102
|
+
if (e === m.current) {
|
|
2103
|
+
requestAnimationFrame(() => Zn()?.focus());
|
|
2104
|
+
return;
|
|
2105
|
+
}
|
|
2106
|
+
zi(e);
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
})
|
|
2110
|
+
] });
|
|
2111
|
+
return d && e && (n = T(n, d)), /* @__PURE__ */ w(S, { children: [n, t] });
|
|
2112
|
+
}, [
|
|
2113
|
+
l,
|
|
2114
|
+
c,
|
|
2115
|
+
i,
|
|
2116
|
+
a.id,
|
|
2117
|
+
e,
|
|
2118
|
+
d
|
|
2119
|
+
]), a = {
|
|
2120
|
+
...a,
|
|
2121
|
+
ref: s
|
|
2122
|
+
}, a;
|
|
2123
|
+
});
|
|
2124
|
+
J(function(e) {
|
|
2125
|
+
return Y(Fi, Bi(e));
|
|
2126
|
+
});
|
|
2127
|
+
function Vi({ level: e, children: t }) {
|
|
2128
|
+
let n = h(Ur), r = Math.max(Math.min(e || n + 1, 6), 1);
|
|
2129
|
+
return /* @__PURE__ */ C(Ur.Provider, {
|
|
2130
|
+
value: r,
|
|
2131
|
+
children: t
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
var Hi = "div", Ui = X(function({ autoFocusOnShow: e = !0, ...t }) {
|
|
2135
|
+
return t = q(t, (t) => /* @__PURE__ */ C(Hn.Provider, {
|
|
2136
|
+
value: e,
|
|
2137
|
+
children: t
|
|
2138
|
+
}), [e]), t;
|
|
2139
|
+
});
|
|
2140
|
+
J(function(e) {
|
|
2141
|
+
return Y(Hi, Ui(e));
|
|
2142
|
+
});
|
|
2143
|
+
function Wi(e, t) {
|
|
2144
|
+
let n = B(e).createElement("button");
|
|
2145
|
+
return n.type = "button", n.tabIndex = -1, n.textContent = "Dismiss popup", Object.assign(n.style, {
|
|
2146
|
+
border: "0px",
|
|
2147
|
+
clip: "rect(0 0 0 0)",
|
|
2148
|
+
height: "1px",
|
|
2149
|
+
margin: "-1px",
|
|
2150
|
+
overflow: "hidden",
|
|
2151
|
+
padding: "0px",
|
|
2152
|
+
position: "absolute",
|
|
2153
|
+
whiteSpace: "nowrap",
|
|
2154
|
+
width: "1px"
|
|
2155
|
+
}), n.addEventListener("click", t), e.prepend(n), () => {
|
|
2156
|
+
n.removeEventListener("click", t), n.remove();
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
function Gi(e) {
|
|
2160
|
+
let t = b(null);
|
|
2161
|
+
return g(() => {
|
|
2162
|
+
if (!e) {
|
|
2163
|
+
t.current = null;
|
|
2164
|
+
return;
|
|
2165
|
+
}
|
|
2166
|
+
return Je("mousedown", (e) => {
|
|
2167
|
+
t.current = e.target;
|
|
2168
|
+
}, !0);
|
|
2169
|
+
}, [e]), t;
|
|
2170
|
+
}
|
|
2171
|
+
var Ki = /* @__PURE__ */ new WeakMap();
|
|
2172
|
+
function qi(e, t, n) {
|
|
2173
|
+
Ki.has(e) || Ki.set(e, /* @__PURE__ */ new Map());
|
|
2174
|
+
let r = Ki.get(e), i = r.get(t);
|
|
2175
|
+
if (!i) return r.set(t, n()), () => {
|
|
2176
|
+
var e;
|
|
2177
|
+
(e = r.get(t)) == null || e(), r.delete(t);
|
|
2178
|
+
};
|
|
2179
|
+
let a = n(), o = () => {
|
|
2180
|
+
a(), i(), r.delete(t);
|
|
2181
|
+
};
|
|
2182
|
+
return r.set(t, o), () => {
|
|
2183
|
+
r.get(t) === o && (a(), r.set(t, i));
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
function Ji(e, t, n) {
|
|
2187
|
+
return qi(e, t, () => {
|
|
2188
|
+
let r = e.getAttribute(t);
|
|
2189
|
+
return e.setAttribute(t, n), () => {
|
|
2190
|
+
r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
|
|
2191
|
+
};
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
function Yi(e, t, n) {
|
|
2195
|
+
return qi(e, t, () => {
|
|
2196
|
+
let r = t in e, i = e[t];
|
|
2197
|
+
return e[t] = n, () => {
|
|
2198
|
+
r ? e[t] = i : delete e[t];
|
|
2199
|
+
};
|
|
2200
|
+
});
|
|
2201
|
+
}
|
|
2202
|
+
function Xi(e, t) {
|
|
2203
|
+
return e ? qi(e, "style", () => {
|
|
2204
|
+
let n = e.style.cssText;
|
|
2205
|
+
return Object.assign(e.style, t), () => {
|
|
2206
|
+
e.style.cssText = n;
|
|
2207
|
+
};
|
|
2208
|
+
}) : () => {};
|
|
2209
|
+
}
|
|
2210
|
+
function Zi(e, t, n) {
|
|
2211
|
+
return e ? qi(e, t, () => {
|
|
2212
|
+
let r = e.style.getPropertyValue(t);
|
|
2213
|
+
return e.style.setProperty(t, n), () => {
|
|
2214
|
+
r ? e.style.setProperty(t, r) : e.style.removeProperty(t);
|
|
2215
|
+
};
|
|
2216
|
+
}) : () => {};
|
|
2217
|
+
}
|
|
2218
|
+
var Qi = ["SCRIPT", "STYLE"];
|
|
2219
|
+
function $i(e) {
|
|
2220
|
+
return `__ariakit-dialog-snapshot-${e}`;
|
|
2221
|
+
}
|
|
2222
|
+
function ea(e, t) {
|
|
2223
|
+
let n = B(t), r = $i(e);
|
|
2224
|
+
if (!n.body[r]) return !0;
|
|
2225
|
+
do {
|
|
2226
|
+
if (t === n.body) return !1;
|
|
2227
|
+
if (t[r]) return !0;
|
|
2228
|
+
if (!t.parentElement) return !1;
|
|
2229
|
+
t = t.parentElement;
|
|
2230
|
+
} while (!0);
|
|
2231
|
+
}
|
|
2232
|
+
function ta(e, t, n) {
|
|
2233
|
+
return Qi.includes(t.tagName) || !ea(e, t) ? !1 : !n.some((e) => e && V(t, e));
|
|
2234
|
+
}
|
|
2235
|
+
function na(e, t, n, r) {
|
|
2236
|
+
for (let i of t) {
|
|
2237
|
+
if (!i?.isConnected) continue;
|
|
2238
|
+
let a = t.some((e) => !e || e === i ? !1 : e.contains(i)), o = B(i), s = i;
|
|
2239
|
+
for (; i.parentElement && i !== o.body;) {
|
|
2240
|
+
if (r?.(i.parentElement, s), !a) for (let r of i.parentElement.children) ta(e, r, t) && n(r, s);
|
|
2241
|
+
i = i.parentElement;
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
function ra(e, t) {
|
|
2246
|
+
let { body: n } = B(t[0]), r = [];
|
|
2247
|
+
return na(e, t, (t) => {
|
|
2248
|
+
r.push(Yi(t, $i(e), !0));
|
|
2249
|
+
}), se(Yi(n, $i(e), !0), () => {
|
|
2250
|
+
for (let e of r) e();
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
function ia(e, ...t) {
|
|
2254
|
+
if (!e) return !1;
|
|
2255
|
+
let n = e.getAttribute("data-backdrop");
|
|
2256
|
+
return n == null ? !1 : n === "" || n === "true" || !t.length ? !0 : t.some((e) => n === e);
|
|
2257
|
+
}
|
|
2258
|
+
function aa(e = "", t = !1) {
|
|
2259
|
+
return `__ariakit-dialog-${t ? "ancestor" : "outside"}${e ? `-${e}` : ""}`;
|
|
2260
|
+
}
|
|
2261
|
+
function oa(e, t = "") {
|
|
2262
|
+
return se(Yi(e, aa(), !0), Yi(e, aa(t), !0));
|
|
2263
|
+
}
|
|
2264
|
+
function sa(e, t = "") {
|
|
2265
|
+
return se(Yi(e, aa("", !0), !0), Yi(e, aa(t, !0), !0));
|
|
2266
|
+
}
|
|
2267
|
+
function ca(e, t) {
|
|
2268
|
+
let n = aa(t, !0);
|
|
2269
|
+
if (e[n]) return !0;
|
|
2270
|
+
let r = aa(t);
|
|
2271
|
+
do {
|
|
2272
|
+
if (e[r]) return !0;
|
|
2273
|
+
if (!e.parentElement) return !1;
|
|
2274
|
+
e = e.parentElement;
|
|
2275
|
+
} while (!0);
|
|
2276
|
+
}
|
|
2277
|
+
function la(e, t) {
|
|
2278
|
+
let n = [], r = t.map((e) => e?.id);
|
|
2279
|
+
return na(e, t, (t) => {
|
|
2280
|
+
ia(t, ...r) || n.unshift(oa(t, e));
|
|
2281
|
+
}, (t, r) => {
|
|
2282
|
+
r.hasAttribute("data-dialog") && r.id !== e || n.unshift(sa(t, e));
|
|
2283
|
+
}), () => {
|
|
2284
|
+
for (let e of n) e();
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2287
|
+
function ua(e) {
|
|
2288
|
+
return e.tagName === "HTML" ? !0 : V(B(e).body, e);
|
|
2289
|
+
}
|
|
2290
|
+
function da(e, t) {
|
|
2291
|
+
if (!e) return !1;
|
|
2292
|
+
if (V(e, t)) return !0;
|
|
2293
|
+
let n = t.getAttribute("aria-activedescendant");
|
|
2294
|
+
if (n) {
|
|
2295
|
+
let t = B(e).getElementById(n);
|
|
2296
|
+
if (t) return V(e, t);
|
|
2297
|
+
}
|
|
2298
|
+
return !1;
|
|
2299
|
+
}
|
|
2300
|
+
function fa(e, t) {
|
|
2301
|
+
if (!("clientY" in e)) return !1;
|
|
2302
|
+
let n = t.getBoundingClientRect();
|
|
2303
|
+
return n.width === 0 || n.height === 0 ? !1 : n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
|
|
2304
|
+
}
|
|
2305
|
+
function pa({ store: e, type: t, listener: n, capture: r, domReady: i }) {
|
|
2306
|
+
let a = W(n), o = Z(e, "open"), s = b(!1);
|
|
2307
|
+
U(() => {
|
|
2308
|
+
if (!o || !i) return;
|
|
2309
|
+
let { contentElement: t } = e.getState();
|
|
2310
|
+
if (!t) return;
|
|
2311
|
+
let n = () => {
|
|
2312
|
+
s.current = !0;
|
|
2313
|
+
};
|
|
2314
|
+
return t.addEventListener("focusin", n, !0), () => t.removeEventListener("focusin", n, !0);
|
|
2315
|
+
}, [
|
|
2316
|
+
e,
|
|
2317
|
+
o,
|
|
2318
|
+
i
|
|
2319
|
+
]), g(() => o ? Je(t, (t) => {
|
|
2320
|
+
let { contentElement: n, disclosureElement: r } = e.getState(), i = t.target;
|
|
2321
|
+
n && i && ua(i) && (V(n, i) || da(r, i) || i.hasAttribute("data-focus-trap") || fa(t, n) || s.current && !ca(i, n.id) || a(t));
|
|
2322
|
+
}, r) : void 0, [
|
|
2323
|
+
o,
|
|
2324
|
+
r,
|
|
2325
|
+
e,
|
|
2326
|
+
t,
|
|
2327
|
+
a
|
|
2328
|
+
]);
|
|
2329
|
+
}
|
|
2330
|
+
function ma(e, t) {
|
|
2331
|
+
return typeof e == "function" ? e(t) : !!e;
|
|
2332
|
+
}
|
|
2333
|
+
function ha(e, t, n, r) {
|
|
2334
|
+
let i = Gi(Z(e, "open")), a = {
|
|
2335
|
+
store: e,
|
|
2336
|
+
domReady: n,
|
|
2337
|
+
capture: !0
|
|
2338
|
+
};
|
|
2339
|
+
pa({
|
|
2340
|
+
...a,
|
|
2341
|
+
type: "click",
|
|
2342
|
+
listener: (n) => {
|
|
2343
|
+
let { contentElement: a } = e.getState(), o = i.current;
|
|
2344
|
+
o && ca(o, a?.id) && ma(t, n) && (r && (r.current = !0), e.hide());
|
|
2345
|
+
}
|
|
2346
|
+
}), pa({
|
|
2347
|
+
...a,
|
|
2348
|
+
type: "focusin",
|
|
2349
|
+
listener: (n) => {
|
|
2350
|
+
let { contentElement: r } = e.getState();
|
|
2351
|
+
r && n.target !== B(r) && ma(t, n) && e.hide();
|
|
2352
|
+
}
|
|
2353
|
+
}), pa({
|
|
2354
|
+
...a,
|
|
2355
|
+
type: "contextmenu",
|
|
2356
|
+
listener: (n) => {
|
|
2357
|
+
ma(t, n) && (r && (r.current = !0), e.hide());
|
|
2358
|
+
}
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
var ga = f({});
|
|
2362
|
+
function _a(e) {
|
|
2363
|
+
let t = h(ga), [n, r] = x([]), i = m((e) => (r((t) => [...t, e]), se(t.add?.call(t, e), () => {
|
|
2364
|
+
r((t) => t.filter((t) => t !== e));
|
|
2365
|
+
})), [t]);
|
|
2366
|
+
U(() => rn(e, ["open", "contentElement"], (n) => {
|
|
2367
|
+
if (n.open && n.contentElement) return t.add?.call(t, e);
|
|
2368
|
+
}), [e, t]);
|
|
2369
|
+
let a = v(() => ({
|
|
2370
|
+
store: e,
|
|
2371
|
+
add: i
|
|
2372
|
+
}), [e, i]);
|
|
2373
|
+
return {
|
|
2374
|
+
wrapElement: m((e) => /* @__PURE__ */ C(ga.Provider, {
|
|
2375
|
+
value: a,
|
|
2376
|
+
children: e
|
|
2377
|
+
}), [a]),
|
|
2378
|
+
nestedDialogs: n
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
function va({ attribute: e, contentId: t, contentElement: n, enabled: r }) {
|
|
2382
|
+
let [i, a] = at(), o = m(() => {
|
|
2383
|
+
if (!r || !n) return !1;
|
|
2384
|
+
let { body: i } = B(n), a = i.getAttribute(e);
|
|
2385
|
+
return !a || a === t;
|
|
2386
|
+
}, [
|
|
2387
|
+
i,
|
|
2388
|
+
r,
|
|
2389
|
+
n,
|
|
2390
|
+
e,
|
|
2391
|
+
t
|
|
2392
|
+
]);
|
|
2393
|
+
return g(() => {
|
|
2394
|
+
if (!r || !t || !n) return;
|
|
2395
|
+
let { body: i } = B(n);
|
|
2396
|
+
if (o()) return i.setAttribute(e, t), () => i.removeAttribute(e);
|
|
2397
|
+
let s = new MutationObserver(() => E(a));
|
|
2398
|
+
return s.observe(i, { attributeFilter: [e] }), () => s.disconnect();
|
|
2399
|
+
}, [
|
|
2400
|
+
i,
|
|
2401
|
+
r,
|
|
2402
|
+
t,
|
|
2403
|
+
n,
|
|
2404
|
+
o,
|
|
2405
|
+
e
|
|
2406
|
+
]), o;
|
|
2407
|
+
}
|
|
2408
|
+
function ya(e) {
|
|
2409
|
+
let t = e.getBoundingClientRect().left;
|
|
2410
|
+
return Math.round(t) + e.scrollLeft ? "paddingLeft" : "paddingRight";
|
|
2411
|
+
}
|
|
2412
|
+
function ba(e, t, n) {
|
|
2413
|
+
let r = va({
|
|
2414
|
+
attribute: "data-dialog-prevent-body-scroll",
|
|
2415
|
+
contentElement: e,
|
|
2416
|
+
contentId: t,
|
|
2417
|
+
enabled: n
|
|
2418
|
+
});
|
|
2419
|
+
g(() => {
|
|
2420
|
+
if (!r() || !e) return;
|
|
2421
|
+
let t = B(e), n = be(e), { documentElement: i, body: a } = t, o = i.style.getPropertyValue("--scrollbar-width"), s = o ? Number.parseInt(o, 10) : n.innerWidth - i.clientWidth, c = () => Zi(i, "--scrollbar-width", `${s}px`), l = ya(i), u = () => Xi(a, {
|
|
2422
|
+
overflow: "hidden",
|
|
2423
|
+
[l]: `${s}px`
|
|
2424
|
+
}), d = () => {
|
|
2425
|
+
let { scrollX: e, scrollY: t, visualViewport: r } = n, i = r?.offsetLeft ?? 0, o = r?.offsetTop ?? 0, c = Xi(a, {
|
|
2426
|
+
position: "fixed",
|
|
2427
|
+
overflow: "hidden",
|
|
2428
|
+
top: `${-(t - Math.floor(o))}px`,
|
|
2429
|
+
left: `${-(e - Math.floor(i))}px`,
|
|
2430
|
+
right: "0",
|
|
2431
|
+
[l]: `${s}px`
|
|
2432
|
+
});
|
|
2433
|
+
return () => {
|
|
2434
|
+
c(), process.env.NODE_ENV !== "test" && n.scrollTo({
|
|
2435
|
+
left: e,
|
|
2436
|
+
top: t,
|
|
2437
|
+
behavior: "instant"
|
|
2438
|
+
});
|
|
2439
|
+
};
|
|
2440
|
+
}, f = Ie() && !ze();
|
|
2441
|
+
return se(c(), f ? d() : u());
|
|
2442
|
+
}, [r, e]);
|
|
2443
|
+
}
|
|
2444
|
+
function xa(e, ...t) {
|
|
2445
|
+
if (!e) return !1;
|
|
2446
|
+
let n = e.getAttribute("data-focus-trap");
|
|
2447
|
+
return n == null ? !1 : t.length ? n === "" ? !1 : t.some((e) => n === e) : !0;
|
|
2448
|
+
}
|
|
2449
|
+
function Sa() {
|
|
2450
|
+
return "inert" in HTMLElement.prototype;
|
|
2451
|
+
}
|
|
2452
|
+
function Ca(e) {
|
|
2453
|
+
return Ji(e, "aria-hidden", "true");
|
|
2454
|
+
}
|
|
2455
|
+
function wa(e, t) {
|
|
2456
|
+
return "style" in e ? Sa() ? Yi(e, "inert", !0) : se(...Jn(e, !0).map((e) => {
|
|
2457
|
+
if (t?.some((t) => t && V(t, e))) return I;
|
|
2458
|
+
let n = qi(e, "focus", () => (e.focus = I, () => {
|
|
2459
|
+
delete e.focus;
|
|
2460
|
+
}));
|
|
2461
|
+
return se(Ji(e, "tabindex", "-1"), n);
|
|
2462
|
+
}), Ca(e), Xi(e, {
|
|
2463
|
+
pointerEvents: "none",
|
|
2464
|
+
userSelect: "none",
|
|
2465
|
+
cursor: "default"
|
|
2466
|
+
})) : I;
|
|
2467
|
+
}
|
|
2468
|
+
function Ta(e, t) {
|
|
2469
|
+
let n = [], r = t.map((e) => e?.id);
|
|
2470
|
+
return na(e, t, (e) => {
|
|
2471
|
+
ia(e, ...r) || xa(e, ...r) || n.unshift(wa(e, t));
|
|
2472
|
+
}, (e) => {
|
|
2473
|
+
e.hasAttribute("role") && (t.some((t) => t && V(t, e)) || n.unshift(Ji(e, "role", "none")));
|
|
2474
|
+
}), () => {
|
|
2475
|
+
for (let e of n) e();
|
|
2476
|
+
};
|
|
2477
|
+
}
|
|
2478
|
+
function Ea(e = {}) {
|
|
2479
|
+
let t = sn(e.store, on(e.disclosure, ["contentElement", "disclosureElement"]));
|
|
2480
|
+
cn(e, t);
|
|
2481
|
+
let n = t?.getState(), r = z(e.open, n?.open, e.defaultOpen, !1), i = z(e.animated, n?.animated, !1), a = $t({
|
|
2482
|
+
open: r,
|
|
2483
|
+
animated: i,
|
|
2484
|
+
animating: !!i && r,
|
|
2485
|
+
mounted: r,
|
|
2486
|
+
contentElement: z(n?.contentElement, null),
|
|
2487
|
+
disclosureElement: z(n?.disclosureElement, null)
|
|
2488
|
+
}, t);
|
|
2489
|
+
return en(a, () => rn(a, ["animated", "animating"], (e) => {
|
|
2490
|
+
e.animated || a.setState("animating", !1);
|
|
2491
|
+
})), en(a, () => nn(a, ["open"], () => {
|
|
2492
|
+
a.getState().animated && a.setState("animating", !0);
|
|
2493
|
+
})), en(a, () => rn(a, ["open", "animating"], (e) => {
|
|
2494
|
+
a.setState("mounted", e.open || e.animating);
|
|
2495
|
+
})), {
|
|
2496
|
+
...a,
|
|
2497
|
+
disclosure: e.disclosure,
|
|
2498
|
+
setOpen: (e) => a.setState("open", e),
|
|
2499
|
+
show: () => a.setState("open", !0),
|
|
2500
|
+
hide: () => a.setState("open", !1),
|
|
2501
|
+
toggle: () => a.setState("open", (e) => !e),
|
|
2502
|
+
stopAnimation: () => a.setState("animating", !1),
|
|
2503
|
+
setContentElement: (e) => a.setState("contentElement", e),
|
|
2504
|
+
setDisclosureElement: (e) => a.setState("disclosureElement", e)
|
|
2505
|
+
};
|
|
2506
|
+
}
|
|
2507
|
+
function Da(e, t, n) {
|
|
2508
|
+
return it(t, [n.store, n.disclosure]), Q(e, n, "open", "setOpen"), Q(e, n, "mounted", "setMounted"), Q(e, n, "animated"), Object.assign(e, { disclosure: n.disclosure });
|
|
2509
|
+
}
|
|
2510
|
+
function Oa(e = {}) {
|
|
2511
|
+
let [t, n] = mn(Ea, e);
|
|
2512
|
+
return Da(t, n, e);
|
|
2513
|
+
}
|
|
2514
|
+
var ka = "div", Aa = /* @__PURE__ */ "a.button.details.dialog.div.form.h1.h2.h3.h4.h5.h6.header.img.input.label.li.nav.ol.p.section.select.span.summary.textarea.ul.svg".split(".");
|
|
2515
|
+
X(function(e) {
|
|
2516
|
+
return e;
|
|
2517
|
+
});
|
|
2518
|
+
var ja = J(function(e) {
|
|
2519
|
+
return Y(ka, e);
|
|
2520
|
+
});
|
|
2521
|
+
Object.assign(ja, Aa.reduce((e, t) => (e[t] = J(function(e) {
|
|
2522
|
+
return Y(t, e);
|
|
2523
|
+
}), e), {}));
|
|
2524
|
+
function Ma({ store: e, backdrop: t, alwaysVisible: n, hidden: r }) {
|
|
2525
|
+
let i = b(null), a = Oa({ disclosure: e }), o = Z(e, "contentElement");
|
|
2526
|
+
g(() => {
|
|
2527
|
+
let e = i.current, t = o;
|
|
2528
|
+
e && t && (e.style.zIndex = getComputedStyle(t).zIndex);
|
|
2529
|
+
}, [o]), U(() => {
|
|
2530
|
+
let e = o?.id;
|
|
2531
|
+
if (!e) return;
|
|
2532
|
+
let t = i.current;
|
|
2533
|
+
if (t) return sa(t, e);
|
|
2534
|
+
}, [o]);
|
|
2535
|
+
let s = mi({
|
|
2536
|
+
ref: i,
|
|
2537
|
+
store: a,
|
|
2538
|
+
role: "presentation",
|
|
2539
|
+
"data-backdrop": o?.id || "",
|
|
2540
|
+
alwaysVisible: n,
|
|
2541
|
+
hidden: r ?? void 0,
|
|
2542
|
+
style: {
|
|
2543
|
+
position: "fixed",
|
|
2544
|
+
top: 0,
|
|
2545
|
+
right: 0,
|
|
2546
|
+
bottom: 0,
|
|
2547
|
+
left: 0
|
|
2548
|
+
}
|
|
2549
|
+
});
|
|
2550
|
+
if (!t) return null;
|
|
2551
|
+
if (p(t)) return /* @__PURE__ */ C(ja, {
|
|
2552
|
+
...s,
|
|
2553
|
+
render: t
|
|
2554
|
+
});
|
|
2555
|
+
let c = typeof t == "boolean" ? "div" : t;
|
|
2556
|
+
return /* @__PURE__ */ C(ja, {
|
|
2557
|
+
...s,
|
|
2558
|
+
render: /* @__PURE__ */ C(c, {})
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
function Na(e = {}) {
|
|
2562
|
+
return Ea(e);
|
|
2563
|
+
}
|
|
2564
|
+
function Pa(e, t, n) {
|
|
2565
|
+
return Da(e, t, n);
|
|
2566
|
+
}
|
|
2567
|
+
function Fa(e = {}) {
|
|
2568
|
+
let [t, n] = mn(Na, e);
|
|
2569
|
+
return Pa(t, n, e);
|
|
2570
|
+
}
|
|
2571
|
+
var Ia = "div", La = Le();
|
|
2572
|
+
function Ra(e) {
|
|
2573
|
+
let t = xe();
|
|
2574
|
+
return !t || e && V(e, t) ? !1 : !!Gn(t);
|
|
2575
|
+
}
|
|
2576
|
+
function za(e, t = !1) {
|
|
2577
|
+
if (!e) return null;
|
|
2578
|
+
let n = "current" in e ? e.current : e;
|
|
2579
|
+
return n ? t ? Gn(n) ? n : null : n : null;
|
|
2580
|
+
}
|
|
2581
|
+
var Ba = X(function({ store: e, open: t, onClose: n, focusable: r = !0, modal: i = !0, portal: a = !!i, backdrop: o = !!i, hideOnEscape: s = !0, hideOnInteractOutside: c = !0, getPersistentElements: l, preventBodyScroll: u = !!i, autoFocusOnShow: d = !0, autoFocusOnHide: f = !0, initialFocus: p, finalFocus: h, unmountOnHide: _, unstable_treeSnapshotKey: v, ...y }) {
|
|
2582
|
+
let T = Ct(), E = b(null), D = Fa({
|
|
2583
|
+
store: e || T,
|
|
2584
|
+
open: t,
|
|
2585
|
+
setOpen(e) {
|
|
2586
|
+
if (e) return;
|
|
2587
|
+
let t = E.current;
|
|
2588
|
+
if (!t) return;
|
|
2589
|
+
let r = new Event("close", {
|
|
2590
|
+
bubbles: !1,
|
|
2591
|
+
cancelable: !0
|
|
2592
|
+
});
|
|
2593
|
+
n && t.addEventListener("close", n, { once: !0 }), t.dispatchEvent(r), r.defaultPrevented && D.setOpen(!0);
|
|
2594
|
+
}
|
|
2595
|
+
}), { portalRef: O, domReady: k } = ot(a, y.portalRef), A = y.preserveTabOrder, j = Z(D, (e) => A && !i && e.mounted), M = tt(y.id), N = Z(D, "open"), P = Z(D, "mounted"), F = Z(D, "contentElement"), ee = pi(P, y.hidden, y.alwaysVisible);
|
|
2596
|
+
ba(F, M, u && !ee);
|
|
2597
|
+
let te = b(!1);
|
|
2598
|
+
U(() => rn(D, ["open"], (e) => {
|
|
2599
|
+
e.open && (te.current = !1);
|
|
2600
|
+
}), [D]), ha(D, c, k, te);
|
|
2601
|
+
let { wrapElement: ne, nestedDialogs: I } = _a(D);
|
|
2602
|
+
y = q(y, ne, [ne]);
|
|
2603
|
+
let re = b(null);
|
|
2604
|
+
La && g(() => {
|
|
2605
|
+
if (!k) return;
|
|
2606
|
+
let e = E.current;
|
|
2607
|
+
if (!e) return;
|
|
2608
|
+
let t = B(e), n = (e) => {
|
|
2609
|
+
re.current = e.target;
|
|
2610
|
+
};
|
|
2611
|
+
return t.addEventListener("mousedown", n, !0), () => {
|
|
2612
|
+
t.removeEventListener("mousedown", n, !0);
|
|
2613
|
+
};
|
|
2614
|
+
}, [k]), U(() => {
|
|
2615
|
+
if (!N) return;
|
|
2616
|
+
let e = E.current, t = xe(e, !0);
|
|
2617
|
+
if (t) {
|
|
2618
|
+
if (t.tagName === "BODY") {
|
|
2619
|
+
let t = re.current;
|
|
2620
|
+
if (re.current = null, !t?.isConnected || !Gn(t) || e && V(e, t)) return;
|
|
2621
|
+
D.setDisclosureElement(t);
|
|
2622
|
+
return;
|
|
2623
|
+
}
|
|
2624
|
+
e && V(e, t) || D.setDisclosureElement(t);
|
|
2625
|
+
}
|
|
2626
|
+
}, [D, N]), g(() => {
|
|
2627
|
+
if (!P || !k) return;
|
|
2628
|
+
let e = E.current;
|
|
2629
|
+
if (!e) return;
|
|
2630
|
+
let t = be(e), n = t.visualViewport || t, r = () => {
|
|
2631
|
+
let n = t.visualViewport?.height ?? t.innerHeight;
|
|
2632
|
+
e.style.setProperty("--dialog-viewport-height", `${n}px`);
|
|
2633
|
+
};
|
|
2634
|
+
return r(), n.addEventListener("resize", r), () => {
|
|
2635
|
+
n.removeEventListener("resize", r);
|
|
2636
|
+
};
|
|
2637
|
+
}, [P, k]), g(() => {
|
|
2638
|
+
if (!i || !P || !k) return;
|
|
2639
|
+
let e = E.current;
|
|
2640
|
+
if (e && !e.querySelector("[data-dialog-dismiss]")) return Wi(e, D.hide);
|
|
2641
|
+
}, [
|
|
2642
|
+
D,
|
|
2643
|
+
i,
|
|
2644
|
+
P,
|
|
2645
|
+
k
|
|
2646
|
+
]), U(() => {
|
|
2647
|
+
if (!Sa() || N || !P || !k) return;
|
|
2648
|
+
let e = E.current;
|
|
2649
|
+
if (e) return wa(e);
|
|
2650
|
+
}, [
|
|
2651
|
+
N,
|
|
2652
|
+
P,
|
|
2653
|
+
k
|
|
2654
|
+
]);
|
|
2655
|
+
let ie = N && k;
|
|
2656
|
+
U(() => {
|
|
2657
|
+
if (!M || !ie) return;
|
|
2658
|
+
let e = E.current;
|
|
2659
|
+
return ra(M, [e]);
|
|
2660
|
+
}, [
|
|
2661
|
+
M,
|
|
2662
|
+
ie,
|
|
2663
|
+
v
|
|
2664
|
+
]);
|
|
2665
|
+
let ae = W(l);
|
|
2666
|
+
U(() => {
|
|
2667
|
+
if (!M || !ie) return;
|
|
2668
|
+
let { disclosureElement: e } = D.getState(), t = [
|
|
2669
|
+
E.current,
|
|
2670
|
+
...ae() || [],
|
|
2671
|
+
...I.map((e) => e.getState().contentElement)
|
|
2672
|
+
];
|
|
2673
|
+
return i ? se(la(M, t), Ta(M, t)) : la(M, [e, ...t]);
|
|
2674
|
+
}, [
|
|
2675
|
+
M,
|
|
2676
|
+
D,
|
|
2677
|
+
ie,
|
|
2678
|
+
ae,
|
|
2679
|
+
I,
|
|
2680
|
+
i,
|
|
2681
|
+
v
|
|
2682
|
+
]);
|
|
2683
|
+
let oe = !!d, ce = K(d), [le, ue] = x(!1);
|
|
2684
|
+
g(() => {
|
|
2685
|
+
if (!N || !oe || !k || !F?.isConnected) return;
|
|
2686
|
+
let e = za(p, !0) || F.querySelector("[data-autofocus=true],[autofocus]") || Yn(F, !0, a && j) || F, t = Gn(e);
|
|
2687
|
+
ce(t ? e : null) && (ue(!0), queueMicrotask(() => {
|
|
2688
|
+
D.getState().open && (e.focus(), La && t && e.scrollIntoView({
|
|
2689
|
+
block: "nearest",
|
|
2690
|
+
inline: "nearest"
|
|
2691
|
+
}));
|
|
2692
|
+
}));
|
|
2693
|
+
}, [
|
|
2694
|
+
N,
|
|
2695
|
+
oe,
|
|
2696
|
+
k,
|
|
2697
|
+
F,
|
|
2698
|
+
p,
|
|
2699
|
+
a,
|
|
2700
|
+
j,
|
|
2701
|
+
D,
|
|
2702
|
+
ce
|
|
2703
|
+
]);
|
|
2704
|
+
let de = !!f, L = K(f), [fe, pe] = x(!1);
|
|
2705
|
+
g(() => {
|
|
2706
|
+
if (N) return pe(!0), () => pe(!1);
|
|
2707
|
+
}, [N]);
|
|
2708
|
+
let R = m((e, t = !0) => {
|
|
2709
|
+
if (te.current) return;
|
|
2710
|
+
let { disclosureElement: n } = D.getState();
|
|
2711
|
+
if (Ra(e)) return;
|
|
2712
|
+
let r = za(h) || n;
|
|
2713
|
+
if (r?.id) {
|
|
2714
|
+
let e = B(r), t = `[aria-activedescendant="${r.id}"]`, n = e.querySelector(t);
|
|
2715
|
+
n && (r = n);
|
|
2716
|
+
}
|
|
2717
|
+
if (r && !Gn(r)) {
|
|
2718
|
+
let e = r.closest("[data-dialog]");
|
|
2719
|
+
if (e?.id) {
|
|
2720
|
+
let t = B(e), n = `[aria-controls~="${e.id}"]`, i = t.querySelector(n);
|
|
2721
|
+
i && (r = i);
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
let i = r && Gn(r);
|
|
2725
|
+
if (!i && t) {
|
|
2726
|
+
requestAnimationFrame(() => R(e, !1));
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
L(i ? r : null) && i && r?.focus();
|
|
2730
|
+
}, [
|
|
2731
|
+
D,
|
|
2732
|
+
h,
|
|
2733
|
+
L
|
|
2734
|
+
]), z = b(!1);
|
|
2735
|
+
U(() => {
|
|
2736
|
+
if (N || !fe || !de) return;
|
|
2737
|
+
let e = E.current;
|
|
2738
|
+
z.current = !0, R(e);
|
|
2739
|
+
}, [
|
|
2740
|
+
N,
|
|
2741
|
+
fe,
|
|
2742
|
+
k,
|
|
2743
|
+
de,
|
|
2744
|
+
R
|
|
2745
|
+
]), g(() => {
|
|
2746
|
+
if (!fe || !de) return;
|
|
2747
|
+
let e = E.current;
|
|
2748
|
+
return () => {
|
|
2749
|
+
if (z.current) {
|
|
2750
|
+
z.current = !1;
|
|
2751
|
+
return;
|
|
2752
|
+
}
|
|
2753
|
+
R(e);
|
|
2754
|
+
};
|
|
2755
|
+
}, [
|
|
2756
|
+
fe,
|
|
2757
|
+
de,
|
|
2758
|
+
R
|
|
2759
|
+
]);
|
|
2760
|
+
let me = K(s);
|
|
2761
|
+
g(() => !k || !P ? void 0 : Je("keydown", (e) => {
|
|
2762
|
+
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
2763
|
+
let t = E.current;
|
|
2764
|
+
if (!t || ca(t)) return;
|
|
2765
|
+
let n = e.target;
|
|
2766
|
+
if (!n) return;
|
|
2767
|
+
let { disclosureElement: r } = D.getState();
|
|
2768
|
+
(n.tagName === "BODY" || V(t, n) || !r || V(r, n)) && me(e) && D.hide();
|
|
2769
|
+
}, !0), [
|
|
2770
|
+
D,
|
|
2771
|
+
k,
|
|
2772
|
+
P,
|
|
2773
|
+
me
|
|
2774
|
+
]), y = q(y, (e) => /* @__PURE__ */ C(Vi, {
|
|
2775
|
+
level: i ? 1 : void 0,
|
|
2776
|
+
children: e
|
|
2777
|
+
}), [i]);
|
|
2778
|
+
let he = y.hidden, ge = y.alwaysVisible;
|
|
2779
|
+
y = q(y, (e) => o ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(Ma, {
|
|
2780
|
+
store: D,
|
|
2781
|
+
backdrop: o,
|
|
2782
|
+
hidden: he,
|
|
2783
|
+
alwaysVisible: ge
|
|
2784
|
+
}), e] }) : e, [
|
|
2785
|
+
D,
|
|
2786
|
+
o,
|
|
2787
|
+
he,
|
|
2788
|
+
ge
|
|
2789
|
+
]);
|
|
2790
|
+
let [_e, ve] = x(), [ye, Se] = x();
|
|
2791
|
+
return y = q(y, (e) => /* @__PURE__ */ C(Tt, {
|
|
2792
|
+
value: D,
|
|
2793
|
+
children: /* @__PURE__ */ C(Et.Provider, {
|
|
2794
|
+
value: ve,
|
|
2795
|
+
children: /* @__PURE__ */ C(Dt.Provider, {
|
|
2796
|
+
value: Se,
|
|
2797
|
+
children: e
|
|
2798
|
+
})
|
|
2799
|
+
})
|
|
2800
|
+
}), [D]), y = {
|
|
2801
|
+
"data-dialog": "",
|
|
2802
|
+
role: "dialog",
|
|
2803
|
+
tabIndex: r ? -1 : void 0,
|
|
2804
|
+
"aria-labelledby": y["aria-label"] == null ? _e : void 0,
|
|
2805
|
+
"aria-describedby": ye,
|
|
2806
|
+
...y,
|
|
2807
|
+
id: M,
|
|
2808
|
+
ref: G(E, y.ref)
|
|
2809
|
+
}, y = Ui({
|
|
2810
|
+
...y,
|
|
2811
|
+
autoFocusOnShow: le
|
|
2812
|
+
}), y = mi({
|
|
2813
|
+
store: D,
|
|
2814
|
+
...y
|
|
2815
|
+
}), y = xr({
|
|
2816
|
+
...y,
|
|
2817
|
+
focusable: r
|
|
2818
|
+
}), y = Bi({
|
|
2819
|
+
portal: a,
|
|
2820
|
+
...y,
|
|
2821
|
+
portalRef: O,
|
|
2822
|
+
preserveTabOrder: j
|
|
2823
|
+
}), y;
|
|
2824
|
+
});
|
|
2825
|
+
function Va(e, t = Ct) {
|
|
2826
|
+
return J(function(n) {
|
|
2827
|
+
let r = t();
|
|
2828
|
+
return Z(n.store || r, (e) => !n.unmountOnHide || e?.mounted || !!n.open) ? /* @__PURE__ */ C(e, { ...n }) : null;
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
Va(J(function(e) {
|
|
2832
|
+
return Y(Ia, Ba(e));
|
|
2833
|
+
}), Ct);
|
|
2834
|
+
var Ha = Math.min, Ua = Math.max, Wa = Math.round, Ga = Math.floor, Ka = (e) => ({
|
|
2835
|
+
x: e,
|
|
2836
|
+
y: e
|
|
2837
|
+
}), qa = {
|
|
2838
|
+
left: "right",
|
|
2839
|
+
right: "left",
|
|
2840
|
+
bottom: "top",
|
|
2841
|
+
top: "bottom"
|
|
2842
|
+
};
|
|
2843
|
+
function Ja(e, t, n) {
|
|
2844
|
+
return Ua(e, Ha(t, n));
|
|
2845
|
+
}
|
|
2846
|
+
function Ya(e, t) {
|
|
2847
|
+
return typeof e == "function" ? e(t) : e;
|
|
2848
|
+
}
|
|
2849
|
+
function Xa(e) {
|
|
2850
|
+
return e.split("-")[0];
|
|
2851
|
+
}
|
|
2852
|
+
function Za(e) {
|
|
2853
|
+
return e.split("-")[1];
|
|
2854
|
+
}
|
|
2855
|
+
function Qa(e) {
|
|
2856
|
+
return e === "x" ? "y" : "x";
|
|
2857
|
+
}
|
|
2858
|
+
function $a(e) {
|
|
2859
|
+
return e === "y" ? "height" : "width";
|
|
2860
|
+
}
|
|
2861
|
+
function eo(e) {
|
|
2862
|
+
let t = e[0];
|
|
2863
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
2864
|
+
}
|
|
2865
|
+
function to(e) {
|
|
2866
|
+
return Qa(eo(e));
|
|
2867
|
+
}
|
|
2868
|
+
function no(e, t, n) {
|
|
2869
|
+
n === void 0 && (n = !1);
|
|
2870
|
+
let r = Za(e), i = to(e), a = $a(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
2871
|
+
return t.reference[a] > t.floating[a] && (o = fo(o)), [o, fo(o)];
|
|
2872
|
+
}
|
|
2873
|
+
function ro(e) {
|
|
2874
|
+
let t = fo(e);
|
|
2875
|
+
return [
|
|
2876
|
+
io(e),
|
|
2877
|
+
t,
|
|
2878
|
+
io(t)
|
|
2879
|
+
];
|
|
2880
|
+
}
|
|
2881
|
+
function io(e) {
|
|
2882
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
2883
|
+
}
|
|
2884
|
+
var ao = ["left", "right"], oo = ["right", "left"], so = ["top", "bottom"], co = ["bottom", "top"];
|
|
2885
|
+
function lo(e, t, n) {
|
|
2886
|
+
switch (e) {
|
|
2887
|
+
case "top":
|
|
2888
|
+
case "bottom": return n ? t ? oo : ao : t ? ao : oo;
|
|
2889
|
+
case "left":
|
|
2890
|
+
case "right": return t ? so : co;
|
|
2891
|
+
default: return [];
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
function uo(e, t, n, r) {
|
|
2895
|
+
let i = Za(e), a = lo(Xa(e), n === "start", r);
|
|
2896
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(io)))), a;
|
|
2897
|
+
}
|
|
2898
|
+
function fo(e) {
|
|
2899
|
+
let t = Xa(e);
|
|
2900
|
+
return qa[t] + e.slice(t.length);
|
|
2901
|
+
}
|
|
2902
|
+
function po(e) {
|
|
2903
|
+
return {
|
|
2904
|
+
top: 0,
|
|
2905
|
+
right: 0,
|
|
2906
|
+
bottom: 0,
|
|
2907
|
+
left: 0,
|
|
2908
|
+
...e
|
|
2909
|
+
};
|
|
2910
|
+
}
|
|
2911
|
+
function mo(e) {
|
|
2912
|
+
return typeof e == "number" ? {
|
|
2913
|
+
top: e,
|
|
2914
|
+
right: e,
|
|
2915
|
+
bottom: e,
|
|
2916
|
+
left: e
|
|
2917
|
+
} : po(e);
|
|
2918
|
+
}
|
|
2919
|
+
function ho(e) {
|
|
2920
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
2921
|
+
return {
|
|
2922
|
+
width: r,
|
|
2923
|
+
height: i,
|
|
2924
|
+
top: n,
|
|
2925
|
+
left: t,
|
|
2926
|
+
right: t + r,
|
|
2927
|
+
bottom: n + i,
|
|
2928
|
+
x: t,
|
|
2929
|
+
y: n
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
function go(e, t, n) {
|
|
2933
|
+
let { reference: r, floating: i } = e, a = eo(t), o = to(t), s = $a(o), c = Xa(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
2934
|
+
switch (c) {
|
|
2935
|
+
case "top":
|
|
2936
|
+
p = {
|
|
2937
|
+
x: u,
|
|
2938
|
+
y: r.y - i.height
|
|
2939
|
+
};
|
|
2940
|
+
break;
|
|
2941
|
+
case "bottom":
|
|
2942
|
+
p = {
|
|
2943
|
+
x: u,
|
|
2944
|
+
y: r.y + r.height
|
|
2945
|
+
};
|
|
2946
|
+
break;
|
|
2947
|
+
case "right":
|
|
2948
|
+
p = {
|
|
2949
|
+
x: r.x + r.width,
|
|
2950
|
+
y: d
|
|
2951
|
+
};
|
|
2952
|
+
break;
|
|
2953
|
+
case "left":
|
|
2954
|
+
p = {
|
|
2955
|
+
x: r.x - i.width,
|
|
2956
|
+
y: d
|
|
2957
|
+
};
|
|
2958
|
+
break;
|
|
2959
|
+
default: p = {
|
|
2960
|
+
x: r.x,
|
|
2961
|
+
y: r.y
|
|
2962
|
+
};
|
|
2963
|
+
}
|
|
2964
|
+
switch (Za(t)) {
|
|
2965
|
+
case "start":
|
|
2966
|
+
p[o] -= f * (n && l ? -1 : 1);
|
|
2967
|
+
break;
|
|
2968
|
+
case "end":
|
|
2969
|
+
p[o] += f * (n && l ? -1 : 1);
|
|
2970
|
+
break;
|
|
2971
|
+
}
|
|
2972
|
+
return p;
|
|
2973
|
+
}
|
|
2974
|
+
async function _o(e, t) {
|
|
2975
|
+
t === void 0 && (t = {});
|
|
2976
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = Ya(t, e), p = mo(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = ho(await i.getClippingRect({
|
|
2977
|
+
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
2978
|
+
boundary: c,
|
|
2979
|
+
rootBoundary: l,
|
|
2980
|
+
strategy: s
|
|
2981
|
+
})), g = u === "floating" ? {
|
|
2982
|
+
x: n,
|
|
2983
|
+
y: r,
|
|
2984
|
+
width: a.floating.width,
|
|
2985
|
+
height: a.floating.height
|
|
2986
|
+
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
2987
|
+
x: 1,
|
|
2988
|
+
y: 1
|
|
2989
|
+
}, y = ho(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2990
|
+
elements: o,
|
|
2991
|
+
rect: g,
|
|
2992
|
+
offsetParent: _,
|
|
2993
|
+
strategy: s
|
|
2994
|
+
}) : g);
|
|
2995
|
+
return {
|
|
2996
|
+
top: (h.top - y.top + p.top) / v.y,
|
|
2997
|
+
bottom: (y.bottom - h.bottom + p.bottom) / v.y,
|
|
2998
|
+
left: (h.left - y.left + p.left) / v.x,
|
|
2999
|
+
right: (y.right - h.right + p.right) / v.x
|
|
3000
|
+
};
|
|
3001
|
+
}
|
|
3002
|
+
var vo = 50, yo = async (e, t, n) => {
|
|
3003
|
+
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
3004
|
+
...o,
|
|
3005
|
+
detectOverflow: _o
|
|
3006
|
+
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
3007
|
+
reference: e,
|
|
3008
|
+
floating: t,
|
|
3009
|
+
strategy: i
|
|
3010
|
+
}), { x: u, y: d } = go(l, r, c), f = r, p = 0, m = {};
|
|
3011
|
+
for (let n = 0; n < a.length; n++) {
|
|
3012
|
+
let h = a[n];
|
|
3013
|
+
if (!h) continue;
|
|
3014
|
+
let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
|
|
3015
|
+
x: u,
|
|
3016
|
+
y: d,
|
|
3017
|
+
initialPlacement: r,
|
|
3018
|
+
placement: f,
|
|
3019
|
+
strategy: i,
|
|
3020
|
+
middlewareData: m,
|
|
3021
|
+
rects: l,
|
|
3022
|
+
platform: s,
|
|
3023
|
+
elements: {
|
|
3024
|
+
reference: e,
|
|
3025
|
+
floating: t
|
|
3026
|
+
}
|
|
3027
|
+
});
|
|
3028
|
+
u = v ?? u, d = y ?? d, m[g] = {
|
|
3029
|
+
...m[g],
|
|
3030
|
+
...b
|
|
3031
|
+
}, x && p < vo && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
3032
|
+
reference: e,
|
|
3033
|
+
floating: t,
|
|
3034
|
+
strategy: i
|
|
3035
|
+
}) : x.rects), {x: u, y: d} = go(l, f, c)), n = -1);
|
|
3036
|
+
}
|
|
3037
|
+
return {
|
|
3038
|
+
x: u,
|
|
3039
|
+
y: d,
|
|
3040
|
+
placement: f,
|
|
3041
|
+
strategy: i,
|
|
3042
|
+
middlewareData: m
|
|
3043
|
+
};
|
|
3044
|
+
}, bo = (e) => ({
|
|
3045
|
+
name: "arrow",
|
|
3046
|
+
options: e,
|
|
3047
|
+
async fn(t) {
|
|
3048
|
+
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = Ya(e, t) || {};
|
|
3049
|
+
if (l == null) return {};
|
|
3050
|
+
let d = mo(u), f = {
|
|
3051
|
+
x: n,
|
|
3052
|
+
y: r
|
|
3053
|
+
}, p = to(i), m = $a(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
|
|
3054
|
+
(!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
|
|
3055
|
+
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = Ha(d[_], T), D = Ha(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = Ja(O, A, k), M = !c.arrow && Za(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
|
|
3056
|
+
return {
|
|
3057
|
+
[p]: f[p] + N,
|
|
3058
|
+
data: {
|
|
3059
|
+
[p]: j,
|
|
3060
|
+
centerOffset: A - j - N,
|
|
3061
|
+
...M && { alignmentOffset: N }
|
|
3062
|
+
},
|
|
3063
|
+
reset: M
|
|
3064
|
+
};
|
|
3065
|
+
}
|
|
3066
|
+
}), xo = function(e) {
|
|
3067
|
+
return e === void 0 && (e = {}), {
|
|
3068
|
+
name: "flip",
|
|
3069
|
+
options: e,
|
|
3070
|
+
async fn(t) {
|
|
3071
|
+
var n;
|
|
3072
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = Ya(e, t);
|
|
3073
|
+
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
3074
|
+
let g = Xa(r), _ = eo(o), v = Xa(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [fo(o)] : ro(o)), x = p !== "none";
|
|
3075
|
+
!d && x && b.push(...uo(o, m, p, y));
|
|
3076
|
+
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
3077
|
+
if (l && w.push(C[g]), u) {
|
|
3078
|
+
let e = no(r, a, y);
|
|
3079
|
+
w.push(C[e[0]], C[e[1]]);
|
|
3080
|
+
}
|
|
3081
|
+
if (T = [...T, {
|
|
3082
|
+
placement: r,
|
|
3083
|
+
overflows: w
|
|
3084
|
+
}], !w.every((e) => e <= 0)) {
|
|
3085
|
+
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
3086
|
+
if (t && (!(u === "alignment" && _ !== eo(t)) || T.every((e) => eo(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
|
|
3087
|
+
data: {
|
|
3088
|
+
index: e,
|
|
3089
|
+
overflows: T
|
|
3090
|
+
},
|
|
3091
|
+
reset: { placement: t }
|
|
3092
|
+
};
|
|
3093
|
+
let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
|
|
3094
|
+
if (!n) switch (f) {
|
|
3095
|
+
case "bestFit": {
|
|
3096
|
+
let e = T.filter((e) => {
|
|
3097
|
+
if (x) {
|
|
3098
|
+
let t = eo(e.placement);
|
|
3099
|
+
return t === _ || t === "y";
|
|
3100
|
+
}
|
|
3101
|
+
return !0;
|
|
3102
|
+
}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
|
|
3103
|
+
e && (n = e);
|
|
3104
|
+
break;
|
|
3105
|
+
}
|
|
3106
|
+
case "initialPlacement":
|
|
3107
|
+
n = o;
|
|
3108
|
+
break;
|
|
3109
|
+
}
|
|
3110
|
+
if (r !== n) return { reset: { placement: n } };
|
|
3111
|
+
}
|
|
3112
|
+
return {};
|
|
3113
|
+
}
|
|
3114
|
+
};
|
|
3115
|
+
}, So = /* @__PURE__ */ new Set(["left", "top"]);
|
|
3116
|
+
async function Co(e, t) {
|
|
3117
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Xa(n), s = Za(n), c = eo(n) === "y", l = So.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = Ya(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
3118
|
+
mainAxis: d,
|
|
3119
|
+
crossAxis: 0,
|
|
3120
|
+
alignmentAxis: null
|
|
3121
|
+
} : {
|
|
3122
|
+
mainAxis: d.mainAxis || 0,
|
|
3123
|
+
crossAxis: d.crossAxis || 0,
|
|
3124
|
+
alignmentAxis: d.alignmentAxis
|
|
3125
|
+
};
|
|
3126
|
+
return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
|
|
3127
|
+
x: p * u,
|
|
3128
|
+
y: f * l
|
|
3129
|
+
} : {
|
|
3130
|
+
x: f * l,
|
|
3131
|
+
y: p * u
|
|
3132
|
+
};
|
|
3133
|
+
}
|
|
3134
|
+
var wo = function(e) {
|
|
3135
|
+
return e === void 0 && (e = 0), {
|
|
3136
|
+
name: "offset",
|
|
3137
|
+
options: e,
|
|
3138
|
+
async fn(t) {
|
|
3139
|
+
var n;
|
|
3140
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Co(t, e);
|
|
3141
|
+
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
3142
|
+
x: r + s.x,
|
|
3143
|
+
y: i + s.y,
|
|
3144
|
+
data: {
|
|
3145
|
+
...s,
|
|
3146
|
+
placement: a
|
|
3147
|
+
}
|
|
3148
|
+
};
|
|
3149
|
+
}
|
|
3150
|
+
};
|
|
3151
|
+
}, To = function(e) {
|
|
3152
|
+
return e === void 0 && (e = {}), {
|
|
3153
|
+
name: "shift",
|
|
3154
|
+
options: e,
|
|
3155
|
+
async fn(t) {
|
|
3156
|
+
let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
|
|
3157
|
+
let { x: t, y: n } = e;
|
|
3158
|
+
return {
|
|
3159
|
+
x: t,
|
|
3160
|
+
y: n
|
|
3161
|
+
};
|
|
3162
|
+
} }, ...l } = Ya(e, t), u = {
|
|
3163
|
+
x: n,
|
|
3164
|
+
y: r
|
|
3165
|
+
}, d = await a.detectOverflow(t, l), f = eo(Xa(i)), p = Qa(f), m = u[p], h = u[f];
|
|
3166
|
+
if (o) {
|
|
3167
|
+
let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
|
|
3168
|
+
m = Ja(n, m, r);
|
|
3169
|
+
}
|
|
3170
|
+
if (s) {
|
|
3171
|
+
let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
|
|
3172
|
+
h = Ja(n, h, r);
|
|
3173
|
+
}
|
|
3174
|
+
let g = c.fn({
|
|
3175
|
+
...t,
|
|
3176
|
+
[p]: m,
|
|
3177
|
+
[f]: h
|
|
3178
|
+
});
|
|
3179
|
+
return {
|
|
3180
|
+
...g,
|
|
3181
|
+
data: {
|
|
3182
|
+
x: g.x - n,
|
|
3183
|
+
y: g.y - r,
|
|
3184
|
+
enabled: {
|
|
3185
|
+
[p]: o,
|
|
3186
|
+
[f]: s
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
};
|
|
3192
|
+
}, Eo = function(e) {
|
|
3193
|
+
return e === void 0 && (e = {}), {
|
|
3194
|
+
options: e,
|
|
3195
|
+
fn(t) {
|
|
3196
|
+
let { x: n, y: r, placement: i, rects: a, middlewareData: o } = t, { offset: s = 0, mainAxis: c = !0, crossAxis: l = !0 } = Ya(e, t), u = {
|
|
3197
|
+
x: n,
|
|
3198
|
+
y: r
|
|
3199
|
+
}, d = eo(i), f = Qa(d), p = u[f], m = u[d], h = Ya(s, t), g = typeof h == "number" ? {
|
|
3200
|
+
mainAxis: h,
|
|
3201
|
+
crossAxis: 0
|
|
3202
|
+
} : {
|
|
3203
|
+
mainAxis: 0,
|
|
3204
|
+
crossAxis: 0,
|
|
3205
|
+
...h
|
|
3206
|
+
};
|
|
3207
|
+
if (c) {
|
|
3208
|
+
let e = f === "y" ? "height" : "width", t = a.reference[f] - a.floating[e] + g.mainAxis, n = a.reference[f] + a.reference[e] - g.mainAxis;
|
|
3209
|
+
p < t ? p = t : p > n && (p = n);
|
|
3210
|
+
}
|
|
3211
|
+
if (l) {
|
|
3212
|
+
let e = f === "y" ? "width" : "height", t = So.has(Xa(i)), n = a.reference[d] - a.floating[e] + (t && o.offset?.[d] || 0) + (t ? 0 : g.crossAxis), r = a.reference[d] + a.reference[e] + (t ? 0 : o.offset?.[d] || 0) - (t ? g.crossAxis : 0);
|
|
3213
|
+
m < n ? m = n : m > r && (m = r);
|
|
3214
|
+
}
|
|
3215
|
+
return {
|
|
3216
|
+
[f]: p,
|
|
3217
|
+
[d]: m
|
|
3218
|
+
};
|
|
3219
|
+
}
|
|
3220
|
+
};
|
|
3221
|
+
}, Do = function(e) {
|
|
3222
|
+
return e === void 0 && (e = {}), {
|
|
3223
|
+
name: "size",
|
|
3224
|
+
options: e,
|
|
3225
|
+
async fn(t) {
|
|
3226
|
+
var n, r;
|
|
3227
|
+
let { placement: i, rects: a, platform: o, elements: s } = t, { apply: c = () => {}, ...l } = Ya(e, t), u = await o.detectOverflow(t, l), d = Xa(i), f = Za(i), p = eo(i) === "y", { width: m, height: h } = a.floating, g, _;
|
|
3228
|
+
d === "top" || d === "bottom" ? (g = d, _ = f === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (_ = d, g = f === "end" ? "top" : "bottom");
|
|
3229
|
+
let v = h - u.top - u.bottom, y = m - u.left - u.right, b = Ha(h - u[g], v), x = Ha(m - u[_], y), S = !t.middlewareData.shift, C = b, w = x;
|
|
3230
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (w = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = v), S && !f) {
|
|
3231
|
+
let e = Ua(u.left, 0), t = Ua(u.right, 0), n = Ua(u.top, 0), r = Ua(u.bottom, 0);
|
|
3232
|
+
p ? w = m - 2 * (e !== 0 || t !== 0 ? e + t : Ua(u.left, u.right)) : C = h - 2 * (n !== 0 || r !== 0 ? n + r : Ua(u.top, u.bottom));
|
|
3233
|
+
}
|
|
3234
|
+
await c({
|
|
3235
|
+
...t,
|
|
3236
|
+
availableWidth: w,
|
|
3237
|
+
availableHeight: C
|
|
3238
|
+
});
|
|
3239
|
+
let T = await o.getDimensions(s.floating);
|
|
3240
|
+
return m !== T.width || h !== T.height ? { reset: { rects: !0 } } : {};
|
|
3241
|
+
}
|
|
3242
|
+
};
|
|
3243
|
+
};
|
|
3244
|
+
function Oo() {
|
|
3245
|
+
return typeof window < "u";
|
|
3246
|
+
}
|
|
3247
|
+
function ko(e) {
|
|
3248
|
+
return Mo(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
3249
|
+
}
|
|
3250
|
+
function Ao(e) {
|
|
3251
|
+
var t;
|
|
3252
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
3253
|
+
}
|
|
3254
|
+
function jo(e) {
|
|
3255
|
+
return ((Mo(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
3256
|
+
}
|
|
3257
|
+
function Mo(e) {
|
|
3258
|
+
return Oo() ? e instanceof Node || e instanceof Ao(e).Node : !1;
|
|
3259
|
+
}
|
|
3260
|
+
function No(e) {
|
|
3261
|
+
return Oo() ? e instanceof Element || e instanceof Ao(e).Element : !1;
|
|
3262
|
+
}
|
|
3263
|
+
function Po(e) {
|
|
3264
|
+
return Oo() ? e instanceof HTMLElement || e instanceof Ao(e).HTMLElement : !1;
|
|
3265
|
+
}
|
|
3266
|
+
function Fo(e) {
|
|
3267
|
+
return !Oo() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Ao(e).ShadowRoot;
|
|
3268
|
+
}
|
|
3269
|
+
function Io(e) {
|
|
3270
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = qo(e);
|
|
3271
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
3272
|
+
}
|
|
3273
|
+
function Lo(e) {
|
|
3274
|
+
return /^(table|td|th)$/.test(ko(e));
|
|
3275
|
+
}
|
|
3276
|
+
function Ro(e) {
|
|
3277
|
+
try {
|
|
3278
|
+
if (e.matches(":popover-open")) return !0;
|
|
3279
|
+
} catch {}
|
|
3280
|
+
try {
|
|
3281
|
+
return e.matches(":modal");
|
|
3282
|
+
} catch {
|
|
3283
|
+
return !1;
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
var zo = /transform|translate|scale|rotate|perspective|filter/, Bo = /paint|layout|strict|content/, Vo = (e) => !!e && e !== "none", Ho;
|
|
3287
|
+
function Uo(e) {
|
|
3288
|
+
let t = No(e) ? qo(e) : e;
|
|
3289
|
+
return Vo(t.transform) || Vo(t.translate) || Vo(t.scale) || Vo(t.rotate) || Vo(t.perspective) || !Go() && (Vo(t.backdropFilter) || Vo(t.filter)) || zo.test(t.willChange || "") || Bo.test(t.contain || "");
|
|
3290
|
+
}
|
|
3291
|
+
function Wo(e) {
|
|
3292
|
+
let t = Yo(e);
|
|
3293
|
+
for (; Po(t) && !Ko(t);) {
|
|
3294
|
+
if (Uo(t)) return t;
|
|
3295
|
+
if (Ro(t)) return null;
|
|
3296
|
+
t = Yo(t);
|
|
3297
|
+
}
|
|
3298
|
+
return null;
|
|
3299
|
+
}
|
|
3300
|
+
function Go() {
|
|
3301
|
+
return Ho ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), Ho;
|
|
3302
|
+
}
|
|
3303
|
+
function Ko(e) {
|
|
3304
|
+
return /^(html|body|#document)$/.test(ko(e));
|
|
3305
|
+
}
|
|
3306
|
+
function qo(e) {
|
|
3307
|
+
return Ao(e).getComputedStyle(e);
|
|
3308
|
+
}
|
|
3309
|
+
function Jo(e) {
|
|
3310
|
+
return No(e) ? {
|
|
3311
|
+
scrollLeft: e.scrollLeft,
|
|
3312
|
+
scrollTop: e.scrollTop
|
|
3313
|
+
} : {
|
|
3314
|
+
scrollLeft: e.scrollX,
|
|
3315
|
+
scrollTop: e.scrollY
|
|
3316
|
+
};
|
|
3317
|
+
}
|
|
3318
|
+
function Yo(e) {
|
|
3319
|
+
if (ko(e) === "html") return e;
|
|
3320
|
+
let t = e.assignedSlot || e.parentNode || Fo(e) && e.host || jo(e);
|
|
3321
|
+
return Fo(t) ? t.host : t;
|
|
3322
|
+
}
|
|
3323
|
+
function Xo(e) {
|
|
3324
|
+
let t = Yo(e);
|
|
3325
|
+
return Ko(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Po(t) && Io(t) ? t : Xo(t);
|
|
3326
|
+
}
|
|
3327
|
+
function Zo(e, t, n) {
|
|
3328
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
3329
|
+
let r = Xo(e), i = r === e.ownerDocument?.body, a = Ao(r);
|
|
3330
|
+
if (i) {
|
|
3331
|
+
let e = Qo(a);
|
|
3332
|
+
return t.concat(a, a.visualViewport || [], Io(r) ? r : [], e && n ? Zo(e) : []);
|
|
3333
|
+
} else return t.concat(r, Zo(r, [], n));
|
|
3334
|
+
}
|
|
3335
|
+
function Qo(e) {
|
|
3336
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
3337
|
+
}
|
|
3338
|
+
function $o(e) {
|
|
3339
|
+
let t = qo(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = Po(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = Wa(n) !== a || Wa(r) !== o;
|
|
3340
|
+
return s && (n = a, r = o), {
|
|
3341
|
+
width: n,
|
|
3342
|
+
height: r,
|
|
3343
|
+
$: s
|
|
3344
|
+
};
|
|
3345
|
+
}
|
|
3346
|
+
function es(e) {
|
|
3347
|
+
return No(e) ? e : e.contextElement;
|
|
3348
|
+
}
|
|
3349
|
+
function ts(e) {
|
|
3350
|
+
let t = es(e);
|
|
3351
|
+
if (!Po(t)) return Ka(1);
|
|
3352
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = $o(t), o = (a ? Wa(n.width) : n.width) / r, s = (a ? Wa(n.height) : n.height) / i;
|
|
3353
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
3354
|
+
x: o,
|
|
3355
|
+
y: s
|
|
3356
|
+
};
|
|
3357
|
+
}
|
|
3358
|
+
var ns = /* @__PURE__ */ Ka(0);
|
|
3359
|
+
function rs(e) {
|
|
3360
|
+
let t = Ao(e);
|
|
3361
|
+
return !Go() || !t.visualViewport ? ns : {
|
|
3362
|
+
x: t.visualViewport.offsetLeft,
|
|
3363
|
+
y: t.visualViewport.offsetTop
|
|
3364
|
+
};
|
|
3365
|
+
}
|
|
3366
|
+
function is(e, t, n) {
|
|
3367
|
+
return t === void 0 && (t = !1), !n || t && n !== Ao(e) ? !1 : t;
|
|
3368
|
+
}
|
|
3369
|
+
function as(e, t, n, r) {
|
|
3370
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
3371
|
+
let i = e.getBoundingClientRect(), a = es(e), o = Ka(1);
|
|
3372
|
+
t && (r ? No(r) && (o = ts(r)) : o = ts(e));
|
|
3373
|
+
let s = is(a, n, r) ? rs(a) : Ka(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
|
|
3374
|
+
if (a) {
|
|
3375
|
+
let e = Ao(a), t = r && No(r) ? Ao(r) : r, n = e, i = Qo(n);
|
|
3376
|
+
for (; i && r && t !== n;) {
|
|
3377
|
+
let e = ts(i), t = i.getBoundingClientRect(), r = qo(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
3378
|
+
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = Ao(i), i = Qo(n);
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
return ho({
|
|
3382
|
+
width: u,
|
|
3383
|
+
height: d,
|
|
3384
|
+
x: c,
|
|
3385
|
+
y: l
|
|
3386
|
+
});
|
|
3387
|
+
}
|
|
3388
|
+
function os(e, t) {
|
|
3389
|
+
let n = Jo(e).scrollLeft;
|
|
3390
|
+
return t ? t.left + n : as(jo(e)).left + n;
|
|
3391
|
+
}
|
|
3392
|
+
function ss(e, t) {
|
|
3393
|
+
let n = e.getBoundingClientRect();
|
|
3394
|
+
return {
|
|
3395
|
+
x: n.left + t.scrollLeft - os(e, n),
|
|
3396
|
+
y: n.top + t.scrollTop
|
|
3397
|
+
};
|
|
3398
|
+
}
|
|
3399
|
+
function cs(e) {
|
|
3400
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = jo(r), s = t ? Ro(t.floating) : !1;
|
|
3401
|
+
if (r === o || s && a) return n;
|
|
3402
|
+
let c = {
|
|
3403
|
+
scrollLeft: 0,
|
|
3404
|
+
scrollTop: 0
|
|
3405
|
+
}, l = Ka(1), u = Ka(0), d = Po(r);
|
|
3406
|
+
if ((d || !d && !a) && ((ko(r) !== "body" || Io(o)) && (c = Jo(r)), d)) {
|
|
3407
|
+
let e = as(r);
|
|
3408
|
+
l = ts(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
|
|
3409
|
+
}
|
|
3410
|
+
let f = o && !d && !a ? ss(o, c) : Ka(0);
|
|
3411
|
+
return {
|
|
3412
|
+
width: n.width * l.x,
|
|
3413
|
+
height: n.height * l.y,
|
|
3414
|
+
x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
|
|
3415
|
+
y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
|
|
3416
|
+
};
|
|
3417
|
+
}
|
|
3418
|
+
function ls(e) {
|
|
3419
|
+
return Array.from(e.getClientRects());
|
|
3420
|
+
}
|
|
3421
|
+
function us(e) {
|
|
3422
|
+
let t = jo(e), n = Jo(e), r = e.ownerDocument.body, i = Ua(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = Ua(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + os(e), s = -n.scrollTop;
|
|
3423
|
+
return qo(r).direction === "rtl" && (o += Ua(t.clientWidth, r.clientWidth) - i), {
|
|
3424
|
+
width: i,
|
|
3425
|
+
height: a,
|
|
3426
|
+
x: o,
|
|
3427
|
+
y: s
|
|
3428
|
+
};
|
|
3429
|
+
}
|
|
3430
|
+
var ds = 25;
|
|
3431
|
+
function fs(e, t) {
|
|
3432
|
+
let n = Ao(e), r = jo(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
3433
|
+
if (i) {
|
|
3434
|
+
a = i.width, o = i.height;
|
|
3435
|
+
let e = Go();
|
|
3436
|
+
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
3437
|
+
}
|
|
3438
|
+
let l = os(r);
|
|
3439
|
+
if (l <= 0) {
|
|
3440
|
+
let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
|
|
3441
|
+
o <= ds && (a -= o);
|
|
3442
|
+
} else l <= ds && (a += l);
|
|
3443
|
+
return {
|
|
3444
|
+
width: a,
|
|
3445
|
+
height: o,
|
|
3446
|
+
x: s,
|
|
3447
|
+
y: c
|
|
3448
|
+
};
|
|
3449
|
+
}
|
|
3450
|
+
function ps(e, t) {
|
|
3451
|
+
let n = as(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = Po(e) ? ts(e) : Ka(1);
|
|
3452
|
+
return {
|
|
3453
|
+
width: e.clientWidth * a.x,
|
|
3454
|
+
height: e.clientHeight * a.y,
|
|
3455
|
+
x: i * a.x,
|
|
3456
|
+
y: r * a.y
|
|
3457
|
+
};
|
|
3458
|
+
}
|
|
3459
|
+
function ms(e, t, n) {
|
|
3460
|
+
let r;
|
|
3461
|
+
if (t === "viewport") r = fs(e, n);
|
|
3462
|
+
else if (t === "document") r = us(jo(e));
|
|
3463
|
+
else if (No(t)) r = ps(t, n);
|
|
3464
|
+
else {
|
|
3465
|
+
let n = rs(e);
|
|
3466
|
+
r = {
|
|
3467
|
+
x: t.x - n.x,
|
|
3468
|
+
y: t.y - n.y,
|
|
3469
|
+
width: t.width,
|
|
3470
|
+
height: t.height
|
|
3471
|
+
};
|
|
3472
|
+
}
|
|
3473
|
+
return ho(r);
|
|
3474
|
+
}
|
|
3475
|
+
function hs(e, t) {
|
|
3476
|
+
let n = Yo(e);
|
|
3477
|
+
return n === t || !No(n) || Ko(n) ? !1 : qo(n).position === "fixed" || hs(n, t);
|
|
3478
|
+
}
|
|
3479
|
+
function gs(e, t) {
|
|
3480
|
+
let n = t.get(e);
|
|
3481
|
+
if (n) return n;
|
|
3482
|
+
let r = Zo(e, [], !1).filter((e) => No(e) && ko(e) !== "body"), i = null, a = qo(e).position === "fixed", o = a ? Yo(e) : e;
|
|
3483
|
+
for (; No(o) && !Ko(o);) {
|
|
3484
|
+
let t = qo(o), n = Uo(o);
|
|
3485
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || Io(o) && !n && hs(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = Yo(o);
|
|
3486
|
+
}
|
|
3487
|
+
return t.set(e, r), r;
|
|
3488
|
+
}
|
|
3489
|
+
function _s(e) {
|
|
3490
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? Ro(t) ? [] : gs(t, this._c) : [].concat(n), r], o = ms(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
3491
|
+
for (let e = 1; e < a.length; e++) {
|
|
3492
|
+
let n = ms(t, a[e], i);
|
|
3493
|
+
s = Ua(n.top, s), c = Ha(n.right, c), l = Ha(n.bottom, l), u = Ua(n.left, u);
|
|
3494
|
+
}
|
|
3495
|
+
return {
|
|
3496
|
+
width: c - u,
|
|
3497
|
+
height: l - s,
|
|
3498
|
+
x: u,
|
|
3499
|
+
y: s
|
|
3500
|
+
};
|
|
3501
|
+
}
|
|
3502
|
+
function vs(e) {
|
|
3503
|
+
let { width: t, height: n } = $o(e);
|
|
3504
|
+
return {
|
|
3505
|
+
width: t,
|
|
3506
|
+
height: n
|
|
3507
|
+
};
|
|
3508
|
+
}
|
|
3509
|
+
function ys(e, t, n) {
|
|
3510
|
+
let r = Po(t), i = jo(t), a = n === "fixed", o = as(e, !0, a, t), s = {
|
|
3511
|
+
scrollLeft: 0,
|
|
3512
|
+
scrollTop: 0
|
|
3513
|
+
}, c = Ka(0);
|
|
3514
|
+
function l() {
|
|
3515
|
+
c.x = os(i);
|
|
3516
|
+
}
|
|
3517
|
+
if (r || !r && !a) if ((ko(t) !== "body" || Io(i)) && (s = Jo(t)), r) {
|
|
3518
|
+
let e = as(t, !0, a, t);
|
|
3519
|
+
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
3520
|
+
} else i && l();
|
|
3521
|
+
a && !r && i && l();
|
|
3522
|
+
let u = i && !r && !a ? ss(i, s) : Ka(0);
|
|
3523
|
+
return {
|
|
3524
|
+
x: o.left + s.scrollLeft - c.x - u.x,
|
|
3525
|
+
y: o.top + s.scrollTop - c.y - u.y,
|
|
3526
|
+
width: o.width,
|
|
3527
|
+
height: o.height
|
|
3528
|
+
};
|
|
3529
|
+
}
|
|
3530
|
+
function bs(e) {
|
|
3531
|
+
return qo(e).position === "static";
|
|
3532
|
+
}
|
|
3533
|
+
function xs(e, t) {
|
|
3534
|
+
if (!Po(e) || qo(e).position === "fixed") return null;
|
|
3535
|
+
if (t) return t(e);
|
|
3536
|
+
let n = e.offsetParent;
|
|
3537
|
+
return jo(e) === n && (n = n.ownerDocument.body), n;
|
|
3538
|
+
}
|
|
3539
|
+
function Ss(e, t) {
|
|
3540
|
+
let n = Ao(e);
|
|
3541
|
+
if (Ro(e)) return n;
|
|
3542
|
+
if (!Po(e)) {
|
|
3543
|
+
let t = Yo(e);
|
|
3544
|
+
for (; t && !Ko(t);) {
|
|
3545
|
+
if (No(t) && !bs(t)) return t;
|
|
3546
|
+
t = Yo(t);
|
|
3547
|
+
}
|
|
3548
|
+
return n;
|
|
3549
|
+
}
|
|
3550
|
+
let r = xs(e, t);
|
|
3551
|
+
for (; r && Lo(r) && bs(r);) r = xs(r, t);
|
|
3552
|
+
return r && Ko(r) && bs(r) && !Uo(r) ? n : r || Wo(e) || n;
|
|
3553
|
+
}
|
|
3554
|
+
var Cs = async function(e) {
|
|
3555
|
+
let t = this.getOffsetParent || Ss, n = this.getDimensions, r = await n(e.floating);
|
|
3556
|
+
return {
|
|
3557
|
+
reference: ys(e.reference, await t(e.floating), e.strategy),
|
|
3558
|
+
floating: {
|
|
3559
|
+
x: 0,
|
|
3560
|
+
y: 0,
|
|
3561
|
+
width: r.width,
|
|
3562
|
+
height: r.height
|
|
3563
|
+
}
|
|
3564
|
+
};
|
|
3565
|
+
};
|
|
3566
|
+
function ws(e) {
|
|
3567
|
+
return qo(e).direction === "rtl";
|
|
3568
|
+
}
|
|
3569
|
+
var Ts = {
|
|
3570
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: cs,
|
|
3571
|
+
getDocumentElement: jo,
|
|
3572
|
+
getClippingRect: _s,
|
|
3573
|
+
getOffsetParent: Ss,
|
|
3574
|
+
getElementRects: Cs,
|
|
3575
|
+
getClientRects: ls,
|
|
3576
|
+
getDimensions: vs,
|
|
3577
|
+
getScale: ts,
|
|
3578
|
+
isElement: No,
|
|
3579
|
+
isRTL: ws
|
|
3580
|
+
};
|
|
3581
|
+
function Es(e, t) {
|
|
3582
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
3583
|
+
}
|
|
3584
|
+
function Ds(e, t) {
|
|
3585
|
+
let n = null, r, i = jo(e);
|
|
3586
|
+
function a() {
|
|
3587
|
+
var e;
|
|
3588
|
+
clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
|
|
3589
|
+
}
|
|
3590
|
+
function o(s, c) {
|
|
3591
|
+
s === void 0 && (s = !1), c === void 0 && (c = 1), a();
|
|
3592
|
+
let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
|
|
3593
|
+
if (s || t(), !f || !p) return;
|
|
3594
|
+
let m = Ga(d), h = Ga(i.clientWidth - (u + f)), g = Ga(i.clientHeight - (d + p)), _ = Ga(u), v = {
|
|
3595
|
+
rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
|
|
3596
|
+
threshold: Ua(0, Ha(1, c)) || 1
|
|
3597
|
+
}, y = !0;
|
|
3598
|
+
function b(t) {
|
|
3599
|
+
let n = t[0].intersectionRatio;
|
|
3600
|
+
if (n !== c) {
|
|
3601
|
+
if (!y) return o();
|
|
3602
|
+
n ? o(!1, n) : r = setTimeout(() => {
|
|
3603
|
+
o(!1, 1e-7);
|
|
3604
|
+
}, 1e3);
|
|
3605
|
+
}
|
|
3606
|
+
n === 1 && !Es(l, e.getBoundingClientRect()) && o(), y = !1;
|
|
3607
|
+
}
|
|
3608
|
+
try {
|
|
3609
|
+
n = new IntersectionObserver(b, {
|
|
3610
|
+
...v,
|
|
3611
|
+
root: i.ownerDocument
|
|
3612
|
+
});
|
|
3613
|
+
} catch {
|
|
3614
|
+
n = new IntersectionObserver(b, v);
|
|
3615
|
+
}
|
|
3616
|
+
n.observe(e);
|
|
3617
|
+
}
|
|
3618
|
+
return o(!0), a;
|
|
3619
|
+
}
|
|
3620
|
+
function Os(e, t, n, r) {
|
|
3621
|
+
r === void 0 && (r = {});
|
|
3622
|
+
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = es(e), u = i || a ? [...l ? Zo(l) : [], ...t ? Zo(t) : []] : [];
|
|
3623
|
+
u.forEach((e) => {
|
|
3624
|
+
i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
|
|
3625
|
+
});
|
|
3626
|
+
let d = l && s ? Ds(l, n) : null, f = -1, p = null;
|
|
3627
|
+
o && (p = new ResizeObserver((e) => {
|
|
3628
|
+
let [r] = e;
|
|
3629
|
+
r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
3630
|
+
var e;
|
|
3631
|
+
(e = p) == null || e.observe(t);
|
|
3632
|
+
})), n();
|
|
3633
|
+
}), l && !c && p.observe(l), t && p.observe(t));
|
|
3634
|
+
let m, h = c ? as(e) : null;
|
|
3635
|
+
c && g();
|
|
3636
|
+
function g() {
|
|
3637
|
+
let t = as(e);
|
|
3638
|
+
h && !Es(h, t) && n(), h = t, m = requestAnimationFrame(g);
|
|
3639
|
+
}
|
|
3640
|
+
return n(), () => {
|
|
3641
|
+
var e;
|
|
3642
|
+
u.forEach((e) => {
|
|
3643
|
+
i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
|
|
3644
|
+
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
3645
|
+
};
|
|
3646
|
+
}
|
|
3647
|
+
var ks = wo, As = To, js = xo, Ms = Do, Ns = bo, Ps = Eo, Fs = (e, t, n) => {
|
|
3648
|
+
let r = /* @__PURE__ */ new Map(), i = {
|
|
3649
|
+
platform: Ts,
|
|
3650
|
+
...n
|
|
3651
|
+
}, a = {
|
|
3652
|
+
...i.platform,
|
|
3653
|
+
_c: r
|
|
3654
|
+
};
|
|
3655
|
+
return yo(e, t, {
|
|
3656
|
+
...i,
|
|
3657
|
+
platform: a
|
|
3658
|
+
});
|
|
3659
|
+
}, Is = "div";
|
|
3660
|
+
function Ls(e = 0, t = 0, n = 0, r = 0) {
|
|
3661
|
+
if (typeof DOMRect == "function") return new DOMRect(e, t, n, r);
|
|
3662
|
+
let i = {
|
|
3663
|
+
x: e,
|
|
3664
|
+
y: t,
|
|
3665
|
+
width: n,
|
|
3666
|
+
height: r,
|
|
3667
|
+
top: t,
|
|
3668
|
+
right: e + n,
|
|
3669
|
+
bottom: t + r,
|
|
3670
|
+
left: e
|
|
3671
|
+
};
|
|
3672
|
+
return {
|
|
3673
|
+
...i,
|
|
3674
|
+
toJSON: () => i
|
|
3675
|
+
};
|
|
3676
|
+
}
|
|
3677
|
+
function Rs(e) {
|
|
3678
|
+
if (!e) return Ls();
|
|
3679
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
3680
|
+
return Ls(t, n, r, i);
|
|
3681
|
+
}
|
|
3682
|
+
function zs(e, t) {
|
|
3683
|
+
return {
|
|
3684
|
+
contextElement: e || void 0,
|
|
3685
|
+
getBoundingClientRect: () => {
|
|
3686
|
+
let n = e, r = t?.(n);
|
|
3687
|
+
return r || !n ? Rs(r) : n.getBoundingClientRect();
|
|
3688
|
+
}
|
|
3689
|
+
};
|
|
3690
|
+
}
|
|
3691
|
+
function Bs(e) {
|
|
3692
|
+
return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e);
|
|
3693
|
+
}
|
|
3694
|
+
function Vs(e) {
|
|
3695
|
+
let t = window.devicePixelRatio || 1;
|
|
3696
|
+
return Math.round(e * t) / t;
|
|
3697
|
+
}
|
|
3698
|
+
function Hs(e, t) {
|
|
3699
|
+
return ks(({ placement: n }) => {
|
|
3700
|
+
let r = (e?.clientHeight || 0) / 2, i = typeof t.gutter == "number" ? t.gutter + r : t.gutter ?? r;
|
|
3701
|
+
return {
|
|
3702
|
+
crossAxis: n.split("-")[1] ? void 0 : t.shift,
|
|
3703
|
+
mainAxis: i,
|
|
3704
|
+
alignmentAxis: t.shift
|
|
3705
|
+
};
|
|
3706
|
+
});
|
|
3707
|
+
}
|
|
3708
|
+
function Us(e) {
|
|
3709
|
+
if (e.flip === !1) return;
|
|
3710
|
+
let t = typeof e.flip == "string" ? e.flip.split(" ") : void 0;
|
|
3711
|
+
return L(!t || t.every(Bs), process.env.NODE_ENV !== "production" && "`flip` expects a spaced-delimited list of placements"), js({
|
|
3712
|
+
padding: e.overflowPadding,
|
|
3713
|
+
fallbackPlacements: t
|
|
3714
|
+
});
|
|
3715
|
+
}
|
|
3716
|
+
function Ws(e) {
|
|
3717
|
+
if (!(!e.slide && !e.overlap)) return As({
|
|
3718
|
+
mainAxis: e.slide,
|
|
3719
|
+
crossAxis: e.overlap,
|
|
3720
|
+
padding: e.overflowPadding,
|
|
3721
|
+
limiter: Ps()
|
|
3722
|
+
});
|
|
3723
|
+
}
|
|
3724
|
+
function Gs(e) {
|
|
3725
|
+
return Ms({
|
|
3726
|
+
padding: e.overflowPadding,
|
|
3727
|
+
apply({ elements: t, availableWidth: n, availableHeight: r, rects: i }) {
|
|
3728
|
+
let a = t.floating, o = Math.round(i.reference.width);
|
|
3729
|
+
n = Math.floor(n), r = Math.floor(r), a.style.setProperty("--popover-anchor-width", `${o}px`), a.style.setProperty("--popover-available-width", `${n}px`), a.style.setProperty("--popover-available-height", `${r}px`), e.sameWidth && (a.style.width = `${o}px`), e.fitViewport && (a.style.maxWidth = `${n}px`, a.style.maxHeight = `${r}px`);
|
|
3730
|
+
}
|
|
3731
|
+
});
|
|
3732
|
+
}
|
|
3733
|
+
function Ks(e, t) {
|
|
3734
|
+
if (e) return Ns({
|
|
3735
|
+
element: e,
|
|
3736
|
+
padding: t.arrowPadding
|
|
3737
|
+
});
|
|
3738
|
+
}
|
|
3739
|
+
var qs = X(function({ store: e, modal: t = !1, portal: n = !!t, preserveTabOrder: r = !0, autoFocusOnShow: i = !0, wrapperProps: a, fixed: o = !1, flip: s = !0, shift: c = 0, slide: l = !0, overlap: u = !1, sameWidth: d = !1, fitViewport: f = !1, gutter: p, arrowPadding: m = 4, overflowPadding: h = 8, getAnchorRect: g, updatePosition: _, ...v }) {
|
|
3740
|
+
let y = At();
|
|
3741
|
+
e ||= y, L(e, process.env.NODE_ENV !== "production" && "Popover must receive a `store` prop or be wrapped in a PopoverProvider component.");
|
|
3742
|
+
let S = Z(e, "arrowElement"), w = Z(e, "anchorElement"), T = Z(e, "disclosureElement"), E = Z(e, "popoverElement"), D = Z(e, "contentElement"), O = Z(e, "placement"), k = Z(e, "mounted"), A = Z(e, "rendered"), j = b(null), [M, N] = x(!1), { portalRef: P, domReady: F } = ot(n, v.portalRef), ee = W(g), te = W(_), ne = !!_;
|
|
3743
|
+
U(() => {
|
|
3744
|
+
if (!E?.isConnected) return;
|
|
3745
|
+
E.style.setProperty("--popover-overflow-padding", `${h}px`);
|
|
3746
|
+
let t = zs(w, ee), n = async () => {
|
|
3747
|
+
if (!k) return;
|
|
3748
|
+
S || (j.current = j.current || document.createElement("div"));
|
|
3749
|
+
let n = S || j.current, r = [
|
|
3750
|
+
Hs(n, {
|
|
3751
|
+
gutter: p,
|
|
3752
|
+
shift: c
|
|
3753
|
+
}),
|
|
3754
|
+
Us({
|
|
3755
|
+
flip: s,
|
|
3756
|
+
overflowPadding: h
|
|
3757
|
+
}),
|
|
3758
|
+
Ws({
|
|
3759
|
+
slide: l,
|
|
3760
|
+
shift: c,
|
|
3761
|
+
overlap: u,
|
|
3762
|
+
overflowPadding: h
|
|
3763
|
+
}),
|
|
3764
|
+
Ks(n, { arrowPadding: m }),
|
|
3765
|
+
Gs({
|
|
3766
|
+
sameWidth: d,
|
|
3767
|
+
fitViewport: f,
|
|
3768
|
+
overflowPadding: h
|
|
3769
|
+
})
|
|
3770
|
+
], i = await Fs(t, E, {
|
|
3771
|
+
placement: O,
|
|
3772
|
+
strategy: o ? "fixed" : "absolute",
|
|
3773
|
+
middleware: r
|
|
3774
|
+
});
|
|
3775
|
+
e?.setState("currentPlacement", i.placement), N(!0);
|
|
3776
|
+
let a = Vs(i.x), g = Vs(i.y);
|
|
3777
|
+
if (Object.assign(E.style, {
|
|
3778
|
+
top: "0",
|
|
3779
|
+
left: "0",
|
|
3780
|
+
transform: `translate3d(${a}px,${g}px,0)`
|
|
3781
|
+
}), n && i.middlewareData.arrow) {
|
|
3782
|
+
let { x: e, y: t } = i.middlewareData.arrow, r = i.placement.split("-")[0], a = n.clientWidth / 2, o = n.clientHeight / 2, s = e == null ? -a : e + a, c = t == null ? -o : t + o;
|
|
3783
|
+
E.style.setProperty("--popover-transform-origin", {
|
|
3784
|
+
top: `${s}px calc(100% + ${o}px)`,
|
|
3785
|
+
bottom: `${s}px ${-o}px`,
|
|
3786
|
+
left: `calc(100% + ${a}px) ${c}px`,
|
|
3787
|
+
right: `${-a}px ${c}px`
|
|
3788
|
+
}[r]), Object.assign(n.style, {
|
|
3789
|
+
left: e == null ? "" : `${e}px`,
|
|
3790
|
+
top: t == null ? "" : `${t}px`,
|
|
3791
|
+
[r]: "100%"
|
|
3792
|
+
});
|
|
3793
|
+
}
|
|
3794
|
+
}, r = Os(t, E, async () => {
|
|
3795
|
+
ne ? (await te({ updatePosition: n }), N(!0)) : await n();
|
|
3796
|
+
}, { elementResize: typeof ResizeObserver == "function" });
|
|
3797
|
+
return () => {
|
|
3798
|
+
N(!1), r();
|
|
3799
|
+
};
|
|
3800
|
+
}, [
|
|
3801
|
+
e,
|
|
3802
|
+
A,
|
|
3803
|
+
E,
|
|
3804
|
+
S,
|
|
3805
|
+
w,
|
|
3806
|
+
E,
|
|
3807
|
+
O,
|
|
3808
|
+
k,
|
|
3809
|
+
F,
|
|
3810
|
+
o,
|
|
3811
|
+
s,
|
|
3812
|
+
c,
|
|
3813
|
+
l,
|
|
3814
|
+
u,
|
|
3815
|
+
d,
|
|
3816
|
+
f,
|
|
3817
|
+
p,
|
|
3818
|
+
m,
|
|
3819
|
+
h,
|
|
3820
|
+
ee,
|
|
3821
|
+
ne,
|
|
3822
|
+
te
|
|
3823
|
+
]), U(() => {
|
|
3824
|
+
if (!k || !F || !E?.isConnected || !D?.isConnected) return;
|
|
3825
|
+
let e = () => {
|
|
3826
|
+
E.style.zIndex = getComputedStyle(D).zIndex;
|
|
3827
|
+
};
|
|
3828
|
+
e();
|
|
3829
|
+
let t = requestAnimationFrame(() => {
|
|
3830
|
+
t = requestAnimationFrame(e);
|
|
3831
|
+
});
|
|
3832
|
+
return () => cancelAnimationFrame(t);
|
|
3833
|
+
}, [
|
|
3834
|
+
k,
|
|
3835
|
+
F,
|
|
3836
|
+
E,
|
|
3837
|
+
D
|
|
3838
|
+
]);
|
|
3839
|
+
let I = o ? "fixed" : "absolute";
|
|
3840
|
+
return v = q(v, (t) => /* @__PURE__ */ C("div", {
|
|
3841
|
+
...a,
|
|
3842
|
+
style: {
|
|
3843
|
+
position: I,
|
|
3844
|
+
top: 0,
|
|
3845
|
+
left: 0,
|
|
3846
|
+
width: "max-content",
|
|
3847
|
+
...a?.style
|
|
3848
|
+
},
|
|
3849
|
+
ref: e?.setPopoverElement,
|
|
3850
|
+
children: t
|
|
3851
|
+
}), [
|
|
3852
|
+
e,
|
|
3853
|
+
I,
|
|
3854
|
+
a
|
|
3855
|
+
]), v = q(v, (t) => /* @__PURE__ */ C(Mt, {
|
|
3856
|
+
value: e,
|
|
3857
|
+
children: t
|
|
3858
|
+
}), [e]), v = {
|
|
3859
|
+
"data-placing": !M || void 0,
|
|
3860
|
+
...v,
|
|
3861
|
+
style: {
|
|
3862
|
+
position: "relative",
|
|
3863
|
+
...v.style
|
|
3864
|
+
}
|
|
3865
|
+
}, v = Ba({
|
|
3866
|
+
store: e,
|
|
3867
|
+
modal: t,
|
|
3868
|
+
portal: n,
|
|
3869
|
+
preserveTabOrder: r,
|
|
3870
|
+
preserveTabOrderAnchor: T || w,
|
|
3871
|
+
autoFocusOnShow: M && i,
|
|
3872
|
+
...v,
|
|
3873
|
+
portalRef: P
|
|
3874
|
+
}), v;
|
|
3875
|
+
});
|
|
3876
|
+
Va(J(function(e) {
|
|
3877
|
+
return Y(Is, qs(e));
|
|
3878
|
+
}), At);
|
|
3879
|
+
var Js = "div", Ys = X(function({ store: e, alwaysVisible: t, ...n }) {
|
|
3880
|
+
let r = qt();
|
|
3881
|
+
return e ||= r, n = Di({
|
|
3882
|
+
store: e,
|
|
3883
|
+
alwaysVisible: t,
|
|
3884
|
+
...n
|
|
3885
|
+
}), n = qs({
|
|
3886
|
+
store: e,
|
|
3887
|
+
alwaysVisible: t,
|
|
3888
|
+
...n
|
|
3889
|
+
}), n;
|
|
3890
|
+
}), Xs = Va(J(function(e) {
|
|
3891
|
+
return Y(Js, Ys(e));
|
|
3892
|
+
}), qt);
|
|
3893
|
+
function Zs({ popover: e, ...t } = {}) {
|
|
3894
|
+
let n = sn(t.store, on(e, [
|
|
3895
|
+
"arrowElement",
|
|
3896
|
+
"anchorElement",
|
|
3897
|
+
"contentElement",
|
|
3898
|
+
"popoverElement",
|
|
3899
|
+
"disclosureElement"
|
|
3900
|
+
]));
|
|
3901
|
+
cn(t, n);
|
|
3902
|
+
let r = n?.getState(), i = Na({
|
|
3903
|
+
...t,
|
|
3904
|
+
store: n
|
|
3905
|
+
}), a = z(t.placement, r?.placement, "bottom"), o = $t({
|
|
3906
|
+
...i.getState(),
|
|
3907
|
+
placement: a,
|
|
3908
|
+
currentPlacement: a,
|
|
3909
|
+
anchorElement: z(r?.anchorElement, null),
|
|
3910
|
+
popoverElement: z(r?.popoverElement, null),
|
|
3911
|
+
arrowElement: z(r?.arrowElement, null),
|
|
3912
|
+
rendered: /* @__PURE__ */ Symbol("rendered")
|
|
3913
|
+
}, i, n);
|
|
3914
|
+
return {
|
|
3915
|
+
...i,
|
|
3916
|
+
...o,
|
|
3917
|
+
setAnchorElement: (e) => o.setState("anchorElement", e),
|
|
3918
|
+
setPopoverElement: (e) => o.setState("popoverElement", e),
|
|
3919
|
+
setArrowElement: (e) => o.setState("arrowElement", e),
|
|
3920
|
+
render: () => o.setState("rendered", /* @__PURE__ */ Symbol("rendered"))
|
|
3921
|
+
};
|
|
3922
|
+
}
|
|
3923
|
+
function Qs(e, t, n) {
|
|
3924
|
+
return it(t, [n.popover]), Q(e, n, "placement"), Pa(e, t, n);
|
|
3925
|
+
}
|
|
3926
|
+
function $s(e) {
|
|
3927
|
+
let t = e.find((e) => !!e.element), n = [...e].reverse().find((e) => !!e.element)?.element, r = t?.element?.parentElement;
|
|
3928
|
+
if (!n) return B(r).body;
|
|
3929
|
+
for (; r;) {
|
|
3930
|
+
if (r.contains(n)) return r;
|
|
3931
|
+
r = r.parentElement;
|
|
3932
|
+
}
|
|
3933
|
+
return B(r).body;
|
|
3934
|
+
}
|
|
3935
|
+
function ec(e) {
|
|
3936
|
+
return e?.__unstablePrivateStore;
|
|
3937
|
+
}
|
|
3938
|
+
function tc(e = {}) {
|
|
3939
|
+
cn(e, e.store);
|
|
3940
|
+
let t = e.store?.getState(), n = z(e.items, t?.items, e.defaultItems, []), r = new Map(n.map((e) => [e.id, e])), i = {
|
|
3941
|
+
items: n,
|
|
3942
|
+
renderedItems: z(t?.renderedItems, [])
|
|
3943
|
+
}, a = ec(e.store), o = $t({
|
|
3944
|
+
items: n,
|
|
3945
|
+
renderedItems: i.renderedItems
|
|
3946
|
+
}, a), s = $t(i, e.store), c = (e) => {
|
|
3947
|
+
let t = Ne(e, (e) => e.element);
|
|
3948
|
+
o.setState("renderedItems", t), s.setState("renderedItems", t);
|
|
3949
|
+
};
|
|
3950
|
+
en(s, () => tn(o)), en(o, () => an(o, ["items"], (e) => {
|
|
3951
|
+
s.setState("items", e.items);
|
|
3952
|
+
})), en(o, () => an(o, ["renderedItems"], (e) => {
|
|
3953
|
+
let t = !0, n = requestAnimationFrame(() => {
|
|
3954
|
+
let { renderedItems: t } = s.getState();
|
|
3955
|
+
e.renderedItems !== t && c(e.renderedItems);
|
|
3956
|
+
});
|
|
3957
|
+
if (typeof IntersectionObserver != "function") return () => cancelAnimationFrame(n);
|
|
3958
|
+
let r = () => {
|
|
3959
|
+
if (t) {
|
|
3960
|
+
t = !1;
|
|
3961
|
+
return;
|
|
3962
|
+
}
|
|
3963
|
+
cancelAnimationFrame(n), n = requestAnimationFrame(() => c(e.renderedItems));
|
|
3964
|
+
}, i = $s(e.renderedItems), a = new IntersectionObserver(r, { root: i });
|
|
3965
|
+
for (let t of e.renderedItems) t.element && a.observe(t.element);
|
|
3966
|
+
return () => {
|
|
3967
|
+
cancelAnimationFrame(n), a.disconnect();
|
|
3968
|
+
};
|
|
3969
|
+
}));
|
|
3970
|
+
let l = (e, t, n = !1) => {
|
|
3971
|
+
let i;
|
|
3972
|
+
return t((t) => {
|
|
3973
|
+
let n = t.findIndex(({ id: t }) => t === e.id), a = t.slice();
|
|
3974
|
+
if (n !== -1) {
|
|
3975
|
+
i = t[n];
|
|
3976
|
+
let o = {
|
|
3977
|
+
...i,
|
|
3978
|
+
...e
|
|
3979
|
+
};
|
|
3980
|
+
a[n] = o, r.set(e.id, o);
|
|
3981
|
+
} else a.push(e), r.set(e.id, e);
|
|
3982
|
+
return a;
|
|
3983
|
+
}), () => {
|
|
3984
|
+
t((t) => {
|
|
3985
|
+
if (!i) return n && r.delete(e.id), t.filter(({ id: t }) => t !== e.id);
|
|
3986
|
+
let a = t.findIndex(({ id: t }) => t === e.id);
|
|
3987
|
+
if (a === -1) return t;
|
|
3988
|
+
let o = t.slice();
|
|
3989
|
+
return o[a] = i, r.set(e.id, i), o;
|
|
3990
|
+
});
|
|
3991
|
+
};
|
|
3992
|
+
}, u = (e) => l(e, (e) => o.setState("items", e), !0);
|
|
3993
|
+
return {
|
|
3994
|
+
...s,
|
|
3995
|
+
registerItem: u,
|
|
3996
|
+
renderItem: (e) => se(u(e), l(e, (e) => o.setState("renderedItems", e))),
|
|
3997
|
+
item: (e) => {
|
|
3998
|
+
if (!e) return null;
|
|
3999
|
+
let t = r.get(e);
|
|
4000
|
+
if (!t) {
|
|
4001
|
+
let { items: n } = o.getState();
|
|
4002
|
+
t = n.find((t) => t.id === e), t && r.set(e, t);
|
|
4003
|
+
}
|
|
4004
|
+
return t || null;
|
|
4005
|
+
},
|
|
4006
|
+
__unstablePrivateStore: o
|
|
4007
|
+
};
|
|
4008
|
+
}
|
|
4009
|
+
function nc(e, t, n) {
|
|
4010
|
+
return it(t, [n.store]), Q(e, n, "items", "setItems"), e;
|
|
4011
|
+
}
|
|
4012
|
+
var rc = { id: null };
|
|
4013
|
+
function ic(e, t) {
|
|
4014
|
+
return e.find((e) => t ? !e.disabled && e.id !== t : !e.disabled);
|
|
4015
|
+
}
|
|
4016
|
+
function ac(e, t) {
|
|
4017
|
+
return e.filter((e) => t ? !e.disabled && e.id !== t : !e.disabled);
|
|
4018
|
+
}
|
|
4019
|
+
function oc(e, t) {
|
|
4020
|
+
return e.filter((e) => e.rowId === t);
|
|
4021
|
+
}
|
|
4022
|
+
function sc(e, t, n = !1) {
|
|
4023
|
+
let r = e.findIndex((e) => e.id === t);
|
|
4024
|
+
return [
|
|
4025
|
+
...e.slice(r + 1),
|
|
4026
|
+
...n ? [rc] : [],
|
|
4027
|
+
...e.slice(0, r)
|
|
4028
|
+
];
|
|
4029
|
+
}
|
|
4030
|
+
function cc(e) {
|
|
4031
|
+
let t = [];
|
|
4032
|
+
for (let n of e) {
|
|
4033
|
+
let e = t.find((e) => e[0]?.rowId === n.rowId);
|
|
4034
|
+
e ? e.push(n) : t.push([n]);
|
|
4035
|
+
}
|
|
4036
|
+
return t;
|
|
4037
|
+
}
|
|
4038
|
+
function lc(e) {
|
|
4039
|
+
let t = 0;
|
|
4040
|
+
for (let { length: n } of e) n > t && (t = n);
|
|
4041
|
+
return t;
|
|
4042
|
+
}
|
|
4043
|
+
function uc(e) {
|
|
4044
|
+
return {
|
|
4045
|
+
id: "__EMPTY_ITEM__",
|
|
4046
|
+
disabled: !0,
|
|
4047
|
+
rowId: e
|
|
4048
|
+
};
|
|
4049
|
+
}
|
|
4050
|
+
function dc(e, t, n) {
|
|
4051
|
+
let r = lc(e);
|
|
4052
|
+
for (let i of e) for (let e = 0; e < r; e += 1) {
|
|
4053
|
+
let r = i[e];
|
|
4054
|
+
if (!r || n && r.disabled) {
|
|
4055
|
+
let r = e === 0 && n ? ic(i) : i[e - 1];
|
|
4056
|
+
i[e] = r && t !== r.id && n ? r : uc(r?.rowId);
|
|
4057
|
+
}
|
|
4058
|
+
}
|
|
4059
|
+
return e;
|
|
4060
|
+
}
|
|
4061
|
+
function fc(e) {
|
|
4062
|
+
let t = cc(e), n = lc(t), r = [];
|
|
4063
|
+
for (let e = 0; e < n; e += 1) for (let n of t) {
|
|
4064
|
+
let t = n[e];
|
|
4065
|
+
t && r.push({
|
|
4066
|
+
...t,
|
|
4067
|
+
rowId: t.rowId ? `${e}` : void 0
|
|
4068
|
+
});
|
|
4069
|
+
}
|
|
4070
|
+
return r;
|
|
4071
|
+
}
|
|
4072
|
+
function pc(e = {}) {
|
|
4073
|
+
let t = e.store?.getState(), n = tc(e), r = z(e.activeId, t?.activeId, e.defaultActiveId), i = $t({
|
|
4074
|
+
...n.getState(),
|
|
4075
|
+
id: z(e.id, t?.id, `id-${Math.random().toString(36).slice(2, 8)}`),
|
|
4076
|
+
activeId: r,
|
|
4077
|
+
baseElement: z(t?.baseElement, null),
|
|
4078
|
+
includesBaseElement: z(e.includesBaseElement, t?.includesBaseElement, r === null),
|
|
4079
|
+
moves: z(t?.moves, 0),
|
|
4080
|
+
orientation: z(e.orientation, t?.orientation, "both"),
|
|
4081
|
+
rtl: z(e.rtl, t?.rtl, !1),
|
|
4082
|
+
virtualFocus: z(e.virtualFocus, t?.virtualFocus, !1),
|
|
4083
|
+
focusLoop: z(e.focusLoop, t?.focusLoop, !1),
|
|
4084
|
+
focusWrap: z(e.focusWrap, t?.focusWrap, !1),
|
|
4085
|
+
focusShift: z(e.focusShift, t?.focusShift, !1)
|
|
4086
|
+
}, n, e.store);
|
|
4087
|
+
en(i, () => rn(i, ["renderedItems", "activeId"], (e) => {
|
|
4088
|
+
i.setState("activeId", (t) => t === void 0 ? ic(e.renderedItems)?.id : t);
|
|
4089
|
+
}));
|
|
4090
|
+
let a = (e = "next", t = {}) => {
|
|
4091
|
+
let n = i.getState(), { skip: r = 0, activeId: a = n.activeId, focusShift: o = n.focusShift, focusLoop: s = n.focusLoop, focusWrap: c = n.focusWrap, includesBaseElement: l = n.includesBaseElement, renderedItems: u = n.renderedItems, rtl: d = n.rtl } = t, f = e === "up" || e === "down", p = e === "next" || e === "down", m = p ? d && !f : !d || f, h = o && !r, g = f ? Ir(dc(cc(u), a, h)) : u;
|
|
4092
|
+
if (g = m ? Lr(g) : g, g = f ? fc(g) : g, a == null) return ic(g)?.id;
|
|
4093
|
+
let _ = g.find((e) => e.id === a);
|
|
4094
|
+
if (!_) return ic(g)?.id;
|
|
4095
|
+
let v = g.some((e) => e.rowId), y = g.indexOf(_), b = g.slice(y + 1), x = oc(b, _.rowId);
|
|
4096
|
+
if (r) {
|
|
4097
|
+
let e = ac(x, a);
|
|
4098
|
+
return (e.slice(r)[0] || e[e.length - 1])?.id;
|
|
4099
|
+
}
|
|
4100
|
+
let S = s && (f ? s !== "horizontal" : s !== "vertical"), C = v && c && (f ? c !== "horizontal" : c !== "vertical"), w = p ? (!v || f) && S && l : f ? l : !1;
|
|
4101
|
+
if (S) return ic(sc(C && !w ? g : oc(g, _.rowId), a, w), a)?.id;
|
|
4102
|
+
if (C) {
|
|
4103
|
+
let e = ic(w ? x : b, a);
|
|
4104
|
+
return w ? e?.id || null : e?.id;
|
|
4105
|
+
}
|
|
4106
|
+
let T = ic(x, a);
|
|
4107
|
+
return !T && w ? null : T?.id;
|
|
4108
|
+
};
|
|
4109
|
+
return {
|
|
4110
|
+
...n,
|
|
4111
|
+
...i,
|
|
4112
|
+
setBaseElement: (e) => i.setState("baseElement", e),
|
|
4113
|
+
setActiveId: (e) => i.setState("activeId", e),
|
|
4114
|
+
move: (e) => {
|
|
4115
|
+
e !== void 0 && (i.setState("activeId", e), i.setState("moves", (e) => e + 1));
|
|
4116
|
+
},
|
|
4117
|
+
first: () => ic(i.getState().renderedItems)?.id,
|
|
4118
|
+
last: () => ic(Lr(i.getState().renderedItems))?.id,
|
|
4119
|
+
next: (e) => (e !== void 0 && typeof e == "number" && (e = { skip: e }), a("next", e)),
|
|
4120
|
+
previous: (e) => (e !== void 0 && typeof e == "number" && (e = { skip: e }), a("previous", e)),
|
|
4121
|
+
down: (e) => (e !== void 0 && typeof e == "number" && (e = { skip: e }), a("down", e)),
|
|
4122
|
+
up: (e) => (e !== void 0 && typeof e == "number" && (e = { skip: e }), a("up", e))
|
|
4123
|
+
};
|
|
4124
|
+
}
|
|
4125
|
+
function mc(e) {
|
|
4126
|
+
return {
|
|
4127
|
+
id: tt(e.id),
|
|
4128
|
+
...e
|
|
4129
|
+
};
|
|
4130
|
+
}
|
|
4131
|
+
function hc(e, t, n) {
|
|
4132
|
+
return e = nc(e, t, n), Q(e, n, "activeId", "setActiveId"), Q(e, n, "includesBaseElement"), Q(e, n, "virtualFocus"), Q(e, n, "orientation"), Q(e, n, "rtl"), Q(e, n, "focusLoop"), Q(e, n, "focusWrap"), Q(e, n, "focusShift"), e;
|
|
4133
|
+
}
|
|
4134
|
+
f(void 0);
|
|
4135
|
+
var gc = _t([jt, Bt], [Mt, Vt]);
|
|
4136
|
+
gc.useContext, gc.useScopedContext;
|
|
4137
|
+
var _c = gc.useProviderContext;
|
|
4138
|
+
gc.ContextProvider, gc.ScopedContextProvider, f(void 0), f(!1);
|
|
4139
|
+
function vc({ combobox: e, ...t } = {}) {
|
|
4140
|
+
let n = sn(t.store, on(e, [
|
|
4141
|
+
"value",
|
|
4142
|
+
"items",
|
|
4143
|
+
"renderedItems",
|
|
4144
|
+
"baseElement",
|
|
4145
|
+
"arrowElement",
|
|
4146
|
+
"anchorElement",
|
|
4147
|
+
"contentElement",
|
|
4148
|
+
"popoverElement",
|
|
4149
|
+
"disclosureElement"
|
|
4150
|
+
]));
|
|
4151
|
+
cn(t, n);
|
|
4152
|
+
let r = n.getState(), i = pc({
|
|
4153
|
+
...t,
|
|
4154
|
+
store: n,
|
|
4155
|
+
virtualFocus: z(t.virtualFocus, r.virtualFocus, !0),
|
|
4156
|
+
includesBaseElement: z(t.includesBaseElement, r.includesBaseElement, !1),
|
|
4157
|
+
activeId: z(t.activeId, r.activeId, t.defaultActiveId, null),
|
|
4158
|
+
orientation: z(t.orientation, r.orientation, "vertical")
|
|
4159
|
+
}), a = Zs({
|
|
4160
|
+
...t,
|
|
4161
|
+
store: n,
|
|
4162
|
+
placement: z(t.placement, r.placement, "bottom-start")
|
|
4163
|
+
}), o = /* @__PURE__ */ new String(""), s = {
|
|
4164
|
+
...i.getState(),
|
|
4165
|
+
...a.getState(),
|
|
4166
|
+
value: z(t.value, r.value, t.defaultValue, o),
|
|
4167
|
+
setValueOnMove: z(t.setValueOnMove, r.setValueOnMove, !1),
|
|
4168
|
+
labelElement: z(r.labelElement, null),
|
|
4169
|
+
selectElement: z(r.selectElement, null),
|
|
4170
|
+
listElement: z(r.listElement, null)
|
|
4171
|
+
}, c = $t(s, i, a, n);
|
|
4172
|
+
return en(c, () => rn(c, ["value", "items"], (e) => {
|
|
4173
|
+
if (e.value !== o || !e.items.length) return;
|
|
4174
|
+
let t = e.items.find((e) => !e.disabled && e.value != null);
|
|
4175
|
+
t?.value != null && c.setState("value", t.value);
|
|
4176
|
+
})), en(c, () => rn(c, ["mounted"], (e) => {
|
|
4177
|
+
e.mounted || c.setState("activeId", s.activeId);
|
|
4178
|
+
})), en(c, () => rn(c, [
|
|
4179
|
+
"mounted",
|
|
4180
|
+
"items",
|
|
4181
|
+
"value"
|
|
4182
|
+
], (t) => {
|
|
4183
|
+
if (e || t.mounted) return;
|
|
4184
|
+
let n = Fr(t.value), r = n[n.length - 1];
|
|
4185
|
+
if (r == null) return;
|
|
4186
|
+
let i = t.items.find((e) => !e.disabled && e.value === r);
|
|
4187
|
+
i && c.setState("activeId", i.id);
|
|
4188
|
+
})), en(c, () => an(c, ["setValueOnMove", "moves"], (e) => {
|
|
4189
|
+
let { mounted: t, value: n, activeId: r } = c.getState();
|
|
4190
|
+
if (!e.setValueOnMove && t || Array.isArray(n) || !e.moves || !r) return;
|
|
4191
|
+
let a = i.item(r);
|
|
4192
|
+
!a || a.disabled || a.value == null || c.setState("value", a.value);
|
|
4193
|
+
})), {
|
|
4194
|
+
...i,
|
|
4195
|
+
...a,
|
|
4196
|
+
...c,
|
|
4197
|
+
combobox: e,
|
|
4198
|
+
setValue: (e) => c.setState("value", e),
|
|
4199
|
+
setLabelElement: (e) => c.setState("labelElement", e),
|
|
4200
|
+
setSelectElement: (e) => c.setState("selectElement", e),
|
|
4201
|
+
setListElement: (e) => c.setState("listElement", e)
|
|
4202
|
+
};
|
|
4203
|
+
}
|
|
4204
|
+
function yc(e) {
|
|
4205
|
+
let t = _c();
|
|
4206
|
+
return e = {
|
|
4207
|
+
...e,
|
|
4208
|
+
combobox: e.combobox === void 0 ? t : e.combobox
|
|
4209
|
+
}, mc(e);
|
|
4210
|
+
}
|
|
4211
|
+
function bc(e, t, n) {
|
|
4212
|
+
return it(t, [n.combobox]), Q(e, n, "value", "setValue"), Q(e, n, "setValueOnMove"), Object.assign(Qs(hc(e, t, n), t, n), { combobox: n.combobox });
|
|
4213
|
+
}
|
|
4214
|
+
function xc(e = {}) {
|
|
4215
|
+
e = yc(e);
|
|
4216
|
+
let [t, n] = mn(vc, e);
|
|
4217
|
+
return bc(t, n, e);
|
|
4218
|
+
}
|
|
4219
|
+
function Sc(e = {}) {
|
|
4220
|
+
return /* @__PURE__ */ C(Jt, {
|
|
4221
|
+
value: xc(e),
|
|
4222
|
+
children: e.children
|
|
4223
|
+
});
|
|
4224
|
+
}
|
|
4225
|
+
var $ = {
|
|
4226
|
+
agentSelector: "_agentSelector_6xmt4_1",
|
|
4227
|
+
agentAlignmentLeft: "_agentAlignmentLeft_6xmt4_1",
|
|
4228
|
+
agentAlignmentOffsetFromLeft: "_agentAlignmentOffsetFromLeft_6xmt4_4",
|
|
4229
|
+
agentSelectorButton: "_agentSelectorButton_6xmt4_7",
|
|
4230
|
+
agentStatus: "_agentStatus_6xmt4_11",
|
|
4231
|
+
agentLoader: "_agentLoader_6xmt4_24",
|
|
4232
|
+
agentError: "_agentError_6xmt4_27",
|
|
4233
|
+
triggerChip: "_triggerChip_6xmt4_30",
|
|
4234
|
+
agentLabel: "_agentLabel_6xmt4_36",
|
|
4235
|
+
dropdownIndicator: "_dropdownIndicator_6xmt4_42",
|
|
4236
|
+
sidebar: "_sidebar_6xmt4_57",
|
|
4237
|
+
agentListRetryButton: "_agentListRetryButton_6xmt4_70",
|
|
4238
|
+
agentList: "_agentList_6xmt4_70",
|
|
4239
|
+
agentListItemIcon: "_agentListItemIcon_6xmt4_102",
|
|
4240
|
+
agentListContainer: "_agentListContainer_6xmt4_107"
|
|
4241
|
+
};
|
|
4242
|
+
function Cc({ agents: d, contentClassName: f, onErrorAction: p, recordAction: h, requestState: _, disabled: v, onAgentsListOpen: y, selectedAgent: S, selectorAlignment: T = s.OFFSET_FROM_LEFT, triggerChipClassName: E, useAgentLocalStorage: te = !1, variant: ne = "modal" }) {
|
|
4243
|
+
let { formatMessage: I } = ee(), [re, ie] = x(!1), ae = _ === c.ERROR, [oe, se] = x(ae), [ce, le] = u(n), ue = l(), de = _ === c.SUCCESS, L = _ === c.IN_PROGRESS, fe = I(t.selectAgent), pe = I(t.defaultAgent), R = "";
|
|
4244
|
+
de ? R = S?.name ?? fe : ae && (R = pe);
|
|
4245
|
+
let z = b(null), { Wrapper: me, wrapperProps: he } = N({
|
|
4246
|
+
ref: z,
|
|
4247
|
+
textValue: R
|
|
4248
|
+
});
|
|
4249
|
+
g(() => {
|
|
4250
|
+
re && h && h({
|
|
4251
|
+
...i,
|
|
4252
|
+
action: r,
|
|
4253
|
+
target: a.OPEN_SELECTOR
|
|
4254
|
+
});
|
|
4255
|
+
}, [re, h]), g(() => {
|
|
4256
|
+
if (te && ce) {
|
|
4257
|
+
let e = d.find((e) => e.id === ce);
|
|
4258
|
+
e ? ue({
|
|
4259
|
+
type: o.SET_SELECTED_AGENT,
|
|
4260
|
+
id: e.id
|
|
4261
|
+
}) : le(null);
|
|
4262
|
+
}
|
|
4263
|
+
}, [d]);
|
|
4264
|
+
let ge = m((e) => {
|
|
4265
|
+
ie(!1), ue({
|
|
4266
|
+
type: o.SET_SELECTED_AGENT,
|
|
4267
|
+
id: e.id
|
|
4268
|
+
}), te && le(e.id), h && h({
|
|
4269
|
+
...i,
|
|
4270
|
+
action: r,
|
|
4271
|
+
target: a.SELECT_AGENT
|
|
4272
|
+
});
|
|
4273
|
+
}, [
|
|
4274
|
+
ue,
|
|
4275
|
+
h,
|
|
4276
|
+
le,
|
|
4277
|
+
te
|
|
4278
|
+
]), _e = m(() => {
|
|
4279
|
+
ie(!1), p(), h && h({
|
|
4280
|
+
...i,
|
|
4281
|
+
action: r,
|
|
4282
|
+
target: a.RETRY_LOADING_AGENTS
|
|
4283
|
+
});
|
|
4284
|
+
}, [p, h]), ve = m((e) => se(ae && ae && !re && e ? e : !1), [ae, re]), ye = (e) => {
|
|
4285
|
+
e && y && y(), ie(e);
|
|
4286
|
+
}, B = ne === "sidebar" && $.sidebar, be = (e) => {
|
|
4287
|
+
(e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "ArrowLeft" || e.key === "ArrowRight") && e.stopPropagation();
|
|
4288
|
+
}, xe = $.agentAlignmentOffsetFromLeft;
|
|
4289
|
+
return T === s.LEFT && (xe = $.agentAlignmentLeft), /* @__PURE__ */ C(O.Group, {
|
|
4290
|
+
className: F($.agentSelector, xe, E, B),
|
|
4291
|
+
name: fe,
|
|
4292
|
+
onKeyDown: be,
|
|
4293
|
+
type: "multiple",
|
|
4294
|
+
children: /* @__PURE__ */ w(Sc, {
|
|
4295
|
+
defaultValue: d[0]?.id,
|
|
4296
|
+
open: re,
|
|
4297
|
+
setOpen: ye,
|
|
4298
|
+
children: [/* @__PURE__ */ C(M, { children: /* @__PURE__ */ C(j, {
|
|
4299
|
+
content: I(t.errorTooltip),
|
|
4300
|
+
onOpenChange: ve,
|
|
4301
|
+
open: oe,
|
|
4302
|
+
side: "bottom",
|
|
4303
|
+
variant: "error",
|
|
4304
|
+
children: /* @__PURE__ */ C(Hr, {
|
|
4305
|
+
className: $.selectAgentButton,
|
|
4306
|
+
disabled: v || L,
|
|
4307
|
+
render: /* @__PURE__ */ w(O.TriggerChip, {
|
|
4308
|
+
"aria-label": R,
|
|
4309
|
+
className: $.triggerChip,
|
|
4310
|
+
"data-target-id": "FilterChip.TriggerChip-agentSelectorTrigger",
|
|
4311
|
+
value: "trigger-chip",
|
|
4312
|
+
children: [
|
|
4313
|
+
/* @__PURE__ */ C(A, {
|
|
4314
|
+
className: $.agentStatus,
|
|
4315
|
+
colorIndex: 0,
|
|
4316
|
+
text: I(t.agent)
|
|
4317
|
+
}),
|
|
4318
|
+
L && /* @__PURE__ */ C(k, {
|
|
4319
|
+
"aria-label": I(t.loadingMessage),
|
|
4320
|
+
className: $.agentLoader,
|
|
4321
|
+
variant: "default"
|
|
4322
|
+
}),
|
|
4323
|
+
ae && /* @__PURE__ */ C(P, {
|
|
4324
|
+
className: $.agentError,
|
|
4325
|
+
height: "1rem",
|
|
4326
|
+
role: "presentation",
|
|
4327
|
+
width: "1rem"
|
|
4328
|
+
}),
|
|
4329
|
+
/* @__PURE__ */ C(me, {
|
|
4330
|
+
...he,
|
|
4331
|
+
children: /* @__PURE__ */ C(O.Label, {
|
|
4332
|
+
ref: z,
|
|
4333
|
+
className: $.agentLabel,
|
|
4334
|
+
children: R
|
|
4335
|
+
})
|
|
4336
|
+
}),
|
|
4337
|
+
!L && /* @__PURE__ */ C("div", {
|
|
4338
|
+
className: $.dropdownIndicator,
|
|
4339
|
+
children: /* @__PURE__ */ C(O.DropdownIndicator, {})
|
|
4340
|
+
})
|
|
4341
|
+
]
|
|
4342
|
+
})
|
|
4343
|
+
})
|
|
4344
|
+
}) }), /* @__PURE__ */ w(Xs, {
|
|
4345
|
+
"aria-label": I(t.agentList),
|
|
4346
|
+
className: F($.agentListContainer, B),
|
|
4347
|
+
unmountOnHide: !0,
|
|
4348
|
+
children: [de && /* @__PURE__ */ C(Oi, {
|
|
4349
|
+
className: F($.agentList, f),
|
|
4350
|
+
children: d.map((t, n) => /* @__PURE__ */ C(ci, {
|
|
4351
|
+
clickOnEnter: !0,
|
|
4352
|
+
clickOnSpace: !0,
|
|
4353
|
+
focusable: !0,
|
|
4354
|
+
focusOnHover: !0,
|
|
4355
|
+
hideOnClick: !0,
|
|
4356
|
+
onClick: () => {
|
|
4357
|
+
ge(t);
|
|
4358
|
+
},
|
|
4359
|
+
setValueOnClick: !0,
|
|
4360
|
+
value: t.id,
|
|
4361
|
+
children: /* @__PURE__ */ C(e, { agent: t })
|
|
4362
|
+
}, t.id))
|
|
4363
|
+
}), ae && /* @__PURE__ */ C(D, {
|
|
4364
|
+
className: F($.agentListRetryButton, B),
|
|
4365
|
+
onClick: _e,
|
|
4366
|
+
variant: "tertiary",
|
|
4367
|
+
"data-target-id": "Button-errorMessage",
|
|
4368
|
+
children: I(t.errorMessage)
|
|
4369
|
+
})]
|
|
4370
|
+
})]
|
|
4371
|
+
})
|
|
4372
|
+
});
|
|
4373
|
+
}
|
|
4374
|
+
export { Cc as t };
|