@burdenoff/fe-libs 2026.527.2 → 2026.527.4

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 (161) hide show
  1. package/dist/button/Button.js +18 -16
  2. package/dist/chrome/AccountSwitcher.js +10 -7
  3. package/dist/chrome/AutoBreadcrumbs.js +2 -0
  4. package/dist/chrome/Breadcrumbs.js +2 -0
  5. package/dist/chrome/CommandPalette.js +5 -3
  6. package/dist/chrome/ContextSwitcher.js +90 -338
  7. package/dist/chrome/DynamicFooter.js +7 -7
  8. package/dist/chrome/Footer.js +5 -5
  9. package/dist/chrome/GeographySwitcher.js +3 -3
  10. package/dist/chrome/GlobalSearch.js +73 -448
  11. package/dist/chrome/HeaderBar.js +6 -1
  12. package/dist/chrome/LanguagePickerSheet.js +1 -1
  13. package/dist/chrome/LanguageSwitcher.js +2 -2
  14. package/dist/chrome/NotificationCenter.js +69 -694
  15. package/dist/chrome/PanelTabs.js +7 -4
  16. package/dist/chrome/PluginContextMenuTarget.js +1 -1
  17. package/dist/chrome/ProductPickerSheet.js +4 -4
  18. package/dist/chrome/ProductSideNav.js +1 -1
  19. package/dist/chrome/ProductSwitcher.js +3 -3
  20. package/dist/chrome/ProfileSwitcher.js +13 -8
  21. package/dist/chrome/ShortcutHelpDialog.js +2 -1
  22. package/dist/chrome/SideNavigation.js +75 -239
  23. package/dist/chrome/Sidebar.js +1 -0
  24. package/dist/chrome/contextSwitcher/EmptyState.js +32 -0
  25. package/dist/chrome/contextSwitcher/OrganizationList.js +34 -0
  26. package/dist/chrome/contextSwitcher/ProjectList.js +34 -0
  27. package/dist/chrome/contextSwitcher/SearchInput.js +50 -0
  28. package/dist/chrome/contextSwitcher/TabButton.js +9 -0
  29. package/dist/chrome/contextSwitcher/TriggerButton.js +38 -0
  30. package/dist/chrome/contextSwitcher/WorkspaceList.js +34 -0
  31. package/dist/chrome/contextSwitcher/icons.js +58 -0
  32. package/dist/chrome/contextSwitcher/useIsMobile.js +11 -0
  33. package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +253 -0
  34. package/dist/chrome/globalSearch/CategoryTabs.js +28 -0
  35. package/dist/chrome/globalSearch/ResultsList.js +58 -0
  36. package/dist/chrome/globalSearch/SearchInput.js +28 -0
  37. package/dist/chrome/globalSearch/SearchModeBar.js +36 -0
  38. package/dist/chrome/globalSearch/useAdvancedFilters.js +78 -0
  39. package/dist/chrome/globalSearch/utils.js +22 -0
  40. package/dist/chrome/notificationCenter/BellButton.js +27 -0
  41. package/dist/chrome/notificationCenter/NotificationCardItem.js +129 -0
  42. package/dist/chrome/notificationCenter/NotificationFilters.js +67 -0
  43. package/dist/chrome/notificationCenter/NotificationFooter.js +23 -0
  44. package/dist/chrome/notificationCenter/NotificationHeader.js +75 -0
  45. package/dist/chrome/notificationCenter/NotificationList.js +75 -0
  46. package/dist/chrome/notificationCenter/NotificationPanel.js +19 -0
  47. package/dist/chrome/notificationCenter/SkeletonCard.js +18 -0
  48. package/dist/chrome/notificationCenter/constants.js +93 -0
  49. package/dist/chrome/notificationCenter/gql.js +58 -0
  50. package/dist/chrome/notificationCenter/useNotificationCenter.js +149 -0
  51. package/dist/chrome/notificationCenter/usePanelChrome.js +36 -0
  52. package/dist/chrome/sideNavigation/CollapseToggle.js +29 -0
  53. package/dist/chrome/sideNavigation/MobileActionsBar.js +25 -0
  54. package/dist/chrome/sideNavigation/NavItemRenderer.js +79 -0
  55. package/dist/chrome/sideNavigation/SidebarHeader.js +29 -0
  56. package/dist/chrome/sideNavigation/helpers.js +19 -0
  57. package/dist/chrome/sideNavigation/useSideNavigationState.js +45 -0
  58. package/dist/form/Checkbox.js +17 -15
  59. package/dist/form/FormDescription.js +9 -10
  60. package/dist/form/FormField.js +11 -12
  61. package/dist/form/FormLabel.js +13 -13
  62. package/dist/form/FormMessage.js +10 -11
  63. package/dist/form/Input.js +11 -10
  64. package/dist/form/Radio.js +25 -21
  65. package/dist/form/Select.js +81 -66
  66. package/dist/form/Textarea.js +10 -9
  67. package/dist/shared/components/AccessDenied.js +8 -4
  68. package/dist/shared/components/AppErrorBoundary.js +2 -0
  69. package/dist/shared/components/ContextConversationWidget.js +173 -767
  70. package/dist/shared/components/ErrorFallback.js +3 -0
  71. package/dist/shared/components/PWAInstallBanner.js +8 -4
  72. package/dist/shared/components/RequireAuth.js +4 -4
  73. package/dist/shared/components/SSORedirectGuard.js +1 -1
  74. package/dist/shared/components/contextConversationWidget/Composer.js +66 -0
  75. package/dist/shared/components/contextConversationWidget/MessageItem.js +124 -0
  76. package/dist/shared/components/contextConversationWidget/MessageList.js +32 -0
  77. package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +19 -0
  78. package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +28 -0
  79. package/dist/shared/components/contextConversationWidget/ReplyBanner.js +32 -0
  80. package/dist/shared/components/contextConversationWidget/WidgetHeader.js +70 -0
  81. package/dist/shared/components/contextConversationWidget/queries.js +197 -0
  82. package/dist/shared/components/contextConversationWidget/types.js +10 -0
  83. package/dist/shared/components/contextConversationWidget/useAttachmentUpload.js +57 -0
  84. package/dist/shared/components/contextConversationWidget/useConversationSubscriptions.js +26 -0
  85. package/dist/shared/components/contextConversationWidget/useMessageActions.js +34 -0
  86. package/dist/shared/components/contextConversationWidget/useSendMessage.js +45 -0
  87. package/dist/shared/components/contextConversationWidget/useWidgetMessages.js +44 -0
  88. package/dist/shared/components/contextConversationWidget/utils.js +56 -0
  89. package/dist/shared/feature-flags/FeatureFlagProvider.js +21 -21
  90. package/dist/shared/geography/GeographyProvider.js +20 -20
  91. package/dist/shared/graphql/GatewayContext.js +1 -1
  92. package/dist/shared/motion/MotionList.js +1 -1
  93. package/dist/shared/pages/AiPage.js +3 -3
  94. package/dist/shared/pages/SearchPage.js +293 -1071
  95. package/dist/shared/pages/searchPage/ActiveFilterChips.js +176 -0
  96. package/dist/shared/pages/searchPage/FiltersPanel.js +329 -0
  97. package/dist/shared/pages/searchPage/ResultsList.js +119 -0
  98. package/dist/shared/pages/searchPage/ResultsStatus.js +32 -0
  99. package/dist/shared/pages/searchPage/SearchInput.js +31 -0
  100. package/dist/shared/pages/searchPage/SearchPagination.js +37 -0
  101. package/dist/shared/pages/searchPage/SearchToolbar.js +58 -0
  102. package/dist/shared/pages/searchPage/constants.js +155 -0
  103. package/dist/shared/pages/searchPage/utils.js +24 -0
  104. package/dist/shared/plugins/PluginRuntimeProvider.js +1 -1
  105. package/dist/shared/providers/shell/ActiveContextProvider.js +12 -12
  106. package/dist/shared/providers/shell/AppShellContext.js +1 -1
  107. package/dist/shared/providers/shell/AuthProvider.js +130 -384
  108. package/dist/shared/providers/shell/AuthTokenProvider.js +6 -6
  109. package/dist/shared/providers/shell/ContextManagerProvider.js +1 -1
  110. package/dist/shared/providers/shell/FeatureFlagsProvider.js +5 -5
  111. package/dist/shared/providers/shell/GlobalUiProvider.js +17 -17
  112. package/dist/shared/providers/shell/I18nProvider.js +15 -15
  113. package/dist/shared/providers/shell/PageConversationContextProvider.js +14 -14
  114. package/dist/shared/providers/shell/PermissionProvider.js +16 -16
  115. package/dist/shared/providers/shell/ShellUiProvider.js +13 -13
  116. package/dist/shared/providers/shell/ThemeProvider.js +9 -9
  117. package/dist/shared/providers/shell/authProvider/bridgeStateSync.js +34 -0
  118. package/dist/shared/providers/shell/authProvider/jwt.js +13 -0
  119. package/dist/shared/providers/shell/authProvider/ssoRelay.js +38 -0
  120. package/dist/shared/providers/shell/authProvider/useAuthActions.js +170 -0
  121. package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +86 -0
  122. package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +32 -0
  123. package/dist/shared/providers/shell/authProvider/useStorageSync.js +35 -0
  124. package/dist/shared/providers/shell/authProvider/useTokenExpiryTimer.js +37 -0
  125. package/dist/shared/tours/TourPlayer.js +1 -0
  126. package/dist/shared/tours/TourPlayerProvider.js +1 -1
  127. package/dist/shared/tours/TourTooltip.js +3 -0
  128. package/dist/shared/tours/TourTrigger.js +86 -259
  129. package/dist/shared/tours/ToursContext.js +108 -398
  130. package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +48 -0
  131. package/dist/shared/tours/tourTrigger/MobileTourSheet.js +68 -0
  132. package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +36 -0
  133. package/dist/shared/tours/tourTrigger/TourListItemMobile.js +47 -0
  134. package/dist/shared/tours/tourTrigger/TourStatusChip.js +30 -0
  135. package/dist/shared/tours/tourTrigger/TourTriggerButton.js +22 -0
  136. package/dist/shared/tours/toursContext/errors.js +18 -0
  137. package/dist/shared/tours/toursContext/gql.js +152 -0
  138. package/dist/shared/tours/toursContext/route.js +20 -0
  139. package/dist/shared/tours/toursContext/session.js +19 -0
  140. package/dist/shared/tours/toursContext/useIdleReady.js +18 -0
  141. package/dist/shared/tours/toursContext/useTourMutations.js +118 -0
  142. package/dist/shared-events.js +3 -3
  143. package/dist/shared-hooks.js +1 -1
  144. package/dist/storage/SaveToFilesButton.js +3 -3
  145. package/dist/storage/SaveToFilesDialog.js +1 -1
  146. package/dist/tag/TagBadge.js +1 -1
  147. package/dist/tag/TagsWidget.js +81 -226
  148. package/dist/tag/tagsWidget/AddTagTrigger.js +14 -0
  149. package/dist/tag/tagsWidget/TagBadgeList.js +17 -0
  150. package/dist/tag/tagsWidget/TagSearchPopover.js +80 -0
  151. package/dist/tag/tagsWidget/operations.js +64 -0
  152. package/dist/tag/tagsWidget/useVocabResolver.js +30 -0
  153. package/dist/ui/card.js +44 -39
  154. package/dist/ui/dropdown-menu.js +82 -66
  155. package/dist/ui/input.js +10 -10
  156. package/dist/ui/label.js +13 -11
  157. package/dist/ui/select.js +80 -66
  158. package/dist/ui/table.js +61 -54
  159. package/dist/ui/textarea.js +9 -9
  160. package/dist/ui/tooltip.js +13 -11
  161. package/package.json +1 -1
