@febkosq8/arc 0.6.7 → 0.8.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.
Files changed (35) hide show
  1. package/README.md +9 -3
  2. package/components/index.css +56 -0
  3. package/dist/arc.js +880 -280
  4. package/dist/{button.d.ts → components/button.d.ts} +1 -1
  5. package/dist/components/grid-loader.d.ts +16 -0
  6. package/dist/components/index.d.ts +44 -0
  7. package/dist/components/label-field.d.ts +9 -0
  8. package/dist/{preview-card.d.ts → components/preview-card.d.ts} +3 -1
  9. package/dist/components/table.d.ts +30 -0
  10. package/dist/index.d.ts +2 -41
  11. package/dist/utilities/index.d.ts +3 -0
  12. package/package.json +5 -3
  13. /package/dist/{avatar.d.ts → components/avatar.d.ts} +0 -0
  14. /package/dist/{button-double-click.d.ts → components/button-double-click.d.ts} +0 -0
  15. /package/dist/{button-group.d.ts → components/button-group.d.ts} +0 -0
  16. /package/dist/{button-long-press.d.ts → components/button-long-press.d.ts} +0 -0
  17. /package/dist/{card.d.ts → components/card.d.ts} +0 -0
  18. /package/dist/{divider.d.ts → components/divider.d.ts} +0 -0
  19. /package/dist/{dropdown-multi.d.ts → components/dropdown-multi.d.ts} +0 -0
  20. /package/dist/{dropdown.d.ts → components/dropdown.d.ts} +0 -0
  21. /package/dist/{error-text.d.ts → components/error-text.d.ts} +0 -0
  22. /package/dist/{input-timestamp.d.ts → components/input-timestamp.d.ts} +0 -0
  23. /package/dist/{input.d.ts → components/input.d.ts} +0 -0
  24. /package/dist/{menu.d.ts → components/menu.d.ts} +0 -0
  25. /package/dist/{modal.d.ts → components/modal.d.ts} +0 -0
  26. /package/dist/{pill-link.d.ts → components/pill-link.d.ts} +0 -0
  27. /package/dist/{pill.d.ts → components/pill.d.ts} +0 -0
  28. /package/dist/{select.d.ts → components/select.d.ts} +0 -0
  29. /package/dist/{switch.d.ts → components/switch.d.ts} +0 -0
  30. /package/dist/{tag.d.ts → components/tag.d.ts} +0 -0
  31. /package/dist/{text-link.d.ts → components/text-link.d.ts} +0 -0
  32. /package/dist/{theme-switcher.d.ts → components/theme-switcher.d.ts} +0 -0
  33. /package/dist/{typing-animation.d.ts → components/typing-animation.d.ts} +0 -0
  34. /package/dist/{date-handler.d.ts → utilities/date-handler.d.ts} +0 -0
  35. /package/dist/{hash-navigation.d.ts → utilities/hash-navigation.d.ts} +0 -0
package/dist/arc.js CHANGED
@@ -1,38 +1,43 @@
1
1
  import { cva as e, cx as t } from "@rinzai/zen";
