@krosoft/react 0.0.71 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/KpiCards-Bjsd4bSz.js +40 -0
- package/dist/{SearchInput-LIey3bo9.js → SearchInput-Bu4wb0gI.js} +10 -9
- package/dist/ThemeSelector-DMgBLEYm.js +49 -0
- package/dist/Topbar-CFALRIJn.js +168 -0
- package/dist/{badge-Cj2EQgcL.js → badge-C4pCH7IL.js} +1 -1
- package/dist/components/core/cards/KpiCards.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +10 -8
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/theme/ThemeSelector.d.ts +8 -0
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -0
- package/dist/components/core/theme/index.d.ts +3 -0
- package/dist/components/core/theme/index.d.ts.map +1 -0
- package/dist/components/core/theme/index.js +4 -0
- package/dist/components/index.js +41 -30
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +27 -18
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +16 -112
- package/dist/hooks/ui/useTheme.d.ts +20 -0
- package/dist/hooks/ui/useTheme.d.ts.map +1 -0
- package/dist/index-BQOmHRsD.js +1662 -0
- package/dist/select-CdiR6cO0.js +2020 -0
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tailwind/index.js +3 -1
- package/dist/{toast-B6CC_ory.js → toast-BypnW71k.js} +1 -1
- package/dist/tooltip-Dep8OR3c.js +779 -0
- package/dist/useTheme-D__o7mLN.js +122 -0
- package/package.json +10 -2
- package/dist/KpiCards-D4Cy8CLT.js +0 -38
- package/dist/Topbar-CtXJ337W.js +0 -2314
- package/dist/index-BNCR478R.js +0 -272
|
@@ -0,0 +1,1662 @@
|
|
|
1
|
+
import { jsx as nt, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import { a as ne, c as oe } from "./index-gWiv5-6R.js";
|
|
3
|
+
import * as g from "react";
|
|
4
|
+
import { useLayoutEffect as re } from "react";
|
|
5
|
+
import { c as ie } from "./createLucideIcon-CRdjzt2A.js";
|
|
6
|
+
import * as se from "react-dom";
|
|
7
|
+
const Pt = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Lt = ne, ce = (t, e) => (n) => {
|
|
8
|
+
var o;
|
|
9
|
+
if ((e == null ? void 0 : e.variants) == null) return Lt(t, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
10
|
+
const { variants: r, defaultVariants: i } = e, s = Object.keys(r).map((f) => {
|
|
11
|
+
const l = n == null ? void 0 : n[f], u = i == null ? void 0 : i[f];
|
|
12
|
+
if (l === null) return null;
|
|
13
|
+
const d = Pt(l) || Pt(u);
|
|
14
|
+
return r[f][d];
|
|
15
|
+
}), c = n && Object.entries(n).reduce((f, l) => {
|
|
16
|
+
let [u, d] = l;
|
|
17
|
+
return d === void 0 || (f[u] = d), f;
|
|
18
|
+
}, {}), a = e == null || (o = e.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((f, l) => {
|
|
19
|
+
let { class: u, className: d, ...m } = l;
|
|
20
|
+
return Object.entries(m).every((h) => {
|
|
21
|
+
let [p, w] = h;
|
|
22
|
+
return Array.isArray(w) ? w.includes({
|
|
23
|
+
...i,
|
|
24
|
+
...c
|
|
25
|
+
}[p]) : {
|
|
26
|
+
...i,
|
|
27
|
+
...c
|
|
28
|
+
}[p] === w;
|
|
29
|
+
}) ? [
|
|
30
|
+
...f,
|
|
31
|
+
u,
|
|
32
|
+
d
|
|
33
|
+
] : f;
|
|
34
|
+
}, []);
|
|
35
|
+
return Lt(t, s, a, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
36
|
+
};
|
|
37
|
+
function Dt(t, e) {
|
|
38
|
+
if (typeof t == "function")
|
|
39
|
+
return t(e);
|
|
40
|
+
t != null && (t.current = e);
|
|
41
|
+
}
|
|
42
|
+
function It(...t) {
|
|
43
|
+
return (e) => {
|
|
44
|
+
let n = !1;
|
|
45
|
+
const o = t.map((r) => {
|
|
46
|
+
const i = Dt(r, e);
|
|
47
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
48
|
+
});
|
|
49
|
+
if (n)
|
|
50
|
+
return () => {
|
|
51
|
+
for (let r = 0; r < o.length; r++) {
|
|
52
|
+
const i = o[r];
|
|
53
|
+
typeof i == "function" ? i() : Dt(t[r], null);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function Cn(...t) {
|
|
59
|
+
return g.useCallback(It(...t), t);
|
|
60
|
+
}
|
|
61
|
+
// @__NO_SIDE_EFFECTS__
|
|
62
|
+
function le(t) {
|
|
63
|
+
const e = /* @__PURE__ */ ae(t), n = g.forwardRef((o, r) => {
|
|
64
|
+
const { children: i, ...s } = o, c = g.Children.toArray(i), a = c.find(ue);
|
|
65
|
+
if (a) {
|
|
66
|
+
const f = a.props.children, l = c.map((u) => u === a ? g.Children.count(f) > 1 ? g.Children.only(null) : g.isValidElement(f) ? f.props.children : null : u);
|
|
67
|
+
return /* @__PURE__ */ nt(e, { ...s, ref: r, children: g.isValidElement(f) ? g.cloneElement(f, void 0, l) : null });
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ nt(e, { ...s, ref: r, children: i });
|
|
70
|
+
});
|
|
71
|
+
return n.displayName = `${t}.Slot`, n;
|
|
72
|
+
}
|
|
73
|
+
var fe = /* @__PURE__ */ le("Slot");
|
|
74
|
+
// @__NO_SIDE_EFFECTS__
|
|
75
|
+
function ae(t) {
|
|
76
|
+
const e = g.forwardRef((n, o) => {
|
|
77
|
+
const { children: r, ...i } = n;
|
|
78
|
+
if (g.isValidElement(r)) {
|
|
79
|
+
const s = me(r), c = de(i, r.props);
|
|
80
|
+
return r.type !== g.Fragment && (c.ref = o ? It(o, s) : s), g.cloneElement(r, c);
|
|
81
|
+
}
|
|
82
|
+
return g.Children.count(r) > 1 ? g.Children.only(null) : null;
|
|
83
|
+
});
|
|
84
|
+
return e.displayName = `${t}.SlotClone`, e;
|
|
85
|
+
}
|
|
86
|
+
var jt = Symbol("radix.slottable");
|
|
87
|
+
// @__NO_SIDE_EFFECTS__
|
|
88
|
+
function An(t) {
|
|
89
|
+
const e = ({ children: n }) => /* @__PURE__ */ nt(ee, { children: n });
|
|
90
|
+
return e.displayName = `${t}.Slottable`, e.__radixId = jt, e;
|
|
91
|
+
}
|
|
92
|
+
function ue(t) {
|
|
93
|
+
return g.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === jt;
|
|
94
|
+
}
|
|
95
|
+
function de(t, e) {
|
|
96
|
+
const n = { ...e };
|
|
97
|
+
for (const o in e) {
|
|
98
|
+
const r = t[o], i = e[o];
|
|
99
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
|
|
100
|
+
const a = i(...c);
|
|
101
|
+
return r(...c), a;
|
|
102
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
103
|
+
}
|
|
104
|
+
return { ...t, ...n };
|
|
105
|
+
}
|
|
106
|
+
function me(t) {
|
|
107
|
+
var o, r;
|
|
108
|
+
let e = (o = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : o.get, n = e && "isReactWarning" in e && e.isReactWarning;
|
|
109
|
+
return n ? t.ref : (e = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
|
|
110
|
+
}
|
|
111
|
+
const he = ce(
|
|
112
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
113
|
+
{
|
|
114
|
+
variants: {
|
|
115
|
+
variant: {
|
|
116
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
117
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
118
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
119
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
120
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
121
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
122
|
+
styled: "bg-gradient-to-r from-slate-900 to-purple-700 hover:from-slate-800 hover:to-purple-600 text-white shadow-lg shadow-purple-500/25 px-6 h-12"
|
|
123
|
+
},
|
|
124
|
+
size: {
|
|
125
|
+
default: "h-10 px-4 py-2",
|
|
126
|
+
sm: "h-9 rounded-md px-3",
|
|
127
|
+
lg: "h-11 rounded-md px-8",
|
|
128
|
+
icon: "h-10 w-10"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
defaultVariants: {
|
|
132
|
+
variant: "default",
|
|
133
|
+
size: "default"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
), ge = g.forwardRef(({ className: t, variant: e, size: n, asChild: o = !1, ...r }, i) => /* @__PURE__ */ nt(o ? fe : "button", { className: oe(he({ variant: e, size: n, className: t })), ref: i, ...r }));
|
|
137
|
+
ge.displayName = "Button";
|
|
138
|
+
function On(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
139
|
+
return function(r) {
|
|
140
|
+
if (t == null || t(r), n === !1 || !r.defaultPrevented)
|
|
141
|
+
return e == null ? void 0 : e(r);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function En(t, e = []) {
|
|
145
|
+
let n = [];
|
|
146
|
+
function o(i, s) {
|
|
147
|
+
const c = g.createContext(s), a = n.length;
|
|
148
|
+
n = [...n, s];
|
|
149
|
+
const f = (u) => {
|
|
150
|
+
var y;
|
|
151
|
+
const { scope: d, children: m, ...h } = u, p = ((y = d == null ? void 0 : d[t]) == null ? void 0 : y[a]) || c, w = g.useMemo(() => h, Object.values(h));
|
|
152
|
+
return /* @__PURE__ */ nt(p.Provider, { value: w, children: m });
|
|
153
|
+
};
|
|
154
|
+
f.displayName = i + "Provider";
|
|
155
|
+
function l(u, d) {
|
|
156
|
+
var p;
|
|
157
|
+
const m = ((p = d == null ? void 0 : d[t]) == null ? void 0 : p[a]) || c, h = g.useContext(m);
|
|
158
|
+
if (h) return h;
|
|
159
|
+
if (s !== void 0) return s;
|
|
160
|
+
throw new Error(`\`${u}\` must be used within \`${i}\``);
|
|
161
|
+
}
|
|
162
|
+
return [f, l];
|
|
163
|
+
}
|
|
164
|
+
const r = () => {
|
|
165
|
+
const i = n.map((s) => g.createContext(s));
|
|
166
|
+
return function(c) {
|
|
167
|
+
const a = (c == null ? void 0 : c[t]) || i;
|
|
168
|
+
return g.useMemo(
|
|
169
|
+
() => ({ [`__scope${t}`]: { ...c, [t]: a } }),
|
|
170
|
+
[c, a]
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
return r.scopeName = t, [o, pe(r, ...e)];
|
|
175
|
+
}
|
|
176
|
+
function pe(...t) {
|
|
177
|
+
const e = t[0];
|
|
178
|
+
if (t.length === 1) return e;
|
|
179
|
+
const n = () => {
|
|
180
|
+
const o = t.map((r) => ({
|
|
181
|
+
useScope: r(),
|
|
182
|
+
scopeName: r.scopeName
|
|
183
|
+
}));
|
|
184
|
+
return function(i) {
|
|
185
|
+
const s = o.reduce((c, { useScope: a, scopeName: f }) => {
|
|
186
|
+
const u = a(i)[`__scope${f}`];
|
|
187
|
+
return { ...c, ...u };
|
|
188
|
+
}, {});
|
|
189
|
+
return g.useMemo(() => ({ [`__scope${e.scopeName}`]: s }), [s]);
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
return n.scopeName = e.scopeName, n;
|
|
193
|
+
}
|
|
194
|
+
function we(t) {
|
|
195
|
+
const e = g.useRef(t);
|
|
196
|
+
return g.useEffect(() => {
|
|
197
|
+
e.current = t;
|
|
198
|
+
}), g.useMemo(() => (...n) => {
|
|
199
|
+
var o;
|
|
200
|
+
return (o = e.current) == null ? void 0 : o.call(e, ...n);
|
|
201
|
+
}, []);
|
|
202
|
+
}
|
|
203
|
+
function Pn(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
204
|
+
const n = we(t);
|
|
205
|
+
g.useEffect(() => {
|
|
206
|
+
const o = (r) => {
|
|
207
|
+
r.key === "Escape" && n(r);
|
|
208
|
+
};
|
|
209
|
+
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
210
|
+
}, [n, e]);
|
|
211
|
+
}
|
|
212
|
+
var bt = globalThis != null && globalThis.document ? g.useLayoutEffect : () => {
|
|
213
|
+
}, ye = g[" useInsertionEffect ".trim().toString()] || bt;
|
|
214
|
+
function Ln({
|
|
215
|
+
prop: t,
|
|
216
|
+
defaultProp: e,
|
|
217
|
+
onChange: n = () => {
|
|
218
|
+
},
|
|
219
|
+
caller: o
|
|
220
|
+
}) {
|
|
221
|
+
const [r, i, s] = xe({
|
|
222
|
+
defaultProp: e,
|
|
223
|
+
onChange: n
|
|
224
|
+
}), c = t !== void 0, a = c ? t : r;
|
|
225
|
+
{
|
|
226
|
+
const l = g.useRef(t !== void 0);
|
|
227
|
+
g.useEffect(() => {
|
|
228
|
+
const u = l.current;
|
|
229
|
+
u !== c && console.warn(
|
|
230
|
+
`${o} is changing from ${u ? "controlled" : "uncontrolled"} to ${c ? "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.`
|
|
231
|
+
), l.current = c;
|
|
232
|
+
}, [c, o]);
|
|
233
|
+
}
|
|
234
|
+
const f = g.useCallback(
|
|
235
|
+
(l) => {
|
|
236
|
+
var u;
|
|
237
|
+
if (c) {
|
|
238
|
+
const d = ve(l) ? l(t) : l;
|
|
239
|
+
d !== t && ((u = s.current) == null || u.call(s, d));
|
|
240
|
+
} else
|
|
241
|
+
i(l);
|
|
242
|
+
},
|
|
243
|
+
[c, t, i, s]
|
|
244
|
+
);
|
|
245
|
+
return [a, f];
|
|
246
|
+
}
|
|
247
|
+
function xe({
|
|
248
|
+
defaultProp: t,
|
|
249
|
+
onChange: e
|
|
250
|
+
}) {
|
|
251
|
+
const [n, o] = g.useState(t), r = g.useRef(n), i = g.useRef(e);
|
|
252
|
+
return ye(() => {
|
|
253
|
+
i.current = e;
|
|
254
|
+
}, [e]), g.useEffect(() => {
|
|
255
|
+
var s;
|
|
256
|
+
r.current !== n && ((s = i.current) == null || s.call(i, n), r.current = n);
|
|
257
|
+
}, [n, r]), [n, o, i];
|
|
258
|
+
}
|
|
259
|
+
function ve(t) {
|
|
260
|
+
return typeof t == "function";
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* @license lucide-react v1.16.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/
|
|
268
|
+
const be = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Dn = ie("chevron-down", be);
|
|
269
|
+
var Re = g[" useId ".trim().toString()] || (() => {
|
|
270
|
+
}), Se = 0;
|
|
271
|
+
function Tn(t) {
|
|
272
|
+
const [e, n] = g.useState(Re());
|
|
273
|
+
return bt(() => {
|
|
274
|
+
n((o) => o ?? String(Se++));
|
|
275
|
+
}, [t]), e ? `radix-${e}` : "";
|
|
276
|
+
}
|
|
277
|
+
const Ce = ["top", "right", "bottom", "left"], U = Math.min, $ = Math.max, ct = Math.round, it = Math.floor, I = (t) => ({
|
|
278
|
+
x: t,
|
|
279
|
+
y: t
|
|
280
|
+
}), Ae = {
|
|
281
|
+
left: "right",
|
|
282
|
+
right: "left",
|
|
283
|
+
bottom: "top",
|
|
284
|
+
top: "bottom"
|
|
285
|
+
};
|
|
286
|
+
function yt(t, e, n) {
|
|
287
|
+
return $(t, U(e, n));
|
|
288
|
+
}
|
|
289
|
+
function H(t, e) {
|
|
290
|
+
return typeof t == "function" ? t(e) : t;
|
|
291
|
+
}
|
|
292
|
+
function X(t) {
|
|
293
|
+
return t.split("-")[0];
|
|
294
|
+
}
|
|
295
|
+
function tt(t) {
|
|
296
|
+
return t.split("-")[1];
|
|
297
|
+
}
|
|
298
|
+
function Rt(t) {
|
|
299
|
+
return t === "x" ? "y" : "x";
|
|
300
|
+
}
|
|
301
|
+
function St(t) {
|
|
302
|
+
return t === "y" ? "height" : "width";
|
|
303
|
+
}
|
|
304
|
+
function z(t) {
|
|
305
|
+
const e = t[0];
|
|
306
|
+
return e === "t" || e === "b" ? "y" : "x";
|
|
307
|
+
}
|
|
308
|
+
function Ct(t) {
|
|
309
|
+
return Rt(z(t));
|
|
310
|
+
}
|
|
311
|
+
function Oe(t, e, n) {
|
|
312
|
+
n === void 0 && (n = !1);
|
|
313
|
+
const o = tt(t), r = Ct(t), i = St(r);
|
|
314
|
+
let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
315
|
+
return e.reference[i] > e.floating[i] && (s = lt(s)), [s, lt(s)];
|
|
316
|
+
}
|
|
317
|
+
function Ee(t) {
|
|
318
|
+
const e = lt(t);
|
|
319
|
+
return [xt(t), e, xt(e)];
|
|
320
|
+
}
|
|
321
|
+
function xt(t) {
|
|
322
|
+
return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
|
|
323
|
+
}
|
|
324
|
+
const Tt = ["left", "right"], Mt = ["right", "left"], Pe = ["top", "bottom"], Le = ["bottom", "top"];
|
|
325
|
+
function De(t, e, n) {
|
|
326
|
+
switch (t) {
|
|
327
|
+
case "top":
|
|
328
|
+
case "bottom":
|
|
329
|
+
return n ? e ? Mt : Tt : e ? Tt : Mt;
|
|
330
|
+
case "left":
|
|
331
|
+
case "right":
|
|
332
|
+
return e ? Pe : Le;
|
|
333
|
+
default:
|
|
334
|
+
return [];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function Te(t, e, n, o) {
|
|
338
|
+
const r = tt(t);
|
|
339
|
+
let i = De(X(t), n === "start", o);
|
|
340
|
+
return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(xt)))), i;
|
|
341
|
+
}
|
|
342
|
+
function lt(t) {
|
|
343
|
+
const e = X(t);
|
|
344
|
+
return Ae[e] + t.slice(e.length);
|
|
345
|
+
}
|
|
346
|
+
function Me(t) {
|
|
347
|
+
return {
|
|
348
|
+
top: 0,
|
|
349
|
+
right: 0,
|
|
350
|
+
bottom: 0,
|
|
351
|
+
left: 0,
|
|
352
|
+
...t
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function Ht(t) {
|
|
356
|
+
return typeof t != "number" ? Me(t) : {
|
|
357
|
+
top: t,
|
|
358
|
+
right: t,
|
|
359
|
+
bottom: t,
|
|
360
|
+
left: t
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
function ft(t) {
|
|
364
|
+
const {
|
|
365
|
+
x: e,
|
|
366
|
+
y: n,
|
|
367
|
+
width: o,
|
|
368
|
+
height: r
|
|
369
|
+
} = t;
|
|
370
|
+
return {
|
|
371
|
+
width: o,
|
|
372
|
+
height: r,
|
|
373
|
+
top: n,
|
|
374
|
+
left: e,
|
|
375
|
+
right: e + o,
|
|
376
|
+
bottom: n + r,
|
|
377
|
+
x: e,
|
|
378
|
+
y: n
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function kt(t, e, n) {
|
|
382
|
+
let {
|
|
383
|
+
reference: o,
|
|
384
|
+
floating: r
|
|
385
|
+
} = t;
|
|
386
|
+
const i = z(e), s = Ct(e), c = St(s), a = X(e), f = i === "y", l = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, d = o[c] / 2 - r[c] / 2;
|
|
387
|
+
let m;
|
|
388
|
+
switch (a) {
|
|
389
|
+
case "top":
|
|
390
|
+
m = {
|
|
391
|
+
x: l,
|
|
392
|
+
y: o.y - r.height
|
|
393
|
+
};
|
|
394
|
+
break;
|
|
395
|
+
case "bottom":
|
|
396
|
+
m = {
|
|
397
|
+
x: l,
|
|
398
|
+
y: o.y + o.height
|
|
399
|
+
};
|
|
400
|
+
break;
|
|
401
|
+
case "right":
|
|
402
|
+
m = {
|
|
403
|
+
x: o.x + o.width,
|
|
404
|
+
y: u
|
|
405
|
+
};
|
|
406
|
+
break;
|
|
407
|
+
case "left":
|
|
408
|
+
m = {
|
|
409
|
+
x: o.x - r.width,
|
|
410
|
+
y: u
|
|
411
|
+
};
|
|
412
|
+
break;
|
|
413
|
+
default:
|
|
414
|
+
m = {
|
|
415
|
+
x: o.x,
|
|
416
|
+
y: o.y
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
switch (tt(e)) {
|
|
420
|
+
case "start":
|
|
421
|
+
m[s] -= d * (n && f ? -1 : 1);
|
|
422
|
+
break;
|
|
423
|
+
case "end":
|
|
424
|
+
m[s] += d * (n && f ? -1 : 1);
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
return m;
|
|
428
|
+
}
|
|
429
|
+
async function ke(t, e) {
|
|
430
|
+
var n;
|
|
431
|
+
e === void 0 && (e = {});
|
|
432
|
+
const {
|
|
433
|
+
x: o,
|
|
434
|
+
y: r,
|
|
435
|
+
platform: i,
|
|
436
|
+
rects: s,
|
|
437
|
+
elements: c,
|
|
438
|
+
strategy: a
|
|
439
|
+
} = t, {
|
|
440
|
+
boundary: f = "clippingAncestors",
|
|
441
|
+
rootBoundary: l = "viewport",
|
|
442
|
+
elementContext: u = "floating",
|
|
443
|
+
altBoundary: d = !1,
|
|
444
|
+
padding: m = 0
|
|
445
|
+
} = H(e, t), h = Ht(m), w = c[d ? u === "floating" ? "reference" : "floating" : u], y = ft(await i.getClippingRect({
|
|
446
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
447
|
+
boundary: f,
|
|
448
|
+
rootBoundary: l,
|
|
449
|
+
strategy: a
|
|
450
|
+
})), b = u === "floating" ? {
|
|
451
|
+
x: o,
|
|
452
|
+
y: r,
|
|
453
|
+
width: s.floating.width,
|
|
454
|
+
height: s.floating.height
|
|
455
|
+
} : s.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), x = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
|
456
|
+
x: 1,
|
|
457
|
+
y: 1
|
|
458
|
+
} : {
|
|
459
|
+
x: 1,
|
|
460
|
+
y: 1
|
|
461
|
+
}, R = ft(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
462
|
+
elements: c,
|
|
463
|
+
rect: b,
|
|
464
|
+
offsetParent: v,
|
|
465
|
+
strategy: a
|
|
466
|
+
}) : b);
|
|
467
|
+
return {
|
|
468
|
+
top: (y.top - R.top + h.top) / x.y,
|
|
469
|
+
bottom: (R.bottom - y.bottom + h.bottom) / x.y,
|
|
470
|
+
left: (y.left - R.left + h.left) / x.x,
|
|
471
|
+
right: (R.right - y.right + h.right) / x.x
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
const $e = 50, _e = async (t, e, n) => {
|
|
475
|
+
const {
|
|
476
|
+
placement: o = "bottom",
|
|
477
|
+
strategy: r = "absolute",
|
|
478
|
+
middleware: i = [],
|
|
479
|
+
platform: s
|
|
480
|
+
} = n, c = s.detectOverflow ? s : {
|
|
481
|
+
...s,
|
|
482
|
+
detectOverflow: ke
|
|
483
|
+
}, a = await (s.isRTL == null ? void 0 : s.isRTL(e));
|
|
484
|
+
let f = await s.getElementRects({
|
|
485
|
+
reference: t,
|
|
486
|
+
floating: e,
|
|
487
|
+
strategy: r
|
|
488
|
+
}), {
|
|
489
|
+
x: l,
|
|
490
|
+
y: u
|
|
491
|
+
} = kt(f, o, a), d = o, m = 0;
|
|
492
|
+
const h = {};
|
|
493
|
+
for (let p = 0; p < i.length; p++) {
|
|
494
|
+
const w = i[p];
|
|
495
|
+
if (!w)
|
|
496
|
+
continue;
|
|
497
|
+
const {
|
|
498
|
+
name: y,
|
|
499
|
+
fn: b
|
|
500
|
+
} = w, {
|
|
501
|
+
x: v,
|
|
502
|
+
y: x,
|
|
503
|
+
data: R,
|
|
504
|
+
reset: S
|
|
505
|
+
} = await b({
|
|
506
|
+
x: l,
|
|
507
|
+
y: u,
|
|
508
|
+
initialPlacement: o,
|
|
509
|
+
placement: d,
|
|
510
|
+
strategy: r,
|
|
511
|
+
middlewareData: h,
|
|
512
|
+
rects: f,
|
|
513
|
+
platform: c,
|
|
514
|
+
elements: {
|
|
515
|
+
reference: t,
|
|
516
|
+
floating: e
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
l = v ?? l, u = x ?? u, h[y] = {
|
|
520
|
+
...h[y],
|
|
521
|
+
...R
|
|
522
|
+
}, S && m < $e && (m++, typeof S == "object" && (S.placement && (d = S.placement), S.rects && (f = S.rects === !0 ? await s.getElementRects({
|
|
523
|
+
reference: t,
|
|
524
|
+
floating: e,
|
|
525
|
+
strategy: r
|
|
526
|
+
}) : S.rects), {
|
|
527
|
+
x: l,
|
|
528
|
+
y: u
|
|
529
|
+
} = kt(f, d, a)), p = -1);
|
|
530
|
+
}
|
|
531
|
+
return {
|
|
532
|
+
x: l,
|
|
533
|
+
y: u,
|
|
534
|
+
placement: d,
|
|
535
|
+
strategy: r,
|
|
536
|
+
middlewareData: h
|
|
537
|
+
};
|
|
538
|
+
}, Ne = (t) => ({
|
|
539
|
+
name: "arrow",
|
|
540
|
+
options: t,
|
|
541
|
+
async fn(e) {
|
|
542
|
+
const {
|
|
543
|
+
x: n,
|
|
544
|
+
y: o,
|
|
545
|
+
placement: r,
|
|
546
|
+
rects: i,
|
|
547
|
+
platform: s,
|
|
548
|
+
elements: c,
|
|
549
|
+
middlewareData: a
|
|
550
|
+
} = e, {
|
|
551
|
+
element: f,
|
|
552
|
+
padding: l = 0
|
|
553
|
+
} = H(t, e) || {};
|
|
554
|
+
if (f == null)
|
|
555
|
+
return {};
|
|
556
|
+
const u = Ht(l), d = {
|
|
557
|
+
x: n,
|
|
558
|
+
y: o
|
|
559
|
+
}, m = Ct(r), h = St(m), p = await s.getDimensions(f), w = m === "y", y = w ? "top" : "left", b = w ? "bottom" : "right", v = w ? "clientHeight" : "clientWidth", x = i.reference[h] + i.reference[m] - d[m] - i.floating[h], R = d[m] - i.reference[m], S = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
|
|
560
|
+
let A = S ? S[v] : 0;
|
|
561
|
+
(!A || !await (s.isElement == null ? void 0 : s.isElement(S))) && (A = c.floating[v] || i.floating[h]);
|
|
562
|
+
const L = x / 2 - R / 2, N = A / 2 - p[h] / 2 - 1, P = U(u[y], N), F = U(u[b], N), M = P, D = A - p[h] - F, O = A / 2 - p[h] / 2 + L, B = yt(M, O, D), E = !a.arrow && tt(r) != null && O !== B && i.reference[h] / 2 - (O < M ? P : F) - p[h] / 2 < 0, T = E ? O < M ? O - M : O - D : 0;
|
|
563
|
+
return {
|
|
564
|
+
[m]: d[m] + T,
|
|
565
|
+
data: {
|
|
566
|
+
[m]: B,
|
|
567
|
+
centerOffset: O - B - T,
|
|
568
|
+
...E && {
|
|
569
|
+
alignmentOffset: T
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
reset: E
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
}), Fe = function(t) {
|
|
576
|
+
return t === void 0 && (t = {}), {
|
|
577
|
+
name: "flip",
|
|
578
|
+
options: t,
|
|
579
|
+
async fn(e) {
|
|
580
|
+
var n, o;
|
|
581
|
+
const {
|
|
582
|
+
placement: r,
|
|
583
|
+
middlewareData: i,
|
|
584
|
+
rects: s,
|
|
585
|
+
initialPlacement: c,
|
|
586
|
+
platform: a,
|
|
587
|
+
elements: f
|
|
588
|
+
} = e, {
|
|
589
|
+
mainAxis: l = !0,
|
|
590
|
+
crossAxis: u = !0,
|
|
591
|
+
fallbackPlacements: d,
|
|
592
|
+
fallbackStrategy: m = "bestFit",
|
|
593
|
+
fallbackAxisSideDirection: h = "none",
|
|
594
|
+
flipAlignment: p = !0,
|
|
595
|
+
...w
|
|
596
|
+
} = H(t, e);
|
|
597
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
598
|
+
return {};
|
|
599
|
+
const y = X(r), b = z(c), v = X(c) === c, x = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), R = d || (v || !p ? [lt(c)] : Ee(c)), S = h !== "none";
|
|
600
|
+
!d && S && R.push(...Te(c, p, h, x));
|
|
601
|
+
const A = [c, ...R], L = await a.detectOverflow(e, w), N = [];
|
|
602
|
+
let P = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
603
|
+
if (l && N.push(L[y]), u) {
|
|
604
|
+
const O = Oe(r, s, x);
|
|
605
|
+
N.push(L[O[0]], L[O[1]]);
|
|
606
|
+
}
|
|
607
|
+
if (P = [...P, {
|
|
608
|
+
placement: r,
|
|
609
|
+
overflows: N
|
|
610
|
+
}], !N.every((O) => O <= 0)) {
|
|
611
|
+
var F, M;
|
|
612
|
+
const O = (((F = i.flip) == null ? void 0 : F.index) || 0) + 1, B = A[O];
|
|
613
|
+
if (B && (!(u === "alignment" ? b !== z(B) : !1) || // We leave the current main axis only if every placement on that axis
|
|
614
|
+
// overflows the main axis.
|
|
615
|
+
P.every((C) => z(C.placement) === b ? C.overflows[0] > 0 : !0)))
|
|
616
|
+
return {
|
|
617
|
+
data: {
|
|
618
|
+
index: O,
|
|
619
|
+
overflows: P
|
|
620
|
+
},
|
|
621
|
+
reset: {
|
|
622
|
+
placement: B
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
let E = (M = P.filter((T) => T.overflows[0] <= 0).sort((T, C) => T.overflows[1] - C.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
626
|
+
if (!E)
|
|
627
|
+
switch (m) {
|
|
628
|
+
case "bestFit": {
|
|
629
|
+
var D;
|
|
630
|
+
const T = (D = P.filter((C) => {
|
|
631
|
+
if (S) {
|
|
632
|
+
const k = z(C.placement);
|
|
633
|
+
return k === b || // Create a bias to the `y` side axis due to horizontal
|
|
634
|
+
// reading directions favoring greater width.
|
|
635
|
+
k === "y";
|
|
636
|
+
}
|
|
637
|
+
return !0;
|
|
638
|
+
}).map((C) => [C.placement, C.overflows.filter((k) => k > 0).reduce((k, K) => k + K, 0)]).sort((C, k) => C[1] - k[1])[0]) == null ? void 0 : D[0];
|
|
639
|
+
T && (E = T);
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
case "initialPlacement":
|
|
643
|
+
E = c;
|
|
644
|
+
break;
|
|
645
|
+
}
|
|
646
|
+
if (r !== E)
|
|
647
|
+
return {
|
|
648
|
+
reset: {
|
|
649
|
+
placement: E
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
return {};
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
};
|
|
657
|
+
function $t(t, e) {
|
|
658
|
+
return {
|
|
659
|
+
top: t.top - e.height,
|
|
660
|
+
right: t.right - e.width,
|
|
661
|
+
bottom: t.bottom - e.height,
|
|
662
|
+
left: t.left - e.width
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
function _t(t) {
|
|
666
|
+
return Ce.some((e) => t[e] >= 0);
|
|
667
|
+
}
|
|
668
|
+
const We = function(t) {
|
|
669
|
+
return t === void 0 && (t = {}), {
|
|
670
|
+
name: "hide",
|
|
671
|
+
options: t,
|
|
672
|
+
async fn(e) {
|
|
673
|
+
const {
|
|
674
|
+
rects: n,
|
|
675
|
+
platform: o
|
|
676
|
+
} = e, {
|
|
677
|
+
strategy: r = "referenceHidden",
|
|
678
|
+
...i
|
|
679
|
+
} = H(t, e);
|
|
680
|
+
switch (r) {
|
|
681
|
+
case "referenceHidden": {
|
|
682
|
+
const s = await o.detectOverflow(e, {
|
|
683
|
+
...i,
|
|
684
|
+
elementContext: "reference"
|
|
685
|
+
}), c = $t(s, n.reference);
|
|
686
|
+
return {
|
|
687
|
+
data: {
|
|
688
|
+
referenceHiddenOffsets: c,
|
|
689
|
+
referenceHidden: _t(c)
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
case "escaped": {
|
|
694
|
+
const s = await o.detectOverflow(e, {
|
|
695
|
+
...i,
|
|
696
|
+
altBoundary: !0
|
|
697
|
+
}), c = $t(s, n.floating);
|
|
698
|
+
return {
|
|
699
|
+
data: {
|
|
700
|
+
escapedOffsets: c,
|
|
701
|
+
escaped: _t(c)
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
default:
|
|
706
|
+
return {};
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
}, Xt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
711
|
+
async function Ve(t, e) {
|
|
712
|
+
const {
|
|
713
|
+
placement: n,
|
|
714
|
+
platform: o,
|
|
715
|
+
elements: r
|
|
716
|
+
} = t, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = X(n), c = tt(n), a = z(n) === "y", f = Xt.has(s) ? -1 : 1, l = i && a ? -1 : 1, u = H(e, t);
|
|
717
|
+
let {
|
|
718
|
+
mainAxis: d,
|
|
719
|
+
crossAxis: m,
|
|
720
|
+
alignmentAxis: h
|
|
721
|
+
} = typeof u == "number" ? {
|
|
722
|
+
mainAxis: u,
|
|
723
|
+
crossAxis: 0,
|
|
724
|
+
alignmentAxis: null
|
|
725
|
+
} : {
|
|
726
|
+
mainAxis: u.mainAxis || 0,
|
|
727
|
+
crossAxis: u.crossAxis || 0,
|
|
728
|
+
alignmentAxis: u.alignmentAxis
|
|
729
|
+
};
|
|
730
|
+
return c && typeof h == "number" && (m = c === "end" ? h * -1 : h), a ? {
|
|
731
|
+
x: m * l,
|
|
732
|
+
y: d * f
|
|
733
|
+
} : {
|
|
734
|
+
x: d * f,
|
|
735
|
+
y: m * l
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
const Be = function(t) {
|
|
739
|
+
return t === void 0 && (t = 0), {
|
|
740
|
+
name: "offset",
|
|
741
|
+
options: t,
|
|
742
|
+
async fn(e) {
|
|
743
|
+
var n, o;
|
|
744
|
+
const {
|
|
745
|
+
x: r,
|
|
746
|
+
y: i,
|
|
747
|
+
placement: s,
|
|
748
|
+
middlewareData: c
|
|
749
|
+
} = e, a = await Ve(e, t);
|
|
750
|
+
return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
|
|
751
|
+
x: r + a.x,
|
|
752
|
+
y: i + a.y,
|
|
753
|
+
data: {
|
|
754
|
+
...a,
|
|
755
|
+
placement: s
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
}, ze = function(t) {
|
|
761
|
+
return t === void 0 && (t = {}), {
|
|
762
|
+
name: "shift",
|
|
763
|
+
options: t,
|
|
764
|
+
async fn(e) {
|
|
765
|
+
const {
|
|
766
|
+
x: n,
|
|
767
|
+
y: o,
|
|
768
|
+
placement: r,
|
|
769
|
+
platform: i
|
|
770
|
+
} = e, {
|
|
771
|
+
mainAxis: s = !0,
|
|
772
|
+
crossAxis: c = !1,
|
|
773
|
+
limiter: a = {
|
|
774
|
+
fn: (y) => {
|
|
775
|
+
let {
|
|
776
|
+
x: b,
|
|
777
|
+
y: v
|
|
778
|
+
} = y;
|
|
779
|
+
return {
|
|
780
|
+
x: b,
|
|
781
|
+
y: v
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
...f
|
|
786
|
+
} = H(t, e), l = {
|
|
787
|
+
x: n,
|
|
788
|
+
y: o
|
|
789
|
+
}, u = await i.detectOverflow(e, f), d = z(X(r)), m = Rt(d);
|
|
790
|
+
let h = l[m], p = l[d];
|
|
791
|
+
if (s) {
|
|
792
|
+
const y = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", v = h + u[y], x = h - u[b];
|
|
793
|
+
h = yt(v, h, x);
|
|
794
|
+
}
|
|
795
|
+
if (c) {
|
|
796
|
+
const y = d === "y" ? "top" : "left", b = d === "y" ? "bottom" : "right", v = p + u[y], x = p - u[b];
|
|
797
|
+
p = yt(v, p, x);
|
|
798
|
+
}
|
|
799
|
+
const w = a.fn({
|
|
800
|
+
...e,
|
|
801
|
+
[m]: h,
|
|
802
|
+
[d]: p
|
|
803
|
+
});
|
|
804
|
+
return {
|
|
805
|
+
...w,
|
|
806
|
+
data: {
|
|
807
|
+
x: w.x - n,
|
|
808
|
+
y: w.y - o,
|
|
809
|
+
enabled: {
|
|
810
|
+
[m]: s,
|
|
811
|
+
[d]: c
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
}, Ie = function(t) {
|
|
818
|
+
return t === void 0 && (t = {}), {
|
|
819
|
+
options: t,
|
|
820
|
+
fn(e) {
|
|
821
|
+
const {
|
|
822
|
+
x: n,
|
|
823
|
+
y: o,
|
|
824
|
+
placement: r,
|
|
825
|
+
rects: i,
|
|
826
|
+
middlewareData: s
|
|
827
|
+
} = e, {
|
|
828
|
+
offset: c = 0,
|
|
829
|
+
mainAxis: a = !0,
|
|
830
|
+
crossAxis: f = !0
|
|
831
|
+
} = H(t, e), l = {
|
|
832
|
+
x: n,
|
|
833
|
+
y: o
|
|
834
|
+
}, u = z(r), d = Rt(u);
|
|
835
|
+
let m = l[d], h = l[u];
|
|
836
|
+
const p = H(c, e), w = typeof p == "number" ? {
|
|
837
|
+
mainAxis: p,
|
|
838
|
+
crossAxis: 0
|
|
839
|
+
} : {
|
|
840
|
+
mainAxis: 0,
|
|
841
|
+
crossAxis: 0,
|
|
842
|
+
...p
|
|
843
|
+
};
|
|
844
|
+
if (a) {
|
|
845
|
+
const v = d === "y" ? "height" : "width", x = i.reference[d] - i.floating[v] + w.mainAxis, R = i.reference[d] + i.reference[v] - w.mainAxis;
|
|
846
|
+
m < x ? m = x : m > R && (m = R);
|
|
847
|
+
}
|
|
848
|
+
if (f) {
|
|
849
|
+
var y, b;
|
|
850
|
+
const v = d === "y" ? "width" : "height", x = Xt.has(X(r)), R = i.reference[u] - i.floating[v] + (x && ((y = s.offset) == null ? void 0 : y[u]) || 0) + (x ? 0 : w.crossAxis), S = i.reference[u] + i.reference[v] + (x ? 0 : ((b = s.offset) == null ? void 0 : b[u]) || 0) - (x ? w.crossAxis : 0);
|
|
851
|
+
h < R ? h = R : h > S && (h = S);
|
|
852
|
+
}
|
|
853
|
+
return {
|
|
854
|
+
[d]: m,
|
|
855
|
+
[u]: h
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
}, je = function(t) {
|
|
860
|
+
return t === void 0 && (t = {}), {
|
|
861
|
+
name: "size",
|
|
862
|
+
options: t,
|
|
863
|
+
async fn(e) {
|
|
864
|
+
var n, o;
|
|
865
|
+
const {
|
|
866
|
+
placement: r,
|
|
867
|
+
rects: i,
|
|
868
|
+
platform: s,
|
|
869
|
+
elements: c
|
|
870
|
+
} = e, {
|
|
871
|
+
apply: a = () => {
|
|
872
|
+
},
|
|
873
|
+
...f
|
|
874
|
+
} = H(t, e), l = await s.detectOverflow(e, f), u = X(r), d = tt(r), m = z(r) === "y", {
|
|
875
|
+
width: h,
|
|
876
|
+
height: p
|
|
877
|
+
} = i.floating;
|
|
878
|
+
let w, y;
|
|
879
|
+
u === "top" || u === "bottom" ? (w = u, y = d === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (y = u, w = d === "end" ? "top" : "bottom");
|
|
880
|
+
const b = p - l.top - l.bottom, v = h - l.left - l.right, x = U(p - l[w], b), R = U(h - l[y], v), S = !e.middlewareData.shift;
|
|
881
|
+
let A = x, L = R;
|
|
882
|
+
if ((n = e.middlewareData.shift) != null && n.enabled.x && (L = v), (o = e.middlewareData.shift) != null && o.enabled.y && (A = b), S && !d) {
|
|
883
|
+
const P = $(l.left, 0), F = $(l.right, 0), M = $(l.top, 0), D = $(l.bottom, 0);
|
|
884
|
+
m ? L = h - 2 * (P !== 0 || F !== 0 ? P + F : $(l.left, l.right)) : A = p - 2 * (M !== 0 || D !== 0 ? M + D : $(l.top, l.bottom));
|
|
885
|
+
}
|
|
886
|
+
await a({
|
|
887
|
+
...e,
|
|
888
|
+
availableWidth: L,
|
|
889
|
+
availableHeight: A
|
|
890
|
+
});
|
|
891
|
+
const N = await s.getDimensions(c.floating);
|
|
892
|
+
return h !== N.width || p !== N.height ? {
|
|
893
|
+
reset: {
|
|
894
|
+
rects: !0
|
|
895
|
+
}
|
|
896
|
+
} : {};
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
function ut() {
|
|
901
|
+
return typeof window < "u";
|
|
902
|
+
}
|
|
903
|
+
function et(t) {
|
|
904
|
+
return qt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
905
|
+
}
|
|
906
|
+
function _(t) {
|
|
907
|
+
var e;
|
|
908
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
909
|
+
}
|
|
910
|
+
function j(t) {
|
|
911
|
+
var e;
|
|
912
|
+
return (e = (qt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
913
|
+
}
|
|
914
|
+
function qt(t) {
|
|
915
|
+
return ut() ? t instanceof Node || t instanceof _(t).Node : !1;
|
|
916
|
+
}
|
|
917
|
+
function W(t) {
|
|
918
|
+
return ut() ? t instanceof Element || t instanceof _(t).Element : !1;
|
|
919
|
+
}
|
|
920
|
+
function q(t) {
|
|
921
|
+
return ut() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
|
|
922
|
+
}
|
|
923
|
+
function Nt(t) {
|
|
924
|
+
return !ut() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
|
|
925
|
+
}
|
|
926
|
+
function rt(t) {
|
|
927
|
+
const {
|
|
928
|
+
overflow: e,
|
|
929
|
+
overflowX: n,
|
|
930
|
+
overflowY: o,
|
|
931
|
+
display: r
|
|
932
|
+
} = V(t);
|
|
933
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && r !== "inline" && r !== "contents";
|
|
934
|
+
}
|
|
935
|
+
function He(t) {
|
|
936
|
+
return /^(table|td|th)$/.test(et(t));
|
|
937
|
+
}
|
|
938
|
+
function dt(t) {
|
|
939
|
+
try {
|
|
940
|
+
if (t.matches(":popover-open"))
|
|
941
|
+
return !0;
|
|
942
|
+
} catch {
|
|
943
|
+
}
|
|
944
|
+
try {
|
|
945
|
+
return t.matches(":modal");
|
|
946
|
+
} catch {
|
|
947
|
+
return !1;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
const Xe = /transform|translate|scale|rotate|perspective|filter/, qe = /paint|layout|strict|content/, Z = (t) => !!t && t !== "none";
|
|
951
|
+
let gt;
|
|
952
|
+
function At(t) {
|
|
953
|
+
const e = W(t) ? V(t) : t;
|
|
954
|
+
return Z(e.transform) || Z(e.translate) || Z(e.scale) || Z(e.rotate) || Z(e.perspective) || !Ot() && (Z(e.backdropFilter) || Z(e.filter)) || Xe.test(e.willChange || "") || qe.test(e.contain || "");
|
|
955
|
+
}
|
|
956
|
+
function Ke(t) {
|
|
957
|
+
let e = Y(t);
|
|
958
|
+
for (; q(e) && !Q(e); ) {
|
|
959
|
+
if (At(e))
|
|
960
|
+
return e;
|
|
961
|
+
if (dt(e))
|
|
962
|
+
return null;
|
|
963
|
+
e = Y(e);
|
|
964
|
+
}
|
|
965
|
+
return null;
|
|
966
|
+
}
|
|
967
|
+
function Ot() {
|
|
968
|
+
return gt == null && (gt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), gt;
|
|
969
|
+
}
|
|
970
|
+
function Q(t) {
|
|
971
|
+
return /^(html|body|#document)$/.test(et(t));
|
|
972
|
+
}
|
|
973
|
+
function V(t) {
|
|
974
|
+
return _(t).getComputedStyle(t);
|
|
975
|
+
}
|
|
976
|
+
function mt(t) {
|
|
977
|
+
return W(t) ? {
|
|
978
|
+
scrollLeft: t.scrollLeft,
|
|
979
|
+
scrollTop: t.scrollTop
|
|
980
|
+
} : {
|
|
981
|
+
scrollLeft: t.scrollX,
|
|
982
|
+
scrollTop: t.scrollY
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function Y(t) {
|
|
986
|
+
if (et(t) === "html")
|
|
987
|
+
return t;
|
|
988
|
+
const e = (
|
|
989
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
990
|
+
t.assignedSlot || // DOM Element detected.
|
|
991
|
+
t.parentNode || // ShadowRoot detected.
|
|
992
|
+
Nt(t) && t.host || // Fallback.
|
|
993
|
+
j(t)
|
|
994
|
+
);
|
|
995
|
+
return Nt(e) ? e.host : e;
|
|
996
|
+
}
|
|
997
|
+
function Kt(t) {
|
|
998
|
+
const e = Y(t);
|
|
999
|
+
return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : q(e) && rt(e) ? e : Kt(e);
|
|
1000
|
+
}
|
|
1001
|
+
function ot(t, e, n) {
|
|
1002
|
+
var o;
|
|
1003
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
1004
|
+
const r = Kt(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = _(r);
|
|
1005
|
+
if (i) {
|
|
1006
|
+
const c = vt(s);
|
|
1007
|
+
return e.concat(s, s.visualViewport || [], rt(r) ? r : [], c && n ? ot(c) : []);
|
|
1008
|
+
} else
|
|
1009
|
+
return e.concat(r, ot(r, [], n));
|
|
1010
|
+
}
|
|
1011
|
+
function vt(t) {
|
|
1012
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
1013
|
+
}
|
|
1014
|
+
function Ut(t) {
|
|
1015
|
+
const e = V(t);
|
|
1016
|
+
let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
1017
|
+
const r = q(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = ct(n) !== i || ct(o) !== s;
|
|
1018
|
+
return c && (n = i, o = s), {
|
|
1019
|
+
width: n,
|
|
1020
|
+
height: o,
|
|
1021
|
+
$: c
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
function Et(t) {
|
|
1025
|
+
return W(t) ? t : t.contextElement;
|
|
1026
|
+
}
|
|
1027
|
+
function J(t) {
|
|
1028
|
+
const e = Et(t);
|
|
1029
|
+
if (!q(e))
|
|
1030
|
+
return I(1);
|
|
1031
|
+
const n = e.getBoundingClientRect(), {
|
|
1032
|
+
width: o,
|
|
1033
|
+
height: r,
|
|
1034
|
+
$: i
|
|
1035
|
+
} = Ut(e);
|
|
1036
|
+
let s = (i ? ct(n.width) : n.width) / o, c = (i ? ct(n.height) : n.height) / r;
|
|
1037
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
1038
|
+
x: s,
|
|
1039
|
+
y: c
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
const Ue = /* @__PURE__ */ I(0);
|
|
1043
|
+
function Yt(t) {
|
|
1044
|
+
const e = _(t);
|
|
1045
|
+
return !Ot() || !e.visualViewport ? Ue : {
|
|
1046
|
+
x: e.visualViewport.offsetLeft,
|
|
1047
|
+
y: e.visualViewport.offsetTop
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
function Ye(t, e, n) {
|
|
1051
|
+
return e === void 0 && (e = !1), !n || e && n !== _(t) ? !1 : e;
|
|
1052
|
+
}
|
|
1053
|
+
function G(t, e, n, o) {
|
|
1054
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
1055
|
+
const r = t.getBoundingClientRect(), i = Et(t);
|
|
1056
|
+
let s = I(1);
|
|
1057
|
+
e && (o ? W(o) && (s = J(o)) : s = J(t));
|
|
1058
|
+
const c = Ye(i, n, o) ? Yt(i) : I(0);
|
|
1059
|
+
let a = (r.left + c.x) / s.x, f = (r.top + c.y) / s.y, l = r.width / s.x, u = r.height / s.y;
|
|
1060
|
+
if (i) {
|
|
1061
|
+
const d = _(i), m = o && W(o) ? _(o) : o;
|
|
1062
|
+
let h = d, p = vt(h);
|
|
1063
|
+
for (; p && o && m !== h; ) {
|
|
1064
|
+
const w = J(p), y = p.getBoundingClientRect(), b = V(p), v = y.left + (p.clientLeft + parseFloat(b.paddingLeft)) * w.x, x = y.top + (p.clientTop + parseFloat(b.paddingTop)) * w.y;
|
|
1065
|
+
a *= w.x, f *= w.y, l *= w.x, u *= w.y, a += v, f += x, h = _(p), p = vt(h);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
return ft({
|
|
1069
|
+
width: l,
|
|
1070
|
+
height: u,
|
|
1071
|
+
x: a,
|
|
1072
|
+
y: f
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function ht(t, e) {
|
|
1076
|
+
const n = mt(t).scrollLeft;
|
|
1077
|
+
return e ? e.left + n : G(j(t)).left + n;
|
|
1078
|
+
}
|
|
1079
|
+
function Zt(t, e) {
|
|
1080
|
+
const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - ht(t, n), r = n.top + e.scrollTop;
|
|
1081
|
+
return {
|
|
1082
|
+
x: o,
|
|
1083
|
+
y: r
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
function Ze(t) {
|
|
1087
|
+
let {
|
|
1088
|
+
elements: e,
|
|
1089
|
+
rect: n,
|
|
1090
|
+
offsetParent: o,
|
|
1091
|
+
strategy: r
|
|
1092
|
+
} = t;
|
|
1093
|
+
const i = r === "fixed", s = j(o), c = e ? dt(e.floating) : !1;
|
|
1094
|
+
if (o === s || c && i)
|
|
1095
|
+
return n;
|
|
1096
|
+
let a = {
|
|
1097
|
+
scrollLeft: 0,
|
|
1098
|
+
scrollTop: 0
|
|
1099
|
+
}, f = I(1);
|
|
1100
|
+
const l = I(0), u = q(o);
|
|
1101
|
+
if ((u || !u && !i) && ((et(o) !== "body" || rt(s)) && (a = mt(o)), u)) {
|
|
1102
|
+
const m = G(o);
|
|
1103
|
+
f = J(o), l.x = m.x + o.clientLeft, l.y = m.y + o.clientTop;
|
|
1104
|
+
}
|
|
1105
|
+
const d = s && !u && !i ? Zt(s, a) : I(0);
|
|
1106
|
+
return {
|
|
1107
|
+
width: n.width * f.x,
|
|
1108
|
+
height: n.height * f.y,
|
|
1109
|
+
x: n.x * f.x - a.scrollLeft * f.x + l.x + d.x,
|
|
1110
|
+
y: n.y * f.y - a.scrollTop * f.y + l.y + d.y
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
function Ge(t) {
|
|
1114
|
+
return Array.from(t.getClientRects());
|
|
1115
|
+
}
|
|
1116
|
+
function Je(t) {
|
|
1117
|
+
const e = j(t), n = mt(t), o = t.ownerDocument.body, r = $(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = $(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
1118
|
+
let s = -n.scrollLeft + ht(t);
|
|
1119
|
+
const c = -n.scrollTop;
|
|
1120
|
+
return V(o).direction === "rtl" && (s += $(e.clientWidth, o.clientWidth) - r), {
|
|
1121
|
+
width: r,
|
|
1122
|
+
height: i,
|
|
1123
|
+
x: s,
|
|
1124
|
+
y: c
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
const Ft = 25;
|
|
1128
|
+
function Qe(t, e) {
|
|
1129
|
+
const n = _(t), o = j(t), r = n.visualViewport;
|
|
1130
|
+
let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
|
|
1131
|
+
if (r) {
|
|
1132
|
+
i = r.width, s = r.height;
|
|
1133
|
+
const l = Ot();
|
|
1134
|
+
(!l || l && e === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
|
|
1135
|
+
}
|
|
1136
|
+
const f = ht(o);
|
|
1137
|
+
if (f <= 0) {
|
|
1138
|
+
const l = o.ownerDocument, u = l.body, d = getComputedStyle(u), m = l.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, h = Math.abs(o.clientWidth - u.clientWidth - m);
|
|
1139
|
+
h <= Ft && (i -= h);
|
|
1140
|
+
} else f <= Ft && (i += f);
|
|
1141
|
+
return {
|
|
1142
|
+
width: i,
|
|
1143
|
+
height: s,
|
|
1144
|
+
x: c,
|
|
1145
|
+
y: a
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
function tn(t, e) {
|
|
1149
|
+
const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = q(t) ? J(t) : I(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, a = r * i.x, f = o * i.y;
|
|
1150
|
+
return {
|
|
1151
|
+
width: s,
|
|
1152
|
+
height: c,
|
|
1153
|
+
x: a,
|
|
1154
|
+
y: f
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function Wt(t, e, n) {
|
|
1158
|
+
let o;
|
|
1159
|
+
if (e === "viewport")
|
|
1160
|
+
o = Qe(t, n);
|
|
1161
|
+
else if (e === "document")
|
|
1162
|
+
o = Je(j(t));
|
|
1163
|
+
else if (W(e))
|
|
1164
|
+
o = tn(e, n);
|
|
1165
|
+
else {
|
|
1166
|
+
const r = Yt(t);
|
|
1167
|
+
o = {
|
|
1168
|
+
x: e.x - r.x,
|
|
1169
|
+
y: e.y - r.y,
|
|
1170
|
+
width: e.width,
|
|
1171
|
+
height: e.height
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
return ft(o);
|
|
1175
|
+
}
|
|
1176
|
+
function Gt(t, e) {
|
|
1177
|
+
const n = Y(t);
|
|
1178
|
+
return n === e || !W(n) || Q(n) ? !1 : V(n).position === "fixed" || Gt(n, e);
|
|
1179
|
+
}
|
|
1180
|
+
function en(t, e) {
|
|
1181
|
+
const n = e.get(t);
|
|
1182
|
+
if (n)
|
|
1183
|
+
return n;
|
|
1184
|
+
let o = ot(t, [], !1).filter((c) => W(c) && et(c) !== "body"), r = null;
|
|
1185
|
+
const i = V(t).position === "fixed";
|
|
1186
|
+
let s = i ? Y(t) : t;
|
|
1187
|
+
for (; W(s) && !Q(s); ) {
|
|
1188
|
+
const c = V(s), a = At(s);
|
|
1189
|
+
!a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && (r.position === "absolute" || r.position === "fixed") || rt(s) && !a && Gt(t, s)) ? o = o.filter((l) => l !== s) : r = c, s = Y(s);
|
|
1190
|
+
}
|
|
1191
|
+
return e.set(t, o), o;
|
|
1192
|
+
}
|
|
1193
|
+
function nn(t) {
|
|
1194
|
+
let {
|
|
1195
|
+
element: e,
|
|
1196
|
+
boundary: n,
|
|
1197
|
+
rootBoundary: o,
|
|
1198
|
+
strategy: r
|
|
1199
|
+
} = t;
|
|
1200
|
+
const s = [...n === "clippingAncestors" ? dt(e) ? [] : en(e, this._c) : [].concat(n), o], c = Wt(e, s[0], r);
|
|
1201
|
+
let a = c.top, f = c.right, l = c.bottom, u = c.left;
|
|
1202
|
+
for (let d = 1; d < s.length; d++) {
|
|
1203
|
+
const m = Wt(e, s[d], r);
|
|
1204
|
+
a = $(m.top, a), f = U(m.right, f), l = U(m.bottom, l), u = $(m.left, u);
|
|
1205
|
+
}
|
|
1206
|
+
return {
|
|
1207
|
+
width: f - u,
|
|
1208
|
+
height: l - a,
|
|
1209
|
+
x: u,
|
|
1210
|
+
y: a
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
function on(t) {
|
|
1214
|
+
const {
|
|
1215
|
+
width: e,
|
|
1216
|
+
height: n
|
|
1217
|
+
} = Ut(t);
|
|
1218
|
+
return {
|
|
1219
|
+
width: e,
|
|
1220
|
+
height: n
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
function rn(t, e, n) {
|
|
1224
|
+
const o = q(e), r = j(e), i = n === "fixed", s = G(t, !0, i, e);
|
|
1225
|
+
let c = {
|
|
1226
|
+
scrollLeft: 0,
|
|
1227
|
+
scrollTop: 0
|
|
1228
|
+
};
|
|
1229
|
+
const a = I(0);
|
|
1230
|
+
function f() {
|
|
1231
|
+
a.x = ht(r);
|
|
1232
|
+
}
|
|
1233
|
+
if (o || !o && !i)
|
|
1234
|
+
if ((et(e) !== "body" || rt(r)) && (c = mt(e)), o) {
|
|
1235
|
+
const m = G(e, !0, i, e);
|
|
1236
|
+
a.x = m.x + e.clientLeft, a.y = m.y + e.clientTop;
|
|
1237
|
+
} else r && f();
|
|
1238
|
+
i && !o && r && f();
|
|
1239
|
+
const l = r && !o && !i ? Zt(r, c) : I(0), u = s.left + c.scrollLeft - a.x - l.x, d = s.top + c.scrollTop - a.y - l.y;
|
|
1240
|
+
return {
|
|
1241
|
+
x: u,
|
|
1242
|
+
y: d,
|
|
1243
|
+
width: s.width,
|
|
1244
|
+
height: s.height
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
function pt(t) {
|
|
1248
|
+
return V(t).position === "static";
|
|
1249
|
+
}
|
|
1250
|
+
function Vt(t, e) {
|
|
1251
|
+
if (!q(t) || V(t).position === "fixed")
|
|
1252
|
+
return null;
|
|
1253
|
+
if (e)
|
|
1254
|
+
return e(t);
|
|
1255
|
+
let n = t.offsetParent;
|
|
1256
|
+
return j(t) === n && (n = n.ownerDocument.body), n;
|
|
1257
|
+
}
|
|
1258
|
+
function Jt(t, e) {
|
|
1259
|
+
const n = _(t);
|
|
1260
|
+
if (dt(t))
|
|
1261
|
+
return n;
|
|
1262
|
+
if (!q(t)) {
|
|
1263
|
+
let r = Y(t);
|
|
1264
|
+
for (; r && !Q(r); ) {
|
|
1265
|
+
if (W(r) && !pt(r))
|
|
1266
|
+
return r;
|
|
1267
|
+
r = Y(r);
|
|
1268
|
+
}
|
|
1269
|
+
return n;
|
|
1270
|
+
}
|
|
1271
|
+
let o = Vt(t, e);
|
|
1272
|
+
for (; o && He(o) && pt(o); )
|
|
1273
|
+
o = Vt(o, e);
|
|
1274
|
+
return o && Q(o) && pt(o) && !At(o) ? n : o || Ke(t) || n;
|
|
1275
|
+
}
|
|
1276
|
+
const sn = async function(t) {
|
|
1277
|
+
const e = this.getOffsetParent || Jt, n = this.getDimensions, o = await n(t.floating);
|
|
1278
|
+
return {
|
|
1279
|
+
reference: rn(t.reference, await e(t.floating), t.strategy),
|
|
1280
|
+
floating: {
|
|
1281
|
+
x: 0,
|
|
1282
|
+
y: 0,
|
|
1283
|
+
width: o.width,
|
|
1284
|
+
height: o.height
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
function cn(t) {
|
|
1289
|
+
return V(t).direction === "rtl";
|
|
1290
|
+
}
|
|
1291
|
+
const ln = {
|
|
1292
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ze,
|
|
1293
|
+
getDocumentElement: j,
|
|
1294
|
+
getClippingRect: nn,
|
|
1295
|
+
getOffsetParent: Jt,
|
|
1296
|
+
getElementRects: sn,
|
|
1297
|
+
getClientRects: Ge,
|
|
1298
|
+
getDimensions: on,
|
|
1299
|
+
getScale: J,
|
|
1300
|
+
isElement: W,
|
|
1301
|
+
isRTL: cn
|
|
1302
|
+
};
|
|
1303
|
+
function Qt(t, e) {
|
|
1304
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1305
|
+
}
|
|
1306
|
+
function fn(t, e) {
|
|
1307
|
+
let n = null, o;
|
|
1308
|
+
const r = j(t);
|
|
1309
|
+
function i() {
|
|
1310
|
+
var c;
|
|
1311
|
+
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
1312
|
+
}
|
|
1313
|
+
function s(c, a) {
|
|
1314
|
+
c === void 0 && (c = !1), a === void 0 && (a = 1), i();
|
|
1315
|
+
const f = t.getBoundingClientRect(), {
|
|
1316
|
+
left: l,
|
|
1317
|
+
top: u,
|
|
1318
|
+
width: d,
|
|
1319
|
+
height: m
|
|
1320
|
+
} = f;
|
|
1321
|
+
if (c || e(), !d || !m)
|
|
1322
|
+
return;
|
|
1323
|
+
const h = it(u), p = it(r.clientWidth - (l + d)), w = it(r.clientHeight - (u + m)), y = it(l), v = {
|
|
1324
|
+
rootMargin: -h + "px " + -p + "px " + -w + "px " + -y + "px",
|
|
1325
|
+
threshold: $(0, U(1, a)) || 1
|
|
1326
|
+
};
|
|
1327
|
+
let x = !0;
|
|
1328
|
+
function R(S) {
|
|
1329
|
+
const A = S[0].intersectionRatio;
|
|
1330
|
+
if (A !== a) {
|
|
1331
|
+
if (!x)
|
|
1332
|
+
return s();
|
|
1333
|
+
A ? s(!1, A) : o = setTimeout(() => {
|
|
1334
|
+
s(!1, 1e-7);
|
|
1335
|
+
}, 1e3);
|
|
1336
|
+
}
|
|
1337
|
+
A === 1 && !Qt(f, t.getBoundingClientRect()) && s(), x = !1;
|
|
1338
|
+
}
|
|
1339
|
+
try {
|
|
1340
|
+
n = new IntersectionObserver(R, {
|
|
1341
|
+
...v,
|
|
1342
|
+
// Handle <iframe>s
|
|
1343
|
+
root: r.ownerDocument
|
|
1344
|
+
});
|
|
1345
|
+
} catch {
|
|
1346
|
+
n = new IntersectionObserver(R, v);
|
|
1347
|
+
}
|
|
1348
|
+
n.observe(t);
|
|
1349
|
+
}
|
|
1350
|
+
return s(!0), i;
|
|
1351
|
+
}
|
|
1352
|
+
function Mn(t, e, n, o) {
|
|
1353
|
+
o === void 0 && (o = {});
|
|
1354
|
+
const {
|
|
1355
|
+
ancestorScroll: r = !0,
|
|
1356
|
+
ancestorResize: i = !0,
|
|
1357
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1358
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1359
|
+
animationFrame: a = !1
|
|
1360
|
+
} = o, f = Et(t), l = r || i ? [...f ? ot(f) : [], ...e ? ot(e) : []] : [];
|
|
1361
|
+
l.forEach((y) => {
|
|
1362
|
+
r && y.addEventListener("scroll", n, {
|
|
1363
|
+
passive: !0
|
|
1364
|
+
}), i && y.addEventListener("resize", n);
|
|
1365
|
+
});
|
|
1366
|
+
const u = f && c ? fn(f, n) : null;
|
|
1367
|
+
let d = -1, m = null;
|
|
1368
|
+
s && (m = new ResizeObserver((y) => {
|
|
1369
|
+
let [b] = y;
|
|
1370
|
+
b && b.target === f && m && e && (m.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
1371
|
+
var v;
|
|
1372
|
+
(v = m) == null || v.observe(e);
|
|
1373
|
+
})), n();
|
|
1374
|
+
}), f && !a && m.observe(f), e && m.observe(e));
|
|
1375
|
+
let h, p = a ? G(t) : null;
|
|
1376
|
+
a && w();
|
|
1377
|
+
function w() {
|
|
1378
|
+
const y = G(t);
|
|
1379
|
+
p && !Qt(p, y) && n(), p = y, h = requestAnimationFrame(w);
|
|
1380
|
+
}
|
|
1381
|
+
return n(), () => {
|
|
1382
|
+
var y;
|
|
1383
|
+
l.forEach((b) => {
|
|
1384
|
+
r && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
|
|
1385
|
+
}), u == null || u(), (y = m) == null || y.disconnect(), m = null, a && cancelAnimationFrame(h);
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
const an = Be, un = ze, dn = Fe, mn = je, hn = We, Bt = Ne, gn = Ie, pn = (t, e, n) => {
|
|
1389
|
+
const o = /* @__PURE__ */ new Map(), r = {
|
|
1390
|
+
platform: ln,
|
|
1391
|
+
...n
|
|
1392
|
+
}, i = {
|
|
1393
|
+
...r.platform,
|
|
1394
|
+
_c: o
|
|
1395
|
+
};
|
|
1396
|
+
return _e(t, e, {
|
|
1397
|
+
...r,
|
|
1398
|
+
platform: i
|
|
1399
|
+
});
|
|
1400
|
+
};
|
|
1401
|
+
var wn = typeof document < "u", yn = function() {
|
|
1402
|
+
}, st = wn ? re : yn;
|
|
1403
|
+
function at(t, e) {
|
|
1404
|
+
if (t === e)
|
|
1405
|
+
return !0;
|
|
1406
|
+
if (typeof t != typeof e)
|
|
1407
|
+
return !1;
|
|
1408
|
+
if (typeof t == "function" && t.toString() === e.toString())
|
|
1409
|
+
return !0;
|
|
1410
|
+
let n, o, r;
|
|
1411
|
+
if (t && e && typeof t == "object") {
|
|
1412
|
+
if (Array.isArray(t)) {
|
|
1413
|
+
if (n = t.length, n !== e.length) return !1;
|
|
1414
|
+
for (o = n; o-- !== 0; )
|
|
1415
|
+
if (!at(t[o], e[o]))
|
|
1416
|
+
return !1;
|
|
1417
|
+
return !0;
|
|
1418
|
+
}
|
|
1419
|
+
if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length)
|
|
1420
|
+
return !1;
|
|
1421
|
+
for (o = n; o-- !== 0; )
|
|
1422
|
+
if (!{}.hasOwnProperty.call(e, r[o]))
|
|
1423
|
+
return !1;
|
|
1424
|
+
for (o = n; o-- !== 0; ) {
|
|
1425
|
+
const i = r[o];
|
|
1426
|
+
if (!(i === "_owner" && t.$$typeof) && !at(t[i], e[i]))
|
|
1427
|
+
return !1;
|
|
1428
|
+
}
|
|
1429
|
+
return !0;
|
|
1430
|
+
}
|
|
1431
|
+
return t !== t && e !== e;
|
|
1432
|
+
}
|
|
1433
|
+
function te(t) {
|
|
1434
|
+
return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1435
|
+
}
|
|
1436
|
+
function zt(t, e) {
|
|
1437
|
+
const n = te(t);
|
|
1438
|
+
return Math.round(e * n) / n;
|
|
1439
|
+
}
|
|
1440
|
+
function wt(t) {
|
|
1441
|
+
const e = g.useRef(t);
|
|
1442
|
+
return st(() => {
|
|
1443
|
+
e.current = t;
|
|
1444
|
+
}), e;
|
|
1445
|
+
}
|
|
1446
|
+
function kn(t) {
|
|
1447
|
+
t === void 0 && (t = {});
|
|
1448
|
+
const {
|
|
1449
|
+
placement: e = "bottom",
|
|
1450
|
+
strategy: n = "absolute",
|
|
1451
|
+
middleware: o = [],
|
|
1452
|
+
platform: r,
|
|
1453
|
+
elements: {
|
|
1454
|
+
reference: i,
|
|
1455
|
+
floating: s
|
|
1456
|
+
} = {},
|
|
1457
|
+
transform: c = !0,
|
|
1458
|
+
whileElementsMounted: a,
|
|
1459
|
+
open: f
|
|
1460
|
+
} = t, [l, u] = g.useState({
|
|
1461
|
+
x: 0,
|
|
1462
|
+
y: 0,
|
|
1463
|
+
strategy: n,
|
|
1464
|
+
placement: e,
|
|
1465
|
+
middlewareData: {},
|
|
1466
|
+
isPositioned: !1
|
|
1467
|
+
}), [d, m] = g.useState(o);
|
|
1468
|
+
at(d, o) || m(o);
|
|
1469
|
+
const [h, p] = g.useState(null), [w, y] = g.useState(null), b = g.useCallback((C) => {
|
|
1470
|
+
C !== S.current && (S.current = C, p(C));
|
|
1471
|
+
}, []), v = g.useCallback((C) => {
|
|
1472
|
+
C !== A.current && (A.current = C, y(C));
|
|
1473
|
+
}, []), x = i || h, R = s || w, S = g.useRef(null), A = g.useRef(null), L = g.useRef(l), N = a != null, P = wt(a), F = wt(r), M = wt(f), D = g.useCallback(() => {
|
|
1474
|
+
if (!S.current || !A.current)
|
|
1475
|
+
return;
|
|
1476
|
+
const C = {
|
|
1477
|
+
placement: e,
|
|
1478
|
+
strategy: n,
|
|
1479
|
+
middleware: d
|
|
1480
|
+
};
|
|
1481
|
+
F.current && (C.platform = F.current), pn(S.current, A.current, C).then((k) => {
|
|
1482
|
+
const K = {
|
|
1483
|
+
...k,
|
|
1484
|
+
// The floating element's position may be recomputed while it's closed
|
|
1485
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1486
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1487
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1488
|
+
isPositioned: M.current !== !1
|
|
1489
|
+
};
|
|
1490
|
+
O.current && !at(L.current, K) && (L.current = K, se.flushSync(() => {
|
|
1491
|
+
u(K);
|
|
1492
|
+
}));
|
|
1493
|
+
});
|
|
1494
|
+
}, [d, e, n, F, M]);
|
|
1495
|
+
st(() => {
|
|
1496
|
+
f === !1 && L.current.isPositioned && (L.current.isPositioned = !1, u((C) => ({
|
|
1497
|
+
...C,
|
|
1498
|
+
isPositioned: !1
|
|
1499
|
+
})));
|
|
1500
|
+
}, [f]);
|
|
1501
|
+
const O = g.useRef(!1);
|
|
1502
|
+
st(() => (O.current = !0, () => {
|
|
1503
|
+
O.current = !1;
|
|
1504
|
+
}), []), st(() => {
|
|
1505
|
+
if (x && (S.current = x), R && (A.current = R), x && R) {
|
|
1506
|
+
if (P.current)
|
|
1507
|
+
return P.current(x, R, D);
|
|
1508
|
+
D();
|
|
1509
|
+
}
|
|
1510
|
+
}, [x, R, D, P, N]);
|
|
1511
|
+
const B = g.useMemo(() => ({
|
|
1512
|
+
reference: S,
|
|
1513
|
+
floating: A,
|
|
1514
|
+
setReference: b,
|
|
1515
|
+
setFloating: v
|
|
1516
|
+
}), [b, v]), E = g.useMemo(() => ({
|
|
1517
|
+
reference: x,
|
|
1518
|
+
floating: R
|
|
1519
|
+
}), [x, R]), T = g.useMemo(() => {
|
|
1520
|
+
const C = {
|
|
1521
|
+
position: n,
|
|
1522
|
+
left: 0,
|
|
1523
|
+
top: 0
|
|
1524
|
+
};
|
|
1525
|
+
if (!E.floating)
|
|
1526
|
+
return C;
|
|
1527
|
+
const k = zt(E.floating, l.x), K = zt(E.floating, l.y);
|
|
1528
|
+
return c ? {
|
|
1529
|
+
...C,
|
|
1530
|
+
transform: "translate(" + k + "px, " + K + "px)",
|
|
1531
|
+
...te(E.floating) >= 1.5 && {
|
|
1532
|
+
willChange: "transform"
|
|
1533
|
+
}
|
|
1534
|
+
} : {
|
|
1535
|
+
position: n,
|
|
1536
|
+
left: k,
|
|
1537
|
+
top: K
|
|
1538
|
+
};
|
|
1539
|
+
}, [n, c, E.floating, l.x, l.y]);
|
|
1540
|
+
return g.useMemo(() => ({
|
|
1541
|
+
...l,
|
|
1542
|
+
update: D,
|
|
1543
|
+
refs: B,
|
|
1544
|
+
elements: E,
|
|
1545
|
+
floatingStyles: T
|
|
1546
|
+
}), [l, D, B, E, T]);
|
|
1547
|
+
}
|
|
1548
|
+
const xn = (t) => {
|
|
1549
|
+
function e(n) {
|
|
1550
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1551
|
+
}
|
|
1552
|
+
return {
|
|
1553
|
+
name: "arrow",
|
|
1554
|
+
options: t,
|
|
1555
|
+
fn(n) {
|
|
1556
|
+
const {
|
|
1557
|
+
element: o,
|
|
1558
|
+
padding: r
|
|
1559
|
+
} = typeof t == "function" ? t(n) : t;
|
|
1560
|
+
return o && e(o) ? o.current != null ? Bt({
|
|
1561
|
+
element: o.current,
|
|
1562
|
+
padding: r
|
|
1563
|
+
}).fn(n) : {} : o ? Bt({
|
|
1564
|
+
element: o,
|
|
1565
|
+
padding: r
|
|
1566
|
+
}).fn(n) : {};
|
|
1567
|
+
}
|
|
1568
|
+
};
|
|
1569
|
+
}, $n = (t, e) => {
|
|
1570
|
+
const n = an(t);
|
|
1571
|
+
return {
|
|
1572
|
+
name: n.name,
|
|
1573
|
+
fn: n.fn,
|
|
1574
|
+
options: [t, e]
|
|
1575
|
+
};
|
|
1576
|
+
}, _n = (t, e) => {
|
|
1577
|
+
const n = un(t);
|
|
1578
|
+
return {
|
|
1579
|
+
name: n.name,
|
|
1580
|
+
fn: n.fn,
|
|
1581
|
+
options: [t, e]
|
|
1582
|
+
};
|
|
1583
|
+
}, Nn = (t, e) => ({
|
|
1584
|
+
fn: gn(t).fn,
|
|
1585
|
+
options: [t, e]
|
|
1586
|
+
}), Fn = (t, e) => {
|
|
1587
|
+
const n = dn(t);
|
|
1588
|
+
return {
|
|
1589
|
+
name: n.name,
|
|
1590
|
+
fn: n.fn,
|
|
1591
|
+
options: [t, e]
|
|
1592
|
+
};
|
|
1593
|
+
}, Wn = (t, e) => {
|
|
1594
|
+
const n = mn(t);
|
|
1595
|
+
return {
|
|
1596
|
+
name: n.name,
|
|
1597
|
+
fn: n.fn,
|
|
1598
|
+
options: [t, e]
|
|
1599
|
+
};
|
|
1600
|
+
}, Vn = (t, e) => {
|
|
1601
|
+
const n = hn(t);
|
|
1602
|
+
return {
|
|
1603
|
+
name: n.name,
|
|
1604
|
+
fn: n.fn,
|
|
1605
|
+
options: [t, e]
|
|
1606
|
+
};
|
|
1607
|
+
}, Bn = (t, e) => {
|
|
1608
|
+
const n = xn(t);
|
|
1609
|
+
return {
|
|
1610
|
+
name: n.name,
|
|
1611
|
+
fn: n.fn,
|
|
1612
|
+
options: [t, e]
|
|
1613
|
+
};
|
|
1614
|
+
};
|
|
1615
|
+
function zn(t) {
|
|
1616
|
+
const [e, n] = g.useState(void 0);
|
|
1617
|
+
return bt(() => {
|
|
1618
|
+
if (t) {
|
|
1619
|
+
n({ width: t.offsetWidth, height: t.offsetHeight });
|
|
1620
|
+
const o = new ResizeObserver((r) => {
|
|
1621
|
+
if (!Array.isArray(r) || !r.length)
|
|
1622
|
+
return;
|
|
1623
|
+
const i = r[0];
|
|
1624
|
+
let s, c;
|
|
1625
|
+
if ("borderBoxSize" in i) {
|
|
1626
|
+
const a = i.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
|
|
1627
|
+
s = f.inlineSize, c = f.blockSize;
|
|
1628
|
+
} else
|
|
1629
|
+
s = t.offsetWidth, c = t.offsetHeight;
|
|
1630
|
+
n({ width: s, height: c });
|
|
1631
|
+
});
|
|
1632
|
+
return o.observe(t, { box: "border-box" }), () => o.unobserve(t);
|
|
1633
|
+
} else
|
|
1634
|
+
n(void 0);
|
|
1635
|
+
}, [t]), e;
|
|
1636
|
+
}
|
|
1637
|
+
export {
|
|
1638
|
+
ge as B,
|
|
1639
|
+
Dn as C,
|
|
1640
|
+
le as a,
|
|
1641
|
+
he as b,
|
|
1642
|
+
ce as c,
|
|
1643
|
+
Pn as d,
|
|
1644
|
+
On as e,
|
|
1645
|
+
we as f,
|
|
1646
|
+
zn as g,
|
|
1647
|
+
kn as h,
|
|
1648
|
+
Fn as i,
|
|
1649
|
+
Wn as j,
|
|
1650
|
+
Bn as k,
|
|
1651
|
+
Nn as l,
|
|
1652
|
+
Vn as m,
|
|
1653
|
+
Mn as n,
|
|
1654
|
+
$n as o,
|
|
1655
|
+
bt as p,
|
|
1656
|
+
En as q,
|
|
1657
|
+
An as r,
|
|
1658
|
+
_n as s,
|
|
1659
|
+
Tn as t,
|
|
1660
|
+
Cn as u,
|
|
1661
|
+
Ln as v
|
|
1662
|
+
};
|