@genispace/geniapp 0.1.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -0
  3. package/dist/CrossAppRecordPicker-BXchXcK5.js +624 -0
  4. package/dist/CrossAppRecordPicker-BXchXcK5.js.map +1 -0
  5. package/dist/Page-wHZrMN17.js +24 -0
  6. package/dist/Page-wHZrMN17.js.map +1 -0
  7. package/dist/ai/adopt/AiSuggestionPanel.d.ts +30 -0
  8. package/dist/ai/adopt/BusinessGuidancePanel.d.ts +31 -0
  9. package/dist/ai/adopt/DetailPageAiLayout.d.ts +7 -0
  10. package/dist/ai/adopt/adoptPresets.d.ts +11 -0
  11. package/dist/ai/adopt/guidanceContent.d.ts +27 -0
  12. package/dist/ai/adopt/parseAiSummary.d.ts +7 -0
  13. package/dist/ai/components/AgentJobProgress.d.ts +124 -0
  14. package/dist/ai/components/AsyncCombobox.d.ts +44 -0
  15. package/dist/ai/components/BulkActionBar.d.ts +44 -0
  16. package/dist/ai/components/EntityRef.d.ts +39 -0
  17. package/dist/ai/components/JobProgress.d.ts +64 -0
  18. package/dist/ai/components/ServerDataTable.d.ts +89 -0
  19. package/dist/ai/components/Timeline.d.ts +35 -0
  20. package/dist/ai/components/useInfiniteRows.d.ts +25 -0
  21. package/dist/ai/errors/userFacingError.d.ts +14 -0
  22. package/dist/ai/errors/userFacingError.js +48 -0
  23. package/dist/ai/errors/userFacingError.js.map +1 -0
  24. package/dist/ai/index.d.ts +34 -0
  25. package/dist/ai/integrations/partner/createPartnerRecordPickerHook.d.ts +15 -0
  26. package/dist/ai/integrations/partner/partnerRecordPicker.d.ts +20 -0
  27. package/dist/ai/layout/ModalWithAiLayout.d.ts +11 -0
  28. package/dist/ai/layout/aiUi.d.ts +16 -0
  29. package/dist/ai/layout/layoutConstants.d.ts +19 -0
  30. package/dist/ai/layout/modalSizeForAi.d.ts +5 -0
  31. package/dist/ai/locales/sharedAiCopy.d.ts +6 -0
  32. package/dist/ai/managed-data/DatasourceReadonlyTable.d.ts +11 -0
  33. package/dist/ai/managed-data/createTableClient.d.ts +7 -0
  34. package/dist/ai/managed-data/emitManagedEvent.d.ts +18 -0
  35. package/dist/ai/managed-data/executeManagedDatasource.d.ts +21 -0
  36. package/dist/ai/managed-data/queryManagedDatasource.d.ts +28 -0
  37. package/dist/ai/providers/AppUiProviders.d.ts +6 -0
  38. package/dist/ai/types/app-ai.types.d.ts +29 -0
  39. package/dist/ai/types/index.d.ts +1 -0
  40. package/dist/ai.d.ts +1 -0
  41. package/dist/ai.js +1817 -0
  42. package/dist/ai.js.map +1 -0
  43. package/dist/case-workspace/domain.d.ts +41 -0
  44. package/dist/case-workspace/domain.js +24 -0
  45. package/dist/case-workspace/domain.js.map +1 -0
  46. package/dist/case-workspace/index.d.ts +91 -0
  47. package/dist/case-workspace.d.ts +1 -0
  48. package/dist/case-workspace.js +392 -0
  49. package/dist/case-workspace.js.map +1 -0
  50. package/dist/cn-B6yFEsav.js +9 -0
  51. package/dist/cn-B6yFEsav.js.map +1 -0
  52. package/dist/components/ui/calendar.css +7 -0
  53. package/dist/cookieSettings-D_v3KS02.js +97 -0
  54. package/dist/cookieSettings-D_v3KS02.js.map +1 -0
  55. package/dist/dashboard/index.d.ts +16 -0
  56. package/dist/dashboard/src/ChartFrame.d.ts +18 -0
  57. package/dist/dashboard/src/ChartTooltip.d.ts +38 -0
  58. package/dist/dashboard/src/FilterBar.d.ts +23 -0
  59. package/dist/dashboard/src/KpiStatCard.d.ts +29 -0
  60. package/dist/dashboard/src/StatGrid.d.ts +15 -0
  61. package/dist/dashboard/src/TimeRangePicker.d.ts +14 -0
  62. package/dist/dashboard/src/chart.d.ts +10 -0
  63. package/dist/dashboard/src/format.d.ts +16 -0
  64. package/dist/dashboard/src/links.d.ts +2 -0
  65. package/dist/dashboard/src/useDashboardRange.d.ts +27 -0
  66. package/dist/dashboard.d.ts +1 -0
  67. package/dist/dashboard.js +361 -0
  68. package/dist/dashboard.js.map +1 -0
  69. package/dist/fonts.css +15 -0
  70. package/dist/hooks/access/AppAccessGate.d.ts +20 -0
  71. package/dist/hooks/access/AppAccessNotice.d.ts +8 -0
  72. package/dist/hooks/access/useAppAccess.d.ts +26 -0
  73. package/dist/hooks/config/businessLocale.d.ts +12 -0
  74. package/dist/hooks/config/currencies.d.ts +9 -0
  75. package/dist/hooks/index.d.ts +17 -0
  76. package/dist/hooks/picker/CrossAppRecordPicker.d.ts +37 -0
  77. package/dist/hooks/picker/managedAppPicker.d.ts +21 -0
  78. package/dist/hooks/picker/partnerPayload.d.ts +6 -0
  79. package/dist/hooks/routing/draftEntityId.d.ts +5 -0
  80. package/dist/hooks/routing/useRefetchOnRouteMatch.d.ts +6 -0
  81. package/dist/hooks/shell/resolveApiRoot.d.ts +13 -0
  82. package/dist/hooks/shell/shell.d.ts +4 -0
  83. package/dist/hooks/shell/useGenispacePlatformClient.d.ts +7 -0
  84. package/dist/hooks.d.ts +1 -0
  85. package/dist/hooks.js +42 -0
  86. package/dist/hooks.js.map +1 -0
  87. package/dist/index.d.ts +3 -0
  88. package/dist/index.js +77 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/kit.d.ts +50 -0
  91. package/dist/kit.js +2067 -0
  92. package/dist/kit.js.map +1 -0
  93. package/dist/page.d.ts +1 -0
  94. package/dist/page.js +5 -0
  95. package/dist/page.js.map +1 -0
  96. package/dist/shell-DIHnXIUb.js +6 -0
  97. package/dist/shell-DIHnXIUb.js.map +1 -0
  98. package/dist/shell.d.ts +30 -0
  99. package/dist/shell.js +104 -0
  100. package/dist/shell.js.map +1 -0
  101. package/dist/storage/assetPreview.d.ts +12 -0
  102. package/dist/storage/components/AssetThumbnail.d.ts +15 -0
  103. package/dist/storage/components/CopyStorageLinkButton.d.ts +13 -0
  104. package/dist/storage/components/StorageImage.d.ts +9 -0
  105. package/dist/storage/components/StoragePreviewContent.d.ts +22 -0
  106. package/dist/storage/components/StorageVideo.d.ts +9 -0
  107. package/dist/storage/copyTextToClipboard.d.ts +5 -0
  108. package/dist/storage/hooks/useAuthenticatedStorageBlobs.d.ts +3 -0
  109. package/dist/storage/hooks/useImageThumbnailBlobs.d.ts +4 -0
  110. package/dist/storage/hooks/useShareableStorageLink.d.ts +7 -0
  111. package/dist/storage/index.d.ts +12 -0
  112. package/dist/storage/openUrlInNewTab.d.ts +6 -0
  113. package/dist/storage/platformStorage.d.ts +43 -0
  114. package/dist/storage.d.ts +1 -0
  115. package/dist/storage.js +605 -0
  116. package/dist/storage.js.map +1 -0
  117. package/dist/style.css +1 -0
  118. package/dist/styles/base.css +616 -0
  119. package/dist/styles/reduced-motion.css +14 -0
  120. package/dist/styles/tailwind-preset.js +269 -0
  121. package/dist/task-workspace/domain.d.ts +35 -0
  122. package/dist/task-workspace/domain.js +45 -0
  123. package/dist/task-workspace/domain.js.map +1 -0
  124. package/dist/task-workspace/experience.d.ts +50 -0
  125. package/dist/task-workspace/index.d.ts +172 -0
  126. package/dist/task-workspace.d.ts +1 -0
  127. package/dist/task-workspace.js +626 -0
  128. package/dist/task-workspace.js.map +1 -0
  129. package/dist/ui/components/features/app/AppCheckboxInput.d.ts +9 -0
  130. package/dist/ui/components/features/app/AppConfirmDialog.d.ts +12 -0
  131. package/dist/ui/components/features/app/AppDashboardSkeleton.d.ts +9 -0
  132. package/dist/ui/components/features/app/AppDatePicker.d.ts +69 -0
  133. package/dist/ui/components/features/app/AppModal.d.ts +27 -0
  134. package/dist/ui/components/features/app/AppPageStates.d.ts +17 -0
  135. package/dist/ui/components/features/app/AppSelectInput.d.ts +10 -0
  136. package/dist/ui/components/features/app/AppTemporalInput.d.ts +19 -0
  137. package/dist/ui/components/features/app/Page.d.ts +14 -0
  138. package/dist/ui/components/features/app/QueryErrorAlert.d.ts +7 -0
  139. package/dist/ui/components/features/app/Sidebar.d.ts +47 -0
  140. package/dist/ui/components/features/app/index.d.ts +17 -0
  141. package/dist/ui/components/features/user/UserAvatar.d.ts +17 -0
  142. package/dist/ui/components/features/user/UserDisplay.d.ts +10 -0
  143. package/dist/ui/components/features/user/UserSelect.d.ts +14 -0
  144. package/dist/ui/components/features/user/useUserDirectory.d.ts +13 -0
  145. package/dist/ui/components/features/user/userDirectoryTypes.d.ts +18 -0
  146. package/dist/ui/components/patterns/form-section.d.ts +11 -0
  147. package/dist/ui/components/primitives/feedback/index.d.ts +2 -0
  148. package/dist/ui/components/primitives/feedback/toaster.d.ts +1 -0
  149. package/dist/ui/components/primitives/feedback/use-toast.d.ts +46 -0
  150. package/dist/ui/components/primitives/page-skeleton/ChartAreaSkeleton.d.ts +13 -0
  151. package/dist/ui/components/primitives/page-skeleton/ChartEmptyState.d.ts +14 -0
  152. package/dist/ui/components/primitives/page-skeleton/ComponentSkeletonShell.d.ts +16 -0
  153. package/dist/ui/components/primitives/page-skeleton/ConfigEditorSkeleton.d.ts +5 -0
  154. package/dist/ui/components/primitives/page-skeleton/DetailTabsSkeleton.d.ts +6 -0
  155. package/dist/ui/components/primitives/page-skeleton/EmptyStateBadge.d.ts +13 -0
  156. package/dist/ui/components/primitives/page-skeleton/FormCardSkeleton.d.ts +7 -0
  157. package/dist/ui/components/primitives/page-skeleton/FormFieldSkeleton.d.ts +6 -0
  158. package/dist/ui/components/primitives/page-skeleton/FormPageSkeleton.d.ts +6 -0
  159. package/dist/ui/components/primitives/page-skeleton/GridCardsSkeleton.d.ts +6 -0
  160. package/dist/ui/components/primitives/page-skeleton/ListSkeleton.d.ts +26 -0
  161. package/dist/ui/components/primitives/page-skeleton/PageHeaderSkeleton.d.ts +6 -0
  162. package/dist/ui/components/primitives/page-skeleton/SplitPaneSkeleton.d.ts +4 -0
  163. package/dist/ui/components/primitives/page-skeleton/StatsRowSkeleton.d.ts +5 -0
  164. package/dist/ui/components/primitives/page-skeleton/TableEmptyState.d.ts +27 -0
  165. package/dist/ui/components/primitives/page-skeleton/TablePageSkeleton.d.ts +8 -0
  166. package/dist/ui/components/primitives/page-skeleton/TabsBarSkeleton.d.ts +6 -0
  167. package/dist/ui/components/primitives/page-skeleton/index.d.ts +24 -0
  168. package/dist/ui/components/primitives/page-skeleton/skeletonMetrics.d.ts +9 -0
  169. package/dist/ui/components/primitives/page-skeleton/useVisibleCenter.d.ts +34 -0
  170. package/dist/ui/components/ui/accordion.d.ts +7 -0
  171. package/dist/ui/components/ui/ai-draft-banner.d.ts +21 -0
  172. package/dist/ui/components/ui/alert-dialog.d.ts +48 -0
  173. package/dist/ui/components/ui/alert.d.ts +8 -0
  174. package/dist/ui/components/ui/avatar.d.ts +6 -0
  175. package/dist/ui/components/ui/badge.d.ts +9 -0
  176. package/dist/ui/components/ui/breadcrumb.d.ts +19 -0
  177. package/dist/ui/components/ui/button.d.ts +11 -0
  178. package/dist/ui/components/ui/calendar.d.ts +8 -0
  179. package/dist/ui/components/ui/card.d.ts +8 -0
  180. package/dist/ui/components/ui/chart.d.ts +16 -0
  181. package/dist/ui/components/ui/checkbox.d.ts +4 -0
  182. package/dist/ui/components/ui/collapsible.d.ts +5 -0
  183. package/dist/ui/components/ui/column-config.d.ts +42 -0
  184. package/dist/ui/components/ui/date-picker.d.ts +9 -0
  185. package/dist/ui/components/ui/date-range-filter.d.ts +32 -0
  186. package/dist/ui/components/ui/date-range-picker.d.ts +11 -0
  187. package/dist/ui/components/ui/dialog-input.d.ts +17 -0
  188. package/dist/ui/components/ui/dialog-safe-select.d.ts +13 -0
  189. package/dist/ui/components/ui/dialog.d.ts +25 -0
  190. package/dist/ui/components/ui/dropdown-menu.d.ts +27 -0
  191. package/dist/ui/components/ui/feature-guide.d.ts +43 -0
  192. package/dist/ui/components/ui/form.d.ts +25 -0
  193. package/dist/ui/components/ui/help-tip.d.ts +29 -0
  194. package/dist/ui/components/ui/hint-notice.d.ts +22 -0
  195. package/dist/ui/components/ui/index.d.ts +6 -0
  196. package/dist/ui/components/ui/input.d.ts +3 -0
  197. package/dist/ui/components/ui/label.d.ts +5 -0
  198. package/dist/ui/components/ui/modal-container.d.ts +56 -0
  199. package/dist/ui/components/ui/modal-templates.d.ts +46 -0
  200. package/dist/ui/components/ui/multi-select.d.ts +20 -0
  201. package/dist/ui/components/ui/pagination.d.ts +28 -0
  202. package/dist/ui/components/ui/popover.d.ts +7 -0
  203. package/dist/ui/components/ui/progress.d.ts +7 -0
  204. package/dist/ui/components/ui/radio-button-group.d.ts +18 -0
  205. package/dist/ui/components/ui/radio-group.d.ts +5 -0
  206. package/dist/ui/components/ui/scroll-area.d.ts +5 -0
  207. package/dist/ui/components/ui/select.d.ts +16 -0
  208. package/dist/ui/components/ui/separator.d.ts +7 -0
  209. package/dist/ui/components/ui/sheet.d.ts +25 -0
  210. package/dist/ui/components/ui/sidebar-rail.d.ts +9 -0
  211. package/dist/ui/components/ui/skeleton.d.ts +2 -0
  212. package/dist/ui/components/ui/slider.d.ts +13 -0
  213. package/dist/ui/components/ui/switch.d.ts +4 -0
  214. package/dist/ui/components/ui/table.d.ts +10 -0
  215. package/dist/ui/components/ui/tabs.d.ts +10 -0
  216. package/dist/ui/components/ui/textarea.d.ts +3 -0
  217. package/dist/ui/components/ui/toast.d.ts +21 -0
  218. package/dist/ui/components/ui/toggle-group.d.ts +12 -0
  219. package/dist/ui/components/ui/toggle.d.ts +12 -0
  220. package/dist/ui/components/ui/tooltip.d.ts +7 -0
  221. package/dist/ui/components/ui/typography.d.ts +15 -0
  222. package/dist/ui/components/ui/underline-tabs.d.ts +13 -0
  223. package/dist/ui/components/ui/view-mode-toggle.d.ts +9 -0
  224. package/dist/ui/hooks/useIsMobile.d.ts +16 -0
  225. package/dist/ui/styles/design-tokens.d.ts +189 -0
  226. package/dist/ui/styles/z-index-layers.d.ts +46 -0
  227. package/dist/ui.d.ts +2 -0
  228. package/dist/ui.js +35 -0
  229. package/dist/ui.js.map +1 -0
  230. package/dist/useUserDirectory-CqkyCQoR.js +2377 -0
  231. package/dist/useUserDirectory-CqkyCQoR.js.map +1 -0
  232. package/dist/utils/cookieSettings.d.ts +12 -0
  233. package/dist/utils/data/countryCodes.d.ts +26 -0
  234. package/dist/utils/index.d.ts +18 -0
  235. package/dist/utils/utils/appPath.d.ts +5 -0
  236. package/dist/utils/utils/chunkLoadRecovery.d.ts +7 -0
  237. package/dist/utils/utils/cn.d.ts +3 -0
  238. package/dist/utils/utils/crossApp.d.ts +71 -0
  239. package/dist/utils/utils/debounce.d.ts +1 -0
  240. package/dist/utils/utils/formatUserLabel.d.ts +8 -0
  241. package/dist/utils/utils/formatting.d.ts +18 -0
  242. package/dist/utils/utils/logoutNotification.d.ts +28 -0
  243. package/dist/utils/utils/operatorLocale.d.ts +32 -0
  244. package/dist/utils/utils/routeLocalePrefetch.d.ts +5 -0
  245. package/dist/utils/utils/shellIframeUrl.d.ts +20 -0
  246. package/dist/utils/utils/spaceSettings.d.ts +20 -0
  247. package/dist/utils/utils/sso.d.ts +42 -0
  248. package/dist/utils/utils/throttle.d.ts +1 -0
  249. package/dist/utils/utils/timezones.d.ts +14 -0
  250. package/dist/utils/utils/toDateInputValue.d.ts +5 -0
  251. package/dist/utils/utils/watermark.d.ts +1 -0
  252. package/dist/utils.d.ts +1 -0
  253. package/dist/utils.js +1334 -0
  254. package/dist/utils.js.map +1 -0
  255. package/dist/vite.d.ts +22 -0
  256. package/dist/vite.js +74 -0
  257. package/dist/vite.js.map +1 -0
  258. package/package.json +191 -0
