@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,132 @@
1
+ import { describeError as S } from "./error-message.js";
2
+ import { partnerWords as N, partnerOutcome as C, partnerSaid as A } from "./partner-failure.js";
3
+ import { getDisplayTimezone as R } from "./utils.js";
4
+ function q(t, e = Date.now()) {
5
+ const n = t instanceof Date ? t : new Date(t);
6
+ if (Number.isNaN(n.getTime())) return "";
7
+ const r = R(), a = r ? { timeZone: r } : {}, o = (u) => new Intl.DateTimeFormat("en-US", {
8
+ ...a,
9
+ year: "numeric",
10
+ month: "numeric",
11
+ day: "numeric"
12
+ }).format(u), c = new Intl.DateTimeFormat("en-US", {
13
+ ...a,
14
+ hour: "numeric",
15
+ minute: "2-digit"
16
+ }).format(n);
17
+ return o(n) === o(new Date(e)) ? c : `${new Intl.DateTimeFormat("en-US", { ...a, month: "short", day: "numeric" }).format(
18
+ n
19
+ )}, ${c}`;
20
+ }
21
+ function w(t) {
22
+ if (!Number.isFinite(t) || t < 6e4) return "less than a minute";
23
+ const e = Math.round(t / 6e4);
24
+ if (e < 60) return `${e} minute${e === 1 ? "" : "s"}`;
25
+ const n = Math.round(t / 36e5);
26
+ if (n < 48) return `${n} hour${n === 1 ? "" : "s"}`;
27
+ const r = Math.round(t / 864e5);
28
+ return `${r} day${r === 1 ? "" : "s"}`;
29
+ }
30
+ function M(t) {
31
+ const e = (t ?? "").trim();
32
+ if (!e) return { text: "", quoted: !1 };
33
+ const n = /\bHTTP \d{3}: /.exec(e), r = N(n ? e.slice(n.index) : e);
34
+ return r ? { text: r.replace(/[\s.,;:]+$/, ""), quoted: !0 } : { text: D(e), quoted: !1 };
35
+ }
36
+ function D(t) {
37
+ const e = (t ?? "").trim();
38
+ if (!e) return "";
39
+ const n = /\bHTTP \d{3}: /.exec(e), r = N(n ? e.slice(n.index) : e) ?? C(e) ?? A(e);
40
+ return r ? r.replace(/[\s.,;:]+$/, "") : S({ message: e }, "").title.replace(/[\s.,;:]+$/, "");
41
+ }
42
+ const U = /* @__PURE__ */ new Set(["transient", "rate_limited"]);
43
+ function E(t, e = {}) {
44
+ var g, b, x, _;
45
+ const n = e.now ?? Date.now(), r = e.time ?? ((s) => q(s, n));
46
+ e.reason;
47
+ const a = ((g = t.api) == null ? void 0 : g.trim()) || "the other system", o = (t.status ?? "").toLowerCase(), c = t.finished_at ?? t.started_at;
48
+ if (o === "sending") {
49
+ const s = t.answer_by ? new Date(t.answer_by).getTime() : Number.NaN;
50
+ return Number.isFinite(s) && n > s ? {
51
+ state: "no_answer",
52
+ tone: "held",
53
+ text: `No answer from ${a} after ${w(n - new Date(t.started_at).getTime())} — the send is held and will not be repeated automatically`
54
+ } : {
55
+ state: "sending",
56
+ tone: "busy",
57
+ text: `Sending to ${a} now (started ${r(t.started_at)})`
58
+ };
59
+ }
60
+ if (o === "pending") {
61
+ const s = t.usual_answer_ms != null && t.usual_answer_ms > 0 ? ` · usually answers within ${w(t.usual_answer_ms)}` : "";
62
+ return {
63
+ state: "waiting",
64
+ tone: "waiting",
65
+ text: `Sent to ${a} at ${r(t.started_at)} — waiting for ${a}'s answer${s}`
66
+ };
67
+ }
68
+ if (o === "accepted") {
69
+ const s = (b = t.external_ref) == null ? void 0 : b.trim(), $ = ((x = t.ref_label) == null ? void 0 : x.trim()) || "reference";
70
+ return {
71
+ state: "accepted",
72
+ tone: "ok",
73
+ text: `${a} accepted it at ${r(c)}${s ? ` — ${$} ${s}` : ""}`
74
+ };
75
+ }
76
+ const d = (t.error_class ?? "").toLowerCase(), u = e.reason ? { text: e.reason(t.reason), quoted: !1 } : M(t.reason), i = t.retry && t.retry.at ? t.retry : null, h = i ? new Date(i.at).getTime() : Number.NaN, m = i ? `${Number.isFinite(h) && h > n ? `Retrying at ${r(i.at)}` : "Retrying now"} (attempt ${i.attempt} of ${i.of})` : "", y = (_ = t.no_retry) == null ? void 0 : _.trim(), l = (s) => i ? { retry_at: i.at } : s && y ? { detail: `It won't be sent again automatically — ${y}.` } : {};
77
+ if (U.has(d)) {
78
+ const $ = d === "rate_limited" ? `${a} was too busy to take it at ${r(c)} — nothing was sent.` : `Couldn't reach ${a} — nothing was sent.`, p = !i && t.can_resend === !0, F = i ? ` ${m}` : p ? "" : " Ask an admin to send it again.";
79
+ return {
80
+ state: "not_taken",
81
+ tone: i ? "waiting" : "problem",
82
+ text: `${$}${F}`,
83
+ ...p ? { resend: !0 } : {},
84
+ ...l(!0)
85
+ };
86
+ }
87
+ const f = `${a} refused it at ${r(c)}`;
88
+ if (d === "auth")
89
+ return {
90
+ state: "refused",
91
+ tone: i ? "waiting" : "problem",
92
+ text: `${f}: it did not accept this app's sign-in. ${i ? m : `An administrator needs to check the connection to ${a}.`}`,
93
+ ...l(!0)
94
+ };
95
+ const T = u.text ? u.quoted ? `: “${u.text}.”` : `: ${u.text}.` : ".", k = o === "rejected" || ["validation", "not_found"].includes(d);
96
+ return {
97
+ state: "refused",
98
+ tone: i ? "waiting" : "problem",
99
+ text: `${f}${T} ${i ? m : u.text ? "Change that on the record, then send it again." : "Check the record, then send it again."}`,
100
+ // "Repeating it cannot fix it" is already what the next step says.
101
+ ...l(!k)
102
+ };
103
+ }
104
+ function H(t, e = Date.now()) {
105
+ if (!t) return null;
106
+ const n = new Date(t).getTime();
107
+ if (!Number.isFinite(n) || n <= e) return null;
108
+ const r = Math.ceil((n - e) / 6e4);
109
+ return r < 60 ? `in ${r} minute${r === 1 ? "" : "s"}` : `in ${w(n - e)}`;
110
+ }
111
+ function O(t, e = Date.now()) {
112
+ var a;
113
+ const n = (a = t.retry) != null && a.at ? new Date(t.retry.at).getTime() : Number.NaN;
114
+ if (!Number.isFinite(n) || n <= e) return null;
115
+ const r = n - e;
116
+ return Math.min(r, (r - 1) % 6e4 + 1) + 250;
117
+ }
118
+ function P(t, e = Date.now()) {
119
+ if ((t.status ?? "").toLowerCase() !== "sending" || !t.answer_by) return null;
120
+ const n = new Date(t.answer_by).getTime();
121
+ return !Number.isFinite(n) || n < e ? null : n - e + 500;
122
+ }
123
+ export {
124
+ q as atClock,
125
+ P as msUntilNoAnswer,
126
+ O as msUntilRetryTick,
127
+ w as plainDuration,
128
+ D as plainSendReason,
129
+ H as retryCountdown,
130
+ M as sendReason,
131
+ E as sendStatusWords
132
+ };
@@ -0,0 +1,23 @@
1
+ import { encodeListLink as l, LIST_LINK_MAX_CHARS as i } from "./list-link.js";
2
+ function s(n, t, r, o, u) {
3
+ const e = l(r, o);
4
+ return {
5
+ kind: n,
6
+ ...n === "list" ? { collection: String(t) } : { queue: String(t) },
7
+ lv: e.length <= i ? e : null,
8
+ summary: u ?? null
9
+ };
10
+ }
11
+ function a() {
12
+ if (typeof window > "u") return null;
13
+ const n = new URLSearchParams(window.location.search).get("tab");
14
+ return n && /^[A-Za-z0-9_-]{1,40}$/.test(n) ? n : null;
15
+ }
16
+ function f(n) {
17
+ return `${n.split(/\s+/)[0] || n} sent you`;
18
+ }
19
+ export {
20
+ a as currentRecordTab,
21
+ s as listViewInput,
22
+ f as senderLead
23
+ };
@@ -0,0 +1,155 @@
1
+ import { clientSocketGone as _ } from "./client-chaos.js";
2
+ const x = /* @__PURE__ */ new Set(["io client disconnect", "io server disconnect"]);
3
+ function K(e, i = {}) {
4
+ var N;
5
+ const r = i.now ?? Date.now, o = i.silenceMs ?? 4e4, l = i.probeTimeoutMs ?? 5e3, t = i.tickMs ?? 5e3, s = i.sleepGapMs ?? 75e3, d = i.wakeWindowMs ?? 15e3, G = i.repairWindowMs ?? 12e3, H = i.maxRepairs ?? 2, g = () => {
6
+ var n;
7
+ try {
8
+ return ((n = i.held) == null ? void 0 : n.call(i)) === !0;
9
+ } catch {
10
+ return !1;
11
+ }
12
+ };
13
+ let S = !1, h = !1, v = r(), R = r(), U = 0, M, p = !1, a = null, c = !1, w = 0, u = !1, m = null;
14
+ const T = /* @__PURE__ */ new Set(), f = { probes: 0, failedProbes: 0, repairs: 0, repaired: 0, gaveUp: 0 }, W = (n, L) => {
15
+ if (n !== c) {
16
+ c = n;
17
+ for (const P of [...T])
18
+ try {
19
+ P(n, L);
20
+ } catch {
21
+ }
22
+ }
23
+ }, y = () => {
24
+ m && clearTimeout(m), m = null;
25
+ }, O = () => {
26
+ u = !0, w = 0, y(), f.gaveUp++, W(!1, "gave-up");
27
+ }, b = () => {
28
+ if (!(u || g())) {
29
+ if (w >= H) {
30
+ O();
31
+ return;
32
+ }
33
+ w++, f.repairs++, W(!0), y(), m = setTimeout(() => {
34
+ m = null, c && b();
35
+ }, G);
36
+ try {
37
+ e.reconnect();
38
+ } catch {
39
+ }
40
+ }
41
+ }, E = () => {
42
+ if (p || c || u || g()) return;
43
+ p = !0, f.probes++;
44
+ let n = !1;
45
+ a = setTimeout(() => {
46
+ a = null, !n && (n = !0, p = !1, e.connected() && (f.failedProbes++, b()));
47
+ }, l);
48
+ try {
49
+ e.probe(() => {
50
+ n || (n = !0, p = !1, a && clearTimeout(a), a = null, v = r());
51
+ });
52
+ } catch {
53
+ }
54
+ }, I = () => {
55
+ if (U = r(), !(!S || u || c || g())) {
56
+ if (e.connected()) {
57
+ h && E();
58
+ return;
59
+ }
60
+ M && x.has(M) || b();
61
+ }
62
+ }, k = setInterval(() => A.tick(), t);
63
+ (N = k.unref) == null || N.call(k);
64
+ const A = {
65
+ heard() {
66
+ v = r();
67
+ },
68
+ up() {
69
+ S = !0, h = !0, v = r(), M = void 0, u = !1, c ? (f.repaired++, w = 0, y(), W(!1, "repaired")) : w = 0;
70
+ },
71
+ down(n) {
72
+ h = !1, M = n, a && clearTimeout(a), a = null, p = !1, !(c || !S || u || g()) && (n && x.has(n) || (n === "ping timeout" || r() - U <= d) && b());
73
+ },
74
+ wake() {
75
+ I();
76
+ },
77
+ tick() {
78
+ const n = r(), L = n - R;
79
+ if (R = n, L > s) {
80
+ I();
81
+ return;
82
+ }
83
+ h && e.connected() && n - v > o && E();
84
+ },
85
+ repairing: () => c,
86
+ onRepairing(n) {
87
+ return T.add(n), () => {
88
+ T.delete(n);
89
+ };
90
+ },
91
+ stats: () => ({ ...f }),
92
+ stop() {
93
+ clearInterval(k), y(), a && clearTimeout(a), a = null, T.clear();
94
+ }
95
+ };
96
+ return A;
97
+ }
98
+ const j = 3e4;
99
+ function q(e) {
100
+ if (typeof window > "u" || typeof document > "u") return () => {
101
+ };
102
+ const i = [], r = (t, s, d) => {
103
+ t && (t.addEventListener(s, d), i.push(() => t.removeEventListener(s, d)));
104
+ };
105
+ let o = document.visibilityState === "hidden" ? Date.now() : 0;
106
+ r(window, "online", () => e("online")), r(window, "pageshow", (t) => {
107
+ t != null && t.persisted && e("restored");
108
+ }), r(document, "resume", () => e("resumed")), r(document, "visibilitychange", () => {
109
+ if (document.visibilityState === "hidden") {
110
+ o = Date.now();
111
+ return;
112
+ }
113
+ const t = o ? Date.now() - o : 0;
114
+ o = 0, t >= j && e("visible");
115
+ });
116
+ const l = navigator.connection;
117
+ return r(l, "change", () => e("network")), () => {
118
+ for (const t of i) t();
119
+ };
120
+ }
121
+ const D = /* @__PURE__ */ new WeakMap();
122
+ function B(e) {
123
+ return e ? D.get(e) ?? null : null;
124
+ }
125
+ function C(e, i) {
126
+ D.set(e, i);
127
+ }
128
+ function F(e, i = {}) {
129
+ if (!e) return null;
130
+ const r = D.get(e);
131
+ if (r) return r;
132
+ const o = e.io;
133
+ if (!o || typeof o.on != "function") return null;
134
+ const l = o.on.bind(o), t = K(
135
+ {
136
+ connected: () => e.connected,
137
+ probe: (s) => {
138
+ (e.volatile ?? e).emit("time:sync", { c: Date.now() }, () => s());
139
+ },
140
+ reconnect: () => {
141
+ e.disconnect(), e.connect();
142
+ }
143
+ },
144
+ { held: _, ...i }
145
+ );
146
+ return l("ping", () => t.heard()), l("packet", () => t.heard()), e.on("auth:ok", () => t.up()), e.on("disconnect", (s) => t.down(s)), q((s) => t.wake(s)), D.set(e, t), t;
147
+ }
148
+ export {
149
+ j as HIDDEN_WAKE_MS,
150
+ F as attachSocketLiveness,
151
+ K as createLiveness,
152
+ B as livenessOf,
153
+ q as onWakeSignals,
154
+ C as registerLiveness
155
+ };