@nivaro/react 0.3.114 → 0.3.115

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 (281) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1717 -21
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4088 -3592
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +1 -0
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  62. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  63. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  65. package/dist/shared/components/change-proposals/types.js +4 -0
  66. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  67. package/dist/shared/components/chat/Composer.js +276 -298
  68. package/dist/shared/components/chat/room-due.js +13 -0
  69. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  70. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  71. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  72. package/dist/shared/components/imports/ImportConsole.js +159 -155
  73. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  74. package/dist/shared/components/integrations/SendStatus.js +202 -0
  75. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  76. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  77. package/dist/shared/components/integrations/console/api.js +161 -117
  78. package/dist/shared/components/integrations/console/tone.js +15 -12
  79. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  80. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  81. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  82. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  83. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  84. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  85. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  86. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  87. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  88. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  89. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  90. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  91. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  92. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  93. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  94. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  95. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  96. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  97. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  98. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  99. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  100. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  101. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  102. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  103. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  104. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  105. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  106. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  107. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  108. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  109. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  110. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  111. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  112. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  113. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  114. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  115. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  116. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  117. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  118. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  119. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  120. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  121. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  122. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  123. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  124. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  125. package/dist/shared/components/item-edit/file-live.js +77 -0
  126. package/dist/shared/components/item-edit/file-processing.js +87 -0
  127. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  128. package/dist/shared/components/item-edit/live-related.js +23 -0
  129. package/dist/shared/components/item-edit/live-title.js +66 -0
  130. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  131. package/dist/shared/components/item-edit/removed-line.js +58 -0
  132. package/dist/shared/components/item-edit/render-stability.js +70 -59
  133. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  134. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  135. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  136. package/dist/shared/components/list/InlineEdit.js +504 -208
  137. package/dist/shared/components/list/ListViewers.js +81 -0
  138. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  139. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  140. package/dist/shared/components/merge/merge-values.js +110 -0
  141. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  142. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  143. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  144. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  145. package/dist/shared/components/notifications/bundles.js +21 -19
  146. package/dist/shared/components/notifications/resolved-line.js +25 -0
  147. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  148. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  149. package/dist/shared/components/panels/AlertBanners.js +132 -0
  150. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  151. package/dist/shared/components/panels/BranchLanes.js +82 -54
  152. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  153. package/dist/shared/components/panels/CommentImages.js +219 -0
  154. package/dist/shared/components/panels/CommentPanel.js +649 -530
  155. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  156. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  157. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  158. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  159. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  160. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  161. package/dist/shared/components/panels/SlaClock.js +130 -99
  162. package/dist/shared/components/panels/TaskPanel.js +308 -287
  163. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  164. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  165. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  166. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  167. package/dist/shared/components/profile/AgentNameField.js +141 -0
  168. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  169. package/dist/shared/components/profile/PersonAccess.js +398 -330
  170. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  171. package/dist/shared/components/profile/PersonProfile.js +81 -73
  172. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  173. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  174. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  175. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  176. package/dist/shared/components/queue/QueueWorklist.js +1927 -1635
  177. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  178. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  179. package/dist/shared/components/support/ReportProblem.js +1 -0
  180. package/dist/shared/components/support/ScreenShare.js +554 -0
  181. package/dist/shared/components/support/SupportView.js +160 -129
  182. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  183. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  184. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  185. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  186. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  187. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  188. package/dist/shared/lib/activity-sentence.js +87 -75
  189. package/dist/shared/lib/agent-presence.js +46 -0
  190. package/dist/shared/lib/approval-progress.js +49 -0
  191. package/dist/shared/lib/attention-prefs.js +27 -0
  192. package/dist/shared/lib/cell-locks.js +56 -0
  193. package/dist/shared/lib/co-edit.js +166 -0
  194. package/dist/shared/lib/coedit-registry.js +44 -0
  195. package/dist/shared/lib/comment-awareness.js +124 -0
  196. package/dist/shared/lib/comment-images.js +45 -0
  197. package/dist/shared/lib/config-watch.js +94 -0
  198. package/dist/shared/lib/copy-rules.js +65 -0
  199. package/dist/shared/lib/count-step.js +30 -0
  200. package/dist/shared/lib/deadline-ticker.js +68 -0
  201. package/dist/shared/lib/derived-causes.js +115 -0
  202. package/dist/shared/lib/draft-store.js +114 -85
  203. package/dist/shared/lib/error-hints.js +1 -0
  204. package/dist/shared/lib/field-merge.js +126 -0
  205. package/dist/shared/lib/filter-sentence.js +10 -10
  206. package/dist/shared/lib/focus-mode.js +16 -12
  207. package/dist/shared/lib/grid-cursors.js +77 -0
  208. package/dist/shared/lib/grid-presence.js +182 -0
  209. package/dist/shared/lib/idle-reload.js +100 -73
  210. package/dist/shared/lib/in-step.js +45 -0
  211. package/dist/shared/lib/integration-chip.js +19 -18
  212. package/dist/shared/lib/line-locks.js +141 -0
  213. package/dist/shared/lib/line-split.js +41 -0
  214. package/dist/shared/lib/linked-changes.js +150 -0
  215. package/dist/shared/lib/list-return.js +231 -0
  216. package/dist/shared/lib/list-viewers.js +52 -0
  217. package/dist/shared/lib/live-announcer.js +86 -0
  218. package/dist/shared/lib/live-counts.js +85 -0
  219. package/dist/shared/lib/live-data-changed.js +108 -0
  220. package/dist/shared/lib/live-deltas.js +81 -0
  221. package/dist/shared/lib/live-findings.js +113 -0
  222. package/dist/shared/lib/live-groups.js +122 -0
  223. package/dist/shared/lib/live-link-labels.js +162 -0
  224. package/dist/shared/lib/live-list-flow.js +334 -0
  225. package/dist/shared/lib/live-list.js +143 -129
  226. package/dist/shared/lib/live-moves.js +51 -0
  227. package/dist/shared/lib/live-ops.js +26 -26
  228. package/dist/shared/lib/live-pickers.js +7 -0
  229. package/dist/shared/lib/live-preference.js +184 -0
  230. package/dist/shared/lib/live-queries.js +226 -181
  231. package/dist/shared/lib/live-screen.js +333 -0
  232. package/dist/shared/lib/live-search.js +108 -0
  233. package/dist/shared/lib/live-seen.js +35 -0
  234. package/dist/shared/lib/live-views.js +100 -0
  235. package/dist/shared/lib/live.js +159 -133
  236. package/dist/shared/lib/missed-updates.js +198 -0
  237. package/dist/shared/lib/newer-file.js +56 -0
  238. package/dist/shared/lib/notification-sound.js +42 -20
  239. package/dist/shared/lib/own-writes.js +59 -41
  240. package/dist/shared/lib/picker-badges.js +94 -0
  241. package/dist/shared/lib/presence-signals.js +131 -84
  242. package/dist/shared/lib/realtime.js +49 -24
  243. package/dist/shared/lib/record-gaps.js +85 -0
  244. package/dist/shared/lib/record-outbox.js +369 -222
  245. package/dist/shared/lib/record-peek.js +75 -0
  246. package/dist/shared/lib/record-tabs.js +92 -72
  247. package/dist/shared/lib/relative-ticker.js +42 -0
  248. package/dist/shared/lib/request-gate.js +119 -119
  249. package/dist/shared/lib/rollup-recalc.js +107 -0
  250. package/dist/shared/lib/room-gaps.js +40 -36
  251. package/dist/shared/lib/rum.js +137 -87
  252. package/dist/shared/lib/save-progress.js +20 -0
  253. package/dist/shared/lib/scheduled-countdown.js +67 -0
  254. package/dist/shared/lib/screen-refresh.js +160 -0
  255. package/dist/shared/lib/screen-share.js +234 -0
  256. package/dist/shared/lib/seen-since.js +74 -0
  257. package/dist/shared/lib/selection-watch.js +205 -0
  258. package/dist/shared/lib/send-status.js +132 -0
  259. package/dist/shared/lib/send-view.js +23 -0
  260. package/dist/shared/lib/socket-liveness.js +155 -0
  261. package/dist/shared/lib/socket-realtime.js +168 -140
  262. package/dist/shared/lib/state-census.js +53 -0
  263. package/dist/shared/lib/summary-mode.js +61 -39
  264. package/dist/shared/lib/tab-attention.js +143 -32
  265. package/dist/shared/lib/table-density.js +64 -0
  266. package/dist/shared/lib/track-travel.js +40 -0
  267. package/dist/shared/lib/unseen-changes.js +68 -0
  268. package/dist/shared/lib/upload-file.js +33 -0
  269. package/dist/shared/lib/upload-presence.js +127 -0
  270. package/dist/shared/lib/urgent-chime.js +65 -0
  271. package/dist/shared/lib/use-online-users.js +32 -11
  272. package/dist/shared/lib/user-sync.js +155 -39
  273. package/dist/shared/lib/waiting-count.js +44 -0
  274. package/dist/shared/lib/watch-desktop.js +83 -0
  275. package/dist/shared/lib/watch-list.js +447 -0
  276. package/dist/shared/lib/widget-image-render.js +64 -0
  277. package/dist/shared/lib/widget-image.js +111 -0
  278. package/dist/shared/lib/worker-socket.js +130 -104
  279. package/dist/shared/lib/write-to-screen.js +133 -0
  280. package/package.json +1 -1
  281. package/styles.css +49 -1
