@still-forest/canopy 0.38.0 → 0.38.1

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.
@@ -1,2034 +0,0 @@
1
- import { j as o } from "./jsx-runtime-B0GD0xBr.js";
2
- import { c as D, u as P, f as It, g as Pt, b as X, S as ue, B as St, h as Mt } from "./calendar-DMGJ52xx.js";
3
- import * as l from "react";
4
- import T, { Fragment as Ot } from "react";
5
- import { c as u } from "./index-CRiPKpXj.js";
6
- import { a as B, c as Z, b as O, P as _, e as w, d as z, f as $t, g as zt, u as Lt, h as De, i as Ht, R as Ft, j as Bt, F as Vt, D as Ie, k as Gt, l as Pe, m as Wt, A as qt, n as Kt, C as Ut, o as Yt, p as Xt, q as Zt, r as Jt, s as Qt } from "./popover-Bdo9y9v9.js";
7
- import { H as eo, T as pe } from "./Heading-DjVutKs1.js";
8
- import { F as Se } from "./Layout-CvVv48kM.js";
9
- /**
10
- * @license lucide-react v0.543.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- const to = [
16
- ["rect", { width: "14", height: "8", x: "5", y: "2", rx: "2", key: "wc9tft" }],
17
- ["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", key: "w68u3i" }],
18
- ["path", { d: "M6 18h2", key: "rwmk9e" }],
19
- ["path", { d: "M12 18h6", key: "aqd8w3" }]
20
- ], oo = D("computer", to);
21
- /**
22
- * @license lucide-react v0.543.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */
27
- const ro = [
28
- ["path", { d: "M12 17v4", key: "1riwvh" }],
29
- ["path", { d: "m14.305 7.53.923-.382", key: "1mlnsw" }],
30
- ["path", { d: "m15.228 4.852-.923-.383", key: "82mpwg" }],
31
- ["path", { d: "m16.852 3.228-.383-.924", key: "ln4sir" }],
32
- ["path", { d: "m16.852 8.772-.383.923", key: "1dejw0" }],
33
- ["path", { d: "m19.148 3.228.383-.924", key: "192kgf" }],
34
- ["path", { d: "m19.53 9.696-.382-.924", key: "fiavlr" }],
35
- ["path", { d: "m20.772 4.852.924-.383", key: "1j8mgp" }],
36
- ["path", { d: "m20.772 7.148.924.383", key: "zix9be" }],
37
- ["path", { d: "M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7", key: "1tnzv8" }],
38
- ["path", { d: "M8 21h8", key: "1ev6f3" }],
39
- ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }]
40
- ], ao = D("monitor-cog", ro);
41
- /**
42
- * @license lucide-react v0.543.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */
47
- const no = [
48
- [
49
- "path",
50
- {
51
- d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
52
- key: "kfwtm"
53
- }
54
- ]
55
- ], Me = D("moon", no);
56
- /**
57
- * @license lucide-react v0.543.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */
62
- const so = [
63
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
64
- ["path", { d: "M9 3v18", key: "fh3hqa" }],
65
- ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
66
- ], io = D("panel-left-open", so);
67
- /**
68
- * @license lucide-react v0.543.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */
73
- const lo = [
74
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
75
- ["path", { d: "M15 3v18", key: "14nvp0" }],
76
- ["path", { d: "m10 15-3-3 3-3", key: "1pgupc" }]
77
- ], co = D("panel-right-open", lo);
78
- /**
79
- * @license lucide-react v0.543.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */
84
- const uo = [
85
- ["path", { d: "M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6", key: "y09zxi" }],
86
- ["path", { d: "m21 3-9 9", key: "mpx6sq" }],
87
- ["path", { d: "M15 3h6v6", key: "1q9fwt" }]
88
- ], po = D("square-arrow-out-up-right", uo);
89
- /**
90
- * @license lucide-react v0.543.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */
95
- const fo = [
96
- ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
97
- ["path", { d: "M12 2v2", key: "tus03m" }],
98
- ["path", { d: "M12 20v2", key: "1lh1kg" }],
99
- ["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
100
- ["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
101
- ["path", { d: "M2 12h2", key: "1t8f8n" }],
102
- ["path", { d: "M20 12h2", key: "1q8mjw" }],
103
- ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
104
- ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
105
- ], Oe = D("sun", fo);
106
- /**
107
- * @license lucide-react v0.543.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */
112
- const xo = [
113
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
114
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
115
- ], mo = D("x", xo);
116
- var J = "Collapsible", [go, $e] = Z(J), [ho, fe] = go(J), ze = l.forwardRef(
117
- (e, t) => {
118
- const {
119
- __scopeCollapsible: r,
120
- open: a,
121
- defaultOpen: n,
122
- disabled: s,
123
- onOpenChange: i,
124
- ...c
125
- } = e, [d, f] = B({
126
- prop: a,
127
- defaultProp: n ?? !1,
128
- onChange: i,
129
- caller: J
130
- });
131
- return /* @__PURE__ */ o.jsx(
132
- ho,
133
- {
134
- scope: r,
135
- disabled: s,
136
- contentId: O(),
137
- open: d,
138
- onOpenToggle: l.useCallback(() => f((p) => !p), [f]),
139
- children: /* @__PURE__ */ o.jsx(
140
- _.div,
141
- {
142
- "data-state": he(d),
143
- "data-disabled": s ? "" : void 0,
144
- ...c,
145
- ref: t
146
- }
147
- )
148
- }
149
- );
150
- }
151
- );
152
- ze.displayName = J;
153
- var Le = "CollapsibleTrigger", xe = l.forwardRef(
154
- (e, t) => {
155
- const { __scopeCollapsible: r, ...a } = e, n = fe(Le, r);
156
- return /* @__PURE__ */ o.jsx(
157
- _.button,
158
- {
159
- type: "button",
160
- "aria-controls": n.contentId,
161
- "aria-expanded": n.open || !1,
162
- "data-state": he(n.open),
163
- "data-disabled": n.disabled ? "" : void 0,
164
- disabled: n.disabled,
165
- ...a,
166
- ref: t,
167
- onClick: w(e.onClick, n.onOpenToggle)
168
- }
169
- );
170
- }
171
- );
172
- xe.displayName = Le;
173
- var me = "CollapsibleContent", ge = l.forwardRef(
174
- (e, t) => {
175
- const { forceMount: r, ...a } = e, n = fe(me, e.__scopeCollapsible);
176
- return /* @__PURE__ */ o.jsx(z, { present: r || n.open, children: ({ present: s }) => /* @__PURE__ */ o.jsx(bo, { ...a, ref: t, present: s }) });
177
- }
178
- );
179
- ge.displayName = me;
180
- var bo = l.forwardRef((e, t) => {
181
- const { __scopeCollapsible: r, present: a, children: n, ...s } = e, i = fe(me, r), [c, d] = l.useState(a), f = l.useRef(null), p = P(t, f), m = l.useRef(0), h = m.current, g = l.useRef(0), v = g.current, C = i.open || c, y = l.useRef(C), b = l.useRef(void 0);
182
- return l.useEffect(() => {
183
- const x = requestAnimationFrame(() => y.current = !1);
184
- return () => cancelAnimationFrame(x);
185
- }, []), $t(() => {
186
- const x = f.current;
187
- if (x) {
188
- b.current = b.current || {
189
- transitionDuration: x.style.transitionDuration,
190
- animationName: x.style.animationName
191
- }, x.style.transitionDuration = "0s", x.style.animationName = "none";
192
- const N = x.getBoundingClientRect();
193
- m.current = N.height, g.current = N.width, y.current || (x.style.transitionDuration = b.current.transitionDuration, x.style.animationName = b.current.animationName), d(a);
194
- }
195
- }, [i.open, a]), /* @__PURE__ */ o.jsx(
196
- _.div,
197
- {
198
- "data-state": he(i.open),
199
- "data-disabled": i.disabled ? "" : void 0,
200
- id: i.contentId,
201
- hidden: !C,
202
- ...s,
203
- ref: p,
204
- style: {
205
- "--radix-collapsible-content-height": h ? `${h}px` : void 0,
206
- "--radix-collapsible-content-width": v ? `${v}px` : void 0,
207
- ...e.style
208
- },
209
- children: C && n
210
- }
211
- );
212
- });
213
- function he(e) {
214
- return e ? "open" : "closed";
215
- }
216
- var He = ze, vo = xe, Co = ge, R = "Accordion", yo = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [be, jo, wo] = zt(R), [Q, Ka] = Z(R, [
217
- wo,
218
- $e
219
- ]), ve = $e(), Fe = T.forwardRef(
220
- (e, t) => {
221
- const { type: r, ...a } = e, n = a, s = a;
222
- return /* @__PURE__ */ o.jsx(be.Provider, { scope: e.__scopeAccordion, children: r === "multiple" ? /* @__PURE__ */ o.jsx(Ro, { ...s, ref: t }) : /* @__PURE__ */ o.jsx(_o, { ...n, ref: t }) });
223
- }
224
- );
225
- Fe.displayName = R;
226
- var [Be, To] = Q(R), [Ve, No] = Q(
227
- R,
228
- { collapsible: !1 }
229
- ), _o = T.forwardRef(
230
- (e, t) => {
231
- const {
232
- value: r,
233
- defaultValue: a,
234
- onValueChange: n = () => {
235
- },
236
- collapsible: s = !1,
237
- ...i
238
- } = e, [c, d] = B({
239
- prop: r,
240
- defaultProp: a ?? "",
241
- onChange: n,
242
- caller: R
243
- });
244
- return /* @__PURE__ */ o.jsx(
245
- Be,
246
- {
247
- scope: e.__scopeAccordion,
248
- value: T.useMemo(() => c ? [c] : [], [c]),
249
- onItemOpen: d,
250
- onItemClose: T.useCallback(() => s && d(""), [s, d]),
251
- children: /* @__PURE__ */ o.jsx(Ve, { scope: e.__scopeAccordion, collapsible: s, children: /* @__PURE__ */ o.jsx(Ge, { ...i, ref: t }) })
252
- }
253
- );
254
- }
255
- ), Ro = T.forwardRef((e, t) => {
256
- const {
257
- value: r,
258
- defaultValue: a,
259
- onValueChange: n = () => {
260
- },
261
- ...s
262
- } = e, [i, c] = B({
263
- prop: r,
264
- defaultProp: a ?? [],
265
- onChange: n,
266
- caller: R
267
- }), d = T.useCallback(
268
- (p) => c((m = []) => [...m, p]),
269
- [c]
270
- ), f = T.useCallback(
271
- (p) => c((m = []) => m.filter((h) => h !== p)),
272
- [c]
273
- );
274
- return /* @__PURE__ */ o.jsx(
275
- Be,
276
- {
277
- scope: e.__scopeAccordion,
278
- value: i,
279
- onItemOpen: d,
280
- onItemClose: f,
281
- children: /* @__PURE__ */ o.jsx(Ve, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ o.jsx(Ge, { ...s, ref: t }) })
282
- }
283
- );
284
- }), [ko, ee] = Q(R), Ge = T.forwardRef(
285
- (e, t) => {
286
- const { __scopeAccordion: r, disabled: a, dir: n, orientation: s = "vertical", ...i } = e, c = T.useRef(null), d = P(c, t), f = jo(r), m = Lt(n) === "ltr", h = w(e.onKeyDown, (g) => {
287
- if (!yo.includes(g.key)) return;
288
- const v = g.target, C = f().filter((ne) => !ne.ref.current?.disabled), y = C.findIndex((ne) => ne.ref.current === v), b = C.length;
289
- if (y === -1) return;
290
- g.preventDefault();
291
- let x = y;
292
- const N = 0, A = b - 1, E = () => {
293
- x = y + 1, x > A && (x = N);
294
- }, M = () => {
295
- x = y - 1, x < N && (x = A);
296
- };
297
- switch (g.key) {
298
- case "Home":
299
- x = N;
300
- break;
301
- case "End":
302
- x = A;
303
- break;
304
- case "ArrowRight":
305
- s === "horizontal" && (m ? E() : M());
306
- break;
307
- case "ArrowDown":
308
- s === "vertical" && E();
309
- break;
310
- case "ArrowLeft":
311
- s === "horizontal" && (m ? M() : E());
312
- break;
313
- case "ArrowUp":
314
- s === "vertical" && M();
315
- break;
316
- }
317
- const W = x % b;
318
- C[W].ref.current?.focus();
319
- });
320
- return /* @__PURE__ */ o.jsx(
321
- ko,
322
- {
323
- scope: r,
324
- disabled: a,
325
- direction: n,
326
- orientation: s,
327
- children: /* @__PURE__ */ o.jsx(be.Slot, { scope: r, children: /* @__PURE__ */ o.jsx(
328
- _.div,
329
- {
330
- ...i,
331
- "data-orientation": s,
332
- ref: d,
333
- onKeyDown: a ? void 0 : h
334
- }
335
- ) })
336
- }
337
- );
338
- }
339
- ), U = "AccordionItem", [Ao, Ce] = Q(U), We = T.forwardRef(
340
- (e, t) => {
341
- const { __scopeAccordion: r, value: a, ...n } = e, s = ee(U, r), i = To(U, r), c = ve(r), d = O(), f = a && i.value.includes(a) || !1, p = s.disabled || e.disabled;
342
- return /* @__PURE__ */ o.jsx(
343
- Ao,
344
- {
345
- scope: r,
346
- open: f,
347
- disabled: p,
348
- triggerId: d,
349
- children: /* @__PURE__ */ o.jsx(
350
- He,
351
- {
352
- "data-orientation": s.orientation,
353
- "data-state": Ze(f),
354
- ...c,
355
- ...n,
356
- ref: t,
357
- disabled: p,
358
- open: f,
359
- onOpenChange: (m) => {
360
- m ? i.onItemOpen(a) : i.onItemClose(a);
361
- }
362
- }
363
- )
364
- }
365
- );
366
- }
367
- );
368
- We.displayName = U;
369
- var qe = "AccordionHeader", Ke = T.forwardRef(
370
- (e, t) => {
371
- const { __scopeAccordion: r, ...a } = e, n = ee(R, r), s = Ce(qe, r);
372
- return /* @__PURE__ */ o.jsx(
373
- _.h3,
374
- {
375
- "data-orientation": n.orientation,
376
- "data-state": Ze(s.open),
377
- "data-disabled": s.disabled ? "" : void 0,
378
- ...a,
379
- ref: t
380
- }
381
- );
382
- }
383
- );
384
- Ke.displayName = qe;
385
- var ie = "AccordionTrigger", Ue = T.forwardRef(
386
- (e, t) => {
387
- const { __scopeAccordion: r, ...a } = e, n = ee(R, r), s = Ce(ie, r), i = No(ie, r), c = ve(r);
388
- return /* @__PURE__ */ o.jsx(be.ItemSlot, { scope: r, children: /* @__PURE__ */ o.jsx(
389
- vo,
390
- {
391
- "aria-disabled": s.open && !i.collapsible || void 0,
392
- "data-orientation": n.orientation,
393
- id: s.triggerId,
394
- ...c,
395
- ...a,
396
- ref: t
397
- }
398
- ) });
399
- }
400
- );
401
- Ue.displayName = ie;
402
- var Ye = "AccordionContent", Xe = T.forwardRef(
403
- (e, t) => {
404
- const { __scopeAccordion: r, ...a } = e, n = ee(R, r), s = Ce(Ye, r), i = ve(r);
405
- return /* @__PURE__ */ o.jsx(
406
- Co,
407
- {
408
- role: "region",
409
- "aria-labelledby": s.triggerId,
410
- "data-orientation": n.orientation,
411
- ...i,
412
- ...a,
413
- ref: t,
414
- style: {
415
- "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
416
- "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
417
- ...e.style
418
- }
419
- }
420
- );
421
- }
422
- );
423
- Xe.displayName = Ye;
424
- function Ze(e) {
425
- return e ? "open" : "closed";
426
- }
427
- var Eo = Fe, Do = We, Io = Ke, Po = Ue, So = Xe, te = "Dialog", [Je, Ua] = Z(te), [Mo, k] = Je(te), Qe = (e) => {
428
- const {
429
- __scopeDialog: t,
430
- children: r,
431
- open: a,
432
- defaultOpen: n,
433
- onOpenChange: s,
434
- modal: i = !0
435
- } = e, c = l.useRef(null), d = l.useRef(null), [f, p] = B({
436
- prop: a,
437
- defaultProp: n ?? !1,
438
- onChange: s,
439
- caller: te
440
- });
441
- return /* @__PURE__ */ o.jsx(
442
- Mo,
443
- {
444
- scope: t,
445
- triggerRef: c,
446
- contentRef: d,
447
- contentId: O(),
448
- titleId: O(),
449
- descriptionId: O(),
450
- open: f,
451
- onOpenChange: p,
452
- onOpenToggle: l.useCallback(() => p((m) => !m), [p]),
453
- modal: i,
454
- children: r
455
- }
456
- );
457
- };
458
- Qe.displayName = te;
459
- var et = "DialogTrigger", tt = l.forwardRef(
460
- (e, t) => {
461
- const { __scopeDialog: r, ...a } = e, n = k(et, r), s = P(t, n.triggerRef);
462
- return /* @__PURE__ */ o.jsx(
463
- _.button,
464
- {
465
- type: "button",
466
- "aria-haspopup": "dialog",
467
- "aria-expanded": n.open,
468
- "aria-controls": n.contentId,
469
- "data-state": we(n.open),
470
- ...a,
471
- ref: s,
472
- onClick: w(e.onClick, n.onOpenToggle)
473
- }
474
- );
475
- }
476
- );
477
- tt.displayName = et;
478
- var ye = "DialogPortal", [Oo, ot] = Je(ye, {
479
- forceMount: void 0
480
- }), rt = (e) => {
481
- const { __scopeDialog: t, forceMount: r, children: a, container: n } = e, s = k(ye, t);
482
- return /* @__PURE__ */ o.jsx(Oo, { scope: t, forceMount: r, children: l.Children.map(a, (i) => /* @__PURE__ */ o.jsx(z, { present: r || s.open, children: /* @__PURE__ */ o.jsx(De, { asChild: !0, container: n, children: i }) })) });
483
- };
484
- rt.displayName = ye;
485
- var Y = "DialogOverlay", at = l.forwardRef(
486
- (e, t) => {
487
- const r = ot(Y, e.__scopeDialog), { forceMount: a = r.forceMount, ...n } = e, s = k(Y, e.__scopeDialog);
488
- return s.modal ? /* @__PURE__ */ o.jsx(z, { present: a || s.open, children: /* @__PURE__ */ o.jsx(zo, { ...n, ref: t }) }) : null;
489
- }
490
- );
491
- at.displayName = Y;
492
- var $o = It("DialogOverlay.RemoveScroll"), zo = l.forwardRef(
493
- (e, t) => {
494
- const { __scopeDialog: r, ...a } = e, n = k(Y, r);
495
- return (
496
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
497
- // ie. when `Overlay` and `Content` are siblings
498
- /* @__PURE__ */ o.jsx(Ft, { as: $o, allowPinchZoom: !0, shards: [n.contentRef], children: /* @__PURE__ */ o.jsx(
499
- _.div,
500
- {
501
- "data-state": we(n.open),
502
- ...a,
503
- ref: t,
504
- style: { pointerEvents: "auto", ...a.style }
505
- }
506
- ) })
507
- );
508
- }
509
- ), I = "DialogContent", nt = l.forwardRef(
510
- (e, t) => {
511
- const r = ot(I, e.__scopeDialog), { forceMount: a = r.forceMount, ...n } = e, s = k(I, e.__scopeDialog);
512
- return /* @__PURE__ */ o.jsx(z, { present: a || s.open, children: s.modal ? /* @__PURE__ */ o.jsx(Lo, { ...n, ref: t }) : /* @__PURE__ */ o.jsx(Ho, { ...n, ref: t }) });
513
- }
514
- );
515
- nt.displayName = I;
516
- var Lo = l.forwardRef(
517
- (e, t) => {
518
- const r = k(I, e.__scopeDialog), a = l.useRef(null), n = P(t, r.contentRef, a);
519
- return l.useEffect(() => {
520
- const s = a.current;
521
- if (s) return Ht(s);
522
- }, []), /* @__PURE__ */ o.jsx(
523
- st,
524
- {
525
- ...e,
526
- ref: n,
527
- trapFocus: r.open,
528
- disableOutsidePointerEvents: !0,
529
- onCloseAutoFocus: w(e.onCloseAutoFocus, (s) => {
530
- s.preventDefault(), r.triggerRef.current?.focus();
531
- }),
532
- onPointerDownOutside: w(e.onPointerDownOutside, (s) => {
533
- const i = s.detail.originalEvent, c = i.button === 0 && i.ctrlKey === !0;
534
- (i.button === 2 || c) && s.preventDefault();
535
- }),
536
- onFocusOutside: w(
537
- e.onFocusOutside,
538
- (s) => s.preventDefault()
539
- )
540
- }
541
- );
542
- }
543
- ), Ho = l.forwardRef(
544
- (e, t) => {
545
- const r = k(I, e.__scopeDialog), a = l.useRef(!1), n = l.useRef(!1);
546
- return /* @__PURE__ */ o.jsx(
547
- st,
548
- {
549
- ...e,
550
- ref: t,
551
- trapFocus: !1,
552
- disableOutsidePointerEvents: !1,
553
- onCloseAutoFocus: (s) => {
554
- e.onCloseAutoFocus?.(s), s.defaultPrevented || (a.current || r.triggerRef.current?.focus(), s.preventDefault()), a.current = !1, n.current = !1;
555
- },
556
- onInteractOutside: (s) => {
557
- e.onInteractOutside?.(s), s.defaultPrevented || (a.current = !0, s.detail.originalEvent.type === "pointerdown" && (n.current = !0));
558
- const i = s.target;
559
- r.triggerRef.current?.contains(i) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && n.current && s.preventDefault();
560
- }
561
- }
562
- );
563
- }
564
- ), st = l.forwardRef(
565
- (e, t) => {
566
- const { __scopeDialog: r, trapFocus: a, onOpenAutoFocus: n, onCloseAutoFocus: s, ...i } = e, c = k(I, r), d = l.useRef(null), f = P(t, d);
567
- return Bt(), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
568
- /* @__PURE__ */ o.jsx(
569
- Vt,
570
- {
571
- asChild: !0,
572
- loop: !0,
573
- trapped: a,
574
- onMountAutoFocus: n,
575
- onUnmountAutoFocus: s,
576
- children: /* @__PURE__ */ o.jsx(
577
- Ie,
578
- {
579
- role: "dialog",
580
- id: c.contentId,
581
- "aria-describedby": c.descriptionId,
582
- "aria-labelledby": c.titleId,
583
- "data-state": we(c.open),
584
- ...i,
585
- ref: f,
586
- onDismiss: () => c.onOpenChange(!1)
587
- }
588
- )
589
- }
590
- ),
591
- /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
592
- /* @__PURE__ */ o.jsx(Fo, { titleId: c.titleId }),
593
- /* @__PURE__ */ o.jsx(Vo, { contentRef: d, descriptionId: c.descriptionId })
594
- ] })
595
- ] });
596
- }
597
- ), je = "DialogTitle", it = l.forwardRef(
598
- (e, t) => {
599
- const { __scopeDialog: r, ...a } = e, n = k(je, r);
600
- return /* @__PURE__ */ o.jsx(_.h2, { id: n.titleId, ...a, ref: t });
601
- }
602
- );
603
- it.displayName = je;
604
- var lt = "DialogDescription", ct = l.forwardRef(
605
- (e, t) => {
606
- const { __scopeDialog: r, ...a } = e, n = k(lt, r);
607
- return /* @__PURE__ */ o.jsx(_.p, { id: n.descriptionId, ...a, ref: t });
608
- }
609
- );
610
- ct.displayName = lt;
611
- var dt = "DialogClose", ut = l.forwardRef(
612
- (e, t) => {
613
- const { __scopeDialog: r, ...a } = e, n = k(dt, r);
614
- return /* @__PURE__ */ o.jsx(
615
- _.button,
616
- {
617
- type: "button",
618
- ...a,
619
- ref: t,
620
- onClick: w(e.onClick, () => n.onOpenChange(!1))
621
- }
622
- );
623
- }
624
- );
625
- ut.displayName = dt;
626
- function we(e) {
627
- return e ? "open" : "closed";
628
- }
629
- var pt = "DialogTitleWarning", [Ya, ft] = Gt(pt, {
630
- contentName: I,
631
- titleName: je,
632
- docsSlug: "dialog"
633
- }), Fo = ({ titleId: e }) => {
634
- const t = ft(pt), r = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
635
-
636
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
637
-
638
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
639
- return l.useEffect(() => {
640
- e && (document.getElementById(e) || console.error(r));
641
- }, [r, e]), null;
642
- }, Bo = "DialogDescriptionWarning", Vo = ({ contentRef: e, descriptionId: t }) => {
643
- const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ft(Bo).contentName}}.`;
644
- return l.useEffect(() => {
645
- const n = e.current?.getAttribute("aria-describedby");
646
- t && n && (document.getElementById(t) || console.warn(a));
647
- }, [a, e, t]), null;
648
- }, Go = Qe, Xa = tt, Wo = rt, qo = at, Ko = nt, Uo = it, Yo = ct, Xo = ut, Zo = "Separator", ke = "horizontal", Jo = ["horizontal", "vertical"], xt = l.forwardRef((e, t) => {
649
- const { decorative: r, orientation: a = ke, ...n } = e, s = Qo(a) ? a : ke, c = r ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
650
- return /* @__PURE__ */ o.jsx(
651
- _.div,
652
- {
653
- "data-orientation": s,
654
- ...c,
655
- ...n,
656
- ref: t
657
- }
658
- );
659
- });
660
- xt.displayName = Zo;
661
- function Qo(e) {
662
- return Jo.includes(e);
663
- }
664
- var er = xt, [oe, Za] = Z("Tooltip", [
665
- Pe
666
- ]), re = Pe(), mt = "TooltipProvider", tr = 700, le = "tooltip.open", [or, Te] = oe(mt), gt = (e) => {
667
- const {
668
- __scopeTooltip: t,
669
- delayDuration: r = tr,
670
- skipDelayDuration: a = 300,
671
- disableHoverableContent: n = !1,
672
- children: s
673
- } = e, i = l.useRef(!0), c = l.useRef(!1), d = l.useRef(0);
674
- return l.useEffect(() => {
675
- const f = d.current;
676
- return () => window.clearTimeout(f);
677
- }, []), /* @__PURE__ */ o.jsx(
678
- or,
679
- {
680
- scope: t,
681
- isOpenDelayedRef: i,
682
- delayDuration: r,
683
- onOpen: l.useCallback(() => {
684
- window.clearTimeout(d.current), i.current = !1;
685
- }, []),
686
- onClose: l.useCallback(() => {
687
- window.clearTimeout(d.current), d.current = window.setTimeout(
688
- () => i.current = !0,
689
- a
690
- );
691
- }, [a]),
692
- isPointerInTransitRef: c,
693
- onPointerInTransitChange: l.useCallback((f) => {
694
- c.current = f;
695
- }, []),
696
- disableHoverableContent: n,
697
- children: s
698
- }
699
- );
700
- };
701
- gt.displayName = mt;
702
- var F = "Tooltip", [rr, V] = oe(F), ht = (e) => {
703
- const {
704
- __scopeTooltip: t,
705
- children: r,
706
- open: a,
707
- defaultOpen: n,
708
- onOpenChange: s,
709
- disableHoverableContent: i,
710
- delayDuration: c
711
- } = e, d = Te(F, e.__scopeTooltip), f = re(t), [p, m] = l.useState(null), h = O(), g = l.useRef(0), v = i ?? d.disableHoverableContent, C = c ?? d.delayDuration, y = l.useRef(!1), [b, x] = B({
712
- prop: a,
713
- defaultProp: n ?? !1,
714
- onChange: (W) => {
715
- W ? (d.onOpen(), document.dispatchEvent(new CustomEvent(le))) : d.onClose(), s?.(W);
716
- },
717
- caller: F
718
- }), N = l.useMemo(() => b ? y.current ? "delayed-open" : "instant-open" : "closed", [b]), A = l.useCallback(() => {
719
- window.clearTimeout(g.current), g.current = 0, y.current = !1, x(!0);
720
- }, [x]), E = l.useCallback(() => {
721
- window.clearTimeout(g.current), g.current = 0, x(!1);
722
- }, [x]), M = l.useCallback(() => {
723
- window.clearTimeout(g.current), g.current = window.setTimeout(() => {
724
- y.current = !0, x(!0), g.current = 0;
725
- }, C);
726
- }, [C, x]);
727
- return l.useEffect(() => () => {
728
- g.current && (window.clearTimeout(g.current), g.current = 0);
729
- }, []), /* @__PURE__ */ o.jsx(Wt, { ...f, children: /* @__PURE__ */ o.jsx(
730
- rr,
731
- {
732
- scope: t,
733
- contentId: h,
734
- open: b,
735
- stateAttribute: N,
736
- trigger: p,
737
- onTriggerChange: m,
738
- onTriggerEnter: l.useCallback(() => {
739
- d.isOpenDelayedRef.current ? M() : A();
740
- }, [d.isOpenDelayedRef, M, A]),
741
- onTriggerLeave: l.useCallback(() => {
742
- v ? E() : (window.clearTimeout(g.current), g.current = 0);
743
- }, [E, v]),
744
- onOpen: A,
745
- onClose: E,
746
- disableHoverableContent: v,
747
- children: r
748
- }
749
- ) });
750
- };
751
- ht.displayName = F;
752
- var ce = "TooltipTrigger", bt = l.forwardRef(
753
- (e, t) => {
754
- const { __scopeTooltip: r, ...a } = e, n = V(ce, r), s = Te(ce, r), i = re(r), c = l.useRef(null), d = P(t, c, n.onTriggerChange), f = l.useRef(!1), p = l.useRef(!1), m = l.useCallback(() => f.current = !1, []);
755
- return l.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ o.jsx(qt, { asChild: !0, ...i, children: /* @__PURE__ */ o.jsx(
756
- _.button,
757
- {
758
- "aria-describedby": n.open ? n.contentId : void 0,
759
- "data-state": n.stateAttribute,
760
- ...a,
761
- ref: d,
762
- onPointerMove: w(e.onPointerMove, (h) => {
763
- h.pointerType !== "touch" && !p.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), p.current = !0);
764
- }),
765
- onPointerLeave: w(e.onPointerLeave, () => {
766
- n.onTriggerLeave(), p.current = !1;
767
- }),
768
- onPointerDown: w(e.onPointerDown, () => {
769
- n.open && n.onClose(), f.current = !0, document.addEventListener("pointerup", m, { once: !0 });
770
- }),
771
- onFocus: w(e.onFocus, () => {
772
- f.current || n.onOpen();
773
- }),
774
- onBlur: w(e.onBlur, n.onClose),
775
- onClick: w(e.onClick, n.onClose)
776
- }
777
- ) });
778
- }
779
- );
780
- bt.displayName = ce;
781
- var Ne = "TooltipPortal", [ar, nr] = oe(Ne, {
782
- forceMount: void 0
783
- }), vt = (e) => {
784
- const { __scopeTooltip: t, forceMount: r, children: a, container: n } = e, s = V(Ne, t);
785
- return /* @__PURE__ */ o.jsx(ar, { scope: t, forceMount: r, children: /* @__PURE__ */ o.jsx(z, { present: r || s.open, children: /* @__PURE__ */ o.jsx(De, { asChild: !0, container: n, children: a }) }) });
786
- };
787
- vt.displayName = Ne;
788
- var $ = "TooltipContent", Ct = l.forwardRef(
789
- (e, t) => {
790
- const r = nr($, e.__scopeTooltip), { forceMount: a = r.forceMount, side: n = "top", ...s } = e, i = V($, e.__scopeTooltip);
791
- return /* @__PURE__ */ o.jsx(z, { present: a || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ o.jsx(yt, { side: n, ...s, ref: t }) : /* @__PURE__ */ o.jsx(sr, { side: n, ...s, ref: t }) });
792
- }
793
- ), sr = l.forwardRef((e, t) => {
794
- const r = V($, e.__scopeTooltip), a = Te($, e.__scopeTooltip), n = l.useRef(null), s = P(t, n), [i, c] = l.useState(null), { trigger: d, onClose: f } = r, p = n.current, { onPointerInTransitChange: m } = a, h = l.useCallback(() => {
795
- c(null), m(!1);
796
- }, [m]), g = l.useCallback(
797
- (v, C) => {
798
- const y = v.currentTarget, b = { x: v.clientX, y: v.clientY }, x = dr(b, y.getBoundingClientRect()), N = ur(b, x), A = pr(C.getBoundingClientRect()), E = xr([...N, ...A]);
799
- c(E), m(!0);
800
- },
801
- [m]
802
- );
803
- return l.useEffect(() => () => h(), [h]), l.useEffect(() => {
804
- if (d && p) {
805
- const v = (y) => g(y, p), C = (y) => g(y, d);
806
- return d.addEventListener("pointerleave", v), p.addEventListener("pointerleave", C), () => {
807
- d.removeEventListener("pointerleave", v), p.removeEventListener("pointerleave", C);
808
- };
809
- }
810
- }, [d, p, g, h]), l.useEffect(() => {
811
- if (i) {
812
- const v = (C) => {
813
- const y = C.target, b = { x: C.clientX, y: C.clientY }, x = d?.contains(y) || p?.contains(y), N = !fr(b, i);
814
- x ? h() : N && (h(), f());
815
- };
816
- return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
817
- }
818
- }, [d, p, i, f, h]), /* @__PURE__ */ o.jsx(yt, { ...e, ref: s });
819
- }), [ir, lr] = oe(F, { isInside: !1 }), cr = Pt("TooltipContent"), yt = l.forwardRef(
820
- (e, t) => {
821
- const {
822
- __scopeTooltip: r,
823
- children: a,
824
- "aria-label": n,
825
- onEscapeKeyDown: s,
826
- onPointerDownOutside: i,
827
- ...c
828
- } = e, d = V($, r), f = re(r), { onClose: p } = d;
829
- return l.useEffect(() => (document.addEventListener(le, p), () => document.removeEventListener(le, p)), [p]), l.useEffect(() => {
830
- if (d.trigger) {
831
- const m = (h) => {
832
- h.target?.contains(d.trigger) && p();
833
- };
834
- return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
835
- }
836
- }, [d.trigger, p]), /* @__PURE__ */ o.jsx(
837
- Ie,
838
- {
839
- asChild: !0,
840
- disableOutsidePointerEvents: !1,
841
- onEscapeKeyDown: s,
842
- onPointerDownOutside: i,
843
- onFocusOutside: (m) => m.preventDefault(),
844
- onDismiss: p,
845
- children: /* @__PURE__ */ o.jsxs(
846
- Ut,
847
- {
848
- "data-state": d.stateAttribute,
849
- ...f,
850
- ...c,
851
- ref: t,
852
- style: {
853
- ...c.style,
854
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
855
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
856
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
857
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
858
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
859
- },
860
- children: [
861
- /* @__PURE__ */ o.jsx(cr, { children: a }),
862
- /* @__PURE__ */ o.jsx(ir, { scope: r, isInside: !0, children: /* @__PURE__ */ o.jsx(Yt, { id: d.contentId, role: "tooltip", children: n || a }) })
863
- ]
864
- }
865
- )
866
- }
867
- );
868
- }
869
- );
870
- Ct.displayName = $;
871
- var jt = "TooltipArrow", wt = l.forwardRef(
872
- (e, t) => {
873
- const { __scopeTooltip: r, ...a } = e, n = re(r);
874
- return lr(
875
- jt,
876
- r
877
- ).isInside ? null : /* @__PURE__ */ o.jsx(Kt, { ...n, ...a, ref: t });
878
- }
879
- );
880
- wt.displayName = jt;
881
- function dr(e, t) {
882
- const r = Math.abs(t.top - e.y), a = Math.abs(t.bottom - e.y), n = Math.abs(t.right - e.x), s = Math.abs(t.left - e.x);
883
- switch (Math.min(r, a, n, s)) {
884
- case s:
885
- return "left";
886
- case n:
887
- return "right";
888
- case r:
889
- return "top";
890
- case a:
891
- return "bottom";
892
- default:
893
- throw new Error("unreachable");
894
- }
895
- }
896
- function ur(e, t, r = 5) {
897
- const a = [];
898
- switch (t) {
899
- case "top":
900
- a.push(
901
- { x: e.x - r, y: e.y + r },
902
- { x: e.x + r, y: e.y + r }
903
- );
904
- break;
905
- case "bottom":
906
- a.push(
907
- { x: e.x - r, y: e.y - r },
908
- { x: e.x + r, y: e.y - r }
909
- );
910
- break;
911
- case "left":
912
- a.push(
913
- { x: e.x + r, y: e.y - r },
914
- { x: e.x + r, y: e.y + r }
915
- );
916
- break;
917
- case "right":
918
- a.push(
919
- { x: e.x - r, y: e.y - r },
920
- { x: e.x - r, y: e.y + r }
921
- );
922
- break;
923
- }
924
- return a;
925
- }
926
- function pr(e) {
927
- const { top: t, right: r, bottom: a, left: n } = e;
928
- return [
929
- { x: n, y: t },
930
- { x: r, y: t },
931
- { x: r, y: a },
932
- { x: n, y: a }
933
- ];
934
- }
935
- function fr(e, t) {
936
- const { x: r, y: a } = e;
937
- let n = !1;
938
- for (let s = 0, i = t.length - 1; s < t.length; i = s++) {
939
- const c = t[s], d = t[i], f = c.x, p = c.y, m = d.x, h = d.y;
940
- p > a != h > a && r < (m - f) * (a - p) / (h - p) + f && (n = !n);
941
- }
942
- return n;
943
- }
944
- function xr(e) {
945
- const t = e.slice();
946
- return t.sort((r, a) => r.x < a.x ? -1 : r.x > a.x ? 1 : r.y < a.y ? -1 : r.y > a.y ? 1 : 0), mr(t);
947
- }
948
- function mr(e) {
949
- if (e.length <= 1) return e.slice();
950
- const t = [];
951
- for (let a = 0; a < e.length; a++) {
952
- const n = e[a];
953
- for (; t.length >= 2; ) {
954
- const s = t[t.length - 1], i = t[t.length - 2];
955
- if ((s.x - i.x) * (n.y - i.y) >= (s.y - i.y) * (n.x - i.x)) t.pop();
956
- else break;
957
- }
958
- t.push(n);
959
- }
960
- t.pop();
961
- const r = [];
962
- for (let a = e.length - 1; a >= 0; a--) {
963
- const n = e[a];
964
- for (; r.length >= 2; ) {
965
- const s = r[r.length - 1], i = r[r.length - 2];
966
- if ((s.x - i.x) * (n.y - i.y) >= (s.y - i.y) * (n.x - i.x)) r.pop();
967
- else break;
968
- }
969
- r.push(n);
970
- }
971
- return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
972
- }
973
- var gr = gt, hr = ht, br = bt, vr = vt, Cr = Ct, yr = wt;
974
- function jr({ ...e }) {
975
- return /* @__PURE__ */ o.jsx(Eo, { "data-slot": "accordion", ...e });
976
- }
977
- function wr({ className: e, ...t }) {
978
- return /* @__PURE__ */ o.jsx(
979
- Do,
980
- {
981
- className: u("border-b last:border-b-0", e),
982
- "data-slot": "accordion-item",
983
- ...t
984
- }
985
- );
986
- }
987
- function Tr({ className: e, children: t, ...r }) {
988
- return /* @__PURE__ */ o.jsx(Io, { className: "flex", children: /* @__PURE__ */ o.jsxs(
989
- Po,
990
- {
991
- className: u(
992
- "flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left font-medium text-sm outline-none transition-all hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
993
- e
994
- ),
995
- "data-slot": "accordion-trigger",
996
- ...r,
997
- children: [
998
- t,
999
- /* @__PURE__ */ o.jsx(Xt, { className: "pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" })
1000
- ]
1001
- }
1002
- ) });
1003
- }
1004
- function Nr({ className: e, children: t, ...r }) {
1005
- return /* @__PURE__ */ o.jsx(
1006
- So,
1007
- {
1008
- className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
1009
- "data-slot": "accordion-content",
1010
- ...r,
1011
- children: /* @__PURE__ */ o.jsx("div", { className: u("pt-0 pb-4", e), children: t })
1012
- }
1013
- );
1014
- }
1015
- const _e = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(jr, { ...t, children: e });
1016
- _e.Item = wr;
1017
- _e.Trigger = Tr;
1018
- _e.Content = Nr;
1019
- function _r({ className: e, ...t }) {
1020
- return /* @__PURE__ */ o.jsx(
1021
- "div",
1022
- {
1023
- className: u("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm", e),
1024
- "data-slot": "card",
1025
- ...t
1026
- }
1027
- );
1028
- }
1029
- function Rr({ className: e, ...t }) {
1030
- return /* @__PURE__ */ o.jsx(
1031
- "div",
1032
- {
1033
- className: u(
1034
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
1035
- e
1036
- ),
1037
- "data-slot": "card-header",
1038
- ...t
1039
- }
1040
- );
1041
- }
1042
- function kr({ className: e, ...t }) {
1043
- return /* @__PURE__ */ o.jsx("div", { className: u("font-semibold leading-none", e), "data-slot": "card-title", ...t });
1044
- }
1045
- function Ar({ className: e, ...t }) {
1046
- return /* @__PURE__ */ o.jsx("div", { className: u("text-muted-foreground text-sm", e), "data-slot": "card-description", ...t });
1047
- }
1048
- function Er({ className: e, ...t }) {
1049
- return /* @__PURE__ */ o.jsx(
1050
- "div",
1051
- {
1052
- className: u("col-start-2 row-span-2 row-start-1 self-start justify-self-end", e),
1053
- "data-slot": "card-action",
1054
- ...t
1055
- }
1056
- );
1057
- }
1058
- function Dr({ className: e, ...t }) {
1059
- return /* @__PURE__ */ o.jsx("div", { className: u("px-6", e), "data-slot": "card-content", ...t });
1060
- }
1061
- function Ir({ className: e, ...t }) {
1062
- return /* @__PURE__ */ o.jsx("div", { className: u("flex items-center px-6 [.border-t]:pt-6", e), "data-slot": "card-footer", ...t });
1063
- }
1064
- const L = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(_r, { ...t, children: e });
1065
- L.Action = Er;
1066
- L.Content = Dr;
1067
- L.Description = Ar;
1068
- L.Footer = Ir;
1069
- L.Header = Rr;
1070
- L.Title = kr;
1071
- function Pr({ ...e }) {
1072
- return /* @__PURE__ */ o.jsx(He, { "data-slot": "collapsible", ...e });
1073
- }
1074
- function Sr({ ...e }) {
1075
- return /* @__PURE__ */ o.jsx(xe, { "data-slot": "collapsible-trigger", ...e });
1076
- }
1077
- function Mr({ ...e }) {
1078
- return /* @__PURE__ */ o.jsx(ge, { "data-slot": "collapsible-content", ...e });
1079
- }
1080
- const Tt = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(Pr, { ...t, children: e });
1081
- Tt.Trigger = Sr;
1082
- Tt.Content = Mr;
1083
- function Or({ className: e, ...t }) {
1084
- return /* @__PURE__ */ o.jsx(
1085
- "div",
1086
- {
1087
- className: u(
1088
- "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
1089
- e
1090
- ),
1091
- "data-slot": "empty",
1092
- ...t
1093
- }
1094
- );
1095
- }
1096
- function $r({ className: e, ...t }) {
1097
- return /* @__PURE__ */ o.jsx(
1098
- "div",
1099
- {
1100
- className: u("flex max-w-sm flex-col items-center gap-2 text-center", e),
1101
- "data-slot": "empty-header",
1102
- ...t
1103
- }
1104
- );
1105
- }
1106
- const zr = X(
1107
- "flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1108
- {
1109
- variants: {
1110
- variant: {
1111
- default: "bg-transparent",
1112
- icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
1113
- }
1114
- },
1115
- defaultVariants: {
1116
- variant: "default"
1117
- }
1118
- }
1119
- );
1120
- function Lr({
1121
- className: e,
1122
- variant: t = "default",
1123
- ...r
1124
- }) {
1125
- return /* @__PURE__ */ o.jsx(
1126
- "div",
1127
- {
1128
- className: u(zr({ variant: t, className: e })),
1129
- "data-slot": "empty-icon",
1130
- "data-variant": t,
1131
- ...r
1132
- }
1133
- );
1134
- }
1135
- function Hr({ className: e, ...t }) {
1136
- return /* @__PURE__ */ o.jsx(
1137
- "div",
1138
- {
1139
- className: u("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", e),
1140
- "data-slot": "empty-content",
1141
- ...t
1142
- }
1143
- );
1144
- }
1145
- const G = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(Or, { ...t, children: e }), Fr = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(eo, { "data-slot": "empty-title", level: "3", weight: "medium", ...t, children: e }), Br = ({ children: e, className: t, ...r }) => /* @__PURE__ */ o.jsx(
1146
- pe,
1147
- {
1148
- className: u(
1149
- "text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
1150
- t
1151
- ),
1152
- "data-slot": "empty-description",
1153
- size: "sm",
1154
- weight: "medium",
1155
- ...r,
1156
- children: e
1157
- }
1158
- );
1159
- G.Header = $r;
1160
- G.Media = Lr;
1161
- G.Content = Hr;
1162
- G.Title = Fr;
1163
- G.Description = Br;
1164
- function Vr({
1165
- className: e,
1166
- orientation: t = "horizontal",
1167
- decorative: r = !0,
1168
- ...a
1169
- }) {
1170
- return /* @__PURE__ */ o.jsx(
1171
- er,
1172
- {
1173
- className: u(
1174
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
1175
- e
1176
- ),
1177
- "data-slot": "separator",
1178
- decorative: r,
1179
- orientation: t,
1180
- ...a
1181
- }
1182
- );
1183
- }
1184
- function Ja({ className: e, ...t }) {
1185
- return /* @__PURE__ */ o.jsx("div", { className: u("group/item-group flex flex-col", e), "data-slot": "item-group", role: "list", ...t });
1186
- }
1187
- const Gr = X(
1188
- "group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
1189
- {
1190
- variants: {
1191
- variant: {
1192
- default: "bg-transparent",
1193
- outline: "border-border",
1194
- muted: "bg-muted/50"
1195
- },
1196
- size: {
1197
- default: "p-4 gap-4 ",
1198
- sm: "py-3 px-4 gap-2.5"
1199
- }
1200
- },
1201
- defaultVariants: {
1202
- variant: "default",
1203
- size: "default"
1204
- }
1205
- }
1206
- );
1207
- function Wr({
1208
- className: e,
1209
- variant: t = "default",
1210
- size: r = "default",
1211
- asChild: a = !1,
1212
- ...n
1213
- }) {
1214
- const s = a ? ue : "div";
1215
- return /* @__PURE__ */ o.jsx(
1216
- s,
1217
- {
1218
- className: u(Gr({ variant: t, size: r, className: e })),
1219
- "data-size": r,
1220
- "data-slot": "item",
1221
- "data-variant": t,
1222
- ...n
1223
- }
1224
- );
1225
- }
1226
- const qr = X(
1227
- "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
1228
- {
1229
- variants: {
1230
- variant: {
1231
- default: "bg-transparent",
1232
- icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
1233
- image: "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover"
1234
- }
1235
- },
1236
- defaultVariants: {
1237
- variant: "default"
1238
- }
1239
- }
1240
- );
1241
- function Kr({
1242
- className: e,
1243
- variant: t = "default",
1244
- ...r
1245
- }) {
1246
- return /* @__PURE__ */ o.jsx(
1247
- "div",
1248
- {
1249
- className: u(qr({ variant: t, className: e })),
1250
- "data-slot": "item-media",
1251
- "data-variant": t,
1252
- ...r
1253
- }
1254
- );
1255
- }
1256
- function Ur({ className: e, ...t }) {
1257
- return /* @__PURE__ */ o.jsx(
1258
- "div",
1259
- {
1260
- className: u("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", e),
1261
- "data-slot": "item-content",
1262
- ...t
1263
- }
1264
- );
1265
- }
1266
- function Yr({ className: e, ...t }) {
1267
- return /* @__PURE__ */ o.jsx(
1268
- "div",
1269
- {
1270
- className: u("flex w-fit items-center gap-2 text-sm leading-snug font-medium", e),
1271
- "data-slot": "item-title",
1272
- ...t
1273
- }
1274
- );
1275
- }
1276
- function Xr({ className: e, ...t }) {
1277
- return /* @__PURE__ */ o.jsx(
1278
- "p",
1279
- {
1280
- className: u(
1281
- "text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
1282
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
1283
- e
1284
- ),
1285
- "data-slot": "item-description",
1286
- ...t
1287
- }
1288
- );
1289
- }
1290
- function Zr({ className: e, ...t }) {
1291
- return /* @__PURE__ */ o.jsx("div", { className: u("flex items-center gap-2", e), "data-slot": "item-actions", ...t });
1292
- }
1293
- function Jr({ className: e, ...t }) {
1294
- return /* @__PURE__ */ o.jsx(
1295
- "div",
1296
- {
1297
- className: u("flex basis-full items-center justify-between gap-2", e),
1298
- "data-slot": "item-header",
1299
- ...t
1300
- }
1301
- );
1302
- }
1303
- function Qr({ className: e, ...t }) {
1304
- return /* @__PURE__ */ o.jsx(
1305
- "div",
1306
- {
1307
- className: u("flex basis-full items-center justify-between gap-2", e),
1308
- "data-slot": "item-footer",
1309
- ...t
1310
- }
1311
- );
1312
- }
1313
- const S = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(Wr, { ...t, children: e });
1314
- S.Header = Jr;
1315
- S.Media = Kr;
1316
- S.Content = Ur;
1317
- S.Title = Yr;
1318
- S.Description = Xr;
1319
- S.Actions = Zr;
1320
- S.Footer = Qr;
1321
- const Nt = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(Zt, { ...t, children: e });
1322
- Nt.Trigger = Jt;
1323
- Nt.Content = Qt;
1324
- function ea({ className: e, ...t }) {
1325
- return /* @__PURE__ */ o.jsx("div", { className: "relative w-full overflow-x-auto", "data-slot": "table-container", children: /* @__PURE__ */ o.jsx("table", { className: u("w-full caption-bottom text-sm", e), "data-slot": "table", ...t }) });
1326
- }
1327
- function ta({ className: e, ...t }) {
1328
- return /* @__PURE__ */ o.jsx("thead", { className: u("[&_tr]:border-b", e), "data-slot": "table-header", ...t });
1329
- }
1330
- function oa({ className: e, ...t }) {
1331
- return /* @__PURE__ */ o.jsx("tbody", { className: u("[&_tr:last-child]:border-0", e), "data-slot": "table-body", ...t });
1332
- }
1333
- function ra({ className: e, ...t }) {
1334
- return /* @__PURE__ */ o.jsx(
1335
- "tr",
1336
- {
1337
- className: u("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", e),
1338
- "data-slot": "table-row",
1339
- ...t
1340
- }
1341
- );
1342
- }
1343
- function aa({ className: e, ...t }) {
1344
- return /* @__PURE__ */ o.jsx(
1345
- "th",
1346
- {
1347
- className: u(
1348
- "h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1349
- e
1350
- ),
1351
- "data-slot": "table-head",
1352
- ...t
1353
- }
1354
- );
1355
- }
1356
- function na({ className: e, ...t }) {
1357
- return /* @__PURE__ */ o.jsx(
1358
- "td",
1359
- {
1360
- className: u(
1361
- "whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1362
- e
1363
- ),
1364
- "data-slot": "table-cell",
1365
- ...t
1366
- }
1367
- );
1368
- }
1369
- function sa({ className: e, ...t }) {
1370
- return /* @__PURE__ */ o.jsx("caption", { className: u("mt-4 text-muted-foreground text-sm", e), "data-slot": "table-caption", ...t });
1371
- }
1372
- const H = ({ children: e, ...t }) => /* @__PURE__ */ o.jsx(ea, { ...t, children: e });
1373
- H.Body = oa;
1374
- H.Caption = sa;
1375
- H.Cell = na;
1376
- H.Head = aa;
1377
- H.Header = ta;
1378
- H.Row = ra;
1379
- const ia = ({
1380
- children: e,
1381
- className: t,
1382
- position: r = "outside",
1383
- type: a = "unordered",
1384
- variant: n = "muted",
1385
- ...s
1386
- }) => /* @__PURE__ */ o.jsx(
1387
- "ul",
1388
- {
1389
- className: u(
1390
- {
1391
- "list-decimal": a === "ordered",
1392
- "list-disc": a === "unordered",
1393
- "list-none": a === "none"
1394
- },
1395
- {
1396
- "list-inside": r === "inside",
1397
- "list-outside": r === "outside"
1398
- },
1399
- {
1400
- "ml-4": r === "outside" && a === "unordered",
1401
- "ml-6": r === "outside" && a === "ordered"
1402
- },
1403
- {
1404
- "marker:text-foreground": n === "default",
1405
- "marker:text-inherit": n === "inherit",
1406
- "marker:text-muted": n === "muted",
1407
- "marker:text-accent": n === "accent",
1408
- // Action colors
1409
- "marker:text-primary": n === "primary",
1410
- "marker:text-secondary": n === "secondary",
1411
- // Brand color
1412
- "marker:text-brand": n === "brand",
1413
- // Accent colors (rich color variants)
1414
- "marker:text-info": n === "info",
1415
- "marker:text-warning": n === "warning",
1416
- "marker:text-destructive": n === "destructive",
1417
- "marker:text-success": n === "success"
1418
- },
1419
- t
1420
- ),
1421
- ...s,
1422
- children: e
1423
- }
1424
- ), la = ({ children: e, asChild: t, ...r }) => {
1425
- const a = t ? ue : "li";
1426
- return /* @__PURE__ */ o.jsx(a, { role: "listitem", ...r, children: e });
1427
- };
1428
- ia.Item = la;
1429
- const Ae = [
1430
- {
1431
- theme: "light",
1432
- icon: /* @__PURE__ */ o.jsx(Oe, {}),
1433
- label: "Light mode"
1434
- },
1435
- {
1436
- theme: "dark",
1437
- icon: /* @__PURE__ */ o.jsx(Me, {}),
1438
- label: "Dark mode"
1439
- },
1440
- {
1441
- theme: "system",
1442
- icon: /* @__PURE__ */ o.jsx(oo, {}),
1443
- label: "System theme"
1444
- }
1445
- ], ca = ({ theme: e, setTheme: t, className: r, buttonClassName: a, ...n }) => {
1446
- const s = () => {
1447
- t(e === "light" ? "dark" : e === "dark" ? "system" : "light");
1448
- }, i = Ae.find((d) => d.theme === e)?.icon, c = Ae.find((d) => d.theme === e)?.label;
1449
- return /* @__PURE__ */ o.jsx("span", { className: u(r), ...n, children: /* @__PURE__ */ o.jsxs(St, { className: u("p-1 w-full", a), onClick: s, variant: "unstyled", children: [
1450
- i,
1451
- /* @__PURE__ */ o.jsx(pe, { size: "base", truncate: !0, children: c })
1452
- ] }) });
1453
- }, da = ({
1454
- variant: e = "horizontal",
1455
- theme: t,
1456
- setTheme: r,
1457
- className: a,
1458
- buttonClassName: n,
1459
- ...s
1460
- }) => {
1461
- const i = (c) => t === c ? "text-primary/75" : "text-primary/25 hover:text-primary";
1462
- return e === "stacked" ? /* @__PURE__ */ o.jsx(
1463
- ca,
1464
- {
1465
- buttonClassName: n,
1466
- className: a,
1467
- setTheme: r,
1468
- theme: t,
1469
- ...s
1470
- }
1471
- ) : /* @__PURE__ */ o.jsxs(Se, { gap: "4", children: [
1472
- /* @__PURE__ */ o.jsxs(j, { children: [
1473
- /* @__PURE__ */ o.jsx(j.Trigger, { children: /* @__PURE__ */ o.jsx(ao, { className: i("system"), onClick: () => r("system"), size: 32 }) }),
1474
- /* @__PURE__ */ o.jsx(j.Content, { children: "Use system theme" })
1475
- ] }),
1476
- /* @__PURE__ */ o.jsxs(j, { children: [
1477
- /* @__PURE__ */ o.jsx(j.Trigger, { children: /* @__PURE__ */ o.jsx(Oe, { className: i("light"), onClick: () => r("light"), size: 32 }) }),
1478
- /* @__PURE__ */ o.jsx(j.Content, { children: "Use light theme" })
1479
- ] }),
1480
- /* @__PURE__ */ o.jsxs(j, { children: [
1481
- /* @__PURE__ */ o.jsx(j.Trigger, { children: /* @__PURE__ */ o.jsx(Me, { className: i("dark"), onClick: () => r("dark"), size: 32 }) }),
1482
- /* @__PURE__ */ o.jsx(j.Content, { children: "Use dark theme" })
1483
- ] })
1484
- ] });
1485
- };
1486
- function Re({ delayDuration: e = 0, ...t }) {
1487
- return /* @__PURE__ */ o.jsx(gr, { "data-slot": "tooltip-provider", delayDuration: e, ...t });
1488
- }
1489
- function _t({ ...e }) {
1490
- return /* @__PURE__ */ o.jsx(Re, { children: /* @__PURE__ */ o.jsx(hr, { "data-slot": "tooltip", ...e }) });
1491
- }
1492
- function Rt({ ...e }) {
1493
- return /* @__PURE__ */ o.jsx(br, { "data-slot": "tooltip-trigger", ...e });
1494
- }
1495
- function kt({
1496
- className: e,
1497
- sideOffset: t = 0,
1498
- children: r,
1499
- ...a
1500
- }) {
1501
- return /* @__PURE__ */ o.jsx(vr, { children: /* @__PURE__ */ o.jsxs(
1502
- Cr,
1503
- {
1504
- className: u(
1505
- "fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs data-[state=closed]:animate-out",
1506
- e
1507
- ),
1508
- "data-slot": "tooltip-content",
1509
- sideOffset: t,
1510
- ...a,
1511
- children: [
1512
- r,
1513
- /* @__PURE__ */ o.jsx(yr, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary" })
1514
- ]
1515
- }
1516
- ) });
1517
- }
1518
- const j = ({ children: e, open: t, onOpenChange: r }) => /* @__PURE__ */ o.jsx(Re, { children: /* @__PURE__ */ o.jsx(_t, { onOpenChange: r, open: t, children: e }) }), ua = ({ children: e, cursor: t = "pointer", className: r }) => /* @__PURE__ */ o.jsx(
1519
- Rt,
1520
- {
1521
- asChild: !0,
1522
- className: u(
1523
- t === "arrow" && "cursor-default",
1524
- t === "pointer" && "cursor-pointer",
1525
- t === "text" && "cursor-text",
1526
- t === "not-allowed" && "cursor-not-allowed",
1527
- r
1528
- ),
1529
- children: e
1530
- }
1531
- ), pa = ({ className: e, children: t }) => /* @__PURE__ */ o.jsx(kt, { className: e, children: t });
1532
- j.Trigger = ua;
1533
- j.Content = pa;
1534
- const Qa = ({ children: e, content: t }) => /* @__PURE__ */ o.jsxs(j, { children: [
1535
- /* @__PURE__ */ o.jsx(j.Trigger, { children: typeof e == "string" ? /* @__PURE__ */ o.jsx("span", { children: e }) : e }),
1536
- /* @__PURE__ */ o.jsx(j.Content, { children: t })
1537
- ] });
1538
- function fa({ ...e }) {
1539
- return /* @__PURE__ */ o.jsx(Go, { "data-slot": "sheet", ...e });
1540
- }
1541
- function xa({ ...e }) {
1542
- return /* @__PURE__ */ o.jsx(Wo, { "data-slot": "sheet-portal", ...e });
1543
- }
1544
- function ma({ className: e, ...t }) {
1545
- return /* @__PURE__ */ o.jsx(
1546
- qo,
1547
- {
1548
- className: u(
1549
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
1550
- e
1551
- ),
1552
- "data-slot": "sheet-overlay",
1553
- ...t
1554
- }
1555
- );
1556
- }
1557
- function ga({
1558
- className: e,
1559
- children: t,
1560
- side: r = "right",
1561
- ...a
1562
- }) {
1563
- return /* @__PURE__ */ o.jsxs(xa, { children: [
1564
- /* @__PURE__ */ o.jsx(ma, {}),
1565
- /* @__PURE__ */ o.jsxs(
1566
- Ko,
1567
- {
1568
- className: u(
1569
- "fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",
1570
- r === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
1571
- r === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
1572
- r === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
1573
- r === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
1574
- e
1575
- ),
1576
- "data-slot": "sheet-content",
1577
- ...a,
1578
- children: [
1579
- t,
1580
- /* @__PURE__ */ o.jsxs(Xo, { className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1581
- /* @__PURE__ */ o.jsx(mo, { className: "size-4" }),
1582
- /* @__PURE__ */ o.jsx("span", { className: "sr-only", children: "Close" })
1583
- ] })
1584
- ]
1585
- }
1586
- )
1587
- ] });
1588
- }
1589
- function ha({ className: e, ...t }) {
1590
- return /* @__PURE__ */ o.jsx("div", { className: u("flex flex-col gap-1.5 p-4", e), "data-slot": "sheet-header", ...t });
1591
- }
1592
- function ba({ className: e, ...t }) {
1593
- return /* @__PURE__ */ o.jsx(
1594
- Uo,
1595
- {
1596
- className: u("font-semibold text-foreground", e),
1597
- "data-slot": "sheet-title",
1598
- ...t
1599
- }
1600
- );
1601
- }
1602
- function va({ className: e, ...t }) {
1603
- return /* @__PURE__ */ o.jsx(
1604
- Yo,
1605
- {
1606
- className: u("text-muted-foreground text-sm", e),
1607
- "data-slot": "sheet-description",
1608
- ...t
1609
- }
1610
- );
1611
- }
1612
- const se = 768;
1613
- function Ca() {
1614
- const [e, t] = l.useState(void 0);
1615
- return l.useEffect(() => {
1616
- const r = window.matchMedia(`(max-width: ${se - 1}px)`), a = () => {
1617
- t(window.innerWidth < se);
1618
- };
1619
- return r.addEventListener("change", a), t(window.innerWidth < se), () => r.removeEventListener("change", a);
1620
- }, []), !!e;
1621
- }
1622
- const ya = "sidebar_state", ja = 60 * 60 * 24 * 7, wa = "16rem", Ta = "18rem", Na = "3rem", _a = "b", At = l.createContext(null);
1623
- function ae() {
1624
- const e = l.useContext(At);
1625
- if (!e)
1626
- throw new Error("useSidebar must be used within a SidebarProvider.");
1627
- return e;
1628
- }
1629
- function Ra({
1630
- defaultOpen: e = !0,
1631
- open: t,
1632
- onOpenChange: r,
1633
- className: a,
1634
- style: n,
1635
- children: s,
1636
- ...i
1637
- }) {
1638
- const c = Ca(), [d, f] = l.useState(!1), [p, m] = l.useState(e), h = t ?? p, g = l.useCallback(
1639
- (b) => {
1640
- const x = typeof b == "function" ? b(h) : b;
1641
- r ? r(x) : m(x), document.cookie = `${ya}=${x}; path=/; max-age=${ja}`;
1642
- },
1643
- [r, h]
1644
- ), v = l.useCallback(() => c ? f((b) => !b) : g((b) => !b), [c, g]);
1645
- l.useEffect(() => {
1646
- const b = (x) => {
1647
- x.key === _a && (x.metaKey || x.ctrlKey) && (x.preventDefault(), v());
1648
- };
1649
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
1650
- }, [v]);
1651
- const C = h ? "expanded" : "collapsed", y = l.useMemo(
1652
- () => ({
1653
- state: C,
1654
- open: h,
1655
- setOpen: g,
1656
- isMobile: c,
1657
- openMobile: d,
1658
- setOpenMobile: f,
1659
- toggleSidebar: v
1660
- }),
1661
- [C, h, g, c, d, v]
1662
- );
1663
- return /* @__PURE__ */ o.jsx(At.Provider, { value: y, children: /* @__PURE__ */ o.jsx(Re, { delayDuration: 0, children: /* @__PURE__ */ o.jsx(
1664
- "div",
1665
- {
1666
- className: u("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", a),
1667
- "data-slot": "sidebar-wrapper",
1668
- style: {
1669
- "--sidebar-width": wa,
1670
- "--sidebar-width-icon": Na,
1671
- ...n
1672
- },
1673
- ...i,
1674
- children: s
1675
- }
1676
- ) }) });
1677
- }
1678
- function ka({
1679
- side: e = "left",
1680
- variant: t = "sidebar",
1681
- collapsible: r = "offcanvas",
1682
- className: a,
1683
- children: n,
1684
- ...s
1685
- }) {
1686
- const { isMobile: i, state: c, openMobile: d, setOpenMobile: f } = ae();
1687
- return r === "none" ? /* @__PURE__ */ o.jsx(
1688
- "div",
1689
- {
1690
- className: u("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", a),
1691
- "data-slot": "sidebar",
1692
- ...s,
1693
- children: n
1694
- }
1695
- ) : i ? /* @__PURE__ */ o.jsx(fa, { onOpenChange: f, open: d, ...s, children: /* @__PURE__ */ o.jsxs(
1696
- ga,
1697
- {
1698
- className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
1699
- "data-mobile": "true",
1700
- "data-sidebar": "sidebar",
1701
- "data-slot": "sidebar",
1702
- side: e,
1703
- style: {
1704
- "--sidebar-width": Ta
1705
- },
1706
- children: [
1707
- /* @__PURE__ */ o.jsxs(ha, { className: "sr-only", children: [
1708
- /* @__PURE__ */ o.jsx(ba, { children: "Sidebar" }),
1709
- /* @__PURE__ */ o.jsx(va, { children: "Displays the mobile sidebar." })
1710
- ] }),
1711
- /* @__PURE__ */ o.jsx("div", { className: "flex h-full w-full flex-col", children: n })
1712
- ]
1713
- }
1714
- ) }) : /* @__PURE__ */ o.jsxs(
1715
- "div",
1716
- {
1717
- className: "group peer hidden text-sidebar-foreground md:block",
1718
- "data-collapsible": c === "collapsed" ? r : "",
1719
- "data-side": e,
1720
- "data-slot": "sidebar",
1721
- "data-state": c,
1722
- "data-variant": t,
1723
- children: [
1724
- /* @__PURE__ */ o.jsx(
1725
- "div",
1726
- {
1727
- className: u(
1728
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
1729
- "group-data-[collapsible=offcanvas]:w-0",
1730
- "group-data-[side=right]:rotate-180",
1731
- t === "floating" || t === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
1732
- ),
1733
- "data-slot": "sidebar-gap"
1734
- }
1735
- ),
1736
- /* @__PURE__ */ o.jsx(
1737
- "div",
1738
- {
1739
- className: u(
1740
- "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
1741
- e === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
1742
- // Adjust the padding for floating and inset variants.
1743
- t === "floating" || t === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
1744
- a
1745
- ),
1746
- "data-slot": "sidebar-container",
1747
- ...s,
1748
- children: /* @__PURE__ */ o.jsx(
1749
- "div",
1750
- {
1751
- className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",
1752
- "data-sidebar": "sidebar",
1753
- "data-slot": "sidebar-inner",
1754
- children: n
1755
- }
1756
- )
1757
- }
1758
- )
1759
- ]
1760
- }
1761
- );
1762
- }
1763
- function Aa({ className: e, onClick: t, children: r, ...a }) {
1764
- const { toggleSidebar: n, open: s } = ae();
1765
- return /* @__PURE__ */ o.jsxs(
1766
- Mt,
1767
- {
1768
- className: u("size-7", e),
1769
- "data-sidebar": "trigger",
1770
- "data-slot": "sidebar-trigger",
1771
- onClick: (i) => {
1772
- t?.(i), n();
1773
- },
1774
- size: "icon",
1775
- variant: "ghost",
1776
- ...a,
1777
- children: [
1778
- s ? /* @__PURE__ */ o.jsx(co, {}) : /* @__PURE__ */ o.jsx(io, {}),
1779
- /* @__PURE__ */ o.jsx("span", { className: "sr-only", children: "Toggle Sidebar" }),
1780
- s ? r : null
1781
- ]
1782
- }
1783
- );
1784
- }
1785
- function Ea({ className: e, ...t }) {
1786
- const { toggleSidebar: r } = ae();
1787
- return /* @__PURE__ */ o.jsx(
1788
- "button",
1789
- {
1790
- "aria-label": "Toggle Sidebar",
1791
- className: u(
1792
- "-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex",
1793
- "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
1794
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
1795
- "group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full",
1796
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
1797
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
1798
- e
1799
- ),
1800
- "data-sidebar": "rail",
1801
- "data-slot": "sidebar-rail",
1802
- onClick: r,
1803
- tabIndex: -1,
1804
- title: "Toggle Sidebar",
1805
- ...t
1806
- }
1807
- );
1808
- }
1809
- function Da({ className: e, ...t }) {
1810
- return /* @__PURE__ */ o.jsx(
1811
- "main",
1812
- {
1813
- className: u(
1814
- "relative flex w-full flex-1 flex-col bg-background",
1815
- "md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
1816
- e
1817
- ),
1818
- "data-slot": "sidebar-inset",
1819
- ...t
1820
- }
1821
- );
1822
- }
1823
- function Ia({ className: e, ...t }) {
1824
- return /* @__PURE__ */ o.jsx(
1825
- "div",
1826
- {
1827
- className: u("flex flex-col gap-2 p-2", e),
1828
- "data-sidebar": "header",
1829
- "data-slot": "sidebar-header",
1830
- ...t
1831
- }
1832
- );
1833
- }
1834
- function Pa({ className: e, ...t }) {
1835
- return /* @__PURE__ */ o.jsx(
1836
- "div",
1837
- {
1838
- className: u("flex flex-col gap-2 p-2", e),
1839
- "data-sidebar": "footer",
1840
- "data-slot": "sidebar-footer",
1841
- ...t
1842
- }
1843
- );
1844
- }
1845
- function Et({ className: e, ...t }) {
1846
- return /* @__PURE__ */ o.jsx(
1847
- Vr,
1848
- {
1849
- className: u("mx-2 w-auto bg-sidebar-border", e),
1850
- "data-sidebar": "separator",
1851
- "data-slot": "sidebar-separator",
1852
- ...t
1853
- }
1854
- );
1855
- }
1856
- function Sa({ className: e, ...t }) {
1857
- return /* @__PURE__ */ o.jsx(
1858
- "div",
1859
- {
1860
- className: u(
1861
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
1862
- e
1863
- ),
1864
- "data-sidebar": "content",
1865
- "data-slot": "sidebar-content",
1866
- ...t
1867
- }
1868
- );
1869
- }
1870
- function Ma({ className: e, ...t }) {
1871
- return /* @__PURE__ */ o.jsx(
1872
- "div",
1873
- {
1874
- className: u("relative flex w-full min-w-0 flex-col p-2", e),
1875
- "data-sidebar": "group",
1876
- "data-slot": "sidebar-group",
1877
- ...t
1878
- }
1879
- );
1880
- }
1881
- function Oa({ className: e, ...t }) {
1882
- return /* @__PURE__ */ o.jsx(
1883
- "div",
1884
- {
1885
- className: u("w-full text-sm", e),
1886
- "data-sidebar": "group-content",
1887
- "data-slot": "sidebar-group-content",
1888
- ...t
1889
- }
1890
- );
1891
- }
1892
- function de({ className: e, ...t }) {
1893
- return /* @__PURE__ */ o.jsx(
1894
- "ul",
1895
- {
1896
- className: u("flex w-full min-w-0 flex-col gap-1", e),
1897
- "data-sidebar": "menu",
1898
- "data-slot": "sidebar-menu",
1899
- ...t
1900
- }
1901
- );
1902
- }
1903
- function q({ className: e, ...t }) {
1904
- return /* @__PURE__ */ o.jsx(
1905
- "li",
1906
- {
1907
- className: u("group/menu-item relative", e),
1908
- "data-sidebar": "menu-item",
1909
- "data-slot": "sidebar-menu-item",
1910
- ...t
1911
- }
1912
- );
1913
- }
1914
- const $a = X(
1915
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
1916
- {
1917
- variants: {
1918
- variant: {
1919
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1920
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
1921
- },
1922
- size: {
1923
- default: "h-8 text-sm",
1924
- sm: "h-7 text-xs",
1925
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
1926
- }
1927
- },
1928
- defaultVariants: {
1929
- variant: "default",
1930
- size: "default"
1931
- }
1932
- }
1933
- );
1934
- function K({
1935
- asChild: e = !1,
1936
- isActive: t = !1,
1937
- variant: r = "default",
1938
- size: a = "default",
1939
- tooltip: n,
1940
- className: s,
1941
- ...i
1942
- }) {
1943
- const c = e ? ue : "button", { isMobile: d, state: f } = ae(), p = /* @__PURE__ */ o.jsx(
1944
- c,
1945
- {
1946
- className: u($a({ variant: r, size: a }), s),
1947
- "data-active": t,
1948
- "data-sidebar": "menu-button",
1949
- "data-size": a,
1950
- "data-slot": "sidebar-menu-button",
1951
- ...i
1952
- }
1953
- );
1954
- return n ? (typeof n == "string" && (n = {
1955
- children: n
1956
- }), /* @__PURE__ */ o.jsxs(_t, { children: [
1957
- /* @__PURE__ */ o.jsx(Rt, { asChild: !0, children: p }),
1958
- /* @__PURE__ */ o.jsx(kt, { align: "center", hidden: f !== "collapsed" || d, side: "right", ...n })
1959
- ] })) : p;
1960
- }
1961
- const Dt = ({ children: e }) => /* @__PURE__ */ o.jsx(pe, { size: "base", truncate: !0, children: e }), za = ({ itemSet: e, activeSlug: t }) => /* @__PURE__ */ o.jsx(o.Fragment, { children: e.links.map((r) => /* @__PURE__ */ o.jsx(q, { className: "hover:cursor-pointer", onClick: r.onClick, children: /* @__PURE__ */ o.jsx(K, { asChild: !0, isActive: t === r.slug, children: /* @__PURE__ */ o.jsxs("span", { children: [
1962
- /* @__PURE__ */ o.jsx(r.icon, {}),
1963
- /* @__PURE__ */ o.jsx(Dt, { children: r.title }),
1964
- r.external && /* @__PURE__ */ o.jsx(Se, { children: /* @__PURE__ */ o.jsx(po, { size: 12, strokeWidth: 1.5 }) })
1965
- ] }) }) }, r.slug)) }), Ee = ({ itemSets: e, activeSlug: t }) => /* @__PURE__ */ o.jsx(de, { children: e.map((r, a) => /* @__PURE__ */ o.jsxs(Ot, { children: [
1966
- /* @__PURE__ */ o.jsx(za, { activeSlug: t, itemSet: r }),
1967
- a < e.length - 1 && /* @__PURE__ */ o.jsx(Et, {})
1968
- ] }, `item-set-${a}`)) }), La = ({
1969
- brandContent: e,
1970
- brandOnClick: t,
1971
- activeSlug: r,
1972
- itemSets: a,
1973
- bottomItemSets: n = [],
1974
- theme: s,
1975
- setTheme: i,
1976
- ...c
1977
- }) => /* @__PURE__ */ o.jsxs(ka, { collapsible: "icon", ...c, children: [
1978
- /* @__PURE__ */ o.jsx(Ia, { children: /* @__PURE__ */ o.jsx(de, { children: /* @__PURE__ */ o.jsx(q, { children: /* @__PURE__ */ o.jsx(
1979
- K,
1980
- {
1981
- className: t ? "cursor-pointer" : "cursor-default",
1982
- onClick: t,
1983
- size: "lg",
1984
- children: e
1985
- }
1986
- ) }) }) }),
1987
- /* @__PURE__ */ o.jsx(Sa, { children: /* @__PURE__ */ o.jsx(Ma, { children: /* @__PURE__ */ o.jsx(Oa, { children: /* @__PURE__ */ o.jsx(Ee, { activeSlug: r, itemSets: a }) }) }) }),
1988
- /* @__PURE__ */ o.jsx(Pa, { className: "mb-4", children: /* @__PURE__ */ o.jsxs(de, { children: [
1989
- /* @__PURE__ */ o.jsx(q, { children: /* @__PURE__ */ o.jsx(K, { asChild: !0, children: /* @__PURE__ */ o.jsx(Aa, { className: "justify-start font-normal", children: /* @__PURE__ */ o.jsx(Dt, { children: "Collapse menu" }) }) }) }),
1990
- /* @__PURE__ */ o.jsx(q, { children: /* @__PURE__ */ o.jsx(K, { asChild: !0, children: /* @__PURE__ */ o.jsx(da, { buttonClassName: "p-0", setTheme: i, theme: s, variant: "stacked" }) }) }),
1991
- n.length > 0 && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
1992
- /* @__PURE__ */ o.jsx(Et, {}),
1993
- /* @__PURE__ */ o.jsx(Ee, { activeSlug: r, itemSets: n })
1994
- ] })
1995
- ] }) }),
1996
- /* @__PURE__ */ o.jsx(Ea, {})
1997
- ] }), en = ({ children: e, ...t }) => /* @__PURE__ */ o.jsxs(Ra, { children: [
1998
- /* @__PURE__ */ o.jsx(La, { ...t }),
1999
- /* @__PURE__ */ o.jsx(Da, { className: "max-w-screen-xl", children: e })
2000
- ] });
2001
- export {
2002
- _e as A,
2003
- Ko as C,
2004
- Yo as D,
2005
- G as E,
2006
- Ja as I,
2007
- Dt as M,
2008
- qo as O,
2009
- Wo as P,
2010
- Go as R,
2011
- Aa as S,
2012
- Xa as T,
2013
- mo as X,
2014
- La as a,
2015
- en as b,
2016
- Xo as c,
2017
- Uo as d,
2018
- Vr as e,
2019
- L as f,
2020
- Tt as g,
2021
- S as h,
2022
- Nt as i,
2023
- H as j,
2024
- oa as k,
2025
- sa as l,
2026
- na as m,
2027
- aa as n,
2028
- ta as o,
2029
- ra as p,
2030
- ia as q,
2031
- da as r,
2032
- j as s,
2033
- Qa as t
2034
- };