@rinzai/zen 0.1.5 → 0.1.7

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