@febkosq8/arc 0.6.7 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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: {
@@ -188,7 +193,7 @@ var O = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chil
188
193
  };
189
194
  //#endregion
190
195
  //#region components/hash-navigation.ts
191
- function N({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", block: r } = {}) {
196
+ function Ee({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", block: r } = {}) {
192
197
  if (typeof window > "u") return () => {};
193
198
  let i = 0, a = setInterval(() => {
194
199
  i += 1;
@@ -206,10 +211,10 @@ function N({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", b
206
211
  }, e);
207
212
  return () => clearInterval(a);
208
213
  }
209
- function P(e) {
210
- o(() => N(e), []);
214
+ function De(e) {
215
+ o(() => Ee(e), []);
211
216
  }
212
- function F({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveChange: r }) {
217
+ function Oe({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveChange: r }) {
213
218
  let i = t.map((e) => document.getElementById(e)).filter((e) => e !== null), a = window.location.hash.toLowerCase().slice(1) || null, o = () => {
214
219
  let t = e.getBoundingClientRect(), o = t.top + t.height / 2, s = i.find((e) => {
215
220
  let t = e.getBoundingClientRect();
@@ -223,7 +228,7 @@ function F({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveChan
223
228
  }
224
229
  //#endregion
225
230
  //#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", {
231
+ var ke = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted ring-1 ring-border transition-all", {
227
232
  variants: { size: {
228
233
  xs: "size-6 text-xs",
229
234
  sm: "size-7 text-sm",
@@ -232,40 +237,40 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
232
237
  xl: "size-12 text-xl"
233
238
  } },
234
239
  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]);
240
+ }), Ae = ({ name: e, image: n, size: r, className: i, ...a }) => {
241
+ 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
242
  return o(() => {
238
- u(!1);
239
- }, [f]), /* @__PURE__ */ d("span", {
240
- className: t(I({
243
+ l(!1);
244
+ }, [d]), /* @__PURE__ */ f("span", {
245
+ className: t(ke({
241
246
  size: r,
242
247
  className: i
243
248
  })),
244
249
  ...a,
245
- children: p ? /* @__PURE__ */ d("img", {
246
- src: f,
250
+ children: p ? /* @__PURE__ */ f("img", {
251
+ src: d,
247
252
  alt: e ?? "User avatar",
248
253
  title: e ?? "User",
249
254
  className: "h-full w-full object-cover",
250
- onError: () => u(!0)
251
- }) : /* @__PURE__ */ d("span", {
255
+ onError: () => l(!0)
256
+ }) : /* @__PURE__ */ f("span", {
252
257
  className: "font-medium leading-none text-foreground",
253
258
  title: e ?? "User",
254
259
  children: m
255
260
  })
256
261
  });
257
- }, R = ({ className: e, ...n }) => /* @__PURE__ */ d("div", {
262
+ }, je = ({ className: e, ...n }) => /* @__PURE__ */ f("div", {
258
263
  role: "separator",
259
264
  className: t("arc-divider w-full border-b border-border", e),
260
265
  ...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, {
266
+ }), Me = ({ 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 }) => {
267
+ let d = e.find((e) => String(e.key) === String(n)) ?? null;
268
+ return /* @__PURE__ */ f(m.Root, {
264
269
  items: e,
265
- value: g,
270
+ value: d,
266
271
  onValueChange: (e) => {
267
272
  if (c && e === null) return;
268
- let t = e !== null && g !== null && String(e.key) === String(g.key);
273
+ let t = e !== null && d !== null && String(e.key) === String(d.key);
269
274
  r?.(!c && t ? null : e);
270
275
  },
271
276
  itemToStringLabel: (e) => e?.label ?? "",
@@ -273,43 +278,43 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
273
278
  isItemEqualToValue: (e, t) => String(e.key) === String(t.key),
274
279
  name: s,
275
280
  disabled: o,
276
- children: /* @__PURE__ */ f("div", {
281
+ children: /* @__PURE__ */ p("div", {
277
282
  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, {
283
+ children: [/* @__PURE__ */ p(m.InputGroup, {
284
+ 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"),
285
+ children: [/* @__PURE__ */ f(m.Input, {
281
286
  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
287
  placeholder: a,
283
288
  "data-name": l,
284
289
  "data-required": u,
285
290
  "data-disabled": o
286
- }), /* @__PURE__ */ d(p.Trigger, {
291
+ }), /* @__PURE__ */ f(m.Trigger, {
287
292
  className: "shrink-0 self-center rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
288
293
  "aria-label": "Toggle options",
289
- children: /* @__PURE__ */ d(h, {
294
+ children: /* @__PURE__ */ f(x, {
290
295
  className: "h-5 w-5 text-foreground",
291
296
  "aria-hidden": "true"
292
297
  })
293
298
  })]
294
- }), /* @__PURE__ */ d(p.Portal, { children: /* @__PURE__ */ d(p.Positioner, {
299
+ }), /* @__PURE__ */ f(m.Portal, { children: /* @__PURE__ */ f(m.Positioner, {
295
300
  className: "z-50",
296
301
  sideOffset: 8,
297
- children: /* @__PURE__ */ f(p.Popup, {
302
+ children: /* @__PURE__ */ p(m.Popup, {
298
303
  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, {
304
+ children: [/* @__PURE__ */ f(m.Empty, {
300
305
  className: "relative cursor-default select-none px-4 py-2 text-muted-foreground empty:hidden",
301
306
  children: "No values to show."
302
- }), /* @__PURE__ */ d(p.List, { children: (e) => /* @__PURE__ */ f(p.Item, {
307
+ }), /* @__PURE__ */ f(m.List, { children: (e) => /* @__PURE__ */ p(m.Item, {
303
308
  value: e,
304
309
  disabled: e.disabled,
305
310
  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, {
311
+ children: [/* @__PURE__ */ f(m.ItemIndicator, {
307
312
  className: "flex items-center",
308
- children: /* @__PURE__ */ d(m, {
313
+ children: /* @__PURE__ */ f(b, {
309
314
  className: "h-3 w-3",
310
315
  "aria-hidden": "true"
311
316
  })
312
- }), /* @__PURE__ */ d("span", {
317
+ }), /* @__PURE__ */ f("span", {
313
318
  title: e.label,
314
319
  className: "block truncate",
315
320
  children: e.label
@@ -319,23 +324,205 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
319
324
  }) })]
320
325
  })
321
326
  });
322
- }, B = ({ data: e, className: n, ...r }) => {
327
+ }, H = ({ data: e, className: n, ...r }) => {
323
328
  let i = Array.isArray(e) ? e.join(", ") : typeof e == "string" ? e : null;
324
- return /* @__PURE__ */ d("em", {
329
+ return /* @__PURE__ */ f("em", {
325
330
  role: "alert",
326
331
  className: t("arc-error-text animate-pulse whitespace-nowrap text-base font-semibold text-destructive", n),
327
332
  title: i ?? void 0,
328
333
  ...r,
329
334
  children: i
330
335
  });
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", {
336
+ }, Ne = [
337
+ "(,,> ᴗ <,,)",
338
+ "≽^•⩊•^≼",
339
+ "(╥﹏╥)",
340
+ "(˶ᵔ ᵕ ᵔ˶)",
341
+ "•⩊•",
342
+ "˚₊‧꒰ა ₍ᐢ. ̫.ᐢ₎ ໒꒱ ‧₊˚",
343
+ "٩(ˊᗜˋ )و",
344
+ "(≧◡≦)",
345
+ "⸜(。˃ ᵕ ˂ )⸝♡",
346
+ "(˶˃⤙˂˶)",
347
+ "(˶′◡‵˶)",
348
+ "(^▽^)",
349
+ "˚₊‧꒰ა. .໒꒱ ‧₊˚",
350
+ "( ˶ˆᗜˆ˵ )",
351
+ "⊹ ₊ ⁺‧₊˚ ♡ ପ(๑•ᴗ•๑)ଓ ♡˚₊‧⁺ ₊ ⊹",
352
+ "(つ﹏⊂)",
353
+ "ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ•̫͡•ʕ•̫͡•ʔ•̫͡ʕ•̫͡•ʕ•̫͡•ʔ•̫͡ʔ•̫͡•",
354
+ "(´・` )♡",
355
+ "(╥_╥)",
356
+ "(♡ˊ͈ ꒳ ˋ͈)",
357
+ "(⸝⸝๑ ̫ ๑⸝⸝⸝)",
358
+ "(˶º⤙º˶)",
359
+ "૮₍。´ᴖ ˔ ᴖ`。₎ა",
360
+ "(•̀ᴗ•́)و ̑̑",
361
+ "(─‿‿─)"
362
+ ];
363
+ function U(e, t, n) {
364
+ let r = Math.sin((e + 1) * 12.9898 + t * 78.233 + n * 37.719) * 43758.5453;
365
+ return r - Math.floor(r);
366
+ }
367
+ var W = [
368
+ "circle",
369
+ "square",
370
+ "diamond",
371
+ "star",
372
+ "heart",
373
+ "hexagon"
374
+ ], Pe = e("arc-grid-loader__cell grid aspect-square w-full place-items-center overflow-hidden text-center leading-none break-all", {
375
+ variants: { shape: {
376
+ circle: "rounded-full",
377
+ square: "rounded-md",
378
+ diamond: "arc-grid-loader__cell--diamond",
379
+ star: "arc-grid-loader__cell--star",
380
+ heart: "arc-grid-loader__cell--heart",
381
+ hexagon: "arc-grid-loader__cell--hexagon"
382
+ } },
383
+ defaultVariants: { shape: "circle" }
384
+ }), Fe = ({ className: e, rows: n = 3, columns: r = 3, size: i = 120, maxSize: a = 24, shape: s = "circle", colors: c = [], label: l = "Loading", symbols: d = Ne, style: p, ...m }) => {
385
+ let [h, g] = u([]), [_, v] = u([]), [y, b] = u([]), [x, S] = u(() => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
386
+ if (o(() => {
387
+ s === "mixed" && v(Array.from({ length: n * r }, () => W[Math.floor(Math.random() * W.length)]));
388
+ }, [
389
+ r,
390
+ n,
391
+ s
392
+ ]), o(() => {
393
+ s === "mixed" && c.length !== 0 && b(Array.from({ length: n * r }, () => Math.floor(Math.random() * c.length)));
394
+ }, [
395
+ r,
396
+ c.length,
397
+ n,
398
+ s
399
+ ]), o(() => {
400
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => S(e.matches);
401
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
402
+ }, []), o(() => {
403
+ if (x) return;
404
+ let e = () => {
405
+ let e = Array.from({ length: d.length }, (e, t) => t);
406
+ for (let t = e.length - 1; t > 0; --t) {
407
+ let n = Math.floor(Math.random() * (t + 1));
408
+ [e[t], e[n]] = [e[n], e[t]];
409
+ }
410
+ g(Array.from({ length: n * r }, (t, n) => e[n % e.length]));
411
+ };
412
+ if (e(), d.length < 2) return;
413
+ let t = window.setInterval(() => {
414
+ e();
415
+ }, 900);
416
+ return () => window.clearInterval(t);
417
+ }, [
418
+ r,
419
+ x,
420
+ n,
421
+ d
422
+ ]), !Number.isInteger(n) || n < 1) throw RangeError("GridLoader rows must be a positive integer.");
423
+ if (!Number.isInteger(r) || r < 1) throw RangeError("GridLoader columns must be a positive integer.");
424
+ if (!Number.isFinite(i) || i <= 0) throw RangeError("GridLoader size must be a positive number.");
425
+ if (!Number.isFinite(a) || a <= 0) throw RangeError("GridLoader maxSize must be a positive number.");
426
+ if (d.length === 0) throw RangeError("GridLoader symbols must contain at least one item.");
427
+ return /* @__PURE__ */ f("span", {
428
+ ...m,
429
+ role: "status",
430
+ "aria-live": "polite",
431
+ "aria-label": l,
432
+ className: t("arc-grid-loader inline-flex shrink-0 items-center justify-center align-middle", e),
433
+ style: {
434
+ width: i,
435
+ height: i,
436
+ ...p
437
+ },
438
+ children: /* @__PURE__ */ f("span", {
439
+ "aria-hidden": "true",
440
+ className: "grid h-full w-full place-items-center",
441
+ style: {
442
+ gap: "8%",
443
+ gridTemplateColumns: `repeat(${r}, minmax(0, 1fr))`,
444
+ gridTemplateRows: `repeat(${n}, minmax(0, 1fr))`
445
+ },
446
+ children: Array.from({ length: n * r }, (e, o) => /* @__PURE__ */ f("span", {
447
+ className: t(Pe({ shape: s === "mixed" ? _[o] ?? W[Math.floor(U(o, n, r) * W.length)] : s })),
448
+ onAnimationIteration: () => {
449
+ s === "mixed" && (v((e) => {
450
+ let t = [...e], i = t[o] ?? W[Math.floor(U(o, n, r) * W.length)], a = W.filter((e) => e !== i);
451
+ return t[o] = a[Math.floor(Math.random() * a.length)], t;
452
+ }), c.length > 1 && b((e) => {
453
+ let t = [...e];
454
+ return t[o] = ((t[o] ?? o % c.length) + (1 + Math.floor(Math.random() * (c.length - 1)))) % c.length, t;
455
+ }));
456
+ },
457
+ style: {
458
+ animationDelay: `${-U(o, n, r) * 1200}ms`,
459
+ animationDuration: `${900 + U(o, n, r) * 600}ms`,
460
+ backgroundColor: c.length > 0 ? c[s === "mixed" ? y[o] ?? o % c.length : o % c.length] : void 0,
461
+ fontSize: `${Math.min(i / Math.max(n, r), a) * .3}px`,
462
+ maxWidth: a,
463
+ maxHeight: a
464
+ },
465
+ children: d[h[o] ?? o % d.length]
466
+ }, o))
467
+ })
468
+ });
469
+ }, 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, {
470
+ open: c,
471
+ onOpenChange: l,
472
+ children: [/* @__PURE__ */ f(A.Trigger, {
473
+ nativeButton: !!i,
474
+ openOnHover: r === "hover",
475
+ render: i ?? /* @__PURE__ */ f("span", {}),
476
+ children: n
477
+ }), /* @__PURE__ */ f(A.Portal, { children: /* @__PURE__ */ f(A.Positioner, {
478
+ className: "z-50",
479
+ side: a,
480
+ align: o,
481
+ sideOffset: 8,
482
+ children: /* @__PURE__ */ p(A.Popup, {
483
+ 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),
484
+ 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]
485
+ })
486
+ }) })]
487
+ }), Ie = ({ id: e, label: n, help: r, errors: i, className: a, ...o }) => {
488
+ let s = Array.isArray(i) ? i.map((e) => e == null ? "" : String(e)) : typeof i == "string" ? i : null;
489
+ return /* @__PURE__ */ p("div", {
490
+ ...o,
491
+ className: t("flex h-7 w-full items-center justify-start gap-2 overflow-hidden", a),
492
+ children: [
493
+ /* @__PURE__ */ f("label", {
494
+ className: "w-fit text-xl leading-none font-bold whitespace-nowrap",
495
+ title: n,
496
+ htmlFor: e,
497
+ children: n
498
+ }),
499
+ r != null && r !== !1 && /* @__PURE__ */ f(G, {
500
+ trigger: "hover",
501
+ triggerRender: /* @__PURE__ */ f("button", {
502
+ type: "button",
503
+ "aria-label": `Help for ${n}`,
504
+ 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"
505
+ }),
506
+ cardContent: /* @__PURE__ */ f("div", {
507
+ className: "max-w-100 wrap-break-word text-sm leading-5",
508
+ children: r
509
+ }),
510
+ children: /* @__PURE__ */ f(k, {
511
+ className: "h-4 w-4",
512
+ "aria-hidden": "true"
513
+ })
514
+ }),
515
+ s && (Array.isArray(s) ? s.length > 0 && /* @__PURE__ */ f(H, { data: s }) : /* @__PURE__ */ f(H, { data: s }))
516
+ ]
517
+ });
518
+ }, Le = 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
519
  variants: {
333
520
  variant: {
334
521
  default: "border-border bg-background",
335
522
  ghost: "border-transparent bg-transparent"
336
523
  },
337
524
  as: {
338
- input: "h-10 pointer-coarse:h-11 p-1 pl-2",
525
+ input: "h-8 pointer-coarse:h-9 p-1 pl-2",
339
526
  textarea: "min-h-50 max-h-250 resize-y overflow-auto! p-2 whitespace-pre-wrap"
340
527
  }
341
528
  },
@@ -343,17 +530,17 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
343
530
  variant: "default",
344
531
  as: "input"
345
532
  }
346
- }), H = ({ as: e = "input", className: n, variant: r, ...i }) => {
347
- let a = t(V({
533
+ }), K = ({ as: e = "input", className: n, variant: r, ...i }) => {
534
+ let a = t(Le({
348
535
  as: e,
349
536
  variant: r
350
537
  }), n);
351
- return d(e === "textarea" ? "textarea" : "input", {
538
+ return f(e === "textarea" ? "textarea" : "input", {
352
539
  ...i,
353
540
  autoComplete: "off",
354
541
  className: a
355
542
  });
356
- }, ee = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
543
+ }, Re = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
357
544
  variants: { variant: {
358
545
  primary: "border-primary bg-primary text-primary-foreground",
359
546
  secondary: "border-secondary bg-secondary text-secondary-foreground",
@@ -365,55 +552,55 @@ var I = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-
365
552
  "outline-warning": "border-warning bg-background text-warning"
366
553
  } },
367
554
  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),
555
+ }), q = (e) => {
556
+ 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;
557
+ return /* @__PURE__ */ f("div", {
558
+ className: t(Re({ 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
559
  onPointerMove: h ? (e) => {
373
560
  if (u?.(e), !h) return;
374
561
  let t = e.currentTarget.getBoundingClientRect();
375
562
  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
563
  } : u,
377
- ...f
564
+ ...d
378
565
  });
379
566
  };
380
- U.Header = (e) => {
567
+ q.Header = (e) => {
381
568
  let { className: n, ...r } = e;
382
- return /* @__PURE__ */ d("h2", {
569
+ return /* @__PURE__ */ f("h2", {
383
570
  className: t("arc-card-header flex w-full typography-heading-3 flex-col border-foreground/40 px-0 pb-1", n),
384
571
  ...r
385
572
  });
386
- }, U.Content = (e) => {
573
+ }, q.Content = (e) => {
387
574
  let { className: n, ...r } = e;
388
- return /* @__PURE__ */ d("div", {
575
+ return /* @__PURE__ */ f("div", {
389
576
  className: t("arc-card-content typography-paragraph mt-0! w-full justify-between px-0 py-1 whitespace-pre-wrap", n),
390
577
  ...r
391
578
  });
392
- }, U.Footer = (e) => {
579
+ }, q.Footer = (e) => {
393
580
  let { className: n, ...r } = e;
394
- return /* @__PURE__ */ d("div", {
581
+ return /* @__PURE__ */ f("div", {
395
582
  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
583
  ...r
397
584
  });
398
585
  };
399
586
  //#endregion
400
587
  //#region components/date-handler.ts
401
- var W = class e {
588
+ var ze = class e {
402
589
  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));
590
+ if (e == null || e === "") return j.invalid("missing date");
591
+ if (e instanceof Date) return j.fromJSDate(e);
592
+ if (typeof e == "number") return j.fromMillis(e);
593
+ if (typeof e == "bigint") return j.fromMillis(Number(e));
407
594
  if (typeof e == "string") {
408
595
  let t = e.trim();
409
- if (t === "") return g.invalid("missing date");
596
+ if (t === "") return j.invalid("missing date");
410
597
  if (/^-?\d+$/.test(t)) {
411
598
  let e = Number(t.length === 10 ? Number(t) * 1e3 : t);
412
- return g.fromMillis(e);
599
+ return j.fromMillis(e);
413
600
  }
414
- return g.fromISO(t);
601
+ return j.fromISO(t);
415
602
  }
416
- return g.fromJSDate(new Date(String(e)));
603
+ return j.fromJSDate(new Date(String(e)));
417
604
  }
418
605
  static getDateTime(t, n = "dd/MM/yyyy hh:mm:ss a") {
419
606
  let r = e.toDateTime(t);
@@ -449,16 +636,16 @@ var W = class e {
449
636
  return i.length > 0 ? i.join(", ") : null;
450
637
  }
451
638
  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);
639
+ let r = t ? j.now().plus(e) : j.now().minus(e);
453
640
  return n ? r.toFormat(n) : r.toISO();
454
641
  }
455
642
  static getFormattedTime(t, n = "$ISO$ ($RELATIVE$)") {
456
643
  let r = e.getDateTime(t), i = e.getRelativeTime(t);
457
644
  return n.replace("$ISO$", r).replace("$RELATIVE$", i);
458
645
  }
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, {
646
+ }, Be = ({ value: e, format: t = "$ISO$ ($RELATIVE$)", ...n }) => {
647
+ let r = c(() => e ? ze.getFormattedTime(e, t) : "", [e, t]);
648
+ return /* @__PURE__ */ f(K, {
462
649
  type: "text",
463
650
  disabled: !0,
464
651
  readOnly: !0,
@@ -466,7 +653,7 @@ var W = class e {
466
653
  size: Math.max(r.length, 1),
467
654
  ...n
468
655
  });
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", {
656
+ }, Ve = 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
657
  variants: {
471
658
  variant: {
472
659
  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 +674,8 @@ var W = class e {
487
674
  variant: "pill",
488
675
  size: "md"
489
676
  }
490
- }), re = ({ active: e = !1, className: n, size: r = "md", variant: i = "pill", ...a }) => /* @__PURE__ */ d("a", {
491
- className: t(ne({
677
+ }), He = ({ active: e = !1, className: n, size: r = "md", variant: i = "pill", ...a }) => /* @__PURE__ */ f("a", {
678
+ className: t(Ve({
492
679
  variant: i,
493
680
  size: r
494
681
  }), e && {
@@ -498,29 +685,29 @@ var W = class e {
498
685
  }[i], n),
499
686
  "aria-current": e ? "page" : void 0,
500
687
  ...a
501
- }), G = ({ active: e = !1, className: n, ...r }) => /* @__PURE__ */ d("button", {
688
+ }), J = ({ active: e = !1, className: n, ...r }) => /* @__PURE__ */ f("button", {
502
689
  type: "button",
503
690
  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
691
  "aria-pressed": e,
505
692
  ...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, {
693
+ }), Ue = ({ 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)), Y = Object.assign(({ className: e, contentClassName: n, active: r, activeClassName: i, buttonText: a, children: o }) => /* @__PURE__ */ p(M.Root, {
507
694
  loopFocus: !0,
508
- children: [/* @__PURE__ */ f(_.Trigger, {
509
- render: /* @__PURE__ */ d(G, {
695
+ children: [/* @__PURE__ */ p(M.Trigger, {
696
+ render: /* @__PURE__ */ f(J, {
510
697
  active: r,
511
698
  className: t("w-fit", r && i, e)
512
699
  }),
513
- children: [a, /* @__PURE__ */ d(v, {
700
+ children: [a, /* @__PURE__ */ f(N, {
514
701
  className: "-mr-1 ml-2 h-4 w-4",
515
702
  "aria-hidden": "true"
516
703
  })]
517
- }), /* @__PURE__ */ d(_.Portal, { children: /* @__PURE__ */ d(_.Positioner, {
704
+ }), /* @__PURE__ */ f(M.Portal, { children: /* @__PURE__ */ f(M.Positioner, {
518
705
  className: "z-50",
519
706
  sideOffset: 8,
520
707
  collisionPadding: 8,
521
- children: /* @__PURE__ */ d(_.Popup, {
708
+ children: /* @__PURE__ */ f(M.Popup, {
522
709
  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 })
710
+ children: /* @__PURE__ */ f(Ue, { children: o })
524
711
  })
525
712
  }) })]
526
713
  }), {
@@ -529,14 +716,14 @@ var W = class e {
529
716
  if (r) {
530
717
  let e = n.only(s);
531
718
  if (!a(e)) throw Error("Menu.Item with asChild requires a single React element child.");
532
- return /* @__PURE__ */ d(_.Item, {
719
+ return /* @__PURE__ */ f(M.Item, {
533
720
  ...c,
534
721
  className: l,
535
722
  nativeButton: o ?? !0,
536
723
  render: e
537
724
  });
538
725
  }
539
- return /* @__PURE__ */ d(_.Item, {
726
+ return /* @__PURE__ */ f(M.Item, {
540
727
  ...c,
541
728
  className: l,
542
729
  nativeButton: o,
@@ -545,44 +732,44 @@ var W = class e {
545
732
  },
546
733
  Sub: ({ active: e, buttonText: r, children: i }) => {
547
734
  let o = n.toArray(i).some((e) => a(e) && e.props.active), s = e || o;
548
- return /* @__PURE__ */ f(_.SubmenuRoot, {
735
+ return /* @__PURE__ */ p(M.SubmenuRoot, {
549
736
  loopFocus: !0,
550
- children: [/* @__PURE__ */ f(_.SubmenuTrigger, {
737
+ children: [/* @__PURE__ */ p(M.SubmenuTrigger, {
551
738
  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, {
739
+ children: [r, /* @__PURE__ */ f(P, {
553
740
  className: "-mr-1 ml-2 h-4 w-4",
554
741
  "aria-hidden": "true"
555
742
  })]
556
- }), /* @__PURE__ */ d(_.Portal, { children: /* @__PURE__ */ d(_.Positioner, {
743
+ }), /* @__PURE__ */ f(M.Portal, { children: /* @__PURE__ */ f(M.Positioner, {
557
744
  className: "z-50",
558
745
  side: "right",
559
746
  align: "start",
560
747
  sideOffset: 8,
561
748
  collisionPadding: 8,
562
- children: /* @__PURE__ */ d(_.Popup, {
749
+ children: /* @__PURE__ */ f(M.Popup, {
563
750
  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 })
751
+ children: /* @__PURE__ */ f(Ue, { children: i })
565
752
  })
566
753
  }) })]
567
754
  });
568
755
  }
569
- }), ie = ({ open: e = !1, setOpen: n, children: r, initialFocus: i, headerContent: a, footerContent: s, width: c, height: l, className: u, customKeyHandler: p }) => (o(() => {
756
+ }), We = ({ open: e = !1, setOpen: n, children: r, initialFocus: i, headerContent: a, footerContent: s, width: c, height: l, className: u, customKeyHandler: d }) => (o(() => {
570
757
  if (!e) return;
571
758
  let t = (e) => {
572
759
  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));
760
+ t && (e.preventDefault(), t === "esc" && n(!1), d?.(t, e));
574
761
  };
575
762
  return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
576
763
  }, [
577
764
  e,
578
765
  n,
579
- p
580
- ]), /* @__PURE__ */ d(C.Root, {
766
+ d
767
+ ]), /* @__PURE__ */ f(R.Root, {
581
768
  open: e,
582
769
  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, {
770
+ 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
771
  className: "fixed inset-0 z-10 flex min-h-dvh items-center justify-center p-4",
585
- children: /* @__PURE__ */ f(C.Popup, {
772
+ children: /* @__PURE__ */ p(R.Popup, {
586
773
  initialFocus: i,
587
774
  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
775
  style: {
@@ -590,27 +777,27 @@ var W = class e {
590
777
  height: l
591
778
  },
592
779
  children: [
593
- /* @__PURE__ */ d(C.Title, {
780
+ /* @__PURE__ */ f(R.Title, {
594
781
  className: "mb-4 border-b border-border pb-2 text-lg font-bold leading-6 text-foreground",
595
782
  children: a
596
783
  }),
597
- /* @__PURE__ */ d("div", {
784
+ /* @__PURE__ */ f("div", {
598
785
  className: "grow",
599
786
  children: r
600
787
  }),
601
- s && /* @__PURE__ */ d("div", {
788
+ s && /* @__PURE__ */ f("div", {
602
789
  className: "mt-auto border-t border-border pt-2",
603
790
  children: s
604
791
  })
605
792
  ]
606
793
  })
607
794
  })] })
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, {
795
+ })), Ge = ({ 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 }) => {
796
+ let h = n.filter((e) => r?.includes(String(e.key)));
797
+ return /* @__PURE__ */ f(m.Root, {
611
798
  multiple: !0,
612
799
  items: n,
613
- value: _,
800
+ value: h,
614
801
  onValueChange: (e) => {
615
802
  l && e.length === 0 || i?.(e);
616
803
  },
@@ -619,63 +806,63 @@ var W = class e {
619
806
  isItemEqualToValue: (e, t) => String(e.key) === String(t.key),
620
807
  name: c,
621
808
  disabled: s,
622
- children: /* @__PURE__ */ f("div", {
809
+ children: /* @__PURE__ */ p("div", {
623
810
  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", {
811
+ children: [/* @__PURE__ */ p(m.InputGroup, {
812
+ 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"),
813
+ children: [/* @__PURE__ */ f(m.Value, { children: (n) => /* @__PURE__ */ p("div", {
627
814
  className: "flex min-w-0 grow flex-wrap items-center gap-1.5",
628
- children: [/* @__PURE__ */ d(p.Chips, {
815
+ children: [/* @__PURE__ */ f(m.Chips, {
629
816
  className: "flex flex-wrap gap-1.5",
630
- children: n.map((e) => /* @__PURE__ */ f(p.Chip, {
817
+ children: n.map((e) => /* @__PURE__ */ p(m.Chip, {
631
818
  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", {
819
+ children: [/* @__PURE__ */ f("span", {
633
820
  className: "max-w-32 truncate",
634
821
  children: e.label
635
- }), !s && (!l || n.length > 1) && /* @__PURE__ */ d(p.ChipRemove, {
822
+ }), !s && (!l || n.length > 1) && /* @__PURE__ */ f(m.ChipRemove, {
636
823
  className: "ml-0.5 cursor-pointer rounded-md hover:text-destructive focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
637
824
  "aria-label": `Remove ${e.label}`,
638
- children: /* @__PURE__ */ d(w, {
825
+ children: /* @__PURE__ */ f(z, {
639
826
  className: "h-3 w-3",
640
827
  "aria-hidden": "true"
641
828
  })
642
829
  })]
643
830
  }, e.key))
644
- }), /* @__PURE__ */ d(p.Input, {
831
+ }), /* @__PURE__ */ f(m.Input, {
645
832
  id: e,
646
833
  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
834
  placeholder: o,
648
835
  "data-name": u,
649
- "data-required": g,
836
+ "data-required": d,
650
837
  "data-disabled": s
651
838
  })]
652
- }) }), /* @__PURE__ */ d(p.Trigger, {
839
+ }) }), /* @__PURE__ */ f(m.Trigger, {
653
840
  className: "shrink-0 self-center rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
654
841
  "aria-label": "Toggle options",
655
- children: /* @__PURE__ */ d(h, {
842
+ children: /* @__PURE__ */ f(x, {
656
843
  className: "h-5 w-5 text-foreground",
657
844
  "aria-hidden": "true"
658
845
  })
659
846
  })]
660
- }), /* @__PURE__ */ d(p.Portal, { children: /* @__PURE__ */ d(p.Positioner, {
847
+ }), /* @__PURE__ */ f(m.Portal, { children: /* @__PURE__ */ f(m.Positioner, {
661
848
  className: "z-50",
662
849
  sideOffset: 8,
663
- children: /* @__PURE__ */ f(p.Popup, {
850
+ children: /* @__PURE__ */ p(m.Popup, {
664
851
  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, {
852
+ children: [/* @__PURE__ */ f(m.Empty, {
666
853
  className: "relative cursor-default select-none px-4 py-2 text-muted-foreground empty:hidden",
667
854
  children: "No values to show."
668
- }), /* @__PURE__ */ d(p.List, { children: (e) => /* @__PURE__ */ f(p.Item, {
855
+ }), /* @__PURE__ */ f(m.List, { children: (e) => /* @__PURE__ */ p(m.Item, {
669
856
  value: e,
670
857
  disabled: e.disabled,
671
858
  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, {
859
+ children: [/* @__PURE__ */ f(m.ItemIndicator, {
673
860
  className: "flex items-center",
674
- children: /* @__PURE__ */ d(m, {
861
+ children: /* @__PURE__ */ f(b, {
675
862
  className: "h-3 w-3",
676
863
  "aria-hidden": "true"
677
864
  })
678
- }), /* @__PURE__ */ d("span", {
865
+ }), /* @__PURE__ */ f("span", {
679
866
  title: e.label,
680
867
  className: "block truncate",
681
868
  children: e.label
@@ -685,21 +872,7 @@ var W = class e {
685
872
  }) })]
686
873
  })
687
874
  });
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, {
875
+ }, X = ({ id: e, value: n, onChange: r, data: i, className: a, disabled: o, placeholder: s, ...c }) => /* @__PURE__ */ p(B.Root, {
703
876
  value: n,
704
877
  onValueChange: (e) => {
705
878
  e !== null && r(e);
@@ -710,40 +883,40 @@ var W = class e {
710
883
  label: typeof e.label == "string" ? e.label : e.key
711
884
  })),
712
885
  ...c,
713
- children: [/* @__PURE__ */ f(E.Trigger, {
886
+ children: [/* @__PURE__ */ p(B.Trigger, {
714
887
  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, {
888
+ 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),
889
+ children: [/* @__PURE__ */ f(B.Value, {
717
890
  placeholder: s,
718
891
  className: "min-w-0 flex-1 truncate text-left"
719
- }), /* @__PURE__ */ d(E.Icon, {
892
+ }), /* @__PURE__ */ f(B.Icon, {
720
893
  className: "shrink-0",
721
- children: /* @__PURE__ */ d(h, {
894
+ children: /* @__PURE__ */ f(x, {
722
895
  className: "h-3.5 w-3.5 text-muted-foreground",
723
896
  "aria-hidden": "true"
724
897
  })
725
898
  })]
726
- }), /* @__PURE__ */ d(E.Portal, { children: /* @__PURE__ */ d(E.Positioner, {
899
+ }), /* @__PURE__ */ f(B.Portal, { children: /* @__PURE__ */ f(B.Positioner, {
727
900
  className: "z-50 outline-none",
728
901
  sideOffset: 8,
729
902
  alignItemWithTrigger: !1,
730
903
  side: "bottom",
731
904
  align: "start",
732
- children: /* @__PURE__ */ d(E.Popup, {
905
+ children: /* @__PURE__ */ f(B.Popup, {
733
906
  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, {
907
+ children: /* @__PURE__ */ f(B.List, {
735
908
  className: "max-h-60 overflow-auto outline-none",
736
- children: i.map((e) => /* @__PURE__ */ f(E.Item, {
909
+ children: i.map((e) => /* @__PURE__ */ p(B.Item, {
737
910
  value: e.key,
738
911
  disabled: e.disabled ?? !1,
739
912
  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, {
913
+ children: [/* @__PURE__ */ f(B.ItemIndicator, {
741
914
  className: "flex items-center",
742
- children: /* @__PURE__ */ d(m, {
915
+ children: /* @__PURE__ */ f(b, {
743
916
  className: "h-3 w-3",
744
917
  "aria-hidden": "true"
745
918
  })
746
- }), /* @__PURE__ */ d(E.ItemText, {
919
+ }), /* @__PURE__ */ f(B.ItemText, {
747
920
  className: "block truncate",
748
921
  children: e.label
749
922
  })]
@@ -751,7 +924,7 @@ var W = class e {
751
924
  })
752
925
  })
753
926
  }) })]
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", {
927
+ }), Ke = 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
928
  variants: { variant: {
756
929
  primary: "bg-primary text-primary-foreground",
757
930
  secondary: "border-border bg-secondary text-secondary-foreground",
@@ -761,37 +934,507 @@ var W = class e {
761
934
  outline: "border-border bg-transparent text-foreground"
762
935
  } },
763
936
  defaultVariants: { variant: "primary" }
764
- }), le = ({ className: e, variant: n, ...r }) => /* @__PURE__ */ d("div", {
765
- className: t(ce({
937
+ }), qe = ({ className: e, variant: n, ...r }) => /* @__PURE__ */ f("div", {
938
+ className: t(Ke({
766
939
  variant: n,
767
940
  className: e
768
941
  })),
769
942
  ...r
770
- }), ue = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }) => /* @__PURE__ */ d("a", {
943
+ }), Je = (e, t, n, r) => {
944
+ let i = e.getValue(t), a = ee(i, n);
945
+ return r({ itemRank: a }), a.passed;
946
+ }, Z = {
947
+ fuzzy: Je,
948
+ includesString: le,
949
+ select: (e, t, n) => {
950
+ let r = e.getValue(t);
951
+ 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);
952
+ }
953
+ }, Ye = ye({
954
+ columnMeta: {},
955
+ columnFilteringFeature: te,
956
+ columnResizingFeature: ne,
957
+ columnSizingFeature: re,
958
+ columnVisibilityFeature: ie,
959
+ globalFilteringFeature: ue,
960
+ rowPaginationFeature: de,
961
+ rowSortingFeature: fe,
962
+ filteredRowModel: oe(),
963
+ paginatedRowModel: se(),
964
+ sortedRowModel: ce(),
965
+ sortFns: {
966
+ alphanumeric: pe,
967
+ alphanumericCaseSensitive: me,
968
+ basic: he,
969
+ datetime: ge,
970
+ text: _e,
971
+ textCaseSensitive: ve
972
+ },
973
+ filterFns: Z
974
+ });
975
+ function Xe(e) {
976
+ return Object.prototype.hasOwnProperty.call(Z, e);
977
+ }
978
+ function Ze(e, t) {
979
+ if (e !== !1) {
980
+ if (e === void 0) return t ? "select" : void 0;
981
+ if (typeof e == "function" || e === "auto" || Xe(e)) return e;
982
+ throw Error(`Unsupported table filterFn "${e}". Use "auto" or one of: ${Object.keys(Z).join(", ")}.`);
983
+ }
984
+ }
985
+ var Qe = ae(), $e = ({ data: e, columnDef: n, pageSize: r = 10, className: i, showHeader: a = !0, showFilters: o = !0, showSorting: l = !0 }) => {
986
+ let d = s(), [m, b] = u({
987
+ pageIndex: 0,
988
+ pageSize: r
989
+ }), [x, w] = u([]), [T, D] = u(""), [O, k] = u([]), [A, j] = u({}), M = x.length > 0 || T !== "", N = c(() => n?.map((e) => Qe.accessor(e.accessorKey, {
990
+ id: e.id,
991
+ enableResizing: e.enableResizing,
992
+ enableColumnFilter: e.filterFn !== !1 && e.enableColumnFilter,
993
+ enableSorting: e.enableSorting,
994
+ enableHiding: e.enableHiding ?? !0,
995
+ size: e.size,
996
+ minSize: e.minSize ?? 50,
997
+ maxSize: e.maxSize ?? 1e3,
998
+ filterFn: Ze(e.filterFn, e.filterSelectOptions),
999
+ meta: {
1000
+ headerLabel: e.header,
1001
+ filterSelectOptions: e.filterSelectOptions,
1002
+ mobileFullWidth: e.mobileFullWidth
1003
+ },
1004
+ header: (n) => {
1005
+ let r = n.column.getIsSorted(), i = n.column.getCanSort();
1006
+ return /* @__PURE__ */ f("div", {
1007
+ className: "flex flex-col gap-1.5",
1008
+ children: /* @__PURE__ */ p("div", {
1009
+ className: t("flex items-center gap-1.5", l && i && "cursor-pointer select-none"),
1010
+ onClick: l && i ? n.column.getToggleSortingHandler() : void 0,
1011
+ children: [/* @__PURE__ */ f("span", {
1012
+ className: "min-w-0 truncate text-sm font-semibold tracking-wide",
1013
+ children: e.header
1014
+ }), l && i && /* @__PURE__ */ p("span", {
1015
+ className: "text-muted-foreground ml-auto shrink-0 text-xs",
1016
+ children: [
1017
+ r === "asc" && /* @__PURE__ */ f(v, { className: "text-primary h-3.5 w-3.5" }),
1018
+ r === "desc" && /* @__PURE__ */ f(_, { className: "text-primary h-3.5 w-3.5" }),
1019
+ r === !1 && /* @__PURE__ */ f(y, { className: "h-3 w-3 opacity-60" })
1020
+ ]
1021
+ })]
1022
+ })
1023
+ });
1024
+ },
1025
+ cell: e.cell ?? ((e) => e.getValue())
1026
+ })), [n]), P = be({
1027
+ data: e,
1028
+ columns: N,
1029
+ state: {
1030
+ columnFilters: x,
1031
+ globalFilter: T,
1032
+ sorting: O,
1033
+ pagination: m,
1034
+ columnVisibility: A
1035
+ },
1036
+ enableColumnResizing: !0,
1037
+ columnResizeMode: "onChange",
1038
+ onColumnVisibilityChange: j,
1039
+ onSortingChange: k,
1040
+ onColumnFiltersChange: w,
1041
+ onGlobalFilterChange: D,
1042
+ globalFilterFn: Je,
1043
+ features: Ye,
1044
+ defaultColumn: {
1045
+ size: 200,
1046
+ minSize: 50,
1047
+ maxSize: 1e3
1048
+ }
1049
+ }), 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;
1050
+ return /* @__PURE__ */ p("div", {
1051
+ className: t("flex w-full min-w-0 flex-col", i),
1052
+ children: [
1053
+ a && /* @__PURE__ */ p("div", {
1054
+ 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",
1055
+ children: [
1056
+ /* @__PURE__ */ p("div", {
1057
+ className: "flex items-center gap-2",
1058
+ children: [/* @__PURE__ */ p(V, {
1059
+ variant: "outline-secondary",
1060
+ size: "sm",
1061
+ disabled: !M && O.length === 0,
1062
+ onClick: () => {
1063
+ w([]), D(""), k([]);
1064
+ },
1065
+ title: "Clear filters and sorting",
1066
+ type: "button",
1067
+ children: [/* @__PURE__ */ f(E, { className: "mr-1.5 h-3 w-3" }), "Clear filters and sorting"]
1068
+ }), /* @__PURE__ */ f(nt, { table: P })]
1069
+ }),
1070
+ /* @__PURE__ */ p("nav", {
1071
+ "aria-label": "Table pagination",
1072
+ className: "flex w-full items-center justify-between gap-1 md:flex-1 md:justify-center",
1073
+ children: [
1074
+ /* @__PURE__ */ p("div", {
1075
+ className: "flex items-center gap-1",
1076
+ children: [/* @__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: 0
1083
+ })),
1084
+ disabled: !P.getCanPreviousPage(),
1085
+ title: "First page",
1086
+ "aria-label": "First page",
1087
+ type: "button",
1088
+ children: /* @__PURE__ */ f(h, {
1089
+ "aria-hidden": "true",
1090
+ className: "h-3.5 w-3.5"
1091
+ })
1092
+ }), /* @__PURE__ */ f(V, {
1093
+ variant: "outline-secondary",
1094
+ size: "icon-md",
1095
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1096
+ onClick: () => b((e) => ({
1097
+ ...e,
1098
+ pageIndex: e.pageIndex - 1
1099
+ })),
1100
+ disabled: !P.getCanPreviousPage(),
1101
+ title: "Previous page",
1102
+ "aria-label": "Previous page",
1103
+ type: "button",
1104
+ children: /* @__PURE__ */ f(S, {
1105
+ "aria-hidden": "true",
1106
+ className: "h-3.5 w-3.5"
1107
+ })
1108
+ })]
1109
+ }),
1110
+ /* @__PURE__ */ f("span", {
1111
+ "aria-hidden": "true",
1112
+ className: "text-muted-foreground px-1",
1113
+ children: "·"
1114
+ }),
1115
+ /* @__PURE__ */ p("span", {
1116
+ className: "text-center text-xs font-medium",
1117
+ children: [/* @__PURE__ */ f("span", {
1118
+ className: "text-foreground",
1119
+ children: F > 0 ? `${F} ${F === 1 ? "row" : "rows"}` : "No rows"
1120
+ }), F > 0 && /* @__PURE__ */ p("span", {
1121
+ className: "text-muted-foreground block",
1122
+ children: [
1123
+ "Page ",
1124
+ P.state.pagination.pageIndex + 1,
1125
+ " of ",
1126
+ P.getPageCount(),
1127
+ M && " · filtered"
1128
+ ]
1129
+ })]
1130
+ }),
1131
+ /* @__PURE__ */ f("span", {
1132
+ "aria-hidden": "true",
1133
+ className: "text-muted-foreground px-1",
1134
+ children: "·"
1135
+ }),
1136
+ /* @__PURE__ */ p("div", {
1137
+ className: "flex items-center gap-1",
1138
+ children: [/* @__PURE__ */ f(V, {
1139
+ variant: "outline-secondary",
1140
+ size: "icon-md",
1141
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1142
+ onClick: () => b((e) => ({
1143
+ ...e,
1144
+ pageIndex: e.pageIndex + 1
1145
+ })),
1146
+ disabled: !P.getCanNextPage(),
1147
+ title: "Next page",
1148
+ "aria-label": "Next page",
1149
+ type: "button",
1150
+ children: /* @__PURE__ */ f(C, {
1151
+ "aria-hidden": "true",
1152
+ className: "h-3.5 w-3.5"
1153
+ })
1154
+ }), /* @__PURE__ */ f(V, {
1155
+ variant: "outline-secondary",
1156
+ size: "icon-md",
1157
+ className: "h-10 w-10 sm:h-8 sm:w-8",
1158
+ onClick: () => b((e) => ({
1159
+ ...e,
1160
+ pageIndex: P.getPageCount() - 1
1161
+ })),
1162
+ disabled: !P.getCanNextPage(),
1163
+ title: "Last page",
1164
+ "aria-label": "Last page",
1165
+ type: "button",
1166
+ children: /* @__PURE__ */ f(g, {
1167
+ "aria-hidden": "true",
1168
+ className: "h-3.5 w-3.5"
1169
+ })
1170
+ })]
1171
+ })
1172
+ ]
1173
+ }),
1174
+ /* @__PURE__ */ p("label", {
1175
+ htmlFor: `${d}-page-size`,
1176
+ className: "text-muted-foreground flex w-full items-center justify-between gap-2 text-xs md:w-auto",
1177
+ children: ["Rows per page", /* @__PURE__ */ f(X, {
1178
+ id: `${d}-page-size`,
1179
+ value: P.state.pagination.pageSize.toString(),
1180
+ onChange: (e) => {
1181
+ b({
1182
+ ...m,
1183
+ pageSize: Number(e)
1184
+ });
1185
+ },
1186
+ className: "w-16",
1187
+ data: [
1188
+ 10,
1189
+ 20,
1190
+ 30,
1191
+ 40,
1192
+ 50
1193
+ ].map((e) => ({
1194
+ key: e.toString(),
1195
+ label: e.toString()
1196
+ }))
1197
+ })]
1198
+ })
1199
+ ]
1200
+ }),
1201
+ (L || R) && /* @__PURE__ */ p("details", {
1202
+ className: "border-muted-foreground border-x border-b px-3 py-2",
1203
+ children: [/* @__PURE__ */ f("summary", {
1204
+ className: "cursor-pointer text-sm font-medium",
1205
+ children: L && R ? "Filters and sorting" : L ? "Filters" : "Sorting"
1206
+ }), /* @__PURE__ */ p("div", {
1207
+ className: "grid gap-3 pt-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
1208
+ children: [R && /* @__PURE__ */ p("div", {
1209
+ className: "flex min-w-0 items-end gap-2",
1210
+ children: [/* @__PURE__ */ p("div", {
1211
+ className: "min-w-0 flex-1",
1212
+ children: [/* @__PURE__ */ f("label", {
1213
+ htmlFor: `${d}-sort`,
1214
+ className: "text-muted-foreground mb-1 block text-xs font-medium",
1215
+ children: "Sort by"
1216
+ }), /* @__PURE__ */ f(X, {
1217
+ id: `${d}-sort`,
1218
+ value: O[0]?.id ?? "__none__",
1219
+ onChange: (e) => {
1220
+ k((t) => e === "__none__" ? [] : [{
1221
+ id: e,
1222
+ desc: t.find((t) => t.id === e)?.desc ?? !1
1223
+ }]);
1224
+ },
1225
+ data: [{
1226
+ key: "__none__",
1227
+ label: "No sorting"
1228
+ }, ...P.getVisibleLeafColumns().filter((e) => e.getCanSort()).map((e) => ({
1229
+ key: e.id,
1230
+ label: e.columnDef.meta?.headerLabel ?? e.id
1231
+ }))]
1232
+ })]
1233
+ }), /* @__PURE__ */ f(V, {
1234
+ variant: "outline-secondary",
1235
+ size: "icon-sm",
1236
+ disabled: O.length === 0,
1237
+ title: O[0]?.desc ? "Sort ascending" : "Sort descending",
1238
+ "aria-label": O[0]?.desc ? "Sort ascending" : "Sort descending",
1239
+ onClick: () => k((e) => e.map((e, t) => t === 0 ? {
1240
+ ...e,
1241
+ desc: !e.desc
1242
+ } : e)),
1243
+ type: "button",
1244
+ children: O[0]?.desc ? /* @__PURE__ */ f(_, {
1245
+ "aria-hidden": "true",
1246
+ className: "h-3.5 w-3.5"
1247
+ }) : /* @__PURE__ */ f(v, {
1248
+ "aria-hidden": "true",
1249
+ className: "h-3.5 w-3.5"
1250
+ })
1251
+ })]
1252
+ }), L && I.filter((e) => e.getCanFilter()).map((e) => {
1253
+ let t = e.columnDef.meta?.headerLabel ?? e.id, n = `${d}-${e.id}-filter`;
1254
+ return /* @__PURE__ */ p("div", {
1255
+ className: "min-w-0",
1256
+ children: [/* @__PURE__ */ f("label", {
1257
+ htmlFor: n,
1258
+ className: "text-muted-foreground mb-1 block text-xs font-medium",
1259
+ children: t
1260
+ }), /* @__PURE__ */ f(tt, {
1261
+ column: e,
1262
+ idPrefix: `${d}-`
1263
+ })]
1264
+ }, e.id);
1265
+ })]
1266
+ })]
1267
+ }),
1268
+ /* @__PURE__ */ p("div", {
1269
+ 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"),
1270
+ children: [/* @__PURE__ */ f("div", {
1271
+ className: "hidden w-full min-w-0 overflow-x-auto md:block",
1272
+ children: /* @__PURE__ */ p("table", {
1273
+ className: "w-full table-fixed border-collapse",
1274
+ style: { minWidth: P.getVisibleLeafColumns().reduce((e, t) => e + t.getSize(), 0) },
1275
+ children: [/* @__PURE__ */ f("thead", { children: P.getHeaderGroups().map((e) => /* @__PURE__ */ f("tr", {
1276
+ className: "bg-muted/50",
1277
+ children: e.headers.map((e) => /* @__PURE__ */ p("th", {
1278
+ className: "border-border relative border-r border-b px-3 py-2.5 text-left last:border-r-0",
1279
+ style: { width: e.getSize() },
1280
+ colSpan: e.colSpan,
1281
+ children: [e.isPlaceholder ? null : /* @__PURE__ */ f(P.FlexRender, { header: e }), /* @__PURE__ */ f("div", {
1282
+ onDoubleClick: () => e.column.resetSize(),
1283
+ onMouseDown: e.getResizeHandler(),
1284
+ onTouchStart: e.getResizeHandler(),
1285
+ 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"),
1286
+ children: e.column.getIsResizing() && /* @__PURE__ */ p("span", {
1287
+ 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",
1288
+ children: [Math.round(e.getSize()), "px"]
1289
+ })
1290
+ })]
1291
+ }, e.id))
1292
+ }, e.id)) }), /* @__PURE__ */ p("tbody", { children: [P.getRowModel().rows.length === 0 && /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
1293
+ colSpan: N.length,
1294
+ className: "text-muted-foreground px-3 py-4 text-center text-sm",
1295
+ children: "No results found."
1296
+ }) }), P.getRowModel().rows.map((e, n) => /* @__PURE__ */ f("tr", {
1297
+ 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"),
1298
+ children: e.getVisibleCells().map((e) => /* @__PURE__ */ f("td", {
1299
+ className: "border-border max-w-0 truncate border-r px-2 text-sm last:border-r-0",
1300
+ children: /* @__PURE__ */ f(P.FlexRender, { cell: e })
1301
+ }, e.id))
1302
+ }, e.id))] })]
1303
+ })
1304
+ }), /* @__PURE__ */ f("div", {
1305
+ className: "flex flex-col gap-3 p-3 md:hidden",
1306
+ children: P.getRowModel().rows.length === 0 ? /* @__PURE__ */ f("div", {
1307
+ className: "text-muted-foreground px-3 py-4 text-center text-sm",
1308
+ children: "No results found."
1309
+ }) : P.getRowModel().rows.map((e, n) => /* @__PURE__ */ f("article", {
1310
+ className: t("border-border bg-background min-w-0 rounded-md border p-4", n % 2 == 1 && "bg-muted/20"),
1311
+ children: /* @__PURE__ */ f("dl", {
1312
+ className: "flex min-w-0 flex-col gap-2",
1313
+ children: e.getVisibleCells().map((e, n) => /* @__PURE__ */ p("div", {
1314
+ 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"),
1315
+ children: [/* @__PURE__ */ f("dt", {
1316
+ className: "text-muted-foreground shrink-0 text-xs font-medium",
1317
+ children: z(e.column.id)
1318
+ }), /* @__PURE__ */ f("dd", {
1319
+ 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"),
1320
+ children: /* @__PURE__ */ f(P.FlexRender, { cell: e })
1321
+ })]
1322
+ }, e.id))
1323
+ })
1324
+ }, e.id))
1325
+ })]
1326
+ })
1327
+ ]
1328
+ });
1329
+ };
1330
+ function et({ value: e, onChange: t, debounce: n = 500, ...r }) {
1331
+ let [i, a] = u(e);
1332
+ return o(() => {
1333
+ a(e);
1334
+ }, [e]), o(() => {
1335
+ let e = setTimeout(() => {
1336
+ t(i);
1337
+ }, n);
1338
+ return () => clearTimeout(e);
1339
+ }, [
1340
+ i,
1341
+ n,
1342
+ t
1343
+ ]), /* @__PURE__ */ f(K, {
1344
+ ...r,
1345
+ value: i,
1346
+ onChange: (e) => a(e.target.value),
1347
+ autoComplete: "off"
1348
+ });
1349
+ }
1350
+ function tt({ column: e, idPrefix: t = "" }) {
1351
+ let n = `${t}${e.id}-filter`, r = {
1352
+ includesString: "Includes string",
1353
+ equalsString: "Equals string",
1354
+ arrIncludes: "Included in list",
1355
+ equals: "Equals",
1356
+ fuzzy: "Fuzzy"
1357
+ }, i = e.getFilterValue(), a = e.columnDef.meta?.filterSelectOptions;
1358
+ return a ? /* @__PURE__ */ f(X, {
1359
+ id: n,
1360
+ value: i ?? "__all__",
1361
+ onChange: (t) => e.setFilterValue(t === "__all__" ? void 0 : t),
1362
+ className: "w-full text-xs",
1363
+ data: [{
1364
+ key: "__all__",
1365
+ label: "All"
1366
+ }, ...a.map((e) => ({
1367
+ key: e.value,
1368
+ label: e.label
1369
+ }))]
1370
+ }) : /* @__PURE__ */ f(et, {
1371
+ id: n,
1372
+ type: "text",
1373
+ name: e.id,
1374
+ value: i ?? "",
1375
+ onChange: (t) => e.setFilterValue(t),
1376
+ title: `Search (${r[e.columnDef.filterFn]})`,
1377
+ placeholder: "Filter...",
1378
+ 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"
1379
+ });
1380
+ }
1381
+ function nt({ table: e }) {
1382
+ return /* @__PURE__ */ p(G, {
1383
+ trigger: "click",
1384
+ triggerRender: /* @__PURE__ */ f(V, {
1385
+ variant: "outline-secondary",
1386
+ size: "sm",
1387
+ title: "Toggle columns",
1388
+ type: "button"
1389
+ }),
1390
+ side: "bottom",
1391
+ align: "start",
1392
+ className: "p-1",
1393
+ cardContent: /* @__PURE__ */ f("div", {
1394
+ className: "flex flex-col",
1395
+ children: e.getAllLeafColumns().map((e) => {
1396
+ let n = e.columnDef.meta?.headerLabel ?? e.id, r = e.getCanHide(), i = e.getIsVisible();
1397
+ return /* @__PURE__ */ p(V, {
1398
+ variant: "ghost",
1399
+ size: "sm",
1400
+ disabled: !r,
1401
+ 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"),
1402
+ onClick: () => r && e.toggleVisibility(!i),
1403
+ type: "button",
1404
+ 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]
1405
+ }, e.id);
1406
+ })
1407
+ }),
1408
+ children: [/* @__PURE__ */ f(O, { className: "mr-1.5 h-3 w-3" }), "Columns"]
1409
+ });
1410
+ }
1411
+ //#endregion
1412
+ //#region components/text-link.tsx
1413
+ var rt = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }) => /* @__PURE__ */ f("a", {
771
1414
  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
1415
  href: n,
773
1416
  target: i,
774
1417
  rel: a ?? (i === "_blank" ? "noopener noreferrer" : void 0),
775
1418
  ...o,
776
1419
  children: r
777
- }), de = ({ checked: e = !1, onChange: n, disabled: r = !1, variant: i = "primary", children: a, ...o }) => /* @__PURE__ */ d(D.Root, {
1420
+ }), it = ({ checked: e = !1, onChange: n, disabled: r = !1, variant: i = "primary", children: a, ...o }) => /* @__PURE__ */ f(xe.Root, {
778
1421
  checked: e,
779
1422
  disabled: r,
780
1423
  onCheckedChange: n,
781
- className: t("arc-switch", fe({
1424
+ className: t("arc-switch", at({
782
1425
  variant: i,
783
1426
  disabled: r
784
1427
  })),
785
1428
  ...o,
786
- children: a ? a(e) : /* @__PURE__ */ d(D.Thumb, {
1429
+ children: a ? a(e) : /* @__PURE__ */ f(xe.Thumb, {
787
1430
  "aria-hidden": "true",
788
- className: pe({
1431
+ className: ot({
789
1432
  variant: i,
790
1433
  checked: e,
791
1434
  disabled: r
792
1435
  })
793
1436
  })
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: {
1437
+ }), at = 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
1438
  variant: {
796
1439
  danger: "data-checked:bg-destructive",
797
1440
  success: "data-checked:bg-success",
@@ -802,7 +1445,7 @@ var W = class e {
802
1445
  true: "ring-2 ring-border",
803
1446
  false: ""
804
1447
  }
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", {
1448
+ } }), ot = 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
1449
  variants: {
807
1450
  variant: {
808
1451
  primary: "",
@@ -895,95 +1538,95 @@ var W = class e {
895
1538
  className: "border-success bg-success/70"
896
1539
  }
897
1540
  ]
898
- }), J = {
899
- light: S,
900
- dark: x,
901
- system: b
902
- }, Y = {
1541
+ }), Q = {
1542
+ light: L,
1543
+ dark: I,
1544
+ system: F
1545
+ }, $ = {
903
1546
  light: "Light",
904
1547
  dark: "Dark",
905
1548
  system: "System"
906
- }, X = "theme", Z = (e) => e === "dark" || e === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, me = () => {
1549
+ }, st = "theme", ct = (e) => e === "dark" || e === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, lt = () => {
907
1550
  if (typeof window > "u") return "system";
908
- let e = window.localStorage.getItem(X);
1551
+ let e = window.localStorage.getItem(st);
909
1552
  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);
1553
+ }, ut = (e) => e === "system" ? "light" : e === "light" ? "dark" : "system";
1554
+ function dt({ variant: e = "dropdown", showLabel: n = !1 }) {
1555
+ let [r, i] = u(lt);
913
1556
  o(() => {
914
- typeof window < "u" && (document.documentElement.classList.toggle("dark", Z(r)), window.localStorage.setItem(X, r));
1557
+ typeof window < "u" && (document.documentElement.classList.toggle("dark", ct(r)), window.localStorage.setItem(st, r));
915
1558
  }, [r]);
916
1559
  let a = () => {
917
- i(Q(r));
1560
+ i(ut(r));
918
1561
  };
919
1562
  if (e === "toggle") {
920
- let e = J[r], t = Q(r);
921
- return /* @__PURE__ */ d("div", {
1563
+ let e = Q[r], t = ut(r);
1564
+ return /* @__PURE__ */ f("div", {
922
1565
  className: "arc-theme-switcher",
923
- children: /* @__PURE__ */ f(G, {
924
- active: Z(r),
1566
+ children: /* @__PURE__ */ p(J, {
1567
+ active: ct(r),
925
1568
  "aria-label": `Switch to ${t} theme`,
926
1569
  title: `Switch to ${t} theme`,
927
1570
  onClick: a,
928
1571
  className: "w-fit gap-3",
929
- children: [/* @__PURE__ */ d(e, { "aria-hidden": "true" }), n && Y[r]]
1572
+ children: [/* @__PURE__ */ f(e, { "aria-hidden": "true" }), n && $[r]]
930
1573
  })
931
1574
  });
932
1575
  }
933
- let s = J[r];
934
- return /* @__PURE__ */ d("div", {
1576
+ let s = Q[r];
1577
+ return /* @__PURE__ */ f("div", {
935
1578
  className: "arc-theme-switcher",
936
- children: /* @__PURE__ */ f(q, {
1579
+ children: /* @__PURE__ */ p(Y, {
937
1580
  className: "gap-3",
938
1581
  contentClassName: "min-w-(--anchor-width)",
939
- buttonText: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(s, { "aria-hidden": "true" }), n && Y[r]] }),
1582
+ buttonText: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, { "aria-hidden": "true" }), n && $[r]] }),
940
1583
  children: [
941
- /* @__PURE__ */ d(q.Item, {
1584
+ /* @__PURE__ */ f(Y.Item, {
942
1585
  asChild: !0,
943
1586
  className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
944
- children: /* @__PURE__ */ f(G, {
1587
+ children: /* @__PURE__ */ p(J, {
945
1588
  active: r === "system",
946
1589
  title: "System Theme",
947
1590
  onClick: () => {
948
1591
  i("system");
949
1592
  },
950
1593
  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, {
1594
+ children: [/* @__PURE__ */ f(F, {
952
1595
  className: "size-4",
953
1596
  "aria-hidden": "true"
954
- }), n && Y.system]
1597
+ }), n && $.system]
955
1598
  })
956
1599
  }),
957
- /* @__PURE__ */ d(q.Item, {
1600
+ /* @__PURE__ */ f(Y.Item, {
958
1601
  asChild: !0,
959
1602
  className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
960
- children: /* @__PURE__ */ f(G, {
1603
+ children: /* @__PURE__ */ p(J, {
961
1604
  active: r === "light",
962
1605
  title: "Light Theme",
963
1606
  onClick: () => {
964
1607
  i("light");
965
1608
  },
966
1609
  className: t("flex w-full gap-3 whitespace-nowrap rounded-none p-2", n ? "justify-start" : "justify-center"),
967
- children: [/* @__PURE__ */ d(S, {
1610
+ children: [/* @__PURE__ */ f(L, {
968
1611
  className: "size-4",
969
1612
  "aria-hidden": "true"
970
- }), n && Y.light]
1613
+ }), n && $.light]
971
1614
  })
972
1615
  }),
973
- /* @__PURE__ */ d(q.Item, {
1616
+ /* @__PURE__ */ f(Y.Item, {
974
1617
  asChild: !0,
975
1618
  className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
976
- children: /* @__PURE__ */ f(G, {
1619
+ children: /* @__PURE__ */ p(J, {
977
1620
  active: r === "dark",
978
1621
  title: "Dark Theme",
979
1622
  onClick: () => {
980
1623
  i("dark");
981
1624
  },
982
1625
  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, {
1626
+ children: [/* @__PURE__ */ f(I, {
984
1627
  className: "size-4",
985
1628
  "aria-hidden": "true"
986
- }), n && Y.dark]
1629
+ }), n && $.dark]
987
1630
  })
988
1631
  })
989
1632
  ]
@@ -992,16 +1635,16 @@ function he({ variant: e = "dropdown", showLabel: n = !1 }) {
992
1635
  }
993
1636
  //#endregion
994
1637
  //#region components/typing-animation.tsx
995
- function ge(e) {
1638
+ function ft(e) {
996
1639
  return e === "newline" ? "\n" : e === "comma" ? ", " : "";
997
1640
  }
998
- function $(e, t, n, r, i) {
1641
+ function pt(e, t, n, r, i) {
999
1642
  if (r === "character") return Math.max(0, Math.min(e.length, t + n * i));
1000
1643
  let a = [...e.matchAll(/\S+\s*/g)].map((e) => e.index + e[0].length), o = t;
1001
1644
  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
1645
  return o;
1003
1646
  }
1004
- function _e({ strings: e, placeholder: t, perTick: n = {
1647
+ function mt({ strings: e, placeholder: t, perTick: n = {
1005
1648
  amount: 1,
1006
1649
  unit: "character"
1007
1650
  }, msDelay: r = {
@@ -1009,8 +1652,8 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1009
1652
  deleting: 55,
1010
1653
  hold: 1800,
1011
1654
  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);
1655
+ }, waitTillVisible: i = !0, pauseWhenHidden: a = !0, loop: s = e.length > 1, minVisiblePercent: c = 0, afterString: d = "clear", trailingDot: m = !1 }) {
1656
+ 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
1657
  o(() => {
1015
1658
  if (!i) return;
1016
1659
  let e = M.current;
@@ -1019,16 +1662,16 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1019
1662
  e.isIntersecting ? D(!0) : a && D(!1);
1020
1663
  }, {
1021
1664
  root: e.closest("main"),
1022
- threshold: Math.min(100, Math.max(0, u)) / 100
1665
+ threshold: Math.min(100, Math.max(0, c)) / 100
1023
1666
  });
1024
1667
  return t.observe(e), () => t.disconnect();
1025
1668
  }, [
1026
1669
  a,
1027
1670
  i,
1028
- u
1671
+ c
1029
1672
  ]), o(() => {
1030
1673
  if (!E || e.length === 0) return;
1031
- let t, n = p !== "clear";
1674
+ let t, n = d !== "clear";
1032
1675
  N.current = 0, P.current = 0, F.current = 0, I.current = "", L.current = !1, C(""), T([]), k(!1);
1033
1676
  let r = () => {
1034
1677
  if (!s && N.current >= e.length) return;
@@ -1046,9 +1689,9 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1046
1689
  T([]), C(""), N.current += 1, P.current = 0, t = setTimeout(r, _);
1047
1690
  return;
1048
1691
  }
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);
1692
+ if (L.current) P.current = pt(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
1693
  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) {
1694
+ if (P.current = pt(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
1695
  k(!0);
1053
1696
  return;
1054
1697
  }
@@ -1063,7 +1706,7 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1063
1706
  E,
1064
1707
  s,
1065
1708
  _,
1066
- p,
1709
+ d,
1067
1710
  e,
1068
1711
  b,
1069
1712
  x,
@@ -1081,14 +1724,14 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1081
1724
  O,
1082
1725
  v
1083
1726
  ]);
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", {
1727
+ let R = A ? "." : "", z = d !== "clear", B = ft(d), ee = w.reduce((e, t) => e + t.split("\n").length, 0);
1728
+ return z ? /* @__PURE__ */ f("div", {
1086
1729
  ref: (e) => {
1087
1730
  M.current = e;
1088
1731
  },
1089
1732
  className: "arc-typing-animation overflow-hidden",
1090
- style: { "--typing-roll-offset": V },
1091
- children: /* @__PURE__ */ f("div", {
1733
+ style: { "--typing-roll-offset": ee },
1734
+ children: /* @__PURE__ */ p("div", {
1092
1735
  className: "whitespace-pre-line",
1093
1736
  children: [
1094
1737
  w.join(B),
@@ -1096,20 +1739,20 @@ function _e({ strings: e, placeholder: t, perTick: n = {
1096
1739
  R
1097
1740
  ]
1098
1741
  })
1099
- }) : /* @__PURE__ */ f("span", {
1742
+ }) : /* @__PURE__ */ p("span", {
1100
1743
  ref: (e) => {
1101
1744
  M.current = e;
1102
1745
  },
1103
1746
  className: "arc-typing-animation inline-grid align-top",
1104
- children: [/* @__PURE__ */ f("span", {
1747
+ children: [/* @__PURE__ */ p("span", {
1105
1748
  "aria-hidden": "true",
1106
1749
  className: "invisible col-start-1 row-start-1 whitespace-pre-line",
1107
1750
  children: [t ?? e[0], m && "."]
1108
- }), /* @__PURE__ */ f("span", {
1751
+ }), /* @__PURE__ */ p("span", {
1109
1752
  className: "col-start-1 row-start-1 whitespace-pre-line",
1110
1753
  children: [S, R]
1111
1754
  })]
1112
1755
  });
1113
1756
  }
1114
1757
  //#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 };
1758
+ export { Ae as Avatar, V as Button, Se as ButtonGroup, q as Card, ze as DateHandler, je as Divider, we as DoubleClickButton, Me as Dropdown, H as ErrorText, Fe as GridLoader, K as Input, Be as InputTimestamp, Ie as LabelField, Te as LongPressButton, Y as Menu, We as Modal, Ge as MultiDropdown, J as Pill, He as PillLink, G as PreviewCard, X as Select, it as Switch, $e as Table, qe as Tag, rt as TextLink, dt as ThemeSwitcher, mt as TypingAnimation, Ee as navigateToHashOnLoad, Oe as updateHashOnScroll, De as useHashNavigationOnLoad };