florixui 1.0.0
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/README.md +919 -0
- package/dist/components/custom/actions-menu.d.ts +41 -0
- package/dist/components/custom/advanced-input.d.ts +39 -0
- package/dist/components/custom/advanced-select.d.ts +67 -0
- package/dist/components/custom/data-table.d.ts +38 -0
- package/dist/components/custom/date-time-range-picker-utils.d.ts +32 -0
- package/dist/components/custom/date-time-range-picker.d.ts +15 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/calendar.d.ts +10 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/chart.d.ts +44 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/map.d.ts +278 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/stepper.d.ts +27 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/timeline.d.ts +25 -0
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +3638 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/styles.css +2 -0
- package/package.json +104 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3638 @@
|
|
|
1
|
+
import { clsx as e } from "clsx";
|
|
2
|
+
import { twMerge as t } from "tailwind-merge";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useEffect as s, useId as c, useImperativeHandle as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
5
|
+
import { Calendar as p, Check as m, CheckIcon as h, ChevronDown as g, ChevronDownIcon as _, ChevronLeftIcon as v, ChevronRightIcon as y, ChevronUpIcon as b, CircleCheckIcon as x, Clock as S, Eye as C, EyeOff as w, InfoIcon as T, Layers as E, Loader2 as ee, Loader2Icon as D, LoaderCircleIcon as O, Locate as k, Maximize as A, Minus as te, MoreVertical as j, OctagonXIcon as M, Plus as ne, PlusIcon as re, SearchIcon as N, TriangleAlertIcon as ie, X as ae, XIcon as oe } from "lucide-react";
|
|
6
|
+
import { cva as P } from "class-variance-authority";
|
|
7
|
+
import { AlertDialog as F, Checkbox as I, Dialog as L, DropdownMenu as R, HoverCard as z, Label as se, Popover as B, Progress as V, RadioGroup as H, Select as U, Separator as ce, Slider as W, Slot as G, Switch as le, Tabs as K, Toggle as ue, ToggleGroup as de, Tooltip as q } from "radix-ui";
|
|
8
|
+
import { Fragment as fe, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
9
|
+
import { Command as X } from "cmdk";
|
|
10
|
+
import { DayPicker as pe, getDefaultClassNames as me } from "react-day-picker";
|
|
11
|
+
import * as he from "recharts";
|
|
12
|
+
import ge from "maplibre-gl";
|
|
13
|
+
import "maplibre-gl/dist/maplibre-gl.css";
|
|
14
|
+
import { createPortal as _e } from "react-dom";
|
|
15
|
+
import { useTheme as ve } from "next-themes";
|
|
16
|
+
import { Toaster as ye } from "sonner";
|
|
17
|
+
//#region src/lib/utils.ts
|
|
18
|
+
function Z(...n) {
|
|
19
|
+
return t(e(n));
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/ui/button.tsx
|
|
23
|
+
var be = P("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
27
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
28
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
29
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
30
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
31
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
35
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
36
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
37
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
38
|
+
icon: "size-8",
|
|
39
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
40
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
41
|
+
"icon-lg": "size-9"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
variant: "default",
|
|
46
|
+
size: "default"
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function Q({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
|
|
50
|
+
return /* @__PURE__ */ J(r ? G.Root : "button", {
|
|
51
|
+
"data-slot": "button",
|
|
52
|
+
"data-variant": t,
|
|
53
|
+
"data-size": n,
|
|
54
|
+
className: Z(be({
|
|
55
|
+
variant: t,
|
|
56
|
+
size: n,
|
|
57
|
+
className: e
|
|
58
|
+
})),
|
|
59
|
+
...i
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/ui/dropdown-menu.tsx
|
|
64
|
+
function xe({ ...e }) {
|
|
65
|
+
return /* @__PURE__ */ J(R.Root, {
|
|
66
|
+
"data-slot": "dropdown-menu",
|
|
67
|
+
...e
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function Se({ ...e }) {
|
|
71
|
+
return /* @__PURE__ */ J(R.Portal, {
|
|
72
|
+
"data-slot": "dropdown-menu-portal",
|
|
73
|
+
...e
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function Ce({ ...e }) {
|
|
77
|
+
return /* @__PURE__ */ J(R.Trigger, {
|
|
78
|
+
"data-slot": "dropdown-menu-trigger",
|
|
79
|
+
...e
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function we({ className: e, align: t = "start", sideOffset: n = 4, ...r }) {
|
|
83
|
+
return /* @__PURE__ */ J(R.Portal, { children: /* @__PURE__ */ J(R.Content, {
|
|
84
|
+
"data-slot": "dropdown-menu-content",
|
|
85
|
+
sideOffset: n,
|
|
86
|
+
align: t,
|
|
87
|
+
className: Z("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
88
|
+
...r
|
|
89
|
+
}) });
|
|
90
|
+
}
|
|
91
|
+
function Te({ ...e }) {
|
|
92
|
+
return /* @__PURE__ */ J(R.Group, {
|
|
93
|
+
"data-slot": "dropdown-menu-group",
|
|
94
|
+
...e
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function Ee({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
98
|
+
return /* @__PURE__ */ J(R.Item, {
|
|
99
|
+
"data-slot": "dropdown-menu-item",
|
|
100
|
+
"data-inset": t,
|
|
101
|
+
"data-variant": n,
|
|
102
|
+
className: Z("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", e),
|
|
103
|
+
...r
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function De({ className: e, children: t, checked: n, inset: r, ...i }) {
|
|
107
|
+
return /* @__PURE__ */ Y(R.CheckboxItem, {
|
|
108
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
109
|
+
"data-inset": r,
|
|
110
|
+
className: Z("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
|
|
111
|
+
checked: n,
|
|
112
|
+
...i,
|
|
113
|
+
children: [/* @__PURE__ */ J("span", {
|
|
114
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
115
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
116
|
+
children: /* @__PURE__ */ J(R.ItemIndicator, { children: /* @__PURE__ */ J(h, {}) })
|
|
117
|
+
}), t]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function Oe({ ...e }) {
|
|
121
|
+
return /* @__PURE__ */ J(R.RadioGroup, {
|
|
122
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
123
|
+
...e
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function ke({ className: e, children: t, inset: n, ...r }) {
|
|
127
|
+
return /* @__PURE__ */ Y(R.RadioItem, {
|
|
128
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
129
|
+
"data-inset": n,
|
|
130
|
+
className: Z("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
|
|
131
|
+
...r,
|
|
132
|
+
children: [/* @__PURE__ */ J("span", {
|
|
133
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
134
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
135
|
+
children: /* @__PURE__ */ J(R.ItemIndicator, { children: /* @__PURE__ */ J(h, {}) })
|
|
136
|
+
}), t]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function Ae({ className: e, inset: t, ...n }) {
|
|
140
|
+
return /* @__PURE__ */ J(R.Label, {
|
|
141
|
+
"data-slot": "dropdown-menu-label",
|
|
142
|
+
"data-inset": t,
|
|
143
|
+
className: Z("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", e),
|
|
144
|
+
...n
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function je({ className: e, ...t }) {
|
|
148
|
+
return /* @__PURE__ */ J(R.Separator, {
|
|
149
|
+
"data-slot": "dropdown-menu-separator",
|
|
150
|
+
className: Z("-mx-1 my-1 h-px bg-border", e),
|
|
151
|
+
...t
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function Me({ className: e, ...t }) {
|
|
155
|
+
return /* @__PURE__ */ J("span", {
|
|
156
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
157
|
+
className: Z("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", e),
|
|
158
|
+
...t
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function Ne({ ...e }) {
|
|
162
|
+
return /* @__PURE__ */ J(R.Sub, {
|
|
163
|
+
"data-slot": "dropdown-menu-sub",
|
|
164
|
+
...e
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function Pe({ className: e, inset: t, children: n, ...r }) {
|
|
168
|
+
return /* @__PURE__ */ Y(R.SubTrigger, {
|
|
169
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
170
|
+
"data-inset": t,
|
|
171
|
+
className: Z("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
|
|
172
|
+
...r,
|
|
173
|
+
children: [n, /* @__PURE__ */ J(y, { className: "ml-auto" })]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function Fe({ className: e, ...t }) {
|
|
177
|
+
return /* @__PURE__ */ J(R.SubContent, {
|
|
178
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
179
|
+
className: Z("z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
180
|
+
...t
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/components/custom/actions-menu.tsx
|
|
185
|
+
var Ie = 16;
|
|
186
|
+
function Le(e) {
|
|
187
|
+
return e.type === void 0 || e.type === "action";
|
|
188
|
+
}
|
|
189
|
+
function Re({ items: e, trigger: t, triggerIcon: n = j, triggerLabel: r = "Open menu", width: i = "10rem", align: a = "end", className: o, open: s, onOpenChange: c }) {
|
|
190
|
+
return /* @__PURE__ */ Y(xe, {
|
|
191
|
+
open: s,
|
|
192
|
+
onOpenChange: c,
|
|
193
|
+
children: [/* @__PURE__ */ J(Ce, {
|
|
194
|
+
asChild: !0,
|
|
195
|
+
children: t ?? /* @__PURE__ */ Y(Q, {
|
|
196
|
+
variant: "ghost",
|
|
197
|
+
size: "icon",
|
|
198
|
+
className: Z("size-8", o),
|
|
199
|
+
"aria-label": r,
|
|
200
|
+
children: [/* @__PURE__ */ J(n, { size: Ie }), /* @__PURE__ */ J("span", {
|
|
201
|
+
className: "sr-only",
|
|
202
|
+
children: r
|
|
203
|
+
})]
|
|
204
|
+
})
|
|
205
|
+
}), /* @__PURE__ */ J(we, {
|
|
206
|
+
align: a,
|
|
207
|
+
style: { width: i },
|
|
208
|
+
children: e.map((e, t) => {
|
|
209
|
+
if (e.type === "separator") return /* @__PURE__ */ J(je, {}, `sep-${t}`);
|
|
210
|
+
if (e.type === "label") return /* @__PURE__ */ J(Ae, { children: e.label }, `label-${t}`);
|
|
211
|
+
if (!Le(e)) return null;
|
|
212
|
+
let n = e.icon;
|
|
213
|
+
return /* @__PURE__ */ Y(Ee, {
|
|
214
|
+
onSelect: e.onSelect,
|
|
215
|
+
disabled: e.disabled,
|
|
216
|
+
variant: e.destructive ? "destructive" : "default",
|
|
217
|
+
children: [
|
|
218
|
+
n && /* @__PURE__ */ J(n, { size: Ie }),
|
|
219
|
+
e.label,
|
|
220
|
+
e.shortcut && /* @__PURE__ */ J(Me, { children: e.shortcut })
|
|
221
|
+
]
|
|
222
|
+
}, t);
|
|
223
|
+
})
|
|
224
|
+
})]
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/components/ui/label.tsx
|
|
229
|
+
function ze({ className: e, ...t }) {
|
|
230
|
+
return /* @__PURE__ */ J(se.Root, {
|
|
231
|
+
"data-slot": "label",
|
|
232
|
+
className: Z("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
233
|
+
...t
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/components/ui/separator.tsx
|
|
238
|
+
function Be({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }) {
|
|
239
|
+
return /* @__PURE__ */ J(ce.Root, {
|
|
240
|
+
"data-slot": "separator",
|
|
241
|
+
decorative: n,
|
|
242
|
+
orientation: t,
|
|
243
|
+
className: Z("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", e),
|
|
244
|
+
...r
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/components/ui/field.tsx
|
|
249
|
+
function Ve({ className: e, ...t }) {
|
|
250
|
+
return /* @__PURE__ */ J("fieldset", {
|
|
251
|
+
"data-slot": "field-set",
|
|
252
|
+
className: Z("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", e),
|
|
253
|
+
...t
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function He({ className: e, variant: t = "legend", ...n }) {
|
|
257
|
+
return /* @__PURE__ */ J("legend", {
|
|
258
|
+
"data-slot": "field-legend",
|
|
259
|
+
"data-variant": t,
|
|
260
|
+
className: Z("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", e),
|
|
261
|
+
...n
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function Ue({ className: e, ...t }) {
|
|
265
|
+
return /* @__PURE__ */ J("div", {
|
|
266
|
+
"data-slot": "field-group",
|
|
267
|
+
className: Z("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", e),
|
|
268
|
+
...t
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
var We = P("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
272
|
+
variants: { orientation: {
|
|
273
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
274
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
275
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
276
|
+
} },
|
|
277
|
+
defaultVariants: { orientation: "vertical" }
|
|
278
|
+
});
|
|
279
|
+
function Ge({ className: e, orientation: t = "vertical", ...n }) {
|
|
280
|
+
return /* @__PURE__ */ J("div", {
|
|
281
|
+
role: "group",
|
|
282
|
+
"data-slot": "field",
|
|
283
|
+
"data-orientation": t,
|
|
284
|
+
className: Z(We({ orientation: t }), e),
|
|
285
|
+
...n
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function Ke({ className: e, ...t }) {
|
|
289
|
+
return /* @__PURE__ */ J("div", {
|
|
290
|
+
"data-slot": "field-content",
|
|
291
|
+
className: Z("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", e),
|
|
292
|
+
...t
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function qe({ className: e, ...t }) {
|
|
296
|
+
return /* @__PURE__ */ J(ze, {
|
|
297
|
+
"data-slot": "field-label",
|
|
298
|
+
className: Z("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", e),
|
|
299
|
+
...t
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function Je({ className: e, ...t }) {
|
|
303
|
+
return /* @__PURE__ */ J("div", {
|
|
304
|
+
"data-slot": "field-label",
|
|
305
|
+
className: Z("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50", e),
|
|
306
|
+
...t
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function Ye({ className: e, ...t }) {
|
|
310
|
+
return /* @__PURE__ */ J("p", {
|
|
311
|
+
"data-slot": "field-description",
|
|
312
|
+
className: Z("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", e),
|
|
313
|
+
...t
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function Xe({ children: e, className: t, ...n }) {
|
|
317
|
+
return /* @__PURE__ */ Y("div", {
|
|
318
|
+
"data-slot": "field-separator",
|
|
319
|
+
"data-content": !!e,
|
|
320
|
+
className: Z("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", t),
|
|
321
|
+
...n,
|
|
322
|
+
children: [/* @__PURE__ */ J(Be, { className: "absolute inset-0 top-1/2" }), e && /* @__PURE__ */ J("span", {
|
|
323
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
324
|
+
"data-slot": "field-separator-content",
|
|
325
|
+
children: e
|
|
326
|
+
})]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
function Ze({ className: e, children: t, errors: n, ...r }) {
|
|
330
|
+
let i = u(() => {
|
|
331
|
+
if (t) return t;
|
|
332
|
+
if (!n?.length) return null;
|
|
333
|
+
let e = [...new Map(n.map((e) => [e?.message, e])).values()];
|
|
334
|
+
return e?.length == 1 ? e[0]?.message : /* @__PURE__ */ J("ul", {
|
|
335
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
336
|
+
children: e.map((e, t) => e?.message && /* @__PURE__ */ J("li", { children: e.message }, t))
|
|
337
|
+
});
|
|
338
|
+
}, [t, n]);
|
|
339
|
+
return i ? /* @__PURE__ */ J("div", {
|
|
340
|
+
role: "alert",
|
|
341
|
+
"data-slot": "field-error",
|
|
342
|
+
className: Z("text-sm font-normal text-destructive", e),
|
|
343
|
+
...r,
|
|
344
|
+
children: i
|
|
345
|
+
}) : null;
|
|
346
|
+
}
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/components/custom/advanced-input.tsx
|
|
349
|
+
function Qe({ error: e, errorMessage: t, helperText: n, errorId: r, helperId: i }) {
|
|
350
|
+
return !t && !n ? null : /* @__PURE__ */ J("div", {
|
|
351
|
+
className: "mt-1.5 min-h-5",
|
|
352
|
+
children: e && t ? /* @__PURE__ */ J("p", {
|
|
353
|
+
id: r,
|
|
354
|
+
className: "text-xs leading-5 text-destructive",
|
|
355
|
+
children: t
|
|
356
|
+
}) : !e && n ? /* @__PURE__ */ J("p", {
|
|
357
|
+
id: i,
|
|
358
|
+
className: "text-xs leading-5 text-muted-foreground",
|
|
359
|
+
children: n
|
|
360
|
+
}) : null
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
var $e = n.forwardRef(function(e, t) {
|
|
364
|
+
let { className: r, wrapperClassName: i, label: a, description: o, errorMessage: s, helperText: c, required: l = !1, size: u = "default", variant: d = "default", leftIcon: f, rightIcon: p, disabled: m, startItem: h, endItem: g, loading: _ = !1, as: v = "input", id: y, error: b, ...x } = e, S = b ?? !!s, T = n.useId(), E = y || T, [D, O] = n.useState(!1), k = `${E}-error`, A = `${E}-helper`, te = `${E}-description`, j = [
|
|
365
|
+
S && s ? k : null,
|
|
366
|
+
!S && c ? A : null,
|
|
367
|
+
o ? te : null
|
|
368
|
+
].filter(Boolean).join(" ") || void 0, M = d === "alt" ? "bg-muted" : "bg-transparent dark:bg-input/30", ne = l ? /* @__PURE__ */ J("span", {
|
|
369
|
+
"aria-hidden": !0,
|
|
370
|
+
className: "ml-0.5 text-destructive",
|
|
371
|
+
children: "*"
|
|
372
|
+
}) : null;
|
|
373
|
+
if (v === "textarea") {
|
|
374
|
+
let e = x;
|
|
375
|
+
return /* @__PURE__ */ Y("div", {
|
|
376
|
+
className: Z("space-y-1.5", i),
|
|
377
|
+
children: [
|
|
378
|
+
a && /* @__PURE__ */ Y(qe, {
|
|
379
|
+
htmlFor: E,
|
|
380
|
+
className: Z(m && "text-muted-foreground"),
|
|
381
|
+
children: [a, ne]
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ J("textarea", {
|
|
384
|
+
id: E,
|
|
385
|
+
ref: t,
|
|
386
|
+
disabled: m,
|
|
387
|
+
"aria-invalid": S,
|
|
388
|
+
"aria-describedby": j,
|
|
389
|
+
className: Z("flex min-h-20 w-full rounded-lg border border-input px-3 py-2 text-base outline-none transition-colors placeholder:text-muted-foreground md:text-sm", M, "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", r),
|
|
390
|
+
...e
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ J(Qe, {
|
|
393
|
+
error: S,
|
|
394
|
+
errorMessage: s,
|
|
395
|
+
helperText: c,
|
|
396
|
+
errorId: k,
|
|
397
|
+
helperId: A
|
|
398
|
+
}),
|
|
399
|
+
o && /* @__PURE__ */ J(Ye, {
|
|
400
|
+
id: te,
|
|
401
|
+
children: o
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
let { type: re, onFocus: N, ...ie } = x, ae = re ?? "text", oe = ae === "password", P = oe && D ? "text" : ae, F = oe ? /* @__PURE__ */ J("button", {
|
|
407
|
+
type: "button",
|
|
408
|
+
onClick: () => O((e) => !e),
|
|
409
|
+
"aria-label": D ? "Hide password" : "Show password",
|
|
410
|
+
className: "cursor-pointer text-muted-foreground transition-colors hover:text-foreground",
|
|
411
|
+
tabIndex: -1,
|
|
412
|
+
children: J(D ? w : C, { className: "size-4" })
|
|
413
|
+
}) : null, I = _ ? /* @__PURE__ */ J(ee, { className: "size-4 animate-spin text-muted-foreground" }) : f, L = oe ? F : p, R = (e) => {
|
|
414
|
+
P === "number" && e.target.select(), N?.(e);
|
|
415
|
+
}, z = !!(h || g), se = /* @__PURE__ */ J("input", {
|
|
416
|
+
id: E,
|
|
417
|
+
type: P,
|
|
418
|
+
ref: t,
|
|
419
|
+
disabled: m,
|
|
420
|
+
"aria-invalid": S,
|
|
421
|
+
"aria-describedby": j,
|
|
422
|
+
onFocus: R,
|
|
423
|
+
className: Z("w-full min-w-0 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:text-sm", z ? "h-full border-0 py-1 focus-visible:ring-0" : Z("rounded-lg border border-input px-3 py-1 transition-colors", M, u === "default" ? "h-9" : "h-8", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", I && "pl-9", L && "pr-9"), z && Z(h ? "pl-0" : "pl-3", g ? "pr-0" : "pr-3"), z && I && !h && "pl-9", z && L && !g && "pr-9", r),
|
|
424
|
+
...ie
|
|
425
|
+
});
|
|
426
|
+
return /* @__PURE__ */ Y("div", {
|
|
427
|
+
className: Z("space-y-1.5", i),
|
|
428
|
+
children: [
|
|
429
|
+
a && /* @__PURE__ */ Y(qe, {
|
|
430
|
+
htmlFor: E,
|
|
431
|
+
className: Z(m && "text-muted-foreground"),
|
|
432
|
+
children: [a, ne]
|
|
433
|
+
}),
|
|
434
|
+
z ? /* @__PURE__ */ Y("div", {
|
|
435
|
+
"aria-invalid": S,
|
|
436
|
+
className: Z("flex items-center overflow-hidden rounded-lg border border-input transition-colors", M, u === "default" ? "h-9" : "h-8", "focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50", "aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-3 aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40", m && "cursor-not-allowed opacity-50"),
|
|
437
|
+
children: [
|
|
438
|
+
h && /* @__PURE__ */ J("div", {
|
|
439
|
+
className: "flex h-full shrink-0 items-center justify-center border-r border-input bg-muted/40 px-3 text-sm text-muted-foreground [&_svg]:size-4",
|
|
440
|
+
children: h
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ Y("div", {
|
|
443
|
+
className: "relative flex h-full flex-1 items-center",
|
|
444
|
+
children: [
|
|
445
|
+
I && /* @__PURE__ */ J("div", {
|
|
446
|
+
className: "pointer-events-none absolute left-3 flex items-center text-muted-foreground [&_svg]:size-4",
|
|
447
|
+
children: I
|
|
448
|
+
}),
|
|
449
|
+
se,
|
|
450
|
+
L && /* @__PURE__ */ J("div", {
|
|
451
|
+
className: "absolute right-3 z-10 flex items-center",
|
|
452
|
+
children: L
|
|
453
|
+
})
|
|
454
|
+
]
|
|
455
|
+
}),
|
|
456
|
+
g && /* @__PURE__ */ J("div", {
|
|
457
|
+
className: "flex h-full shrink-0 items-center justify-center border-l border-input bg-muted/40 px-3 text-sm text-foreground [&_svg]:size-4",
|
|
458
|
+
children: g
|
|
459
|
+
})
|
|
460
|
+
]
|
|
461
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
462
|
+
className: "relative",
|
|
463
|
+
children: [
|
|
464
|
+
I && /* @__PURE__ */ J("div", {
|
|
465
|
+
className: "pointer-events-none absolute left-3 top-1/2 flex -translate-y-1/2 items-center text-muted-foreground [&_svg]:size-4",
|
|
466
|
+
children: I
|
|
467
|
+
}),
|
|
468
|
+
se,
|
|
469
|
+
L && /* @__PURE__ */ J("div", {
|
|
470
|
+
className: "absolute right-3 top-1/2 z-10 flex -translate-y-1/2 items-center",
|
|
471
|
+
children: L
|
|
472
|
+
})
|
|
473
|
+
]
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ J(Qe, {
|
|
476
|
+
error: S,
|
|
477
|
+
errorMessage: s,
|
|
478
|
+
helperText: c,
|
|
479
|
+
errorId: k,
|
|
480
|
+
helperId: A
|
|
481
|
+
}),
|
|
482
|
+
o && /* @__PURE__ */ J(Ye, {
|
|
483
|
+
id: te,
|
|
484
|
+
children: o
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region src/components/ui/dialog.tsx
|
|
491
|
+
function et({ ...e }) {
|
|
492
|
+
return /* @__PURE__ */ J(L.Root, {
|
|
493
|
+
"data-slot": "dialog",
|
|
494
|
+
...e
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
function tt({ ...e }) {
|
|
498
|
+
return /* @__PURE__ */ J(L.Trigger, {
|
|
499
|
+
"data-slot": "dialog-trigger",
|
|
500
|
+
...e
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
function nt({ ...e }) {
|
|
504
|
+
return /* @__PURE__ */ J(L.Portal, {
|
|
505
|
+
"data-slot": "dialog-portal",
|
|
506
|
+
...e
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
function rt({ ...e }) {
|
|
510
|
+
return /* @__PURE__ */ J(L.Close, {
|
|
511
|
+
"data-slot": "dialog-close",
|
|
512
|
+
...e
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
function it({ className: e, ...t }) {
|
|
516
|
+
return /* @__PURE__ */ J(L.Overlay, {
|
|
517
|
+
"data-slot": "dialog-overlay",
|
|
518
|
+
className: Z("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
|
|
519
|
+
...t
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
function at({ className: e, children: t, showCloseButton: n = !0, ...r }) {
|
|
523
|
+
return /* @__PURE__ */ Y(nt, { children: [/* @__PURE__ */ J(it, {}), /* @__PURE__ */ Y(L.Content, {
|
|
524
|
+
"data-slot": "dialog-content",
|
|
525
|
+
className: Z("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
526
|
+
...r,
|
|
527
|
+
children: [t, n && /* @__PURE__ */ J(L.Close, {
|
|
528
|
+
"data-slot": "dialog-close",
|
|
529
|
+
asChild: !0,
|
|
530
|
+
children: /* @__PURE__ */ Y(Q, {
|
|
531
|
+
variant: "ghost",
|
|
532
|
+
className: "absolute top-2 right-2",
|
|
533
|
+
size: "icon-sm",
|
|
534
|
+
children: [/* @__PURE__ */ J(oe, {}), /* @__PURE__ */ J("span", {
|
|
535
|
+
className: "sr-only",
|
|
536
|
+
children: "Close"
|
|
537
|
+
})]
|
|
538
|
+
})
|
|
539
|
+
})]
|
|
540
|
+
})] });
|
|
541
|
+
}
|
|
542
|
+
function ot({ className: e, ...t }) {
|
|
543
|
+
return /* @__PURE__ */ J("div", {
|
|
544
|
+
"data-slot": "dialog-header",
|
|
545
|
+
className: Z("flex flex-col gap-2", e),
|
|
546
|
+
...t
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
function st({ className: e, showCloseButton: t = !1, children: n, ...r }) {
|
|
550
|
+
return /* @__PURE__ */ Y("div", {
|
|
551
|
+
"data-slot": "dialog-footer",
|
|
552
|
+
className: Z("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", e),
|
|
553
|
+
...r,
|
|
554
|
+
children: [n, t && /* @__PURE__ */ J(L.Close, {
|
|
555
|
+
asChild: !0,
|
|
556
|
+
children: /* @__PURE__ */ J(Q, {
|
|
557
|
+
variant: "outline",
|
|
558
|
+
children: "Close"
|
|
559
|
+
})
|
|
560
|
+
})]
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
function ct({ className: e, ...t }) {
|
|
564
|
+
return /* @__PURE__ */ J(L.Title, {
|
|
565
|
+
"data-slot": "dialog-title",
|
|
566
|
+
className: Z("text-base leading-none font-medium", e),
|
|
567
|
+
...t
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
function lt({ className: e, ...t }) {
|
|
571
|
+
return /* @__PURE__ */ J(L.Description, {
|
|
572
|
+
"data-slot": "dialog-description",
|
|
573
|
+
className: Z("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
|
|
574
|
+
...t
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/components/ui/input.tsx
|
|
579
|
+
function ut({ className: e, type: t, ...n }) {
|
|
580
|
+
return /* @__PURE__ */ J("input", {
|
|
581
|
+
type: t,
|
|
582
|
+
"data-slot": "input",
|
|
583
|
+
className: Z("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", e),
|
|
584
|
+
...n
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
//#endregion
|
|
588
|
+
//#region src/components/ui/textarea.tsx
|
|
589
|
+
function dt({ className: e, ...t }) {
|
|
590
|
+
return /* @__PURE__ */ J("textarea", {
|
|
591
|
+
"data-slot": "textarea",
|
|
592
|
+
className: Z("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", e),
|
|
593
|
+
...t
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region src/components/ui/input-group.tsx
|
|
598
|
+
function ft({ className: e, ...t }) {
|
|
599
|
+
return /* @__PURE__ */ J("div", {
|
|
600
|
+
"data-slot": "input-group",
|
|
601
|
+
role: "group",
|
|
602
|
+
className: Z("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", e),
|
|
603
|
+
...t
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
var pt = P("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
607
|
+
variants: { align: {
|
|
608
|
+
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
609
|
+
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
610
|
+
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
611
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
612
|
+
} },
|
|
613
|
+
defaultVariants: { align: "inline-start" }
|
|
614
|
+
});
|
|
615
|
+
function mt({ className: e, align: t = "inline-start", ...n }) {
|
|
616
|
+
return /* @__PURE__ */ J("div", {
|
|
617
|
+
role: "group",
|
|
618
|
+
"data-slot": "input-group-addon",
|
|
619
|
+
"data-align": t,
|
|
620
|
+
className: Z(pt({ align: t }), e),
|
|
621
|
+
onClick: (e) => {
|
|
622
|
+
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
623
|
+
},
|
|
624
|
+
...n
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
var ht = P("flex items-center gap-2 text-sm shadow-none", {
|
|
628
|
+
variants: { size: {
|
|
629
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
630
|
+
sm: "",
|
|
631
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
632
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
633
|
+
} },
|
|
634
|
+
defaultVariants: { size: "xs" }
|
|
635
|
+
});
|
|
636
|
+
function gt({ className: e, type: t = "button", variant: n = "ghost", size: r = "xs", ...i }) {
|
|
637
|
+
return /* @__PURE__ */ J(Q, {
|
|
638
|
+
type: t,
|
|
639
|
+
"data-size": r,
|
|
640
|
+
variant: n,
|
|
641
|
+
className: Z(ht({ size: r }), e),
|
|
642
|
+
...i
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
function _t({ className: e, ...t }) {
|
|
646
|
+
return /* @__PURE__ */ J("span", {
|
|
647
|
+
className: Z("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
|
|
648
|
+
...t
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
function vt({ className: e, ...t }) {
|
|
652
|
+
return /* @__PURE__ */ J(ut, {
|
|
653
|
+
"data-slot": "input-group-control",
|
|
654
|
+
className: Z("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", e),
|
|
655
|
+
...t
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
function yt({ className: e, ...t }) {
|
|
659
|
+
return /* @__PURE__ */ J(dt, {
|
|
660
|
+
"data-slot": "input-group-control",
|
|
661
|
+
className: Z("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", e),
|
|
662
|
+
...t
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
//#endregion
|
|
666
|
+
//#region src/components/ui/command.tsx
|
|
667
|
+
function bt({ className: e, ...t }) {
|
|
668
|
+
return /* @__PURE__ */ J(X, {
|
|
669
|
+
"data-slot": "command",
|
|
670
|
+
className: Z("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground", e),
|
|
671
|
+
...t
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
function xt({ title: e = "Command Palette", description: t = "Search for a command to run...", children: n, className: r, showCloseButton: i = !1, ...a }) {
|
|
675
|
+
return /* @__PURE__ */ Y(et, {
|
|
676
|
+
...a,
|
|
677
|
+
children: [/* @__PURE__ */ Y(ot, {
|
|
678
|
+
className: "sr-only",
|
|
679
|
+
children: [/* @__PURE__ */ J(ct, { children: e }), /* @__PURE__ */ J(lt, { children: t })]
|
|
680
|
+
}), /* @__PURE__ */ J(at, {
|
|
681
|
+
className: Z("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", r),
|
|
682
|
+
showCloseButton: i,
|
|
683
|
+
children: n
|
|
684
|
+
})]
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
function St({ className: e, ...t }) {
|
|
688
|
+
return /* @__PURE__ */ J("div", {
|
|
689
|
+
"data-slot": "command-input-wrapper",
|
|
690
|
+
className: "p-1 pb-0",
|
|
691
|
+
children: /* @__PURE__ */ Y(ft, {
|
|
692
|
+
className: "h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",
|
|
693
|
+
children: [/* @__PURE__ */ J(X.Input, {
|
|
694
|
+
"data-slot": "command-input",
|
|
695
|
+
className: Z("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
696
|
+
...t
|
|
697
|
+
}), /* @__PURE__ */ J(mt, { children: /* @__PURE__ */ J(N, { className: "size-4 shrink-0 opacity-50" }) })]
|
|
698
|
+
})
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
function Ct({ className: e, ...t }) {
|
|
702
|
+
return /* @__PURE__ */ J(X.List, {
|
|
703
|
+
"data-slot": "command-list",
|
|
704
|
+
className: Z("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", e),
|
|
705
|
+
...t
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
function wt({ className: e, ...t }) {
|
|
709
|
+
return /* @__PURE__ */ J(X.Empty, {
|
|
710
|
+
"data-slot": "command-empty",
|
|
711
|
+
className: Z("py-6 text-center text-sm", e),
|
|
712
|
+
...t
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
function Tt({ className: e, ...t }) {
|
|
716
|
+
return /* @__PURE__ */ J(X.Group, {
|
|
717
|
+
"data-slot": "command-group",
|
|
718
|
+
className: Z("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", e),
|
|
719
|
+
...t
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
function Et({ className: e, ...t }) {
|
|
723
|
+
return /* @__PURE__ */ J(X.Separator, {
|
|
724
|
+
"data-slot": "command-separator",
|
|
725
|
+
className: Z("-mx-1 h-px bg-border", e),
|
|
726
|
+
...t
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
function Dt({ className: e, children: t, ...n }) {
|
|
730
|
+
return /* @__PURE__ */ Y(X.Item, {
|
|
731
|
+
"data-slot": "command-item",
|
|
732
|
+
className: Z("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", e),
|
|
733
|
+
...n,
|
|
734
|
+
children: [t, /* @__PURE__ */ J(h, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })]
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
function Ot({ className: e, ...t }) {
|
|
738
|
+
return /* @__PURE__ */ J("span", {
|
|
739
|
+
"data-slot": "command-shortcut",
|
|
740
|
+
className: Z("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", e),
|
|
741
|
+
...t
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/components/ui/popover.tsx
|
|
746
|
+
function kt({ ...e }) {
|
|
747
|
+
return /* @__PURE__ */ J(B.Root, {
|
|
748
|
+
"data-slot": "popover",
|
|
749
|
+
...e
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
function At({ ...e }) {
|
|
753
|
+
return /* @__PURE__ */ J(B.Trigger, {
|
|
754
|
+
"data-slot": "popover-trigger",
|
|
755
|
+
...e
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
function jt({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
759
|
+
return /* @__PURE__ */ J(B.Portal, { children: /* @__PURE__ */ J(B.Content, {
|
|
760
|
+
"data-slot": "popover-content",
|
|
761
|
+
align: t,
|
|
762
|
+
sideOffset: n,
|
|
763
|
+
className: Z("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
764
|
+
...r
|
|
765
|
+
}) });
|
|
766
|
+
}
|
|
767
|
+
function Mt({ ...e }) {
|
|
768
|
+
return /* @__PURE__ */ J(B.Anchor, {
|
|
769
|
+
"data-slot": "popover-anchor",
|
|
770
|
+
...e
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
function Nt({ className: e, ...t }) {
|
|
774
|
+
return /* @__PURE__ */ J("div", {
|
|
775
|
+
"data-slot": "popover-header",
|
|
776
|
+
className: Z("flex flex-col gap-0.5 text-sm", e),
|
|
777
|
+
...t
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
function Pt({ className: e, ...t }) {
|
|
781
|
+
return /* @__PURE__ */ J("div", {
|
|
782
|
+
"data-slot": "popover-title",
|
|
783
|
+
className: Z("font-medium", e),
|
|
784
|
+
...t
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
function Ft({ className: e, ...t }) {
|
|
788
|
+
return /* @__PURE__ */ J("p", {
|
|
789
|
+
"data-slot": "popover-description",
|
|
790
|
+
className: Z("text-muted-foreground", e),
|
|
791
|
+
...t
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region src/components/custom/advanced-select.tsx
|
|
796
|
+
function It(e) {
|
|
797
|
+
return typeof e == "object" && !!e && "value" in e && "label" in e;
|
|
798
|
+
}
|
|
799
|
+
function Lt({ options: e = [], groups: t = [], value: r, onValueChange: i, placeholder: a = "Select option", disabled: o = !1, error: s = !1, errorMessage: c, multiple: l = !1, className: u, size: d = "default", variant: f = "default", searchable: p = !1, clearable: m = !1, getOptionLabel: g, getOptionValue: v, renderOptionLabel: y, label: b, description: x, required: S = !1, onCreateNew: C, createNewLabel: w = "New item", loading: T = !1, compactMultiple: E = !1, formatCompactDisplay: D, startItem: O, endItem: k, maxSelections: A, defaultOpen: te = !1, onOpenChange: j, onLoadMore: M, hasNextPage: ne = !1, isFetchingNextPage: N = !1, allowEmpty: ie = !1, showSelectAll: ae = !1, readOnly: P = !1, popoverClassName: F }) {
|
|
800
|
+
let [I, L] = n.useState(te), R = n.useRef(!1), z = n.useRef(null), se = n.useId(), B = n.useCallback((e) => {
|
|
801
|
+
P && e || (L(e), j?.(e), e && (R.current = !1));
|
|
802
|
+
}, [j, P]), [V, H] = n.useState(l ? Array.isArray(r) ? r : r ? [r] : [] : []);
|
|
803
|
+
n.useEffect(() => {
|
|
804
|
+
l && H(Array.isArray(r) ? r : r ? [r] : []);
|
|
805
|
+
}, [l, r]), n.useEffect(() => {
|
|
806
|
+
N || (R.current = !1);
|
|
807
|
+
}, [N]);
|
|
808
|
+
let U = n.useCallback((e) => typeof e == "string" ? e : v ? v(e) : It(e) ? e.value : String(e), [v]), ce = n.useCallback((n) => {
|
|
809
|
+
if (typeof n == "string") {
|
|
810
|
+
for (let e of t) {
|
|
811
|
+
let t = e.options.find((e) => e.value === n);
|
|
812
|
+
if (t) return t.label;
|
|
813
|
+
}
|
|
814
|
+
for (let t of e) if (typeof t == "string") {
|
|
815
|
+
if (t === n) return t;
|
|
816
|
+
} else if (It(t) && t.value === n) return t.label;
|
|
817
|
+
return n;
|
|
818
|
+
}
|
|
819
|
+
return g ? g(n) : It(n) ? n.label : String(n);
|
|
820
|
+
}, [
|
|
821
|
+
g,
|
|
822
|
+
t,
|
|
823
|
+
e
|
|
824
|
+
]), W = n.useMemo(() => l || !r ? "" : typeof r == "string" ? r : Array.isArray(r) ? "" : U(r), [
|
|
825
|
+
l,
|
|
826
|
+
r,
|
|
827
|
+
U
|
|
828
|
+
]), G = n.useMemo(() => e.map((e) => typeof e == "string" ? {
|
|
829
|
+
value: e,
|
|
830
|
+
label: e
|
|
831
|
+
} : It(e) ? e : {
|
|
832
|
+
value: U(e),
|
|
833
|
+
label: ce(e)
|
|
834
|
+
}), [
|
|
835
|
+
e,
|
|
836
|
+
ce,
|
|
837
|
+
U
|
|
838
|
+
]), le = n.useCallback((t) => e.find((e) => U(e) === t), [e, U]), K = n.useMemo(() => {
|
|
839
|
+
let e = [...G];
|
|
840
|
+
return t.forEach((t) => e.push(...t.options)), e;
|
|
841
|
+
}, [G, t]), ue = (n) => {
|
|
842
|
+
let r = e.find((e) => U(e) === n);
|
|
843
|
+
if (r === void 0 && t.length > 0) for (let e of t) {
|
|
844
|
+
let t = e.options.find((e) => e.value === n);
|
|
845
|
+
if (t) {
|
|
846
|
+
r = t;
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (l) {
|
|
851
|
+
let e = V.some((e) => U(e) === n);
|
|
852
|
+
if (!e && A && V.length >= A || e && V.length === 1 && !ie) return;
|
|
853
|
+
let t = e ? V.filter((e) => U(e) !== n) : [...V, r];
|
|
854
|
+
H(t), i?.(t);
|
|
855
|
+
} else i?.(r), L(!1);
|
|
856
|
+
}, de = l && K.length > 0 && K.length === V.length, q = () => {
|
|
857
|
+
if (l) {
|
|
858
|
+
if (de) {
|
|
859
|
+
ie && (H([]), i?.([]));
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
A && K.length > A || (H(K), i?.(K));
|
|
863
|
+
}
|
|
864
|
+
}, X = (e) => {
|
|
865
|
+
e.stopPropagation(), l ? (H([]), i?.([])) : i?.("");
|
|
866
|
+
}, pe = (e, t) => {
|
|
867
|
+
if (e.stopPropagation(), V.length === 1 && !ie) return;
|
|
868
|
+
let n = V.filter((e) => U(e) !== U(t));
|
|
869
|
+
H(n), i?.(n);
|
|
870
|
+
}, me = n.useCallback((e) => {
|
|
871
|
+
let t = e.currentTarget;
|
|
872
|
+
t.scrollHeight - t.scrollTop - t.clientHeight < 100 && M && ne && !N && !R.current && (R.current = !0, M());
|
|
873
|
+
}, [
|
|
874
|
+
M,
|
|
875
|
+
ne,
|
|
876
|
+
N
|
|
877
|
+
]), he = l ? V.length > 0 : !!W, ge = () => l ? null : K.find((e) => e.value === W)?.label || a, _e = () => {
|
|
878
|
+
!o && !P && (z.current?.focus(), L(!0));
|
|
879
|
+
}, ve = !!(O || k), ye = l && !E, be = ye ? d === "default" ? "min-h-9" : "min-h-7" : d === "default" ? "h-9" : "h-7", xe = f === "alt" ? "bg-muted" : "bg-transparent dark:bg-input/30", Se = /* @__PURE__ */ J("div", {
|
|
880
|
+
className: Z("flex min-w-0 flex-1 items-center gap-1.5", ye ? "py-1" : "overflow-hidden"),
|
|
881
|
+
children: l && V.length > 0 ? E ? /* @__PURE__ */ J("span", {
|
|
882
|
+
className: "min-w-0 truncate",
|
|
883
|
+
children: D ? D(V) : `${V.length} selected`
|
|
884
|
+
}) : /* @__PURE__ */ J("div", {
|
|
885
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
886
|
+
children: V.map((e, t) => /* @__PURE__ */ Y("span", {
|
|
887
|
+
className: "inline-flex items-center gap-1 rounded-sm bg-primary px-2 py-0.5 text-xs font-normal text-primary-foreground",
|
|
888
|
+
children: [ce(e), !o && /* @__PURE__ */ J("button", {
|
|
889
|
+
type: "button",
|
|
890
|
+
"aria-label": `Remove ${ce(e)}`,
|
|
891
|
+
onClick: (t) => pe(t, e),
|
|
892
|
+
className: "rounded-sm transition-colors hover:bg-primary/80",
|
|
893
|
+
children: /* @__PURE__ */ J(oe, { className: "size-3" })
|
|
894
|
+
})]
|
|
895
|
+
}, `${U(e)}-${t}`))
|
|
896
|
+
}) : /* @__PURE__ */ J("span", {
|
|
897
|
+
className: Z("block min-w-0 truncate", !he && "text-muted-foreground"),
|
|
898
|
+
children: ge() || a
|
|
899
|
+
})
|
|
900
|
+
}), Ce = /* @__PURE__ */ Y("div", {
|
|
901
|
+
className: "flex shrink-0 items-center gap-1",
|
|
902
|
+
children: [m && he && !o && /* @__PURE__ */ J("span", {
|
|
903
|
+
role: "button",
|
|
904
|
+
tabIndex: 0,
|
|
905
|
+
"aria-label": "Clear",
|
|
906
|
+
onClick: X,
|
|
907
|
+
onKeyDown: (e) => {
|
|
908
|
+
(e.key === "Enter" || e.key === " ") && (e.stopPropagation(), X(e));
|
|
909
|
+
},
|
|
910
|
+
className: "cursor-pointer rounded-sm p-0.5 transition-colors hover:bg-accent",
|
|
911
|
+
children: /* @__PURE__ */ J(oe, { className: "size-3.5" })
|
|
912
|
+
}), /* @__PURE__ */ J(_, {
|
|
913
|
+
size: 16,
|
|
914
|
+
className: "shrink-0 opacity-60",
|
|
915
|
+
"aria-hidden": !0
|
|
916
|
+
})]
|
|
917
|
+
}), we = (e) => {
|
|
918
|
+
let t = l ? V.some((t) => U(t) === e.value) : W === e.value, n = le(e.value);
|
|
919
|
+
return /* @__PURE__ */ Y(Dt, {
|
|
920
|
+
value: e.value,
|
|
921
|
+
onSelect: () => ue(e.value),
|
|
922
|
+
disabled: e.disabled,
|
|
923
|
+
children: [
|
|
924
|
+
l ? /* @__PURE__ */ J("div", {
|
|
925
|
+
className: Z("flex size-4 shrink-0 items-center justify-center rounded-sm border", t ? "border-primary bg-primary" : "border-input"),
|
|
926
|
+
children: t && /* @__PURE__ */ J(h, {
|
|
927
|
+
size: 12,
|
|
928
|
+
className: "text-primary-foreground"
|
|
929
|
+
})
|
|
930
|
+
}) : /* @__PURE__ */ J("div", {
|
|
931
|
+
className: "flex size-4 shrink-0 items-center justify-center",
|
|
932
|
+
children: t && /* @__PURE__ */ J(h, {
|
|
933
|
+
size: 16,
|
|
934
|
+
className: "text-primary"
|
|
935
|
+
})
|
|
936
|
+
}),
|
|
937
|
+
(e.icon || e.image) && /* @__PURE__ */ J("div", {
|
|
938
|
+
className: "flex size-4 shrink-0 items-center justify-center",
|
|
939
|
+
children: e.image ? /* @__PURE__ */ J("img", {
|
|
940
|
+
src: e.image,
|
|
941
|
+
alt: e.label,
|
|
942
|
+
className: "size-4 rounded-sm object-cover"
|
|
943
|
+
}) : e.icon
|
|
944
|
+
}),
|
|
945
|
+
/* @__PURE__ */ Y("div", {
|
|
946
|
+
className: "flex flex-1 items-center justify-between gap-2",
|
|
947
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
948
|
+
className: "flex flex-col gap-0.5",
|
|
949
|
+
children: [/* @__PURE__ */ J("span", {
|
|
950
|
+
className: "text-sm font-normal",
|
|
951
|
+
children: y && n ? y(n) : e.label
|
|
952
|
+
}), e.description && /* @__PURE__ */ J("span", {
|
|
953
|
+
className: "text-xs leading-snug text-muted-foreground",
|
|
954
|
+
children: e.description
|
|
955
|
+
})]
|
|
956
|
+
}), e.badge && /* @__PURE__ */ J("span", {
|
|
957
|
+
className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",
|
|
958
|
+
children: e.badge
|
|
959
|
+
})]
|
|
960
|
+
})
|
|
961
|
+
]
|
|
962
|
+
}, e.value);
|
|
963
|
+
}, Te = /* @__PURE__ */ J(jt, {
|
|
964
|
+
className: Z("w-(--radix-popper-anchor-width) min-w-(--radix-popper-anchor-width) p-0", F),
|
|
965
|
+
align: "start",
|
|
966
|
+
onOpenAutoFocus: (e) => {
|
|
967
|
+
p || e.preventDefault();
|
|
968
|
+
},
|
|
969
|
+
onWheel: (e) => e.stopPropagation(),
|
|
970
|
+
children: /* @__PURE__ */ Y(bt, { children: [p && /* @__PURE__ */ J(St, {
|
|
971
|
+
placeholder: `Search ${a.toLowerCase()}...`,
|
|
972
|
+
autoFocus: !0
|
|
973
|
+
}), /* @__PURE__ */ J(Ct, {
|
|
974
|
+
onScroll: me,
|
|
975
|
+
children: T ? /* @__PURE__ */ J("div", {
|
|
976
|
+
className: "flex items-center justify-center py-6",
|
|
977
|
+
children: /* @__PURE__ */ J(ee, { className: "size-5 animate-spin text-muted-foreground" })
|
|
978
|
+
}) : /* @__PURE__ */ Y(fe, { children: [
|
|
979
|
+
l && ae && K.length > 0 && /* @__PURE__ */ Y(fe, { children: [/* @__PURE__ */ J(Tt, { children: /* @__PURE__ */ Y(Dt, {
|
|
980
|
+
value: "__select_all__",
|
|
981
|
+
onSelect: q,
|
|
982
|
+
className: "font-medium",
|
|
983
|
+
children: [/* @__PURE__ */ J("div", {
|
|
984
|
+
className: Z("flex size-4 shrink-0 items-center justify-center rounded-sm border", de ? "border-primary bg-primary" : "border-input"),
|
|
985
|
+
children: de && /* @__PURE__ */ J(h, {
|
|
986
|
+
size: 12,
|
|
987
|
+
className: "text-primary-foreground"
|
|
988
|
+
})
|
|
989
|
+
}), /* @__PURE__ */ J("span", { children: "Select all" })]
|
|
990
|
+
}) }), /* @__PURE__ */ J(Et, {})] }),
|
|
991
|
+
/* @__PURE__ */ J(wt, { children: "No results found." }),
|
|
992
|
+
t.length > 0 ? t.map((e, t) => /* @__PURE__ */ Y(n.Fragment, { children: [t > 0 && /* @__PURE__ */ J(Et, {}), /* @__PURE__ */ J(Tt, {
|
|
993
|
+
heading: e.label,
|
|
994
|
+
children: e.options.map(we)
|
|
995
|
+
})] }, e.label)) : /* @__PURE__ */ J(Tt, { children: G.map(we) }),
|
|
996
|
+
C && /* @__PURE__ */ Y(fe, { children: [/* @__PURE__ */ J(Et, {}), /* @__PURE__ */ J(Tt, { children: /* @__PURE__ */ Y(Q, {
|
|
997
|
+
variant: "ghost",
|
|
998
|
+
className: "w-full justify-start font-normal",
|
|
999
|
+
onClick: () => {
|
|
1000
|
+
C(), L(!1);
|
|
1001
|
+
},
|
|
1002
|
+
children: [/* @__PURE__ */ J(re, {
|
|
1003
|
+
size: 16,
|
|
1004
|
+
className: "-ms-1 opacity-60",
|
|
1005
|
+
"aria-hidden": !0
|
|
1006
|
+
}), w]
|
|
1007
|
+
}) })] }),
|
|
1008
|
+
N && /* @__PURE__ */ J("div", {
|
|
1009
|
+
className: "flex items-center justify-center py-3",
|
|
1010
|
+
children: /* @__PURE__ */ J(ee, { className: "size-4 animate-spin text-muted-foreground" })
|
|
1011
|
+
})
|
|
1012
|
+
] })
|
|
1013
|
+
})] })
|
|
1014
|
+
}), Ee = S ? /* @__PURE__ */ J("span", {
|
|
1015
|
+
"aria-hidden": !0,
|
|
1016
|
+
className: "ml-0.5 text-destructive",
|
|
1017
|
+
children: "*"
|
|
1018
|
+
}) : null;
|
|
1019
|
+
return /* @__PURE__ */ Y("div", {
|
|
1020
|
+
className: "space-y-1.5",
|
|
1021
|
+
children: [
|
|
1022
|
+
b && /* @__PURE__ */ Y(qe, {
|
|
1023
|
+
htmlFor: se,
|
|
1024
|
+
onClick: _e,
|
|
1025
|
+
className: Z("cursor-pointer", o && "text-muted-foreground"),
|
|
1026
|
+
children: [b, Ee]
|
|
1027
|
+
}),
|
|
1028
|
+
ve ? /* @__PURE__ */ Y(kt, {
|
|
1029
|
+
open: I,
|
|
1030
|
+
onOpenChange: B,
|
|
1031
|
+
modal: !1,
|
|
1032
|
+
children: [/* @__PURE__ */ J(At, {
|
|
1033
|
+
asChild: !0,
|
|
1034
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1035
|
+
"aria-invalid": s,
|
|
1036
|
+
className: Z("flex rounded-md border border-input transition-colors", ye ? "items-stretch" : "items-center overflow-hidden", xe, be, I && "border-ring ring-3 ring-ring/50", "aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-3 aria-[invalid=true]:ring-destructive/20", o && "pointer-events-none cursor-not-allowed opacity-50"),
|
|
1037
|
+
children: [
|
|
1038
|
+
O && /* @__PURE__ */ J("div", {
|
|
1039
|
+
className: "flex h-full shrink-0 items-center justify-center border-r border-input bg-muted/40 px-3 text-sm text-muted-foreground [&_svg]:size-4",
|
|
1040
|
+
children: O
|
|
1041
|
+
}),
|
|
1042
|
+
/* @__PURE__ */ Y(Q, {
|
|
1043
|
+
id: se,
|
|
1044
|
+
type: "button",
|
|
1045
|
+
disabled: o,
|
|
1046
|
+
ref: z,
|
|
1047
|
+
variant: "ghost",
|
|
1048
|
+
role: "combobox",
|
|
1049
|
+
"aria-expanded": I,
|
|
1050
|
+
onClick: (e) => {
|
|
1051
|
+
P && (e.preventDefault(), e.stopPropagation());
|
|
1052
|
+
},
|
|
1053
|
+
className: Z("h-full flex-1 justify-between rounded-none border-0 px-3 py-1 font-normal text-foreground shadow-none hover:bg-transparent focus-visible:ring-0", ye ? "items-start" : "items-center", u),
|
|
1054
|
+
children: [Se, Ce]
|
|
1055
|
+
}),
|
|
1056
|
+
k && /* @__PURE__ */ J("div", {
|
|
1057
|
+
className: "flex h-full shrink-0 items-center justify-center border-l border-input bg-muted/40 px-3 text-sm text-foreground [&_svg]:size-4",
|
|
1058
|
+
children: k
|
|
1059
|
+
})
|
|
1060
|
+
]
|
|
1061
|
+
})
|
|
1062
|
+
}), Te]
|
|
1063
|
+
}) : /* @__PURE__ */ Y(kt, {
|
|
1064
|
+
open: I,
|
|
1065
|
+
onOpenChange: B,
|
|
1066
|
+
modal: !1,
|
|
1067
|
+
children: [/* @__PURE__ */ J(At, {
|
|
1068
|
+
asChild: !0,
|
|
1069
|
+
children: /* @__PURE__ */ Y(Q, {
|
|
1070
|
+
id: se,
|
|
1071
|
+
type: "button",
|
|
1072
|
+
disabled: o,
|
|
1073
|
+
ref: z,
|
|
1074
|
+
variant: "outline",
|
|
1075
|
+
role: "combobox",
|
|
1076
|
+
"aria-expanded": I,
|
|
1077
|
+
"aria-invalid": s,
|
|
1078
|
+
onClick: (e) => {
|
|
1079
|
+
P && (e.preventDefault(), e.stopPropagation());
|
|
1080
|
+
},
|
|
1081
|
+
className: Z("h-auto w-full justify-between px-3 py-1 font-normal text-foreground", be, ye ? "items-start" : "items-center", xe, I && "border-ring ring-3 ring-ring/50", u),
|
|
1082
|
+
children: [Se, Ce]
|
|
1083
|
+
})
|
|
1084
|
+
}), Te]
|
|
1085
|
+
}),
|
|
1086
|
+
s && c && /* @__PURE__ */ J("p", {
|
|
1087
|
+
className: "text-xs leading-5 text-destructive",
|
|
1088
|
+
children: c
|
|
1089
|
+
}),
|
|
1090
|
+
x && /* @__PURE__ */ J(Ye, { children: x })
|
|
1091
|
+
]
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region src/components/ui/checkbox.tsx
|
|
1096
|
+
function Rt({ className: e, ...t }) {
|
|
1097
|
+
return /* @__PURE__ */ J(I.Root, {
|
|
1098
|
+
"data-slot": "checkbox",
|
|
1099
|
+
className: Z("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", e),
|
|
1100
|
+
...t,
|
|
1101
|
+
children: /* @__PURE__ */ J(I.Indicator, {
|
|
1102
|
+
"data-slot": "checkbox-indicator",
|
|
1103
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
1104
|
+
children: /* @__PURE__ */ J(h, {})
|
|
1105
|
+
})
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
//#endregion
|
|
1109
|
+
//#region src/components/ui/table.tsx
|
|
1110
|
+
function zt({ className: e, ...t }) {
|
|
1111
|
+
return /* @__PURE__ */ J("div", {
|
|
1112
|
+
"data-slot": "table-container",
|
|
1113
|
+
className: "relative w-full overflow-x-auto",
|
|
1114
|
+
children: /* @__PURE__ */ J("table", {
|
|
1115
|
+
"data-slot": "table",
|
|
1116
|
+
className: Z("w-full caption-bottom text-sm", e),
|
|
1117
|
+
...t
|
|
1118
|
+
})
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
function Bt({ className: e, ...t }) {
|
|
1122
|
+
return /* @__PURE__ */ J("thead", {
|
|
1123
|
+
"data-slot": "table-header",
|
|
1124
|
+
className: Z("[&_tr]:border-b", e),
|
|
1125
|
+
...t
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
function Vt({ className: e, ...t }) {
|
|
1129
|
+
return /* @__PURE__ */ J("tbody", {
|
|
1130
|
+
"data-slot": "table-body",
|
|
1131
|
+
className: Z("[&_tr:last-child]:border-0", e),
|
|
1132
|
+
...t
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
function Ht({ className: e, ...t }) {
|
|
1136
|
+
return /* @__PURE__ */ J("tfoot", {
|
|
1137
|
+
"data-slot": "table-footer",
|
|
1138
|
+
className: Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", e),
|
|
1139
|
+
...t
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
function Ut({ className: e, ...t }) {
|
|
1143
|
+
return /* @__PURE__ */ J("tr", {
|
|
1144
|
+
"data-slot": "table-row",
|
|
1145
|
+
className: Z("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", e),
|
|
1146
|
+
...t
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
function Wt({ className: e, ...t }) {
|
|
1150
|
+
return /* @__PURE__ */ J("th", {
|
|
1151
|
+
"data-slot": "table-head",
|
|
1152
|
+
className: Z("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", e),
|
|
1153
|
+
...t
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
function Gt({ className: e, ...t }) {
|
|
1157
|
+
return /* @__PURE__ */ J("td", {
|
|
1158
|
+
"data-slot": "table-cell",
|
|
1159
|
+
className: Z("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", e),
|
|
1160
|
+
...t
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
function Kt({ className: e, ...t }) {
|
|
1164
|
+
return /* @__PURE__ */ J("caption", {
|
|
1165
|
+
"data-slot": "table-caption",
|
|
1166
|
+
className: Z("mt-4 text-sm text-muted-foreground", e),
|
|
1167
|
+
...t
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region src/components/ui/spinner.tsx
|
|
1172
|
+
function qt({ className: e, ...t }) {
|
|
1173
|
+
return /* @__PURE__ */ J(D, {
|
|
1174
|
+
role: "status",
|
|
1175
|
+
"aria-label": "Loading",
|
|
1176
|
+
className: Z("size-4 animate-spin", e),
|
|
1177
|
+
...t
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
//#endregion
|
|
1181
|
+
//#region src/components/custom/data-table.tsx
|
|
1182
|
+
var Jt = {
|
|
1183
|
+
left: "text-left",
|
|
1184
|
+
center: "text-center",
|
|
1185
|
+
right: "text-right"
|
|
1186
|
+
};
|
|
1187
|
+
function Yt({ columns: e, data: t, getRowId: r = (e, t) => String(t), selectable: i = !1, selectedIds: a, onSelectionChange: o, rowActions: s, loading: c = !1, emptyMessage: l = "No results.", striped: u = !0, stickyHeader: d = !1, maxHeight: f, onRowClick: p, className: m }) {
|
|
1188
|
+
let h = n.useMemo(() => t.map((e, t) => r(e, t)), [t, r]), [g, _] = n.useState([]), v = a ?? g, y = (e) => {
|
|
1189
|
+
a === void 0 && _(e), o?.(e);
|
|
1190
|
+
}, b = h.length > 0 && h.every((e) => v.includes(e)), x = v.length > 0 && !b, S = () => y(b ? [] : h), C = (e) => y(v.includes(e) ? v.filter((t) => t !== e) : [...v, e]), w = e.length + +!!i + +!!s, T = "px-4 py-3 first:pl-5 last:pr-5", E = "px-4 first:pl-5 last:pr-5";
|
|
1191
|
+
return /* @__PURE__ */ J("div", {
|
|
1192
|
+
className: Z("rounded-lg border", f === void 0 ? "overflow-hidden" : "overflow-auto", m),
|
|
1193
|
+
style: f === void 0 ? void 0 : { maxHeight: typeof f == "number" ? `${f}px` : f },
|
|
1194
|
+
children: /* @__PURE__ */ Y(zt, { children: [/* @__PURE__ */ J(Bt, {
|
|
1195
|
+
className: Z("bg-muted/60", d && "sticky top-0 z-10 [&_th]:bg-muted/95 [&_th]:backdrop-blur supports-backdrop-filter:[&_th]:bg-muted/80"),
|
|
1196
|
+
children: /* @__PURE__ */ Y(Ut, {
|
|
1197
|
+
className: "hover:bg-transparent",
|
|
1198
|
+
children: [
|
|
1199
|
+
i && /* @__PURE__ */ J(Wt, {
|
|
1200
|
+
className: Z("w-10", E),
|
|
1201
|
+
children: /* @__PURE__ */ J(Rt, {
|
|
1202
|
+
"aria-label": "Select all rows",
|
|
1203
|
+
checked: b ? !0 : x ? "indeterminate" : !1,
|
|
1204
|
+
onCheckedChange: S
|
|
1205
|
+
})
|
|
1206
|
+
}),
|
|
1207
|
+
e.map((e) => /* @__PURE__ */ J(Wt, {
|
|
1208
|
+
style: e.width ? { width: e.width } : void 0,
|
|
1209
|
+
className: Z("h-11 text-xs font-semibold tracking-wide text-foreground uppercase", E, e.align && Jt[e.align], e.className, e.headerClassName),
|
|
1210
|
+
children: e.header
|
|
1211
|
+
}, e.key)),
|
|
1212
|
+
s && /* @__PURE__ */ J(Wt, { className: "w-12" })
|
|
1213
|
+
]
|
|
1214
|
+
})
|
|
1215
|
+
}), /* @__PURE__ */ J(Vt, { children: c ? /* @__PURE__ */ J(Ut, {
|
|
1216
|
+
className: "hover:bg-transparent",
|
|
1217
|
+
children: /* @__PURE__ */ J(Gt, {
|
|
1218
|
+
colSpan: w,
|
|
1219
|
+
className: "h-28 text-center",
|
|
1220
|
+
children: /* @__PURE__ */ Y("span", {
|
|
1221
|
+
className: "inline-flex items-center gap-2 text-muted-foreground",
|
|
1222
|
+
children: [/* @__PURE__ */ J(qt, { className: "size-4" }), " Loading…"]
|
|
1223
|
+
})
|
|
1224
|
+
})
|
|
1225
|
+
}) : t.length === 0 ? /* @__PURE__ */ J(Ut, {
|
|
1226
|
+
className: "hover:bg-transparent",
|
|
1227
|
+
children: /* @__PURE__ */ J(Gt, {
|
|
1228
|
+
colSpan: w,
|
|
1229
|
+
className: "h-28 text-center text-muted-foreground",
|
|
1230
|
+
children: l
|
|
1231
|
+
})
|
|
1232
|
+
}) : t.map((t, n) => {
|
|
1233
|
+
let r = h[n], a = v.includes(r);
|
|
1234
|
+
return /* @__PURE__ */ Y(Ut, {
|
|
1235
|
+
"data-state": a ? "selected" : void 0,
|
|
1236
|
+
onClick: p ? () => p(t) : void 0,
|
|
1237
|
+
className: Z(u && !a && "odd:bg-muted/40", a && "bg-primary/10 shadow-[inset_3px_0_0_0_var(--primary)] hover:bg-primary/15", p && "cursor-pointer"),
|
|
1238
|
+
children: [
|
|
1239
|
+
i && /* @__PURE__ */ J(Gt, {
|
|
1240
|
+
className: Z("w-10", T),
|
|
1241
|
+
onClick: (e) => e.stopPropagation(),
|
|
1242
|
+
children: /* @__PURE__ */ J(Rt, {
|
|
1243
|
+
"aria-label": "Select row",
|
|
1244
|
+
checked: a,
|
|
1245
|
+
onCheckedChange: () => C(r)
|
|
1246
|
+
})
|
|
1247
|
+
}),
|
|
1248
|
+
e.map((e) => /* @__PURE__ */ J(Gt, {
|
|
1249
|
+
style: e.width ? { width: e.width } : void 0,
|
|
1250
|
+
className: Z(T, e.align && Jt[e.align], e.className),
|
|
1251
|
+
children: e.cell ? e.cell(t, n) : String(t[e.key] ?? "")
|
|
1252
|
+
}, e.key)),
|
|
1253
|
+
s && /* @__PURE__ */ J(Gt, {
|
|
1254
|
+
className: "w-12 pr-3 text-right",
|
|
1255
|
+
onClick: (e) => e.stopPropagation(),
|
|
1256
|
+
children: /* @__PURE__ */ J(Re, { items: s(t) })
|
|
1257
|
+
})
|
|
1258
|
+
]
|
|
1259
|
+
}, r);
|
|
1260
|
+
}) })] })
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
//#endregion
|
|
1264
|
+
//#region src/components/ui/calendar.tsx
|
|
1265
|
+
function Xt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", locale: a, formatters: o, components: s, ...c }) {
|
|
1266
|
+
let l = me();
|
|
1267
|
+
return /* @__PURE__ */ J(pe, {
|
|
1268
|
+
showOutsideDays: n,
|
|
1269
|
+
className: Z("group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
|
|
1270
|
+
captionLayout: r,
|
|
1271
|
+
locale: a,
|
|
1272
|
+
formatters: {
|
|
1273
|
+
formatMonthDropdown: (e) => e.toLocaleString(a?.code, { month: "short" }),
|
|
1274
|
+
...o
|
|
1275
|
+
},
|
|
1276
|
+
classNames: {
|
|
1277
|
+
root: Z("w-fit", l.root),
|
|
1278
|
+
months: Z("relative flex flex-col gap-4 md:flex-row", l.months),
|
|
1279
|
+
month: Z("flex w-full flex-col gap-4", l.month),
|
|
1280
|
+
nav: Z("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", l.nav),
|
|
1281
|
+
button_previous: Z(be({ variant: i }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", l.button_previous),
|
|
1282
|
+
button_next: Z(be({ variant: i }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", l.button_next),
|
|
1283
|
+
month_caption: Z("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", l.month_caption),
|
|
1284
|
+
dropdowns: Z("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", l.dropdowns),
|
|
1285
|
+
dropdown_root: Z("relative rounded-(--cell-radius)", l.dropdown_root),
|
|
1286
|
+
dropdown: Z("absolute inset-0 bg-popover opacity-0", l.dropdown),
|
|
1287
|
+
caption_label: Z("font-medium select-none", r === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", l.caption_label),
|
|
1288
|
+
table: "w-full border-collapse",
|
|
1289
|
+
weekdays: Z("flex", l.weekdays),
|
|
1290
|
+
weekday: Z("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", l.weekday),
|
|
1291
|
+
week: Z("mt-2 flex w-full", l.week),
|
|
1292
|
+
week_number_header: Z("w-(--cell-size) select-none", l.week_number_header),
|
|
1293
|
+
week_number: Z("text-[0.8rem] text-muted-foreground select-none", l.week_number),
|
|
1294
|
+
day: Z("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", c.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", l.day),
|
|
1295
|
+
range_start: Z("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", l.range_start),
|
|
1296
|
+
range_middle: Z("rounded-none", l.range_middle),
|
|
1297
|
+
range_end: Z("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", l.range_end),
|
|
1298
|
+
today: Z("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", l.today),
|
|
1299
|
+
outside: Z("text-muted-foreground aria-selected:text-muted-foreground", l.outside),
|
|
1300
|
+
disabled: Z("text-muted-foreground opacity-50", l.disabled),
|
|
1301
|
+
hidden: Z("invisible", l.hidden),
|
|
1302
|
+
...t
|
|
1303
|
+
},
|
|
1304
|
+
components: {
|
|
1305
|
+
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ J("div", {
|
|
1306
|
+
"data-slot": "calendar",
|
|
1307
|
+
ref: t,
|
|
1308
|
+
className: Z(e),
|
|
1309
|
+
...n
|
|
1310
|
+
}),
|
|
1311
|
+
Chevron: ({ className: e, orientation: t, ...n }) => J(t === "left" ? v : t === "right" ? y : _, {
|
|
1312
|
+
className: Z("size-4", e),
|
|
1313
|
+
...n
|
|
1314
|
+
}),
|
|
1315
|
+
DayButton: ({ ...e }) => /* @__PURE__ */ J(Zt, {
|
|
1316
|
+
locale: a,
|
|
1317
|
+
...e
|
|
1318
|
+
}),
|
|
1319
|
+
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ J("td", {
|
|
1320
|
+
...t,
|
|
1321
|
+
children: /* @__PURE__ */ J("div", {
|
|
1322
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
1323
|
+
children: e
|
|
1324
|
+
})
|
|
1325
|
+
}),
|
|
1326
|
+
...s
|
|
1327
|
+
},
|
|
1328
|
+
...c
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
function Zt({ className: e, day: t, modifiers: r, locale: i, ...a }) {
|
|
1332
|
+
let o = me(), s = n.useRef(null);
|
|
1333
|
+
return n.useEffect(() => {
|
|
1334
|
+
r.focused && s.current?.focus();
|
|
1335
|
+
}, [r.focused]), /* @__PURE__ */ J(Q, {
|
|
1336
|
+
ref: s,
|
|
1337
|
+
variant: "ghost",
|
|
1338
|
+
size: "icon",
|
|
1339
|
+
"data-day": t.date.toLocaleDateString(i?.code),
|
|
1340
|
+
"data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
|
|
1341
|
+
"data-range-start": r.range_start,
|
|
1342
|
+
"data-range-end": r.range_end,
|
|
1343
|
+
"data-range-middle": r.range_middle,
|
|
1344
|
+
className: Z("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", o.day, e),
|
|
1345
|
+
...a
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
//#endregion
|
|
1349
|
+
//#region src/components/custom/date-time-range-picker-utils.ts
|
|
1350
|
+
function Qt(e) {
|
|
1351
|
+
return `${e.getUTCFullYear()}-${String(e.getUTCMonth() + 1).padStart(2, "0")}-${String(e.getUTCDate()).padStart(2, "0")}T${String(e.getUTCHours()).padStart(2, "0")}:${String(e.getUTCMinutes()).padStart(2, "0")}:${String(e.getUTCSeconds()).padStart(2, "0")}Z`;
|
|
1352
|
+
}
|
|
1353
|
+
function $t(e, t) {
|
|
1354
|
+
if (!e) return null;
|
|
1355
|
+
let n = new Date(e);
|
|
1356
|
+
if (isNaN(n.getTime())) return null;
|
|
1357
|
+
let r = new Intl.DateTimeFormat("en-US", {
|
|
1358
|
+
year: "numeric",
|
|
1359
|
+
month: "2-digit",
|
|
1360
|
+
day: "2-digit",
|
|
1361
|
+
hour: "2-digit",
|
|
1362
|
+
minute: "2-digit",
|
|
1363
|
+
second: "2-digit",
|
|
1364
|
+
hour12: !1,
|
|
1365
|
+
timeZone: t
|
|
1366
|
+
}).formatToParts(n), i = (e) => r.find((t) => t.type === e)?.value || "0";
|
|
1367
|
+
return {
|
|
1368
|
+
year: parseInt(i("year"), 10),
|
|
1369
|
+
month: parseInt(i("month"), 10) - 1,
|
|
1370
|
+
day: parseInt(i("day"), 10),
|
|
1371
|
+
h: i("hour").padStart(2, "0"),
|
|
1372
|
+
m: i("minute").padStart(2, "0"),
|
|
1373
|
+
s: i("second").padStart(2, "0")
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
function en(e, t, n, r, i, a, o) {
|
|
1377
|
+
let s = Date.UTC(e, t, n, parseInt(r), parseInt(i), parseInt(a)), c = new Date(s), l = new Intl.DateTimeFormat("en-US", {
|
|
1378
|
+
year: "numeric",
|
|
1379
|
+
month: "2-digit",
|
|
1380
|
+
day: "2-digit",
|
|
1381
|
+
hour: "2-digit",
|
|
1382
|
+
minute: "2-digit",
|
|
1383
|
+
second: "2-digit",
|
|
1384
|
+
hour12: !1,
|
|
1385
|
+
timeZone: o
|
|
1386
|
+
}).formatToParts(c), u = (e) => parseInt(l.find((t) => t.type === e)?.value || "0", 10), d = Date.UTC(u("year"), u("month") - 1, u("day"), u("hour"), u("minute"), u("second")) - s;
|
|
1387
|
+
return Qt(new Date(s - d));
|
|
1388
|
+
}
|
|
1389
|
+
var tn = [
|
|
1390
|
+
{
|
|
1391
|
+
value: "hour",
|
|
1392
|
+
label: "Hour"
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
value: "day",
|
|
1396
|
+
label: "Day"
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
value: "week",
|
|
1400
|
+
label: "Week"
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
value: "month",
|
|
1404
|
+
label: "Month"
|
|
1405
|
+
}
|
|
1406
|
+
];
|
|
1407
|
+
function nn(e) {
|
|
1408
|
+
let t = /* @__PURE__ */ new Date(), n = Qt(t), r = new Date(t);
|
|
1409
|
+
switch (e) {
|
|
1410
|
+
case "hour":
|
|
1411
|
+
r.setUTCHours(r.getUTCHours() - 1);
|
|
1412
|
+
break;
|
|
1413
|
+
case "day":
|
|
1414
|
+
r.setUTCHours(r.getUTCHours() - 24);
|
|
1415
|
+
break;
|
|
1416
|
+
case "week":
|
|
1417
|
+
r.setUTCDate(r.getUTCDate() - 7);
|
|
1418
|
+
break;
|
|
1419
|
+
case "month":
|
|
1420
|
+
r.setUTCDate(r.getUTCDate() - 30);
|
|
1421
|
+
break;
|
|
1422
|
+
}
|
|
1423
|
+
return {
|
|
1424
|
+
from: Qt(r),
|
|
1425
|
+
to: n
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
function rn(e, t) {
|
|
1429
|
+
let n = new Date(e.from).getTime(), r = new Date(e.to).getTime(), i = r - n, a = t === "prev" ? -i : i;
|
|
1430
|
+
return {
|
|
1431
|
+
preset: e.preset,
|
|
1432
|
+
from: Qt(new Date(n + a)),
|
|
1433
|
+
to: Qt(new Date(r + a))
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
function an(e, t) {
|
|
1437
|
+
if (e.preset) return tn.find((t) => t.value === e.preset)?.label ?? e.preset;
|
|
1438
|
+
if (e.from && e.to) {
|
|
1439
|
+
let n = (e) => new Date(e).toLocaleString("en-US", {
|
|
1440
|
+
year: "numeric",
|
|
1441
|
+
month: "short",
|
|
1442
|
+
day: "2-digit",
|
|
1443
|
+
hour: "2-digit",
|
|
1444
|
+
minute: "2-digit",
|
|
1445
|
+
hour12: !1,
|
|
1446
|
+
timeZone: t || "UTC"
|
|
1447
|
+
});
|
|
1448
|
+
return `${n(e.from)} – ${n(e.to)}`;
|
|
1449
|
+
}
|
|
1450
|
+
return "Select range";
|
|
1451
|
+
}
|
|
1452
|
+
//#endregion
|
|
1453
|
+
//#region src/components/custom/date-time-range-picker.tsx
|
|
1454
|
+
function on({ value: e, max: t, onChange: r }) {
|
|
1455
|
+
let [i, a] = n.useState(e);
|
|
1456
|
+
n.useEffect(() => {
|
|
1457
|
+
a(e);
|
|
1458
|
+
}, [e]);
|
|
1459
|
+
let o = (e) => {
|
|
1460
|
+
let n = Math.min(Math.max(0, parseInt(e || "0", 10)), t), i = isNaN(n) ? "00" : String(n).padStart(2, "0");
|
|
1461
|
+
a(i), r(i);
|
|
1462
|
+
}, s = (e) => {
|
|
1463
|
+
let n = Math.min(Math.max(parseInt(i || "0", 10) + e, 0), t), o = String(n).padStart(2, "0");
|
|
1464
|
+
a(o), r(o);
|
|
1465
|
+
};
|
|
1466
|
+
return /* @__PURE__ */ J("input", {
|
|
1467
|
+
type: "number",
|
|
1468
|
+
min: 0,
|
|
1469
|
+
max: t,
|
|
1470
|
+
value: i,
|
|
1471
|
+
onChange: (e) => a(e.target.value),
|
|
1472
|
+
onBlur: (e) => o(e.target.value),
|
|
1473
|
+
onKeyDown: (e) => {
|
|
1474
|
+
e.key === "Enter" && o(e.target.value), e.key === "ArrowUp" && (e.preventDefault(), s(1)), e.key === "ArrowDown" && (e.preventDefault(), s(-1));
|
|
1475
|
+
},
|
|
1476
|
+
className: Z("h-8 w-12 rounded-md border border-input bg-transparent text-center text-sm font-medium dark:bg-input/30", "focus:border-ring focus:ring-3 focus:ring-ring/50 focus:outline-none", "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none")
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
function sn({ isoValue: e, onChange: t, label: r, placeholder: i = "Select date & time", timezone: a, minDate: o, maxDate: s }) {
|
|
1480
|
+
let [c, l] = n.useState(!1), u = a || "UTC", d = $t(e, u), [f, m] = n.useState(d?.h ?? "00"), [h, g] = n.useState(d?.m ?? "00"), [_, v] = n.useState(d?.s ?? "00");
|
|
1481
|
+
n.useEffect(() => {
|
|
1482
|
+
let t = $t(e, u);
|
|
1483
|
+
m(t?.h ?? "00"), g(t?.m ?? "00"), v(t?.s ?? "00");
|
|
1484
|
+
}, [e, u]);
|
|
1485
|
+
let y = d ? new Date(d.year, d.month, d.day) : void 0, b = (e, n, r, i, a, o) => t(en(e, n, r, i, a, o, u)), x = (e) => {
|
|
1486
|
+
e && b(e.getFullYear(), e.getMonth(), e.getDate(), f, h, _);
|
|
1487
|
+
}, C = (e, t) => {
|
|
1488
|
+
let n = e === "h" ? t : f, r = e === "m" ? t : h, i = e === "s" ? t : _;
|
|
1489
|
+
e === "h" && m(t), e === "m" && g(t), e === "s" && v(t), d && b(d.year, d.month, d.day, n, r, i);
|
|
1490
|
+
}, w = (e) => {
|
|
1491
|
+
if (o) {
|
|
1492
|
+
let t = new Date(o);
|
|
1493
|
+
if (t.setHours(0, 0, 0, 0), e < t) return !0;
|
|
1494
|
+
}
|
|
1495
|
+
if (s) {
|
|
1496
|
+
let t = new Date(s);
|
|
1497
|
+
if (t.setHours(23, 59, 59, 999), e > t) return !0;
|
|
1498
|
+
}
|
|
1499
|
+
return !1;
|
|
1500
|
+
}, T = d ? new Date(e).toLocaleString("en-US", {
|
|
1501
|
+
year: "numeric",
|
|
1502
|
+
month: "short",
|
|
1503
|
+
day: "2-digit",
|
|
1504
|
+
hour: "2-digit",
|
|
1505
|
+
minute: "2-digit",
|
|
1506
|
+
second: "2-digit",
|
|
1507
|
+
hour12: !1,
|
|
1508
|
+
timeZone: u
|
|
1509
|
+
}) : i;
|
|
1510
|
+
return /* @__PURE__ */ Y("div", {
|
|
1511
|
+
className: "flex flex-col gap-1",
|
|
1512
|
+
children: [/* @__PURE__ */ J("label", {
|
|
1513
|
+
className: "px-0.5 text-xs text-muted-foreground",
|
|
1514
|
+
children: r
|
|
1515
|
+
}), /* @__PURE__ */ Y(kt, {
|
|
1516
|
+
open: c,
|
|
1517
|
+
onOpenChange: l,
|
|
1518
|
+
modal: !1,
|
|
1519
|
+
children: [/* @__PURE__ */ J(At, {
|
|
1520
|
+
asChild: !0,
|
|
1521
|
+
children: /* @__PURE__ */ Y("button", {
|
|
1522
|
+
type: "button",
|
|
1523
|
+
className: Z("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors outline-none dark:bg-input/30", "hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", c && "border-ring ring-3 ring-ring/50", !d && "text-muted-foreground"),
|
|
1524
|
+
children: [/* @__PURE__ */ J("span", {
|
|
1525
|
+
className: "truncate",
|
|
1526
|
+
children: T
|
|
1527
|
+
}), /* @__PURE__ */ J(p, { className: "size-3.5 shrink-0 opacity-60" })]
|
|
1528
|
+
})
|
|
1529
|
+
}), /* @__PURE__ */ Y(jt, {
|
|
1530
|
+
className: "w-auto p-0",
|
|
1531
|
+
align: "start",
|
|
1532
|
+
sideOffset: 4,
|
|
1533
|
+
children: [/* @__PURE__ */ J(Xt, {
|
|
1534
|
+
mode: "single",
|
|
1535
|
+
selected: y,
|
|
1536
|
+
onSelect: x,
|
|
1537
|
+
disabled: w,
|
|
1538
|
+
defaultMonth: y,
|
|
1539
|
+
autoFocus: !0
|
|
1540
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1541
|
+
className: "flex items-center gap-2 border-t px-3 py-2.5",
|
|
1542
|
+
children: [
|
|
1543
|
+
/* @__PURE__ */ J(S, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1544
|
+
/* @__PURE__ */ J(on, {
|
|
1545
|
+
value: f,
|
|
1546
|
+
max: 23,
|
|
1547
|
+
onChange: (e) => C("h", e)
|
|
1548
|
+
}),
|
|
1549
|
+
/* @__PURE__ */ J("span", {
|
|
1550
|
+
className: "text-sm font-medium text-muted-foreground",
|
|
1551
|
+
children: ":"
|
|
1552
|
+
}),
|
|
1553
|
+
/* @__PURE__ */ J(on, {
|
|
1554
|
+
value: h,
|
|
1555
|
+
max: 59,
|
|
1556
|
+
onChange: (e) => C("m", e)
|
|
1557
|
+
}),
|
|
1558
|
+
/* @__PURE__ */ J("span", {
|
|
1559
|
+
className: "text-sm font-medium text-muted-foreground",
|
|
1560
|
+
children: ":"
|
|
1561
|
+
}),
|
|
1562
|
+
/* @__PURE__ */ J(on, {
|
|
1563
|
+
value: _,
|
|
1564
|
+
max: 59,
|
|
1565
|
+
onChange: (e) => C("s", e)
|
|
1566
|
+
})
|
|
1567
|
+
]
|
|
1568
|
+
})]
|
|
1569
|
+
})]
|
|
1570
|
+
})]
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
var cn = n.forwardRef(function({ value: e, onChange: t, className: r, timezone: i, presets: a, maxRangeDays: o }, s) {
|
|
1574
|
+
let c = a ?? tn, [l, u] = n.useState(!1), [d, f] = n.useState(e.from), [m, h] = n.useState(e.to);
|
|
1575
|
+
n.useEffect(() => {
|
|
1576
|
+
f(e.from), h(e.to);
|
|
1577
|
+
}, [e]);
|
|
1578
|
+
let _ = (e) => {
|
|
1579
|
+
if (f(e), o && e) {
|
|
1580
|
+
let t = new Date(new Date(e).getTime() + o * 864e5);
|
|
1581
|
+
new Date(m) > t && h(t.toISOString());
|
|
1582
|
+
}
|
|
1583
|
+
}, v = (e) => {
|
|
1584
|
+
t({
|
|
1585
|
+
preset: e,
|
|
1586
|
+
...nn(e)
|
|
1587
|
+
}), u(!1);
|
|
1588
|
+
};
|
|
1589
|
+
return /* @__PURE__ */ Y(kt, {
|
|
1590
|
+
open: l,
|
|
1591
|
+
onOpenChange: u,
|
|
1592
|
+
children: [/* @__PURE__ */ J(At, {
|
|
1593
|
+
asChild: !0,
|
|
1594
|
+
children: /* @__PURE__ */ Y("button", {
|
|
1595
|
+
ref: s,
|
|
1596
|
+
type: "button",
|
|
1597
|
+
className: Z("flex h-9 items-center justify-between gap-1.5 rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors outline-none dark:bg-input/30", "hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", l && "border-ring ring-3 ring-ring/50", r),
|
|
1598
|
+
children: [
|
|
1599
|
+
/* @__PURE__ */ J(p, { className: "size-3.5 shrink-0 opacity-60" }),
|
|
1600
|
+
/* @__PURE__ */ J("span", {
|
|
1601
|
+
className: "truncate",
|
|
1602
|
+
children: an(e, i)
|
|
1603
|
+
}),
|
|
1604
|
+
/* @__PURE__ */ J(g, { className: Z("size-3.5 shrink-0 opacity-60 transition-transform", l && "rotate-180") })
|
|
1605
|
+
]
|
|
1606
|
+
})
|
|
1607
|
+
}), /* @__PURE__ */ J(jt, {
|
|
1608
|
+
align: "end",
|
|
1609
|
+
sideOffset: 4,
|
|
1610
|
+
className: "w-auto p-0",
|
|
1611
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1612
|
+
className: "flex min-w-60 flex-col",
|
|
1613
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1614
|
+
className: "border-b p-2",
|
|
1615
|
+
children: [/* @__PURE__ */ J("p", {
|
|
1616
|
+
className: "mb-2 px-0.5 text-sm text-muted-foreground",
|
|
1617
|
+
children: "Presets"
|
|
1618
|
+
}), /* @__PURE__ */ J("div", {
|
|
1619
|
+
className: "grid gap-1",
|
|
1620
|
+
style: { gridTemplateColumns: `repeat(${c.length}, minmax(0, 1fr))` },
|
|
1621
|
+
children: c.map((t) => /* @__PURE__ */ J("button", {
|
|
1622
|
+
type: "button",
|
|
1623
|
+
onClick: () => v(t.value),
|
|
1624
|
+
className: Z("rounded-md px-2 py-1.5 text-center text-xs font-medium transition-colors", e.preset === t.value ? "bg-primary text-primary-foreground" : "bg-accent/50 text-foreground hover:bg-accent"),
|
|
1625
|
+
children: t.label
|
|
1626
|
+
}, t.value))
|
|
1627
|
+
})]
|
|
1628
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1629
|
+
className: "flex flex-col gap-3 p-2",
|
|
1630
|
+
children: [
|
|
1631
|
+
/* @__PURE__ */ J("p", {
|
|
1632
|
+
className: "px-0.5 text-sm text-muted-foreground",
|
|
1633
|
+
children: "Custom range"
|
|
1634
|
+
}),
|
|
1635
|
+
/* @__PURE__ */ J(sn, {
|
|
1636
|
+
isoValue: d,
|
|
1637
|
+
onChange: _,
|
|
1638
|
+
label: "From",
|
|
1639
|
+
placeholder: "Start date & time",
|
|
1640
|
+
timezone: i,
|
|
1641
|
+
maxDate: (/* @__PURE__ */ new Date()).toISOString()
|
|
1642
|
+
}),
|
|
1643
|
+
/* @__PURE__ */ J(sn, {
|
|
1644
|
+
isoValue: m,
|
|
1645
|
+
onChange: h,
|
|
1646
|
+
label: "To",
|
|
1647
|
+
placeholder: "End date & time",
|
|
1648
|
+
timezone: i,
|
|
1649
|
+
minDate: d || void 0,
|
|
1650
|
+
maxDate: (() => {
|
|
1651
|
+
let e = (/* @__PURE__ */ new Date()).toISOString();
|
|
1652
|
+
if (o && d) {
|
|
1653
|
+
let t = new Date(new Date(d).getTime() + o * 864e5).toISOString();
|
|
1654
|
+
return t < e ? t : e;
|
|
1655
|
+
}
|
|
1656
|
+
return e;
|
|
1657
|
+
})()
|
|
1658
|
+
}),
|
|
1659
|
+
/* @__PURE__ */ J(Q, {
|
|
1660
|
+
type: "button",
|
|
1661
|
+
size: "sm",
|
|
1662
|
+
className: "w-full",
|
|
1663
|
+
disabled: !d || !m,
|
|
1664
|
+
onClick: () => {
|
|
1665
|
+
!d || !m || (t({
|
|
1666
|
+
preset: null,
|
|
1667
|
+
from: d <= m ? d : m,
|
|
1668
|
+
to: d <= m ? m : d
|
|
1669
|
+
}), u(!1));
|
|
1670
|
+
},
|
|
1671
|
+
children: "Apply"
|
|
1672
|
+
})
|
|
1673
|
+
]
|
|
1674
|
+
})]
|
|
1675
|
+
})
|
|
1676
|
+
})]
|
|
1677
|
+
});
|
|
1678
|
+
}), ln = P("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
1679
|
+
variants: { variant: {
|
|
1680
|
+
default: "bg-card text-card-foreground",
|
|
1681
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"
|
|
1682
|
+
} },
|
|
1683
|
+
defaultVariants: { variant: "default" }
|
|
1684
|
+
});
|
|
1685
|
+
function un({ className: e, variant: t, ...n }) {
|
|
1686
|
+
return /* @__PURE__ */ J("div", {
|
|
1687
|
+
"data-slot": "alert",
|
|
1688
|
+
role: "alert",
|
|
1689
|
+
className: Z(ln({ variant: t }), e),
|
|
1690
|
+
...n
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
function dn({ className: e, ...t }) {
|
|
1694
|
+
return /* @__PURE__ */ J("div", {
|
|
1695
|
+
"data-slot": "alert-title",
|
|
1696
|
+
className: Z("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", e),
|
|
1697
|
+
...t
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
function fn({ className: e, ...t }) {
|
|
1701
|
+
return /* @__PURE__ */ J("div", {
|
|
1702
|
+
"data-slot": "alert-description",
|
|
1703
|
+
className: Z("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", e),
|
|
1704
|
+
...t
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
function pn({ className: e, ...t }) {
|
|
1708
|
+
return /* @__PURE__ */ J("div", {
|
|
1709
|
+
"data-slot": "alert-action",
|
|
1710
|
+
className: Z("absolute top-2 right-2", e),
|
|
1711
|
+
...t
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
//#endregion
|
|
1715
|
+
//#region src/components/ui/alert-dialog.tsx
|
|
1716
|
+
function mn({ ...e }) {
|
|
1717
|
+
return /* @__PURE__ */ J(F.Root, {
|
|
1718
|
+
"data-slot": "alert-dialog",
|
|
1719
|
+
...e
|
|
1720
|
+
});
|
|
1721
|
+
}
|
|
1722
|
+
function hn({ ...e }) {
|
|
1723
|
+
return /* @__PURE__ */ J(F.Trigger, {
|
|
1724
|
+
"data-slot": "alert-dialog-trigger",
|
|
1725
|
+
...e
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
function gn({ ...e }) {
|
|
1729
|
+
return /* @__PURE__ */ J(F.Portal, {
|
|
1730
|
+
"data-slot": "alert-dialog-portal",
|
|
1731
|
+
...e
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
function _n({ className: e, ...t }) {
|
|
1735
|
+
return /* @__PURE__ */ J(F.Overlay, {
|
|
1736
|
+
"data-slot": "alert-dialog-overlay",
|
|
1737
|
+
className: Z("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
|
|
1738
|
+
...t
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
function vn({ className: e, size: t = "default", ...n }) {
|
|
1742
|
+
return /* @__PURE__ */ Y(gn, { children: [/* @__PURE__ */ J(_n, {}), /* @__PURE__ */ J(F.Content, {
|
|
1743
|
+
"data-slot": "alert-dialog-content",
|
|
1744
|
+
"data-size": t,
|
|
1745
|
+
className: Z("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
1746
|
+
...n
|
|
1747
|
+
})] });
|
|
1748
|
+
}
|
|
1749
|
+
function yn({ className: e, ...t }) {
|
|
1750
|
+
return /* @__PURE__ */ J("div", {
|
|
1751
|
+
"data-slot": "alert-dialog-header",
|
|
1752
|
+
className: Z("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", e),
|
|
1753
|
+
...t
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
function bn({ className: e, ...t }) {
|
|
1757
|
+
return /* @__PURE__ */ J("div", {
|
|
1758
|
+
"data-slot": "alert-dialog-footer",
|
|
1759
|
+
className: Z("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", e),
|
|
1760
|
+
...t
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
function xn({ className: e, ...t }) {
|
|
1764
|
+
return /* @__PURE__ */ J("div", {
|
|
1765
|
+
"data-slot": "alert-dialog-media",
|
|
1766
|
+
className: Z("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", e),
|
|
1767
|
+
...t
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
function Sn({ className: e, ...t }) {
|
|
1771
|
+
return /* @__PURE__ */ J(F.Title, {
|
|
1772
|
+
"data-slot": "alert-dialog-title",
|
|
1773
|
+
className: Z("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", e),
|
|
1774
|
+
...t
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
function Cn({ className: e, ...t }) {
|
|
1778
|
+
return /* @__PURE__ */ J(F.Description, {
|
|
1779
|
+
"data-slot": "alert-dialog-description",
|
|
1780
|
+
className: Z("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
|
|
1781
|
+
...t
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
function wn({ className: e, variant: t = "default", size: n = "default", ...r }) {
|
|
1785
|
+
return /* @__PURE__ */ J(Q, {
|
|
1786
|
+
variant: t,
|
|
1787
|
+
size: n,
|
|
1788
|
+
asChild: !0,
|
|
1789
|
+
children: /* @__PURE__ */ J(F.Action, {
|
|
1790
|
+
"data-slot": "alert-dialog-action",
|
|
1791
|
+
className: Z(e),
|
|
1792
|
+
...r
|
|
1793
|
+
})
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
function Tn({ className: e, variant: t = "outline", size: n = "default", ...r }) {
|
|
1797
|
+
return /* @__PURE__ */ J(Q, {
|
|
1798
|
+
variant: t,
|
|
1799
|
+
size: n,
|
|
1800
|
+
asChild: !0,
|
|
1801
|
+
children: /* @__PURE__ */ J(F.Cancel, {
|
|
1802
|
+
"data-slot": "alert-dialog-cancel",
|
|
1803
|
+
className: Z(e),
|
|
1804
|
+
...r
|
|
1805
|
+
})
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
//#endregion
|
|
1809
|
+
//#region src/components/ui/badge.tsx
|
|
1810
|
+
var En = P("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
1811
|
+
variants: { variant: {
|
|
1812
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
1813
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
1814
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
1815
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
1816
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
1817
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
1818
|
+
red: "border-red/30 bg-red/10 text-red",
|
|
1819
|
+
orange: "border-orange/30 bg-orange/10 text-orange",
|
|
1820
|
+
yellow: "border-yellow/30 bg-yellow/10 text-yellow",
|
|
1821
|
+
green: "border-green/30 bg-green/10 text-green",
|
|
1822
|
+
teal: "border-teal/30 bg-teal/10 text-teal",
|
|
1823
|
+
cyan: "border-cyan/30 bg-cyan/10 text-cyan",
|
|
1824
|
+
blue: "border-blue/30 bg-blue/10 text-blue",
|
|
1825
|
+
purple: "border-purple/30 bg-purple/10 text-purple",
|
|
1826
|
+
pink: "border-pink/30 bg-pink/10 text-pink",
|
|
1827
|
+
gray: "border-gray/30 bg-gray/10 text-gray"
|
|
1828
|
+
} },
|
|
1829
|
+
defaultVariants: { variant: "default" }
|
|
1830
|
+
});
|
|
1831
|
+
function Dn({ className: e, variant: t = "default", asChild: n = !1, ...r }) {
|
|
1832
|
+
return /* @__PURE__ */ J(n ? G.Root : "span", {
|
|
1833
|
+
"data-slot": "badge",
|
|
1834
|
+
"data-variant": t,
|
|
1835
|
+
className: Z(En({ variant: t }), e),
|
|
1836
|
+
...r
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
//#endregion
|
|
1840
|
+
//#region src/components/ui/button-group.tsx
|
|
1841
|
+
var On = P("group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
1842
|
+
variants: { orientation: {
|
|
1843
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!",
|
|
1844
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!"
|
|
1845
|
+
} },
|
|
1846
|
+
defaultVariants: { orientation: "horizontal" }
|
|
1847
|
+
});
|
|
1848
|
+
function kn({ className: e, orientation: t, ...n }) {
|
|
1849
|
+
return /* @__PURE__ */ J("div", {
|
|
1850
|
+
role: "group",
|
|
1851
|
+
"data-slot": "button-group",
|
|
1852
|
+
"data-orientation": t,
|
|
1853
|
+
className: Z(On({ orientation: t }), e),
|
|
1854
|
+
...n
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
function An({ className: e, asChild: t = !1, ...n }) {
|
|
1858
|
+
return /* @__PURE__ */ J(t ? G.Root : "div", {
|
|
1859
|
+
className: Z("flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
|
|
1860
|
+
...n
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
function jn({ className: e, orientation: t = "vertical", ...n }) {
|
|
1864
|
+
return /* @__PURE__ */ J(Be, {
|
|
1865
|
+
"data-slot": "button-group-separator",
|
|
1866
|
+
orientation: t,
|
|
1867
|
+
className: Z("relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto", e),
|
|
1868
|
+
...n
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
//#endregion
|
|
1872
|
+
//#region src/components/ui/card.tsx
|
|
1873
|
+
function Mn({ className: e, size: t = "default", ...n }) {
|
|
1874
|
+
return /* @__PURE__ */ J("div", {
|
|
1875
|
+
"data-slot": "card",
|
|
1876
|
+
"data-size": t,
|
|
1877
|
+
className: Z("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", e),
|
|
1878
|
+
...n
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
function Nn({ className: e, ...t }) {
|
|
1882
|
+
return /* @__PURE__ */ J("div", {
|
|
1883
|
+
"data-slot": "card-header",
|
|
1884
|
+
className: Z("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3", e),
|
|
1885
|
+
...t
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
function Pn({ className: e, ...t }) {
|
|
1889
|
+
return /* @__PURE__ */ J("div", {
|
|
1890
|
+
"data-slot": "card-title",
|
|
1891
|
+
className: Z("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", e),
|
|
1892
|
+
...t
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1895
|
+
function Fn({ className: e, ...t }) {
|
|
1896
|
+
return /* @__PURE__ */ J("div", {
|
|
1897
|
+
"data-slot": "card-description",
|
|
1898
|
+
className: Z("text-sm text-muted-foreground", e),
|
|
1899
|
+
...t
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
function In({ className: e, ...t }) {
|
|
1903
|
+
return /* @__PURE__ */ J("div", {
|
|
1904
|
+
"data-slot": "card-action",
|
|
1905
|
+
className: Z("col-start-2 row-span-2 row-start-1 self-start justify-self-end", e),
|
|
1906
|
+
...t
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
function Ln({ className: e, ...t }) {
|
|
1910
|
+
return /* @__PURE__ */ J("div", {
|
|
1911
|
+
"data-slot": "card-content",
|
|
1912
|
+
className: Z("px-4 group-data-[size=sm]/card:px-3", e),
|
|
1913
|
+
...t
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
function Rn({ className: e, ...t }) {
|
|
1917
|
+
return /* @__PURE__ */ J("div", {
|
|
1918
|
+
"data-slot": "card-footer",
|
|
1919
|
+
className: Z("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3", e),
|
|
1920
|
+
...t
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
//#endregion
|
|
1924
|
+
//#region src/components/ui/chart.tsx
|
|
1925
|
+
var zn = {
|
|
1926
|
+
light: "",
|
|
1927
|
+
dark: ".dark"
|
|
1928
|
+
}, Bn = {
|
|
1929
|
+
width: 320,
|
|
1930
|
+
height: 200
|
|
1931
|
+
}, Vn = n.createContext(null);
|
|
1932
|
+
function Hn() {
|
|
1933
|
+
let e = n.useContext(Vn);
|
|
1934
|
+
if (!e) throw Error("useChart must be used within a <ChartContainer />");
|
|
1935
|
+
return e;
|
|
1936
|
+
}
|
|
1937
|
+
function Un({ id: e, className: t, children: r, config: i, initialDimension: a = Bn, ...o }) {
|
|
1938
|
+
let s = n.useId(), c = `chart-${e ?? s.replace(/:/g, "")}`;
|
|
1939
|
+
return /* @__PURE__ */ J(Vn.Provider, {
|
|
1940
|
+
value: { config: i },
|
|
1941
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1942
|
+
"data-slot": "chart",
|
|
1943
|
+
"data-chart": c,
|
|
1944
|
+
className: Z("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", t),
|
|
1945
|
+
...o,
|
|
1946
|
+
children: [/* @__PURE__ */ J(Wn, {
|
|
1947
|
+
id: c,
|
|
1948
|
+
config: i
|
|
1949
|
+
}), /* @__PURE__ */ J(he.ResponsiveContainer, {
|
|
1950
|
+
initialDimension: a,
|
|
1951
|
+
children: r
|
|
1952
|
+
})]
|
|
1953
|
+
})
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
var Wn = ({ id: e, config: t }) => {
|
|
1957
|
+
let n = Object.entries(t).filter(([, e]) => e.theme ?? e.color);
|
|
1958
|
+
return n.length ? /* @__PURE__ */ J("style", { dangerouslySetInnerHTML: { __html: Object.entries(zn).map(([t, r]) => `
|
|
1959
|
+
${r} [data-chart=${e}] {
|
|
1960
|
+
${n.map(([e, n]) => {
|
|
1961
|
+
let r = n.theme?.[t] ?? n.color;
|
|
1962
|
+
return r ? ` --color-${e}: ${r};` : null;
|
|
1963
|
+
}).join("\n")}
|
|
1964
|
+
}
|
|
1965
|
+
`).join("\n") } }) : null;
|
|
1966
|
+
}, Gn = he.Tooltip;
|
|
1967
|
+
function Kn({ active: e, payload: t, className: r, indicator: i = "dot", hideLabel: a = !1, hideIndicator: o = !1, label: s, labelFormatter: c, labelClassName: l, formatter: u, color: d, nameKey: f, labelKey: p }) {
|
|
1968
|
+
let { config: m } = Hn(), h = n.useMemo(() => {
|
|
1969
|
+
if (a || !t?.length) return null;
|
|
1970
|
+
let [e] = t, n = Yn(m, e, `${p ?? e?.dataKey ?? e?.name ?? "value"}`), r = !p && typeof s == "string" ? m[s]?.label ?? s : n?.label;
|
|
1971
|
+
return c ? /* @__PURE__ */ J("div", {
|
|
1972
|
+
className: Z("font-medium", l),
|
|
1973
|
+
children: c(r, t)
|
|
1974
|
+
}) : r ? /* @__PURE__ */ J("div", {
|
|
1975
|
+
className: Z("font-medium", l),
|
|
1976
|
+
children: r
|
|
1977
|
+
}) : null;
|
|
1978
|
+
}, [
|
|
1979
|
+
s,
|
|
1980
|
+
c,
|
|
1981
|
+
t,
|
|
1982
|
+
a,
|
|
1983
|
+
l,
|
|
1984
|
+
m,
|
|
1985
|
+
p
|
|
1986
|
+
]);
|
|
1987
|
+
if (!e || !t?.length) return null;
|
|
1988
|
+
let g = t.length === 1 && i !== "dot";
|
|
1989
|
+
return /* @__PURE__ */ Y("div", {
|
|
1990
|
+
className: Z("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", r),
|
|
1991
|
+
children: [g ? null : h, /* @__PURE__ */ J("div", {
|
|
1992
|
+
className: "grid gap-1.5",
|
|
1993
|
+
children: t.filter((e) => e.type !== "none").map((e, t) => {
|
|
1994
|
+
let n = Yn(m, e, `${f ?? e.name ?? e.dataKey ?? "value"}`), r = d ?? e.payload?.fill ?? e.color;
|
|
1995
|
+
return /* @__PURE__ */ J("div", {
|
|
1996
|
+
className: Z("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", i === "dot" && "items-center"),
|
|
1997
|
+
children: u && e?.value !== void 0 && e.name ? u(e.value, e.name, e, t, e.payload) : /* @__PURE__ */ Y(fe, { children: [n?.icon ? /* @__PURE__ */ J(n.icon, {}) : !o && /* @__PURE__ */ J("div", {
|
|
1998
|
+
className: Z("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
1999
|
+
"h-2.5 w-2.5": i === "dot",
|
|
2000
|
+
"w-1": i === "line",
|
|
2001
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": i === "dashed",
|
|
2002
|
+
"my-0.5": g && i === "dashed"
|
|
2003
|
+
}),
|
|
2004
|
+
style: {
|
|
2005
|
+
"--color-bg": r,
|
|
2006
|
+
"--color-border": r
|
|
2007
|
+
}
|
|
2008
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2009
|
+
className: Z("flex flex-1 justify-between leading-none", g ? "items-end" : "items-center"),
|
|
2010
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2011
|
+
className: "grid gap-1.5",
|
|
2012
|
+
children: [g ? h : null, /* @__PURE__ */ J("span", {
|
|
2013
|
+
className: "text-muted-foreground",
|
|
2014
|
+
children: n?.label ?? e.name
|
|
2015
|
+
})]
|
|
2016
|
+
}), e.value != null && /* @__PURE__ */ J("span", {
|
|
2017
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
2018
|
+
children: typeof e.value == "number" ? e.value.toLocaleString() : String(e.value)
|
|
2019
|
+
})]
|
|
2020
|
+
})] })
|
|
2021
|
+
}, t);
|
|
2022
|
+
})
|
|
2023
|
+
})]
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
var qn = he.Legend;
|
|
2027
|
+
function Jn({ className: e, hideIcon: t = !1, payload: n, verticalAlign: r = "bottom", nameKey: i }) {
|
|
2028
|
+
let { config: a } = Hn();
|
|
2029
|
+
return n?.length ? /* @__PURE__ */ J("div", {
|
|
2030
|
+
className: Z("flex items-center justify-center gap-4", r === "top" ? "pb-3" : "pt-3", e),
|
|
2031
|
+
children: n.filter((e) => e.type !== "none").map((e, n) => {
|
|
2032
|
+
let r = Yn(a, e, `${i ?? e.dataKey ?? "value"}`);
|
|
2033
|
+
return /* @__PURE__ */ Y("div", {
|
|
2034
|
+
className: Z("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
2035
|
+
children: [r?.icon && !t ? /* @__PURE__ */ J(r.icon, {}) : /* @__PURE__ */ J("div", {
|
|
2036
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
2037
|
+
style: { backgroundColor: e.color }
|
|
2038
|
+
}), r?.label]
|
|
2039
|
+
}, n);
|
|
2040
|
+
})
|
|
2041
|
+
}) : null;
|
|
2042
|
+
}
|
|
2043
|
+
function Yn(e, t, n) {
|
|
2044
|
+
if (typeof t != "object" || !t) return;
|
|
2045
|
+
let r = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0, i = n;
|
|
2046
|
+
return n in t && typeof t[n] == "string" ? i = t[n] : r && n in r && typeof r[n] == "string" && (i = r[n]), i in e ? e[i] : e[n];
|
|
2047
|
+
}
|
|
2048
|
+
//#endregion
|
|
2049
|
+
//#region src/components/ui/hover-card.tsx
|
|
2050
|
+
function Xn({ ...e }) {
|
|
2051
|
+
return /* @__PURE__ */ J(z.Root, {
|
|
2052
|
+
"data-slot": "hover-card",
|
|
2053
|
+
...e
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
function Zn({ ...e }) {
|
|
2057
|
+
return /* @__PURE__ */ J(z.Trigger, {
|
|
2058
|
+
"data-slot": "hover-card-trigger",
|
|
2059
|
+
...e
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
function Qn({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
2063
|
+
return /* @__PURE__ */ J(z.Portal, {
|
|
2064
|
+
"data-slot": "hover-card-portal",
|
|
2065
|
+
children: /* @__PURE__ */ J(z.Content, {
|
|
2066
|
+
"data-slot": "hover-card-content",
|
|
2067
|
+
align: t,
|
|
2068
|
+
sideOffset: n,
|
|
2069
|
+
className: Z("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
2070
|
+
...r
|
|
2071
|
+
})
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
//#endregion
|
|
2075
|
+
//#region src/components/ui/item.tsx
|
|
2076
|
+
function $n({ className: e, ...t }) {
|
|
2077
|
+
return /* @__PURE__ */ J("div", {
|
|
2078
|
+
role: "list",
|
|
2079
|
+
"data-slot": "item-group",
|
|
2080
|
+
className: Z("group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2", e),
|
|
2081
|
+
...t
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2084
|
+
function er({ className: e, ...t }) {
|
|
2085
|
+
return /* @__PURE__ */ J(Be, {
|
|
2086
|
+
"data-slot": "item-separator",
|
|
2087
|
+
orientation: "horizontal",
|
|
2088
|
+
className: Z("my-2", e),
|
|
2089
|
+
...t
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
var tr = P("group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted", {
|
|
2093
|
+
variants: {
|
|
2094
|
+
variant: {
|
|
2095
|
+
default: "border-transparent",
|
|
2096
|
+
outline: "border-border",
|
|
2097
|
+
muted: "border-transparent bg-muted/50"
|
|
2098
|
+
},
|
|
2099
|
+
size: {
|
|
2100
|
+
default: "gap-2.5 px-3 py-2.5",
|
|
2101
|
+
sm: "gap-2.5 px-3 py-2.5",
|
|
2102
|
+
xs: "gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0"
|
|
2103
|
+
}
|
|
2104
|
+
},
|
|
2105
|
+
defaultVariants: {
|
|
2106
|
+
variant: "default",
|
|
2107
|
+
size: "default"
|
|
2108
|
+
}
|
|
2109
|
+
});
|
|
2110
|
+
function nr({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
|
|
2111
|
+
return /* @__PURE__ */ J(r ? G.Root : "div", {
|
|
2112
|
+
"data-slot": "item",
|
|
2113
|
+
"data-variant": t,
|
|
2114
|
+
"data-size": n,
|
|
2115
|
+
className: Z(tr({
|
|
2116
|
+
variant: t,
|
|
2117
|
+
size: n,
|
|
2118
|
+
className: e
|
|
2119
|
+
})),
|
|
2120
|
+
...i
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
var rr = P("flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none", {
|
|
2124
|
+
variants: { variant: {
|
|
2125
|
+
default: "bg-transparent",
|
|
2126
|
+
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
2127
|
+
image: "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover"
|
|
2128
|
+
} },
|
|
2129
|
+
defaultVariants: { variant: "default" }
|
|
2130
|
+
});
|
|
2131
|
+
function ir({ className: e, variant: t = "default", ...n }) {
|
|
2132
|
+
return /* @__PURE__ */ J("div", {
|
|
2133
|
+
"data-slot": "item-media",
|
|
2134
|
+
"data-variant": t,
|
|
2135
|
+
className: Z(rr({
|
|
2136
|
+
variant: t,
|
|
2137
|
+
className: e
|
|
2138
|
+
})),
|
|
2139
|
+
...n
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
function ar({ className: e, ...t }) {
|
|
2143
|
+
return /* @__PURE__ */ J("div", {
|
|
2144
|
+
"data-slot": "item-content",
|
|
2145
|
+
className: Z("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none", e),
|
|
2146
|
+
...t
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
function or({ className: e, ...t }) {
|
|
2150
|
+
return /* @__PURE__ */ J("div", {
|
|
2151
|
+
"data-slot": "item-title",
|
|
2152
|
+
className: Z("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4", e),
|
|
2153
|
+
...t
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
function sr({ className: e, ...t }) {
|
|
2157
|
+
return /* @__PURE__ */ J("p", {
|
|
2158
|
+
"data-slot": "item-description",
|
|
2159
|
+
className: Z("line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", e),
|
|
2160
|
+
...t
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
function cr({ className: e, ...t }) {
|
|
2164
|
+
return /* @__PURE__ */ J("div", {
|
|
2165
|
+
"data-slot": "item-actions",
|
|
2166
|
+
className: Z("flex items-center gap-2", e),
|
|
2167
|
+
...t
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
function lr({ className: e, ...t }) {
|
|
2171
|
+
return /* @__PURE__ */ J("div", {
|
|
2172
|
+
"data-slot": "item-header",
|
|
2173
|
+
className: Z("flex basis-full items-center justify-between gap-2", e),
|
|
2174
|
+
...t
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
function ur({ className: e, ...t }) {
|
|
2178
|
+
return /* @__PURE__ */ J("div", {
|
|
2179
|
+
"data-slot": "item-footer",
|
|
2180
|
+
className: Z("flex basis-full items-center justify-between gap-2", e),
|
|
2181
|
+
...t
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
//#endregion
|
|
2185
|
+
//#region src/components/ui/map.tsx
|
|
2186
|
+
var dr = {
|
|
2187
|
+
dark: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",
|
|
2188
|
+
light: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
|
|
2189
|
+
}, fr = [
|
|
2190
|
+
{
|
|
2191
|
+
label: "Light",
|
|
2192
|
+
url: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
label: "Voyager",
|
|
2196
|
+
url: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
|
|
2197
|
+
},
|
|
2198
|
+
{
|
|
2199
|
+
label: "Dark",
|
|
2200
|
+
url: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
|
|
2201
|
+
}
|
|
2202
|
+
], pr = r(null);
|
|
2203
|
+
function $() {
|
|
2204
|
+
let e = o(pr);
|
|
2205
|
+
if (!e) throw Error("useMap must be used within a Map component");
|
|
2206
|
+
return e;
|
|
2207
|
+
}
|
|
2208
|
+
function mr() {
|
|
2209
|
+
return /* @__PURE__ */ J("div", {
|
|
2210
|
+
className: "bg-background/50 absolute inset-0 z-10 flex items-center justify-center backdrop-blur-xs",
|
|
2211
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2212
|
+
className: "flex gap-1",
|
|
2213
|
+
children: [
|
|
2214
|
+
/* @__PURE__ */ J("span", { className: "bg-muted-foreground/60 size-1.5 animate-pulse rounded-full" }),
|
|
2215
|
+
/* @__PURE__ */ J("span", { className: "bg-muted-foreground/60 size-1.5 animate-pulse rounded-full [animation-delay:150ms]" }),
|
|
2216
|
+
/* @__PURE__ */ J("span", { className: "bg-muted-foreground/60 size-1.5 animate-pulse rounded-full [animation-delay:300ms]" })
|
|
2217
|
+
]
|
|
2218
|
+
})
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
function hr(e) {
|
|
2222
|
+
let t = e.getCenter();
|
|
2223
|
+
return {
|
|
2224
|
+
center: [t.lng, t.lat],
|
|
2225
|
+
zoom: e.getZoom(),
|
|
2226
|
+
bearing: e.getBearing(),
|
|
2227
|
+
pitch: e.getPitch()
|
|
2228
|
+
};
|
|
2229
|
+
}
|
|
2230
|
+
var gr = i(function({ children: e, className: t, theme: n, styles: r, projection: i, viewport: o, onViewportChange: c, loading: p = !1, controls: m = !0, tiles: h = fr, ...g }, _) {
|
|
2231
|
+
let v = h === !1 ? [] : h, y = d(null), [b, x] = f(null), [S, C] = f(!1), [w, T] = f(!1), [E, ee] = f(0), D = d(null), O = d(null), k = d(!1), A = o !== void 0 && c !== void 0, te = d(c);
|
|
2232
|
+
te.current = c;
|
|
2233
|
+
let j = u(() => ({
|
|
2234
|
+
dark: r?.dark ?? dr.dark,
|
|
2235
|
+
light: r?.light ?? dr.light
|
|
2236
|
+
}), [r]);
|
|
2237
|
+
l(_, () => b, [b]);
|
|
2238
|
+
let M = a(() => {
|
|
2239
|
+
O.current &&= (clearTimeout(O.current), null);
|
|
2240
|
+
}, []);
|
|
2241
|
+
s(() => {
|
|
2242
|
+
if (!y.current) return;
|
|
2243
|
+
let e = v[0]?.url ?? j.light;
|
|
2244
|
+
D.current = e;
|
|
2245
|
+
let t = new ge.Map({
|
|
2246
|
+
container: y.current,
|
|
2247
|
+
style: e,
|
|
2248
|
+
renderWorldCopies: !1,
|
|
2249
|
+
attributionControl: !1,
|
|
2250
|
+
...g,
|
|
2251
|
+
...o
|
|
2252
|
+
}), n = () => {
|
|
2253
|
+
M(), O.current = setTimeout(() => {
|
|
2254
|
+
T(!0), i && t.setProjection(i);
|
|
2255
|
+
}, 100);
|
|
2256
|
+
}, r = () => C(!0), a = () => {
|
|
2257
|
+
k.current || te.current?.(hr(t));
|
|
2258
|
+
};
|
|
2259
|
+
return t.on("load", r), t.on("styledata", n), t.on("move", a), x(t), () => {
|
|
2260
|
+
M(), t.off("load", r), t.off("styledata", n), t.off("move", a), t.remove(), C(!1), T(!1), x(null);
|
|
2261
|
+
};
|
|
2262
|
+
}, []), s(() => {
|
|
2263
|
+
if (!b || !A || !o || b.isMoving()) return;
|
|
2264
|
+
let e = hr(b), t = {
|
|
2265
|
+
center: o.center ?? e.center,
|
|
2266
|
+
zoom: o.zoom ?? e.zoom,
|
|
2267
|
+
bearing: o.bearing ?? e.bearing,
|
|
2268
|
+
pitch: o.pitch ?? e.pitch
|
|
2269
|
+
};
|
|
2270
|
+
t.center[0] === e.center[0] && t.center[1] === e.center[1] && t.zoom === e.zoom && t.bearing === e.bearing && t.pitch === e.pitch || (k.current = !0, b.jumpTo(t), k.current = !1);
|
|
2271
|
+
}, [
|
|
2272
|
+
b,
|
|
2273
|
+
A,
|
|
2274
|
+
o
|
|
2275
|
+
]), s(() => {
|
|
2276
|
+
if (!b) return;
|
|
2277
|
+
let e = v[E]?.url ?? (n === "dark" ? j.dark : j.light);
|
|
2278
|
+
D.current !== e && (M(), D.current = e, T(!1), b.setStyle(e, { diff: !0 }));
|
|
2279
|
+
}, [
|
|
2280
|
+
b,
|
|
2281
|
+
E,
|
|
2282
|
+
n,
|
|
2283
|
+
j,
|
|
2284
|
+
M
|
|
2285
|
+
]);
|
|
2286
|
+
let ne = u(() => ({
|
|
2287
|
+
map: b,
|
|
2288
|
+
isLoaded: S && w
|
|
2289
|
+
}), [
|
|
2290
|
+
b,
|
|
2291
|
+
S,
|
|
2292
|
+
w
|
|
2293
|
+
]);
|
|
2294
|
+
return /* @__PURE__ */ J(pr.Provider, {
|
|
2295
|
+
value: ne,
|
|
2296
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2297
|
+
ref: y,
|
|
2298
|
+
className: Z("relative h-full w-full", t),
|
|
2299
|
+
children: [(!S || p) && /* @__PURE__ */ J(mr, {}), b && /* @__PURE__ */ Y(fe, { children: [m && /* @__PURE__ */ J(Ar, {
|
|
2300
|
+
position: "top-right",
|
|
2301
|
+
tiles: v,
|
|
2302
|
+
tileIndex: E,
|
|
2303
|
+
onTileChange: ee
|
|
2304
|
+
}), e] })]
|
|
2305
|
+
})
|
|
2306
|
+
});
|
|
2307
|
+
}), _r = r(null);
|
|
2308
|
+
function vr() {
|
|
2309
|
+
let e = o(_r);
|
|
2310
|
+
if (!e) throw Error("Marker components must be used within MapMarker");
|
|
2311
|
+
return e;
|
|
2312
|
+
}
|
|
2313
|
+
function yr({ longitude: e, latitude: t, children: n, onClick: r, onMouseEnter: i, onMouseLeave: a, onDragStart: o, onDrag: c, onDragEnd: l, draggable: f = !1, ...p }) {
|
|
2314
|
+
let { map: m } = $(), h = d({
|
|
2315
|
+
onClick: r,
|
|
2316
|
+
onMouseEnter: i,
|
|
2317
|
+
onMouseLeave: a,
|
|
2318
|
+
onDragStart: o,
|
|
2319
|
+
onDrag: c,
|
|
2320
|
+
onDragEnd: l
|
|
2321
|
+
});
|
|
2322
|
+
h.current = {
|
|
2323
|
+
onClick: r,
|
|
2324
|
+
onMouseEnter: i,
|
|
2325
|
+
onMouseLeave: a,
|
|
2326
|
+
onDragStart: o,
|
|
2327
|
+
onDrag: c,
|
|
2328
|
+
onDragEnd: l
|
|
2329
|
+
};
|
|
2330
|
+
let g = u(() => {
|
|
2331
|
+
let n = new ge.Marker({
|
|
2332
|
+
...p,
|
|
2333
|
+
element: document.createElement("div"),
|
|
2334
|
+
draggable: f
|
|
2335
|
+
}).setLngLat([e, t]);
|
|
2336
|
+
return n.getElement()?.addEventListener("click", (e) => h.current.onClick?.(e)), n.getElement()?.addEventListener("mouseenter", (e) => h.current.onMouseEnter?.(e)), n.getElement()?.addEventListener("mouseleave", (e) => h.current.onMouseLeave?.(e)), n.on("dragstart", () => {
|
|
2337
|
+
let e = n.getLngLat();
|
|
2338
|
+
h.current.onDragStart?.({
|
|
2339
|
+
lng: e.lng,
|
|
2340
|
+
lat: e.lat
|
|
2341
|
+
});
|
|
2342
|
+
}), n.on("drag", () => {
|
|
2343
|
+
let e = n.getLngLat();
|
|
2344
|
+
h.current.onDrag?.({
|
|
2345
|
+
lng: e.lng,
|
|
2346
|
+
lat: e.lat
|
|
2347
|
+
});
|
|
2348
|
+
}), n.on("dragend", () => {
|
|
2349
|
+
let e = n.getLngLat();
|
|
2350
|
+
h.current.onDragEnd?.({
|
|
2351
|
+
lng: e.lng,
|
|
2352
|
+
lat: e.lat
|
|
2353
|
+
});
|
|
2354
|
+
}), n;
|
|
2355
|
+
}, []);
|
|
2356
|
+
s(() => {
|
|
2357
|
+
if (m) return g.addTo(m), () => {
|
|
2358
|
+
g.remove();
|
|
2359
|
+
};
|
|
2360
|
+
}, [m]), (g.getLngLat().lng !== e || g.getLngLat().lat !== t) && g.setLngLat([e, t]), g.isDraggable() !== f && g.setDraggable(f);
|
|
2361
|
+
let _ = g.getOffset(), v = p.offset ?? [0, 0], [y, b] = Array.isArray(v) ? v : [v.x, v.y];
|
|
2362
|
+
return (_.x !== y || _.y !== b) && g.setOffset(v), g.getRotation() !== p.rotation && g.setRotation(p.rotation ?? 0), g.getRotationAlignment() !== p.rotationAlignment && g.setRotationAlignment(p.rotationAlignment ?? "auto"), g.getPitchAlignment() !== p.pitchAlignment && g.setPitchAlignment(p.pitchAlignment ?? "auto"), /* @__PURE__ */ J(_r.Provider, {
|
|
2363
|
+
value: {
|
|
2364
|
+
marker: g,
|
|
2365
|
+
map: m
|
|
2366
|
+
},
|
|
2367
|
+
children: n
|
|
2368
|
+
});
|
|
2369
|
+
}
|
|
2370
|
+
function br({ children: e, className: t }) {
|
|
2371
|
+
let { marker: n } = vr();
|
|
2372
|
+
return _e(/* @__PURE__ */ J("div", {
|
|
2373
|
+
className: Z("relative cursor-pointer", t),
|
|
2374
|
+
children: e || /* @__PURE__ */ J(xr, {})
|
|
2375
|
+
}), n.getElement());
|
|
2376
|
+
}
|
|
2377
|
+
function xr() {
|
|
2378
|
+
return /* @__PURE__ */ J("div", { className: "relative h-4 w-4 rounded-full border-2 border-white bg-blue-500 shadow-lg" });
|
|
2379
|
+
}
|
|
2380
|
+
function Sr({ onClick: e }) {
|
|
2381
|
+
return /* @__PURE__ */ J("button", {
|
|
2382
|
+
type: "button",
|
|
2383
|
+
onClick: e,
|
|
2384
|
+
"aria-label": "Close popup",
|
|
2385
|
+
className: "focus-visible:ring-ring hover:bg-muted text-foreground absolute top-0.5 right-0.5 z-10 inline-flex size-5 cursor-pointer items-center justify-center rounded-sm transition-colors focus:outline-none focus-visible:ring-2",
|
|
2386
|
+
children: /* @__PURE__ */ J(ae, { className: "size-3.5" })
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2389
|
+
function Cr({ children: e, className: t, closeButton: n = !1, ...r }) {
|
|
2390
|
+
let { marker: i, map: a } = vr(), o = u(() => document.createElement("div"), []), c = d(r), l = u(() => new ge.Popup({
|
|
2391
|
+
offset: 16,
|
|
2392
|
+
...r,
|
|
2393
|
+
closeButton: !1
|
|
2394
|
+
}).setMaxWidth("none").setDOMContent(o), []);
|
|
2395
|
+
if (s(() => {
|
|
2396
|
+
if (a) return l.setDOMContent(o), i.setPopup(l), () => {
|
|
2397
|
+
i.setPopup(null);
|
|
2398
|
+
};
|
|
2399
|
+
}, [a]), l.isOpen()) {
|
|
2400
|
+
let e = c.current;
|
|
2401
|
+
e.offset !== r.offset && l.setOffset(r.offset ?? 16), e.maxWidth !== r.maxWidth && r.maxWidth && l.setMaxWidth(r.maxWidth ?? "none"), c.current = r;
|
|
2402
|
+
}
|
|
2403
|
+
return _e(/* @__PURE__ */ Y("div", {
|
|
2404
|
+
className: Z("bg-popover text-popover-foreground relative max-w-62 rounded-md border p-3 shadow-md", "animate-in fade-in-0 zoom-in-95 duration-200 ease-out", t),
|
|
2405
|
+
children: [n && /* @__PURE__ */ J(Sr, { onClick: () => l.remove() }), e]
|
|
2406
|
+
}), o);
|
|
2407
|
+
}
|
|
2408
|
+
function wr({ children: e, className: t, ...n }) {
|
|
2409
|
+
let { marker: r, map: i } = vr(), a = u(() => document.createElement("div"), []), o = d(n), c = u(() => new ge.Popup({
|
|
2410
|
+
offset: 16,
|
|
2411
|
+
...n,
|
|
2412
|
+
closeOnClick: !0,
|
|
2413
|
+
closeButton: !1
|
|
2414
|
+
}).setMaxWidth("none"), []);
|
|
2415
|
+
if (s(() => {
|
|
2416
|
+
if (!i) return;
|
|
2417
|
+
c.setDOMContent(a);
|
|
2418
|
+
let e = () => {
|
|
2419
|
+
c.setLngLat(r.getLngLat()).addTo(i);
|
|
2420
|
+
}, t = () => c.remove();
|
|
2421
|
+
return r.getElement()?.addEventListener("mouseenter", e), r.getElement()?.addEventListener("mouseleave", t), () => {
|
|
2422
|
+
r.getElement()?.removeEventListener("mouseenter", e), r.getElement()?.removeEventListener("mouseleave", t), c.remove();
|
|
2423
|
+
};
|
|
2424
|
+
}, [i]), c.isOpen()) {
|
|
2425
|
+
let e = o.current;
|
|
2426
|
+
e.offset !== n.offset && c.setOffset(n.offset ?? 16), e.maxWidth !== n.maxWidth && n.maxWidth && c.setMaxWidth(n.maxWidth ?? "none"), o.current = n;
|
|
2427
|
+
}
|
|
2428
|
+
return _e(/* @__PURE__ */ J("div", {
|
|
2429
|
+
className: Z("bg-foreground text-background pointer-events-none rounded-md px-2 py-1 text-xs text-balance shadow-md", "animate-in fade-in-0 zoom-in-95 duration-200 ease-out", t),
|
|
2430
|
+
children: e
|
|
2431
|
+
}), a);
|
|
2432
|
+
}
|
|
2433
|
+
function Tr({ children: e, className: t, position: n = "top" }) {
|
|
2434
|
+
return /* @__PURE__ */ J("div", {
|
|
2435
|
+
className: Z("absolute left-1/2 -translate-x-1/2 whitespace-nowrap", "text-foreground text-[10px] font-medium", {
|
|
2436
|
+
top: "bottom-full mb-1",
|
|
2437
|
+
bottom: "top-full mt-1"
|
|
2438
|
+
}[n], t),
|
|
2439
|
+
children: e
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
var Er = {
|
|
2443
|
+
"top-left": "top-2 left-2",
|
|
2444
|
+
"top-right": "top-2 right-2",
|
|
2445
|
+
"bottom-left": "bottom-2 left-2",
|
|
2446
|
+
"bottom-right": "bottom-10 right-2"
|
|
2447
|
+
};
|
|
2448
|
+
function Dr({ children: e }) {
|
|
2449
|
+
return /* @__PURE__ */ J("div", {
|
|
2450
|
+
className: "border-border bg-background [&>button:not(:last-child)]:border-border flex flex-col overflow-hidden rounded-md border shadow-sm [&>button:not(:last-child)]:border-b",
|
|
2451
|
+
children: e
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2454
|
+
function Or({ onClick: e, label: t, children: n, disabled: r = !1 }) {
|
|
2455
|
+
return /* @__PURE__ */ J("button", {
|
|
2456
|
+
onClick: e,
|
|
2457
|
+
"aria-label": t,
|
|
2458
|
+
type: "button",
|
|
2459
|
+
className: Z("flex size-8 items-center justify-center transition-all", "first:rounded-t-md last:rounded-b-md", "hover:bg-accent dark:hover:bg-accent/40", "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", "disabled:pointer-events-none disabled:opacity-50"),
|
|
2460
|
+
disabled: r,
|
|
2461
|
+
children: n
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
function kr({ tiles: e, tileIndex: t, onTileChange: n, openLeft: r }) {
|
|
2465
|
+
let [i, a] = f(!1), o = d(null);
|
|
2466
|
+
return s(() => {
|
|
2467
|
+
if (!i) return;
|
|
2468
|
+
let e = (e) => {
|
|
2469
|
+
o.current && !o.current.contains(e.target) && a(!1);
|
|
2470
|
+
}, t = (e) => {
|
|
2471
|
+
e.key === "Escape" && a(!1);
|
|
2472
|
+
};
|
|
2473
|
+
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
2474
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
2475
|
+
};
|
|
2476
|
+
}, [i]), /* @__PURE__ */ Y("div", {
|
|
2477
|
+
ref: o,
|
|
2478
|
+
className: "relative",
|
|
2479
|
+
children: [/* @__PURE__ */ J(Dr, { children: /* @__PURE__ */ J(Or, {
|
|
2480
|
+
onClick: () => a((e) => !e),
|
|
2481
|
+
label: `Basemap: ${e[t]?.label ?? ""}`,
|
|
2482
|
+
children: /* @__PURE__ */ J(E, { className: "size-4" })
|
|
2483
|
+
}) }), i && /* @__PURE__ */ J("div", {
|
|
2484
|
+
role: "listbox",
|
|
2485
|
+
"aria-label": "Basemap",
|
|
2486
|
+
className: Z("border-border bg-background absolute top-0 z-20 min-w-32 overflow-hidden rounded-md border p-1 shadow-md", r ? "right-9" : "left-9"),
|
|
2487
|
+
children: e.map((e, r) => /* @__PURE__ */ Y("button", {
|
|
2488
|
+
type: "button",
|
|
2489
|
+
role: "option",
|
|
2490
|
+
"aria-selected": r === t,
|
|
2491
|
+
onClick: () => {
|
|
2492
|
+
n?.(r), a(!1);
|
|
2493
|
+
},
|
|
2494
|
+
className: Z("flex w-full items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-left text-xs font-medium transition-colors", r === t ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"),
|
|
2495
|
+
children: [e.label, r === t && /* @__PURE__ */ J(m, { className: "size-3.5 shrink-0" })]
|
|
2496
|
+
}, e.label))
|
|
2497
|
+
})]
|
|
2498
|
+
});
|
|
2499
|
+
}
|
|
2500
|
+
function Ar({ position: e = "bottom-right", showZoom: t = !0, showCompass: n = !1, showLocate: r = !1, showFullscreen: i = !1, className: o, onLocate: s, tiles: c = [], tileIndex: l = 0, onTileChange: u }) {
|
|
2501
|
+
let { map: d } = $(), [p, m] = f(!1), h = a(() => {
|
|
2502
|
+
d?.zoomTo(d.getZoom() + 1, { duration: 300 });
|
|
2503
|
+
}, [d]), g = a(() => {
|
|
2504
|
+
d?.zoomTo(d.getZoom() - 1, { duration: 300 });
|
|
2505
|
+
}, [d]), _ = a(() => {
|
|
2506
|
+
d?.resetNorthPitch({ duration: 300 });
|
|
2507
|
+
}, [d]), v = a(() => {
|
|
2508
|
+
m(!0), "geolocation" in navigator && navigator.geolocation.getCurrentPosition((e) => {
|
|
2509
|
+
let t = {
|
|
2510
|
+
longitude: e.coords.longitude,
|
|
2511
|
+
latitude: e.coords.latitude
|
|
2512
|
+
};
|
|
2513
|
+
d?.flyTo({
|
|
2514
|
+
center: [t.longitude, t.latitude],
|
|
2515
|
+
zoom: 14,
|
|
2516
|
+
duration: 1500
|
|
2517
|
+
}), s?.(t), m(!1);
|
|
2518
|
+
}, (e) => {
|
|
2519
|
+
console.error("Error getting location:", e), m(!1);
|
|
2520
|
+
});
|
|
2521
|
+
}, [d, s]), y = a(() => {
|
|
2522
|
+
let e = d?.getContainer();
|
|
2523
|
+
e && (document.fullscreenElement ? document.exitFullscreen() : e.requestFullscreen());
|
|
2524
|
+
}, [d]);
|
|
2525
|
+
return /* @__PURE__ */ Y("div", {
|
|
2526
|
+
className: Z("absolute z-10 flex flex-col gap-1.5", Er[e], o),
|
|
2527
|
+
children: [
|
|
2528
|
+
t && /* @__PURE__ */ Y(Dr, { children: [/* @__PURE__ */ J(Or, {
|
|
2529
|
+
onClick: h,
|
|
2530
|
+
label: "Zoom in",
|
|
2531
|
+
children: /* @__PURE__ */ J(ne, { className: "size-4" })
|
|
2532
|
+
}), /* @__PURE__ */ J(Or, {
|
|
2533
|
+
onClick: g,
|
|
2534
|
+
label: "Zoom out",
|
|
2535
|
+
children: /* @__PURE__ */ J(te, { className: "size-4" })
|
|
2536
|
+
})] }),
|
|
2537
|
+
c.length > 1 && /* @__PURE__ */ J(kr, {
|
|
2538
|
+
tiles: c,
|
|
2539
|
+
tileIndex: l,
|
|
2540
|
+
onTileChange: u,
|
|
2541
|
+
openLeft: e.endsWith("right")
|
|
2542
|
+
}),
|
|
2543
|
+
n && /* @__PURE__ */ J(Dr, { children: /* @__PURE__ */ J(jr, { onClick: _ }) }),
|
|
2544
|
+
r && /* @__PURE__ */ J(Dr, { children: /* @__PURE__ */ J(Or, {
|
|
2545
|
+
onClick: v,
|
|
2546
|
+
label: "Find my location",
|
|
2547
|
+
disabled: p,
|
|
2548
|
+
children: p ? /* @__PURE__ */ J(ee, { className: "size-4 animate-spin" }) : /* @__PURE__ */ J(k, { className: "size-4" })
|
|
2549
|
+
}) }),
|
|
2550
|
+
i && /* @__PURE__ */ J(Dr, { children: /* @__PURE__ */ J(Or, {
|
|
2551
|
+
onClick: y,
|
|
2552
|
+
label: "Toggle fullscreen",
|
|
2553
|
+
children: /* @__PURE__ */ J(A, { className: "size-4" })
|
|
2554
|
+
}) })
|
|
2555
|
+
]
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
function jr({ onClick: e }) {
|
|
2559
|
+
let { map: t } = $(), n = d(null);
|
|
2560
|
+
return s(() => {
|
|
2561
|
+
if (!t || !n.current) return;
|
|
2562
|
+
let e = n.current, r = () => {
|
|
2563
|
+
let n = t.getBearing(), r = t.getPitch();
|
|
2564
|
+
e.style.transform = `rotateX(${r}deg) rotateZ(${-n}deg)`;
|
|
2565
|
+
};
|
|
2566
|
+
return t.on("rotate", r), t.on("pitch", r), r(), () => {
|
|
2567
|
+
t.off("rotate", r), t.off("pitch", r);
|
|
2568
|
+
};
|
|
2569
|
+
}, [t]), /* @__PURE__ */ J(Or, {
|
|
2570
|
+
onClick: e,
|
|
2571
|
+
label: "Reset bearing to north",
|
|
2572
|
+
children: /* @__PURE__ */ Y("svg", {
|
|
2573
|
+
ref: n,
|
|
2574
|
+
viewBox: "0 0 24 24",
|
|
2575
|
+
className: "size-5 transition-transform duration-200",
|
|
2576
|
+
style: { transformStyle: "preserve-3d" },
|
|
2577
|
+
children: [
|
|
2578
|
+
/* @__PURE__ */ J("path", {
|
|
2579
|
+
d: "M12 2L16 12H12V2Z",
|
|
2580
|
+
className: "fill-red-500"
|
|
2581
|
+
}),
|
|
2582
|
+
/* @__PURE__ */ J("path", {
|
|
2583
|
+
d: "M12 2L8 12H12V2Z",
|
|
2584
|
+
className: "fill-red-300"
|
|
2585
|
+
}),
|
|
2586
|
+
/* @__PURE__ */ J("path", {
|
|
2587
|
+
d: "M12 22L16 12H12V22Z",
|
|
2588
|
+
className: "fill-muted-foreground/60"
|
|
2589
|
+
}),
|
|
2590
|
+
/* @__PURE__ */ J("path", {
|
|
2591
|
+
d: "M12 22L8 12H12V22Z",
|
|
2592
|
+
className: "fill-muted-foreground/30"
|
|
2593
|
+
})
|
|
2594
|
+
]
|
|
2595
|
+
})
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2598
|
+
function Mr({ longitude: e, latitude: t, onClose: n, children: r, className: i, closeButton: a = !1, ...o }) {
|
|
2599
|
+
let { map: c } = $(), l = d(o), f = d(n);
|
|
2600
|
+
f.current = n;
|
|
2601
|
+
let p = u(() => document.createElement("div"), []), m = u(() => new ge.Popup({
|
|
2602
|
+
offset: 16,
|
|
2603
|
+
...o,
|
|
2604
|
+
closeButton: !1
|
|
2605
|
+
}).setMaxWidth("none").setLngLat([e, t]), []);
|
|
2606
|
+
if (s(() => {
|
|
2607
|
+
if (!c) return;
|
|
2608
|
+
let e = () => f.current?.();
|
|
2609
|
+
return m.on("close", e), m.setDOMContent(p), m.addTo(c), () => {
|
|
2610
|
+
m.off("close", e), m.isOpen() && m.remove();
|
|
2611
|
+
};
|
|
2612
|
+
}, [c]), m.isOpen()) {
|
|
2613
|
+
let n = l.current;
|
|
2614
|
+
(m.getLngLat().lng !== e || m.getLngLat().lat !== t) && m.setLngLat([e, t]), n.offset !== o.offset && m.setOffset(o.offset ?? 16), n.maxWidth !== o.maxWidth && o.maxWidth && m.setMaxWidth(o.maxWidth ?? "none"), l.current = o;
|
|
2615
|
+
}
|
|
2616
|
+
return _e(/* @__PURE__ */ Y("div", {
|
|
2617
|
+
className: Z("bg-popover text-popover-foreground relative max-w-62 rounded-md border p-3 shadow-md", "animate-in fade-in-0 zoom-in-95 duration-200 ease-out", i),
|
|
2618
|
+
children: [a && /* @__PURE__ */ J(Sr, { onClick: () => {
|
|
2619
|
+
m.remove();
|
|
2620
|
+
} }), r]
|
|
2621
|
+
}), p);
|
|
2622
|
+
}
|
|
2623
|
+
function Nr({ id: e, coordinates: t, color: n = "#4285F4", width: r = 3, opacity: i = .8, dashArray: a, onClick: o, onMouseEnter: l, onMouseLeave: u, interactive: d = !0 }) {
|
|
2624
|
+
let { map: f, isLoaded: p } = $(), m = c(), h = e ?? m, g = `route-source-${h}`, _ = `route-layer-${h}`;
|
|
2625
|
+
return s(() => {
|
|
2626
|
+
if (!(!p || !f)) return f.addSource(g, {
|
|
2627
|
+
type: "geojson",
|
|
2628
|
+
data: {
|
|
2629
|
+
type: "Feature",
|
|
2630
|
+
properties: {},
|
|
2631
|
+
geometry: {
|
|
2632
|
+
type: "LineString",
|
|
2633
|
+
coordinates: []
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
}), f.addLayer({
|
|
2637
|
+
id: _,
|
|
2638
|
+
type: "line",
|
|
2639
|
+
source: g,
|
|
2640
|
+
layout: {
|
|
2641
|
+
"line-join": "round",
|
|
2642
|
+
"line-cap": "round"
|
|
2643
|
+
},
|
|
2644
|
+
paint: {
|
|
2645
|
+
"line-color": n,
|
|
2646
|
+
"line-width": r,
|
|
2647
|
+
"line-opacity": i,
|
|
2648
|
+
...a && { "line-dasharray": a }
|
|
2649
|
+
}
|
|
2650
|
+
}), () => {
|
|
2651
|
+
try {
|
|
2652
|
+
f.getLayer(_) && f.removeLayer(_), f.getSource(g) && f.removeSource(g);
|
|
2653
|
+
} catch {}
|
|
2654
|
+
};
|
|
2655
|
+
}, [p, f]), s(() => {
|
|
2656
|
+
if (!p || !f || t.length < 2) return;
|
|
2657
|
+
let e = f.getSource(g);
|
|
2658
|
+
e && e.setData({
|
|
2659
|
+
type: "Feature",
|
|
2660
|
+
properties: {},
|
|
2661
|
+
geometry: {
|
|
2662
|
+
type: "LineString",
|
|
2663
|
+
coordinates: t
|
|
2664
|
+
}
|
|
2665
|
+
});
|
|
2666
|
+
}, [
|
|
2667
|
+
p,
|
|
2668
|
+
f,
|
|
2669
|
+
t,
|
|
2670
|
+
g
|
|
2671
|
+
]), s(() => {
|
|
2672
|
+
!p || !f || !f.getLayer(_) || (f.setPaintProperty(_, "line-color", n), f.setPaintProperty(_, "line-width", r), f.setPaintProperty(_, "line-opacity", i), a && f.setPaintProperty(_, "line-dasharray", a));
|
|
2673
|
+
}, [
|
|
2674
|
+
p,
|
|
2675
|
+
f,
|
|
2676
|
+
_,
|
|
2677
|
+
n,
|
|
2678
|
+
r,
|
|
2679
|
+
i,
|
|
2680
|
+
a
|
|
2681
|
+
]), s(() => {
|
|
2682
|
+
if (!p || !f || !d) return;
|
|
2683
|
+
let e = () => {
|
|
2684
|
+
o?.();
|
|
2685
|
+
}, t = () => {
|
|
2686
|
+
f.getCanvas().style.cursor = "pointer", l?.();
|
|
2687
|
+
}, n = () => {
|
|
2688
|
+
f.getCanvas().style.cursor = "", u?.();
|
|
2689
|
+
};
|
|
2690
|
+
return f.on("click", _, e), f.on("mouseenter", _, t), f.on("mouseleave", _, n), () => {
|
|
2691
|
+
f.off("click", _, e), f.off("mouseenter", _, t), f.off("mouseleave", _, n);
|
|
2692
|
+
};
|
|
2693
|
+
}, [
|
|
2694
|
+
p,
|
|
2695
|
+
f,
|
|
2696
|
+
_,
|
|
2697
|
+
o,
|
|
2698
|
+
l,
|
|
2699
|
+
u,
|
|
2700
|
+
d
|
|
2701
|
+
]), null;
|
|
2702
|
+
}
|
|
2703
|
+
var Pr = .2, Fr = 64, Ir = 12, Lr = 6, Rr = {
|
|
2704
|
+
"line-color": "#4285F4",
|
|
2705
|
+
"line-width": 2,
|
|
2706
|
+
"line-opacity": .85
|
|
2707
|
+
}, zr = {
|
|
2708
|
+
"line-join": "round",
|
|
2709
|
+
"line-cap": "round"
|
|
2710
|
+
};
|
|
2711
|
+
function Br(e, t) {
|
|
2712
|
+
if (!t) return e;
|
|
2713
|
+
let n = { ...e };
|
|
2714
|
+
for (let [e, r] of Object.entries(t)) {
|
|
2715
|
+
if (r === void 0) continue;
|
|
2716
|
+
let t = n[e];
|
|
2717
|
+
n[e] = t === void 0 ? r : [
|
|
2718
|
+
"case",
|
|
2719
|
+
[
|
|
2720
|
+
"boolean",
|
|
2721
|
+
["feature-state", "hover"],
|
|
2722
|
+
!1
|
|
2723
|
+
],
|
|
2724
|
+
r,
|
|
2725
|
+
t
|
|
2726
|
+
];
|
|
2727
|
+
}
|
|
2728
|
+
return n;
|
|
2729
|
+
}
|
|
2730
|
+
function Vr(e, t, n, r) {
|
|
2731
|
+
let [i, a] = e, [o, s] = t, c = o - i, l = s - a, u = Math.hypot(c, l);
|
|
2732
|
+
if (u === 0 || n === 0) return [e, t];
|
|
2733
|
+
let d = (i + o) / 2, f = (a + s) / 2, p = -l / u, m = c / u, h = u * n, g = d + p * h, _ = f + m * h, v = [], y = Math.max(2, Math.floor(r));
|
|
2734
|
+
for (let e = 0; e <= y; e += 1) {
|
|
2735
|
+
let t = e / y, n = 1 - t, r = n * n * i + 2 * n * t * g + t * t * o, c = n * n * a + 2 * n * t * _ + t * t * s;
|
|
2736
|
+
v.push([r, c]);
|
|
2737
|
+
}
|
|
2738
|
+
return v;
|
|
2739
|
+
}
|
|
2740
|
+
function Hr({ data: e, id: t, curvature: n = Pr, samples: r = Fr, paint: i, layout: a, hoverPaint: o, onClick: l, onHover: f, interactive: p = !0, beforeId: m }) {
|
|
2741
|
+
let { map: h, isLoaded: g } = $(), _ = c(), v = t ?? _, y = `arc-source-${v}`, b = `arc-layer-${v}`, x = `arc-hit-layer-${v}`, S = u(() => Br({
|
|
2742
|
+
...Rr,
|
|
2743
|
+
...i
|
|
2744
|
+
}, o), [i, o]), C = u(() => ({
|
|
2745
|
+
...zr,
|
|
2746
|
+
...a
|
|
2747
|
+
}), [a]), w = u(() => {
|
|
2748
|
+
let e = i?.["line-width"] ?? Rr["line-width"];
|
|
2749
|
+
return Math.max((typeof e == "number" ? e : Ir) + Lr, Ir);
|
|
2750
|
+
}, [i]), T = u(() => ({
|
|
2751
|
+
type: "FeatureCollection",
|
|
2752
|
+
features: e.map((e) => {
|
|
2753
|
+
let { from: t, to: i, ...a } = e;
|
|
2754
|
+
return {
|
|
2755
|
+
type: "Feature",
|
|
2756
|
+
properties: a,
|
|
2757
|
+
geometry: {
|
|
2758
|
+
type: "LineString",
|
|
2759
|
+
coordinates: Vr(t, i, n, r)
|
|
2760
|
+
}
|
|
2761
|
+
};
|
|
2762
|
+
})
|
|
2763
|
+
}), [
|
|
2764
|
+
e,
|
|
2765
|
+
n,
|
|
2766
|
+
r
|
|
2767
|
+
]), E = d({
|
|
2768
|
+
data: e,
|
|
2769
|
+
onClick: l,
|
|
2770
|
+
onHover: f
|
|
2771
|
+
});
|
|
2772
|
+
return E.current = {
|
|
2773
|
+
data: e,
|
|
2774
|
+
onClick: l,
|
|
2775
|
+
onHover: f
|
|
2776
|
+
}, s(() => {
|
|
2777
|
+
if (!(!g || !h)) return h.addSource(y, {
|
|
2778
|
+
type: "geojson",
|
|
2779
|
+
data: T,
|
|
2780
|
+
promoteId: "id"
|
|
2781
|
+
}), h.addLayer({
|
|
2782
|
+
id: x,
|
|
2783
|
+
type: "line",
|
|
2784
|
+
source: y,
|
|
2785
|
+
layout: zr,
|
|
2786
|
+
paint: {
|
|
2787
|
+
"line-color": "rgba(0, 0, 0, 0)",
|
|
2788
|
+
"line-width": w,
|
|
2789
|
+
"line-opacity": 1
|
|
2790
|
+
}
|
|
2791
|
+
}, m), h.addLayer({
|
|
2792
|
+
id: b,
|
|
2793
|
+
type: "line",
|
|
2794
|
+
source: y,
|
|
2795
|
+
layout: C,
|
|
2796
|
+
paint: S
|
|
2797
|
+
}, m), () => {
|
|
2798
|
+
try {
|
|
2799
|
+
h.getLayer(b) && h.removeLayer(b), h.getLayer(x) && h.removeLayer(x), h.getSource(y) && h.removeSource(y);
|
|
2800
|
+
} catch {}
|
|
2801
|
+
};
|
|
2802
|
+
}, [g, h]), s(() => {
|
|
2803
|
+
!g || !h || h.getSource(y)?.setData(T);
|
|
2804
|
+
}, [
|
|
2805
|
+
g,
|
|
2806
|
+
h,
|
|
2807
|
+
T,
|
|
2808
|
+
y
|
|
2809
|
+
]), s(() => {
|
|
2810
|
+
if (!(!g || !h || !h.getLayer(b))) {
|
|
2811
|
+
for (let [e, t] of Object.entries(S)) h.setPaintProperty(b, e, t);
|
|
2812
|
+
for (let [e, t] of Object.entries(C)) h.setLayoutProperty(b, e, t);
|
|
2813
|
+
h.getLayer(x) && h.setPaintProperty(x, "line-width", w);
|
|
2814
|
+
}
|
|
2815
|
+
}, [
|
|
2816
|
+
g,
|
|
2817
|
+
h,
|
|
2818
|
+
b,
|
|
2819
|
+
x,
|
|
2820
|
+
S,
|
|
2821
|
+
C,
|
|
2822
|
+
w
|
|
2823
|
+
]), s(() => {
|
|
2824
|
+
if (!g || !h || !p) return;
|
|
2825
|
+
let e = null, t = (t) => {
|
|
2826
|
+
if (t === e) return;
|
|
2827
|
+
let n = !!h.getSource(y);
|
|
2828
|
+
e != null && n && h.setFeatureState({
|
|
2829
|
+
source: y,
|
|
2830
|
+
id: e
|
|
2831
|
+
}, { hover: !1 }), e = t, t != null && n && h.setFeatureState({
|
|
2832
|
+
source: y,
|
|
2833
|
+
id: t
|
|
2834
|
+
}, { hover: !0 });
|
|
2835
|
+
}, n = (e) => e == null ? void 0 : E.current.data.find((t) => String(t.id) === String(e)), r = (r) => {
|
|
2836
|
+
let i = r.features?.[0]?.id;
|
|
2837
|
+
if (i == null || i === e) return;
|
|
2838
|
+
t(i), h.getCanvas().style.cursor = "pointer";
|
|
2839
|
+
let a = n(i);
|
|
2840
|
+
a && E.current.onHover?.({
|
|
2841
|
+
arc: a,
|
|
2842
|
+
longitude: r.lngLat.lng,
|
|
2843
|
+
latitude: r.lngLat.lat,
|
|
2844
|
+
originalEvent: r
|
|
2845
|
+
});
|
|
2846
|
+
}, i = () => {
|
|
2847
|
+
t(null), h.getCanvas().style.cursor = "", E.current.onHover?.(null);
|
|
2848
|
+
}, a = (e) => {
|
|
2849
|
+
let t = n(e.features?.[0]?.id);
|
|
2850
|
+
t && E.current.onClick?.({
|
|
2851
|
+
arc: t,
|
|
2852
|
+
longitude: e.lngLat.lng,
|
|
2853
|
+
latitude: e.lngLat.lat,
|
|
2854
|
+
originalEvent: e
|
|
2855
|
+
});
|
|
2856
|
+
};
|
|
2857
|
+
return h.on("mousemove", x, r), h.on("mouseleave", x, i), h.on("click", x, a), () => {
|
|
2858
|
+
h.off("mousemove", x, r), h.off("mouseleave", x, i), h.off("click", x, a), t(null), h.getCanvas().style.cursor = "";
|
|
2859
|
+
};
|
|
2860
|
+
}, [
|
|
2861
|
+
g,
|
|
2862
|
+
h,
|
|
2863
|
+
x,
|
|
2864
|
+
y,
|
|
2865
|
+
p
|
|
2866
|
+
]), null;
|
|
2867
|
+
}
|
|
2868
|
+
function Ur({ data: e, clusterMaxZoom: t = 14, clusterRadius: n = 50, clusterColors: r = [
|
|
2869
|
+
"#22c55e",
|
|
2870
|
+
"#eab308",
|
|
2871
|
+
"#ef4444"
|
|
2872
|
+
], clusterThresholds: i = [100, 750], pointColor: a = "#3b82f6", onPointClick: o, onClusterClick: l }) {
|
|
2873
|
+
let { map: u, isLoaded: f } = $(), p = c(), m = `cluster-source-${p}`, h = `clusters-${p}`, g = `cluster-count-${p}`, _ = `unclustered-point-${p}`, v = d({
|
|
2874
|
+
clusterColors: r,
|
|
2875
|
+
clusterThresholds: i,
|
|
2876
|
+
pointColor: a
|
|
2877
|
+
});
|
|
2878
|
+
return s(() => {
|
|
2879
|
+
if (!(!f || !u)) return u.addSource(m, {
|
|
2880
|
+
type: "geojson",
|
|
2881
|
+
data: e,
|
|
2882
|
+
cluster: !0,
|
|
2883
|
+
clusterMaxZoom: t,
|
|
2884
|
+
clusterRadius: n
|
|
2885
|
+
}), u.addLayer({
|
|
2886
|
+
id: h,
|
|
2887
|
+
type: "circle",
|
|
2888
|
+
source: m,
|
|
2889
|
+
filter: ["has", "point_count"],
|
|
2890
|
+
paint: {
|
|
2891
|
+
"circle-color": [
|
|
2892
|
+
"step",
|
|
2893
|
+
["get", "point_count"],
|
|
2894
|
+
r[0],
|
|
2895
|
+
i[0],
|
|
2896
|
+
r[1],
|
|
2897
|
+
i[1],
|
|
2898
|
+
r[2]
|
|
2899
|
+
],
|
|
2900
|
+
"circle-radius": [
|
|
2901
|
+
"step",
|
|
2902
|
+
["get", "point_count"],
|
|
2903
|
+
20,
|
|
2904
|
+
i[0],
|
|
2905
|
+
30,
|
|
2906
|
+
i[1],
|
|
2907
|
+
40
|
|
2908
|
+
],
|
|
2909
|
+
"circle-stroke-width": 1,
|
|
2910
|
+
"circle-stroke-color": "#fff",
|
|
2911
|
+
"circle-opacity": .85
|
|
2912
|
+
}
|
|
2913
|
+
}), u.addLayer({
|
|
2914
|
+
id: g,
|
|
2915
|
+
type: "symbol",
|
|
2916
|
+
source: m,
|
|
2917
|
+
filter: ["has", "point_count"],
|
|
2918
|
+
layout: {
|
|
2919
|
+
"text-field": "{point_count_abbreviated}",
|
|
2920
|
+
"text-font": ["Open Sans"],
|
|
2921
|
+
"text-size": 12
|
|
2922
|
+
},
|
|
2923
|
+
paint: { "text-color": "#fff" }
|
|
2924
|
+
}), u.addLayer({
|
|
2925
|
+
id: _,
|
|
2926
|
+
type: "circle",
|
|
2927
|
+
source: m,
|
|
2928
|
+
filter: ["!", ["has", "point_count"]],
|
|
2929
|
+
paint: {
|
|
2930
|
+
"circle-color": a,
|
|
2931
|
+
"circle-radius": 5,
|
|
2932
|
+
"circle-stroke-width": 2,
|
|
2933
|
+
"circle-stroke-color": "#fff"
|
|
2934
|
+
}
|
|
2935
|
+
}), () => {
|
|
2936
|
+
try {
|
|
2937
|
+
u.getLayer(g) && u.removeLayer(g), u.getLayer(_) && u.removeLayer(_), u.getLayer(h) && u.removeLayer(h), u.getSource(m) && u.removeSource(m);
|
|
2938
|
+
} catch {}
|
|
2939
|
+
};
|
|
2940
|
+
}, [
|
|
2941
|
+
f,
|
|
2942
|
+
u,
|
|
2943
|
+
m
|
|
2944
|
+
]), s(() => {
|
|
2945
|
+
if (!f || !u || typeof e == "string") return;
|
|
2946
|
+
let t = u.getSource(m);
|
|
2947
|
+
t && t.setData(e);
|
|
2948
|
+
}, [
|
|
2949
|
+
f,
|
|
2950
|
+
u,
|
|
2951
|
+
e,
|
|
2952
|
+
m
|
|
2953
|
+
]), s(() => {
|
|
2954
|
+
if (!f || !u) return;
|
|
2955
|
+
let e = v.current, t = e.clusterColors !== r || e.clusterThresholds !== i;
|
|
2956
|
+
u.getLayer(h) && t && (u.setPaintProperty(h, "circle-color", [
|
|
2957
|
+
"step",
|
|
2958
|
+
["get", "point_count"],
|
|
2959
|
+
r[0],
|
|
2960
|
+
i[0],
|
|
2961
|
+
r[1],
|
|
2962
|
+
i[1],
|
|
2963
|
+
r[2]
|
|
2964
|
+
]), u.setPaintProperty(h, "circle-radius", [
|
|
2965
|
+
"step",
|
|
2966
|
+
["get", "point_count"],
|
|
2967
|
+
20,
|
|
2968
|
+
i[0],
|
|
2969
|
+
30,
|
|
2970
|
+
i[1],
|
|
2971
|
+
40
|
|
2972
|
+
])), u.getLayer(_) && e.pointColor !== a && u.setPaintProperty(_, "circle-color", a), v.current = {
|
|
2973
|
+
clusterColors: r,
|
|
2974
|
+
clusterThresholds: i,
|
|
2975
|
+
pointColor: a
|
|
2976
|
+
};
|
|
2977
|
+
}, [
|
|
2978
|
+
f,
|
|
2979
|
+
u,
|
|
2980
|
+
h,
|
|
2981
|
+
_,
|
|
2982
|
+
r,
|
|
2983
|
+
i,
|
|
2984
|
+
a
|
|
2985
|
+
]), s(() => {
|
|
2986
|
+
if (!f || !u) return;
|
|
2987
|
+
let e = async (e) => {
|
|
2988
|
+
let t = u.queryRenderedFeatures(e.point, { layers: [h] });
|
|
2989
|
+
if (!t.length) return;
|
|
2990
|
+
let n = t[0], r = n.properties?.cluster_id, i = n.properties?.point_count, a = n.geometry.coordinates;
|
|
2991
|
+
if (l) l(r, a, i);
|
|
2992
|
+
else {
|
|
2993
|
+
let e = await u.getSource(m).getClusterExpansionZoom(r);
|
|
2994
|
+
u.easeTo({
|
|
2995
|
+
center: a,
|
|
2996
|
+
zoom: e
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
}, t = (e) => {
|
|
3000
|
+
if (!o || !e.features?.length) return;
|
|
3001
|
+
let t = e.features[0], n = t.geometry.coordinates.slice();
|
|
3002
|
+
for (; Math.abs(e.lngLat.lng - n[0]) > 180;) n[0] += e.lngLat.lng > n[0] ? 360 : -360;
|
|
3003
|
+
o(t, n);
|
|
3004
|
+
}, n = () => {
|
|
3005
|
+
u.getCanvas().style.cursor = "pointer";
|
|
3006
|
+
}, r = () => {
|
|
3007
|
+
u.getCanvas().style.cursor = "";
|
|
3008
|
+
}, i = () => {
|
|
3009
|
+
o && (u.getCanvas().style.cursor = "pointer");
|
|
3010
|
+
}, a = () => {
|
|
3011
|
+
u.getCanvas().style.cursor = "";
|
|
3012
|
+
};
|
|
3013
|
+
return u.on("click", h, e), u.on("click", _, t), u.on("mouseenter", h, n), u.on("mouseleave", h, r), u.on("mouseenter", _, i), u.on("mouseleave", _, a), () => {
|
|
3014
|
+
u.off("click", h, e), u.off("click", _, t), u.off("mouseenter", h, n), u.off("mouseleave", h, r), u.off("mouseenter", _, i), u.off("mouseleave", _, a);
|
|
3015
|
+
};
|
|
3016
|
+
}, [
|
|
3017
|
+
f,
|
|
3018
|
+
u,
|
|
3019
|
+
h,
|
|
3020
|
+
_,
|
|
3021
|
+
m,
|
|
3022
|
+
l,
|
|
3023
|
+
o
|
|
3024
|
+
]), null;
|
|
3025
|
+
}
|
|
3026
|
+
//#endregion
|
|
3027
|
+
//#region src/components/ui/progress.tsx
|
|
3028
|
+
function Wr({ className: e, value: t, ...n }) {
|
|
3029
|
+
return /* @__PURE__ */ J(V.Root, {
|
|
3030
|
+
"data-slot": "progress",
|
|
3031
|
+
className: Z("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted", e),
|
|
3032
|
+
...n,
|
|
3033
|
+
children: /* @__PURE__ */ J(V.Indicator, {
|
|
3034
|
+
"data-slot": "progress-indicator",
|
|
3035
|
+
className: "size-full flex-1 bg-primary transition-all",
|
|
3036
|
+
style: { transform: `translateX(-${100 - (t || 0)}%)` }
|
|
3037
|
+
})
|
|
3038
|
+
});
|
|
3039
|
+
}
|
|
3040
|
+
//#endregion
|
|
3041
|
+
//#region src/components/ui/radio-group.tsx
|
|
3042
|
+
function Gr({ className: e, ...t }) {
|
|
3043
|
+
return /* @__PURE__ */ J(H.Root, {
|
|
3044
|
+
"data-slot": "radio-group",
|
|
3045
|
+
className: Z("grid w-full gap-2", e),
|
|
3046
|
+
...t
|
|
3047
|
+
});
|
|
3048
|
+
}
|
|
3049
|
+
function Kr({ className: e, ...t }) {
|
|
3050
|
+
return /* @__PURE__ */ J(H.Item, {
|
|
3051
|
+
"data-slot": "radio-group-item",
|
|
3052
|
+
className: Z("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", e),
|
|
3053
|
+
...t,
|
|
3054
|
+
children: /* @__PURE__ */ J(H.Indicator, {
|
|
3055
|
+
"data-slot": "radio-group-indicator",
|
|
3056
|
+
className: "flex size-4 items-center justify-center",
|
|
3057
|
+
children: /* @__PURE__ */ J("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" })
|
|
3058
|
+
})
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
//#endregion
|
|
3062
|
+
//#region src/components/ui/select.tsx
|
|
3063
|
+
function qr({ ...e }) {
|
|
3064
|
+
return /* @__PURE__ */ J(U.Root, {
|
|
3065
|
+
"data-slot": "select",
|
|
3066
|
+
...e
|
|
3067
|
+
});
|
|
3068
|
+
}
|
|
3069
|
+
function Jr({ className: e, ...t }) {
|
|
3070
|
+
return /* @__PURE__ */ J(U.Group, {
|
|
3071
|
+
"data-slot": "select-group",
|
|
3072
|
+
className: Z("scroll-my-1 p-1", e),
|
|
3073
|
+
...t
|
|
3074
|
+
});
|
|
3075
|
+
}
|
|
3076
|
+
function Yr({ ...e }) {
|
|
3077
|
+
return /* @__PURE__ */ J(U.Value, {
|
|
3078
|
+
"data-slot": "select-value",
|
|
3079
|
+
...e
|
|
3080
|
+
});
|
|
3081
|
+
}
|
|
3082
|
+
function Xr({ className: e, size: t = "default", children: n, ...r }) {
|
|
3083
|
+
return /* @__PURE__ */ Y(U.Trigger, {
|
|
3084
|
+
"data-slot": "select-trigger",
|
|
3085
|
+
"data-size": t,
|
|
3086
|
+
className: Z("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
|
|
3087
|
+
...r,
|
|
3088
|
+
children: [n, /* @__PURE__ */ J(U.Icon, {
|
|
3089
|
+
asChild: !0,
|
|
3090
|
+
children: /* @__PURE__ */ J(_, { className: "pointer-events-none size-4 text-muted-foreground" })
|
|
3091
|
+
})]
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
function Zr({ className: e, children: t, position: n = "item-aligned", align: r = "center", ...i }) {
|
|
3095
|
+
return /* @__PURE__ */ J(U.Portal, { children: /* @__PURE__ */ Y(U.Content, {
|
|
3096
|
+
"data-slot": "select-content",
|
|
3097
|
+
"data-align-trigger": n === "item-aligned",
|
|
3098
|
+
className: Z("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
|
|
3099
|
+
position: n,
|
|
3100
|
+
align: r,
|
|
3101
|
+
...i,
|
|
3102
|
+
children: [
|
|
3103
|
+
/* @__PURE__ */ J(ti, {}),
|
|
3104
|
+
/* @__PURE__ */ J(U.Viewport, {
|
|
3105
|
+
"data-position": n,
|
|
3106
|
+
className: Z("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", n === "popper" && ""),
|
|
3107
|
+
children: t
|
|
3108
|
+
}),
|
|
3109
|
+
/* @__PURE__ */ J(ni, {})
|
|
3110
|
+
]
|
|
3111
|
+
}) });
|
|
3112
|
+
}
|
|
3113
|
+
function Qr({ className: e, ...t }) {
|
|
3114
|
+
return /* @__PURE__ */ J(U.Label, {
|
|
3115
|
+
"data-slot": "select-label",
|
|
3116
|
+
className: Z("px-1.5 py-1 text-xs text-muted-foreground", e),
|
|
3117
|
+
...t
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
3120
|
+
function $r({ className: e, children: t, ...n }) {
|
|
3121
|
+
return /* @__PURE__ */ Y(U.Item, {
|
|
3122
|
+
"data-slot": "select-item",
|
|
3123
|
+
className: Z("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", e),
|
|
3124
|
+
...n,
|
|
3125
|
+
children: [/* @__PURE__ */ J("span", {
|
|
3126
|
+
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center",
|
|
3127
|
+
children: /* @__PURE__ */ J(U.ItemIndicator, { children: /* @__PURE__ */ J(h, { className: "pointer-events-none" }) })
|
|
3128
|
+
}), /* @__PURE__ */ J(U.ItemText, { children: t })]
|
|
3129
|
+
});
|
|
3130
|
+
}
|
|
3131
|
+
function ei({ className: e, ...t }) {
|
|
3132
|
+
return /* @__PURE__ */ J(U.Separator, {
|
|
3133
|
+
"data-slot": "select-separator",
|
|
3134
|
+
className: Z("pointer-events-none -mx-1 my-1 h-px bg-border", e),
|
|
3135
|
+
...t
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
3138
|
+
function ti({ className: e, ...t }) {
|
|
3139
|
+
return /* @__PURE__ */ J(U.ScrollUpButton, {
|
|
3140
|
+
"data-slot": "select-scroll-up-button",
|
|
3141
|
+
className: Z("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", e),
|
|
3142
|
+
...t,
|
|
3143
|
+
children: /* @__PURE__ */ J(b, {})
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
function ni({ className: e, ...t }) {
|
|
3147
|
+
return /* @__PURE__ */ J(U.ScrollDownButton, {
|
|
3148
|
+
"data-slot": "select-scroll-down-button",
|
|
3149
|
+
className: Z("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", e),
|
|
3150
|
+
...t,
|
|
3151
|
+
children: /* @__PURE__ */ J(_, {})
|
|
3152
|
+
});
|
|
3153
|
+
}
|
|
3154
|
+
//#endregion
|
|
3155
|
+
//#region src/components/ui/sheet.tsx
|
|
3156
|
+
function ri({ ...e }) {
|
|
3157
|
+
return /* @__PURE__ */ J(L.Root, {
|
|
3158
|
+
"data-slot": "sheet",
|
|
3159
|
+
...e
|
|
3160
|
+
});
|
|
3161
|
+
}
|
|
3162
|
+
function ii({ ...e }) {
|
|
3163
|
+
return /* @__PURE__ */ J(L.Trigger, {
|
|
3164
|
+
"data-slot": "sheet-trigger",
|
|
3165
|
+
...e
|
|
3166
|
+
});
|
|
3167
|
+
}
|
|
3168
|
+
function ai({ ...e }) {
|
|
3169
|
+
return /* @__PURE__ */ J(L.Close, {
|
|
3170
|
+
"data-slot": "sheet-close",
|
|
3171
|
+
...e
|
|
3172
|
+
});
|
|
3173
|
+
}
|
|
3174
|
+
function oi({ ...e }) {
|
|
3175
|
+
return /* @__PURE__ */ J(L.Portal, {
|
|
3176
|
+
"data-slot": "sheet-portal",
|
|
3177
|
+
...e
|
|
3178
|
+
});
|
|
3179
|
+
}
|
|
3180
|
+
function si({ className: e, ...t }) {
|
|
3181
|
+
return /* @__PURE__ */ J(L.Overlay, {
|
|
3182
|
+
"data-slot": "sheet-overlay",
|
|
3183
|
+
className: Z("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
|
|
3184
|
+
...t
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
function ci({ className: e, children: t, side: n = "right", showCloseButton: r = !0, ...i }) {
|
|
3188
|
+
return /* @__PURE__ */ Y(oi, { children: [/* @__PURE__ */ J(si, {}), /* @__PURE__ */ Y(L.Content, {
|
|
3189
|
+
"data-slot": "sheet-content",
|
|
3190
|
+
"data-side": n,
|
|
3191
|
+
className: Z("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10", e),
|
|
3192
|
+
...i,
|
|
3193
|
+
children: [t, r && /* @__PURE__ */ J(L.Close, {
|
|
3194
|
+
"data-slot": "sheet-close",
|
|
3195
|
+
asChild: !0,
|
|
3196
|
+
children: /* @__PURE__ */ Y(Q, {
|
|
3197
|
+
variant: "ghost",
|
|
3198
|
+
className: "absolute top-3 right-3",
|
|
3199
|
+
size: "icon-sm",
|
|
3200
|
+
children: [/* @__PURE__ */ J(oe, {}), /* @__PURE__ */ J("span", {
|
|
3201
|
+
className: "sr-only",
|
|
3202
|
+
children: "Close"
|
|
3203
|
+
})]
|
|
3204
|
+
})
|
|
3205
|
+
})]
|
|
3206
|
+
})] });
|
|
3207
|
+
}
|
|
3208
|
+
function li({ className: e, ...t }) {
|
|
3209
|
+
return /* @__PURE__ */ J("div", {
|
|
3210
|
+
"data-slot": "sheet-header",
|
|
3211
|
+
className: Z("flex flex-col gap-0.5 p-4", e),
|
|
3212
|
+
...t
|
|
3213
|
+
});
|
|
3214
|
+
}
|
|
3215
|
+
function ui({ className: e, ...t }) {
|
|
3216
|
+
return /* @__PURE__ */ J("div", {
|
|
3217
|
+
"data-slot": "sheet-footer",
|
|
3218
|
+
className: Z("mt-auto flex flex-col gap-2 p-4", e),
|
|
3219
|
+
...t
|
|
3220
|
+
});
|
|
3221
|
+
}
|
|
3222
|
+
function di({ className: e, ...t }) {
|
|
3223
|
+
return /* @__PURE__ */ J(L.Title, {
|
|
3224
|
+
"data-slot": "sheet-title",
|
|
3225
|
+
className: Z("text-base font-medium text-foreground", e),
|
|
3226
|
+
...t
|
|
3227
|
+
});
|
|
3228
|
+
}
|
|
3229
|
+
function fi({ className: e, ...t }) {
|
|
3230
|
+
return /* @__PURE__ */ J(L.Description, {
|
|
3231
|
+
"data-slot": "sheet-description",
|
|
3232
|
+
className: Z("text-sm text-muted-foreground", e),
|
|
3233
|
+
...t
|
|
3234
|
+
});
|
|
3235
|
+
}
|
|
3236
|
+
//#endregion
|
|
3237
|
+
//#region src/components/ui/slider.tsx
|
|
3238
|
+
function pi({ className: e, defaultValue: t, value: r, min: i = 0, max: a = 100, ...o }) {
|
|
3239
|
+
let s = n.useMemo(() => Array.isArray(r) ? r : Array.isArray(t) ? t : [i, a], [
|
|
3240
|
+
r,
|
|
3241
|
+
t,
|
|
3242
|
+
i,
|
|
3243
|
+
a
|
|
3244
|
+
]);
|
|
3245
|
+
return /* @__PURE__ */ Y(W.Root, {
|
|
3246
|
+
"data-slot": "slider",
|
|
3247
|
+
defaultValue: t,
|
|
3248
|
+
value: r,
|
|
3249
|
+
min: i,
|
|
3250
|
+
max: a,
|
|
3251
|
+
className: Z("relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col", e),
|
|
3252
|
+
...o,
|
|
3253
|
+
children: [/* @__PURE__ */ J(W.Track, {
|
|
3254
|
+
"data-slot": "slider-track",
|
|
3255
|
+
className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
|
|
3256
|
+
children: /* @__PURE__ */ J(W.Range, {
|
|
3257
|
+
"data-slot": "slider-range",
|
|
3258
|
+
className: "absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full"
|
|
3259
|
+
})
|
|
3260
|
+
}), Array.from({ length: s.length }, (e, t) => /* @__PURE__ */ J(W.Thumb, {
|
|
3261
|
+
"data-slot": "slider-thumb",
|
|
3262
|
+
className: "relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"
|
|
3263
|
+
}, t))]
|
|
3264
|
+
});
|
|
3265
|
+
}
|
|
3266
|
+
//#endregion
|
|
3267
|
+
//#region src/components/ui/sonner.tsx
|
|
3268
|
+
var mi = ({ ...e }) => {
|
|
3269
|
+
let { theme: t = "system" } = ve();
|
|
3270
|
+
return /* @__PURE__ */ J(ye, {
|
|
3271
|
+
theme: t,
|
|
3272
|
+
className: "toaster group",
|
|
3273
|
+
icons: {
|
|
3274
|
+
success: /* @__PURE__ */ J(x, { className: "size-4" }),
|
|
3275
|
+
info: /* @__PURE__ */ J(T, { className: "size-4" }),
|
|
3276
|
+
warning: /* @__PURE__ */ J(ie, { className: "size-4" }),
|
|
3277
|
+
error: /* @__PURE__ */ J(M, { className: "size-4" }),
|
|
3278
|
+
loading: /* @__PURE__ */ J(D, { className: "size-4 animate-spin" })
|
|
3279
|
+
},
|
|
3280
|
+
style: {
|
|
3281
|
+
"--normal-bg": "var(--popover)",
|
|
3282
|
+
"--normal-text": "var(--popover-foreground)",
|
|
3283
|
+
"--normal-border": "var(--border)",
|
|
3284
|
+
"--border-radius": "var(--radius)"
|
|
3285
|
+
},
|
|
3286
|
+
toastOptions: { classNames: { toast: "cn-toast" } },
|
|
3287
|
+
...e
|
|
3288
|
+
});
|
|
3289
|
+
}, hi = r(void 0), gi = r(void 0), _i = () => {
|
|
3290
|
+
let e = o(hi);
|
|
3291
|
+
if (!e) throw Error("useStepper must be used within a Stepper");
|
|
3292
|
+
return e;
|
|
3293
|
+
}, vi = () => {
|
|
3294
|
+
let e = o(gi);
|
|
3295
|
+
if (!e) throw Error("useStepItem must be used within a StepperItem");
|
|
3296
|
+
return e;
|
|
3297
|
+
};
|
|
3298
|
+
function yi({ defaultValue: e = 0, value: t, onValueChange: r, orientation: i = "horizontal", className: a, ...o }) {
|
|
3299
|
+
let [s, c] = n.useState(e), l = n.useCallback((e) => {
|
|
3300
|
+
t === void 0 && c(e), r?.(e);
|
|
3301
|
+
}, [t, r]), u = t ?? s;
|
|
3302
|
+
return /* @__PURE__ */ J(hi.Provider, {
|
|
3303
|
+
value: {
|
|
3304
|
+
activeStep: u,
|
|
3305
|
+
orientation: i,
|
|
3306
|
+
setActiveStep: l
|
|
3307
|
+
},
|
|
3308
|
+
children: /* @__PURE__ */ J("div", {
|
|
3309
|
+
className: Z("group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col", a),
|
|
3310
|
+
"data-orientation": i,
|
|
3311
|
+
"data-slot": "stepper",
|
|
3312
|
+
...o
|
|
3313
|
+
})
|
|
3314
|
+
});
|
|
3315
|
+
}
|
|
3316
|
+
function bi({ step: e, completed: t = !1, disabled: n = !1, loading: r = !1, className: i, children: a, ...o }) {
|
|
3317
|
+
let { activeStep: s } = _i(), c = t || e < s ? "completed" : s === e ? "active" : "inactive", l = r && e === s;
|
|
3318
|
+
return /* @__PURE__ */ J(gi.Provider, {
|
|
3319
|
+
value: {
|
|
3320
|
+
isDisabled: n,
|
|
3321
|
+
isLoading: l,
|
|
3322
|
+
state: c,
|
|
3323
|
+
step: e
|
|
3324
|
+
},
|
|
3325
|
+
children: /* @__PURE__ */ J("div", {
|
|
3326
|
+
className: Z("group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row group-data-[orientation=vertical]/stepper:flex-col", i),
|
|
3327
|
+
"data-slot": "stepper-item",
|
|
3328
|
+
"data-state": c,
|
|
3329
|
+
...l ? { "data-loading": !0 } : {},
|
|
3330
|
+
...o,
|
|
3331
|
+
children: a
|
|
3332
|
+
})
|
|
3333
|
+
});
|
|
3334
|
+
}
|
|
3335
|
+
function xi({ asChild: e = !1, className: t, children: n, ...r }) {
|
|
3336
|
+
let { setActiveStep: i } = _i(), { step: a, isDisabled: o } = vi();
|
|
3337
|
+
return e ? /* @__PURE__ */ J(e ? G.Root : "span", {
|
|
3338
|
+
className: t,
|
|
3339
|
+
"data-slot": "stepper-trigger",
|
|
3340
|
+
children: n
|
|
3341
|
+
}) : /* @__PURE__ */ J("button", {
|
|
3342
|
+
className: Z("inline-flex items-center gap-3 rounded-full outline-none focus-visible:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50", t),
|
|
3343
|
+
"data-slot": "stepper-trigger",
|
|
3344
|
+
disabled: o,
|
|
3345
|
+
onClick: () => i(a),
|
|
3346
|
+
type: "button",
|
|
3347
|
+
...r,
|
|
3348
|
+
children: n
|
|
3349
|
+
});
|
|
3350
|
+
}
|
|
3351
|
+
function Si({ asChild: e = !1, className: t, children: n, ...r }) {
|
|
3352
|
+
let { state: i, step: a, isLoading: o } = vi();
|
|
3353
|
+
return /* @__PURE__ */ J("span", {
|
|
3354
|
+
className: Z("relative flex size-6 shrink-0 items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs data-[state=active]:bg-primary data-[state=completed]:bg-primary data-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground", t),
|
|
3355
|
+
"data-slot": "stepper-indicator",
|
|
3356
|
+
"data-state": i,
|
|
3357
|
+
...r,
|
|
3358
|
+
children: e ? n : /* @__PURE__ */ Y(fe, { children: [
|
|
3359
|
+
/* @__PURE__ */ J("span", {
|
|
3360
|
+
className: "transition-all group-data-[state=completed]/step:scale-0 group-data-loading/step:scale-0 group-data-[state=completed]/step:opacity-0 group-data-loading/step:opacity-0 group-data-loading/step:transition-none",
|
|
3361
|
+
children: a
|
|
3362
|
+
}),
|
|
3363
|
+
/* @__PURE__ */ J(h, {
|
|
3364
|
+
"aria-hidden": "true",
|
|
3365
|
+
className: "absolute scale-0 opacity-0 transition-all group-data-[state=completed]/step:scale-100 group-data-[state=completed]/step:opacity-100",
|
|
3366
|
+
size: 16
|
|
3367
|
+
}),
|
|
3368
|
+
o && /* @__PURE__ */ J("span", {
|
|
3369
|
+
className: "absolute transition-all",
|
|
3370
|
+
children: /* @__PURE__ */ J(O, {
|
|
3371
|
+
"aria-hidden": "true",
|
|
3372
|
+
className: "animate-spin",
|
|
3373
|
+
size: 14
|
|
3374
|
+
})
|
|
3375
|
+
})
|
|
3376
|
+
] })
|
|
3377
|
+
});
|
|
3378
|
+
}
|
|
3379
|
+
function Ci({ className: e, ...t }) {
|
|
3380
|
+
return /* @__PURE__ */ J("h3", {
|
|
3381
|
+
className: Z("font-medium text-sm", e),
|
|
3382
|
+
"data-slot": "stepper-title",
|
|
3383
|
+
...t
|
|
3384
|
+
});
|
|
3385
|
+
}
|
|
3386
|
+
function wi({ className: e, ...t }) {
|
|
3387
|
+
return /* @__PURE__ */ J("p", {
|
|
3388
|
+
className: Z("text-muted-foreground text-sm", e),
|
|
3389
|
+
"data-slot": "stepper-description",
|
|
3390
|
+
...t
|
|
3391
|
+
});
|
|
3392
|
+
}
|
|
3393
|
+
function Ti({ className: e, ...t }) {
|
|
3394
|
+
return /* @__PURE__ */ J("div", {
|
|
3395
|
+
className: Z("m-0.5 bg-muted group-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=vertical]/stepper:h-12 group-data-[orientation=horizontal]/stepper:w-full group-data-[orientation=vertical]/stepper:w-0.5 group-data-[orientation=horizontal]/stepper:flex-1 group-data-[state=completed]/step:bg-primary", e),
|
|
3396
|
+
"data-slot": "stepper-separator",
|
|
3397
|
+
...t
|
|
3398
|
+
});
|
|
3399
|
+
}
|
|
3400
|
+
//#endregion
|
|
3401
|
+
//#region src/components/ui/switch.tsx
|
|
3402
|
+
function Ei({ className: e, size: t = "default", ...n }) {
|
|
3403
|
+
return /* @__PURE__ */ J(le.Root, {
|
|
3404
|
+
"data-slot": "switch",
|
|
3405
|
+
"data-size": t,
|
|
3406
|
+
className: Z("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", e),
|
|
3407
|
+
...n,
|
|
3408
|
+
children: /* @__PURE__ */ J(le.Thumb, {
|
|
3409
|
+
"data-slot": "switch-thumb",
|
|
3410
|
+
className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
|
|
3411
|
+
})
|
|
3412
|
+
});
|
|
3413
|
+
}
|
|
3414
|
+
//#endregion
|
|
3415
|
+
//#region src/components/ui/tabs.tsx
|
|
3416
|
+
function Di({ className: e, orientation: t = "horizontal", ...n }) {
|
|
3417
|
+
return /* @__PURE__ */ J(K.Root, {
|
|
3418
|
+
"data-slot": "tabs",
|
|
3419
|
+
"data-orientation": t,
|
|
3420
|
+
className: Z("group/tabs flex gap-2 data-horizontal:flex-col", e),
|
|
3421
|
+
...n
|
|
3422
|
+
});
|
|
3423
|
+
}
|
|
3424
|
+
var Oi = P("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
3425
|
+
variants: { variant: {
|
|
3426
|
+
default: "bg-muted",
|
|
3427
|
+
line: "gap-1 bg-transparent"
|
|
3428
|
+
} },
|
|
3429
|
+
defaultVariants: { variant: "default" }
|
|
3430
|
+
});
|
|
3431
|
+
function ki({ className: e, variant: t = "default", ...n }) {
|
|
3432
|
+
return /* @__PURE__ */ J(K.List, {
|
|
3433
|
+
"data-slot": "tabs-list",
|
|
3434
|
+
"data-variant": t,
|
|
3435
|
+
className: Z(Oi({ variant: t }), e),
|
|
3436
|
+
...n
|
|
3437
|
+
});
|
|
3438
|
+
}
|
|
3439
|
+
function Ai({ className: e, ...t }) {
|
|
3440
|
+
return /* @__PURE__ */ J(K.Trigger, {
|
|
3441
|
+
"data-slot": "tabs-trigger",
|
|
3442
|
+
className: Z("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", e),
|
|
3443
|
+
...t
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
function ji({ className: e, ...t }) {
|
|
3447
|
+
return /* @__PURE__ */ J(K.Content, {
|
|
3448
|
+
"data-slot": "tabs-content",
|
|
3449
|
+
className: Z("flex-1 text-sm outline-none", e),
|
|
3450
|
+
...t
|
|
3451
|
+
});
|
|
3452
|
+
}
|
|
3453
|
+
//#endregion
|
|
3454
|
+
//#region src/components/ui/timeline.tsx
|
|
3455
|
+
var Mi = n.createContext(void 0), Ni = () => {
|
|
3456
|
+
let e = n.useContext(Mi);
|
|
3457
|
+
if (!e) throw Error("useTimeline must be used within a Timeline");
|
|
3458
|
+
return e;
|
|
3459
|
+
};
|
|
3460
|
+
function Pi({ defaultValue: e = 1, value: t, onValueChange: r, orientation: i = "vertical", className: a, ...o }) {
|
|
3461
|
+
let [s, c] = n.useState(e), l = n.useCallback((e) => {
|
|
3462
|
+
t === void 0 && c(e), r?.(e);
|
|
3463
|
+
}, [t, r]), u = t ?? s;
|
|
3464
|
+
return /* @__PURE__ */ J(Mi.Provider, {
|
|
3465
|
+
value: {
|
|
3466
|
+
activeStep: u,
|
|
3467
|
+
setActiveStep: l
|
|
3468
|
+
},
|
|
3469
|
+
children: /* @__PURE__ */ J("div", {
|
|
3470
|
+
className: Z("group/timeline flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col", a),
|
|
3471
|
+
"data-orientation": i,
|
|
3472
|
+
"data-slot": "timeline",
|
|
3473
|
+
...o
|
|
3474
|
+
})
|
|
3475
|
+
});
|
|
3476
|
+
}
|
|
3477
|
+
function Fi({ className: e, ...t }) {
|
|
3478
|
+
return /* @__PURE__ */ J("div", {
|
|
3479
|
+
className: Z("text-muted-foreground text-sm", e),
|
|
3480
|
+
"data-slot": "timeline-content",
|
|
3481
|
+
...t
|
|
3482
|
+
});
|
|
3483
|
+
}
|
|
3484
|
+
function Ii({ asChild: e = !1, className: t, ...n }) {
|
|
3485
|
+
return /* @__PURE__ */ J(e ? G.Root : "time", {
|
|
3486
|
+
className: Z("mb-1 block font-medium text-muted-foreground text-xs group-data-[orientation=vertical]/timeline:max-sm:h-4", t),
|
|
3487
|
+
"data-slot": "timeline-date",
|
|
3488
|
+
...n
|
|
3489
|
+
});
|
|
3490
|
+
}
|
|
3491
|
+
function Li({ className: e, ...t }) {
|
|
3492
|
+
return /* @__PURE__ */ J("div", {
|
|
3493
|
+
className: Z(e),
|
|
3494
|
+
"data-slot": "timeline-header",
|
|
3495
|
+
...t
|
|
3496
|
+
});
|
|
3497
|
+
}
|
|
3498
|
+
function Ri({ className: e, children: t, ...n }) {
|
|
3499
|
+
return /* @__PURE__ */ J("div", {
|
|
3500
|
+
"aria-hidden": "true",
|
|
3501
|
+
className: Z("group-data-[orientation=horizontal]/timeline:-top-6 group-data-[orientation=horizontal]/timeline:-translate-y-1/2 group-data-[orientation=vertical]/timeline:-left-6 group-data-[orientation=vertical]/timeline:-translate-x-1/2 absolute size-4 rounded-full border-2 border-primary/20 group-data-[orientation=vertical]/timeline:top-0 group-data-[orientation=horizontal]/timeline:left-0 group-data-completed/timeline-item:border-primary", e),
|
|
3502
|
+
"data-slot": "timeline-indicator",
|
|
3503
|
+
...n,
|
|
3504
|
+
children: t
|
|
3505
|
+
});
|
|
3506
|
+
}
|
|
3507
|
+
function zi({ step: e, className: t, ...n }) {
|
|
3508
|
+
let { activeStep: r } = Ni();
|
|
3509
|
+
return /* @__PURE__ */ J("div", {
|
|
3510
|
+
className: Z("group/timeline-item relative flex flex-1 flex-col gap-0.5 group-data-[orientation=vertical]/timeline:ms-8 group-data-[orientation=horizontal]/timeline:mt-8 group-data-[orientation=horizontal]/timeline:not-last:pe-8 group-data-[orientation=vertical]/timeline:not-last:pb-12 has-[+[data-completed]]:[&_[data-slot=timeline-separator]]:bg-primary", t),
|
|
3511
|
+
"data-completed": e <= r || void 0,
|
|
3512
|
+
"data-slot": "timeline-item",
|
|
3513
|
+
...n
|
|
3514
|
+
});
|
|
3515
|
+
}
|
|
3516
|
+
function Bi({ className: e, ...t }) {
|
|
3517
|
+
return /* @__PURE__ */ J("div", {
|
|
3518
|
+
"aria-hidden": "true",
|
|
3519
|
+
className: Z("group-data-[orientation=horizontal]/timeline:-top-6 group-data-[orientation=horizontal]/timeline:-translate-y-1/2 group-data-[orientation=vertical]/timeline:-left-6 group-data-[orientation=vertical]/timeline:-translate-x-1/2 absolute self-start bg-primary/10 group-last/timeline-item:hidden group-data-[orientation=horizontal]/timeline:h-0.5 group-data-[orientation=vertical]/timeline:h-[calc(100%-1rem-0.25rem)] group-data-[orientation=horizontal]/timeline:w-[calc(100%-1rem-0.25rem)] group-data-[orientation=vertical]/timeline:w-0.5 group-data-[orientation=horizontal]/timeline:translate-x-4.5 group-data-[orientation=vertical]/timeline:translate-y-4.5", e),
|
|
3520
|
+
"data-slot": "timeline-separator",
|
|
3521
|
+
...t
|
|
3522
|
+
});
|
|
3523
|
+
}
|
|
3524
|
+
function Vi({ className: e, ...t }) {
|
|
3525
|
+
return /* @__PURE__ */ J("h3", {
|
|
3526
|
+
className: Z("font-medium text-sm", e),
|
|
3527
|
+
"data-slot": "timeline-title",
|
|
3528
|
+
...t
|
|
3529
|
+
});
|
|
3530
|
+
}
|
|
3531
|
+
//#endregion
|
|
3532
|
+
//#region src/components/ui/toggle.tsx
|
|
3533
|
+
var Hi = P("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
3534
|
+
variants: {
|
|
3535
|
+
variant: {
|
|
3536
|
+
default: "bg-transparent",
|
|
3537
|
+
outline: "border border-input bg-transparent hover:bg-muted"
|
|
3538
|
+
},
|
|
3539
|
+
size: {
|
|
3540
|
+
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
3541
|
+
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
3542
|
+
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
|
|
3543
|
+
}
|
|
3544
|
+
},
|
|
3545
|
+
defaultVariants: {
|
|
3546
|
+
variant: "default",
|
|
3547
|
+
size: "default"
|
|
3548
|
+
}
|
|
3549
|
+
});
|
|
3550
|
+
function Ui({ className: e, variant: t = "default", size: n = "default", ...r }) {
|
|
3551
|
+
return /* @__PURE__ */ J(ue.Root, {
|
|
3552
|
+
"data-slot": "toggle",
|
|
3553
|
+
className: Z(Hi({
|
|
3554
|
+
variant: t,
|
|
3555
|
+
size: n,
|
|
3556
|
+
className: e
|
|
3557
|
+
})),
|
|
3558
|
+
...r
|
|
3559
|
+
});
|
|
3560
|
+
}
|
|
3561
|
+
//#endregion
|
|
3562
|
+
//#region src/components/ui/toggle-group.tsx
|
|
3563
|
+
var Wi = n.createContext({
|
|
3564
|
+
size: "default",
|
|
3565
|
+
variant: "default",
|
|
3566
|
+
spacing: 2,
|
|
3567
|
+
orientation: "horizontal"
|
|
3568
|
+
});
|
|
3569
|
+
function Gi({ className: e, variant: t, size: n, spacing: r = 2, orientation: i = "horizontal", children: a, ...o }) {
|
|
3570
|
+
return /* @__PURE__ */ J(de.Root, {
|
|
3571
|
+
"data-slot": "toggle-group",
|
|
3572
|
+
"data-variant": t,
|
|
3573
|
+
"data-size": n,
|
|
3574
|
+
"data-spacing": r,
|
|
3575
|
+
"data-orientation": i,
|
|
3576
|
+
style: { "--gap": r },
|
|
3577
|
+
className: Z("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch", e),
|
|
3578
|
+
...o,
|
|
3579
|
+
children: /* @__PURE__ */ J(Wi.Provider, {
|
|
3580
|
+
value: {
|
|
3581
|
+
variant: t,
|
|
3582
|
+
size: n,
|
|
3583
|
+
spacing: r,
|
|
3584
|
+
orientation: i
|
|
3585
|
+
},
|
|
3586
|
+
children: a
|
|
3587
|
+
})
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
function Ki({ className: e, children: t, variant: r = "default", size: i = "default", ...a }) {
|
|
3591
|
+
let o = n.useContext(Wi);
|
|
3592
|
+
return /* @__PURE__ */ J(de.Item, {
|
|
3593
|
+
"data-slot": "toggle-group-item",
|
|
3594
|
+
"data-variant": o.variant || r,
|
|
3595
|
+
"data-size": o.size || i,
|
|
3596
|
+
"data-spacing": o.spacing,
|
|
3597
|
+
className: Z("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", Hi({
|
|
3598
|
+
variant: o.variant || r,
|
|
3599
|
+
size: o.size || i
|
|
3600
|
+
}), e),
|
|
3601
|
+
...a,
|
|
3602
|
+
children: t
|
|
3603
|
+
});
|
|
3604
|
+
}
|
|
3605
|
+
//#endregion
|
|
3606
|
+
//#region src/components/ui/tooltip.tsx
|
|
3607
|
+
function qi({ delayDuration: e = 0, ...t }) {
|
|
3608
|
+
return /* @__PURE__ */ J(q.Provider, {
|
|
3609
|
+
"data-slot": "tooltip-provider",
|
|
3610
|
+
delayDuration: e,
|
|
3611
|
+
...t
|
|
3612
|
+
});
|
|
3613
|
+
}
|
|
3614
|
+
function Ji({ ...e }) {
|
|
3615
|
+
return /* @__PURE__ */ J(q.Root, {
|
|
3616
|
+
"data-slot": "tooltip",
|
|
3617
|
+
...e
|
|
3618
|
+
});
|
|
3619
|
+
}
|
|
3620
|
+
function Yi({ ...e }) {
|
|
3621
|
+
return /* @__PURE__ */ J(q.Trigger, {
|
|
3622
|
+
"data-slot": "tooltip-trigger",
|
|
3623
|
+
...e
|
|
3624
|
+
});
|
|
3625
|
+
}
|
|
3626
|
+
function Xi({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
3627
|
+
return /* @__PURE__ */ J(q.Portal, { children: /* @__PURE__ */ Y(q.Content, {
|
|
3628
|
+
"data-slot": "tooltip-content",
|
|
3629
|
+
sideOffset: t,
|
|
3630
|
+
className: Z("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
3631
|
+
...r,
|
|
3632
|
+
children: [n, /* @__PURE__ */ J(q.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })]
|
|
3633
|
+
}) });
|
|
3634
|
+
}
|
|
3635
|
+
//#endregion
|
|
3636
|
+
export { Re as ActionsMenu, $e as AdvancedInput, Lt as AdvancedSelect, un as Alert, pn as AlertAction, fn as AlertDescription, mn as AlertDialog, wn as AlertDialogAction, Tn as AlertDialogCancel, vn as AlertDialogContent, Cn as AlertDialogDescription, bn as AlertDialogFooter, yn as AlertDialogHeader, xn as AlertDialogMedia, _n as AlertDialogOverlay, gn as AlertDialogPortal, Sn as AlertDialogTitle, hn as AlertDialogTrigger, dn as AlertTitle, Dn as Badge, Q as Button, kn as ButtonGroup, jn as ButtonGroupSeparator, An as ButtonGroupText, Xt as Calendar, Zt as CalendarDayButton, Mn as Card, In as CardAction, Ln as CardContent, Fn as CardDescription, Rn as CardFooter, Nn as CardHeader, Pn as CardTitle, Un as ChartContainer, qn as ChartLegend, Jn as ChartLegendContent, Wn as ChartStyle, Gn as ChartTooltip, Kn as ChartTooltipContent, Rt as Checkbox, bt as Command, xt as CommandDialog, wt as CommandEmpty, Tt as CommandGroup, St as CommandInput, Dt as CommandItem, Ct as CommandList, Et as CommandSeparator, Ot as CommandShortcut, Yt as DataTable, cn as DateTimeRangePicker, et as Dialog, rt as DialogClose, at as DialogContent, lt as DialogDescription, st as DialogFooter, ot as DialogHeader, it as DialogOverlay, nt as DialogPortal, ct as DialogTitle, tt as DialogTrigger, xe as DropdownMenu, De as DropdownMenuCheckboxItem, we as DropdownMenuContent, Te as DropdownMenuGroup, Ee as DropdownMenuItem, Ae as DropdownMenuLabel, Se as DropdownMenuPortal, Oe as DropdownMenuRadioGroup, ke as DropdownMenuRadioItem, je as DropdownMenuSeparator, Me as DropdownMenuShortcut, Ne as DropdownMenuSub, Fe as DropdownMenuSubContent, Pe as DropdownMenuSubTrigger, Ce as DropdownMenuTrigger, Ge as Field, Ke as FieldContent, Ye as FieldDescription, Ze as FieldError, Ue as FieldGroup, qe as FieldLabel, He as FieldLegend, Xe as FieldSeparator, Ve as FieldSet, Je as FieldTitle, Xn as HoverCard, Qn as HoverCardContent, Zn as HoverCardTrigger, ut as Input, ft as InputGroup, mt as InputGroupAddon, gt as InputGroupButton, vt as InputGroupInput, _t as InputGroupText, yt as InputGroupTextarea, nr as Item, cr as ItemActions, ar as ItemContent, sr as ItemDescription, ur as ItemFooter, $n as ItemGroup, lr as ItemHeader, ir as ItemMedia, er as ItemSeparator, or as ItemTitle, ze as Label, gr as Map, Hr as MapArc, Ur as MapClusterLayer, Ar as MapControls, yr as MapMarker, Mr as MapPopup, Nr as MapRoute, br as MarkerContent, Tr as MarkerLabel, Cr as MarkerPopup, wr as MarkerTooltip, kt as Popover, Mt as PopoverAnchor, jt as PopoverContent, Ft as PopoverDescription, Nt as PopoverHeader, Pt as PopoverTitle, At as PopoverTrigger, Wr as Progress, Gr as RadioGroup, Kr as RadioGroupItem, qr as Select, Zr as SelectContent, Jr as SelectGroup, $r as SelectItem, Qr as SelectLabel, ni as SelectScrollDownButton, ti as SelectScrollUpButton, ei as SelectSeparator, Xr as SelectTrigger, Yr as SelectValue, Be as Separator, ri as Sheet, ai as SheetClose, ci as SheetContent, fi as SheetDescription, ui as SheetFooter, li as SheetHeader, di as SheetTitle, ii as SheetTrigger, pi as Slider, qt as Spinner, yi as Stepper, wi as StepperDescription, Si as StepperIndicator, bi as StepperItem, Ti as StepperSeparator, Ci as StepperTitle, xi as StepperTrigger, Ei as Switch, zt as Table, Vt as TableBody, Kt as TableCaption, Gt as TableCell, Ht as TableFooter, Wt as TableHead, Bt as TableHeader, Ut as TableRow, Di as Tabs, ji as TabsContent, ki as TabsList, Ai as TabsTrigger, dt as Textarea, Pi as Timeline, Fi as TimelineContent, Ii as TimelineDate, Li as TimelineHeader, Ri as TimelineIndicator, zi as TimelineItem, Bi as TimelineSeparator, Vi as TimelineTitle, mi as Toaster, Ui as Toggle, Gi as ToggleGroup, Ki as ToggleGroupItem, Ji as Tooltip, Xi as TooltipContent, qi as TooltipProvider, Yi as TooltipTrigger, En as badgeVariants, On as buttonGroupVariants, be as buttonVariants, Z as cn, rn as navigateRange, nn as presetToRange, Oi as tabsListVariants, Hi as toggleVariants, $ as useMap };
|
|
3637
|
+
|
|
3638
|
+
//# sourceMappingURL=index.js.map
|