@@ -1,1142 +1,364 @@
1
1
  import { useActiveContext as e } from "../providers/shell/ActiveContextProvider.js";
2
2
  import { useShellNavigate as t } from "../utils/appHelpers.js";
3
3
  import { useGlobalSearch as n } from "../hooks/shell/useGlobalSearch.js";
4
- import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
5
- import { ArrowUpDown as ee, Calendar as s, CheckSquare as te, ChevronDown as ne, ChevronLeft as re, ChevronRight as ie, ChevronUp as ae, Clock as oe, File as c, FileText as l, FolderKanban as u, LayoutGrid as d, Loader2 as se, MessageSquare as f, Plus as ce, Search as p, Server as m, SlidersHorizontal as le, Tag as h, Terminal as g, Users as _, X as v } from "lucide-react";
6
- import { Fragment as ue, jsx as y, jsxs as b } from "react/jsx-runtime";
7
- import { useSearchParams as de } from "react-router-dom";
4
+ import { EMPTY_METADATA_CONDITION as r, ENTITY_TYPE_ICONS as i, ENTITY_TYPE_OPTIONS as a, PRODUCT_OPTIONS as ee } from "./searchPage/constants.js";
5
+ import { normalizeMetadataConditions as te, safeParseJson as ne, serializeCsv as o, splitCsv as s } from "./searchPage/utils.js";
6
+ import { SearchInput as re } from "./searchPage/SearchInput.js";
7
+ import { SearchToolbar as ie } from "./searchPage/SearchToolbar.js";
8
+ import { FiltersPanel as ae } from "./searchPage/FiltersPanel.js";
9
+ import { ActiveFilterChips as oe } from "./searchPage/ActiveFilterChips.js";
10
+ import { ResultsStatus as se } from "./searchPage/ResultsStatus.js";
11
+ import { ResultsList as ce } from "./searchPage/ResultsList.js";
12
+ import { SearchPagination as le } from "./searchPage/SearchPagination.js";
13
+ import { useCallback as ue, useEffect as de, useMemo as c, useState as l } from "react";
14
+ import { FileText as fe } from "lucide-react";
15
+ import { jsx as u, jsxs as pe } from "react/jsx-runtime";
16
+ import { useSearchParams as me } from "react-router-dom";
8
17
  //#region src/shared/pages/SearchPage.tsx
