@ryanodd/design-system 0.0.0-dev1 → 0.0.0-dev3
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/README.md +17 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/index.css +1 -0
- package/dist/index.js +45 -0
- package/dist/index.mjs +4984 -0
- package/package.json +12 -2
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,4984 @@
|
|
|
1
|
+
import { jsx as p, jsxs as K, Fragment as Ce } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import we, { forwardRef as Ge, useState as $i, useLayoutEffect as Bi } from "react";
|
|
4
|
+
import * as an from "react-dom";
|
|
5
|
+
import Wi from "react-dom";
|
|
6
|
+
const Hi = "_button_w6zk1_1", Vi = "_buttonNotificationDot_w6zk1_143", Fn = {
|
|
7
|
+
button: Hi,
|
|
8
|
+
buttonNotificationDot: Vi
|
|
9
|
+
}, Ki = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='m12%2019l-7-7l7-7m7%207H5'/%3e%3c/svg%3e", Ui = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M5%2012h14m-7-7l7%207l-7%207'/%3e%3c/svg%3e", Gi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='currentColor'%20d='m9.55%2015.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175%209.2q-.3.3-.7.3t-.7-.3L4.55%2013q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z'/%3e%3c/svg%3e", zi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3c/svg%3e", ji = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M18%206L6%2018M6%206l12%2012'/%3e%3c/svg%3e", Yi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M15%203h6v6m-11%205L21%203m-3%2010v6a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h6'/%3e%3c/svg%3e", Xi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='currentColor'%20d='M31.23%2017.736c.063-.57.103-1.148.103-1.736s-.04-1.166-.104-1.737l-4.378-1.557c-.218-.716-.504-1.4-.85-2.05l1.992-4.192a15.6%2015.6%200%200%200-2.458-2.46L21.343%206a11%2011%200%200%200-2.05-.85L17.737.772C17.166.708%2016.588.667%2016%20.667s-1.166.04-1.737.105L12.707%205.15q-1.075.327-2.05.85L6.464%204.004c-.91.725-1.734%201.55-2.46%202.46L6%2010.654q-.523.976-.85%202.05l-4.378%201.56c-.064.57-.105%201.15-.105%201.737s.04%201.165.105%201.736l4.378%201.558q.327%201.074.85%202.05l-1.995%204.192c.725.91%201.55%201.733%202.46%202.458L10.654%2026q.976.523%202.05.852l1.558%204.377c.57.063%201.148.103%201.737.103c.588%200%201.165-.04%201.736-.104l1.558-4.378c.715-.218%201.4-.504%202.05-.85l4.192%201.992c.91-.725%201.733-1.55%202.458-2.458L26%2021.343c.348-.647.634-1.334.852-2.05l4.377-1.557zM16%2020.87a4.871%204.871%200%201%201-.002-9.742A4.871%204.871%200%200%201%2016%2020.87'/%3e%3c/svg%3e", qi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%3e%3cpath%20d='m15%2012l-8.373%208.373a1%201%200%201%201-3-3L12%209m6%206l4-4'/%3e%3cpath%20d='m21.5%2011.5l-1.914-1.914A2%202%200%200%201%2019%208.172V7l-2.26-2.26a6%206%200%200%200-4.202-1.756L9%202.96l.92.82A6.18%206.18%200%200%201%2012%208.4V10l2%202h1.172a2%202%200%200%201%201.414.586L18.5%2014.5'/%3e%3c/g%3e%3c/svg%3e", Zi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='currentColor'%20d='M6.979%203.074a6%206%200%200%201%204.988%201.425l.037.033l.034-.03a6%206%200%200%201%204.733-1.44l.246.036a6%206%200%200%201%203.364%2010.008l-.18.185l-.048.041l-7.45%207.379a1%201%200%200%201-1.313.082l-.094-.082l-7.493-7.422A6%206%200%200%201%206.979%203.074'/%3e%3c/svg%3e", Qi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cg%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3ccircle%20cx='8'%20cy='2.5'%20r='.75'/%3e%3ccircle%20cx='8'%20cy='8'%20r='.75'/%3e%3ccircle%20cx='8'%20cy='13.5'%20r='.75'/%3e%3c/g%3e%3c/svg%3e", Ji = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%3e%3cpath%20fill='currentColor'%20d='m213.85%20125.46l-112%20120a8%208%200%200%201-13.69-7l14.66-73.33l-57.63-21.64a8%208%200%200%201-3-13l112-120a8%208%200%200%201%2013.69%207l-14.7%2073.41l57.63%2021.61a8%208%200%200%201%203%2012.95Z'/%3e%3c/svg%3e", es = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%3e%3crect%20width='20'%20height='16'%20x='2'%20y='4'%20rx='2'/%3e%3cpath%20d='m22%207l-8.97%205.7a1.94%201.94%200%200%201-2.06%200L2%207'/%3e%3c/g%3e%3c/svg%3e", ts = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M4%2012h16M4%206h16M4%2018h16'/%3e%3c/svg%3e", ns = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M7.159%203.185C7.415%203.066%207.699%203%208%203h8a2%202%200%200%201%202%202v9m0%204v1a2%202%200%200%201-2%202H8a2%202%200%200%201-2-2V6m5-2h2M3%203l18%2018m-9-4v.01'/%3e%3c/svg%3e", os = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='currentColor'%20d='m12.9%206.855l4.242%204.242l-9.9%209.9H3v-4.243zm1.414-1.415l2.121-2.121a1%201%200%200%201%201.414%200l2.829%202.828a1%201%200%200%201%200%201.415l-2.122%202.121z'/%3e%3c/svg%3e", rs = "_icon_178c1_1", is = {
|
|
10
|
+
icon: rs
|
|
11
|
+
}, bf = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl"], U = (e, t) => {
|
|
12
|
+
const n = Ge(({ size: o = "lg", className: r, ...i }, c) => /* @__PURE__ */ p(
|
|
13
|
+
e,
|
|
14
|
+
{
|
|
15
|
+
className: `${r} ${is.icon}`,
|
|
16
|
+
"data-size": o,
|
|
17
|
+
ref: c,
|
|
18
|
+
alt: t,
|
|
19
|
+
...i
|
|
20
|
+
}
|
|
21
|
+
));
|
|
22
|
+
return n.displayName = t, n;
|
|
23
|
+
}, ss = U(Ki, "Left"), cs = U(Ui, "Right"), mo = U(Gi, "Check"), as = U(zi, "Circle"), vo = U(ji, "Close"), ls = U(Yi, "External Link"), us = U(Xi, "Gear"), ds = U(qi, "Hammer"), fs = U(Zi, "Heart"), ps = U(Qi, "Kebab"), ms = U(Ji, "Lightning"), vs = U(es, "Mail"), hs = U(ts, "Menu"), gs = U(ns, "No Mobile Devices"), ws = U(os, "Pencil"), $n = {
|
|
24
|
+
ArrowLeft: ss,
|
|
25
|
+
ArrowRight: cs,
|
|
26
|
+
Check: mo,
|
|
27
|
+
Circle: as,
|
|
28
|
+
Close: vo,
|
|
29
|
+
ExternalLink: ls,
|
|
30
|
+
Gear: us,
|
|
31
|
+
Hammer: ds,
|
|
32
|
+
Heart: fs,
|
|
33
|
+
Kebab: ps,
|
|
34
|
+
Lightning: ms,
|
|
35
|
+
Mail: vs,
|
|
36
|
+
Menu: hs,
|
|
37
|
+
NoMobile: gs,
|
|
38
|
+
Pencil: ws,
|
|
39
|
+
None: null
|
|
40
|
+
}, ys = "_spinnerWrapper_1mfc7_1", Cs = "_spinner_1mfc7_1", Bn = {
|
|
41
|
+
spinnerWrapper: ys,
|
|
42
|
+
spinner: Cs
|
|
43
|
+
}, ho = Ge(
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
45
|
+
({ className: e, size: t = "lg", ...n }, o) => /* @__PURE__ */ p(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref: o,
|
|
49
|
+
className: Bn.spinnerWrapper,
|
|
50
|
+
"data-size": t,
|
|
51
|
+
...n,
|
|
52
|
+
children: /* @__PURE__ */ p("div", { className: Bn.spinner })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
ho.displayName = "Spinner";
|
|
57
|
+
const Ct = Ge(
|
|
58
|
+
({ className: e, notificationDotText: t, children: n, icon: o, trailingIcon: r, size: i = "medium", variant: c, loading: a, iconOnly: d, ...l }, u) => {
|
|
59
|
+
const f = o ? $n[o] : void 0, v = r ? $n[r] : void 0, h = i === "small" ? "sm" : i === "medium" ? "md" : "lg";
|
|
60
|
+
return /* @__PURE__ */ K(
|
|
61
|
+
"button",
|
|
62
|
+
{
|
|
63
|
+
ref: u,
|
|
64
|
+
...l,
|
|
65
|
+
className: `${Fn.button} ${e ?? ""}`,
|
|
66
|
+
"data-size": i,
|
|
67
|
+
"data-variant": c,
|
|
68
|
+
"data-icon-only": d,
|
|
69
|
+
children: [
|
|
70
|
+
f && /* @__PURE__ */ p(f, { size: h }),
|
|
71
|
+
a && /* @__PURE__ */ p(ho, { size: h }),
|
|
72
|
+
n,
|
|
73
|
+
v && /* @__PURE__ */ p(v, { size: h }),
|
|
74
|
+
t && /* @__PURE__ */ p("span", { className: Fn.buttonNotificationDot, children: t })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
Ct.displayName = "Button";
|
|
81
|
+
function Wn(e, t) {
|
|
82
|
+
if (typeof e == "function")
|
|
83
|
+
return e(t);
|
|
84
|
+
e != null && (e.current = t);
|
|
85
|
+
}
|
|
86
|
+
function bt(...e) {
|
|
87
|
+
return (t) => {
|
|
88
|
+
let n = !1;
|
|
89
|
+
const o = e.map((r) => {
|
|
90
|
+
const i = Wn(r, t);
|
|
91
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
92
|
+
});
|
|
93
|
+
if (n)
|
|
94
|
+
return () => {
|
|
95
|
+
for (let r = 0; r < o.length; r++) {
|
|
96
|
+
const i = o[r];
|
|
97
|
+
typeof i == "function" ? i() : Wn(e[r], null);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function W(...e) {
|
|
103
|
+
return s.useCallback(bt(...e), e);
|
|
104
|
+
}
|
|
105
|
+
function bs(e, t) {
|
|
106
|
+
const n = s.createContext(t), o = (i) => {
|
|
107
|
+
const { children: c, ...a } = i, d = s.useMemo(() => a, Object.values(a));
|
|
108
|
+
return /* @__PURE__ */ p(n.Provider, { value: d, children: c });
|
|
109
|
+
};
|
|
110
|
+
o.displayName = e + "Provider";
|
|
111
|
+
function r(i) {
|
|
112
|
+
const c = s.useContext(n);
|
|
113
|
+
if (c) return c;
|
|
114
|
+
if (t !== void 0) return t;
|
|
115
|
+
throw new Error(`\`${i}\` must be used within \`${e}\``);
|
|
116
|
+
}
|
|
117
|
+
return [o, r];
|
|
118
|
+
}
|
|
119
|
+
function de(e, t = []) {
|
|
120
|
+
let n = [];
|
|
121
|
+
function o(i, c) {
|
|
122
|
+
const a = s.createContext(c), d = n.length;
|
|
123
|
+
n = [...n, c];
|
|
124
|
+
const l = (f) => {
|
|
125
|
+
const { scope: v, children: h, ...w } = f, m = v?.[e]?.[d] || a, g = s.useMemo(() => w, Object.values(w));
|
|
126
|
+
return /* @__PURE__ */ p(m.Provider, { value: g, children: h });
|
|
127
|
+
};
|
|
128
|
+
l.displayName = i + "Provider";
|
|
129
|
+
function u(f, v) {
|
|
130
|
+
const h = v?.[e]?.[d] || a, w = s.useContext(h);
|
|
131
|
+
if (w) return w;
|
|
132
|
+
if (c !== void 0) return c;
|
|
133
|
+
throw new Error(`\`${f}\` must be used within \`${i}\``);
|
|
134
|
+
}
|
|
135
|
+
return [l, u];
|
|
136
|
+
}
|
|
137
|
+
const r = () => {
|
|
138
|
+
const i = n.map((c) => s.createContext(c));
|
|
139
|
+
return function(a) {
|
|
140
|
+
const d = a?.[e] || i;
|
|
141
|
+
return s.useMemo(
|
|
142
|
+
() => ({ [`__scope${e}`]: { ...a, [e]: d } }),
|
|
143
|
+
[a, d]
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
return r.scopeName = e, [o, xs(r, ...t)];
|
|
148
|
+
}
|
|
149
|
+
function xs(...e) {
|
|
150
|
+
const t = e[0];
|
|
151
|
+
if (e.length === 1) return t;
|
|
152
|
+
const n = () => {
|
|
153
|
+
const o = e.map((r) => ({
|
|
154
|
+
useScope: r(),
|
|
155
|
+
scopeName: r.scopeName
|
|
156
|
+
}));
|
|
157
|
+
return function(i) {
|
|
158
|
+
const c = o.reduce((a, { useScope: d, scopeName: l }) => {
|
|
159
|
+
const f = d(i)[`__scope${l}`];
|
|
160
|
+
return { ...a, ...f };
|
|
161
|
+
}, {});
|
|
162
|
+
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
return n.scopeName = t.scopeName, n;
|
|
166
|
+
}
|
|
167
|
+
function _(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
168
|
+
return function(r) {
|
|
169
|
+
if (e?.(r), n === !1 || !r.defaultPrevented)
|
|
170
|
+
return t?.(r);
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
var ae = globalThis?.document ? s.useLayoutEffect : () => {
|
|
174
|
+
}, Es = s[" useInsertionEffect ".trim().toString()] || ae;
|
|
175
|
+
function Ne({
|
|
176
|
+
prop: e,
|
|
177
|
+
defaultProp: t,
|
|
178
|
+
onChange: n = () => {
|
|
179
|
+
},
|
|
180
|
+
caller: o
|
|
181
|
+
}) {
|
|
182
|
+
const [r, i, c] = Rs({
|
|
183
|
+
defaultProp: t,
|
|
184
|
+
onChange: n
|
|
185
|
+
}), a = e !== void 0, d = a ? e : r;
|
|
186
|
+
{
|
|
187
|
+
const u = s.useRef(e !== void 0);
|
|
188
|
+
s.useEffect(() => {
|
|
189
|
+
const f = u.current;
|
|
190
|
+
f !== a && console.warn(
|
|
191
|
+
`${o} is changing from ${f ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
192
|
+
), u.current = a;
|
|
193
|
+
}, [a, o]);
|
|
194
|
+
}
|
|
195
|
+
const l = s.useCallback(
|
|
196
|
+
(u) => {
|
|
197
|
+
if (a) {
|
|
198
|
+
const f = Ts(u) ? u(e) : u;
|
|
199
|
+
f !== e && c.current?.(f);
|
|
200
|
+
} else
|
|
201
|
+
i(u);
|
|
202
|
+
},
|
|
203
|
+
[a, e, i, c]
|
|
204
|
+
);
|
|
205
|
+
return [d, l];
|
|
206
|
+
}
|
|
207
|
+
function Rs({
|
|
208
|
+
defaultProp: e,
|
|
209
|
+
onChange: t
|
|
210
|
+
}) {
|
|
211
|
+
const [n, o] = s.useState(e), r = s.useRef(n), i = s.useRef(t);
|
|
212
|
+
return Es(() => {
|
|
213
|
+
i.current = t;
|
|
214
|
+
}, [t]), s.useEffect(() => {
|
|
215
|
+
r.current !== n && (i.current?.(n), r.current = n);
|
|
216
|
+
}, [n, r]), [n, o, i];
|
|
217
|
+
}
|
|
218
|
+
function Ts(e) {
|
|
219
|
+
return typeof e == "function";
|
|
220
|
+
}
|
|
221
|
+
function Ss(e) {
|
|
222
|
+
const t = s.useRef({ value: e, previous: e });
|
|
223
|
+
return s.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
224
|
+
}
|
|
225
|
+
function go(e) {
|
|
226
|
+
const [t, n] = s.useState(void 0);
|
|
227
|
+
return ae(() => {
|
|
228
|
+
if (e) {
|
|
229
|
+
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
230
|
+
const o = new ResizeObserver((r) => {
|
|
231
|
+
if (!Array.isArray(r) || !r.length)
|
|
232
|
+
return;
|
|
233
|
+
const i = r[0];
|
|
234
|
+
let c, a;
|
|
235
|
+
if ("borderBoxSize" in i) {
|
|
236
|
+
const d = i.borderBoxSize, l = Array.isArray(d) ? d[0] : d;
|
|
237
|
+
c = l.inlineSize, a = l.blockSize;
|
|
238
|
+
} else
|
|
239
|
+
c = e.offsetWidth, a = e.offsetHeight;
|
|
240
|
+
n({ width: c, height: a });
|
|
241
|
+
});
|
|
242
|
+
return o.observe(e, { box: "border-box" }), () => o.unobserve(e);
|
|
243
|
+
} else
|
|
244
|
+
n(void 0);
|
|
245
|
+
}, [e]), t;
|
|
246
|
+
}
|
|
247
|
+
function Ps(e, t) {
|
|
248
|
+
return s.useReducer((n, o) => t[n][o] ?? n, e);
|
|
249
|
+
}
|
|
250
|
+
var Z = (e) => {
|
|
251
|
+
const { present: t, children: n } = e, o = _s(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = W(o.ref, Ms(r));
|
|
252
|
+
return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
|
|
253
|
+
};
|
|
254
|
+
Z.displayName = "Presence";
|
|
255
|
+
function _s(e) {
|
|
256
|
+
const [t, n] = s.useState(), o = s.useRef(null), r = s.useRef(e), i = s.useRef("none"), c = e ? "mounted" : "unmounted", [a, d] = Ps(c, {
|
|
257
|
+
mounted: {
|
|
258
|
+
UNMOUNT: "unmounted",
|
|
259
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
260
|
+
},
|
|
261
|
+
unmountSuspended: {
|
|
262
|
+
MOUNT: "mounted",
|
|
263
|
+
ANIMATION_END: "unmounted"
|
|
264
|
+
},
|
|
265
|
+
unmounted: {
|
|
266
|
+
MOUNT: "mounted"
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
return s.useEffect(() => {
|
|
270
|
+
const l = nt(o.current);
|
|
271
|
+
i.current = a === "mounted" ? l : "none";
|
|
272
|
+
}, [a]), ae(() => {
|
|
273
|
+
const l = o.current, u = r.current;
|
|
274
|
+
if (u !== e) {
|
|
275
|
+
const v = i.current, h = nt(l);
|
|
276
|
+
e ? d("MOUNT") : h === "none" || l?.display === "none" ? d("UNMOUNT") : d(u && v !== h ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
|
|
277
|
+
}
|
|
278
|
+
}, [e, d]), ae(() => {
|
|
279
|
+
if (t) {
|
|
280
|
+
let l;
|
|
281
|
+
const u = t.ownerDocument.defaultView ?? window, f = (h) => {
|
|
282
|
+
const m = nt(o.current).includes(CSS.escape(h.animationName));
|
|
283
|
+
if (h.target === t && m && (d("ANIMATION_END"), !r.current)) {
|
|
284
|
+
const g = t.style.animationFillMode;
|
|
285
|
+
t.style.animationFillMode = "forwards", l = u.setTimeout(() => {
|
|
286
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}, v = (h) => {
|
|
290
|
+
h.target === t && (i.current = nt(o.current));
|
|
291
|
+
};
|
|
292
|
+
return t.addEventListener("animationstart", v), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
|
|
293
|
+
u.clearTimeout(l), t.removeEventListener("animationstart", v), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
|
|
294
|
+
};
|
|
295
|
+
} else
|
|
296
|
+
d("ANIMATION_END");
|
|
297
|
+
}, [t, d]), {
|
|
298
|
+
isPresent: ["mounted", "unmountSuspended"].includes(a),
|
|
299
|
+
ref: s.useCallback((l) => {
|
|
300
|
+
o.current = l ? getComputedStyle(l) : null, n(l);
|
|
301
|
+
}, [])
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function nt(e) {
|
|
305
|
+
return e?.animationName || "none";
|
|
306
|
+
}
|
|
307
|
+
function Ms(e) {
|
|
308
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
309
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
310
|
+
}
|
|
311
|
+
// @__NO_SIDE_EFFECTS__
|
|
312
|
+
function Be(e) {
|
|
313
|
+
const t = /* @__PURE__ */ As(e), n = s.forwardRef((o, r) => {
|
|
314
|
+
const { children: i, ...c } = o, a = s.Children.toArray(i), d = a.find(Ds);
|
|
315
|
+
if (d) {
|
|
316
|
+
const l = d.props.children, u = a.map((f) => f === d ? s.Children.count(l) > 1 ? s.Children.only(null) : s.isValidElement(l) ? l.props.children : null : f);
|
|
317
|
+
return /* @__PURE__ */ p(t, { ...c, ref: r, children: s.isValidElement(l) ? s.cloneElement(l, void 0, u) : null });
|
|
318
|
+
}
|
|
319
|
+
return /* @__PURE__ */ p(t, { ...c, ref: r, children: i });
|
|
320
|
+
});
|
|
321
|
+
return n.displayName = `${e}.Slot`, n;
|
|
322
|
+
}
|
|
323
|
+
// @__NO_SIDE_EFFECTS__
|
|
324
|
+
function As(e) {
|
|
325
|
+
const t = s.forwardRef((n, o) => {
|
|
326
|
+
const { children: r, ...i } = n;
|
|
327
|
+
if (s.isValidElement(r)) {
|
|
328
|
+
const c = Is(r), a = Ns(i, r.props);
|
|
329
|
+
return r.type !== s.Fragment && (a.ref = o ? bt(o, c) : c), s.cloneElement(r, a);
|
|
330
|
+
}
|
|
331
|
+
return s.Children.count(r) > 1 ? s.Children.only(null) : null;
|
|
332
|
+
});
|
|
333
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
334
|
+
}
|
|
335
|
+
var wo = Symbol("radix.slottable");
|
|
336
|
+
// @__NO_SIDE_EFFECTS__
|
|
337
|
+
function Os(e) {
|
|
338
|
+
const t = ({ children: n }) => /* @__PURE__ */ p(Ce, { children: n });
|
|
339
|
+
return t.displayName = `${e}.Slottable`, t.__radixId = wo, t;
|
|
340
|
+
}
|
|
341
|
+
function Ds(e) {
|
|
342
|
+
return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === wo;
|
|
343
|
+
}
|
|
344
|
+
function Ns(e, t) {
|
|
345
|
+
const n = { ...t };
|
|
346
|
+
for (const o in t) {
|
|
347
|
+
const r = e[o], i = t[o];
|
|
348
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...a) => {
|
|
349
|
+
const d = i(...a);
|
|
350
|
+
return r(...a), d;
|
|
351
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
352
|
+
}
|
|
353
|
+
return { ...e, ...n };
|
|
354
|
+
}
|
|
355
|
+
function Is(e) {
|
|
356
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
357
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
358
|
+
}
|
|
359
|
+
var ks = [
|
|
360
|
+
"a",
|
|
361
|
+
"button",
|
|
362
|
+
"div",
|
|
363
|
+
"form",
|
|
364
|
+
"h2",
|
|
365
|
+
"h3",
|
|
366
|
+
"img",
|
|
367
|
+
"input",
|
|
368
|
+
"label",
|
|
369
|
+
"li",
|
|
370
|
+
"nav",
|
|
371
|
+
"ol",
|
|
372
|
+
"p",
|
|
373
|
+
"select",
|
|
374
|
+
"span",
|
|
375
|
+
"svg",
|
|
376
|
+
"ul"
|
|
377
|
+
], I = ks.reduce((e, t) => {
|
|
378
|
+
const n = /* @__PURE__ */ Be(`Primitive.${t}`), o = s.forwardRef((r, i) => {
|
|
379
|
+
const { asChild: c, ...a } = r, d = c ? n : t;
|
|
380
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(d, { ...a, ref: i });
|
|
381
|
+
});
|
|
382
|
+
return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
|
|
383
|
+
}, {});
|
|
384
|
+
function ln(e, t) {
|
|
385
|
+
e && an.flushSync(() => e.dispatchEvent(t));
|
|
386
|
+
}
|
|
387
|
+
var xt = "Checkbox", [Ls] = de(xt), [Fs, un] = Ls(xt);
|
|
388
|
+
function $s(e) {
|
|
389
|
+
const {
|
|
390
|
+
__scopeCheckbox: t,
|
|
391
|
+
checked: n,
|
|
392
|
+
children: o,
|
|
393
|
+
defaultChecked: r,
|
|
394
|
+
disabled: i,
|
|
395
|
+
form: c,
|
|
396
|
+
name: a,
|
|
397
|
+
onCheckedChange: d,
|
|
398
|
+
required: l,
|
|
399
|
+
value: u = "on",
|
|
400
|
+
// @ts-expect-error
|
|
401
|
+
internal_do_not_use_render: f
|
|
402
|
+
} = e, [v, h] = Ne({
|
|
403
|
+
prop: n,
|
|
404
|
+
defaultProp: r ?? !1,
|
|
405
|
+
onChange: d,
|
|
406
|
+
caller: xt
|
|
407
|
+
}), [w, m] = s.useState(null), [g, y] = s.useState(null), C = s.useRef(!1), b = w ? !!c || !!w.closest("form") : (
|
|
408
|
+
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
409
|
+
!0
|
|
410
|
+
), x = {
|
|
411
|
+
checked: v,
|
|
412
|
+
disabled: i,
|
|
413
|
+
setChecked: h,
|
|
414
|
+
control: w,
|
|
415
|
+
setControl: m,
|
|
416
|
+
name: a,
|
|
417
|
+
form: c,
|
|
418
|
+
value: u,
|
|
419
|
+
hasConsumerStoppedPropagationRef: C,
|
|
420
|
+
required: l,
|
|
421
|
+
defaultChecked: me(r) ? !1 : r,
|
|
422
|
+
isFormControl: b,
|
|
423
|
+
bubbleInput: g,
|
|
424
|
+
setBubbleInput: y
|
|
425
|
+
};
|
|
426
|
+
return /* @__PURE__ */ p(
|
|
427
|
+
Fs,
|
|
428
|
+
{
|
|
429
|
+
scope: t,
|
|
430
|
+
...x,
|
|
431
|
+
children: Bs(f) ? f(x) : o
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
var yo = "CheckboxTrigger", Co = s.forwardRef(
|
|
436
|
+
({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...o }, r) => {
|
|
437
|
+
const {
|
|
438
|
+
control: i,
|
|
439
|
+
value: c,
|
|
440
|
+
disabled: a,
|
|
441
|
+
checked: d,
|
|
442
|
+
required: l,
|
|
443
|
+
setControl: u,
|
|
444
|
+
setChecked: f,
|
|
445
|
+
hasConsumerStoppedPropagationRef: v,
|
|
446
|
+
isFormControl: h,
|
|
447
|
+
bubbleInput: w
|
|
448
|
+
} = un(yo, e), m = W(r, u), g = s.useRef(d);
|
|
449
|
+
return s.useEffect(() => {
|
|
450
|
+
const y = i?.form;
|
|
451
|
+
if (y) {
|
|
452
|
+
const C = () => f(g.current);
|
|
453
|
+
return y.addEventListener("reset", C), () => y.removeEventListener("reset", C);
|
|
454
|
+
}
|
|
455
|
+
}, [i, f]), /* @__PURE__ */ p(
|
|
456
|
+
I.button,
|
|
457
|
+
{
|
|
458
|
+
type: "button",
|
|
459
|
+
role: "checkbox",
|
|
460
|
+
"aria-checked": me(d) ? "mixed" : d,
|
|
461
|
+
"aria-required": l,
|
|
462
|
+
"data-state": So(d),
|
|
463
|
+
"data-disabled": a ? "" : void 0,
|
|
464
|
+
disabled: a,
|
|
465
|
+
value: c,
|
|
466
|
+
...o,
|
|
467
|
+
ref: m,
|
|
468
|
+
onKeyDown: _(t, (y) => {
|
|
469
|
+
y.key === "Enter" && y.preventDefault();
|
|
470
|
+
}),
|
|
471
|
+
onClick: _(n, (y) => {
|
|
472
|
+
f((C) => me(C) ? !0 : !C), w && h && (v.current = y.isPropagationStopped(), v.current || y.stopPropagation());
|
|
473
|
+
})
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
Co.displayName = yo;
|
|
479
|
+
var bo = s.forwardRef(
|
|
480
|
+
(e, t) => {
|
|
481
|
+
const {
|
|
482
|
+
__scopeCheckbox: n,
|
|
483
|
+
name: o,
|
|
484
|
+
checked: r,
|
|
485
|
+
defaultChecked: i,
|
|
486
|
+
required: c,
|
|
487
|
+
disabled: a,
|
|
488
|
+
value: d,
|
|
489
|
+
onCheckedChange: l,
|
|
490
|
+
form: u,
|
|
491
|
+
...f
|
|
492
|
+
} = e;
|
|
493
|
+
return /* @__PURE__ */ p(
|
|
494
|
+
$s,
|
|
495
|
+
{
|
|
496
|
+
__scopeCheckbox: n,
|
|
497
|
+
checked: r,
|
|
498
|
+
defaultChecked: i,
|
|
499
|
+
disabled: a,
|
|
500
|
+
required: c,
|
|
501
|
+
onCheckedChange: l,
|
|
502
|
+
name: o,
|
|
503
|
+
form: u,
|
|
504
|
+
value: d,
|
|
505
|
+
internal_do_not_use_render: ({ isFormControl: v }) => /* @__PURE__ */ K(Ce, { children: [
|
|
506
|
+
/* @__PURE__ */ p(
|
|
507
|
+
Co,
|
|
508
|
+
{
|
|
509
|
+
...f,
|
|
510
|
+
ref: t,
|
|
511
|
+
__scopeCheckbox: n
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
v && /* @__PURE__ */ p(
|
|
515
|
+
To,
|
|
516
|
+
{
|
|
517
|
+
__scopeCheckbox: n
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
] })
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
bo.displayName = xt;
|
|
526
|
+
var xo = "CheckboxIndicator", Eo = s.forwardRef(
|
|
527
|
+
(e, t) => {
|
|
528
|
+
const { __scopeCheckbox: n, forceMount: o, ...r } = e, i = un(xo, n);
|
|
529
|
+
return /* @__PURE__ */ p(
|
|
530
|
+
Z,
|
|
531
|
+
{
|
|
532
|
+
present: o || me(i.checked) || i.checked === !0,
|
|
533
|
+
children: /* @__PURE__ */ p(
|
|
534
|
+
I.span,
|
|
535
|
+
{
|
|
536
|
+
"data-state": So(i.checked),
|
|
537
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
538
|
+
...r,
|
|
539
|
+
ref: t,
|
|
540
|
+
style: { pointerEvents: "none", ...e.style }
|
|
541
|
+
}
|
|
542
|
+
)
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
);
|
|
547
|
+
Eo.displayName = xo;
|
|
548
|
+
var Ro = "CheckboxBubbleInput", To = s.forwardRef(
|
|
549
|
+
({ __scopeCheckbox: e, ...t }, n) => {
|
|
550
|
+
const {
|
|
551
|
+
control: o,
|
|
552
|
+
hasConsumerStoppedPropagationRef: r,
|
|
553
|
+
checked: i,
|
|
554
|
+
defaultChecked: c,
|
|
555
|
+
required: a,
|
|
556
|
+
disabled: d,
|
|
557
|
+
name: l,
|
|
558
|
+
value: u,
|
|
559
|
+
form: f,
|
|
560
|
+
bubbleInput: v,
|
|
561
|
+
setBubbleInput: h
|
|
562
|
+
} = un(Ro, e), w = W(n, h), m = Ss(i), g = go(o);
|
|
563
|
+
s.useEffect(() => {
|
|
564
|
+
const C = v;
|
|
565
|
+
if (!C) return;
|
|
566
|
+
const b = window.HTMLInputElement.prototype, E = Object.getOwnPropertyDescriptor(
|
|
567
|
+
b,
|
|
568
|
+
"checked"
|
|
569
|
+
).set, T = !r.current;
|
|
570
|
+
if (m !== i && E) {
|
|
571
|
+
const R = new Event("click", { bubbles: T });
|
|
572
|
+
C.indeterminate = me(i), E.call(C, me(i) ? !1 : i), C.dispatchEvent(R);
|
|
573
|
+
}
|
|
574
|
+
}, [v, m, i, r]);
|
|
575
|
+
const y = s.useRef(me(i) ? !1 : i);
|
|
576
|
+
return /* @__PURE__ */ p(
|
|
577
|
+
I.input,
|
|
578
|
+
{
|
|
579
|
+
type: "checkbox",
|
|
580
|
+
"aria-hidden": !0,
|
|
581
|
+
defaultChecked: c ?? y.current,
|
|
582
|
+
required: a,
|
|
583
|
+
disabled: d,
|
|
584
|
+
name: l,
|
|
585
|
+
value: u,
|
|
586
|
+
form: f,
|
|
587
|
+
...t,
|
|
588
|
+
tabIndex: -1,
|
|
589
|
+
ref: w,
|
|
590
|
+
style: {
|
|
591
|
+
...t.style,
|
|
592
|
+
...g,
|
|
593
|
+
position: "absolute",
|
|
594
|
+
pointerEvents: "none",
|
|
595
|
+
opacity: 0,
|
|
596
|
+
margin: 0,
|
|
597
|
+
// We transform because the input is absolutely positioned but we have
|
|
598
|
+
// rendered it **after** the button. This pulls it back to sit on top
|
|
599
|
+
// of the button.
|
|
600
|
+
transform: "translateX(-100%)"
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
);
|
|
606
|
+
To.displayName = Ro;
|
|
607
|
+
function Bs(e) {
|
|
608
|
+
return typeof e == "function";
|
|
609
|
+
}
|
|
610
|
+
function me(e) {
|
|
611
|
+
return e === "indeterminate";
|
|
612
|
+
}
|
|
613
|
+
function So(e) {
|
|
614
|
+
return me(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
615
|
+
}
|
|
616
|
+
const Ws = "_checkboxRow_5ztin_1", Hs = "_checkboxRoot_5ztin_7", Vs = "_checkboxIndicator_5ztin_19", Ks = "_checkboxCheckmarkIcon_5ztin_29", Us = "_checkboxLabel_5ztin_35", Fe = {
|
|
617
|
+
checkboxRow: Ws,
|
|
618
|
+
checkboxRoot: Hs,
|
|
619
|
+
checkboxIndicator: Vs,
|
|
620
|
+
checkboxCheckmarkIcon: Ks,
|
|
621
|
+
checkboxLabel: Us
|
|
622
|
+
}, xf = ({ id: e, labelContent: t, checked: n, onClick: o }) => /* @__PURE__ */ K("div", { className: Fe.checkboxRow, children: [
|
|
623
|
+
/* @__PURE__ */ p(
|
|
624
|
+
bo,
|
|
625
|
+
{
|
|
626
|
+
checked: n,
|
|
627
|
+
onCheckedChange: (r) => {
|
|
628
|
+
o(r === !0);
|
|
629
|
+
},
|
|
630
|
+
className: Fe.checkboxRoot,
|
|
631
|
+
defaultChecked: !0,
|
|
632
|
+
id: e,
|
|
633
|
+
children: /* @__PURE__ */ p(Eo, { className: Fe.checkboxIndicator, children: /* @__PURE__ */ p(mo, { className: Fe.checkboxCheckmarkIcon }) })
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ p("label", { className: Fe.checkboxLabel, htmlFor: e, children: t })
|
|
637
|
+
] });
|
|
638
|
+
var Gs = s[" useId ".trim().toString()] || (() => {
|
|
639
|
+
}), zs = 0;
|
|
640
|
+
function ye(e) {
|
|
641
|
+
const [t, n] = s.useState(Gs());
|
|
642
|
+
return ae(() => {
|
|
643
|
+
n((o) => o ?? String(zs++));
|
|
644
|
+
}, [e]), e || (t ? `radix-${t}` : "");
|
|
645
|
+
}
|
|
646
|
+
function Y(e) {
|
|
647
|
+
const t = s.useRef(e);
|
|
648
|
+
return s.useEffect(() => {
|
|
649
|
+
t.current = e;
|
|
650
|
+
}), s.useMemo(() => (...n) => t.current?.(...n), []);
|
|
651
|
+
}
|
|
652
|
+
function js(e, t = globalThis?.document) {
|
|
653
|
+
const n = Y(e);
|
|
654
|
+
s.useEffect(() => {
|
|
655
|
+
const o = (r) => {
|
|
656
|
+
r.key === "Escape" && n(r);
|
|
657
|
+
};
|
|
658
|
+
return t.addEventListener("keydown", o, { capture: !0 }), () => t.removeEventListener("keydown", o, { capture: !0 });
|
|
659
|
+
}, [n, t]);
|
|
660
|
+
}
|
|
661
|
+
var Ys = "DismissableLayer", Yt = "dismissableLayer.update", Xs = "dismissableLayer.pointerDownOutside", qs = "dismissableLayer.focusOutside", Hn, Po = s.createContext({
|
|
662
|
+
layers: /* @__PURE__ */ new Set(),
|
|
663
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
664
|
+
branches: /* @__PURE__ */ new Set()
|
|
665
|
+
}), ze = s.forwardRef(
|
|
666
|
+
(e, t) => {
|
|
667
|
+
const {
|
|
668
|
+
disableOutsidePointerEvents: n = !1,
|
|
669
|
+
onEscapeKeyDown: o,
|
|
670
|
+
onPointerDownOutside: r,
|
|
671
|
+
onFocusOutside: i,
|
|
672
|
+
onInteractOutside: c,
|
|
673
|
+
onDismiss: a,
|
|
674
|
+
...d
|
|
675
|
+
} = e, l = s.useContext(Po), [u, f] = s.useState(null), v = u?.ownerDocument ?? globalThis?.document, [, h] = s.useState({}), w = W(t, (R) => f(R)), m = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), y = m.indexOf(g), C = u ? m.indexOf(u) : -1, b = l.layersWithOutsidePointerEventsDisabled.size > 0, x = C >= y, E = Qs((R) => {
|
|
676
|
+
const M = R.target, N = [...l.branches].some((D) => D.contains(M));
|
|
677
|
+
!x || N || (r?.(R), c?.(R), R.defaultPrevented || a?.());
|
|
678
|
+
}, v), T = Js((R) => {
|
|
679
|
+
const M = R.target;
|
|
680
|
+
[...l.branches].some((D) => D.contains(M)) || (i?.(R), c?.(R), R.defaultPrevented || a?.());
|
|
681
|
+
}, v);
|
|
682
|
+
return js((R) => {
|
|
683
|
+
C === l.layers.size - 1 && (o?.(R), !R.defaultPrevented && a && (R.preventDefault(), a()));
|
|
684
|
+
}, v), s.useEffect(() => {
|
|
685
|
+
if (u)
|
|
686
|
+
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Hn = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(u)), l.layers.add(u), Vn(), () => {
|
|
687
|
+
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = Hn);
|
|
688
|
+
};
|
|
689
|
+
}, [u, v, n, l]), s.useEffect(() => () => {
|
|
690
|
+
u && (l.layers.delete(u), l.layersWithOutsidePointerEventsDisabled.delete(u), Vn());
|
|
691
|
+
}, [u, l]), s.useEffect(() => {
|
|
692
|
+
const R = () => h({});
|
|
693
|
+
return document.addEventListener(Yt, R), () => document.removeEventListener(Yt, R);
|
|
694
|
+
}, []), /* @__PURE__ */ p(
|
|
695
|
+
I.div,
|
|
696
|
+
{
|
|
697
|
+
...d,
|
|
698
|
+
ref: w,
|
|
699
|
+
style: {
|
|
700
|
+
pointerEvents: b ? x ? "auto" : "none" : void 0,
|
|
701
|
+
...e.style
|
|
702
|
+
},
|
|
703
|
+
onFocusCapture: _(e.onFocusCapture, T.onFocusCapture),
|
|
704
|
+
onBlurCapture: _(e.onBlurCapture, T.onBlurCapture),
|
|
705
|
+
onPointerDownCapture: _(
|
|
706
|
+
e.onPointerDownCapture,
|
|
707
|
+
E.onPointerDownCapture
|
|
708
|
+
)
|
|
709
|
+
}
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
ze.displayName = Ys;
|
|
714
|
+
var Zs = "DismissableLayerBranch", _o = s.forwardRef((e, t) => {
|
|
715
|
+
const n = s.useContext(Po), o = s.useRef(null), r = W(t, o);
|
|
716
|
+
return s.useEffect(() => {
|
|
717
|
+
const i = o.current;
|
|
718
|
+
if (i)
|
|
719
|
+
return n.branches.add(i), () => {
|
|
720
|
+
n.branches.delete(i);
|
|
721
|
+
};
|
|
722
|
+
}, [n.branches]), /* @__PURE__ */ p(I.div, { ...e, ref: r });
|
|
723
|
+
});
|
|
724
|
+
_o.displayName = Zs;
|
|
725
|
+
function Qs(e, t = globalThis?.document) {
|
|
726
|
+
const n = Y(e), o = s.useRef(!1), r = s.useRef(() => {
|
|
727
|
+
});
|
|
728
|
+
return s.useEffect(() => {
|
|
729
|
+
const i = (a) => {
|
|
730
|
+
if (a.target && !o.current) {
|
|
731
|
+
let d = function() {
|
|
732
|
+
Mo(
|
|
733
|
+
Xs,
|
|
734
|
+
n,
|
|
735
|
+
l,
|
|
736
|
+
{ discrete: !0 }
|
|
737
|
+
);
|
|
738
|
+
};
|
|
739
|
+
const l = { originalEvent: a };
|
|
740
|
+
a.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = d, t.addEventListener("click", r.current, { once: !0 })) : d();
|
|
741
|
+
} else
|
|
742
|
+
t.removeEventListener("click", r.current);
|
|
743
|
+
o.current = !1;
|
|
744
|
+
}, c = window.setTimeout(() => {
|
|
745
|
+
t.addEventListener("pointerdown", i);
|
|
746
|
+
}, 0);
|
|
747
|
+
return () => {
|
|
748
|
+
window.clearTimeout(c), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
|
|
749
|
+
};
|
|
750
|
+
}, [t, n]), {
|
|
751
|
+
// ensures we check React component tree (not just DOM tree)
|
|
752
|
+
onPointerDownCapture: () => o.current = !0
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function Js(e, t = globalThis?.document) {
|
|
756
|
+
const n = Y(e), o = s.useRef(!1);
|
|
757
|
+
return s.useEffect(() => {
|
|
758
|
+
const r = (i) => {
|
|
759
|
+
i.target && !o.current && Mo(qs, n, { originalEvent: i }, {
|
|
760
|
+
discrete: !1
|
|
761
|
+
});
|
|
762
|
+
};
|
|
763
|
+
return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
|
|
764
|
+
}, [t, n]), {
|
|
765
|
+
onFocusCapture: () => o.current = !0,
|
|
766
|
+
onBlurCapture: () => o.current = !1
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function Vn() {
|
|
770
|
+
const e = new CustomEvent(Yt);
|
|
771
|
+
document.dispatchEvent(e);
|
|
772
|
+
}
|
|
773
|
+
function Mo(e, t, n, { discrete: o }) {
|
|
774
|
+
const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
775
|
+
t && r.addEventListener(e, t, { once: !0 }), o ? ln(r, i) : r.dispatchEvent(i);
|
|
776
|
+
}
|
|
777
|
+
var ec = ze, tc = _o, Ft = "focusScope.autoFocusOnMount", $t = "focusScope.autoFocusOnUnmount", Kn = { bubbles: !1, cancelable: !0 }, nc = "FocusScope", dn = s.forwardRef((e, t) => {
|
|
778
|
+
const {
|
|
779
|
+
loop: n = !1,
|
|
780
|
+
trapped: o = !1,
|
|
781
|
+
onMountAutoFocus: r,
|
|
782
|
+
onUnmountAutoFocus: i,
|
|
783
|
+
...c
|
|
784
|
+
} = e, [a, d] = s.useState(null), l = Y(r), u = Y(i), f = s.useRef(null), v = W(t, (m) => d(m)), h = s.useRef({
|
|
785
|
+
paused: !1,
|
|
786
|
+
pause() {
|
|
787
|
+
this.paused = !0;
|
|
788
|
+
},
|
|
789
|
+
resume() {
|
|
790
|
+
this.paused = !1;
|
|
791
|
+
}
|
|
792
|
+
}).current;
|
|
793
|
+
s.useEffect(() => {
|
|
794
|
+
if (o) {
|
|
795
|
+
let m = function(b) {
|
|
796
|
+
if (h.paused || !a) return;
|
|
797
|
+
const x = b.target;
|
|
798
|
+
a.contains(x) ? f.current = x : pe(f.current, { select: !0 });
|
|
799
|
+
}, g = function(b) {
|
|
800
|
+
if (h.paused || !a) return;
|
|
801
|
+
const x = b.relatedTarget;
|
|
802
|
+
x !== null && (a.contains(x) || pe(f.current, { select: !0 }));
|
|
803
|
+
}, y = function(b) {
|
|
804
|
+
if (document.activeElement === document.body)
|
|
805
|
+
for (const E of b)
|
|
806
|
+
E.removedNodes.length > 0 && pe(a);
|
|
807
|
+
};
|
|
808
|
+
document.addEventListener("focusin", m), document.addEventListener("focusout", g);
|
|
809
|
+
const C = new MutationObserver(y);
|
|
810
|
+
return a && C.observe(a, { childList: !0, subtree: !0 }), () => {
|
|
811
|
+
document.removeEventListener("focusin", m), document.removeEventListener("focusout", g), C.disconnect();
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
}, [o, a, h.paused]), s.useEffect(() => {
|
|
815
|
+
if (a) {
|
|
816
|
+
Gn.add(h);
|
|
817
|
+
const m = document.activeElement;
|
|
818
|
+
if (!a.contains(m)) {
|
|
819
|
+
const y = new CustomEvent(Ft, Kn);
|
|
820
|
+
a.addEventListener(Ft, l), a.dispatchEvent(y), y.defaultPrevented || (oc(ac(Ao(a)), { select: !0 }), document.activeElement === m && pe(a));
|
|
821
|
+
}
|
|
822
|
+
return () => {
|
|
823
|
+
a.removeEventListener(Ft, l), setTimeout(() => {
|
|
824
|
+
const y = new CustomEvent($t, Kn);
|
|
825
|
+
a.addEventListener($t, u), a.dispatchEvent(y), y.defaultPrevented || pe(m ?? document.body, { select: !0 }), a.removeEventListener($t, u), Gn.remove(h);
|
|
826
|
+
}, 0);
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
}, [a, l, u, h]);
|
|
830
|
+
const w = s.useCallback(
|
|
831
|
+
(m) => {
|
|
832
|
+
if (!n && !o || h.paused) return;
|
|
833
|
+
const g = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, y = document.activeElement;
|
|
834
|
+
if (g && y) {
|
|
835
|
+
const C = m.currentTarget, [b, x] = rc(C);
|
|
836
|
+
b && x ? !m.shiftKey && y === x ? (m.preventDefault(), n && pe(b, { select: !0 })) : m.shiftKey && y === b && (m.preventDefault(), n && pe(x, { select: !0 })) : y === C && m.preventDefault();
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
[n, o, h.paused]
|
|
840
|
+
);
|
|
841
|
+
return /* @__PURE__ */ p(I.div, { tabIndex: -1, ...c, ref: v, onKeyDown: w });
|
|
842
|
+
});
|
|
843
|
+
dn.displayName = nc;
|
|
844
|
+
function oc(e, { select: t = !1 } = {}) {
|
|
845
|
+
const n = document.activeElement;
|
|
846
|
+
for (const o of e)
|
|
847
|
+
if (pe(o, { select: t }), document.activeElement !== n) return;
|
|
848
|
+
}
|
|
849
|
+
function rc(e) {
|
|
850
|
+
const t = Ao(e), n = Un(t, e), o = Un(t.reverse(), e);
|
|
851
|
+
return [n, o];
|
|
852
|
+
}
|
|
853
|
+
function Ao(e) {
|
|
854
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
855
|
+
acceptNode: (o) => {
|
|
856
|
+
const r = o.tagName === "INPUT" && o.type === "hidden";
|
|
857
|
+
return o.disabled || o.hidden || r ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
861
|
+
return t;
|
|
862
|
+
}
|
|
863
|
+
function Un(e, t) {
|
|
864
|
+
for (const n of e)
|
|
865
|
+
if (!ic(n, { upTo: t })) return n;
|
|
866
|
+
}
|
|
867
|
+
function ic(e, { upTo: t }) {
|
|
868
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
869
|
+
for (; e; ) {
|
|
870
|
+
if (t !== void 0 && e === t) return !1;
|
|
871
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
872
|
+
e = e.parentElement;
|
|
873
|
+
}
|
|
874
|
+
return !1;
|
|
875
|
+
}
|
|
876
|
+
function sc(e) {
|
|
877
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
878
|
+
}
|
|
879
|
+
function pe(e, { select: t = !1 } = {}) {
|
|
880
|
+
if (e && e.focus) {
|
|
881
|
+
const n = document.activeElement;
|
|
882
|
+
e.focus({ preventScroll: !0 }), e !== n && sc(e) && t && e.select();
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
var Gn = cc();
|
|
886
|
+
function cc() {
|
|
887
|
+
let e = [];
|
|
888
|
+
return {
|
|
889
|
+
add(t) {
|
|
890
|
+
const n = e[0];
|
|
891
|
+
t !== n && n?.pause(), e = zn(e, t), e.unshift(t);
|
|
892
|
+
},
|
|
893
|
+
remove(t) {
|
|
894
|
+
e = zn(e, t), e[0]?.resume();
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function zn(e, t) {
|
|
899
|
+
const n = [...e], o = n.indexOf(t);
|
|
900
|
+
return o !== -1 && n.splice(o, 1), n;
|
|
901
|
+
}
|
|
902
|
+
function ac(e) {
|
|
903
|
+
return e.filter((t) => t.tagName !== "A");
|
|
904
|
+
}
|
|
905
|
+
var lc = "Portal", je = s.forwardRef((e, t) => {
|
|
906
|
+
const { container: n, ...o } = e, [r, i] = s.useState(!1);
|
|
907
|
+
ae(() => i(!0), []);
|
|
908
|
+
const c = n || r && globalThis?.document?.body;
|
|
909
|
+
return c ? Wi.createPortal(/* @__PURE__ */ p(I.div, { ...o, ref: t }), c) : null;
|
|
910
|
+
});
|
|
911
|
+
je.displayName = lc;
|
|
912
|
+
var Bt = 0;
|
|
913
|
+
function Oo() {
|
|
914
|
+
s.useEffect(() => {
|
|
915
|
+
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
916
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? jn()), document.body.insertAdjacentElement("beforeend", e[1] ?? jn()), Bt++, () => {
|
|
917
|
+
Bt === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Bt--;
|
|
918
|
+
};
|
|
919
|
+
}, []);
|
|
920
|
+
}
|
|
921
|
+
function jn() {
|
|
922
|
+
const e = document.createElement("span");
|
|
923
|
+
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;
|
|
924
|
+
}
|
|
925
|
+
var oe = function() {
|
|
926
|
+
return oe = Object.assign || function(t) {
|
|
927
|
+
for (var n, o = 1, r = arguments.length; o < r; o++) {
|
|
928
|
+
n = arguments[o];
|
|
929
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
930
|
+
}
|
|
931
|
+
return t;
|
|
932
|
+
}, oe.apply(this, arguments);
|
|
933
|
+
};
|
|
934
|
+
function Do(e, t) {
|
|
935
|
+
var n = {};
|
|
936
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
|
|
937
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
938
|
+
for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
|
|
939
|
+
t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
|
|
940
|
+
return n;
|
|
941
|
+
}
|
|
942
|
+
function uc(e, t, n) {
|
|
943
|
+
if (n || arguments.length === 2) for (var o = 0, r = t.length, i; o < r; o++)
|
|
944
|
+
(i || !(o in t)) && (i || (i = Array.prototype.slice.call(t, 0, o)), i[o] = t[o]);
|
|
945
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
946
|
+
}
|
|
947
|
+
var ut = "right-scroll-bar-position", dt = "width-before-scroll-bar", dc = "with-scroll-bars-hidden", fc = "--removed-body-scroll-bar-size";
|
|
948
|
+
function Wt(e, t) {
|
|
949
|
+
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
950
|
+
}
|
|
951
|
+
function pc(e, t) {
|
|
952
|
+
var n = $i(function() {
|
|
953
|
+
return {
|
|
954
|
+
// value
|
|
955
|
+
value: e,
|
|
956
|
+
// last callback
|
|
957
|
+
callback: t,
|
|
958
|
+
// "memoized" public interface
|
|
959
|
+
facade: {
|
|
960
|
+
get current() {
|
|
961
|
+
return n.value;
|
|
962
|
+
},
|
|
963
|
+
set current(o) {
|
|
964
|
+
var r = n.value;
|
|
965
|
+
r !== o && (n.value = o, n.callback(o, r));
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
})[0];
|
|
970
|
+
return n.callback = t, n.facade;
|
|
971
|
+
}
|
|
972
|
+
var mc = typeof window < "u" ? s.useLayoutEffect : s.useEffect, Yn = /* @__PURE__ */ new WeakMap();
|
|
973
|
+
function vc(e, t) {
|
|
974
|
+
var n = pc(null, function(o) {
|
|
975
|
+
return e.forEach(function(r) {
|
|
976
|
+
return Wt(r, o);
|
|
977
|
+
});
|
|
978
|
+
});
|
|
979
|
+
return mc(function() {
|
|
980
|
+
var o = Yn.get(n);
|
|
981
|
+
if (o) {
|
|
982
|
+
var r = new Set(o), i = new Set(e), c = n.current;
|
|
983
|
+
r.forEach(function(a) {
|
|
984
|
+
i.has(a) || Wt(a, null);
|
|
985
|
+
}), i.forEach(function(a) {
|
|
986
|
+
r.has(a) || Wt(a, c);
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
Yn.set(n, e);
|
|
990
|
+
}, [e]), n;
|
|
991
|
+
}
|
|
992
|
+
function hc(e) {
|
|
993
|
+
return e;
|
|
994
|
+
}
|
|
995
|
+
function gc(e, t) {
|
|
996
|
+
t === void 0 && (t = hc);
|
|
997
|
+
var n = [], o = !1, r = {
|
|
998
|
+
read: function() {
|
|
999
|
+
if (o)
|
|
1000
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
1001
|
+
return n.length ? n[n.length - 1] : e;
|
|
1002
|
+
},
|
|
1003
|
+
useMedium: function(i) {
|
|
1004
|
+
var c = t(i, o);
|
|
1005
|
+
return n.push(c), function() {
|
|
1006
|
+
n = n.filter(function(a) {
|
|
1007
|
+
return a !== c;
|
|
1008
|
+
});
|
|
1009
|
+
};
|
|
1010
|
+
},
|
|
1011
|
+
assignSyncMedium: function(i) {
|
|
1012
|
+
for (o = !0; n.length; ) {
|
|
1013
|
+
var c = n;
|
|
1014
|
+
n = [], c.forEach(i);
|
|
1015
|
+
}
|
|
1016
|
+
n = {
|
|
1017
|
+
push: function(a) {
|
|
1018
|
+
return i(a);
|
|
1019
|
+
},
|
|
1020
|
+
filter: function() {
|
|
1021
|
+
return n;
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
},
|
|
1025
|
+
assignMedium: function(i) {
|
|
1026
|
+
o = !0;
|
|
1027
|
+
var c = [];
|
|
1028
|
+
if (n.length) {
|
|
1029
|
+
var a = n;
|
|
1030
|
+
n = [], a.forEach(i), c = n;
|
|
1031
|
+
}
|
|
1032
|
+
var d = function() {
|
|
1033
|
+
var u = c;
|
|
1034
|
+
c = [], u.forEach(i);
|
|
1035
|
+
}, l = function() {
|
|
1036
|
+
return Promise.resolve().then(d);
|
|
1037
|
+
};
|
|
1038
|
+
l(), n = {
|
|
1039
|
+
push: function(u) {
|
|
1040
|
+
c.push(u), l();
|
|
1041
|
+
},
|
|
1042
|
+
filter: function(u) {
|
|
1043
|
+
return c = c.filter(u), n;
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
return r;
|
|
1049
|
+
}
|
|
1050
|
+
function wc(e) {
|
|
1051
|
+
e === void 0 && (e = {});
|
|
1052
|
+
var t = gc(null);
|
|
1053
|
+
return t.options = oe({ async: !0, ssr: !1 }, e), t;
|
|
1054
|
+
}
|
|
1055
|
+
var No = function(e) {
|
|
1056
|
+
var t = e.sideCar, n = Do(e, ["sideCar"]);
|
|
1057
|
+
if (!t)
|
|
1058
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
1059
|
+
var o = t.read();
|
|
1060
|
+
if (!o)
|
|
1061
|
+
throw new Error("Sidecar medium not found");
|
|
1062
|
+
return s.createElement(o, oe({}, n));
|
|
1063
|
+
};
|
|
1064
|
+
No.isSideCarExport = !0;
|
|
1065
|
+
function yc(e, t) {
|
|
1066
|
+
return e.useMedium(t), No;
|
|
1067
|
+
}
|
|
1068
|
+
var Io = wc(), Ht = function() {
|
|
1069
|
+
}, Et = s.forwardRef(function(e, t) {
|
|
1070
|
+
var n = s.useRef(null), o = s.useState({
|
|
1071
|
+
onScrollCapture: Ht,
|
|
1072
|
+
onWheelCapture: Ht,
|
|
1073
|
+
onTouchMoveCapture: Ht
|
|
1074
|
+
}), r = o[0], i = o[1], c = e.forwardProps, a = e.children, d = e.className, l = e.removeScrollBar, u = e.enabled, f = e.shards, v = e.sideCar, h = e.noRelative, w = e.noIsolation, m = e.inert, g = e.allowPinchZoom, y = e.as, C = y === void 0 ? "div" : y, b = e.gapMode, x = Do(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = v, T = vc([n, t]), R = oe(oe({}, x), r);
|
|
1075
|
+
return s.createElement(
|
|
1076
|
+
s.Fragment,
|
|
1077
|
+
null,
|
|
1078
|
+
u && s.createElement(E, { sideCar: Io, removeScrollBar: l, shards: f, noRelative: h, noIsolation: w, inert: m, setCallbacks: i, allowPinchZoom: !!g, lockRef: n, gapMode: b }),
|
|
1079
|
+
c ? s.cloneElement(s.Children.only(a), oe(oe({}, R), { ref: T })) : s.createElement(C, oe({}, R, { className: d, ref: T }), a)
|
|
1080
|
+
);
|
|
1081
|
+
});
|
|
1082
|
+
Et.defaultProps = {
|
|
1083
|
+
enabled: !0,
|
|
1084
|
+
removeScrollBar: !0,
|
|
1085
|
+
inert: !1
|
|
1086
|
+
};
|
|
1087
|
+
Et.classNames = {
|
|
1088
|
+
fullWidth: dt,
|
|
1089
|
+
zeroRight: ut
|
|
1090
|
+
};
|
|
1091
|
+
var Cc = function() {
|
|
1092
|
+
if (typeof __webpack_nonce__ < "u")
|
|
1093
|
+
return __webpack_nonce__;
|
|
1094
|
+
};
|
|
1095
|
+
function bc() {
|
|
1096
|
+
if (!document)
|
|
1097
|
+
return null;
|
|
1098
|
+
var e = document.createElement("style");
|
|
1099
|
+
e.type = "text/css";
|
|
1100
|
+
var t = Cc();
|
|
1101
|
+
return t && e.setAttribute("nonce", t), e;
|
|
1102
|
+
}
|
|
1103
|
+
function xc(e, t) {
|
|
1104
|
+
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
1105
|
+
}
|
|
1106
|
+
function Ec(e) {
|
|
1107
|
+
var t = document.head || document.getElementsByTagName("head")[0];
|
|
1108
|
+
t.appendChild(e);
|
|
1109
|
+
}
|
|
1110
|
+
var Rc = function() {
|
|
1111
|
+
var e = 0, t = null;
|
|
1112
|
+
return {
|
|
1113
|
+
add: function(n) {
|
|
1114
|
+
e == 0 && (t = bc()) && (xc(t, n), Ec(t)), e++;
|
|
1115
|
+
},
|
|
1116
|
+
remove: function() {
|
|
1117
|
+
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
}, Tc = function() {
|
|
1121
|
+
var e = Rc();
|
|
1122
|
+
return function(t, n) {
|
|
1123
|
+
s.useEffect(function() {
|
|
1124
|
+
return e.add(t), function() {
|
|
1125
|
+
e.remove();
|
|
1126
|
+
};
|
|
1127
|
+
}, [t && n]);
|
|
1128
|
+
};
|
|
1129
|
+
}, ko = function() {
|
|
1130
|
+
var e = Tc(), t = function(n) {
|
|
1131
|
+
var o = n.styles, r = n.dynamic;
|
|
1132
|
+
return e(o, r), null;
|
|
1133
|
+
};
|
|
1134
|
+
return t;
|
|
1135
|
+
}, Sc = {
|
|
1136
|
+
left: 0,
|
|
1137
|
+
top: 0,
|
|
1138
|
+
right: 0,
|
|
1139
|
+
gap: 0
|
|
1140
|
+
}, Vt = function(e) {
|
|
1141
|
+
return parseInt(e || "", 10) || 0;
|
|
1142
|
+
}, Pc = function(e) {
|
|
1143
|
+
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], o = t[e === "padding" ? "paddingTop" : "marginTop"], r = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
1144
|
+
return [Vt(n), Vt(o), Vt(r)];
|
|
1145
|
+
}, _c = function(e) {
|
|
1146
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
1147
|
+
return Sc;
|
|
1148
|
+
var t = Pc(e), n = document.documentElement.clientWidth, o = window.innerWidth;
|
|
1149
|
+
return {
|
|
1150
|
+
left: t[0],
|
|
1151
|
+
top: t[1],
|
|
1152
|
+
right: t[2],
|
|
1153
|
+
gap: Math.max(0, o - n + t[2] - t[0])
|
|
1154
|
+
};
|
|
1155
|
+
}, Mc = ko(), Me = "data-scroll-locked", Ac = function(e, t, n, o) {
|
|
1156
|
+
var r = e.left, i = e.top, c = e.right, a = e.gap;
|
|
1157
|
+
return n === void 0 && (n = "margin"), `
|
|
1158
|
+
.`.concat(dc, ` {
|
|
1159
|
+
overflow: hidden `).concat(o, `;
|
|
1160
|
+
padding-right: `).concat(a, "px ").concat(o, `;
|
|
1161
|
+
}
|
|
1162
|
+
body[`).concat(Me, `] {
|
|
1163
|
+
overflow: hidden `).concat(o, `;
|
|
1164
|
+
overscroll-behavior: contain;
|
|
1165
|
+
`).concat([
|
|
1166
|
+
t && "position: relative ".concat(o, ";"),
|
|
1167
|
+
n === "margin" && `
|
|
1168
|
+
padding-left: `.concat(r, `px;
|
|
1169
|
+
padding-top: `).concat(i, `px;
|
|
1170
|
+
padding-right: `).concat(c, `px;
|
|
1171
|
+
margin-left:0;
|
|
1172
|
+
margin-top:0;
|
|
1173
|
+
margin-right: `).concat(a, "px ").concat(o, `;
|
|
1174
|
+
`),
|
|
1175
|
+
n === "padding" && "padding-right: ".concat(a, "px ").concat(o, ";")
|
|
1176
|
+
].filter(Boolean).join(""), `
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
.`).concat(ut, ` {
|
|
1180
|
+
right: `).concat(a, "px ").concat(o, `;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
.`).concat(dt, ` {
|
|
1184
|
+
margin-right: `).concat(a, "px ").concat(o, `;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
.`).concat(ut, " .").concat(ut, ` {
|
|
1188
|
+
right: 0 `).concat(o, `;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
.`).concat(dt, " .").concat(dt, ` {
|
|
1192
|
+
margin-right: 0 `).concat(o, `;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
body[`).concat(Me, `] {
|
|
1196
|
+
`).concat(fc, ": ").concat(a, `px;
|
|
1197
|
+
}
|
|
1198
|
+
`);
|
|
1199
|
+
}, Xn = function() {
|
|
1200
|
+
var e = parseInt(document.body.getAttribute(Me) || "0", 10);
|
|
1201
|
+
return isFinite(e) ? e : 0;
|
|
1202
|
+
}, Oc = function() {
|
|
1203
|
+
s.useEffect(function() {
|
|
1204
|
+
return document.body.setAttribute(Me, (Xn() + 1).toString()), function() {
|
|
1205
|
+
var e = Xn() - 1;
|
|
1206
|
+
e <= 0 ? document.body.removeAttribute(Me) : document.body.setAttribute(Me, e.toString());
|
|
1207
|
+
};
|
|
1208
|
+
}, []);
|
|
1209
|
+
}, Dc = function(e) {
|
|
1210
|
+
var t = e.noRelative, n = e.noImportant, o = e.gapMode, r = o === void 0 ? "margin" : o;
|
|
1211
|
+
Oc();
|
|
1212
|
+
var i = s.useMemo(function() {
|
|
1213
|
+
return _c(r);
|
|
1214
|
+
}, [r]);
|
|
1215
|
+
return s.createElement(Mc, { styles: Ac(i, !t, r, n ? "" : "!important") });
|
|
1216
|
+
}, Xt = !1;
|
|
1217
|
+
if (typeof window < "u")
|
|
1218
|
+
try {
|
|
1219
|
+
var ot = Object.defineProperty({}, "passive", {
|
|
1220
|
+
get: function() {
|
|
1221
|
+
return Xt = !0, !0;
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
window.addEventListener("test", ot, ot), window.removeEventListener("test", ot, ot);
|
|
1225
|
+
} catch {
|
|
1226
|
+
Xt = !1;
|
|
1227
|
+
}
|
|
1228
|
+
var Te = Xt ? { passive: !1 } : !1, Nc = function(e) {
|
|
1229
|
+
return e.tagName === "TEXTAREA";
|
|
1230
|
+
}, Lo = function(e, t) {
|
|
1231
|
+
if (!(e instanceof Element))
|
|
1232
|
+
return !1;
|
|
1233
|
+
var n = window.getComputedStyle(e);
|
|
1234
|
+
return (
|
|
1235
|
+
// not-not-scrollable
|
|
1236
|
+
n[t] !== "hidden" && // contains scroll inside self
|
|
1237
|
+
!(n.overflowY === n.overflowX && !Nc(e) && n[t] === "visible")
|
|
1238
|
+
);
|
|
1239
|
+
}, Ic = function(e) {
|
|
1240
|
+
return Lo(e, "overflowY");
|
|
1241
|
+
}, kc = function(e) {
|
|
1242
|
+
return Lo(e, "overflowX");
|
|
1243
|
+
}, qn = function(e, t) {
|
|
1244
|
+
var n = t.ownerDocument, o = t;
|
|
1245
|
+
do {
|
|
1246
|
+
typeof ShadowRoot < "u" && o instanceof ShadowRoot && (o = o.host);
|
|
1247
|
+
var r = Fo(e, o);
|
|
1248
|
+
if (r) {
|
|
1249
|
+
var i = $o(e, o), c = i[1], a = i[2];
|
|
1250
|
+
if (c > a)
|
|
1251
|
+
return !0;
|
|
1252
|
+
}
|
|
1253
|
+
o = o.parentNode;
|
|
1254
|
+
} while (o && o !== n.body);
|
|
1255
|
+
return !1;
|
|
1256
|
+
}, Lc = function(e) {
|
|
1257
|
+
var t = e.scrollTop, n = e.scrollHeight, o = e.clientHeight;
|
|
1258
|
+
return [
|
|
1259
|
+
t,
|
|
1260
|
+
n,
|
|
1261
|
+
o
|
|
1262
|
+
];
|
|
1263
|
+
}, Fc = function(e) {
|
|
1264
|
+
var t = e.scrollLeft, n = e.scrollWidth, o = e.clientWidth;
|
|
1265
|
+
return [
|
|
1266
|
+
t,
|
|
1267
|
+
n,
|
|
1268
|
+
o
|
|
1269
|
+
];
|
|
1270
|
+
}, Fo = function(e, t) {
|
|
1271
|
+
return e === "v" ? Ic(t) : kc(t);
|
|
1272
|
+
}, $o = function(e, t) {
|
|
1273
|
+
return e === "v" ? Lc(t) : Fc(t);
|
|
1274
|
+
}, $c = function(e, t) {
|
|
1275
|
+
return e === "h" && t === "rtl" ? -1 : 1;
|
|
1276
|
+
}, Bc = function(e, t, n, o, r) {
|
|
1277
|
+
var i = $c(e, window.getComputedStyle(t).direction), c = i * o, a = n.target, d = t.contains(a), l = !1, u = c > 0, f = 0, v = 0;
|
|
1278
|
+
do {
|
|
1279
|
+
if (!a)
|
|
1280
|
+
break;
|
|
1281
|
+
var h = $o(e, a), w = h[0], m = h[1], g = h[2], y = m - g - i * w;
|
|
1282
|
+
(w || y) && Fo(e, a) && (f += y, v += w);
|
|
1283
|
+
var C = a.parentNode;
|
|
1284
|
+
a = C && C.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? C.host : C;
|
|
1285
|
+
} while (
|
|
1286
|
+
// portaled content
|
|
1287
|
+
!d && a !== document.body || // self content
|
|
1288
|
+
d && (t.contains(a) || t === a)
|
|
1289
|
+
);
|
|
1290
|
+
return (u && Math.abs(f) < 1 || !u && Math.abs(v) < 1) && (l = !0), l;
|
|
1291
|
+
}, rt = function(e) {
|
|
1292
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
1293
|
+
}, Zn = function(e) {
|
|
1294
|
+
return [e.deltaX, e.deltaY];
|
|
1295
|
+
}, Qn = function(e) {
|
|
1296
|
+
return e && "current" in e ? e.current : e;
|
|
1297
|
+
}, Wc = function(e, t) {
|
|
1298
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
1299
|
+
}, Hc = function(e) {
|
|
1300
|
+
return `
|
|
1301
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
1302
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
1303
|
+
`);
|
|
1304
|
+
}, Vc = 0, Se = [];
|
|
1305
|
+
function Kc(e) {
|
|
1306
|
+
var t = s.useRef([]), n = s.useRef([0, 0]), o = s.useRef(), r = s.useState(Vc++)[0], i = s.useState(ko)[0], c = s.useRef(e);
|
|
1307
|
+
s.useEffect(function() {
|
|
1308
|
+
c.current = e;
|
|
1309
|
+
}, [e]), s.useEffect(function() {
|
|
1310
|
+
if (e.inert) {
|
|
1311
|
+
document.body.classList.add("block-interactivity-".concat(r));
|
|
1312
|
+
var m = uc([e.lockRef.current], (e.shards || []).map(Qn), !0).filter(Boolean);
|
|
1313
|
+
return m.forEach(function(g) {
|
|
1314
|
+
return g.classList.add("allow-interactivity-".concat(r));
|
|
1315
|
+
}), function() {
|
|
1316
|
+
document.body.classList.remove("block-interactivity-".concat(r)), m.forEach(function(g) {
|
|
1317
|
+
return g.classList.remove("allow-interactivity-".concat(r));
|
|
1318
|
+
});
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
1322
|
+
var a = s.useCallback(function(m, g) {
|
|
1323
|
+
if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
|
|
1324
|
+
return !c.current.allowPinchZoom;
|
|
1325
|
+
var y = rt(m), C = n.current, b = "deltaX" in m ? m.deltaX : C[0] - y[0], x = "deltaY" in m ? m.deltaY : C[1] - y[1], E, T = m.target, R = Math.abs(b) > Math.abs(x) ? "h" : "v";
|
|
1326
|
+
if ("touches" in m && R === "h" && T.type === "range")
|
|
1327
|
+
return !1;
|
|
1328
|
+
var M = qn(R, T);
|
|
1329
|
+
if (!M)
|
|
1330
|
+
return !0;
|
|
1331
|
+
if (M ? E = R : (E = R === "v" ? "h" : "v", M = qn(R, T)), !M)
|
|
1332
|
+
return !1;
|
|
1333
|
+
if (!o.current && "changedTouches" in m && (b || x) && (o.current = E), !E)
|
|
1334
|
+
return !0;
|
|
1335
|
+
var N = o.current || E;
|
|
1336
|
+
return Bc(N, g, m, N === "h" ? b : x);
|
|
1337
|
+
}, []), d = s.useCallback(function(m) {
|
|
1338
|
+
var g = m;
|
|
1339
|
+
if (!(!Se.length || Se[Se.length - 1] !== i)) {
|
|
1340
|
+
var y = "deltaY" in g ? Zn(g) : rt(g), C = t.current.filter(function(E) {
|
|
1341
|
+
return E.name === g.type && (E.target === g.target || g.target === E.shadowParent) && Wc(E.delta, y);
|
|
1342
|
+
})[0];
|
|
1343
|
+
if (C && C.should) {
|
|
1344
|
+
g.cancelable && g.preventDefault();
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
if (!C) {
|
|
1348
|
+
var b = (c.current.shards || []).map(Qn).filter(Boolean).filter(function(E) {
|
|
1349
|
+
return E.contains(g.target);
|
|
1350
|
+
}), x = b.length > 0 ? a(g, b[0]) : !c.current.noIsolation;
|
|
1351
|
+
x && g.cancelable && g.preventDefault();
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
}, []), l = s.useCallback(function(m, g, y, C) {
|
|
1355
|
+
var b = { name: m, delta: g, target: y, should: C, shadowParent: Uc(y) };
|
|
1356
|
+
t.current.push(b), setTimeout(function() {
|
|
1357
|
+
t.current = t.current.filter(function(x) {
|
|
1358
|
+
return x !== b;
|
|
1359
|
+
});
|
|
1360
|
+
}, 1);
|
|
1361
|
+
}, []), u = s.useCallback(function(m) {
|
|
1362
|
+
n.current = rt(m), o.current = void 0;
|
|
1363
|
+
}, []), f = s.useCallback(function(m) {
|
|
1364
|
+
l(m.type, Zn(m), m.target, a(m, e.lockRef.current));
|
|
1365
|
+
}, []), v = s.useCallback(function(m) {
|
|
1366
|
+
l(m.type, rt(m), m.target, a(m, e.lockRef.current));
|
|
1367
|
+
}, []);
|
|
1368
|
+
s.useEffect(function() {
|
|
1369
|
+
return Se.push(i), e.setCallbacks({
|
|
1370
|
+
onScrollCapture: f,
|
|
1371
|
+
onWheelCapture: f,
|
|
1372
|
+
onTouchMoveCapture: v
|
|
1373
|
+
}), document.addEventListener("wheel", d, Te), document.addEventListener("touchmove", d, Te), document.addEventListener("touchstart", u, Te), function() {
|
|
1374
|
+
Se = Se.filter(function(m) {
|
|
1375
|
+
return m !== i;
|
|
1376
|
+
}), document.removeEventListener("wheel", d, Te), document.removeEventListener("touchmove", d, Te), document.removeEventListener("touchstart", u, Te);
|
|
1377
|
+
};
|
|
1378
|
+
}, []);
|
|
1379
|
+
var h = e.removeScrollBar, w = e.inert;
|
|
1380
|
+
return s.createElement(
|
|
1381
|
+
s.Fragment,
|
|
1382
|
+
null,
|
|
1383
|
+
w ? s.createElement(i, { styles: Hc(r) }) : null,
|
|
1384
|
+
h ? s.createElement(Dc, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
1385
|
+
);
|
|
1386
|
+
}
|
|
1387
|
+
function Uc(e) {
|
|
1388
|
+
for (var t = null; e !== null; )
|
|
1389
|
+
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
1390
|
+
return t;
|
|
1391
|
+
}
|
|
1392
|
+
const Gc = yc(Io, Kc);
|
|
1393
|
+
var fn = s.forwardRef(function(e, t) {
|
|
1394
|
+
return s.createElement(Et, oe({}, e, { ref: t, sideCar: Gc }));
|
|
1395
|
+
});
|
|
1396
|
+
fn.classNames = Et.classNames;
|
|
1397
|
+
var zc = function(e) {
|
|
1398
|
+
if (typeof document > "u")
|
|
1399
|
+
return null;
|
|
1400
|
+
var t = Array.isArray(e) ? e[0] : e;
|
|
1401
|
+
return t.ownerDocument.body;
|
|
1402
|
+
}, Pe = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), st = {}, Kt = 0, Bo = function(e) {
|
|
1403
|
+
return e && (e.host || Bo(e.parentNode));
|
|
1404
|
+
}, jc = function(e, t) {
|
|
1405
|
+
return t.map(function(n) {
|
|
1406
|
+
if (e.contains(n))
|
|
1407
|
+
return n;
|
|
1408
|
+
var o = Bo(n);
|
|
1409
|
+
return o && e.contains(o) ? o : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
1410
|
+
}).filter(function(n) {
|
|
1411
|
+
return !!n;
|
|
1412
|
+
});
|
|
1413
|
+
}, Yc = function(e, t, n, o) {
|
|
1414
|
+
var r = jc(t, Array.isArray(e) ? e : [e]);
|
|
1415
|
+
st[n] || (st[n] = /* @__PURE__ */ new WeakMap());
|
|
1416
|
+
var i = st[n], c = [], a = /* @__PURE__ */ new Set(), d = new Set(r), l = function(f) {
|
|
1417
|
+
!f || a.has(f) || (a.add(f), l(f.parentNode));
|
|
1418
|
+
};
|
|
1419
|
+
r.forEach(l);
|
|
1420
|
+
var u = function(f) {
|
|
1421
|
+
!f || d.has(f) || Array.prototype.forEach.call(f.children, function(v) {
|
|
1422
|
+
if (a.has(v))
|
|
1423
|
+
u(v);
|
|
1424
|
+
else
|
|
1425
|
+
try {
|
|
1426
|
+
var h = v.getAttribute(o), w = h !== null && h !== "false", m = (Pe.get(v) || 0) + 1, g = (i.get(v) || 0) + 1;
|
|
1427
|
+
Pe.set(v, m), i.set(v, g), c.push(v), m === 1 && w && it.set(v, !0), g === 1 && v.setAttribute(n, "true"), w || v.setAttribute(o, "true");
|
|
1428
|
+
} catch (y) {
|
|
1429
|
+
console.error("aria-hidden: cannot operate on ", v, y);
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
};
|
|
1433
|
+
return u(t), a.clear(), Kt++, function() {
|
|
1434
|
+
c.forEach(function(f) {
|
|
1435
|
+
var v = Pe.get(f) - 1, h = i.get(f) - 1;
|
|
1436
|
+
Pe.set(f, v), i.set(f, h), v || (it.has(f) || f.removeAttribute(o), it.delete(f)), h || f.removeAttribute(n);
|
|
1437
|
+
}), Kt--, Kt || (Pe = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), st = {});
|
|
1438
|
+
};
|
|
1439
|
+
}, Wo = function(e, t, n) {
|
|
1440
|
+
n === void 0 && (n = "data-aria-hidden");
|
|
1441
|
+
var o = Array.from(Array.isArray(e) ? e : [e]), r = zc(e);
|
|
1442
|
+
return r ? (o.push.apply(o, Array.from(r.querySelectorAll("[aria-live], script"))), Yc(o, r, n, "aria-hidden")) : function() {
|
|
1443
|
+
return null;
|
|
1444
|
+
};
|
|
1445
|
+
}, Rt = "Dialog", [Ho] = de(Rt), [Xc, te] = Ho(Rt), Vo = (e) => {
|
|
1446
|
+
const {
|
|
1447
|
+
__scopeDialog: t,
|
|
1448
|
+
children: n,
|
|
1449
|
+
open: o,
|
|
1450
|
+
defaultOpen: r,
|
|
1451
|
+
onOpenChange: i,
|
|
1452
|
+
modal: c = !0
|
|
1453
|
+
} = e, a = s.useRef(null), d = s.useRef(null), [l, u] = Ne({
|
|
1454
|
+
prop: o,
|
|
1455
|
+
defaultProp: r ?? !1,
|
|
1456
|
+
onChange: i,
|
|
1457
|
+
caller: Rt
|
|
1458
|
+
});
|
|
1459
|
+
return /* @__PURE__ */ p(
|
|
1460
|
+
Xc,
|
|
1461
|
+
{
|
|
1462
|
+
scope: t,
|
|
1463
|
+
triggerRef: a,
|
|
1464
|
+
contentRef: d,
|
|
1465
|
+
contentId: ye(),
|
|
1466
|
+
titleId: ye(),
|
|
1467
|
+
descriptionId: ye(),
|
|
1468
|
+
open: l,
|
|
1469
|
+
onOpenChange: u,
|
|
1470
|
+
onOpenToggle: s.useCallback(() => u((f) => !f), [u]),
|
|
1471
|
+
modal: c,
|
|
1472
|
+
children: n
|
|
1473
|
+
}
|
|
1474
|
+
);
|
|
1475
|
+
};
|
|
1476
|
+
Vo.displayName = Rt;
|
|
1477
|
+
var Ko = "DialogTrigger", Uo = s.forwardRef(
|
|
1478
|
+
(e, t) => {
|
|
1479
|
+
const { __scopeDialog: n, ...o } = e, r = te(Ko, n), i = W(t, r.triggerRef);
|
|
1480
|
+
return /* @__PURE__ */ p(
|
|
1481
|
+
I.button,
|
|
1482
|
+
{
|
|
1483
|
+
type: "button",
|
|
1484
|
+
"aria-haspopup": "dialog",
|
|
1485
|
+
"aria-expanded": r.open,
|
|
1486
|
+
"aria-controls": r.contentId,
|
|
1487
|
+
"data-state": vn(r.open),
|
|
1488
|
+
...o,
|
|
1489
|
+
ref: i,
|
|
1490
|
+
onClick: _(e.onClick, r.onOpenToggle)
|
|
1491
|
+
}
|
|
1492
|
+
);
|
|
1493
|
+
}
|
|
1494
|
+
);
|
|
1495
|
+
Uo.displayName = Ko;
|
|
1496
|
+
var pn = "DialogPortal", [qc, Go] = Ho(pn, {
|
|
1497
|
+
forceMount: void 0
|
|
1498
|
+
}), zo = (e) => {
|
|
1499
|
+
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, i = te(pn, t);
|
|
1500
|
+
return /* @__PURE__ */ p(qc, { scope: t, forceMount: n, children: s.Children.map(o, (c) => /* @__PURE__ */ p(Z, { present: n || i.open, children: /* @__PURE__ */ p(je, { asChild: !0, container: r, children: c }) })) });
|
|
1501
|
+
};
|
|
1502
|
+
zo.displayName = pn;
|
|
1503
|
+
var pt = "DialogOverlay", jo = s.forwardRef(
|
|
1504
|
+
(e, t) => {
|
|
1505
|
+
const n = Go(pt, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, i = te(pt, e.__scopeDialog);
|
|
1506
|
+
return i.modal ? /* @__PURE__ */ p(Z, { present: o || i.open, children: /* @__PURE__ */ p(Qc, { ...r, ref: t }) }) : null;
|
|
1507
|
+
}
|
|
1508
|
+
);
|
|
1509
|
+
jo.displayName = pt;
|
|
1510
|
+
var Zc = /* @__PURE__ */ Be("DialogOverlay.RemoveScroll"), Qc = s.forwardRef(
|
|
1511
|
+
(e, t) => {
|
|
1512
|
+
const { __scopeDialog: n, ...o } = e, r = te(pt, n);
|
|
1513
|
+
return (
|
|
1514
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1515
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
1516
|
+
/* @__PURE__ */ p(fn, { as: Zc, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ p(
|
|
1517
|
+
I.div,
|
|
1518
|
+
{
|
|
1519
|
+
"data-state": vn(r.open),
|
|
1520
|
+
...o,
|
|
1521
|
+
ref: t,
|
|
1522
|
+
style: { pointerEvents: "auto", ...o.style }
|
|
1523
|
+
}
|
|
1524
|
+
) })
|
|
1525
|
+
);
|
|
1526
|
+
}
|
|
1527
|
+
), be = "DialogContent", Yo = s.forwardRef(
|
|
1528
|
+
(e, t) => {
|
|
1529
|
+
const n = Go(be, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, i = te(be, e.__scopeDialog);
|
|
1530
|
+
return /* @__PURE__ */ p(Z, { present: o || i.open, children: i.modal ? /* @__PURE__ */ p(Jc, { ...r, ref: t }) : /* @__PURE__ */ p(ea, { ...r, ref: t }) });
|
|
1531
|
+
}
|
|
1532
|
+
);
|
|
1533
|
+
Yo.displayName = be;
|
|
1534
|
+
var Jc = s.forwardRef(
|
|
1535
|
+
(e, t) => {
|
|
1536
|
+
const n = te(be, e.__scopeDialog), o = s.useRef(null), r = W(t, n.contentRef, o);
|
|
1537
|
+
return s.useEffect(() => {
|
|
1538
|
+
const i = o.current;
|
|
1539
|
+
if (i) return Wo(i);
|
|
1540
|
+
}, []), /* @__PURE__ */ p(
|
|
1541
|
+
Xo,
|
|
1542
|
+
{
|
|
1543
|
+
...e,
|
|
1544
|
+
ref: r,
|
|
1545
|
+
trapFocus: n.open,
|
|
1546
|
+
disableOutsidePointerEvents: !0,
|
|
1547
|
+
onCloseAutoFocus: _(e.onCloseAutoFocus, (i) => {
|
|
1548
|
+
i.preventDefault(), n.triggerRef.current?.focus();
|
|
1549
|
+
}),
|
|
1550
|
+
onPointerDownOutside: _(e.onPointerDownOutside, (i) => {
|
|
1551
|
+
const c = i.detail.originalEvent, a = c.button === 0 && c.ctrlKey === !0;
|
|
1552
|
+
(c.button === 2 || a) && i.preventDefault();
|
|
1553
|
+
}),
|
|
1554
|
+
onFocusOutside: _(
|
|
1555
|
+
e.onFocusOutside,
|
|
1556
|
+
(i) => i.preventDefault()
|
|
1557
|
+
)
|
|
1558
|
+
}
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1561
|
+
), ea = s.forwardRef(
|
|
1562
|
+
(e, t) => {
|
|
1563
|
+
const n = te(be, e.__scopeDialog), o = s.useRef(!1), r = s.useRef(!1);
|
|
1564
|
+
return /* @__PURE__ */ p(
|
|
1565
|
+
Xo,
|
|
1566
|
+
{
|
|
1567
|
+
...e,
|
|
1568
|
+
ref: t,
|
|
1569
|
+
trapFocus: !1,
|
|
1570
|
+
disableOutsidePointerEvents: !1,
|
|
1571
|
+
onCloseAutoFocus: (i) => {
|
|
1572
|
+
e.onCloseAutoFocus?.(i), i.defaultPrevented || (o.current || n.triggerRef.current?.focus(), i.preventDefault()), o.current = !1, r.current = !1;
|
|
1573
|
+
},
|
|
1574
|
+
onInteractOutside: (i) => {
|
|
1575
|
+
e.onInteractOutside?.(i), i.defaultPrevented || (o.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
1576
|
+
const c = i.target;
|
|
1577
|
+
n.triggerRef.current?.contains(c) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
), Xo = s.forwardRef(
|
|
1583
|
+
(e, t) => {
|
|
1584
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...c } = e, a = te(be, n), d = s.useRef(null), l = W(t, d);
|
|
1585
|
+
return Oo(), /* @__PURE__ */ K(Ce, { children: [
|
|
1586
|
+
/* @__PURE__ */ p(
|
|
1587
|
+
dn,
|
|
1588
|
+
{
|
|
1589
|
+
asChild: !0,
|
|
1590
|
+
loop: !0,
|
|
1591
|
+
trapped: o,
|
|
1592
|
+
onMountAutoFocus: r,
|
|
1593
|
+
onUnmountAutoFocus: i,
|
|
1594
|
+
children: /* @__PURE__ */ p(
|
|
1595
|
+
ze,
|
|
1596
|
+
{
|
|
1597
|
+
role: "dialog",
|
|
1598
|
+
id: a.contentId,
|
|
1599
|
+
"aria-describedby": a.descriptionId,
|
|
1600
|
+
"aria-labelledby": a.titleId,
|
|
1601
|
+
"data-state": vn(a.open),
|
|
1602
|
+
...c,
|
|
1603
|
+
ref: l,
|
|
1604
|
+
onDismiss: () => a.onOpenChange(!1)
|
|
1605
|
+
}
|
|
1606
|
+
)
|
|
1607
|
+
}
|
|
1608
|
+
),
|
|
1609
|
+
/* @__PURE__ */ K(Ce, { children: [
|
|
1610
|
+
/* @__PURE__ */ p(na, { titleId: a.titleId }),
|
|
1611
|
+
/* @__PURE__ */ p(ra, { contentRef: d, descriptionId: a.descriptionId })
|
|
1612
|
+
] })
|
|
1613
|
+
] });
|
|
1614
|
+
}
|
|
1615
|
+
), mn = "DialogTitle", qo = s.forwardRef(
|
|
1616
|
+
(e, t) => {
|
|
1617
|
+
const { __scopeDialog: n, ...o } = e, r = te(mn, n);
|
|
1618
|
+
return /* @__PURE__ */ p(I.h2, { id: r.titleId, ...o, ref: t });
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
qo.displayName = mn;
|
|
1622
|
+
var Zo = "DialogDescription", ta = s.forwardRef(
|
|
1623
|
+
(e, t) => {
|
|
1624
|
+
const { __scopeDialog: n, ...o } = e, r = te(Zo, n);
|
|
1625
|
+
return /* @__PURE__ */ p(I.p, { id: r.descriptionId, ...o, ref: t });
|
|
1626
|
+
}
|
|
1627
|
+
);
|
|
1628
|
+
ta.displayName = Zo;
|
|
1629
|
+
var Qo = "DialogClose", Jo = s.forwardRef(
|
|
1630
|
+
(e, t) => {
|
|
1631
|
+
const { __scopeDialog: n, ...o } = e, r = te(Qo, n);
|
|
1632
|
+
return /* @__PURE__ */ p(
|
|
1633
|
+
I.button,
|
|
1634
|
+
{
|
|
1635
|
+
type: "button",
|
|
1636
|
+
...o,
|
|
1637
|
+
ref: t,
|
|
1638
|
+
onClick: _(e.onClick, () => r.onOpenChange(!1))
|
|
1639
|
+
}
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
);
|
|
1643
|
+
Jo.displayName = Qo;
|
|
1644
|
+
function vn(e) {
|
|
1645
|
+
return e ? "open" : "closed";
|
|
1646
|
+
}
|
|
1647
|
+
var er = "DialogTitleWarning", [Ef, tr] = bs(er, {
|
|
1648
|
+
contentName: be,
|
|
1649
|
+
titleName: mn,
|
|
1650
|
+
docsSlug: "dialog"
|
|
1651
|
+
}), na = ({ titleId: e }) => {
|
|
1652
|
+
const t = tr(er), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1653
|
+
|
|
1654
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1655
|
+
|
|
1656
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
1657
|
+
return s.useEffect(() => {
|
|
1658
|
+
e && (document.getElementById(e) || console.error(n));
|
|
1659
|
+
}, [n, e]), null;
|
|
1660
|
+
}, oa = "DialogDescriptionWarning", ra = ({ contentRef: e, descriptionId: t }) => {
|
|
1661
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tr(oa).contentName}}.`;
|
|
1662
|
+
return s.useEffect(() => {
|
|
1663
|
+
const r = e.current?.getAttribute("aria-describedby");
|
|
1664
|
+
t && r && (document.getElementById(t) || console.warn(o));
|
|
1665
|
+
}, [o, e, t]), null;
|
|
1666
|
+
}, ia = Vo, sa = Uo, ca = zo, aa = jo, la = Yo, ua = qo, da = Jo;
|
|
1667
|
+
const fa = "_dialogOverlay_1flkk_1", pa = "_dialogContent_1flkk_20", ma = "_dialogCloseButton_1flkk_65", va = "_dialogTitle_1flkk_72", ct = {
|
|
1668
|
+
dialogOverlay: fa,
|
|
1669
|
+
dialogContent: pa,
|
|
1670
|
+
dialogCloseButton: ma,
|
|
1671
|
+
dialogTitle: va
|
|
1672
|
+
}, Rf = ({ trigger: e, content: t, title: n, ...o }) => /* @__PURE__ */ K(ia, { ...o, children: [
|
|
1673
|
+
/* @__PURE__ */ p(sa, { asChild: !0, children: e }),
|
|
1674
|
+
/* @__PURE__ */ K(ca, { children: [
|
|
1675
|
+
/* @__PURE__ */ p(aa, { className: `${ct.dialogOverlay}` }),
|
|
1676
|
+
/* @__PURE__ */ K(
|
|
1677
|
+
la,
|
|
1678
|
+
{
|
|
1679
|
+
className: ct.dialogContent,
|
|
1680
|
+
onPointerDownOutside: (r) => {
|
|
1681
|
+
r?.preventDefault();
|
|
1682
|
+
},
|
|
1683
|
+
"data-size": "md",
|
|
1684
|
+
children: [
|
|
1685
|
+
/* @__PURE__ */ p(da, { asChild: !0, children: /* @__PURE__ */ p(Ct, { className: `${ct.dialogCloseButton}`, variant: "tertiary", iconOnly: !0, children: /* @__PURE__ */ p(vo, {}) }) }),
|
|
1686
|
+
/* @__PURE__ */ p(ua, { className: ct.dialogTitle, children: n }),
|
|
1687
|
+
t
|
|
1688
|
+
]
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
] })
|
|
1692
|
+
] });
|
|
1693
|
+
function hn(e) {
|
|
1694
|
+
const t = e + "CollectionProvider", [n, o] = de(t), [r, i] = n(
|
|
1695
|
+
t,
|
|
1696
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
1697
|
+
), c = (m) => {
|
|
1698
|
+
const { scope: g, children: y } = m, C = we.useRef(null), b = we.useRef(/* @__PURE__ */ new Map()).current;
|
|
1699
|
+
return /* @__PURE__ */ p(r, { scope: g, itemMap: b, collectionRef: C, children: y });
|
|
1700
|
+
};
|
|
1701
|
+
c.displayName = t;
|
|
1702
|
+
const a = e + "CollectionSlot", d = /* @__PURE__ */ Be(a), l = we.forwardRef(
|
|
1703
|
+
(m, g) => {
|
|
1704
|
+
const { scope: y, children: C } = m, b = i(a, y), x = W(g, b.collectionRef);
|
|
1705
|
+
return /* @__PURE__ */ p(d, { ref: x, children: C });
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1708
|
+
l.displayName = a;
|
|
1709
|
+
const u = e + "CollectionItemSlot", f = "data-radix-collection-item", v = /* @__PURE__ */ Be(u), h = we.forwardRef(
|
|
1710
|
+
(m, g) => {
|
|
1711
|
+
const { scope: y, children: C, ...b } = m, x = we.useRef(null), E = W(g, x), T = i(u, y);
|
|
1712
|
+
return we.useEffect(() => (T.itemMap.set(x, { ref: x, ...b }), () => void T.itemMap.delete(x))), /* @__PURE__ */ p(v, { [f]: "", ref: E, children: C });
|
|
1713
|
+
}
|
|
1714
|
+
);
|
|
1715
|
+
h.displayName = u;
|
|
1716
|
+
function w(m) {
|
|
1717
|
+
const g = i(e + "CollectionConsumer", m);
|
|
1718
|
+
return we.useCallback(() => {
|
|
1719
|
+
const C = g.collectionRef.current;
|
|
1720
|
+
if (!C) return [];
|
|
1721
|
+
const b = Array.from(C.querySelectorAll(`[${f}]`));
|
|
1722
|
+
return Array.from(g.itemMap.values()).sort(
|
|
1723
|
+
(T, R) => b.indexOf(T.ref.current) - b.indexOf(R.ref.current)
|
|
1724
|
+
);
|
|
1725
|
+
}, [g.collectionRef, g.itemMap]);
|
|
1726
|
+
}
|
|
1727
|
+
return [
|
|
1728
|
+
{ Provider: c, Slot: l, ItemSlot: h },
|
|
1729
|
+
w,
|
|
1730
|
+
o
|
|
1731
|
+
];
|
|
1732
|
+
}
|
|
1733
|
+
var ha = s.createContext(void 0);
|
|
1734
|
+
function nr(e) {
|
|
1735
|
+
const t = s.useContext(ha);
|
|
1736
|
+
return e || t || "ltr";
|
|
1737
|
+
}
|
|
1738
|
+
const ga = ["top", "right", "bottom", "left"], ve = Math.min, z = Math.max, mt = Math.round, at = Math.floor, ie = (e) => ({
|
|
1739
|
+
x: e,
|
|
1740
|
+
y: e
|
|
1741
|
+
}), wa = {
|
|
1742
|
+
left: "right",
|
|
1743
|
+
right: "left",
|
|
1744
|
+
bottom: "top",
|
|
1745
|
+
top: "bottom"
|
|
1746
|
+
}, ya = {
|
|
1747
|
+
start: "end",
|
|
1748
|
+
end: "start"
|
|
1749
|
+
};
|
|
1750
|
+
function qt(e, t, n) {
|
|
1751
|
+
return z(e, ve(t, n));
|
|
1752
|
+
}
|
|
1753
|
+
function le(e, t) {
|
|
1754
|
+
return typeof e == "function" ? e(t) : e;
|
|
1755
|
+
}
|
|
1756
|
+
function ue(e) {
|
|
1757
|
+
return e.split("-")[0];
|
|
1758
|
+
}
|
|
1759
|
+
function Ie(e) {
|
|
1760
|
+
return e.split("-")[1];
|
|
1761
|
+
}
|
|
1762
|
+
function gn(e) {
|
|
1763
|
+
return e === "x" ? "y" : "x";
|
|
1764
|
+
}
|
|
1765
|
+
function wn(e) {
|
|
1766
|
+
return e === "y" ? "height" : "width";
|
|
1767
|
+
}
|
|
1768
|
+
const Ca = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
1769
|
+
function re(e) {
|
|
1770
|
+
return Ca.has(ue(e)) ? "y" : "x";
|
|
1771
|
+
}
|
|
1772
|
+
function yn(e) {
|
|
1773
|
+
return gn(re(e));
|
|
1774
|
+
}
|
|
1775
|
+
function ba(e, t, n) {
|
|
1776
|
+
n === void 0 && (n = !1);
|
|
1777
|
+
const o = Ie(e), r = yn(e), i = wn(r);
|
|
1778
|
+
let c = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
1779
|
+
return t.reference[i] > t.floating[i] && (c = vt(c)), [c, vt(c)];
|
|
1780
|
+
}
|
|
1781
|
+
function xa(e) {
|
|
1782
|
+
const t = vt(e);
|
|
1783
|
+
return [Zt(e), t, Zt(t)];
|
|
1784
|
+
}
|
|
1785
|
+
function Zt(e) {
|
|
1786
|
+
return e.replace(/start|end/g, (t) => ya[t]);
|
|
1787
|
+
}
|
|
1788
|
+
const Jn = ["left", "right"], eo = ["right", "left"], Ea = ["top", "bottom"], Ra = ["bottom", "top"];
|
|
1789
|
+
function Ta(e, t, n) {
|
|
1790
|
+
switch (e) {
|
|
1791
|
+
case "top":
|
|
1792
|
+
case "bottom":
|
|
1793
|
+
return n ? t ? eo : Jn : t ? Jn : eo;
|
|
1794
|
+
case "left":
|
|
1795
|
+
case "right":
|
|
1796
|
+
return t ? Ea : Ra;
|
|
1797
|
+
default:
|
|
1798
|
+
return [];
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
function Sa(e, t, n, o) {
|
|
1802
|
+
const r = Ie(e);
|
|
1803
|
+
let i = Ta(ue(e), n === "start", o);
|
|
1804
|
+
return r && (i = i.map((c) => c + "-" + r), t && (i = i.concat(i.map(Zt)))), i;
|
|
1805
|
+
}
|
|
1806
|
+
function vt(e) {
|
|
1807
|
+
return e.replace(/left|right|bottom|top/g, (t) => wa[t]);
|
|
1808
|
+
}
|
|
1809
|
+
function Pa(e) {
|
|
1810
|
+
return {
|
|
1811
|
+
top: 0,
|
|
1812
|
+
right: 0,
|
|
1813
|
+
bottom: 0,
|
|
1814
|
+
left: 0,
|
|
1815
|
+
...e
|
|
1816
|
+
};
|
|
1817
|
+
}
|
|
1818
|
+
function or(e) {
|
|
1819
|
+
return typeof e != "number" ? Pa(e) : {
|
|
1820
|
+
top: e,
|
|
1821
|
+
right: e,
|
|
1822
|
+
bottom: e,
|
|
1823
|
+
left: e
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
function ht(e) {
|
|
1827
|
+
const {
|
|
1828
|
+
x: t,
|
|
1829
|
+
y: n,
|
|
1830
|
+
width: o,
|
|
1831
|
+
height: r
|
|
1832
|
+
} = e;
|
|
1833
|
+
return {
|
|
1834
|
+
width: o,
|
|
1835
|
+
height: r,
|
|
1836
|
+
top: n,
|
|
1837
|
+
left: t,
|
|
1838
|
+
right: t + o,
|
|
1839
|
+
bottom: n + r,
|
|
1840
|
+
x: t,
|
|
1841
|
+
y: n
|
|
1842
|
+
};
|
|
1843
|
+
}
|
|
1844
|
+
function to(e, t, n) {
|
|
1845
|
+
let {
|
|
1846
|
+
reference: o,
|
|
1847
|
+
floating: r
|
|
1848
|
+
} = e;
|
|
1849
|
+
const i = re(t), c = yn(t), a = wn(c), d = ue(t), l = i === "y", u = o.x + o.width / 2 - r.width / 2, f = o.y + o.height / 2 - r.height / 2, v = o[a] / 2 - r[a] / 2;
|
|
1850
|
+
let h;
|
|
1851
|
+
switch (d) {
|
|
1852
|
+
case "top":
|
|
1853
|
+
h = {
|
|
1854
|
+
x: u,
|
|
1855
|
+
y: o.y - r.height
|
|
1856
|
+
};
|
|
1857
|
+
break;
|
|
1858
|
+
case "bottom":
|
|
1859
|
+
h = {
|
|
1860
|
+
x: u,
|
|
1861
|
+
y: o.y + o.height
|
|
1862
|
+
};
|
|
1863
|
+
break;
|
|
1864
|
+
case "right":
|
|
1865
|
+
h = {
|
|
1866
|
+
x: o.x + o.width,
|
|
1867
|
+
y: f
|
|
1868
|
+
};
|
|
1869
|
+
break;
|
|
1870
|
+
case "left":
|
|
1871
|
+
h = {
|
|
1872
|
+
x: o.x - r.width,
|
|
1873
|
+
y: f
|
|
1874
|
+
};
|
|
1875
|
+
break;
|
|
1876
|
+
default:
|
|
1877
|
+
h = {
|
|
1878
|
+
x: o.x,
|
|
1879
|
+
y: o.y
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
switch (Ie(t)) {
|
|
1883
|
+
case "start":
|
|
1884
|
+
h[c] -= v * (n && l ? -1 : 1);
|
|
1885
|
+
break;
|
|
1886
|
+
case "end":
|
|
1887
|
+
h[c] += v * (n && l ? -1 : 1);
|
|
1888
|
+
break;
|
|
1889
|
+
}
|
|
1890
|
+
return h;
|
|
1891
|
+
}
|
|
1892
|
+
const _a = async (e, t, n) => {
|
|
1893
|
+
const {
|
|
1894
|
+
placement: o = "bottom",
|
|
1895
|
+
strategy: r = "absolute",
|
|
1896
|
+
middleware: i = [],
|
|
1897
|
+
platform: c
|
|
1898
|
+
} = n, a = i.filter(Boolean), d = await (c.isRTL == null ? void 0 : c.isRTL(t));
|
|
1899
|
+
let l = await c.getElementRects({
|
|
1900
|
+
reference: e,
|
|
1901
|
+
floating: t,
|
|
1902
|
+
strategy: r
|
|
1903
|
+
}), {
|
|
1904
|
+
x: u,
|
|
1905
|
+
y: f
|
|
1906
|
+
} = to(l, o, d), v = o, h = {}, w = 0;
|
|
1907
|
+
for (let m = 0; m < a.length; m++) {
|
|
1908
|
+
const {
|
|
1909
|
+
name: g,
|
|
1910
|
+
fn: y
|
|
1911
|
+
} = a[m], {
|
|
1912
|
+
x: C,
|
|
1913
|
+
y: b,
|
|
1914
|
+
data: x,
|
|
1915
|
+
reset: E
|
|
1916
|
+
} = await y({
|
|
1917
|
+
x: u,
|
|
1918
|
+
y: f,
|
|
1919
|
+
initialPlacement: o,
|
|
1920
|
+
placement: v,
|
|
1921
|
+
strategy: r,
|
|
1922
|
+
middlewareData: h,
|
|
1923
|
+
rects: l,
|
|
1924
|
+
platform: c,
|
|
1925
|
+
elements: {
|
|
1926
|
+
reference: e,
|
|
1927
|
+
floating: t
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1930
|
+
u = C ?? u, f = b ?? f, h = {
|
|
1931
|
+
...h,
|
|
1932
|
+
[g]: {
|
|
1933
|
+
...h[g],
|
|
1934
|
+
...x
|
|
1935
|
+
}
|
|
1936
|
+
}, E && w <= 50 && (w++, typeof E == "object" && (E.placement && (v = E.placement), E.rects && (l = E.rects === !0 ? await c.getElementRects({
|
|
1937
|
+
reference: e,
|
|
1938
|
+
floating: t,
|
|
1939
|
+
strategy: r
|
|
1940
|
+
}) : E.rects), {
|
|
1941
|
+
x: u,
|
|
1942
|
+
y: f
|
|
1943
|
+
} = to(l, v, d)), m = -1);
|
|
1944
|
+
}
|
|
1945
|
+
return {
|
|
1946
|
+
x: u,
|
|
1947
|
+
y: f,
|
|
1948
|
+
placement: v,
|
|
1949
|
+
strategy: r,
|
|
1950
|
+
middlewareData: h
|
|
1951
|
+
};
|
|
1952
|
+
};
|
|
1953
|
+
async function We(e, t) {
|
|
1954
|
+
var n;
|
|
1955
|
+
t === void 0 && (t = {});
|
|
1956
|
+
const {
|
|
1957
|
+
x: o,
|
|
1958
|
+
y: r,
|
|
1959
|
+
platform: i,
|
|
1960
|
+
rects: c,
|
|
1961
|
+
elements: a,
|
|
1962
|
+
strategy: d
|
|
1963
|
+
} = e, {
|
|
1964
|
+
boundary: l = "clippingAncestors",
|
|
1965
|
+
rootBoundary: u = "viewport",
|
|
1966
|
+
elementContext: f = "floating",
|
|
1967
|
+
altBoundary: v = !1,
|
|
1968
|
+
padding: h = 0
|
|
1969
|
+
} = le(t, e), w = or(h), g = a[v ? f === "floating" ? "reference" : "floating" : f], y = ht(await i.getClippingRect({
|
|
1970
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(g))) == null || n ? g : g.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
|
|
1971
|
+
boundary: l,
|
|
1972
|
+
rootBoundary: u,
|
|
1973
|
+
strategy: d
|
|
1974
|
+
})), C = f === "floating" ? {
|
|
1975
|
+
x: o,
|
|
1976
|
+
y: r,
|
|
1977
|
+
width: c.floating.width,
|
|
1978
|
+
height: c.floating.height
|
|
1979
|
+
} : c.reference, b = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), x = await (i.isElement == null ? void 0 : i.isElement(b)) ? await (i.getScale == null ? void 0 : i.getScale(b)) || {
|
|
1980
|
+
x: 1,
|
|
1981
|
+
y: 1
|
|
1982
|
+
} : {
|
|
1983
|
+
x: 1,
|
|
1984
|
+
y: 1
|
|
1985
|
+
}, E = ht(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1986
|
+
elements: a,
|
|
1987
|
+
rect: C,
|
|
1988
|
+
offsetParent: b,
|
|
1989
|
+
strategy: d
|
|
1990
|
+
}) : C);
|
|
1991
|
+
return {
|
|
1992
|
+
top: (y.top - E.top + w.top) / x.y,
|
|
1993
|
+
bottom: (E.bottom - y.bottom + w.bottom) / x.y,
|
|
1994
|
+
left: (y.left - E.left + w.left) / x.x,
|
|
1995
|
+
right: (E.right - y.right + w.right) / x.x
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
const Ma = (e) => ({
|
|
1999
|
+
name: "arrow",
|
|
2000
|
+
options: e,
|
|
2001
|
+
async fn(t) {
|
|
2002
|
+
const {
|
|
2003
|
+
x: n,
|
|
2004
|
+
y: o,
|
|
2005
|
+
placement: r,
|
|
2006
|
+
rects: i,
|
|
2007
|
+
platform: c,
|
|
2008
|
+
elements: a,
|
|
2009
|
+
middlewareData: d
|
|
2010
|
+
} = t, {
|
|
2011
|
+
element: l,
|
|
2012
|
+
padding: u = 0
|
|
2013
|
+
} = le(e, t) || {};
|
|
2014
|
+
if (l == null)
|
|
2015
|
+
return {};
|
|
2016
|
+
const f = or(u), v = {
|
|
2017
|
+
x: n,
|
|
2018
|
+
y: o
|
|
2019
|
+
}, h = yn(r), w = wn(h), m = await c.getDimensions(l), g = h === "y", y = g ? "top" : "left", C = g ? "bottom" : "right", b = g ? "clientHeight" : "clientWidth", x = i.reference[w] + i.reference[h] - v[h] - i.floating[w], E = v[h] - i.reference[h], T = await (c.getOffsetParent == null ? void 0 : c.getOffsetParent(l));
|
|
2020
|
+
let R = T ? T[b] : 0;
|
|
2021
|
+
(!R || !await (c.isElement == null ? void 0 : c.isElement(T))) && (R = a.floating[b] || i.floating[w]);
|
|
2022
|
+
const M = x / 2 - E / 2, N = R / 2 - m[w] / 2 - 1, D = ve(f[y], N), k = ve(f[C], N), B = D, L = R - m[w] - k, P = R / 2 - m[w] / 2 + M, F = qt(B, P, L), O = !d.arrow && Ie(r) != null && P !== F && i.reference[w] / 2 - (P < B ? D : k) - m[w] / 2 < 0, $ = O ? P < B ? P - B : P - L : 0;
|
|
2023
|
+
return {
|
|
2024
|
+
[h]: v[h] + $,
|
|
2025
|
+
data: {
|
|
2026
|
+
[h]: F,
|
|
2027
|
+
centerOffset: P - F - $,
|
|
2028
|
+
...O && {
|
|
2029
|
+
alignmentOffset: $
|
|
2030
|
+
}
|
|
2031
|
+
},
|
|
2032
|
+
reset: O
|
|
2033
|
+
};
|
|
2034
|
+
}
|
|
2035
|
+
}), Aa = function(e) {
|
|
2036
|
+
return e === void 0 && (e = {}), {
|
|
2037
|
+
name: "flip",
|
|
2038
|
+
options: e,
|
|
2039
|
+
async fn(t) {
|
|
2040
|
+
var n, o;
|
|
2041
|
+
const {
|
|
2042
|
+
placement: r,
|
|
2043
|
+
middlewareData: i,
|
|
2044
|
+
rects: c,
|
|
2045
|
+
initialPlacement: a,
|
|
2046
|
+
platform: d,
|
|
2047
|
+
elements: l
|
|
2048
|
+
} = t, {
|
|
2049
|
+
mainAxis: u = !0,
|
|
2050
|
+
crossAxis: f = !0,
|
|
2051
|
+
fallbackPlacements: v,
|
|
2052
|
+
fallbackStrategy: h = "bestFit",
|
|
2053
|
+
fallbackAxisSideDirection: w = "none",
|
|
2054
|
+
flipAlignment: m = !0,
|
|
2055
|
+
...g
|
|
2056
|
+
} = le(e, t);
|
|
2057
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
2058
|
+
return {};
|
|
2059
|
+
const y = ue(r), C = re(a), b = ue(a) === a, x = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), E = v || (b || !m ? [vt(a)] : xa(a)), T = w !== "none";
|
|
2060
|
+
!v && T && E.push(...Sa(a, m, w, x));
|
|
2061
|
+
const R = [a, ...E], M = await We(t, g), N = [];
|
|
2062
|
+
let D = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
2063
|
+
if (u && N.push(M[y]), f) {
|
|
2064
|
+
const P = ba(r, c, x);
|
|
2065
|
+
N.push(M[P[0]], M[P[1]]);
|
|
2066
|
+
}
|
|
2067
|
+
if (D = [...D, {
|
|
2068
|
+
placement: r,
|
|
2069
|
+
overflows: N
|
|
2070
|
+
}], !N.every((P) => P <= 0)) {
|
|
2071
|
+
var k, B;
|
|
2072
|
+
const P = (((k = i.flip) == null ? void 0 : k.index) || 0) + 1, F = R[P];
|
|
2073
|
+
if (F && (!(f === "alignment" ? C !== re(F) : !1) || // We leave the current main axis only if every placement on that axis
|
|
2074
|
+
// overflows the main axis.
|
|
2075
|
+
D.every((A) => re(A.placement) === C ? A.overflows[0] > 0 : !0)))
|
|
2076
|
+
return {
|
|
2077
|
+
data: {
|
|
2078
|
+
index: P,
|
|
2079
|
+
overflows: D
|
|
2080
|
+
},
|
|
2081
|
+
reset: {
|
|
2082
|
+
placement: F
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
let O = (B = D.filter(($) => $.overflows[0] <= 0).sort(($, A) => $.overflows[1] - A.overflows[1])[0]) == null ? void 0 : B.placement;
|
|
2086
|
+
if (!O)
|
|
2087
|
+
switch (h) {
|
|
2088
|
+
case "bestFit": {
|
|
2089
|
+
var L;
|
|
2090
|
+
const $ = (L = D.filter((A) => {
|
|
2091
|
+
if (T) {
|
|
2092
|
+
const S = re(A.placement);
|
|
2093
|
+
return S === C || // Create a bias to the `y` side axis due to horizontal
|
|
2094
|
+
// reading directions favoring greater width.
|
|
2095
|
+
S === "y";
|
|
2096
|
+
}
|
|
2097
|
+
return !0;
|
|
2098
|
+
}).map((A) => [A.placement, A.overflows.filter((S) => S > 0).reduce((S, H) => S + H, 0)]).sort((A, S) => A[1] - S[1])[0]) == null ? void 0 : L[0];
|
|
2099
|
+
$ && (O = $);
|
|
2100
|
+
break;
|
|
2101
|
+
}
|
|
2102
|
+
case "initialPlacement":
|
|
2103
|
+
O = a;
|
|
2104
|
+
break;
|
|
2105
|
+
}
|
|
2106
|
+
if (r !== O)
|
|
2107
|
+
return {
|
|
2108
|
+
reset: {
|
|
2109
|
+
placement: O
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
return {};
|
|
2114
|
+
}
|
|
2115
|
+
};
|
|
2116
|
+
};
|
|
2117
|
+
function no(e, t) {
|
|
2118
|
+
return {
|
|
2119
|
+
top: e.top - t.height,
|
|
2120
|
+
right: e.right - t.width,
|
|
2121
|
+
bottom: e.bottom - t.height,
|
|
2122
|
+
left: e.left - t.width
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
function oo(e) {
|
|
2126
|
+
return ga.some((t) => e[t] >= 0);
|
|
2127
|
+
}
|
|
2128
|
+
const Oa = function(e) {
|
|
2129
|
+
return e === void 0 && (e = {}), {
|
|
2130
|
+
name: "hide",
|
|
2131
|
+
options: e,
|
|
2132
|
+
async fn(t) {
|
|
2133
|
+
const {
|
|
2134
|
+
rects: n
|
|
2135
|
+
} = t, {
|
|
2136
|
+
strategy: o = "referenceHidden",
|
|
2137
|
+
...r
|
|
2138
|
+
} = le(e, t);
|
|
2139
|
+
switch (o) {
|
|
2140
|
+
case "referenceHidden": {
|
|
2141
|
+
const i = await We(t, {
|
|
2142
|
+
...r,
|
|
2143
|
+
elementContext: "reference"
|
|
2144
|
+
}), c = no(i, n.reference);
|
|
2145
|
+
return {
|
|
2146
|
+
data: {
|
|
2147
|
+
referenceHiddenOffsets: c,
|
|
2148
|
+
referenceHidden: oo(c)
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
case "escaped": {
|
|
2153
|
+
const i = await We(t, {
|
|
2154
|
+
...r,
|
|
2155
|
+
altBoundary: !0
|
|
2156
|
+
}), c = no(i, n.floating);
|
|
2157
|
+
return {
|
|
2158
|
+
data: {
|
|
2159
|
+
escapedOffsets: c,
|
|
2160
|
+
escaped: oo(c)
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2163
|
+
}
|
|
2164
|
+
default:
|
|
2165
|
+
return {};
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
};
|
|
2169
|
+
}, rr = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2170
|
+
async function Da(e, t) {
|
|
2171
|
+
const {
|
|
2172
|
+
placement: n,
|
|
2173
|
+
platform: o,
|
|
2174
|
+
elements: r
|
|
2175
|
+
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), c = ue(n), a = Ie(n), d = re(n) === "y", l = rr.has(c) ? -1 : 1, u = i && d ? -1 : 1, f = le(t, e);
|
|
2176
|
+
let {
|
|
2177
|
+
mainAxis: v,
|
|
2178
|
+
crossAxis: h,
|
|
2179
|
+
alignmentAxis: w
|
|
2180
|
+
} = typeof f == "number" ? {
|
|
2181
|
+
mainAxis: f,
|
|
2182
|
+
crossAxis: 0,
|
|
2183
|
+
alignmentAxis: null
|
|
2184
|
+
} : {
|
|
2185
|
+
mainAxis: f.mainAxis || 0,
|
|
2186
|
+
crossAxis: f.crossAxis || 0,
|
|
2187
|
+
alignmentAxis: f.alignmentAxis
|
|
2188
|
+
};
|
|
2189
|
+
return a && typeof w == "number" && (h = a === "end" ? w * -1 : w), d ? {
|
|
2190
|
+
x: h * u,
|
|
2191
|
+
y: v * l
|
|
2192
|
+
} : {
|
|
2193
|
+
x: v * l,
|
|
2194
|
+
y: h * u
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
const Na = function(e) {
|
|
2198
|
+
return e === void 0 && (e = 0), {
|
|
2199
|
+
name: "offset",
|
|
2200
|
+
options: e,
|
|
2201
|
+
async fn(t) {
|
|
2202
|
+
var n, o;
|
|
2203
|
+
const {
|
|
2204
|
+
x: r,
|
|
2205
|
+
y: i,
|
|
2206
|
+
placement: c,
|
|
2207
|
+
middlewareData: a
|
|
2208
|
+
} = t, d = await Da(t, e);
|
|
2209
|
+
return c === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
|
|
2210
|
+
x: r + d.x,
|
|
2211
|
+
y: i + d.y,
|
|
2212
|
+
data: {
|
|
2213
|
+
...d,
|
|
2214
|
+
placement: c
|
|
2215
|
+
}
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
};
|
|
2219
|
+
}, Ia = function(e) {
|
|
2220
|
+
return e === void 0 && (e = {}), {
|
|
2221
|
+
name: "shift",
|
|
2222
|
+
options: e,
|
|
2223
|
+
async fn(t) {
|
|
2224
|
+
const {
|
|
2225
|
+
x: n,
|
|
2226
|
+
y: o,
|
|
2227
|
+
placement: r
|
|
2228
|
+
} = t, {
|
|
2229
|
+
mainAxis: i = !0,
|
|
2230
|
+
crossAxis: c = !1,
|
|
2231
|
+
limiter: a = {
|
|
2232
|
+
fn: (g) => {
|
|
2233
|
+
let {
|
|
2234
|
+
x: y,
|
|
2235
|
+
y: C
|
|
2236
|
+
} = g;
|
|
2237
|
+
return {
|
|
2238
|
+
x: y,
|
|
2239
|
+
y: C
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
},
|
|
2243
|
+
...d
|
|
2244
|
+
} = le(e, t), l = {
|
|
2245
|
+
x: n,
|
|
2246
|
+
y: o
|
|
2247
|
+
}, u = await We(t, d), f = re(ue(r)), v = gn(f);
|
|
2248
|
+
let h = l[v], w = l[f];
|
|
2249
|
+
if (i) {
|
|
2250
|
+
const g = v === "y" ? "top" : "left", y = v === "y" ? "bottom" : "right", C = h + u[g], b = h - u[y];
|
|
2251
|
+
h = qt(C, h, b);
|
|
2252
|
+
}
|
|
2253
|
+
if (c) {
|
|
2254
|
+
const g = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", C = w + u[g], b = w - u[y];
|
|
2255
|
+
w = qt(C, w, b);
|
|
2256
|
+
}
|
|
2257
|
+
const m = a.fn({
|
|
2258
|
+
...t,
|
|
2259
|
+
[v]: h,
|
|
2260
|
+
[f]: w
|
|
2261
|
+
});
|
|
2262
|
+
return {
|
|
2263
|
+
...m,
|
|
2264
|
+
data: {
|
|
2265
|
+
x: m.x - n,
|
|
2266
|
+
y: m.y - o,
|
|
2267
|
+
enabled: {
|
|
2268
|
+
[v]: i,
|
|
2269
|
+
[f]: c
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
}, ka = function(e) {
|
|
2276
|
+
return e === void 0 && (e = {}), {
|
|
2277
|
+
options: e,
|
|
2278
|
+
fn(t) {
|
|
2279
|
+
const {
|
|
2280
|
+
x: n,
|
|
2281
|
+
y: o,
|
|
2282
|
+
placement: r,
|
|
2283
|
+
rects: i,
|
|
2284
|
+
middlewareData: c
|
|
2285
|
+
} = t, {
|
|
2286
|
+
offset: a = 0,
|
|
2287
|
+
mainAxis: d = !0,
|
|
2288
|
+
crossAxis: l = !0
|
|
2289
|
+
} = le(e, t), u = {
|
|
2290
|
+
x: n,
|
|
2291
|
+
y: o
|
|
2292
|
+
}, f = re(r), v = gn(f);
|
|
2293
|
+
let h = u[v], w = u[f];
|
|
2294
|
+
const m = le(a, t), g = typeof m == "number" ? {
|
|
2295
|
+
mainAxis: m,
|
|
2296
|
+
crossAxis: 0
|
|
2297
|
+
} : {
|
|
2298
|
+
mainAxis: 0,
|
|
2299
|
+
crossAxis: 0,
|
|
2300
|
+
...m
|
|
2301
|
+
};
|
|
2302
|
+
if (d) {
|
|
2303
|
+
const b = v === "y" ? "height" : "width", x = i.reference[v] - i.floating[b] + g.mainAxis, E = i.reference[v] + i.reference[b] - g.mainAxis;
|
|
2304
|
+
h < x ? h = x : h > E && (h = E);
|
|
2305
|
+
}
|
|
2306
|
+
if (l) {
|
|
2307
|
+
var y, C;
|
|
2308
|
+
const b = v === "y" ? "width" : "height", x = rr.has(ue(r)), E = i.reference[f] - i.floating[b] + (x && ((y = c.offset) == null ? void 0 : y[f]) || 0) + (x ? 0 : g.crossAxis), T = i.reference[f] + i.reference[b] + (x ? 0 : ((C = c.offset) == null ? void 0 : C[f]) || 0) - (x ? g.crossAxis : 0);
|
|
2309
|
+
w < E ? w = E : w > T && (w = T);
|
|
2310
|
+
}
|
|
2311
|
+
return {
|
|
2312
|
+
[v]: h,
|
|
2313
|
+
[f]: w
|
|
2314
|
+
};
|
|
2315
|
+
}
|
|
2316
|
+
};
|
|
2317
|
+
}, La = function(e) {
|
|
2318
|
+
return e === void 0 && (e = {}), {
|
|
2319
|
+
name: "size",
|
|
2320
|
+
options: e,
|
|
2321
|
+
async fn(t) {
|
|
2322
|
+
var n, o;
|
|
2323
|
+
const {
|
|
2324
|
+
placement: r,
|
|
2325
|
+
rects: i,
|
|
2326
|
+
platform: c,
|
|
2327
|
+
elements: a
|
|
2328
|
+
} = t, {
|
|
2329
|
+
apply: d = () => {
|
|
2330
|
+
},
|
|
2331
|
+
...l
|
|
2332
|
+
} = le(e, t), u = await We(t, l), f = ue(r), v = Ie(r), h = re(r) === "y", {
|
|
2333
|
+
width: w,
|
|
2334
|
+
height: m
|
|
2335
|
+
} = i.floating;
|
|
2336
|
+
let g, y;
|
|
2337
|
+
f === "top" || f === "bottom" ? (g = f, y = v === (await (c.isRTL == null ? void 0 : c.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = f, g = v === "end" ? "top" : "bottom");
|
|
2338
|
+
const C = m - u.top - u.bottom, b = w - u.left - u.right, x = ve(m - u[g], C), E = ve(w - u[y], b), T = !t.middlewareData.shift;
|
|
2339
|
+
let R = x, M = E;
|
|
2340
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = b), (o = t.middlewareData.shift) != null && o.enabled.y && (R = C), T && !v) {
|
|
2341
|
+
const D = z(u.left, 0), k = z(u.right, 0), B = z(u.top, 0), L = z(u.bottom, 0);
|
|
2342
|
+
h ? M = w - 2 * (D !== 0 || k !== 0 ? D + k : z(u.left, u.right)) : R = m - 2 * (B !== 0 || L !== 0 ? B + L : z(u.top, u.bottom));
|
|
2343
|
+
}
|
|
2344
|
+
await d({
|
|
2345
|
+
...t,
|
|
2346
|
+
availableWidth: M,
|
|
2347
|
+
availableHeight: R
|
|
2348
|
+
});
|
|
2349
|
+
const N = await c.getDimensions(a.floating);
|
|
2350
|
+
return w !== N.width || m !== N.height ? {
|
|
2351
|
+
reset: {
|
|
2352
|
+
rects: !0
|
|
2353
|
+
}
|
|
2354
|
+
} : {};
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
};
|
|
2358
|
+
function Tt() {
|
|
2359
|
+
return typeof window < "u";
|
|
2360
|
+
}
|
|
2361
|
+
function ke(e) {
|
|
2362
|
+
return ir(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
2363
|
+
}
|
|
2364
|
+
function j(e) {
|
|
2365
|
+
var t;
|
|
2366
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
2367
|
+
}
|
|
2368
|
+
function ce(e) {
|
|
2369
|
+
var t;
|
|
2370
|
+
return (t = (ir(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
2371
|
+
}
|
|
2372
|
+
function ir(e) {
|
|
2373
|
+
return Tt() ? e instanceof Node || e instanceof j(e).Node : !1;
|
|
2374
|
+
}
|
|
2375
|
+
function J(e) {
|
|
2376
|
+
return Tt() ? e instanceof Element || e instanceof j(e).Element : !1;
|
|
2377
|
+
}
|
|
2378
|
+
function se(e) {
|
|
2379
|
+
return Tt() ? e instanceof HTMLElement || e instanceof j(e).HTMLElement : !1;
|
|
2380
|
+
}
|
|
2381
|
+
function ro(e) {
|
|
2382
|
+
return !Tt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof j(e).ShadowRoot;
|
|
2383
|
+
}
|
|
2384
|
+
const Fa = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
2385
|
+
function Ye(e) {
|
|
2386
|
+
const {
|
|
2387
|
+
overflow: t,
|
|
2388
|
+
overflowX: n,
|
|
2389
|
+
overflowY: o,
|
|
2390
|
+
display: r
|
|
2391
|
+
} = ee(e);
|
|
2392
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !Fa.has(r);
|
|
2393
|
+
}
|
|
2394
|
+
const $a = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
2395
|
+
function Ba(e) {
|
|
2396
|
+
return $a.has(ke(e));
|
|
2397
|
+
}
|
|
2398
|
+
const Wa = [":popover-open", ":modal"];
|
|
2399
|
+
function St(e) {
|
|
2400
|
+
return Wa.some((t) => {
|
|
2401
|
+
try {
|
|
2402
|
+
return e.matches(t);
|
|
2403
|
+
} catch {
|
|
2404
|
+
return !1;
|
|
2405
|
+
}
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
const Ha = ["transform", "translate", "scale", "rotate", "perspective"], Va = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Ka = ["paint", "layout", "strict", "content"];
|
|
2409
|
+
function Cn(e) {
|
|
2410
|
+
const t = bn(), n = J(e) ? ee(e) : e;
|
|
2411
|
+
return Ha.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Va.some((o) => (n.willChange || "").includes(o)) || Ka.some((o) => (n.contain || "").includes(o));
|
|
2412
|
+
}
|
|
2413
|
+
function Ua(e) {
|
|
2414
|
+
let t = he(e);
|
|
2415
|
+
for (; se(t) && !Oe(t); ) {
|
|
2416
|
+
if (Cn(t))
|
|
2417
|
+
return t;
|
|
2418
|
+
if (St(t))
|
|
2419
|
+
return null;
|
|
2420
|
+
t = he(t);
|
|
2421
|
+
}
|
|
2422
|
+
return null;
|
|
2423
|
+
}
|
|
2424
|
+
function bn() {
|
|
2425
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2426
|
+
}
|
|
2427
|
+
const Ga = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2428
|
+
function Oe(e) {
|
|
2429
|
+
return Ga.has(ke(e));
|
|
2430
|
+
}
|
|
2431
|
+
function ee(e) {
|
|
2432
|
+
return j(e).getComputedStyle(e);
|
|
2433
|
+
}
|
|
2434
|
+
function Pt(e) {
|
|
2435
|
+
return J(e) ? {
|
|
2436
|
+
scrollLeft: e.scrollLeft,
|
|
2437
|
+
scrollTop: e.scrollTop
|
|
2438
|
+
} : {
|
|
2439
|
+
scrollLeft: e.scrollX,
|
|
2440
|
+
scrollTop: e.scrollY
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2443
|
+
function he(e) {
|
|
2444
|
+
if (ke(e) === "html")
|
|
2445
|
+
return e;
|
|
2446
|
+
const t = (
|
|
2447
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
2448
|
+
e.assignedSlot || // DOM Element detected.
|
|
2449
|
+
e.parentNode || // ShadowRoot detected.
|
|
2450
|
+
ro(e) && e.host || // Fallback.
|
|
2451
|
+
ce(e)
|
|
2452
|
+
);
|
|
2453
|
+
return ro(t) ? t.host : t;
|
|
2454
|
+
}
|
|
2455
|
+
function sr(e) {
|
|
2456
|
+
const t = he(e);
|
|
2457
|
+
return Oe(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) && Ye(t) ? t : sr(t);
|
|
2458
|
+
}
|
|
2459
|
+
function He(e, t, n) {
|
|
2460
|
+
var o;
|
|
2461
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
2462
|
+
const r = sr(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), c = j(r);
|
|
2463
|
+
if (i) {
|
|
2464
|
+
const a = Qt(c);
|
|
2465
|
+
return t.concat(c, c.visualViewport || [], Ye(r) ? r : [], a && n ? He(a) : []);
|
|
2466
|
+
}
|
|
2467
|
+
return t.concat(r, He(r, [], n));
|
|
2468
|
+
}
|
|
2469
|
+
function Qt(e) {
|
|
2470
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
2471
|
+
}
|
|
2472
|
+
function cr(e) {
|
|
2473
|
+
const t = ee(e);
|
|
2474
|
+
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
2475
|
+
const r = se(e), i = r ? e.offsetWidth : n, c = r ? e.offsetHeight : o, a = mt(n) !== i || mt(o) !== c;
|
|
2476
|
+
return a && (n = i, o = c), {
|
|
2477
|
+
width: n,
|
|
2478
|
+
height: o,
|
|
2479
|
+
$: a
|
|
2480
|
+
};
|
|
2481
|
+
}
|
|
2482
|
+
function xn(e) {
|
|
2483
|
+
return J(e) ? e : e.contextElement;
|
|
2484
|
+
}
|
|
2485
|
+
function Ae(e) {
|
|
2486
|
+
const t = xn(e);
|
|
2487
|
+
if (!se(t))
|
|
2488
|
+
return ie(1);
|
|
2489
|
+
const n = t.getBoundingClientRect(), {
|
|
2490
|
+
width: o,
|
|
2491
|
+
height: r,
|
|
2492
|
+
$: i
|
|
2493
|
+
} = cr(t);
|
|
2494
|
+
let c = (i ? mt(n.width) : n.width) / o, a = (i ? mt(n.height) : n.height) / r;
|
|
2495
|
+
return (!c || !Number.isFinite(c)) && (c = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
2496
|
+
x: c,
|
|
2497
|
+
y: a
|
|
2498
|
+
};
|
|
2499
|
+
}
|
|
2500
|
+
const za = /* @__PURE__ */ ie(0);
|
|
2501
|
+
function ar(e) {
|
|
2502
|
+
const t = j(e);
|
|
2503
|
+
return !bn() || !t.visualViewport ? za : {
|
|
2504
|
+
x: t.visualViewport.offsetLeft,
|
|
2505
|
+
y: t.visualViewport.offsetTop
|
|
2506
|
+
};
|
|
2507
|
+
}
|
|
2508
|
+
function ja(e, t, n) {
|
|
2509
|
+
return t === void 0 && (t = !1), !n || t && n !== j(e) ? !1 : t;
|
|
2510
|
+
}
|
|
2511
|
+
function xe(e, t, n, o) {
|
|
2512
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2513
|
+
const r = e.getBoundingClientRect(), i = xn(e);
|
|
2514
|
+
let c = ie(1);
|
|
2515
|
+
t && (o ? J(o) && (c = Ae(o)) : c = Ae(e));
|
|
2516
|
+
const a = ja(i, n, o) ? ar(i) : ie(0);
|
|
2517
|
+
let d = (r.left + a.x) / c.x, l = (r.top + a.y) / c.y, u = r.width / c.x, f = r.height / c.y;
|
|
2518
|
+
if (i) {
|
|
2519
|
+
const v = j(i), h = o && J(o) ? j(o) : o;
|
|
2520
|
+
let w = v, m = Qt(w);
|
|
2521
|
+
for (; m && o && h !== w; ) {
|
|
2522
|
+
const g = Ae(m), y = m.getBoundingClientRect(), C = ee(m), b = y.left + (m.clientLeft + parseFloat(C.paddingLeft)) * g.x, x = y.top + (m.clientTop + parseFloat(C.paddingTop)) * g.y;
|
|
2523
|
+
d *= g.x, l *= g.y, u *= g.x, f *= g.y, d += b, l += x, w = j(m), m = Qt(w);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
return ht({
|
|
2527
|
+
width: u,
|
|
2528
|
+
height: f,
|
|
2529
|
+
x: d,
|
|
2530
|
+
y: l
|
|
2531
|
+
});
|
|
2532
|
+
}
|
|
2533
|
+
function _t(e, t) {
|
|
2534
|
+
const n = Pt(e).scrollLeft;
|
|
2535
|
+
return t ? t.left + n : xe(ce(e)).left + n;
|
|
2536
|
+
}
|
|
2537
|
+
function lr(e, t) {
|
|
2538
|
+
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - _t(e, n), r = n.top + t.scrollTop;
|
|
2539
|
+
return {
|
|
2540
|
+
x: o,
|
|
2541
|
+
y: r
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
function Ya(e) {
|
|
2545
|
+
let {
|
|
2546
|
+
elements: t,
|
|
2547
|
+
rect: n,
|
|
2548
|
+
offsetParent: o,
|
|
2549
|
+
strategy: r
|
|
2550
|
+
} = e;
|
|
2551
|
+
const i = r === "fixed", c = ce(o), a = t ? St(t.floating) : !1;
|
|
2552
|
+
if (o === c || a && i)
|
|
2553
|
+
return n;
|
|
2554
|
+
let d = {
|
|
2555
|
+
scrollLeft: 0,
|
|
2556
|
+
scrollTop: 0
|
|
2557
|
+
}, l = ie(1);
|
|
2558
|
+
const u = ie(0), f = se(o);
|
|
2559
|
+
if ((f || !f && !i) && ((ke(o) !== "body" || Ye(c)) && (d = Pt(o)), se(o))) {
|
|
2560
|
+
const h = xe(o);
|
|
2561
|
+
l = Ae(o), u.x = h.x + o.clientLeft, u.y = h.y + o.clientTop;
|
|
2562
|
+
}
|
|
2563
|
+
const v = c && !f && !i ? lr(c, d) : ie(0);
|
|
2564
|
+
return {
|
|
2565
|
+
width: n.width * l.x,
|
|
2566
|
+
height: n.height * l.y,
|
|
2567
|
+
x: n.x * l.x - d.scrollLeft * l.x + u.x + v.x,
|
|
2568
|
+
y: n.y * l.y - d.scrollTop * l.y + u.y + v.y
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
function Xa(e) {
|
|
2572
|
+
return Array.from(e.getClientRects());
|
|
2573
|
+
}
|
|
2574
|
+
function qa(e) {
|
|
2575
|
+
const t = ce(e), n = Pt(e), o = e.ownerDocument.body, r = z(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = z(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
2576
|
+
let c = -n.scrollLeft + _t(e);
|
|
2577
|
+
const a = -n.scrollTop;
|
|
2578
|
+
return ee(o).direction === "rtl" && (c += z(t.clientWidth, o.clientWidth) - r), {
|
|
2579
|
+
width: r,
|
|
2580
|
+
height: i,
|
|
2581
|
+
x: c,
|
|
2582
|
+
y: a
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
const io = 25;
|
|
2586
|
+
function Za(e, t) {
|
|
2587
|
+
const n = j(e), o = ce(e), r = n.visualViewport;
|
|
2588
|
+
let i = o.clientWidth, c = o.clientHeight, a = 0, d = 0;
|
|
2589
|
+
if (r) {
|
|
2590
|
+
i = r.width, c = r.height;
|
|
2591
|
+
const u = bn();
|
|
2592
|
+
(!u || u && t === "fixed") && (a = r.offsetLeft, d = r.offsetTop);
|
|
2593
|
+
}
|
|
2594
|
+
const l = _t(o);
|
|
2595
|
+
if (l <= 0) {
|
|
2596
|
+
const u = o.ownerDocument, f = u.body, v = getComputedStyle(f), h = u.compatMode === "CSS1Compat" && parseFloat(v.marginLeft) + parseFloat(v.marginRight) || 0, w = Math.abs(o.clientWidth - f.clientWidth - h);
|
|
2597
|
+
w <= io && (i -= w);
|
|
2598
|
+
} else l <= io && (i += l);
|
|
2599
|
+
return {
|
|
2600
|
+
width: i,
|
|
2601
|
+
height: c,
|
|
2602
|
+
x: a,
|
|
2603
|
+
y: d
|
|
2604
|
+
};
|
|
2605
|
+
}
|
|
2606
|
+
const Qa = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
2607
|
+
function Ja(e, t) {
|
|
2608
|
+
const n = xe(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = se(e) ? Ae(e) : ie(1), c = e.clientWidth * i.x, a = e.clientHeight * i.y, d = r * i.x, l = o * i.y;
|
|
2609
|
+
return {
|
|
2610
|
+
width: c,
|
|
2611
|
+
height: a,
|
|
2612
|
+
x: d,
|
|
2613
|
+
y: l
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
function so(e, t, n) {
|
|
2617
|
+
let o;
|
|
2618
|
+
if (t === "viewport")
|
|
2619
|
+
o = Za(e, n);
|
|
2620
|
+
else if (t === "document")
|
|
2621
|
+
o = qa(ce(e));
|
|
2622
|
+
else if (J(t))
|
|
2623
|
+
o = Ja(t, n);
|
|
2624
|
+
else {
|
|
2625
|
+
const r = ar(e);
|
|
2626
|
+
o = {
|
|
2627
|
+
x: t.x - r.x,
|
|
2628
|
+
y: t.y - r.y,
|
|
2629
|
+
width: t.width,
|
|
2630
|
+
height: t.height
|
|
2631
|
+
};
|
|
2632
|
+
}
|
|
2633
|
+
return ht(o);
|
|
2634
|
+
}
|
|
2635
|
+
function ur(e, t) {
|
|
2636
|
+
const n = he(e);
|
|
2637
|
+
return n === t || !J(n) || Oe(n) ? !1 : ee(n).position === "fixed" || ur(n, t);
|
|
2638
|
+
}
|
|
2639
|
+
function el(e, t) {
|
|
2640
|
+
const n = t.get(e);
|
|
2641
|
+
if (n)
|
|
2642
|
+
return n;
|
|
2643
|
+
let o = He(e, [], !1).filter((a) => J(a) && ke(a) !== "body"), r = null;
|
|
2644
|
+
const i = ee(e).position === "fixed";
|
|
2645
|
+
let c = i ? he(e) : e;
|
|
2646
|
+
for (; J(c) && !Oe(c); ) {
|
|
2647
|
+
const a = ee(c), d = Cn(c);
|
|
2648
|
+
!d && a.position === "fixed" && (r = null), (i ? !d && !r : !d && a.position === "static" && !!r && Qa.has(r.position) || Ye(c) && !d && ur(e, c)) ? o = o.filter((u) => u !== c) : r = a, c = he(c);
|
|
2649
|
+
}
|
|
2650
|
+
return t.set(e, o), o;
|
|
2651
|
+
}
|
|
2652
|
+
function tl(e) {
|
|
2653
|
+
let {
|
|
2654
|
+
element: t,
|
|
2655
|
+
boundary: n,
|
|
2656
|
+
rootBoundary: o,
|
|
2657
|
+
strategy: r
|
|
2658
|
+
} = e;
|
|
2659
|
+
const c = [...n === "clippingAncestors" ? St(t) ? [] : el(t, this._c) : [].concat(n), o], a = c[0], d = c.reduce((l, u) => {
|
|
2660
|
+
const f = so(t, u, r);
|
|
2661
|
+
return l.top = z(f.top, l.top), l.right = ve(f.right, l.right), l.bottom = ve(f.bottom, l.bottom), l.left = z(f.left, l.left), l;
|
|
2662
|
+
}, so(t, a, r));
|
|
2663
|
+
return {
|
|
2664
|
+
width: d.right - d.left,
|
|
2665
|
+
height: d.bottom - d.top,
|
|
2666
|
+
x: d.left,
|
|
2667
|
+
y: d.top
|
|
2668
|
+
};
|
|
2669
|
+
}
|
|
2670
|
+
function nl(e) {
|
|
2671
|
+
const {
|
|
2672
|
+
width: t,
|
|
2673
|
+
height: n
|
|
2674
|
+
} = cr(e);
|
|
2675
|
+
return {
|
|
2676
|
+
width: t,
|
|
2677
|
+
height: n
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
function ol(e, t, n) {
|
|
2681
|
+
const o = se(t), r = ce(t), i = n === "fixed", c = xe(e, !0, i, t);
|
|
2682
|
+
let a = {
|
|
2683
|
+
scrollLeft: 0,
|
|
2684
|
+
scrollTop: 0
|
|
2685
|
+
};
|
|
2686
|
+
const d = ie(0);
|
|
2687
|
+
function l() {
|
|
2688
|
+
d.x = _t(r);
|
|
2689
|
+
}
|
|
2690
|
+
if (o || !o && !i)
|
|
2691
|
+
if ((ke(t) !== "body" || Ye(r)) && (a = Pt(t)), o) {
|
|
2692
|
+
const h = xe(t, !0, i, t);
|
|
2693
|
+
d.x = h.x + t.clientLeft, d.y = h.y + t.clientTop;
|
|
2694
|
+
} else r && l();
|
|
2695
|
+
i && !o && r && l();
|
|
2696
|
+
const u = r && !o && !i ? lr(r, a) : ie(0), f = c.left + a.scrollLeft - d.x - u.x, v = c.top + a.scrollTop - d.y - u.y;
|
|
2697
|
+
return {
|
|
2698
|
+
x: f,
|
|
2699
|
+
y: v,
|
|
2700
|
+
width: c.width,
|
|
2701
|
+
height: c.height
|
|
2702
|
+
};
|
|
2703
|
+
}
|
|
2704
|
+
function Ut(e) {
|
|
2705
|
+
return ee(e).position === "static";
|
|
2706
|
+
}
|
|
2707
|
+
function co(e, t) {
|
|
2708
|
+
if (!se(e) || ee(e).position === "fixed")
|
|
2709
|
+
return null;
|
|
2710
|
+
if (t)
|
|
2711
|
+
return t(e);
|
|
2712
|
+
let n = e.offsetParent;
|
|
2713
|
+
return ce(e) === n && (n = n.ownerDocument.body), n;
|
|
2714
|
+
}
|
|
2715
|
+
function dr(e, t) {
|
|
2716
|
+
const n = j(e);
|
|
2717
|
+
if (St(e))
|
|
2718
|
+
return n;
|
|
2719
|
+
if (!se(e)) {
|
|
2720
|
+
let r = he(e);
|
|
2721
|
+
for (; r && !Oe(r); ) {
|
|
2722
|
+
if (J(r) && !Ut(r))
|
|
2723
|
+
return r;
|
|
2724
|
+
r = he(r);
|
|
2725
|
+
}
|
|
2726
|
+
return n;
|
|
2727
|
+
}
|
|
2728
|
+
let o = co(e, t);
|
|
2729
|
+
for (; o && Ba(o) && Ut(o); )
|
|
2730
|
+
o = co(o, t);
|
|
2731
|
+
return o && Oe(o) && Ut(o) && !Cn(o) ? n : o || Ua(e) || n;
|
|
2732
|
+
}
|
|
2733
|
+
const rl = async function(e) {
|
|
2734
|
+
const t = this.getOffsetParent || dr, n = this.getDimensions, o = await n(e.floating);
|
|
2735
|
+
return {
|
|
2736
|
+
reference: ol(e.reference, await t(e.floating), e.strategy),
|
|
2737
|
+
floating: {
|
|
2738
|
+
x: 0,
|
|
2739
|
+
y: 0,
|
|
2740
|
+
width: o.width,
|
|
2741
|
+
height: o.height
|
|
2742
|
+
}
|
|
2743
|
+
};
|
|
2744
|
+
};
|
|
2745
|
+
function il(e) {
|
|
2746
|
+
return ee(e).direction === "rtl";
|
|
2747
|
+
}
|
|
2748
|
+
const sl = {
|
|
2749
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ya,
|
|
2750
|
+
getDocumentElement: ce,
|
|
2751
|
+
getClippingRect: tl,
|
|
2752
|
+
getOffsetParent: dr,
|
|
2753
|
+
getElementRects: rl,
|
|
2754
|
+
getClientRects: Xa,
|
|
2755
|
+
getDimensions: nl,
|
|
2756
|
+
getScale: Ae,
|
|
2757
|
+
isElement: J,
|
|
2758
|
+
isRTL: il
|
|
2759
|
+
};
|
|
2760
|
+
function fr(e, t) {
|
|
2761
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
2762
|
+
}
|
|
2763
|
+
function cl(e, t) {
|
|
2764
|
+
let n = null, o;
|
|
2765
|
+
const r = ce(e);
|
|
2766
|
+
function i() {
|
|
2767
|
+
var a;
|
|
2768
|
+
clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
|
|
2769
|
+
}
|
|
2770
|
+
function c(a, d) {
|
|
2771
|
+
a === void 0 && (a = !1), d === void 0 && (d = 1), i();
|
|
2772
|
+
const l = e.getBoundingClientRect(), {
|
|
2773
|
+
left: u,
|
|
2774
|
+
top: f,
|
|
2775
|
+
width: v,
|
|
2776
|
+
height: h
|
|
2777
|
+
} = l;
|
|
2778
|
+
if (a || t(), !v || !h)
|
|
2779
|
+
return;
|
|
2780
|
+
const w = at(f), m = at(r.clientWidth - (u + v)), g = at(r.clientHeight - (f + h)), y = at(u), b = {
|
|
2781
|
+
rootMargin: -w + "px " + -m + "px " + -g + "px " + -y + "px",
|
|
2782
|
+
threshold: z(0, ve(1, d)) || 1
|
|
2783
|
+
};
|
|
2784
|
+
let x = !0;
|
|
2785
|
+
function E(T) {
|
|
2786
|
+
const R = T[0].intersectionRatio;
|
|
2787
|
+
if (R !== d) {
|
|
2788
|
+
if (!x)
|
|
2789
|
+
return c();
|
|
2790
|
+
R ? c(!1, R) : o = setTimeout(() => {
|
|
2791
|
+
c(!1, 1e-7);
|
|
2792
|
+
}, 1e3);
|
|
2793
|
+
}
|
|
2794
|
+
R === 1 && !fr(l, e.getBoundingClientRect()) && c(), x = !1;
|
|
2795
|
+
}
|
|
2796
|
+
try {
|
|
2797
|
+
n = new IntersectionObserver(E, {
|
|
2798
|
+
...b,
|
|
2799
|
+
// Handle <iframe>s
|
|
2800
|
+
root: r.ownerDocument
|
|
2801
|
+
});
|
|
2802
|
+
} catch {
|
|
2803
|
+
n = new IntersectionObserver(E, b);
|
|
2804
|
+
}
|
|
2805
|
+
n.observe(e);
|
|
2806
|
+
}
|
|
2807
|
+
return c(!0), i;
|
|
2808
|
+
}
|
|
2809
|
+
function al(e, t, n, o) {
|
|
2810
|
+
o === void 0 && (o = {});
|
|
2811
|
+
const {
|
|
2812
|
+
ancestorScroll: r = !0,
|
|
2813
|
+
ancestorResize: i = !0,
|
|
2814
|
+
elementResize: c = typeof ResizeObserver == "function",
|
|
2815
|
+
layoutShift: a = typeof IntersectionObserver == "function",
|
|
2816
|
+
animationFrame: d = !1
|
|
2817
|
+
} = o, l = xn(e), u = r || i ? [...l ? He(l) : [], ...He(t)] : [];
|
|
2818
|
+
u.forEach((y) => {
|
|
2819
|
+
r && y.addEventListener("scroll", n, {
|
|
2820
|
+
passive: !0
|
|
2821
|
+
}), i && y.addEventListener("resize", n);
|
|
2822
|
+
});
|
|
2823
|
+
const f = l && a ? cl(l, n) : null;
|
|
2824
|
+
let v = -1, h = null;
|
|
2825
|
+
c && (h = new ResizeObserver((y) => {
|
|
2826
|
+
let [C] = y;
|
|
2827
|
+
C && C.target === l && h && (h.unobserve(t), cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
2828
|
+
var b;
|
|
2829
|
+
(b = h) == null || b.observe(t);
|
|
2830
|
+
})), n();
|
|
2831
|
+
}), l && !d && h.observe(l), h.observe(t));
|
|
2832
|
+
let w, m = d ? xe(e) : null;
|
|
2833
|
+
d && g();
|
|
2834
|
+
function g() {
|
|
2835
|
+
const y = xe(e);
|
|
2836
|
+
m && !fr(m, y) && n(), m = y, w = requestAnimationFrame(g);
|
|
2837
|
+
}
|
|
2838
|
+
return n(), () => {
|
|
2839
|
+
var y;
|
|
2840
|
+
u.forEach((C) => {
|
|
2841
|
+
r && C.removeEventListener("scroll", n), i && C.removeEventListener("resize", n);
|
|
2842
|
+
}), f?.(), (y = h) == null || y.disconnect(), h = null, d && cancelAnimationFrame(w);
|
|
2843
|
+
};
|
|
2844
|
+
}
|
|
2845
|
+
const ll = Na, ul = Ia, dl = Aa, fl = La, pl = Oa, ao = Ma, ml = ka, vl = (e, t, n) => {
|
|
2846
|
+
const o = /* @__PURE__ */ new Map(), r = {
|
|
2847
|
+
platform: sl,
|
|
2848
|
+
...n
|
|
2849
|
+
}, i = {
|
|
2850
|
+
...r.platform,
|
|
2851
|
+
_c: o
|
|
2852
|
+
};
|
|
2853
|
+
return _a(e, t, {
|
|
2854
|
+
...r,
|
|
2855
|
+
platform: i
|
|
2856
|
+
});
|
|
2857
|
+
};
|
|
2858
|
+
var hl = typeof document < "u", gl = function() {
|
|
2859
|
+
}, ft = hl ? Bi : gl;
|
|
2860
|
+
function gt(e, t) {
|
|
2861
|
+
if (e === t)
|
|
2862
|
+
return !0;
|
|
2863
|
+
if (typeof e != typeof t)
|
|
2864
|
+
return !1;
|
|
2865
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
2866
|
+
return !0;
|
|
2867
|
+
let n, o, r;
|
|
2868
|
+
if (e && t && typeof e == "object") {
|
|
2869
|
+
if (Array.isArray(e)) {
|
|
2870
|
+
if (n = e.length, n !== t.length) return !1;
|
|
2871
|
+
for (o = n; o-- !== 0; )
|
|
2872
|
+
if (!gt(e[o], t[o]))
|
|
2873
|
+
return !1;
|
|
2874
|
+
return !0;
|
|
2875
|
+
}
|
|
2876
|
+
if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
|
|
2877
|
+
return !1;
|
|
2878
|
+
for (o = n; o-- !== 0; )
|
|
2879
|
+
if (!{}.hasOwnProperty.call(t, r[o]))
|
|
2880
|
+
return !1;
|
|
2881
|
+
for (o = n; o-- !== 0; ) {
|
|
2882
|
+
const i = r[o];
|
|
2883
|
+
if (!(i === "_owner" && e.$$typeof) && !gt(e[i], t[i]))
|
|
2884
|
+
return !1;
|
|
2885
|
+
}
|
|
2886
|
+
return !0;
|
|
2887
|
+
}
|
|
2888
|
+
return e !== e && t !== t;
|
|
2889
|
+
}
|
|
2890
|
+
function pr(e) {
|
|
2891
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
2892
|
+
}
|
|
2893
|
+
function lo(e, t) {
|
|
2894
|
+
const n = pr(e);
|
|
2895
|
+
return Math.round(t * n) / n;
|
|
2896
|
+
}
|
|
2897
|
+
function Gt(e) {
|
|
2898
|
+
const t = s.useRef(e);
|
|
2899
|
+
return ft(() => {
|
|
2900
|
+
t.current = e;
|
|
2901
|
+
}), t;
|
|
2902
|
+
}
|
|
2903
|
+
function wl(e) {
|
|
2904
|
+
e === void 0 && (e = {});
|
|
2905
|
+
const {
|
|
2906
|
+
placement: t = "bottom",
|
|
2907
|
+
strategy: n = "absolute",
|
|
2908
|
+
middleware: o = [],
|
|
2909
|
+
platform: r,
|
|
2910
|
+
elements: {
|
|
2911
|
+
reference: i,
|
|
2912
|
+
floating: c
|
|
2913
|
+
} = {},
|
|
2914
|
+
transform: a = !0,
|
|
2915
|
+
whileElementsMounted: d,
|
|
2916
|
+
open: l
|
|
2917
|
+
} = e, [u, f] = s.useState({
|
|
2918
|
+
x: 0,
|
|
2919
|
+
y: 0,
|
|
2920
|
+
strategy: n,
|
|
2921
|
+
placement: t,
|
|
2922
|
+
middlewareData: {},
|
|
2923
|
+
isPositioned: !1
|
|
2924
|
+
}), [v, h] = s.useState(o);
|
|
2925
|
+
gt(v, o) || h(o);
|
|
2926
|
+
const [w, m] = s.useState(null), [g, y] = s.useState(null), C = s.useCallback((A) => {
|
|
2927
|
+
A !== T.current && (T.current = A, m(A));
|
|
2928
|
+
}, []), b = s.useCallback((A) => {
|
|
2929
|
+
A !== R.current && (R.current = A, y(A));
|
|
2930
|
+
}, []), x = i || w, E = c || g, T = s.useRef(null), R = s.useRef(null), M = s.useRef(u), N = d != null, D = Gt(d), k = Gt(r), B = Gt(l), L = s.useCallback(() => {
|
|
2931
|
+
if (!T.current || !R.current)
|
|
2932
|
+
return;
|
|
2933
|
+
const A = {
|
|
2934
|
+
placement: t,
|
|
2935
|
+
strategy: n,
|
|
2936
|
+
middleware: v
|
|
2937
|
+
};
|
|
2938
|
+
k.current && (A.platform = k.current), vl(T.current, R.current, A).then((S) => {
|
|
2939
|
+
const H = {
|
|
2940
|
+
...S,
|
|
2941
|
+
// The floating element's position may be recomputed while it's closed
|
|
2942
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
2943
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
2944
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
2945
|
+
isPositioned: B.current !== !1
|
|
2946
|
+
};
|
|
2947
|
+
P.current && !gt(M.current, H) && (M.current = H, an.flushSync(() => {
|
|
2948
|
+
f(H);
|
|
2949
|
+
}));
|
|
2950
|
+
});
|
|
2951
|
+
}, [v, t, n, k, B]);
|
|
2952
|
+
ft(() => {
|
|
2953
|
+
l === !1 && M.current.isPositioned && (M.current.isPositioned = !1, f((A) => ({
|
|
2954
|
+
...A,
|
|
2955
|
+
isPositioned: !1
|
|
2956
|
+
})));
|
|
2957
|
+
}, [l]);
|
|
2958
|
+
const P = s.useRef(!1);
|
|
2959
|
+
ft(() => (P.current = !0, () => {
|
|
2960
|
+
P.current = !1;
|
|
2961
|
+
}), []), ft(() => {
|
|
2962
|
+
if (x && (T.current = x), E && (R.current = E), x && E) {
|
|
2963
|
+
if (D.current)
|
|
2964
|
+
return D.current(x, E, L);
|
|
2965
|
+
L();
|
|
2966
|
+
}
|
|
2967
|
+
}, [x, E, L, D, N]);
|
|
2968
|
+
const F = s.useMemo(() => ({
|
|
2969
|
+
reference: T,
|
|
2970
|
+
floating: R,
|
|
2971
|
+
setReference: C,
|
|
2972
|
+
setFloating: b
|
|
2973
|
+
}), [C, b]), O = s.useMemo(() => ({
|
|
2974
|
+
reference: x,
|
|
2975
|
+
floating: E
|
|
2976
|
+
}), [x, E]), $ = s.useMemo(() => {
|
|
2977
|
+
const A = {
|
|
2978
|
+
position: n,
|
|
2979
|
+
left: 0,
|
|
2980
|
+
top: 0
|
|
2981
|
+
};
|
|
2982
|
+
if (!O.floating)
|
|
2983
|
+
return A;
|
|
2984
|
+
const S = lo(O.floating, u.x), H = lo(O.floating, u.y);
|
|
2985
|
+
return a ? {
|
|
2986
|
+
...A,
|
|
2987
|
+
transform: "translate(" + S + "px, " + H + "px)",
|
|
2988
|
+
...pr(O.floating) >= 1.5 && {
|
|
2989
|
+
willChange: "transform"
|
|
2990
|
+
}
|
|
2991
|
+
} : {
|
|
2992
|
+
position: n,
|
|
2993
|
+
left: S,
|
|
2994
|
+
top: H
|
|
2995
|
+
};
|
|
2996
|
+
}, [n, a, O.floating, u.x, u.y]);
|
|
2997
|
+
return s.useMemo(() => ({
|
|
2998
|
+
...u,
|
|
2999
|
+
update: L,
|
|
3000
|
+
refs: F,
|
|
3001
|
+
elements: O,
|
|
3002
|
+
floatingStyles: $
|
|
3003
|
+
}), [u, L, F, O, $]);
|
|
3004
|
+
}
|
|
3005
|
+
const yl = (e) => {
|
|
3006
|
+
function t(n) {
|
|
3007
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
3008
|
+
}
|
|
3009
|
+
return {
|
|
3010
|
+
name: "arrow",
|
|
3011
|
+
options: e,
|
|
3012
|
+
fn(n) {
|
|
3013
|
+
const {
|
|
3014
|
+
element: o,
|
|
3015
|
+
padding: r
|
|
3016
|
+
} = typeof e == "function" ? e(n) : e;
|
|
3017
|
+
return o && t(o) ? o.current != null ? ao({
|
|
3018
|
+
element: o.current,
|
|
3019
|
+
padding: r
|
|
3020
|
+
}).fn(n) : {} : o ? ao({
|
|
3021
|
+
element: o,
|
|
3022
|
+
padding: r
|
|
3023
|
+
}).fn(n) : {};
|
|
3024
|
+
}
|
|
3025
|
+
};
|
|
3026
|
+
}, Cl = (e, t) => ({
|
|
3027
|
+
...ll(e),
|
|
3028
|
+
options: [e, t]
|
|
3029
|
+
}), bl = (e, t) => ({
|
|
3030
|
+
...ul(e),
|
|
3031
|
+
options: [e, t]
|
|
3032
|
+
}), xl = (e, t) => ({
|
|
3033
|
+
...ml(e),
|
|
3034
|
+
options: [e, t]
|
|
3035
|
+
}), El = (e, t) => ({
|
|
3036
|
+
...dl(e),
|
|
3037
|
+
options: [e, t]
|
|
3038
|
+
}), Rl = (e, t) => ({
|
|
3039
|
+
...fl(e),
|
|
3040
|
+
options: [e, t]
|
|
3041
|
+
}), Tl = (e, t) => ({
|
|
3042
|
+
...pl(e),
|
|
3043
|
+
options: [e, t]
|
|
3044
|
+
}), Sl = (e, t) => ({
|
|
3045
|
+
...yl(e),
|
|
3046
|
+
options: [e, t]
|
|
3047
|
+
});
|
|
3048
|
+
var Pl = "Arrow", mr = s.forwardRef((e, t) => {
|
|
3049
|
+
const { children: n, width: o = 10, height: r = 5, ...i } = e;
|
|
3050
|
+
return /* @__PURE__ */ p(
|
|
3051
|
+
I.svg,
|
|
3052
|
+
{
|
|
3053
|
+
...i,
|
|
3054
|
+
ref: t,
|
|
3055
|
+
width: o,
|
|
3056
|
+
height: r,
|
|
3057
|
+
viewBox: "0 0 30 10",
|
|
3058
|
+
preserveAspectRatio: "none",
|
|
3059
|
+
children: e.asChild ? n : /* @__PURE__ */ p("polygon", { points: "0,0 30,0 15,10" })
|
|
3060
|
+
}
|
|
3061
|
+
);
|
|
3062
|
+
});
|
|
3063
|
+
mr.displayName = Pl;
|
|
3064
|
+
var _l = mr, En = "Popper", [vr, Mt] = de(En), [Ml, hr] = vr(En), gr = (e) => {
|
|
3065
|
+
const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
|
|
3066
|
+
return /* @__PURE__ */ p(Ml, { scope: t, anchor: o, onAnchorChange: r, children: n });
|
|
3067
|
+
};
|
|
3068
|
+
gr.displayName = En;
|
|
3069
|
+
var wr = "PopperAnchor", yr = s.forwardRef(
|
|
3070
|
+
(e, t) => {
|
|
3071
|
+
const { __scopePopper: n, virtualRef: o, ...r } = e, i = hr(wr, n), c = s.useRef(null), a = W(t, c), d = s.useRef(null);
|
|
3072
|
+
return s.useEffect(() => {
|
|
3073
|
+
const l = d.current;
|
|
3074
|
+
d.current = o?.current || c.current, l !== d.current && i.onAnchorChange(d.current);
|
|
3075
|
+
}), o ? null : /* @__PURE__ */ p(I.div, { ...r, ref: a });
|
|
3076
|
+
}
|
|
3077
|
+
);
|
|
3078
|
+
yr.displayName = wr;
|
|
3079
|
+
var Rn = "PopperContent", [Al, Ol] = vr(Rn), Cr = s.forwardRef(
|
|
3080
|
+
(e, t) => {
|
|
3081
|
+
const {
|
|
3082
|
+
__scopePopper: n,
|
|
3083
|
+
side: o = "bottom",
|
|
3084
|
+
sideOffset: r = 0,
|
|
3085
|
+
align: i = "center",
|
|
3086
|
+
alignOffset: c = 0,
|
|
3087
|
+
arrowPadding: a = 0,
|
|
3088
|
+
avoidCollisions: d = !0,
|
|
3089
|
+
collisionBoundary: l = [],
|
|
3090
|
+
collisionPadding: u = 0,
|
|
3091
|
+
sticky: f = "partial",
|
|
3092
|
+
hideWhenDetached: v = !1,
|
|
3093
|
+
updatePositionStrategy: h = "optimized",
|
|
3094
|
+
onPlaced: w,
|
|
3095
|
+
...m
|
|
3096
|
+
} = e, g = hr(Rn, n), [y, C] = s.useState(null), b = W(t, (V) => C(V)), [x, E] = s.useState(null), T = go(x), R = T?.width ?? 0, M = T?.height ?? 0, N = o + (i !== "center" ? "-" + i : ""), D = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, k = Array.isArray(l) ? l : [l], B = k.length > 0, L = {
|
|
3097
|
+
padding: D,
|
|
3098
|
+
boundary: k.filter(Nl),
|
|
3099
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
3100
|
+
altBoundary: B
|
|
3101
|
+
}, { refs: P, floatingStyles: F, placement: O, isPositioned: $, middlewareData: A } = wl({
|
|
3102
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
3103
|
+
strategy: "fixed",
|
|
3104
|
+
placement: N,
|
|
3105
|
+
whileElementsMounted: (...V) => al(...V, {
|
|
3106
|
+
animationFrame: h === "always"
|
|
3107
|
+
}),
|
|
3108
|
+
elements: {
|
|
3109
|
+
reference: g.anchor
|
|
3110
|
+
},
|
|
3111
|
+
middleware: [
|
|
3112
|
+
Cl({ mainAxis: r + M, alignmentAxis: c }),
|
|
3113
|
+
d && bl({
|
|
3114
|
+
mainAxis: !0,
|
|
3115
|
+
crossAxis: !1,
|
|
3116
|
+
limiter: f === "partial" ? xl() : void 0,
|
|
3117
|
+
...L
|
|
3118
|
+
}),
|
|
3119
|
+
d && El({ ...L }),
|
|
3120
|
+
Rl({
|
|
3121
|
+
...L,
|
|
3122
|
+
apply: ({ elements: V, rects: Le, availableWidth: Ii, availableHeight: ki }) => {
|
|
3123
|
+
const { width: Li, height: Fi } = Le.reference, tt = V.floating.style;
|
|
3124
|
+
tt.setProperty("--radix-popper-available-width", `${Ii}px`), tt.setProperty("--radix-popper-available-height", `${ki}px`), tt.setProperty("--radix-popper-anchor-width", `${Li}px`), tt.setProperty("--radix-popper-anchor-height", `${Fi}px`);
|
|
3125
|
+
}
|
|
3126
|
+
}),
|
|
3127
|
+
x && Sl({ element: x, padding: a }),
|
|
3128
|
+
Il({ arrowWidth: R, arrowHeight: M }),
|
|
3129
|
+
v && Tl({ strategy: "referenceHidden", ...L })
|
|
3130
|
+
]
|
|
3131
|
+
}), [S, H] = Er(O), X = Y(w);
|
|
3132
|
+
ae(() => {
|
|
3133
|
+
$ && X?.();
|
|
3134
|
+
}, [$, X]);
|
|
3135
|
+
const Q = A.arrow?.x, ne = A.arrow?.y, fe = A.arrow?.centerOffset !== 0, [et, ge] = s.useState();
|
|
3136
|
+
return ae(() => {
|
|
3137
|
+
y && ge(window.getComputedStyle(y).zIndex);
|
|
3138
|
+
}, [y]), /* @__PURE__ */ p(
|
|
3139
|
+
"div",
|
|
3140
|
+
{
|
|
3141
|
+
ref: P.setFloating,
|
|
3142
|
+
"data-radix-popper-content-wrapper": "",
|
|
3143
|
+
style: {
|
|
3144
|
+
...F,
|
|
3145
|
+
transform: $ ? F.transform : "translate(0, -200%)",
|
|
3146
|
+
// keep off the page when measuring
|
|
3147
|
+
minWidth: "max-content",
|
|
3148
|
+
zIndex: et,
|
|
3149
|
+
"--radix-popper-transform-origin": [
|
|
3150
|
+
A.transformOrigin?.x,
|
|
3151
|
+
A.transformOrigin?.y
|
|
3152
|
+
].join(" "),
|
|
3153
|
+
// hide the content if using the hide middleware and should be hidden
|
|
3154
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
3155
|
+
// as if the PopperContent isn't there at all
|
|
3156
|
+
...A.hide?.referenceHidden && {
|
|
3157
|
+
visibility: "hidden",
|
|
3158
|
+
pointerEvents: "none"
|
|
3159
|
+
}
|
|
3160
|
+
},
|
|
3161
|
+
dir: e.dir,
|
|
3162
|
+
children: /* @__PURE__ */ p(
|
|
3163
|
+
Al,
|
|
3164
|
+
{
|
|
3165
|
+
scope: n,
|
|
3166
|
+
placedSide: S,
|
|
3167
|
+
onArrowChange: E,
|
|
3168
|
+
arrowX: Q,
|
|
3169
|
+
arrowY: ne,
|
|
3170
|
+
shouldHideArrow: fe,
|
|
3171
|
+
children: /* @__PURE__ */ p(
|
|
3172
|
+
I.div,
|
|
3173
|
+
{
|
|
3174
|
+
"data-side": S,
|
|
3175
|
+
"data-align": H,
|
|
3176
|
+
...m,
|
|
3177
|
+
ref: b,
|
|
3178
|
+
style: {
|
|
3179
|
+
...m.style,
|
|
3180
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
3181
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
3182
|
+
animation: $ ? void 0 : "none"
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
)
|
|
3186
|
+
}
|
|
3187
|
+
)
|
|
3188
|
+
}
|
|
3189
|
+
);
|
|
3190
|
+
}
|
|
3191
|
+
);
|
|
3192
|
+
Cr.displayName = Rn;
|
|
3193
|
+
var br = "PopperArrow", Dl = {
|
|
3194
|
+
top: "bottom",
|
|
3195
|
+
right: "left",
|
|
3196
|
+
bottom: "top",
|
|
3197
|
+
left: "right"
|
|
3198
|
+
}, xr = s.forwardRef(function(t, n) {
|
|
3199
|
+
const { __scopePopper: o, ...r } = t, i = Ol(br, o), c = Dl[i.placedSide];
|
|
3200
|
+
return (
|
|
3201
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
3202
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
3203
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
3204
|
+
/* @__PURE__ */ p(
|
|
3205
|
+
"span",
|
|
3206
|
+
{
|
|
3207
|
+
ref: i.onArrowChange,
|
|
3208
|
+
style: {
|
|
3209
|
+
position: "absolute",
|
|
3210
|
+
left: i.arrowX,
|
|
3211
|
+
top: i.arrowY,
|
|
3212
|
+
[c]: 0,
|
|
3213
|
+
transformOrigin: {
|
|
3214
|
+
top: "",
|
|
3215
|
+
right: "0 0",
|
|
3216
|
+
bottom: "center 0",
|
|
3217
|
+
left: "100% 0"
|
|
3218
|
+
}[i.placedSide],
|
|
3219
|
+
transform: {
|
|
3220
|
+
top: "translateY(100%)",
|
|
3221
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
3222
|
+
bottom: "rotate(180deg)",
|
|
3223
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
3224
|
+
}[i.placedSide],
|
|
3225
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
3226
|
+
},
|
|
3227
|
+
children: /* @__PURE__ */ p(
|
|
3228
|
+
_l,
|
|
3229
|
+
{
|
|
3230
|
+
...r,
|
|
3231
|
+
ref: n,
|
|
3232
|
+
style: {
|
|
3233
|
+
...r.style,
|
|
3234
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
3235
|
+
display: "block"
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
)
|
|
3239
|
+
}
|
|
3240
|
+
)
|
|
3241
|
+
);
|
|
3242
|
+
});
|
|
3243
|
+
xr.displayName = br;
|
|
3244
|
+
function Nl(e) {
|
|
3245
|
+
return e !== null;
|
|
3246
|
+
}
|
|
3247
|
+
var Il = (e) => ({
|
|
3248
|
+
name: "transformOrigin",
|
|
3249
|
+
options: e,
|
|
3250
|
+
fn(t) {
|
|
3251
|
+
const { placement: n, rects: o, middlewareData: r } = t, c = r.arrow?.centerOffset !== 0, a = c ? 0 : e.arrowWidth, d = c ? 0 : e.arrowHeight, [l, u] = Er(n), f = { start: "0%", center: "50%", end: "100%" }[u], v = (r.arrow?.x ?? 0) + a / 2, h = (r.arrow?.y ?? 0) + d / 2;
|
|
3252
|
+
let w = "", m = "";
|
|
3253
|
+
return l === "bottom" ? (w = c ? f : `${v}px`, m = `${-d}px`) : l === "top" ? (w = c ? f : `${v}px`, m = `${o.floating.height + d}px`) : l === "right" ? (w = `${-d}px`, m = c ? f : `${h}px`) : l === "left" && (w = `${o.floating.width + d}px`, m = c ? f : `${h}px`), { data: { x: w, y: m } };
|
|
3254
|
+
}
|
|
3255
|
+
});
|
|
3256
|
+
function Er(e) {
|
|
3257
|
+
const [t, n = "center"] = e.split("-");
|
|
3258
|
+
return [t, n];
|
|
3259
|
+
}
|
|
3260
|
+
var Rr = gr, Tr = yr, Sr = Cr, Pr = xr, zt = "rovingFocusGroup.onEntryFocus", kl = { bubbles: !1, cancelable: !0 }, Xe = "RovingFocusGroup", [Jt, _r, Ll] = hn(Xe), [Fl, Mr] = de(
|
|
3261
|
+
Xe,
|
|
3262
|
+
[Ll]
|
|
3263
|
+
), [$l, Bl] = Fl(Xe), Ar = s.forwardRef(
|
|
3264
|
+
(e, t) => /* @__PURE__ */ p(Jt.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ p(Jt.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ p(Wl, { ...e, ref: t }) }) })
|
|
3265
|
+
);
|
|
3266
|
+
Ar.displayName = Xe;
|
|
3267
|
+
var Wl = s.forwardRef((e, t) => {
|
|
3268
|
+
const {
|
|
3269
|
+
__scopeRovingFocusGroup: n,
|
|
3270
|
+
orientation: o,
|
|
3271
|
+
loop: r = !1,
|
|
3272
|
+
dir: i,
|
|
3273
|
+
currentTabStopId: c,
|
|
3274
|
+
defaultCurrentTabStopId: a,
|
|
3275
|
+
onCurrentTabStopIdChange: d,
|
|
3276
|
+
onEntryFocus: l,
|
|
3277
|
+
preventScrollOnEntryFocus: u = !1,
|
|
3278
|
+
...f
|
|
3279
|
+
} = e, v = s.useRef(null), h = W(t, v), w = nr(i), [m, g] = Ne({
|
|
3280
|
+
prop: c,
|
|
3281
|
+
defaultProp: a ?? null,
|
|
3282
|
+
onChange: d,
|
|
3283
|
+
caller: Xe
|
|
3284
|
+
}), [y, C] = s.useState(!1), b = Y(l), x = _r(n), E = s.useRef(!1), [T, R] = s.useState(0);
|
|
3285
|
+
return s.useEffect(() => {
|
|
3286
|
+
const M = v.current;
|
|
3287
|
+
if (M)
|
|
3288
|
+
return M.addEventListener(zt, b), () => M.removeEventListener(zt, b);
|
|
3289
|
+
}, [b]), /* @__PURE__ */ p(
|
|
3290
|
+
$l,
|
|
3291
|
+
{
|
|
3292
|
+
scope: n,
|
|
3293
|
+
orientation: o,
|
|
3294
|
+
dir: w,
|
|
3295
|
+
loop: r,
|
|
3296
|
+
currentTabStopId: m,
|
|
3297
|
+
onItemFocus: s.useCallback(
|
|
3298
|
+
(M) => g(M),
|
|
3299
|
+
[g]
|
|
3300
|
+
),
|
|
3301
|
+
onItemShiftTab: s.useCallback(() => C(!0), []),
|
|
3302
|
+
onFocusableItemAdd: s.useCallback(
|
|
3303
|
+
() => R((M) => M + 1),
|
|
3304
|
+
[]
|
|
3305
|
+
),
|
|
3306
|
+
onFocusableItemRemove: s.useCallback(
|
|
3307
|
+
() => R((M) => M - 1),
|
|
3308
|
+
[]
|
|
3309
|
+
),
|
|
3310
|
+
children: /* @__PURE__ */ p(
|
|
3311
|
+
I.div,
|
|
3312
|
+
{
|
|
3313
|
+
tabIndex: y || T === 0 ? -1 : 0,
|
|
3314
|
+
"data-orientation": o,
|
|
3315
|
+
...f,
|
|
3316
|
+
ref: h,
|
|
3317
|
+
style: { outline: "none", ...e.style },
|
|
3318
|
+
onMouseDown: _(e.onMouseDown, () => {
|
|
3319
|
+
E.current = !0;
|
|
3320
|
+
}),
|
|
3321
|
+
onFocus: _(e.onFocus, (M) => {
|
|
3322
|
+
const N = !E.current;
|
|
3323
|
+
if (M.target === M.currentTarget && N && !y) {
|
|
3324
|
+
const D = new CustomEvent(zt, kl);
|
|
3325
|
+
if (M.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
3326
|
+
const k = x().filter((O) => O.focusable), B = k.find((O) => O.active), L = k.find((O) => O.id === m), F = [B, L, ...k].filter(
|
|
3327
|
+
Boolean
|
|
3328
|
+
).map((O) => O.ref.current);
|
|
3329
|
+
Nr(F, u);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
E.current = !1;
|
|
3333
|
+
}),
|
|
3334
|
+
onBlur: _(e.onBlur, () => C(!1))
|
|
3335
|
+
}
|
|
3336
|
+
)
|
|
3337
|
+
}
|
|
3338
|
+
);
|
|
3339
|
+
}), Or = "RovingFocusGroupItem", Dr = s.forwardRef(
|
|
3340
|
+
(e, t) => {
|
|
3341
|
+
const {
|
|
3342
|
+
__scopeRovingFocusGroup: n,
|
|
3343
|
+
focusable: o = !0,
|
|
3344
|
+
active: r = !1,
|
|
3345
|
+
tabStopId: i,
|
|
3346
|
+
children: c,
|
|
3347
|
+
...a
|
|
3348
|
+
} = e, d = ye(), l = i || d, u = Bl(Or, n), f = u.currentTabStopId === l, v = _r(n), { onFocusableItemAdd: h, onFocusableItemRemove: w, currentTabStopId: m } = u;
|
|
3349
|
+
return s.useEffect(() => {
|
|
3350
|
+
if (o)
|
|
3351
|
+
return h(), () => w();
|
|
3352
|
+
}, [o, h, w]), /* @__PURE__ */ p(
|
|
3353
|
+
Jt.ItemSlot,
|
|
3354
|
+
{
|
|
3355
|
+
scope: n,
|
|
3356
|
+
id: l,
|
|
3357
|
+
focusable: o,
|
|
3358
|
+
active: r,
|
|
3359
|
+
children: /* @__PURE__ */ p(
|
|
3360
|
+
I.span,
|
|
3361
|
+
{
|
|
3362
|
+
tabIndex: f ? 0 : -1,
|
|
3363
|
+
"data-orientation": u.orientation,
|
|
3364
|
+
...a,
|
|
3365
|
+
ref: t,
|
|
3366
|
+
onMouseDown: _(e.onMouseDown, (g) => {
|
|
3367
|
+
o ? u.onItemFocus(l) : g.preventDefault();
|
|
3368
|
+
}),
|
|
3369
|
+
onFocus: _(e.onFocus, () => u.onItemFocus(l)),
|
|
3370
|
+
onKeyDown: _(e.onKeyDown, (g) => {
|
|
3371
|
+
if (g.key === "Tab" && g.shiftKey) {
|
|
3372
|
+
u.onItemShiftTab();
|
|
3373
|
+
return;
|
|
3374
|
+
}
|
|
3375
|
+
if (g.target !== g.currentTarget) return;
|
|
3376
|
+
const y = Kl(g, u.orientation, u.dir);
|
|
3377
|
+
if (y !== void 0) {
|
|
3378
|
+
if (g.metaKey || g.ctrlKey || g.altKey || g.shiftKey) return;
|
|
3379
|
+
g.preventDefault();
|
|
3380
|
+
let b = v().filter((x) => x.focusable).map((x) => x.ref.current);
|
|
3381
|
+
if (y === "last") b.reverse();
|
|
3382
|
+
else if (y === "prev" || y === "next") {
|
|
3383
|
+
y === "prev" && b.reverse();
|
|
3384
|
+
const x = b.indexOf(g.currentTarget);
|
|
3385
|
+
b = u.loop ? Ul(b, x + 1) : b.slice(x + 1);
|
|
3386
|
+
}
|
|
3387
|
+
setTimeout(() => Nr(b));
|
|
3388
|
+
}
|
|
3389
|
+
}),
|
|
3390
|
+
children: typeof c == "function" ? c({ isCurrentTabStop: f, hasTabStop: m != null }) : c
|
|
3391
|
+
}
|
|
3392
|
+
)
|
|
3393
|
+
}
|
|
3394
|
+
);
|
|
3395
|
+
}
|
|
3396
|
+
);
|
|
3397
|
+
Dr.displayName = Or;
|
|
3398
|
+
var Hl = {
|
|
3399
|
+
ArrowLeft: "prev",
|
|
3400
|
+
ArrowUp: "prev",
|
|
3401
|
+
ArrowRight: "next",
|
|
3402
|
+
ArrowDown: "next",
|
|
3403
|
+
PageUp: "first",
|
|
3404
|
+
Home: "first",
|
|
3405
|
+
PageDown: "last",
|
|
3406
|
+
End: "last"
|
|
3407
|
+
};
|
|
3408
|
+
function Vl(e, t) {
|
|
3409
|
+
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
3410
|
+
}
|
|
3411
|
+
function Kl(e, t, n) {
|
|
3412
|
+
const o = Vl(e.key, n);
|
|
3413
|
+
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
3414
|
+
return Hl[o];
|
|
3415
|
+
}
|
|
3416
|
+
function Nr(e, t = !1) {
|
|
3417
|
+
const n = document.activeElement;
|
|
3418
|
+
for (const o of e)
|
|
3419
|
+
if (o === n || (o.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
3420
|
+
}
|
|
3421
|
+
function Ul(e, t) {
|
|
3422
|
+
return e.map((n, o) => e[(t + o) % e.length]);
|
|
3423
|
+
}
|
|
3424
|
+
var Gl = Ar, zl = Dr, en = ["Enter", " "], jl = ["ArrowDown", "PageUp", "Home"], Ir = ["ArrowUp", "PageDown", "End"], Yl = [...jl, ...Ir], Xl = {
|
|
3425
|
+
ltr: [...en, "ArrowRight"],
|
|
3426
|
+
rtl: [...en, "ArrowLeft"]
|
|
3427
|
+
}, ql = {
|
|
3428
|
+
ltr: ["ArrowLeft"],
|
|
3429
|
+
rtl: ["ArrowRight"]
|
|
3430
|
+
}, qe = "Menu", [Ve, Zl, Ql] = hn(qe), [Ee, kr] = de(qe, [
|
|
3431
|
+
Ql,
|
|
3432
|
+
Mt,
|
|
3433
|
+
Mr
|
|
3434
|
+
]), At = Mt(), Lr = Mr(), [Jl, Re] = Ee(qe), [eu, Ze] = Ee(qe), Fr = (e) => {
|
|
3435
|
+
const { __scopeMenu: t, open: n = !1, children: o, dir: r, onOpenChange: i, modal: c = !0 } = e, a = At(t), [d, l] = s.useState(null), u = s.useRef(!1), f = Y(i), v = nr(r);
|
|
3436
|
+
return s.useEffect(() => {
|
|
3437
|
+
const h = () => {
|
|
3438
|
+
u.current = !0, document.addEventListener("pointerdown", w, { capture: !0, once: !0 }), document.addEventListener("pointermove", w, { capture: !0, once: !0 });
|
|
3439
|
+
}, w = () => u.current = !1;
|
|
3440
|
+
return document.addEventListener("keydown", h, { capture: !0 }), () => {
|
|
3441
|
+
document.removeEventListener("keydown", h, { capture: !0 }), document.removeEventListener("pointerdown", w, { capture: !0 }), document.removeEventListener("pointermove", w, { capture: !0 });
|
|
3442
|
+
};
|
|
3443
|
+
}, []), /* @__PURE__ */ p(Rr, { ...a, children: /* @__PURE__ */ p(
|
|
3444
|
+
Jl,
|
|
3445
|
+
{
|
|
3446
|
+
scope: t,
|
|
3447
|
+
open: n,
|
|
3448
|
+
onOpenChange: f,
|
|
3449
|
+
content: d,
|
|
3450
|
+
onContentChange: l,
|
|
3451
|
+
children: /* @__PURE__ */ p(
|
|
3452
|
+
eu,
|
|
3453
|
+
{
|
|
3454
|
+
scope: t,
|
|
3455
|
+
onClose: s.useCallback(() => f(!1), [f]),
|
|
3456
|
+
isUsingKeyboardRef: u,
|
|
3457
|
+
dir: v,
|
|
3458
|
+
modal: c,
|
|
3459
|
+
children: o
|
|
3460
|
+
}
|
|
3461
|
+
)
|
|
3462
|
+
}
|
|
3463
|
+
) });
|
|
3464
|
+
};
|
|
3465
|
+
Fr.displayName = qe;
|
|
3466
|
+
var tu = "MenuAnchor", Tn = s.forwardRef(
|
|
3467
|
+
(e, t) => {
|
|
3468
|
+
const { __scopeMenu: n, ...o } = e, r = At(n);
|
|
3469
|
+
return /* @__PURE__ */ p(Tr, { ...r, ...o, ref: t });
|
|
3470
|
+
}
|
|
3471
|
+
);
|
|
3472
|
+
Tn.displayName = tu;
|
|
3473
|
+
var Sn = "MenuPortal", [nu, $r] = Ee(Sn, {
|
|
3474
|
+
forceMount: void 0
|
|
3475
|
+
}), Br = (e) => {
|
|
3476
|
+
const { __scopeMenu: t, forceMount: n, children: o, container: r } = e, i = Re(Sn, t);
|
|
3477
|
+
return /* @__PURE__ */ p(nu, { scope: t, forceMount: n, children: /* @__PURE__ */ p(Z, { present: n || i.open, children: /* @__PURE__ */ p(je, { asChild: !0, container: r, children: o }) }) });
|
|
3478
|
+
};
|
|
3479
|
+
Br.displayName = Sn;
|
|
3480
|
+
var q = "MenuContent", [ou, Pn] = Ee(q), Wr = s.forwardRef(
|
|
3481
|
+
(e, t) => {
|
|
3482
|
+
const n = $r(q, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, i = Re(q, e.__scopeMenu), c = Ze(q, e.__scopeMenu);
|
|
3483
|
+
return /* @__PURE__ */ p(Ve.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ p(Z, { present: o || i.open, children: /* @__PURE__ */ p(Ve.Slot, { scope: e.__scopeMenu, children: c.modal ? /* @__PURE__ */ p(ru, { ...r, ref: t }) : /* @__PURE__ */ p(iu, { ...r, ref: t }) }) }) });
|
|
3484
|
+
}
|
|
3485
|
+
), ru = s.forwardRef(
|
|
3486
|
+
(e, t) => {
|
|
3487
|
+
const n = Re(q, e.__scopeMenu), o = s.useRef(null), r = W(t, o);
|
|
3488
|
+
return s.useEffect(() => {
|
|
3489
|
+
const i = o.current;
|
|
3490
|
+
if (i) return Wo(i);
|
|
3491
|
+
}, []), /* @__PURE__ */ p(
|
|
3492
|
+
_n,
|
|
3493
|
+
{
|
|
3494
|
+
...e,
|
|
3495
|
+
ref: r,
|
|
3496
|
+
trapFocus: n.open,
|
|
3497
|
+
disableOutsidePointerEvents: n.open,
|
|
3498
|
+
disableOutsideScroll: !0,
|
|
3499
|
+
onFocusOutside: _(
|
|
3500
|
+
e.onFocusOutside,
|
|
3501
|
+
(i) => i.preventDefault(),
|
|
3502
|
+
{ checkForDefaultPrevented: !1 }
|
|
3503
|
+
),
|
|
3504
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
3505
|
+
}
|
|
3506
|
+
);
|
|
3507
|
+
}
|
|
3508
|
+
), iu = s.forwardRef((e, t) => {
|
|
3509
|
+
const n = Re(q, e.__scopeMenu);
|
|
3510
|
+
return /* @__PURE__ */ p(
|
|
3511
|
+
_n,
|
|
3512
|
+
{
|
|
3513
|
+
...e,
|
|
3514
|
+
ref: t,
|
|
3515
|
+
trapFocus: !1,
|
|
3516
|
+
disableOutsidePointerEvents: !1,
|
|
3517
|
+
disableOutsideScroll: !1,
|
|
3518
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
3519
|
+
}
|
|
3520
|
+
);
|
|
3521
|
+
}), su = /* @__PURE__ */ Be("MenuContent.ScrollLock"), _n = s.forwardRef(
|
|
3522
|
+
(e, t) => {
|
|
3523
|
+
const {
|
|
3524
|
+
__scopeMenu: n,
|
|
3525
|
+
loop: o = !1,
|
|
3526
|
+
trapFocus: r,
|
|
3527
|
+
onOpenAutoFocus: i,
|
|
3528
|
+
onCloseAutoFocus: c,
|
|
3529
|
+
disableOutsidePointerEvents: a,
|
|
3530
|
+
onEntryFocus: d,
|
|
3531
|
+
onEscapeKeyDown: l,
|
|
3532
|
+
onPointerDownOutside: u,
|
|
3533
|
+
onFocusOutside: f,
|
|
3534
|
+
onInteractOutside: v,
|
|
3535
|
+
onDismiss: h,
|
|
3536
|
+
disableOutsideScroll: w,
|
|
3537
|
+
...m
|
|
3538
|
+
} = e, g = Re(q, n), y = Ze(q, n), C = At(n), b = Lr(n), x = Zl(n), [E, T] = s.useState(null), R = s.useRef(null), M = W(t, R, g.onContentChange), N = s.useRef(0), D = s.useRef(""), k = s.useRef(0), B = s.useRef(null), L = s.useRef("right"), P = s.useRef(0), F = w ? fn : s.Fragment, O = w ? { as: su, allowPinchZoom: !0 } : void 0, $ = (S) => {
|
|
3539
|
+
const H = D.current + S, X = x().filter((V) => !V.disabled), Q = document.activeElement, ne = X.find((V) => V.ref.current === Q)?.textValue, fe = X.map((V) => V.textValue), et = wu(fe, H, ne), ge = X.find((V) => V.textValue === et)?.ref.current;
|
|
3540
|
+
(function V(Le) {
|
|
3541
|
+
D.current = Le, window.clearTimeout(N.current), Le !== "" && (N.current = window.setTimeout(() => V(""), 1e3));
|
|
3542
|
+
})(H), ge && setTimeout(() => ge.focus());
|
|
3543
|
+
};
|
|
3544
|
+
s.useEffect(() => () => window.clearTimeout(N.current), []), Oo();
|
|
3545
|
+
const A = s.useCallback((S) => L.current === B.current?.side && Cu(S, B.current?.area), []);
|
|
3546
|
+
return /* @__PURE__ */ p(
|
|
3547
|
+
ou,
|
|
3548
|
+
{
|
|
3549
|
+
scope: n,
|
|
3550
|
+
searchRef: D,
|
|
3551
|
+
onItemEnter: s.useCallback(
|
|
3552
|
+
(S) => {
|
|
3553
|
+
A(S) && S.preventDefault();
|
|
3554
|
+
},
|
|
3555
|
+
[A]
|
|
3556
|
+
),
|
|
3557
|
+
onItemLeave: s.useCallback(
|
|
3558
|
+
(S) => {
|
|
3559
|
+
A(S) || (R.current?.focus(), T(null));
|
|
3560
|
+
},
|
|
3561
|
+
[A]
|
|
3562
|
+
),
|
|
3563
|
+
onTriggerLeave: s.useCallback(
|
|
3564
|
+
(S) => {
|
|
3565
|
+
A(S) && S.preventDefault();
|
|
3566
|
+
},
|
|
3567
|
+
[A]
|
|
3568
|
+
),
|
|
3569
|
+
pointerGraceTimerRef: k,
|
|
3570
|
+
onPointerGraceIntentChange: s.useCallback((S) => {
|
|
3571
|
+
B.current = S;
|
|
3572
|
+
}, []),
|
|
3573
|
+
children: /* @__PURE__ */ p(F, { ...O, children: /* @__PURE__ */ p(
|
|
3574
|
+
dn,
|
|
3575
|
+
{
|
|
3576
|
+
asChild: !0,
|
|
3577
|
+
trapped: r,
|
|
3578
|
+
onMountAutoFocus: _(i, (S) => {
|
|
3579
|
+
S.preventDefault(), R.current?.focus({ preventScroll: !0 });
|
|
3580
|
+
}),
|
|
3581
|
+
onUnmountAutoFocus: c,
|
|
3582
|
+
children: /* @__PURE__ */ p(
|
|
3583
|
+
ze,
|
|
3584
|
+
{
|
|
3585
|
+
asChild: !0,
|
|
3586
|
+
disableOutsidePointerEvents: a,
|
|
3587
|
+
onEscapeKeyDown: l,
|
|
3588
|
+
onPointerDownOutside: u,
|
|
3589
|
+
onFocusOutside: f,
|
|
3590
|
+
onInteractOutside: v,
|
|
3591
|
+
onDismiss: h,
|
|
3592
|
+
children: /* @__PURE__ */ p(
|
|
3593
|
+
Gl,
|
|
3594
|
+
{
|
|
3595
|
+
asChild: !0,
|
|
3596
|
+
...b,
|
|
3597
|
+
dir: y.dir,
|
|
3598
|
+
orientation: "vertical",
|
|
3599
|
+
loop: o,
|
|
3600
|
+
currentTabStopId: E,
|
|
3601
|
+
onCurrentTabStopIdChange: T,
|
|
3602
|
+
onEntryFocus: _(d, (S) => {
|
|
3603
|
+
y.isUsingKeyboardRef.current || S.preventDefault();
|
|
3604
|
+
}),
|
|
3605
|
+
preventScrollOnEntryFocus: !0,
|
|
3606
|
+
children: /* @__PURE__ */ p(
|
|
3607
|
+
Sr,
|
|
3608
|
+
{
|
|
3609
|
+
role: "menu",
|
|
3610
|
+
"aria-orientation": "vertical",
|
|
3611
|
+
"data-state": ni(g.open),
|
|
3612
|
+
"data-radix-menu-content": "",
|
|
3613
|
+
dir: y.dir,
|
|
3614
|
+
...C,
|
|
3615
|
+
...m,
|
|
3616
|
+
ref: M,
|
|
3617
|
+
style: { outline: "none", ...m.style },
|
|
3618
|
+
onKeyDown: _(m.onKeyDown, (S) => {
|
|
3619
|
+
const X = S.target.closest("[data-radix-menu-content]") === S.currentTarget, Q = S.ctrlKey || S.altKey || S.metaKey, ne = S.key.length === 1;
|
|
3620
|
+
X && (S.key === "Tab" && S.preventDefault(), !Q && ne && $(S.key));
|
|
3621
|
+
const fe = R.current;
|
|
3622
|
+
if (S.target !== fe || !Yl.includes(S.key)) return;
|
|
3623
|
+
S.preventDefault();
|
|
3624
|
+
const ge = x().filter((V) => !V.disabled).map((V) => V.ref.current);
|
|
3625
|
+
Ir.includes(S.key) && ge.reverse(), hu(ge);
|
|
3626
|
+
}),
|
|
3627
|
+
onBlur: _(e.onBlur, (S) => {
|
|
3628
|
+
S.currentTarget.contains(S.target) || (window.clearTimeout(N.current), D.current = "");
|
|
3629
|
+
}),
|
|
3630
|
+
onPointerMove: _(
|
|
3631
|
+
e.onPointerMove,
|
|
3632
|
+
Ke((S) => {
|
|
3633
|
+
const H = S.target, X = P.current !== S.clientX;
|
|
3634
|
+
if (S.currentTarget.contains(H) && X) {
|
|
3635
|
+
const Q = S.clientX > P.current ? "right" : "left";
|
|
3636
|
+
L.current = Q, P.current = S.clientX;
|
|
3637
|
+
}
|
|
3638
|
+
})
|
|
3639
|
+
)
|
|
3640
|
+
}
|
|
3641
|
+
)
|
|
3642
|
+
}
|
|
3643
|
+
)
|
|
3644
|
+
}
|
|
3645
|
+
)
|
|
3646
|
+
}
|
|
3647
|
+
) })
|
|
3648
|
+
}
|
|
3649
|
+
);
|
|
3650
|
+
}
|
|
3651
|
+
);
|
|
3652
|
+
Wr.displayName = q;
|
|
3653
|
+
var cu = "MenuGroup", Mn = s.forwardRef(
|
|
3654
|
+
(e, t) => {
|
|
3655
|
+
const { __scopeMenu: n, ...o } = e;
|
|
3656
|
+
return /* @__PURE__ */ p(I.div, { role: "group", ...o, ref: t });
|
|
3657
|
+
}
|
|
3658
|
+
);
|
|
3659
|
+
Mn.displayName = cu;
|
|
3660
|
+
var au = "MenuLabel", Hr = s.forwardRef(
|
|
3661
|
+
(e, t) => {
|
|
3662
|
+
const { __scopeMenu: n, ...o } = e;
|
|
3663
|
+
return /* @__PURE__ */ p(I.div, { ...o, ref: t });
|
|
3664
|
+
}
|
|
3665
|
+
);
|
|
3666
|
+
Hr.displayName = au;
|
|
3667
|
+
var wt = "MenuItem", uo = "menu.itemSelect", Ot = s.forwardRef(
|
|
3668
|
+
(e, t) => {
|
|
3669
|
+
const { disabled: n = !1, onSelect: o, ...r } = e, i = s.useRef(null), c = Ze(wt, e.__scopeMenu), a = Pn(wt, e.__scopeMenu), d = W(t, i), l = s.useRef(!1), u = () => {
|
|
3670
|
+
const f = i.current;
|
|
3671
|
+
if (!n && f) {
|
|
3672
|
+
const v = new CustomEvent(uo, { bubbles: !0, cancelable: !0 });
|
|
3673
|
+
f.addEventListener(uo, (h) => o?.(h), { once: !0 }), ln(f, v), v.defaultPrevented ? l.current = !1 : c.onClose();
|
|
3674
|
+
}
|
|
3675
|
+
};
|
|
3676
|
+
return /* @__PURE__ */ p(
|
|
3677
|
+
Vr,
|
|
3678
|
+
{
|
|
3679
|
+
...r,
|
|
3680
|
+
ref: d,
|
|
3681
|
+
disabled: n,
|
|
3682
|
+
onClick: _(e.onClick, u),
|
|
3683
|
+
onPointerDown: (f) => {
|
|
3684
|
+
e.onPointerDown?.(f), l.current = !0;
|
|
3685
|
+
},
|
|
3686
|
+
onPointerUp: _(e.onPointerUp, (f) => {
|
|
3687
|
+
l.current || f.currentTarget?.click();
|
|
3688
|
+
}),
|
|
3689
|
+
onKeyDown: _(e.onKeyDown, (f) => {
|
|
3690
|
+
const v = a.searchRef.current !== "";
|
|
3691
|
+
n || v && f.key === " " || en.includes(f.key) && (f.currentTarget.click(), f.preventDefault());
|
|
3692
|
+
})
|
|
3693
|
+
}
|
|
3694
|
+
);
|
|
3695
|
+
}
|
|
3696
|
+
);
|
|
3697
|
+
Ot.displayName = wt;
|
|
3698
|
+
var Vr = s.forwardRef(
|
|
3699
|
+
(e, t) => {
|
|
3700
|
+
const { __scopeMenu: n, disabled: o = !1, textValue: r, ...i } = e, c = Pn(wt, n), a = Lr(n), d = s.useRef(null), l = W(t, d), [u, f] = s.useState(!1), [v, h] = s.useState("");
|
|
3701
|
+
return s.useEffect(() => {
|
|
3702
|
+
const w = d.current;
|
|
3703
|
+
w && h((w.textContent ?? "").trim());
|
|
3704
|
+
}, [i.children]), /* @__PURE__ */ p(
|
|
3705
|
+
Ve.ItemSlot,
|
|
3706
|
+
{
|
|
3707
|
+
scope: n,
|
|
3708
|
+
disabled: o,
|
|
3709
|
+
textValue: r ?? v,
|
|
3710
|
+
children: /* @__PURE__ */ p(zl, { asChild: !0, ...a, focusable: !o, children: /* @__PURE__ */ p(
|
|
3711
|
+
I.div,
|
|
3712
|
+
{
|
|
3713
|
+
role: "menuitem",
|
|
3714
|
+
"data-highlighted": u ? "" : void 0,
|
|
3715
|
+
"aria-disabled": o || void 0,
|
|
3716
|
+
"data-disabled": o ? "" : void 0,
|
|
3717
|
+
...i,
|
|
3718
|
+
ref: l,
|
|
3719
|
+
onPointerMove: _(
|
|
3720
|
+
e.onPointerMove,
|
|
3721
|
+
Ke((w) => {
|
|
3722
|
+
o ? c.onItemLeave(w) : (c.onItemEnter(w), w.defaultPrevented || w.currentTarget.focus({ preventScroll: !0 }));
|
|
3723
|
+
})
|
|
3724
|
+
),
|
|
3725
|
+
onPointerLeave: _(
|
|
3726
|
+
e.onPointerLeave,
|
|
3727
|
+
Ke((w) => c.onItemLeave(w))
|
|
3728
|
+
),
|
|
3729
|
+
onFocus: _(e.onFocus, () => f(!0)),
|
|
3730
|
+
onBlur: _(e.onBlur, () => f(!1))
|
|
3731
|
+
}
|
|
3732
|
+
) })
|
|
3733
|
+
}
|
|
3734
|
+
);
|
|
3735
|
+
}
|
|
3736
|
+
), lu = "MenuCheckboxItem", Kr = s.forwardRef(
|
|
3737
|
+
(e, t) => {
|
|
3738
|
+
const { checked: n = !1, onCheckedChange: o, ...r } = e;
|
|
3739
|
+
return /* @__PURE__ */ p(Yr, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ p(
|
|
3740
|
+
Ot,
|
|
3741
|
+
{
|
|
3742
|
+
role: "menuitemcheckbox",
|
|
3743
|
+
"aria-checked": yt(n) ? "mixed" : n,
|
|
3744
|
+
...r,
|
|
3745
|
+
ref: t,
|
|
3746
|
+
"data-state": On(n),
|
|
3747
|
+
onSelect: _(
|
|
3748
|
+
r.onSelect,
|
|
3749
|
+
() => o?.(yt(n) ? !0 : !n),
|
|
3750
|
+
{ checkForDefaultPrevented: !1 }
|
|
3751
|
+
)
|
|
3752
|
+
}
|
|
3753
|
+
) });
|
|
3754
|
+
}
|
|
3755
|
+
);
|
|
3756
|
+
Kr.displayName = lu;
|
|
3757
|
+
var Ur = "MenuRadioGroup", [uu, du] = Ee(
|
|
3758
|
+
Ur,
|
|
3759
|
+
{ value: void 0, onValueChange: () => {
|
|
3760
|
+
} }
|
|
3761
|
+
), Gr = s.forwardRef(
|
|
3762
|
+
(e, t) => {
|
|
3763
|
+
const { value: n, onValueChange: o, ...r } = e, i = Y(o);
|
|
3764
|
+
return /* @__PURE__ */ p(uu, { scope: e.__scopeMenu, value: n, onValueChange: i, children: /* @__PURE__ */ p(Mn, { ...r, ref: t }) });
|
|
3765
|
+
}
|
|
3766
|
+
);
|
|
3767
|
+
Gr.displayName = Ur;
|
|
3768
|
+
var zr = "MenuRadioItem", jr = s.forwardRef(
|
|
3769
|
+
(e, t) => {
|
|
3770
|
+
const { value: n, ...o } = e, r = du(zr, e.__scopeMenu), i = n === r.value;
|
|
3771
|
+
return /* @__PURE__ */ p(Yr, { scope: e.__scopeMenu, checked: i, children: /* @__PURE__ */ p(
|
|
3772
|
+
Ot,
|
|
3773
|
+
{
|
|
3774
|
+
role: "menuitemradio",
|
|
3775
|
+
"aria-checked": i,
|
|
3776
|
+
...o,
|
|
3777
|
+
ref: t,
|
|
3778
|
+
"data-state": On(i),
|
|
3779
|
+
onSelect: _(
|
|
3780
|
+
o.onSelect,
|
|
3781
|
+
() => r.onValueChange?.(n),
|
|
3782
|
+
{ checkForDefaultPrevented: !1 }
|
|
3783
|
+
)
|
|
3784
|
+
}
|
|
3785
|
+
) });
|
|
3786
|
+
}
|
|
3787
|
+
);
|
|
3788
|
+
jr.displayName = zr;
|
|
3789
|
+
var An = "MenuItemIndicator", [Yr, fu] = Ee(
|
|
3790
|
+
An,
|
|
3791
|
+
{ checked: !1 }
|
|
3792
|
+
), Xr = s.forwardRef(
|
|
3793
|
+
(e, t) => {
|
|
3794
|
+
const { __scopeMenu: n, forceMount: o, ...r } = e, i = fu(An, n);
|
|
3795
|
+
return /* @__PURE__ */ p(
|
|
3796
|
+
Z,
|
|
3797
|
+
{
|
|
3798
|
+
present: o || yt(i.checked) || i.checked === !0,
|
|
3799
|
+
children: /* @__PURE__ */ p(
|
|
3800
|
+
I.span,
|
|
3801
|
+
{
|
|
3802
|
+
...r,
|
|
3803
|
+
ref: t,
|
|
3804
|
+
"data-state": On(i.checked)
|
|
3805
|
+
}
|
|
3806
|
+
)
|
|
3807
|
+
}
|
|
3808
|
+
);
|
|
3809
|
+
}
|
|
3810
|
+
);
|
|
3811
|
+
Xr.displayName = An;
|
|
3812
|
+
var pu = "MenuSeparator", qr = s.forwardRef(
|
|
3813
|
+
(e, t) => {
|
|
3814
|
+
const { __scopeMenu: n, ...o } = e;
|
|
3815
|
+
return /* @__PURE__ */ p(
|
|
3816
|
+
I.div,
|
|
3817
|
+
{
|
|
3818
|
+
role: "separator",
|
|
3819
|
+
"aria-orientation": "horizontal",
|
|
3820
|
+
...o,
|
|
3821
|
+
ref: t
|
|
3822
|
+
}
|
|
3823
|
+
);
|
|
3824
|
+
}
|
|
3825
|
+
);
|
|
3826
|
+
qr.displayName = pu;
|
|
3827
|
+
var mu = "MenuArrow", Zr = s.forwardRef(
|
|
3828
|
+
(e, t) => {
|
|
3829
|
+
const { __scopeMenu: n, ...o } = e, r = At(n);
|
|
3830
|
+
return /* @__PURE__ */ p(Pr, { ...r, ...o, ref: t });
|
|
3831
|
+
}
|
|
3832
|
+
);
|
|
3833
|
+
Zr.displayName = mu;
|
|
3834
|
+
var vu = "MenuSub", [Tf, Qr] = Ee(vu), $e = "MenuSubTrigger", Jr = s.forwardRef(
|
|
3835
|
+
(e, t) => {
|
|
3836
|
+
const n = Re($e, e.__scopeMenu), o = Ze($e, e.__scopeMenu), r = Qr($e, e.__scopeMenu), i = Pn($e, e.__scopeMenu), c = s.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: d } = i, l = { __scopeMenu: e.__scopeMenu }, u = s.useCallback(() => {
|
|
3837
|
+
c.current && window.clearTimeout(c.current), c.current = null;
|
|
3838
|
+
}, []);
|
|
3839
|
+
return s.useEffect(() => u, [u]), s.useEffect(() => {
|
|
3840
|
+
const f = a.current;
|
|
3841
|
+
return () => {
|
|
3842
|
+
window.clearTimeout(f), d(null);
|
|
3843
|
+
};
|
|
3844
|
+
}, [a, d]), /* @__PURE__ */ p(Tn, { asChild: !0, ...l, children: /* @__PURE__ */ p(
|
|
3845
|
+
Vr,
|
|
3846
|
+
{
|
|
3847
|
+
id: r.triggerId,
|
|
3848
|
+
"aria-haspopup": "menu",
|
|
3849
|
+
"aria-expanded": n.open,
|
|
3850
|
+
"aria-controls": r.contentId,
|
|
3851
|
+
"data-state": ni(n.open),
|
|
3852
|
+
...e,
|
|
3853
|
+
ref: bt(t, r.onTriggerChange),
|
|
3854
|
+
onClick: (f) => {
|
|
3855
|
+
e.onClick?.(f), !(e.disabled || f.defaultPrevented) && (f.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
3856
|
+
},
|
|
3857
|
+
onPointerMove: _(
|
|
3858
|
+
e.onPointerMove,
|
|
3859
|
+
Ke((f) => {
|
|
3860
|
+
i.onItemEnter(f), !f.defaultPrevented && !e.disabled && !n.open && !c.current && (i.onPointerGraceIntentChange(null), c.current = window.setTimeout(() => {
|
|
3861
|
+
n.onOpenChange(!0), u();
|
|
3862
|
+
}, 100));
|
|
3863
|
+
})
|
|
3864
|
+
),
|
|
3865
|
+
onPointerLeave: _(
|
|
3866
|
+
e.onPointerLeave,
|
|
3867
|
+
Ke((f) => {
|
|
3868
|
+
u();
|
|
3869
|
+
const v = n.content?.getBoundingClientRect();
|
|
3870
|
+
if (v) {
|
|
3871
|
+
const h = n.content?.dataset.side, w = h === "right", m = w ? -5 : 5, g = v[w ? "left" : "right"], y = v[w ? "right" : "left"];
|
|
3872
|
+
i.onPointerGraceIntentChange({
|
|
3873
|
+
area: [
|
|
3874
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
3875
|
+
// consistently within polygon bounds
|
|
3876
|
+
{ x: f.clientX + m, y: f.clientY },
|
|
3877
|
+
{ x: g, y: v.top },
|
|
3878
|
+
{ x: y, y: v.top },
|
|
3879
|
+
{ x: y, y: v.bottom },
|
|
3880
|
+
{ x: g, y: v.bottom }
|
|
3881
|
+
],
|
|
3882
|
+
side: h
|
|
3883
|
+
}), window.clearTimeout(a.current), a.current = window.setTimeout(
|
|
3884
|
+
() => i.onPointerGraceIntentChange(null),
|
|
3885
|
+
300
|
|
3886
|
+
);
|
|
3887
|
+
} else {
|
|
3888
|
+
if (i.onTriggerLeave(f), f.defaultPrevented) return;
|
|
3889
|
+
i.onPointerGraceIntentChange(null);
|
|
3890
|
+
}
|
|
3891
|
+
})
|
|
3892
|
+
),
|
|
3893
|
+
onKeyDown: _(e.onKeyDown, (f) => {
|
|
3894
|
+
const v = i.searchRef.current !== "";
|
|
3895
|
+
e.disabled || v && f.key === " " || Xl[o.dir].includes(f.key) && (n.onOpenChange(!0), n.content?.focus(), f.preventDefault());
|
|
3896
|
+
})
|
|
3897
|
+
}
|
|
3898
|
+
) });
|
|
3899
|
+
}
|
|
3900
|
+
);
|
|
3901
|
+
Jr.displayName = $e;
|
|
3902
|
+
var ei = "MenuSubContent", ti = s.forwardRef(
|
|
3903
|
+
(e, t) => {
|
|
3904
|
+
const n = $r(q, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, i = Re(q, e.__scopeMenu), c = Ze(q, e.__scopeMenu), a = Qr(ei, e.__scopeMenu), d = s.useRef(null), l = W(t, d);
|
|
3905
|
+
return /* @__PURE__ */ p(Ve.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ p(Z, { present: o || i.open, children: /* @__PURE__ */ p(Ve.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ p(
|
|
3906
|
+
_n,
|
|
3907
|
+
{
|
|
3908
|
+
id: a.contentId,
|
|
3909
|
+
"aria-labelledby": a.triggerId,
|
|
3910
|
+
...r,
|
|
3911
|
+
ref: l,
|
|
3912
|
+
align: "start",
|
|
3913
|
+
side: c.dir === "rtl" ? "left" : "right",
|
|
3914
|
+
disableOutsidePointerEvents: !1,
|
|
3915
|
+
disableOutsideScroll: !1,
|
|
3916
|
+
trapFocus: !1,
|
|
3917
|
+
onOpenAutoFocus: (u) => {
|
|
3918
|
+
c.isUsingKeyboardRef.current && d.current?.focus(), u.preventDefault();
|
|
3919
|
+
},
|
|
3920
|
+
onCloseAutoFocus: (u) => u.preventDefault(),
|
|
3921
|
+
onFocusOutside: _(e.onFocusOutside, (u) => {
|
|
3922
|
+
u.target !== a.trigger && i.onOpenChange(!1);
|
|
3923
|
+
}),
|
|
3924
|
+
onEscapeKeyDown: _(e.onEscapeKeyDown, (u) => {
|
|
3925
|
+
c.onClose(), u.preventDefault();
|
|
3926
|
+
}),
|
|
3927
|
+
onKeyDown: _(e.onKeyDown, (u) => {
|
|
3928
|
+
const f = u.currentTarget.contains(u.target), v = ql[c.dir].includes(u.key);
|
|
3929
|
+
f && v && (i.onOpenChange(!1), a.trigger?.focus(), u.preventDefault());
|
|
3930
|
+
})
|
|
3931
|
+
}
|
|
3932
|
+
) }) }) });
|
|
3933
|
+
}
|
|
3934
|
+
);
|
|
3935
|
+
ti.displayName = ei;
|
|
3936
|
+
function ni(e) {
|
|
3937
|
+
return e ? "open" : "closed";
|
|
3938
|
+
}
|
|
3939
|
+
function yt(e) {
|
|
3940
|
+
return e === "indeterminate";
|
|
3941
|
+
}
|
|
3942
|
+
function On(e) {
|
|
3943
|
+
return yt(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
3944
|
+
}
|
|
3945
|
+
function hu(e) {
|
|
3946
|
+
const t = document.activeElement;
|
|
3947
|
+
for (const n of e)
|
|
3948
|
+
if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
3949
|
+
}
|
|
3950
|
+
function gu(e, t) {
|
|
3951
|
+
return e.map((n, o) => e[(t + o) % e.length]);
|
|
3952
|
+
}
|
|
3953
|
+
function wu(e, t, n) {
|
|
3954
|
+
const r = t.length > 1 && Array.from(t).every((l) => l === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
|
|
3955
|
+
let c = gu(e, Math.max(i, 0));
|
|
3956
|
+
r.length === 1 && (c = c.filter((l) => l !== n));
|
|
3957
|
+
const d = c.find(
|
|
3958
|
+
(l) => l.toLowerCase().startsWith(r.toLowerCase())
|
|
3959
|
+
);
|
|
3960
|
+
return d !== n ? d : void 0;
|
|
3961
|
+
}
|
|
3962
|
+
function yu(e, t) {
|
|
3963
|
+
const { x: n, y: o } = e;
|
|
3964
|
+
let r = !1;
|
|
3965
|
+
for (let i = 0, c = t.length - 1; i < t.length; c = i++) {
|
|
3966
|
+
const a = t[i], d = t[c], l = a.x, u = a.y, f = d.x, v = d.y;
|
|
3967
|
+
u > o != v > o && n < (f - l) * (o - u) / (v - u) + l && (r = !r);
|
|
3968
|
+
}
|
|
3969
|
+
return r;
|
|
3970
|
+
}
|
|
3971
|
+
function Cu(e, t) {
|
|
3972
|
+
if (!t) return !1;
|
|
3973
|
+
const n = { x: e.clientX, y: e.clientY };
|
|
3974
|
+
return yu(n, t);
|
|
3975
|
+
}
|
|
3976
|
+
function Ke(e) {
|
|
3977
|
+
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
3978
|
+
}
|
|
3979
|
+
var bu = Fr, xu = Tn, Eu = Br, Ru = Wr, Tu = Mn, Su = Hr, Pu = Ot, _u = Kr, Mu = Gr, Au = jr, Ou = Xr, Du = qr, Nu = Zr, Iu = Jr, ku = ti, Dt = "DropdownMenu", [Lu] = de(
|
|
3980
|
+
Dt,
|
|
3981
|
+
[kr]
|
|
3982
|
+
), G = kr(), [Fu, oi] = Lu(Dt), ri = (e) => {
|
|
3983
|
+
const {
|
|
3984
|
+
__scopeDropdownMenu: t,
|
|
3985
|
+
children: n,
|
|
3986
|
+
dir: o,
|
|
3987
|
+
open: r,
|
|
3988
|
+
defaultOpen: i,
|
|
3989
|
+
onOpenChange: c,
|
|
3990
|
+
modal: a = !0
|
|
3991
|
+
} = e, d = G(t), l = s.useRef(null), [u, f] = Ne({
|
|
3992
|
+
prop: r,
|
|
3993
|
+
defaultProp: i ?? !1,
|
|
3994
|
+
onChange: c,
|
|
3995
|
+
caller: Dt
|
|
3996
|
+
});
|
|
3997
|
+
return /* @__PURE__ */ p(
|
|
3998
|
+
Fu,
|
|
3999
|
+
{
|
|
4000
|
+
scope: t,
|
|
4001
|
+
triggerId: ye(),
|
|
4002
|
+
triggerRef: l,
|
|
4003
|
+
contentId: ye(),
|
|
4004
|
+
open: u,
|
|
4005
|
+
onOpenChange: f,
|
|
4006
|
+
onOpenToggle: s.useCallback(() => f((v) => !v), [f]),
|
|
4007
|
+
modal: a,
|
|
4008
|
+
children: /* @__PURE__ */ p(bu, { ...d, open: u, onOpenChange: f, dir: o, modal: a, children: n })
|
|
4009
|
+
}
|
|
4010
|
+
);
|
|
4011
|
+
};
|
|
4012
|
+
ri.displayName = Dt;
|
|
4013
|
+
var ii = "DropdownMenuTrigger", si = s.forwardRef(
|
|
4014
|
+
(e, t) => {
|
|
4015
|
+
const { __scopeDropdownMenu: n, disabled: o = !1, ...r } = e, i = oi(ii, n), c = G(n);
|
|
4016
|
+
return /* @__PURE__ */ p(xu, { asChild: !0, ...c, children: /* @__PURE__ */ p(
|
|
4017
|
+
I.button,
|
|
4018
|
+
{
|
|
4019
|
+
type: "button",
|
|
4020
|
+
id: i.triggerId,
|
|
4021
|
+
"aria-haspopup": "menu",
|
|
4022
|
+
"aria-expanded": i.open,
|
|
4023
|
+
"aria-controls": i.open ? i.contentId : void 0,
|
|
4024
|
+
"data-state": i.open ? "open" : "closed",
|
|
4025
|
+
"data-disabled": o ? "" : void 0,
|
|
4026
|
+
disabled: o,
|
|
4027
|
+
...r,
|
|
4028
|
+
ref: bt(t, i.triggerRef),
|
|
4029
|
+
onPointerDown: _(e.onPointerDown, (a) => {
|
|
4030
|
+
!o && a.button === 0 && a.ctrlKey === !1 && (i.onOpenToggle(), i.open || a.preventDefault());
|
|
4031
|
+
}),
|
|
4032
|
+
onKeyDown: _(e.onKeyDown, (a) => {
|
|
4033
|
+
o || (["Enter", " "].includes(a.key) && i.onOpenToggle(), a.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(a.key) && a.preventDefault());
|
|
4034
|
+
})
|
|
4035
|
+
}
|
|
4036
|
+
) });
|
|
4037
|
+
}
|
|
4038
|
+
);
|
|
4039
|
+
si.displayName = ii;
|
|
4040
|
+
var $u = "DropdownMenuPortal", ci = (e) => {
|
|
4041
|
+
const { __scopeDropdownMenu: t, ...n } = e, o = G(t);
|
|
4042
|
+
return /* @__PURE__ */ p(Eu, { ...o, ...n });
|
|
4043
|
+
};
|
|
4044
|
+
ci.displayName = $u;
|
|
4045
|
+
var ai = "DropdownMenuContent", li = s.forwardRef(
|
|
4046
|
+
(e, t) => {
|
|
4047
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = oi(ai, n), i = G(n), c = s.useRef(!1);
|
|
4048
|
+
return /* @__PURE__ */ p(
|
|
4049
|
+
Ru,
|
|
4050
|
+
{
|
|
4051
|
+
id: r.contentId,
|
|
4052
|
+
"aria-labelledby": r.triggerId,
|
|
4053
|
+
...i,
|
|
4054
|
+
...o,
|
|
4055
|
+
ref: t,
|
|
4056
|
+
onCloseAutoFocus: _(e.onCloseAutoFocus, (a) => {
|
|
4057
|
+
c.current || r.triggerRef.current?.focus(), c.current = !1, a.preventDefault();
|
|
4058
|
+
}),
|
|
4059
|
+
onInteractOutside: _(e.onInteractOutside, (a) => {
|
|
4060
|
+
const d = a.detail.originalEvent, l = d.button === 0 && d.ctrlKey === !0, u = d.button === 2 || l;
|
|
4061
|
+
(!r.modal || u) && (c.current = !0);
|
|
4062
|
+
}),
|
|
4063
|
+
style: {
|
|
4064
|
+
...e.style,
|
|
4065
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
4066
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
4067
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
4068
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
4069
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4072
|
+
);
|
|
4073
|
+
}
|
|
4074
|
+
);
|
|
4075
|
+
li.displayName = ai;
|
|
4076
|
+
var Bu = "DropdownMenuGroup", Wu = s.forwardRef(
|
|
4077
|
+
(e, t) => {
|
|
4078
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4079
|
+
return /* @__PURE__ */ p(Tu, { ...r, ...o, ref: t });
|
|
4080
|
+
}
|
|
4081
|
+
);
|
|
4082
|
+
Wu.displayName = Bu;
|
|
4083
|
+
var Hu = "DropdownMenuLabel", Vu = s.forwardRef(
|
|
4084
|
+
(e, t) => {
|
|
4085
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4086
|
+
return /* @__PURE__ */ p(Su, { ...r, ...o, ref: t });
|
|
4087
|
+
}
|
|
4088
|
+
);
|
|
4089
|
+
Vu.displayName = Hu;
|
|
4090
|
+
var Ku = "DropdownMenuItem", ui = s.forwardRef(
|
|
4091
|
+
(e, t) => {
|
|
4092
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4093
|
+
return /* @__PURE__ */ p(Pu, { ...r, ...o, ref: t });
|
|
4094
|
+
}
|
|
4095
|
+
);
|
|
4096
|
+
ui.displayName = Ku;
|
|
4097
|
+
var Uu = "DropdownMenuCheckboxItem", Gu = s.forwardRef((e, t) => {
|
|
4098
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4099
|
+
return /* @__PURE__ */ p(_u, { ...r, ...o, ref: t });
|
|
4100
|
+
});
|
|
4101
|
+
Gu.displayName = Uu;
|
|
4102
|
+
var zu = "DropdownMenuRadioGroup", ju = s.forwardRef((e, t) => {
|
|
4103
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4104
|
+
return /* @__PURE__ */ p(Mu, { ...r, ...o, ref: t });
|
|
4105
|
+
});
|
|
4106
|
+
ju.displayName = zu;
|
|
4107
|
+
var Yu = "DropdownMenuRadioItem", Xu = s.forwardRef((e, t) => {
|
|
4108
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4109
|
+
return /* @__PURE__ */ p(Au, { ...r, ...o, ref: t });
|
|
4110
|
+
});
|
|
4111
|
+
Xu.displayName = Yu;
|
|
4112
|
+
var qu = "DropdownMenuItemIndicator", Zu = s.forwardRef((e, t) => {
|
|
4113
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4114
|
+
return /* @__PURE__ */ p(Ou, { ...r, ...o, ref: t });
|
|
4115
|
+
});
|
|
4116
|
+
Zu.displayName = qu;
|
|
4117
|
+
var Qu = "DropdownMenuSeparator", Ju = s.forwardRef((e, t) => {
|
|
4118
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4119
|
+
return /* @__PURE__ */ p(Du, { ...r, ...o, ref: t });
|
|
4120
|
+
});
|
|
4121
|
+
Ju.displayName = Qu;
|
|
4122
|
+
var ed = "DropdownMenuArrow", di = s.forwardRef(
|
|
4123
|
+
(e, t) => {
|
|
4124
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4125
|
+
return /* @__PURE__ */ p(Nu, { ...r, ...o, ref: t });
|
|
4126
|
+
}
|
|
4127
|
+
);
|
|
4128
|
+
di.displayName = ed;
|
|
4129
|
+
var td = "DropdownMenuSubTrigger", nd = s.forwardRef((e, t) => {
|
|
4130
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4131
|
+
return /* @__PURE__ */ p(Iu, { ...r, ...o, ref: t });
|
|
4132
|
+
});
|
|
4133
|
+
nd.displayName = td;
|
|
4134
|
+
var od = "DropdownMenuSubContent", rd = s.forwardRef((e, t) => {
|
|
4135
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = G(n);
|
|
4136
|
+
return /* @__PURE__ */ p(
|
|
4137
|
+
ku,
|
|
4138
|
+
{
|
|
4139
|
+
...r,
|
|
4140
|
+
...o,
|
|
4141
|
+
ref: t,
|
|
4142
|
+
style: {
|
|
4143
|
+
...e.style,
|
|
4144
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
4145
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
4146
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
4147
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
4148
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
);
|
|
4152
|
+
});
|
|
4153
|
+
rd.displayName = od;
|
|
4154
|
+
var id = ri, sd = si, cd = ci, ad = li, ld = ui, ud = di;
|
|
4155
|
+
const dd = "_menuButtonContent_boy14_1", fd = "_menuButtonItem_boy14_10", pd = "_menuButtonArrow_boy14_42", tn = {
|
|
4156
|
+
menuButtonContent: dd,
|
|
4157
|
+
menuButtonItem: fd,
|
|
4158
|
+
menuButtonArrow: pd
|
|
4159
|
+
}, Sf = ({ children: e, ...t }) => /* @__PURE__ */ K(id, { modal: !1, ...t, children: [
|
|
4160
|
+
/* @__PURE__ */ p(sd, { asChild: !0, children: /* @__PURE__ */ p(Ct, { "data-variant": "tertiary", iconOnly: !0, icon: "Menu" }) }),
|
|
4161
|
+
/* @__PURE__ */ p(cd, { children: /* @__PURE__ */ K(ad, { align: "end", className: tn.menuButtonContent, sideOffset: 5, children: [
|
|
4162
|
+
e,
|
|
4163
|
+
/* @__PURE__ */ p(ud, { className: tn.menuButtonArrow })
|
|
4164
|
+
] }) })
|
|
4165
|
+
] }), Pf = ({ children: e, ...t }) => /* @__PURE__ */ p(ld, { className: tn.menuButtonItem, ...t, children: e });
|
|
4166
|
+
var md = Object.freeze({
|
|
4167
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
4168
|
+
position: "absolute",
|
|
4169
|
+
border: 0,
|
|
4170
|
+
width: 1,
|
|
4171
|
+
height: 1,
|
|
4172
|
+
padding: 0,
|
|
4173
|
+
margin: -1,
|
|
4174
|
+
overflow: "hidden",
|
|
4175
|
+
clip: "rect(0, 0, 0, 0)",
|
|
4176
|
+
whiteSpace: "nowrap",
|
|
4177
|
+
wordWrap: "normal"
|
|
4178
|
+
}), vd = "VisuallyHidden", Nt = s.forwardRef(
|
|
4179
|
+
(e, t) => /* @__PURE__ */ p(
|
|
4180
|
+
I.span,
|
|
4181
|
+
{
|
|
4182
|
+
...e,
|
|
4183
|
+
ref: t,
|
|
4184
|
+
style: { ...md, ...e.style }
|
|
4185
|
+
}
|
|
4186
|
+
)
|
|
4187
|
+
);
|
|
4188
|
+
Nt.displayName = vd;
|
|
4189
|
+
var hd = Nt, Dn = "ToastProvider", [Nn, gd, wd] = hn("Toast"), [fi] = de("Toast", [wd]), [yd, It] = fi(Dn), pi = (e) => {
|
|
4190
|
+
const {
|
|
4191
|
+
__scopeToast: t,
|
|
4192
|
+
label: n = "Notification",
|
|
4193
|
+
duration: o = 5e3,
|
|
4194
|
+
swipeDirection: r = "right",
|
|
4195
|
+
swipeThreshold: i = 50,
|
|
4196
|
+
children: c
|
|
4197
|
+
} = e, [a, d] = s.useState(null), [l, u] = s.useState(0), f = s.useRef(!1), v = s.useRef(!1);
|
|
4198
|
+
return n.trim() || console.error(
|
|
4199
|
+
`Invalid prop \`label\` supplied to \`${Dn}\`. Expected non-empty \`string\`.`
|
|
4200
|
+
), /* @__PURE__ */ p(Nn.Provider, { scope: t, children: /* @__PURE__ */ p(
|
|
4201
|
+
yd,
|
|
4202
|
+
{
|
|
4203
|
+
scope: t,
|
|
4204
|
+
label: n,
|
|
4205
|
+
duration: o,
|
|
4206
|
+
swipeDirection: r,
|
|
4207
|
+
swipeThreshold: i,
|
|
4208
|
+
toastCount: l,
|
|
4209
|
+
viewport: a,
|
|
4210
|
+
onViewportChange: d,
|
|
4211
|
+
onToastAdd: s.useCallback(() => u((h) => h + 1), []),
|
|
4212
|
+
onToastRemove: s.useCallback(() => u((h) => h - 1), []),
|
|
4213
|
+
isFocusedToastEscapeKeyDownRef: f,
|
|
4214
|
+
isClosePausedRef: v,
|
|
4215
|
+
children: c
|
|
4216
|
+
}
|
|
4217
|
+
) });
|
|
4218
|
+
};
|
|
4219
|
+
pi.displayName = Dn;
|
|
4220
|
+
var mi = "ToastViewport", Cd = ["F8"], nn = "toast.viewportPause", on = "toast.viewportResume", vi = s.forwardRef(
|
|
4221
|
+
(e, t) => {
|
|
4222
|
+
const {
|
|
4223
|
+
__scopeToast: n,
|
|
4224
|
+
hotkey: o = Cd,
|
|
4225
|
+
label: r = "Notifications ({hotkey})",
|
|
4226
|
+
...i
|
|
4227
|
+
} = e, c = It(mi, n), a = gd(n), d = s.useRef(null), l = s.useRef(null), u = s.useRef(null), f = s.useRef(null), v = W(t, f, c.onViewportChange), h = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), w = c.toastCount > 0;
|
|
4228
|
+
s.useEffect(() => {
|
|
4229
|
+
const g = (y) => {
|
|
4230
|
+
o.length !== 0 && o.every((b) => y[b] || y.code === b) && f.current?.focus();
|
|
4231
|
+
};
|
|
4232
|
+
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
4233
|
+
}, [o]), s.useEffect(() => {
|
|
4234
|
+
const g = d.current, y = f.current;
|
|
4235
|
+
if (w && g && y) {
|
|
4236
|
+
const C = () => {
|
|
4237
|
+
if (!c.isClosePausedRef.current) {
|
|
4238
|
+
const T = new CustomEvent(nn);
|
|
4239
|
+
y.dispatchEvent(T), c.isClosePausedRef.current = !0;
|
|
4240
|
+
}
|
|
4241
|
+
}, b = () => {
|
|
4242
|
+
if (c.isClosePausedRef.current) {
|
|
4243
|
+
const T = new CustomEvent(on);
|
|
4244
|
+
y.dispatchEvent(T), c.isClosePausedRef.current = !1;
|
|
4245
|
+
}
|
|
4246
|
+
}, x = (T) => {
|
|
4247
|
+
!g.contains(T.relatedTarget) && b();
|
|
4248
|
+
}, E = () => {
|
|
4249
|
+
g.contains(document.activeElement) || b();
|
|
4250
|
+
};
|
|
4251
|
+
return g.addEventListener("focusin", C), g.addEventListener("focusout", x), g.addEventListener("pointermove", C), g.addEventListener("pointerleave", E), window.addEventListener("blur", C), window.addEventListener("focus", b), () => {
|
|
4252
|
+
g.removeEventListener("focusin", C), g.removeEventListener("focusout", x), g.removeEventListener("pointermove", C), g.removeEventListener("pointerleave", E), window.removeEventListener("blur", C), window.removeEventListener("focus", b);
|
|
4253
|
+
};
|
|
4254
|
+
}
|
|
4255
|
+
}, [w, c.isClosePausedRef]);
|
|
4256
|
+
const m = s.useCallback(
|
|
4257
|
+
({ tabbingDirection: g }) => {
|
|
4258
|
+
const C = a().map((b) => {
|
|
4259
|
+
const x = b.ref.current, E = [x, ...Nd(x)];
|
|
4260
|
+
return g === "forwards" ? E : E.reverse();
|
|
4261
|
+
});
|
|
4262
|
+
return (g === "forwards" ? C.reverse() : C).flat();
|
|
4263
|
+
},
|
|
4264
|
+
[a]
|
|
4265
|
+
);
|
|
4266
|
+
return s.useEffect(() => {
|
|
4267
|
+
const g = f.current;
|
|
4268
|
+
if (g) {
|
|
4269
|
+
const y = (C) => {
|
|
4270
|
+
const b = C.altKey || C.ctrlKey || C.metaKey;
|
|
4271
|
+
if (C.key === "Tab" && !b) {
|
|
4272
|
+
const E = document.activeElement, T = C.shiftKey;
|
|
4273
|
+
if (C.target === g && T) {
|
|
4274
|
+
l.current?.focus();
|
|
4275
|
+
return;
|
|
4276
|
+
}
|
|
4277
|
+
const N = m({ tabbingDirection: T ? "backwards" : "forwards" }), D = N.findIndex((k) => k === E);
|
|
4278
|
+
jt(N.slice(D + 1)) ? C.preventDefault() : T ? l.current?.focus() : u.current?.focus();
|
|
4279
|
+
}
|
|
4280
|
+
};
|
|
4281
|
+
return g.addEventListener("keydown", y), () => g.removeEventListener("keydown", y);
|
|
4282
|
+
}
|
|
4283
|
+
}, [a, m]), /* @__PURE__ */ K(
|
|
4284
|
+
tc,
|
|
4285
|
+
{
|
|
4286
|
+
ref: d,
|
|
4287
|
+
role: "region",
|
|
4288
|
+
"aria-label": r.replace("{hotkey}", h),
|
|
4289
|
+
tabIndex: -1,
|
|
4290
|
+
style: { pointerEvents: w ? void 0 : "none" },
|
|
4291
|
+
children: [
|
|
4292
|
+
w && /* @__PURE__ */ p(
|
|
4293
|
+
rn,
|
|
4294
|
+
{
|
|
4295
|
+
ref: l,
|
|
4296
|
+
onFocusFromOutsideViewport: () => {
|
|
4297
|
+
const g = m({
|
|
4298
|
+
tabbingDirection: "forwards"
|
|
4299
|
+
});
|
|
4300
|
+
jt(g);
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
),
|
|
4304
|
+
/* @__PURE__ */ p(Nn.Slot, { scope: n, children: /* @__PURE__ */ p(I.ol, { tabIndex: -1, ...i, ref: v }) }),
|
|
4305
|
+
w && /* @__PURE__ */ p(
|
|
4306
|
+
rn,
|
|
4307
|
+
{
|
|
4308
|
+
ref: u,
|
|
4309
|
+
onFocusFromOutsideViewport: () => {
|
|
4310
|
+
const g = m({
|
|
4311
|
+
tabbingDirection: "backwards"
|
|
4312
|
+
});
|
|
4313
|
+
jt(g);
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
)
|
|
4317
|
+
]
|
|
4318
|
+
}
|
|
4319
|
+
);
|
|
4320
|
+
}
|
|
4321
|
+
);
|
|
4322
|
+
vi.displayName = mi;
|
|
4323
|
+
var hi = "ToastFocusProxy", rn = s.forwardRef(
|
|
4324
|
+
(e, t) => {
|
|
4325
|
+
const { __scopeToast: n, onFocusFromOutsideViewport: o, ...r } = e, i = It(hi, n);
|
|
4326
|
+
return /* @__PURE__ */ p(
|
|
4327
|
+
Nt,
|
|
4328
|
+
{
|
|
4329
|
+
tabIndex: 0,
|
|
4330
|
+
...r,
|
|
4331
|
+
ref: t,
|
|
4332
|
+
style: { position: "fixed" },
|
|
4333
|
+
onFocus: (c) => {
|
|
4334
|
+
const a = c.relatedTarget;
|
|
4335
|
+
!i.viewport?.contains(a) && o();
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
);
|
|
4339
|
+
}
|
|
4340
|
+
);
|
|
4341
|
+
rn.displayName = hi;
|
|
4342
|
+
var Qe = "Toast", bd = "toast.swipeStart", xd = "toast.swipeMove", Ed = "toast.swipeCancel", Rd = "toast.swipeEnd", gi = s.forwardRef(
|
|
4343
|
+
(e, t) => {
|
|
4344
|
+
const { forceMount: n, open: o, defaultOpen: r, onOpenChange: i, ...c } = e, [a, d] = Ne({
|
|
4345
|
+
prop: o,
|
|
4346
|
+
defaultProp: r ?? !0,
|
|
4347
|
+
onChange: i,
|
|
4348
|
+
caller: Qe
|
|
4349
|
+
});
|
|
4350
|
+
return /* @__PURE__ */ p(Z, { present: n || a, children: /* @__PURE__ */ p(
|
|
4351
|
+
Pd,
|
|
4352
|
+
{
|
|
4353
|
+
open: a,
|
|
4354
|
+
...c,
|
|
4355
|
+
ref: t,
|
|
4356
|
+
onClose: () => d(!1),
|
|
4357
|
+
onPause: Y(e.onPause),
|
|
4358
|
+
onResume: Y(e.onResume),
|
|
4359
|
+
onSwipeStart: _(e.onSwipeStart, (l) => {
|
|
4360
|
+
l.currentTarget.setAttribute("data-swipe", "start");
|
|
4361
|
+
}),
|
|
4362
|
+
onSwipeMove: _(e.onSwipeMove, (l) => {
|
|
4363
|
+
const { x: u, y: f } = l.detail.delta;
|
|
4364
|
+
l.currentTarget.setAttribute("data-swipe", "move"), l.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${u}px`), l.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${f}px`);
|
|
4365
|
+
}),
|
|
4366
|
+
onSwipeCancel: _(e.onSwipeCancel, (l) => {
|
|
4367
|
+
l.currentTarget.setAttribute("data-swipe", "cancel"), l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
4368
|
+
}),
|
|
4369
|
+
onSwipeEnd: _(e.onSwipeEnd, (l) => {
|
|
4370
|
+
const { x: u, y: f } = l.detail.delta;
|
|
4371
|
+
l.currentTarget.setAttribute("data-swipe", "end"), l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), l.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${u}px`), l.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${f}px`), d(!1);
|
|
4372
|
+
})
|
|
4373
|
+
}
|
|
4374
|
+
) });
|
|
4375
|
+
}
|
|
4376
|
+
);
|
|
4377
|
+
gi.displayName = Qe;
|
|
4378
|
+
var [Td, Sd] = fi(Qe, {
|
|
4379
|
+
onClose() {
|
|
4380
|
+
}
|
|
4381
|
+
}), Pd = s.forwardRef(
|
|
4382
|
+
(e, t) => {
|
|
4383
|
+
const {
|
|
4384
|
+
__scopeToast: n,
|
|
4385
|
+
type: o = "foreground",
|
|
4386
|
+
duration: r,
|
|
4387
|
+
open: i,
|
|
4388
|
+
onClose: c,
|
|
4389
|
+
onEscapeKeyDown: a,
|
|
4390
|
+
onPause: d,
|
|
4391
|
+
onResume: l,
|
|
4392
|
+
onSwipeStart: u,
|
|
4393
|
+
onSwipeMove: f,
|
|
4394
|
+
onSwipeCancel: v,
|
|
4395
|
+
onSwipeEnd: h,
|
|
4396
|
+
...w
|
|
4397
|
+
} = e, m = It(Qe, n), [g, y] = s.useState(null), C = W(t, (P) => y(P)), b = s.useRef(null), x = s.useRef(null), E = r || m.duration, T = s.useRef(0), R = s.useRef(E), M = s.useRef(0), { onToastAdd: N, onToastRemove: D } = m, k = Y(() => {
|
|
4398
|
+
g?.contains(document.activeElement) && m.viewport?.focus(), c();
|
|
4399
|
+
}), B = s.useCallback(
|
|
4400
|
+
(P) => {
|
|
4401
|
+
!P || P === 1 / 0 || (window.clearTimeout(M.current), T.current = (/* @__PURE__ */ new Date()).getTime(), M.current = window.setTimeout(k, P));
|
|
4402
|
+
},
|
|
4403
|
+
[k]
|
|
4404
|
+
);
|
|
4405
|
+
s.useEffect(() => {
|
|
4406
|
+
const P = m.viewport;
|
|
4407
|
+
if (P) {
|
|
4408
|
+
const F = () => {
|
|
4409
|
+
B(R.current), l?.();
|
|
4410
|
+
}, O = () => {
|
|
4411
|
+
const $ = (/* @__PURE__ */ new Date()).getTime() - T.current;
|
|
4412
|
+
R.current = R.current - $, window.clearTimeout(M.current), d?.();
|
|
4413
|
+
};
|
|
4414
|
+
return P.addEventListener(nn, O), P.addEventListener(on, F), () => {
|
|
4415
|
+
P.removeEventListener(nn, O), P.removeEventListener(on, F);
|
|
4416
|
+
};
|
|
4417
|
+
}
|
|
4418
|
+
}, [m.viewport, E, d, l, B]), s.useEffect(() => {
|
|
4419
|
+
i && !m.isClosePausedRef.current && B(E);
|
|
4420
|
+
}, [i, E, m.isClosePausedRef, B]), s.useEffect(() => (N(), () => D()), [N, D]);
|
|
4421
|
+
const L = s.useMemo(() => g ? Ri(g) : null, [g]);
|
|
4422
|
+
return m.viewport ? /* @__PURE__ */ K(Ce, { children: [
|
|
4423
|
+
L && /* @__PURE__ */ p(
|
|
4424
|
+
_d,
|
|
4425
|
+
{
|
|
4426
|
+
__scopeToast: n,
|
|
4427
|
+
role: "status",
|
|
4428
|
+
"aria-live": o === "foreground" ? "assertive" : "polite",
|
|
4429
|
+
children: L
|
|
4430
|
+
}
|
|
4431
|
+
),
|
|
4432
|
+
/* @__PURE__ */ p(Td, { scope: n, onClose: k, children: an.createPortal(
|
|
4433
|
+
/* @__PURE__ */ p(Nn.ItemSlot, { scope: n, children: /* @__PURE__ */ p(
|
|
4434
|
+
ec,
|
|
4435
|
+
{
|
|
4436
|
+
asChild: !0,
|
|
4437
|
+
onEscapeKeyDown: _(a, () => {
|
|
4438
|
+
m.isFocusedToastEscapeKeyDownRef.current || k(), m.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
4439
|
+
}),
|
|
4440
|
+
children: /* @__PURE__ */ p(
|
|
4441
|
+
I.li,
|
|
4442
|
+
{
|
|
4443
|
+
tabIndex: 0,
|
|
4444
|
+
"data-state": i ? "open" : "closed",
|
|
4445
|
+
"data-swipe-direction": m.swipeDirection,
|
|
4446
|
+
...w,
|
|
4447
|
+
ref: C,
|
|
4448
|
+
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
4449
|
+
onKeyDown: _(e.onKeyDown, (P) => {
|
|
4450
|
+
P.key === "Escape" && (a?.(P.nativeEvent), P.nativeEvent.defaultPrevented || (m.isFocusedToastEscapeKeyDownRef.current = !0, k()));
|
|
4451
|
+
}),
|
|
4452
|
+
onPointerDown: _(e.onPointerDown, (P) => {
|
|
4453
|
+
P.button === 0 && (b.current = { x: P.clientX, y: P.clientY });
|
|
4454
|
+
}),
|
|
4455
|
+
onPointerMove: _(e.onPointerMove, (P) => {
|
|
4456
|
+
if (!b.current) return;
|
|
4457
|
+
const F = P.clientX - b.current.x, O = P.clientY - b.current.y, $ = !!x.current, A = ["left", "right"].includes(m.swipeDirection), S = ["left", "up"].includes(m.swipeDirection) ? Math.min : Math.max, H = A ? S(0, F) : 0, X = A ? 0 : S(0, O), Q = P.pointerType === "touch" ? 10 : 2, ne = { x: H, y: X }, fe = { originalEvent: P, delta: ne };
|
|
4458
|
+
$ ? (x.current = ne, lt(xd, f, fe, {
|
|
4459
|
+
discrete: !1
|
|
4460
|
+
})) : fo(ne, m.swipeDirection, Q) ? (x.current = ne, lt(bd, u, fe, {
|
|
4461
|
+
discrete: !1
|
|
4462
|
+
}), P.target.setPointerCapture(P.pointerId)) : (Math.abs(F) > Q || Math.abs(O) > Q) && (b.current = null);
|
|
4463
|
+
}),
|
|
4464
|
+
onPointerUp: _(e.onPointerUp, (P) => {
|
|
4465
|
+
const F = x.current, O = P.target;
|
|
4466
|
+
if (O.hasPointerCapture(P.pointerId) && O.releasePointerCapture(P.pointerId), x.current = null, b.current = null, F) {
|
|
4467
|
+
const $ = P.currentTarget, A = { originalEvent: P, delta: F };
|
|
4468
|
+
fo(F, m.swipeDirection, m.swipeThreshold) ? lt(Rd, h, A, {
|
|
4469
|
+
discrete: !0
|
|
4470
|
+
}) : lt(
|
|
4471
|
+
Ed,
|
|
4472
|
+
v,
|
|
4473
|
+
A,
|
|
4474
|
+
{
|
|
4475
|
+
discrete: !0
|
|
4476
|
+
}
|
|
4477
|
+
), $.addEventListener("click", (S) => S.preventDefault(), {
|
|
4478
|
+
once: !0
|
|
4479
|
+
});
|
|
4480
|
+
}
|
|
4481
|
+
})
|
|
4482
|
+
}
|
|
4483
|
+
)
|
|
4484
|
+
}
|
|
4485
|
+
) }),
|
|
4486
|
+
m.viewport
|
|
4487
|
+
) })
|
|
4488
|
+
] }) : null;
|
|
4489
|
+
}
|
|
4490
|
+
), _d = (e) => {
|
|
4491
|
+
const { __scopeToast: t, children: n, ...o } = e, r = It(Qe, t), [i, c] = s.useState(!1), [a, d] = s.useState(!1);
|
|
4492
|
+
return Od(() => c(!0)), s.useEffect(() => {
|
|
4493
|
+
const l = window.setTimeout(() => d(!0), 1e3);
|
|
4494
|
+
return () => window.clearTimeout(l);
|
|
4495
|
+
}, []), a ? null : /* @__PURE__ */ p(je, { asChild: !0, children: /* @__PURE__ */ p(Nt, { ...o, children: i && /* @__PURE__ */ K(Ce, { children: [
|
|
4496
|
+
r.label,
|
|
4497
|
+
" ",
|
|
4498
|
+
n
|
|
4499
|
+
] }) }) });
|
|
4500
|
+
}, Md = "ToastTitle", wi = s.forwardRef(
|
|
4501
|
+
(e, t) => {
|
|
4502
|
+
const { __scopeToast: n, ...o } = e;
|
|
4503
|
+
return /* @__PURE__ */ p(I.div, { ...o, ref: t });
|
|
4504
|
+
}
|
|
4505
|
+
);
|
|
4506
|
+
wi.displayName = Md;
|
|
4507
|
+
var Ad = "ToastDescription", yi = s.forwardRef(
|
|
4508
|
+
(e, t) => {
|
|
4509
|
+
const { __scopeToast: n, ...o } = e;
|
|
4510
|
+
return /* @__PURE__ */ p(I.div, { ...o, ref: t });
|
|
4511
|
+
}
|
|
4512
|
+
);
|
|
4513
|
+
yi.displayName = Ad;
|
|
4514
|
+
var Ci = "ToastAction", bi = s.forwardRef(
|
|
4515
|
+
(e, t) => {
|
|
4516
|
+
const { altText: n, ...o } = e;
|
|
4517
|
+
return n.trim() ? /* @__PURE__ */ p(Ei, { altText: n, asChild: !0, children: /* @__PURE__ */ p(In, { ...o, ref: t }) }) : (console.error(
|
|
4518
|
+
`Invalid prop \`altText\` supplied to \`${Ci}\`. Expected non-empty \`string\`.`
|
|
4519
|
+
), null);
|
|
4520
|
+
}
|
|
4521
|
+
);
|
|
4522
|
+
bi.displayName = Ci;
|
|
4523
|
+
var xi = "ToastClose", In = s.forwardRef(
|
|
4524
|
+
(e, t) => {
|
|
4525
|
+
const { __scopeToast: n, ...o } = e, r = Sd(xi, n);
|
|
4526
|
+
return /* @__PURE__ */ p(Ei, { asChild: !0, children: /* @__PURE__ */ p(
|
|
4527
|
+
I.button,
|
|
4528
|
+
{
|
|
4529
|
+
type: "button",
|
|
4530
|
+
...o,
|
|
4531
|
+
ref: t,
|
|
4532
|
+
onClick: _(e.onClick, r.onClose)
|
|
4533
|
+
}
|
|
4534
|
+
) });
|
|
4535
|
+
}
|
|
4536
|
+
);
|
|
4537
|
+
In.displayName = xi;
|
|
4538
|
+
var Ei = s.forwardRef((e, t) => {
|
|
4539
|
+
const { __scopeToast: n, altText: o, ...r } = e;
|
|
4540
|
+
return /* @__PURE__ */ p(
|
|
4541
|
+
I.div,
|
|
4542
|
+
{
|
|
4543
|
+
"data-radix-toast-announce-exclude": "",
|
|
4544
|
+
"data-radix-toast-announce-alt": o || void 0,
|
|
4545
|
+
...r,
|
|
4546
|
+
ref: t
|
|
4547
|
+
}
|
|
4548
|
+
);
|
|
4549
|
+
});
|
|
4550
|
+
function Ri(e) {
|
|
4551
|
+
const t = [];
|
|
4552
|
+
return Array.from(e.childNodes).forEach((o) => {
|
|
4553
|
+
if (o.nodeType === o.TEXT_NODE && o.textContent && t.push(o.textContent), Dd(o)) {
|
|
4554
|
+
const r = o.ariaHidden || o.hidden || o.style.display === "none", i = o.dataset.radixToastAnnounceExclude === "";
|
|
4555
|
+
if (!r)
|
|
4556
|
+
if (i) {
|
|
4557
|
+
const c = o.dataset.radixToastAnnounceAlt;
|
|
4558
|
+
c && t.push(c);
|
|
4559
|
+
} else
|
|
4560
|
+
t.push(...Ri(o));
|
|
4561
|
+
}
|
|
4562
|
+
}), t;
|
|
4563
|
+
}
|
|
4564
|
+
function lt(e, t, n, { discrete: o }) {
|
|
4565
|
+
const r = n.originalEvent.currentTarget, i = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: n });
|
|
4566
|
+
t && r.addEventListener(e, t, { once: !0 }), o ? ln(r, i) : r.dispatchEvent(i);
|
|
4567
|
+
}
|
|
4568
|
+
var fo = (e, t, n = 0) => {
|
|
4569
|
+
const o = Math.abs(e.x), r = Math.abs(e.y), i = o > r;
|
|
4570
|
+
return t === "left" || t === "right" ? i && o > n : !i && r > n;
|
|
4571
|
+
};
|
|
4572
|
+
function Od(e = () => {
|
|
4573
|
+
}) {
|
|
4574
|
+
const t = Y(e);
|
|
4575
|
+
ae(() => {
|
|
4576
|
+
let n = 0, o = 0;
|
|
4577
|
+
return n = window.requestAnimationFrame(() => o = window.requestAnimationFrame(t)), () => {
|
|
4578
|
+
window.cancelAnimationFrame(n), window.cancelAnimationFrame(o);
|
|
4579
|
+
};
|
|
4580
|
+
}, [t]);
|
|
4581
|
+
}
|
|
4582
|
+
function Dd(e) {
|
|
4583
|
+
return e.nodeType === e.ELEMENT_NODE;
|
|
4584
|
+
}
|
|
4585
|
+
function Nd(e) {
|
|
4586
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
4587
|
+
acceptNode: (o) => {
|
|
4588
|
+
const r = o.tagName === "INPUT" && o.type === "hidden";
|
|
4589
|
+
return o.disabled || o.hidden || r ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
4590
|
+
}
|
|
4591
|
+
});
|
|
4592
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
4593
|
+
return t;
|
|
4594
|
+
}
|
|
4595
|
+
function jt(e) {
|
|
4596
|
+
const t = document.activeElement;
|
|
4597
|
+
return e.some((n) => n === t ? !0 : (n.focus(), document.activeElement !== t));
|
|
4598
|
+
}
|
|
4599
|
+
var Id = pi, kd = vi, Ld = gi, Fd = wi, $d = yi, Bd = bi, Wd = In;
|
|
4600
|
+
const Hd = "_toast_7o27j_1", Vd = "_toastContent_7o27j_12", Kd = "_toastViewport_7o27j_70", Ud = "_toastTitle_7o27j_89", Gd = "_toastDescription_7o27j_95", _e = {
|
|
4601
|
+
toast: Hd,
|
|
4602
|
+
toastContent: Vd,
|
|
4603
|
+
toastViewport: Kd,
|
|
4604
|
+
toastTitle: Ud,
|
|
4605
|
+
toastDescription: Gd
|
|
4606
|
+
}, _f = ({ ...e }) => /* @__PURE__ */ p(Id, { ...e }), zd = Ge(({ ...e }, t) => /* @__PURE__ */ p(kd, { className: _e.toastViewport, ref: t, ...e }));
|
|
4607
|
+
zd.displayName = "ToastViewport";
|
|
4608
|
+
const jd = Ge(
|
|
4609
|
+
({ toastTitle: e, toastDescription: t, toastAction: n, ...o }, r) => /* @__PURE__ */ K(Ld, { className: _e.toast, ref: r, ...o, children: [
|
|
4610
|
+
/* @__PURE__ */ K("div", { className: _e.toastContent, children: [
|
|
4611
|
+
/* @__PURE__ */ p(Fd, { className: _e.toastTitle, children: e }),
|
|
4612
|
+
t && /* @__PURE__ */ p($d, { className: _e.toastDescription, children: t })
|
|
4613
|
+
] }),
|
|
4614
|
+
n && /* @__PURE__ */ p(Bd, { className: _e.toastAction, asChild: !0, altText: "Toast action", children: n }),
|
|
4615
|
+
/* @__PURE__ */ p(Wd, { asChild: !0, children: /* @__PURE__ */ p(Ct, { variant: "tertiary", iconOnly: !0, icon: "Close" }) })
|
|
4616
|
+
] })
|
|
4617
|
+
);
|
|
4618
|
+
jd.displayName = "Toast";
|
|
4619
|
+
var [kt] = de("Tooltip", [
|
|
4620
|
+
Mt
|
|
4621
|
+
]), Lt = Mt(), Ti = "TooltipProvider", Yd = 700, sn = "tooltip.open", [Xd, kn] = kt(Ti), Si = (e) => {
|
|
4622
|
+
const {
|
|
4623
|
+
__scopeTooltip: t,
|
|
4624
|
+
delayDuration: n = Yd,
|
|
4625
|
+
skipDelayDuration: o = 300,
|
|
4626
|
+
disableHoverableContent: r = !1,
|
|
4627
|
+
children: i
|
|
4628
|
+
} = e, c = s.useRef(!0), a = s.useRef(!1), d = s.useRef(0);
|
|
4629
|
+
return s.useEffect(() => {
|
|
4630
|
+
const l = d.current;
|
|
4631
|
+
return () => window.clearTimeout(l);
|
|
4632
|
+
}, []), /* @__PURE__ */ p(
|
|
4633
|
+
Xd,
|
|
4634
|
+
{
|
|
4635
|
+
scope: t,
|
|
4636
|
+
isOpenDelayedRef: c,
|
|
4637
|
+
delayDuration: n,
|
|
4638
|
+
onOpen: s.useCallback(() => {
|
|
4639
|
+
window.clearTimeout(d.current), c.current = !1;
|
|
4640
|
+
}, []),
|
|
4641
|
+
onClose: s.useCallback(() => {
|
|
4642
|
+
window.clearTimeout(d.current), d.current = window.setTimeout(
|
|
4643
|
+
() => c.current = !0,
|
|
4644
|
+
o
|
|
4645
|
+
);
|
|
4646
|
+
}, [o]),
|
|
4647
|
+
isPointerInTransitRef: a,
|
|
4648
|
+
onPointerInTransitChange: s.useCallback((l) => {
|
|
4649
|
+
a.current = l;
|
|
4650
|
+
}, []),
|
|
4651
|
+
disableHoverableContent: r,
|
|
4652
|
+
children: i
|
|
4653
|
+
}
|
|
4654
|
+
);
|
|
4655
|
+
};
|
|
4656
|
+
Si.displayName = Ti;
|
|
4657
|
+
var Ue = "Tooltip", [qd, Je] = kt(Ue), Pi = (e) => {
|
|
4658
|
+
const {
|
|
4659
|
+
__scopeTooltip: t,
|
|
4660
|
+
children: n,
|
|
4661
|
+
open: o,
|
|
4662
|
+
defaultOpen: r,
|
|
4663
|
+
onOpenChange: i,
|
|
4664
|
+
disableHoverableContent: c,
|
|
4665
|
+
delayDuration: a
|
|
4666
|
+
} = e, d = kn(Ue, e.__scopeTooltip), l = Lt(t), [u, f] = s.useState(null), v = ye(), h = s.useRef(0), w = c ?? d.disableHoverableContent, m = a ?? d.delayDuration, g = s.useRef(!1), [y, C] = Ne({
|
|
4667
|
+
prop: o,
|
|
4668
|
+
defaultProp: r ?? !1,
|
|
4669
|
+
onChange: (R) => {
|
|
4670
|
+
R ? (d.onOpen(), document.dispatchEvent(new CustomEvent(sn))) : d.onClose(), i?.(R);
|
|
4671
|
+
},
|
|
4672
|
+
caller: Ue
|
|
4673
|
+
}), b = s.useMemo(() => y ? g.current ? "delayed-open" : "instant-open" : "closed", [y]), x = s.useCallback(() => {
|
|
4674
|
+
window.clearTimeout(h.current), h.current = 0, g.current = !1, C(!0);
|
|
4675
|
+
}, [C]), E = s.useCallback(() => {
|
|
4676
|
+
window.clearTimeout(h.current), h.current = 0, C(!1);
|
|
4677
|
+
}, [C]), T = s.useCallback(() => {
|
|
4678
|
+
window.clearTimeout(h.current), h.current = window.setTimeout(() => {
|
|
4679
|
+
g.current = !0, C(!0), h.current = 0;
|
|
4680
|
+
}, m);
|
|
4681
|
+
}, [m, C]);
|
|
4682
|
+
return s.useEffect(() => () => {
|
|
4683
|
+
h.current && (window.clearTimeout(h.current), h.current = 0);
|
|
4684
|
+
}, []), /* @__PURE__ */ p(Rr, { ...l, children: /* @__PURE__ */ p(
|
|
4685
|
+
qd,
|
|
4686
|
+
{
|
|
4687
|
+
scope: t,
|
|
4688
|
+
contentId: v,
|
|
4689
|
+
open: y,
|
|
4690
|
+
stateAttribute: b,
|
|
4691
|
+
trigger: u,
|
|
4692
|
+
onTriggerChange: f,
|
|
4693
|
+
onTriggerEnter: s.useCallback(() => {
|
|
4694
|
+
d.isOpenDelayedRef.current ? T() : x();
|
|
4695
|
+
}, [d.isOpenDelayedRef, T, x]),
|
|
4696
|
+
onTriggerLeave: s.useCallback(() => {
|
|
4697
|
+
w ? E() : (window.clearTimeout(h.current), h.current = 0);
|
|
4698
|
+
}, [E, w]),
|
|
4699
|
+
onOpen: x,
|
|
4700
|
+
onClose: E,
|
|
4701
|
+
disableHoverableContent: w,
|
|
4702
|
+
children: n
|
|
4703
|
+
}
|
|
4704
|
+
) });
|
|
4705
|
+
};
|
|
4706
|
+
Pi.displayName = Ue;
|
|
4707
|
+
var cn = "TooltipTrigger", _i = s.forwardRef(
|
|
4708
|
+
(e, t) => {
|
|
4709
|
+
const { __scopeTooltip: n, ...o } = e, r = Je(cn, n), i = kn(cn, n), c = Lt(n), a = s.useRef(null), d = W(t, a, r.onTriggerChange), l = s.useRef(!1), u = s.useRef(!1), f = s.useCallback(() => l.current = !1, []);
|
|
4710
|
+
return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(Tr, { asChild: !0, ...c, children: /* @__PURE__ */ p(
|
|
4711
|
+
I.button,
|
|
4712
|
+
{
|
|
4713
|
+
"aria-describedby": r.open ? r.contentId : void 0,
|
|
4714
|
+
"data-state": r.stateAttribute,
|
|
4715
|
+
...o,
|
|
4716
|
+
ref: d,
|
|
4717
|
+
onPointerMove: _(e.onPointerMove, (v) => {
|
|
4718
|
+
v.pointerType !== "touch" && !u.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), u.current = !0);
|
|
4719
|
+
}),
|
|
4720
|
+
onPointerLeave: _(e.onPointerLeave, () => {
|
|
4721
|
+
r.onTriggerLeave(), u.current = !1;
|
|
4722
|
+
}),
|
|
4723
|
+
onPointerDown: _(e.onPointerDown, () => {
|
|
4724
|
+
r.open && r.onClose(), l.current = !0, document.addEventListener("pointerup", f, { once: !0 });
|
|
4725
|
+
}),
|
|
4726
|
+
onFocus: _(e.onFocus, () => {
|
|
4727
|
+
l.current || r.onOpen();
|
|
4728
|
+
}),
|
|
4729
|
+
onBlur: _(e.onBlur, r.onClose),
|
|
4730
|
+
onClick: _(e.onClick, r.onClose)
|
|
4731
|
+
}
|
|
4732
|
+
) });
|
|
4733
|
+
}
|
|
4734
|
+
);
|
|
4735
|
+
_i.displayName = cn;
|
|
4736
|
+
var Ln = "TooltipPortal", [Zd, Qd] = kt(Ln, {
|
|
4737
|
+
forceMount: void 0
|
|
4738
|
+
}), Mi = (e) => {
|
|
4739
|
+
const { __scopeTooltip: t, forceMount: n, children: o, container: r } = e, i = Je(Ln, t);
|
|
4740
|
+
return /* @__PURE__ */ p(Zd, { scope: t, forceMount: n, children: /* @__PURE__ */ p(Z, { present: n || i.open, children: /* @__PURE__ */ p(je, { asChild: !0, container: r, children: o }) }) });
|
|
4741
|
+
};
|
|
4742
|
+
Mi.displayName = Ln;
|
|
4743
|
+
var De = "TooltipContent", Ai = s.forwardRef(
|
|
4744
|
+
(e, t) => {
|
|
4745
|
+
const n = Qd(De, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, c = Je(De, e.__scopeTooltip);
|
|
4746
|
+
return /* @__PURE__ */ p(Z, { present: o || c.open, children: c.disableHoverableContent ? /* @__PURE__ */ p(Oi, { side: r, ...i, ref: t }) : /* @__PURE__ */ p(Jd, { side: r, ...i, ref: t }) });
|
|
4747
|
+
}
|
|
4748
|
+
), Jd = s.forwardRef((e, t) => {
|
|
4749
|
+
const n = Je(De, e.__scopeTooltip), o = kn(De, e.__scopeTooltip), r = s.useRef(null), i = W(t, r), [c, a] = s.useState(null), { trigger: d, onClose: l } = n, u = r.current, { onPointerInTransitChange: f } = o, v = s.useCallback(() => {
|
|
4750
|
+
a(null), f(!1);
|
|
4751
|
+
}, [f]), h = s.useCallback(
|
|
4752
|
+
(w, m) => {
|
|
4753
|
+
const g = w.currentTarget, y = { x: w.clientX, y: w.clientY }, C = of(y, g.getBoundingClientRect()), b = rf(y, C), x = sf(m.getBoundingClientRect()), E = af([...b, ...x]);
|
|
4754
|
+
a(E), f(!0);
|
|
4755
|
+
},
|
|
4756
|
+
[f]
|
|
4757
|
+
);
|
|
4758
|
+
return s.useEffect(() => () => v(), [v]), s.useEffect(() => {
|
|
4759
|
+
if (d && u) {
|
|
4760
|
+
const w = (g) => h(g, u), m = (g) => h(g, d);
|
|
4761
|
+
return d.addEventListener("pointerleave", w), u.addEventListener("pointerleave", m), () => {
|
|
4762
|
+
d.removeEventListener("pointerleave", w), u.removeEventListener("pointerleave", m);
|
|
4763
|
+
};
|
|
4764
|
+
}
|
|
4765
|
+
}, [d, u, h, v]), s.useEffect(() => {
|
|
4766
|
+
if (c) {
|
|
4767
|
+
const w = (m) => {
|
|
4768
|
+
const g = m.target, y = { x: m.clientX, y: m.clientY }, C = d?.contains(g) || u?.contains(g), b = !cf(y, c);
|
|
4769
|
+
C ? v() : b && (v(), l());
|
|
4770
|
+
};
|
|
4771
|
+
return document.addEventListener("pointermove", w), () => document.removeEventListener("pointermove", w);
|
|
4772
|
+
}
|
|
4773
|
+
}, [d, u, c, l, v]), /* @__PURE__ */ p(Oi, { ...e, ref: i });
|
|
4774
|
+
}), [ef, tf] = kt(Ue, { isInside: !1 }), nf = /* @__PURE__ */ Os("TooltipContent"), Oi = s.forwardRef(
|
|
4775
|
+
(e, t) => {
|
|
4776
|
+
const {
|
|
4777
|
+
__scopeTooltip: n,
|
|
4778
|
+
children: o,
|
|
4779
|
+
"aria-label": r,
|
|
4780
|
+
onEscapeKeyDown: i,
|
|
4781
|
+
onPointerDownOutside: c,
|
|
4782
|
+
...a
|
|
4783
|
+
} = e, d = Je(De, n), l = Lt(n), { onClose: u } = d;
|
|
4784
|
+
return s.useEffect(() => (document.addEventListener(sn, u), () => document.removeEventListener(sn, u)), [u]), s.useEffect(() => {
|
|
4785
|
+
if (d.trigger) {
|
|
4786
|
+
const f = (v) => {
|
|
4787
|
+
v.target?.contains(d.trigger) && u();
|
|
4788
|
+
};
|
|
4789
|
+
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
4790
|
+
}
|
|
4791
|
+
}, [d.trigger, u]), /* @__PURE__ */ p(
|
|
4792
|
+
ze,
|
|
4793
|
+
{
|
|
4794
|
+
asChild: !0,
|
|
4795
|
+
disableOutsidePointerEvents: !1,
|
|
4796
|
+
onEscapeKeyDown: i,
|
|
4797
|
+
onPointerDownOutside: c,
|
|
4798
|
+
onFocusOutside: (f) => f.preventDefault(),
|
|
4799
|
+
onDismiss: u,
|
|
4800
|
+
children: /* @__PURE__ */ K(
|
|
4801
|
+
Sr,
|
|
4802
|
+
{
|
|
4803
|
+
"data-state": d.stateAttribute,
|
|
4804
|
+
...l,
|
|
4805
|
+
...a,
|
|
4806
|
+
ref: t,
|
|
4807
|
+
style: {
|
|
4808
|
+
...a.style,
|
|
4809
|
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
4810
|
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
4811
|
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
4812
|
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
4813
|
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
4814
|
+
},
|
|
4815
|
+
children: [
|
|
4816
|
+
/* @__PURE__ */ p(nf, { children: o }),
|
|
4817
|
+
/* @__PURE__ */ p(ef, { scope: n, isInside: !0, children: /* @__PURE__ */ p(hd, { id: d.contentId, role: "tooltip", children: r || o }) })
|
|
4818
|
+
]
|
|
4819
|
+
}
|
|
4820
|
+
)
|
|
4821
|
+
}
|
|
4822
|
+
);
|
|
4823
|
+
}
|
|
4824
|
+
);
|
|
4825
|
+
Ai.displayName = De;
|
|
4826
|
+
var Di = "TooltipArrow", Ni = s.forwardRef(
|
|
4827
|
+
(e, t) => {
|
|
4828
|
+
const { __scopeTooltip: n, ...o } = e, r = Lt(n);
|
|
4829
|
+
return tf(
|
|
4830
|
+
Di,
|
|
4831
|
+
n
|
|
4832
|
+
).isInside ? null : /* @__PURE__ */ p(Pr, { ...r, ...o, ref: t });
|
|
4833
|
+
}
|
|
4834
|
+
);
|
|
4835
|
+
Ni.displayName = Di;
|
|
4836
|
+
function of(e, t) {
|
|
4837
|
+
const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
|
|
4838
|
+
switch (Math.min(n, o, r, i)) {
|
|
4839
|
+
case i:
|
|
4840
|
+
return "left";
|
|
4841
|
+
case r:
|
|
4842
|
+
return "right";
|
|
4843
|
+
case n:
|
|
4844
|
+
return "top";
|
|
4845
|
+
case o:
|
|
4846
|
+
return "bottom";
|
|
4847
|
+
default:
|
|
4848
|
+
throw new Error("unreachable");
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
function rf(e, t, n = 5) {
|
|
4852
|
+
const o = [];
|
|
4853
|
+
switch (t) {
|
|
4854
|
+
case "top":
|
|
4855
|
+
o.push(
|
|
4856
|
+
{ x: e.x - n, y: e.y + n },
|
|
4857
|
+
{ x: e.x + n, y: e.y + n }
|
|
4858
|
+
);
|
|
4859
|
+
break;
|
|
4860
|
+
case "bottom":
|
|
4861
|
+
o.push(
|
|
4862
|
+
{ x: e.x - n, y: e.y - n },
|
|
4863
|
+
{ x: e.x + n, y: e.y - n }
|
|
4864
|
+
);
|
|
4865
|
+
break;
|
|
4866
|
+
case "left":
|
|
4867
|
+
o.push(
|
|
4868
|
+
{ x: e.x + n, y: e.y - n },
|
|
4869
|
+
{ x: e.x + n, y: e.y + n }
|
|
4870
|
+
);
|
|
4871
|
+
break;
|
|
4872
|
+
case "right":
|
|
4873
|
+
o.push(
|
|
4874
|
+
{ x: e.x - n, y: e.y - n },
|
|
4875
|
+
{ x: e.x - n, y: e.y + n }
|
|
4876
|
+
);
|
|
4877
|
+
break;
|
|
4878
|
+
}
|
|
4879
|
+
return o;
|
|
4880
|
+
}
|
|
4881
|
+
function sf(e) {
|
|
4882
|
+
const { top: t, right: n, bottom: o, left: r } = e;
|
|
4883
|
+
return [
|
|
4884
|
+
{ x: r, y: t },
|
|
4885
|
+
{ x: n, y: t },
|
|
4886
|
+
{ x: n, y: o },
|
|
4887
|
+
{ x: r, y: o }
|
|
4888
|
+
];
|
|
4889
|
+
}
|
|
4890
|
+
function cf(e, t) {
|
|
4891
|
+
const { x: n, y: o } = e;
|
|
4892
|
+
let r = !1;
|
|
4893
|
+
for (let i = 0, c = t.length - 1; i < t.length; c = i++) {
|
|
4894
|
+
const a = t[i], d = t[c], l = a.x, u = a.y, f = d.x, v = d.y;
|
|
4895
|
+
u > o != v > o && n < (f - l) * (o - u) / (v - u) + l && (r = !r);
|
|
4896
|
+
}
|
|
4897
|
+
return r;
|
|
4898
|
+
}
|
|
4899
|
+
function af(e) {
|
|
4900
|
+
const t = e.slice();
|
|
4901
|
+
return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), lf(t);
|
|
4902
|
+
}
|
|
4903
|
+
function lf(e) {
|
|
4904
|
+
if (e.length <= 1) return e.slice();
|
|
4905
|
+
const t = [];
|
|
4906
|
+
for (let o = 0; o < e.length; o++) {
|
|
4907
|
+
const r = e[o];
|
|
4908
|
+
for (; t.length >= 2; ) {
|
|
4909
|
+
const i = t[t.length - 1], c = t[t.length - 2];
|
|
4910
|
+
if ((i.x - c.x) * (r.y - c.y) >= (i.y - c.y) * (r.x - c.x)) t.pop();
|
|
4911
|
+
else break;
|
|
4912
|
+
}
|
|
4913
|
+
t.push(r);
|
|
4914
|
+
}
|
|
4915
|
+
t.pop();
|
|
4916
|
+
const n = [];
|
|
4917
|
+
for (let o = e.length - 1; o >= 0; o--) {
|
|
4918
|
+
const r = e[o];
|
|
4919
|
+
for (; n.length >= 2; ) {
|
|
4920
|
+
const i = n[n.length - 1], c = n[n.length - 2];
|
|
4921
|
+
if ((i.x - c.x) * (r.y - c.y) >= (i.y - c.y) * (r.x - c.x)) n.pop();
|
|
4922
|
+
else break;
|
|
4923
|
+
}
|
|
4924
|
+
n.push(r);
|
|
4925
|
+
}
|
|
4926
|
+
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
4927
|
+
}
|
|
4928
|
+
var uf = Si, df = Pi, ff = _i, pf = Mi, mf = Ai, vf = Ni;
|
|
4929
|
+
const hf = "_tooltipContent_4rdhp_1", gf = "_tooltipArrow_4rdhp_12", po = {
|
|
4930
|
+
tooltipContent: hf,
|
|
4931
|
+
tooltipArrow: gf
|
|
4932
|
+
}, Mf = ({ ...e }) => /* @__PURE__ */ p(uf, { ...e });
|
|
4933
|
+
function Af({ children: e, content: t, open: n, defaultOpen: o, onOpenChange: r, ...i }) {
|
|
4934
|
+
return t === void 0 ? /* @__PURE__ */ p(Ce, { children: e }) : /* @__PURE__ */ K(
|
|
4935
|
+
df,
|
|
4936
|
+
{
|
|
4937
|
+
open: n,
|
|
4938
|
+
defaultOpen: o,
|
|
4939
|
+
onOpenChange: (c) => {
|
|
4940
|
+
r?.(c);
|
|
4941
|
+
},
|
|
4942
|
+
disableHoverableContent: !0,
|
|
4943
|
+
delayDuration: 200,
|
|
4944
|
+
children: [
|
|
4945
|
+
/* @__PURE__ */ p(ff, { asChild: !0, children: e }),
|
|
4946
|
+
/* @__PURE__ */ p(pf, { children: /* @__PURE__ */ K(mf, { className: po.tooltipContent, ...i, sideOffset: 4, children: [
|
|
4947
|
+
t,
|
|
4948
|
+
/* @__PURE__ */ p(vf, { className: po.tooltipArrow })
|
|
4949
|
+
] }) })
|
|
4950
|
+
]
|
|
4951
|
+
}
|
|
4952
|
+
);
|
|
4953
|
+
}
|
|
4954
|
+
export {
|
|
4955
|
+
ss as ArrowLeft,
|
|
4956
|
+
cs as ArrowRight,
|
|
4957
|
+
Ct as Button,
|
|
4958
|
+
mo as Check,
|
|
4959
|
+
xf as Checkbox,
|
|
4960
|
+
as as Circle,
|
|
4961
|
+
vo as Close,
|
|
4962
|
+
Rf as Dialog,
|
|
4963
|
+
ls as ExternalLink,
|
|
4964
|
+
us as Gear,
|
|
4965
|
+
ds as Hammer,
|
|
4966
|
+
fs as Heart,
|
|
4967
|
+
$n as IconMap,
|
|
4968
|
+
ps as Kebab,
|
|
4969
|
+
ms as Lightning,
|
|
4970
|
+
vs as Mail,
|
|
4971
|
+
hs as Menu,
|
|
4972
|
+
Sf as MenuButton,
|
|
4973
|
+
Pf as MenuButtonItem,
|
|
4974
|
+
gs as NoMobile,
|
|
4975
|
+
ws as Pencil,
|
|
4976
|
+
ho as Spinner,
|
|
4977
|
+
jd as Toast,
|
|
4978
|
+
_f as ToastProvider,
|
|
4979
|
+
zd as ToastViewport,
|
|
4980
|
+
Af as Tooltip,
|
|
4981
|
+
Mf as TooltipProvider,
|
|
4982
|
+
U as createIcon,
|
|
4983
|
+
bf as iconSizes
|
|
4984
|
+
};
|