@nivaro/react 0.3.114 → 0.3.116

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 (293) 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 +1728 -22
  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 +4909 -4182
  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 +612 -551
  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/OverflowRail.js +326 -0
  39. package/dist/shared/components/PageRenderer.js +636 -599
  40. package/dist/shared/components/PresenceDot.js +21 -0
  41. package/dist/shared/components/ProfileView.js +656 -536
  42. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  43. package/dist/shared/components/RecentRecordsRail.js +51 -48
  44. package/dist/shared/components/RecordCompare.js +241 -150
  45. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  46. package/dist/shared/components/RecordGridEditor.js +350 -311
  47. package/dist/shared/components/RecordHoverCard.js +147 -0
  48. package/dist/shared/components/RecordPeekHost.js +111 -0
  49. package/dist/shared/components/RecordReadView.js +414 -412
  50. package/dist/shared/components/RelativeTime.js +16 -0
  51. package/dist/shared/components/ReportView.js +1396 -1304
  52. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  53. package/dist/shared/components/TabCountHost.js +10 -0
  54. package/dist/shared/components/TickerNumber.js +19 -18
  55. package/dist/shared/components/TipLayer.js +70 -58
  56. package/dist/shared/components/WidgetImageMenu.js +59 -0
  57. package/dist/shared/components/WidgetSlot.js +571 -524
  58. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  59. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  60. package/dist/shared/components/cbv/approval-changed.js +20 -0
  61. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/SignalCard.js +84 -77
  79. package/dist/shared/components/integrations/console/api.js +161 -117
  80. package/dist/shared/components/integrations/console/tone.js +15 -12
  81. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  82. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  83. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  84. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  85. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  86. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  87. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  88. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  89. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  90. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  91. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  92. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  93. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  94. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  95. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  96. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  97. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  98. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  99. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  100. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  101. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  102. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  103. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  104. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  105. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  106. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  107. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  108. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  109. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  110. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  111. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  112. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  113. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  114. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  115. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  116. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  117. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  118. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  119. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  120. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  121. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  122. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  123. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  124. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  125. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  126. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  127. package/dist/shared/components/item-edit/file-live.js +77 -0
  128. package/dist/shared/components/item-edit/file-processing.js +87 -0
  129. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  130. package/dist/shared/components/item-edit/live-related.js +23 -0
  131. package/dist/shared/components/item-edit/live-title.js +66 -0
  132. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  133. package/dist/shared/components/item-edit/removed-line.js +58 -0
  134. package/dist/shared/components/item-edit/render-stability.js +70 -59
  135. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  136. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  137. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  138. package/dist/shared/components/list/InlineEdit.js +504 -208
  139. package/dist/shared/components/list/ListViewers.js +81 -0
  140. package/dist/shared/components/list/PhonePager.js +50 -0
  141. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  142. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  143. package/dist/shared/components/merge/merge-values.js +110 -0
  144. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  145. package/dist/shared/components/notifications/NotificationCenterView.js +389 -323
  146. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  147. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  148. package/dist/shared/components/notifications/bundles.js +21 -19
  149. package/dist/shared/components/notifications/resolved-line.js +25 -0
  150. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  151. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  152. package/dist/shared/components/panels/AlertBanners.js +132 -0
  153. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  154. package/dist/shared/components/panels/BranchLanes.js +82 -54
  155. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  156. package/dist/shared/components/panels/CommentImages.js +219 -0
  157. package/dist/shared/components/panels/CommentPanel.js +649 -530
  158. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  159. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  160. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  161. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  162. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  163. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  164. package/dist/shared/components/panels/SlaClock.js +130 -99
  165. package/dist/shared/components/panels/TaskPanel.js +308 -287
  166. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  167. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  168. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  169. package/dist/shared/components/pipeline/PipelineEditorView.js +2050 -1942
  170. package/dist/shared/components/profile/AgentNameField.js +141 -0
  171. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  172. package/dist/shared/components/profile/PersonAccess.js +398 -330
  173. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  174. package/dist/shared/components/profile/PersonProfile.js +81 -73
  175. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  176. package/dist/shared/components/queue/OwnerAvatars.js +9 -9
  177. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  178. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  179. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  180. package/dist/shared/components/queue/QueueWorklist.js +2407 -1950
  181. package/dist/shared/components/queue/worklist-helpers.js +10 -6
  182. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  183. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  184. package/dist/shared/components/support/ReportProblem.js +1 -0
  185. package/dist/shared/components/support/ScreenShare.js +554 -0
  186. package/dist/shared/components/support/SupportView.js +160 -129
  187. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  188. package/dist/shared/components/ui/popover.js +53 -29
  189. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  190. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  191. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  192. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  193. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  194. package/dist/shared/lib/activity-sentence.js +87 -75
  195. package/dist/shared/lib/agent-presence.js +46 -0
  196. package/dist/shared/lib/approval-progress.js +49 -0
  197. package/dist/shared/lib/attention-prefs.js +27 -0
  198. package/dist/shared/lib/cell-locks.js +56 -0
  199. package/dist/shared/lib/co-edit.js +166 -0
  200. package/dist/shared/lib/coedit-registry.js +44 -0
  201. package/dist/shared/lib/comment-awareness.js +124 -0
  202. package/dist/shared/lib/comment-images.js +45 -0
  203. package/dist/shared/lib/config-watch.js +94 -0
  204. package/dist/shared/lib/copy-rules.js +65 -0
  205. package/dist/shared/lib/count-step.js +30 -0
  206. package/dist/shared/lib/deadline-ticker.js +68 -0
  207. package/dist/shared/lib/derived-causes.js +115 -0
  208. package/dist/shared/lib/draft-store.js +114 -85
  209. package/dist/shared/lib/error-hints.js +1 -0
  210. package/dist/shared/lib/field-merge.js +126 -0
  211. package/dist/shared/lib/filter-sentence.js +10 -10
  212. package/dist/shared/lib/focus-mode.js +16 -12
  213. package/dist/shared/lib/grid-cursors.js +77 -0
  214. package/dist/shared/lib/grid-presence.js +182 -0
  215. package/dist/shared/lib/idle-reload.js +100 -73
  216. package/dist/shared/lib/in-step.js +45 -0
  217. package/dist/shared/lib/integration-chip.js +19 -18
  218. package/dist/shared/lib/keep-row-focus.js +43 -0
  219. package/dist/shared/lib/line-locks.js +141 -0
  220. package/dist/shared/lib/line-split.js +41 -0
  221. package/dist/shared/lib/linked-changes.js +150 -0
  222. package/dist/shared/lib/list-return.js +231 -0
  223. package/dist/shared/lib/list-viewers.js +52 -0
  224. package/dist/shared/lib/live-announcer.js +86 -0
  225. package/dist/shared/lib/live-counts.js +85 -0
  226. package/dist/shared/lib/live-data-changed.js +108 -0
  227. package/dist/shared/lib/live-deltas.js +81 -0
  228. package/dist/shared/lib/live-findings.js +113 -0
  229. package/dist/shared/lib/live-groups.js +122 -0
  230. package/dist/shared/lib/live-link-labels.js +162 -0
  231. package/dist/shared/lib/live-list-flow.js +334 -0
  232. package/dist/shared/lib/live-list.js +143 -129
  233. package/dist/shared/lib/live-moves.js +51 -0
  234. package/dist/shared/lib/live-ops.js +26 -26
  235. package/dist/shared/lib/live-pickers.js +7 -0
  236. package/dist/shared/lib/live-preference.js +184 -0
  237. package/dist/shared/lib/live-queries.js +226 -181
  238. package/dist/shared/lib/live-screen.js +333 -0
  239. package/dist/shared/lib/live-search.js +108 -0
  240. package/dist/shared/lib/live-seen.js +35 -0
  241. package/dist/shared/lib/live-views.js +100 -0
  242. package/dist/shared/lib/live.js +159 -133
  243. package/dist/shared/lib/missed-updates.js +198 -0
  244. package/dist/shared/lib/newer-file.js +56 -0
  245. package/dist/shared/lib/notification-sound.js +42 -20
  246. package/dist/shared/lib/obligation-banner.js +17 -17
  247. package/dist/shared/lib/own-writes.js +59 -41
  248. package/dist/shared/lib/picker-badges.js +94 -0
  249. package/dist/shared/lib/presence-signals.js +131 -84
  250. package/dist/shared/lib/rail-menu-context.js +9 -0
  251. package/dist/shared/lib/realtime.js +49 -24
  252. package/dist/shared/lib/record-gaps.js +85 -0
  253. package/dist/shared/lib/record-outbox.js +369 -222
  254. package/dist/shared/lib/record-peek.js +75 -0
  255. package/dist/shared/lib/record-tabs.js +92 -72
  256. package/dist/shared/lib/relative-ticker.js +42 -0
  257. package/dist/shared/lib/request-gate.js +119 -119
  258. package/dist/shared/lib/rollup-recalc.js +107 -0
  259. package/dist/shared/lib/room-gaps.js +40 -36
  260. package/dist/shared/lib/row-surface.js +7 -0
  261. package/dist/shared/lib/rum.js +137 -87
  262. package/dist/shared/lib/save-progress.js +20 -0
  263. package/dist/shared/lib/scheduled-countdown.js +67 -0
  264. package/dist/shared/lib/screen-refresh.js +160 -0
  265. package/dist/shared/lib/screen-share.js +234 -0
  266. package/dist/shared/lib/seen-since.js +74 -0
  267. package/dist/shared/lib/selection-watch.js +205 -0
  268. package/dist/shared/lib/send-status.js +132 -0
  269. package/dist/shared/lib/send-view.js +23 -0
  270. package/dist/shared/lib/socket-liveness.js +155 -0
  271. package/dist/shared/lib/socket-realtime.js +168 -140
  272. package/dist/shared/lib/state-census.js +53 -0
  273. package/dist/shared/lib/summary-mode.js +61 -39
  274. package/dist/shared/lib/tab-attention.js +143 -32
  275. package/dist/shared/lib/table-density.js +64 -0
  276. package/dist/shared/lib/table-pins.js +20 -18
  277. package/dist/shared/lib/track-travel.js +40 -0
  278. package/dist/shared/lib/unseen-changes.js +68 -0
  279. package/dist/shared/lib/upload-file.js +62 -0
  280. package/dist/shared/lib/upload-presence.js +127 -0
  281. package/dist/shared/lib/urgent-chime.js +65 -0
  282. package/dist/shared/lib/use-below-md.js +29 -0
  283. package/dist/shared/lib/use-online-users.js +32 -11
  284. package/dist/shared/lib/user-sync.js +155 -39
  285. package/dist/shared/lib/waiting-count.js +44 -0
  286. package/dist/shared/lib/watch-desktop.js +83 -0
  287. package/dist/shared/lib/watch-list.js +447 -0
  288. package/dist/shared/lib/widget-image-render.js +64 -0
  289. package/dist/shared/lib/widget-image.js +111 -0
  290. package/dist/shared/lib/worker-socket.js +130 -104
  291. package/dist/shared/lib/write-to-screen.js +133 -0
  292. package/package.json +1 -1
  293. package/styles.css +49 -1