@@ -0,0 +1,2377 @@
1
+ import { jsxs as n, jsx as e, Fragment as we } from "react/jsx-runtime";
2
+ import * as b from "react";
3
+ import { useState as F, useEffect as H, useCallback as he, Children as ve, isValidElement as Ee, useRef as fa, useMemo as ha } from "react";
4
+ import { ChevronRight as Te, ChevronLeft as Oe, Menu as pa, X as J, ChevronDown as Ne, CalendarDays as ye, Clock3 as ba, Check as Re, ChevronUp as ga } from "lucide-react";
5
+ import { cn as c, formatUserLabel as Pe } from "@genispace/geniapp/utils";
6
+ import * as S from "@radix-ui/react-dialog";
7
+ import { cva as Me } from "class-variance-authority";
8
+ import { createPortal as xa } from "react-dom";
9
+ import { format as wa } from "date-fns";
10
+ import { zhCN as te, enUS as re } from "date-fns/locale";
11
+ import { useTranslation as va } from "react-i18next";
12
+ import { Slot as Na } from "@radix-ui/react-slot";
13
+ import { DayPicker as ya } from "react-day-picker";
14
+ import * as W from "@radix-ui/react-popover";
15
+ import * as D from "@radix-ui/react-select";
16
+ import * as pe from "@radix-ui/react-checkbox";
17
+ import * as K from "@radix-ui/react-avatar";
18
+ const X = {
19
+ SIDEBAR: "z-20",
20
+ STICKY_HEADER: "z-10",
21
+ BACKDROP: "z-[300]",
22
+ DRAWER: "z-[400]"
23
+ };
24
+ function ka({
25
+ groups: a,
26
+ collapsed: t
27
+ }) {
28
+ const [r, s] = F(
29
+ () => Object.fromEntries(a.map((l) => [l.id, l.defaultOpen !== !1]))
30
+ );
31
+ return H(() => {
32
+ s((l) => {
33
+ const o = { ...l };
34
+ let d = !1;
35
+ return a.forEach((m) => {
36
+ m.id in o || (o[m.id] = m.defaultOpen !== !1, d = !0);
37
+ }), d ? o : l;
38
+ });
39
+ }, [a]), /* @__PURE__ */ e("div", { className: "space-y-3", children: a.map((l) => {
40
+ const o = l.collapsible !== !1, d = t || !o || r[l.id] !== !1;
41
+ return /* @__PURE__ */ n("section", { className: "min-w-0", "aria-label": typeof l.label == "string" ? l.label : void 0, children: [
42
+ t ? /* @__PURE__ */ e(
43
+ "div",
44
+ {
45
+ className: "mx-auto mb-1 flex h-7 w-10 items-center justify-center text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",
46
+ title: typeof l.label == "string" ? l.label : void 0,
47
+ "aria-hidden": "true",
48
+ children: l.icon ?? /* @__PURE__ */ e("span", { className: "h-px w-5 bg-border" })
49
+ }
50
+ ) : o ? /* @__PURE__ */ n(
51
+ "button",
52
+ {
53
+ type: "button",
54
+ className: "mb-1 flex min-h-9 w-full items-center justify-between rounded-lg px-2 text-left text-xs font-semibold text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
55
+ onClick: () => s((m) => ({ ...m, [l.id]: !d })),
56
+ "aria-expanded": d,
57
+ children: [
58
+ /* @__PURE__ */ n("span", { className: "flex min-w-0 items-center gap-2", children: [
59
+ l.icon,
60
+ /* @__PURE__ */ e("span", { className: "truncate", children: l.label })
61
+ ] }),
62
+ /* @__PURE__ */ e(Ne, { className: `h-3.5 w-3.5 flex-shrink-0 transition-transform ${d ? "" : "-rotate-90"}` })
63
+ ]
64
+ }
65
+ ) : /* @__PURE__ */ n("div", { className: "mb-1 flex min-h-9 items-center gap-2 px-2 text-xs font-semibold text-muted-foreground", children: [
66
+ l.icon,
67
+ /* @__PURE__ */ e("span", { className: "truncate", children: l.label })
68
+ ] }),
69
+ d && /* @__PURE__ */ e("div", { className: "space-y-1", children: l.items })
70
+ ] }, l.id);
71
+ }) });
72
+ }
73
+ function Et({
74
+ children: a,
75
+ sidebarHeader: t,
76
+ sidebarNav: r,
77
+ sidebarNavGroups: s,
78
+ sidebarFooter: l,
79
+ collapsible: o = !1,
80
+ defaultCollapsed: d = !1,
81
+ withMobileDrawer: m = !1,
82
+ mobileTitle: u,
83
+ navAriaLabel: f = "Application navigation",
84
+ expandLabel: k = "Expand sidebar",
85
+ collapseLabel: N = "Collapse sidebar",
86
+ openLabel: w = "Open navigation",
87
+ closeLabel: g = "Close navigation",
88
+ storageKey: h = "app_sidebar_collapsed"
89
+ }) {
90
+ const [x, v] = F(() => {
91
+ if (!o) return !1;
92
+ const R = localStorage.getItem(h);
93
+ return R !== null ? JSON.parse(R) : d;
94
+ }), [p, _] = F(!1), [C, T] = F(!1);
95
+ H(() => {
96
+ o && localStorage.setItem(h, JSON.stringify(x));
97
+ }, [x, o, h]);
98
+ const E = he(() => _(!1), []);
99
+ H(() => {
100
+ if (!p) return;
101
+ const R = document.body.style.overflow;
102
+ return document.body.style.overflow = "hidden", () => {
103
+ document.body.style.overflow = R;
104
+ };
105
+ }, [p]), H(() => {
106
+ if (!p) return;
107
+ const R = (z) => {
108
+ z.key === "Escape" && E();
109
+ };
110
+ return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
111
+ }, [p, E]);
112
+ const O = (R, z) => {
113
+ const fe = typeof t == "function" ? t(z) : t, V = typeof s == "function" ? s(z) : s, ma = V ? /* @__PURE__ */ e(ka, { groups: V, collapsed: z }) : typeof r == "function" ? r(z) : r, Se = typeof l == "function" ? l(z) : l;
114
+ return /* @__PURE__ */ n(we, { children: [
115
+ R && /* @__PURE__ */ e("div", { className: "flex-shrink-0 flex items-center justify-end border-b border-border bg-muted/70 px-3 py-2.5", children: /* @__PURE__ */ e(
116
+ "button",
117
+ {
118
+ type: "button",
119
+ onClick: E,
120
+ className: "flex h-9 w-9 items-center justify-center rounded-full text-neutral-600 transition hover:bg-neutral-200/80 hover:text-neutral-900 active:scale-95 dark:text-neutral-300 dark:hover:bg-neutral-600/60 dark:hover:text-white",
121
+ "aria-label": g,
122
+ children: /* @__PURE__ */ e(J, { className: "h-5 w-5" })
123
+ }
124
+ ) }),
125
+ /* @__PURE__ */ e(
126
+ "div",
127
+ {
128
+ className: c(
129
+ "flex-shrink-0 flex h-[69px] items-center border-b border-neutral-200 dark:border-neutral-700",
130
+ z ? "px-2 justify-center" : "px-4"
131
+ ),
132
+ children: fe
133
+ }
134
+ ),
135
+ /* @__PURE__ */ e(
136
+ "nav",
137
+ {
138
+ className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0 p-3 space-y-1",
139
+ "aria-label": f,
140
+ onClick: R ? (ua) => {
141
+ const De = ua.target;
142
+ De instanceof Element && De.closest("a") && E();
143
+ } : void 0,
144
+ children: ma
145
+ }
146
+ ),
147
+ Se && /* @__PURE__ */ e(
148
+ "div",
149
+ {
150
+ className: "flex-shrink-0 border-t border-neutral-200 dark:border-neutral-700 p-3",
151
+ onClick: R ? E : void 0,
152
+ children: Se
153
+ }
154
+ )
155
+ ] });
156
+ }, M = o && x ? "w-20" : "w-64", y = /* @__PURE__ */ n(
157
+ "aside",
158
+ {
159
+ className: c(
160
+ "fixed left-0 top-0 bottom-0",
161
+ X.SIDEBAR,
162
+ "hidden bg-neutral-100 dark:bg-neutral-800 border-r border-neutral-200 dark:border-neutral-700",
163
+ "transition-all duration-300 overflow-visible lg:flex lg:flex-col",
164
+ M
165
+ ),
166
+ onMouseEnter: () => T(!0),
167
+ onMouseLeave: () => T(!1),
168
+ children: [
169
+ o && /* @__PURE__ */ e(
170
+ "div",
171
+ {
172
+ className: c(
173
+ "absolute -right-2 inset-y-0 z-10 w-4 flex items-center justify-center transition-opacity duration-300",
174
+ C ? "opacity-100" : "opacity-0"
175
+ ),
176
+ onClick: () => v((R) => !R),
177
+ role: "button",
178
+ tabIndex: -1,
179
+ "aria-label": x ? k : N,
180
+ style: { cursor: x ? "e-resize" : "w-resize" },
181
+ children: /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-1/2 w-[2px] bg-neutral-300 dark:bg-neutral-600" })
182
+ }
183
+ ),
184
+ o && /* @__PURE__ */ e(
185
+ "button",
186
+ {
187
+ type: "button",
188
+ onClick: () => v((R) => !R),
189
+ className: c(
190
+ "absolute -right-3 top-[69px] -translate-y-1/2",
191
+ "flex h-6 w-6 items-center justify-center rounded-full",
192
+ "border border-neutral-200 dark:border-neutral-700",
193
+ "bg-neutral-100 dark:bg-neutral-800 shadow-sm",
194
+ X.STICKY_HEADER
195
+ ),
196
+ "aria-label": x ? k : N,
197
+ children: x ? /* @__PURE__ */ e(Te, { className: "w-4 h-4 text-neutral-600 dark:text-neutral-400" }) : /* @__PURE__ */ e(Oe, { className: "w-4 h-4 text-neutral-600 dark:text-neutral-400" })
198
+ }
199
+ ),
200
+ O(!1, x)
201
+ ]
202
+ }
203
+ ), $ = /* @__PURE__ */ e(
204
+ "main",
205
+ {
206
+ className: c(
207
+ "flex-1 min-h-screen min-w-0 relative z-0 transition-all duration-300 pl-0",
208
+ o && x ? "lg:pl-20" : "lg:pl-64"
209
+ ),
210
+ children: /* @__PURE__ */ e("div", { className: "w-full h-full min-h-0 overflow-auto", children: a })
211
+ }
212
+ );
213
+ return m ? /* @__PURE__ */ n("div", { className: "flex min-h-screen w-full min-w-0 max-w-full overflow-x-hidden bg-neutral-50 dark:bg-neutral-950", children: [
214
+ y,
215
+ /* @__PURE__ */ e(
216
+ "button",
217
+ {
218
+ type: "button",
219
+ className: c(
220
+ "fixed bottom-[calc(1.25rem+env(safe-area-inset-bottom,0px))] left-4 z-10",
221
+ "flex h-12 w-12 items-center justify-center rounded-full",
222
+ "border border-neutral-200/80 bg-white/95 text-neutral-800",
223
+ "shadow-lg shadow-neutral-900/10 ring-1 ring-neutral-900/5 backdrop-blur-sm",
224
+ "transition-all duration-200 hover:bg-neutral-50 hover:shadow-xl active:scale-95",
225
+ "dark:border-neutral-600/60 dark:bg-neutral-800/95 dark:text-neutral-100",
226
+ "dark:shadow-black/30 dark:ring-white/10 dark:hover:bg-neutral-700/90 lg:hidden",
227
+ p ? "pointer-events-none opacity-0" : "pointer-events-auto opacity-100"
228
+ ),
229
+ onClick: () => _(!0),
230
+ "aria-label": w,
231
+ "aria-expanded": p,
232
+ children: /* @__PURE__ */ e(pa, { className: "h-5 w-5" })
233
+ }
234
+ ),
235
+ p && /* @__PURE__ */ n("div", { className: "lg:hidden", children: [
236
+ /* @__PURE__ */ e(
237
+ "div",
238
+ {
239
+ role: "presentation",
240
+ className: c(
241
+ "fixed inset-0",
242
+ X.BACKDROP,
243
+ "animate-in fade-in duration-200 bg-neutral-950/45 backdrop-blur-[3px] dark:bg-black/55"
244
+ ),
245
+ onClick: E,
246
+ "aria-hidden": !0
247
+ }
248
+ ),
249
+ /* @__PURE__ */ e(
250
+ "aside",
251
+ {
252
+ className: c(
253
+ "fixed left-0 top-0 bottom-0 flex w-[min(19rem,88vw)] max-w-[88vw] flex-col overflow-hidden",
254
+ "rounded-r-2xl border-y border-r border-l-0 border-neutral-200/70",
255
+ "bg-neutral-50/95 shadow-[0_12px_48px_-12px_rgba(0,0,0,0.22)] backdrop-blur-md",
256
+ "animate-in slide-in-from-left-5 duration-300 ease-out",
257
+ "dark:border-neutral-600/45 dark:bg-neutral-900/95 dark:shadow-black/40",
258
+ X.DRAWER
259
+ ),
260
+ children: O(!0, !1)
261
+ }
262
+ )
263
+ ] }),
264
+ $
265
+ ] }) : /* @__PURE__ */ n("div", { className: "flex min-h-screen w-full min-w-0 max-w-full overflow-x-hidden bg-neutral-50 dark:bg-neutral-950", children: [
266
+ y,
267
+ $
268
+ ] });
269
+ }
270
+ function i({
271
+ className: a,
272
+ ...t
273
+ }) {
274
+ return /* @__PURE__ */ e(
275
+ "div",
276
+ {
277
+ className: c(
278
+ "relative overflow-hidden rounded-md bg-primary/10",
279
+ "before:pointer-events-none before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:content-['']",
280
+ "before:bg-gradient-to-r before:from-transparent before:via-white/50 before:to-transparent",
281
+ "dark:before:via-white/[0.14]",
282
+ a
283
+ ),
284
+ ...t
285
+ }
286
+ );
287
+ }
288
+ function ze({
289
+ count: a = 4,
290
+ variant: t = "segmented",
291
+ className: r
292
+ }) {
293
+ return t === "pill" ? /* @__PURE__ */ e("div", { className: c("flex flex-wrap gap-4 mb-6", r), children: Array.from({ length: a }).map((s, l) => /* @__PURE__ */ e(i, { className: "h-10 w-24 rounded-xl" }, l)) }) : /* @__PURE__ */ e(
294
+ "div",
295
+ {
296
+ className: c(
297
+ "mb-6 flex h-auto w-full flex-wrap items-stretch gap-1 rounded-xl border border-neutral-200/80 dark:border-neutral-800",
298
+ "bg-neutral-100/80 dark:bg-neutral-900/50 p-1",
299
+ r
300
+ ),
301
+ children: Array.from({ length: a }).map((s, l) => /* @__PURE__ */ e(
302
+ i,
303
+ {
304
+ className: "h-9 min-w-[5.5rem] flex-1 rounded-lg sm:flex-initial sm:min-w-[7rem]"
305
+ },
306
+ l
307
+ ))
308
+ }
309
+ );
310
+ }
311
+ function j({
312
+ labelWidth: a = "w-24",
313
+ inputHeight: t = "h-10",
314
+ className: r
315
+ }) {
316
+ return /* @__PURE__ */ n("div", { className: c("space-y-2", r), children: [
317
+ /* @__PURE__ */ e(i, { className: c("h-4", a) }),
318
+ /* @__PURE__ */ e(i, { className: c("w-full rounded-md", t) })
319
+ ] });
320
+ }
321
+ function ee({
322
+ titleWidth: a = "w-36",
323
+ fieldCount: t = 2,
324
+ showTextarea: r = !1,
325
+ className: s
326
+ }) {
327
+ return /* @__PURE__ */ n("div", { className: c("card p-6 space-y-6", s), children: [
328
+ /* @__PURE__ */ e(i, { className: c("h-6", a) }),
329
+ Array.from({ length: t }).map((l, o) => /* @__PURE__ */ e(
330
+ j,
331
+ {
332
+ labelWidth: o === 0 ? "w-24" : "w-28",
333
+ inputHeight: r && o === t - 1 ? "h-[120px]" : "h-10"
334
+ },
335
+ o
336
+ ))
337
+ ] });
338
+ }
339
+ function Sa({ tabCount: a = 4, className: t }) {
340
+ return /* @__PURE__ */ n("div", { className: c("space-y-6", t), children: [
341
+ /* @__PURE__ */ e(ze, { count: a, variant: "segmented" }),
342
+ /* @__PURE__ */ n("div", { className: "grid lg:grid-cols-3 gap-8", children: [
343
+ /* @__PURE__ */ n("div", { className: "lg:col-span-2 space-y-8", children: [
344
+ /* @__PURE__ */ e(ee, { titleWidth: "w-36", fieldCount: 2, showTextarea: !0 }),
345
+ /* @__PURE__ */ n("div", { className: "card p-6 space-y-4", children: [
346
+ /* @__PURE__ */ e(i, { className: "h-6 w-40" }),
347
+ /* @__PURE__ */ e(i, { className: "h-10 w-full rounded-md" }),
348
+ /* @__PURE__ */ e(j, { labelWidth: "w-16" })
349
+ ] }),
350
+ /* @__PURE__ */ n("div", { className: "card p-6 space-y-4", children: [
351
+ /* @__PURE__ */ e(i, { className: "h-6 w-24" }),
352
+ /* @__PURE__ */ e(i, { className: "h-4 w-full max-w-xl" }),
353
+ /* @__PURE__ */ e(i, { className: "h-4 w-3/4 max-w-lg" }),
354
+ /* @__PURE__ */ n("div", { className: "space-y-3 pt-2", children: [
355
+ /* @__PURE__ */ e(i, { className: "h-10 w-full rounded-md" }),
356
+ /* @__PURE__ */ e(i, { className: "h-10 w-full rounded-md" })
357
+ ] })
358
+ ] }),
359
+ /* @__PURE__ */ n("div", { className: "card p-6 space-y-4", children: [
360
+ /* @__PURE__ */ e(i, { className: "h-6 w-32" }),
361
+ /* @__PURE__ */ e(i, { className: "h-4 w-full max-w-md" }),
362
+ /* @__PURE__ */ e(i, { className: "h-12 w-full rounded-md" })
363
+ ] }),
364
+ /* @__PURE__ */ n("div", { className: "card p-6 space-y-6", children: [
365
+ /* @__PURE__ */ e(i, { className: "h-6 w-44" }),
366
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
367
+ /* @__PURE__ */ e(i, { className: "h-4 w-28" }),
368
+ /* @__PURE__ */ e(i, { className: "h-[300px] w-full rounded-md" })
369
+ ] }),
370
+ /* @__PURE__ */ e(j, { labelWidth: "w-32" }),
371
+ /* @__PURE__ */ n("div", { className: "grid md:grid-cols-2 gap-6", children: [
372
+ /* @__PURE__ */ e(j, { labelWidth: "w-24" }),
373
+ /* @__PURE__ */ e(j, { labelWidth: "w-24" })
374
+ ] })
375
+ ] })
376
+ ] }),
377
+ /* @__PURE__ */ n("aside", { className: "lg:col-span-1 space-y-4", children: [
378
+ /* @__PURE__ */ n("div", { className: "card p-5 space-y-3", children: [
379
+ /* @__PURE__ */ e(i, { className: "h-5 w-40" }),
380
+ /* @__PURE__ */ e(i, { className: "h-4 w-full" }),
381
+ /* @__PURE__ */ e(i, { className: "h-4 w-full" }),
382
+ /* @__PURE__ */ e(i, { className: "h-4 w-5/6" })
383
+ ] }),
384
+ /* @__PURE__ */ n("div", { className: "card p-5 space-y-3", children: [
385
+ /* @__PURE__ */ e(i, { className: "h-5 w-36" }),
386
+ /* @__PURE__ */ e(i, { className: "h-4 w-full" }),
387
+ /* @__PURE__ */ e(i, { className: "h-4 w-4/5" })
388
+ ] })
389
+ ] })
390
+ ] })
391
+ ] });
392
+ }
393
+ function ke({
394
+ showBack: a = !0,
395
+ showActions: t = !0,
396
+ className: r
397
+ }) {
398
+ return /* @__PURE__ */ n("div", { className: c("flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6 sm:mb-8", r), children: [
399
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-3 sm:gap-4 min-w-0", children: [
400
+ a ? /* @__PURE__ */ e(i, { className: "h-10 w-10 shrink-0 rounded-md" }) : null,
401
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1 space-y-2", children: [
402
+ /* @__PURE__ */ e(i, { className: "h-8 w-48 max-w-full" }),
403
+ /* @__PURE__ */ e(i, { className: "h-4 w-64 max-w-full" })
404
+ ] })
405
+ ] }),
406
+ t ? /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 shrink-0", children: [
407
+ /* @__PURE__ */ e(i, { className: "h-10 w-32 rounded-md" }),
408
+ /* @__PURE__ */ e(i, { className: "h-10 w-36 rounded-md" })
409
+ ] }) : null
410
+ ] });
411
+ }
412
+ function Da({
413
+ tabCount: a = 5,
414
+ showHeader: t = !0,
415
+ className: r
416
+ }) {
417
+ return /* @__PURE__ */ n("div", { className: c("space-y-6", r), children: [
418
+ t ? /* @__PURE__ */ n("div", { className: "flex flex-col md:flex-row md:items-start gap-6", children: [
419
+ /* @__PURE__ */ e(i, { className: "h-16 w-16 rounded-xl shrink-0" }),
420
+ /* @__PURE__ */ n("div", { className: "flex-1 min-w-0 space-y-3", children: [
421
+ /* @__PURE__ */ e(i, { className: "h-8 w-56 max-w-full" }),
422
+ /* @__PURE__ */ e(i, { className: "h-4 w-full max-w-2xl" }),
423
+ /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2 pt-1", children: [
424
+ /* @__PURE__ */ e(i, { className: "h-6 w-20 rounded-full" }),
425
+ /* @__PURE__ */ e(i, { className: "h-6 w-24 rounded-full" }),
426
+ /* @__PURE__ */ e(i, { className: "h-6 w-16 rounded-full" })
427
+ ] })
428
+ ] }),
429
+ /* @__PURE__ */ n("div", { className: "flex gap-2 shrink-0", children: [
430
+ /* @__PURE__ */ e(i, { className: "h-10 w-28 rounded-md" }),
431
+ /* @__PURE__ */ e(i, { className: "h-10 w-10 rounded-md" })
432
+ ] })
433
+ ] }) : /* @__PURE__ */ e(ke, { showBack: !1 }),
434
+ /* @__PURE__ */ e(ze, { count: a, variant: "pill" }),
435
+ /* @__PURE__ */ n("div", { className: "card p-6 space-y-6", children: [
436
+ /* @__PURE__ */ e(i, { className: "h-6 w-40" }),
437
+ /* @__PURE__ */ e("div", { className: "grid md:grid-cols-2 gap-6", children: Array.from({ length: 4 }).map((s, l) => /* @__PURE__ */ n("div", { className: "space-y-2", children: [
438
+ /* @__PURE__ */ e(i, { className: "h-4 w-24" }),
439
+ /* @__PURE__ */ e(i, { className: "h-10 w-full rounded-md" })
440
+ ] }, l)) }),
441
+ /* @__PURE__ */ e(i, { className: "h-[200px] w-full rounded-md" })
442
+ ] })
443
+ ] });
444
+ }
445
+ function Ce({
446
+ rowCount: a = 8,
447
+ columnCount: t = 6,
448
+ showSearch: r = !0,
449
+ showFilters: s = !1,
450
+ className: l
451
+ }) {
452
+ return /* @__PURE__ */ n("div", { className: c("space-y-4", l), children: [
453
+ r ? /* @__PURE__ */ n("div", { className: "flex flex-col sm:flex-row gap-3", children: [
454
+ /* @__PURE__ */ e(i, { className: "h-10 flex-1 rounded-md" }),
455
+ s ? /* @__PURE__ */ e(i, { className: "h-10 w-32 rounded-md" }) : null
456
+ ] }) : null,
457
+ /* @__PURE__ */ e("div", { className: "card overflow-hidden", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "w-full min-w-[640px]", children: [
458
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "border-b", children: Array.from({ length: t }).map((o, d) => /* @__PURE__ */ e("th", { className: "py-3 px-4 text-left", children: /* @__PURE__ */ e(i, { className: "h-4 w-16" }) }, d)) }) }),
459
+ /* @__PURE__ */ e("tbody", { children: Array.from({ length: a }).map((o, d) => /* @__PURE__ */ e("tr", { className: "border-b", children: Array.from({ length: t }).map((m, u) => /* @__PURE__ */ e("td", { className: "py-3 px-4", children: u === 0 ? /* @__PURE__ */ n("div", { className: "space-y-2", children: [
460
+ /* @__PURE__ */ e(i, { className: "h-4 w-32" }),
461
+ /* @__PURE__ */ e(i, { className: "h-3 w-48" })
462
+ ] }) : /* @__PURE__ */ e(i, { className: "h-4 w-20" }) }, u)) }, d)) })
463
+ ] }) }) })
464
+ ] });
465
+ }
466
+ const Ca = {
467
+ 2: "md:grid-cols-2",
468
+ 3: "md:grid-cols-2 lg:grid-cols-3",
469
+ 4: "md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
470
+ };
471
+ function Aa({
472
+ count: a = 8,
473
+ columns: t = "4",
474
+ className: r
475
+ }) {
476
+ return /* @__PURE__ */ e("div", { className: c("grid gap-4", Ca[t], r), children: Array.from({ length: a }).map((s, l) => /* @__PURE__ */ n(
477
+ "div",
478
+ {
479
+ className: "card p-4 border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-neutral-800 flex flex-col h-full",
480
+ children: [
481
+ /* @__PURE__ */ n("div", { className: "flex items-start justify-between mb-3", children: [
482
+ /* @__PURE__ */ n("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
483
+ /* @__PURE__ */ e(i, { className: "w-10 h-10 rounded-lg shrink-0" }),
484
+ /* @__PURE__ */ n("div", { className: "flex-1 space-y-2 min-w-0", children: [
485
+ /* @__PURE__ */ e(i, { className: "h-4 w-32" }),
486
+ /* @__PURE__ */ e(i, { className: "h-3 w-full" }),
487
+ /* @__PURE__ */ e(i, { className: "h-3 w-3/4" })
488
+ ] })
489
+ ] }),
490
+ /* @__PURE__ */ e(i, { className: "w-4 h-4 shrink-0" })
491
+ ] }),
492
+ /* @__PURE__ */ n("div", { className: "space-y-3 flex-grow", children: [
493
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-2", children: [
494
+ /* @__PURE__ */ e(i, { className: "h-12 rounded-md" }),
495
+ /* @__PURE__ */ e(i, { className: "h-12 rounded-md" })
496
+ ] }),
497
+ /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
498
+ /* @__PURE__ */ e(i, { className: "h-6 w-16 rounded-md" }),
499
+ /* @__PURE__ */ e(i, { className: "h-6 w-20 rounded-md" })
500
+ ] })
501
+ ] }),
502
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-3 mt-3 border-t border-neutral-200/80 dark:border-neutral-800", children: [
503
+ /* @__PURE__ */ e(i, { className: "h-3 w-24" }),
504
+ /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
505
+ /* @__PURE__ */ e(i, { className: "h-8 w-8 rounded-md" }),
506
+ /* @__PURE__ */ e(i, { className: "h-8 w-8 rounded-md" })
507
+ ] })
508
+ ] })
509
+ ]
510
+ },
511
+ l
512
+ )) });
513
+ }
514
+ function _a({ className: a }) {
515
+ return /* @__PURE__ */ n("div", { className: c("flex flex-col lg:grid lg:grid-cols-12 gap-4 sm:gap-6 min-h-0", a), children: [
516
+ /* @__PURE__ */ e("div", { className: "lg:col-span-3 flex flex-col min-h-0", children: /* @__PURE__ */ n("div", { className: "card border border-neutral-200 dark:border-neutral-800 overflow-hidden flex flex-col h-full min-h-[320px]", children: [
517
+ /* @__PURE__ */ e("div", { className: "p-4 border-b border-neutral-200 dark:border-neutral-800", children: /* @__PURE__ */ e(i, { className: "h-6 w-24" }) }),
518
+ /* @__PURE__ */ n("div", { className: "p-4 sm:p-6 space-y-4 flex-1", children: [
519
+ /* @__PURE__ */ e(j, { labelWidth: "w-20" }),
520
+ /* @__PURE__ */ e(j, { labelWidth: "w-16", inputHeight: "h-24" }),
521
+ /* @__PURE__ */ e(j, { labelWidth: "w-12" }),
522
+ /* @__PURE__ */ n("div", { className: "pt-4 border-t border-neutral-200 dark:border-neutral-800 space-y-3", children: [
523
+ /* @__PURE__ */ e(i, { className: "h-5 w-20" }),
524
+ /* @__PURE__ */ e(i, { className: "h-10 w-full rounded-md" }),
525
+ /* @__PURE__ */ e(i, { className: "h-10 w-full rounded-md" })
526
+ ] })
527
+ ] })
528
+ ] }) }),
529
+ /* @__PURE__ */ e("div", { className: "lg:col-span-9 flex flex-col min-h-0", children: /* @__PURE__ */ n("div", { className: "card border border-neutral-200 dark:border-neutral-800 flex flex-col flex-1 min-h-[320px]", children: [
530
+ /* @__PURE__ */ n("div", { className: "p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between gap-3", children: [
531
+ /* @__PURE__ */ e(i, { className: "h-6 w-32" }),
532
+ /* @__PURE__ */ e(i, { className: "h-9 w-28 rounded-md" })
533
+ ] }),
534
+ /* @__PURE__ */ e("div", { className: "p-4 sm:p-6 flex-1 space-y-4", children: Array.from({ length: 5 }).map((t, r) => /* @__PURE__ */ n("div", { className: "flex items-center gap-3 p-3 rounded-lg border border-neutral-200/80 dark:border-neutral-800", children: [
535
+ /* @__PURE__ */ e(i, { className: "h-5 w-5 rounded shrink-0" }),
536
+ /* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
537
+ /* @__PURE__ */ e(i, { className: "h-4 w-40" }),
538
+ /* @__PURE__ */ e(i, { className: "h-3 w-full max-w-md" })
539
+ ] })
540
+ ] }, r)) })
541
+ ] }) })
542
+ ] });
543
+ }
544
+ function Ea({ count: a = 4, className: t }) {
545
+ return /* @__PURE__ */ e("div", { className: c("grid grid-cols-2 lg:grid-cols-4 gap-4", t), children: Array.from({ length: a }).map((r, s) => /* @__PURE__ */ n(
546
+ "div",
547
+ {
548
+ className: "card p-4 border border-neutral-200 dark:border-neutral-700 space-y-3",
549
+ children: [
550
+ /* @__PURE__ */ e(i, { className: "h-4 w-20" }),
551
+ /* @__PURE__ */ e(i, { className: "h-8 w-16" }),
552
+ /* @__PURE__ */ e(i, { className: "h-3 w-24" })
553
+ ]
554
+ },
555
+ s
556
+ )) });
557
+ }
558
+ function Ta({
559
+ fieldCount: a = 4,
560
+ showSecondCard: t = !1,
561
+ className: r
562
+ }) {
563
+ return /* @__PURE__ */ n("div", { className: c("space-y-6", r), children: [
564
+ /* @__PURE__ */ e(ke, { showBack: !0, showActions: !1 }),
565
+ /* @__PURE__ */ e(ee, { fieldCount: a }),
566
+ t ? /* @__PURE__ */ e(ee, { fieldCount: Math.max(2, a - 2) }) : null
567
+ ] });
568
+ }
569
+ const P = {
570
+ STICKY_HEADER: "z-10",
571
+ SIDEBAR: "z-20",
572
+ TOOLTIP: "z-[150]",
573
+ POPOVER: "z-[250]",
574
+ MODAL_BACKDROP: "z-[500]",
575
+ MODAL: "z-[10000]",
576
+ NESTED_MODAL: "z-[10002]",
577
+ DATE_PICKER_POPOVER: "z-[10003]",
578
+ OVERLAY_POPOVER: "z-[10003]",
579
+ TOAST: "z-[100000]"
580
+ };
581
+ function Oa({ preset: a, className: t }) {
582
+ switch (a) {
583
+ case "config-editor":
584
+ return /* @__PURE__ */ e(Sa, { className: t });
585
+ case "detail-tabs":
586
+ return /* @__PURE__ */ e(Da, { className: t });
587
+ case "table-page":
588
+ return /* @__PURE__ */ e(Ce, { className: t });
589
+ case "grid-cards":
590
+ return /* @__PURE__ */ e(Aa, { className: t });
591
+ case "split-pane":
592
+ return /* @__PURE__ */ e(_a, { className: t });
593
+ case "profile":
594
+ return /* @__PURE__ */ n("div", { className: t, children: [
595
+ /* @__PURE__ */ e(ke, { showBack: !1, showActions: !1 }),
596
+ /* @__PURE__ */ n("div", { className: "space-y-8", children: [
597
+ /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ n("div", { className: "flex flex-col md:flex-row items-start gap-6", children: [
598
+ /* @__PURE__ */ e(i, { className: "size-20 rounded-full shrink-0" }),
599
+ /* @__PURE__ */ n("div", { className: "flex-1 w-full space-y-4", children: [
600
+ /* @__PURE__ */ e(j, { labelWidth: "w-20" }),
601
+ /* @__PURE__ */ e(j, { labelWidth: "w-24" }),
602
+ /* @__PURE__ */ e(j, { labelWidth: "w-28" })
603
+ ] })
604
+ ] }) }),
605
+ /* @__PURE__ */ e(ee, { fieldCount: 4 })
606
+ ] })
607
+ ] });
608
+ case "dashboard":
609
+ return /* @__PURE__ */ n("div", { className: c("space-y-6", t), children: [
610
+ /* @__PURE__ */ e(Ea, {}),
611
+ /* @__PURE__ */ n("div", { className: "grid lg:grid-cols-2 gap-6", children: [
612
+ /* @__PURE__ */ e(i, { className: "h-64 w-full rounded-xl" }),
613
+ /* @__PURE__ */ e(i, { className: "h-64 w-full rounded-xl" })
614
+ ] }),
615
+ /* @__PURE__ */ e(Ce, { rowCount: 5, showSearch: !1 })
616
+ ] });
617
+ case "form-page":
618
+ return /* @__PURE__ */ e(Ta, { className: t });
619
+ default:
620
+ return null;
621
+ }
622
+ }
623
+ function Ra({
624
+ message: a,
625
+ onRetry: t,
626
+ retryLabel: r = "Retry",
627
+ className: s
628
+ }) {
629
+ return /* @__PURE__ */ n(
630
+ "div",
631
+ {
632
+ className: c(
633
+ "mb-6 flex flex-col gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive dark:border-destructive/50 dark:bg-destructive/20 sm:flex-row sm:items-center sm:justify-between",
634
+ s
635
+ ),
636
+ role: "alert",
637
+ children: [
638
+ /* @__PURE__ */ e("span", { className: "min-w-0 break-words", children: a }),
639
+ t ? /* @__PURE__ */ e(
640
+ "button",
641
+ {
642
+ type: "button",
643
+ onClick: t,
644
+ className: "shrink-0 rounded-lg border border-destructive/50 bg-background px-3 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/10 dark:hover:bg-destructive/30",
645
+ children: r
646
+ }
647
+ ) : null
648
+ ]
649
+ }
650
+ );
651
+ }
652
+ function Tt({
653
+ loading: a,
654
+ error: t,
655
+ onRetry: r,
656
+ retryLabel: s,
657
+ preset: l = "table-page",
658
+ loadingFallback: o,
659
+ className: d,
660
+ children: m
661
+ }) {
662
+ return a ? /* @__PURE__ */ e("div", { className: d, role: "status", "aria-busy": "true", children: o ?? /* @__PURE__ */ e(Oa, { preset: l }) }) : t ? /* @__PURE__ */ e(
663
+ Ra,
664
+ {
665
+ message: t,
666
+ onRetry: r,
667
+ retryLabel: s,
668
+ className: d
669
+ }
670
+ ) : /* @__PURE__ */ e(we, { children: m });
671
+ }
672
+ function ne({ meta: a = !1 }) {
673
+ return /* @__PURE__ */ n("div", { className: "flex min-h-14 items-center justify-between gap-3 border-b border-border px-4 py-3 sm:px-5", children: [
674
+ /* @__PURE__ */ e(i, { className: "h-4 w-28" }),
675
+ a ? /* @__PURE__ */ e(i, { className: "h-3 w-16" }) : null
676
+ ] });
677
+ }
678
+ function Pa({ index: a }) {
679
+ return /* @__PURE__ */ n("article", { className: "rounded-2xl border border-border bg-card p-4 shadow-sm sm:p-5", children: [
680
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4", children: [
681
+ /* @__PURE__ */ e(i, { className: "h-3 w-24" }),
682
+ /* @__PURE__ */ e(i, { className: "h-4 w-4 rounded" })
683
+ ] }),
684
+ /* @__PURE__ */ e(i, { className: "mt-3 h-9 w-20" }),
685
+ /* @__PURE__ */ e(i, { className: c("mt-2 h-3 max-w-full", ["w-40", "w-16", "w-36", "w-32"][a] ?? "w-28") })
686
+ ] });
687
+ }
688
+ function Ma() {
689
+ return /* @__PURE__ */ n("section", { className: "min-w-0 overflow-hidden rounded-2xl border border-border bg-card shadow-sm", children: [
690
+ /* @__PURE__ */ e(ne, { meta: !0 }),
691
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("div", { className: "min-w-[780px]", children: [
692
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-[1.05fr_1.55fr_.75fr_.7fr_1fr] gap-4 border-b border-border bg-muted/40 px-5 py-3", children: [20, 28, 16, 16, 20].map((a, t) => /* @__PURE__ */ e(i, { className: "h-3", style: { width: `${a * 4}px` } }, t)) }),
693
+ Array.from({ length: 5 }).map((a, t) => /* @__PURE__ */ n("div", { className: "grid min-h-[55px] grid-cols-[1.05fr_1.55fr_.75fr_.7fr_1fr] items-center gap-4 border-b border-border px-5 py-3 last:border-b-0", children: [
694
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
695
+ /* @__PURE__ */ e(i, { className: "h-2.5 w-2.5 rounded-full" }),
696
+ /* @__PURE__ */ e(i, { className: "h-4 w-28" })
697
+ ] }),
698
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
699
+ /* @__PURE__ */ e(i, { className: c("h-3.5", t % 2 ? "w-44" : "w-52") }),
700
+ /* @__PURE__ */ e(i, { className: "h-3 w-32" })
701
+ ] }),
702
+ /* @__PURE__ */ e(i, { className: "h-4 w-20" }),
703
+ /* @__PURE__ */ e(i, { className: "h-7 w-16 rounded-full" }),
704
+ /* @__PURE__ */ e(i, { className: "h-3.5 w-28" })
705
+ ] }, t))
706
+ ] }) })
707
+ ] });
708
+ }
709
+ function za() {
710
+ return /* @__PURE__ */ n("section", { className: "overflow-hidden rounded-2xl border border-border bg-card shadow-sm", children: [
711
+ /* @__PURE__ */ e(ne, { meta: !0 }),
712
+ /* @__PURE__ */ e("div", { className: "space-y-5 p-5", children: [88, 72, 80].map((a, t) => /* @__PURE__ */ n("div", { children: [
713
+ /* @__PURE__ */ n("div", { className: "mb-2 flex items-center justify-between gap-4", children: [
714
+ /* @__PURE__ */ e(i, { className: "h-3.5", style: { width: `${a}%` } }),
715
+ /* @__PURE__ */ e(i, { className: "h-3.5 w-4" })
716
+ ] }),
717
+ /* @__PURE__ */ e(i, { className: "h-1.5 w-full rounded-full" })
718
+ ] }, t)) })
719
+ ] });
720
+ }
721
+ function ja() {
722
+ return /* @__PURE__ */ n("section", { className: "overflow-hidden rounded-2xl border border-border bg-card shadow-sm", children: [
723
+ /* @__PURE__ */ e(ne, { meta: !0 }),
724
+ /* @__PURE__ */ e("div", { className: "flex h-64 items-end justify-around gap-5 px-6 pb-5 pt-8", children: [58, 82, 68].map((a, t) => /* @__PURE__ */ n("div", { className: "flex h-full flex-1 items-end justify-center gap-2 border-b border-border", children: [
725
+ /* @__PURE__ */ e(i, { className: "w-[26%] max-w-12 rounded-b-none rounded-t-md", style: { height: `${a}%` } }),
726
+ /* @__PURE__ */ e(i, { className: "w-[20%] max-w-9 rounded-b-none rounded-t-md", style: { height: `${Math.max(24, a - 28)}%` } })
727
+ ] }, t)) })
728
+ ] });
729
+ }
730
+ function Ia() {
731
+ return /* @__PURE__ */ n("section", { className: "overflow-hidden rounded-2xl border border-border bg-card shadow-sm", children: [
732
+ /* @__PURE__ */ e(ne, { meta: !0 }),
733
+ /* @__PURE__ */ n("div", { className: "space-y-5 p-5", children: [
734
+ Array.from({ length: 3 }).map((a, t) => /* @__PURE__ */ n("div", { children: [
735
+ /* @__PURE__ */ n("div", { className: "mb-2 flex justify-between", children: [
736
+ /* @__PURE__ */ e(i, { className: "h-3 w-24" }),
737
+ /* @__PURE__ */ e(i, { className: "h-3 w-10" })
738
+ ] }),
739
+ /* @__PURE__ */ e(i, { className: "h-1.5 w-full rounded-full" })
740
+ ] }, t)),
741
+ /* @__PURE__ */ n("div", { className: "rounded-xl border border-border bg-muted/30 p-4", children: [
742
+ /* @__PURE__ */ e(i, { className: "h-3 w-24" }),
743
+ /* @__PURE__ */ e(i, { className: "mt-3 h-8 w-12" }),
744
+ /* @__PURE__ */ e(i, { className: "mt-2 h-3 w-28" })
745
+ ] })
746
+ ] })
747
+ ] });
748
+ }
749
+ function Ot({ className: a }) {
750
+ return /* @__PURE__ */ n(
751
+ "div",
752
+ {
753
+ className: c("relative w-full min-w-0 max-w-full px-4 py-4 sm:px-6 sm:py-6 lg:px-8", a),
754
+ "data-app-dashboard-skeleton": !0,
755
+ children: [
756
+ /* @__PURE__ */ n("div", { className: "mb-6 flex min-h-[52px] w-full min-w-0 flex-col items-stretch justify-between gap-3 sm:min-h-[60px] sm:flex-row sm:items-center sm:gap-4", children: [
757
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1 space-y-2", children: [
758
+ /* @__PURE__ */ e(i, { className: "h-7 w-56 max-w-full sm:h-8" }),
759
+ /* @__PURE__ */ e(i, { className: "hidden h-4 w-[28rem] max-w-full sm:block" })
760
+ ] }),
761
+ /* @__PURE__ */ e(i, { className: "h-11 w-24 rounded-xl" })
762
+ ] }),
763
+ /* @__PURE__ */ n("div", { className: "w-full min-w-0 space-y-6", children: [
764
+ /* @__PURE__ */ e("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-4", children: Array.from({ length: 4 }).map((t, r) => /* @__PURE__ */ e(Pa, { index: r }, r)) }),
765
+ /* @__PURE__ */ n("div", { className: "grid min-w-0 gap-4 xl:grid-cols-[1.45fr_.75fr]", children: [
766
+ /* @__PURE__ */ e(Ma, {}),
767
+ /* @__PURE__ */ e(za, {})
768
+ ] }),
769
+ /* @__PURE__ */ n("div", { className: "grid min-w-0 gap-4 xl:grid-cols-[1.45fr_.75fr]", children: [
770
+ /* @__PURE__ */ e(ja, {}),
771
+ /* @__PURE__ */ e(Ia, {})
772
+ ] })
773
+ ] })
774
+ ]
775
+ }
776
+ );
777
+ }
778
+ const La = S.Root, Rt = S.Trigger, $a = S.Portal, Pt = S.Close, je = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
779
+ S.Overlay,
780
+ {
781
+ ref: r,
782
+ className: c(
783
+ `fixed inset-0 ${P.MODAL_BACKDROP} bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,
784
+ a
785
+ ),
786
+ ...t
787
+ }
788
+ ));
789
+ je.displayName = S.Overlay.displayName;
790
+ const Ie = b.forwardRef(({ className: a, children: t, nested: r, showCloseButton: s = !0, closeLabel: l = "Close dialog", ...o }, d) => {
791
+ const m = r ? P.NESTED_MODAL : P.MODAL;
792
+ return /* @__PURE__ */ n($a, { children: [
793
+ /* @__PURE__ */ e(je, { className: r ? m : void 0 }),
794
+ /* @__PURE__ */ n(
795
+ S.Content,
796
+ {
797
+ ref: d,
798
+ className: c(
799
+ `fixed left-[50%] top-[50%] ${m} grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-4 shadow-lg duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:p-6`,
800
+ a
801
+ ),
802
+ ...o,
803
+ children: [
804
+ t,
805
+ s ? /* @__PURE__ */ n(S.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
806
+ /* @__PURE__ */ e(J, { className: "h-4 w-4" }),
807
+ /* @__PURE__ */ e("span", { className: "sr-only", children: l })
808
+ ] }) : null
809
+ ]
810
+ }
811
+ )
812
+ ] });
813
+ });
814
+ Ie.displayName = S.Content.displayName;
815
+ const Le = ({
816
+ className: a,
817
+ ...t
818
+ }) => /* @__PURE__ */ e(
819
+ "div",
820
+ {
821
+ className: c(
822
+ "flex flex-col space-y-1.5 text-center sm:text-left",
823
+ a
824
+ ),
825
+ ...t
826
+ }
827
+ );
828
+ Le.displayName = "DialogHeader";
829
+ const $e = ({
830
+ className: a,
831
+ ...t
832
+ }) => /* @__PURE__ */ e(
833
+ "div",
834
+ {
835
+ className: c(
836
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
837
+ a
838
+ ),
839
+ ...t
840
+ }
841
+ );
842
+ $e.displayName = "DialogFooter";
843
+ const Ve = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
844
+ S.Title,
845
+ {
846
+ ref: r,
847
+ className: c(
848
+ "text-lg font-semibold leading-none tracking-tight",
849
+ a
850
+ ),
851
+ ...t
852
+ }
853
+ ));
854
+ Ve.displayName = S.Title.displayName;
855
+ const Be = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
856
+ S.Description,
857
+ {
858
+ ref: r,
859
+ className: c("text-sm text-muted-foreground", a),
860
+ ...t
861
+ }
862
+ ));
863
+ Be.displayName = S.Description.displayName;
864
+ const Va = S.Root, Mt = S.Trigger, zt = S.Close, Ba = S.Portal, Fe = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
865
+ S.Overlay,
866
+ {
867
+ className: c(
868
+ `fixed inset-0 ${P.MODAL_BACKDROP} bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,
869
+ a
870
+ ),
871
+ ...t,
872
+ ref: r
873
+ }
874
+ ));
875
+ Fe.displayName = S.Overlay.displayName;
876
+ const Fa = Me(
877
+ `fixed ${P.MODAL} gap-4 overflow-visible bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out`,
878
+ {
879
+ variants: {
880
+ side: {
881
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
882
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
883
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
884
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
885
+ }
886
+ },
887
+ defaultVariants: {
888
+ side: "right"
889
+ }
890
+ }
891
+ ), He = b.forwardRef(({ side: a = "right", className: t, children: r, ...s }, l) => /* @__PURE__ */ n(Ba, { children: [
892
+ /* @__PURE__ */ e(Fe, {}),
893
+ /* @__PURE__ */ n(
894
+ S.Content,
895
+ {
896
+ ref: l,
897
+ className: c(Fa({ side: a }), t),
898
+ onPointerDownOutside: (o) => o.preventDefault(),
899
+ onInteractOutside: (o) => {
900
+ const d = o.target;
901
+ d.closest("[data-app-date-picker-popover]") && o.preventDefault(), d.closest("[data-radix-dialog-content]") && o.preventDefault(), d.closest("[data-radix-select-content]") && o.preventDefault();
902
+ },
903
+ onFocusOutside: (o) => {
904
+ const d = o.target;
905
+ d.closest("[data-app-date-picker-popover]") && o.preventDefault(), d.closest("[data-radix-dialog-content]") && o.preventDefault(), d.closest("[data-radix-select-content]") && o.preventDefault();
906
+ },
907
+ onEscapeKeyDown: (o) => o.preventDefault(),
908
+ ...s,
909
+ children: [
910
+ /* @__PURE__ */ n(S.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
911
+ /* @__PURE__ */ e(J, { className: "h-4 w-4" }),
912
+ /* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
913
+ ] }),
914
+ r
915
+ ]
916
+ }
917
+ )
918
+ ] }));
919
+ He.displayName = S.Content.displayName;
920
+ const We = ({
921
+ className: a,
922
+ ...t
923
+ }) => /* @__PURE__ */ e(
924
+ "div",
925
+ {
926
+ className: c(
927
+ "flex flex-col space-y-2 text-center sm:text-left",
928
+ a
929
+ ),
930
+ ...t
931
+ }
932
+ );
933
+ We.displayName = "SheetHeader";
934
+ const Ha = ({
935
+ className: a,
936
+ ...t
937
+ }) => /* @__PURE__ */ e(
938
+ "div",
939
+ {
940
+ className: c(
941
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
942
+ a
943
+ ),
944
+ ...t
945
+ }
946
+ );
947
+ Ha.displayName = "SheetFooter";
948
+ const Ue = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
949
+ S.Title,
950
+ {
951
+ ref: r,
952
+ className: c("text-lg font-semibold text-foreground", a),
953
+ ...t
954
+ }
955
+ ));
956
+ Ue.displayName = S.Title.displayName;
957
+ const Ke = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
958
+ S.Description,
959
+ {
960
+ ref: r,
961
+ className: c("text-sm text-muted-foreground", a),
962
+ ...t
963
+ }
964
+ ));
965
+ Ke.displayName = S.Description.displayName;
966
+ const Wa = {
967
+ sm: "sm:max-w-md",
968
+ md: "sm:max-w-xl",
969
+ lg: "sm:max-w-2xl",
970
+ xl: "sm:max-w-4xl",
971
+ wide: "sm:max-w-6xl"
972
+ }, Ye = typeof process < "u" && process.env.NODE_ENV === "test";
973
+ function jt({
974
+ open: a,
975
+ onClose: t,
976
+ title: r,
977
+ description: s,
978
+ children: l,
979
+ footer: o,
980
+ size: d = "md",
981
+ contentClassName: m,
982
+ bodyClassName: u,
983
+ closeLabel: f,
984
+ closeOnOutside: k = !1
985
+ }) {
986
+ if (Ye)
987
+ return a ? /* @__PURE__ */ n("div", { role: "dialog", "aria-modal": "true", "aria-label": r, className: m, children: [
988
+ /* @__PURE__ */ n("header", { children: [
989
+ /* @__PURE__ */ e("h2", { children: r }),
990
+ s ? /* @__PURE__ */ e("p", { children: s }) : null
991
+ ] }),
992
+ /* @__PURE__ */ e("div", { className: u, children: l }),
993
+ o ? /* @__PURE__ */ e("footer", { children: o }) : null,
994
+ /* @__PURE__ */ e("button", { type: "button", "aria-label": f || "Close", onClick: t, children: f || "Close" })
995
+ ] }) : null;
996
+ const w = (typeof window > "u" ? "" : window.localStorage.getItem("i18nextLng") || document.documentElement.lang).toLowerCase().startsWith("zh");
997
+ return /* @__PURE__ */ e(La, { open: a, onOpenChange: (g) => {
998
+ g || t();
999
+ }, children: /* @__PURE__ */ n(
1000
+ Ie,
1001
+ {
1002
+ closeLabel: f || (w ? "关闭对话框" : "Close dialog"),
1003
+ className: c(
1004
+ "max-h-[calc(100dvh-1rem)] gap-0 overflow-hidden p-0 sm:max-h-[calc(100dvh-3rem)]",
1005
+ "max-sm:bottom-0 max-sm:left-0 max-sm:top-auto max-sm:w-full max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-2xl",
1006
+ Wa[d],
1007
+ m
1008
+ ),
1009
+ onPointerDownOutside: (g) => {
1010
+ k || g.preventDefault();
1011
+ },
1012
+ children: [
1013
+ /* @__PURE__ */ n(Le, { className: "shrink-0 border-b border-border px-5 py-4 pr-12 text-left sm:px-6", children: [
1014
+ /* @__PURE__ */ e(Ve, { className: "text-lg leading-6", children: r }),
1015
+ s ? /* @__PURE__ */ e(Be, { children: s }) : null
1016
+ ] }),
1017
+ /* @__PURE__ */ e("div", { className: c("min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 py-4 sm:px-6", u), children: l }),
1018
+ o ? /* @__PURE__ */ e($e, { className: "shrink-0 border-t border-border bg-background px-5 py-4 sm:px-6", children: o }) : null
1019
+ ]
1020
+ }
1021
+ ) });
1022
+ }
1023
+ function It({ open: a, onClose: t, title: r, description: s, children: l, side: o = "right", className: d }) {
1024
+ return Ye ? a ? /* @__PURE__ */ n("div", { role: "dialog", "aria-modal": "true", "aria-label": r, className: d, children: [
1025
+ /* @__PURE__ */ n("header", { children: [
1026
+ /* @__PURE__ */ e("h2", { children: r }),
1027
+ s ? /* @__PURE__ */ e("p", { children: s }) : null
1028
+ ] }),
1029
+ /* @__PURE__ */ e("div", { children: l }),
1030
+ /* @__PURE__ */ e("button", { type: "button", "aria-label": "Close", onClick: t, children: "Close" })
1031
+ ] }) : null : /* @__PURE__ */ e(Va, { open: a, onOpenChange: (m) => {
1032
+ m || t();
1033
+ }, children: /* @__PURE__ */ n(He, { side: o, className: c("w-full overflow-y-auto sm:max-w-md", d), children: [
1034
+ /* @__PURE__ */ n(We, { className: "text-left", children: [
1035
+ /* @__PURE__ */ e(Ue, { children: r }),
1036
+ s ? /* @__PURE__ */ e(Ke, { children: s }) : null
1037
+ ] }),
1038
+ /* @__PURE__ */ e("div", { className: "mt-6 space-y-5 text-sm leading-6 text-muted-foreground", children: l })
1039
+ ] }) });
1040
+ }
1041
+ let q = 0, Y = null;
1042
+ function Ua() {
1043
+ const a = document.documentElement;
1044
+ Y = {
1045
+ htmlOverflow: a.style.overflow,
1046
+ bodyOverflow: document.body.style.overflow
1047
+ }, a.style.overflow = "hidden", document.body.style.overflow = "hidden";
1048
+ }
1049
+ function Ka() {
1050
+ if (!Y) return;
1051
+ const a = document.documentElement;
1052
+ a.style.overflow = Y.htmlOverflow, document.body.style.overflow = Y.bodyOverflow, Y = null;
1053
+ }
1054
+ function Ya(a) {
1055
+ H(() => typeof document > "u" || !a ? void 0 : (q === 0 && Ua(), q++, () => {
1056
+ q--, q === 0 && Ka();
1057
+ }), [a]);
1058
+ }
1059
+ const B = {
1060
+ sm: { width: "480px", maxHeight: "90vh" },
1061
+ md: { width: "640px", maxHeight: "90vh" },
1062
+ lg: { width: "896px", maxHeight: "90vh" },
1063
+ xl: { width: "1000px", maxHeight: "90vh" },
1064
+ wide: { width: "min(1152px, 95vw)", maxHeight: "90vh" },
1065
+ full: { width: "95vw", maxHeight: "95vh" }
1066
+ }, Ga = {
1067
+ sm: B.sm,
1068
+ md: B.md,
1069
+ lg: B.lg,
1070
+ xl: B.xl,
1071
+ wide: B.wide,
1072
+ full: B.full,
1073
+ STANDARD: B.lg,
1074
+ LARGE: B.wide
1075
+ }, Ge = ({
1076
+ size: a = "STANDARD",
1077
+ isOpen: t,
1078
+ onClose: r,
1079
+ title: s,
1080
+ showCloseButton: l = !0,
1081
+ closeOnOverlayClick: o = !1,
1082
+ className: d,
1083
+ contentClassName: m,
1084
+ usePortal: u = !0,
1085
+ children: f
1086
+ }) => {
1087
+ Ya(t), b.useEffect(() => {
1088
+ const g = (h) => {
1089
+ h.key === "Escape" && t && r();
1090
+ };
1091
+ return t && document.addEventListener("keydown", g), () => {
1092
+ document.removeEventListener("keydown", g);
1093
+ };
1094
+ }, [t, r]);
1095
+ const k = (g) => {
1096
+ o && g.target === g.currentTarget && r();
1097
+ }, N = Ga[a], w = /* @__PURE__ */ e(
1098
+ "div",
1099
+ {
1100
+ className: c(
1101
+ "fixed inset-0 flex items-start sm:items-center justify-center p-4 sm:p-6 overflow-y-auto bg-black/50 backdrop-blur-sm",
1102
+ P.MODAL,
1103
+ d
1104
+ ),
1105
+ onClick: k,
1106
+ style: {
1107
+ opacity: t ? 1 : 0,
1108
+ visibility: t ? "visible" : "hidden",
1109
+ transition: "opacity 200ms ease-in-out, visibility 200ms ease-in-out"
1110
+ },
1111
+ children: /* @__PURE__ */ n(
1112
+ "div",
1113
+ {
1114
+ className: c(
1115
+ "w-full rounded-lg shadow-xl border bg-white dark:bg-surface-darker flex flex-col overflow-hidden my-auto sm:my-4",
1116
+ "border-surface-darker/10 dark:border-surface/20",
1117
+ "animate-in fade-in-0 zoom-in-95 duration-300",
1118
+ "mx-auto sm:mx-4 md:mx-6 lg:mx-8",
1119
+ "max-h-[calc(100dvh-2rem)]",
1120
+ m
1121
+ ),
1122
+ style: {
1123
+ maxWidth: N.width,
1124
+ maxHeight: `min(${N.maxHeight}, calc(100dvh - 2rem))`
1125
+ },
1126
+ onClick: (g) => g.stopPropagation(),
1127
+ children: [
1128
+ (s || l) && /* @__PURE__ */ n("div", { className: "flex items-center justify-between p-6 border-b border-neutral-200 dark:border-neutral-700 flex-shrink-0", children: [
1129
+ s && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: typeof s == "string" ? /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-neutral-900 dark:text-white", children: s }) : s }),
1130
+ l && /* @__PURE__ */ e(
1131
+ "button",
1132
+ {
1133
+ onClick: r,
1134
+ className: "p-2 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded-lg transition-colors",
1135
+ "aria-label": "Close dialog",
1136
+ children: /* @__PURE__ */ e(J, { className: "w-5 h-5 text-neutral-500 dark:text-neutral-400" })
1137
+ }
1138
+ )
1139
+ ] }),
1140
+ /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: f })
1141
+ ]
1142
+ }
1143
+ )
1144
+ }
1145
+ );
1146
+ return t ? u ? xa(w, document.body) : w : null;
1147
+ }, be = Me(
1148
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:focus-visible:ring-offset-neutral-950 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1149
+ {
1150
+ variants: {
1151
+ variant: {
1152
+ default: "bg-blue-500 dark:bg-neutral-50 text-white dark:text-neutral-950 shadow-sm hover:shadow-md hover:bg-blue-600 dark:hover:bg-white active:bg-blue-700 dark:active:bg-neutral-100",
1153
+ destructive: "bg-red-600 dark:bg-red-700 text-white shadow-sm hover:shadow-md hover:bg-red-700 dark:hover:bg-red-600 active:bg-red-800 dark:active:bg-red-800",
1154
+ outline: "border border-neutral-300 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800 active:bg-neutral-200 dark:active:bg-neutral-700",
1155
+ secondary: "bg-neutral-100 dark:bg-neutral-800 text-neutral-800 dark:text-neutral-50 shadow-sm hover:shadow-md hover:bg-neutral-200 dark:hover:bg-neutral-700 active:bg-neutral-300 dark:active:bg-neutral-900 hover:text-neutral-900 dark:hover:text-neutral-50 active:text-neutral-950 dark:active:text-neutral-50",
1156
+ ghost: "bg-transparent text-neutral-700 dark:text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800 active:bg-neutral-200 dark:active:bg-neutral-900 hover:text-neutral-900 dark:hover:text-neutral-200 active:text-neutral-950 dark:active:text-neutral-100",
1157
+ subtle: "bg-transparent text-neutral-600 dark:text-neutral-400 hover:bg-neutral-50 dark:hover:bg-neutral-800/50 active:bg-neutral-100 dark:active:bg-neutral-700/50",
1158
+ link: "bg-transparent text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline"
1159
+ },
1160
+ size: {
1161
+ default: "h-9 px-4 py-2",
1162
+ sm: "h-8 rounded-lg px-3 text-xs",
1163
+ lg: "h-10 rounded-xl px-8",
1164
+ icon: "h-9 w-9 p-0"
1165
+ }
1166
+ },
1167
+ defaultVariants: {
1168
+ variant: "default",
1169
+ size: "default"
1170
+ }
1171
+ }
1172
+ ), A = b.forwardRef(
1173
+ ({ className: a, variant: t, size: r, asChild: s = !1, ...l }, o) => /* @__PURE__ */ e(
1174
+ s ? Na : "button",
1175
+ {
1176
+ className: c(be({ variant: t, size: r, className: a })),
1177
+ ref: o,
1178
+ ...l
1179
+ }
1180
+ )
1181
+ );
1182
+ A.displayName = "Button";
1183
+ const Ze = ({
1184
+ size: a = "STANDARD",
1185
+ isOpen: t,
1186
+ onClose: r,
1187
+ title: s,
1188
+ className: l,
1189
+ children: o,
1190
+ footer: d,
1191
+ showCloseButton: m = !0,
1192
+ closeOnOverlayClick: u = !1
1193
+ }) => /* @__PURE__ */ n(
1194
+ Ge,
1195
+ {
1196
+ size: a,
1197
+ isOpen: t,
1198
+ onClose: r,
1199
+ title: s,
1200
+ showCloseButton: m,
1201
+ closeOnOverlayClick: u,
1202
+ className: l,
1203
+ children: [
1204
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain custom-scrollbar", children: o }),
1205
+ d && /* @__PURE__ */ e("div", { className: "flex-shrink-0 border-t border-neutral-200 dark:border-neutral-700 bg-neutral-50 dark:bg-neutral-800", children: d })
1206
+ ]
1207
+ }
1208
+ ), Lt = ({
1209
+ onSubmit: a,
1210
+ onCancel: t,
1211
+ submitText: r = "OK",
1212
+ cancelText: s = "Cancel",
1213
+ submitDisabled: l = !1,
1214
+ submitLoading: o = !1,
1215
+ showFooter: d = !0,
1216
+ customFooter: m,
1217
+ ...u
1218
+ }) => /* @__PURE__ */ e(Ze, { ...u, footer: d ? m || /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-3 p-6", children: [
1219
+ /* @__PURE__ */ e(A, { type: "button", variant: "secondary", onClick: () => {
1220
+ t?.(), u.onClose();
1221
+ }, children: s }),
1222
+ a && /* @__PURE__ */ n(
1223
+ A,
1224
+ {
1225
+ type: "button",
1226
+ variant: "default",
1227
+ onClick: () => {
1228
+ a?.();
1229
+ },
1230
+ disabled: l || o,
1231
+ className: "gap-2",
1232
+ children: [
1233
+ o && /* @__PURE__ */ e("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white" }),
1234
+ r
1235
+ ]
1236
+ }
1237
+ )
1238
+ ] }) : void 0 }), Za = ({
1239
+ isOpen: a,
1240
+ onClose: t,
1241
+ onConfirm: r,
1242
+ title: s = "Confirm",
1243
+ message: l,
1244
+ confirmText: o = "Confirm",
1245
+ cancelText: d = "Cancel",
1246
+ danger: m = !1,
1247
+ loading: u = !1
1248
+ }) => /* @__PURE__ */ e(
1249
+ Ge,
1250
+ {
1251
+ size: "STANDARD",
1252
+ isOpen: a,
1253
+ onClose: t,
1254
+ title: s,
1255
+ contentClassName: "max-w-4xl",
1256
+ children: /* @__PURE__ */ n("div", { className: "p-6", children: [
1257
+ /* @__PURE__ */ e("p", { className: "text-neutral-700 dark:text-neutral-300 mb-6", children: l }),
1258
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-3", children: [
1259
+ /* @__PURE__ */ e(A, { type: "button", variant: "secondary", onClick: t, disabled: u, children: d }),
1260
+ /* @__PURE__ */ n(
1261
+ A,
1262
+ {
1263
+ type: "button",
1264
+ variant: m ? "destructive" : "default",
1265
+ onClick: () => {
1266
+ r();
1267
+ },
1268
+ disabled: u,
1269
+ className: "gap-2",
1270
+ children: [
1271
+ u && /* @__PURE__ */ e("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white" }),
1272
+ o
1273
+ ]
1274
+ }
1275
+ )
1276
+ ] })
1277
+ ] })
1278
+ }
1279
+ ), $t = ({
1280
+ searchable: a = !1,
1281
+ searchPlaceholder: t = "Search...",
1282
+ onSearch: r,
1283
+ emptyMessage: s = "No data",
1284
+ loading: l = !1,
1285
+ children: o,
1286
+ title: d,
1287
+ ...m
1288
+ }) => {
1289
+ const [u, f] = b.useState("");
1290
+ return /* @__PURE__ */ n(Ze, { ...m, title: d, children: [
1291
+ a && /* @__PURE__ */ e("div", { className: "p-4 border-b border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
1292
+ "input",
1293
+ {
1294
+ type: "text",
1295
+ placeholder: t,
1296
+ value: u,
1297
+ onChange: (N) => {
1298
+ const w = N.target.value;
1299
+ f(w), r?.(w);
1300
+ },
1301
+ className: "w-full px-3 py-2 border border-neutral-300 dark:border-neutral-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-brand-primary bg-white dark:bg-neutral-700 text-neutral-900 dark:text-white"
1302
+ }
1303
+ ) }),
1304
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain custom-scrollbar", children: l ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-12", children: [
1305
+ /* @__PURE__ */ e("div", { className: "w-8 h-8 border-2 border-brand-primary/30 border-t-blue-600 rounded-full animate-spin" }),
1306
+ /* @__PURE__ */ e("span", { className: "ml-3 text-neutral-600 dark:text-neutral-400", children: "Loading..." })
1307
+ ] }) : o || /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-neutral-500 dark:text-neutral-400", children: s }) }) })
1308
+ ] });
1309
+ };
1310
+ function Vt({
1311
+ open: a,
1312
+ title: t,
1313
+ message: r,
1314
+ confirmLabel: s = "Confirm",
1315
+ cancelLabel: l = "Cancel",
1316
+ onConfirm: o,
1317
+ onCancel: d,
1318
+ danger: m = !1,
1319
+ loading: u = !1
1320
+ }) {
1321
+ return /* @__PURE__ */ e(
1322
+ Za,
1323
+ {
1324
+ isOpen: a,
1325
+ onClose: d,
1326
+ onConfirm: o,
1327
+ title: t,
1328
+ message: r,
1329
+ confirmText: s,
1330
+ cancelText: l,
1331
+ danger: m,
1332
+ loading: u
1333
+ }
1334
+ );
1335
+ }
1336
+ function le({
1337
+ className: a,
1338
+ classNames: t,
1339
+ showOutsideDays: r = !0,
1340
+ components: s,
1341
+ ...l
1342
+ }) {
1343
+ return /* @__PURE__ */ e(
1344
+ ya,
1345
+ {
1346
+ showOutsideDays: r,
1347
+ className: c(
1348
+ "p-3",
1349
+ l.mode === "range" ? "gs-calendar-range" : "gs-calendar-single",
1350
+ a
1351
+ ),
1352
+ classNames: {
1353
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
1354
+ month: "space-y-4 min-w-[280px]",
1355
+ caption: "flex justify-center pt-1 relative items-center w-full",
1356
+ caption_label: "text-sm font-medium",
1357
+ nav: "space-x-1 flex items-center",
1358
+ nav_button: c(
1359
+ be({ variant: "outline" }),
1360
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
1361
+ ),
1362
+ nav_button_previous: "absolute left-0",
1363
+ nav_button_next: "absolute right-0",
1364
+ table: "w-full border-collapse space-y-1",
1365
+ head_row: "flex w-full",
1366
+ head_cell: "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem]",
1367
+ row: "flex w-full mt-2",
1368
+ cell: c(
1369
+ `relative p-0 text-center text-sm flex-1 focus-within:relative focus-within:${P.SIDEBAR} has-[[aria-selected]]:bg-accent has-[[aria-selected].day-outside]:bg-accent/50 has-[[aria-selected].day-range-end]:rounded-r-md`,
1370
+ l.mode === "range" ? "has-[>.day-range-end]:rounded-r-md has-[>.day-range-start]:rounded-l-md first:has-[[aria-selected]]:rounded-l-md last:has-[[aria-selected]]:rounded-r-md" : void 0
1371
+ ),
1372
+ day: c(
1373
+ be({ variant: "ghost" }),
1374
+ "h-8 w-8 p-0 font-normal aria-selected:opacity-100"
1375
+ ),
1376
+ day_range_start: "day-range-start",
1377
+ day_range_end: "day-range-end",
1378
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
1379
+ day_today: "bg-accent text-accent-foreground",
1380
+ day_outside: "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
1381
+ day_disabled: "text-muted-foreground opacity-50",
1382
+ day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
1383
+ day_hidden: "invisible",
1384
+ ...t
1385
+ },
1386
+ components: {
1387
+ IconLeft: ({ className: o, ...d }) => /* @__PURE__ */ e(Oe, { className: c("h-4 w-4", o), ...d }),
1388
+ IconRight: ({ className: o, ...d }) => /* @__PURE__ */ e(Te, { className: c("h-4 w-4", o), ...d }),
1389
+ // Consumer overrides (e.g. a custom DayContent) merge in without dropping
1390
+ // the nav chevrons above.
1391
+ ...s
1392
+ },
1393
+ ...l
1394
+ }
1395
+ );
1396
+ }
1397
+ le.displayName = "Calendar";
1398
+ function Ja() {
1399
+ const [a, t] = b.useState("hsl(0 0% 100%)");
1400
+ return b.useEffect(() => {
1401
+ const r = () => {
1402
+ if (typeof window > "u") return;
1403
+ const l = document.documentElement, o = getComputedStyle(l).getPropertyValue("--popover").trim(), d = l.classList.contains("dark");
1404
+ t(o ? `hsl(${o})` : d ? "hsl(0 0% 3.9%)" : "hsl(0 0% 100%)");
1405
+ };
1406
+ r();
1407
+ const s = new MutationObserver(r);
1408
+ return s.observe(document.documentElement, {
1409
+ attributes: !0,
1410
+ attributeFilter: ["class"]
1411
+ }), () => s.disconnect();
1412
+ }, []), a;
1413
+ }
1414
+ const se = W.Root, oe = W.Trigger, Bt = W.Anchor, Q = b.forwardRef(({ className: a, align: t = "center", sideOffset: r = 4, style: s, ...l }, o) => {
1415
+ const d = Ja();
1416
+ return /* @__PURE__ */ e(W.Portal, { children: /* @__PURE__ */ e(
1417
+ W.Content,
1418
+ {
1419
+ ref: o,
1420
+ align: t,
1421
+ sideOffset: r,
1422
+ className: c(
1423
+ `${P.OVERLAY_POPOVER} w-72 rounded-md border p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]`,
1424
+ "text-popover-foreground border-border",
1425
+ a
1426
+ ),
1427
+ style: {
1428
+ backgroundColor: d,
1429
+ ...s
1430
+ },
1431
+ ...l
1432
+ }
1433
+ ) });
1434
+ });
1435
+ Q.displayName = W.Content.displayName;
1436
+ const ie = typeof process < "u" && process.env.NODE_ENV === "test", Qa = {
1437
+ en: {
1438
+ chooseDate: "Select date",
1439
+ chooseDateTime: "Select date and time",
1440
+ chooseTime: "Select time",
1441
+ clear: "Clear",
1442
+ today: "Today",
1443
+ previousYear: "Previous year",
1444
+ nextYear: "Next year",
1445
+ hour: "Hour",
1446
+ minute: "Minute",
1447
+ apply: "Apply"
1448
+ },
1449
+ zh: {
1450
+ chooseDate: "选择日期",
1451
+ chooseDateTime: "选择日期和时间",
1452
+ chooseTime: "选择时间",
1453
+ clear: "清除",
1454
+ today: "今天",
1455
+ previousYear: "上一年",
1456
+ nextYear: "下一年",
1457
+ hour: "小时",
1458
+ minute: "分钟",
1459
+ apply: "应用"
1460
+ }
1461
+ };
1462
+ function Je(a) {
1463
+ return String(a || "").toLowerCase().startsWith("zh") ? "zh" : "en";
1464
+ }
1465
+ function de(a, t) {
1466
+ return { ...Qa[Je(a)], ...t };
1467
+ }
1468
+ function I(a) {
1469
+ const t = String(a || "").trim().match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
1470
+ if (!t[1]) return;
1471
+ const r = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
1472
+ if (!(r.getFullYear() !== Number(t[1]) || r.getMonth() !== Number(t[2]) - 1 || r.getDate() !== Number(t[3])))
1473
+ return r;
1474
+ }
1475
+ function Z(a) {
1476
+ return `${a.getFullYear()}-${String(a.getMonth() + 1).padStart(2, "0")}-${String(a.getDate()).padStart(2, "0")}`;
1477
+ }
1478
+ function U(a) {
1479
+ const t = String(a || "").match(/(?:T|^)(\d{2}):(\d{2})/), r = Math.min(23, Math.max(0, Number(t?.[1] || 9))), s = Math.min(59, Math.max(0, Number(t?.[2] || 0)));
1480
+ return { hour: r, minute: s };
1481
+ }
1482
+ function ae(a, t) {
1483
+ const r = I(a);
1484
+ return r ? wa(r, t === "zh" ? "yyyy年M月d日" : "MMM d, yyyy", {
1485
+ locale: t === "zh" ? te : re
1486
+ }) : "";
1487
+ }
1488
+ function Xa(a, t) {
1489
+ const r = ae(a, t);
1490
+ if (!r) return "";
1491
+ const s = U(a);
1492
+ return `${r} ${String(s.hour).padStart(2, "0")}:${String(s.minute).padStart(2, "0")}`;
1493
+ }
1494
+ function qa(a) {
1495
+ if (!a) return "";
1496
+ const t = U(a);
1497
+ return `${String(t.hour).padStart(2, "0")}:${String(t.minute).padStart(2, "0")}`;
1498
+ }
1499
+ function ce(a) {
1500
+ const { i18n: t } = va();
1501
+ return Je(a || t.resolvedLanguage || t.language);
1502
+ }
1503
+ function me({ label: a, onClear: t }) {
1504
+ return /* @__PURE__ */ e(
1505
+ A,
1506
+ {
1507
+ type: "button",
1508
+ variant: "ghost",
1509
+ size: "icon",
1510
+ "aria-label": a,
1511
+ className: "h-9 w-9 shrink-0 rounded-l-none border-l border-border text-muted-foreground",
1512
+ onClick: t,
1513
+ children: /* @__PURE__ */ e(J, { className: "h-4 w-4", "aria-hidden": "true" })
1514
+ }
1515
+ );
1516
+ }
1517
+ function ue({ icon: a, value: t, placeholder: r }) {
1518
+ return /* @__PURE__ */ n(we, { children: [
1519
+ a,
1520
+ /* @__PURE__ */ e("span", { className: c("min-w-0 flex-1 truncate text-left", !t && "text-muted-foreground"), children: t || r })
1521
+ ] });
1522
+ }
1523
+ function et({
1524
+ id: a,
1525
+ value: t,
1526
+ onChange: r,
1527
+ disabled: s,
1528
+ placeholder: l,
1529
+ className: o,
1530
+ triggerClassName: d,
1531
+ min: m,
1532
+ max: u,
1533
+ locale: f,
1534
+ labels: k,
1535
+ clearable: N = !0,
1536
+ "aria-label": w,
1537
+ popoverLayer: g = "aboveModal",
1538
+ disabledDays: h,
1539
+ presets: x = []
1540
+ }) {
1541
+ const v = ce(f), p = de(v, k), _ = I(t), C = I(m), T = I(u), [E, O] = b.useState(!1), M = ae(t, v);
1542
+ return /* @__PURE__ */ n("div", { className: c("flex min-w-0 items-stretch rounded-md border border-input bg-background shadow-sm focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2", o), children: [
1543
+ /* @__PURE__ */ n(se, { open: E, onOpenChange: O, modal: !0, children: [
1544
+ /* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ e(
1545
+ A,
1546
+ {
1547
+ id: a,
1548
+ type: "button",
1549
+ variant: "ghost",
1550
+ disabled: s,
1551
+ "aria-label": w || l || p.chooseDate,
1552
+ className: c("h-10 min-w-0 flex-1 justify-start gap-2 rounded-r-none px-3 font-normal hover:bg-accent/60", d),
1553
+ children: /* @__PURE__ */ e(ue, { icon: /* @__PURE__ */ e(ye, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), value: M, placeholder: l || p.chooseDate })
1554
+ }
1555
+ ) }),
1556
+ /* @__PURE__ */ n(
1557
+ Q,
1558
+ {
1559
+ align: "start",
1560
+ className: c("w-auto max-w-[calc(100vw-1.5rem)] p-0", g === "aboveModal" ? P.DATE_PICKER_POPOVER : P.POPOVER),
1561
+ children: [
1562
+ /* @__PURE__ */ e(
1563
+ le,
1564
+ {
1565
+ mode: "single",
1566
+ selected: _,
1567
+ defaultMonth: _ || C || /* @__PURE__ */ new Date(),
1568
+ onSelect: (y) => {
1569
+ y && (r(Z(y)), O(!1));
1570
+ },
1571
+ disabled: [{ before: C || new Date(100, 0, 1), after: T || new Date(9999, 11, 31) }, ...Array.isArray(h) ? h : h ? [h] : []],
1572
+ locale: v === "zh" ? te : re,
1573
+ captionLayout: "dropdown-buttons",
1574
+ fromDate: C || new Date(1900, 0, 1),
1575
+ toDate: T || new Date((/* @__PURE__ */ new Date()).getFullYear() + 20, 11, 31),
1576
+ initialFocus: !0
1577
+ }
1578
+ ),
1579
+ x.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 border-t border-border px-3 py-2", children: x.map((y) => /* @__PURE__ */ e(A, { type: "button", variant: "ghost", size: "sm", onClick: () => {
1580
+ r(y.value), O(!1);
1581
+ }, children: y.label }, `${y.label}-${y.value}`)) }) : null,
1582
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1583
+ /* @__PURE__ */ e(
1584
+ A,
1585
+ {
1586
+ type: "button",
1587
+ variant: "ghost",
1588
+ size: "sm",
1589
+ onClick: () => {
1590
+ const y = Z(/* @__PURE__ */ new Date()), L = C && new Date(y) < C, $ = T && new Date(y) > T;
1591
+ !L && !$ && r(y), O(!1);
1592
+ },
1593
+ children: p.today
1594
+ }
1595
+ ),
1596
+ N && t ? /* @__PURE__ */ e(A, { type: "button", variant: "ghost", size: "sm", onClick: () => {
1597
+ r(""), O(!1);
1598
+ }, children: p.clear }) : null
1599
+ ] })
1600
+ ]
1601
+ }
1602
+ )
1603
+ ] }),
1604
+ N && t && !s ? /* @__PURE__ */ e(me, { label: p.clear, onClear: () => r("") }) : null
1605
+ ] });
1606
+ }
1607
+ function at(a) {
1608
+ return ie ? /* @__PURE__ */ e("input", { id: a.id, type: "date", value: a.value, onChange: (t) => a.onChange(t.currentTarget.value), disabled: a.disabled, min: a.min, max: a.max, "aria-label": a["aria-label"] || a.placeholder, className: a.className }) : /* @__PURE__ */ e(et, { ...a });
1609
+ }
1610
+ function tt({
1611
+ id: a,
1612
+ value: t,
1613
+ onChange: r,
1614
+ disabled: s,
1615
+ placeholder: l,
1616
+ className: o,
1617
+ triggerClassName: d,
1618
+ min: m,
1619
+ max: u,
1620
+ locale: f,
1621
+ labels: k,
1622
+ clearable: N = !0,
1623
+ "aria-label": w,
1624
+ popoverLayer: g = "aboveModal",
1625
+ disabledDays: h,
1626
+ presets: x = []
1627
+ }) {
1628
+ const v = ce(f), p = de(v, k), _ = I(m), C = I(u), T = { from: I(t.from), to: I(t.to) }, [E, O] = b.useState(!1), M = t.from ? `${ae(t.from, v)}${t.to ? ` – ${ae(t.to, v)}` : ""}` : "";
1629
+ return /* @__PURE__ */ n("div", { className: c("flex min-w-0 items-stretch rounded-md border border-input bg-background shadow-sm focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2", o), children: [
1630
+ /* @__PURE__ */ n(se, { open: E, onOpenChange: O, modal: !0, children: [
1631
+ /* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ e(A, { id: a, type: "button", variant: "ghost", disabled: s, "aria-label": w || l || p.chooseDate, className: c("h-10 min-w-0 flex-1 justify-start gap-2 rounded-r-none px-3 font-normal", d), children: /* @__PURE__ */ e(ue, { icon: /* @__PURE__ */ e(ye, { className: "h-4 w-4 shrink-0", "aria-hidden": !0 }), value: M, placeholder: l || p.chooseDate }) }) }),
1632
+ /* @__PURE__ */ n(Q, { align: "start", className: c("w-auto max-w-[calc(100vw-1.5rem)] p-0", g === "aboveModal" ? P.DATE_PICKER_POPOVER : P.POPOVER), children: [
1633
+ /* @__PURE__ */ e(le, { mode: "range", selected: T, onSelect: (y) => r({ from: y?.from ? Z(y.from) : "", to: y?.to ? Z(y.to) : "" }), numberOfMonths: 2, disabled: [{ before: _ || new Date(100, 0, 1), after: C || new Date(9999, 11, 31) }, ...Array.isArray(h) ? h : h ? [h] : []], locale: v === "zh" ? te : re, captionLayout: "dropdown-buttons", fromDate: _ || new Date(1900, 0, 1), toDate: C || new Date((/* @__PURE__ */ new Date()).getFullYear() + 20, 11, 31), initialFocus: !0 }),
1634
+ x.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 border-t border-border px-3 py-2", children: x.map((y) => /* @__PURE__ */ e(A, { type: "button", variant: "ghost", size: "sm", onClick: () => {
1635
+ r(y.value), O(!1);
1636
+ }, children: y.label }, y.label)) }) : null,
1637
+ /* @__PURE__ */ e("div", { className: "flex justify-end border-t border-border px-3 py-2", children: N && t.from ? /* @__PURE__ */ e(A, { type: "button", variant: "ghost", size: "sm", onClick: () => r({ from: "", to: "" }), children: p.clear }) : null })
1638
+ ] })
1639
+ ] }),
1640
+ N && t.from && !s ? /* @__PURE__ */ e(me, { label: p.clear, onClear: () => r({ from: "", to: "" }) }) : null
1641
+ ] });
1642
+ }
1643
+ function Ft(a) {
1644
+ return ie ? /* @__PURE__ */ n("div", { className: a.className, children: [
1645
+ /* @__PURE__ */ e("input", { id: a.id, type: "date", value: a.value.from, onChange: (t) => a.onChange({ ...a.value, from: t.currentTarget.value }), disabled: a.disabled, min: a.min, max: a.max, "aria-label": a["aria-label"] || a.placeholder }),
1646
+ /* @__PURE__ */ e("input", { type: "date", value: a.value.to, onChange: (t) => a.onChange({ ...a.value, to: t.currentTarget.value }), disabled: a.disabled, min: a.min, max: a.max, "aria-label": `${a["aria-label"] || a.placeholder || "Date"} end` })
1647
+ ] }) : /* @__PURE__ */ e(tt, { ...a });
1648
+ }
1649
+ function Qe({
1650
+ hour: a,
1651
+ minute: t,
1652
+ minuteStep: r,
1653
+ labels: s,
1654
+ onHour: l,
1655
+ onMinute: o
1656
+ }) {
1657
+ const d = Array.from({ length: Math.ceil(60 / r) }, (m, u) => Math.min(59, u * r));
1658
+ return /* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-3 border-t border-border p-3", children: [
1659
+ /* @__PURE__ */ n("fieldset", { children: [
1660
+ /* @__PURE__ */ e("legend", { className: "mb-2 text-xs font-medium text-muted-foreground", children: s.hour }),
1661
+ /* @__PURE__ */ e("div", { className: "grid max-h-36 grid-cols-4 gap-1 overflow-y-auto pr-1", children: Array.from({ length: 24 }, (m, u) => /* @__PURE__ */ e(A, { type: "button", size: "sm", variant: a === u ? "default" : "ghost", className: "h-8 px-1 tabular-nums", onClick: () => l(u), children: String(u).padStart(2, "0") }, u)) })
1662
+ ] }),
1663
+ /* @__PURE__ */ n("fieldset", { children: [
1664
+ /* @__PURE__ */ e("legend", { className: "mb-2 text-xs font-medium text-muted-foreground", children: s.minute }),
1665
+ /* @__PURE__ */ e("div", { className: "grid max-h-36 grid-cols-3 gap-1 overflow-y-auto pr-1", children: d.map((m) => /* @__PURE__ */ e(A, { type: "button", size: "sm", variant: t === m ? "default" : "ghost", className: "h-8 px-1 tabular-nums", onClick: () => o(m), children: String(m).padStart(2, "0") }, m)) })
1666
+ ] })
1667
+ ] });
1668
+ }
1669
+ function rt({
1670
+ id: a,
1671
+ value: t,
1672
+ onChange: r,
1673
+ disabled: s,
1674
+ placeholder: l,
1675
+ className: o,
1676
+ triggerClassName: d,
1677
+ min: m,
1678
+ max: u,
1679
+ locale: f,
1680
+ labels: k,
1681
+ clearable: N = !0,
1682
+ minuteStep: w = 5,
1683
+ "aria-label": g,
1684
+ popoverLayer: h = "aboveModal"
1685
+ }) {
1686
+ const x = ce(f), v = de(x, k), p = I(t), _ = I(m), C = I(u), T = U(t), [E, O] = b.useState(!1), [M, y] = b.useState(p || /* @__PURE__ */ new Date()), [L, $] = b.useState(T.hour), [R, z] = b.useState(T.minute);
1687
+ b.useEffect(() => {
1688
+ if (!E) return;
1689
+ y(p || /* @__PURE__ */ new Date());
1690
+ const V = U(t);
1691
+ $(V.hour), z(V.minute);
1692
+ }, [E, p?.getTime(), t]);
1693
+ const fe = () => {
1694
+ r(`${Z(M)}T${String(L).padStart(2, "0")}:${String(R).padStart(2, "0")}`), O(!1);
1695
+ };
1696
+ return /* @__PURE__ */ n("div", { className: c("flex min-w-0 items-stretch rounded-md border border-input bg-background shadow-sm focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2", o), children: [
1697
+ /* @__PURE__ */ n(se, { open: E, onOpenChange: O, modal: !0, children: [
1698
+ /* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ e(A, { id: a, type: "button", variant: "ghost", disabled: s, "aria-label": g || l || v.chooseDateTime, className: c("h-10 min-w-0 flex-1 justify-start gap-2 rounded-r-none px-3 font-normal hover:bg-accent/60", d), children: /* @__PURE__ */ e(ue, { icon: /* @__PURE__ */ e(ye, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), value: Xa(t, x), placeholder: l || v.chooseDateTime }) }) }),
1699
+ /* @__PURE__ */ n(Q, { align: "start", className: c("w-auto max-w-[calc(100vw-1.5rem)] p-0", h === "aboveModal" ? P.DATE_PICKER_POPOVER : P.POPOVER), children: [
1700
+ /* @__PURE__ */ e(le, { mode: "single", selected: M, onSelect: (V) => V && y(V), disabled: { before: _ || new Date(100, 0, 1), after: C || new Date(9999, 11, 31) }, locale: x === "zh" ? te : re, initialFocus: !0 }),
1701
+ /* @__PURE__ */ e(Qe, { hour: L, minute: R, minuteStep: Math.max(1, Math.min(30, w)), labels: v, onHour: $, onMinute: z }),
1702
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1703
+ N && t ? /* @__PURE__ */ e(A, { type: "button", variant: "ghost", size: "sm", onClick: () => {
1704
+ r(""), O(!1);
1705
+ }, children: v.clear }) : /* @__PURE__ */ e("span", {}),
1706
+ /* @__PURE__ */ e(A, { type: "button", size: "sm", onClick: fe, children: v.apply })
1707
+ ] })
1708
+ ] })
1709
+ ] }),
1710
+ N && t && !s ? /* @__PURE__ */ e(me, { label: v.clear, onClear: () => r("") }) : null
1711
+ ] });
1712
+ }
1713
+ function nt(a) {
1714
+ return ie ? /* @__PURE__ */ e("input", { id: a.id, type: "datetime-local", value: a.value, onChange: (t) => a.onChange(t.currentTarget.value), disabled: a.disabled, min: a.min, max: a.max, "aria-label": a["aria-label"] || a.placeholder, className: a.className }) : /* @__PURE__ */ e(rt, { ...a });
1715
+ }
1716
+ function lt({
1717
+ id: a,
1718
+ value: t,
1719
+ onChange: r,
1720
+ disabled: s,
1721
+ placeholder: l,
1722
+ className: o,
1723
+ triggerClassName: d,
1724
+ locale: m,
1725
+ labels: u,
1726
+ clearable: f = !0,
1727
+ minuteStep: k = 5,
1728
+ "aria-label": N,
1729
+ popoverLayer: w = "aboveModal"
1730
+ }) {
1731
+ const g = ce(m), h = de(g, u), x = U(t), [v, p] = b.useState(!1), [_, C] = b.useState(x.hour), [T, E] = b.useState(x.minute);
1732
+ b.useEffect(() => {
1733
+ if (!v) return;
1734
+ const M = U(t);
1735
+ C(M.hour), E(M.minute);
1736
+ }, [v, t]);
1737
+ const O = () => {
1738
+ r(`${String(_).padStart(2, "0")}:${String(T).padStart(2, "0")}`), p(!1);
1739
+ };
1740
+ return /* @__PURE__ */ n("div", { className: c("flex min-w-0 items-stretch rounded-md border border-input bg-background shadow-sm focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2", o), children: [
1741
+ /* @__PURE__ */ n(se, { open: v, onOpenChange: p, modal: !0, children: [
1742
+ /* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ e(A, { id: a, type: "button", variant: "ghost", disabled: s, "aria-label": N || l || h.chooseTime, className: c("h-10 min-w-0 flex-1 justify-start gap-2 rounded-r-none px-3 font-normal hover:bg-accent/60", d), children: /* @__PURE__ */ e(ue, { icon: /* @__PURE__ */ e(ba, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), value: qa(t), placeholder: l || h.chooseTime }) }) }),
1743
+ /* @__PURE__ */ n(Q, { align: "start", className: c("w-[320px] max-w-[calc(100vw-1.5rem)] p-0", w === "aboveModal" ? P.DATE_PICKER_POPOVER : P.POPOVER), children: [
1744
+ /* @__PURE__ */ e(Qe, { hour: _, minute: T, minuteStep: Math.max(1, Math.min(30, k)), labels: h, onHour: C, onMinute: E }),
1745
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1746
+ f && t ? /* @__PURE__ */ e(A, { type: "button", variant: "ghost", size: "sm", onClick: () => {
1747
+ r(""), p(!1);
1748
+ }, children: h.clear }) : /* @__PURE__ */ e("span", {}),
1749
+ /* @__PURE__ */ e(A, { type: "button", size: "sm", onClick: O, children: h.apply })
1750
+ ] })
1751
+ ] })
1752
+ ] }),
1753
+ f && t && !s ? /* @__PURE__ */ e(me, { label: h.clear, onClear: () => r("") }) : null
1754
+ ] });
1755
+ }
1756
+ function st(a) {
1757
+ return ie ? /* @__PURE__ */ e("input", { id: a.id, type: "time", value: a.value, onChange: (t) => a.onChange(t.currentTarget.value), disabled: a.disabled, "aria-label": a["aria-label"] || a.placeholder, className: a.className }) : /* @__PURE__ */ e(lt, { ...a });
1758
+ }
1759
+ const Xe = b.forwardRef(
1760
+ ({ className: a, type: t, ...r }, s) => /* @__PURE__ */ e(
1761
+ "input",
1762
+ {
1763
+ type: t,
1764
+ className: c(
1765
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1766
+ a
1767
+ ),
1768
+ ref: s,
1769
+ ...r
1770
+ }
1771
+ )
1772
+ );
1773
+ Xe.displayName = "Input";
1774
+ const ot = typeof process < "u" && process.env.NODE_ENV === "test";
1775
+ function it(a) {
1776
+ return a === "date" || a === "datetime-local" || a === "time";
1777
+ }
1778
+ const Ht = b.forwardRef(function({
1779
+ type: t = "text",
1780
+ value: r,
1781
+ defaultValue: s,
1782
+ onChange: l,
1783
+ onValueChange: o,
1784
+ min: d,
1785
+ max: m,
1786
+ locale: u,
1787
+ labels: f,
1788
+ clearable: k,
1789
+ minuteStep: N,
1790
+ popoverLayer: w,
1791
+ className: g,
1792
+ id: h,
1793
+ disabled: x,
1794
+ placeholder: v,
1795
+ "aria-label": p,
1796
+ name: _,
1797
+ ...C
1798
+ }, T) {
1799
+ if (ot)
1800
+ return /* @__PURE__ */ e("input", { ...C, ref: T, id: h, name: _, type: t, value: r, defaultValue: s, onChange: l, min: d, max: m, disabled: x, placeholder: v, "aria-label": p, className: g });
1801
+ if (!it(t))
1802
+ return /* @__PURE__ */ e(
1803
+ Xe,
1804
+ {
1805
+ ...C,
1806
+ ref: T,
1807
+ id: h,
1808
+ name: _,
1809
+ type: t,
1810
+ value: r,
1811
+ defaultValue: s,
1812
+ onChange: l,
1813
+ min: d,
1814
+ max: m,
1815
+ disabled: x,
1816
+ placeholder: v,
1817
+ "aria-label": p,
1818
+ className: g
1819
+ }
1820
+ );
1821
+ const E = String(r ?? s ?? ""), M = {
1822
+ id: h,
1823
+ value: E,
1824
+ onChange: (y) => {
1825
+ if (o?.(y), l) {
1826
+ const L = { value: y, name: _ || "", type: t };
1827
+ l({ target: L, currentTarget: L });
1828
+ }
1829
+ },
1830
+ disabled: x,
1831
+ placeholder: v,
1832
+ className: g,
1833
+ min: d == null ? void 0 : String(d),
1834
+ max: m == null ? void 0 : String(m),
1835
+ locale: u,
1836
+ labels: f,
1837
+ clearable: k,
1838
+ popoverLayer: w,
1839
+ "aria-label": p
1840
+ };
1841
+ if (t === "datetime-local") return /* @__PURE__ */ e(nt, { ...M, minuteStep: N });
1842
+ if (t === "time") {
1843
+ const { min: y, max: L, ...$ } = M;
1844
+ return /* @__PURE__ */ e(st, { ...$, minuteStep: N });
1845
+ }
1846
+ return /* @__PURE__ */ e(at, { ...M });
1847
+ });
1848
+ function qe({
1849
+ onValueChange: a,
1850
+ ...t
1851
+ }) {
1852
+ return /* @__PURE__ */ e(
1853
+ D.Root,
1854
+ {
1855
+ ...t,
1856
+ onValueChange: a ? (r) => {
1857
+ b.startTransition(() => {
1858
+ a(r);
1859
+ });
1860
+ } : void 0
1861
+ }
1862
+ );
1863
+ }
1864
+ qe.displayName = D.Root.displayName;
1865
+ const dt = D.Group, ct = D.Value, ea = b.forwardRef(({ className: a, children: t, ...r }, s) => /* @__PURE__ */ n(
1866
+ D.Trigger,
1867
+ {
1868
+ ref: s,
1869
+ className: c(
1870
+ "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1871
+ a
1872
+ ),
1873
+ ...r,
1874
+ children: [
1875
+ t,
1876
+ /* @__PURE__ */ e(D.Icon, { asChild: !0, children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4 opacity-50" }) })
1877
+ ]
1878
+ }
1879
+ ));
1880
+ ea.displayName = D.Trigger.displayName;
1881
+ const aa = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
1882
+ D.ScrollUpButton,
1883
+ {
1884
+ ref: r,
1885
+ className: c(
1886
+ "flex cursor-default items-center justify-center py-1",
1887
+ a
1888
+ ),
1889
+ ...t,
1890
+ children: /* @__PURE__ */ e(ga, { className: "h-4 w-4" })
1891
+ }
1892
+ ));
1893
+ aa.displayName = D.ScrollUpButton.displayName;
1894
+ const ta = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
1895
+ D.ScrollDownButton,
1896
+ {
1897
+ ref: r,
1898
+ className: c(
1899
+ "flex cursor-default items-center justify-center py-1",
1900
+ a
1901
+ ),
1902
+ ...t,
1903
+ children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4" })
1904
+ }
1905
+ ));
1906
+ ta.displayName = D.ScrollDownButton.displayName;
1907
+ const ra = b.forwardRef(({ className: a, children: t, position: r = "popper", ...s }, l) => /* @__PURE__ */ e(D.Portal, { children: /* @__PURE__ */ n(
1908
+ D.Content,
1909
+ {
1910
+ ref: l,
1911
+ className: c(
1912
+ `relative ${P.OVERLAY_POPOVER} max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden custom-scrollbar rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]`,
1913
+ r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1914
+ a
1915
+ ),
1916
+ position: r,
1917
+ onCloseAutoFocus: (o) => {
1918
+ o.preventDefault();
1919
+ },
1920
+ onEscapeKeyDown: (o) => {
1921
+ o.stopPropagation();
1922
+ },
1923
+ ...s,
1924
+ children: [
1925
+ /* @__PURE__ */ e(aa, {}),
1926
+ /* @__PURE__ */ e(
1927
+ D.Viewport,
1928
+ {
1929
+ className: c(
1930
+ "p-1",
1931
+ r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1932
+ ),
1933
+ children: t
1934
+ }
1935
+ ),
1936
+ /* @__PURE__ */ e(ta, {})
1937
+ ]
1938
+ }
1939
+ ) }));
1940
+ ra.displayName = D.Content.displayName;
1941
+ const na = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
1942
+ D.Label,
1943
+ {
1944
+ ref: r,
1945
+ className: c("px-2 py-1.5 text-sm font-semibold", a),
1946
+ ...t
1947
+ }
1948
+ ));
1949
+ na.displayName = D.Label.displayName;
1950
+ const la = b.forwardRef(({ className: a, children: t, ...r }, s) => /* @__PURE__ */ n(
1951
+ D.Item,
1952
+ {
1953
+ ref: s,
1954
+ className: c(
1955
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1956
+ a
1957
+ ),
1958
+ ...r,
1959
+ children: [
1960
+ /* @__PURE__ */ e("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(D.ItemIndicator, { children: /* @__PURE__ */ e(Re, { className: "h-4 w-4" }) }) }),
1961
+ /* @__PURE__ */ e(D.ItemText, { children: t })
1962
+ ]
1963
+ }
1964
+ ));
1965
+ la.displayName = D.Item.displayName;
1966
+ const mt = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
1967
+ D.Separator,
1968
+ {
1969
+ ref: r,
1970
+ className: c("-mx-1 my-1 h-px bg-muted", a),
1971
+ ...t
1972
+ }
1973
+ ));
1974
+ mt.displayName = D.Separator.displayName;
1975
+ const G = "__genispace_empty_selection__", ut = typeof process < "u" && process.env.NODE_ENV === "test";
1976
+ function ge(a) {
1977
+ const t = a.props.value ?? a.key ?? "";
1978
+ return String(t) || G;
1979
+ }
1980
+ function ft(a) {
1981
+ return ve.toArray(a).join("");
1982
+ }
1983
+ function xe(a) {
1984
+ const t = [];
1985
+ return ve.toArray(a).forEach((r, s) => {
1986
+ if (Ee(r)) {
1987
+ if (r.type === "option") {
1988
+ const l = r;
1989
+ t.push(
1990
+ /* @__PURE__ */ e(la, { value: ge(l), disabled: l.props.disabled, children: l.props.label || l.props.children }, r.key ?? `${ge(l)}-${s}`)
1991
+ );
1992
+ return;
1993
+ }
1994
+ if (r.type === "optgroup") {
1995
+ const l = r;
1996
+ t.push(
1997
+ /* @__PURE__ */ n(dt, { children: [
1998
+ l.props.label ? /* @__PURE__ */ e(na, { children: l.props.label }) : null,
1999
+ xe(l.props.children)
2000
+ ] }, r.key ?? `group-${s}`)
2001
+ );
2002
+ return;
2003
+ }
2004
+ t.push(...xe(r.props.children));
2005
+ }
2006
+ }), t;
2007
+ }
2008
+ function sa(a, t) {
2009
+ let r;
2010
+ return ve.forEach(a, (s) => {
2011
+ if (!(!Ee(s) || r)) {
2012
+ if (s.type === "option") {
2013
+ const l = s;
2014
+ ge(l) === (t || G) && (r = l.props.label || ft(l.props.children));
2015
+ return;
2016
+ }
2017
+ r = sa(s.props.children, t);
2018
+ }
2019
+ }), r;
2020
+ }
2021
+ function Ae(a) {
2022
+ return Array.isArray(a) ? a[0] : a;
2023
+ }
2024
+ function Wt({
2025
+ value: a,
2026
+ defaultValue: t,
2027
+ onChange: r,
2028
+ children: s,
2029
+ className: l,
2030
+ contentClassName: o,
2031
+ disabled: d,
2032
+ required: m,
2033
+ name: u,
2034
+ id: f,
2035
+ placeholder: k,
2036
+ "aria-label": N,
2037
+ "aria-describedby": w
2038
+ }) {
2039
+ if (ut)
2040
+ return /* @__PURE__ */ e(
2041
+ "select",
2042
+ {
2043
+ id: f,
2044
+ name: u,
2045
+ value: a,
2046
+ defaultValue: t,
2047
+ onChange: r,
2048
+ disabled: d,
2049
+ required: m,
2050
+ "aria-label": N,
2051
+ "aria-describedby": w,
2052
+ className: l,
2053
+ children: s
2054
+ }
2055
+ );
2056
+ const g = Ae(a), h = Ae(t), x = g == null ? void 0 : String(g) || G, v = h == null ? void 0 : String(h) || G, p = sa(s, x ?? v ?? "");
2057
+ return /* @__PURE__ */ n(
2058
+ qe,
2059
+ {
2060
+ value: x,
2061
+ defaultValue: v,
2062
+ disabled: d,
2063
+ required: m,
2064
+ name: u,
2065
+ onValueChange: (_) => {
2066
+ const C = _ === G ? "" : _;
2067
+ r?.({ target: { value: C, name: u || "" }, currentTarget: { value: C, name: u || "" } });
2068
+ },
2069
+ children: [
2070
+ /* @__PURE__ */ e(ea, { id: f, "aria-label": N, "aria-describedby": w, className: c("min-h-10", l), children: /* @__PURE__ */ e(ct, { placeholder: k || p, children: p }) }),
2071
+ /* @__PURE__ */ e(ra, { className: o, children: xe(s) })
2072
+ ]
2073
+ }
2074
+ );
2075
+ }
2076
+ const oa = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
2077
+ pe.Root,
2078
+ {
2079
+ ref: r,
2080
+ className: c(
2081
+ "peer h-4 w-4 shrink-0 rounded-sm border border-neutral-300 dark:border-neutral-700 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
2082
+ a
2083
+ ),
2084
+ ...t,
2085
+ children: /* @__PURE__ */ e(
2086
+ pe.Indicator,
2087
+ {
2088
+ className: c("flex items-center justify-center text-current"),
2089
+ children: /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" })
2090
+ }
2091
+ )
2092
+ }
2093
+ ));
2094
+ oa.displayName = pe.Root.displayName;
2095
+ const ht = typeof process < "u" && process.env.NODE_ENV === "test";
2096
+ function Ut({ checked: a, defaultChecked: t, onChange: r, className: s, disabled: l, required: o, name: d, value: m, id: u, "aria-label": f, "aria-describedby": k }) {
2097
+ return ht ? /* @__PURE__ */ e("input", { id: u, type: "checkbox", checked: a, defaultChecked: t, onChange: r, className: s, disabled: l, required: o, name: d, value: m, "aria-label": f, "aria-describedby": k }) : /* @__PURE__ */ e(
2098
+ oa,
2099
+ {
2100
+ id: u,
2101
+ checked: a,
2102
+ defaultChecked: t,
2103
+ disabled: l,
2104
+ required: o,
2105
+ name: d,
2106
+ value: m,
2107
+ "aria-label": f,
2108
+ "aria-describedby": k,
2109
+ className: s,
2110
+ onCheckedChange: (N) => {
2111
+ const w = N === !0;
2112
+ r?.({ target: { checked: w, name: d || "", value: String(m ?? "on") }, currentTarget: { checked: w, name: d || "", value: String(m ?? "on") } });
2113
+ }
2114
+ }
2115
+ );
2116
+ }
2117
+ const ia = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
2118
+ K.Root,
2119
+ {
2120
+ ref: r,
2121
+ className: c(
2122
+ "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
2123
+ a
2124
+ ),
2125
+ ...t
2126
+ }
2127
+ ));
2128
+ ia.displayName = K.Root.displayName;
2129
+ const da = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
2130
+ K.Image,
2131
+ {
2132
+ ref: r,
2133
+ className: c("aspect-square h-full w-full", a),
2134
+ ...t
2135
+ }
2136
+ ));
2137
+ da.displayName = K.Image.displayName;
2138
+ const ca = b.forwardRef(({ className: a, ...t }, r) => /* @__PURE__ */ e(
2139
+ K.Fallback,
2140
+ {
2141
+ ref: r,
2142
+ className: c(
2143
+ "flex h-full w-full items-center justify-center rounded-full bg-muted",
2144
+ a
2145
+ ),
2146
+ ...t
2147
+ }
2148
+ ));
2149
+ ca.displayName = K.Fallback.displayName;
2150
+ const _e = /[\u4e00-\u9fff]/;
2151
+ function pt(a, t) {
2152
+ const r = (a || "").trim(), s = (t || "").trim(), l = r || s;
2153
+ if (!l) return "?";
2154
+ const o = r && _e.test(r) ? r : s && _e.test(s) ? s : "";
2155
+ if (o)
2156
+ return Array.from(o.trim()).slice(0, 2).join("");
2157
+ const d = l.split(/\s+/).filter(Boolean);
2158
+ return d.length >= 2 ? (d[0].slice(0, 1) + d[1].slice(0, 1)).toUpperCase() : l.slice(0, 2).toUpperCase();
2159
+ }
2160
+ function bt({
2161
+ name: a,
2162
+ email: t,
2163
+ avatarUrl: r,
2164
+ sizeClassName: s = "size-6",
2165
+ className: l,
2166
+ variant: o = "default",
2167
+ shape: d = "circle"
2168
+ }) {
2169
+ const m = r != null ? String(r).trim() : "", u = !!m, f = d === "rounded" ? "rounded-lg" : "rounded-full";
2170
+ return /* @__PURE__ */ n(
2171
+ ia,
2172
+ {
2173
+ className: c(
2174
+ "shrink-0 overflow-hidden",
2175
+ f,
2176
+ o === "default" && "border border-border/50",
2177
+ o === "chatUser" && "ring-1 ring-border/50 bg-gradient-to-br from-blue-500 to-indigo-500 text-white font-semibold",
2178
+ s,
2179
+ l
2180
+ ),
2181
+ children: [
2182
+ u ? /* @__PURE__ */ e(da, { src: m, alt: "", className: "object-cover" }) : null,
2183
+ /* @__PURE__ */ e(
2184
+ ca,
2185
+ {
2186
+ className: c(
2187
+ f,
2188
+ "text-xs font-medium",
2189
+ o === "default" && "bg-accent/10",
2190
+ o === "chatUser" && "bg-transparent text-white font-semibold"
2191
+ ),
2192
+ children: pt(a, t)
2193
+ }
2194
+ )
2195
+ ]
2196
+ }
2197
+ );
2198
+ }
2199
+ function Kt({
2200
+ userId: a,
2201
+ profile: t,
2202
+ showAvatar: r = !1,
2203
+ className: s = "",
2204
+ emptyLabel: l = "—"
2205
+ }) {
2206
+ const o = Pe(t, a, l);
2207
+ return r ? /* @__PURE__ */ n("span", { className: `inline-flex items-center gap-2 ${s}`.trim(), children: [
2208
+ /* @__PURE__ */ e(
2209
+ bt,
2210
+ {
2211
+ name: t?.name || o,
2212
+ email: t?.email,
2213
+ avatarUrl: t?.avatarUrl,
2214
+ sizeClassName: "size-6"
2215
+ }
2216
+ ),
2217
+ /* @__PURE__ */ e("span", { title: a || void 0, children: o })
2218
+ ] }) : /* @__PURE__ */ e("span", { className: s, title: a || void 0, children: o });
2219
+ }
2220
+ const gt = "w-full rounded-lg border border-neutral-200 bg-white px-3 py-2 text-sm text-neutral-900 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40 dark:border-neutral-600 dark:bg-neutral-950 dark:text-neutral-50 disabled:cursor-not-allowed disabled:opacity-50";
2221
+ function Yt({
2222
+ value: a,
2223
+ onChange: t,
2224
+ members: r,
2225
+ allowEmpty: s = !0,
2226
+ emptyLabel: l = "—",
2227
+ placeholder: o,
2228
+ disabled: d = !1,
2229
+ className: m,
2230
+ id: u
2231
+ }) {
2232
+ return /* @__PURE__ */ n(
2233
+ "select",
2234
+ {
2235
+ id: u,
2236
+ className: m ?? gt,
2237
+ value: a,
2238
+ disabled: d,
2239
+ onChange: (f) => t(f.target.value),
2240
+ children: [
2241
+ s ? /* @__PURE__ */ e("option", { value: "", children: o ?? l }) : null,
2242
+ r.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: Pe(f) }, f.id))
2243
+ ]
2244
+ }
2245
+ );
2246
+ }
2247
+ function Gt(a, t) {
2248
+ const r = t?.memberStatus ?? "ACTIVE", [s, l] = F([]), [o, d] = F(!!a), [m, u] = F(null), f = fa(/* @__PURE__ */ new Map());
2249
+ H(() => {
2250
+ if (!a) {
2251
+ d(!1);
2252
+ return;
2253
+ }
2254
+ let w = !1;
2255
+ return d(!0), u(null), f.current.clear(), a.spaces.listMemberProfiles({ status: r }).then((g) => {
2256
+ if (w) return;
2257
+ l(g);
2258
+ const h = f.current;
2259
+ for (const x of g)
2260
+ h.set(x.id, x);
2261
+ }).catch((g) => {
2262
+ w || u(g instanceof Error ? g.message : "Failed to load team members");
2263
+ }).finally(() => {
2264
+ w || d(!1);
2265
+ }), () => {
2266
+ w = !0;
2267
+ };
2268
+ }, [a, r]);
2269
+ const k = he((w) => {
2270
+ if (w)
2271
+ return f.current.get(w);
2272
+ }, []), N = he(
2273
+ async (w) => {
2274
+ if (!a) return;
2275
+ const g = [...new Set(w.filter((h) => h && !f.current.has(h)))];
2276
+ if (g.length)
2277
+ try {
2278
+ const h = await a.users.getPublicProfiles(g);
2279
+ for (const x of h)
2280
+ f.current.set(x.id, x);
2281
+ l((x) => {
2282
+ const v = new Map(x.map((p) => [p.id, p]));
2283
+ for (const p of h)
2284
+ v.set(p.id, p);
2285
+ return [...v.values()];
2286
+ });
2287
+ } catch {
2288
+ }
2289
+ },
2290
+ [a]
2291
+ );
2292
+ return ha(
2293
+ () => ({
2294
+ loading: o,
2295
+ error: m,
2296
+ members: s,
2297
+ getProfile: k,
2298
+ resolveMany: N
2299
+ }),
2300
+ [o, m, s, k, N]
2301
+ );
2302
+ }
2303
+ export {
2304
+ Rt as $,
2305
+ Ut as A,
2306
+ A as B,
2307
+ Sa as C,
2308
+ Da as D,
2309
+ Ue as E,
2310
+ Ta as F,
2311
+ Aa as G,
2312
+ Ke as H,
2313
+ Ze as I,
2314
+ le as J,
2315
+ Za as K,
2316
+ La as L,
2317
+ Ge as M,
2318
+ Pt as N,
2319
+ Ie as O,
2320
+ Oa as P,
2321
+ Ra as Q,
2322
+ Be as R,
2323
+ i as S,
2324
+ Ce as T,
2325
+ Kt as U,
2326
+ $e as V,
2327
+ Le as W,
2328
+ je as X,
2329
+ $a as Y,
2330
+ P as Z,
2331
+ Ve as _,
2332
+ Vt as a,
2333
+ Lt as a0,
2334
+ Xe as a1,
2335
+ $t as a2,
2336
+ Bt as a3,
2337
+ qe as a4,
2338
+ ra as a5,
2339
+ dt as a6,
2340
+ la as a7,
2341
+ na as a8,
2342
+ ta as a9,
2343
+ aa,
2344
+ mt as ab,
2345
+ ea as ac,
2346
+ ct as ad,
2347
+ zt as ae,
2348
+ Ha as af,
2349
+ Mt as ag,
2350
+ be as ah,
2351
+ Ot as b,
2352
+ at as c,
2353
+ Ft as d,
2354
+ nt as e,
2355
+ It as f,
2356
+ jt as g,
2357
+ Tt as h,
2358
+ Wt as i,
2359
+ Et as j,
2360
+ Ht as k,
2361
+ st as l,
2362
+ Ea as m,
2363
+ Yt as n,
2364
+ Z as o,
2365
+ it as p,
2366
+ I as q,
2367
+ se as r,
2368
+ oe as s,
2369
+ de as t,
2370
+ Gt as u,
2371
+ Q as v,
2372
+ oa as w,
2373
+ Va as x,
2374
+ He as y,
2375
+ We as z
2376
+ };
2377
+ //# sourceMappingURL=useUserDirectory-CqkyCQoR.js.map