@@ -1,28 +1,33 @@
1
- import { jsxs as n, jsx as t, Fragment as Ae } from "react/jsx-runtime";
2
- import { useQueryClient as Ee, useQuery as A, useMutation as U } from "@tanstack/react-query";
3
- import { ClipboardList as Fe, ChevronDown as oe, X as ee, Plus as De, Bot as Ie, Users as Le, History as We, Pencil as Oe, RotateCcw as je, ChevronsUpDown as ge, Check as Ke } from "lucide-react";
4
- import { useState as w, useMemo as Ue, useEffect as de } from "react";
5
- import { toast as _ } from "sonner";
6
- import { useNivaroClient as O, useItemEditAuth as Me } from "../../context.js";
7
- import { get as E, post as Y, patch as Re, del as He } from "../../lib/commands.js";
8
- import { OPEN_TASK_STATUSES as ce, invalidateRecordTasks as Be } from "../../lib/record-tasks.js";
9
- import { useStartsOpen as Ve } from "../../lib/use-starts-open.js";
10
- import { formatDate as Z, cn as M, formatRelative as xe, formatDateTime as fe } from "../../lib/utils.js";
11
- import { TaskDoButton as ze } from "../ai/TaskDo.js";
1
+ import { jsxs as n, jsx as t, Fragment as Ie } from "react/jsx-runtime";
2
+ import { useQueryClient as Le, useQuery as F, useMutation as K } from "@tanstack/react-query";
3
+ import { ClipboardList as We, ChevronDown as me, X as te, Plus as Oe, Bot as je, Users as Ue, History as Ke, Pencil as Me, RotateCcw as Re, ChevronsUpDown as be, Check as He } from "lucide-react";
4
+ import { useState as P, useMemo as ke, useEffect as ue } from "react";
5
+ import { toast as w } from "sonner";
6
+ import { useNivaroClient as O, useItemEditAuth as Be } from "../../context.js";
7
+ import { get as D, post as Z, patch as Ve, del as ze } from "../../lib/commands.js";
8
+ import { OPEN_TASK_STATUSES as pe, invalidateRecordTasks as Ge } from "../../lib/record-tasks.js";
9
+ import { useNewSince as Je } from "../../lib/seen-since.js";
10
+ import { usePresenceStates as Xe } from "../../lib/use-online-users.js";
11
+ import { useStartsOpen as Qe } from "../../lib/use-starts-open.js";
12
+ import { formatDate as ee, cn as M, formatDateTime as ye } from "../../lib/utils.js";
13
+ import { TaskDoButton as Ye } from "../ai/TaskDo.js";
14
+ import { PresenceDot as Ze } from "../PresenceDot.js";
15
+ import { RelativeTime as Ne } from "../RelativeTime.js";
12
16
  import { Button as V } from "../ui/button.js";
13
- import { Checkbox as me } from "../ui/checkbox.js";
14
- import { Command as be, CommandInput as ke, CommandList as ye, CommandEmpty as Ne, CommandGroup as te, CommandItem as ve } from "../ui/command.js";
15
- import { Input as ae } from "../ui/input.js";
17
+ import { Checkbox as he } from "../ui/checkbox.js";
18
+ import { Command as ve, CommandInput as _e, CommandList as we, CommandEmpty as Ce, CommandGroup as ae, CommandItem as Se } from "../ui/command.js";
19
+ import { Input as ne } from "../ui/input.js";
16
20
  import { Label as W } from "../ui/label.js";
17
- import { Popover as _e, PopoverTrigger as we, PopoverContent as Ce } from "../ui/popover.js";
21
+ import { Popover as Pe, PopoverTrigger as $e, PopoverContent as qe } from "../ui/popover.js";
18
22
  import { SimpleSelect as G } from "../ui/SimpleSelect.js";
19
- import { Textarea as Ge } from "../ui/textarea.js";
20
- const Je = "id,first_name,last_name,email,is_out_of_office,ooo_end,delegate_id";
23
+ import { Textarea as et } from "../ui/textarea.js";
24
+ import { NewSinceChip as tt } from "./NewSinceChip.js";
25
+ const at = "id,first_name,last_name,email,is_out_of_office,ooo_end,delegate_id";
21
26
  function z(a) {
22
27
  return a && ([a.first_name, a.last_name].filter(Boolean).join(" ") || a.email) || "Unknown";
23
28
  }
