@krosoft/react 0.0.86 → 0.0.87
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/AppSubTitle-DaFa30Qp.js +13 -0
- package/dist/{AppTitle-2BwwWSnl.js → AppTitle-COtcNGNr.js} +4 -4
- package/dist/AppVerticalTabs-aeKDheVe.js +829 -0
- package/dist/{FormDialog--99pXUqP.js → FormDialog-B3u7bHU_.js} +18 -18
- package/dist/{MetricCard-BRAVWmNa.js → MetricCard-L5ETuqBs.js} +3 -3
- package/dist/{SearchInput-CJe4D2eD.js → SearchInput-BxnaShYy.js} +3 -3
- package/dist/{TableFilter-5_KAD-Po.js → TableFilter-RzydxKBF.js} +5 -5
- package/dist/{TableSettings-XUosW5z7.js → TableSettings-Bwysm3KH.js} +15 -15
- package/dist/{ThemeSelector-CpHyRG1j.js → ThemeSelector-mZBbr2qt.js} +3 -3
- package/dist/{Topbar-B-4vtD89.js → Topbar-DzFClMWt.js} +4 -4
- package/dist/{badge-Bw-aBz_H.js → badge-DCS7KMnM.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +38 -36
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/AppSubTitle.d.ts +8 -0
- package/dist/components/core/layouts/AppSubTitle.d.ts.map +1 -0
- package/dist/components/core/layouts/index.d.ts +1 -0
- package/dist/components/core/layouts/index.d.ts.map +1 -1
- package/dist/components/core/layouts/index.js +5 -3
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +84 -82
- package/dist/components/ui/index.js +4 -4
- package/dist/dropdown-menu-BDcm9kW8.js +1086 -0
- package/dist/index-DUnCfjrC.js +2176 -0
- package/dist/popover-PsZp711z.js +4533 -0
- package/dist/select-C6w0ck7-.js +1737 -0
- package/dist/tooltip-CtjaR1qq.js +337 -0
- package/dist/types/UseDataTableResult.d.ts +1 -1
- package/dist/types/UseDataTableResult.d.ts.map +1 -1
- package/package.json +6 -5
- package/dist/AppVerticalTabs-Czaejh1i.js +0 -1302
- package/dist/dropdown-menu-D3C3wkLH.js +0 -1685
- package/dist/floating-ui.react-dom-BIcsGc3t.js +0 -1681
- package/dist/popover-BEB_r1Wm.js +0 -5897
- package/dist/select-B_OLzx1W.js +0 -2071
- package/dist/tooltip-DzQngJZK.js +0 -828
package/dist/select-B_OLzx1W.js
DELETED
|
@@ -1,2071 +0,0 @@
|
|
|
1
|
-
import { jsx as v, jsxs as ie, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
-
import { c as te } from "./index-gWiv5-6R.js";
|
|
3
|
-
import * as a from "react";
|
|
4
|
-
import ae, { useState as _n } from "react";
|
|
5
|
-
import * as qe from "react-dom";
|
|
6
|
-
import Mn from "react-dom";
|
|
7
|
-
import { a as Ln, q as Qe, u as k, d as Dn, e as M, f as ve, g as kn, h as Bn, p as G, o as Fn, s as Wn, i as Hn, j as Vn, k as Un, m as $n, n as Kn, l as jn, r as Je, t as rt, C as gt } from "./floating-ui.react-dom-BIcsGc3t.js";
|
|
8
|
-
import { c as yt } from "./createLucideIcon-CRdjzt2A.js";
|
|
9
|
-
function zn(e) {
|
|
10
|
-
const t = a.useRef({ value: e, previous: e });
|
|
11
|
-
return a.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @license lucide-react v1.16.0 - ISC
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the ISC license.
|
|
17
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
|
-
const Yn = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Xn = yt("check", Yn);
|
|
20
|
-
/**
|
|
21
|
-
* @license lucide-react v1.16.0 - ISC
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the ISC license.
|
|
24
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/
|
|
26
|
-
const Gn = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Zn = yt("chevron-up", Gn);
|
|
27
|
-
function ot(e, [t, n]) {
|
|
28
|
-
return Math.min(n, Math.max(t, e));
|
|
29
|
-
}
|
|
30
|
-
// @__NO_SIDE_EFFECTS__
|
|
31
|
-
function Ae(e) {
|
|
32
|
-
const t = /* @__PURE__ */ qn(e), n = a.forwardRef((r, o) => {
|
|
33
|
-
const { children: s, ...c } = r, i = a.Children.toArray(s), u = i.find(Jn);
|
|
34
|
-
if (u) {
|
|
35
|
-
const d = u.props.children, m = i.map((g) => g === u ? a.Children.count(d) > 1 ? a.Children.only(null) : a.isValidElement(d) ? d.props.children : null : g);
|
|
36
|
-
return /* @__PURE__ */ v(t, { ...c, ref: o, children: a.isValidElement(d) ? a.cloneElement(d, void 0, m) : null });
|
|
37
|
-
}
|
|
38
|
-
return /* @__PURE__ */ v(t, { ...c, ref: o, children: s });
|
|
39
|
-
});
|
|
40
|
-
return n.displayName = `${e}.Slot`, n;
|
|
41
|
-
}
|
|
42
|
-
// @__NO_SIDE_EFFECTS__
|
|
43
|
-
function qn(e) {
|
|
44
|
-
const t = a.forwardRef((n, r) => {
|
|
45
|
-
const { children: o, ...s } = n;
|
|
46
|
-
if (a.isValidElement(o)) {
|
|
47
|
-
const c = tr(o), i = er(s, o.props);
|
|
48
|
-
return o.type !== a.Fragment && (i.ref = r ? Ln(r, c) : c), a.cloneElement(o, i);
|
|
49
|
-
}
|
|
50
|
-
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
51
|
-
});
|
|
52
|
-
return t.displayName = `${e}.SlotClone`, t;
|
|
53
|
-
}
|
|
54
|
-
var Qn = Symbol("radix.slottable");
|
|
55
|
-
function Jn(e) {
|
|
56
|
-
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Qn;
|
|
57
|
-
}
|
|
58
|
-
function er(e, t) {
|
|
59
|
-
const n = { ...t };
|
|
60
|
-
for (const r in t) {
|
|
61
|
-
const o = e[r], s = t[r];
|
|
62
|
-
/^on[A-Z]/.test(r) ? o && s ? n[r] = (...i) => {
|
|
63
|
-
const u = s(...i);
|
|
64
|
-
return o(...i), u;
|
|
65
|
-
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...s } : r === "className" && (n[r] = [o, s].filter(Boolean).join(" "));
|
|
66
|
-
}
|
|
67
|
-
return { ...e, ...n };
|
|
68
|
-
}
|
|
69
|
-
function tr(e) {
|
|
70
|
-
var r, o;
|
|
71
|
-
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
72
|
-
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
73
|
-
}
|
|
74
|
-
function nr(e) {
|
|
75
|
-
const t = e + "CollectionProvider", [n, r] = Qe(t), [o, s] = n(
|
|
76
|
-
t,
|
|
77
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
78
|
-
), c = (l) => {
|
|
79
|
-
const { scope: p, children: y } = l, f = ae.useRef(null), h = ae.useRef(/* @__PURE__ */ new Map()).current;
|
|
80
|
-
return /* @__PURE__ */ v(o, { scope: p, itemMap: h, collectionRef: f, children: y });
|
|
81
|
-
};
|
|
82
|
-
c.displayName = t;
|
|
83
|
-
const i = e + "CollectionSlot", u = /* @__PURE__ */ Ae(i), d = ae.forwardRef(
|
|
84
|
-
(l, p) => {
|
|
85
|
-
const { scope: y, children: f } = l, h = s(i, y), C = k(p, h.collectionRef);
|
|
86
|
-
return /* @__PURE__ */ v(u, { ref: C, children: f });
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
d.displayName = i;
|
|
90
|
-
const m = e + "CollectionItemSlot", g = "data-radix-collection-item", S = /* @__PURE__ */ Ae(m), w = ae.forwardRef(
|
|
91
|
-
(l, p) => {
|
|
92
|
-
const { scope: y, children: f, ...h } = l, C = ae.useRef(null), P = k(p, C), R = s(m, y);
|
|
93
|
-
return ae.useEffect(() => (R.itemMap.set(C, { ref: C, ...h }), () => void R.itemMap.delete(C))), /* @__PURE__ */ v(S, { [g]: "", ref: P, children: f });
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
w.displayName = m;
|
|
97
|
-
function E(l) {
|
|
98
|
-
const p = s(e + "CollectionConsumer", l);
|
|
99
|
-
return ae.useCallback(() => {
|
|
100
|
-
const f = p.collectionRef.current;
|
|
101
|
-
if (!f) return [];
|
|
102
|
-
const h = Array.from(f.querySelectorAll(`[${g}]`));
|
|
103
|
-
return Array.from(p.itemMap.values()).sort(
|
|
104
|
-
(R, b) => h.indexOf(R.ref.current) - h.indexOf(b.ref.current)
|
|
105
|
-
);
|
|
106
|
-
}, [p.collectionRef, p.itemMap]);
|
|
107
|
-
}
|
|
108
|
-
return [
|
|
109
|
-
{ Provider: c, Slot: d, ItemSlot: w },
|
|
110
|
-
E,
|
|
111
|
-
r
|
|
112
|
-
];
|
|
113
|
-
}
|
|
114
|
-
var rr = a.createContext(void 0);
|
|
115
|
-
function or(e) {
|
|
116
|
-
const t = a.useContext(rr);
|
|
117
|
-
return e || t || "ltr";
|
|
118
|
-
}
|
|
119
|
-
var ar = [
|
|
120
|
-
"a",
|
|
121
|
-
"button",
|
|
122
|
-
"div",
|
|
123
|
-
"form",
|
|
124
|
-
"h2",
|
|
125
|
-
"h3",
|
|
126
|
-
"img",
|
|
127
|
-
"input",
|
|
128
|
-
"label",
|
|
129
|
-
"li",
|
|
130
|
-
"nav",
|
|
131
|
-
"ol",
|
|
132
|
-
"p",
|
|
133
|
-
"select",
|
|
134
|
-
"span",
|
|
135
|
-
"svg",
|
|
136
|
-
"ul"
|
|
137
|
-
], _ = ar.reduce((e, t) => {
|
|
138
|
-
const n = /* @__PURE__ */ Ae(`Primitive.${t}`), r = a.forwardRef((o, s) => {
|
|
139
|
-
const { asChild: c, ...i } = o, u = c ? n : t;
|
|
140
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ v(u, { ...i, ref: s });
|
|
141
|
-
});
|
|
142
|
-
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
143
|
-
}, {});
|
|
144
|
-
function ir(e, t) {
|
|
145
|
-
e && qe.flushSync(() => e.dispatchEvent(t));
|
|
146
|
-
}
|
|
147
|
-
var sr = "DismissableLayer", $e = "dismissableLayer.update", cr = "dismissableLayer.pointerDownOutside", lr = "dismissableLayer.focusOutside", at, St = a.createContext({
|
|
148
|
-
layers: /* @__PURE__ */ new Set(),
|
|
149
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
150
|
-
branches: /* @__PURE__ */ new Set()
|
|
151
|
-
}), wt = a.forwardRef(
|
|
152
|
-
(e, t) => {
|
|
153
|
-
const {
|
|
154
|
-
disableOutsidePointerEvents: n = !1,
|
|
155
|
-
onEscapeKeyDown: r,
|
|
156
|
-
onPointerDownOutside: o,
|
|
157
|
-
onFocusOutside: s,
|
|
158
|
-
onInteractOutside: c,
|
|
159
|
-
onDismiss: i,
|
|
160
|
-
...u
|
|
161
|
-
} = e, d = a.useContext(St), [m, g] = a.useState(null), S = (m == null ? void 0 : m.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, w] = a.useState({}), E = k(t, (b) => g(b)), l = Array.from(d.layers), [p] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), y = l.indexOf(p), f = m ? l.indexOf(m) : -1, h = d.layersWithOutsidePointerEventsDisabled.size > 0, C = f >= y, P = fr((b) => {
|
|
162
|
-
const O = b.target, L = [...d.branches].some((H) => H.contains(O));
|
|
163
|
-
!C || L || (o == null || o(b), c == null || c(b), b.defaultPrevented || i == null || i());
|
|
164
|
-
}, S), R = pr((b) => {
|
|
165
|
-
const O = b.target;
|
|
166
|
-
[...d.branches].some((H) => H.contains(O)) || (s == null || s(b), c == null || c(b), b.defaultPrevented || i == null || i());
|
|
167
|
-
}, S);
|
|
168
|
-
return Dn((b) => {
|
|
169
|
-
f === d.layers.size - 1 && (r == null || r(b), !b.defaultPrevented && i && (b.preventDefault(), i()));
|
|
170
|
-
}, S), a.useEffect(() => {
|
|
171
|
-
if (m)
|
|
172
|
-
return n && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (at = S.body.style.pointerEvents, S.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(m)), d.layers.add(m), it(), () => {
|
|
173
|
-
n && d.layersWithOutsidePointerEventsDisabled.size === 1 && (S.body.style.pointerEvents = at);
|
|
174
|
-
};
|
|
175
|
-
}, [m, S, n, d]), a.useEffect(() => () => {
|
|
176
|
-
m && (d.layers.delete(m), d.layersWithOutsidePointerEventsDisabled.delete(m), it());
|
|
177
|
-
}, [m, d]), a.useEffect(() => {
|
|
178
|
-
const b = () => w({});
|
|
179
|
-
return document.addEventListener($e, b), () => document.removeEventListener($e, b);
|
|
180
|
-
}, []), /* @__PURE__ */ v(
|
|
181
|
-
_.div,
|
|
182
|
-
{
|
|
183
|
-
...u,
|
|
184
|
-
ref: E,
|
|
185
|
-
style: {
|
|
186
|
-
pointerEvents: h ? C ? "auto" : "none" : void 0,
|
|
187
|
-
...e.style
|
|
188
|
-
},
|
|
189
|
-
onFocusCapture: M(e.onFocusCapture, R.onFocusCapture),
|
|
190
|
-
onBlurCapture: M(e.onBlurCapture, R.onBlurCapture),
|
|
191
|
-
onPointerDownCapture: M(
|
|
192
|
-
e.onPointerDownCapture,
|
|
193
|
-
P.onPointerDownCapture
|
|
194
|
-
)
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
wt.displayName = sr;
|
|
200
|
-
var ur = "DismissableLayerBranch", dr = a.forwardRef((e, t) => {
|
|
201
|
-
const n = a.useContext(St), r = a.useRef(null), o = k(t, r);
|
|
202
|
-
return a.useEffect(() => {
|
|
203
|
-
const s = r.current;
|
|
204
|
-
if (s)
|
|
205
|
-
return n.branches.add(s), () => {
|
|
206
|
-
n.branches.delete(s);
|
|
207
|
-
};
|
|
208
|
-
}, [n.branches]), /* @__PURE__ */ v(_.div, { ...e, ref: o });
|
|
209
|
-
});
|
|
210
|
-
dr.displayName = ur;
|
|
211
|
-
function fr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
212
|
-
const n = ve(e), r = a.useRef(!1), o = a.useRef(() => {
|
|
213
|
-
});
|
|
214
|
-
return a.useEffect(() => {
|
|
215
|
-
const s = (i) => {
|
|
216
|
-
if (i.target && !r.current) {
|
|
217
|
-
let u = function() {
|
|
218
|
-
Ct(
|
|
219
|
-
cr,
|
|
220
|
-
n,
|
|
221
|
-
d,
|
|
222
|
-
{ discrete: !0 }
|
|
223
|
-
);
|
|
224
|
-
};
|
|
225
|
-
const d = { originalEvent: i };
|
|
226
|
-
i.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = u, t.addEventListener("click", o.current, { once: !0 })) : u();
|
|
227
|
-
} else
|
|
228
|
-
t.removeEventListener("click", o.current);
|
|
229
|
-
r.current = !1;
|
|
230
|
-
}, c = window.setTimeout(() => {
|
|
231
|
-
t.addEventListener("pointerdown", s);
|
|
232
|
-
}, 0);
|
|
233
|
-
return () => {
|
|
234
|
-
window.clearTimeout(c), t.removeEventListener("pointerdown", s), t.removeEventListener("click", o.current);
|
|
235
|
-
};
|
|
236
|
-
}, [t, n]), {
|
|
237
|
-
// ensures we check React component tree (not just DOM tree)
|
|
238
|
-
onPointerDownCapture: () => r.current = !0
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
function pr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
242
|
-
const n = ve(e), r = a.useRef(!1);
|
|
243
|
-
return a.useEffect(() => {
|
|
244
|
-
const o = (s) => {
|
|
245
|
-
s.target && !r.current && Ct(lr, n, { originalEvent: s }, {
|
|
246
|
-
discrete: !1
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
|
|
250
|
-
}, [t, n]), {
|
|
251
|
-
onFocusCapture: () => r.current = !0,
|
|
252
|
-
onBlurCapture: () => r.current = !1
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
function it() {
|
|
256
|
-
const e = new CustomEvent($e);
|
|
257
|
-
document.dispatchEvent(e);
|
|
258
|
-
}
|
|
259
|
-
function Ct(e, t, n, { discrete: r }) {
|
|
260
|
-
const o = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
261
|
-
t && o.addEventListener(e, t, { once: !0 }), r ? ir(o, s) : o.dispatchEvent(s);
|
|
262
|
-
}
|
|
263
|
-
var ke = 0;
|
|
264
|
-
function vr() {
|
|
265
|
-
a.useEffect(() => {
|
|
266
|
-
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
267
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ?? st()), document.body.insertAdjacentElement("beforeend", e[1] ?? st()), ke++, () => {
|
|
268
|
-
ke === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ke--;
|
|
269
|
-
};
|
|
270
|
-
}, []);
|
|
271
|
-
}
|
|
272
|
-
function st() {
|
|
273
|
-
const e = document.createElement("span");
|
|
274
|
-
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
275
|
-
}
|
|
276
|
-
var Be = "focusScope.autoFocusOnMount", Fe = "focusScope.autoFocusOnUnmount", ct = { bubbles: !1, cancelable: !0 }, mr = "FocusScope", bt = a.forwardRef((e, t) => {
|
|
277
|
-
const {
|
|
278
|
-
loop: n = !1,
|
|
279
|
-
trapped: r = !1,
|
|
280
|
-
onMountAutoFocus: o,
|
|
281
|
-
onUnmountAutoFocus: s,
|
|
282
|
-
...c
|
|
283
|
-
} = e, [i, u] = a.useState(null), d = ve(o), m = ve(s), g = a.useRef(null), S = k(t, (l) => u(l)), w = a.useRef({
|
|
284
|
-
paused: !1,
|
|
285
|
-
pause() {
|
|
286
|
-
this.paused = !0;
|
|
287
|
-
},
|
|
288
|
-
resume() {
|
|
289
|
-
this.paused = !1;
|
|
290
|
-
}
|
|
291
|
-
}).current;
|
|
292
|
-
a.useEffect(() => {
|
|
293
|
-
if (r) {
|
|
294
|
-
let l = function(h) {
|
|
295
|
-
if (w.paused || !i) return;
|
|
296
|
-
const C = h.target;
|
|
297
|
-
i.contains(C) ? g.current = C : ee(g.current, { select: !0 });
|
|
298
|
-
}, p = function(h) {
|
|
299
|
-
if (w.paused || !i) return;
|
|
300
|
-
const C = h.relatedTarget;
|
|
301
|
-
C !== null && (i.contains(C) || ee(g.current, { select: !0 }));
|
|
302
|
-
}, y = function(h) {
|
|
303
|
-
if (document.activeElement === document.body)
|
|
304
|
-
for (const P of h)
|
|
305
|
-
P.removedNodes.length > 0 && ee(i);
|
|
306
|
-
};
|
|
307
|
-
document.addEventListener("focusin", l), document.addEventListener("focusout", p);
|
|
308
|
-
const f = new MutationObserver(y);
|
|
309
|
-
return i && f.observe(i, { childList: !0, subtree: !0 }), () => {
|
|
310
|
-
document.removeEventListener("focusin", l), document.removeEventListener("focusout", p), f.disconnect();
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
}, [r, i, w.paused]), a.useEffect(() => {
|
|
314
|
-
if (i) {
|
|
315
|
-
ut.add(w);
|
|
316
|
-
const l = document.activeElement;
|
|
317
|
-
if (!i.contains(l)) {
|
|
318
|
-
const y = new CustomEvent(Be, ct);
|
|
319
|
-
i.addEventListener(Be, d), i.dispatchEvent(y), y.defaultPrevented || (hr(Cr(Et(i)), { select: !0 }), document.activeElement === l && ee(i));
|
|
320
|
-
}
|
|
321
|
-
return () => {
|
|
322
|
-
i.removeEventListener(Be, d), setTimeout(() => {
|
|
323
|
-
const y = new CustomEvent(Fe, ct);
|
|
324
|
-
i.addEventListener(Fe, m), i.dispatchEvent(y), y.defaultPrevented || ee(l ?? document.body, { select: !0 }), i.removeEventListener(Fe, m), ut.remove(w);
|
|
325
|
-
}, 0);
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
}, [i, d, m, w]);
|
|
329
|
-
const E = a.useCallback(
|
|
330
|
-
(l) => {
|
|
331
|
-
if (!n && !r || w.paused) return;
|
|
332
|
-
const p = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, y = document.activeElement;
|
|
333
|
-
if (p && y) {
|
|
334
|
-
const f = l.currentTarget, [h, C] = gr(f);
|
|
335
|
-
h && C ? !l.shiftKey && y === C ? (l.preventDefault(), n && ee(h, { select: !0 })) : l.shiftKey && y === h && (l.preventDefault(), n && ee(C, { select: !0 })) : y === f && l.preventDefault();
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
[n, r, w.paused]
|
|
339
|
-
);
|
|
340
|
-
return /* @__PURE__ */ v(_.div, { tabIndex: -1, ...c, ref: S, onKeyDown: E });
|
|
341
|
-
});
|
|
342
|
-
bt.displayName = mr;
|
|
343
|
-
function hr(e, { select: t = !1 } = {}) {
|
|
344
|
-
const n = document.activeElement;
|
|
345
|
-
for (const r of e)
|
|
346
|
-
if (ee(r, { select: t }), document.activeElement !== n) return;
|
|
347
|
-
}
|
|
348
|
-
function gr(e) {
|
|
349
|
-
const t = Et(e), n = lt(t, e), r = lt(t.reverse(), e);
|
|
350
|
-
return [n, r];
|
|
351
|
-
}
|
|
352
|
-
function Et(e) {
|
|
353
|
-
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
354
|
-
acceptNode: (r) => {
|
|
355
|
-
const o = r.tagName === "INPUT" && r.type === "hidden";
|
|
356
|
-
return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
360
|
-
return t;
|
|
361
|
-
}
|
|
362
|
-
function lt(e, t) {
|
|
363
|
-
for (const n of e)
|
|
364
|
-
if (!yr(n, { upTo: t })) return n;
|
|
365
|
-
}
|
|
366
|
-
function yr(e, { upTo: t }) {
|
|
367
|
-
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
368
|
-
for (; e; ) {
|
|
369
|
-
if (t !== void 0 && e === t) return !1;
|
|
370
|
-
if (getComputedStyle(e).display === "none") return !0;
|
|
371
|
-
e = e.parentElement;
|
|
372
|
-
}
|
|
373
|
-
return !1;
|
|
374
|
-
}
|
|
375
|
-
function Sr(e) {
|
|
376
|
-
return e instanceof HTMLInputElement && "select" in e;
|
|
377
|
-
}
|
|
378
|
-
function ee(e, { select: t = !1 } = {}) {
|
|
379
|
-
if (e && e.focus) {
|
|
380
|
-
const n = document.activeElement;
|
|
381
|
-
e.focus({ preventScroll: !0 }), e !== n && Sr(e) && t && e.select();
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
var ut = wr();
|
|
385
|
-
function wr() {
|
|
386
|
-
let e = [];
|
|
387
|
-
return {
|
|
388
|
-
add(t) {
|
|
389
|
-
const n = e[0];
|
|
390
|
-
t !== n && (n == null || n.pause()), e = dt(e, t), e.unshift(t);
|
|
391
|
-
},
|
|
392
|
-
remove(t) {
|
|
393
|
-
var n;
|
|
394
|
-
e = dt(e, t), (n = e[0]) == null || n.resume();
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
function dt(e, t) {
|
|
399
|
-
const n = [...e], r = n.indexOf(t);
|
|
400
|
-
return r !== -1 && n.splice(r, 1), n;
|
|
401
|
-
}
|
|
402
|
-
function Cr(e) {
|
|
403
|
-
return e.filter((t) => t.tagName !== "A");
|
|
404
|
-
}
|
|
405
|
-
var br = "Arrow", xt = a.forwardRef((e, t) => {
|
|
406
|
-
const { children: n, width: r = 10, height: o = 5, ...s } = e;
|
|
407
|
-
return /* @__PURE__ */ v(
|
|
408
|
-
_.svg,
|
|
409
|
-
{
|
|
410
|
-
...s,
|
|
411
|
-
ref: t,
|
|
412
|
-
width: r,
|
|
413
|
-
height: o,
|
|
414
|
-
viewBox: "0 0 30 10",
|
|
415
|
-
preserveAspectRatio: "none",
|
|
416
|
-
children: e.asChild ? n : /* @__PURE__ */ v("polygon", { points: "0,0 30,0 15,10" })
|
|
417
|
-
}
|
|
418
|
-
);
|
|
419
|
-
});
|
|
420
|
-
xt.displayName = br;
|
|
421
|
-
var Er = xt, et = "Popper", [Pt, Rt] = Qe(et), [xr, Nt] = Pt(et), Tt = (e) => {
|
|
422
|
-
const { __scopePopper: t, children: n } = e, [r, o] = a.useState(null);
|
|
423
|
-
return /* @__PURE__ */ v(xr, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
424
|
-
};
|
|
425
|
-
Tt.displayName = et;
|
|
426
|
-
var It = "PopperAnchor", At = a.forwardRef(
|
|
427
|
-
(e, t) => {
|
|
428
|
-
const { __scopePopper: n, virtualRef: r, ...o } = e, s = Nt(It, n), c = a.useRef(null), i = k(t, c), u = a.useRef(null);
|
|
429
|
-
return a.useEffect(() => {
|
|
430
|
-
const d = u.current;
|
|
431
|
-
u.current = (r == null ? void 0 : r.current) || c.current, d !== u.current && s.onAnchorChange(u.current);
|
|
432
|
-
}), r ? null : /* @__PURE__ */ v(_.div, { ...o, ref: i });
|
|
433
|
-
}
|
|
434
|
-
);
|
|
435
|
-
At.displayName = It;
|
|
436
|
-
var tt = "PopperContent", [Pr, Rr] = Pt(tt), Ot = a.forwardRef(
|
|
437
|
-
(e, t) => {
|
|
438
|
-
var x, A, W, I, N, T;
|
|
439
|
-
const {
|
|
440
|
-
__scopePopper: n,
|
|
441
|
-
side: r = "bottom",
|
|
442
|
-
sideOffset: o = 0,
|
|
443
|
-
align: s = "center",
|
|
444
|
-
alignOffset: c = 0,
|
|
445
|
-
arrowPadding: i = 0,
|
|
446
|
-
avoidCollisions: u = !0,
|
|
447
|
-
collisionBoundary: d = [],
|
|
448
|
-
collisionPadding: m = 0,
|
|
449
|
-
sticky: g = "partial",
|
|
450
|
-
hideWhenDetached: S = !1,
|
|
451
|
-
updatePositionStrategy: w = "optimized",
|
|
452
|
-
onPlaced: E,
|
|
453
|
-
...l
|
|
454
|
-
} = e, p = Nt(tt, n), [y, f] = a.useState(null), h = k(t, (K) => f(K)), [C, P] = a.useState(null), R = kn(C), b = (R == null ? void 0 : R.width) ?? 0, O = (R == null ? void 0 : R.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), H = typeof m == "number" ? m : { top: 0, right: 0, bottom: 0, left: 0, ...m }, D = Array.isArray(d) ? d : [d], U = D.length > 0, $ = {
|
|
455
|
-
padding: H,
|
|
456
|
-
boundary: D.filter(Tr),
|
|
457
|
-
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
458
|
-
altBoundary: U
|
|
459
|
-
}, { refs: z, floatingStyles: j, placement: B, isPositioned: V, middlewareData: F } = Bn({
|
|
460
|
-
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
461
|
-
strategy: "fixed",
|
|
462
|
-
placement: L,
|
|
463
|
-
whileElementsMounted: (...K) => Kn(...K, {
|
|
464
|
-
animationFrame: w === "always"
|
|
465
|
-
}),
|
|
466
|
-
elements: {
|
|
467
|
-
reference: p.anchor
|
|
468
|
-
},
|
|
469
|
-
middleware: [
|
|
470
|
-
Fn({ mainAxis: o + O, alignmentAxis: c }),
|
|
471
|
-
u && Wn({
|
|
472
|
-
mainAxis: !0,
|
|
473
|
-
crossAxis: !1,
|
|
474
|
-
limiter: g === "partial" ? jn() : void 0,
|
|
475
|
-
...$
|
|
476
|
-
}),
|
|
477
|
-
u && Hn({ ...$ }),
|
|
478
|
-
Vn({
|
|
479
|
-
...$,
|
|
480
|
-
apply: ({ elements: K, rects: Z, availableWidth: Se, availableHeight: we }) => {
|
|
481
|
-
const { width: Ce, height: On } = Z.reference, Ee = K.floating.style;
|
|
482
|
-
Ee.setProperty("--radix-popper-available-width", `${Se}px`), Ee.setProperty("--radix-popper-available-height", `${we}px`), Ee.setProperty("--radix-popper-anchor-width", `${Ce}px`), Ee.setProperty("--radix-popper-anchor-height", `${On}px`);
|
|
483
|
-
}
|
|
484
|
-
}),
|
|
485
|
-
C && Un({ element: C, padding: i }),
|
|
486
|
-
Ir({ arrowWidth: b, arrowHeight: O }),
|
|
487
|
-
S && $n({ strategy: "referenceHidden", ...$ })
|
|
488
|
-
]
|
|
489
|
-
}), [Y, he] = Lt(B), Q = ve(E);
|
|
490
|
-
G(() => {
|
|
491
|
-
V && (Q == null || Q());
|
|
492
|
-
}, [V, Q]);
|
|
493
|
-
const ge = (x = F.arrow) == null ? void 0 : x.x, ye = (A = F.arrow) == null ? void 0 : A.y, J = ((W = F.arrow) == null ? void 0 : W.centerOffset) !== 0, [le, oe] = a.useState();
|
|
494
|
-
return G(() => {
|
|
495
|
-
y && oe(window.getComputedStyle(y).zIndex);
|
|
496
|
-
}, [y]), /* @__PURE__ */ v(
|
|
497
|
-
"div",
|
|
498
|
-
{
|
|
499
|
-
ref: z.setFloating,
|
|
500
|
-
"data-radix-popper-content-wrapper": "",
|
|
501
|
-
style: {
|
|
502
|
-
...j,
|
|
503
|
-
transform: V ? j.transform : "translate(0, -200%)",
|
|
504
|
-
// keep off the page when measuring
|
|
505
|
-
minWidth: "max-content",
|
|
506
|
-
zIndex: le,
|
|
507
|
-
"--radix-popper-transform-origin": [
|
|
508
|
-
(I = F.transformOrigin) == null ? void 0 : I.x,
|
|
509
|
-
(N = F.transformOrigin) == null ? void 0 : N.y
|
|
510
|
-
].join(" "),
|
|
511
|
-
// hide the content if using the hide middleware and should be hidden
|
|
512
|
-
// set visibility to hidden and disable pointer events so the UI behaves
|
|
513
|
-
// as if the PopperContent isn't there at all
|
|
514
|
-
...((T = F.hide) == null ? void 0 : T.referenceHidden) && {
|
|
515
|
-
visibility: "hidden",
|
|
516
|
-
pointerEvents: "none"
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
dir: e.dir,
|
|
520
|
-
children: /* @__PURE__ */ v(
|
|
521
|
-
Pr,
|
|
522
|
-
{
|
|
523
|
-
scope: n,
|
|
524
|
-
placedSide: Y,
|
|
525
|
-
onArrowChange: P,
|
|
526
|
-
arrowX: ge,
|
|
527
|
-
arrowY: ye,
|
|
528
|
-
shouldHideArrow: J,
|
|
529
|
-
children: /* @__PURE__ */ v(
|
|
530
|
-
_.div,
|
|
531
|
-
{
|
|
532
|
-
"data-side": Y,
|
|
533
|
-
"data-align": he,
|
|
534
|
-
...l,
|
|
535
|
-
ref: h,
|
|
536
|
-
style: {
|
|
537
|
-
...l.style,
|
|
538
|
-
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
539
|
-
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
540
|
-
animation: V ? void 0 : "none"
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
)
|
|
544
|
-
}
|
|
545
|
-
)
|
|
546
|
-
}
|
|
547
|
-
);
|
|
548
|
-
}
|
|
549
|
-
);
|
|
550
|
-
Ot.displayName = tt;
|
|
551
|
-
var _t = "PopperArrow", Nr = {
|
|
552
|
-
top: "bottom",
|
|
553
|
-
right: "left",
|
|
554
|
-
bottom: "top",
|
|
555
|
-
left: "right"
|
|
556
|
-
}, Mt = a.forwardRef(function(t, n) {
|
|
557
|
-
const { __scopePopper: r, ...o } = t, s = Rr(_t, r), c = Nr[s.placedSide];
|
|
558
|
-
return (
|
|
559
|
-
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
560
|
-
// doesn't report size as we'd expect on SVG elements.
|
|
561
|
-
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
562
|
-
/* @__PURE__ */ v(
|
|
563
|
-
"span",
|
|
564
|
-
{
|
|
565
|
-
ref: s.onArrowChange,
|
|
566
|
-
style: {
|
|
567
|
-
position: "absolute",
|
|
568
|
-
left: s.arrowX,
|
|
569
|
-
top: s.arrowY,
|
|
570
|
-
[c]: 0,
|
|
571
|
-
transformOrigin: {
|
|
572
|
-
top: "",
|
|
573
|
-
right: "0 0",
|
|
574
|
-
bottom: "center 0",
|
|
575
|
-
left: "100% 0"
|
|
576
|
-
}[s.placedSide],
|
|
577
|
-
transform: {
|
|
578
|
-
top: "translateY(100%)",
|
|
579
|
-
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
580
|
-
bottom: "rotate(180deg)",
|
|
581
|
-
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
582
|
-
}[s.placedSide],
|
|
583
|
-
visibility: s.shouldHideArrow ? "hidden" : void 0
|
|
584
|
-
},
|
|
585
|
-
children: /* @__PURE__ */ v(
|
|
586
|
-
Er,
|
|
587
|
-
{
|
|
588
|
-
...o,
|
|
589
|
-
ref: n,
|
|
590
|
-
style: {
|
|
591
|
-
...o.style,
|
|
592
|
-
// ensures the element can be measured correctly (mostly for if SVG)
|
|
593
|
-
display: "block"
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
)
|
|
597
|
-
}
|
|
598
|
-
)
|
|
599
|
-
);
|
|
600
|
-
});
|
|
601
|
-
Mt.displayName = _t;
|
|
602
|
-
function Tr(e) {
|
|
603
|
-
return e !== null;
|
|
604
|
-
}
|
|
605
|
-
var Ir = (e) => ({
|
|
606
|
-
name: "transformOrigin",
|
|
607
|
-
options: e,
|
|
608
|
-
fn(t) {
|
|
609
|
-
var p, y, f;
|
|
610
|
-
const { placement: n, rects: r, middlewareData: o } = t, c = ((p = o.arrow) == null ? void 0 : p.centerOffset) !== 0, i = c ? 0 : e.arrowWidth, u = c ? 0 : e.arrowHeight, [d, m] = Lt(n), g = { start: "0%", center: "50%", end: "100%" }[m], S = (((y = o.arrow) == null ? void 0 : y.x) ?? 0) + i / 2, w = (((f = o.arrow) == null ? void 0 : f.y) ?? 0) + u / 2;
|
|
611
|
-
let E = "", l = "";
|
|
612
|
-
return d === "bottom" ? (E = c ? g : `${S}px`, l = `${-u}px`) : d === "top" ? (E = c ? g : `${S}px`, l = `${r.floating.height + u}px`) : d === "right" ? (E = `${-u}px`, l = c ? g : `${w}px`) : d === "left" && (E = `${r.floating.width + u}px`, l = c ? g : `${w}px`), { data: { x: E, y: l } };
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
function Lt(e) {
|
|
616
|
-
const [t, n = "center"] = e.split("-");
|
|
617
|
-
return [t, n];
|
|
618
|
-
}
|
|
619
|
-
var Ar = Tt, Or = At, _r = Ot, Mr = Mt, Lr = "Portal", Dt = a.forwardRef((e, t) => {
|
|
620
|
-
var i;
|
|
621
|
-
const { container: n, ...r } = e, [o, s] = a.useState(!1);
|
|
622
|
-
G(() => s(!0), []);
|
|
623
|
-
const c = n || o && ((i = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : i.body);
|
|
624
|
-
return c ? Mn.createPortal(/* @__PURE__ */ v(_.div, { ...r, ref: t }), c) : null;
|
|
625
|
-
});
|
|
626
|
-
Dt.displayName = Lr;
|
|
627
|
-
var kt = Object.freeze({
|
|
628
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
629
|
-
position: "absolute",
|
|
630
|
-
border: 0,
|
|
631
|
-
width: 1,
|
|
632
|
-
height: 1,
|
|
633
|
-
padding: 0,
|
|
634
|
-
margin: -1,
|
|
635
|
-
overflow: "hidden",
|
|
636
|
-
clip: "rect(0, 0, 0, 0)",
|
|
637
|
-
whiteSpace: "nowrap",
|
|
638
|
-
wordWrap: "normal"
|
|
639
|
-
}), Dr = "VisuallyHidden", kr = a.forwardRef(
|
|
640
|
-
(e, t) => /* @__PURE__ */ v(
|
|
641
|
-
_.span,
|
|
642
|
-
{
|
|
643
|
-
...e,
|
|
644
|
-
ref: t,
|
|
645
|
-
style: { ...kt, ...e.style }
|
|
646
|
-
}
|
|
647
|
-
)
|
|
648
|
-
);
|
|
649
|
-
kr.displayName = Dr;
|
|
650
|
-
var Br = function(e) {
|
|
651
|
-
if (typeof document > "u")
|
|
652
|
-
return null;
|
|
653
|
-
var t = Array.isArray(e) ? e[0] : e;
|
|
654
|
-
return t.ownerDocument.body;
|
|
655
|
-
}, ue = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Pe = {}, We = 0, Bt = function(e) {
|
|
656
|
-
return e && (e.host || Bt(e.parentNode));
|
|
657
|
-
}, Fr = function(e, t) {
|
|
658
|
-
return t.map(function(n) {
|
|
659
|
-
if (e.contains(n))
|
|
660
|
-
return n;
|
|
661
|
-
var r = Bt(n);
|
|
662
|
-
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
663
|
-
}).filter(function(n) {
|
|
664
|
-
return !!n;
|
|
665
|
-
});
|
|
666
|
-
}, Wr = function(e, t, n, r) {
|
|
667
|
-
var o = Fr(t, Array.isArray(e) ? e : [e]);
|
|
668
|
-
Pe[n] || (Pe[n] = /* @__PURE__ */ new WeakMap());
|
|
669
|
-
var s = Pe[n], c = [], i = /* @__PURE__ */ new Set(), u = new Set(o), d = function(g) {
|
|
670
|
-
!g || i.has(g) || (i.add(g), d(g.parentNode));
|
|
671
|
-
};
|
|
672
|
-
o.forEach(d);
|
|
673
|
-
var m = function(g) {
|
|
674
|
-
!g || u.has(g) || Array.prototype.forEach.call(g.children, function(S) {
|
|
675
|
-
if (i.has(S))
|
|
676
|
-
m(S);
|
|
677
|
-
else
|
|
678
|
-
try {
|
|
679
|
-
var w = S.getAttribute(r), E = w !== null && w !== "false", l = (ue.get(S) || 0) + 1, p = (s.get(S) || 0) + 1;
|
|
680
|
-
ue.set(S, l), s.set(S, p), c.push(S), l === 1 && E && xe.set(S, !0), p === 1 && S.setAttribute(n, "true"), E || S.setAttribute(r, "true");
|
|
681
|
-
} catch (y) {
|
|
682
|
-
console.error("aria-hidden: cannot operate on ", S, y);
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
};
|
|
686
|
-
return m(t), i.clear(), We++, function() {
|
|
687
|
-
c.forEach(function(g) {
|
|
688
|
-
var S = ue.get(g) - 1, w = s.get(g) - 1;
|
|
689
|
-
ue.set(g, S), s.set(g, w), S || (xe.has(g) || g.removeAttribute(r), xe.delete(g)), w || g.removeAttribute(n);
|
|
690
|
-
}), We--, We || (ue = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Pe = {});
|
|
691
|
-
};
|
|
692
|
-
}, Hr = function(e, t, n) {
|
|
693
|
-
n === void 0 && (n = "data-aria-hidden");
|
|
694
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), o = Br(e);
|
|
695
|
-
return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Wr(r, o, n, "aria-hidden")) : function() {
|
|
696
|
-
return null;
|
|
697
|
-
};
|
|
698
|
-
}, q = function() {
|
|
699
|
-
return q = Object.assign || function(t) {
|
|
700
|
-
for (var n, r = 1, o = arguments.length; r < o; r++) {
|
|
701
|
-
n = arguments[r];
|
|
702
|
-
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
703
|
-
}
|
|
704
|
-
return t;
|
|
705
|
-
}, q.apply(this, arguments);
|
|
706
|
-
};
|
|
707
|
-
function Ft(e, t) {
|
|
708
|
-
var n = {};
|
|
709
|
-
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
710
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
711
|
-
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
712
|
-
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
713
|
-
return n;
|
|
714
|
-
}
|
|
715
|
-
function Vr(e, t, n) {
|
|
716
|
-
if (n || arguments.length === 2) for (var r = 0, o = t.length, s; r < o; r++)
|
|
717
|
-
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
718
|
-
return e.concat(s || Array.prototype.slice.call(t));
|
|
719
|
-
}
|
|
720
|
-
var Te = "right-scroll-bar-position", Ie = "width-before-scroll-bar", Ur = "with-scroll-bars-hidden", $r = "--removed-body-scroll-bar-size";
|
|
721
|
-
function He(e, t) {
|
|
722
|
-
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
723
|
-
}
|
|
724
|
-
function Kr(e, t) {
|
|
725
|
-
var n = _n(function() {
|
|
726
|
-
return {
|
|
727
|
-
// value
|
|
728
|
-
value: e,
|
|
729
|
-
// last callback
|
|
730
|
-
callback: t,
|
|
731
|
-
// "memoized" public interface
|
|
732
|
-
facade: {
|
|
733
|
-
get current() {
|
|
734
|
-
return n.value;
|
|
735
|
-
},
|
|
736
|
-
set current(r) {
|
|
737
|
-
var o = n.value;
|
|
738
|
-
o !== r && (n.value = r, n.callback(r, o));
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
})[0];
|
|
743
|
-
return n.callback = t, n.facade;
|
|
744
|
-
}
|
|
745
|
-
var jr = typeof window < "u" ? a.useLayoutEffect : a.useEffect, ft = /* @__PURE__ */ new WeakMap();
|
|
746
|
-
function zr(e, t) {
|
|
747
|
-
var n = Kr(null, function(r) {
|
|
748
|
-
return e.forEach(function(o) {
|
|
749
|
-
return He(o, r);
|
|
750
|
-
});
|
|
751
|
-
});
|
|
752
|
-
return jr(function() {
|
|
753
|
-
var r = ft.get(n);
|
|
754
|
-
if (r) {
|
|
755
|
-
var o = new Set(r), s = new Set(e), c = n.current;
|
|
756
|
-
o.forEach(function(i) {
|
|
757
|
-
s.has(i) || He(i, null);
|
|
758
|
-
}), s.forEach(function(i) {
|
|
759
|
-
o.has(i) || He(i, c);
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
ft.set(n, e);
|
|
763
|
-
}, [e]), n;
|
|
764
|
-
}
|
|
765
|
-
function Yr(e) {
|
|
766
|
-
return e;
|
|
767
|
-
}
|
|
768
|
-
function Xr(e, t) {
|
|
769
|
-
t === void 0 && (t = Yr);
|
|
770
|
-
var n = [], r = !1, o = {
|
|
771
|
-
read: function() {
|
|
772
|
-
if (r)
|
|
773
|
-
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
774
|
-
return n.length ? n[n.length - 1] : e;
|
|
775
|
-
},
|
|
776
|
-
useMedium: function(s) {
|
|
777
|
-
var c = t(s, r);
|
|
778
|
-
return n.push(c), function() {
|
|
779
|
-
n = n.filter(function(i) {
|
|
780
|
-
return i !== c;
|
|
781
|
-
});
|
|
782
|
-
};
|
|
783
|
-
},
|
|
784
|
-
assignSyncMedium: function(s) {
|
|
785
|
-
for (r = !0; n.length; ) {
|
|
786
|
-
var c = n;
|
|
787
|
-
n = [], c.forEach(s);
|
|
788
|
-
}
|
|
789
|
-
n = {
|
|
790
|
-
push: function(i) {
|
|
791
|
-
return s(i);
|
|
792
|
-
},
|
|
793
|
-
filter: function() {
|
|
794
|
-
return n;
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
},
|
|
798
|
-
assignMedium: function(s) {
|
|
799
|
-
r = !0;
|
|
800
|
-
var c = [];
|
|
801
|
-
if (n.length) {
|
|
802
|
-
var i = n;
|
|
803
|
-
n = [], i.forEach(s), c = n;
|
|
804
|
-
}
|
|
805
|
-
var u = function() {
|
|
806
|
-
var m = c;
|
|
807
|
-
c = [], m.forEach(s);
|
|
808
|
-
}, d = function() {
|
|
809
|
-
return Promise.resolve().then(u);
|
|
810
|
-
};
|
|
811
|
-
d(), n = {
|
|
812
|
-
push: function(m) {
|
|
813
|
-
c.push(m), d();
|
|
814
|
-
},
|
|
815
|
-
filter: function(m) {
|
|
816
|
-
return c = c.filter(m), n;
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
return o;
|
|
822
|
-
}
|
|
823
|
-
function Gr(e) {
|
|
824
|
-
e === void 0 && (e = {});
|
|
825
|
-
var t = Xr(null);
|
|
826
|
-
return t.options = q({ async: !0, ssr: !1 }, e), t;
|
|
827
|
-
}
|
|
828
|
-
var Wt = function(e) {
|
|
829
|
-
var t = e.sideCar, n = Ft(e, ["sideCar"]);
|
|
830
|
-
if (!t)
|
|
831
|
-
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
832
|
-
var r = t.read();
|
|
833
|
-
if (!r)
|
|
834
|
-
throw new Error("Sidecar medium not found");
|
|
835
|
-
return a.createElement(r, q({}, n));
|
|
836
|
-
};
|
|
837
|
-
Wt.isSideCarExport = !0;
|
|
838
|
-
function Zr(e, t) {
|
|
839
|
-
return e.useMedium(t), Wt;
|
|
840
|
-
}
|
|
841
|
-
var Ht = Gr(), Ve = function() {
|
|
842
|
-
}, _e = a.forwardRef(function(e, t) {
|
|
843
|
-
var n = a.useRef(null), r = a.useState({
|
|
844
|
-
onScrollCapture: Ve,
|
|
845
|
-
onWheelCapture: Ve,
|
|
846
|
-
onTouchMoveCapture: Ve
|
|
847
|
-
}), o = r[0], s = r[1], c = e.forwardProps, i = e.children, u = e.className, d = e.removeScrollBar, m = e.enabled, g = e.shards, S = e.sideCar, w = e.noRelative, E = e.noIsolation, l = e.inert, p = e.allowPinchZoom, y = e.as, f = y === void 0 ? "div" : y, h = e.gapMode, C = Ft(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), P = S, R = zr([n, t]), b = q(q({}, C), o);
|
|
848
|
-
return a.createElement(
|
|
849
|
-
a.Fragment,
|
|
850
|
-
null,
|
|
851
|
-
m && a.createElement(P, { sideCar: Ht, removeScrollBar: d, shards: g, noRelative: w, noIsolation: E, inert: l, setCallbacks: s, allowPinchZoom: !!p, lockRef: n, gapMode: h }),
|
|
852
|
-
c ? a.cloneElement(a.Children.only(i), q(q({}, b), { ref: R })) : a.createElement(f, q({}, b, { className: u, ref: R }), i)
|
|
853
|
-
);
|
|
854
|
-
});
|
|
855
|
-
_e.defaultProps = {
|
|
856
|
-
enabled: !0,
|
|
857
|
-
removeScrollBar: !0,
|
|
858
|
-
inert: !1
|
|
859
|
-
};
|
|
860
|
-
_e.classNames = {
|
|
861
|
-
fullWidth: Ie,
|
|
862
|
-
zeroRight: Te
|
|
863
|
-
};
|
|
864
|
-
var qr = function() {
|
|
865
|
-
if (typeof __webpack_nonce__ < "u")
|
|
866
|
-
return __webpack_nonce__;
|
|
867
|
-
};
|
|
868
|
-
function Qr() {
|
|
869
|
-
if (!document)
|
|
870
|
-
return null;
|
|
871
|
-
var e = document.createElement("style");
|
|
872
|
-
e.type = "text/css";
|
|
873
|
-
var t = qr();
|
|
874
|
-
return t && e.setAttribute("nonce", t), e;
|
|
875
|
-
}
|
|
876
|
-
function Jr(e, t) {
|
|
877
|
-
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
878
|
-
}
|
|
879
|
-
function eo(e) {
|
|
880
|
-
var t = document.head || document.getElementsByTagName("head")[0];
|
|
881
|
-
t.appendChild(e);
|
|
882
|
-
}
|
|
883
|
-
var to = function() {
|
|
884
|
-
var e = 0, t = null;
|
|
885
|
-
return {
|
|
886
|
-
add: function(n) {
|
|
887
|
-
e == 0 && (t = Qr()) && (Jr(t, n), eo(t)), e++;
|
|
888
|
-
},
|
|
889
|
-
remove: function() {
|
|
890
|
-
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
891
|
-
}
|
|
892
|
-
};
|
|
893
|
-
}, no = function() {
|
|
894
|
-
var e = to();
|
|
895
|
-
return function(t, n) {
|
|
896
|
-
a.useEffect(function() {
|
|
897
|
-
return e.add(t), function() {
|
|
898
|
-
e.remove();
|
|
899
|
-
};
|
|
900
|
-
}, [t && n]);
|
|
901
|
-
};
|
|
902
|
-
}, Vt = function() {
|
|
903
|
-
var e = no(), t = function(n) {
|
|
904
|
-
var r = n.styles, o = n.dynamic;
|
|
905
|
-
return e(r, o), null;
|
|
906
|
-
};
|
|
907
|
-
return t;
|
|
908
|
-
}, ro = {
|
|
909
|
-
left: 0,
|
|
910
|
-
top: 0,
|
|
911
|
-
right: 0,
|
|
912
|
-
gap: 0
|
|
913
|
-
}, Ue = function(e) {
|
|
914
|
-
return parseInt(e || "", 10) || 0;
|
|
915
|
-
}, oo = function(e) {
|
|
916
|
-
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
917
|
-
return [Ue(n), Ue(r), Ue(o)];
|
|
918
|
-
}, ao = function(e) {
|
|
919
|
-
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
920
|
-
return ro;
|
|
921
|
-
var t = oo(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
922
|
-
return {
|
|
923
|
-
left: t[0],
|
|
924
|
-
top: t[1],
|
|
925
|
-
right: t[2],
|
|
926
|
-
gap: Math.max(0, r - n + t[2] - t[0])
|
|
927
|
-
};
|
|
928
|
-
}, io = Vt(), pe = "data-scroll-locked", so = function(e, t, n, r) {
|
|
929
|
-
var o = e.left, s = e.top, c = e.right, i = e.gap;
|
|
930
|
-
return n === void 0 && (n = "margin"), `
|
|
931
|
-
.`.concat(Ur, ` {
|
|
932
|
-
overflow: hidden `).concat(r, `;
|
|
933
|
-
padding-right: `).concat(i, "px ").concat(r, `;
|
|
934
|
-
}
|
|
935
|
-
body[`).concat(pe, `] {
|
|
936
|
-
overflow: hidden `).concat(r, `;
|
|
937
|
-
overscroll-behavior: contain;
|
|
938
|
-
`).concat([
|
|
939
|
-
t && "position: relative ".concat(r, ";"),
|
|
940
|
-
n === "margin" && `
|
|
941
|
-
padding-left: `.concat(o, `px;
|
|
942
|
-
padding-top: `).concat(s, `px;
|
|
943
|
-
padding-right: `).concat(c, `px;
|
|
944
|
-
margin-left:0;
|
|
945
|
-
margin-top:0;
|
|
946
|
-
margin-right: `).concat(i, "px ").concat(r, `;
|
|
947
|
-
`),
|
|
948
|
-
n === "padding" && "padding-right: ".concat(i, "px ").concat(r, ";")
|
|
949
|
-
].filter(Boolean).join(""), `
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
.`).concat(Te, ` {
|
|
953
|
-
right: `).concat(i, "px ").concat(r, `;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
.`).concat(Ie, ` {
|
|
957
|
-
margin-right: `).concat(i, "px ").concat(r, `;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
.`).concat(Te, " .").concat(Te, ` {
|
|
961
|
-
right: 0 `).concat(r, `;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
.`).concat(Ie, " .").concat(Ie, ` {
|
|
965
|
-
margin-right: 0 `).concat(r, `;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
body[`).concat(pe, `] {
|
|
969
|
-
`).concat($r, ": ").concat(i, `px;
|
|
970
|
-
}
|
|
971
|
-
`);
|
|
972
|
-
}, pt = function() {
|
|
973
|
-
var e = parseInt(document.body.getAttribute(pe) || "0", 10);
|
|
974
|
-
return isFinite(e) ? e : 0;
|
|
975
|
-
}, co = function() {
|
|
976
|
-
a.useEffect(function() {
|
|
977
|
-
return document.body.setAttribute(pe, (pt() + 1).toString()), function() {
|
|
978
|
-
var e = pt() - 1;
|
|
979
|
-
e <= 0 ? document.body.removeAttribute(pe) : document.body.setAttribute(pe, e.toString());
|
|
980
|
-
};
|
|
981
|
-
}, []);
|
|
982
|
-
}, lo = function(e) {
|
|
983
|
-
var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
|
|
984
|
-
co();
|
|
985
|
-
var s = a.useMemo(function() {
|
|
986
|
-
return ao(o);
|
|
987
|
-
}, [o]);
|
|
988
|
-
return a.createElement(io, { styles: so(s, !t, o, n ? "" : "!important") });
|
|
989
|
-
}, Ke = !1;
|
|
990
|
-
if (typeof window < "u")
|
|
991
|
-
try {
|
|
992
|
-
var Re = Object.defineProperty({}, "passive", {
|
|
993
|
-
get: function() {
|
|
994
|
-
return Ke = !0, !0;
|
|
995
|
-
}
|
|
996
|
-
});
|
|
997
|
-
window.addEventListener("test", Re, Re), window.removeEventListener("test", Re, Re);
|
|
998
|
-
} catch {
|
|
999
|
-
Ke = !1;
|
|
1000
|
-
}
|
|
1001
|
-
var de = Ke ? { passive: !1 } : !1, uo = function(e) {
|
|
1002
|
-
return e.tagName === "TEXTAREA";
|
|
1003
|
-
}, Ut = function(e, t) {
|
|
1004
|
-
if (!(e instanceof Element))
|
|
1005
|
-
return !1;
|
|
1006
|
-
var n = window.getComputedStyle(e);
|
|
1007
|
-
return (
|
|
1008
|
-
// not-not-scrollable
|
|
1009
|
-
n[t] !== "hidden" && // contains scroll inside self
|
|
1010
|
-
!(n.overflowY === n.overflowX && !uo(e) && n[t] === "visible")
|
|
1011
|
-
);
|
|
1012
|
-
}, fo = function(e) {
|
|
1013
|
-
return Ut(e, "overflowY");
|
|
1014
|
-
}, po = function(e) {
|
|
1015
|
-
return Ut(e, "overflowX");
|
|
1016
|
-
}, vt = function(e, t) {
|
|
1017
|
-
var n = t.ownerDocument, r = t;
|
|
1018
|
-
do {
|
|
1019
|
-
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
1020
|
-
var o = $t(e, r);
|
|
1021
|
-
if (o) {
|
|
1022
|
-
var s = Kt(e, r), c = s[1], i = s[2];
|
|
1023
|
-
if (c > i)
|
|
1024
|
-
return !0;
|
|
1025
|
-
}
|
|
1026
|
-
r = r.parentNode;
|
|
1027
|
-
} while (r && r !== n.body);
|
|
1028
|
-
return !1;
|
|
1029
|
-
}, vo = function(e) {
|
|
1030
|
-
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
1031
|
-
return [
|
|
1032
|
-
t,
|
|
1033
|
-
n,
|
|
1034
|
-
r
|
|
1035
|
-
];
|
|
1036
|
-
}, mo = function(e) {
|
|
1037
|
-
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
1038
|
-
return [
|
|
1039
|
-
t,
|
|
1040
|
-
n,
|
|
1041
|
-
r
|
|
1042
|
-
];
|
|
1043
|
-
}, $t = function(e, t) {
|
|
1044
|
-
return e === "v" ? fo(t) : po(t);
|
|
1045
|
-
}, Kt = function(e, t) {
|
|
1046
|
-
return e === "v" ? vo(t) : mo(t);
|
|
1047
|
-
}, ho = function(e, t) {
|
|
1048
|
-
return e === "h" && t === "rtl" ? -1 : 1;
|
|
1049
|
-
}, go = function(e, t, n, r, o) {
|
|
1050
|
-
var s = ho(e, window.getComputedStyle(t).direction), c = s * r, i = n.target, u = t.contains(i), d = !1, m = c > 0, g = 0, S = 0;
|
|
1051
|
-
do {
|
|
1052
|
-
if (!i)
|
|
1053
|
-
break;
|
|
1054
|
-
var w = Kt(e, i), E = w[0], l = w[1], p = w[2], y = l - p - s * E;
|
|
1055
|
-
(E || y) && $t(e, i) && (g += y, S += E);
|
|
1056
|
-
var f = i.parentNode;
|
|
1057
|
-
i = f && f.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? f.host : f;
|
|
1058
|
-
} while (
|
|
1059
|
-
// portaled content
|
|
1060
|
-
!u && i !== document.body || // self content
|
|
1061
|
-
u && (t.contains(i) || t === i)
|
|
1062
|
-
);
|
|
1063
|
-
return (m && Math.abs(g) < 1 || !m && Math.abs(S) < 1) && (d = !0), d;
|
|
1064
|
-
}, Ne = function(e) {
|
|
1065
|
-
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
1066
|
-
}, mt = function(e) {
|
|
1067
|
-
return [e.deltaX, e.deltaY];
|
|
1068
|
-
}, ht = function(e) {
|
|
1069
|
-
return e && "current" in e ? e.current : e;
|
|
1070
|
-
}, yo = function(e, t) {
|
|
1071
|
-
return e[0] === t[0] && e[1] === t[1];
|
|
1072
|
-
}, So = function(e) {
|
|
1073
|
-
return `
|
|
1074
|
-
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
1075
|
-
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
1076
|
-
`);
|
|
1077
|
-
}, wo = 0, fe = [];
|
|
1078
|
-
function Co(e) {
|
|
1079
|
-
var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(wo++)[0], s = a.useState(Vt)[0], c = a.useRef(e);
|
|
1080
|
-
a.useEffect(function() {
|
|
1081
|
-
c.current = e;
|
|
1082
|
-
}, [e]), a.useEffect(function() {
|
|
1083
|
-
if (e.inert) {
|
|
1084
|
-
document.body.classList.add("block-interactivity-".concat(o));
|
|
1085
|
-
var l = Vr([e.lockRef.current], (e.shards || []).map(ht), !0).filter(Boolean);
|
|
1086
|
-
return l.forEach(function(p) {
|
|
1087
|
-
return p.classList.add("allow-interactivity-".concat(o));
|
|
1088
|
-
}), function() {
|
|
1089
|
-
document.body.classList.remove("block-interactivity-".concat(o)), l.forEach(function(p) {
|
|
1090
|
-
return p.classList.remove("allow-interactivity-".concat(o));
|
|
1091
|
-
});
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
}, [e.inert, e.lockRef.current, e.shards]);
|
|
1095
|
-
var i = a.useCallback(function(l, p) {
|
|
1096
|
-
if ("touches" in l && l.touches.length === 2 || l.type === "wheel" && l.ctrlKey)
|
|
1097
|
-
return !c.current.allowPinchZoom;
|
|
1098
|
-
var y = Ne(l), f = n.current, h = "deltaX" in l ? l.deltaX : f[0] - y[0], C = "deltaY" in l ? l.deltaY : f[1] - y[1], P, R = l.target, b = Math.abs(h) > Math.abs(C) ? "h" : "v";
|
|
1099
|
-
if ("touches" in l && b === "h" && R.type === "range")
|
|
1100
|
-
return !1;
|
|
1101
|
-
var O = window.getSelection(), L = O && O.anchorNode, H = L ? L === R || L.contains(R) : !1;
|
|
1102
|
-
if (H)
|
|
1103
|
-
return !1;
|
|
1104
|
-
var D = vt(b, R);
|
|
1105
|
-
if (!D)
|
|
1106
|
-
return !0;
|
|
1107
|
-
if (D ? P = b : (P = b === "v" ? "h" : "v", D = vt(b, R)), !D)
|
|
1108
|
-
return !1;
|
|
1109
|
-
if (!r.current && "changedTouches" in l && (h || C) && (r.current = P), !P)
|
|
1110
|
-
return !0;
|
|
1111
|
-
var U = r.current || P;
|
|
1112
|
-
return go(U, p, l, U === "h" ? h : C);
|
|
1113
|
-
}, []), u = a.useCallback(function(l) {
|
|
1114
|
-
var p = l;
|
|
1115
|
-
if (!(!fe.length || fe[fe.length - 1] !== s)) {
|
|
1116
|
-
var y = "deltaY" in p ? mt(p) : Ne(p), f = t.current.filter(function(P) {
|
|
1117
|
-
return P.name === p.type && (P.target === p.target || p.target === P.shadowParent) && yo(P.delta, y);
|
|
1118
|
-
})[0];
|
|
1119
|
-
if (f && f.should) {
|
|
1120
|
-
p.cancelable && p.preventDefault();
|
|
1121
|
-
return;
|
|
1122
|
-
}
|
|
1123
|
-
if (!f) {
|
|
1124
|
-
var h = (c.current.shards || []).map(ht).filter(Boolean).filter(function(P) {
|
|
1125
|
-
return P.contains(p.target);
|
|
1126
|
-
}), C = h.length > 0 ? i(p, h[0]) : !c.current.noIsolation;
|
|
1127
|
-
C && p.cancelable && p.preventDefault();
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
}, []), d = a.useCallback(function(l, p, y, f) {
|
|
1131
|
-
var h = { name: l, delta: p, target: y, should: f, shadowParent: bo(y) };
|
|
1132
|
-
t.current.push(h), setTimeout(function() {
|
|
1133
|
-
t.current = t.current.filter(function(C) {
|
|
1134
|
-
return C !== h;
|
|
1135
|
-
});
|
|
1136
|
-
}, 1);
|
|
1137
|
-
}, []), m = a.useCallback(function(l) {
|
|
1138
|
-
n.current = Ne(l), r.current = void 0;
|
|
1139
|
-
}, []), g = a.useCallback(function(l) {
|
|
1140
|
-
d(l.type, mt(l), l.target, i(l, e.lockRef.current));
|
|
1141
|
-
}, []), S = a.useCallback(function(l) {
|
|
1142
|
-
d(l.type, Ne(l), l.target, i(l, e.lockRef.current));
|
|
1143
|
-
}, []);
|
|
1144
|
-
a.useEffect(function() {
|
|
1145
|
-
return fe.push(s), e.setCallbacks({
|
|
1146
|
-
onScrollCapture: g,
|
|
1147
|
-
onWheelCapture: g,
|
|
1148
|
-
onTouchMoveCapture: S
|
|
1149
|
-
}), document.addEventListener("wheel", u, de), document.addEventListener("touchmove", u, de), document.addEventListener("touchstart", m, de), function() {
|
|
1150
|
-
fe = fe.filter(function(l) {
|
|
1151
|
-
return l !== s;
|
|
1152
|
-
}), document.removeEventListener("wheel", u, de), document.removeEventListener("touchmove", u, de), document.removeEventListener("touchstart", m, de);
|
|
1153
|
-
};
|
|
1154
|
-
}, []);
|
|
1155
|
-
var w = e.removeScrollBar, E = e.inert;
|
|
1156
|
-
return a.createElement(
|
|
1157
|
-
a.Fragment,
|
|
1158
|
-
null,
|
|
1159
|
-
E ? a.createElement(s, { styles: So(o) }) : null,
|
|
1160
|
-
w ? a.createElement(lo, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
1161
|
-
);
|
|
1162
|
-
}
|
|
1163
|
-
function bo(e) {
|
|
1164
|
-
for (var t = null; e !== null; )
|
|
1165
|
-
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
1166
|
-
return t;
|
|
1167
|
-
}
|
|
1168
|
-
const Eo = Zr(Ht, Co);
|
|
1169
|
-
var jt = a.forwardRef(function(e, t) {
|
|
1170
|
-
return a.createElement(_e, q({}, e, { ref: t, sideCar: Eo }));
|
|
1171
|
-
});
|
|
1172
|
-
jt.classNames = _e.classNames;
|
|
1173
|
-
var xo = [" ", "Enter", "ArrowUp", "ArrowDown"], Po = [" ", "Enter"], se = "Select", [Me, Le, Ro] = nr(se), [me] = Qe(se, [
|
|
1174
|
-
Ro,
|
|
1175
|
-
Rt
|
|
1176
|
-
]), De = Rt(), [No, ne] = me(se), [To, Io] = me(se), zt = (e) => {
|
|
1177
|
-
const {
|
|
1178
|
-
__scopeSelect: t,
|
|
1179
|
-
children: n,
|
|
1180
|
-
open: r,
|
|
1181
|
-
defaultOpen: o,
|
|
1182
|
-
onOpenChange: s,
|
|
1183
|
-
value: c,
|
|
1184
|
-
defaultValue: i,
|
|
1185
|
-
onValueChange: u,
|
|
1186
|
-
dir: d,
|
|
1187
|
-
name: m,
|
|
1188
|
-
autoComplete: g,
|
|
1189
|
-
disabled: S,
|
|
1190
|
-
required: w,
|
|
1191
|
-
form: E
|
|
1192
|
-
} = e, l = De(t), [p, y] = a.useState(null), [f, h] = a.useState(null), [C, P] = a.useState(!1), R = or(d), [b, O] = rt({
|
|
1193
|
-
prop: r,
|
|
1194
|
-
defaultProp: o ?? !1,
|
|
1195
|
-
onChange: s,
|
|
1196
|
-
caller: se
|
|
1197
|
-
}), [L, H] = rt({
|
|
1198
|
-
prop: c,
|
|
1199
|
-
defaultProp: i,
|
|
1200
|
-
onChange: u,
|
|
1201
|
-
caller: se
|
|
1202
|
-
}), D = a.useRef(null), U = p ? E || !!p.closest("form") : !0, [$, z] = a.useState(/* @__PURE__ */ new Set()), j = Array.from($).map((B) => B.props.value).join(";");
|
|
1203
|
-
return /* @__PURE__ */ v(Ar, { ...l, children: /* @__PURE__ */ ie(
|
|
1204
|
-
No,
|
|
1205
|
-
{
|
|
1206
|
-
required: w,
|
|
1207
|
-
scope: t,
|
|
1208
|
-
trigger: p,
|
|
1209
|
-
onTriggerChange: y,
|
|
1210
|
-
valueNode: f,
|
|
1211
|
-
onValueNodeChange: h,
|
|
1212
|
-
valueNodeHasChildren: C,
|
|
1213
|
-
onValueNodeHasChildrenChange: P,
|
|
1214
|
-
contentId: Je(),
|
|
1215
|
-
value: L,
|
|
1216
|
-
onValueChange: H,
|
|
1217
|
-
open: b,
|
|
1218
|
-
onOpenChange: O,
|
|
1219
|
-
dir: R,
|
|
1220
|
-
triggerPointerDownPosRef: D,
|
|
1221
|
-
disabled: S,
|
|
1222
|
-
children: [
|
|
1223
|
-
/* @__PURE__ */ v(Me.Provider, { scope: t, children: /* @__PURE__ */ v(
|
|
1224
|
-
To,
|
|
1225
|
-
{
|
|
1226
|
-
scope: e.__scopeSelect,
|
|
1227
|
-
onNativeOptionAdd: a.useCallback((B) => {
|
|
1228
|
-
z((V) => new Set(V).add(B));
|
|
1229
|
-
}, []),
|
|
1230
|
-
onNativeOptionRemove: a.useCallback((B) => {
|
|
1231
|
-
z((V) => {
|
|
1232
|
-
const F = new Set(V);
|
|
1233
|
-
return F.delete(B), F;
|
|
1234
|
-
});
|
|
1235
|
-
}, []),
|
|
1236
|
-
children: n
|
|
1237
|
-
}
|
|
1238
|
-
) }),
|
|
1239
|
-
U ? /* @__PURE__ */ ie(
|
|
1240
|
-
yn,
|
|
1241
|
-
{
|
|
1242
|
-
"aria-hidden": !0,
|
|
1243
|
-
required: w,
|
|
1244
|
-
tabIndex: -1,
|
|
1245
|
-
name: m,
|
|
1246
|
-
autoComplete: g,
|
|
1247
|
-
value: L,
|
|
1248
|
-
onChange: (B) => H(B.target.value),
|
|
1249
|
-
disabled: S,
|
|
1250
|
-
form: E,
|
|
1251
|
-
children: [
|
|
1252
|
-
L === void 0 ? /* @__PURE__ */ v("option", { value: "" }) : null,
|
|
1253
|
-
Array.from($)
|
|
1254
|
-
]
|
|
1255
|
-
},
|
|
1256
|
-
j
|
|
1257
|
-
) : null
|
|
1258
|
-
]
|
|
1259
|
-
}
|
|
1260
|
-
) });
|
|
1261
|
-
};
|
|
1262
|
-
zt.displayName = se;
|
|
1263
|
-
var Yt = "SelectTrigger", Xt = a.forwardRef(
|
|
1264
|
-
(e, t) => {
|
|
1265
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = De(n), c = ne(Yt, n), i = c.disabled || r, u = k(t, c.onTriggerChange), d = Le(n), m = a.useRef("touch"), [g, S, w] = wn((l) => {
|
|
1266
|
-
const p = d().filter((h) => !h.disabled), y = p.find((h) => h.value === c.value), f = Cn(p, l, y);
|
|
1267
|
-
f !== void 0 && c.onValueChange(f.value);
|
|
1268
|
-
}), E = (l) => {
|
|
1269
|
-
i || (c.onOpenChange(!0), w()), l && (c.triggerPointerDownPosRef.current = {
|
|
1270
|
-
x: Math.round(l.pageX),
|
|
1271
|
-
y: Math.round(l.pageY)
|
|
1272
|
-
});
|
|
1273
|
-
};
|
|
1274
|
-
return /* @__PURE__ */ v(Or, { asChild: !0, ...s, children: /* @__PURE__ */ v(
|
|
1275
|
-
_.button,
|
|
1276
|
-
{
|
|
1277
|
-
type: "button",
|
|
1278
|
-
role: "combobox",
|
|
1279
|
-
"aria-controls": c.contentId,
|
|
1280
|
-
"aria-expanded": c.open,
|
|
1281
|
-
"aria-required": c.required,
|
|
1282
|
-
"aria-autocomplete": "none",
|
|
1283
|
-
dir: c.dir,
|
|
1284
|
-
"data-state": c.open ? "open" : "closed",
|
|
1285
|
-
disabled: i,
|
|
1286
|
-
"data-disabled": i ? "" : void 0,
|
|
1287
|
-
"data-placeholder": Sn(c.value) ? "" : void 0,
|
|
1288
|
-
...o,
|
|
1289
|
-
ref: u,
|
|
1290
|
-
onClick: M(o.onClick, (l) => {
|
|
1291
|
-
l.currentTarget.focus(), m.current !== "mouse" && E(l);
|
|
1292
|
-
}),
|
|
1293
|
-
onPointerDown: M(o.onPointerDown, (l) => {
|
|
1294
|
-
m.current = l.pointerType;
|
|
1295
|
-
const p = l.target;
|
|
1296
|
-
p.hasPointerCapture(l.pointerId) && p.releasePointerCapture(l.pointerId), l.button === 0 && l.ctrlKey === !1 && l.pointerType === "mouse" && (E(l), l.preventDefault());
|
|
1297
|
-
}),
|
|
1298
|
-
onKeyDown: M(o.onKeyDown, (l) => {
|
|
1299
|
-
const p = g.current !== "";
|
|
1300
|
-
!(l.ctrlKey || l.altKey || l.metaKey) && l.key.length === 1 && S(l.key), !(p && l.key === " ") && xo.includes(l.key) && (E(), l.preventDefault());
|
|
1301
|
-
})
|
|
1302
|
-
}
|
|
1303
|
-
) });
|
|
1304
|
-
}
|
|
1305
|
-
);
|
|
1306
|
-
Xt.displayName = Yt;
|
|
1307
|
-
var Gt = "SelectValue", Zt = a.forwardRef(
|
|
1308
|
-
(e, t) => {
|
|
1309
|
-
const { __scopeSelect: n, className: r, style: o, children: s, placeholder: c = "", ...i } = e, u = ne(Gt, n), { onValueNodeHasChildrenChange: d } = u, m = s !== void 0, g = k(t, u.onValueNodeChange);
|
|
1310
|
-
return G(() => {
|
|
1311
|
-
d(m);
|
|
1312
|
-
}, [d, m]), /* @__PURE__ */ v(
|
|
1313
|
-
_.span,
|
|
1314
|
-
{
|
|
1315
|
-
...i,
|
|
1316
|
-
ref: g,
|
|
1317
|
-
style: { pointerEvents: "none" },
|
|
1318
|
-
children: Sn(u.value) ? /* @__PURE__ */ v(Ze, { children: c }) : s
|
|
1319
|
-
}
|
|
1320
|
-
);
|
|
1321
|
-
}
|
|
1322
|
-
);
|
|
1323
|
-
Zt.displayName = Gt;
|
|
1324
|
-
var Ao = "SelectIcon", qt = a.forwardRef(
|
|
1325
|
-
(e, t) => {
|
|
1326
|
-
const { __scopeSelect: n, children: r, ...o } = e;
|
|
1327
|
-
return /* @__PURE__ */ v(_.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
|
|
1328
|
-
}
|
|
1329
|
-
);
|
|
1330
|
-
qt.displayName = Ao;
|
|
1331
|
-
var Oo = "SelectPortal", Qt = (e) => /* @__PURE__ */ v(Dt, { asChild: !0, ...e });
|
|
1332
|
-
Qt.displayName = Oo;
|
|
1333
|
-
var ce = "SelectContent", Jt = a.forwardRef(
|
|
1334
|
-
(e, t) => {
|
|
1335
|
-
const n = ne(ce, e.__scopeSelect), [r, o] = a.useState();
|
|
1336
|
-
if (G(() => {
|
|
1337
|
-
o(new DocumentFragment());
|
|
1338
|
-
}, []), !n.open) {
|
|
1339
|
-
const s = r;
|
|
1340
|
-
return s ? qe.createPortal(
|
|
1341
|
-
/* @__PURE__ */ v(en, { scope: e.__scopeSelect, children: /* @__PURE__ */ v(Me.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ v("div", { children: e.children }) }) }),
|
|
1342
|
-
s
|
|
1343
|
-
) : null;
|
|
1344
|
-
}
|
|
1345
|
-
return /* @__PURE__ */ v(tn, { ...e, ref: t });
|
|
1346
|
-
}
|
|
1347
|
-
);
|
|
1348
|
-
Jt.displayName = ce;
|
|
1349
|
-
var X = 10, [en, re] = me(ce), _o = "SelectContentImpl", Mo = /* @__PURE__ */ Ae("SelectContent.RemoveScroll"), tn = a.forwardRef(
|
|
1350
|
-
(e, t) => {
|
|
1351
|
-
const {
|
|
1352
|
-
__scopeSelect: n,
|
|
1353
|
-
position: r = "item-aligned",
|
|
1354
|
-
onCloseAutoFocus: o,
|
|
1355
|
-
onEscapeKeyDown: s,
|
|
1356
|
-
onPointerDownOutside: c,
|
|
1357
|
-
//
|
|
1358
|
-
// PopperContent props
|
|
1359
|
-
side: i,
|
|
1360
|
-
sideOffset: u,
|
|
1361
|
-
align: d,
|
|
1362
|
-
alignOffset: m,
|
|
1363
|
-
arrowPadding: g,
|
|
1364
|
-
collisionBoundary: S,
|
|
1365
|
-
collisionPadding: w,
|
|
1366
|
-
sticky: E,
|
|
1367
|
-
hideWhenDetached: l,
|
|
1368
|
-
avoidCollisions: p,
|
|
1369
|
-
//
|
|
1370
|
-
...y
|
|
1371
|
-
} = e, f = ne(ce, n), [h, C] = a.useState(null), [P, R] = a.useState(null), b = k(t, (x) => C(x)), [O, L] = a.useState(null), [H, D] = a.useState(
|
|
1372
|
-
null
|
|
1373
|
-
), U = Le(n), [$, z] = a.useState(!1), j = a.useRef(!1);
|
|
1374
|
-
a.useEffect(() => {
|
|
1375
|
-
if (h) return Hr(h);
|
|
1376
|
-
}, [h]), vr();
|
|
1377
|
-
const B = a.useCallback(
|
|
1378
|
-
(x) => {
|
|
1379
|
-
const [A, ...W] = U().map((T) => T.ref.current), [I] = W.slice(-1), N = document.activeElement;
|
|
1380
|
-
for (const T of x)
|
|
1381
|
-
if (T === N || (T == null || T.scrollIntoView({ block: "nearest" }), T === A && P && (P.scrollTop = 0), T === I && P && (P.scrollTop = P.scrollHeight), T == null || T.focus(), document.activeElement !== N)) return;
|
|
1382
|
-
},
|
|
1383
|
-
[U, P]
|
|
1384
|
-
), V = a.useCallback(
|
|
1385
|
-
() => B([O, h]),
|
|
1386
|
-
[B, O, h]
|
|
1387
|
-
);
|
|
1388
|
-
a.useEffect(() => {
|
|
1389
|
-
$ && V();
|
|
1390
|
-
}, [$, V]);
|
|
1391
|
-
const { onOpenChange: F, triggerPointerDownPosRef: Y } = f;
|
|
1392
|
-
a.useEffect(() => {
|
|
1393
|
-
if (h) {
|
|
1394
|
-
let x = { x: 0, y: 0 };
|
|
1395
|
-
const A = (I) => {
|
|
1396
|
-
var N, T;
|
|
1397
|
-
x = {
|
|
1398
|
-
x: Math.abs(Math.round(I.pageX) - (((N = Y.current) == null ? void 0 : N.x) ?? 0)),
|
|
1399
|
-
y: Math.abs(Math.round(I.pageY) - (((T = Y.current) == null ? void 0 : T.y) ?? 0))
|
|
1400
|
-
};
|
|
1401
|
-
}, W = (I) => {
|
|
1402
|
-
x.x <= 10 && x.y <= 10 ? I.preventDefault() : h.contains(I.target) || F(!1), document.removeEventListener("pointermove", A), Y.current = null;
|
|
1403
|
-
};
|
|
1404
|
-
return Y.current !== null && (document.addEventListener("pointermove", A), document.addEventListener("pointerup", W, { capture: !0, once: !0 })), () => {
|
|
1405
|
-
document.removeEventListener("pointermove", A), document.removeEventListener("pointerup", W, { capture: !0 });
|
|
1406
|
-
};
|
|
1407
|
-
}
|
|
1408
|
-
}, [h, F, Y]), a.useEffect(() => {
|
|
1409
|
-
const x = () => F(!1);
|
|
1410
|
-
return window.addEventListener("blur", x), window.addEventListener("resize", x), () => {
|
|
1411
|
-
window.removeEventListener("blur", x), window.removeEventListener("resize", x);
|
|
1412
|
-
};
|
|
1413
|
-
}, [F]);
|
|
1414
|
-
const [he, Q] = wn((x) => {
|
|
1415
|
-
const A = U().filter((N) => !N.disabled), W = A.find((N) => N.ref.current === document.activeElement), I = Cn(A, x, W);
|
|
1416
|
-
I && setTimeout(() => I.ref.current.focus());
|
|
1417
|
-
}), ge = a.useCallback(
|
|
1418
|
-
(x, A, W) => {
|
|
1419
|
-
const I = !j.current && !W;
|
|
1420
|
-
(f.value !== void 0 && f.value === A || I) && (L(x), I && (j.current = !0));
|
|
1421
|
-
},
|
|
1422
|
-
[f.value]
|
|
1423
|
-
), ye = a.useCallback(() => h == null ? void 0 : h.focus(), [h]), J = a.useCallback(
|
|
1424
|
-
(x, A, W) => {
|
|
1425
|
-
const I = !j.current && !W;
|
|
1426
|
-
(f.value !== void 0 && f.value === A || I) && D(x);
|
|
1427
|
-
},
|
|
1428
|
-
[f.value]
|
|
1429
|
-
), le = r === "popper" ? je : nn, oe = le === je ? {
|
|
1430
|
-
side: i,
|
|
1431
|
-
sideOffset: u,
|
|
1432
|
-
align: d,
|
|
1433
|
-
alignOffset: m,
|
|
1434
|
-
arrowPadding: g,
|
|
1435
|
-
collisionBoundary: S,
|
|
1436
|
-
collisionPadding: w,
|
|
1437
|
-
sticky: E,
|
|
1438
|
-
hideWhenDetached: l,
|
|
1439
|
-
avoidCollisions: p
|
|
1440
|
-
} : {};
|
|
1441
|
-
return /* @__PURE__ */ v(
|
|
1442
|
-
en,
|
|
1443
|
-
{
|
|
1444
|
-
scope: n,
|
|
1445
|
-
content: h,
|
|
1446
|
-
viewport: P,
|
|
1447
|
-
onViewportChange: R,
|
|
1448
|
-
itemRefCallback: ge,
|
|
1449
|
-
selectedItem: O,
|
|
1450
|
-
onItemLeave: ye,
|
|
1451
|
-
itemTextRefCallback: J,
|
|
1452
|
-
focusSelectedItem: V,
|
|
1453
|
-
selectedItemText: H,
|
|
1454
|
-
position: r,
|
|
1455
|
-
isPositioned: $,
|
|
1456
|
-
searchRef: he,
|
|
1457
|
-
children: /* @__PURE__ */ v(jt, { as: Mo, allowPinchZoom: !0, children: /* @__PURE__ */ v(
|
|
1458
|
-
bt,
|
|
1459
|
-
{
|
|
1460
|
-
asChild: !0,
|
|
1461
|
-
trapped: f.open,
|
|
1462
|
-
onMountAutoFocus: (x) => {
|
|
1463
|
-
x.preventDefault();
|
|
1464
|
-
},
|
|
1465
|
-
onUnmountAutoFocus: M(o, (x) => {
|
|
1466
|
-
var A;
|
|
1467
|
-
(A = f.trigger) == null || A.focus({ preventScroll: !0 }), x.preventDefault();
|
|
1468
|
-
}),
|
|
1469
|
-
children: /* @__PURE__ */ v(
|
|
1470
|
-
wt,
|
|
1471
|
-
{
|
|
1472
|
-
asChild: !0,
|
|
1473
|
-
disableOutsidePointerEvents: !0,
|
|
1474
|
-
onEscapeKeyDown: s,
|
|
1475
|
-
onPointerDownOutside: c,
|
|
1476
|
-
onFocusOutside: (x) => x.preventDefault(),
|
|
1477
|
-
onDismiss: () => f.onOpenChange(!1),
|
|
1478
|
-
children: /* @__PURE__ */ v(
|
|
1479
|
-
le,
|
|
1480
|
-
{
|
|
1481
|
-
role: "listbox",
|
|
1482
|
-
id: f.contentId,
|
|
1483
|
-
"data-state": f.open ? "open" : "closed",
|
|
1484
|
-
dir: f.dir,
|
|
1485
|
-
onContextMenu: (x) => x.preventDefault(),
|
|
1486
|
-
...y,
|
|
1487
|
-
...oe,
|
|
1488
|
-
onPlaced: () => z(!0),
|
|
1489
|
-
ref: b,
|
|
1490
|
-
style: {
|
|
1491
|
-
// flex layout so we can place the scroll buttons properly
|
|
1492
|
-
display: "flex",
|
|
1493
|
-
flexDirection: "column",
|
|
1494
|
-
// reset the outline by default as the content MAY get focused
|
|
1495
|
-
outline: "none",
|
|
1496
|
-
...y.style
|
|
1497
|
-
},
|
|
1498
|
-
onKeyDown: M(y.onKeyDown, (x) => {
|
|
1499
|
-
const A = x.ctrlKey || x.altKey || x.metaKey;
|
|
1500
|
-
if (x.key === "Tab" && x.preventDefault(), !A && x.key.length === 1 && Q(x.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(x.key)) {
|
|
1501
|
-
let I = U().filter((N) => !N.disabled).map((N) => N.ref.current);
|
|
1502
|
-
if (["ArrowUp", "End"].includes(x.key) && (I = I.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(x.key)) {
|
|
1503
|
-
const N = x.target, T = I.indexOf(N);
|
|
1504
|
-
I = I.slice(T + 1);
|
|
1505
|
-
}
|
|
1506
|
-
setTimeout(() => B(I)), x.preventDefault();
|
|
1507
|
-
}
|
|
1508
|
-
})
|
|
1509
|
-
}
|
|
1510
|
-
)
|
|
1511
|
-
}
|
|
1512
|
-
)
|
|
1513
|
-
}
|
|
1514
|
-
) })
|
|
1515
|
-
}
|
|
1516
|
-
);
|
|
1517
|
-
}
|
|
1518
|
-
);
|
|
1519
|
-
tn.displayName = _o;
|
|
1520
|
-
var Lo = "SelectItemAlignedPosition", nn = a.forwardRef((e, t) => {
|
|
1521
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = ne(ce, n), c = re(ce, n), [i, u] = a.useState(null), [d, m] = a.useState(null), g = k(t, (b) => m(b)), S = Le(n), w = a.useRef(!1), E = a.useRef(!0), { viewport: l, selectedItem: p, selectedItemText: y, focusSelectedItem: f } = c, h = a.useCallback(() => {
|
|
1522
|
-
if (s.trigger && s.valueNode && i && d && l && p && y) {
|
|
1523
|
-
const b = s.trigger.getBoundingClientRect(), O = d.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), H = y.getBoundingClientRect();
|
|
1524
|
-
if (s.dir !== "rtl") {
|
|
1525
|
-
const N = H.left - O.left, T = L.left - N, K = b.left - T, Z = b.width + K, Se = Math.max(Z, O.width), we = window.innerWidth - X, Ce = ot(T, [
|
|
1526
|
-
X,
|
|
1527
|
-
// Prevents the content from going off the starting edge of the
|
|
1528
|
-
// viewport. It may still go off the ending edge, but this can be
|
|
1529
|
-
// controlled by the user since they may want to manage overflow in a
|
|
1530
|
-
// specific way.
|
|
1531
|
-
// https://github.com/radix-ui/primitives/issues/2049
|
|
1532
|
-
Math.max(X, we - Se)
|
|
1533
|
-
]);
|
|
1534
|
-
i.style.minWidth = Z + "px", i.style.left = Ce + "px";
|
|
1535
|
-
} else {
|
|
1536
|
-
const N = O.right - H.right, T = window.innerWidth - L.right - N, K = window.innerWidth - b.right - T, Z = b.width + K, Se = Math.max(Z, O.width), we = window.innerWidth - X, Ce = ot(T, [
|
|
1537
|
-
X,
|
|
1538
|
-
Math.max(X, we - Se)
|
|
1539
|
-
]);
|
|
1540
|
-
i.style.minWidth = Z + "px", i.style.right = Ce + "px";
|
|
1541
|
-
}
|
|
1542
|
-
const D = S(), U = window.innerHeight - X * 2, $ = l.scrollHeight, z = window.getComputedStyle(d), j = parseInt(z.borderTopWidth, 10), B = parseInt(z.paddingTop, 10), V = parseInt(z.borderBottomWidth, 10), F = parseInt(z.paddingBottom, 10), Y = j + B + $ + F + V, he = Math.min(p.offsetHeight * 5, Y), Q = window.getComputedStyle(l), ge = parseInt(Q.paddingTop, 10), ye = parseInt(Q.paddingBottom, 10), J = b.top + b.height / 2 - X, le = U - J, oe = p.offsetHeight / 2, x = p.offsetTop + oe, A = j + B + x, W = Y - A;
|
|
1543
|
-
if (A <= J) {
|
|
1544
|
-
const N = D.length > 0 && p === D[D.length - 1].ref.current;
|
|
1545
|
-
i.style.bottom = "0px";
|
|
1546
|
-
const T = d.clientHeight - l.offsetTop - l.offsetHeight, K = Math.max(
|
|
1547
|
-
le,
|
|
1548
|
-
oe + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
1549
|
-
(N ? ye : 0) + T + V
|
|
1550
|
-
), Z = A + K;
|
|
1551
|
-
i.style.height = Z + "px";
|
|
1552
|
-
} else {
|
|
1553
|
-
const N = D.length > 0 && p === D[0].ref.current;
|
|
1554
|
-
i.style.top = "0px";
|
|
1555
|
-
const K = Math.max(
|
|
1556
|
-
J,
|
|
1557
|
-
j + l.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
1558
|
-
(N ? ge : 0) + oe
|
|
1559
|
-
) + W;
|
|
1560
|
-
i.style.height = K + "px", l.scrollTop = A - J + l.offsetTop;
|
|
1561
|
-
}
|
|
1562
|
-
i.style.margin = `${X}px 0`, i.style.minHeight = he + "px", i.style.maxHeight = U + "px", r == null || r(), requestAnimationFrame(() => w.current = !0);
|
|
1563
|
-
}
|
|
1564
|
-
}, [
|
|
1565
|
-
S,
|
|
1566
|
-
s.trigger,
|
|
1567
|
-
s.valueNode,
|
|
1568
|
-
i,
|
|
1569
|
-
d,
|
|
1570
|
-
l,
|
|
1571
|
-
p,
|
|
1572
|
-
y,
|
|
1573
|
-
s.dir,
|
|
1574
|
-
r
|
|
1575
|
-
]);
|
|
1576
|
-
G(() => h(), [h]);
|
|
1577
|
-
const [C, P] = a.useState();
|
|
1578
|
-
G(() => {
|
|
1579
|
-
d && P(window.getComputedStyle(d).zIndex);
|
|
1580
|
-
}, [d]);
|
|
1581
|
-
const R = a.useCallback(
|
|
1582
|
-
(b) => {
|
|
1583
|
-
b && E.current === !0 && (h(), f == null || f(), E.current = !1);
|
|
1584
|
-
},
|
|
1585
|
-
[h, f]
|
|
1586
|
-
);
|
|
1587
|
-
return /* @__PURE__ */ v(
|
|
1588
|
-
ko,
|
|
1589
|
-
{
|
|
1590
|
-
scope: n,
|
|
1591
|
-
contentWrapper: i,
|
|
1592
|
-
shouldExpandOnScrollRef: w,
|
|
1593
|
-
onScrollButtonChange: R,
|
|
1594
|
-
children: /* @__PURE__ */ v(
|
|
1595
|
-
"div",
|
|
1596
|
-
{
|
|
1597
|
-
ref: u,
|
|
1598
|
-
style: {
|
|
1599
|
-
display: "flex",
|
|
1600
|
-
flexDirection: "column",
|
|
1601
|
-
position: "fixed",
|
|
1602
|
-
zIndex: C
|
|
1603
|
-
},
|
|
1604
|
-
children: /* @__PURE__ */ v(
|
|
1605
|
-
_.div,
|
|
1606
|
-
{
|
|
1607
|
-
...o,
|
|
1608
|
-
ref: g,
|
|
1609
|
-
style: {
|
|
1610
|
-
// When we get the height of the content, it includes borders. If we were to set
|
|
1611
|
-
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
1612
|
-
boxSizing: "border-box",
|
|
1613
|
-
// We need to ensure the content doesn't get taller than the wrapper
|
|
1614
|
-
maxHeight: "100%",
|
|
1615
|
-
...o.style
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
)
|
|
1619
|
-
}
|
|
1620
|
-
)
|
|
1621
|
-
}
|
|
1622
|
-
);
|
|
1623
|
-
});
|
|
1624
|
-
nn.displayName = Lo;
|
|
1625
|
-
var Do = "SelectPopperPosition", je = a.forwardRef((e, t) => {
|
|
1626
|
-
const {
|
|
1627
|
-
__scopeSelect: n,
|
|
1628
|
-
align: r = "start",
|
|
1629
|
-
collisionPadding: o = X,
|
|
1630
|
-
...s
|
|
1631
|
-
} = e, c = De(n);
|
|
1632
|
-
return /* @__PURE__ */ v(
|
|
1633
|
-
_r,
|
|
1634
|
-
{
|
|
1635
|
-
...c,
|
|
1636
|
-
...s,
|
|
1637
|
-
ref: t,
|
|
1638
|
-
align: r,
|
|
1639
|
-
collisionPadding: o,
|
|
1640
|
-
style: {
|
|
1641
|
-
// Ensure border-box for floating-ui calculations
|
|
1642
|
-
boxSizing: "border-box",
|
|
1643
|
-
...s.style,
|
|
1644
|
-
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1645
|
-
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
1646
|
-
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
1647
|
-
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1648
|
-
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
);
|
|
1652
|
-
});
|
|
1653
|
-
je.displayName = Do;
|
|
1654
|
-
var [ko, nt] = me(ce, {}), ze = "SelectViewport", rn = a.forwardRef(
|
|
1655
|
-
(e, t) => {
|
|
1656
|
-
const { __scopeSelect: n, nonce: r, ...o } = e, s = re(ze, n), c = nt(ze, n), i = k(t, s.onViewportChange), u = a.useRef(0);
|
|
1657
|
-
return /* @__PURE__ */ ie(Ze, { children: [
|
|
1658
|
-
/* @__PURE__ */ v(
|
|
1659
|
-
"style",
|
|
1660
|
-
{
|
|
1661
|
-
dangerouslySetInnerHTML: {
|
|
1662
|
-
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
1663
|
-
},
|
|
1664
|
-
nonce: r
|
|
1665
|
-
}
|
|
1666
|
-
),
|
|
1667
|
-
/* @__PURE__ */ v(Me.Slot, { scope: n, children: /* @__PURE__ */ v(
|
|
1668
|
-
_.div,
|
|
1669
|
-
{
|
|
1670
|
-
"data-radix-select-viewport": "",
|
|
1671
|
-
role: "presentation",
|
|
1672
|
-
...o,
|
|
1673
|
-
ref: i,
|
|
1674
|
-
style: {
|
|
1675
|
-
// we use position: 'relative' here on the `viewport` so that when we call
|
|
1676
|
-
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
1677
|
-
// (independent of the scrollUpButton).
|
|
1678
|
-
position: "relative",
|
|
1679
|
-
flex: 1,
|
|
1680
|
-
// Viewport should only be scrollable in the vertical direction.
|
|
1681
|
-
// This won't work in vertical writing modes, so we'll need to
|
|
1682
|
-
// revisit this if/when that is supported
|
|
1683
|
-
// https://developer.chrome.com/blog/vertical-form-controls
|
|
1684
|
-
overflow: "hidden auto",
|
|
1685
|
-
...o.style
|
|
1686
|
-
},
|
|
1687
|
-
onScroll: M(o.onScroll, (d) => {
|
|
1688
|
-
const m = d.currentTarget, { contentWrapper: g, shouldExpandOnScrollRef: S } = c;
|
|
1689
|
-
if (S != null && S.current && g) {
|
|
1690
|
-
const w = Math.abs(u.current - m.scrollTop);
|
|
1691
|
-
if (w > 0) {
|
|
1692
|
-
const E = window.innerHeight - X * 2, l = parseFloat(g.style.minHeight), p = parseFloat(g.style.height), y = Math.max(l, p);
|
|
1693
|
-
if (y < E) {
|
|
1694
|
-
const f = y + w, h = Math.min(E, f), C = f - h;
|
|
1695
|
-
g.style.height = h + "px", g.style.bottom === "0px" && (m.scrollTop = C > 0 ? C : 0, g.style.justifyContent = "flex-end");
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
u.current = m.scrollTop;
|
|
1700
|
-
})
|
|
1701
|
-
}
|
|
1702
|
-
) })
|
|
1703
|
-
] });
|
|
1704
|
-
}
|
|
1705
|
-
);
|
|
1706
|
-
rn.displayName = ze;
|
|
1707
|
-
var on = "SelectGroup", [Bo, Fo] = me(on), an = a.forwardRef(
|
|
1708
|
-
(e, t) => {
|
|
1709
|
-
const { __scopeSelect: n, ...r } = e, o = Je();
|
|
1710
|
-
return /* @__PURE__ */ v(Bo, { scope: n, id: o, children: /* @__PURE__ */ v(_.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
1711
|
-
}
|
|
1712
|
-
);
|
|
1713
|
-
an.displayName = on;
|
|
1714
|
-
var sn = "SelectLabel", cn = a.forwardRef(
|
|
1715
|
-
(e, t) => {
|
|
1716
|
-
const { __scopeSelect: n, ...r } = e, o = Fo(sn, n);
|
|
1717
|
-
return /* @__PURE__ */ v(_.div, { id: o.id, ...r, ref: t });
|
|
1718
|
-
}
|
|
1719
|
-
);
|
|
1720
|
-
cn.displayName = sn;
|
|
1721
|
-
var Oe = "SelectItem", [Wo, ln] = me(Oe), un = a.forwardRef(
|
|
1722
|
-
(e, t) => {
|
|
1723
|
-
const {
|
|
1724
|
-
__scopeSelect: n,
|
|
1725
|
-
value: r,
|
|
1726
|
-
disabled: o = !1,
|
|
1727
|
-
textValue: s,
|
|
1728
|
-
...c
|
|
1729
|
-
} = e, i = ne(Oe, n), u = re(Oe, n), d = i.value === r, [m, g] = a.useState(s ?? ""), [S, w] = a.useState(!1), E = k(
|
|
1730
|
-
t,
|
|
1731
|
-
(f) => {
|
|
1732
|
-
var h;
|
|
1733
|
-
return (h = u.itemRefCallback) == null ? void 0 : h.call(u, f, r, o);
|
|
1734
|
-
}
|
|
1735
|
-
), l = Je(), p = a.useRef("touch"), y = () => {
|
|
1736
|
-
o || (i.onValueChange(r), i.onOpenChange(!1));
|
|
1737
|
-
};
|
|
1738
|
-
if (r === "")
|
|
1739
|
-
throw new Error(
|
|
1740
|
-
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
1741
|
-
);
|
|
1742
|
-
return /* @__PURE__ */ v(
|
|
1743
|
-
Wo,
|
|
1744
|
-
{
|
|
1745
|
-
scope: n,
|
|
1746
|
-
value: r,
|
|
1747
|
-
disabled: o,
|
|
1748
|
-
textId: l,
|
|
1749
|
-
isSelected: d,
|
|
1750
|
-
onItemTextChange: a.useCallback((f) => {
|
|
1751
|
-
g((h) => h || ((f == null ? void 0 : f.textContent) ?? "").trim());
|
|
1752
|
-
}, []),
|
|
1753
|
-
children: /* @__PURE__ */ v(
|
|
1754
|
-
Me.ItemSlot,
|
|
1755
|
-
{
|
|
1756
|
-
scope: n,
|
|
1757
|
-
value: r,
|
|
1758
|
-
disabled: o,
|
|
1759
|
-
textValue: m,
|
|
1760
|
-
children: /* @__PURE__ */ v(
|
|
1761
|
-
_.div,
|
|
1762
|
-
{
|
|
1763
|
-
role: "option",
|
|
1764
|
-
"aria-labelledby": l,
|
|
1765
|
-
"data-highlighted": S ? "" : void 0,
|
|
1766
|
-
"aria-selected": d && S,
|
|
1767
|
-
"data-state": d ? "checked" : "unchecked",
|
|
1768
|
-
"aria-disabled": o || void 0,
|
|
1769
|
-
"data-disabled": o ? "" : void 0,
|
|
1770
|
-
tabIndex: o ? void 0 : -1,
|
|
1771
|
-
...c,
|
|
1772
|
-
ref: E,
|
|
1773
|
-
onFocus: M(c.onFocus, () => w(!0)),
|
|
1774
|
-
onBlur: M(c.onBlur, () => w(!1)),
|
|
1775
|
-
onClick: M(c.onClick, () => {
|
|
1776
|
-
p.current !== "mouse" && y();
|
|
1777
|
-
}),
|
|
1778
|
-
onPointerUp: M(c.onPointerUp, () => {
|
|
1779
|
-
p.current === "mouse" && y();
|
|
1780
|
-
}),
|
|
1781
|
-
onPointerDown: M(c.onPointerDown, (f) => {
|
|
1782
|
-
p.current = f.pointerType;
|
|
1783
|
-
}),
|
|
1784
|
-
onPointerMove: M(c.onPointerMove, (f) => {
|
|
1785
|
-
var h;
|
|
1786
|
-
p.current = f.pointerType, o ? (h = u.onItemLeave) == null || h.call(u) : p.current === "mouse" && f.currentTarget.focus({ preventScroll: !0 });
|
|
1787
|
-
}),
|
|
1788
|
-
onPointerLeave: M(c.onPointerLeave, (f) => {
|
|
1789
|
-
var h;
|
|
1790
|
-
f.currentTarget === document.activeElement && ((h = u.onItemLeave) == null || h.call(u));
|
|
1791
|
-
}),
|
|
1792
|
-
onKeyDown: M(c.onKeyDown, (f) => {
|
|
1793
|
-
var C;
|
|
1794
|
-
((C = u.searchRef) == null ? void 0 : C.current) !== "" && f.key === " " || (Po.includes(f.key) && y(), f.key === " " && f.preventDefault());
|
|
1795
|
-
})
|
|
1796
|
-
}
|
|
1797
|
-
)
|
|
1798
|
-
}
|
|
1799
|
-
)
|
|
1800
|
-
}
|
|
1801
|
-
);
|
|
1802
|
-
}
|
|
1803
|
-
);
|
|
1804
|
-
un.displayName = Oe;
|
|
1805
|
-
var be = "SelectItemText", dn = a.forwardRef(
|
|
1806
|
-
(e, t) => {
|
|
1807
|
-
const { __scopeSelect: n, className: r, style: o, ...s } = e, c = ne(be, n), i = re(be, n), u = ln(be, n), d = Io(be, n), [m, g] = a.useState(null), S = k(
|
|
1808
|
-
t,
|
|
1809
|
-
(y) => g(y),
|
|
1810
|
-
u.onItemTextChange,
|
|
1811
|
-
(y) => {
|
|
1812
|
-
var f;
|
|
1813
|
-
return (f = i.itemTextRefCallback) == null ? void 0 : f.call(i, y, u.value, u.disabled);
|
|
1814
|
-
}
|
|
1815
|
-
), w = m == null ? void 0 : m.textContent, E = a.useMemo(
|
|
1816
|
-
() => /* @__PURE__ */ v("option", { value: u.value, disabled: u.disabled, children: w }, u.value),
|
|
1817
|
-
[u.disabled, u.value, w]
|
|
1818
|
-
), { onNativeOptionAdd: l, onNativeOptionRemove: p } = d;
|
|
1819
|
-
return G(() => (l(E), () => p(E)), [l, p, E]), /* @__PURE__ */ ie(Ze, { children: [
|
|
1820
|
-
/* @__PURE__ */ v(_.span, { id: u.textId, ...s, ref: S }),
|
|
1821
|
-
u.isSelected && c.valueNode && !c.valueNodeHasChildren ? qe.createPortal(s.children, c.valueNode) : null
|
|
1822
|
-
] });
|
|
1823
|
-
}
|
|
1824
|
-
);
|
|
1825
|
-
dn.displayName = be;
|
|
1826
|
-
var fn = "SelectItemIndicator", pn = a.forwardRef(
|
|
1827
|
-
(e, t) => {
|
|
1828
|
-
const { __scopeSelect: n, ...r } = e;
|
|
1829
|
-
return ln(fn, n).isSelected ? /* @__PURE__ */ v(_.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
1830
|
-
}
|
|
1831
|
-
);
|
|
1832
|
-
pn.displayName = fn;
|
|
1833
|
-
var Ye = "SelectScrollUpButton", vn = a.forwardRef((e, t) => {
|
|
1834
|
-
const n = re(Ye, e.__scopeSelect), r = nt(Ye, e.__scopeSelect), [o, s] = a.useState(!1), c = k(t, r.onScrollButtonChange);
|
|
1835
|
-
return G(() => {
|
|
1836
|
-
if (n.viewport && n.isPositioned) {
|
|
1837
|
-
let i = function() {
|
|
1838
|
-
const d = u.scrollTop > 0;
|
|
1839
|
-
s(d);
|
|
1840
|
-
};
|
|
1841
|
-
const u = n.viewport;
|
|
1842
|
-
return i(), u.addEventListener("scroll", i), () => u.removeEventListener("scroll", i);
|
|
1843
|
-
}
|
|
1844
|
-
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ v(
|
|
1845
|
-
hn,
|
|
1846
|
-
{
|
|
1847
|
-
...e,
|
|
1848
|
-
ref: c,
|
|
1849
|
-
onAutoScroll: () => {
|
|
1850
|
-
const { viewport: i, selectedItem: u } = n;
|
|
1851
|
-
i && u && (i.scrollTop = i.scrollTop - u.offsetHeight);
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
) : null;
|
|
1855
|
-
});
|
|
1856
|
-
vn.displayName = Ye;
|
|
1857
|
-
var Xe = "SelectScrollDownButton", mn = a.forwardRef((e, t) => {
|
|
1858
|
-
const n = re(Xe, e.__scopeSelect), r = nt(Xe, e.__scopeSelect), [o, s] = a.useState(!1), c = k(t, r.onScrollButtonChange);
|
|
1859
|
-
return G(() => {
|
|
1860
|
-
if (n.viewport && n.isPositioned) {
|
|
1861
|
-
let i = function() {
|
|
1862
|
-
const d = u.scrollHeight - u.clientHeight, m = Math.ceil(u.scrollTop) < d;
|
|
1863
|
-
s(m);
|
|
1864
|
-
};
|
|
1865
|
-
const u = n.viewport;
|
|
1866
|
-
return i(), u.addEventListener("scroll", i), () => u.removeEventListener("scroll", i);
|
|
1867
|
-
}
|
|
1868
|
-
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ v(
|
|
1869
|
-
hn,
|
|
1870
|
-
{
|
|
1871
|
-
...e,
|
|
1872
|
-
ref: c,
|
|
1873
|
-
onAutoScroll: () => {
|
|
1874
|
-
const { viewport: i, selectedItem: u } = n;
|
|
1875
|
-
i && u && (i.scrollTop = i.scrollTop + u.offsetHeight);
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
) : null;
|
|
1879
|
-
});
|
|
1880
|
-
mn.displayName = Xe;
|
|
1881
|
-
var hn = a.forwardRef((e, t) => {
|
|
1882
|
-
const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = re("SelectScrollButton", n), c = a.useRef(null), i = Le(n), u = a.useCallback(() => {
|
|
1883
|
-
c.current !== null && (window.clearInterval(c.current), c.current = null);
|
|
1884
|
-
}, []);
|
|
1885
|
-
return a.useEffect(() => () => u(), [u]), G(() => {
|
|
1886
|
-
var m;
|
|
1887
|
-
const d = i().find((g) => g.ref.current === document.activeElement);
|
|
1888
|
-
(m = d == null ? void 0 : d.ref.current) == null || m.scrollIntoView({ block: "nearest" });
|
|
1889
|
-
}, [i]), /* @__PURE__ */ v(
|
|
1890
|
-
_.div,
|
|
1891
|
-
{
|
|
1892
|
-
"aria-hidden": !0,
|
|
1893
|
-
...o,
|
|
1894
|
-
ref: t,
|
|
1895
|
-
style: { flexShrink: 0, ...o.style },
|
|
1896
|
-
onPointerDown: M(o.onPointerDown, () => {
|
|
1897
|
-
c.current === null && (c.current = window.setInterval(r, 50));
|
|
1898
|
-
}),
|
|
1899
|
-
onPointerMove: M(o.onPointerMove, () => {
|
|
1900
|
-
var d;
|
|
1901
|
-
(d = s.onItemLeave) == null || d.call(s), c.current === null && (c.current = window.setInterval(r, 50));
|
|
1902
|
-
}),
|
|
1903
|
-
onPointerLeave: M(o.onPointerLeave, () => {
|
|
1904
|
-
u();
|
|
1905
|
-
})
|
|
1906
|
-
}
|
|
1907
|
-
);
|
|
1908
|
-
}), Ho = "SelectSeparator", gn = a.forwardRef(
|
|
1909
|
-
(e, t) => {
|
|
1910
|
-
const { __scopeSelect: n, ...r } = e;
|
|
1911
|
-
return /* @__PURE__ */ v(_.div, { "aria-hidden": !0, ...r, ref: t });
|
|
1912
|
-
}
|
|
1913
|
-
);
|
|
1914
|
-
gn.displayName = Ho;
|
|
1915
|
-
var Ge = "SelectArrow", Vo = a.forwardRef(
|
|
1916
|
-
(e, t) => {
|
|
1917
|
-
const { __scopeSelect: n, ...r } = e, o = De(n), s = ne(Ge, n), c = re(Ge, n);
|
|
1918
|
-
return s.open && c.position === "popper" ? /* @__PURE__ */ v(Mr, { ...o, ...r, ref: t }) : null;
|
|
1919
|
-
}
|
|
1920
|
-
);
|
|
1921
|
-
Vo.displayName = Ge;
|
|
1922
|
-
var Uo = "SelectBubbleInput", yn = a.forwardRef(
|
|
1923
|
-
({ __scopeSelect: e, value: t, ...n }, r) => {
|
|
1924
|
-
const o = a.useRef(null), s = k(r, o), c = zn(t);
|
|
1925
|
-
return a.useEffect(() => {
|
|
1926
|
-
const i = o.current;
|
|
1927
|
-
if (!i) return;
|
|
1928
|
-
const u = window.HTMLSelectElement.prototype, m = Object.getOwnPropertyDescriptor(
|
|
1929
|
-
u,
|
|
1930
|
-
"value"
|
|
1931
|
-
).set;
|
|
1932
|
-
if (c !== t && m) {
|
|
1933
|
-
const g = new Event("change", { bubbles: !0 });
|
|
1934
|
-
m.call(i, t), i.dispatchEvent(g);
|
|
1935
|
-
}
|
|
1936
|
-
}, [c, t]), /* @__PURE__ */ v(
|
|
1937
|
-
_.select,
|
|
1938
|
-
{
|
|
1939
|
-
...n,
|
|
1940
|
-
style: { ...kt, ...n.style },
|
|
1941
|
-
ref: s,
|
|
1942
|
-
defaultValue: t
|
|
1943
|
-
}
|
|
1944
|
-
);
|
|
1945
|
-
}
|
|
1946
|
-
);
|
|
1947
|
-
yn.displayName = Uo;
|
|
1948
|
-
function Sn(e) {
|
|
1949
|
-
return e === "" || e === void 0;
|
|
1950
|
-
}
|
|
1951
|
-
function wn(e) {
|
|
1952
|
-
const t = ve(e), n = a.useRef(""), r = a.useRef(0), o = a.useCallback(
|
|
1953
|
-
(c) => {
|
|
1954
|
-
const i = n.current + c;
|
|
1955
|
-
t(i), (function u(d) {
|
|
1956
|
-
n.current = d, window.clearTimeout(r.current), d !== "" && (r.current = window.setTimeout(() => u(""), 1e3));
|
|
1957
|
-
})(i);
|
|
1958
|
-
},
|
|
1959
|
-
[t]
|
|
1960
|
-
), s = a.useCallback(() => {
|
|
1961
|
-
n.current = "", window.clearTimeout(r.current);
|
|
1962
|
-
}, []);
|
|
1963
|
-
return a.useEffect(() => () => window.clearTimeout(r.current), []), [n, o, s];
|
|
1964
|
-
}
|
|
1965
|
-
function Cn(e, t, n) {
|
|
1966
|
-
const o = t.length > 1 && Array.from(t).every((d) => d === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
|
|
1967
|
-
let c = $o(e, Math.max(s, 0));
|
|
1968
|
-
o.length === 1 && (c = c.filter((d) => d !== n));
|
|
1969
|
-
const u = c.find(
|
|
1970
|
-
(d) => d.textValue.toLowerCase().startsWith(o.toLowerCase())
|
|
1971
|
-
);
|
|
1972
|
-
return u !== n ? u : void 0;
|
|
1973
|
-
}
|
|
1974
|
-
function $o(e, t) {
|
|
1975
|
-
return e.map((n, r) => e[(t + r) % e.length]);
|
|
1976
|
-
}
|
|
1977
|
-
var Ko = zt, bn = Xt, jo = Zt, zo = qt, Yo = Qt, En = Jt, Xo = rn, Go = an, xn = cn, Pn = un, Zo = dn, qo = pn, Rn = vn, Nn = mn, Tn = gn;
|
|
1978
|
-
const la = Ko, ua = Go, da = jo, Qo = a.forwardRef(
|
|
1979
|
-
({ className: e, children: t, ...n }, r) => /* @__PURE__ */ ie(
|
|
1980
|
-
bn,
|
|
1981
|
-
{
|
|
1982
|
-
ref: r,
|
|
1983
|
-
className: te(
|
|
1984
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
1985
|
-
e
|
|
1986
|
-
),
|
|
1987
|
-
...n,
|
|
1988
|
-
children: [
|
|
1989
|
-
t,
|
|
1990
|
-
/* @__PURE__ */ v(zo, { asChild: !0, children: /* @__PURE__ */ v(gt, { className: "size-4 opacity-50" }) })
|
|
1991
|
-
]
|
|
1992
|
-
}
|
|
1993
|
-
)
|
|
1994
|
-
);
|
|
1995
|
-
Qo.displayName = bn.displayName;
|
|
1996
|
-
const In = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ v(Rn, { ref: n, className: te("flex cursor-default items-center justify-center py-1", e), ...t, children: /* @__PURE__ */ v(Zn, { className: "size-4" }) }));
|
|
1997
|
-
In.displayName = Rn.displayName;
|
|
1998
|
-
const An = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ v(Nn, { ref: n, className: te("flex cursor-default items-center justify-center py-1", e), ...t, children: /* @__PURE__ */ v(gt, { className: "size-4" }) }));
|
|
1999
|
-
An.displayName = Nn.displayName;
|
|
2000
|
-
const Jo = a.forwardRef(
|
|
2001
|
-
({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ v(Yo, { children: /* @__PURE__ */ ie(
|
|
2002
|
-
En,
|
|
2003
|
-
{
|
|
2004
|
-
ref: o,
|
|
2005
|
-
className: te(
|
|
2006
|
-
"relative z-[100] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2007
|
-
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
2008
|
-
e
|
|
2009
|
-
),
|
|
2010
|
-
position: n,
|
|
2011
|
-
...r,
|
|
2012
|
-
children: [
|
|
2013
|
-
/* @__PURE__ */ v(In, {}),
|
|
2014
|
-
/* @__PURE__ */ v(
|
|
2015
|
-
Xo,
|
|
2016
|
-
{
|
|
2017
|
-
className: te("p-1", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
2018
|
-
children: t
|
|
2019
|
-
}
|
|
2020
|
-
),
|
|
2021
|
-
/* @__PURE__ */ v(An, {})
|
|
2022
|
-
]
|
|
2023
|
-
}
|
|
2024
|
-
) })
|
|
2025
|
-
);
|
|
2026
|
-
Jo.displayName = En.displayName;
|
|
2027
|
-
const ea = a.forwardRef(
|
|
2028
|
-
({ className: e, ...t }, n) => /* @__PURE__ */ v(xn, { ref: n, className: te("py-1.5 pl-8 pr-2 text-sm font-semibold", e), ...t })
|
|
2029
|
-
);
|
|
2030
|
-
ea.displayName = xn.displayName;
|
|
2031
|
-
const ta = a.forwardRef(
|
|
2032
|
-
({ className: e, children: t, ...n }, r) => /* @__PURE__ */ ie(
|
|
2033
|
-
Pn,
|
|
2034
|
-
{
|
|
2035
|
-
ref: r,
|
|
2036
|
-
className: te(
|
|
2037
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2038
|
-
e
|
|
2039
|
-
),
|
|
2040
|
-
...n,
|
|
2041
|
-
children: [
|
|
2042
|
-
/* @__PURE__ */ v("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ v(qo, { children: /* @__PURE__ */ v(Xn, { className: "size-4" }) }) }),
|
|
2043
|
-
/* @__PURE__ */ v(Zo, { children: t })
|
|
2044
|
-
]
|
|
2045
|
-
}
|
|
2046
|
-
)
|
|
2047
|
-
);
|
|
2048
|
-
ta.displayName = Pn.displayName;
|
|
2049
|
-
const na = a.forwardRef(
|
|
2050
|
-
({ className: e, ...t }, n) => /* @__PURE__ */ v(Tn, { ref: n, className: te("-mx-1 my-1 h-px bg-muted", e), ...t })
|
|
2051
|
-
);
|
|
2052
|
-
na.displayName = Tn.displayName;
|
|
2053
|
-
export {
|
|
2054
|
-
Xn as C,
|
|
2055
|
-
jt as R,
|
|
2056
|
-
la as S,
|
|
2057
|
-
Jo as a,
|
|
2058
|
-
ua as b,
|
|
2059
|
-
ta as c,
|
|
2060
|
-
ea as d,
|
|
2061
|
-
An as e,
|
|
2062
|
-
In as f,
|
|
2063
|
-
na as g,
|
|
2064
|
-
Qo as h,
|
|
2065
|
-
da as i,
|
|
2066
|
-
vr as j,
|
|
2067
|
-
Hr as k,
|
|
2068
|
-
ot as l,
|
|
2069
|
-
zn as m,
|
|
2070
|
-
or as u
|
|
2071
|
-
};
|