@rinzai/zen 0.1.7 → 0.1.9
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/collapse/index.d.ts.map +1 -1
- package/dist/zen.css +1 -1
- package/dist/zen.js +767 -732
- package/package.json +24 -23
package/dist/zen.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsx as b, jsxs as W, Fragment as
|
|
1
|
+
import { jsx as b, jsxs as W, Fragment as Ve } from "react/jsx-runtime";
|
|
2
2
|
import * as C from "react";
|
|
3
|
-
import { useLayoutEffect as
|
|
4
|
-
import * as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
if ((o == null ? void 0 : o.variants) == null) return
|
|
9
|
-
const { variants: n, defaultVariants:
|
|
10
|
-
const u = t == null ? void 0 : t[
|
|
3
|
+
import { useLayoutEffect as ot, useEffect as re, useState as de, useId as it, useMemo as ve, useRef as Ee } from "react";
|
|
4
|
+
import * as st from "react-dom";
|
|
5
|
+
import { createPortal as rt, flushSync as lt } from "react-dom";
|
|
6
|
+
const M = (...e) => e.reduce((o, t) => t == null || t === !1 ? o : typeof t == "string" || typeof t == "number" ? o + " " + t : Array.isArray(t) ? o + " " + M(...t) : typeof t == "object" ? o + " " + Object.entries(t).reduce((n, [i, s]) => s == null || s === !1 ? n : typeof s == "string" || typeof s == "number" ? n + " " + i + "-" + s : typeof s == "boolean" && s ? n + " " + i : n, "") : o, ""), Ae = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, We = (e, o) => (t) => {
|
|
7
|
+
var a;
|
|
8
|
+
if ((o == null ? void 0 : o.variants) == null) return M(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
9
|
+
const { variants: n, defaultVariants: i } = o, s = Object.keys(n).map((c) => {
|
|
10
|
+
const u = t == null ? void 0 : t[c], d = i == null ? void 0 : i[c];
|
|
11
11
|
if (u === null) return null;
|
|
12
|
-
const
|
|
13
|
-
return n[
|
|
12
|
+
const h = Ae(u) || Ae(d);
|
|
13
|
+
return n[c][h];
|
|
14
14
|
}), r = t && Object.entries(t).reduce(
|
|
15
|
-
(
|
|
15
|
+
(c, [u, d]) => (d === void 0 || (c[u] = d), c),
|
|
16
16
|
{}
|
|
17
|
-
), l = (
|
|
18
|
-
(
|
|
17
|
+
), l = (a = o == null ? void 0 : o.compoundVariants) == null ? void 0 : a.reduce(
|
|
18
|
+
(c, { class: u, className: d, ...h }) => Object.entries(h).every(
|
|
19
19
|
([f, g]) => Array.isArray(g) ? g.includes(
|
|
20
20
|
{
|
|
21
|
-
...
|
|
21
|
+
...i,
|
|
22
22
|
...r
|
|
23
23
|
}[f]
|
|
24
24
|
) : {
|
|
25
|
-
...
|
|
25
|
+
...i,
|
|
26
26
|
...r
|
|
27
27
|
}[f] === g
|
|
28
|
-
) ? [...
|
|
28
|
+
) ? [...c, u, d] : c,
|
|
29
29
|
[]
|
|
30
30
|
);
|
|
31
|
-
return
|
|
31
|
+
return M(e, s, l, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
32
32
|
};
|
|
33
|
-
function
|
|
34
|
-
return /* @__PURE__ */ b("span", { ...t, className:
|
|
33
|
+
function Be({ variant: e, className: o, ...t }) {
|
|
34
|
+
return /* @__PURE__ */ b("span", { ...t, className: ct({ variant: e, className: o }) });
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const ct = We(
|
|
37
37
|
"zen__badge inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap",
|
|
38
38
|
{
|
|
39
39
|
variants: {
|
|
40
40
|
variant: {
|
|
41
|
-
default: "border-transparent bg-primary text-primary-foreground shadow",
|
|
41
|
+
default: "border-transparent bg-primary text-primary-foreground shadow-sm",
|
|
42
42
|
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
43
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow",
|
|
43
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground shadow-sm",
|
|
44
44
|
outline: "text-foreground"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
@@ -49,18 +49,18 @@ const rt = Ve(
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */ b("button", { className:
|
|
52
|
+
function at({ className: e, variant: o, size: t, ...n }) {
|
|
53
|
+
return /* @__PURE__ */ b("button", { className: ut({ variant: o, size: t, className: e }), ...n });
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
"zen__button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-
|
|
55
|
+
const ut = We(
|
|
56
|
+
"zen__button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
57
57
|
{
|
|
58
58
|
variants: {
|
|
59
59
|
variant: {
|
|
60
|
-
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
61
|
-
destructive: "bg-destructive text-destructive-foreground shadow-
|
|
62
|
-
outline: "border border-input bg-background shadow-
|
|
63
|
-
secondary: "bg-secondary text-secondary-foreground shadow-
|
|
60
|
+
default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
61
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
|
|
62
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
63
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
64
64
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
65
65
|
link: "text-primary underline-offset-4 hover:underline",
|
|
66
66
|
icon: ""
|
|
@@ -77,19 +77,19 @@ const ct = Ve(
|
|
|
77
77
|
size: "default"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
), le = Math.min, H = Math.max, ce = Math.round,
|
|
80
|
+
), le = Math.min, H = Math.max, ce = Math.round, ie = Math.floor, _ = (e) => ({
|
|
81
81
|
x: e,
|
|
82
82
|
y: e
|
|
83
|
-
}),
|
|
83
|
+
}), ft = {
|
|
84
84
|
left: "right",
|
|
85
85
|
right: "left",
|
|
86
86
|
bottom: "top",
|
|
87
87
|
top: "bottom"
|
|
88
|
-
},
|
|
88
|
+
}, dt = {
|
|
89
89
|
start: "end",
|
|
90
90
|
end: "start"
|
|
91
91
|
};
|
|
92
|
-
function
|
|
92
|
+
function Te(e, o, t) {
|
|
93
93
|
return H(e, le(o, t));
|
|
94
94
|
}
|
|
95
95
|
function he(e, o) {
|
|
@@ -101,53 +101,53 @@ function U(e) {
|
|
|
101
101
|
function me(e) {
|
|
102
102
|
return e.split("-")[1];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function je(e) {
|
|
105
105
|
return e === "x" ? "y" : "x";
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function $e(e) {
|
|
108
108
|
return e === "y" ? "height" : "width";
|
|
109
109
|
}
|
|
110
110
|
function G(e) {
|
|
111
111
|
return ["top", "bottom"].includes(U(e)) ? "y" : "x";
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function He(e) {
|
|
114
|
+
return je(G(e));
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ht(e, o, t) {
|
|
117
117
|
t === void 0 && (t = !1);
|
|
118
|
-
const n = me(e),
|
|
119
|
-
let r =
|
|
120
|
-
return o.reference[
|
|
118
|
+
const n = me(e), i = He(e), s = $e(i);
|
|
119
|
+
let r = i === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
120
|
+
return o.reference[s] > o.floating[s] && (r = ae(r)), [r, ae(r)];
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function mt(e) {
|
|
123
123
|
const o = ae(e);
|
|
124
124
|
return [Se(e), o, Se(o)];
|
|
125
125
|
}
|
|
126
126
|
function Se(e) {
|
|
127
|
-
return e.replace(/start|end/g, (o) =>
|
|
127
|
+
return e.replace(/start|end/g, (o) => dt[o]);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
const n = ["left", "right"],
|
|
129
|
+
function gt(e, o, t) {
|
|
130
|
+
const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
131
131
|
switch (e) {
|
|
132
132
|
case "top":
|
|
133
133
|
case "bottom":
|
|
134
|
-
return t ? o ?
|
|
134
|
+
return t ? o ? i : n : o ? n : i;
|
|
135
135
|
case "left":
|
|
136
136
|
case "right":
|
|
137
|
-
return o ?
|
|
137
|
+
return o ? s : r;
|
|
138
138
|
default:
|
|
139
139
|
return [];
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
return
|
|
142
|
+
function pt(e, o, t, n) {
|
|
143
|
+
const i = me(e);
|
|
144
|
+
let s = gt(U(e), t === "start", n);
|
|
145
|
+
return i && (s = s.map((r) => r + "-" + i), o && (s = s.concat(s.map(Se)))), s;
|
|
146
146
|
}
|
|
147
147
|
function ae(e) {
|
|
148
|
-
return e.replace(/left|right|bottom|top/g, (o) =>
|
|
148
|
+
return e.replace(/left|right|bottom|top/g, (o) => ft[o]);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function xt(e) {
|
|
151
151
|
return {
|
|
152
152
|
top: 0,
|
|
153
153
|
right: 0,
|
|
@@ -156,8 +156,8 @@ function gt(e) {
|
|
|
156
156
|
...e
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
return typeof e != "number" ?
|
|
159
|
+
function wt(e) {
|
|
160
|
+
return typeof e != "number" ? xt(e) : {
|
|
161
161
|
top: e,
|
|
162
162
|
right: e,
|
|
163
163
|
bottom: e,
|
|
@@ -169,15 +169,15 @@ function ue(e) {
|
|
|
169
169
|
x: o,
|
|
170
170
|
y: t,
|
|
171
171
|
width: n,
|
|
172
|
-
height:
|
|
172
|
+
height: i
|
|
173
173
|
} = e;
|
|
174
174
|
return {
|
|
175
175
|
width: n,
|
|
176
|
-
height:
|
|
176
|
+
height: i,
|
|
177
177
|
top: t,
|
|
178
178
|
left: o,
|
|
179
179
|
right: o + n,
|
|
180
|
-
bottom: t +
|
|
180
|
+
bottom: t + i,
|
|
181
181
|
x: o,
|
|
182
182
|
y: t
|
|
183
183
|
};
|
|
@@ -185,15 +185,15 @@ function ue(e) {
|
|
|
185
185
|
function ze(e, o, t) {
|
|
186
186
|
let {
|
|
187
187
|
reference: n,
|
|
188
|
-
floating:
|
|
188
|
+
floating: i
|
|
189
189
|
} = e;
|
|
190
|
-
const
|
|
190
|
+
const s = G(o), r = He(o), l = $e(r), a = U(o), c = s === "y", u = n.x + n.width / 2 - i.width / 2, d = n.y + n.height / 2 - i.height / 2, h = n[l] / 2 - i[l] / 2;
|
|
191
191
|
let f;
|
|
192
|
-
switch (
|
|
192
|
+
switch (a) {
|
|
193
193
|
case "top":
|
|
194
194
|
f = {
|
|
195
195
|
x: u,
|
|
196
|
-
y: n.y -
|
|
196
|
+
y: n.y - i.height
|
|
197
197
|
};
|
|
198
198
|
break;
|
|
199
199
|
case "bottom":
|
|
@@ -210,7 +210,7 @@ function ze(e, o, t) {
|
|
|
210
210
|
break;
|
|
211
211
|
case "left":
|
|
212
212
|
f = {
|
|
213
|
-
x: n.x -
|
|
213
|
+
x: n.x - i.width,
|
|
214
214
|
y: d
|
|
215
215
|
};
|
|
216
216
|
break;
|
|
@@ -222,46 +222,46 @@ function ze(e, o, t) {
|
|
|
222
222
|
}
|
|
223
223
|
switch (me(o)) {
|
|
224
224
|
case "start":
|
|
225
|
-
f[r] -=
|
|
225
|
+
f[r] -= h * (t && c ? -1 : 1);
|
|
226
226
|
break;
|
|
227
227
|
case "end":
|
|
228
|
-
f[r] +=
|
|
228
|
+
f[r] += h * (t && c ? -1 : 1);
|
|
229
229
|
break;
|
|
230
230
|
}
|
|
231
231
|
return f;
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const yt = async (e, o, t) => {
|
|
234
234
|
const {
|
|
235
235
|
placement: n = "bottom",
|
|
236
|
-
strategy:
|
|
237
|
-
middleware:
|
|
236
|
+
strategy: i = "absolute",
|
|
237
|
+
middleware: s = [],
|
|
238
238
|
platform: r
|
|
239
|
-
} = t, l =
|
|
240
|
-
let
|
|
239
|
+
} = t, l = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(o));
|
|
240
|
+
let c = await r.getElementRects({
|
|
241
241
|
reference: e,
|
|
242
242
|
floating: o,
|
|
243
|
-
strategy:
|
|
243
|
+
strategy: i
|
|
244
244
|
}), {
|
|
245
245
|
x: u,
|
|
246
246
|
y: d
|
|
247
|
-
} = ze(
|
|
247
|
+
} = ze(c, n, a), h = n, f = {}, g = 0;
|
|
248
248
|
for (let x = 0; x < l.length; x++) {
|
|
249
249
|
const {
|
|
250
250
|
name: w,
|
|
251
|
-
fn:
|
|
251
|
+
fn: m
|
|
252
252
|
} = l[x], {
|
|
253
253
|
x: p,
|
|
254
254
|
y: v,
|
|
255
255
|
data: E,
|
|
256
256
|
reset: y
|
|
257
|
-
} = await
|
|
257
|
+
} = await m({
|
|
258
258
|
x: u,
|
|
259
259
|
y: d,
|
|
260
260
|
initialPlacement: n,
|
|
261
|
-
placement:
|
|
262
|
-
strategy:
|
|
261
|
+
placement: h,
|
|
262
|
+
strategy: i,
|
|
263
263
|
middlewareData: f,
|
|
264
|
-
rects:
|
|
264
|
+
rects: c,
|
|
265
265
|
platform: r,
|
|
266
266
|
elements: {
|
|
267
267
|
reference: e,
|
|
@@ -274,141 +274,141 @@ const xt = async (e, o, t) => {
|
|
|
274
274
|
...f[w],
|
|
275
275
|
...E
|
|
276
276
|
}
|
|
277
|
-
}, y && g <= 50 && (g++, typeof y == "object" && (y.placement && (
|
|
277
|
+
}, y && g <= 50 && (g++, typeof y == "object" && (y.placement && (h = y.placement), y.rects && (c = y.rects === !0 ? await r.getElementRects({
|
|
278
278
|
reference: e,
|
|
279
279
|
floating: o,
|
|
280
|
-
strategy:
|
|
280
|
+
strategy: i
|
|
281
281
|
}) : y.rects), {
|
|
282
282
|
x: u,
|
|
283
283
|
y: d
|
|
284
|
-
} = ze(
|
|
284
|
+
} = ze(c, h, a)), x = -1);
|
|
285
285
|
}
|
|
286
286
|
return {
|
|
287
287
|
x: u,
|
|
288
288
|
y: d,
|
|
289
|
-
placement:
|
|
290
|
-
strategy:
|
|
289
|
+
placement: h,
|
|
290
|
+
strategy: i,
|
|
291
291
|
middlewareData: f
|
|
292
292
|
};
|
|
293
293
|
};
|
|
294
|
-
async function
|
|
294
|
+
async function Ue(e, o) {
|
|
295
295
|
var t;
|
|
296
296
|
o === void 0 && (o = {});
|
|
297
297
|
const {
|
|
298
298
|
x: n,
|
|
299
|
-
y:
|
|
300
|
-
platform:
|
|
299
|
+
y: i,
|
|
300
|
+
platform: s,
|
|
301
301
|
rects: r,
|
|
302
302
|
elements: l,
|
|
303
|
-
strategy:
|
|
303
|
+
strategy: a
|
|
304
304
|
} = e, {
|
|
305
|
-
boundary:
|
|
305
|
+
boundary: c = "clippingAncestors",
|
|
306
306
|
rootBoundary: u = "viewport",
|
|
307
307
|
elementContext: d = "floating",
|
|
308
|
-
altBoundary:
|
|
308
|
+
altBoundary: h = !1,
|
|
309
309
|
padding: f = 0
|
|
310
|
-
} = he(o, e), g =
|
|
311
|
-
element: (t = await (
|
|
312
|
-
boundary:
|
|
310
|
+
} = he(o, e), g = wt(f), w = l[h ? d === "floating" ? "reference" : "floating" : d], m = ue(await s.getClippingRect({
|
|
311
|
+
element: (t = await (s.isElement == null ? void 0 : s.isElement(w))) == null || t ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
312
|
+
boundary: c,
|
|
313
313
|
rootBoundary: u,
|
|
314
|
-
strategy:
|
|
314
|
+
strategy: a
|
|
315
315
|
})), p = d === "floating" ? {
|
|
316
316
|
x: n,
|
|
317
|
-
y:
|
|
317
|
+
y: i,
|
|
318
318
|
width: r.floating.width,
|
|
319
319
|
height: r.floating.height
|
|
320
|
-
} : r.reference, v = await (
|
|
320
|
+
} : r.reference, v = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), E = await (s.isElement == null ? void 0 : s.isElement(v)) ? await (s.getScale == null ? void 0 : s.getScale(v)) || {
|
|
321
321
|
x: 1,
|
|
322
322
|
y: 1
|
|
323
323
|
} : {
|
|
324
324
|
x: 1,
|
|
325
325
|
y: 1
|
|
326
|
-
}, y = ue(
|
|
326
|
+
}, y = ue(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
327
327
|
elements: l,
|
|
328
328
|
rect: p,
|
|
329
329
|
offsetParent: v,
|
|
330
|
-
strategy:
|
|
330
|
+
strategy: a
|
|
331
331
|
}) : p);
|
|
332
332
|
return {
|
|
333
|
-
top: (
|
|
334
|
-
bottom: (y.bottom -
|
|
335
|
-
left: (
|
|
336
|
-
right: (y.right -
|
|
333
|
+
top: (m.top - y.top + g.top) / E.y,
|
|
334
|
+
bottom: (y.bottom - m.bottom + g.bottom) / E.y,
|
|
335
|
+
left: (m.left - y.left + g.left) / E.x,
|
|
336
|
+
right: (y.right - m.right + g.right) / E.x
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const bt = function(e) {
|
|
340
340
|
return e === void 0 && (e = {}), {
|
|
341
341
|
name: "flip",
|
|
342
342
|
options: e,
|
|
343
343
|
async fn(o) {
|
|
344
344
|
var t, n;
|
|
345
345
|
const {
|
|
346
|
-
placement:
|
|
347
|
-
middlewareData:
|
|
346
|
+
placement: i,
|
|
347
|
+
middlewareData: s,
|
|
348
348
|
rects: r,
|
|
349
349
|
initialPlacement: l,
|
|
350
|
-
platform:
|
|
351
|
-
elements:
|
|
350
|
+
platform: a,
|
|
351
|
+
elements: c
|
|
352
352
|
} = o, {
|
|
353
353
|
mainAxis: u = !0,
|
|
354
354
|
crossAxis: d = !0,
|
|
355
|
-
fallbackPlacements:
|
|
355
|
+
fallbackPlacements: h,
|
|
356
356
|
fallbackStrategy: f = "bestFit",
|
|
357
357
|
fallbackAxisSideDirection: g = "none",
|
|
358
358
|
flipAlignment: x = !0,
|
|
359
359
|
...w
|
|
360
360
|
} = he(e, o);
|
|
361
|
-
if ((t =
|
|
361
|
+
if ((t = s.arrow) != null && t.alignmentOffset)
|
|
362
362
|
return {};
|
|
363
|
-
const
|
|
364
|
-
!
|
|
365
|
-
const
|
|
366
|
-
let
|
|
367
|
-
if (u &&
|
|
368
|
-
const
|
|
369
|
-
|
|
363
|
+
const m = U(i), p = G(l), v = U(l) === l, E = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), y = h || (v || !x ? [ae(l)] : mt(l)), R = g !== "none";
|
|
364
|
+
!h && R && y.push(...pt(l, x, g, E));
|
|
365
|
+
const O = [l, ...y], z = await Ue(o, w), K = [];
|
|
366
|
+
let P = ((n = s.flip) == null ? void 0 : n.overflows) || [];
|
|
367
|
+
if (u && K.push(z[m]), d) {
|
|
368
|
+
const N = ht(i, r, E);
|
|
369
|
+
K.push(z[N[0]], z[N[1]]);
|
|
370
370
|
}
|
|
371
|
-
if (
|
|
372
|
-
placement:
|
|
373
|
-
overflows:
|
|
374
|
-
}], !
|
|
375
|
-
var
|
|
376
|
-
const
|
|
371
|
+
if (P = [...P, {
|
|
372
|
+
placement: i,
|
|
373
|
+
overflows: K
|
|
374
|
+
}], !K.every((N) => N <= 0)) {
|
|
375
|
+
var Y, ee;
|
|
376
|
+
const N = (((Y = s.flip) == null ? void 0 : Y.index) || 0) + 1, te = O[N];
|
|
377
377
|
if (te)
|
|
378
378
|
return {
|
|
379
379
|
data: {
|
|
380
|
-
index:
|
|
381
|
-
overflows:
|
|
380
|
+
index: N,
|
|
381
|
+
overflows: P
|
|
382
382
|
},
|
|
383
383
|
reset: {
|
|
384
384
|
placement: te
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
let
|
|
388
|
-
if (!
|
|
387
|
+
let k = (ee = P.filter((V) => V.overflows[0] <= 0).sort((V, S) => V.overflows[1] - S.overflows[1])[0]) == null ? void 0 : ee.placement;
|
|
388
|
+
if (!k)
|
|
389
389
|
switch (f) {
|
|
390
390
|
case "bestFit": {
|
|
391
391
|
var B;
|
|
392
|
-
const V = (B =
|
|
393
|
-
if (
|
|
394
|
-
const
|
|
395
|
-
return
|
|
392
|
+
const V = (B = P.filter((S) => {
|
|
393
|
+
if (R) {
|
|
394
|
+
const A = G(S.placement);
|
|
395
|
+
return A === p || // Create a bias to the `y` side axis due to horizontal
|
|
396
396
|
// reading directions favoring greater width.
|
|
397
|
-
|
|
397
|
+
A === "y";
|
|
398
398
|
}
|
|
399
399
|
return !0;
|
|
400
|
-
}).map((S) => [S.placement, S.overflows.filter((
|
|
401
|
-
V && (
|
|
400
|
+
}).map((S) => [S.placement, S.overflows.filter((A) => A > 0).reduce((A, j) => A + j, 0)]).sort((S, A) => S[1] - A[1])[0]) == null ? void 0 : B[0];
|
|
401
|
+
V && (k = V);
|
|
402
402
|
break;
|
|
403
403
|
}
|
|
404
404
|
case "initialPlacement":
|
|
405
|
-
|
|
405
|
+
k = l;
|
|
406
406
|
break;
|
|
407
407
|
}
|
|
408
|
-
if (
|
|
408
|
+
if (i !== k)
|
|
409
409
|
return {
|
|
410
410
|
reset: {
|
|
411
|
-
placement:
|
|
411
|
+
placement: k
|
|
412
412
|
}
|
|
413
413
|
};
|
|
414
414
|
}
|
|
@@ -416,14 +416,14 @@ const wt = function(e) {
|
|
|
416
416
|
}
|
|
417
417
|
};
|
|
418
418
|
};
|
|
419
|
-
async function
|
|
419
|
+
async function vt(e, o) {
|
|
420
420
|
const {
|
|
421
421
|
placement: t,
|
|
422
422
|
platform: n,
|
|
423
|
-
elements:
|
|
424
|
-
} = e,
|
|
423
|
+
elements: i
|
|
424
|
+
} = e, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = U(t), l = me(t), a = G(t) === "y", c = ["left", "top"].includes(r) ? -1 : 1, u = s && a ? -1 : 1, d = he(o, e);
|
|
425
425
|
let {
|
|
426
|
-
mainAxis:
|
|
426
|
+
mainAxis: h,
|
|
427
427
|
crossAxis: f,
|
|
428
428
|
alignmentAxis: g
|
|
429
429
|
} = typeof d == "number" ? {
|
|
@@ -435,37 +435,37 @@ async function yt(e, o) {
|
|
|
435
435
|
crossAxis: d.crossAxis || 0,
|
|
436
436
|
alignmentAxis: d.alignmentAxis
|
|
437
437
|
};
|
|
438
|
-
return l && typeof g == "number" && (f = l === "end" ? g * -1 : g),
|
|
438
|
+
return l && typeof g == "number" && (f = l === "end" ? g * -1 : g), a ? {
|
|
439
439
|
x: f * u,
|
|
440
|
-
y:
|
|
440
|
+
y: h * c
|
|
441
441
|
} : {
|
|
442
|
-
x:
|
|
442
|
+
x: h * c,
|
|
443
443
|
y: f * u
|
|
444
444
|
};
|
|
445
445
|
}
|
|
446
|
-
const
|
|
446
|
+
const Et = function(e) {
|
|
447
447
|
return e === void 0 && (e = 0), {
|
|
448
448
|
name: "offset",
|
|
449
449
|
options: e,
|
|
450
450
|
async fn(o) {
|
|
451
451
|
var t, n;
|
|
452
452
|
const {
|
|
453
|
-
x:
|
|
454
|
-
y:
|
|
453
|
+
x: i,
|
|
454
|
+
y: s,
|
|
455
455
|
placement: r,
|
|
456
456
|
middlewareData: l
|
|
457
|
-
} = o,
|
|
457
|
+
} = o, a = await vt(o, e);
|
|
458
458
|
return r === ((t = l.offset) == null ? void 0 : t.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
|
|
459
|
-
x:
|
|
460
|
-
y:
|
|
459
|
+
x: i + a.x,
|
|
460
|
+
y: s + a.y,
|
|
461
461
|
data: {
|
|
462
|
-
...
|
|
462
|
+
...a,
|
|
463
463
|
placement: r
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
467
|
};
|
|
468
|
-
},
|
|
468
|
+
}, St = function(e) {
|
|
469
469
|
return e === void 0 && (e = {}), {
|
|
470
470
|
name: "shift",
|
|
471
471
|
options: e,
|
|
@@ -473,39 +473,39 @@ const bt = function(e) {
|
|
|
473
473
|
const {
|
|
474
474
|
x: t,
|
|
475
475
|
y: n,
|
|
476
|
-
placement:
|
|
476
|
+
placement: i
|
|
477
477
|
} = o, {
|
|
478
|
-
mainAxis:
|
|
478
|
+
mainAxis: s = !0,
|
|
479
479
|
crossAxis: r = !1,
|
|
480
480
|
limiter: l = {
|
|
481
481
|
fn: (w) => {
|
|
482
482
|
let {
|
|
483
|
-
x:
|
|
483
|
+
x: m,
|
|
484
484
|
y: p
|
|
485
485
|
} = w;
|
|
486
486
|
return {
|
|
487
|
-
x:
|
|
487
|
+
x: m,
|
|
488
488
|
y: p
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
491
|
},
|
|
492
|
-
...
|
|
493
|
-
} = he(e, o),
|
|
492
|
+
...a
|
|
493
|
+
} = he(e, o), c = {
|
|
494
494
|
x: t,
|
|
495
495
|
y: n
|
|
496
|
-
}, u = await
|
|
497
|
-
let f =
|
|
498
|
-
if (
|
|
499
|
-
const w =
|
|
500
|
-
f =
|
|
496
|
+
}, u = await Ue(o, a), d = G(U(i)), h = je(d);
|
|
497
|
+
let f = c[h], g = c[d];
|
|
498
|
+
if (s) {
|
|
499
|
+
const w = h === "y" ? "top" : "left", m = h === "y" ? "bottom" : "right", p = f + u[w], v = f - u[m];
|
|
500
|
+
f = Te(p, f, v);
|
|
501
501
|
}
|
|
502
502
|
if (r) {
|
|
503
|
-
const w = d === "y" ? "top" : "left",
|
|
504
|
-
g =
|
|
503
|
+
const w = d === "y" ? "top" : "left", m = d === "y" ? "bottom" : "right", p = g + u[w], v = g - u[m];
|
|
504
|
+
g = Te(p, g, v);
|
|
505
505
|
}
|
|
506
506
|
const x = l.fn({
|
|
507
507
|
...o,
|
|
508
|
-
[
|
|
508
|
+
[h]: f,
|
|
509
509
|
[d]: g
|
|
510
510
|
});
|
|
511
511
|
return {
|
|
@@ -514,7 +514,7 @@ const bt = function(e) {
|
|
|
514
514
|
x: x.x - t,
|
|
515
515
|
y: x.y - n,
|
|
516
516
|
enabled: {
|
|
517
|
-
[
|
|
517
|
+
[h]: s,
|
|
518
518
|
[d]: r
|
|
519
519
|
}
|
|
520
520
|
}
|
|
@@ -526,38 +526,38 @@ function ge() {
|
|
|
526
526
|
return typeof window < "u";
|
|
527
527
|
}
|
|
528
528
|
function Q(e) {
|
|
529
|
-
return
|
|
529
|
+
return qe(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function T(e) {
|
|
532
532
|
var o;
|
|
533
533
|
return (e == null || (o = e.ownerDocument) == null ? void 0 : o.defaultView) || window;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function F(e) {
|
|
536
536
|
var o;
|
|
537
|
-
return (o = (
|
|
537
|
+
return (o = (qe(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : o.documentElement;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
return ge() ? e instanceof Node || e instanceof
|
|
539
|
+
function qe(e) {
|
|
540
|
+
return ge() ? e instanceof Node || e instanceof T(e).Node : !1;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
return ge() ? e instanceof Element || e instanceof
|
|
542
|
+
function I(e) {
|
|
543
|
+
return ge() ? e instanceof Element || e instanceof T(e).Element : !1;
|
|
544
544
|
}
|
|
545
545
|
function D(e) {
|
|
546
|
-
return ge() ? e instanceof HTMLElement || e instanceof
|
|
546
|
+
return ge() ? e instanceof HTMLElement || e instanceof T(e).HTMLElement : !1;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
return !ge() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof
|
|
548
|
+
function Ne(e) {
|
|
549
|
+
return !ge() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof T(e).ShadowRoot;
|
|
550
550
|
}
|
|
551
551
|
function oe(e) {
|
|
552
552
|
const {
|
|
553
553
|
overflow: o,
|
|
554
554
|
overflowX: t,
|
|
555
555
|
overflowY: n,
|
|
556
|
-
display:
|
|
556
|
+
display: i
|
|
557
557
|
} = L(e);
|
|
558
|
-
return /auto|scroll|overlay|hidden|clip/.test(o + n + t) && !["inline", "contents"].includes(
|
|
558
|
+
return /auto|scroll|overlay|hidden|clip/.test(o + n + t) && !["inline", "contents"].includes(i);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Ot(e) {
|
|
561
561
|
return ["table", "td", "th"].includes(Q(e));
|
|
562
562
|
}
|
|
563
563
|
function pe(e) {
|
|
@@ -569,14 +569,14 @@ function pe(e) {
|
|
|
569
569
|
}
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
const o = Re(), t =
|
|
574
|
-
return
|
|
572
|
+
function Ce(e) {
|
|
573
|
+
const o = Re(), t = I(e) ? L(e) : e;
|
|
574
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !o && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !o && (t.filter ? t.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (t.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (t.contain || "").includes(n));
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Ct(e) {
|
|
577
577
|
let o = $(e);
|
|
578
578
|
for (; D(o) && !J(o); ) {
|
|
579
|
-
if (
|
|
579
|
+
if (Ce(o))
|
|
580
580
|
return o;
|
|
581
581
|
if (pe(o))
|
|
582
582
|
return null;
|
|
@@ -591,10 +591,10 @@ function J(e) {
|
|
|
591
591
|
return ["html", "body", "#document"].includes(Q(e));
|
|
592
592
|
}
|
|
593
593
|
function L(e) {
|
|
594
|
-
return
|
|
594
|
+
return T(e).getComputedStyle(e);
|
|
595
595
|
}
|
|
596
596
|
function xe(e) {
|
|
597
|
-
return
|
|
597
|
+
return I(e) ? {
|
|
598
598
|
scrollLeft: e.scrollLeft,
|
|
599
599
|
scrollTop: e.scrollTop
|
|
600
600
|
} : {
|
|
@@ -609,10 +609,10 @@ function $(e) {
|
|
|
609
609
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
610
610
|
e.assignedSlot || // DOM Element detected.
|
|
611
611
|
e.parentNode || // ShadowRoot detected.
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
Ne(e) && e.host || // Fallback.
|
|
613
|
+
F(e)
|
|
614
614
|
);
|
|
615
|
-
return
|
|
615
|
+
return Ne(o) ? o.host : o;
|
|
616
616
|
}
|
|
617
617
|
function Ke(e) {
|
|
618
618
|
const o = $(e);
|
|
@@ -621,212 +621,212 @@ function Ke(e) {
|
|
|
621
621
|
function ne(e, o, t) {
|
|
622
622
|
var n;
|
|
623
623
|
o === void 0 && (o = []), t === void 0 && (t = !0);
|
|
624
|
-
const
|
|
625
|
-
if (
|
|
626
|
-
const l =
|
|
627
|
-
return o.concat(r, r.visualViewport || [], oe(
|
|
624
|
+
const i = Ke(e), s = i === ((n = e.ownerDocument) == null ? void 0 : n.body), r = T(i);
|
|
625
|
+
if (s) {
|
|
626
|
+
const l = Oe(r);
|
|
627
|
+
return o.concat(r, r.visualViewport || [], oe(i) ? i : [], l && t ? ne(l) : []);
|
|
628
628
|
}
|
|
629
|
-
return o.concat(
|
|
629
|
+
return o.concat(i, ne(i, [], t));
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Oe(e) {
|
|
632
632
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
633
633
|
}
|
|
634
634
|
function Ye(e) {
|
|
635
635
|
const o = L(e);
|
|
636
636
|
let t = parseFloat(o.width) || 0, n = parseFloat(o.height) || 0;
|
|
637
|
-
const
|
|
638
|
-
return l && (t =
|
|
637
|
+
const i = D(e), s = i ? e.offsetWidth : t, r = i ? e.offsetHeight : n, l = ce(t) !== s || ce(n) !== r;
|
|
638
|
+
return l && (t = s, n = r), {
|
|
639
639
|
width: t,
|
|
640
640
|
height: n,
|
|
641
641
|
$: l
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
644
|
+
function Me(e) {
|
|
645
|
+
return I(e) ? e : e.contextElement;
|
|
646
646
|
}
|
|
647
647
|
function Z(e) {
|
|
648
|
-
const o =
|
|
648
|
+
const o = Me(e);
|
|
649
649
|
if (!D(o))
|
|
650
650
|
return _(1);
|
|
651
651
|
const t = o.getBoundingClientRect(), {
|
|
652
652
|
width: n,
|
|
653
|
-
height:
|
|
654
|
-
$:
|
|
653
|
+
height: i,
|
|
654
|
+
$: s
|
|
655
655
|
} = Ye(o);
|
|
656
|
-
let r = (
|
|
656
|
+
let r = (s ? ce(t.width) : t.width) / n, l = (s ? ce(t.height) : t.height) / i;
|
|
657
657
|
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
658
658
|
x: r,
|
|
659
659
|
y: l
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
const
|
|
663
|
-
function
|
|
664
|
-
const o =
|
|
665
|
-
return !Re() || !o.visualViewport ?
|
|
662
|
+
const Rt = /* @__PURE__ */ _(0);
|
|
663
|
+
function Xe(e) {
|
|
664
|
+
const o = T(e);
|
|
665
|
+
return !Re() || !o.visualViewport ? Rt : {
|
|
666
666
|
x: o.visualViewport.offsetLeft,
|
|
667
667
|
y: o.visualViewport.offsetTop
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
return o === void 0 && (o = !1), !t || o && t !==
|
|
670
|
+
function Mt(e, o, t) {
|
|
671
|
+
return o === void 0 && (o = !1), !t || o && t !== T(e) ? !1 : o;
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function q(e, o, t, n) {
|
|
674
674
|
o === void 0 && (o = !1), t === void 0 && (t = !1);
|
|
675
|
-
const
|
|
675
|
+
const i = e.getBoundingClientRect(), s = Me(e);
|
|
676
676
|
let r = _(1);
|
|
677
|
-
o && (n ?
|
|
678
|
-
const l =
|
|
679
|
-
let
|
|
680
|
-
if (
|
|
681
|
-
const
|
|
682
|
-
let g =
|
|
677
|
+
o && (n ? I(n) && (r = Z(n)) : r = Z(e));
|
|
678
|
+
const l = Mt(s, t, n) ? Xe(s) : _(0);
|
|
679
|
+
let a = (i.left + l.x) / r.x, c = (i.top + l.y) / r.y, u = i.width / r.x, d = i.height / r.y;
|
|
680
|
+
if (s) {
|
|
681
|
+
const h = T(s), f = n && I(n) ? T(n) : n;
|
|
682
|
+
let g = h, x = Oe(g);
|
|
683
683
|
for (; x && n && f !== g; ) {
|
|
684
|
-
const w = Z(x),
|
|
685
|
-
|
|
684
|
+
const w = Z(x), m = x.getBoundingClientRect(), p = L(x), v = m.left + (x.clientLeft + parseFloat(p.paddingLeft)) * w.x, E = m.top + (x.clientTop + parseFloat(p.paddingTop)) * w.y;
|
|
685
|
+
a *= w.x, c *= w.y, u *= w.x, d *= w.y, a += v, c += E, g = T(x), x = Oe(g);
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
return ue({
|
|
689
689
|
width: u,
|
|
690
690
|
height: d,
|
|
691
|
-
x:
|
|
692
|
-
y:
|
|
691
|
+
x: a,
|
|
692
|
+
y: c
|
|
693
693
|
});
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function ke(e, o) {
|
|
696
696
|
const t = xe(e).scrollLeft;
|
|
697
|
-
return o ? o.left + t :
|
|
697
|
+
return o ? o.left + t : q(F(e)).left + t;
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Ze(e, o, t) {
|
|
700
700
|
t === void 0 && (t = !1);
|
|
701
|
-
const n = e.getBoundingClientRect(),
|
|
701
|
+
const n = e.getBoundingClientRect(), i = n.left + o.scrollLeft - (t ? 0 : (
|
|
702
702
|
// RTL <body> scrollbar.
|
|
703
|
-
|
|
704
|
-
)),
|
|
703
|
+
ke(e, n)
|
|
704
|
+
)), s = n.top + o.scrollTop;
|
|
705
705
|
return {
|
|
706
|
-
x:
|
|
707
|
-
y:
|
|
706
|
+
x: i,
|
|
707
|
+
y: s
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function kt(e) {
|
|
711
711
|
let {
|
|
712
712
|
elements: o,
|
|
713
713
|
rect: t,
|
|
714
714
|
offsetParent: n,
|
|
715
|
-
strategy:
|
|
715
|
+
strategy: i
|
|
716
716
|
} = e;
|
|
717
|
-
const
|
|
718
|
-
if (n === r || l &&
|
|
717
|
+
const s = i === "fixed", r = F(n), l = o ? pe(o.floating) : !1;
|
|
718
|
+
if (n === r || l && s)
|
|
719
719
|
return t;
|
|
720
|
-
let
|
|
720
|
+
let a = {
|
|
721
721
|
scrollLeft: 0,
|
|
722
722
|
scrollTop: 0
|
|
723
|
-
},
|
|
723
|
+
}, c = _(1);
|
|
724
724
|
const u = _(0), d = D(n);
|
|
725
|
-
if ((d || !d && !
|
|
726
|
-
const f =
|
|
727
|
-
|
|
725
|
+
if ((d || !d && !s) && ((Q(n) !== "body" || oe(r)) && (a = xe(n)), D(n))) {
|
|
726
|
+
const f = q(n);
|
|
727
|
+
c = Z(n), u.x = f.x + n.clientLeft, u.y = f.y + n.clientTop;
|
|
728
728
|
}
|
|
729
|
-
const
|
|
729
|
+
const h = r && !d && !s ? Ze(r, a, !0) : _(0);
|
|
730
730
|
return {
|
|
731
|
-
width: t.width *
|
|
732
|
-
height: t.height *
|
|
733
|
-
x: t.x *
|
|
734
|
-
y: t.y *
|
|
731
|
+
width: t.width * c.x,
|
|
732
|
+
height: t.height * c.y,
|
|
733
|
+
x: t.x * c.x - a.scrollLeft * c.x + u.x + h.x,
|
|
734
|
+
y: t.y * c.y - a.scrollTop * c.y + u.y + h.y
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function At(e) {
|
|
738
738
|
return Array.from(e.getClientRects());
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
const o =
|
|
742
|
-
let r = -t.scrollLeft +
|
|
740
|
+
function Tt(e) {
|
|
741
|
+
const o = F(e), t = xe(e), n = e.ownerDocument.body, i = H(o.scrollWidth, o.clientWidth, n.scrollWidth, n.clientWidth), s = H(o.scrollHeight, o.clientHeight, n.scrollHeight, n.clientHeight);
|
|
742
|
+
let r = -t.scrollLeft + ke(e);
|
|
743
743
|
const l = -t.scrollTop;
|
|
744
|
-
return L(n).direction === "rtl" && (r += H(o.clientWidth, n.clientWidth) -
|
|
745
|
-
width:
|
|
746
|
-
height:
|
|
744
|
+
return L(n).direction === "rtl" && (r += H(o.clientWidth, n.clientWidth) - i), {
|
|
745
|
+
width: i,
|
|
746
|
+
height: s,
|
|
747
747
|
x: r,
|
|
748
748
|
y: l
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
function
|
|
752
|
-
const t =
|
|
753
|
-
let
|
|
754
|
-
if (
|
|
755
|
-
|
|
756
|
-
const
|
|
757
|
-
(!
|
|
751
|
+
function zt(e, o) {
|
|
752
|
+
const t = T(e), n = F(e), i = t.visualViewport;
|
|
753
|
+
let s = n.clientWidth, r = n.clientHeight, l = 0, a = 0;
|
|
754
|
+
if (i) {
|
|
755
|
+
s = i.width, r = i.height;
|
|
756
|
+
const c = Re();
|
|
757
|
+
(!c || c && o === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
|
|
758
758
|
}
|
|
759
759
|
return {
|
|
760
|
-
width:
|
|
760
|
+
width: s,
|
|
761
761
|
height: r,
|
|
762
762
|
x: l,
|
|
763
|
-
y:
|
|
763
|
+
y: a
|
|
764
764
|
};
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
const t =
|
|
766
|
+
function Nt(e, o) {
|
|
767
|
+
const t = q(e, !0, o === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft, s = D(e) ? Z(e) : _(1), r = e.clientWidth * s.x, l = e.clientHeight * s.y, a = i * s.x, c = n * s.y;
|
|
768
768
|
return {
|
|
769
769
|
width: r,
|
|
770
770
|
height: l,
|
|
771
|
-
x:
|
|
772
|
-
y:
|
|
771
|
+
x: a,
|
|
772
|
+
y: c
|
|
773
773
|
};
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function Ie(e, o, t) {
|
|
776
776
|
let n;
|
|
777
777
|
if (o === "viewport")
|
|
778
|
-
n =
|
|
778
|
+
n = zt(e, t);
|
|
779
779
|
else if (o === "document")
|
|
780
|
-
n =
|
|
781
|
-
else if (
|
|
782
|
-
n =
|
|
780
|
+
n = Tt(F(e));
|
|
781
|
+
else if (I(o))
|
|
782
|
+
n = Nt(o, t);
|
|
783
783
|
else {
|
|
784
|
-
const
|
|
784
|
+
const i = Xe(e);
|
|
785
785
|
n = {
|
|
786
|
-
x: o.x -
|
|
787
|
-
y: o.y -
|
|
786
|
+
x: o.x - i.x,
|
|
787
|
+
y: o.y - i.y,
|
|
788
788
|
width: o.width,
|
|
789
789
|
height: o.height
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
792
|
return ue(n);
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function Ge(e, o) {
|
|
795
795
|
const t = $(e);
|
|
796
|
-
return t === o || !
|
|
796
|
+
return t === o || !I(t) || J(t) ? !1 : L(t).position === "fixed" || Ge(t, o);
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function It(e, o) {
|
|
799
799
|
const t = o.get(e);
|
|
800
800
|
if (t)
|
|
801
801
|
return t;
|
|
802
|
-
let n = ne(e, [], !1).filter((l) =>
|
|
803
|
-
const
|
|
804
|
-
let r =
|
|
805
|
-
for (;
|
|
806
|
-
const l = L(r),
|
|
807
|
-
!
|
|
802
|
+
let n = ne(e, [], !1).filter((l) => I(l) && Q(l) !== "body"), i = null;
|
|
803
|
+
const s = L(e).position === "fixed";
|
|
804
|
+
let r = s ? $(e) : e;
|
|
805
|
+
for (; I(r) && !J(r); ) {
|
|
806
|
+
const l = L(r), a = Ce(r);
|
|
807
|
+
!a && l.position === "fixed" && (i = null), (s ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || oe(r) && !a && Ge(e, r)) ? n = n.filter((u) => u !== r) : i = l, r = $(r);
|
|
808
808
|
}
|
|
809
809
|
return o.set(e, n), n;
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function Lt(e) {
|
|
812
812
|
let {
|
|
813
813
|
element: o,
|
|
814
814
|
boundary: t,
|
|
815
815
|
rootBoundary: n,
|
|
816
|
-
strategy:
|
|
816
|
+
strategy: i
|
|
817
817
|
} = e;
|
|
818
|
-
const r = [...t === "clippingAncestors" ? pe(o) ? [] :
|
|
819
|
-
const d =
|
|
820
|
-
return
|
|
821
|
-
},
|
|
818
|
+
const r = [...t === "clippingAncestors" ? pe(o) ? [] : It(o, this._c) : [].concat(t), n], l = r[0], a = r.reduce((c, u) => {
|
|
819
|
+
const d = Ie(o, u, i);
|
|
820
|
+
return c.top = H(d.top, c.top), c.right = le(d.right, c.right), c.bottom = le(d.bottom, c.bottom), c.left = H(d.left, c.left), c;
|
|
821
|
+
}, Ie(o, l, i));
|
|
822
822
|
return {
|
|
823
|
-
width:
|
|
824
|
-
height:
|
|
825
|
-
x:
|
|
826
|
-
y:
|
|
823
|
+
width: a.right - a.left,
|
|
824
|
+
height: a.bottom - a.top,
|
|
825
|
+
x: a.left,
|
|
826
|
+
y: a.top
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function _t(e) {
|
|
830
830
|
const {
|
|
831
831
|
width: o,
|
|
832
832
|
height: t
|
|
@@ -836,19 +836,19 @@ function Nt(e) {
|
|
|
836
836
|
height: t
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
|
-
function
|
|
840
|
-
const n = D(o),
|
|
839
|
+
function Dt(e, o, t) {
|
|
840
|
+
const n = D(o), i = F(o), s = t === "fixed", r = q(e, !0, s, o);
|
|
841
841
|
let l = {
|
|
842
842
|
scrollLeft: 0,
|
|
843
843
|
scrollTop: 0
|
|
844
844
|
};
|
|
845
|
-
const
|
|
846
|
-
if (n || !n && !
|
|
847
|
-
if ((Q(o) !== "body" || oe(
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
} else
|
|
851
|
-
const
|
|
845
|
+
const a = _(0);
|
|
846
|
+
if (n || !n && !s)
|
|
847
|
+
if ((Q(o) !== "body" || oe(i)) && (l = xe(o)), n) {
|
|
848
|
+
const h = q(o, !0, s, o);
|
|
849
|
+
a.x = h.x + o.clientLeft, a.y = h.y + o.clientTop;
|
|
850
|
+
} else i && (a.x = ke(i));
|
|
851
|
+
const c = i && !n && !s ? Ze(i, l) : _(0), u = r.left + l.scrollLeft - a.x - c.x, d = r.top + l.scrollTop - a.y - c.y;
|
|
852
852
|
return {
|
|
853
853
|
x: u,
|
|
854
854
|
y: d,
|
|
@@ -865,30 +865,30 @@ function Le(e, o) {
|
|
|
865
865
|
if (o)
|
|
866
866
|
return o(e);
|
|
867
867
|
let t = e.offsetParent;
|
|
868
|
-
return
|
|
868
|
+
return F(e) === t && (t = t.ownerDocument.body), t;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
const t =
|
|
870
|
+
function Je(e, o) {
|
|
871
|
+
const t = T(e);
|
|
872
872
|
if (pe(e))
|
|
873
873
|
return t;
|
|
874
874
|
if (!D(e)) {
|
|
875
|
-
let
|
|
876
|
-
for (;
|
|
877
|
-
if (
|
|
878
|
-
return
|
|
879
|
-
|
|
875
|
+
let i = $(e);
|
|
876
|
+
for (; i && !J(i); ) {
|
|
877
|
+
if (I(i) && !we(i))
|
|
878
|
+
return i;
|
|
879
|
+
i = $(i);
|
|
880
880
|
}
|
|
881
881
|
return t;
|
|
882
882
|
}
|
|
883
883
|
let n = Le(e, o);
|
|
884
|
-
for (; n &&
|
|
884
|
+
for (; n && Ot(n) && we(n); )
|
|
885
885
|
n = Le(n, o);
|
|
886
|
-
return n && J(n) && we(n) && !
|
|
886
|
+
return n && J(n) && we(n) && !Ce(n) ? t : n || Ct(e) || t;
|
|
887
887
|
}
|
|
888
|
-
const
|
|
889
|
-
const o = this.getOffsetParent ||
|
|
888
|
+
const Ft = async function(e) {
|
|
889
|
+
const o = this.getOffsetParent || Je, t = this.getDimensions, n = await t(e.floating);
|
|
890
890
|
return {
|
|
891
|
-
reference:
|
|
891
|
+
reference: Dt(e.reference, await o(e.floating), e.strategy),
|
|
892
892
|
floating: {
|
|
893
893
|
x: 0,
|
|
894
894
|
y: 0,
|
|
@@ -897,117 +897,120 @@ const _t = async function(e) {
|
|
|
897
897
|
}
|
|
898
898
|
};
|
|
899
899
|
};
|
|
900
|
-
function
|
|
900
|
+
function Pt(e) {
|
|
901
901
|
return L(e).direction === "rtl";
|
|
902
902
|
}
|
|
903
|
-
const
|
|
904
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
905
|
-
getDocumentElement:
|
|
906
|
-
getClippingRect:
|
|
907
|
-
getOffsetParent:
|
|
908
|
-
getElementRects:
|
|
909
|
-
getClientRects:
|
|
910
|
-
getDimensions:
|
|
903
|
+
const Vt = {
|
|
904
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: kt,
|
|
905
|
+
getDocumentElement: F,
|
|
906
|
+
getClippingRect: Lt,
|
|
907
|
+
getOffsetParent: Je,
|
|
908
|
+
getElementRects: Ft,
|
|
909
|
+
getClientRects: At,
|
|
910
|
+
getDimensions: _t,
|
|
911
911
|
getScale: Z,
|
|
912
|
-
isElement:
|
|
913
|
-
isRTL:
|
|
912
|
+
isElement: I,
|
|
913
|
+
isRTL: Pt
|
|
914
914
|
};
|
|
915
|
-
function
|
|
915
|
+
function Qe(e, o) {
|
|
916
|
+
return e.x === o.x && e.y === o.y && e.width === o.width && e.height === o.height;
|
|
917
|
+
}
|
|
918
|
+
function Wt(e, o) {
|
|
916
919
|
let t = null, n;
|
|
917
|
-
const
|
|
918
|
-
function
|
|
920
|
+
const i = F(e);
|
|
921
|
+
function s() {
|
|
919
922
|
var l;
|
|
920
923
|
clearTimeout(n), (l = t) == null || l.disconnect(), t = null;
|
|
921
924
|
}
|
|
922
|
-
function r(l,
|
|
923
|
-
l === void 0 && (l = !1),
|
|
924
|
-
const {
|
|
925
|
-
left:
|
|
926
|
-
top:
|
|
927
|
-
width:
|
|
928
|
-
height:
|
|
929
|
-
} =
|
|
930
|
-
if (l || o(), !
|
|
925
|
+
function r(l, a) {
|
|
926
|
+
l === void 0 && (l = !1), a === void 0 && (a = 1), s();
|
|
927
|
+
const c = e.getBoundingClientRect(), {
|
|
928
|
+
left: u,
|
|
929
|
+
top: d,
|
|
930
|
+
width: h,
|
|
931
|
+
height: f
|
|
932
|
+
} = c;
|
|
933
|
+
if (l || o(), !h || !f)
|
|
931
934
|
return;
|
|
932
|
-
const
|
|
933
|
-
rootMargin: -
|
|
934
|
-
threshold: H(0, le(1,
|
|
935
|
+
const g = ie(d), x = ie(i.clientWidth - (u + h)), w = ie(i.clientHeight - (d + f)), m = ie(u), v = {
|
|
936
|
+
rootMargin: -g + "px " + -x + "px " + -w + "px " + -m + "px",
|
|
937
|
+
threshold: H(0, le(1, a)) || 1
|
|
935
938
|
};
|
|
936
|
-
let
|
|
937
|
-
function
|
|
938
|
-
const O =
|
|
939
|
-
if (O !==
|
|
940
|
-
if (!
|
|
939
|
+
let E = !0;
|
|
940
|
+
function y(R) {
|
|
941
|
+
const O = R[0].intersectionRatio;
|
|
942
|
+
if (O !== a) {
|
|
943
|
+
if (!E)
|
|
941
944
|
return r();
|
|
942
945
|
O ? r(!1, O) : n = setTimeout(() => {
|
|
943
946
|
r(!1, 1e-7);
|
|
944
947
|
}, 1e3);
|
|
945
948
|
}
|
|
946
|
-
|
|
949
|
+
O === 1 && !Qe(c, e.getBoundingClientRect()) && r(), E = !1;
|
|
947
950
|
}
|
|
948
951
|
try {
|
|
949
|
-
t = new IntersectionObserver(
|
|
950
|
-
...
|
|
952
|
+
t = new IntersectionObserver(y, {
|
|
953
|
+
...v,
|
|
951
954
|
// Handle <iframe>s
|
|
952
|
-
root:
|
|
955
|
+
root: i.ownerDocument
|
|
953
956
|
});
|
|
954
957
|
} catch {
|
|
955
|
-
t = new IntersectionObserver(
|
|
958
|
+
t = new IntersectionObserver(y, v);
|
|
956
959
|
}
|
|
957
960
|
t.observe(e);
|
|
958
961
|
}
|
|
959
|
-
return r(!0),
|
|
962
|
+
return r(!0), s;
|
|
960
963
|
}
|
|
961
|
-
function
|
|
964
|
+
function Bt(e, o, t, n) {
|
|
962
965
|
n === void 0 && (n = {});
|
|
963
966
|
const {
|
|
964
|
-
ancestorScroll:
|
|
965
|
-
ancestorResize:
|
|
967
|
+
ancestorScroll: i = !0,
|
|
968
|
+
ancestorResize: s = !0,
|
|
966
969
|
elementResize: r = typeof ResizeObserver == "function",
|
|
967
970
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
968
|
-
animationFrame:
|
|
969
|
-
} = n,
|
|
970
|
-
u.forEach((
|
|
971
|
-
|
|
971
|
+
animationFrame: a = !1
|
|
972
|
+
} = n, c = Me(e), u = i || s ? [...c ? ne(c) : [], ...ne(o)] : [];
|
|
973
|
+
u.forEach((m) => {
|
|
974
|
+
i && m.addEventListener("scroll", t, {
|
|
972
975
|
passive: !0
|
|
973
|
-
}),
|
|
976
|
+
}), s && m.addEventListener("resize", t);
|
|
974
977
|
});
|
|
975
|
-
const d =
|
|
976
|
-
let
|
|
977
|
-
r && (f = new ResizeObserver((
|
|
978
|
-
let [p] =
|
|
979
|
-
p && p.target ===
|
|
978
|
+
const d = c && l ? Wt(c, t) : null;
|
|
979
|
+
let h = -1, f = null;
|
|
980
|
+
r && (f = new ResizeObserver((m) => {
|
|
981
|
+
let [p] = m;
|
|
982
|
+
p && p.target === c && f && (f.unobserve(o), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
980
983
|
var v;
|
|
981
984
|
(v = f) == null || v.observe(o);
|
|
982
985
|
})), t();
|
|
983
|
-
}),
|
|
984
|
-
let g, x =
|
|
985
|
-
|
|
986
|
+
}), c && !a && f.observe(c), f.observe(o));
|
|
987
|
+
let g, x = a ? q(e) : null;
|
|
988
|
+
a && w();
|
|
986
989
|
function w() {
|
|
987
|
-
const
|
|
988
|
-
x && (
|
|
990
|
+
const m = q(e);
|
|
991
|
+
x && !Qe(x, m) && t(), x = m, g = requestAnimationFrame(w);
|
|
989
992
|
}
|
|
990
993
|
return t(), () => {
|
|
991
|
-
var
|
|
994
|
+
var m;
|
|
992
995
|
u.forEach((p) => {
|
|
993
|
-
|
|
994
|
-
}), d == null || d(), (
|
|
996
|
+
i && p.removeEventListener("scroll", t), s && p.removeEventListener("resize", t);
|
|
997
|
+
}), d == null || d(), (m = f) == null || m.disconnect(), f = null, a && cancelAnimationFrame(g);
|
|
995
998
|
};
|
|
996
999
|
}
|
|
997
|
-
const
|
|
998
|
-
const n = /* @__PURE__ */ new Map(),
|
|
999
|
-
platform:
|
|
1000
|
+
const jt = Et, $t = St, Ht = bt, Ut = (e, o, t) => {
|
|
1001
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
1002
|
+
platform: Vt,
|
|
1000
1003
|
...t
|
|
1001
|
-
},
|
|
1002
|
-
...
|
|
1004
|
+
}, s = {
|
|
1005
|
+
...i.platform,
|
|
1003
1006
|
_c: n
|
|
1004
1007
|
};
|
|
1005
|
-
return
|
|
1006
|
-
...
|
|
1007
|
-
platform:
|
|
1008
|
+
return yt(e, o, {
|
|
1009
|
+
...i,
|
|
1010
|
+
platform: s
|
|
1008
1011
|
});
|
|
1009
1012
|
};
|
|
1010
|
-
var
|
|
1013
|
+
var se = typeof document < "u" ? ot : re;
|
|
1011
1014
|
function fe(e, o) {
|
|
1012
1015
|
if (e === o)
|
|
1013
1016
|
return !0;
|
|
@@ -1015,7 +1018,7 @@ function fe(e, o) {
|
|
|
1015
1018
|
return !1;
|
|
1016
1019
|
if (typeof e == "function" && e.toString() === o.toString())
|
|
1017
1020
|
return !0;
|
|
1018
|
-
let t, n,
|
|
1021
|
+
let t, n, i;
|
|
1019
1022
|
if (e && o && typeof e == "object") {
|
|
1020
1023
|
if (Array.isArray(e)) {
|
|
1021
1024
|
if (t = e.length, t !== o.length) return !1;
|
|
@@ -1024,47 +1027,47 @@ function fe(e, o) {
|
|
|
1024
1027
|
return !1;
|
|
1025
1028
|
return !0;
|
|
1026
1029
|
}
|
|
1027
|
-
if (
|
|
1030
|
+
if (i = Object.keys(e), t = i.length, t !== Object.keys(o).length)
|
|
1028
1031
|
return !1;
|
|
1029
1032
|
for (n = t; n-- !== 0; )
|
|
1030
|
-
if (!{}.hasOwnProperty.call(o,
|
|
1033
|
+
if (!{}.hasOwnProperty.call(o, i[n]))
|
|
1031
1034
|
return !1;
|
|
1032
1035
|
for (n = t; n-- !== 0; ) {
|
|
1033
|
-
const
|
|
1034
|
-
if (!(
|
|
1036
|
+
const s = i[n];
|
|
1037
|
+
if (!(s === "_owner" && e.$$typeof) && !fe(e[s], o[s]))
|
|
1035
1038
|
return !1;
|
|
1036
1039
|
}
|
|
1037
1040
|
return !0;
|
|
1038
1041
|
}
|
|
1039
1042
|
return e !== e && o !== o;
|
|
1040
1043
|
}
|
|
1041
|
-
function
|
|
1044
|
+
function et(e) {
|
|
1042
1045
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1043
1046
|
}
|
|
1044
1047
|
function _e(e, o) {
|
|
1045
|
-
const t =
|
|
1048
|
+
const t = et(e);
|
|
1046
1049
|
return Math.round(o * t) / t;
|
|
1047
1050
|
}
|
|
1048
1051
|
function ye(e) {
|
|
1049
1052
|
const o = C.useRef(e);
|
|
1050
|
-
return
|
|
1053
|
+
return se(() => {
|
|
1051
1054
|
o.current = e;
|
|
1052
1055
|
}), o;
|
|
1053
1056
|
}
|
|
1054
|
-
function
|
|
1057
|
+
function qt(e) {
|
|
1055
1058
|
e === void 0 && (e = {});
|
|
1056
1059
|
const {
|
|
1057
1060
|
placement: o = "bottom",
|
|
1058
1061
|
strategy: t = "absolute",
|
|
1059
1062
|
middleware: n = [],
|
|
1060
|
-
platform:
|
|
1063
|
+
platform: i,
|
|
1061
1064
|
elements: {
|
|
1062
|
-
reference:
|
|
1065
|
+
reference: s,
|
|
1063
1066
|
floating: r
|
|
1064
1067
|
} = {},
|
|
1065
1068
|
transform: l = !0,
|
|
1066
|
-
whileElementsMounted:
|
|
1067
|
-
open:
|
|
1069
|
+
whileElementsMounted: a,
|
|
1070
|
+
open: c
|
|
1068
1071
|
} = e, [u, d] = C.useState({
|
|
1069
1072
|
x: 0,
|
|
1070
1073
|
y: 0,
|
|
@@ -1072,56 +1075,56 @@ function Ht(e) {
|
|
|
1072
1075
|
placement: o,
|
|
1073
1076
|
middlewareData: {},
|
|
1074
1077
|
isPositioned: !1
|
|
1075
|
-
}), [
|
|
1076
|
-
fe(
|
|
1077
|
-
const [g, x] = C.useState(null), [w,
|
|
1078
|
-
S !==
|
|
1078
|
+
}), [h, f] = C.useState(n);
|
|
1079
|
+
fe(h, n) || f(n);
|
|
1080
|
+
const [g, x] = C.useState(null), [w, m] = C.useState(null), p = C.useCallback((S) => {
|
|
1081
|
+
S !== R.current && (R.current = S, x(S));
|
|
1079
1082
|
}, []), v = C.useCallback((S) => {
|
|
1080
|
-
S !==
|
|
1081
|
-
}, []), E =
|
|
1082
|
-
if (!
|
|
1083
|
+
S !== O.current && (O.current = S, m(S));
|
|
1084
|
+
}, []), E = s || g, y = r || w, R = C.useRef(null), O = C.useRef(null), z = C.useRef(u), K = a != null, P = ye(a), Y = ye(i), ee = ye(c), B = C.useCallback(() => {
|
|
1085
|
+
if (!R.current || !O.current)
|
|
1083
1086
|
return;
|
|
1084
1087
|
const S = {
|
|
1085
1088
|
placement: o,
|
|
1086
1089
|
strategy: t,
|
|
1087
|
-
middleware:
|
|
1090
|
+
middleware: h
|
|
1088
1091
|
};
|
|
1089
|
-
|
|
1092
|
+
Y.current && (S.platform = Y.current), Ut(R.current, O.current, S).then((A) => {
|
|
1090
1093
|
const j = {
|
|
1091
|
-
...
|
|
1094
|
+
...A,
|
|
1092
1095
|
// The floating element's position may be recomputed while it's closed
|
|
1093
1096
|
// but still mounted (such as when transitioning out). To ensure
|
|
1094
1097
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1095
1098
|
// setting it to `true` when `open === false` (must be specified).
|
|
1096
1099
|
isPositioned: ee.current !== !1
|
|
1097
1100
|
};
|
|
1098
|
-
|
|
1101
|
+
N.current && !fe(z.current, j) && (z.current = j, st.flushSync(() => {
|
|
1099
1102
|
d(j);
|
|
1100
1103
|
}));
|
|
1101
1104
|
});
|
|
1102
|
-
}, [
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
+
}, [h, o, t, Y, ee]);
|
|
1106
|
+
se(() => {
|
|
1107
|
+
c === !1 && z.current.isPositioned && (z.current.isPositioned = !1, d((S) => ({
|
|
1105
1108
|
...S,
|
|
1106
1109
|
isPositioned: !1
|
|
1107
1110
|
})));
|
|
1108
|
-
}, [
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
}), []),
|
|
1113
|
-
if (E && (
|
|
1114
|
-
if (
|
|
1115
|
-
return
|
|
1111
|
+
}, [c]);
|
|
1112
|
+
const N = C.useRef(!1);
|
|
1113
|
+
se(() => (N.current = !0, () => {
|
|
1114
|
+
N.current = !1;
|
|
1115
|
+
}), []), se(() => {
|
|
1116
|
+
if (E && (R.current = E), y && (O.current = y), E && y) {
|
|
1117
|
+
if (P.current)
|
|
1118
|
+
return P.current(E, y, B);
|
|
1116
1119
|
B();
|
|
1117
1120
|
}
|
|
1118
|
-
}, [E, y, B,
|
|
1121
|
+
}, [E, y, B, P, K]);
|
|
1119
1122
|
const te = C.useMemo(() => ({
|
|
1120
|
-
reference:
|
|
1121
|
-
floating:
|
|
1123
|
+
reference: R,
|
|
1124
|
+
floating: O,
|
|
1122
1125
|
setReference: p,
|
|
1123
1126
|
setFloating: v
|
|
1124
|
-
}), [p, v]),
|
|
1127
|
+
}), [p, v]), k = C.useMemo(() => ({
|
|
1125
1128
|
reference: E,
|
|
1126
1129
|
floating: y
|
|
1127
1130
|
}), [E, y]), V = C.useMemo(() => {
|
|
@@ -1130,40 +1133,40 @@ function Ht(e) {
|
|
|
1130
1133
|
left: 0,
|
|
1131
1134
|
top: 0
|
|
1132
1135
|
};
|
|
1133
|
-
if (!
|
|
1136
|
+
if (!k.floating)
|
|
1134
1137
|
return S;
|
|
1135
|
-
const
|
|
1138
|
+
const A = _e(k.floating, u.x), j = _e(k.floating, u.y);
|
|
1136
1139
|
return l ? {
|
|
1137
1140
|
...S,
|
|
1138
|
-
transform: "translate(" +
|
|
1139
|
-
...
|
|
1141
|
+
transform: "translate(" + A + "px, " + j + "px)",
|
|
1142
|
+
...et(k.floating) >= 1.5 && {
|
|
1140
1143
|
willChange: "transform"
|
|
1141
1144
|
}
|
|
1142
1145
|
} : {
|
|
1143
1146
|
position: t,
|
|
1144
|
-
left:
|
|
1147
|
+
left: A,
|
|
1145
1148
|
top: j
|
|
1146
1149
|
};
|
|
1147
|
-
}, [t, l,
|
|
1150
|
+
}, [t, l, k.floating, u.x, u.y]);
|
|
1148
1151
|
return C.useMemo(() => ({
|
|
1149
1152
|
...u,
|
|
1150
1153
|
update: B,
|
|
1151
1154
|
refs: te,
|
|
1152
|
-
elements:
|
|
1155
|
+
elements: k,
|
|
1153
1156
|
floatingStyles: V
|
|
1154
|
-
}), [u, B, te,
|
|
1157
|
+
}), [u, B, te, k, V]);
|
|
1155
1158
|
}
|
|
1156
|
-
const
|
|
1157
|
-
...
|
|
1158
|
-
options: [e, o]
|
|
1159
|
-
}), Kt = (e, o) => ({
|
|
1160
|
-
...Bt(e),
|
|
1159
|
+
const Kt = (e, o) => ({
|
|
1160
|
+
...jt(e),
|
|
1161
1161
|
options: [e, o]
|
|
1162
1162
|
}), Yt = (e, o) => ({
|
|
1163
|
-
|
|
1163
|
+
...$t(e),
|
|
1164
|
+
options: [e, o]
|
|
1165
|
+
}), Xt = (e, o) => ({
|
|
1166
|
+
...Ht(e),
|
|
1164
1167
|
options: [e, o]
|
|
1165
1168
|
});
|
|
1166
|
-
function
|
|
1169
|
+
function Zt(e, o) {
|
|
1167
1170
|
return () => {
|
|
1168
1171
|
if (typeof document > "u")
|
|
1169
1172
|
return;
|
|
@@ -1175,153 +1178,156 @@ function qt(e, o) {
|
|
|
1175
1178
|
};
|
|
1176
1179
|
};
|
|
1177
1180
|
}
|
|
1178
|
-
function
|
|
1181
|
+
function tt(e) {
|
|
1179
1182
|
const {
|
|
1180
1183
|
className: o,
|
|
1181
1184
|
placement: t = "bottom-start",
|
|
1182
1185
|
trigger: n = "hover",
|
|
1183
|
-
content:
|
|
1184
|
-
children:
|
|
1186
|
+
content: i,
|
|
1187
|
+
children: s,
|
|
1185
1188
|
onClose: r,
|
|
1186
1189
|
onOpen: l,
|
|
1187
|
-
disabled:
|
|
1188
|
-
show:
|
|
1190
|
+
disabled: a = !1,
|
|
1191
|
+
show: c = !1,
|
|
1189
1192
|
setShow: u,
|
|
1190
1193
|
role: d = "tooltip",
|
|
1191
|
-
style:
|
|
1194
|
+
style: h,
|
|
1192
1195
|
...f
|
|
1193
|
-
} = e, [g, x] = de(
|
|
1196
|
+
} = e, [g, x] = de(c), w = () => u !== void 0 && c !== void 0 ? c : g, m = () => u !== void 0 && c !== void 0 ? u : x, { x: p, y: v, strategy: E, refs: y } = qt({
|
|
1194
1197
|
open: w(),
|
|
1195
|
-
middleware: [
|
|
1196
|
-
whileElementsMounted:
|
|
1198
|
+
middleware: [Kt(4), Xt(), Yt()],
|
|
1199
|
+
whileElementsMounted: Bt,
|
|
1197
1200
|
placement: t
|
|
1198
|
-
}),
|
|
1201
|
+
}), R = it();
|
|
1199
1202
|
return re(
|
|
1200
|
-
|
|
1201
|
-
|
|
1203
|
+
Zt(y.floating, (O) => {
|
|
1204
|
+
O && m()(!1);
|
|
1202
1205
|
}),
|
|
1203
1206
|
[]
|
|
1204
|
-
), /* @__PURE__ */ W(
|
|
1207
|
+
), /* @__PURE__ */ W(Ve, { children: [
|
|
1205
1208
|
/* @__PURE__ */ b(
|
|
1206
1209
|
"div",
|
|
1207
1210
|
{
|
|
1208
1211
|
className: "z-auto min-w-fit max-w-fit",
|
|
1209
|
-
id: `zen__popover-${
|
|
1212
|
+
id: `zen__popover-${R}`,
|
|
1210
1213
|
ref: y.setReference,
|
|
1211
|
-
onClick: (
|
|
1214
|
+
onClick: (O) => {
|
|
1212
1215
|
if (n === "click") {
|
|
1213
|
-
if (
|
|
1216
|
+
if (a)
|
|
1214
1217
|
return;
|
|
1215
|
-
w() ? (
|
|
1218
|
+
w() ? (m()(!1), r == null || r()) : (m()(!0), l == null || l());
|
|
1216
1219
|
}
|
|
1217
|
-
|
|
1220
|
+
O.stopPropagation();
|
|
1218
1221
|
},
|
|
1219
1222
|
role: d,
|
|
1220
|
-
children:
|
|
1223
|
+
children: s
|
|
1221
1224
|
}
|
|
1222
1225
|
),
|
|
1223
|
-
w() &&
|
|
1226
|
+
w() && rt(
|
|
1224
1227
|
/* @__PURE__ */ b(
|
|
1225
1228
|
"div",
|
|
1226
1229
|
{
|
|
1227
1230
|
...f,
|
|
1228
|
-
onClick: (
|
|
1231
|
+
onClick: (O) => O.stopPropagation(),
|
|
1229
1232
|
role: "tooltip",
|
|
1230
|
-
className:
|
|
1233
|
+
className: M(
|
|
1231
1234
|
"zen__popover z-50 w-fit rounded border border-border bg-background shadow-secondary",
|
|
1232
1235
|
o
|
|
1233
1236
|
),
|
|
1234
1237
|
ref: y.setFloating,
|
|
1235
1238
|
style: {
|
|
1236
|
-
...
|
|
1239
|
+
...h,
|
|
1237
1240
|
position: E,
|
|
1238
1241
|
top: v ?? 0,
|
|
1239
1242
|
left: p ?? 0
|
|
1240
1243
|
},
|
|
1241
|
-
children:
|
|
1244
|
+
children: i
|
|
1242
1245
|
}
|
|
1243
1246
|
),
|
|
1244
1247
|
document.body
|
|
1245
1248
|
)
|
|
1246
1249
|
] });
|
|
1247
1250
|
}
|
|
1248
|
-
function
|
|
1251
|
+
function Gt(e) {
|
|
1249
1252
|
var x, w;
|
|
1250
1253
|
const {
|
|
1251
1254
|
items: o = [],
|
|
1252
1255
|
children: t,
|
|
1253
1256
|
moreItemsLabel: n = "",
|
|
1254
|
-
parentRef:
|
|
1255
|
-
data:
|
|
1256
|
-
estimator: r = (
|
|
1257
|
+
parentRef: i,
|
|
1258
|
+
data: s,
|
|
1259
|
+
estimator: r = (m, p) => p + 30,
|
|
1257
1260
|
font: l = "12px Inter",
|
|
1258
|
-
badgeVariant:
|
|
1259
|
-
badgeStyles:
|
|
1261
|
+
badgeVariant: a = "secondary",
|
|
1262
|
+
badgeStyles: c
|
|
1260
1263
|
} = e, [u, d] = de({
|
|
1261
1264
|
visible: o,
|
|
1262
1265
|
hidden: []
|
|
1263
|
-
}),
|
|
1266
|
+
}), h = ve(() => {
|
|
1264
1267
|
if (typeof document > "u")
|
|
1265
1268
|
return null;
|
|
1266
1269
|
const p = document.createElement("canvas").getContext("2d");
|
|
1267
1270
|
return p && (p.font = l), p;
|
|
1268
1271
|
}, []), f = () => {
|
|
1269
|
-
const
|
|
1270
|
-
if (!
|
|
1272
|
+
const m = i == null ? void 0 : i.current;
|
|
1273
|
+
if (!m)
|
|
1271
1274
|
return;
|
|
1272
|
-
const p =
|
|
1273
|
-
|
|
1275
|
+
const p = m.offsetWidth, v = [], E = [], y = r(
|
|
1276
|
+
n,
|
|
1277
|
+
((h == null ? void 0 : h.measureText(n).width) ?? 0) + 10
|
|
1278
|
+
);
|
|
1279
|
+
g == null || g.reduce((R, O, z) => (R + O + y > p - 20 ? E.push(o[z]) : v.push(o[z]), R + O), 0), d({
|
|
1274
1280
|
visible: v,
|
|
1275
1281
|
hidden: E
|
|
1276
1282
|
});
|
|
1277
1283
|
}, g = ve(
|
|
1278
|
-
() => (o == null ? void 0 : o.map((
|
|
1284
|
+
() => (o == null ? void 0 : o.map((m) => r(m, (h == null ? void 0 : h.measureText(m).width) ?? 0))) ?? [],
|
|
1279
1285
|
[o]
|
|
1280
1286
|
);
|
|
1281
1287
|
return re(() => {
|
|
1282
1288
|
f();
|
|
1283
1289
|
}, [o]), re(() => {
|
|
1284
|
-
if (!(
|
|
1285
|
-
const
|
|
1290
|
+
if (!(i != null && i.current)) return;
|
|
1291
|
+
const m = new ResizeObserver(() => {
|
|
1286
1292
|
f();
|
|
1287
1293
|
});
|
|
1288
|
-
return
|
|
1289
|
-
|
|
1294
|
+
return m.observe(i.current), () => {
|
|
1295
|
+
m.disconnect();
|
|
1290
1296
|
};
|
|
1291
|
-
}, [o]), /* @__PURE__ */ W(
|
|
1292
|
-
(x = u.visible) == null ? void 0 : x.map((
|
|
1297
|
+
}, [o]), /* @__PURE__ */ W(Ve, { children: [
|
|
1298
|
+
(x = u.visible) == null ? void 0 : x.map((m, p) => t(m, p, s == null ? void 0 : s[p])),
|
|
1293
1299
|
((w = u.hidden) == null ? void 0 : w.length) > 0 && /* @__PURE__ */ b(
|
|
1294
|
-
|
|
1300
|
+
tt,
|
|
1295
1301
|
{
|
|
1296
1302
|
trigger: "click",
|
|
1297
1303
|
content: /* @__PURE__ */ b("div", { className: "grid max-h-60 grid-flow-row grid-cols-2 gap-3 overflow-auto p-2", children: u.hidden.map(
|
|
1298
|
-
(
|
|
1299
|
-
|
|
1304
|
+
(m, p) => t(
|
|
1305
|
+
m,
|
|
1300
1306
|
u.visible.length + p,
|
|
1301
|
-
|
|
1307
|
+
s == null ? void 0 : s[u.visible.length + p]
|
|
1302
1308
|
)
|
|
1303
1309
|
) }),
|
|
1304
|
-
children: /* @__PURE__ */ b(
|
|
1310
|
+
children: /* @__PURE__ */ b(Be, { className: c, variant: a, children: /* @__PURE__ */ b("p", { children: `+${u.hidden.length} ${n}` }) }, "more_items_button")
|
|
1305
1311
|
}
|
|
1306
1312
|
)
|
|
1307
1313
|
] });
|
|
1308
1314
|
}
|
|
1309
1315
|
function X(e, o, t) {
|
|
1310
|
-
let n = t.initialDeps ?? [],
|
|
1316
|
+
let n = t.initialDeps ?? [], i;
|
|
1311
1317
|
return () => {
|
|
1312
|
-
var
|
|
1313
|
-
let
|
|
1314
|
-
t.key && ((
|
|
1318
|
+
var s, r, l, a;
|
|
1319
|
+
let c;
|
|
1320
|
+
t.key && ((s = t.debug) != null && s.call(t)) && (c = Date.now());
|
|
1315
1321
|
const u = e();
|
|
1316
1322
|
if (!(u.length !== n.length || u.some((f, g) => n[g] !== f)))
|
|
1317
|
-
return
|
|
1323
|
+
return i;
|
|
1318
1324
|
n = u;
|
|
1319
|
-
let
|
|
1320
|
-
if (t.key && ((r = t.debug) != null && r.call(t)) && (
|
|
1321
|
-
const f = Math.round((Date.now() -
|
|
1322
|
-
for (
|
|
1323
|
-
|
|
1324
|
-
return
|
|
1325
|
+
let h;
|
|
1326
|
+
if (t.key && ((r = t.debug) != null && r.call(t)) && (h = Date.now()), i = o(...u), t.key && ((l = t.debug) != null && l.call(t))) {
|
|
1327
|
+
const f = Math.round((Date.now() - c) * 100) / 100, g = Math.round((Date.now() - h) * 100) / 100, x = g / 16, w = (m, p) => {
|
|
1328
|
+
for (m = String(m); m.length < p; )
|
|
1329
|
+
m = " " + m;
|
|
1330
|
+
return m;
|
|
1325
1331
|
};
|
|
1326
1332
|
console.info(
|
|
1327
1333
|
`%c⏱ ${w(g, 5)} /${w(f, 5)} ms`,
|
|
@@ -1335,7 +1341,7 @@ function X(e, o, t) {
|
|
|
1335
1341
|
t == null ? void 0 : t.key
|
|
1336
1342
|
);
|
|
1337
1343
|
}
|
|
1338
|
-
return (
|
|
1344
|
+
return (a = t == null ? void 0 : t.onChange) == null || a.call(t, i), i;
|
|
1339
1345
|
};
|
|
1340
1346
|
}
|
|
1341
1347
|
function be(e, o) {
|
|
@@ -1343,69 +1349,74 @@ function be(e, o) {
|
|
|
1343
1349
|
throw new Error("Unexpected undefined");
|
|
1344
1350
|
return e;
|
|
1345
1351
|
}
|
|
1346
|
-
const
|
|
1352
|
+
const Jt = (e, o) => Math.abs(e - o) < 1, Qt = (e, o, t) => {
|
|
1347
1353
|
let n;
|
|
1348
|
-
return function(...
|
|
1349
|
-
e.clearTimeout(n), n = e.setTimeout(() => o.apply(this,
|
|
1354
|
+
return function(...i) {
|
|
1355
|
+
e.clearTimeout(n), n = e.setTimeout(() => o.apply(this, i), t);
|
|
1350
1356
|
};
|
|
1351
|
-
},
|
|
1357
|
+
}, en = (e) => e, tn = (e) => {
|
|
1352
1358
|
const o = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
|
|
1353
|
-
for (let
|
|
1354
|
-
n.push(
|
|
1359
|
+
for (let i = o; i <= t; i++)
|
|
1360
|
+
n.push(i);
|
|
1355
1361
|
return n;
|
|
1356
|
-
},
|
|
1362
|
+
}, nn = (e, o) => {
|
|
1357
1363
|
const t = e.scrollElement;
|
|
1358
1364
|
if (!t)
|
|
1359
1365
|
return;
|
|
1360
1366
|
const n = e.targetWindow;
|
|
1361
1367
|
if (!n)
|
|
1362
1368
|
return;
|
|
1363
|
-
const
|
|
1364
|
-
const { width: l, height:
|
|
1365
|
-
o({ width: Math.round(l), height: Math.round(
|
|
1369
|
+
const i = (r) => {
|
|
1370
|
+
const { width: l, height: a } = r;
|
|
1371
|
+
o({ width: Math.round(l), height: Math.round(a) });
|
|
1366
1372
|
};
|
|
1367
|
-
if (
|
|
1373
|
+
if (i(t.getBoundingClientRect()), !n.ResizeObserver)
|
|
1368
1374
|
return () => {
|
|
1369
1375
|
};
|
|
1370
|
-
const
|
|
1371
|
-
const l =
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1376
|
+
const s = new n.ResizeObserver((r) => {
|
|
1377
|
+
const l = () => {
|
|
1378
|
+
const a = r[0];
|
|
1379
|
+
if (a != null && a.borderBoxSize) {
|
|
1380
|
+
const c = a.borderBoxSize[0];
|
|
1381
|
+
if (c) {
|
|
1382
|
+
i({ width: c.inlineSize, height: c.blockSize });
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1377
1385
|
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1386
|
+
i(t.getBoundingClientRect());
|
|
1387
|
+
};
|
|
1388
|
+
e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
1380
1389
|
});
|
|
1381
|
-
return
|
|
1382
|
-
|
|
1390
|
+
return s.observe(t, { box: "border-box" }), () => {
|
|
1391
|
+
s.unobserve(t);
|
|
1383
1392
|
};
|
|
1384
1393
|
}, De = {
|
|
1385
1394
|
passive: !0
|
|
1386
|
-
},
|
|
1395
|
+
}, Fe = typeof window > "u" ? !0 : "onscrollend" in window, on = (e, o) => {
|
|
1387
1396
|
const t = e.scrollElement;
|
|
1388
1397
|
if (!t)
|
|
1389
1398
|
return;
|
|
1390
1399
|
const n = e.targetWindow;
|
|
1391
1400
|
if (!n)
|
|
1392
1401
|
return;
|
|
1393
|
-
let
|
|
1394
|
-
const
|
|
1395
|
-
} :
|
|
1402
|
+
let i = 0;
|
|
1403
|
+
const s = e.options.useScrollendEvent && Fe ? () => {
|
|
1404
|
+
} : Qt(
|
|
1396
1405
|
n,
|
|
1397
1406
|
() => {
|
|
1398
|
-
o(
|
|
1407
|
+
o(i, !1);
|
|
1399
1408
|
},
|
|
1400
1409
|
e.options.isScrollingResetDelay
|
|
1401
|
-
), r = (
|
|
1402
|
-
const { horizontal:
|
|
1403
|
-
|
|
1404
|
-
}, l = r(!0),
|
|
1405
|
-
|
|
1406
|
-
|
|
1410
|
+
), r = (u) => () => {
|
|
1411
|
+
const { horizontal: d, isRtl: h } = e.options;
|
|
1412
|
+
i = d ? t.scrollLeft * (h && -1 || 1) : t.scrollTop, s(), o(i, u);
|
|
1413
|
+
}, l = r(!0), a = r(!1);
|
|
1414
|
+
a(), t.addEventListener("scroll", l, De);
|
|
1415
|
+
const c = e.options.useScrollendEvent && Fe;
|
|
1416
|
+
return c && t.addEventListener("scrollend", a, De), () => {
|
|
1417
|
+
t.removeEventListener("scroll", l), c && t.removeEventListener("scrollend", a);
|
|
1407
1418
|
};
|
|
1408
|
-
},
|
|
1419
|
+
}, sn = (e, o, t) => {
|
|
1409
1420
|
if (o != null && o.borderBoxSize) {
|
|
1410
1421
|
const n = o.borderBoxSize[0];
|
|
1411
1422
|
if (n)
|
|
@@ -1416,43 +1427,46 @@ const Zt = (e, o) => Math.abs(e - o) < 1, Gt = (e, o, t) => {
|
|
|
1416
1427
|
return Math.round(
|
|
1417
1428
|
e.getBoundingClientRect()[t.options.horizontal ? "width" : "height"]
|
|
1418
1429
|
);
|
|
1419
|
-
},
|
|
1430
|
+
}, rn = (e, {
|
|
1420
1431
|
adjustments: o = 0,
|
|
1421
1432
|
behavior: t
|
|
1422
1433
|
}, n) => {
|
|
1423
|
-
var
|
|
1434
|
+
var i, s;
|
|
1424
1435
|
const r = e + o;
|
|
1425
|
-
(
|
|
1436
|
+
(s = (i = n.scrollElement) == null ? void 0 : i.scrollTo) == null || s.call(i, {
|
|
1426
1437
|
[n.options.horizontal ? "left" : "top"]: r,
|
|
1427
1438
|
behavior: t
|
|
1428
1439
|
});
|
|
1429
1440
|
};
|
|
1430
|
-
class
|
|
1441
|
+
class ln {
|
|
1431
1442
|
constructor(o) {
|
|
1432
1443
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
1433
1444
|
let t = null;
|
|
1434
|
-
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((
|
|
1435
|
-
|
|
1436
|
-
|
|
1445
|
+
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((i) => {
|
|
1446
|
+
i.forEach((s) => {
|
|
1447
|
+
const r = () => {
|
|
1448
|
+
this._measureElement(s.target, s);
|
|
1449
|
+
};
|
|
1450
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
|
|
1437
1451
|
});
|
|
1438
1452
|
}));
|
|
1439
1453
|
return {
|
|
1440
1454
|
disconnect: () => {
|
|
1441
|
-
var s;
|
|
1442
|
-
(s = n()) == null || s.disconnect(), t = null;
|
|
1443
|
-
},
|
|
1444
|
-
observe: (s) => {
|
|
1445
1455
|
var i;
|
|
1446
|
-
|
|
1456
|
+
(i = n()) == null || i.disconnect(), t = null;
|
|
1447
1457
|
},
|
|
1448
|
-
|
|
1449
|
-
var
|
|
1450
|
-
return (
|
|
1458
|
+
observe: (i) => {
|
|
1459
|
+
var s;
|
|
1460
|
+
return (s = n()) == null ? void 0 : s.observe(i, { box: "border-box" });
|
|
1461
|
+
},
|
|
1462
|
+
unobserve: (i) => {
|
|
1463
|
+
var s;
|
|
1464
|
+
return (s = n()) == null ? void 0 : s.unobserve(i);
|
|
1451
1465
|
}
|
|
1452
1466
|
};
|
|
1453
1467
|
})(), this.range = null, this.setOptions = (t) => {
|
|
1454
|
-
Object.entries(t).forEach(([n,
|
|
1455
|
-
typeof
|
|
1468
|
+
Object.entries(t).forEach(([n, i]) => {
|
|
1469
|
+
typeof i > "u" && delete t[n];
|
|
1456
1470
|
}), this.options = {
|
|
1457
1471
|
debug: !1,
|
|
1458
1472
|
initialOffset: 0,
|
|
@@ -1462,11 +1476,11 @@ class rn {
|
|
|
1462
1476
|
scrollPaddingStart: 0,
|
|
1463
1477
|
scrollPaddingEnd: 0,
|
|
1464
1478
|
horizontal: !1,
|
|
1465
|
-
getItemKey:
|
|
1466
|
-
rangeExtractor:
|
|
1479
|
+
getItemKey: en,
|
|
1480
|
+
rangeExtractor: tn,
|
|
1467
1481
|
onChange: () => {
|
|
1468
1482
|
},
|
|
1469
|
-
measureElement:
|
|
1483
|
+
measureElement: sn,
|
|
1470
1484
|
initialRect: { width: 0, height: 0 },
|
|
1471
1485
|
scrollMargin: 0,
|
|
1472
1486
|
gap: 0,
|
|
@@ -1477,11 +1491,12 @@ class rn {
|
|
|
1477
1491
|
enabled: !0,
|
|
1478
1492
|
isRtl: !1,
|
|
1479
1493
|
useScrollendEvent: !0,
|
|
1494
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
1480
1495
|
...t
|
|
1481
1496
|
};
|
|
1482
1497
|
}, this.notify = (t) => {
|
|
1483
|
-
var n,
|
|
1484
|
-
(
|
|
1498
|
+
var n, i;
|
|
1499
|
+
(i = (n = this.options).onChange) == null || i.call(n, this, t);
|
|
1485
1500
|
}, this.maybeNotify = X(
|
|
1486
1501
|
() => (this.calculateRange(), [
|
|
1487
1502
|
this.isScrolling,
|
|
@@ -1512,34 +1527,34 @@ class rn {
|
|
|
1512
1527
|
this.maybeNotify();
|
|
1513
1528
|
return;
|
|
1514
1529
|
}
|
|
1515
|
-
this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((
|
|
1516
|
-
this.observer.observe(
|
|
1530
|
+
this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((i) => {
|
|
1531
|
+
this.observer.observe(i);
|
|
1517
1532
|
}), this._scrollToOffset(this.getScrollOffset(), {
|
|
1518
1533
|
adjustments: void 0,
|
|
1519
1534
|
behavior: void 0
|
|
1520
1535
|
}), this.unsubs.push(
|
|
1521
|
-
this.options.observeElementRect(this, (
|
|
1522
|
-
this.scrollRect =
|
|
1536
|
+
this.options.observeElementRect(this, (i) => {
|
|
1537
|
+
this.scrollRect = i, this.maybeNotify();
|
|
1523
1538
|
})
|
|
1524
1539
|
), this.unsubs.push(
|
|
1525
|
-
this.options.observeElementOffset(this, (
|
|
1526
|
-
this.scrollAdjustments = 0, this.scrollDirection =
|
|
1540
|
+
this.options.observeElementOffset(this, (i, s) => {
|
|
1541
|
+
this.scrollAdjustments = 0, this.scrollDirection = s ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = s, this.maybeNotify();
|
|
1527
1542
|
})
|
|
1528
1543
|
);
|
|
1529
1544
|
}
|
|
1530
1545
|
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
|
|
1531
|
-
const
|
|
1546
|
+
const i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1532
1547
|
for (let r = n - 1; r >= 0; r--) {
|
|
1533
1548
|
const l = t[r];
|
|
1534
|
-
if (
|
|
1549
|
+
if (i.has(l.lane))
|
|
1535
1550
|
continue;
|
|
1536
|
-
const
|
|
1551
|
+
const a = s.get(
|
|
1537
1552
|
l.lane
|
|
1538
1553
|
);
|
|
1539
|
-
if (
|
|
1554
|
+
if (a == null || l.end > a.end ? s.set(l.lane, l) : l.end < a.end && i.set(l.lane, !0), i.size === this.options.lanes)
|
|
1540
1555
|
break;
|
|
1541
1556
|
}
|
|
1542
|
-
return
|
|
1557
|
+
return s.size === this.options.lanes ? Array.from(s.values()).sort((r, l) => r.end === l.end ? r.index - l.index : r.end - l.end)[0] : void 0;
|
|
1543
1558
|
}, this.getMeasurementOptions = X(
|
|
1544
1559
|
() => [
|
|
1545
1560
|
this.options.count,
|
|
@@ -1548,11 +1563,11 @@ class rn {
|
|
|
1548
1563
|
this.options.getItemKey,
|
|
1549
1564
|
this.options.enabled
|
|
1550
1565
|
],
|
|
1551
|
-
(t, n,
|
|
1566
|
+
(t, n, i, s, r) => (this.pendingMeasuredCacheIndexes = [], {
|
|
1552
1567
|
count: t,
|
|
1553
1568
|
paddingStart: n,
|
|
1554
|
-
scrollMargin:
|
|
1555
|
-
getItemKey:
|
|
1569
|
+
scrollMargin: i,
|
|
1570
|
+
getItemKey: s,
|
|
1556
1571
|
enabled: r
|
|
1557
1572
|
}),
|
|
1558
1573
|
{
|
|
@@ -1560,97 +1575,108 @@ class rn {
|
|
|
1560
1575
|
}
|
|
1561
1576
|
), this.getMeasurements = X(
|
|
1562
1577
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
1563
|
-
({ count: t, paddingStart: n, scrollMargin:
|
|
1578
|
+
({ count: t, paddingStart: n, scrollMargin: i, getItemKey: s, enabled: r }, l) => {
|
|
1564
1579
|
if (!r)
|
|
1565
1580
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
1566
1581
|
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
|
|
1567
1582
|
this.itemSizeCache.set(u.key, u.size);
|
|
1568
1583
|
}));
|
|
1569
|
-
const
|
|
1584
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
1570
1585
|
this.pendingMeasuredCacheIndexes = [];
|
|
1571
|
-
const
|
|
1572
|
-
for (let u =
|
|
1573
|
-
const d =
|
|
1574
|
-
|
|
1586
|
+
const c = this.measurementsCache.slice(0, a);
|
|
1587
|
+
for (let u = a; u < t; u++) {
|
|
1588
|
+
const d = s(u), h = this.options.lanes === 1 ? c[u - 1] : this.getFurthestMeasurement(c, u), f = h ? h.end + this.options.gap : n + i, g = l.get(d), x = typeof g == "number" ? g : this.options.estimateSize(u), w = f + x, m = h ? h.lane : u % this.options.lanes;
|
|
1589
|
+
c[u] = {
|
|
1575
1590
|
index: u,
|
|
1576
1591
|
start: f,
|
|
1577
1592
|
size: x,
|
|
1578
1593
|
end: w,
|
|
1579
1594
|
key: d,
|
|
1580
|
-
lane:
|
|
1595
|
+
lane: m
|
|
1581
1596
|
};
|
|
1582
1597
|
}
|
|
1583
|
-
return this.measurementsCache =
|
|
1598
|
+
return this.measurementsCache = c, c;
|
|
1584
1599
|
},
|
|
1585
1600
|
{
|
|
1586
1601
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
1587
1602
|
debug: () => this.options.debug
|
|
1588
1603
|
}
|
|
1589
1604
|
), this.calculateRange = X(
|
|
1590
|
-
() => [
|
|
1591
|
-
|
|
1605
|
+
() => [
|
|
1606
|
+
this.getMeasurements(),
|
|
1607
|
+
this.getSize(),
|
|
1608
|
+
this.getScrollOffset(),
|
|
1609
|
+
this.options.lanes
|
|
1610
|
+
],
|
|
1611
|
+
(t, n, i, s) => this.range = t.length > 0 && n > 0 ? cn({
|
|
1592
1612
|
measurements: t,
|
|
1593
1613
|
outerSize: n,
|
|
1594
|
-
scrollOffset:
|
|
1614
|
+
scrollOffset: i,
|
|
1615
|
+
lanes: s
|
|
1595
1616
|
}) : null,
|
|
1596
1617
|
{
|
|
1597
1618
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
1598
1619
|
debug: () => this.options.debug
|
|
1599
1620
|
}
|
|
1600
|
-
), this.
|
|
1601
|
-
() =>
|
|
1602
|
-
|
|
1603
|
-
this.calculateRange()
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1621
|
+
), this.getVirtualIndexes = X(
|
|
1622
|
+
() => {
|
|
1623
|
+
let t = null, n = null;
|
|
1624
|
+
const i = this.calculateRange();
|
|
1625
|
+
return i && (t = i.startIndex, n = i.endIndex), [
|
|
1626
|
+
this.options.rangeExtractor,
|
|
1627
|
+
this.options.overscan,
|
|
1628
|
+
this.options.count,
|
|
1629
|
+
t,
|
|
1630
|
+
n
|
|
1631
|
+
];
|
|
1632
|
+
},
|
|
1633
|
+
(t, n, i, s, r) => s === null || r === null ? [] : t({
|
|
1634
|
+
startIndex: s,
|
|
1635
|
+
endIndex: r,
|
|
1636
|
+
overscan: n,
|
|
1611
1637
|
count: i
|
|
1612
1638
|
}),
|
|
1613
1639
|
{
|
|
1614
|
-
key: process.env.NODE_ENV !== "production" && "
|
|
1640
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
1615
1641
|
debug: () => this.options.debug
|
|
1616
1642
|
}
|
|
1617
1643
|
), this.indexFromElement = (t) => {
|
|
1618
|
-
const n = this.options.indexAttribute,
|
|
1619
|
-
return
|
|
1644
|
+
const n = this.options.indexAttribute, i = t.getAttribute(n);
|
|
1645
|
+
return i ? parseInt(i, 10) : (console.warn(
|
|
1620
1646
|
`Missing attribute name '${n}={index}' on measured element.`
|
|
1621
1647
|
), -1);
|
|
1622
1648
|
}, this._measureElement = (t, n) => {
|
|
1623
|
-
const
|
|
1624
|
-
if (!
|
|
1649
|
+
const i = this.indexFromElement(t), s = this.measurementsCache[i];
|
|
1650
|
+
if (!s)
|
|
1625
1651
|
return;
|
|
1626
|
-
const r =
|
|
1627
|
-
l !== t && (l && this.observer.unobserve(l), this.observer.observe(t), this.elementsCache.set(r, t)), t.isConnected && this.resizeItem(
|
|
1652
|
+
const r = s.key, l = this.elementsCache.get(r);
|
|
1653
|
+
l !== t && (l && this.observer.unobserve(l), this.observer.observe(t), this.elementsCache.set(r, t)), t.isConnected && this.resizeItem(i, this.options.measureElement(t, n, this));
|
|
1628
1654
|
}, this.resizeItem = (t, n) => {
|
|
1629
|
-
const
|
|
1630
|
-
if (!
|
|
1655
|
+
const i = this.measurementsCache[t];
|
|
1656
|
+
if (!i)
|
|
1631
1657
|
return;
|
|
1632
|
-
const
|
|
1633
|
-
r !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
|
|
1658
|
+
const s = this.itemSizeCache.get(i.key) ?? i.size, r = n - s;
|
|
1659
|
+
r !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(i, r, this) : i.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
|
|
1634
1660
|
adjustments: this.scrollAdjustments += r,
|
|
1635
1661
|
behavior: void 0
|
|
1636
|
-
})), this.pendingMeasuredCacheIndexes.push(
|
|
1662
|
+
})), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, n)), this.notify(!1));
|
|
1637
1663
|
}, this.measureElement = (t) => {
|
|
1638
1664
|
if (!t) {
|
|
1639
|
-
this.elementsCache.forEach((n,
|
|
1640
|
-
n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(
|
|
1665
|
+
this.elementsCache.forEach((n, i) => {
|
|
1666
|
+
n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(i));
|
|
1641
1667
|
});
|
|
1642
1668
|
return;
|
|
1643
1669
|
}
|
|
1644
1670
|
this._measureElement(t, void 0);
|
|
1645
1671
|
}, this.getVirtualItems = X(
|
|
1646
|
-
() => [this.
|
|
1672
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
1647
1673
|
(t, n) => {
|
|
1648
|
-
const
|
|
1649
|
-
for (let
|
|
1650
|
-
const l = t[
|
|
1651
|
-
|
|
1674
|
+
const i = [];
|
|
1675
|
+
for (let s = 0, r = t.length; s < r; s++) {
|
|
1676
|
+
const l = t[s], a = n[l];
|
|
1677
|
+
i.push(a);
|
|
1652
1678
|
}
|
|
1653
|
-
return
|
|
1679
|
+
return i;
|
|
1654
1680
|
},
|
|
1655
1681
|
{
|
|
1656
1682
|
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
@@ -1660,59 +1686,62 @@ class rn {
|
|
|
1660
1686
|
const n = this.getMeasurements();
|
|
1661
1687
|
if (n.length !== 0)
|
|
1662
1688
|
return be(
|
|
1663
|
-
n[
|
|
1689
|
+
n[nt(
|
|
1664
1690
|
0,
|
|
1665
1691
|
n.length - 1,
|
|
1666
|
-
(
|
|
1692
|
+
(i) => be(n[i]).start,
|
|
1667
1693
|
t
|
|
1668
1694
|
)]
|
|
1669
1695
|
);
|
|
1670
|
-
}, this.getOffsetForAlignment = (t, n) => {
|
|
1671
|
-
const s = this.getSize(),
|
|
1672
|
-
n === "auto" && (
|
|
1673
|
-
const
|
|
1696
|
+
}, this.getOffsetForAlignment = (t, n, i = 0) => {
|
|
1697
|
+
const s = this.getSize(), r = this.getScrollOffset();
|
|
1698
|
+
n === "auto" && (n = t >= r + s ? "end" : "start"), n === "center" ? t += (i - s) / 2 : n === "end" && (t -= s);
|
|
1699
|
+
const l = this.options.horizontal ? "scrollWidth" : "scrollHeight", c = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[l] : this.scrollElement[l] : 0) - s;
|
|
1674
1700
|
return Math.max(Math.min(c, t), 0);
|
|
1675
1701
|
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
1676
1702
|
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
1677
|
-
const
|
|
1678
|
-
if (!
|
|
1703
|
+
const i = this.measurementsCache[t];
|
|
1704
|
+
if (!i)
|
|
1679
1705
|
return;
|
|
1680
|
-
const
|
|
1706
|
+
const s = this.getSize(), r = this.getScrollOffset();
|
|
1681
1707
|
if (n === "auto")
|
|
1682
|
-
if (
|
|
1708
|
+
if (i.end >= r + s - this.options.scrollPaddingEnd)
|
|
1683
1709
|
n = "end";
|
|
1684
|
-
else if (
|
|
1710
|
+
else if (i.start <= r + this.options.scrollPaddingStart)
|
|
1685
1711
|
n = "start";
|
|
1686
1712
|
else
|
|
1687
1713
|
return [r, n];
|
|
1688
|
-
const l = n === "end" ?
|
|
1689
|
-
return [
|
|
1714
|
+
const l = n === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
|
|
1715
|
+
return [
|
|
1716
|
+
this.getOffsetForAlignment(l, n, i.size),
|
|
1717
|
+
n
|
|
1718
|
+
];
|
|
1690
1719
|
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
|
|
1691
1720
|
this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
|
|
1692
|
-
}, this.scrollToOffset = (t, { align: n = "start", behavior:
|
|
1693
|
-
this.cancelScrollToIndex(),
|
|
1721
|
+
}, this.scrollToOffset = (t, { align: n = "start", behavior: i } = {}) => {
|
|
1722
|
+
this.cancelScrollToIndex(), i === "smooth" && this.isDynamicMode() && console.warn(
|
|
1694
1723
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
1695
1724
|
), this._scrollToOffset(this.getOffsetForAlignment(t, n), {
|
|
1696
1725
|
adjustments: void 0,
|
|
1697
|
-
behavior:
|
|
1726
|
+
behavior: i
|
|
1698
1727
|
});
|
|
1699
|
-
}, this.scrollToIndex = (t, { align: n = "auto", behavior:
|
|
1700
|
-
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(),
|
|
1728
|
+
}, this.scrollToIndex = (t, { align: n = "auto", behavior: i } = {}) => {
|
|
1729
|
+
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), i === "smooth" && this.isDynamicMode() && console.warn(
|
|
1701
1730
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
1702
1731
|
);
|
|
1703
|
-
const
|
|
1704
|
-
if (!
|
|
1705
|
-
const [r, l] =
|
|
1706
|
-
this._scrollToOffset(r, { adjustments: void 0, behavior:
|
|
1732
|
+
const s = this.getOffsetForIndex(t, n);
|
|
1733
|
+
if (!s) return;
|
|
1734
|
+
const [r, l] = s;
|
|
1735
|
+
this._scrollToOffset(r, { adjustments: void 0, behavior: i }), i !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
|
1707
1736
|
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
|
1708
1737
|
this.options.getItemKey(t)
|
|
1709
1738
|
)) {
|
|
1710
|
-
const [
|
|
1739
|
+
const [c] = be(
|
|
1711
1740
|
this.getOffsetForIndex(t, l)
|
|
1712
1741
|
);
|
|
1713
|
-
|
|
1742
|
+
Jt(c, this.getScrollOffset()) || this.scrollToIndex(t, { align: l, behavior: i });
|
|
1714
1743
|
} else
|
|
1715
|
-
this.scrollToIndex(t, { align: l, behavior:
|
|
1744
|
+
this.scrollToIndex(t, { align: l, behavior: i });
|
|
1716
1745
|
}));
|
|
1717
1746
|
}, this.scrollBy = (t, { behavior: n } = {}) => {
|
|
1718
1747
|
this.cancelScrollToIndex(), n === "smooth" && this.isDynamicMode() && console.warn(
|
|
@@ -1724,68 +1753,74 @@ class rn {
|
|
|
1724
1753
|
}, this.getTotalSize = () => {
|
|
1725
1754
|
var t;
|
|
1726
1755
|
const n = this.getMeasurements();
|
|
1727
|
-
let
|
|
1728
|
-
return n.length === 0 ?
|
|
1729
|
-
...n.slice(-this.options.lanes).map((
|
|
1756
|
+
let i;
|
|
1757
|
+
return n.length === 0 ? i = this.options.paddingStart : i = this.options.lanes === 1 ? ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0 : Math.max(
|
|
1758
|
+
...n.slice(-this.options.lanes).map((s) => s.end)
|
|
1730
1759
|
), Math.max(
|
|
1731
|
-
|
|
1760
|
+
i - this.options.scrollMargin + this.options.paddingEnd,
|
|
1732
1761
|
0
|
|
1733
1762
|
);
|
|
1734
1763
|
}, this._scrollToOffset = (t, {
|
|
1735
1764
|
adjustments: n,
|
|
1736
|
-
behavior:
|
|
1765
|
+
behavior: i
|
|
1737
1766
|
}) => {
|
|
1738
|
-
this.options.scrollToFn(t, { behavior:
|
|
1767
|
+
this.options.scrollToFn(t, { behavior: i, adjustments: n }, this);
|
|
1739
1768
|
}, this.measure = () => {
|
|
1740
1769
|
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
1741
1770
|
}, this.setOptions(o);
|
|
1742
1771
|
}
|
|
1743
1772
|
}
|
|
1744
|
-
const
|
|
1773
|
+
const nt = (e, o, t, n) => {
|
|
1745
1774
|
for (; e <= o; ) {
|
|
1746
|
-
const
|
|
1747
|
-
if (
|
|
1748
|
-
e =
|
|
1749
|
-
else if (
|
|
1750
|
-
o =
|
|
1775
|
+
const i = (e + o) / 2 | 0, s = t(i);
|
|
1776
|
+
if (s < n)
|
|
1777
|
+
e = i + 1;
|
|
1778
|
+
else if (s > n)
|
|
1779
|
+
o = i - 1;
|
|
1751
1780
|
else
|
|
1752
|
-
return
|
|
1781
|
+
return i;
|
|
1753
1782
|
}
|
|
1754
1783
|
return e > 0 ? e - 1 : 0;
|
|
1755
1784
|
};
|
|
1756
|
-
function
|
|
1785
|
+
function cn({
|
|
1757
1786
|
measurements: e,
|
|
1758
1787
|
outerSize: o,
|
|
1759
|
-
scrollOffset: t
|
|
1788
|
+
scrollOffset: t,
|
|
1789
|
+
lanes: n
|
|
1760
1790
|
}) {
|
|
1761
|
-
const
|
|
1762
|
-
let r =
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1791
|
+
const i = e.length - 1;
|
|
1792
|
+
let r = nt(
|
|
1793
|
+
0,
|
|
1794
|
+
i,
|
|
1795
|
+
(a) => e[a].start,
|
|
1796
|
+
t
|
|
1797
|
+
), l = r;
|
|
1798
|
+
for (; l < i && e[l].end < t + o; )
|
|
1799
|
+
l++;
|
|
1800
|
+
return n > 1 && (r = Math.max(0, r - r % n), l = Math.min(i, l + (n - 1 - l % n))), { startIndex: r, endIndex: l };
|
|
1766
1801
|
}
|
|
1767
1802
|
const Pe = typeof document < "u" ? C.useLayoutEffect : C.useEffect;
|
|
1768
|
-
function
|
|
1803
|
+
function an(e) {
|
|
1769
1804
|
const o = C.useReducer(() => ({}), {})[1], t = {
|
|
1770
1805
|
...e,
|
|
1771
|
-
onChange: (
|
|
1806
|
+
onChange: (i, s) => {
|
|
1772
1807
|
var r;
|
|
1773
|
-
|
|
1808
|
+
s ? lt(o) : o(), (r = e.onChange) == null || r.call(e, i, s);
|
|
1774
1809
|
}
|
|
1775
1810
|
}, [n] = C.useState(
|
|
1776
|
-
() => new
|
|
1811
|
+
() => new ln(t)
|
|
1777
1812
|
);
|
|
1778
1813
|
return n.setOptions(t), Pe(() => n._didMount(), []), Pe(() => n._willUpdate()), n;
|
|
1779
1814
|
}
|
|
1780
|
-
function
|
|
1781
|
-
return
|
|
1782
|
-
observeElementRect:
|
|
1783
|
-
observeElementOffset:
|
|
1784
|
-
scrollToFn:
|
|
1815
|
+
function un(e) {
|
|
1816
|
+
return an({
|
|
1817
|
+
observeElementRect: nn,
|
|
1818
|
+
observeElementOffset: on,
|
|
1819
|
+
scrollToFn: rn,
|
|
1785
1820
|
...e
|
|
1786
1821
|
});
|
|
1787
1822
|
}
|
|
1788
|
-
function
|
|
1823
|
+
function fn(e) {
|
|
1789
1824
|
return /* @__PURE__ */ b(
|
|
1790
1825
|
"svg",
|
|
1791
1826
|
{
|
|
@@ -1800,7 +1835,7 @@ function un(e) {
|
|
|
1800
1835
|
}
|
|
1801
1836
|
);
|
|
1802
1837
|
}
|
|
1803
|
-
function
|
|
1838
|
+
function dn(e) {
|
|
1804
1839
|
return /* @__PURE__ */ b(
|
|
1805
1840
|
"svg",
|
|
1806
1841
|
{
|
|
@@ -1822,7 +1857,7 @@ function fn(e) {
|
|
|
1822
1857
|
}
|
|
1823
1858
|
);
|
|
1824
1859
|
}
|
|
1825
|
-
function
|
|
1860
|
+
function hn(e) {
|
|
1826
1861
|
return /* @__PURE__ */ b(
|
|
1827
1862
|
"svg",
|
|
1828
1863
|
{
|
|
@@ -1837,45 +1872,45 @@ function dn(e) {
|
|
|
1837
1872
|
}
|
|
1838
1873
|
);
|
|
1839
1874
|
}
|
|
1840
|
-
function
|
|
1875
|
+
function wn(e) {
|
|
1841
1876
|
var g;
|
|
1842
1877
|
const {
|
|
1843
1878
|
items: o,
|
|
1844
1879
|
selected: t,
|
|
1845
1880
|
className: n,
|
|
1846
|
-
onChange:
|
|
1847
|
-
disabled:
|
|
1881
|
+
onChange: i,
|
|
1882
|
+
disabled: s,
|
|
1848
1883
|
placeholder: r = "Select an Item",
|
|
1849
1884
|
multiple: l,
|
|
1850
|
-
mutable:
|
|
1851
|
-
onAdd:
|
|
1852
|
-
} = e, u = Ee(null), [d,
|
|
1885
|
+
mutable: a,
|
|
1886
|
+
onAdd: c
|
|
1887
|
+
} = e, u = Ee(null), [d, h] = de(!1), f = Ee(null);
|
|
1853
1888
|
return /* @__PURE__ */ b(
|
|
1854
|
-
|
|
1889
|
+
tt,
|
|
1855
1890
|
{
|
|
1856
1891
|
placement: "bottom",
|
|
1857
1892
|
trigger: "click",
|
|
1858
1893
|
show: d,
|
|
1859
|
-
setShow:
|
|
1894
|
+
setShow: h,
|
|
1860
1895
|
role: "combobox",
|
|
1861
|
-
disabled:
|
|
1896
|
+
disabled: s,
|
|
1862
1897
|
style: {
|
|
1863
1898
|
"--input-width": `${(g = f.current) == null ? void 0 : g.offsetWidth}px`
|
|
1864
1899
|
},
|
|
1865
1900
|
content: /* @__PURE__ */ b(
|
|
1866
|
-
|
|
1901
|
+
mn,
|
|
1867
1902
|
{
|
|
1868
|
-
...
|
|
1869
|
-
...l ? { multiple: l, items: o, onChange:
|
|
1903
|
+
...a ? { mutable: a, onAdd: c } : { mutable: a },
|
|
1904
|
+
...l ? { multiple: l, items: o, onChange: i, selected: t } : { items: o, onChange: i, selected: t }
|
|
1870
1905
|
}
|
|
1871
1906
|
),
|
|
1872
1907
|
children: /* @__PURE__ */ W(
|
|
1873
1908
|
"div",
|
|
1874
1909
|
{
|
|
1875
|
-
className:
|
|
1910
|
+
className: M(
|
|
1876
1911
|
"inline-flex h-10 w-56 grow items-center justify-between rounded border-2 border-input bg-background p-2 transition",
|
|
1877
|
-
|
|
1878
|
-
d && "border-primary shadow-
|
|
1912
|
+
s ? "cursor-not-allowed bg-muted text-muted" : "cursor-pointer",
|
|
1913
|
+
d && "border-primary shadow-xs shadow-ring",
|
|
1879
1914
|
n
|
|
1880
1915
|
),
|
|
1881
1916
|
ref: f,
|
|
@@ -1883,37 +1918,37 @@ function xn(e) {
|
|
|
1883
1918
|
/* @__PURE__ */ b(
|
|
1884
1919
|
"div",
|
|
1885
1920
|
{
|
|
1886
|
-
className:
|
|
1921
|
+
className: M(
|
|
1887
1922
|
"flex max-w-[calc(100%-30px)] flex-none grow items-center gap-1 text-sm",
|
|
1888
|
-
|
|
1923
|
+
s ? "text-muted-foreground" : "text-foreground"
|
|
1889
1924
|
),
|
|
1890
1925
|
ref: u,
|
|
1891
1926
|
children: l ? /* @__PURE__ */ b(
|
|
1892
|
-
|
|
1927
|
+
Gt,
|
|
1893
1928
|
{
|
|
1894
1929
|
items: t.map((x) => x.text),
|
|
1895
1930
|
data: t,
|
|
1896
1931
|
parentRef: u,
|
|
1897
1932
|
estimator: (x, w) => w + 40,
|
|
1898
1933
|
badgeVariant: "secondary",
|
|
1899
|
-
badgeStyles: "
|
|
1900
|
-
children: (x, w,
|
|
1901
|
-
|
|
1934
|
+
badgeStyles: "bg-input! h-6 min-w-min gap-2 bg-input!",
|
|
1935
|
+
children: (x, w, m) => /* @__PURE__ */ W(
|
|
1936
|
+
Be,
|
|
1902
1937
|
{
|
|
1903
|
-
className: "flex h-6 min-w-min gap-2
|
|
1938
|
+
className: "flex h-6 min-w-min gap-2 bg-input! pr-1",
|
|
1904
1939
|
variant: "secondary",
|
|
1905
1940
|
children: [
|
|
1906
1941
|
x,
|
|
1907
1942
|
/* @__PURE__ */ b(
|
|
1908
|
-
|
|
1943
|
+
at,
|
|
1909
1944
|
{
|
|
1910
1945
|
onClick: () => {
|
|
1911
|
-
|
|
1946
|
+
i(t.filter((p) => p.key !== (m == null ? void 0 : m.key)));
|
|
1912
1947
|
},
|
|
1913
1948
|
variant: "icon",
|
|
1914
1949
|
size: "icon",
|
|
1915
1950
|
className: "group bg-muted p-0.5 hover:bg-muted-foreground",
|
|
1916
|
-
children: /* @__PURE__ */ b(
|
|
1951
|
+
children: /* @__PURE__ */ b(hn, { className: "size-3 transition duration-300 group-hover:rotate-90 group-hover:text-muted" })
|
|
1917
1952
|
}
|
|
1918
1953
|
)
|
|
1919
1954
|
]
|
|
@@ -1925,12 +1960,12 @@ function xn(e) {
|
|
|
1925
1960
|
}
|
|
1926
1961
|
),
|
|
1927
1962
|
/* @__PURE__ */ b(
|
|
1928
|
-
|
|
1963
|
+
fn,
|
|
1929
1964
|
{
|
|
1930
|
-
className:
|
|
1965
|
+
className: M(
|
|
1931
1966
|
"size-4 rounded-full bg-input p-0.5 transition duration-300 ease-in-out",
|
|
1932
1967
|
d ? "rotate-180" : "rotate-0",
|
|
1933
|
-
|
|
1968
|
+
s ? "text-muted-foreground" : "text-foreground"
|
|
1934
1969
|
)
|
|
1935
1970
|
}
|
|
1936
1971
|
)
|
|
@@ -1940,33 +1975,33 @@ function xn(e) {
|
|
|
1940
1975
|
}
|
|
1941
1976
|
);
|
|
1942
1977
|
}
|
|
1943
|
-
function
|
|
1944
|
-
const { items: o, multiple: t, selected: n, onChange:
|
|
1978
|
+
function mn(e) {
|
|
1979
|
+
const { items: o, multiple: t, selected: n, onChange: i, mutable: s, onAdd: r } = e, [l, a] = de(""), c = Ee(null), u = ve(
|
|
1945
1980
|
() => o.reduce((f, g) => ((!l.length || g.text.toLowerCase().includes(l.toLowerCase())) && f.push(g), f), []),
|
|
1946
1981
|
[o, l]
|
|
1947
|
-
), d =
|
|
1982
|
+
), d = un({
|
|
1948
1983
|
count: u.length,
|
|
1949
|
-
getScrollElement: () =>
|
|
1984
|
+
getScrollElement: () => c.current,
|
|
1950
1985
|
estimateSize: () => 35
|
|
1951
|
-
}),
|
|
1986
|
+
}), h = n instanceof Array ? n.map((f) => f.key) : [n.key];
|
|
1952
1987
|
return /* @__PURE__ */ W("div", { className: "flex min-w-[var(--input-width)] flex-col divide-y-2 divide-border overflow-hidden rounded border border-input bg-background", children: [
|
|
1953
|
-
/* @__PURE__ */ W("div", { className:
|
|
1954
|
-
/* @__PURE__ */ b(
|
|
1988
|
+
/* @__PURE__ */ W("div", { className: M("inline-flex grow items-center rounded px-3 py-2"), children: [
|
|
1989
|
+
/* @__PURE__ */ b(dn, { className: "left-3 top-3 mr-2 size-4 text-muted-foreground" }),
|
|
1955
1990
|
/* @__PURE__ */ b(
|
|
1956
1991
|
"input",
|
|
1957
1992
|
{
|
|
1958
|
-
className: "inline-flex grow bg-transparent text-sm text-foreground outline-
|
|
1993
|
+
className: "inline-flex grow bg-transparent text-sm text-foreground outline-hidden",
|
|
1959
1994
|
placeholder: "Search",
|
|
1960
1995
|
value: l,
|
|
1961
|
-
onChange: (f) =>
|
|
1996
|
+
onChange: (f) => a(f.target.value)
|
|
1962
1997
|
}
|
|
1963
1998
|
)
|
|
1964
1999
|
] }),
|
|
1965
2000
|
/* @__PURE__ */ W(
|
|
1966
2001
|
"ul",
|
|
1967
2002
|
{
|
|
1968
|
-
className:
|
|
1969
|
-
ref:
|
|
2003
|
+
className: M("max-h-60 grow overflow-auto shadow-sm", "focus:outline-hidden focus:ring-0"),
|
|
2004
|
+
ref: c,
|
|
1970
2005
|
children: [
|
|
1971
2006
|
/* @__PURE__ */ b(
|
|
1972
2007
|
"div",
|
|
@@ -1983,18 +2018,18 @@ function hn(e) {
|
|
|
1983
2018
|
height: `${f.size}px`,
|
|
1984
2019
|
transform: `translateY(${f.start}px)`
|
|
1985
2020
|
},
|
|
1986
|
-
className:
|
|
2021
|
+
className: M(
|
|
1987
2022
|
"absolute left-0 top-0 w-full cursor-pointer px-3 py-2 text-sm text-foreground",
|
|
1988
|
-
|
|
2023
|
+
h.includes(u[f.index].key) ? "bg-primary/90 text-primary-foreground" : "transition hover:bg-primary/60"
|
|
1989
2024
|
),
|
|
1990
2025
|
onClick: () => {
|
|
1991
|
-
t ?
|
|
2026
|
+
t ? h.includes(u[f.index].key) ? i(
|
|
1992
2027
|
structuredClone(
|
|
1993
2028
|
n.filter(
|
|
1994
2029
|
(g) => g.key !== u[f.index].key
|
|
1995
2030
|
)
|
|
1996
2031
|
)
|
|
1997
|
-
) :
|
|
2032
|
+
) : i(structuredClone([...n, u[f.index]])) : i(u[f.index]);
|
|
1998
2033
|
},
|
|
1999
2034
|
children: u[f.index].text
|
|
2000
2035
|
},
|
|
@@ -2002,25 +2037,25 @@ function hn(e) {
|
|
|
2002
2037
|
))
|
|
2003
2038
|
}
|
|
2004
2039
|
),
|
|
2005
|
-
l.length > 0 && u.length === 0 && (
|
|
2040
|
+
l.length > 0 && u.length === 0 && (s ? /* @__PURE__ */ W(
|
|
2006
2041
|
"li",
|
|
2007
2042
|
{
|
|
2008
|
-
className:
|
|
2043
|
+
className: M("px-3 py-2 text-sm text-foreground"),
|
|
2009
2044
|
onClick: () => {
|
|
2010
|
-
r({ text: l, key: l }),
|
|
2045
|
+
r({ text: l, key: l }), a("");
|
|
2011
2046
|
},
|
|
2012
2047
|
children: [
|
|
2013
2048
|
"Add ",
|
|
2014
2049
|
l
|
|
2015
2050
|
]
|
|
2016
2051
|
}
|
|
2017
|
-
) : /* @__PURE__ */ b("li", { className:
|
|
2052
|
+
) : /* @__PURE__ */ b("li", { className: M("cursor-not-allowed px-3 py-2 text-sm text-foreground"), children: "No results found" }))
|
|
2018
2053
|
]
|
|
2019
2054
|
}
|
|
2020
2055
|
)
|
|
2021
2056
|
] });
|
|
2022
2057
|
}
|
|
2023
|
-
function
|
|
2058
|
+
function yn(e) {
|
|
2024
2059
|
return /* @__PURE__ */ b(
|
|
2025
2060
|
"svg",
|
|
2026
2061
|
{
|
|
@@ -2035,15 +2070,15 @@ function wn(e) {
|
|
|
2035
2070
|
}
|
|
2036
2071
|
);
|
|
2037
2072
|
}
|
|
2038
|
-
function
|
|
2073
|
+
function bn(e) {
|
|
2039
2074
|
const { className: o, ...t } = e;
|
|
2040
2075
|
return /* @__PURE__ */ b(
|
|
2041
2076
|
"input",
|
|
2042
2077
|
{
|
|
2043
|
-
className:
|
|
2078
|
+
className: M(
|
|
2044
2079
|
"h-10 w-full rounded border-2 border-input bg-background px-3 py-2 text-sm text-foreground transition",
|
|
2045
|
-
"focus-visible:border-primary focus-visible:shadow-
|
|
2046
|
-
"read-only:cursor-pointer read-only
|
|
2080
|
+
"focus-visible:border-primary focus-visible:shadow-xs focus-visible:shadow-ring focus-visible:outline-hidden",
|
|
2081
|
+
"read-only:cursor-pointer read-only:border-none! read-only:bg-transparent read-only:text-foreground read-only:shadow-none! read-only:outline-hidden!",
|
|
2047
2082
|
"disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted",
|
|
2048
2083
|
"file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
2049
2084
|
o
|
|
@@ -2052,12 +2087,12 @@ function yn(e) {
|
|
|
2052
2087
|
}
|
|
2053
2088
|
);
|
|
2054
2089
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const { className: o, checked: t, onChange: n, defaultChecked:
|
|
2090
|
+
function vn(e) {
|
|
2091
|
+
const { className: o, checked: t, onChange: n, defaultChecked: i, ...s } = e;
|
|
2057
2092
|
return /* @__PURE__ */ W(
|
|
2058
2093
|
"div",
|
|
2059
2094
|
{
|
|
2060
|
-
className:
|
|
2095
|
+
className: M(
|
|
2061
2096
|
"rounded-full",
|
|
2062
2097
|
"h-5 w-10",
|
|
2063
2098
|
"border border-muted bg-secondary",
|
|
@@ -2066,11 +2101,11 @@ function bn(e) {
|
|
|
2066
2101
|
),
|
|
2067
2102
|
onClick: () => n == null ? void 0 : n(!t),
|
|
2068
2103
|
children: [
|
|
2069
|
-
/* @__PURE__ */ b("input", { type: "hidden", readOnly: !0, ...
|
|
2104
|
+
/* @__PURE__ */ b("input", { type: "hidden", readOnly: !0, ...s, defaultChecked: i, checked: t }),
|
|
2070
2105
|
/* @__PURE__ */ b(
|
|
2071
2106
|
"div",
|
|
2072
2107
|
{
|
|
2073
|
-
className:
|
|
2108
|
+
className: M(
|
|
2074
2109
|
"[animation-timing-function:cubic-bezier(1, 0, 0, 1)] duration-250 h-4 w-4 rounded-full bg-primary transition-all",
|
|
2075
2110
|
t ? "translate-x-5" : "translate-x-1"
|
|
2076
2111
|
)
|
|
@@ -2081,16 +2116,16 @@ function bn(e) {
|
|
|
2081
2116
|
);
|
|
2082
2117
|
}
|
|
2083
2118
|
export {
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2119
|
+
Be as Badge,
|
|
2120
|
+
at as Button,
|
|
2121
|
+
yn as ChevronDown,
|
|
2122
|
+
fn as ChevronUp,
|
|
2123
|
+
Gt as Collapse,
|
|
2124
|
+
wn as Dropdown,
|
|
2125
|
+
bn as Input,
|
|
2126
|
+
tt as Popover,
|
|
2127
|
+
dn as Search,
|
|
2128
|
+
vn as Toggle,
|
|
2129
|
+
We as cva,
|
|
2130
|
+
M as cx
|
|
2096
2131
|
};
|