24
- const T = (a, o) => a != null && o != null && String(a).toUpperCase() === String(o).toUpperCase();
25
- function Se(a) {
29
+ const E = (a, o) => a != null && o != null && String(a).toUpperCase() === String(o).toUpperCase();
30
+ function Te(a) {
26
31
  if (!a) return [];
27
32
  try {
28
33
  const o = JSON.parse(a);
@@ -31,13 +36,13 @@ function Se(a) {
31
36
  return [];
32
37
  }
33
38
  }
34
- function Xe(a, o) {
39
+ function nt(a, o) {
35
40
  return a.map((d) => {
36
41
  const m = o.get(d.field) ?? d.field.replace(/_/g, " ");
37
42
  return d.op === "nnull" ? `${m} is filled in` : d.op === "eq" ? `${m} is ${String(d.value ?? "")}` : d.op === "null" ? `${m} is empty` : `${m} ${d.op} ${String(d.value ?? "")}`.trim();
38
43
  }).join(" and ");
39
44
  }
40
- function ue({ priority: a }) {
45
+ function ge({ priority: a }) {
41
46
  return !a || a === "normal" ? null : /* @__PURE__ */ t(
42
47
  "span",
43
48
  {
@@ -46,102 +51,103 @@ function ue({ priority: a }) {
46
51
  }
47
52
  );
48
53
  }
49
- function Qe({
54
+ function st({
50
55
  collection: a,
51
56
  item: o,
52
57
  value: d,
53
58
  valueLabel: m,
54
- onChange: i
59
+ onChange: l
55
60
  }) {
56
- const u = O(), [x, c] = w(!1), [h, r] = w(""), [b, k] = w("");
57
- de(() => {
58
- const s = setTimeout(() => k(h.trim()), 250);
59
- return () => clearTimeout(s);
61
+ const p = O(), [g, c] = P(!1), [h, r] = P(""), [f, b] = P("");
62
+ ue(() => {
63
+ const i = setTimeout(() => b(h.trim()), 250);
64
+ return () => clearTimeout(i);
60
65
  }, [h]);
61
- const L = A({
66
+ const I = F({
62
67
  queryKey: ["task-people", a, o],
63
- queryFn: () => u.request(E("/tasks/people", { collection: a, item: o })).then((s) => s.data).catch(() => []),
64
- enabled: x && !!o && o !== "new",
68
+ queryFn: () => p.request(D("/tasks/people", { collection: a, item: o })).then((i) => i.data).catch(() => []),
69
+ enabled: g && !!o && o !== "new",
65
70
  staleTime: 6e4
66
- }), C = A({
67
- queryKey: ["task-people-search", b],
68
- queryFn: () => u.request(
69
- E("/users", {
71
+ }), $ = F({
72
+ queryKey: ["task-people-search", f],
73
+ queryFn: () => p.request(
74
+ D("/users", {
70
75
  limit: 25,
71
76
  people: 1,
72
- fields: Je,
73
- ...b ? { search: b } : {}
77
+ fields: at,
78
+ ...f ? { search: f } : {}
74
79
  })
75
- ).then((s) => s.data).catch(() => []),
76
- enabled: x,
80
+ ).then((i) => i.data).catch(() => []),
81
+ enabled: g,
77
82
  staleTime: 6e4
78
- }), N = L.data ?? [], S = new Set(N.map((s) => String(s.id).toUpperCase())), P = b.toLowerCase(), l = N.filter(
79
- (s) => !P || `${z(s)} ${s.email ?? ""}`.toLowerCase().includes(P)
80
- ), g = (C.data ?? []).filter((s) => !S.has(String(s.id).toUpperCase())), f = [...l, ...g].map((s) => s.id), [J, y] = w(""), R = f.join(",");
81
- de(() => {
82
- y((s) => f.includes(s) ? s : f[0] ?? "");
83
- }, [R]);
84
- const { data: j } = A({
85
- queryKey: ["task-open-counts", f.join(",")],
86
- queryFn: () => u.request(
87
- E("/tasks/open-counts", { ids: f.join(",") })
88
- ).then((s) => s.data).catch(() => ({})),
89
- enabled: x && f.length > 0,
83
+ }), N = I.data ?? [], q = new Set(N.map((i) => String(i.id).toUpperCase())), T = f.toLowerCase(), s = N.filter(
84
+ (i) => !T || `${z(i)} ${i.email ?? ""}`.toLowerCase().includes(T)
85
+ ), x = ($.data ?? []).filter((i) => !q.has(String(i.id).toUpperCase())), k = [...s, ...x].map((i) => i.id), [J, y] = P(""), L = k.join(",");
86
+ ue(() => {
87
+ y((i) => k.includes(i) ? i : k[0] ?? "");
88
+ }, [L]);
89
+ const { data: j } = F({
90
+ queryKey: ["task-open-counts", k.join(",")],
91
+ queryFn: () => p.request(
92
+ D("/tasks/open-counts", { ids: k.join(",") })
93
+ ).then((i) => i.data).catch(() => ({})),
94
+ enabled: g && k.length > 0,
90
95
  staleTime: 6e4
91
- }), $ = (s, F) => {
92
- const D = (j == null ? void 0 : j[String(s.id).toUpperCase()]) ?? 0;
96
+ }), X = Xe(g), R = (i, _) => {
97
+ const C = (j == null ? void 0 : j[String(i.id).toUpperCase()]) ?? 0;
93
98
  return /* @__PURE__ */ n(
94
- ve,
99
+ Se,
95
100
  {
96
- value: s.id,
101
+ value: i.id,
97
102
  onSelect: () => {
98
- i(T(s.id, d) ? null : s.id, T(s.id, d) ? null : s), c(!1);
103
+ l(E(i.id, d) ? null : i.id, E(i.id, d) ? null : i), c(!1);
99
104
  },
100
105
  className: "text-[12px]",
101
- "data-task-person": s.id,
106
+ "data-task-person": i.id,
102
107
  children: [
103
108
  /* @__PURE__ */ t(
104
- Ke,
109
+ He,
105
110
  {
106
- className: M("mr-2 h-3.5 w-3.5", T(d, s.id) ? "opacity-100" : "opacity-0")
111
+ className: M("mr-2 h-3.5 w-3.5", E(d, i.id) ? "opacity-100" : "opacity-0")
107
112
  }
108
113
  ),
114
+ /* @__PURE__ */ t(Ze, { state: X.get(String(i.id).toUpperCase()), className: "mr-1.5" }),
109
115
  /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate", children: [
110
- z(s),
111
- F != null && F.length ? /* @__PURE__ */ t("span", { className: "ml-1.5 text-[10.5px] text-muted-foreground", children: F.join(", ") }) : null
116
+ z(i),
117
+ _ != null && _.length ? /* @__PURE__ */ t("span", { className: "ml-1.5 text-[10.5px] text-muted-foreground", children: _.join(", ") }) : null
112
118
  ] }),
113
- s.is_out_of_office ? /* @__PURE__ */ t("span", { className: "ml-2 shrink-0 text-[10px] text-amber-600 dark:text-amber-400", children: "out" }) : null,
114
- D > 0 && /* @__PURE__ */ t(
119
+ i.is_out_of_office ? /* @__PURE__ */ t("span", { className: "ml-2 shrink-0 text-[10px] text-amber-600 dark:text-amber-400", children: "out" }) : null,
120
+ C > 0 && /* @__PURE__ */ t(
115
121
  "span",
116
122
  {
117
123
  className: "ml-2 shrink-0 rounded-full bg-slate-100 px-1.5 text-[10px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400",
118
- title: `${D} open task${D === 1 ? "" : "s"} already assigned`,
119
- children: D
124
+ title: `${C} open task${C === 1 ? "" : "s"} already assigned`,
125
+ children: C
120
126
  }
121
127
  )
122
128
  ]
123
129
  },
124
- s.id
130
+ i.id
125
131
  );
126
132
  };
127
- return /* @__PURE__ */ n(_e, { open: x, onOpenChange: c, children: [
128
- /* @__PURE__ */ t(we, { asChild: !0, children: /* @__PURE__ */ n(
133
+ return /* @__PURE__ */ n(Pe, { open: g, onOpenChange: c, children: [
134
+ /* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ n(
129
135
  V,
130
136
  {
131
137
  variant: "outline",
132
138
  role: "combobox",
133
- "aria-expanded": x,
139
+ "aria-expanded": g,
134
140
  "data-task-assignee-picker": !0,
135
141
  className: "h-8 w-full justify-between px-2.5 text-[12px] font-normal",
136
142
  children: [
137
143
  /* @__PURE__ */ t("span", { className: M("truncate", !d && "text-muted-foreground"), children: d ? m ?? "Selected" : "Assign to…" }),
138
- /* @__PURE__ */ t(ge, { className: "ml-1 h-3.5 w-3.5 shrink-0 opacity-50" })
144
+ /* @__PURE__ */ t(be, { className: "ml-1 h-3.5 w-3.5 shrink-0 opacity-50" })
139
145
  ]
140
146
  }
141
147
  ) }),
142
- /* @__PURE__ */ t(Ce, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ n(be, { shouldFilter: !1, value: J, onValueChange: y, children: [
148
+ /* @__PURE__ */ t(qe, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ n(ve, { shouldFilter: !1, value: J, onValueChange: y, children: [
143
149
  /* @__PURE__ */ t(
144
- ke,
150
+ _e,
145
151
  {
146
152
  placeholder: "Search people…",
147
153
  className: "h-8 text-[12px]",
@@ -149,24 +155,24 @@ function Qe({
149
155
  onValueChange: r
150
156
  }
151
157
  ),
152
- /* @__PURE__ */ n(ye, { children: [
153
- /* @__PURE__ */ t(Ne, { className: "py-3 text-center text-[12px] text-muted-foreground", children: C.isFetching ? "Searching…" : "No one matches" }),
154
- l.length > 0 && /* @__PURE__ */ t(te, { heading: "On this record", children: l.map((s) => $(s, s.reasons)) }),
155
- g.length > 0 && /* @__PURE__ */ t(te, { heading: b ? "Everyone" : "Everyone (type to search)", children: g.map((s) => $(s)) })
158
+ /* @__PURE__ */ n(we, { children: [
159
+ /* @__PURE__ */ t(Ce, { className: "py-3 text-center text-[12px] text-muted-foreground", children: $.isFetching ? "Searching…" : "No one matches" }),
160
+ s.length > 0 && /* @__PURE__ */ t(ae, { heading: "On this record", children: s.map((i) => R(i, i.reasons)) }),
161
+ x.length > 0 && /* @__PURE__ */ t(ae, { heading: f ? "Everyone" : "Everyone (type to search)", children: x.map((i) => R(i)) })
156
162
  ] })
157
163
  ] }) })
158
164
  ] });
159
165
  }
160
- function Ye(a) {
166
+ function lt(a) {
161
167
  const o = O();
162
- return A({
168
+ return F({
163
169
  queryKey: ["task-agents"],
164
- queryFn: () => o.request(E("/tasks/agents")).then((d) => d.data ?? []).catch(() => []),
170
+ queryFn: () => o.request(D("/tasks/agents")).then((d) => d.data ?? []).catch(() => []),
165
171
  enabled: a,
166
172
  staleTime: 5 * 6e4
167
173
  });
168
174
  }
169
- function Ze({
175
+ function rt({
170
176
  agents: a,
171
177
  value: o,
172
178
  onChange: d
@@ -175,7 +181,7 @@ function Ze({
175
181
  G,
176
182
  {
177
183
  value: o ?? "",
178
- onChange: (m) => d(a.find((i) => i.conn === m) ?? null),
184
+ onChange: (m) => d(a.find((l) => l.conn === m) ?? null),
179
185
  ariaLabel: "Agent",
180
186
  options: [
181
187
  { value: "", label: a.length ? "Choose an agent…" : "No agents connected" },
@@ -187,90 +193,90 @@ function Ze({
187
193
  }
188
194
  );
189
195
  }
190
- function et({
196
+ function it({
191
197
  value: a,
192
198
  onChange: o
193
199
  }) {
194
- const d = O(), { data: m = [] } = A({
200
+ const d = O(), { data: m = [] } = F({
195
201
  queryKey: ["user-groups", "task-picker"],
196
- queryFn: () => d.request(E("/user-groups")).then((i) => i.data).catch(() => []),
202
+ queryFn: () => d.request(D("/user-groups")).then((l) => l.data).catch(() => []),
197
203
  staleTime: 5 * 6e4
198
204
  });
199
205
  return /* @__PURE__ */ t(
200
206
  G,
201
207
  {
202
208
  value: a == null ? "" : String(a),
203
- onChange: (i) => {
204
- const u = m.find((x) => String(x.id) === i) ?? null;
205
- o(u ? u.id : null, u);
209
+ onChange: (l) => {
210
+ const p = m.find((g) => String(g.id) === l) ?? null;
211
+ o(p ? p.id : null, p);
206
212
  },
207
213
  ariaLabel: "Team",
208
214
  options: [
209
215
  { value: "", label: m.length ? "Choose a team…" : "No teams yet" },
210
- ...m.map((i) => ({
211
- value: String(i.id),
212
- label: `${i.name}${i.member_count ? ` · ${i.member_count}` : ""}`
216
+ ...m.map((l) => ({
217
+ value: String(l.id),
218
+ label: `${l.name}${l.member_count ? ` · ${l.member_count}` : ""}`
213
219
  }))
214
220
  ]
215
221
  }
216
222
  );
217
223
  }
218
- function Pe(a) {
219
- const o = O(), { data: d } = A({
224
+ function Ae(a) {
225
+ const o = O(), { data: d } = F({
220
226
  queryKey: ["task-field-labels", a],
221
- queryFn: () => o.request(E(`/collections/${a}`)).then((u) => u.data.fields ?? []).catch(() => []),
227
+ queryFn: () => o.request(D(`/collections/${a}`)).then((p) => p.data.fields ?? []).catch(() => []),
222
228
  staleTime: 10 * 6e4
223
229
  }), m = (d ?? []).filter(
224
- (u) => !u.hidden && u.field !== "id" && u.type !== "alias" && !u.field.startsWith("__")
225
- ), i = Ue(
226
- () => new Map(m.map((u) => [u.field, u.label || u.field.replace(/_/g, " ")])),
230
+ (p) => !p.hidden && p.field !== "id" && p.type !== "alias" && !p.field.startsWith("__")
231
+ ), l = ke(
232
+ () => new Map(m.map((p) => [p.field, p.label || p.field.replace(/_/g, " ")])),
227
233
  [m]
228
234
  );
229
- return { fields: m, labels: i };
235
+ return { fields: m, labels: l };
230
236
  }
231
- function tt({
237
+ function ot({
232
238
  collection: a,
233
239
  value: o,
234
240
  onChange: d
235
241
  }) {
236
- const { fields: m, labels: i } = Pe(a), [u, x] = w(!1), c = o[0] ?? null;
242
+ const { fields: m, labels: l } = Ae(a), [p, g] = P(!1), c = o[0] ?? null;
237
243
  return /* @__PURE__ */ n("div", { className: "space-y-1.5", "data-task-done-when": !0, children: [
238
244
  /* @__PURE__ */ t(W, { className: "block text-[11px]", children: "Close automatically when (optional)" }),
239
245
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: [
240
- /* @__PURE__ */ n(_e, { open: u, onOpenChange: x, children: [
241
- /* @__PURE__ */ t(we, { asChild: !0, children: /* @__PURE__ */ n(
246
+ /* @__PURE__ */ n(Pe, { open: p, onOpenChange: g, children: [
247
+ /* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ n(
242
248
  V,
243
249
  {
244
250
  variant: "outline",
245
251
  className: "h-8 max-w-[220px] justify-between px-2.5 text-[12px] font-normal",
246
252
  children: [
247
- /* @__PURE__ */ t("span", { className: M("truncate", !c && "text-muted-foreground"), children: c ? i.get(c.field) ?? c.field : "A field on this record…" }),
248
- /* @__PURE__ */ t(ge, { className: "ml-1 h-3.5 w-3.5 shrink-0 opacity-50" })
253
+ /* @__PURE__ */ t("span", { className: M("truncate", !c && "text-muted-foreground"), children: c ? l.get(c.field) ?? c.field : "A field on this record…" }),
254
+ /* @__PURE__ */ t(be, { className: "ml-1 h-3.5 w-3.5 shrink-0 opacity-50" })
249
255
  ]
250
256
  }
251
257
  ) }),
252
- /* @__PURE__ */ t(Ce, { className: "w-[260px] p-0", align: "start", children: /* @__PURE__ */ n(be, { children: [
253
- /* @__PURE__ */ t(ke, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
254
- /* @__PURE__ */ n(ye, { children: [
255
- /* @__PURE__ */ t(Ne, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field" }),
256
- /* @__PURE__ */ t(te, { children: m.map((h) => /* @__PURE__ */ t(
257
- ve,
258
+ /* @__PURE__ */ t(qe, { className: "w-[260px] p-0", align: "start", children: /* @__PURE__ */ n(ve, { children: [
259
+ /* @__PURE__ */ t(_e, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
260
+ /* @__PURE__ */ n(we, { children: [
261
+ /* @__PURE__ */ t(Ce, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field" }),
262
+ /* @__PURE__ */ t(ae, { children: m.map((h) => /* @__PURE__ */ t(
263
+ Se,
258
264
  {
259
- value: `${i.get(h.field)} ${h.field}`,
265
+ value: `${l.get(h.field)} ${h.field}`,
260
266
  onSelect: () => {
261
267
  d([
262
268
  { field: h.field, op: (c == null ? void 0 : c.op) ?? "nnull", value: (c == null ? void 0 : c.value) ?? null }
263
- ]), x(!1);
269
+ ]), g(!1);
264
270
  },
265
271
  className: "text-[12px]",
266
- children: i.get(h.field)
272
+ children: l.get(h.field)
267
273
  },
268
274
  h.field
269
275
  )) })
270
276
  ] })
271
277
  ] }) })
272
278
  ] }),
273
- c && /* @__PURE__ */ n(Ae, { children: [
279
+ c && /* @__PURE__ */ n(Ie, { children: [
274
280
  /* @__PURE__ */ t("div", { className: "w-[130px]", children: /* @__PURE__ */ t(
275
281
  G,
276
282
  {
@@ -283,7 +289,7 @@ function tt({
283
289
  }
284
290
  ) }),
285
291
  c.op === "eq" && /* @__PURE__ */ t(
286
- ae,
292
+ ne,
287
293
  {
288
294
  value: String(c.value ?? ""),
289
295
  onChange: (h) => d([{ ...c, value: h.target.value }]),
@@ -298,14 +304,14 @@ function tt({
298
304
  onClick: () => d([]),
299
305
  className: "rounded p-1 text-slate-400 hover:text-slate-600",
300
306
  "aria-label": "Remove condition",
301
- children: /* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" })
307
+ children: /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5" })
302
308
  }
303
309
  )
304
310
  ] })
305
311
  ] })
306
312
  ] });
307
313
  }
308
- const at = () => ({
314
+ const dt = () => ({
309
315
  title: "",
310
316
  description: "",
311
317
  mode: "person",
@@ -320,7 +326,7 @@ const at = () => ({
320
326
  priority: "normal",
321
327
  doneWhen: []
322
328
  });
323
- function nt(a) {
329
+ function ct(a) {
324
330
  return {
325
331
  title: a.title,
326
332
  description: a.description ?? "",
@@ -334,22 +340,22 @@ function nt(a) {
334
340
  teamName: a.team_name ?? null,
335
341
  due: a.due_date ? String(a.due_date).slice(0, 10) : "",
336
342
  priority: a.priority ?? "normal",
337
- doneWhen: Se(a.done_when)
343
+ doneWhen: Te(a.done_when)
338
344
  };
339
345
  }
340
- function pe({
346
+ function xe({
341
347
  collection: a,
342
348
  item: o,
343
349
  initial: d,
344
350
  submitLabel: m,
345
- busy: i,
346
- allowTeam: u,
347
- allowAgent: x = !1,
351
+ busy: l,
352
+ allowTeam: p,
353
+ allowAgent: g = !1,
348
354
  onSubmit: c,
349
355
  onCancel: h
350
356
  }) {
351
- var P;
352
- const [r, b] = w(d), k = (l, g) => b((f) => ({ ...f, [l]: g })), L = Ye(x).data ?? [], C = x && (L.length > 0 || r.mode === "agent"), N = r.mode === "team" ? r.teamId != null : r.mode === "agent" ? !!r.agent : !!r.assignee, S = r.mode === "person" && ((P = r.assigneePerson) != null && P.is_out_of_office) ? r.assigneePerson : null;
357
+ var T;
358
+ const [r, f] = P(d), b = (s, x) => f((k) => ({ ...k, [s]: x })), I = lt(g).data ?? [], $ = g && (I.length > 0 || r.mode === "agent"), N = r.mode === "team" ? r.teamId != null : r.mode === "agent" ? !!r.agent : !!r.assignee, q = r.mode === "person" && ((T = r.assigneePerson) != null && T.is_out_of_office) ? r.assigneePerson : null;
353
359
  return /* @__PURE__ */ n(
354
360
  "div",
355
361
  {
@@ -359,10 +365,10 @@ function pe({
359
365
  /* @__PURE__ */ n("div", { children: [
360
366
  /* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Title" }),
361
367
  /* @__PURE__ */ t(
362
- ae,
368
+ ne,
363
369
  {
364
370
  value: r.title,
365
- onChange: (l) => k("title", l.target.value),
371
+ onChange: (s) => b("title", s.target.value),
366
372
  className: "h-8 bg-white text-[12px] dark:bg-background",
367
373
  placeholder: "What needs to be done?",
368
374
  autoFocus: !0,
@@ -373,10 +379,10 @@ function pe({
373
379
  /* @__PURE__ */ n("div", { children: [
374
380
  /* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Details (optional)" }),
375
381
  /* @__PURE__ */ t(
376
- Ge,
382
+ et,
377
383
  {
378
384
  value: r.description,
379
- onChange: (l) => k("description", l.target.value),
385
+ onChange: (s) => b("description", s.target.value),
380
386
  className: "min-h-[56px] bg-white text-[12px] dark:bg-background",
381
387
  placeholder: "Anything the person needs to know",
382
388
  rows: 2,
@@ -392,51 +398,51 @@ function pe({
392
398
  /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "ml-0.5 text-red-500", "data-task-required": !0, children: "*" })
393
399
  ] }),
394
400
  /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: ["person", "team", "agent"].filter(
395
- (l) => l !== r.mode && (l !== "team" || u) && (l !== "agent" || C)
396
- ).map((l) => /* @__PURE__ */ t(
401
+ (s) => s !== r.mode && (s !== "team" || p) && (s !== "agent" || $)
402
+ ).map((s) => /* @__PURE__ */ t(
397
403
  "button",
398
404
  {
399
405
  type: "button",
400
- "data-task-mode": l,
401
- onClick: () => k("mode", l),
406
+ "data-task-mode": s,
407
+ onClick: () => b("mode", s),
402
408
  className: "text-[10.5px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200",
403
- children: l === "person" ? "A person" : l === "team" ? "A team" : "An agent"
409
+ children: s === "person" ? "A person" : s === "team" ? "A team" : "An agent"
404
410
  },
405
- l
411
+ s
406
412
  )) })
407
413
  ] }),
408
414
  r.mode === "agent" ? /* @__PURE__ */ t(
409
- Ze,
415
+ rt,
410
416
  {
411
- agents: L,
417
+ agents: I,
412
418
  value: r.agent,
413
- onChange: (l) => b((g) => ({ ...g, agent: (l == null ? void 0 : l.conn) ?? null, agentName: (l == null ? void 0 : l.name) ?? null }))
419
+ onChange: (s) => f((x) => ({ ...x, agent: (s == null ? void 0 : s.conn) ?? null, agentName: (s == null ? void 0 : s.name) ?? null }))
414
420
  }
415
421
  ) : r.mode === "team" ? /* @__PURE__ */ t(
416
- et,
422
+ it,
417
423
  {
418
424
  value: r.teamId,
419
- onChange: (l, g) => b((f) => ({ ...f, teamId: l, teamName: (g == null ? void 0 : g.name) ?? null }))
425
+ onChange: (s, x) => f((k) => ({ ...k, teamId: s, teamName: (x == null ? void 0 : x.name) ?? null }))
420
426
  }
421
427
  ) : /* @__PURE__ */ t(
422
- Qe,
428
+ st,
423
429
  {
424
430
  collection: a,
425
431
  item: o,
426
432
  value: r.assignee,
427
433
  valueLabel: r.assigneeName,
428
- onChange: (l, g) => b((f) => ({
429
- ...f,
430
- assignee: l,
431
- assigneeName: g ? z(g) : null,
432
- assigneePerson: g
434
+ onChange: (s, x) => f((k) => ({
435
+ ...k,
436
+ assignee: s,
437
+ assigneeName: x ? z(x) : null,
438
+ assigneePerson: x
433
439
  }))
434
440
  }
435
441
  ),
436
- S && /* @__PURE__ */ n("p", { className: "mt-1 rounded bg-amber-50 px-2 py-1 text-[11px] text-amber-700 dark:bg-amber-400/10 dark:text-amber-400", children: [
437
- z(S),
442
+ q && /* @__PURE__ */ n("p", { className: "mt-1 rounded bg-amber-50 px-2 py-1 text-[11px] text-amber-700 dark:bg-amber-400/10 dark:text-amber-400", children: [
443
+ z(q),
438
444
  " is out of office",
439
- S.ooo_end ? ` until ${String(S.ooo_end).slice(0, 10)}` : "",
445
+ q.ooo_end ? ` until ${String(q.ooo_end).slice(0, 10)}` : "",
440
446
  " — the task goes to their delegate if one is set."
441
447
  ] }),
442
448
  r.mode === "team" && /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "Waits with the team until one of them picks it up." }),
@@ -445,11 +451,11 @@ function pe({
445
451
  /* @__PURE__ */ n("div", { children: [
446
452
  /* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Due date" }),
447
453
  /* @__PURE__ */ t(
448
- ae,
454
+ ne,
449
455
  {
450
456
  type: "date",
451
457
  value: r.due,
452
- onChange: (l) => k("due", l.target.value),
458
+ onChange: (s) => b("due", s.target.value),
453
459
  className: "h-8 bg-white text-[12px] dark:bg-background",
454
460
  "data-task-due": !0
455
461
  }
@@ -461,7 +467,7 @@ function pe({
461
467
  G,
462
468
  {
463
469
  value: r.priority,
464
- onChange: (l) => k("priority", l),
470
+ onChange: (s) => b("priority", s),
465
471
  options: [
466
472
  { value: "low", label: "Low" },
467
473
  { value: "normal", label: "Normal" },
@@ -472,11 +478,11 @@ function pe({
472
478
  ] })
473
479
  ] }),
474
480
  /* @__PURE__ */ t(
475
- tt,
481
+ ot,
476
482
  {
477
483
  collection: a,
478
484
  value: r.doneWhen,
479
- onChange: (l) => k("doneWhen", l)
485
+ onChange: (s) => b("doneWhen", s)
480
486
  }
481
487
  ),
482
488
  /* @__PURE__ */ n("div", { className: "flex justify-end gap-2", children: [
@@ -495,7 +501,7 @@ function pe({
495
501
  "span",
496
502
  {
497
503
  className: "inline-flex",
498
- "data-tip": i ? void 0 : r.title.trim() ? N ? void 0 : r.mode === "team" ? "Pick a team first" : r.mode === "agent" ? "Pick an agent first" : "Pick an assignee first" : "Write what needs to be done first",
504
+ "data-tip": l ? void 0 : r.title.trim() ? N ? void 0 : r.mode === "team" ? "Pick a team first" : r.mode === "agent" ? "Pick an agent first" : "Pick an assignee first" : "Write what needs to be done first",
499
505
  children: [
500
506
  /* @__PURE__ */ t(
501
507
  V,
@@ -503,14 +509,14 @@ function pe({
503
509
  type: "button",
504
510
  size: "sm",
505
511
  className: "h-7 text-[12px]",
506
- disabled: !r.title.trim() || !N || i,
507
- "aria-describedby": !i && r.title.trim() && !N ? "task-submit-why" : void 0,
512
+ disabled: !r.title.trim() || !N || l,
513
+ "aria-describedby": !l && r.title.trim() && !N ? "task-submit-why" : void 0,
508
514
  onClick: () => c(r),
509
515
  "data-task-submit": !0,
510
- children: i ? "Saving…" : m
516
+ children: l ? "Saving…" : m
511
517
  }
512
518
  ),
513
- !i && r.title.trim() && !N && /* @__PURE__ */ t(
519
+ !l && r.title.trim() && !N && /* @__PURE__ */ t(
514
520
  "span",
515
521
  {
516
522
  id: "task-submit-why",
@@ -527,10 +533,10 @@ function pe({
527
533
  }
528
534
  );
529
535
  }
530
- function he({ taskId: a }) {
531
- const o = O(), { data: d = [], isLoading: m } = A({
536
+ function fe({ taskId: a }) {
537
+ const o = O(), { data: d = [], isLoading: m } = F({
532
538
  queryKey: ["task-history", a],
533
- queryFn: () => o.request(E(`/tasks/${a}/history`)).then((i) => i.data),
539
+ queryFn: () => o.request(D(`/tasks/${a}/history`)).then((l) => l.data),
534
540
  staleTime: 3e4
535
541
  });
536
542
  return m ? /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "Loading history…" }) : d.length ? /* @__PURE__ */ t(
@@ -538,37 +544,51 @@ function he({ taskId: a }) {
538
544
  {
539
545
  className: "mt-1.5 space-y-1 border-l border-slate-200 pl-3 dark:border-border",
540
546
  "data-task-history": !0,
541
- children: d.map((i) => /* @__PURE__ */ n("li", { className: "text-[11px] text-slate-600 dark:text-slate-400", children: [
542
- /* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-slate-200", children: i.text }),
547
+ children: d.map((l) => /* @__PURE__ */ n("li", { className: "text-[11px] text-slate-600 dark:text-slate-400", children: [
548
+ /* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-slate-200", children: l.text }),
543
549
  /* @__PURE__ */ n("span", { className: "text-slate-400", children: [
544
550
  " ",
545
551
  "· ",
546
- i.user_name ? `${i.user_name}, ` : "",
547
- /* @__PURE__ */ t("span", { title: fe(i.at), children: xe(i.at) })
552
+ l.user_name ? `${l.user_name}, ` : "",
553
+ /* @__PURE__ */ t("span", { title: ye(l.at), children: /* @__PURE__ */ t(Ne, { value: l.at }) })
548
554
  ] })
549
- ] }, i.id))
555
+ ] }, l.id))
550
556
  }
551
557
  ) : /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "No history yet." });
552
558
  }
553
- function _t({
559
+ function It({
554
560
  collection: a,
555
561
  item: o,
556
562
  title: d,
557
563
  defaultExpanded: m,
558
- queuedTasks: i,
559
- onQueueTask: u,
560
- onRemoveQueuedTask: x
564
+ queuedTasks: l,
565
+ onQueueTask: p,
566
+ onRemoveQueuedTask: g
561
567
  }) {
562
- const c = O(), h = Ee(), { isAdmin: r, userId: b } = Me(), [k, L] = Ve(m, !1), [C, N] = w(!1), [S, P] = w(null), [l, g] = w(null), [f, J] = w(!1), y = !o || o === "new", { data: R = [] } = A({
568
+ const c = O(), h = Le(), { isAdmin: r, userId: f } = Be(), [b, I] = Qe(m, !1), [$, N] = P(!1), [q, T] = P(null), [s, x] = P(null), [k, J] = P(!1), y = !o || o === "new", { data: L = [], isSuccess: j } = F({
563
569
  queryKey: ["tasks", a, o],
564
- queryFn: () => c.request(E("/tasks", { collection: a, item: o })).then((e) => e.data),
570
+ queryFn: () => c.request(D("/tasks", { collection: a, item: o })).then((e) => e.data),
565
571
  enabled: !!a && !y
566
- }), { labels: j } = Pe(a), $ = () => {
567
- Be(h, a, o), h.invalidateQueries({ queryKey: ["task-history"] });
568
- }, s = (e, p) => {
569
- var I;
570
- return ((I = e == null ? void 0 : e.response) == null ? void 0 : I.error) ?? (e instanceof Error && e.message ? e.message : p);
571
- }, F = (e) => ({
572
+ }), { labels: X } = Ae(a), R = ke(
573
+ () => L.flatMap((e) => {
574
+ const u = e, S = [{ at: u.created_at, by: u.created_by }];
575
+ return u.completed_at && S.push({ at: u.completed_at, by: u.completed_by ?? null }), S;
576
+ }),
577
+ [L]
578
+ ), i = Je({
579
+ userId: f,
580
+ collection: a,
581
+ item: o,
582
+ tab: "tasks",
583
+ open: b,
584
+ entries: R,
585
+ ready: !y && j
586
+ }), _ = () => {
587
+ Ge(h, a, o), h.invalidateQueries({ queryKey: ["task-history"] });
588
+ }, C = (e, u) => {
589
+ var S;
590
+ return ((S = e == null ? void 0 : e.response) == null ? void 0 : S.error) ?? (e instanceof Error && e.message ? e.message : u);
591
+ }, se = (e) => ({
572
592
  title: e.title.trim(),
573
593
  description: e.description.trim() || null,
574
594
  assignee: e.mode === "person" ? e.assignee : null,
@@ -577,46 +597,46 @@ function _t({
577
597
  due_date: e.due || null,
578
598
  priority: e.priority,
579
599
  done_when: e.doneWhen.length ? e.doneWhen : null
580
- }), D = U({
600
+ }), le = K({
581
601
  mutationFn: (e) => c.request(
582
- Y("/tasks", { collection: a, item: o, ...F(e) })
602
+ Z("/tasks", { collection: a, item: o, ...se(e) })
583
603
  ),
584
604
  onSuccess: (e) => {
585
- var p;
586
- $(), N(!1), _.success(
587
- (p = e == null ? void 0 : e.data) != null && p.delegated_from ? "Task created — it went to their delegate" : "Task created"
605
+ var u;
606
+ _(), N(!1), w.success(
607
+ (u = e == null ? void 0 : e.data) != null && u.delegated_from ? "Task created — it went to their delegate" : "Task created"
588
608
  );
589
609
  },
590
- onError: (e) => _.error(s(e, "Could not create the task"))
591
- }), H = U({
592
- mutationFn: ({ id: e, body: p }) => c.request(Re(`/tasks/${e}`, p)),
593
- onSuccess: (e, p) => {
594
- $(), P(null), p.body.status === "open" ? _.success("Task reopened") : _.success("Task updated");
610
+ onError: (e) => w.error(C(e, "Could not create the task"))
611
+ }), H = K({
612
+ mutationFn: ({ id: e, body: u }) => c.request(Ve(`/tasks/${e}`, u)),
613
+ onSuccess: (e, u) => {
614
+ _(), T(null), u.body.status === "open" ? w.success("Task reopened") : w.success("Task updated");
595
615
  },
596
- onError: (e) => _.error(s(e, "Could not update the task"))
597
- }), ne = U({
598
- mutationFn: (e) => c.request(Y(`/tasks/${e}/complete`, {})),
616
+ onError: (e) => w.error(C(e, "Could not update the task"))
617
+ }), re = K({
618
+ mutationFn: (e) => c.request(Z(`/tasks/${e}/complete`, {})),
599
619
  onSuccess: () => {
600
- $(), _.success("Task completed");
620
+ _(), w.success("Task completed");
601
621
  },
602
- onError: (e) => _.error(s(e, "Could not complete the task"))
603
- }), se = U({
604
- mutationFn: (e) => c.request(Y(`/tasks/${e}/claim`, {})),
622
+ onError: (e) => w.error(C(e, "Could not complete the task"))
623
+ }), ie = K({
624
+ mutationFn: (e) => c.request(Z(`/tasks/${e}/claim`, {})),
605
625
  onSuccess: () => {
606
- $(), _.success("It’s yours");
626
+ _(), w.success("It’s yours");
607
627
  },
608
- onError: (e) => _.error(s(e, "Could not pick it up"))
609
- }), le = U({
610
- mutationFn: (e) => c.request(He(`/tasks/${e}`)),
628
+ onError: (e) => w.error(C(e, "Could not pick it up"))
629
+ }), oe = K({
630
+ mutationFn: (e) => c.request(ze(`/tasks/${e}`)),
611
631
  onSuccess: () => {
612
- $(), _.success("Task deleted");
632
+ _(), w.success("Task deleted");
613
633
  },
614
- onError: (e) => _.error(s(e, "Could not delete the task"))
634
+ onError: (e) => w.error(C(e, "Could not delete the task"))
615
635
  });
616
636
  if (!a) return null;
617
- const v = R.filter((e) => ce.has(e.status)), X = R.filter((e) => !ce.has(e.status)), $e = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), Q = (e) => r || T(e.assignee, b) || T(e.created_by, b), qe = (e) => r || T(e.created_by, b);
618
- function Te(e) {
619
- u == null || u({
637
+ const v = L.filter((e) => pe.has(e.status)), Q = L.filter((e) => !pe.has(e.status)), Ee = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), Y = (e) => r || E(e.assignee, f) || E(e.created_by, f), Fe = (e) => r || E(e.created_by, f);
638
+ function De(e) {
639
+ p == null || p({
620
640
  title: e.title.trim(),
621
641
  description: e.description.trim() || void 0,
622
642
  assignee: e.mode === "person" ? e.assignee : null,
@@ -627,17 +647,17 @@ function _t({
627
647
  priority: e.priority
628
648
  }), N(!1);
629
649
  }
630
- const ie = (e, p) => {
631
- const I = !p && !!e.due_date && String(e.due_date).slice(0, 10) < $e;
650
+ const de = (e, u) => {
651
+ const S = !u && !!e.due_date && String(e.due_date).slice(0, 10) < Ee;
632
652
  return /* @__PURE__ */ n("div", { className: "mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-slate-400", children: [
633
- /* @__PURE__ */ t(ue, { priority: e.priority }),
653
+ /* @__PURE__ */ t(ge, { priority: e.priority }),
634
654
  e.agent_assignee ? /* @__PURE__ */ n(
635
655
  "span",
636
656
  {
637
657
  className: "inline-flex items-center gap-1 text-[#0e7490] dark:text-[#67e8f9]",
638
658
  "data-task-agent": e.agent_assignee,
639
659
  children: [
640
- /* @__PURE__ */ t(Ie, { className: "h-3 w-3", "aria-hidden": !0 }),
660
+ /* @__PURE__ */ t(je, { className: "h-3 w-3", "aria-hidden": !0 }),
641
661
  e.agent_name ?? "An agent",
642
662
  e.assignee_name && /* @__PURE__ */ n("span", { className: "text-slate-400", children: [
643
663
  "for ",
@@ -646,52 +666,52 @@ function _t({
646
666
  ]
647
667
  }
648
668
  ) : e.assignee ? /* @__PURE__ */ t("span", { children: e.assignee_name ?? "Someone" }) : e.team_id != null ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
649
- /* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
669
+ /* @__PURE__ */ t(Ue, { className: "h-3 w-3" }),
650
670
  "Waiting for ",
651
671
  e.team_name ?? "the team"
652
672
  ] }) : null,
653
- !p && e.due_date && /* @__PURE__ */ n("span", { className: M(I && "font-medium text-red-500"), children: [
673
+ !u && e.due_date && /* @__PURE__ */ n("span", { className: M(S && "font-medium text-red-500"), children: [
654
674
  "Due ",
655
- Z(e.due_date),
656
- I && " (overdue)"
675
+ ee(e.due_date),
676
+ S && " (overdue)"
657
677
  ] }),
658
- p && e.completed_at && /* @__PURE__ */ n("span", { "data-task-completed-by": !0, children: [
678
+ u && e.completed_at && /* @__PURE__ */ n("span", { "data-task-completed-by": !0, children: [
659
679
  e.status === "cancelled" ? "Cancelled" : `Done${e.completed_by_name ? ` by ${e.completed_by_name}` : ""}`,
660
680
  " ",
661
- /* @__PURE__ */ t("span", { title: fe(e.completed_at), children: xe(e.completed_at) })
681
+ /* @__PURE__ */ t("span", { title: ye(e.completed_at), children: /* @__PURE__ */ t(Ne, { value: e.completed_at }) })
662
682
  ] }),
663
- e.created_by_name && !T(e.created_by, e.assignee) && /* @__PURE__ */ n("span", { children: [
683
+ e.created_by_name && !E(e.created_by, e.assignee) && /* @__PURE__ */ n("span", { children: [
664
684
  "Asked by ",
665
685
  e.created_by_name
666
686
  ] })
667
687
  ] });
668
- }, re = (e, p) => /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-0.5", children: [
669
- !p && /* @__PURE__ */ t(ze, { task: e, compact: !0, onTaskChanged: $ }),
688
+ }, ce = (e, u) => /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-0.5", children: [
689
+ !u && /* @__PURE__ */ t(Ye, { task: e, compact: !0, onTaskChanged: _ }),
670
690
  /* @__PURE__ */ t(
671
691
  "button",
672
692
  {
673
693
  type: "button",
674
- onClick: () => g(l === e.id ? null : e.id),
694
+ onClick: () => x(s === e.id ? null : e.id),
675
695
  className: "rounded p-1 text-slate-300 transition-colors hover:bg-muted hover:text-slate-600",
676
696
  "aria-label": `History of ${e.title}`,
677
697
  title: "History",
678
698
  "data-task-history-toggle": e.id,
679
- children: /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" })
699
+ children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
680
700
  }
681
701
  ),
682
- !p && Q(e) && /* @__PURE__ */ t(
702
+ !u && Y(e) && /* @__PURE__ */ t(
683
703
  "button",
684
704
  {
685
705
  type: "button",
686
- onClick: () => P(S === e.id ? null : e.id),
706
+ onClick: () => T(q === e.id ? null : e.id),
687
707
  className: "rounded p-1 text-slate-300 transition-colors hover:bg-muted hover:text-slate-600",
688
708
  "aria-label": `Edit ${e.title}`,
689
709
  title: "Edit",
690
710
  "data-task-edit": e.id,
691
- children: /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" })
711
+ children: /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" })
692
712
  }
693
713
  ),
694
- p && Q(e) && /* @__PURE__ */ n(
714
+ u && Y(e) && /* @__PURE__ */ n(
695
715
  "button",
696
716
  {
697
717
  type: "button",
@@ -700,21 +720,21 @@ function _t({
700
720
  className: "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:hover:text-slate-200",
701
721
  "data-task-reopen": e.id,
702
722
  children: [
703
- /* @__PURE__ */ t(je, { className: "h-3 w-3" }),
723
+ /* @__PURE__ */ t(Re, { className: "h-3 w-3" }),
704
724
  "Reopen"
705
725
  ]
706
726
  }
707
727
  ),
708
- qe(e) && /* @__PURE__ */ t(
728
+ Fe(e) && /* @__PURE__ */ t(
709
729
  "button",
710
730
  {
711
731
  type: "button",
712
- onClick: () => le.mutate(e.id),
713
- disabled: le.isPending,
732
+ onClick: () => oe.mutate(e.id),
733
+ disabled: oe.isPending,
714
734
  className: "rounded p-1 text-slate-300 transition-colors hover:bg-red-50 hover:text-red-400 disabled:opacity-40 dark:hover:bg-red-500/10",
715
735
  "aria-label": `Delete ${e.title}`,
716
736
  title: "Delete",
717
- children: /* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" })
737
+ children: /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5" })
718
738
  }
719
739
  )
720
740
  ] });
@@ -723,42 +743,43 @@ function _t({
723
743
  "button",
724
744
  {
725
745
  type: "button",
726
- onClick: () => L((e) => !e),
727
- "aria-expanded": k,
728
- "data-task-panel-toggle": k ? "open" : "closed",
746
+ onClick: () => I((e) => !e),
747
+ "aria-expanded": b,
748
+ "data-task-panel-toggle": b ? "open" : "closed",
729
749
  className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
730
750
  children: [
731
751
  /* @__PURE__ */ n("span", { className: "flex w-full items-center gap-2.5", children: [
732
- /* @__PURE__ */ t(Fe, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
752
+ /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
733
753
  /* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: d || "Tasks" }),
734
- (y ? (i ?? []).length : v.length) > 0 && /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: y ? `${(i ?? []).length} queued` : `${v.length} open` }),
754
+ (y ? (l ?? []).length : v.length) > 0 && /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: y ? `${(l ?? []).length} queued` : `${v.length} open` }),
755
+ /* @__PURE__ */ t(tt, { count: i, tab: "tasks" }),
735
756
  /* @__PURE__ */ t(
736
- oe,
757
+ me,
737
758
  {
738
- className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${k ? " rotate-180" : ""}`
759
+ className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${b ? " rotate-180" : ""}`
739
760
  }
740
761
  )
741
762
  ] }),
742
- !k && v.length > 0 && /* @__PURE__ */ n("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
763
+ !b && v.length > 0 && /* @__PURE__ */ n("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
743
764
  v[v.length - 1].title,
744
765
  v[v.length - 1].due_date && /* @__PURE__ */ n("span", { className: "text-slate-400/80", children: [
745
766
  " ",
746
767
  "· due ",
747
- Z(v[v.length - 1].due_date)
768
+ ee(v[v.length - 1].due_date)
748
769
  ] })
749
770
  ] })
750
771
  ]
751
772
  }
752
773
  ),
753
- k && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 dark:border-border/60", children: /* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-3", children: [
754
- y && (i ?? []).length > 0 && /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (i ?? []).map((e, p) => (
774
+ b && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 dark:border-border/60", children: /* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-3", children: [
775
+ y && (l ?? []).length > 0 && /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (l ?? []).map((e, u) => (
755
776
  // biome-ignore lint/suspicious/noArrayIndexKey: queued rows have no id yet
756
777
  /* @__PURE__ */ n("div", { className: "flex items-start gap-2.5 py-2", children: [
757
778
  /* @__PURE__ */ t("span", { className: "mt-0.5 inline-flex shrink-0 items-center rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-500/15 dark:text-amber-400", children: "Pending" }),
758
779
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
759
780
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: e.title }),
760
781
  /* @__PURE__ */ n("div", { className: "mt-0.5 flex items-center gap-3 text-[11px] text-slate-400", children: [
761
- /* @__PURE__ */ t(ue, { priority: e.priority }),
782
+ /* @__PURE__ */ t(ge, { priority: e.priority }),
762
783
  e.assignee_name && /* @__PURE__ */ t("span", { children: e.assignee_name }),
763
784
  e.team_name && /* @__PURE__ */ n("span", { children: [
764
785
  "Team: ",
@@ -766,87 +787,87 @@ function _t({
766
787
  ] }),
767
788
  e.due_date && /* @__PURE__ */ n("span", { children: [
768
789
  "Due ",
769
- Z(e.due_date)
790
+ ee(e.due_date)
770
791
  ] })
771
792
  ] })
772
793
  ] }),
773
- x && /* @__PURE__ */ t(
794
+ g && /* @__PURE__ */ t(
774
795
  "button",
775
796
  {
776
797
  type: "button",
777
- onClick: () => x(p),
798
+ onClick: () => g(u),
778
799
  className: "shrink-0 rounded p-1 text-slate-300 hover:text-red-400",
779
800
  "aria-label": `Remove ${e.title}`,
780
- children: /* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" })
801
+ children: /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5" })
781
802
  }
782
803
  )
783
- ] }, p)
804
+ ] }, u)
784
805
  )) }),
785
- y && (i ?? []).length === 0 && !C && /* @__PURE__ */ t("p", { className: "py-1 text-[12px] text-slate-400", children: "Tasks are created once the record is saved." }),
786
- !y && v.length === 0 && !C && /* @__PURE__ */ t("p", { className: "py-1 text-[13px] text-slate-400", children: "No open tasks" }),
806
+ y && (l ?? []).length === 0 && !$ && /* @__PURE__ */ t("p", { className: "py-1 text-[12px] text-slate-400", children: "Tasks are created once the record is saved." }),
807
+ !y && v.length === 0 && !$ && /* @__PURE__ */ t("p", { className: "py-1 text-[13px] text-slate-400", children: "No open tasks" }),
787
808
  !y && v.length > 0 && /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: v.map((e) => {
788
- const p = Se(e.done_when), I = !e.assignee && e.team_id != null;
809
+ const u = Te(e.done_when), S = !e.assignee && e.team_id != null;
789
810
  return /* @__PURE__ */ n("div", { className: "nvr-rise-in py-2", "data-task-row": e.id, children: [
790
811
  /* @__PURE__ */ n("div", { className: "flex items-start gap-2.5", children: [
791
812
  /* @__PURE__ */ t(
792
- me,
813
+ he,
793
814
  {
794
815
  className: "mt-0.5",
795
816
  checked: !1,
796
- onCheckedChange: () => ne.mutate(e.id),
797
- disabled: ne.isPending || !Q(e),
817
+ onCheckedChange: () => re.mutate(e.id),
818
+ disabled: re.isPending || !Y(e),
798
819
  "aria-label": `Complete task: ${e.title}`
799
820
  }
800
821
  ),
801
822
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
802
823
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: e.title }),
803
824
  e.description && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 whitespace-pre-line text-[12px] text-slate-500", children: e.description }),
804
- ie(e, !1),
805
- p.length > 0 && /* @__PURE__ */ n("p", { className: "mt-0.5 text-[11px] text-slate-500", "data-task-rule": !0, children: [
825
+ de(e, !1),
826
+ u.length > 0 && /* @__PURE__ */ n("p", { className: "mt-0.5 text-[11px] text-slate-500", "data-task-rule": !0, children: [
806
827
  "Closes itself when ",
807
- Xe(p, j)
828
+ nt(u, X)
808
829
  ] }),
809
- I && /* @__PURE__ */ t(
830
+ S && /* @__PURE__ */ t(
810
831
  "button",
811
832
  {
812
833
  type: "button",
813
- onClick: () => se.mutate(e.id),
814
- disabled: se.isPending,
834
+ onClick: () => ie.mutate(e.id),
835
+ disabled: ie.isPending,
815
836
  className: "mt-1 rounded border border-slate-200 px-2 py-0.5 text-[11px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:text-slate-300",
816
837
  "data-task-claim": e.id,
817
838
  children: "Pick it up"
818
839
  }
819
840
  )
820
841
  ] }),
821
- re(e, !1)
842
+ ce(e, !1)
822
843
  ] }),
823
- S === e.id && /* @__PURE__ */ t("div", { className: "mt-2 pl-6", children: /* @__PURE__ */ t(
824
- pe,
844
+ q === e.id && /* @__PURE__ */ t("div", { className: "mt-2 pl-6", children: /* @__PURE__ */ t(
845
+ xe,
825
846
  {
826
847
  collection: a,
827
848
  item: o,
828
- initial: nt(e),
849
+ initial: ct(e),
829
850
  submitLabel: "Save changes",
830
851
  busy: H.isPending,
831
852
  allowTeam: !1,
832
853
  allowAgent: !0,
833
- onCancel: () => P(null),
834
- onSubmit: (q) => {
835
- const K = F(q), B = {
836
- title: K.title,
837
- description: K.description,
838
- due_date: K.due_date,
839
- priority: K.priority,
840
- done_when: K.done_when
854
+ onCancel: () => T(null),
855
+ onSubmit: (A) => {
856
+ const U = se(A), B = {
857
+ title: U.title,
858
+ description: U.description,
859
+ due_date: U.due_date,
860
+ priority: U.priority,
861
+ done_when: U.done_when
841
862
  };
842
- q.mode === "agent" ? q.agent && q.agent !== e.agent_assignee && (B.agent = q.agent) : q.mode === "person" && (T(q.assignee, e.assignee) ? e.agent_assignee && (B.agent = null) : B.assignee = q.assignee), H.mutate({ id: e.id, body: B });
863
+ A.mode === "agent" ? A.agent && A.agent !== e.agent_assignee && (B.agent = A.agent) : A.mode === "person" && (E(A.assignee, e.assignee) ? e.agent_assignee && (B.agent = null) : B.assignee = A.assignee), H.mutate({ id: e.id, body: B });
843
864
  }
844
865
  }
845
866
  ) }),
846
- l === e.id && /* @__PURE__ */ t("div", { className: "pl-6", children: /* @__PURE__ */ t(he, { taskId: e.id }) })
867
+ s === e.id && /* @__PURE__ */ t("div", { className: "pl-6", children: /* @__PURE__ */ t(fe, { taskId: e.id }) })
847
868
  ] }, e.id);
848
869
  }) }),
849
- !C && /* @__PURE__ */ n(
870
+ !$ && /* @__PURE__ */ n(
850
871
  "button",
851
872
  {
852
873
  type: "button",
@@ -854,26 +875,26 @@ function _t({
854
875
  className: "flex items-center gap-1.5 text-[12px] text-slate-400 transition-colors hover:text-nvr-cyan",
855
876
  "data-task-add": !0,
856
877
  children: [
857
- /* @__PURE__ */ t(De, { className: "h-3.5 w-3.5" }),
878
+ /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }),
858
879
  "Add task"
859
880
  ]
860
881
  }
861
882
  ),
862
- C && /* @__PURE__ */ t(
863
- pe,
883
+ $ && /* @__PURE__ */ t(
884
+ xe,
864
885
  {
865
886
  collection: a,
866
887
  item: o,
867
- initial: at(),
888
+ initial: dt(),
868
889
  submitLabel: y ? "Queue task" : "Create task",
869
- busy: D.isPending,
890
+ busy: le.isPending,
870
891
  allowTeam: !0,
871
892
  allowAgent: !y,
872
893
  onCancel: () => N(!1),
873
- onSubmit: (e) => y ? Te(e) : D.mutate(e)
894
+ onSubmit: (e) => y ? De(e) : le.mutate(e)
874
895
  }
875
896
  ),
876
- !y && X.length > 0 && /* @__PURE__ */ n("div", { children: [
897
+ !y && Q.length > 0 && /* @__PURE__ */ n("div", { children: [
877
898
  /* @__PURE__ */ n(
878
899
  "button",
879
900
  {
@@ -882,24 +903,24 @@ function _t({
882
903
  className: "flex items-center gap-1 text-[12px] text-slate-400 transition-colors hover:text-slate-600",
883
904
  children: [
884
905
  /* @__PURE__ */ t(
885
- oe,
906
+ me,
886
907
  {
887
908
  className: M(
888
909
  "h-3.5 w-3.5 transition-transform",
889
- f && "rotate-180"
910
+ k && "rotate-180"
890
911
  )
891
912
  }
892
913
  ),
893
914
  "Completed (",
894
- X.length,
915
+ Q.length,
895
916
  ")"
896
917
  ]
897
918
  }
898
919
  ),
899
- f && /* @__PURE__ */ t("div", { className: "mt-1 divide-y divide-slate-100 dark:divide-border/60", children: X.map((e) => /* @__PURE__ */ n("div", { className: "nvr-rise-in py-2", "data-task-row": e.id, children: [
920
+ k && /* @__PURE__ */ t("div", { className: "mt-1 divide-y divide-slate-100 dark:divide-border/60", children: Q.map((e) => /* @__PURE__ */ n("div", { className: "nvr-rise-in py-2", "data-task-row": e.id, children: [
900
921
  /* @__PURE__ */ n("div", { className: "flex items-start gap-2.5", children: [
901
922
  /* @__PURE__ */ t(
902
- me,
923
+ he,
903
924
  {
904
925
  className: "mt-0.5 opacity-60",
905
926
  checked: !0,
@@ -909,16 +930,16 @@ function _t({
909
930
  ),
910
931
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1 opacity-70", children: [
911
932
  /* @__PURE__ */ t("p", { className: "text-[13px] text-slate-600 line-through dark:text-slate-400", children: e.title }),
912
- ie(e, !0)
933
+ de(e, !0)
913
934
  ] }),
914
- re(e, !0)
935
+ ce(e, !0)
915
936
  ] }),
916
- l === e.id && /* @__PURE__ */ t("div", { className: "pl-6", children: /* @__PURE__ */ t(he, { taskId: e.id }) })
937
+ s === e.id && /* @__PURE__ */ t("div", { className: "pl-6", children: /* @__PURE__ */ t(fe, { taskId: e.id }) })
917
938
  ] }, e.id)) })
918
939
  ] })
919
940
  ] }) })
920
941
  ] });
921
942
  }
922
943
  export {
923
- _t as TaskPanel
944
+ It as TaskPanel
924
945
  };