@@ -0,0 +1,453 @@
1
+ import { jsxs as r, jsx as n, Fragment as v } from "react/jsx-runtime";
2
+ import { Loader2 as I, Play as X, Clock as Y, CheckCircle2 as q, RefreshCw as z } from "lucide-react";
3
+ import { useState as y, useMemo as L } from "react";
4
+ import { toast as $ } from "sonner";
5
+ import { useItemNavigation as H } from "../../../context.js";
6
+ import { toastError as W } from "../../../lib/error-toast.js";
7
+ import { cn as m } from "../../../lib/utils.js";
8
+ import { QueryErrorState as J } from "../../QueryErrorState.js";
9
+ import { useReadyBoard as U, useRunReadyCheck as Z, useCheckReadyRecord as ee } from "./api.js";
10
+ import { Segment as ne } from "./EventsView.js";
11
+ import { agoText as C, exactTime as re, TONE_TEXT as w, TONE_SOFT as D, TONE_BORDER as te, TONE_FILL as G } from "./tone.js";
12
+ const E = {
13
+ block: { tone: "negative", label: "Would be refused", short: "Refused" },
14
+ warn: { tone: "warning", label: "Would send incomplete", short: "Incomplete" },
15
+ ask: { tone: "info", label: "Asks for something when sent", short: "Asks on send" }
16
+ }, N = 50, R = (e, o, d = `${o}s`) => `${e} ${e === 1 ? o : d}`;
17
+ function se(e, o, d) {
18
+ return e.filter(
19
+ (i) => (!o.partner || i.partners.includes(o.partner) || i.issues.some((l) => l.partner === o.partner)) && (!o.problem || i.issues.some((l) => d(l) === o.problem)) && (!o.severity || i.worst === o.severity)
20
+ );
21
+ }
22
+ const oe = (e) => `${e.severity}|${e.message.replace(/\bon \d+ lines?\b/, "on some lines").trim()}`;
23
+ function xe({ onOpenRecord: e }) {
24
+ var B;
25
+ const o = U(), d = Z(), [i, l] = y(null), [c, p] = y(null), [u, b] = y(""), [a, h] = y(N), s = o.data, x = L(() => (s == null ? void 0 : s.entries) ?? [], [s]), g = L(
26
+ () => se(x, { partner: i, problem: c, severity: u }, oe),
27
+ [x, i, c, u]
28
+ ), T = `${i}|${c}|${u}`, [M, V] = y(T);
29
+ if (M !== T && (V(T), h(N)), o.isLoading)
30
+ return /* @__PURE__ */ r("div", { className: "space-y-3", "aria-busy": !0, "data-ic-ready-loading": !0, children: [
31
+ /* @__PURE__ */ n("div", { className: "h-5 w-80 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
32
+ /* @__PURE__ */ r("div", { className: "grid gap-5 lg:grid-cols-[260px_minmax(0,1fr)]", children: [
33
+ /* @__PURE__ */ n("div", { className: "h-48 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }),
34
+ /* @__PURE__ */ n("div", { className: "h-72 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" })
35
+ ] })
36
+ ] });
37
+ if (o.isError || !s)
38
+ return /* @__PURE__ */ n(
39
+ J,
40
+ {
41
+ error: o.error,
42
+ what: "the ready-to-send board",
43
+ onRetry: () => o.refetch()
44
+ }
45
+ );
46
+ const Q = () => d.mutate(void 0, {
47
+ onSuccess: () => $.success("Checking every record that sends next. The board fills in when it is done."),
48
+ onError: (t) => W(t, "Could not start the check")
49
+ }), j = s.can_run ? /* @__PURE__ */ r(
50
+ "button",
51
+ {
52
+ type: "button",
53
+ "data-ic-ready-run": !0,
54
+ disabled: d.isPending || s.running,
55
+ onClick: Q,
56
+ className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-[12.5px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
57
+ children: [
58
+ d.isPending || s.running ? /* @__PURE__ */ n(I, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(X, { className: "h-3.5 w-3.5" }),
59
+ s.running ? "Checking…" : "Run now"
60
+ ]
61
+ }
62
+ ) : null;
63
+ if (!s.run)
64
+ return /* @__PURE__ */ r(
65
+ "div",
66
+ {
67
+ "data-ic-ready-empty": !0,
68
+ className: "flex flex-wrap items-start gap-4 rounded-lg border border-border bg-card px-5 py-6",
69
+ children: [
70
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 space-y-1", children: [
71
+ /* @__PURE__ */ n("p", { className: "text-[14px] font-semibold text-foreground", children: s.running ? "The first check is running" : "Not checked yet" }),
72
+ /* @__PURE__ */ n("p", { className: "max-w-[68ch] text-[12.5px] leading-relaxed text-muted-foreground", children: "Every night, each open record whose next step sends to a partner is checked the way its Push readiness check does: missing values, conditions, and what the partner needs. What would be refused shows up here, so it can be fixed before someone presses the button." })
73
+ ] }),
74
+ j
75
+ ]
76
+ }
77
+ );
78
+ const f = s.totals ?? { records: 0, refused: 0, warnings: 0, asks: 0 }, S = s.run.generated_at, k = s.coverage, A = !!(i || c || u);
79
+ return /* @__PURE__ */ r("div", { className: "space-y-4", "data-ic-ready": !0, children: [
80
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [
81
+ /* @__PURE__ */ r("p", { className: "min-w-0 text-[13px] text-muted-foreground", "data-ic-ready-summary": !0, children: [
82
+ f.records === 0 ? /* @__PURE__ */ n("span", { className: "font-medium text-foreground", children: "Nothing in the way of the next sends" }) : /* @__PURE__ */ r(v, { children: [
83
+ /* @__PURE__ */ n(P, { n: f.refused, tone: "negative" }),
84
+ " would be refused",
85
+ " · ",
86
+ /* @__PURE__ */ n(P, { n: f.warnings, tone: "warning" }),
87
+ " would send incomplete",
88
+ " · ",
89
+ /* @__PURE__ */ n(P, { n: f.asks, tone: "info" }),
90
+ " ask for something when sent"
91
+ ] }),
92
+ " · ",
93
+ /* @__PURE__ */ r("span", { "data-tip": re(S), children: [
94
+ "checked ",
95
+ C(S)
96
+ ] }),
97
+ k && /* @__PURE__ */ r(v, { children: [
98
+ " · ",
99
+ /* @__PURE__ */ r("span", { "data-ic-ready-coverage": !0, children: [
100
+ R(k.checked, "record"),
101
+ " with a send next",
102
+ k.ready > 0 ? `, ${k.ready} ready` : ""
103
+ ] })
104
+ ] })
105
+ ] }),
106
+ /* @__PURE__ */ n("div", { className: "ml-auto", children: j })
107
+ ] }),
108
+ s.running && /* @__PURE__ */ r(
109
+ K,
110
+ {
111
+ tone: "info",
112
+ icon: /* @__PURE__ */ n(I, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 animate-spin" }),
113
+ "data-ic-ready-running": !0,
114
+ children: [
115
+ "A new check is running",
116
+ (B = s.progress) != null && B.total ? ` (${s.progress.checked} of ${s.progress.total} records so far)` : "",
117
+ ". This board is from the last complete check and updates when it finishes."
118
+ ]
119
+ }
120
+ ),
121
+ !s.running && s.stopped_short && /* @__PURE__ */ r(
122
+ K,
123
+ {
124
+ tone: "warning",
125
+ icon: /* @__PURE__ */ n(Y, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
126
+ "data-ic-ready-stopped": !0,
127
+ children: [
128
+ "The latest check stopped before it finished",
129
+ s.stopped ? ` (at ${s.stopped.checked}${s.stopped.total != null ? ` of ${s.stopped.total}` : ""} records${s.stopped.at ? `, started ${C(s.stopped.at)}` : ""})` : "",
130
+ ", so this board is from the last complete check. The next check starts from the beginning."
131
+ ]
132
+ }
133
+ ),
134
+ f.records === 0 ? /* @__PURE__ */ r(
135
+ "div",
136
+ {
137
+ "data-ic-ready-clear": !0,
138
+ className: "flex flex-col items-start gap-1 rounded-lg border border-border bg-card px-5 py-6",
139
+ children: [
140
+ /* @__PURE__ */ r("p", { className: "flex items-center gap-2 text-[14px] font-semibold text-foreground", children: [
141
+ /* @__PURE__ */ n(q, { className: m("h-4 w-4", w.positive) }),
142
+ "Every record you can see is ready to send"
143
+ ] }),
144
+ /* @__PURE__ */ r("p", { className: "text-[12.5px] text-muted-foreground", children: [
145
+ "Checked ",
146
+ C(S),
147
+ ". Records whose next step sends to a partner show up here when something would stop or weaken that send."
148
+ ] })
149
+ ]
150
+ }
151
+ ) : /* @__PURE__ */ r("div", { className: "grid items-start gap-5 lg:grid-cols-[260px_minmax(0,1fr)]", children: [
152
+ /* @__PURE__ */ r("aside", { className: "space-y-5", "aria-label": "Group the board", children: [
153
+ /* @__PURE__ */ r(O, { title: "Partner", children: [
154
+ /* @__PURE__ */ n(
155
+ _,
156
+ {
157
+ on: !i,
158
+ onClick: () => l(null),
159
+ label: "All partners",
160
+ count: f.records
161
+ }
162
+ ),
163
+ (s.partners ?? []).map((t) => /* @__PURE__ */ n(
164
+ _,
165
+ {
166
+ "data-ic-ready-partner": t.partner,
167
+ on: i === t.partner,
168
+ onClick: () => l(i === t.partner ? null : t.partner),
169
+ label: t.partner,
170
+ count: t.records,
171
+ tone: t.refused > 0 ? "negative" : t.warnings > 0 ? "warning" : "info",
172
+ hint: [
173
+ t.refused ? `${t.refused} refused` : "",
174
+ t.warnings ? `${t.warnings} incomplete` : "",
175
+ t.asks ? `${t.asks} ask on send` : ""
176
+ ].filter(Boolean).join(" · ")
177
+ },
178
+ t.partner
179
+ ))
180
+ ] }),
181
+ /* @__PURE__ */ n(O, { title: "Problem", children: (s.problems ?? []).map((t) => /* @__PURE__ */ n(
182
+ _,
183
+ {
184
+ "data-ic-ready-problem": t.key,
185
+ on: c === t.key,
186
+ onClick: () => p(c === t.key ? null : t.key),
187
+ label: t.label,
188
+ count: t.records,
189
+ tone: E[t.severity].tone,
190
+ hint: [
191
+ E[t.severity].short,
192
+ t.lines > 0 ? R(t.lines, "line") : "",
193
+ t.partners.length && !i ? t.partners.join(", ") : ""
194
+ ].filter(Boolean).join(" · "),
195
+ wrap: !0
196
+ },
197
+ t.key
198
+ )) })
199
+ ] }),
200
+ /* @__PURE__ */ r("section", { className: "min-w-0 space-y-3", "aria-label": "Records", children: [
201
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
202
+ /* @__PURE__ */ n(
203
+ ne,
204
+ {
205
+ label: "Show",
206
+ value: u,
207
+ onChange: b,
208
+ options: [
209
+ ["", "All"],
210
+ ["block", "Refused"],
211
+ ["warn", "Incomplete"],
212
+ ["ask", "Asks on send"]
213
+ ],
214
+ "data-ic-ready-severity": !0
215
+ }
216
+ ),
217
+ /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground tabular-nums", children: [
218
+ R(g.length, "send"),
219
+ A && ` of ${x.length}`
220
+ ] }),
221
+ A && /* @__PURE__ */ n(
222
+ "button",
223
+ {
224
+ type: "button",
225
+ onClick: () => {
226
+ l(null), p(null), b("");
227
+ },
228
+ className: "text-[12px] font-medium text-foreground underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",
229
+ children: "Clear filters"
230
+ }
231
+ )
232
+ ] }),
233
+ g.length === 0 ? /* @__PURE__ */ n("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: "Nothing matches these filters." }) : /* @__PURE__ */ n("ul", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card", children: g.slice(0, a).map((t) => {
234
+ var F;
235
+ return /* @__PURE__ */ n(
236
+ ae,
237
+ {
238
+ entry: t,
239
+ collectionLabel: ((F = s.collections) == null ? void 0 : F[t.collection]) ?? t.collection,
240
+ onOpenRecord: e
241
+ },
242
+ `${t.collection}:${t.item}:${t.transition.id}`
243
+ );
244
+ }) }),
245
+ g.length > a && /* @__PURE__ */ r(
246
+ "button",
247
+ {
248
+ type: "button",
249
+ "data-ic-ready-more": !0,
250
+ onClick: () => h((t) => t + N),
251
+ className: "inline-flex h-8 items-center rounded-md border border-border bg-card px-3 text-[12.5px] font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
252
+ children: [
253
+ "Show ",
254
+ Math.min(N, g.length - a),
255
+ " more of ",
256
+ g.length - a,
257
+ " left"
258
+ ]
259
+ }
260
+ )
261
+ ] })
262
+ ] })
263
+ ] });
264
+ }
265
+ function P({ n: e, tone: o }) {
266
+ return /* @__PURE__ */ n("span", { className: m("font-semibold tabular-nums", e > 0 ? w[o] : "text-foreground"), children: e });
267
+ }
268
+ function K({
269
+ tone: e,
270
+ icon: o,
271
+ children: d,
272
+ ...i
273
+ }) {
274
+ return /* @__PURE__ */ r(
275
+ "div",
276
+ {
277
+ role: "status",
278
+ ...i,
279
+ className: m(
280
+ "flex items-start gap-2 rounded-lg border px-4 py-2.5 text-[12.5px]",
281
+ te[e],
282
+ D[e],
283
+ w[e]
284
+ ),
285
+ children: [
286
+ o,
287
+ /* @__PURE__ */ n("span", { children: d })
288
+ ]
289
+ }
290
+ );
291
+ }
292
+ function O({ title: e, children: o }) {
293
+ return /* @__PURE__ */ r("div", { children: [
294
+ /* @__PURE__ */ n("h3", { className: "mb-1.5 px-2 text-[12px] font-semibold text-foreground", children: e }),
295
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: o })
296
+ ] });
297
+ }
298
+ function _({
299
+ on: e,
300
+ onClick: o,
301
+ label: d,
302
+ count: i,
303
+ tone: l,
304
+ hint: c,
305
+ wrap: p,
306
+ ...u
307
+ }) {
308
+ return /* @__PURE__ */ r(
309
+ "button",
310
+ {
311
+ type: "button",
312
+ "aria-pressed": e,
313
+ onClick: o,
314
+ ...u,
315
+ className: m(
316
+ "flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
317
+ e ? "bg-accent text-foreground" : "text-foreground hover:bg-muted"
318
+ ),
319
+ children: [
320
+ l && /* @__PURE__ */ n("span", { className: m("mt-[7px] h-1.5 w-1.5 shrink-0 rounded-full", G[l]) }),
321
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
322
+ /* @__PURE__ */ n(
323
+ "span",
324
+ {
325
+ className: m(
326
+ "block text-[12.5px] leading-snug",
327
+ p ? "break-words" : "truncate",
328
+ e && "font-medium"
329
+ ),
330
+ children: d
331
+ }
332
+ ),
333
+ c && /* @__PURE__ */ n("span", { className: "block text-[11.5px] leading-snug text-muted-foreground", children: c })
334
+ ] }),
335
+ /* @__PURE__ */ n("span", { className: "shrink-0 pt-px text-[12px] font-medium tabular-nums text-muted-foreground", children: i })
336
+ ]
337
+ }
338
+ );
339
+ }
340
+ function ae({
341
+ entry: e,
342
+ collectionLabel: o,
343
+ onOpenRecord: d
344
+ }) {
345
+ const i = H(), l = ee(), c = { collection: e.collection, itemId: e.item }, p = (a) => {
346
+ a.metaKey || a.ctrlKey || a.shiftKey || a.button !== 0 || (a.preventDefault(), d ? d(e.collection, e.item) : i.open(c));
347
+ }, u = E[e.worst], b = () => l.mutate(
348
+ { collection: e.collection, item: e.item },
349
+ {
350
+ onSuccess: (a) => {
351
+ a.sending ? a.ready ? $.success(`${e.label} is ready to send`) : $.message(
352
+ `${e.label} still has ${R(
353
+ a.entries.reduce((h, s) => h + s.issues.length, 0),
354
+ "problem"
355
+ )}`
356
+ ) : $.success(`${e.label} no longer has a send next`);
357
+ },
358
+ onError: (a) => W(a, "Could not check this record", { retry: b })
359
+ }
360
+ );
361
+ return /* @__PURE__ */ r("li", { className: "px-4 py-3", "data-ic-ready-row": `${e.collection}:${e.item}`, "data-worst": e.worst, children: [
362
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-start gap-x-3 gap-y-2", children: [
363
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
364
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
365
+ /* @__PURE__ */ n(
366
+ "a",
367
+ {
368
+ href: i.urlFor(c),
369
+ onClick: p,
370
+ className: "truncate text-[13px] font-semibold text-foreground underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",
371
+ children: e.label
372
+ }
373
+ ),
374
+ /* @__PURE__ */ n("span", { className: "text-[12px] text-muted-foreground", children: o }),
375
+ /* @__PURE__ */ n(
376
+ "span",
377
+ {
378
+ className: m(
379
+ "rounded px-1.5 py-px text-[11px] font-semibold",
380
+ D[u.tone],
381
+ w[u.tone]
382
+ ),
383
+ children: u.short
384
+ }
385
+ )
386
+ ] }),
387
+ /* @__PURE__ */ r("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
388
+ e.state ? `${e.state} → ` : "",
389
+ /* @__PURE__ */ n("span", { className: "text-foreground", children: e.transition.label }),
390
+ e.partners.length > 0 && /* @__PURE__ */ r(v, { children: [
391
+ " · sends to ",
392
+ e.partners.join(", ")
393
+ ] })
394
+ ] })
395
+ ] }),
396
+ /* @__PURE__ */ r(
397
+ "button",
398
+ {
399
+ type: "button",
400
+ "data-ic-ready-check": !0,
401
+ disabled: l.isPending,
402
+ onClick: b,
403
+ className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
404
+ children: [
405
+ /* @__PURE__ */ n(z, { className: m("h-3 w-3", l.isPending && "animate-spin") }),
406
+ l.isPending ? "Checking…" : "Check again"
407
+ ]
408
+ }
409
+ )
410
+ ] }),
411
+ /* @__PURE__ */ n("ul", { className: "mt-2 space-y-1", children: e.issues.map((a) => {
412
+ const h = E[a.severity].tone, s = a.rows ?? [];
413
+ return /* @__PURE__ */ r(
414
+ "li",
415
+ {
416
+ className: "flex items-start gap-2 text-[12.5px] leading-snug",
417
+ children: [
418
+ /* @__PURE__ */ n("span", { className: m("mt-[6px] h-1.5 w-1.5 shrink-0 rounded-full", G[h]) }),
419
+ /* @__PURE__ */ r("span", { className: "min-w-0", children: [
420
+ /* @__PURE__ */ n("span", { className: a.severity === "ask" ? "text-foreground" : w[h], children: a.message }),
421
+ s.length > 0 && /* @__PURE__ */ r("span", { className: "text-muted-foreground", children: [
422
+ " — ",
423
+ s.slice(0, 3).map((x) => x.label).join(", "),
424
+ s.length > 3 ? ` and ${s.length - 3} more` : ""
425
+ ] })
426
+ ] })
427
+ ]
428
+ },
429
+ `${a.severity}:${a.partner ?? ""}:${a.message}`
430
+ );
431
+ }) }),
432
+ /* @__PURE__ */ r("p", { className: "mt-2 text-[11.5px] text-muted-foreground", children: [
433
+ e.owners.length > 0 ? /* @__PURE__ */ r(v, { children: [
434
+ "Step owner",
435
+ e.owners.length === 1 ? "" : "s",
436
+ ": ",
437
+ e.owners.map((a) => a.name).join(", ")
438
+ ] }) : "Nobody owns this step",
439
+ e.checked_by && /* @__PURE__ */ r(v, { children: [
440
+ " · ",
441
+ "checked again by ",
442
+ e.checked_by,
443
+ " ",
444
+ C(e.checked_at)
445
+ ] })
446
+ ] })
447
+ ] });
448
+ }
449
+ export {
450
+ xe as ReadyToSendView,
451
+ se as filterReadyEntries,
452
+ oe as readyProblemKey
453
+ };