9
- var fe = {
10
- UniversalTag: h,
11
- TagVocabulary: h,
12
- tag: h,
13
- document: l,
14
- file: c,
15
- page: l,
16
- member: _,
17
- user: _,
18
- "calendar-event": s,
19
- meeting: s,
20
- project: u,
21
- conversation: f,
22
- thread: f,
23
- task: te,
24
- projects: u,
25
- workspaces: d,
26
- workspace: d,
27
- docs: l,
28
- tags: h,
29
- members: _,
30
- calendar: s,
31
- conversations: f,
32
- tasks: te,
33
- Agent: m,
34
- agent: m,
35
- agents: m,
36
- Vibe: u,
37
- vibe: u,
38
- vibes: u,
39
- Session: g,
40
- session: g,
41
- sessions: g,
42
- Note: l,
43
- note: l,
44
- notes: l,
45
- Target: m,
46
- target: m,
47
- targets: m
48
- }, pe = {
49
- PARTIAL: {
50
- label: "Partial",
51
- description: "Matches prefixes and substrings (autocomplete)"
52
- },
53
- FULLTEXT: {
54
- label: "Full-text",
55
- description: "BM25 word matching with stemming"
56
- },
57
- EXACT: {
58
- label: "Exact",
59
- description: "All search terms must appear exactly"
60
- }
61
- }, me = [
62
- {
63
- value: "SCORE_DESC",
64
- label: "Relevance"
65
- },
66
- {
67
- value: "CREATED_DESC",
68
- label: "Newest first"
69
- },
70
- {
71
- value: "CREATED_ASC",
72
- label: "Oldest first"
73
- },
74
- {
75
- value: "UPDATED_DESC",
76
- label: "Recently updated"
77
- },
78
- {
79
- value: "UPDATED_ASC",
80
- label: "Least recently updated"
81
- },
82
- {
83
- value: "TITLE_ASC",
84
- label: "Title A-Z"
85
- },
86
- {
87
- value: "TITLE_DESC",
88
- label: "Title Z-A"
89
- }
90
- ], he = [
91
- {
92
- value: "workspace",
93
- label: "Workspaces"
94
- },
95
- {
96
- value: "project",
97
- label: "Projects"
98
- },
99
- {
100
- value: "member",
101
- label: "Members"
102
- },
103
- {
104
- value: "user",
105
- label: "Users"
106
- },
107
- {
108
- value: "UniversalTag",
109
- label: "Tags"
110
- },
111
- {
112
- value: "TagVocabulary",
113
- label: "Vocabularies"
114
- },
115
- {
116
- value: "document",
117
- label: "Documents"
118
- },
119
- {
120
- value: "file",
121
- label: "Files"
122
- },
123
- {
124
- value: "task",
125
- label: "Tasks"
126
- },
127
- {
128
- value: "calendar-event",
129
- label: "Calendar Events"
130
- },
131
- {
132
- value: "conversation",
133
- label: "Conversations"
134
- },
135
- {
136
- value: "Agent",
137
- label: "Agents"
138
- },
139
- {
140
- value: "Vibe",
141
- label: "Vibes"
142
- },
143
- {
144
- value: "Session",
145
- label: "Sessions"
146
- },
147
- {
148
- value: "Note",
149
- label: "Notes"
150
- },
151
- {
152
- value: "Target",
153
- label: "Targets"
154
- }
155
- ], ge = [], x = 20, _e = {
156
- key: "",
157
- value: "",
158
- operator: "EQUALS"
159
- };
160
- function S(e) {
161
- return e.split(",").map((e) => e.trim()).filter(Boolean);
162
- }
163
- function C(e) {
164
- return e.length > 0 ? e.join(",") : void 0;
165
- }
166
- function ve(e, t) {
167
- if (!e) return t;
168
- try {
169
- return JSON.parse(e);
170
- } catch {
171
- return t;
172
- }
173
- }
174
- function ye(e) {
175
- return (e ?? []).filter((e) => e.key?.trim() || e.value?.trim()).map((e) => ({
176
- key: e.key ?? "",
177
- value: e.value ?? "",
178
- operator: e.operator ?? "EQUALS"
179
- }));
180
- }
181
- function be({ entityTypeOptions: s = he, entityTypeIcons: te = fe, productOptions: c = ge, defaultProductSources: u = [], placeholder: d = "Search for documents, tags, projects, tasks...", subtitle: f = "Search across all entities in your workspace", supplementalSearch: m } = {}) {
182
- let h = t(), [g, _] = de(), { workspaceId: be } = e(), { searchFull: xe, isSearching: w } = n(), Se = g.get("q") || "", Ce = g.get("mode") || "FULLTEXT", we = g.get("sortBy") || "SCORE_DESC", Te = S(g.get("types") || ""), Ee = S(g.get("excludeTypes") || ""), De = S(g.get("products") || ""), Oe = g.get("createdBy") || "", ke = g.get("updatedBy") || "", Ae = g.get("projectId") || "", je = g.get("from") || "", Me = g.get("to") || "", Ne = g.get("updatedFrom") || "", Pe = g.get("updatedTo") || "", Fe = S(g.get("excludeIds") || ""), T = ve(g.get("tagFilter"), {}), Ie = ye(ve(g.get("metadataConditions"), [])), Le = parseInt(g.get("page") || "1", 10), [E, Re] = o(Se), [D, ze] = o(Ce), [O, Be] = o(we), [k, Ve] = o(Te), [A, He] = o(Ee), [j, Ue] = o(De.length > 0 ? De : u), [M, N] = o(Oe), [P, F] = o(ke), [I, We] = o(Ae), [L, Ge] = o(je), [R, Ke] = o(Me), [z, qe] = o(Ne), [B, Je] = o(Pe), [Ye, Xe] = o(Fe.join(", ")), [Ze, Qe] = o((T.tagIds ?? []).join(", ")), [$e, et] = o((T.tagKeys ?? []).join(", ")), [tt, nt] = o((T.hierarchyPaths ?? []).join(", ")), [rt, it] = o((T.vocabularyKeys ?? []).join(", ")), [at, ot] = o(T.matchAll ?? !1), [st, ct] = o(T.includeDescendants ?? !0), [V, lt] = o(T.depth === void 0 ? "" : String(T.depth)), [H, U] = o(Ie), [W, G] = o(Le), [K, ut] = o([]), [dt, ft] = o(0), [pt, mt] = o(!1), [ht, gt] = o(0), [_t, vt] = o(), [yt, q] = o(null), [J, bt] = o(!1), [xt, St] = o(Se), Ct = r((e) => {
183
- let t = new URLSearchParams(g);
18
+ function d({ entityTypeOptions: d = a, entityTypeIcons: he = i, productOptions: ge = ee, defaultProductSources: _e = [], placeholder: ve = "Search for documents, tags, projects, tasks...", subtitle: ye = "Search across all entities in your workspace", supplementalSearch: f } = {}) {
19
+ let be = t(), [p, xe] = me(), { workspaceId: Se } = e(), { searchFull: Ce, isSearching: we } = n(), Te = p.get("q") || "", Ee = p.get("mode") || "FULLTEXT", De = p.get("sortBy") || "SCORE_DESC", Oe = s(p.get("types") || ""), ke = s(p.get("excludeTypes") || ""), Ae = s(p.get("products") || ""), je = p.get("createdBy") || "", Me = p.get("updatedBy") || "", Ne = p.get("projectId") || "", Pe = p.get("from") || "", Fe = p.get("to") || "", Ie = p.get("updatedFrom") || "", Le = p.get("updatedTo") || "", Re = s(p.get("excludeIds") || ""), m = ne(p.get("tagFilter"), {}), ze = te(ne(p.get("metadataConditions"), [])), Be = parseInt(p.get("page") || "1", 10), [h, Ve] = l(Te), [g, He] = l(Ee), [_, Ue] = l(De), [v, We] = l(Oe), [y, Ge] = l(ke), [b, Ke] = l(Ae.length > 0 ? Ae : _e), [x, qe] = l(je), [S, Je] = l(Me), [C, Ye] = l(Ne), [w, Xe] = l(Pe), [T, E] = l(Fe), [D, O] = l(Ie), [k, Ze] = l(Le), [A, j] = l(Re.join(", ")), [M, N] = l((m.tagIds ?? []).join(", ")), [P, F] = l((m.tagKeys ?? []).join(", ")), [I, L] = l((m.hierarchyPaths ?? []).join(", ")), [R, z] = l((m.vocabularyKeys ?? []).join(", ")), [B, V] = l(m.matchAll ?? !1), [H, U] = l(m.includeDescendants ?? !0), [W, G] = l(m.depth === void 0 ? "" : String(m.depth)), [K, q] = l(ze), [J, Y] = l(Be), [Qe, $e] = l([]), [et, tt] = l(0), [nt, rt] = l(!1), [it, at] = l(0), [ot, st] = l(), [ct, X] = l(null), [lt, ut] = l(!1), [dt, ft] = l(Te), pt = ue((e) => {
20
+ let t = new URLSearchParams(p);
184
21
  Object.entries(e).forEach(([e, n]) => {
185
22
  n ? t.set(e, n) : t.delete(e);
186
- }), _(t, { replace: !0 });
187
- }, [g, _]), Y = a(() => S(Ye), [Ye]), X = a(() => H.filter((e) => e.key.trim() && e.value.trim()), [H]), Z = a(() => {
188
- let e = S(Ze), t = S($e), n = S(tt), r = S(rt), i = V.trim() ? Number(V.trim()) : void 0;
23
+ }), xe(t, { replace: !0 });
24
+ }, [p, xe]), Z = c(() => s(A), [A]), Q = c(() => K.filter((e) => e.key.trim() && e.value.trim()), [K]), $ = c(() => {
25
+ let e = s(M), t = s(P), n = s(I), r = s(R), i = W.trim() ? Number(W.trim()) : void 0;
189
26
  if (e.length > 0 || t.length > 0 || n.length > 0 || r.length > 0) return {
190
27
  tagIds: e.length > 0 ? e : void 0,
191
28
  tagKeys: t.length > 0 ? t : void 0,
192
29
  hierarchyPaths: n.length > 0 ? n : void 0,
193
30
  vocabularyKeys: r.length > 0 ? r : void 0,
194
- matchAll: at,
195
- includeDescendants: st,
31
+ matchAll: B,
32
+ includeDescendants: H,
196
33
  depth: i !== void 0 && Number.isFinite(i) ? i : void 0
197
34
  };
198
35
  }, [
199
- st,
200
- V,
201
- Ze,
202
- $e,
203
- at,
204
- tt,
205
- rt
206
- ]), wt = r(() => {
36
+ H,
37
+ W,
38
+ M,
39
+ P,
40
+ B,
41
+ I,
42
+ R
43
+ ]), mt = ue(() => {
207
44
  let e = {
208
- searchMode: D,
209
- sortBy: O,
210
- limit: x,
211
- offset: (W - 1) * x
45
+ searchMode: g,
46
+ sortBy: _,
47
+ limit: 20,
48
+ offset: (J - 1) * 20
212
49
  };
213
- return k.length > 0 && (e.entityTypes = k), A.length > 0 && (e.excludeEntityTypes = A), j.length > 0 && (e.productSources = j), I.trim() && (e.projectId = I.trim()), M.trim() && (e.createdBy = M.trim()), P.trim() && (e.updatedBy = P.trim()), (L || R) && (e.dateRange = {}, L && (e.dateRange.from = new Date(L).toISOString()), R && (e.dateRange.to = new Date(R).toISOString())), (z || B) && (e.updatedDateRange = {}, z && (e.updatedDateRange.from = new Date(z).toISOString()), B && (e.updatedDateRange.to = new Date(B).toISOString())), Y.length > 0 && (e.excludeIds = Y), X.length > 0 && (e.metadataConditions = X), Z && (e.tagFilter = Z), e;
50
+ return v.length > 0 && (e.entityTypes = v), y.length > 0 && (e.excludeEntityTypes = y), b.length > 0 && (e.productSources = b), C.trim() && (e.projectId = C.trim()), x.trim() && (e.createdBy = x.trim()), S.trim() && (e.updatedBy = S.trim()), (w || T) && (e.dateRange = {}, w && (e.dateRange.from = new Date(w).toISOString()), T && (e.dateRange.to = new Date(T).toISOString())), (D || k) && (e.updatedDateRange = {}, D && (e.updatedDateRange.from = new Date(D).toISOString()), k && (e.updatedDateRange.to = new Date(k).toISOString())), Z.length > 0 && (e.excludeIds = Z), Q.length > 0 && (e.metadataConditions = Q), $ && (e.tagFilter = $), e;
214
51
  }, [
52
+ $,
53
+ x,
54
+ w,
55
+ T,
56
+ y,
215
57
  Z,
216
- M,
217
- L,
218
- R,
219
- A,
220
- Y,
221
- X,
58
+ Q,
59
+ g,
60
+ _,
61
+ J,
62
+ C,
63
+ v,
64
+ b,
65
+ S,
222
66
  D,
223
- O,
224
- W,
225
- I,
226
- k,
227
- j,
228
- P,
229
- z,
230
- B
231
- ]), Tt = r(async () => {
232
- if (!E.trim()) {
233
- ut([]), ft(0), mt(!1), gt(0), vt(void 0), q(null);
67
+ k
68
+ ]), ht = ue(async () => {
69
+ if (!h.trim()) {
70
+ $e([]), tt(0), rt(!1), at(0), st(void 0), X(null);
234
71
  return;
235
72
  }
236
- if (!be) {
237
- q("No workspace selected. Please select a workspace to search.");
73
+ if (!Se) {
74
+ X("No workspace selected. Please select a workspace to search.");
238
75
  return;
239
76
  }
240
- q(null);
77
+ X(null);
241
78
  let e = performance.now();
242
79
  try {
243
- let t = wt(), n = await xe(E, void 0, t), r = performance.now(), i = m && n.results.length === 0 ? await m(E, t) : [], a = n.results.length > 0 ? n.results : i;
244
- ut(a), ft(a.length > 0 ? a.length : n.total), mt(n.hasMore), vt(n.facets), gt(n.searchTimeMs ?? Math.round(r - e));
80
+ let t = mt(), n = await Ce(h, void 0, t), r = performance.now(), i = f && n.results.length === 0 ? await f(h, t) : [], a = n.results.length > 0 ? n.results : i;
81
+ $e(a), tt(a.length > 0 ? a.length : n.total), rt(n.hasMore), st(n.facets), at(n.searchTimeMs ?? Math.round(r - e));
245
82
  } catch (e) {
246
- q(e instanceof Error ? e.message : "Search failed"), ut([]), ft(0), vt(void 0);
83
+ X(e instanceof Error ? e.message : "Search failed"), $e([]), tt(0), st(void 0);
247
84
  }
248
85
  }, [
249
- E,
250
- be,
251
- xe,
252
- wt,
253
- m
86
+ h,
87
+ Se,
88
+ Ce,
89
+ mt,
90
+ f
254
91
  ]);
255
- i(() => {
256
- Tt();
257
- }, [Tt]), i(() => {
258
- Ct({
259
- q: E || void 0,
260
- mode: D === "FULLTEXT" ? void 0 : D,
261
- sortBy: O === "SCORE_DESC" ? void 0 : O,
262
- types: C(k),
263
- excludeTypes: C(A),
264
- products: C(j),
265
- createdBy: M || void 0,
266
- updatedBy: P || void 0,
267
- projectId: I || void 0,
268
- from: L || void 0,
269
- to: R || void 0,
270
- updatedFrom: z || void 0,
271
- updatedTo: B || void 0,
272
- excludeIds: C(Y),
273
- tagFilter: Z ? JSON.stringify(Z) : void 0,
274
- metadataConditions: X.length > 0 ? JSON.stringify(X) : void 0,
275
- page: W > 1 ? String(W) : void 0
92
+ de(() => {
93
+ ht();
94
+ }, [ht]), de(() => {
95
+ pt({
96
+ q: h || void 0,
97
+ mode: g === "FULLTEXT" ? void 0 : g,
98
+ sortBy: _ === "SCORE_DESC" ? void 0 : _,
99
+ types: o(v),
100
+ excludeTypes: o(y),
101
+ products: o(b),
102
+ createdBy: x || void 0,
103
+ updatedBy: S || void 0,
104
+ projectId: C || void 0,
105
+ from: w || void 0,
106
+ to: T || void 0,
107
+ updatedFrom: D || void 0,
108
+ updatedTo: k || void 0,
109
+ excludeIds: o(Z),
110
+ tagFilter: $ ? JSON.stringify($) : void 0,
111
+ metadataConditions: Q.length > 0 ? JSON.stringify(Q) : void 0,
112
+ page: J > 1 ? String(J) : void 0
276
113
  });
277
114
  }, [
115
+ $,
116
+ x,
117
+ w,
118
+ T,
119
+ y,
278
120
  Z,
279
- M,
280
- L,
281
- R,
282
- A,
283
- Y,
284
- X,
285
- E,
286
- I,
121
+ Q,
122
+ h,
123
+ C,
124
+ g,
125
+ _,
126
+ v,
127
+ b,
128
+ J,
129
+ S,
287
130
  D,
288
- O,
289
131
  k,
290
- j,
291
- W,
292
- P,
293
- z,
294
- B,
295
- Ct
132
+ pt
296
133
  ]);
297
- let Et = (e) => {
298
- e.preventDefault(), Re(xt), G(1);
299
- }, Dt = (e) => {
300
- Ve((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), G(1);
301
- }, Ot = (e) => {
302
- He((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), G(1);
303
- }, kt = () => {
304
- U((e) => [...e, { ..._e }]);
305
- }, At = (e, t) => {
306
- U((n) => n.map((n, r) => r === e ? {
134
+ let gt = (e) => {
135
+ e.preventDefault(), Ve(dt), Y(1);
136
+ }, _t = (e) => {
137
+ We((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), Y(1);
138
+ }, vt = (e) => {
139
+ Ge((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), Y(1);
140
+ }, yt = () => {
141
+ q((e) => [...e, { ...r }]);
142
+ }, bt = (e, t) => {
143
+ q((n) => n.map((n, r) => r === e ? {
307
144
  ...n,
308
145
  ...t
309
- } : n)), G(1);
310
- }, jt = (e) => {
311
- U((t) => t.filter((t, n) => n !== e)), G(1);
312
- }, Mt = () => {
313
- ze("FULLTEXT"), Be("SCORE_DESC"), Ve([]), He([]), Ue([]), N(""), F(""), We(""), Ge(""), Ke(""), qe(""), Je(""), Xe(""), Qe(""), et(""), nt(""), it(""), ot(!1), ct(!0), lt(""), U([]), G(1);
314
- }, Q = a(() => {
146
+ } : n)), Y(1);
147
+ }, xt = (e) => {
148
+ q((t) => t.filter((t, n) => n !== e)), Y(1);
149
+ }, St = () => {
150
+ He("FULLTEXT"), Ue("SCORE_DESC"), We([]), Ge([]), Ke([]), qe(""), Je(""), Ye(""), Xe(""), E(""), O(""), Ze(""), j(""), N(""), F(""), L(""), z(""), V(!1), U(!0), G(""), q([]), Y(1);
151
+ }, Ct = c(() => {
315
152
  let e = 0;
316
- return D !== "FULLTEXT" && e++, O !== "SCORE_DESC" && e++, k.length > 0 && e++, A.length > 0 && e++, j.length > 0 && e++, M && e++, P && e++, I && e++, (L || R) && e++, (z || B) && e++, Y.length > 0 && e++, Z && e++, X.length > 0 && e++, e;
153
+ return g !== "FULLTEXT" && e++, _ !== "SCORE_DESC" && e++, v.length > 0 && e++, y.length > 0 && e++, b.length > 0 && e++, x && e++, S && e++, C && e++, (w || T) && e++, (D || k) && e++, Z.length > 0 && e++, $ && e++, Q.length > 0 && e++, e;
317
154
  }, [
318
- Z,
319
- M,
320
- L,
321
- R,
322
- A,
323
- Y.length,
324
- X.length,
325
- I,
155
+ $,
156
+ x,
157
+ w,
158
+ T,
159
+ y,
160
+ Z.length,
161
+ Q.length,
162
+ C,
163
+ g,
164
+ b,
165
+ v,
166
+ _,
167
+ S,
326
168
  D,
327
- j,
328
- k,
329
- O,
330
- P,
331
- z,
332
- B
333
- ]), $ = Math.ceil(dt / x), Nt = (e) => {
334
- e.href && h(e.href);
335
- }, Pt = (e) => te[e] || l, Ft = a(() => {
169
+ k
170
+ ]), wt = Math.ceil(et / 20), Tt = (e) => {
171
+ e.href && be(e.href);
172
+ }, Et = (e) => he[e] || fe, Dt = c(() => {
336
173
  let e = /* @__PURE__ */ new Map();
337
- for (let t of c) e.set(t.value, t);
338
- for (let t of j) e.has(t) || e.set(t, {
174
+ for (let t of ge) e.set(t.value, t);
175
+ for (let t of b) e.has(t) || e.set(t, {
339
176
  value: t,
340
177
  label: t
341
178
  });
342
- for (let t of _t?.byProduct ?? []) e.has(t.product) || e.set(t.product, {
179
+ for (let t of ot?.byProduct ?? []) e.has(t.product) || e.set(t.product, {
343
180
  value: t.product,
344
181
  label: t.product
345
182
  });
346
183
  return Array.from(e.values());
347
184
  }, [
348
- _t?.byProduct,
349
- c,
350
- j
351
- ]), It = (e) => {
352
- Ue((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), G(1);
185
+ ot?.byProduct,
186
+ ge,
187
+ b
188
+ ]), Ot = (e) => {
189
+ Ke((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), Y(1);
353
190
  };
354
- return /* @__PURE__ */ y("div", {
191
+ return /* @__PURE__ */ u("div", {
355
192
  className: "min-h-screen bg-bg-canvas",
356
- children: /* @__PURE__ */ b("div", {
193
+ children: /* @__PURE__ */ pe("div", {
357
194
  className: "container mx-auto max-w-5xl py-6 px-4",
358
195
  children: [
359
- /* @__PURE__ */ b("div", {
196
+ /* @__PURE__ */ pe("div", {
360
197
  className: "mb-6",
361
- children: [/* @__PURE__ */ y("h1", {
198
+ children: [/* @__PURE__ */ u("h1", {
362
199
  className: "text-2xl font-bold text-text-primary mb-2",
363
200
  children: "Search"
364
- }), /* @__PURE__ */ y("p", {
201
+ }), /* @__PURE__ */ u("p", {
365
202
  className: "text-text-secondary",
366
- children: f
203
+ children: ye
367
204
  })]
368
205
  }),
369
- /* @__PURE__ */ y("form", {
370
- onSubmit: Et,
371
- className: "mb-6",
372
- children: /* @__PURE__ */ b("div", {
373
- className: "relative",
374
- children: [
375
- /* @__PURE__ */ y(p, { className: "absolute left-4 top-1/2 -translate-y-1/2 h-5 w-5 text-text-tertiary" }),
376
- /* @__PURE__ */ y("input", {
377
- type: "text",
378
- value: xt,
379
- onChange: (e) => St(e.target.value),
380
- placeholder: d,
381
- className: "w-full h-12 pl-12 pr-12 text-lg rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-primary-default focus:border-transparent",
382
- autoFocus: !0
383
- }),
384
- xt && /* @__PURE__ */ y("button", {
385
- type: "button",
386
- onClick: () => {
387
- St(""), Re("");
388
- },
389
- className: "absolute right-4 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-bg-muted transition-colors",
390
- children: /* @__PURE__ */ y(v, { className: "h-4 w-4 text-text-tertiary" })
391
- })
392
- ]
393
- })
206
+ /* @__PURE__ */ u(re, {
207
+ inputValue: dt,
208
+ placeholder: ve,
209
+ onInputChange: ft,
210
+ onSubmit: gt,
211
+ onClear: () => {
212
+ ft(""), Ve("");
213
+ }
394
214
  }),
395
- /* @__PURE__ */ b("div", {
396
- className: "flex flex-wrap items-center gap-4 mb-6",
397
- children: [
398
- /* @__PURE__ */ y("div", {
399
- className: "flex items-center gap-1 bg-bg-surface rounded-lg p-1 border border-border-default",
400
- children: [
401
- "PARTIAL",
402
- "FULLTEXT",
403
- "EXACT"
404
- ].map((e) => /* @__PURE__ */ y("button", {
405
- onClick: () => {
406
- ze(e), G(1);
407
- },
408
- className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${D === e ? "bg-primary-default text-primary-foreground" : "text-text-secondary hover:bg-bg-muted"}`,
409
- title: pe[e].description,
410
- children: pe[e].label
411
- }, e))
412
- }),
413
- /* @__PURE__ */ b("div", {
414
- className: "flex items-center gap-2",
415
- children: [/* @__PURE__ */ y(ee, { className: "h-4 w-4 text-text-tertiary" }), /* @__PURE__ */ y("select", {
416
- value: O,
417
- onChange: (e) => {
418
- Be(e.target.value), G(1);
419
- },
420
- className: "h-9 px-3 text-sm rounded-md border border-border-default bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default",
421
- children: me.map((e) => /* @__PURE__ */ y("option", {
422
- value: e.value,
423
- children: e.label
424
- }, e.value))
425
- })]
426
- }),
427
- /* @__PURE__ */ b("button", {
428
- onClick: () => bt(!J),
429
- className: `flex items-center gap-2 px-3 py-2 text-sm rounded-md border transition-colors ${J || Q > 0 ? "border-primary-default bg-primary-default/10 text-primary-default" : "border-border-default bg-bg-surface text-text-secondary hover:bg-bg-muted"}`,
430
- children: [
431
- /* @__PURE__ */ y(le, { className: "h-4 w-4" }),
432
- "Filters",
433
- Q > 0 && /* @__PURE__ */ y("span", {
434
- className: "ml-1 px-1.5 py-0.5 text-xs font-medium bg-primary-default text-primary-foreground rounded-full",
435
- children: Q
436
- }),
437
- y(J ? ae : ne, { className: "h-4 w-4" })
438
- ]
439
- }),
440
- Q > 0 && /* @__PURE__ */ y("button", {
441
- onClick: Mt,
442
- className: "text-sm text-text-secondary hover:text-text-primary underline",
443
- children: "Clear all filters"
444
- })
445
- ]
215
+ /* @__PURE__ */ u(ie, {
216
+ searchMode: g,
217
+ sortBy: _,
218
+ showFilters: lt,
219
+ activeFilterCount: Ct,
220
+ onSearchModeChange: (e) => {
221
+ He(e), Y(1);
222
+ },
223
+ onSortByChange: (e) => {
224
+ Ue(e), Y(1);
225
+ },
226
+ onToggleFilters: () => ut(!lt),
227
+ onClearFilters: St
446
228
  }),
447
- J && /* @__PURE__ */ y("div", {
448
- className: "mb-6 p-4 bg-bg-surface rounded-lg border border-border-default",
449
- children: /* @__PURE__ */ b("div", {
450
- className: "grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6",
451
- children: [
452
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
453
- className: "text-sm font-medium text-text-primary mb-3",
454
- children: "Include Entity Types"
455
- }), /* @__PURE__ */ y("div", {
456
- className: "space-y-2 max-h-56 overflow-y-auto",
457
- children: s.map((e) => /* @__PURE__ */ b("label", {
458
- className: "flex items-center gap-2 cursor-pointer",
459
- children: [/* @__PURE__ */ y("input", {
460
- type: "checkbox",
461
- checked: k.includes(e.value),
462
- onChange: () => Dt(e.value),
463
- className: "h-4 w-4 rounded border-border-default text-primary-default focus:ring-primary-default"
464
- }), /* @__PURE__ */ y("span", {
465
- className: "text-sm text-text-secondary",
466
- children: e.label
467
- })]
468
- }, e.value))
469
- })] }),
470
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
471
- className: "text-sm font-medium text-text-primary mb-3",
472
- children: "Exclude Entity Types"
473
- }), /* @__PURE__ */ y("div", {
474
- className: "space-y-2 max-h-56 overflow-y-auto",
475
- children: s.map((e) => /* @__PURE__ */ b("label", {
476
- className: "flex items-center gap-2 cursor-pointer",
477
- children: [/* @__PURE__ */ y("input", {
478
- type: "checkbox",
479
- checked: A.includes(e.value),
480
- onChange: () => Ot(e.value),
481
- className: "h-4 w-4 rounded border-border-default text-primary-default focus:ring-primary-default"
482
- }), /* @__PURE__ */ y("span", {
483
- className: "text-sm text-text-secondary",
484
- children: e.label
485
- })]
486
- }, `exclude-${e.value}`))
487
- })] }),
488
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
489
- className: "text-sm font-medium text-text-primary mb-3",
490
- children: "Product Sources"
491
- }), /* @__PURE__ */ y("div", {
492
- className: "space-y-2 max-h-56 overflow-y-auto",
493
- children: Ft.length > 0 ? Ft.map((e) => {
494
- let t = _t?.byProduct?.find((t) => t.product === e.value)?.count;
495
- return /* @__PURE__ */ b("label", {
496
- className: "flex items-center justify-between gap-2 cursor-pointer",
497
- children: [/* @__PURE__ */ b("div", {
498
- className: "flex items-center gap-2",
499
- children: [/* @__PURE__ */ y("input", {
500
- type: "checkbox",
501
- checked: j.includes(e.value),
502
- onChange: () => It(e.value),
503
- className: "h-4 w-4 rounded border-border-default text-primary-default focus:ring-primary-default"
504
- }), /* @__PURE__ */ y("span", {
505
- className: "text-sm text-text-secondary",
506
- children: e.label
507
- })]
508
- }), t !== void 0 && /* @__PURE__ */ y("span", {
509
- className: "text-xs text-text-tertiary",
510
- children: t
511
- })]
512
- }, e.value);
513
- }) : /* @__PURE__ */ y("span", {
514
- className: "text-sm text-text-tertiary",
515
- children: "Product filters will appear after results are loaded."
516
- })
517
- })] }),
518
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
519
- className: "text-sm font-medium text-text-primary mb-3",
520
- children: "Scope & Actors"
521
- }), /* @__PURE__ */ b("div", {
522
- className: "space-y-3",
523
- children: [
524
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
525
- className: "block text-xs text-text-tertiary mb-1",
526
- children: "Project ID"
527
- }), /* @__PURE__ */ y("input", {
528
- "aria-label": "Project ID filter",
529
- type: "text",
530
- value: I,
531
- onChange: (e) => {
532
- We(e.target.value), G(1);
533
- },
534
- placeholder: "Optional project scope",
535
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
536
- })] }),
537
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
538
- className: "block text-xs text-text-tertiary mb-1",
539
- children: "Created by"
540
- }), /* @__PURE__ */ y("input", {
541
- "aria-label": "Created by filter",
542
- type: "text",
543
- value: M,
544
- onChange: (e) => {
545
- N(e.target.value), G(1);
546
- },
547
- placeholder: "Actor ID",
548
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
549
- })] }),
550
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
551
- className: "block text-xs text-text-tertiary mb-1",
552
- children: "Updated by"
553
- }), /* @__PURE__ */ y("input", {
554
- "aria-label": "Updated by filter",
555
- type: "text",
556
- value: P,
557
- onChange: (e) => {
558
- F(e.target.value), G(1);
559
- },
560
- placeholder: "Actor ID",
561
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
562
- })] })
563
- ]
564
- })] }),
565
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
566
- className: "text-sm font-medium text-text-primary mb-3",
567
- children: "Created Date Range"
568
- }), /* @__PURE__ */ b("div", {
569
- className: "space-y-3",
570
- children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
571
- className: "block text-xs text-text-tertiary mb-1",
572
- children: "From"
573
- }), /* @__PURE__ */ y("input", {
574
- "aria-label": "Created from date",
575
- type: "date",
576
- value: L,
577
- onChange: (e) => {
578
- Ge(e.target.value), G(1);
579
- },
580
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
581
- })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
582
- className: "block text-xs text-text-tertiary mb-1",
583
- children: "To"
584
- }), /* @__PURE__ */ y("input", {
585
- "aria-label": "Created to date",
586
- type: "date",
587
- value: R,
588
- onChange: (e) => {
589
- Ke(e.target.value), G(1);
590
- },
591
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
592
- })] })]
593
- })] }),
594
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
595
- className: "text-sm font-medium text-text-primary mb-3",
596
- children: "Updated Date Range"
597
- }), /* @__PURE__ */ b("div", {
598
- className: "space-y-3",
599
- children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
600
- className: "block text-xs text-text-tertiary mb-1",
601
- children: "From"
602
- }), /* @__PURE__ */ y("input", {
603
- "aria-label": "Updated from date",
604
- type: "date",
605
- value: z,
606
- onChange: (e) => {
607
- qe(e.target.value), G(1);
608
- },
609
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
610
- })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
611
- className: "block text-xs text-text-tertiary mb-1",
612
- children: "To"
613
- }), /* @__PURE__ */ y("input", {
614
- "aria-label": "Updated to date",
615
- type: "date",
616
- value: B,
617
- onChange: (e) => {
618
- Je(e.target.value), G(1);
619
- },
620
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
621
- })] })]
622
- })] }),
623
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
624
- className: "text-sm font-medium text-text-primary mb-3",
625
- children: "Tag Filters"
626
- }), /* @__PURE__ */ b("div", {
627
- className: "space-y-3",
628
- children: [
629
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
630
- className: "block text-xs text-text-tertiary mb-1",
631
- children: "Tag IDs"
632
- }), /* @__PURE__ */ y("input", {
633
- "aria-label": "Tag IDs filter",
634
- type: "text",
635
- value: Ze,
636
- onChange: (e) => {
637
- Qe(e.target.value), G(1);
638
- },
639
- placeholder: "Comma-separated tag IDs",
640
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
641
- })] }),
642
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
643
- className: "block text-xs text-text-tertiary mb-1",
644
- children: "Tag Keys"
645
- }), /* @__PURE__ */ y("input", {
646
- "aria-label": "Tag keys filter",
647
- type: "text",
648
- value: $e,
649
- onChange: (e) => {
650
- et(e.target.value), G(1);
651
- },
652
- placeholder: "Comma-separated tag keys",
653
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
654
- })] }),
655
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
656
- className: "block text-xs text-text-tertiary mb-1",
657
- children: "Hierarchy Paths"
658
- }), /* @__PURE__ */ y("input", {
659
- "aria-label": "Tag hierarchy paths filter",
660
- type: "text",
661
- value: tt,
662
- onChange: (e) => {
663
- nt(e.target.value), G(1);
664
- },
665
- placeholder: "team/engineering, finance/payables",
666
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
667
- })] }),
668
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
669
- className: "block text-xs text-text-tertiary mb-1",
670
- children: "Vocabulary Keys"
671
- }), /* @__PURE__ */ y("input", {
672
- "aria-label": "Tag vocabulary keys filter",
673
- type: "text",
674
- value: rt,
675
- onChange: (e) => {
676
- it(e.target.value), G(1);
677
- },
678
- placeholder: "project-tags, workspace-tags",
679
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
680
- })] }),
681
- /* @__PURE__ */ b("div", {
682
- className: "grid grid-cols-2 gap-3",
683
- children: [/* @__PURE__ */ b("label", {
684
- className: "flex items-center gap-2 text-sm text-text-secondary cursor-pointer",
685
- children: [/* @__PURE__ */ y("input", {
686
- type: "checkbox",
687
- checked: at,
688
- onChange: (e) => {
689
- ot(e.target.checked), G(1);
690
- },
691
- className: "h-4 w-4 rounded border-border-default text-primary-default focus:ring-primary-default"
692
- }), "Match all"]
693
- }), /* @__PURE__ */ b("label", {
694
- className: "flex items-center gap-2 text-sm text-text-secondary cursor-pointer",
695
- children: [/* @__PURE__ */ y("input", {
696
- type: "checkbox",
697
- checked: st,
698
- onChange: (e) => {
699
- ct(e.target.checked), G(1);
700
- },
701
- className: "h-4 w-4 rounded border-border-default text-primary-default focus:ring-primary-default"
702
- }), "Include descendants"]
703
- })]
704
- }),
705
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
706
- className: "block text-xs text-text-tertiary mb-1",
707
- children: "Tag depth"
708
- }), /* @__PURE__ */ y("input", {
709
- "aria-label": "Tag depth filter",
710
- type: "number",
711
- min: "1",
712
- value: V,
713
- onChange: (e) => {
714
- lt(e.target.value), G(1);
715
- },
716
- placeholder: "Optional depth limit",
717
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
718
- })] })
719
- ]
720
- })] }),
721
- /* @__PURE__ */ b("div", {
722
- className: "xl:col-span-2",
723
- children: [/* @__PURE__ */ b("div", {
724
- className: "flex items-center justify-between mb-3",
725
- children: [/* @__PURE__ */ y("h3", {
726
- className: "text-sm font-medium text-text-primary",
727
- children: "Metadata Conditions"
728
- }), /* @__PURE__ */ b("button", {
729
- type: "button",
730
- onClick: kt,
731
- className: "inline-flex items-center gap-1 text-xs text-primary-default hover:text-primary-default/80",
732
- children: [/* @__PURE__ */ y(ce, { className: "h-3.5 w-3.5" }), "Add condition"]
733
- })]
734
- }), /* @__PURE__ */ y("div", {
735
- className: "space-y-3",
736
- children: H.length === 0 ? /* @__PURE__ */ y("span", {
737
- className: "text-sm text-text-tertiary",
738
- children: "No metadata conditions applied."
739
- }) : H.map((e, t) => /* @__PURE__ */ b("div", {
740
- className: "grid grid-cols-1 md:grid-cols-[1.4fr_auto_1.4fr_auto] gap-2 items-center",
741
- children: [
742
- /* @__PURE__ */ y("input", {
743
- "aria-label": `Metadata key ${t + 1}`,
744
- type: "text",
745
- value: e.key,
746
- onChange: (e) => At(t, { key: e.target.value }),
747
- placeholder: "metadata.path",
748
- className: "h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
749
- }),
750
- /* @__PURE__ */ b("select", {
751
- "aria-label": `Metadata operator ${t + 1}`,
752
- value: e.operator,
753
- onChange: (e) => At(t, { operator: e.target.value }),
754
- className: "h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default",
755
- children: [
756
- /* @__PURE__ */ y("option", {
757
- value: "EQUALS",
758
- children: "Equals"
759
- }),
760
- /* @__PURE__ */ y("option", {
761
- value: "NOT_EQUALS",
762
- children: "Not equals"
763
- }),
764
- /* @__PURE__ */ y("option", {
765
- value: "CONTAINS",
766
- children: "Contains"
767
- }),
768
- /* @__PURE__ */ y("option", {
769
- value: "STARTS_WITH",
770
- children: "Starts with"
771
- })
772
- ]
773
- }),
774
- /* @__PURE__ */ y("input", {
775
- "aria-label": `Metadata value ${t + 1}`,
776
- type: "text",
777
- value: e.value,
778
- onChange: (e) => At(t, { value: e.target.value }),
779
- placeholder: "Expected value",
780
- className: "h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
781
- }),
782
- /* @__PURE__ */ y("button", {
783
- type: "button",
784
- onClick: () => jt(t),
785
- className: "inline-flex items-center justify-center h-9 w-9 rounded-md border border-border-default text-text-secondary hover:bg-bg-muted",
786
- "aria-label": `Remove metadata condition ${t + 1}`,
787
- children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
788
- })
789
- ]
790
- }, `metadata-condition-${t}`))
791
- })]
792
- }),
793
- /* @__PURE__ */ b("div", {
794
- className: "xl:col-span-2",
795
- children: [/* @__PURE__ */ y("h3", {
796
- className: "text-sm font-medium text-text-primary mb-3",
797
- children: "Exclusions & Active Filters"
798
- }), /* @__PURE__ */ b("div", {
799
- className: "space-y-4",
800
- children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
801
- className: "block text-xs text-text-tertiary mb-1",
802
- children: "Exclude entity IDs"
803
- }), /* @__PURE__ */ y("input", {
804
- "aria-label": "Exclude entity IDs filter",
805
- type: "text",
806
- value: Ye,
807
- onChange: (e) => {
808
- Xe(e.target.value), G(1);
809
- },
810
- placeholder: "Comma-separated entity IDs",
811
- className: "w-full h-9 px-3 text-sm rounded-md border border-border-default bg-bg-canvas text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-default"
812
- })] }), /* @__PURE__ */ b("div", {
813
- className: "flex flex-wrap gap-2",
814
- children: [
815
- k.map((e) => /* @__PURE__ */ b("span", {
816
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
817
- children: [s.find((t) => t.value === e)?.label || e, /* @__PURE__ */ y("button", {
818
- type: "button",
819
- onClick: () => Dt(e),
820
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
821
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
822
- })]
823
- }, `include-${e}`)),
824
- A.map((e) => /* @__PURE__ */ b("span", {
825
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-bg-muted text-text-secondary rounded-full",
826
- children: [
827
- "Excluding ",
828
- e,
829
- /* @__PURE__ */ y("button", {
830
- type: "button",
831
- onClick: () => Ot(e),
832
- className: "hover:bg-bg-canvas rounded-full p-0.5",
833
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
834
- })
835
- ]
836
- }, `exclude-chip-${e}`)),
837
- j.map((e) => /* @__PURE__ */ b("span", {
838
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
839
- children: [
840
- "Product: ",
841
- Ft.find((t) => t.value === e)?.label || e,
842
- /* @__PURE__ */ y("button", {
843
- type: "button",
844
- onClick: () => It(e),
845
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
846
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
847
- })
848
- ]
849
- }, e)),
850
- M && /* @__PURE__ */ b("span", {
851
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
852
- children: [
853
- "Created by: ",
854
- M,
855
- /* @__PURE__ */ y("button", {
856
- type: "button",
857
- onClick: () => N(""),
858
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
859
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
860
- })
861
- ]
862
- }),
863
- P && /* @__PURE__ */ b("span", {
864
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
865
- children: [
866
- "Updated by: ",
867
- P,
868
- /* @__PURE__ */ y("button", {
869
- type: "button",
870
- onClick: () => F(""),
871
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
872
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
873
- })
874
- ]
875
- }),
876
- I && /* @__PURE__ */ b("span", {
877
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
878
- children: [
879
- "Project: ",
880
- I,
881
- /* @__PURE__ */ y("button", {
882
- type: "button",
883
- onClick: () => We(""),
884
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
885
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
886
- })
887
- ]
888
- }),
889
- (L || R) && /* @__PURE__ */ b("span", {
890
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
891
- children: [
892
- "Created: ",
893
- L || "…",
894
- " → ",
895
- R || "…",
896
- /* @__PURE__ */ y("button", {
897
- type: "button",
898
- onClick: () => {
899
- Ge(""), Ke("");
900
- },
901
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
902
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
903
- })
904
- ]
905
- }),
906
- (z || B) && /* @__PURE__ */ b("span", {
907
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
908
- children: [
909
- "Updated: ",
910
- z || "…",
911
- " → ",
912
- B || "…",
913
- /* @__PURE__ */ y("button", {
914
- type: "button",
915
- onClick: () => {
916
- qe(""), Je("");
917
- },
918
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
919
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
920
- })
921
- ]
922
- }),
923
- Z && /* @__PURE__ */ b("span", {
924
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
925
- children: ["Tag filter active", /* @__PURE__ */ y("button", {
926
- type: "button",
927
- onClick: () => {
928
- Qe(""), et(""), nt(""), it(""), ot(!1), ct(!0), lt("");
929
- },
930
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
931
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
932
- })]
933
- }),
934
- X.length > 0 && /* @__PURE__ */ b("span", {
935
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-primary-default/10 text-primary-default rounded-full",
936
- children: [
937
- X.length,
938
- " metadata condition",
939
- X.length > 1 ? "s" : "",
940
- /* @__PURE__ */ y("button", {
941
- type: "button",
942
- onClick: () => U([]),
943
- className: "hover:bg-primary-default/20 rounded-full p-0.5",
944
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
945
- })
946
- ]
947
- }),
948
- Y.length > 0 && /* @__PURE__ */ b("span", {
949
- className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-bg-muted text-text-secondary rounded-full",
950
- children: [
951
- Y.length,
952
- " excluded ID",
953
- Y.length > 1 ? "s" : "",
954
- /* @__PURE__ */ y("button", {
955
- type: "button",
956
- onClick: () => Xe(""),
957
- className: "hover:bg-bg-canvas rounded-full p-0.5",
958
- children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
959
- })
960
- ]
961
- }),
962
- Q === 0 && /* @__PURE__ */ y("span", {
963
- className: "text-sm text-text-tertiary",
964
- children: "No active filters"
965
- })
966
- ]
967
- })]
968
- })]
969
- })
970
- ]
229
+ lt && /* @__PURE__ */ u(ae, {
230
+ entityTypeOptions: d,
231
+ selectedTypes: v,
232
+ excludedTypes: y,
233
+ availableProductOptions: Dt,
234
+ selectedProducts: b,
235
+ facets: ot,
236
+ projectId: C,
237
+ createdBy: x,
238
+ updatedBy: S,
239
+ dateFrom: w,
240
+ dateTo: T,
241
+ updatedDateFrom: D,
242
+ updatedDateTo: k,
243
+ tagIdsInput: M,
244
+ tagKeysInput: P,
245
+ tagPathsInput: I,
246
+ tagVocabularyKeysInput: R,
247
+ tagMatchAll: B,
248
+ includeDescendants: H,
249
+ tagDepth: W,
250
+ metadataConditions: K,
251
+ onToggleEntityType: _t,
252
+ onToggleExcludedType: vt,
253
+ onToggleProductSource: Ot,
254
+ onProjectIdChange: (e) => {
255
+ Ye(e), Y(1);
256
+ },
257
+ onCreatedByChange: (e) => {
258
+ qe(e), Y(1);
259
+ },
260
+ onUpdatedByChange: (e) => {
261
+ Je(e), Y(1);
262
+ },
263
+ onDateFromChange: (e) => {
264
+ Xe(e), Y(1);
265
+ },
266
+ onDateToChange: (e) => {
267
+ E(e), Y(1);
268
+ },
269
+ onUpdatedDateFromChange: (e) => {
270
+ O(e), Y(1);
271
+ },
272
+ onUpdatedDateToChange: (e) => {
273
+ Ze(e), Y(1);
274
+ },
275
+ onTagIdsChange: (e) => {
276
+ N(e), Y(1);
277
+ },
278
+ onTagKeysChange: (e) => {
279
+ F(e), Y(1);
280
+ },
281
+ onTagPathsChange: (e) => {
282
+ L(e), Y(1);
283
+ },
284
+ onTagVocabularyKeysChange: (e) => {
285
+ z(e), Y(1);
286
+ },
287
+ onTagMatchAllChange: (e) => {
288
+ V(e), Y(1);
289
+ },
290
+ onIncludeDescendantsChange: (e) => {
291
+ U(e), Y(1);
292
+ },
293
+ onTagDepthChange: (e) => {
294
+ G(e), Y(1);
295
+ },
296
+ onAddMetadataCondition: yt,
297
+ onUpdateMetadataCondition: bt,
298
+ onRemoveMetadataCondition: xt,
299
+ children: /* @__PURE__ */ u(oe, {
300
+ excludeIdsInput: A,
301
+ selectedTypes: v,
302
+ excludedTypes: y,
303
+ selectedProducts: b,
304
+ entityTypeOptions: d,
305
+ availableProductOptions: Dt,
306
+ createdBy: x,
307
+ updatedBy: S,
308
+ projectId: C,
309
+ dateFrom: w,
310
+ dateTo: T,
311
+ updatedDateFrom: D,
312
+ updatedDateTo: k,
313
+ builtTagFilter: $,
314
+ normalizedMetadataConditionsCount: Q.length,
315
+ normalizedExcludeIds: Z,
316
+ activeFilterCount: Ct,
317
+ onExcludeIdsChange: (e) => {
318
+ j(e), Y(1);
319
+ },
320
+ onToggleEntityType: _t,
321
+ onToggleExcludedType: vt,
322
+ onToggleProductSource: Ot,
323
+ onClearCreatedBy: () => qe(""),
324
+ onClearUpdatedBy: () => Je(""),
325
+ onClearProjectId: () => Ye(""),
326
+ onClearCreatedDateRange: () => {
327
+ Xe(""), E("");
328
+ },
329
+ onClearUpdatedDateRange: () => {
330
+ O(""), Ze("");
331
+ },
332
+ onClearTagFilter: () => {
333
+ N(""), F(""), L(""), z(""), V(!1), U(!0), G("");
334
+ },
335
+ onClearMetadataConditions: () => q([]),
336
+ onClearExcludeIds: () => j("")
971
337
  })
972
338
  }),
973
- E && /* @__PURE__ */ y("div", {
974
- className: "flex items-center justify-between mb-4",
975
- children: /* @__PURE__ */ y("div", {
976
- className: "text-sm text-text-secondary",
977
- children: w ? /* @__PURE__ */ b("span", {
978
- className: "flex items-center gap-2",
979
- children: [/* @__PURE__ */ y(se, { className: "h-4 w-4 animate-spin" }), "Searching..."]
980
- }) : yt ? /* @__PURE__ */ y("span", {
981
- className: "text-danger-default",
982
- children: yt
983
- }) : /* @__PURE__ */ b("span", { children: [
984
- "Found ",
985
- /* @__PURE__ */ y("strong", { children: dt }),
986
- " results",
987
- ht > 0 && /* @__PURE__ */ b("span", {
988
- className: "text-text-tertiary",
989
- children: [
990
- " in ",
991
- ht,
992
- "ms"
993
- ]
994
- })
995
- ] })
996
- })
339
+ h && /* @__PURE__ */ u(se, {
340
+ isSearching: we,
341
+ error: ct,
342
+ total: et,
343
+ searchTimeMs: it
997
344
  }),
998
- /* @__PURE__ */ b("div", {
999
- className: "space-y-3",
1000
- children: [
1001
- w && K.length === 0 && /* @__PURE__ */ y(ue, { children: [
1002
- 1,
1003
- 2,
1004
- 3,
1005
- 4,
1006
- 5
1007
- ].map((e) => /* @__PURE__ */ y("div", {
1008
- className: "p-4 bg-bg-surface rounded-lg border border-border-default animate-pulse",
1009
- children: /* @__PURE__ */ b("div", {
1010
- className: "flex items-start gap-3",
1011
- children: [/* @__PURE__ */ y("div", { className: "w-10 h-10 rounded-md bg-bg-muted" }), /* @__PURE__ */ b("div", {
1012
- className: "flex-1",
1013
- children: [/* @__PURE__ */ y("div", { className: "h-5 w-1/3 bg-bg-muted rounded mb-2" }), /* @__PURE__ */ y("div", { className: "h-4 w-2/3 bg-bg-muted rounded" })]
1014
- })]
1015
- })
1016
- }, e)) }),
1017
- !w && !yt && K.length === 0 && E && /* @__PURE__ */ b("div", {
1018
- className: "py-12 text-center",
1019
- children: [
1020
- /* @__PURE__ */ y(p, { className: "h-12 w-12 mx-auto text-text-tertiary mb-4" }),
1021
- /* @__PURE__ */ y("h3", {
1022
- className: "text-lg font-medium text-text-primary mb-2",
1023
- children: "No results found"
1024
- }),
1025
- /* @__PURE__ */ b("p", {
1026
- className: "text-text-secondary max-w-md mx-auto",
1027
- children: [
1028
- "No results found for \"",
1029
- E,
1030
- "\". Try adjusting your search terms or filters."
1031
- ]
1032
- }),
1033
- /* @__PURE__ */ b("div", {
1034
- className: "mt-6 space-y-2 text-sm text-text-tertiary",
1035
- children: [/* @__PURE__ */ y("p", { children: "Suggestions:" }), /* @__PURE__ */ b("ul", {
1036
- className: "list-disc list-inside",
1037
- children: [
1038
- /* @__PURE__ */ y("li", { children: "Check your spelling" }),
1039
- /* @__PURE__ */ y("li", { children: "Try more general keywords" }),
1040
- /* @__PURE__ */ y("li", { children: "Use fewer filters" }),
1041
- /* @__PURE__ */ y("li", { children: "Try \"Partial\" search mode for autocomplete" })
1042
- ]
1043
- })]
1044
- })
1045
- ]
1046
- }),
1047
- !w && !E && /* @__PURE__ */ b("div", {
1048
- className: "py-12 text-center",
1049
- children: [
1050
- /* @__PURE__ */ y(p, { className: "h-12 w-12 mx-auto text-text-tertiary mb-4" }),
1051
- /* @__PURE__ */ y("h3", {
1052
- className: "text-lg font-medium text-text-primary mb-2",
1053
- children: "Start searching"
1054
- }),
1055
- /* @__PURE__ */ y("p", {
1056
- className: "text-text-secondary max-w-md mx-auto",
1057
- children: "Enter a search term above to find documents, tags, projects, tasks, and more across your workspace."
1058
- })
1059
- ]
1060
- }),
1061
- K.map((e) => /* @__PURE__ */ y("button", {
1062
- onClick: () => Nt(e),
1063
- className: "w-full p-4 bg-bg-surface rounded-lg border border-border-default hover:border-primary-default hover:shadow-sm transition-all text-left group",
1064
- children: /* @__PURE__ */ b("div", {
1065
- className: "flex items-start gap-3",
1066
- children: [/* @__PURE__ */ y("div", {
1067
- className: "flex-shrink-0 w-10 h-10 rounded-md bg-bg-muted flex items-center justify-center group-hover:bg-primary-default/10 transition-colors",
1068
- children: /* @__PURE__ */ y(Pt(e.entityType || e.category), { className: "h-5 w-5 text-text-tertiary group-hover:text-primary-default" })
1069
- }), /* @__PURE__ */ b("div", {
1070
- className: "flex-1 min-w-0",
1071
- children: [
1072
- /* @__PURE__ */ b("div", {
1073
- className: "flex items-center gap-2 mb-1",
1074
- children: [
1075
- /* @__PURE__ */ y("h3", {
1076
- className: "text-base font-medium text-text-primary truncate group-hover:text-primary-default",
1077
- children: e.title
1078
- }),
1079
- /* @__PURE__ */ y("span", {
1080
- className: "flex-shrink-0 px-2 py-0.5 text-xs font-medium bg-bg-muted text-text-tertiary rounded",
1081
- children: e.entityType || e.category
1082
- }),
1083
- e.productSource && /* @__PURE__ */ y("span", {
1084
- className: "flex-shrink-0 px-2 py-0.5 text-xs font-medium bg-bg-muted text-text-tertiary rounded",
1085
- children: e.productSource
1086
- })
1087
- ]
1088
- }),
1089
- e.description && /* @__PURE__ */ y("p", {
1090
- className: "text-sm text-text-secondary line-clamp-2",
1091
- children: e.description
1092
- }),
1093
- /* @__PURE__ */ b("div", {
1094
- className: "flex items-center gap-4 mt-2 text-xs text-text-tertiary",
1095
- children: [e.score !== void 0 && e.score > 0 && /* @__PURE__ */ b("span", {
1096
- className: "flex items-center gap-1",
1097
- children: ["Score: ", e.score.toFixed(2)]
1098
- }), e.metadata?.createdAt && /* @__PURE__ */ b("span", {
1099
- className: "flex items-center gap-1",
1100
- children: [/* @__PURE__ */ y(oe, { className: "h-3 w-3" }), new Date(String(e.metadata.createdAt)).toLocaleDateString()]
1101
- })]
1102
- })
1103
- ]
1104
- })]
1105
- })
1106
- }, e.id))
1107
- ]
345
+ /* @__PURE__ */ u(ce, {
346
+ isSearching: we,
347
+ error: ct,
348
+ query: h,
349
+ results: Qe,
350
+ getEntityIcon: Et,
351
+ onResultClick: Tt
1108
352
  }),
1109
- K.length > 0 && $ > 1 && /* @__PURE__ */ b("div", {
1110
- className: "flex items-center justify-center gap-2 mt-8",
1111
- children: [
1112
- /* @__PURE__ */ b("button", {
1113
- onClick: () => G((e) => Math.max(1, e - 1)),
1114
- disabled: W === 1,
1115
- className: "flex items-center gap-1 px-3 py-2 text-sm rounded-md border border-border-default bg-bg-surface text-text-secondary hover:bg-bg-muted disabled:opacity-50 disabled:cursor-not-allowed",
1116
- children: [/* @__PURE__ */ y(re, { className: "h-4 w-4" }), "Previous"]
1117
- }),
1118
- /* @__PURE__ */ y("div", {
1119
- className: "flex items-center gap-1",
1120
- children: Array.from({ length: Math.min(5, $) }, (e, t) => {
1121
- let n;
1122
- return n = $ <= 5 || W <= 3 ? t + 1 : W >= $ - 2 ? $ - 4 + t : W - 2 + t, /* @__PURE__ */ y("button", {
1123
- onClick: () => G(n),
1124
- className: `w-9 h-9 text-sm rounded-md transition-colors ${W === n ? "bg-primary-default text-primary-foreground" : "border border-border-default bg-bg-surface text-text-secondary hover:bg-bg-muted"}`,
1125
- children: n
1126
- }, n);
1127
- })
1128
- }),
1129
- /* @__PURE__ */ b("button", {
1130
- onClick: () => G((e) => Math.min($, e + 1)),
1131
- disabled: W === $ || !pt,
1132
- className: "flex items-center gap-1 px-3 py-2 text-sm rounded-md border border-border-default bg-bg-surface text-text-secondary hover:bg-bg-muted disabled:opacity-50 disabled:cursor-not-allowed",
1133
- children: ["Next", /* @__PURE__ */ y(ie, { className: "h-4 w-4" })]
1134
- })
1135
- ]
353
+ Qe.length > 0 && wt > 1 && /* @__PURE__ */ u(le, {
354
+ currentPage: J,
355
+ totalPages: wt,
356
+ hasMore: nt,
357
+ onPageChange: Y
1136
358
  })
1137
359
  ]
1138
360
  })
1139
361
  });
1140
362
  }
1141
363
  //#endregion
1142
- export { be as SearchPage };
364
+ export { d as SearchPage };