@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,21 +1,21 @@
1
- import { NivaroError as H, errorBodyMessage as Z } from "@nivaro/sdk";
2
- import { sharedGetLoader as x, createGetBatcher as F, isBatchableGetPath as W } from "./batch-gets.js";
3
- import { isRehearsalCommand as J, noteOwnWriteFromCommand as N } from "./own-writes.js";
4
- import { noteCredentialChanged as K, isIdentityRead as Y, claimIdentityCall as Q, signedOutError as V, noteSignedIn as X, isSignedOutError as ee, noteUnauthorized as te } from "./signed-out.js";
5
- function M(e) {
1
+ import { NivaroError as Z, errorBodyMessage as x } from "@nivaro/sdk";
2
+ import { sharedGetLoader as F, createGetBatcher as W, isBatchableGetPath as J } from "./batch-gets.js";
3
+ import { isRehearsalCommand as K, noteOwnWriteFromCommand as N, announceWriteCommand as k } from "./own-writes.js";
4
+ import { noteCredentialChanged as Y, isIdentityRead as Q, claimIdentityCall as V, signedOutError as X, noteSignedIn as ee, isSignedOutError as te, noteUnauthorized as ne } from "./signed-out.js";
5
+ function $(e) {
6
6
  if (!e || typeof e != "object") return "";
7
7
  const t = Object.entries(e).filter(([, n]) => n != null).map(([n, c]) => [n, String(c)]).sort(([n], [c]) => n < c ? -1 : n > c ? 1 : 0);
8
8
  return t.length ? new URLSearchParams(t).toString() : "";
9
9
  }
10
- function $(e) {
10
+ function L(e) {
11
11
  const t = (e._method ?? "GET").toUpperCase(), n = t === "GET" || e._body === void 0 ? "" : JSON.stringify(e._body);
12
- return `${t} ${e._path ?? ""} ${M(e._params)} ${n}`;
12
+ return `${t} ${e._path ?? ""} ${$(e._params)} ${n}`;
13
13
  }
14
14
  function S(e) {
15
15
  return (e._method ?? "GET").toUpperCase() === "GET";
16
16
  }
17
17
  const O = /^\/(widgets-internal\/[^/]+\/render|items\/[^/]+\/[^/]+\/child-summary|items\/[^/]+\/auto-id-preview|config-conformance\/record\/.+\/check|pipelines\/instance\/[^/]+\/owners\/batch|addendums\/summary|at-risk\/evaluate|record-views\/.+\/touch)$/;
18
- function ne(e) {
18
+ function re(e) {
19
19
  return S(e) ? !0 : (e._method ?? "GET").toUpperCase() !== "POST" ? !1 : O.test((e._path ?? "").split("?")[0]);
20
20
  }
21
21
  function T(e) {
@@ -26,18 +26,18 @@ function T(e) {
26
26
  return e;
27
27
  }
28
28
  }
29
- const L = Symbol("nivaro.coalesced");
30
- function re(e) {
31
- return e[L] === !0;
29
+ const z = Symbol("nivaro.coalesced");
30
+ function se(e) {
31
+ return e[z] === !0;
32
32
  }
33
- const k = 20, se = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/([^/?#]+))?$/, oe = /* @__PURE__ */ new Set([
33
+ const D = 20, oe = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/([^/?#]+))?$/, ae = /* @__PURE__ */ new Set([
34
34
  "aggregate",
35
35
  "export",
36
36
  "distinct",
37
37
  "resolve-paths",
38
38
  "batch-read",
39
39
  "filter-check"
40
- ]), ae = /* @__PURE__ */ new Set([
40
+ ]), ie = /* @__PURE__ */ new Set([
41
41
  "fields",
42
42
  "filter",
43
43
  "sort",
@@ -50,22 +50,22 @@ const k = 20, se = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/([^/?#]+))?$/, oe = /
50
50
  "conditions",
51
51
  "labels"
52
52
  ]);
53
- function ie(e) {
53
+ function ce(e) {
54
54
  const t = e;
55
55
  if ((t._method ?? "GET").toUpperCase() !== "GET") return null;
56
- const n = se.exec(t._path ?? "");
56
+ const n = oe.exec(t._path ?? "");
57
57
  if (!n) return null;
58
58
  const [, c, d] = n;
59
- if (d !== void 0 && oe.has(d)) return null;
60
- const m = t._params ?? {}, u = {};
61
- for (const [a, l] of Object.entries(m))
59
+ if (d !== void 0 && ae.has(d)) return null;
60
+ const _ = t._params ?? {}, u = {};
61
+ for (const [a, l] of Object.entries(_))
62
62
  if (l !== void 0) {
63
- if (!ae.has(a)) return null;
63
+ if (!ie.has(a)) return null;
64
64
  u[a] = l;
65
65
  }
66
66
  return d === void 0 ? { collection: c, query: u } : { collection: c, id: d, query: u };
67
67
  }
68
- function ce(e) {
68
+ function ue(e) {
69
69
  let t = [], n;
70
70
  const c = (u) => e.request(u.command).then(u.resolve, u.reject), d = async (u) => {
71
71
  if (u.length === 1) return c(u[0]);
@@ -90,7 +90,7 @@ function ce(e) {
90
90
  u.forEach((l, i) => {
91
91
  const r = a == null ? void 0 : a[i];
92
92
  if ((r == null ? void 0 : r.status) === 404 && l.read.id !== void 0) {
93
- l.reject(z());
93
+ l.reject(B());
94
94
  return;
95
95
  }
96
96
  if ((r == null ? void 0 : r.status) !== 200 || r === void 0) {
@@ -99,12 +99,12 @@ function ce(e) {
99
99
  }
100
100
  l.resolve(l.read.id !== void 0 ? { data: r.data } : { data: r.data, ...r.meta ?? {} });
101
101
  });
102
- }, m = () => {
102
+ }, _ = () => {
103
103
  n = void 0;
104
104
  const u = t;
105
105
  t = [];
106
- for (let a = 0; a < u.length; a += k)
107
- d(u.slice(a, a + k));
106
+ for (let a = 0; a < u.length; a += D)
107
+ d(u.slice(a, a + D));
108
108
  };
109
109
  return (u, a) => new Promise((l, i) => {
110
110
  t.push({
@@ -112,22 +112,22 @@ function ce(e) {
112
112
  command: u,
113
113
  resolve: l,
114
114
  reject: i
115
- }), n === void 0 && (n = setTimeout(m, 0));
115
+ }), n === void 0 && (n = setTimeout(_, 0));
116
116
  });
117
117
  }
118
- const D = 50, ue = 10, le = /^\/collections\/([A-Za-z_][A-Za-z0-9_-]{0,127})$/;
119
- function fe(e) {
118
+ const j = 50, le = 10, fe = /^\/collections\/([A-Za-z_][A-Za-z0-9_-]{0,127})$/;
119
+ function de(e) {
120
120
  const t = e;
121
- if ((t._method ?? "GET").toUpperCase() !== "GET" || M(t._params) !== "") return null;
122
- const n = le.exec(t._path ?? "");
121
+ if ((t._method ?? "GET").toUpperCase() !== "GET" || $(t._params) !== "") return null;
122
+ const n = fe.exec(t._path ?? "");
123
123
  return n ? n[1] : null;
124
124
  }
125
- function z() {
125
+ function B() {
126
126
  return Object.assign(new Error("Not found"), { status: 404, response: { error: "Not found" } });
127
127
  }
128
- function de(e) {
128
+ function he(e) {
129
129
  let t = !0, n = [], c;
130
- const d = (a) => e.request(a.command).then(a.resolve, a.reject), m = async (a) => {
130
+ const d = (a) => e.request(a.command).then(a.resolve, a.reject), _ = async (a) => {
131
131
  const l = [...new Set(a.map((o) => o.name))];
132
132
  if (l.length === 1 || !t) {
133
133
  for (const o of a) d(o);
@@ -157,7 +157,7 @@ function de(e) {
157
157
  }
158
158
  const s = r, f = new Set(Array.isArray(i == null ? void 0 : i.missing) ? i.missing : []);
159
159
  for (const o of a)
160
- Object.hasOwn(s, o.name) ? o.resolve({ data: T(s[o.name]) }) : f.has(o.name) ? o.reject(z()) : d(o);
160
+ Object.hasOwn(s, o.name) ? o.resolve({ data: T(s[o.name]) }) : f.has(o.name) ? o.reject(B()) : d(o);
161
161
  }, u = () => {
162
162
  c = void 0;
163
163
  const a = n;
@@ -166,12 +166,12 @@ function de(e) {
166
166
  for (const r of a) {
167
167
  let s = i.get(r.name);
168
168
  if (!s) {
169
- const f = l[l.length - 1], o = f ? new Set(f.map((h) => h.name)).size : D;
170
- s = f && o < D ? f : [], s !== f && l.push(s), i.set(r.name, s);
169
+ const f = l[l.length - 1], o = f ? new Set(f.map((h) => h.name)).size : j;
170
+ s = f && o < j ? f : [], s !== f && l.push(s), i.set(r.name, s);
171
171
  }
172
172
  s.push(r);
173
173
  }
174
- for (const r of l) m(r);
174
+ for (const r of l) _(r);
175
175
  };
176
176
  return (a, l) => new Promise((i, r) => {
177
177
  n.push({
@@ -179,170 +179,170 @@ function de(e) {
179
179
  command: a,
180
180
  resolve: i,
181
181
  reject: r
182
- }), c === void 0 && (c = setTimeout(u, ue));
182
+ }), c === void 0 && (c = setTimeout(u, le));
183
183
  });
184
184
  }
185
- function he(e) {
185
+ function me(e) {
186
186
  return !e || typeof e != "object" ? "" : "?" + new URLSearchParams(
187
187
  Object.fromEntries(
188
188
  Object.entries(e).filter(([, t]) => t != null).map(([t, n]) => [t, String(n)])
189
189
  )
190
190
  ).toString();
191
191
  }
192
- function me(e) {
192
+ function _e(e) {
193
193
  const t = e;
194
194
  if ((t._method ?? "GET").toUpperCase() !== "GET" || t._headers && Object.keys(t._headers).length > 0) return null;
195
195
  const n = t._path ?? "";
196
- return W(n) ? n + he(t._params) : null;
196
+ return J(n) ? n + me(t._params) : null;
197
197
  }
198
- function _e(e) {
198
+ function pe(e) {
199
199
  if (!e) return null;
200
200
  const t = Number(e);
201
201
  if (Number.isFinite(t) && t >= 0) return Math.round(t * 1e3);
202
202
  const n = Date.parse(e);
203
203
  return Number.isFinite(n) ? Math.max(0, n - Date.now()) : null;
204
204
  }
205
- function pe(e, t) {
205
+ function ye(e, t) {
206
206
  const n = t.body, c = n ?? {};
207
- return new H({
208
- message: Z(n) || `HTTP ${t.status}`,
207
+ return new Z({
208
+ message: x(n) || `HTTP ${t.status}`,
209
209
  status: t.status,
210
210
  code: typeof c.code == "string" ? c.code : null,
211
211
  requestId: t.request_id ?? null,
212
212
  response: n,
213
213
  method: "GET",
214
214
  path: e._path,
215
- retryAfterMs: _e(t.retry_after),
215
+ retryAfterMs: pe(t.retry_after),
216
216
  issues: c.issues
217
217
  });
218
218
  }
219
- function ye(e) {
220
- const t = F({
219
+ function ge(e) {
220
+ const t = W({
221
221
  post: (n) => e.request({ _method: "POST", _path: "/batch-get", _body: { reads: n } })
222
222
  });
223
- return (n, c) => (x() ?? t)(c, {
223
+ return (n, c) => (F() ?? t)(c, {
224
224
  alone: () => e.request(n),
225
- error: (d) => pe(n, d)
225
+ error: (d) => ye(n, d)
226
226
  });
227
227
  }
228
- const j = 3e3, ge = /^\/(settings|roles|collections\/[A-Za-z_][A-Za-z0-9_-]*|field-config\/[A-Za-z_][A-Za-z0-9_-]*|collection-layouts(\/active|\/summary\/[A-Za-z_][A-Za-z0-9_-]*)?|chat\/room-types|users\/me)$/, Ee = /^\/(record-views|item-locks|drafts|presence|rum|analytics|session-recordings|comments|notifications|tasks|field-rules\/evaluate|chat\/(?!room-types)|field-config\/[^/]+\/(evaluate-visibility|evaluate-defaults|evaluate-lock|cascade|project)$|items\/(?!nivaro_|directus_)[^/]+|users\/cards$|files\/verify$|batch-get$)/;
229
- function Te(e) {
228
+ const I = 3e3, Ee = /^\/(settings|roles|collections\/[A-Za-z_][A-Za-z0-9_-]*|field-config\/[A-Za-z_][A-Za-z0-9_-]*|collection-layouts(\/active|\/summary\/[A-Za-z_][A-Za-z0-9_-]*)?|chat\/room-types|users\/me)$/, Te = /^\/(record-views|item-locks|drafts|presence|rum|analytics|session-recordings|comments|notifications|tasks|field-rules\/evaluate|chat\/(?!room-types)|field-config\/[^/]+\/(evaluate-visibility|evaluate-defaults|evaluate-lock|cascade|project)$|items\/(?!nivaro_|directus_)[^/]+|users\/cards$|files\/verify$|batch-get$)/;
229
+ function be(e) {
230
230
  const t = (e._path ?? "").split("?")[0];
231
- return (e._method ?? "GET").toUpperCase() === "POST" && O.test(t) ? !0 : Ee.test(t);
231
+ return (e._method ?? "GET").toUpperCase() === "POST" && O.test(t) ? !0 : Te.test(t);
232
232
  }
233
- function be(e) {
233
+ function ve(e) {
234
234
  const t = e;
235
- if (!S(t) || !ge.test(t._path ?? "")) return !1;
235
+ if (!S(t) || !Ee.test(t._path ?? "")) return !1;
236
236
  const n = t._params;
237
237
  return !(n && n.item != null && /^\/collection-layouts\/active$/.test(t._path ?? ""));
238
238
  }
239
239
  let y = 0;
240
- function I() {
240
+ function M() {
241
241
  y++;
242
242
  }
243
243
  let b = 0;
244
- const ve = /^\/(presence|rum|analytics|session-recordings)(\/|$)|^\/(items\/batch-read|batch-get|users\/cards|activity\/labels)$/;
245
- function Ae(e) {
244
+ const Ae = /^\/(presence|rum|analytics|session-recordings)(\/|$)|^\/(items\/batch-read|batch-get|users\/cards|activity\/labels)$/;
245
+ function we(e) {
246
246
  const t = e, n = (t._path ?? "").split("?")[0];
247
- return ve.test(n) ? !1 : !((t._method ?? "GET").toUpperCase() === "POST" && O.test(n) && !/\/touch$/.test(n));
247
+ return Ae.test(n) ? !1 : !((t._method ?? "GET").toUpperCase() === "POST" && O.test(n) && !/\/touch$/.test(n));
248
248
  }
249
- const we = 50, Se = /^\/items\//;
250
- function Oe(e, t) {
249
+ const Se = 50, Oe = /^\/items\//;
250
+ function Ce(e, t) {
251
251
  return e.config === t;
252
252
  }
253
- function Ce(e, t, n, c) {
253
+ function Re(e, t, n, c) {
254
254
  if (t.epoch !== c) return !1;
255
255
  const d = e._path ?? "";
256
- return !Se.test(d) || n - t.at < we;
256
+ return !Oe.test(d) || n - t.at < Se;
257
257
  }
258
258
  function w(e, t) {
259
259
  return e.then(
260
- (n) => (t && X(), n),
260
+ (n) => (t && ee(), n),
261
261
  (n) => {
262
- throw ee(n, t) && te(t), n;
262
+ throw te(n, t) && ne(t), n;
263
263
  }
264
264
  );
265
265
  }
266
- function De(e, t = {}) {
267
- if (re(e)) return e;
268
- const n = /* @__PURE__ */ new Map(), c = t.batchReads ? ce(e) : null, d = t.batchCollections === !1 ? null : de(e), m = t.batchGets ?? t.batchReads ? ye(e) : null, u = /* @__PURE__ */ new Map();
266
+ function je(e, t = {}) {
267
+ if (se(e)) return e;
268
+ const n = /* @__PURE__ */ new Map(), c = t.batchReads ? ue(e) : null, d = t.batchCollections === !1 ? null : he(e), _ = t.batchGets ?? t.batchReads ? ge(e) : null, u = /* @__PURE__ */ new Map();
269
269
  let a = y;
270
270
  const l = (r, s, f) => {
271
271
  if (s !== y) return;
272
272
  a !== y && (u.clear(), a = y);
273
273
  const o = Date.now();
274
- for (const [h, p] of u) o - p.at >= j && u.delete(h);
274
+ for (const [h, p] of u) o - p.at >= I && u.delete(h);
275
275
  u.set(r, { at: o, epoch: s, value: f });
276
276
  }, i = (r) => {
277
277
  const s = r;
278
278
  if (!S(s)) {
279
- const _ = J(s._path, s._params);
280
- _ || N(s._method, s._path, s._body);
281
- const R = !Te(s);
282
- R && I();
283
- const G = Ae(s);
284
- G && b++;
279
+ const m = K(s._path, s._params);
280
+ m || N(s._method, s._path, s._body);
281
+ const R = !be(s);
282
+ R && M();
283
+ const G = we(s);
284
+ G && b++, m || k("start", s._method, s._path);
285
285
  const P = w(e.request(r), !1).finally(() => {
286
- G && b++;
286
+ G && b++, m || k("end", s._method, s._path);
287
287
  });
288
- return (R ? P.finally(I) : P).then((q) => (_ || N(s._method, s._path, s._body, q), q));
288
+ return (R ? P.finally(M) : P).then((q) => (m || N(s._method, s._path, s._body, q), q));
289
289
  }
290
290
  if (r._signal)
291
291
  return w(e.request(r), !1);
292
- const f = $(s), o = be(s);
292
+ const f = L(s), o = ve(s);
293
293
  if (o) {
294
- const _ = u.get(f);
295
- if (_ && _.epoch === y && Date.now() - _.at < j)
296
- return Promise.resolve(T(_.value));
294
+ const m = u.get(f);
295
+ if (m && m.epoch === y && Date.now() - m.at < I)
296
+ return Promise.resolve(T(m.value));
297
297
  }
298
298
  const h = n.get(f);
299
- if (h && (o ? Oe(h, y) : Ce(s, h, Date.now(), b)))
299
+ if (h && (o ? Ce(h, y) : Re(s, h, Date.now(), b)))
300
300
  return h.p.then(T);
301
- const p = Y(s._method, s._path, s._params);
302
- if (p && !Q()) return Promise.reject(V());
303
- const g = c ? ie(s) : null, v = !g && d ? fe(s) : null, C = !g && !v && m && !p ? me(s) : null, B = w(
304
- g && c ? c(r, g) : v && d ? d(r, v) : C && m ? m(r, C) : e.request(r),
301
+ const p = Q(s._method, s._path, s._params);
302
+ if (p && !V()) return Promise.reject(X());
303
+ const g = c ? ce(s) : null, v = !g && d ? de(s) : null, C = !g && !v && _ && !p ? _e(s) : null, U = w(
304
+ g && c ? c(r, g) : v && d ? d(r, v) : C && _ ? _(r, C) : e.request(r),
305
305
  p
306
- ), U = y, A = B.then((_) => (o && l(f, U, T(_)), _)).finally(() => {
307
- var _;
308
- ((_ = n.get(f)) == null ? void 0 : _.p) === A && n.delete(f);
306
+ ), H = y, A = U.then((m) => (o && l(f, H, T(m)), m)).finally(() => {
307
+ var m;
308
+ ((m = n.get(f)) == null ? void 0 : m.p) === A && n.delete(f);
309
309
  });
310
310
  return n.set(f, { p: A, at: Date.now(), epoch: b, config: y }), A;
311
311
  };
312
312
  return new Proxy(e, {
313
313
  get(r, s, f) {
314
314
  if (s === "request") return i;
315
- if (s === L) return !0;
315
+ if (s === z) return !0;
316
316
  if (s === "setToken" && typeof r.setToken == "function")
317
317
  return (h) => {
318
- r.setToken(h), K();
318
+ r.setToken(h), Y();
319
319
  };
320
320
  const o = Reflect.get(r, s, f);
321
321
  return typeof o == "function" ? o.bind(r) : o;
322
322
  }
323
323
  });
324
324
  }
325
- const Re = /^\/(item-locks|drafts|auth)\b/, E = /* @__PURE__ */ new Set();
326
- function Ge() {
325
+ const Ge = /^\/(item-locks|drafts|auth)\b/, E = /* @__PURE__ */ new Set();
326
+ function Pe() {
327
327
  for (const e of [...E]) e();
328
328
  }
329
- function je(e) {
329
+ function Ie(e) {
330
330
  return e.subscribe((t) => {
331
- t.type === "observerAdded" && t.query.state.fetchStatus === "fetching" && E.size !== 0 && Ge();
331
+ t.type === "observerAdded" && t.query.state.fetchStatus === "fetching" && E.size !== 0 && Pe();
332
332
  });
333
333
  }
334
- function Ie(e, t = {}) {
334
+ function Me(e, t = {}) {
335
335
  let n = t.open ?? !0, c;
336
- const d = /* @__PURE__ */ new Map(), m = () => {
336
+ const d = /* @__PURE__ */ new Map(), _ = () => {
337
337
  const i = [...d.values()];
338
338
  d.clear();
339
339
  for (const r of i) r.release();
340
340
  }, u = () => {
341
- E.delete(u), m();
341
+ E.delete(u), _();
342
342
  }, a = (i) => {
343
343
  const r = i;
344
- if (n || !ne(r) || Re.test(r._path ?? "")) return e.request(i);
345
- const s = $(r), f = d.get(s);
344
+ if (n || !re(r) || Ge.test(r._path ?? "")) return e.request(i);
345
+ const s = L(r), f = d.get(s);
346
346
  if (f) return f.promise.then(T);
347
347
  let o = () => {
348
348
  };
@@ -359,12 +359,12 @@ function Ie(e, t = {}) {
359
359
  return (o) => {
360
360
  c !== void 0 && (clearTimeout(c), c = void 0);
361
361
  const h = n;
362
- n = o, o && !h && (E.delete(u), m());
362
+ n = o, o && !h && (E.delete(u), _());
363
363
  };
364
364
  if (r === "dispose")
365
365
  return () => {
366
366
  c === void 0 && (c = setTimeout(() => {
367
- c = void 0, n = !0, E.delete(u), m();
367
+ c = void 0, n = !0, E.delete(u), _();
368
368
  }, 0));
369
369
  };
370
370
  const f = Reflect.get(i, r, s);
@@ -373,22 +373,22 @@ function Ie(e, t = {}) {
373
373
  });
374
374
  }
375
375
  export {
376
- k as BATCH_READ_LIMIT,
377
- D as COLLECTION_BATCH_LIMIT,
378
- ue as COLLECTION_BATCH_WINDOW_MS,
379
- we as RECORD_JOIN_MS,
380
- j as SETTLED_READ_MS,
381
- fe as batchableCollectionMeta,
382
- me as batchableGet,
383
- ie as batchableRead,
384
- Ie as createGatedClient,
385
- I as forgetSettledReads,
386
- re as isCoalesced,
387
- be as isSettledRead,
388
- Oe as mayJoinConfigInflight,
389
- Ce as mayJoinInflight,
390
- Ae as movesWriteEpoch,
391
- Ge as releaseGatedReads,
392
- je as releaseGatedReadsOnSharedFetch,
393
- De as withGetCoalescing
376
+ D as BATCH_READ_LIMIT,
377
+ j as COLLECTION_BATCH_LIMIT,
378
+ le as COLLECTION_BATCH_WINDOW_MS,
379
+ Se as RECORD_JOIN_MS,
380
+ I as SETTLED_READ_MS,
381
+ de as batchableCollectionMeta,
382
+ _e as batchableGet,
383
+ ce as batchableRead,
384
+ Me as createGatedClient,
385
+ M as forgetSettledReads,
386
+ se as isCoalesced,
387
+ ve as isSettledRead,
388
+ Ce as mayJoinConfigInflight,
389
+ Re as mayJoinInflight,
390
+ we as movesWriteEpoch,
391
+ Pe as releaseGatedReads,
392
+ Ie as releaseGatedReadsOnSharedFetch,
393
+ je as withGetCoalescing
394
394
  };
@@ -0,0 +1,107 @@
1
+ import { useQueryClient as I } from "@tanstack/react-query";
2
+ import { useMemo as L, useState as q, useRef as p, useEffect as T } from "react";
3
+ import { parseRollupSources as b } from "../components/item-edit/live-rollups.js";
4
+ import { useLiveRecordEvent as D } from "./live.js";
5
+ import { onWriteCommand as K } from "./own-writes.js";
6
+ const P = 15e3, N = 350, Q = 1400;
7
+ function U(l) {
8
+ const u = /* @__PURE__ */ new Map(), f = l ?? [];
9
+ for (const o of f)
10
+ if (!(o.computed_type !== "rollup" || !o.computed_formula))
11
+ for (const n of b(o.computed_formula)) {
12
+ const c = u.get(n.related_collection) ?? /* @__PURE__ */ new Set();
13
+ c.add(o.field), u.set(n.related_collection, c);
14
+ }
15
+ for (const o of u.values())
16
+ for (const n of f) {
17
+ if (n.computed_type === "rollup" || o.has(n.field) || !n.computed_formula) continue;
18
+ const c = typeof n.computed_formula == "string" ? n.computed_formula : JSON.stringify(n.computed_formula);
19
+ [...o].some((m) => c.includes(`{{${m}}}`)) && o.add(n.field);
20
+ }
21
+ return u;
22
+ }
23
+ function W(l) {
24
+ const [u, f] = l.split("?");
25
+ if (!f) return null;
26
+ const o = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/[^/?#]+)?$/.exec(u);
27
+ if (!o) return null;
28
+ const n = new URLSearchParams(f), c = n.get("parent_collection"), m = n.get("parent_id");
29
+ return !c || !m ? null : { collection: o[1], parentCollection: c, parentId: m };
30
+ }
31
+ const a = /* @__PURE__ */ new Set();
32
+ function Y(l) {
33
+ const { collection: u, fields: f, dataUpdatedAt: o, enabled: n = !0 } = l, c = l.itemId == null || l.itemId === "new" ? null : String(l.itemId), m = I(), h = L(() => U(f), [f]), A = L(() => {
34
+ const e = /* @__PURE__ */ new Set();
35
+ for (const t of h.values()) for (const s of t) e.add(s);
36
+ return e;
37
+ }, [h]), [k, y] = q(a), [z, S] = q(a), d = p({
38
+ inflight: 0,
39
+ serverOpen: !1,
40
+ /** When the burst's last write / the server's `done` ended: a re-read after it settles. */
41
+ endedAt: 0,
42
+ fields: /* @__PURE__ */ new Set()
43
+ }), C = p(l.queryKey);
44
+ C.current = l.queryKey;
45
+ const r = p({}), _ = n && !!c && A.size > 0, x = (e) => {
46
+ const t = d.current, s = new Set(t.fields);
47
+ t.fields.clear(), t.inflight = 0, t.serverOpen = !1, t.endedAt = 0, r.current.max && clearTimeout(r.current.max), r.current.reread && clearTimeout(r.current.reread), y(a), e && s.size > 0 && (S(s), r.current.landed && clearTimeout(r.current.landed), r.current.landed = setTimeout(() => S(a), Q));
48
+ }, R = p(x);
49
+ R.current = x;
50
+ const O = (e) => {
51
+ const t = d.current;
52
+ let s = !1;
53
+ for (const i of e)
54
+ A.has(i) && !t.fields.has(i) && (t.fields.add(i), s = !0);
55
+ t.endedAt = 0, r.current.reread && clearTimeout(r.current.reread), s && y(new Set(t.fields)), r.current.max && clearTimeout(r.current.max), r.current.max = setTimeout(() => R.current(!1), P);
56
+ }, v = p(O);
57
+ v.current = O;
58
+ const M = () => {
59
+ const e = d.current;
60
+ e.fields.size === 0 || e.inflight > 0 || e.serverOpen || (e.endedAt = Date.now(), r.current.reread && clearTimeout(r.current.reread), r.current.reread = setTimeout(() => {
61
+ m.invalidateQueries({ queryKey: C.current });
62
+ }, N));
63
+ }, w = p(M);
64
+ return w.current = M, T(() => {
65
+ if (_)
66
+ return K((e) => {
67
+ const t = W(e.path);
68
+ if (!t || t.parentCollection !== u || t.parentId !== c) return;
69
+ const s = h.get(t.collection);
70
+ if (!s) return;
71
+ const i = d.current;
72
+ e.phase === "start" ? (i.inflight++, v.current(s)) : (i.inflight = Math.max(0, i.inflight - 1), w.current());
73
+ });
74
+ }, [_, u, c, h]), D(
75
+ "record:recalc",
76
+ u,
77
+ c,
78
+ (e) => {
79
+ const t = Array.isArray(e == null ? void 0 : e.fields) ? e.fields.map(String) : [], s = d.current;
80
+ if ((e == null ? void 0 : e.phase) === "start") {
81
+ const i = t.filter((g) => A.has(g));
82
+ for (const g of h.values())
83
+ if (i.some((E) => g.has(E))) for (const E of g) i.push(E);
84
+ if (i.length === 0) return;
85
+ s.serverOpen = !0, v.current(i);
86
+ } else (e == null ? void 0 : e.phase) === "done" && (s.serverOpen = !1, w.current());
87
+ },
88
+ { includeOwn: !0, enabled: _ }
89
+ ), T(() => {
90
+ const e = d.current;
91
+ e.endedAt > 0 && o >= e.endedAt && R.current(!0);
92
+ }, [o]), T(() => {
93
+ const e = r.current;
94
+ return () => {
95
+ for (const t of ["reread", "max", "landed"]) e[t] && clearTimeout(e[t]);
96
+ d.current = { inflight: 0, serverOpen: !1, endedAt: 0, fields: /* @__PURE__ */ new Set() }, y(a), S(a);
97
+ };
98
+ }, [u, c]), { pending: _ ? k : a, landed: _ ? z : a };
99
+ }
100
+ export {
101
+ Q as RECALC_LANDED_MS,
102
+ P as RECALC_MAX_MS,
103
+ N as RECALC_REREAD_MS,
104
+ W as childWriteOf,
105
+ U as recalcFeeds,
106
+ Y as useRollupRecalc
107
+ };