2
- import { Children as n, Fragment as r, cloneElement as i, isValidElement as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
3
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
- import { Combobox as p } from "@base-ui/react/combobox";
5
- import { FaCheck as m, FaChevronDown as h } from "react-icons/fa6";
6
- import { DateTime as g } from "luxon";
7
- import { Menu as _ } from "@base-ui/react/menu";
8
- import { FiChevronDown as v, FiChevronRight as y, FiMonitor as b, FiMoon as x, FiSun as S } from "react-icons/fi";
9
- import { Dialog as C } from "@base-ui/react/dialog";
10
- import { RxCross1 as w } from "react-icons/rx";
11
- import { Popover as T } from "@base-ui/react/popover";
12
- import { Select as E } from "@base-ui/react/select";
13
- import { Switch as D } from "@base-ui/react/switch";
2
+ import { Children as n, Fragment as r, cloneElement as i, isValidElement as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u } from "react";
3
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
4
+ import { Combobox as m } from "@base-ui/react/combobox";
5
+ import { FaAnglesLeft as h, FaAnglesRight as g, FaArrowDownWideShort as _, FaArrowUpWideShort as v, FaArrowsUpDown as y, FaCheck as b, FaChevronDown as x, FaChevronLeft as S, FaChevronRight as C, FaEye as w, FaEyeSlash as T, FaFilterCircleXmark as E, FaLock as D, FaTableColumns as O } from "react-icons/fa6";
6
+ import { RiInfoCardLine as k } from "react-icons/ri";
7
+ import { Popover as A } from "@base-ui/react/popover";
8
+ import { DateTime as j } from "luxon";
9
+ import { Menu as M } from "@base-ui/react/menu";
10
+ import { FiChevronDown as N, FiChevronRight as P, FiMonitor as F, FiMoon as I, FiSun as L } from "react-icons/fi";
11
+ import { Dialog as R } from "@base-ui/react/dialog";
12
+ import { RxCross1 as z } from "react-icons/rx";
13
+ import { Select as B } from "@base-ui/react/select";
14
+ import { rankItem as ee } from "@tanstack/match-sorter-utils";
15
+ import { columnFilteringFeature as te, columnResizingFeature as ne, columnSizingFeature as re, columnVisibilityFeature as ie, createColumnHelper as ae, createFilteredRowModel as oe, createPaginatedRowModel as se, createSortedRowModel as ce, filterFn_includesString as le, globalFilteringFeature as ue, rowPaginationFeature as de, rowSortingFeature as fe, sortFn_alphanumeric as pe, sortFn_alphanumericCaseSensitive as me, sortFn_basic as he, sortFn_datetime as ge, sortFn_text as _e, sortFn_textCaseSensitive as ve, tableFeatures as ye, useTable as be } from "@tanstack/react-table";
16
+ import { Switch as xe } from "@base-ui/react/switch";
14
17
  //#region components/button-group.tsx
15
- var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, children: s, ...c }) => /* @__PURE__ */ d("div", {
18
+ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, children: s, ...c }) => /* @__PURE__ */ f("div", {
16
19
  role: "group",
17
20
  className: t("arc-button-group inline-flex w-fit gap-0 overflow-hidden rounded-md border border-border", "[&>.arc-button]:rounded-none! [&>.arc-button:not(:first-child)]:border-l [&>.arc-button:not(:first-child)]:border-border", "[&>.arc-double-click-button]:z-1 [&>.arc-double-click-button]:m-0 [&>.arc-double-click-button]:rounded-none! [&>.arc-double-click-button]:p-0", "[&>.arc-double-click-button>.arc-button]:rounded-none! [&>.arc-double-click-button>.arc-double-click-progress-ring]:inset-0 [&>.arc-double-click-button>.arc-double-click-progress-ring]:z-2 [&>.arc-double-click-button>.arc-double-click-progress-ring]:rounded-[inherit]", "[&>.arc-long-press-button]:z-1 [&>.arc-long-press-button]:m-0 [&>.arc-long-press-button]:rounded-none! [&>.arc-long-press-button]:p-0", "[&>.arc-long-press-button>.arc-button]:rounded-none! [&>.arc-long-press-button>.arc-double-click-progress-ring]:inset-0 [&>.arc-long-press-button>.arc-double-click-progress-ring]:z-2 [&>.arc-long-press-button>.arc-double-click-progress-ring]:rounded-[inherit]", r === "vertical" && "flex-col items-stretch [&>.arc-button]:w-full [&>.arc-double-click-button]:w-full [&>.arc-long-press-button]:w-full [&>.arc-button:not(:first-child)]:border-t [&>.arc-button:not(:first-child)]:border-l-0 [&>.arc-double-click-button:not(:first-child)]:border-t [&>.arc-double-click-button:not(:first-child)]:border-l-0 [&>.arc-long-press-button:not(:first-child)]:border-t [&>.arc-long-press-button:not(:first-child)]:border-l-0 [&>.arc-double-click-button:first-child]:rounded-t-md [&>.arc-double-click-button:last-child]:rounded-b-md [&>.arc-long-press-button:first-child]:rounded-t-md [&>.arc-long-press-button:last-child]:rounded-b-md", r === "horizontal" && "[&>.arc-double-click-button:not(:first-child)]:border-l [&>.arc-double-click-button:not(:first-child)]:border-border [&>.arc-long-press-button:not(:first-child)]:border-l [&>.arc-long-press-button:not(:first-child)]:border-border [&>.arc-double-click-button:first-child]:rounded-l-md [&>.arc-double-click-button:last-child]:rounded-r-md [&>.arc-long-press-button:first-child]:rounded-l-md [&>.arc-long-press-button:last-child]:rounded-r-md", e),
18
21
  ...c,
19
22
  children: n.map(s, (e) => !o || !a(e) ? e : e.props["aria-pressed"] === !0 ? i(e, { variant: o }) : e)
20
- }), k = e("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 truncate", {
23
+ }), Ce = e("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 truncate", {
21
24
  variants: {
22
25
  variant: {
23
26
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
24
27
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
28
+ success: "bg-success text-success-foreground hover:bg-success/90",
25
29
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
26
30
  ghost: "text-foreground hover:bg-accent hover:text-accent-foreground [&>svg]:text-inherit",
27
31
  warning: "bg-warning text-warning-foreground hover:bg-warning/90",
28
32
  "outline-primary": "border border-primary bg-background text-primary hover:bg-primary hover:text-primary-foreground",
29
33
  "outline-secondary": "border border-secondary-foreground bg-background text-secondary-foreground hover:bg-secondary",
34
+ "outline-success": "border border-success bg-background text-success hover:bg-success hover:text-success-foreground",
30
35
  "outline-destructive": "border border-destructive bg-background text-destructive hover:bg-destructive hover:text-destructive-foreground",
31
36
  "outline-ghost": "border border-transparent bg-background text-foreground hover:bg-accent hover:text-accent-foreground [&>svg]:text-inherit",
32
37
  "outline-warning": "border border-warning bg-background text-warning hover:bg-warning hover:text-warning-foreground"
33
38
  },
34
39
  size: {
35
- xs: "h-7 rounded-md px-2 text-xs",
40
+ xs: "h-6 rounded-md px-2 text-xs",
36
41
  sm: "h-8 pointer-coarse:min-h-10 rounded-md px-3 text-xs",
37
42
  md: "h-10 pointer-coarse:min-h-11 px-4 py-2",
38
43
  lg: "h-11 rounded-md px-8",
@@ -48,15 +53,15 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
48
53
  variant: "primary",
49
54
  size: "md"
50
55
  }
51
- }), A = Object.assign(({ className: e, variant: n, size: r, ...i }) => /* @__PURE__ */ d("button", {
52
- className: t("arc-button", k({
56
+ }), V = Object.assign(({ className: e, variant: n, size: r, ...i }) => /* @__PURE__ */ f("button", {
57
+ className: t("arc-button", Ce({
53
58
  variant: n,
54
59
  size: r,
55
60
  className: e
56
61
  })),
57
62
  ...i
58
- }), { Group: O }), j = ({ doubleClickMsDuration: e = 2e3, feedbackVariant: n = "warning", feedbackContent: r, variant: i = "primary", children: a, onClick: s, onDoubleClick: u, className: p, style: m, ...h }) => {
59
- let [g, _] = l(!1), [v, y] = l(0), b = c(void 0), x = c(void 0), S = c(0), C = {
63
+ }), { Group: Se }), we = ({ doubleClickMsDuration: e = 2e3, feedbackVariant: n = "warning", feedbackContent: r, variant: i = "primary", children: a, onClick: s, onDoubleClick: c, className: d, style: m, ...h }) => {
64
+ let [g, _] = u(!1), [v, y] = u(0), b = l(void 0), x = l(void 0), S = l(0), C = {
60
65
  primary: "var(--color-primary)",
61
66
  secondary: "var(--color-secondary-foreground)",
62
67
  destructive: "var(--color-destructive)",
@@ -72,26 +77,26 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
72
77
  remainingTime: v,
73
78
  variant: i,
74
79
  feedbackVariant: n
75
- }) : r, T = w === void 0 ? a : /* @__PURE__ */ f("span", {
80
+ }) : r, T = w === void 0 ? a : /* @__PURE__ */ p("span", {
76
81
  className: "grid",
77
- children: [/* @__PURE__ */ d("span", {
82
+ children: [/* @__PURE__ */ f("span", {
78
83
  className: t("col-start-1 row-start-1", g ? "invisible" : "visible"),
79
84
  "aria-hidden": g,
80
85
  children: a
81
- }), /* @__PURE__ */ d("span", {
86
+ }), /* @__PURE__ */ f("span", {
82
87
  className: t("col-start-1 row-start-1", g ? "visible" : "invisible"),
83
88
  "aria-hidden": !g,
84
89
  children: w
85
90
  })]
86
- }), E = /* @__PURE__ */ d(A, {
91
+ }), E = /* @__PURE__ */ f(V, {
87
92
  ...h,
88
93
  children: T,
89
- className: t(p),
94
+ className: t(d),
90
95
  style: { ...m },
91
96
  variant: i,
92
97
  "data-double-click-state": g ? "waiting" : void 0,
93
98
  onClick: (t) => {
94
- if (g && Date.now() <= S.current) _(!1), y(0), b.current && clearTimeout(b.current), x.current && clearInterval(x.current), u?.(t);
99
+ if (g && Date.now() <= S.current) _(!1), y(0), b.current && clearTimeout(b.current), x.current && clearInterval(x.current), c?.(t);
95
100
  else {
96
101
  let t = Date.now() + e;
97
102
  S.current = t, _(!0), y(e), b.current && clearTimeout(b.current), x.current && clearInterval(x.current), x.current = setInterval(() => {
@@ -103,11 +108,11 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
103
108
  s?.(t);
104
109
  }
105
110
  });
106
- return /* @__PURE__ */ f("span", {
111
+ return /* @__PURE__ */ p("span", {
107
112
  "aria-label": g ? "Waiting for second click" : void 0,
108
113
  className: "arc-double-click-button relative inline-flex",
109
114
  "data-double-click-state": g ? "waiting" : void 0,
110
- children: [E, /* @__PURE__ */ d("span", {
115
+ children: [E, /* @__PURE__ */ f("span", {
111
116
  "aria-hidden": "true",
112
117
  className: "arc-double-click-progress-ring pointer-events-none absolute inset-0 rounded-md p-px",
113
118
  style: {
@@ -118,8 +123,8 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
118
123
  }
119
124
  })]
120
125
  });
121
- }, M = ({ longPressMsDuration: e = 2500, onLongPress: n, onClick: r, preventClick: i = !0, feedbackVariant: a = "warning", feedbackContent: s, variant: u = "primary", children: p, ...m }) => {
122
- let h = c(void 0), g = c(void 0), _ = c(0), v = c(!1), [y, b] = l(!1), [x, S] = l(0), C = () => {
126
+ }, Te = ({ longPressMsDuration: e = 2500, onLongPress: n, onClick: r, preventClick: i = !0, feedbackVariant: a = "warning", feedbackContent: s, variant: c = "primary", children: d, ...m }) => {
127
+ let h = l(void 0), g = l(void 0), _ = l(0), v = l(!1), [y, b] = u(!1), [x, S] = u(0), C = () => {
123
128
  h.current && clearTimeout(h.current), g.current && clearInterval(g.current), h.current = void 0, g.current = void 0;
124
129
  };
125
130
  o(() => C, []);
@@ -133,27 +138,27 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
133
138
  isActive: v.current,
134
139
  longPressMsDuration: e,
135
140
  remainingTime: x,
136
- variant: u,
141
+ variant: c,
137
142
  feedbackVariant: a
138
- }) : s, E = T === void 0 ? p : /* @__PURE__ */ f("span", {
143
+ }) : s, E = T === void 0 ? d : /* @__PURE__ */ p("span", {
139
144
  className: "grid",
140
- children: [/* @__PURE__ */ d("span", {
145
+ children: [/* @__PURE__ */ f("span", {
141
146
  className: t("col-start-1 row-start-1", y ? "invisible" : "visible"),
142
147
  "aria-hidden": y,
143
- children: p
144
- }), /* @__PURE__ */ d("span", {
148
+ children: d
149
+ }), /* @__PURE__ */ f("span", {
145
150
  className: t("col-start-1 row-start-1", y ? "visible" : "invisible"),
146
151
  "aria-hidden": !y,
147
152
  children: T
148
153
  })]
149
154
  });
150
- return /* @__PURE__ */ f("span", {
155
+ return /* @__PURE__ */ p("span", {
151
156
  className: "arc-long-press-button relative inline-flex",
152
157
  "data-long-press-state": y ? "pressing" : void 0,
153
- children: [/* @__PURE__ */ d(A, {
158
+ children: [/* @__PURE__ */ f(V, {
154
159
  ...m,
155
160
  children: E,
156
- variant: u,
161
+ variant: c,
157
162
  className: t(m.className),
158
163
  "data-long-press-state": y ? "pressing" : void 0,
159
164
  onPointerDown: (t) => {
@@ -174,7 +179,7 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
174
179
  onClick: (e) => {
175
180
  v.current && i ? (e.preventDefault(), e.stopPropagation(), v.current = !1) : r?.(e);
176
181
  }
177
- }), /* @__PURE__ */ d("span", {
182
+ }), /* @__PURE__ */ f("span", {
178
183
  "aria-hidden": "true",
179
184
  className: "arc-double-click-progress-ring pointer-events-none absolute inset-0 rounded-md p-px",
180
185
  style: {
@@ -185,45 +190,7 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
185
190
  }
186
191
  })]
187
192
  });
188
- };
189
- //#endregion
190
- //#region components/hash-navigation.ts
191
- function N({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", block: r } = {}) {
192
- if (typeof window > "u") return () => {};
193
- let i = 0, a = setInterval(() => {
194
- i += 1;
195
- let { hash: e } = window.location;
196
- if (!e || i > t) clearInterval(a);
197
- else try {
198
- let t = document.querySelector(e);
199
- t && (t.scrollIntoView({
200
- behavior: n,
201
- block: r
202
- }), clearInterval(a));
203
- } catch (t) {
204
- console.error(`Invalid hash in URL: ${e}`, t), clearInterval(a);
205
- }
206
- }, e);
207
- return () => clearInterval(a);
208
- }
209
- function P(e) {
210
- o(() => N(e), []);
211
- }
212
- function F({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveChange: r }) {
213
- let i = t.map((e) => document.getElementById(e)).filter((e) => e !== null), a = window.location.hash.toLowerCase().slice(1) || null, o = () => {
214
- let t = e.getBoundingClientRect(), o = t.top + t.height / 2, s = i.find((e) => {
215
- let t = e.getBoundingClientRect();
216
- return t.top <= o && t.bottom > o;
217
- }), c = s ? i.indexOf(s) : -1;
218
- if (r?.(c, i), !s || (a === s.id.toLowerCase() && (a = null), c === 0 && a)) return;
219
- let l = c === 0 && !n ? "" : `#${s.id}`;
220
- window.location.hash !== l && (window.history.replaceState(window.history.state, "", `${window.location.pathname}${window.location.search}${l}`), window.dispatchEvent(new HashChangeEvent("hashchange")));
221
- };
222
- return o(), e.addEventListener("scroll", o, { passive: !0 }), () => e.removeEventListener("scroll", o);
223
- }
224
- //#endregion
225
- //#region components/avatar.tsx
226
- var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted ring-1 ring-border transition-all", {
193
+ }, Ee = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted ring-1 ring-border transition-all", {
227
194
  variants: { size: {
228
195
  xs: "size-6 text-xs",
229
196
  sm: "size-7 text-sm",
@@ -232,40 +199,40 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
232
199
  xl: "size-12 text-xl"
233
200
  } },
234
201
  defaultVariants: { size: "md" }
235
- }), L = ({ name: e, image: n, size: r, className: i, ...a }) => {
236
- let [c, u] = l(!1), f = n?.trim(), p = !!f && !c, m = s(() => e?.split(" ", 3)?.map((e) => e[0])?.filter((e) => /[A-Za-z]/.test(e))?.join("") || "U", [e]);
202
+ }), De = ({ name: e, image: n, size: r, className: i, ...a }) => {
203
+ let [s, l] = u(!1), d = n?.trim(), p = !!d && !s, m = c(() => e?.split(" ", 3)?.map((e) => e[0])?.filter((e) => /[A-Za-z]/.test(e))?.join("") || "U", [e]);
237
204
  return o(() => {
238
- u(!1);
239
- }, [f]), /* @__PURE__ */ d("span", {
240
- className: t(I({
205
+ l(!1);
206
+ }, [d]), /* @__PURE__ */ f("span", {
207
+ className: t(Ee({
241
208
  size: r,
242
209
  className: i
243
210
  })),
244
211
  ...a,
245
- children: p ? /* @__PURE__ */ d("img", {
246
- src: f,
212
+ children: p ? /* @__PURE__ */ f("img", {
213
+ src: d,
247
214
  alt: e ?? "User avatar",
248
215
  title: e ?? "User",
249
216
  className: "h-full w-full object-cover",
250
- onError: () => u(!0)
251
- }) : /* @__PURE__ */ d("span", {
217
+ onError: () => l(!0)
218
+ }) : /* @__PURE__ */ f("span", {
252
219
  className: "font-medium leading-none text-foreground",
253
220
  title: e ?? "User",
254
221
  children: m
255
222
  })
256
223
  });
257
- }, R = ({ className: e, ...n }) => /* @__PURE__ */ d("div", {
224
+ }, Oe = ({ className: e, ...n }) => /* @__PURE__ */ f("div", {
258
225
  role: "separator",
259
226
  className: t("arc-divider w-full border-b border-border", e),
260
227
  ...n
261
- }), z = ({ items: e, value: n, onChange: r, className: i, placeholder: a = "Select an option", disabled: o, name: s, preventEmpty: c = !1, "data-name": l, "data-required": u }) => {
262
- let g = e.find((e) => String(e.key) === String(n)) ?? null;
263
- return /* @__PURE__ */ d(p.Root, {
228
+ }), ke = ({ items: e, value: n, onChange: r, className: i, placeholder: a = "Select an option", disabled: o, name: s, preventEmpty: c = !1, "data-name": l, "data-required": u }) => {
229
+ let d = e.find((e) => String(e.key) === String(n)) ?? null;
230
+ return /* @__PURE__ */ f(m.Root, {
264
231
  items: e,
265
- value: g,
232
+ value: d,
266
233
  onValueChange: (e) => {
267
234
  if (c && e === null) return;
268
- let t = e !== null && g !== null && String(e.key) === String(g.key);
235
+ let t = e !== null && d !== null && String(e.key) === String(d.key);
269
236
  r?.(!c && t ? null : e);
270
237
  },
271
238
  itemToStringLabel: (e) => e?.label ?? "",
@@ -273,43 +240,43 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
273
240
  isItemEqualToValue: (e, t) => String(e.key) === String(t.key),
274
241
  name: s,
275
242
  disabled: o,
276
- children: /* @__PURE__ */ f("div", {
243
+ children: /* @__PURE__ */ p("div", {
277
244
  className: t("arc-dropdown relative", i),
278
- children: [/* @__PURE__ */ f(p.InputGroup, {
279
- className: t("relative flex min-h-10 w-full items-center justify-between gap-5 rounded-md border border-border bg-background pr-2 text-foreground shadow-xs", "focus-within:border-transparent focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring", "data-disabled:cursor-not-allowed data-disabled:bg-muted data-disabled:text-muted-foreground"),
280
- children: [/* @__PURE__ */ d(p.Input, {
245
+ children: [/* @__PURE__ */ p(m.InputGroup, {
246
+ className: t("relative flex h-8 w-full items-center justify-between gap-5 rounded border border-border bg-background pr-2 text-foreground shadow-xs pointer-coarse:h-9", "focus-within:border-transparent focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring", "data-disabled:cursor-not-allowed data-disabled:bg-muted data-disabled:text-muted-foreground"),
247
+ children: [/* @__PURE__ */ f(m.Input, {
281
248
  className: "h-full grow border-none bg-transparent py-2 pl-3 outline-hidden placeholder:text-muted-foreground focus:ring-0 focus:outline-hidden disabled:cursor-not-allowed",
282
249
  placeholder: a,
283
250
  "data-name": l,
284
251
  "data-required": u,
285
252
  "data-disabled": o
286
- }), /* @__PURE__ */ d(p.Trigger, {
253
+ }), /* @__PURE__ */ f(m.Trigger, {
287
254
  className: "shrink-0 self-center rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
288
255
  "aria-label": "Toggle options",
289
- children: /* @__PURE__ */ d(h, {
256
+ children: /* @__PURE__ */ f(x, {
290
257
  className: "h-5 w-5 text-foreground",
291
258
  "aria-hidden": "true"
292
259
  })
293
260
  })]
294
- }), /* @__PURE__ */ d(p.Portal, { children: /* @__PURE__ */ d(p.Positioner, {
261
+ }), /* @__PURE__ */ f(m.Portal, { children: /* @__PURE__ */ f(m.Positioner, {
295
262
  className: "z-50",
296
263
  sideOffset: 8,
297
- children: /* @__PURE__ */ f(p.Popup, {
264
+ children: /* @__PURE__ */ p(m.Popup, {
298
265
  className: "max-h-60 min-w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover text-foreground shadow-lg outline-0",
299
- children: [/* @__PURE__ */ d(p.Empty, {
266
+ children: [/* @__PURE__ */ f(m.Empty, {
300
267
  className: "relative cursor-default select-none px-4 py-2 text-muted-foreground empty:hidden",
301
268
  children: "No values to show."
302
- }), /* @__PURE__ */ d(p.List, { children: (e) => /* @__PURE__ */ f(p.Item, {
269
+ }), /* @__PURE__ */ f(m.List, { children: (e) => /* @__PURE__ */ p(m.Item, {
303
270
  value: e,
304
271
  disabled: e.disabled,
305
272
  className: t("relative flex h-8 w-full cursor-default select-none items-center gap-2 border-b border-border px-4 py-1 last:border-b-0", "data-selected:font-medium data-selected:text-primary", "data-highlighted:bg-accent data-highlighted:text-primary", "data-disabled:cursor-not-allowed data-disabled:opacity-50"),
306
- children: [/* @__PURE__ */ d(p.ItemIndicator, {
273
+ children: [/* @__PURE__ */ f(m.ItemIndicator, {
307
274
  className: "flex items-center",
308
- children: /* @__PURE__ */ d(m, {
275
+ children: /* @__PURE__ */ f(b, {
309
276
  className: "h-3 w-3",
310
277
  "aria-hidden": "true"
311
278
  })
312
- }), /* @__PURE__ */ d("span", {
279
+ }), /* @__PURE__ */ f("span", {
313
280
  title: e.label,
314
281
  className: "block truncate",
315
282
  children: e.label
@@ -319,23 +286,165 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
319
286
  }) })]
320
287
  })
321
288
  });
322
- }, B = ({ data: e, className: n, ...r }) => {
289
+ }, H = ({ data: e, className: n, ...r }) => {
323
290
  let i = Array.isArray(e) ? e.join(", ") : typeof e == "string" ? e : null;
324
- return /* @__PURE__ */ d("em", {
291
+ return /* @__PURE__ */ f("em", {
325
292
  role: "alert",
326
293
  className: t("arc-error-text animate-pulse whitespace-nowrap text-base font-semibold text-destructive", n),
327
294
  title: i ?? void 0,
328
295
  ...r,
329
296
  children: i
330
297
  });
331
- }, V = e("arc-input rounded border text-foreground placeholder:text-muted-foreground focus:border-transparent focus:outline-hidden focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:border-muted disabled:bg-muted", {
298
+ }, Ae = /* @__PURE__ */ "*.+.×.÷.=.~.!.?.@.#.%.&.§.¶.※.◇.◆.○.●.△.▽.□.■.♠.♣.♦.♤.♧.♢.♪.♫.∴.∵".split(".");
299
+ function U(e, t, n) {
300
+ let r = Math.sin((e + 1) * 12.9898 + t * 78.233 + n * 37.719) * 43758.5453;
301
+ return r - Math.floor(r);
302
+ }
303
+ var W = [
304
+ "circle",
305
+ "square",
306
+ "diamond",
307
+ "star",
308
+ "heart",
309
+ "hexagon"
310
+ ], je = e("arc-grid-loader__cell grid aspect-square w-full place-items-center overflow-hidden text-center leading-none break-all", {
311
+ variants: { shape: {
312
+ circle: "rounded-full",
313
+ square: "rounded-md",
314
+ diamond: "arc-grid-loader__cell--diamond",
315
+ star: "arc-grid-loader__cell--star",
316
+ heart: "arc-grid-loader__cell--heart",
317
+ hexagon: "arc-grid-loader__cell--hexagon"
318
+ } },
319
+ defaultVariants: { shape: "circle" }
320
+ }), Me = ({ className: e, rows: n = 3, columns: r = 3, size: i = 120, maxSize: a = 24, shape: s = "circle", shapes: c = W, colors: l = [], label: d = "Loading", symbols: p = Ae, style: m, ...h }) => {
321
+ let [g, _] = u([]), [v, y] = u([]), [b, x] = u([]), S = c.length > 0 ? c : W, [C, w] = u(() => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
322
+ if (o(() => {
323
+ s === "mixed" && y(Array.from({ length: n * r }, () => S[Math.floor(Math.random() * S.length)]));
324
+ }, [
325
+ S,
326
+ r,
327
+ n,
328
+ s
329
+ ]), o(() => {
330
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => w(e.matches);
331
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
332
+ }, []), o(() => {
333
+ C || p.length === 0 || _(Array.from({ length: n * r }, () => Math.floor(Math.random() * p.length)));
334
+ }, [
335
+ r,
336
+ C,
337
+ n,
338
+ p
339
+ ]), !Number.isInteger(n) || n < 1) throw RangeError("GridLoader rows must be a positive integer.");
340
+ if (!Number.isInteger(r) || r < 1) throw RangeError("GridLoader columns must be a positive integer.");
341
+ if (!Number.isFinite(i) || i <= 0) throw RangeError("GridLoader size must be a positive number.");
342
+ if (!Number.isFinite(a) || a <= 0) throw RangeError("GridLoader maxSize must be a positive number.");
343
+ return /* @__PURE__ */ f("span", {
344
+ ...h,
345
+ role: "status",
346
+ "aria-live": "polite",
347
+ "aria-label": d,
348
+ className: t("arc-grid-loader inline-flex shrink-0 items-center justify-center align-middle", e),
349
+ style: {
350
+ width: i,
351
+ height: i,
352
+ ...m
353
+ },
354
+ children: /* @__PURE__ */ f("span", {
355
+ "aria-hidden": "true",
356
+ className: "grid h-full w-full place-items-center",
357
+ style: {
358
+ gap: "8%",
359
+ gridTemplateColumns: `repeat(${r}, minmax(0, 1fr))`,
360
+ gridTemplateRows: `repeat(${n}, minmax(0, 1fr))`
361
+ },
362
+ children: Array.from({ length: n * r }, (e, o) => /* @__PURE__ */ f("span", {
363
+ className: t(je({ shape: s === "mixed" ? v[o] ?? S[Math.floor(U(o, n, r) * S.length)] : s })),
364
+ onAnimationIteration: () => {
365
+ s === "mixed" && y((e) => {
366
+ let t = [...e], i = t[o] ?? S[Math.floor(U(o, n, r) * S.length)], a = S.filter((e) => e !== i);
367
+ return t[o] = a.length > 0 ? a[Math.floor(Math.random() * a.length)] : i, t;
368
+ }), l.length > 1 && x((e) => {
369
+ let t = [...e];
370
+ return t[o] = (t[o] ?? 0) + 1, t;
371
+ }), p.length > 1 && _((e) => {
372
+ let t = [...e];
373
+ return t[o] = ((t[o] ?? o % p.length) + (1 + Math.floor(Math.random() * (p.length - 1)))) % p.length, t;
374
+ });
375
+ },
376
+ style: {
377
+ animationDelay: l.length > 1 ? `${o / (n * r) * 1200}ms` : `${-U(o, n, r) * 1200}ms`,
378
+ animationDuration: l.length > 1 ? "1200ms" : `${900 + U(o, n, r) * 600}ms`,
379
+ backgroundColor: l.length > 0 ? l[(o + (b[o] ?? 0)) % l.length] : void 0,
380
+ fontSize: `${Math.min(i / Math.max(n, r), a) * .4}px`,
381
+ maxWidth: a,
382
+ maxHeight: a
383
+ },
384
+ children: p.length > 0 && /* @__PURE__ */ f("span", {
385
+ className: "grid h-full w-full place-items-center text-center leading-none",
386
+ children: p[g[o] ?? o % p.length]
387
+ })
388
+ }, o))
389
+ })
390
+ });
391
+ }, G = ({ cardContent: e, children: n, trigger: r = "hover", triggerRender: i, side: a = "bottom", align: o = "center", className: s, open: c, onOpenChange: l }) => /* @__PURE__ */ p(A.Root, {
392
+ open: c,
393
+ onOpenChange: l,
394
+ children: [/* @__PURE__ */ f(A.Trigger, {
395
+ nativeButton: !!i,
396
+ openOnHover: r === "hover",
397
+ render: i ?? /* @__PURE__ */ f("span", {}),
398
+ children: n
399
+ }), /* @__PURE__ */ f(A.Portal, { children: /* @__PURE__ */ f(A.Positioner, {
400
+ className: "z-50",
401
+ side: a,
402
+ align: o,
403
+ sideOffset: 8,
404
+ children: /* @__PURE__ */ p(A.Popup, {
405
+ className: t("arc-preview-card relative w-fit max-w-[calc(100vw-1rem)] rounded-md border border-border bg-popover px-2 py-3 text-foreground shadow-lg ring-1 ring-border/60", s),
406
+ children: [/* @__PURE__ */ f(A.Arrow, { className: t("border-border bg-popover h-3 w-3 rotate-45", "data-[side=bottom]:-top-1.5 data-[side=bottom]:border-t data-[side=bottom]:border-l", "data-[side=top]:-bottom-1.5 data-[side=top]:border-r data-[side=top]:border-b", "data-[side=left]:-right-1.5 data-[side=left]:border-t data-[side=left]:border-r", "data-[side=right]:-left-1.5 data-[side=right]:border-b data-[side=right]:border-l") }), e]
407
+ })
408
+ }) })]
409
+ }), Ne = ({ id: e, label: n, help: r, errors: i, className: a, ...o }) => {
410
+ let s = Array.isArray(i) ? i.map((e) => e == null ? "" : String(e)) : typeof i == "string" ? i : null;
411
+ return /* @__PURE__ */ p("div", {
412
+ ...o,
413
+ className: t("flex h-7 w-full items-center justify-start gap-2 overflow-hidden", a),
414
+ children: [
415
+ /* @__PURE__ */ f("label", {
416
+ className: "w-fit text-xl leading-none font-bold whitespace-nowrap",
417
+ title: n,
418
+ htmlFor: e,
419
+ children: n
420
+ }),
421
+ r != null && r !== !1 && /* @__PURE__ */ f(G, {
422
+ trigger: "hover",
423
+ triggerRender: /* @__PURE__ */ f("button", {
424
+ type: "button",
425
+ "aria-label": `Help for ${n}`,
426
+ className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition hover:bg-accent hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-opacity-75"
427
+ }),
428
+ cardContent: /* @__PURE__ */ f("div", {
429
+ className: "max-w-100 wrap-break-word text-sm leading-5",
430
+ children: r
431
+ }),
432
+ children: /* @__PURE__ */ f(k, {
433
+ className: "h-4 w-4",
434
+ "aria-hidden": "true"
435
+ })
436
+ }),
437
+ s && (Array.isArray(s) ? s.length > 0 && /* @__PURE__ */ f(H, { data: s }) : /* @__PURE__ */ f(H, { data: s }))
438
+ ]
439
+ });
440
+ }, Pe = e("arc-input rounded border text-foreground placeholder:text-muted-foreground focus:border-transparent focus:outline-hidden focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:border-muted disabled:bg-muted", {
332
441
  variants: {
333
442
  variant: {
334
443
  default: "border-border bg-background",
335
444
  ghost: "border-transparent bg-transparent"
336
445
  },
337
446
  as: {
338
- input: "h-10 pointer-coarse:h-11 p-1 pl-2",
447
+ input: "h-8 pointer-coarse:h-9 p-1 pl-2",
339
448
  textarea: "min-h-50 max-h-250 resize-y overflow-auto! p-2 whitespace-pre-wrap"
340
449
  }
341
450
  },
@@ -343,17 +452,17 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
343
452
  variant: "default",
344
453
  as: "input"
345
454
  }
346
- }), H = ({ as: e = "input", className: n, variant: r, ...i }) => {
347
- let a = t(V({
455
+ }), K = ({ as: e = "input", className: n, variant: r, ...i }) => {
456
+ let a = t(Pe({
348
457
  as: e,
349
458
  variant: r
350
459
  }), n);
351
- return d(e === "textarea" ? "textarea" : "input", {
460
+ return f(e === "textarea" ? "textarea" : "input", {
352
461
  ...i,
353
462
  autoComplete: "off",
354
463
  className: a
355
464
  });
356
- }, ee = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
465
+ }, Fe = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
357
466
  variants: { variant: {
358
467
  primary: "border-primary bg-primary text-primary-foreground",
359
468
  secondary: "border-secondary bg-secondary text-secondary-foreground",
@@ -365,57 +474,57 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
365
474
  "outline-warning": "border-warning bg-background text-warning"
366
475
  } },
367
476
  defaultVariants: { variant: "outline-secondary" }
368
- }), U = (e) => {
369
- let { className: n, variant: r, hoverable: i = !0, hoverLift: a = !0, hoverBorder: o = !0, hoverGradient: s = !0, postHeaderBorder: c = !0, preFooterBorder: l = !0, onPointerMove: u, ...f } = e, p = i && a, m = i && o, h = i && s;
370
- return /* @__PURE__ */ d("div", {
371
- className: t(ee({ variant: r }), h && "arc-card-cursor-border", c && "[&_.arc-card-header]:border-b", !c && "[&_.arc-card-header]:border-b-0", l && "[&_.arc-card-footer]:border-t", !l && "[&_.arc-card-footer]:border-t-0", (p || m) && "transition-[border-color,transform] duration-300 ease-out", p && "hover:-translate-y-1", m && "hover:border-primary", n),
477
+ }), q = (e) => {
478
+ let { className: n, variant: r, hoverable: i = !0, hoverLift: a = !0, hoverBorder: o = !0, hoverGradient: s = !0, postHeaderBorder: c = !0, preFooterBorder: l = !0, onPointerMove: u, ...d } = e, p = i && a, m = i && o, h = i && s;
479
+ return /* @__PURE__ */ f("div", {
480
+ className: t(Fe({ variant: r }), h && "arc-card-cursor-border", c && "[&_.arc-card-header]:border-b", !c && "[&_.arc-card-header]:border-b-0", l && "[&_.arc-card-footer]:border-t", !l && "[&_.arc-card-footer]:border-t-0", (p || m) && "transition-[border-color,transform] duration-300 ease-out", p && "hover:-translate-y-1", m && "hover:border-primary", n),
372
481
  onPointerMove: h ? (e) => {
373
482
  if (u?.(e), !h) return;
374
483
  let t = e.currentTarget.getBoundingClientRect();
375
484
  e.currentTarget.style.setProperty("--card-pointer-x", `${e.clientX - t.left}px`), e.currentTarget.style.setProperty("--card-pointer-y", `${e.clientY - t.top}px`);
376
485
  } : u,
377
- ...f
486
+ ...d
378
487
  });
379
488
  };
380
- U.Header = (e) => {
489
+ q.Header = (e) => {
381
490
  let { className: n, ...r } = e;
382
- return /* @__PURE__ */ d("h2", {
491
+ return /* @__PURE__ */ f("h2", {
383
492
  className: t("arc-card-header flex w-full typography-heading-3 flex-col border-foreground/40 px-0 pb-1", n),
384
493
  ...r
385
494
  });
386
- }, U.Content = (e) => {
495
+ }, q.Content = (e) => {
387
496
  let { className: n, ...r } = e;
388
- return /* @__PURE__ */ d("div", {
497
+ return /* @__PURE__ */ f("div", {
389
498
  className: t("arc-card-content typography-paragraph mt-0! w-full justify-between px-0 py-1 whitespace-pre-wrap", n),
390
499
  ...r
391
500
  });
392
- }, U.Footer = (e) => {
501
+ }, q.Footer = (e) => {
393
502
  let { className: n, ...r } = e;
394
- return /* @__PURE__ */ d("div", {
503
+ return /* @__PURE__ */ f("div", {
395
504
  className: t("arc-card-footer typography-muted mt-auto mb-0 flex w-full items-end justify-start border-foreground/40 px-0 pt-1", n),
396
505
  ...r
397
506
  });
398
507
  };
399
508
  //#endregion
400
- //#region components/date-handler.ts
401
- var W = class e {
509
+ //#region utilities/date-handler.ts
510
+ var J = class e {
402
511
  static toDateTime(e) {
403
- if (e == null || e === "") return g.invalid("missing date");
404
- if (e instanceof Date) return g.fromJSDate(e);
405
- if (typeof e == "number") return g.fromMillis(e);
406
- if (typeof e == "bigint") return g.fromMillis(Number(e));
512
+ if (e == null || e === "") return j.invalid("missing date");
513
+ if (e instanceof Date) return j.fromJSDate(e);
514
+ if (typeof e == "number") return j.fromMillis(e);
515
+ if (typeof e == "bigint") return j.fromMillis(Number(e));
407
516
  if (typeof e == "string") {
408
517
  let t = e.trim();
409
- if (t === "") return g.invalid("missing date");
518
+ if (t === "") return j.invalid("missing date");
410
519
  if (/^-?\d+$/.test(t)) {
411
520
  let e = Number(t.length === 10 ? Number(t) * 1e3 : t);
412
- return g.fromMillis(e);
521
+ return j.fromMillis(e);
413
522
  }
414
- return g.fromISO(t);
523
+ return j.fromISO(t);
415
524
  }
416
- return g.fromJSDate(new Date(String(e)));
525
+ return j.fromJSDate(new Date(String(e)));
417
526
  }
418
- static getDateTime(t, n = "dd/MM/yyyy hh:mm:ss a") {
527
+ static getDateTime(t, n = "dd/MMM/yyyy hh:mm:ss a") {
419
528
  let r = e.toDateTime(t);
420
529
  return r.isValid ? r.toFormat(n) : "";
421
530
  }
@@ -449,16 +558,16 @@ var W = class e {
449
558
  return i.length > 0 ? i.join(", ") : null;
450
559
  }
451
560
  static generateOffsetDateTime({ offset: e, future: t = !0, format: n = "dd/MM/yyyy hh:mm:ss a" }) {
452
- let r = t ? g.now().plus(e) : g.now().minus(e);
561
+ let r = t ? j.now().plus(e) : j.now().minus(e);
453
562
  return n ? r.toFormat(n) : r.toISO();
454
563
  }
455
564
  static getFormattedTime(t, n = "$ISO$ ($RELATIVE$)") {
456
565
  let r = e.getDateTime(t), i = e.getRelativeTime(t);
457
566
  return n.replace("$ISO$", r).replace("$RELATIVE$", i);
458
567
  }
459
- }, te = ({ value: e, format: t = "$ISO$ ($RELATIVE$)", ...n }) => {
460
- let r = s(() => e ? W.getFormattedTime(e, t) : "", [e, t]);
461
- return /* @__PURE__ */ d(H, {
568
+ }, Ie = ({ value: e, format: t = "$ISO$ ($RELATIVE$)", ...n }) => {
569
+ let r = c(() => e ? J.getFormattedTime(e, t) : "", [e, t]);
570
+ return /* @__PURE__ */ f(K, {
462
571
  type: "text",
463
572
  disabled: !0,
464
573
  readOnly: !0,
@@ -466,7 +575,7 @@ var W = class e {
466
575
  size: Math.max(r.length, 1),
467
576
  ...n
468
577
  });
469
- }, ne = e("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", {
578
+ }, Le = e("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", {
470
579
  variants: {
471
580
  variant: {
472
581
  pill: "arc-pill-link min-w-fit border border-transparent text-base text-muted-foreground transition hover:text-primary hover:outline-none hover:ring-0 focus:outline-none focus-visible:ring-opacity-75",
@@ -487,8 +596,8 @@ var W = class e {
487
596
  variant: "pill",
488
597
  size: "md"
489
598
  }
490
- }), re = ({ active: e = !1, className: n, size: r = "md", variant: i = "pill", ...a }) => /* @__PURE__ */ d("a", {
491
- className: t(ne({
599
+ }), Re = ({ active: e = !1, className: n, size: r = "md", variant: i = "pill", ...a }) => /* @__PURE__ */ f("a", {
600
+ className: t(Le({
492
601
  variant: i,
493
602
  size: r
494
603
  }), e && {
@@ -498,29 +607,29 @@ var W = class e {
498
607
  }[i], n),
499
608
  "aria-current": e ? "page" : void 0,
500
609
  ...a
501
- }), G = ({ active: e = !1, className: n, ...r }) => /* @__PURE__ */ d("button", {
610
+ }), Y = ({ active: e = !1, className: n, ...r }) => /* @__PURE__ */ f("button", {
502
611
  type: "button",
503
612
  className: t("arc-pill", "inline-flex h-10 pointer-coarse:h-11 w-full items-center justify-center whitespace-nowrap rounded-md border border-transparent px-3 py-2 text-base font-medium text-foreground transition hover:text-primary hover:outline-none hover:ring-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-opacity-75", e ? "text-primary!" : "text-muted-foreground", n),
504
613
  "aria-pressed": e,
505
614
  ...r
506
- }), K = ({ children: e }) => n.toArray(e).map((e, t) => /* @__PURE__ */ f(r, { children: [t > 0 && /* @__PURE__ */ d(_.Separator, { className: "mx-2 h-px bg-border" }), e] }, t)), q = Object.assign(({ className: e, contentClassName: n, active: r, activeClassName: i, buttonText: a, children: o }) => /* @__PURE__ */ f(_.Root, {
615
+ }), ze = ({ children: e }) => n.toArray(e).map((e, t) => /* @__PURE__ */ p(r, { children: [t > 0 && /* @__PURE__ */ f(M.Separator, { className: "mx-2 h-px bg-border" }), e] }, t)), X = Object.assign(({ className: e, contentClassName: n, active: r, activeClassName: i, buttonText: a, children: o }) => /* @__PURE__ */ p(M.Root, {
507
616
  loopFocus: !0,
508
- children: [/* @__PURE__ */ f(_.Trigger, {
509
- render: /* @__PURE__ */ d(G, {
617
+ children: [/* @__PURE__ */ p(M.Trigger, {
618
+ render: /* @__PURE__ */ f(Y, {
510
619
  active: r,
511
620
  className: t("w-fit", r && i, e)
512
621
  }),
513
- children: [a, /* @__PURE__ */ d(v, {
622
+ children: [a, /* @__PURE__ */ f(N, {
514
623
  className: "-mr-1 ml-2 h-4 w-4",
515
624
  "aria-hidden": "true"
516
625
  })]
517
- }), /* @__PURE__ */ d(_.Portal, { children: /* @__PURE__ */ d(_.Positioner, {
626
+ }), /* @__PURE__ */ f(M.Portal, { children: /* @__PURE__ */ f(M.Positioner, {
518
627
  className: "z-50",
519
628
  sideOffset: 8,
520
629
  collisionPadding: 8,
521
- children: /* @__PURE__ */ d(_.Popup, {
630
+ children: /* @__PURE__ */ f(M.Popup, {
522
631
  className: t("arc-menu-content z-50 flex bg-popover w-fit min-w-40 max-w-[calc(100vw-1rem)] origin-top-right flex-col overflow-hidden rounded-md border border-border text-foreground shadow-lg ring-1 ring-foreground/10 focus:outline-none", n),
523
- children: /* @__PURE__ */ d(K, { children: o })
632
+ children: /* @__PURE__ */ f(ze, { children: o })
524
633
  })
525
634
  }) })]
526
635
  }), {
@@ -529,14 +638,14 @@ var W = class e {
529
638
  if (r) {
530
639
  let e = n.only(s);
531
640
  if (!a(e)) throw Error("Menu.Item with asChild requires a single React element child.");
532
- return /* @__PURE__ */ d(_.Item, {
641
+ return /* @__PURE__ */ f(M.Item, {
533
642
  ...c,
534
643
  className: l,
535
644
  nativeButton: o ?? !0,
536
645
  render: e
537
646
  });
538
647
  }
539
- return /* @__PURE__ */ d(_.Item, {
648
+ return /* @__PURE__ */ f(M.Item, {
540
649
  ...c,
541
650
  className: l,
542
651
  nativeButton: o,
@@ -545,44 +654,44 @@ var W = class e {
545
654
  },
546
655
  Sub: ({ active: e, buttonText: r, children: i }) => {
547
656
  let o = n.toArray(i).some((e) => a(e) && e.props.active), s = e || o;
548
- return /* @__PURE__ */ f(_.SubmenuRoot, {
657
+ return /* @__PURE__ */ p(M.SubmenuRoot, {
549
658
  loopFocus: !0,
550
- children: [/* @__PURE__ */ f(_.SubmenuTrigger, {
659
+ children: [/* @__PURE__ */ p(M.SubmenuTrigger, {
551
660
  className: t("arc-pill arc-menu-sub-trigger inline-flex h-10 pointer-coarse:h-11 w-full items-center justify-between whitespace-nowrap rounded-md border border-transparent px-3 py-2 text-base font-medium text-foreground transition focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-opacity-75", "data-highlighted:bg-accent data-highlighted:text-primary", s && "text-primary!"),
552
- children: [r, /* @__PURE__ */ d(y, {
661
+ children: [r, /* @__PURE__ */ f(P, {
553
662
  className: "-mr-1 ml-2 h-4 w-4",
554
663
  "aria-hidden": "true"
555
664
  })]
556
- }), /* @__PURE__ */ d(_.Portal, { children: /* @__PURE__ */ d(_.Positioner, {
665
+ }), /* @__PURE__ */ f(M.Portal, { children: /* @__PURE__ */ f(M.Positioner, {
557
666
  className: "z-50",
558
667
  side: "right",
559
668
  align: "start",
560
669
  sideOffset: 8,
561
670
  collisionPadding: 8,
562
- children: /* @__PURE__ */ d(_.Popup, {
671
+ children: /* @__PURE__ */ f(M.Popup, {
563
672
  className: "arc-menu-content z-50 flex bg-popover w-fit min-w-40 max-w-[calc(100vw-1rem)] origin-top-right flex-col overflow-hidden rounded-md border border-border text-foreground shadow-lg ring-1 ring-foreground/10 focus:outline-none",
564
- children: /* @__PURE__ */ d(K, { children: i })
673
+ children: /* @__PURE__ */ f(ze, { children: i })
565
674
  })
566
675
  }) })]
567
676
  });
568
677
  }
569
- }), ie = ({ open: e = !1, setOpen: n, children: r, initialFocus: i, headerContent: a, footerContent: s, width: c, height: l, className: u, customKeyHandler: p }) => (o(() => {
678
+ }), Be = ({ open: e = !1, setOpen: n, children: r, initialFocus: i, headerContent: a, footerContent: s, width: c, height: l, className: u, customKeyHandler: d }) => (o(() => {
570
679
  if (!e) return;
571
680
  let t = (e) => {
572
681
  let t = e.key === "Escape" ? "esc" : (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" ? "ctrl+s" : null;
573
- t && (e.preventDefault(), t === "esc" && n(!1), p?.(t, e));
682
+ t && (e.preventDefault(), t === "esc" && n(!1), d?.(t, e));
574
683
  };
575
684
  return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
576
685
  }, [
577
686
  e,
578
687
  n,
579
- p
580
- ]), /* @__PURE__ */ d(C.Root, {
688
+ d
689
+ ]), /* @__PURE__ */ f(R.Root, {
581
690
  open: e,
582
691
  onOpenChange: n,
583
- children: /* @__PURE__ */ f(C.Portal, { children: [/* @__PURE__ */ d(C.Backdrop, { className: t("fixed inset-0 z-10 bg-black/80 transition-opacity duration-300", "data-ending-style:opacity-0 data-starting-style:opacity-0") }), /* @__PURE__ */ d(C.Viewport, {
692
+ children: /* @__PURE__ */ p(R.Portal, { children: [/* @__PURE__ */ f(R.Backdrop, { className: t("fixed inset-0 z-10 bg-black/80 transition-opacity duration-300", "data-ending-style:opacity-0 data-starting-style:opacity-0") }), /* @__PURE__ */ f(R.Viewport, {
584
693
  className: "fixed inset-0 z-10 flex min-h-dvh items-center justify-center p-4",
585
- children: /* @__PURE__ */ f(C.Popup, {
694
+ children: /* @__PURE__ */ p(R.Popup, {
586
695
  initialFocus: i,
587
696
  className: t("arc-modal flex max-h-full w-fit max-w-full flex-col overflow-auto rounded-md border border-border bg-card p-6 text-left align-middle text-foreground shadow-xl", "transition-all duration-300", "data-starting-style:scale-95 data-starting-style:opacity-0", "data-ending-style:scale-95 data-ending-style:opacity-0", u),
588
697
  style: {
@@ -590,27 +699,27 @@ var W = class e {
590
699
  height: l
591
700
  },
592
701
  children: [
593
- /* @__PURE__ */ d(C.Title, {
702
+ /* @__PURE__ */ f(R.Title, {
594
703
  className: "mb-4 border-b border-border pb-2 text-lg font-bold leading-6 text-foreground",
595
704
  children: a
596
705
  }),
597
- /* @__PURE__ */ d("div", {
706
+ /* @__PURE__ */ f("div", {
598
707
  className: "grow",
599
708
  children: r
600
709
  }),
601
- s && /* @__PURE__ */ d("div", {
710
+ s && /* @__PURE__ */ f("div", {
602
711
  className: "mt-auto border-t border-border pt-2",
603
712
  children: s
604
713
  })
605
714
  ]
606
715
  })
607
716
  })] })
608
- })), ae = ({ id: e, items: n, value: r, onChange: i, className: a, placeholder: o = "Select options", disabled: s, name: c, preventEmpty: l = !1, "data-name": u, "data-required": g }) => {
609
- let _ = n.filter((e) => r?.includes(String(e.key)));
610
- return /* @__PURE__ */ d(p.Root, {
717
+ })), Ve = ({ id: e, items: n, value: r, onChange: i, className: a, placeholder: o = "Select options", disabled: s, name: c, preventEmpty: l = !1, "data-name": u, "data-required": d }) => {
718
+ let h = n.filter((e) => r?.includes(String(e.key)));
719
+ return /* @__PURE__ */ f(m.Root, {
611
720
  multiple: !0,
612
721
  items: n,
613
- value: _,
722
+ value: h,
614
723
  onValueChange: (e) => {
615
724
  l && e.length === 0 || i?.(e);
616
725
  },
@@ -619,63 +728,63 @@ var W = class e {
619
728
  isItemEqualToValue: (e, t) => String(e.key) === String(t.key),
620
729
  name: c,
621
730
  disabled: s,
622
- children: /* @__PURE__ */ f("div", {
731
+ children: /* @__PURE__ */ p("div", {
623
732
  className: t("arc-dropdown-multi relative", a),
624
- children: [/* @__PURE__ */ f(p.InputGroup, {
625
- className: t("relative flex min-h-10 w-full items-center justify-between gap-1.5 rounded-md border border-border bg-background py-1 pr-2 pl-2 text-foreground shadow-xs", "focus-within:border-transparent focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring", "data-disabled:cursor-not-allowed data-disabled:bg-muted data-disabled:text-muted-foreground"),
626
- children: [/* @__PURE__ */ d(p.Value, { children: (n) => /* @__PURE__ */ f("div", {
733
+ children: [/* @__PURE__ */ p(m.InputGroup, {
734
+ className: t("relative flex min-h-8 w-full items-center justify-between gap-1.5 rounded border border-border bg-background py-1 pr-2 pl-2 text-foreground shadow-xs pointer-coarse:min-h-9", "focus-within:border-transparent focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring", "data-disabled:cursor-not-allowed data-disabled:bg-muted data-disabled:text-muted-foreground"),
735
+ children: [/* @__PURE__ */ f(m.Value, { children: (n) => /* @__PURE__ */ p("div", {
627
736
  className: "flex min-w-0 grow flex-wrap items-center gap-1.5",
628
- children: [/* @__PURE__ */ d(p.Chips, {
737
+ children: [/* @__PURE__ */ f(m.Chips, {
629
738
  className: "flex flex-wrap gap-1.5",
630
- children: n.map((e) => /* @__PURE__ */ f(p.Chip, {
739
+ children: n.map((e) => /* @__PURE__ */ p(m.Chip, {
631
740
  className: "inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 py-0.5 text-sm text-foreground",
632
- children: [/* @__PURE__ */ d("span", {
741
+ children: [/* @__PURE__ */ f("span", {
633
742
  className: "max-w-32 truncate",
634
743
  children: e.label
635
- }), !s && (!l || n.length > 1) && /* @__PURE__ */ d(p.ChipRemove, {
744
+ }), !s && (!l || n.length > 1) && /* @__PURE__ */ f(m.ChipRemove, {
636
745
  className: "ml-0.5 cursor-pointer rounded-md hover:text-destructive focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
637
746
  "aria-label": `Remove ${e.label}`,
638
- children: /* @__PURE__ */ d(w, {
747
+ children: /* @__PURE__ */ f(z, {
639
748
  className: "h-3 w-3",
640
749
  "aria-hidden": "true"
641
750
  })
642
751
  })]
643
752
  }, e.key))
644
- }), /* @__PURE__ */ d(p.Input, {
753
+ }), /* @__PURE__ */ f(m.Input, {
645
754
  id: e,
646
755
  className: t("h-full min-w-20 grow border-none bg-transparent py-0.5 pl-1 outline-hidden placeholder:text-muted-foreground focus:ring-0 focus:outline-hidden disabled:cursor-not-allowed", n.length > 0 && "placeholder-transparent"),
647
756
  placeholder: o,
648
757
  "data-name": u,
649
- "data-required": g,
758
+ "data-required": d,
650
759
  "data-disabled": s
651
760
  })]
652
- }) }), /* @__PURE__ */ d(p.Trigger, {
761
+ }) }), /* @__PURE__ */ f(m.Trigger, {
653
762
  className: "shrink-0 self-center rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
654
763
  "aria-label": "Toggle options",
655
- children: /* @__PURE__ */ d(h, {
764
+ children: /* @__PURE__ */ f(x, {
656
765
  className: "h-5 w-5 text-foreground",
657
766
  "aria-hidden": "true"
658
767
  })
659
768
  })]
660
- }), /* @__PURE__ */ d(p.Portal, { children: /* @__PURE__ */ d(p.Positioner, {
769
+ }), /* @__PURE__ */ f(m.Portal, { children: /* @__PURE__ */ f(m.Positioner, {
661
770
  className: "z-50",
662
771
  sideOffset: 8,
663
- children: /* @__PURE__ */ f(p.Popup, {
772
+ children: /* @__PURE__ */ p(m.Popup, {
664
773
  className: "max-h-60 min-w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover text-foreground shadow-lg outline-0",
665
- children: [/* @__PURE__ */ d(p.Empty, {
774
+ children: [/* @__PURE__ */ f(m.Empty, {
666
775
  className: "relative cursor-default select-none px-4 py-2 text-muted-foreground empty:hidden",
667
776
  children: "No values to show."
668
- }), /* @__PURE__ */ d(p.List, { children: (e) => /* @__PURE__ */ f(p.Item, {
777
+ }), /* @__PURE__ */ f(m.List, { children: (e) => /* @__PURE__ */ p(m.Item, {
669
778
  value: e,
670
779
  disabled: e.disabled,
671
780
  className: t("relative flex h-8 w-full cursor-default select-none items-center gap-2 border-b border-border px-4 py-1 last:border-b-0", "data-selected:font-medium data-selected:text-primary", "data-highlighted:bg-accent data-highlighted:text-primary", "data-disabled:cursor-not-allowed data-disabled:opacity-50"),
672
- children: [/* @__PURE__ */ d(p.ItemIndicator, {
781
+ children: [/* @__PURE__ */ f(m.ItemIndicator, {
673
782
  className: "flex items-center",
674
- children: /* @__PURE__ */ d(m, {
783
+ children: /* @__PURE__ */ f(b, {
675
784
  className: "h-3 w-3",
676
785
  "aria-hidden": "true"
677
786
  })
678
- }), /* @__PURE__ */ d("span", {
787
+ }), /* @__PURE__ */ f("span", {
679
788
  title: e.label,
680
789
  className: "block truncate",
681
790
  children: e.label
@@ -685,21 +794,7 @@ var W = class e {
685
794
  }) })]
686
795
  })
687
796
  });
688
- }, oe = ({ cardContent: e, children: n, trigger: r = "hover", triggerRender: i, side: a = "bottom", align: o = "center", className: s }) => /* @__PURE__ */ f(T.Root, { children: [/* @__PURE__ */ d(T.Trigger, {
689
- nativeButton: !!i,
690
- openOnHover: r === "hover",
691
- render: i ?? /* @__PURE__ */ d("span", {}),
692
- children: n
693
- }), /* @__PURE__ */ d(T.Portal, { children: /* @__PURE__ */ d(T.Positioner, {
694
- className: "z-50",
695
- side: a,
696
- align: o,
697
- sideOffset: 8,
698
- children: /* @__PURE__ */ d(T.Popup, {
699
- className: t("arc-preview-card relative w-fit max-w-[calc(100vw-1rem)] rounded-md border border-border bg-popover px-2 py-3 text-foreground shadow-lg ring-1 ring-border/60", "data-[side=bottom]:before:absolute data-[side=bottom]:before:top-0 data-[side=bottom]:before:left-1/2 data-[side=bottom]:before:h-3 data-[side=bottom]:before:w-3 data-[side=bottom]:before:-translate-x-1/2 data-[side=bottom]:before:-translate-y-1/2 data-[side=bottom]:before:rotate-45", "data-[side=bottom]:before:border-t data-[side=bottom]:before:border-l data-[side=bottom]:before:border-border data-[side=bottom]:before:bg-popover", s),
700
- children: e
701
- })
702
- }) })] }), se = ({ id: e, value: n, onChange: r, data: i, className: a, disabled: o, placeholder: s, ...c }) => /* @__PURE__ */ f(E.Root, {
797
+ }, Z = ({ id: e, value: n, onChange: r, data: i, className: a, disabled: o, placeholder: s, ...c }) => /* @__PURE__ */ p(B.Root, {
703
798
  value: n,
704
799
  onValueChange: (e) => {
705
800
  e !== null && r(e);
@@ -710,40 +805,40 @@ var W = class e {
710
805
  label: typeof e.label == "string" ? e.label : e.key
711
806
  })),
712
807
  ...c,
713
- children: [/* @__PURE__ */ f(E.Trigger, {
808
+ children: [/* @__PURE__ */ p(B.Trigger, {
714
809
  id: e,
715
- className: t("arc-select flex w-full items-center gap-2 overflow-hidden rounded-md border border-border bg-background px-2 py-1 text-foreground shadow-xs focus:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground", a),
716
- children: [/* @__PURE__ */ d(E.Value, {
810
+ className: t("arc-select flex h-8 w-full items-center gap-2 overflow-hidden rounded border border-border bg-background px-2 py-1 text-foreground shadow-xs focus:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-9", "disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground", a),
811
+ children: [/* @__PURE__ */ f(B.Value, {
717
812
  placeholder: s,
718
813
  className: "min-w-0 flex-1 truncate text-left"
719
- }), /* @__PURE__ */ d(E.Icon, {
814
+ }), /* @__PURE__ */ f(B.Icon, {
720
815
  className: "shrink-0",
721
- children: /* @__PURE__ */ d(h, {
816
+ children: /* @__PURE__ */ f(x, {
722
817
  className: "h-3.5 w-3.5 text-muted-foreground",
723
818
  "aria-hidden": "true"
724
819
  })
725
820
  })]
726
- }), /* @__PURE__ */ d(E.Portal, { children: /* @__PURE__ */ d(E.Positioner, {
821
+ }), /* @__PURE__ */ f(B.Portal, { children: /* @__PURE__ */ f(B.Positioner, {
727
822
  className: "z-50 outline-none",
728
823
  sideOffset: 8,
729
824
  alignItemWithTrigger: !1,
730
825
  side: "bottom",
731
826
  align: "start",
732
- children: /* @__PURE__ */ d(E.Popup, {
827
+ children: /* @__PURE__ */ f(B.Popup, {
733
828
  className: "min-w-(--anchor-width) overflow-hidden rounded-md border border-border bg-popover text-foreground shadow-lg outline-none",
734
- children: /* @__PURE__ */ d(E.List, {
829
+ children: /* @__PURE__ */ f(B.List, {
735
830
  className: "max-h-60 overflow-auto outline-none",
736
- children: i.map((e) => /* @__PURE__ */ f(E.Item, {
831
+ children: i.map((e) => /* @__PURE__ */ p(B.Item, {
737
832
  value: e.key,
738
833
  disabled: e.disabled ?? !1,
739
834
  className: t("relative flex w-full cursor-default select-none items-center gap-2 px-2 py-1 outline-none", "data-highlighted:bg-accent data-highlighted:text-primary", "data-selected:font-medium data-selected:text-primary", "data-disabled:cursor-not-allowed data-disabled:opacity-50"),
740
- children: [/* @__PURE__ */ d(E.ItemIndicator, {
835
+ children: [/* @__PURE__ */ f(B.ItemIndicator, {
741
836
  className: "flex items-center",
742
- children: /* @__PURE__ */ d(m, {
837
+ children: /* @__PURE__ */ f(b, {
743
838
  className: "h-3 w-3",
744
839
  "aria-hidden": "true"
745
840
  })
746
- }), /* @__PURE__ */ d(E.ItemText, {
841
+ }), /* @__PURE__ */ f(B.ItemText, {
747
842
  className: "block truncate",
748
843
  children: e.label
749
844
  })]
@@ -751,7 +846,7 @@ var W = class e {
751
846
  })
752
847
  })
753
848
  }) })]
754
- }), ce = e("arc-tag inline-flex w-fit items-center rounded-full border border-transparent px-1.5 py-0.5 text-xs font-bold", {
849
+ }), He = e("arc-tag inline-flex w-fit items-center rounded-full border border-transparent px-1.5 py-0.5 text-xs font-bold", {
755
850
  variants: { variant: {
756
851
  primary: "bg-primary text-primary-foreground",
757
852
  secondary: "border-border bg-secondary text-secondary-foreground",
@@ -761,37 +856,507 @@ var W = class e {
761
856
  outline: "border-border bg-transparent text-foreground"
762
857
  } },
763
858
  defaultVariants: { variant: "primary" }
764
- }), le = ({ className: e, variant: n, ...r }) => /* @__PURE__ */ d("div", {
765
- className: t(ce({
859
+ }), Ue = ({ className: e, variant: n, ...r }) => /* @__PURE__ */ f("div", {
860
+ className: t(He({
766
861
  variant: n,
767
862
  className: e
768
863
  })),
769
864
  ...r
770
- }), ue = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }) => /* @__PURE__ */ d("a", {
865
+ }), We = (e, t, n, r) => {
866
+ let i = e.getValue(t), a = ee(i, n);
867
+ return r({ itemRank: a }), a.passed;
868
+ }, Q = {
869
+ fuzzy: We,
870
+ includesString: le,
871
+ select: (e, t, n) => {
872
+ let r = e.getValue(t);
873
+ return Array.isArray(r) ? r.some((e) => String(e) === String(n)) : typeof r == "string" && r.includes(",") ? r.split(",").map((e) => e.trim()).includes(String(n)) : String(r) === String(n);
874
+ }
875
+ }, Ge = ye({
876
+ columnMeta: {},
877
+ columnFilteringFeature: te,
878
+ columnResizingFeature: ne,
879
+ columnSizingFeature: re,
880
+ columnVisibilityFeature: ie,
881
+ globalFilteringFeature: ue,
882
+ rowPaginationFeature: de,
883
+ rowSortingFeature: fe,
884
+ filteredRowModel: oe(),
885
+ paginatedRowModel: se(),
886
+ sortedRowModel: ce(),
887
+ sortFns: {
888
+ alphanumeric: pe,
889
+ alphanumericCaseSensitive: me,
890
+ basic: he,
891
+ datetime: ge,
892
+ text: _e,
893
+ textCaseSensitive: ve
894
+ },
895
+ filterFns: Q
896
+ });
897
+ function Ke(e) {
898
+ return Object.prototype.hasOwnProperty.call(Q, e);
899
+ }
900
+ function qe(e, t) {
901
+ if (e !== !1) {
902
+ if (e === void 0) return t ? "select" : void 0;
903
+ if (typeof e == "function" || e === "auto" || Ke(e)) return e;
904
+ throw Error(`Unsupported table filterFn "${e}". Use "auto" or one of: ${Object.keys(Q).join(", ")}.`);
905
+ }
906
+ }
907
+ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, showHeader: a = !0, showFilters: o = !0, showSorting: l = !0 }) => {
908
+ let d = s(), [m, b] = u({
909
+ pageIndex: 0,
910
+ pageSize: r
911
+ }), [x, w] = u([]), [T, D] = u(""), [O, k] = u([]), [A, j] = u({}), M = x.length > 0 || T !== "", N = c(() => n?.map((e) => Je.accessor(e.accessorKey, {
912
+ id: e.id,
913
+ enableResizing: e.enableResizing,
914
+ enableColumnFilter: e.filterFn !== !1 && e.enableColumnFilter,
915
+ enableSorting: e.enableSorting,
916
+ enableHiding: e.enableHiding ?? !0,
917
+ size: e.size,
918
+ minSize: e.minSize ?? 50,
919
+ maxSize: e.maxSize ?? 1e3,
920
+ filterFn: qe(e.filterFn, e.filterSelectOptions),
921
+ meta: {
922
+ headerLabel: e.header,
923
+ filterSelectOptions: e.filterSelectOptions,
924
+ mobileFullWidth: e.mobileFullWidth
925
+ },
926
+ header: (n) => {
927
+ let r = n.column.getIsSorted(), i = n.column.getCanSort();
928
+ return /* @__PURE__ */ f("div", {
929
+ className: "flex flex-col gap-1.5",
930
+ children: /* @__PURE__ */ p("div", {
931
+ className: t("flex items-center gap-1.5", l && i && "cursor-pointer select-none"),
932
+ onClick: l && i ? n.column.getToggleSortingHandler() : void 0,
933
+ children: [/* @__PURE__ */ f("span", {
934
+ className: "min-w-0 truncate text-sm font-semibold tracking-wide",
935
+ children: e.header
936
+ }), l && i && /* @__PURE__ */ p("span", {
937
+ className: "text-muted-foreground ml-auto shrink-0 text-xs",
938
+ children: [
939
+ r === "asc" && /* @__PURE__ */ f(v, { className: "text-primary h-3.5 w-3.5" }),
940
+ r === "desc" && /* @__PURE__ */ f(_, { className: "text-primary h-3.5 w-3.5" }),
941
+ r === !1 && /* @__PURE__ */ f(y, { className: "h-3 w-3 opacity-60" })
942
+ ]
943
+ })]
944
+ })
945
+ });
946
+ },
947
+ cell: e.cell ?? ((e) => e.getValue())
948
+ })), [n]), P = be({
949
+ data: e,
950
+ columns: N,
951
+ state: {
952
+ columnFilters: x,
953
+ globalFilter: T,
954
+ sorting: O,
955
+ pagination: m,
956
+ columnVisibility: A
957
+ },
958
+ enableColumnResizing: !0,
959
+ columnResizeMode: "onChange",
960
+ onColumnVisibilityChange: j,
961
+ onSortingChange: k,
962
+ onColumnFiltersChange: w,
963
+ onGlobalFilterChange: D,
964
+ globalFilterFn: We,
965
+ features: Ge,
966
+ defaultColumn: {
967
+ size: 200,
968
+ minSize: 50,
969
+ maxSize: 1e3
970
+ }
971
+ }), F = P.getFilteredRowModel().rows.length, I = P.getVisibleLeafColumns(), L = o && I.some((e) => e.getCanFilter()), R = l && I.some((e) => e.getCanSort()), z = (e) => n.find((t) => (t.id ?? t.accessorKey) === e)?.header ?? e;
972
+ return /* @__PURE__ */ p("div", {
973
+ className: t("flex w-full min-w-0 flex-col", i),
974
+ children: [
975
+ a && /* @__PURE__ */ p("div", {
976
+ className: "border-muted-foreground bg-card relative z-10 flex flex-col gap-3 rounded-t-lg border p-3 md:flex-row md:items-center md:gap-4",
977
+ children: [
978
+ /* @__PURE__ */ p("div", {
979
+ className: "flex items-center gap-2",
980
+ children: [/* @__PURE__ */ p(V, {
981
+ variant: "outline-secondary",
982
+ size: "sm",
983
+ disabled: !M && O.length === 0,
984
+ onClick: () => {
985
+ w([]), D(""), k([]);
986
+ },
987
+ title: "Clear filters and sorting",
988
+ type: "button",
989
+ children: [/* @__PURE__ */ f(E, { className: "mr-1.5 h-3 w-3" }), "Clear filters and sorting"]
990
+ }), /* @__PURE__ */ f(Qe, { table: P })]
991
+ }),
992
+ /* @__PURE__ */ p("nav", {
993
+ "aria-label": "Table pagination",
994
+ className: "flex w-full items-center justify-between gap-1 md:flex-1 md:justify-center",
995
+ children: [
996
+ /* @__PURE__ */ p("div", {
997
+ className: "flex items-center gap-1",
998
+ children: [/* @__PURE__ */ f(V, {
999
+ variant: "outline-secondary",
1000
+ size: "icon-md",
1001
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1002
+ onClick: () => b((e) => ({
1003
+ ...e,
1004
+ pageIndex: 0
1005
+ })),
1006
+ disabled: !P.getCanPreviousPage(),
1007
+ title: "First page",
1008
+ "aria-label": "First page",
1009
+ type: "button",
1010
+ children: /* @__PURE__ */ f(h, {
1011
+ "aria-hidden": "true",
1012
+ className: "h-3.5 w-3.5"
1013
+ })
1014
+ }), /* @__PURE__ */ f(V, {
1015
+ variant: "outline-secondary",
1016
+ size: "icon-md",
1017
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1018
+ onClick: () => b((e) => ({
1019
+ ...e,
1020
+ pageIndex: e.pageIndex - 1
1021
+ })),
1022
+ disabled: !P.getCanPreviousPage(),
1023
+ title: "Previous page",
1024
+ "aria-label": "Previous page",
1025
+ type: "button",
1026
+ children: /* @__PURE__ */ f(S, {
1027
+ "aria-hidden": "true",
1028
+ className: "h-3.5 w-3.5"
1029
+ })
1030
+ })]
1031
+ }),
1032
+ /* @__PURE__ */ f("span", {
1033
+ "aria-hidden": "true",
1034
+ className: "text-muted-foreground px-1",
1035
+ children: "·"
1036
+ }),
1037
+ /* @__PURE__ */ p("span", {
1038
+ className: "text-center text-xs font-medium",
1039
+ children: [/* @__PURE__ */ f("span", {
1040
+ className: "text-foreground",
1041
+ children: F > 0 ? `${F} ${F === 1 ? "row" : "rows"}` : "No rows"
1042
+ }), F > 0 && /* @__PURE__ */ p("span", {
1043
+ className: "text-muted-foreground block",
1044
+ children: [
1045
+ "Page ",
1046
+ P.state.pagination.pageIndex + 1,
1047
+ " of ",
1048
+ P.getPageCount(),
1049
+ M && " · filtered"
1050
+ ]
1051
+ })]
1052
+ }),
1053
+ /* @__PURE__ */ f("span", {
1054
+ "aria-hidden": "true",
1055
+ className: "text-muted-foreground px-1",
1056
+ children: "·"
1057
+ }),
1058
+ /* @__PURE__ */ p("div", {
1059
+ className: "flex items-center gap-1",
1060
+ children: [/* @__PURE__ */ f(V, {
1061
+ variant: "outline-secondary",
1062
+ size: "icon-md",
1063
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1064
+ onClick: () => b((e) => ({
1065
+ ...e,
1066
+ pageIndex: e.pageIndex + 1
1067
+ })),
1068
+ disabled: !P.getCanNextPage(),
1069
+ title: "Next page",
1070
+ "aria-label": "Next page",
1071
+ type: "button",
1072
+ children: /* @__PURE__ */ f(C, {
1073
+ "aria-hidden": "true",
1074
+ className: "h-3.5 w-3.5"
1075
+ })
1076
+ }), /* @__PURE__ */ f(V, {
1077
+ variant: "outline-secondary",
1078
+ size: "icon-md",
1079
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1080
+ onClick: () => b((e) => ({
1081
+ ...e,
1082
+ pageIndex: P.getPageCount() - 1
1083
+ })),
1084
+ disabled: !P.getCanNextPage(),
1085
+ title: "Last page",
1086
+ "aria-label": "Last page",
1087
+ type: "button",
1088
+ children: /* @__PURE__ */ f(g, {
1089
+ "aria-hidden": "true",
1090
+ className: "h-3.5 w-3.5"
1091
+ })
1092
+ })]
1093
+ })
1094
+ ]
1095
+ }),
1096
+ /* @__PURE__ */ p("label", {
1097
+ htmlFor: `${d}-page-size`,
1098
+ className: "text-muted-foreground flex w-full items-center justify-between gap-2 text-xs md:w-auto",
1099
+ children: ["Rows per page", /* @__PURE__ */ f(Z, {
1100
+ id: `${d}-page-size`,
1101
+ value: P.state.pagination.pageSize.toString(),
1102
+ onChange: (e) => {
1103
+ b({
1104
+ ...m,
1105
+ pageSize: Number(e)
1106
+ });
1107
+ },
1108
+ className: "w-16",
1109
+ data: [
1110
+ 10,
1111
+ 20,
1112
+ 30,
1113
+ 40,
1114
+ 50
1115
+ ].map((e) => ({
1116
+ key: e.toString(),
1117
+ label: e.toString()
1118
+ }))
1119
+ })]
1120
+ })
1121
+ ]
1122
+ }),
1123
+ (L || R) && /* @__PURE__ */ p("details", {
1124
+ className: "border-muted-foreground border-x border-b px-3 py-2",
1125
+ children: [/* @__PURE__ */ f("summary", {
1126
+ className: "cursor-pointer text-sm font-medium",
1127
+ children: L && R ? "Filters and sorting" : L ? "Filters" : "Sorting"
1128
+ }), /* @__PURE__ */ p("div", {
1129
+ className: "grid gap-3 pt-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
1130
+ children: [R && /* @__PURE__ */ p("div", {
1131
+ className: "flex min-w-0 items-end gap-2",
1132
+ children: [/* @__PURE__ */ p("div", {
1133
+ className: "min-w-0 flex-1",
1134
+ children: [/* @__PURE__ */ f("label", {
1135
+ htmlFor: `${d}-sort`,
1136
+ className: "text-muted-foreground mb-1 block text-xs font-medium",
1137
+ children: "Sort by"
1138
+ }), /* @__PURE__ */ f(Z, {
1139
+ id: `${d}-sort`,
1140
+ value: O[0]?.id ?? "__none__",
1141
+ onChange: (e) => {
1142
+ k((t) => e === "__none__" ? [] : [{
1143
+ id: e,
1144
+ desc: t.find((t) => t.id === e)?.desc ?? !1
1145
+ }]);
1146
+ },
1147
+ data: [{
1148
+ key: "__none__",
1149
+ label: "No sorting"
1150
+ }, ...P.getVisibleLeafColumns().filter((e) => e.getCanSort()).map((e) => ({
1151
+ key: e.id,
1152
+ label: e.columnDef.meta?.headerLabel ?? e.id
1153
+ }))]
1154
+ })]
1155
+ }), /* @__PURE__ */ f(V, {
1156
+ variant: "outline-secondary",
1157
+ size: "icon-sm",
1158
+ disabled: O.length === 0,
1159
+ title: O[0]?.desc ? "Sort ascending" : "Sort descending",
1160
+ "aria-label": O[0]?.desc ? "Sort ascending" : "Sort descending",
1161
+ onClick: () => k((e) => e.map((e, t) => t === 0 ? {
1162
+ ...e,
1163
+ desc: !e.desc
1164
+ } : e)),
1165
+ type: "button",
1166
+ children: O[0]?.desc ? /* @__PURE__ */ f(_, {
1167
+ "aria-hidden": "true",
1168
+ className: "h-3.5 w-3.5"
1169
+ }) : /* @__PURE__ */ f(v, {
1170
+ "aria-hidden": "true",
1171
+ className: "h-3.5 w-3.5"
1172
+ })
1173
+ })]
1174
+ }), L && I.filter((e) => e.getCanFilter()).map((e) => {
1175
+ let t = e.columnDef.meta?.headerLabel ?? e.id, n = `${d}-${e.id}-filter`;
1176
+ return /* @__PURE__ */ p("div", {
1177
+ className: "min-w-0",
1178
+ children: [/* @__PURE__ */ f("label", {
1179
+ htmlFor: n,
1180
+ className: "text-muted-foreground mb-1 block text-xs font-medium",
1181
+ children: t
1182
+ }), /* @__PURE__ */ f(Ze, {
1183
+ column: e,
1184
+ idPrefix: `${d}-`
1185
+ })]
1186
+ }, e.id);
1187
+ })]
1188
+ })]
1189
+ }),
1190
+ /* @__PURE__ */ p("div", {
1191
+ className: t("border-muted-foreground w-full min-w-0 overflow-hidden border-x border-b last:rounded-b-lg", !a && "rounded-t-lg border-t"),
1192
+ children: [/* @__PURE__ */ f("div", {
1193
+ className: "hidden w-full min-w-0 overflow-x-auto md:block",
1194
+ children: /* @__PURE__ */ p("table", {
1195
+ className: "w-full table-fixed border-collapse",
1196
+ style: { minWidth: P.getVisibleLeafColumns().reduce((e, t) => e + t.getSize(), 0) },
1197
+ children: [/* @__PURE__ */ f("thead", { children: P.getHeaderGroups().map((e) => /* @__PURE__ */ f("tr", {
1198
+ className: "bg-muted/50",
1199
+ children: e.headers.map((e) => /* @__PURE__ */ p("th", {
1200
+ className: "border-border relative border-r border-b px-3 py-2.5 text-left last:border-r-0",
1201
+ style: { width: e.getSize() },
1202
+ colSpan: e.colSpan,
1203
+ children: [e.isPlaceholder ? null : /* @__PURE__ */ f(P.FlexRender, { header: e }), /* @__PURE__ */ f("div", {
1204
+ onDoubleClick: () => e.column.resetSize(),
1205
+ onMouseDown: e.getResizeHandler(),
1206
+ onTouchStart: e.getResizeHandler(),
1207
+ className: t("absolute top-0 right-0 h-full w-1 cursor-col-resize", "hover:bg-primary/50 active:bg-primary", e.column.getIsResizing() && "bg-primary"),
1208
+ children: e.column.getIsResizing() && /* @__PURE__ */ p("span", {
1209
+ className: "bg-primary text-primary-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded px-1.5 py-0.5 text-[10px] font-medium whitespace-nowrap shadow",
1210
+ children: [Math.round(e.getSize()), "px"]
1211
+ })
1212
+ })]
1213
+ }, e.id))
1214
+ }, e.id)) }), /* @__PURE__ */ p("tbody", { children: [P.getRowModel().rows.length === 0 && /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
1215
+ colSpan: N.length,
1216
+ className: "text-muted-foreground px-3 py-4 text-center text-sm",
1217
+ children: "No results found."
1218
+ }) }), P.getRowModel().rows.map((e, n) => /* @__PURE__ */ f("tr", {
1219
+ className: t("h-8 transition-colors", "hover:bg-accent/50", n % 2 == 1 && "bg-muted/20", n < P.getRowModel().rows.length - 1 && "border-border border-b"),
1220
+ children: e.getVisibleCells().map((e) => /* @__PURE__ */ f("td", {
1221
+ className: "border-border max-w-0 truncate border-r px-2 text-sm last:border-r-0",
1222
+ children: /* @__PURE__ */ f(P.FlexRender, { cell: e })
1223
+ }, e.id))
1224
+ }, e.id))] })]
1225
+ })
1226
+ }), /* @__PURE__ */ f("div", {
1227
+ className: "flex flex-col gap-3 p-3 md:hidden",
1228
+ children: P.getRowModel().rows.length === 0 ? /* @__PURE__ */ f("div", {
1229
+ className: "text-muted-foreground px-3 py-4 text-center text-sm",
1230
+ children: "No results found."
1231
+ }) : P.getRowModel().rows.map((e, n) => /* @__PURE__ */ f("article", {
1232
+ className: t("border-border bg-background min-w-0 rounded-md border p-4", n % 2 == 1 && "bg-muted/20"),
1233
+ children: /* @__PURE__ */ f("dl", {
1234
+ className: "flex min-w-0 flex-col gap-2",
1235
+ children: e.getVisibleCells().map((e, n) => /* @__PURE__ */ p("div", {
1236
+ className: t("border-border min-w-0 border-b pb-2 last:border-b-0 last:pb-0", n === 0 || e.column.columnDef.meta?.mobileFullWidth ? "flex flex-col gap-1" : "grid grid-cols-[minmax(5rem,1fr)_minmax(0,2fr)] items-start gap-2"),
1237
+ children: [/* @__PURE__ */ f("dt", {
1238
+ className: "text-muted-foreground shrink-0 text-xs font-medium",
1239
+ children: z(e.column.id)
1240
+ }), /* @__PURE__ */ f("dd", {
1241
+ className: t("max-w-full min-w-0 overflow-hidden text-sm break-all *:max-w-full", n === 0 && "font-medium", e.column.columnDef.meta?.mobileFullWidth && "w-full"),
1242
+ children: /* @__PURE__ */ f(P.FlexRender, { cell: e })
1243
+ })]
1244
+ }, e.id))
1245
+ })
1246
+ }, e.id))
1247
+ })]
1248
+ })
1249
+ ]
1250
+ });
1251
+ };
1252
+ function Xe({ value: e, onChange: t, debounce: n = 500, ...r }) {
1253
+ let [i, a] = u(e);
1254
+ return o(() => {
1255
+ a(e);
1256
+ }, [e]), o(() => {
1257
+ let e = setTimeout(() => {
1258
+ t(i);
1259
+ }, n);
1260
+ return () => clearTimeout(e);
1261
+ }, [
1262
+ i,
1263
+ n,
1264
+ t
1265
+ ]), /* @__PURE__ */ f(K, {
1266
+ ...r,
1267
+ value: i,
1268
+ onChange: (e) => a(e.target.value),
1269
+ autoComplete: "off"
1270
+ });
1271
+ }
1272
+ function Ze({ column: e, idPrefix: t = "" }) {
1273
+ let n = `${t}${e.id}-filter`, r = {
1274
+ includesString: "Includes string",
1275
+ equalsString: "Equals string",
1276
+ arrIncludes: "Included in list",
1277
+ equals: "Equals",
1278
+ fuzzy: "Fuzzy"
1279
+ }, i = e.getFilterValue(), a = e.columnDef.meta?.filterSelectOptions;
1280
+ return a ? /* @__PURE__ */ f(Z, {
1281
+ id: n,
1282
+ value: i ?? "__all__",
1283
+ onChange: (t) => e.setFilterValue(t === "__all__" ? void 0 : t),
1284
+ className: "w-full text-xs",
1285
+ data: [{
1286
+ key: "__all__",
1287
+ label: "All"
1288
+ }, ...a.map((e) => ({
1289
+ key: e.value,
1290
+ label: e.label
1291
+ }))]
1292
+ }) : /* @__PURE__ */ f(Xe, {
1293
+ id: n,
1294
+ type: "text",
1295
+ name: e.id,
1296
+ value: i ?? "",
1297
+ onChange: (t) => e.setFilterValue(t),
1298
+ title: `Search (${r[e.columnDef.filterFn]})`,
1299
+ placeholder: "Filter...",
1300
+ className: "border-border text-foreground placeholder:text-muted-foreground focus:ring-ring w-full rounded border bg-transparent px-2 py-1 text-xs shadow-sm focus:border-transparent focus:ring-1 focus:outline-hidden"
1301
+ });
1302
+ }
1303
+ function Qe({ table: e }) {
1304
+ return /* @__PURE__ */ p(G, {
1305
+ trigger: "click",
1306
+ triggerRender: /* @__PURE__ */ f(V, {
1307
+ variant: "outline-secondary",
1308
+ size: "sm",
1309
+ title: "Toggle columns",
1310
+ type: "button"
1311
+ }),
1312
+ side: "bottom",
1313
+ align: "start",
1314
+ className: "p-1",
1315
+ cardContent: /* @__PURE__ */ f("div", {
1316
+ className: "flex flex-col",
1317
+ children: e.getAllLeafColumns().map((e) => {
1318
+ let n = e.columnDef.meta?.headerLabel ?? e.id, r = e.getCanHide(), i = e.getIsVisible();
1319
+ return /* @__PURE__ */ p(V, {
1320
+ variant: "ghost",
1321
+ size: "sm",
1322
+ disabled: !r,
1323
+ className: t("border-border flex w-full items-center justify-start gap-2 rounded-none border-x-0 border-t-0 text-xs shadow-none last:border-b-0", !r && "cursor-not-allowed opacity-50"),
1324
+ onClick: () => r && e.toggleVisibility(!i),
1325
+ type: "button",
1326
+ children: [r ? i ? /* @__PURE__ */ f(w, { className: "text-primary h-3 w-3" }) : /* @__PURE__ */ f(T, { className: "text-muted-foreground h-3 w-3" }) : /* @__PURE__ */ f(D, { className: "h-3 w-3" }), n]
1327
+ }, e.id);
1328
+ })
1329
+ }),
1330
+ children: [/* @__PURE__ */ f(O, { className: "mr-1.5 h-3 w-3" }), "Columns"]
1331
+ });
1332
+ }
1333
+ //#endregion
1334
+ //#region components/text-link.tsx
1335
+ var $e = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }) => /* @__PURE__ */ f("a", {
771
1336
  className: t("arc-text-link rounded-md text-primary underline transition hover:text-primary/80 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-opacity-75", e),
772
1337
  href: n,
773
1338
  target: i,
774
1339
  rel: a ?? (i === "_blank" ? "noopener noreferrer" : void 0),
775
1340
  ...o,
776
1341
  children: r
777
- }), de = ({ checked: e = !1, onChange: n, disabled: r = !1, variant: i = "primary", children: a, ...o }) => /* @__PURE__ */ d(D.Root, {
1342
+ }), et = ({ checked: e = !1, onChange: n, disabled: r = !1, variant: i = "primary", children: a, ...o }) => /* @__PURE__ */ f(xe.Root, {
778
1343
  checked: e,
779
1344
  disabled: r,
780
1345
  onCheckedChange: n,
781
- className: t("arc-switch", fe({
1346
+ className: t("arc-switch", tt({
782
1347
  variant: i,
783
1348
  disabled: r
784
1349
  })),
785
1350
  ...o,
786
- children: a ? a(e) : /* @__PURE__ */ d(D.Thumb, {
1351
+ children: a ? a(e) : /* @__PURE__ */ f(xe.Thumb, {
787
1352
  "aria-hidden": "true",
788
- className: pe({
1353
+ className: nt({
789
1354
  variant: i,
790
1355
  checked: e,
791
1356
  disabled: r
792
1357
  })
793
1358
  })
794
- }), fe = e("relative inline-flex h-7 w-12 items-center rounded-full border border-border bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:not-data-disabled:ring-2 hover:not-data-disabled:ring-ring/60 data-disabled:cursor-not-allowed data-disabled:opacity-60", { variants: {
1359
+ }), tt = e("relative inline-flex h-7 w-12 items-center rounded-full border border-border bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:not-data-disabled:ring-2 hover:not-data-disabled:ring-ring/60 data-disabled:cursor-not-allowed data-disabled:opacity-60", { variants: {
795
1360
  variant: {
796
1361
  danger: "data-checked:bg-destructive",
797
1362
  success: "data-checked:bg-success",
@@ -802,7 +1367,7 @@ var W = class e {
802
1367
  true: "ring-2 ring-border",
803
1368
  false: ""
804
1369
  }
805
- } }), pe = e("absolute top-1/2 inline-block h-5 w-5 -translate-y-1/2 transform rounded-full border shadow-sm transition-[left,background-color,border-color] duration-300 ease-out", {
1370
+ } }), nt = e("absolute top-1/2 inline-block h-5 w-5 -translate-y-1/2 transform rounded-full border shadow-sm transition-[left,background-color,border-color] duration-300 ease-out", {
806
1371
  variants: {
807
1372
  variant: {
808
1373
  primary: "",
@@ -895,95 +1460,95 @@ var W = class e {
895
1460
  className: "border-success bg-success/70"
896
1461
  }
897
1462
  ]
898
- }), J = {
899
- light: S,
900
- dark: x,
901
- system: b
902
- }, Y = {
1463
+ }), rt = {
1464
+ light: L,
1465
+ dark: I,
1466
+ system: F
1467
+ }, $ = {
903
1468
  light: "Light",
904
1469
  dark: "Dark",
905
1470
  system: "System"
906
- }, X = "theme", Z = (e) => e === "dark" || e === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, me = () => {
1471
+ }, it = "theme", at = (e) => e === "dark" || e === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, ot = () => {
907
1472
  if (typeof window > "u") return "system";
908
- let e = window.localStorage.getItem(X);
1473
+ let e = window.localStorage.getItem(it);
909
1474
  return e === "light" || e === "dark" || e === "system" ? e : "system";
910
- }, Q = (e) => e === "system" ? "light" : e === "light" ? "dark" : "system";
911
- function he({ variant: e = "dropdown", showLabel: n = !1 }) {
912
- let [r, i] = l(me);
1475
+ }, st = (e) => e === "system" ? "light" : e === "light" ? "dark" : "system";
1476
+ function ct({ variant: e = "dropdown", showLabel: n = !1 }) {
1477
+ let [r, i] = u(ot);
913
1478
  o(() => {
914
- typeof window < "u" && (document.documentElement.classList.toggle("dark", Z(r)), window.localStorage.setItem(X, r));
1479
+ typeof window < "u" && (document.documentElement.classList.toggle("dark", at(r)), window.localStorage.setItem(it, r));
915
1480
  }, [r]);
916
1481
  let a = () => {
917
- i(Q(r));
1482
+ i(st(r));
918
1483
  };
919
1484
  if (e === "toggle") {
920
- let e = J[r], t = Q(r);
921
- return /* @__PURE__ */ d("div", {
1485
+ let e = rt[r], t = st(r);
1486
+ return /* @__PURE__ */ f("div", {
922
1487
  className: "arc-theme-switcher",
923
- children: /* @__PURE__ */ f(G, {
924
- active: Z(r),
1488
+ children: /* @__PURE__ */ p(Y, {
1489
+ active: at(r),
925
1490
  "aria-label": `Switch to ${t} theme`,
926
1491
  title: `Switch to ${t} theme`,
927
1492
  onClick: a,
928
1493
  className: "w-fit gap-3",
929
- children: [/* @__PURE__ */ d(e, { "aria-hidden": "true" }), n && Y[r]]
1494
+ children: [/* @__PURE__ */ f(e, { "aria-hidden": "true" }), n && $[r]]
930
1495
  })
931
1496
  });
932
1497
  }
933
- let s = J[r];
934
- return /* @__PURE__ */ d("div", {
1498
+ let s = rt[r];
1499
+ return /* @__PURE__ */ f("div", {
935
1500
  className: "arc-theme-switcher",
936
- children: /* @__PURE__ */ f(q, {
1501
+ children: /* @__PURE__ */ p(X, {
937
1502
  className: "gap-3",
938
1503
  contentClassName: "min-w-(--anchor-width)",
939
- buttonText: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(s, { "aria-hidden": "true" }), n && Y[r]] }),
1504
+ buttonText: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, { "aria-hidden": "true" }), n && $[r]] }),
940
1505
  children: [
941
- /* @__PURE__ */ d(q.Item, {
1506
+ /* @__PURE__ */ f(X.Item, {
942
1507
  asChild: !0,
943
1508
  className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
944
- children: /* @__PURE__ */ f(G, {
1509
+ children: /* @__PURE__ */ p(Y, {
945
1510
  active: r === "system",
946
1511
  title: "System Theme",
947
1512
  onClick: () => {
948
1513
  i("system");
949
1514
  },
950
1515
  className: t("flex w-full gap-3 whitespace-nowrap rounded-t-md rounded-b-none p-2", n ? "justify-start" : "justify-center"),
951
- children: [/* @__PURE__ */ d(b, {
1516
+ children: [/* @__PURE__ */ f(F, {
952
1517
  className: "size-4",
953
1518
  "aria-hidden": "true"
954
- }), n && Y.system]
1519
+ }), n && $.system]
955
1520
  })
956
1521
  }),
957
- /* @__PURE__ */ d(q.Item, {
1522
+ /* @__PURE__ */ f(X.Item, {
958
1523
  asChild: !0,
959
1524
  className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
960
- children: /* @__PURE__ */ f(G, {
1525
+ children: /* @__PURE__ */ p(Y, {
961
1526
  active: r === "light",
962
1527
  title: "Light Theme",
963
1528
  onClick: () => {
964
1529
  i("light");
965
1530
  },
966
1531
  className: t("flex w-full gap-3 whitespace-nowrap rounded-none p-2", n ? "justify-start" : "justify-center"),
967
- children: [/* @__PURE__ */ d(S, {
1532
+ children: [/* @__PURE__ */ f(L, {
968
1533
  className: "size-4",
969
1534
  "aria-hidden": "true"
970
- }), n && Y.light]
1535
+ }), n && $.light]
971
1536
  })
972
1537
  }),
973
- /* @__PURE__ */ d(q.Item, {
1538
+ /* @__PURE__ */ f(X.Item, {
974
1539
  asChild: !0,
975
1540
  className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
976
- children: /* @__PURE__ */ f(G, {
1541
+ children: /* @__PURE__ */ p(Y, {
977
1542
  active: r === "dark",
978
1543
  title: "Dark Theme",
979
1544
  onClick: () => {
980
1545
  i("dark");
981
1546
  },
982
1547
  className: t("flex w-full gap-3 whitespace-nowrap rounded-b-md rounded-t-none p-2", n ? "justify-start" : "justify-center"),
983
- children: [/* @__PURE__ */ d(x, {
1548
+ children: [/* @__PURE__ */ f(I, {
984
1549
  className: "size-4",
985
1550
  "aria-hidden": "true"
986
- }), n && Y.dark]
1551
+ }), n && $.dark]
987
1552
  })
988
1553
  })
989
1554
  ]
@@ -992,16 +1557,16 @@ function he({ variant: e = "dropdown", showLabel: n = !1 }) {
992
1557
  }
993
1558
  //#endregion
994
1559
  //#region components/typing-animation.tsx
995
- function ge(e) {
1560
+ function lt(e) {
996
1561
  return e === "newline" ? "\n" : e === "comma" ? ", " : "";
997
1562
  }
998
- function $(e, t, n, r, i) {
1563
+ function ut(e, t, n, r, i) {
999
1564
  if (r === "character") return Math.max(0, Math.min(e.length, t + n * i));
1000
1565
  let a = [...e.matchAll(/\S+\s*/g)].map((e) => e.index + e[0].length), o = t;
1001
1566
  for (let t = 0; t < n; t += 1) o = i === 1 ? a.find((e) => e > o) ?? e.length : [...a].reverse().find((e) => e < o) ?? 0;
1002
1567
  return o;
1003
1568
  }
1004
- function _e({ strings: e, placeholder: t, perTick: n = {
1569
+ function dt({ strings: e, placeholder: t, perTick: n = {
1005
1570
  amount: 1,
1006
1571
  unit: "character"
1007
1572
  }, msDelay: r = {
@@ -1009,8 +1574,8 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1009
1574
  deleting: 55,
1010
1575
  hold: 1800,
1011
1576
  dot: 500
1012
- }, waitTillVisible: i = !0, pauseWhenHidden: a = !0, loop: s = e.length > 1, minVisiblePercent: u = 0, afterString: p = "clear", trailingDot: m = !1 }) {
1013
- let h = r?.typing ?? 110, g = r?.deleting ?? 55, _ = r?.hold ?? 1800, v = r?.dot ?? 500, y = n?.amount ?? 1, b = Number.isFinite(y) ? Math.max(1, Math.floor(y)) : 1, x = n?.unit ?? "character", [S, C] = l(""), [w, T] = l([]), [E, D] = l(!i), [O, k] = l(!1), [A, j] = l(!1), M = c(null), N = c(0), P = c(0), F = c(0), I = c(""), L = c(!1);
1577
+ }, waitTillVisible: i = !0, pauseWhenHidden: a = !0, loop: s = e.length > 1, minVisiblePercent: c = 0, afterString: d = "clear", trailingDot: m = !1 }) {
1578
+ let h = r?.typing ?? 110, g = r?.deleting ?? 55, _ = r?.hold ?? 1800, v = r?.dot ?? 500, y = n?.amount ?? 1, b = Number.isFinite(y) ? Math.max(1, Math.floor(y)) : 1, x = n?.unit ?? "character", [S, C] = u(""), [w, T] = u([]), [E, D] = u(!i), [O, k] = u(!1), [A, j] = u(!1), M = l(null), N = l(0), P = l(0), F = l(0), I = l(""), L = l(!1);
1014
1579
  o(() => {
1015
1580
  if (!i) return;
1016
1581
  let e = M.current;
@@ -1019,16 +1584,16 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1019
1584
  e.isIntersecting ? D(!0) : a && D(!1);
1020
1585
  }, {
1021
1586
  root: e.closest("main"),
1022
- threshold: Math.min(100, Math.max(0, u)) / 100
1587
+ threshold: Math.min(100, Math.max(0, c)) / 100
1023
1588
  });
1024
1589
  return t.observe(e), () => t.disconnect();
1025
1590
  }, [
1026
1591
  a,
1027
1592
  i,
1028
- u
1593
+ c
1029
1594
  ]), o(() => {
1030
1595
  if (!E || e.length === 0) return;
1031
- let t, n = p !== "clear";
1596
+ let t, n = d !== "clear";
1032
1597
  N.current = 0, P.current = 0, F.current = 0, I.current = "", L.current = !1, C(""), T([]), k(!1);
1033
1598
  let r = () => {
1034
1599
  if (!s && N.current >= e.length) return;
@@ -1046,9 +1611,9 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1046
1611
  T([]), C(""), N.current += 1, P.current = 0, t = setTimeout(r, _);
1047
1612
  return;
1048
1613
  }
1049
- if (L.current) P.current = $(i, P.current, b, x, -1), C(i.slice(0, P.current)), P.current === 0 && (L.current = !1, N.current = (N.current + 1) % e.length);
1614
+ if (L.current) P.current = ut(i, P.current, b, x, -1), C(i.slice(0, P.current)), P.current === 0 && (L.current = !1, N.current = (N.current + 1) % e.length);
1050
1615
  else {
1051
- if (P.current = $(i, P.current, b, x, 1), C(i.slice(0, P.current)), L.current = !n && P.current === i.length && (s || N.current < e.length - 1), !n && P.current === i.length && !L.current && !s) {
1616
+ if (P.current = ut(i, P.current, b, x, 1), C(i.slice(0, P.current)), L.current = !n && P.current === i.length && (s || N.current < e.length - 1), !n && P.current === i.length && !L.current && !s) {
1052
1617
  k(!0);
1053
1618
  return;
1054
1619
  }
@@ -1063,7 +1628,7 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1063
1628
  E,
1064
1629
  s,
1065
1630
  _,
1066
- p,
1631
+ d,
1067
1632
  e,
1068
1633
  b,
1069
1634
  x,
@@ -1081,14 +1646,14 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1081
1646
  O,
1082
1647
  v
1083
1648
  ]);
1084
- let R = A ? "." : "", z = p !== "clear", B = ge(p), V = w.reduce((e, t) => e + t.split("\n").length, 0);
1085
- return z ? /* @__PURE__ */ d("div", {
1649
+ let R = A ? "." : "", z = d !== "clear", B = lt(d), ee = w.reduce((e, t) => e + t.split("\n").length, 0);
1650
+ return z ? /* @__PURE__ */ f("div", {
1086
1651
  ref: (e) => {
1087
1652
  M.current = e;
1088
1653
  },
1089
1654
  className: "arc-typing-animation overflow-hidden",
1090
- style: { "--typing-roll-offset": V },
1091
- children: /* @__PURE__ */ f("div", {
1655
+ style: { "--typing-roll-offset": ee },
1656
+ children: /* @__PURE__ */ p("div", {
1092
1657
  className: "whitespace-pre-line",
1093
1658
  children: [
1094
1659
  w.join(B),
@@ -1096,20 +1661,55 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1096
1661
  R
1097
1662
  ]
1098
1663
  })
1099
- }) : /* @__PURE__ */ f("span", {
1664
+ }) : /* @__PURE__ */ p("span", {
1100
1665
  ref: (e) => {
1101
1666
  M.current = e;
1102
1667
  },
1103
1668
  className: "arc-typing-animation inline-grid align-top",
1104
- children: [/* @__PURE__ */ f("span", {
1669
+ children: [/* @__PURE__ */ p("span", {
1105
1670
  "aria-hidden": "true",
1106
1671
  className: "invisible col-start-1 row-start-1 whitespace-pre-line",
1107
1672
  children: [t ?? e[0], m && "."]
1108
- }), /* @__PURE__ */ f("span", {
1673
+ }), /* @__PURE__ */ p("span", {
1109
1674
  className: "col-start-1 row-start-1 whitespace-pre-line",
1110
1675
  children: [S, R]
1111
1676
  })]
1112
1677
  });
1113
1678
  }
1114
1679
  //#endregion
1115
- export { L as Avatar, A as Button, O as ButtonGroup, U as Card, W as DateHandler, R as Divider, j as DoubleClickButton, z as Dropdown, B as ErrorText, H as Input, te as InputTimestamp, M as LongPressButton, q as Menu, ie as Modal, ae as MultiDropdown, G as Pill, re as PillLink, oe as PreviewCard, se as Select, de as Switch, le as Tag, ue as TextLink, he as ThemeSwitcher, _e as TypingAnimation, N as navigateToHashOnLoad, F as updateHashOnScroll, P as useHashNavigationOnLoad };
1680
+ //#region utilities/hash-navigation.ts
1681
+ function ft({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", block: r } = {}) {
1682
+ if (typeof window > "u") return () => {};
1683
+ let i = 0, a = setInterval(() => {
1684
+ i += 1;
1685
+ let { hash: e } = window.location;
1686
+ if (!e || i > t) clearInterval(a);
1687
+ else try {
1688
+ let t = document.querySelector(e);
1689
+ t && (t.scrollIntoView({
1690
+ behavior: n,
1691
+ block: r
1692
+ }), clearInterval(a));
1693
+ } catch (t) {
1694
+ console.error(`Invalid hash in URL: ${e}`, t), clearInterval(a);
1695
+ }
1696
+ }, e);
1697
+ return () => clearInterval(a);
1698
+ }
1699
+ function pt(e) {
1700
+ o(() => ft(e), []);
1701
+ }
1702
+ function mt({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveChange: r }) {
1703
+ let i = t.map((e) => document.getElementById(e)).filter((e) => e !== null), a = window.location.hash.toLowerCase().slice(1) || null, o = () => {
1704
+ let t = e.getBoundingClientRect(), o = t.top + t.height / 2, s = i.find((e) => {
1705
+ let t = e.getBoundingClientRect();
1706
+ return t.top <= o && t.bottom > o;
1707
+ }), c = s ? i.indexOf(s) : -1;
1708
+ if (r?.(c, i), !s || (a === s.id.toLowerCase() && (a = null), c === 0 && a)) return;
1709
+ let l = c === 0 && !n ? "" : `#${s.id}`;
1710
+ window.location.hash !== l && (window.history.replaceState(window.history.state, "", `${window.location.pathname}${window.location.search}${l}`), window.dispatchEvent(new HashChangeEvent("hashchange")));
1711
+ };
1712
+ return o(), e.addEventListener("scroll", o, { passive: !0 }), () => e.removeEventListener("scroll", o);
1713
+ }
1714
+ //#endregion
1715
+ export { De as Avatar, V as Button, Se as ButtonGroup, q as Card, J as DateHandler, Oe as Divider, we as DoubleClickButton, ke as Dropdown, H as ErrorText, Me as GridLoader, K as Input, Ie as InputTimestamp, Ne as LabelField, Te as LongPressButton, X as Menu, Be as Modal, Ve as MultiDropdown, Y as Pill, Re as PillLink, G as PreviewCard, Z as Select, et as Switch, Ye as Table, Ue as Tag, $e as TextLink, ct as ThemeSwitcher, dt as TypingAnimation, ft as navigateToHashOnLoad, mt as updateHashOnScroll, pt as useHashNavigationOnLoad };