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