@arbidocs/blocks 0.4.146 → 0.4.150

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 (357) hide show
  1. package/dist/ConnectedNativeDocxComparison-3XQSINPQ.cjs +44 -0
  2. package/dist/ConnectedNativeDocxComparison-3XQSINPQ.cjs.map +1 -0
  3. package/dist/ConnectedNativeDocxComparison-XQSXVGHR.js +35 -0
  4. package/dist/ConnectedNativeDocxComparison-XQSXVGHR.js.map +1 -0
  5. package/dist/ConnectedNativeDocxEditor-IPEZDERL.js +33 -0
  6. package/dist/ConnectedNativeDocxEditor-IPEZDERL.js.map +1 -0
  7. package/dist/ConnectedNativeDocxEditor-OUWFMIPH.cjs +46 -0
  8. package/dist/ConnectedNativeDocxEditor-OUWFMIPH.cjs.map +1 -0
  9. package/dist/ConnectedStreamedWordArtifact-D5LSMDO4.cjs +44 -0
  10. package/dist/ConnectedStreamedWordArtifact-D5LSMDO4.cjs.map +1 -0
  11. package/dist/ConnectedStreamedWordArtifact-UZVNBKQB.js +35 -0
  12. package/dist/ConnectedStreamedWordArtifact-UZVNBKQB.js.map +1 -0
  13. package/dist/FactTextEditor-YESAU2IJ.js +25 -0
  14. package/dist/FactTextEditor-YESAU2IJ.js.map +1 -0
  15. package/dist/FactTextEditor-YUPBCTXK.cjs +27 -0
  16. package/dist/FactTextEditor-YUPBCTXK.cjs.map +1 -0
  17. package/dist/{NativeDocxEditor-BE2OEOTJ.cjs → NativeDocxEditor-5VBNM5I7.cjs} +8 -8
  18. package/dist/{NativeDocxEditor-BE2OEOTJ.cjs.map → NativeDocxEditor-5VBNM5I7.cjs.map} +1 -1
  19. package/dist/{NativeDocxEditor-KOPFMRYW.js → NativeDocxEditor-XT5ZLFGU.js} +4 -4
  20. package/dist/{NativeDocxEditor-KOPFMRYW.js.map → NativeDocxEditor-XT5ZLFGU.js.map} +1 -1
  21. package/dist/agents/index.cjs +265 -266
  22. package/dist/agents/index.js +8 -9
  23. package/dist/calendar/index.cjs +117 -125
  24. package/dist/calendar/index.d.ts +0 -1
  25. package/dist/calendar/index.js +1 -1
  26. package/dist/calls/index.cjs +3 -3
  27. package/dist/calls/index.js +2 -2
  28. package/dist/chat/index.cjs +78 -78
  29. package/dist/chat/index.js +3 -3
  30. package/dist/{chunk-2FL7QJKJ.js → chunk-265GOG4W.js} +3 -3
  31. package/dist/{chunk-2FL7QJKJ.js.map → chunk-265GOG4W.js.map} +1 -1
  32. package/dist/{chunk-IJST4EBM.js → chunk-3E2F4AHD.js} +8 -8
  33. package/dist/{chunk-IJST4EBM.js.map → chunk-3E2F4AHD.js.map} +1 -1
  34. package/dist/chunk-3FSXWVHW.cjs +5184 -0
  35. package/dist/chunk-3FSXWVHW.cjs.map +1 -0
  36. package/dist/{chunk-LPYEUD2D.cjs → chunk-4JNKXOFZ.cjs} +3 -3
  37. package/dist/{chunk-LPYEUD2D.cjs.map → chunk-4JNKXOFZ.cjs.map} +1 -1
  38. package/dist/{chunk-ODRHHWHY.cjs → chunk-4KMLM3GY.cjs} +4 -4
  39. package/dist/chunk-4KMLM3GY.cjs.map +1 -0
  40. package/dist/{chunk-MHFF5N65.cjs → chunk-757OYF6G.cjs} +4 -38
  41. package/dist/chunk-757OYF6G.cjs.map +1 -0
  42. package/dist/chunk-AXTDDWMR.js +16 -0
  43. package/dist/chunk-AXTDDWMR.js.map +1 -0
  44. package/dist/{chunk-B3AHCIV5.js → chunk-BJ24VPOA.js} +4 -55
  45. package/dist/chunk-BJ24VPOA.js.map +1 -0
  46. package/dist/chunk-C7PTF6BQ.cjs +172 -0
  47. package/dist/chunk-C7PTF6BQ.cjs.map +1 -0
  48. package/dist/{chunk-T5B7FM7S.js → chunk-COA3S3CZ.js} +3 -3
  49. package/dist/{chunk-T5B7FM7S.js.map → chunk-COA3S3CZ.js.map} +1 -1
  50. package/dist/{chunk-C44TDH54.js → chunk-CQPFW64W.js} +5 -5
  51. package/dist/{chunk-C44TDH54.js.map → chunk-CQPFW64W.js.map} +1 -1
  52. package/dist/chunk-D3WFIFRY.cjs +659 -0
  53. package/dist/chunk-D3WFIFRY.cjs.map +1 -0
  54. package/dist/{chunk-QXMR5YHC.js → chunk-DIB4JYUY.js} +19 -3
  55. package/dist/chunk-DIB4JYUY.js.map +1 -0
  56. package/dist/chunk-DVB5ZKOF.js +22 -0
  57. package/dist/chunk-DVB5ZKOF.js.map +1 -0
  58. package/dist/{chunk-VHJHY7TT.js → chunk-ECERC6TI.js} +3 -3
  59. package/dist/{chunk-VHJHY7TT.js.map → chunk-ECERC6TI.js.map} +1 -1
  60. package/dist/chunk-EDV7CYG6.cjs +18 -0
  61. package/dist/chunk-EDV7CYG6.cjs.map +1 -0
  62. package/dist/chunk-FAXXN7KI.cjs +213 -0
  63. package/dist/chunk-FAXXN7KI.cjs.map +1 -0
  64. package/dist/{chunk-2MJWWPHY.js → chunk-G4IYES7G.js} +140 -15
  65. package/dist/chunk-G4IYES7G.js.map +1 -0
  66. package/dist/{chunk-MFMASSEO.cjs → chunk-GGTUMLCT.cjs} +93 -91
  67. package/dist/chunk-GGTUMLCT.cjs.map +1 -0
  68. package/dist/{chunk-QI6AIHWP.cjs → chunk-GOWXP5KT.cjs} +145 -14
  69. package/dist/chunk-GOWXP5KT.cjs.map +1 -0
  70. package/dist/{chunk-O6IEZDRC.cjs → chunk-GRGS5M6O.cjs} +181 -3
  71. package/dist/chunk-GRGS5M6O.cjs.map +1 -0
  72. package/dist/{chunk-A6IU4GIW.js → chunk-HGLC566X.js} +598 -13
  73. package/dist/chunk-HGLC566X.js.map +1 -0
  74. package/dist/{chunk-O2GW5IY6.cjs → chunk-ILM42LE6.cjs} +33 -33
  75. package/dist/{chunk-O2GW5IY6.cjs.map → chunk-ILM42LE6.cjs.map} +1 -1
  76. package/dist/{chunk-C3CGJK7A.cjs → chunk-IPQ5MJ4Z.cjs} +636 -31
  77. package/dist/chunk-IPQ5MJ4Z.cjs.map +1 -0
  78. package/dist/{chunk-NRFAWUVD.js → chunk-JAANWQGB.js} +157 -157
  79. package/dist/chunk-JAANWQGB.js.map +1 -0
  80. package/dist/{chunk-7RJTEWYM.js → chunk-JGOST4IL.js} +350 -64
  81. package/dist/chunk-JGOST4IL.js.map +1 -0
  82. package/dist/chunk-KHXEIEXN.js +41 -0
  83. package/dist/chunk-KHXEIEXN.js.map +1 -0
  84. package/dist/chunk-KLPRAQCE.cjs +22 -0
  85. package/dist/chunk-KLPRAQCE.cjs.map +1 -0
  86. package/dist/chunk-KQYPP72K.js +644 -0
  87. package/dist/chunk-KQYPP72K.js.map +1 -0
  88. package/dist/chunk-KUT2Y7JF.cjs +43 -0
  89. package/dist/chunk-KUT2Y7JF.cjs.map +1 -0
  90. package/dist/{chunk-6YTHQ73P.cjs → chunk-LLYZGH3L.cjs} +3 -56
  91. package/dist/chunk-LLYZGH3L.cjs.map +1 -0
  92. package/dist/{chunk-YSHIC4NJ.cjs → chunk-LXTOOUEN.cjs} +159 -154
  93. package/dist/chunk-LXTOOUEN.cjs.map +1 -0
  94. package/dist/{chunk-EVUEIBNU.js → chunk-M4S75AEJ.js} +44 -5
  95. package/dist/chunk-M4S75AEJ.js.map +1 -0
  96. package/dist/{chunk-V5OAXIBN.cjs → chunk-NPR5BGFF.cjs} +11 -11
  97. package/dist/{chunk-V5OAXIBN.cjs.map → chunk-NPR5BGFF.cjs.map} +1 -1
  98. package/dist/{chunk-PLJ7PHWU.cjs → chunk-NS7NVX4E.cjs} +3 -3
  99. package/dist/{chunk-PLJ7PHWU.cjs.map → chunk-NS7NVX4E.cjs.map} +1 -1
  100. package/dist/{chunk-RB7GX2VT.cjs → chunk-NWNAYXC7.cjs} +9 -9
  101. package/dist/{chunk-RB7GX2VT.cjs.map → chunk-NWNAYXC7.cjs.map} +1 -1
  102. package/dist/chunk-Q6N6MZKO.js +5004 -0
  103. package/dist/chunk-Q6N6MZKO.js.map +1 -0
  104. package/dist/{chunk-I2QSDQQV.cjs → chunk-QT3A4PFC.cjs} +21 -2
  105. package/dist/chunk-QT3A4PFC.cjs.map +1 -0
  106. package/dist/{chunk-6HCJ3ZEU.js → chunk-R6VCPDPF.js} +178 -6
  107. package/dist/chunk-R6VCPDPF.js.map +1 -0
  108. package/dist/{chunk-ZM26YEOT.js → chunk-RY2SODRN.js} +3 -3
  109. package/dist/{chunk-ZM26YEOT.js.map → chunk-RY2SODRN.js.map} +1 -1
  110. package/dist/chunk-SDOEHEJP.js +208 -0
  111. package/dist/chunk-SDOEHEJP.js.map +1 -0
  112. package/dist/{chunk-DETZZBG2.cjs → chunk-SIB6C7P7.cjs} +43 -2
  113. package/dist/chunk-SIB6C7P7.cjs.map +1 -0
  114. package/dist/{chunk-OPTBQSCV.cjs → chunk-SMN32BQ3.cjs} +4 -183
  115. package/dist/chunk-SMN32BQ3.cjs.map +1 -0
  116. package/dist/chunk-TAWPVD6C.cjs +1956 -0
  117. package/dist/chunk-TAWPVD6C.cjs.map +1 -0
  118. package/dist/chunk-TC25LGIM.js +6584 -0
  119. package/dist/chunk-TC25LGIM.js.map +1 -0
  120. package/dist/{chunk-OBWYM25Y.js → chunk-TL45OJQE.js} +85 -83
  121. package/dist/chunk-TL45OJQE.js.map +1 -0
  122. package/dist/{chunk-AOSUHWIL.js → chunk-TZOQKV64.js} +4 -37
  123. package/dist/chunk-TZOQKV64.js.map +1 -0
  124. package/dist/chunk-UTVY63DG.js +16 -0
  125. package/dist/chunk-UTVY63DG.js.map +1 -0
  126. package/dist/chunk-V4YZXGXR.cjs +6751 -0
  127. package/dist/chunk-V4YZXGXR.cjs.map +1 -0
  128. package/dist/chunk-XRWHFMHK.js +19 -0
  129. package/dist/chunk-XRWHFMHK.js.map +1 -0
  130. package/dist/{chunk-O4YPVYPO.cjs → chunk-YAEXSCUW.cjs} +364 -60
  131. package/dist/chunk-YAEXSCUW.cjs.map +1 -0
  132. package/dist/chunk-YIFCLNII.cjs +18 -0
  133. package/dist/chunk-YIFCLNII.cjs.map +1 -0
  134. package/dist/chunk-Z27QMJ6S.cjs +25 -0
  135. package/dist/chunk-Z27QMJ6S.cjs.map +1 -0
  136. package/dist/{chunk-CSI2B2H5.js → chunk-Z4NQ3TED.js} +4 -4
  137. package/dist/chunk-Z4NQ3TED.js.map +1 -0
  138. package/dist/{chunk-DWZXSPMB.cjs → chunk-ZAVEMQ37.cjs} +3 -3
  139. package/dist/{chunk-DWZXSPMB.cjs.map → chunk-ZAVEMQ37.cjs.map} +1 -1
  140. package/dist/{chunk-FUTMU4FR.js → chunk-ZLEYLCE4.js} +8 -181
  141. package/dist/chunk-ZLEYLCE4.js.map +1 -0
  142. package/dist/chunk-ZNLTEZEF.js +170 -0
  143. package/dist/chunk-ZNLTEZEF.js.map +1 -0
  144. package/dist/chunk-ZO7PJMCO.js +1907 -0
  145. package/dist/chunk-ZO7PJMCO.js.map +1 -0
  146. package/dist/citations/index.cjs +14 -14
  147. package/dist/citations/index.js +2 -2
  148. package/dist/collaboration/index.cjs +74 -74
  149. package/dist/collaboration/index.js +3 -3
  150. package/dist/connect/docx.cjs +23 -28
  151. package/dist/connect/docx.cjs.map +1 -1
  152. package/dist/connect/docx.js +12 -28
  153. package/dist/connect/docx.js.map +1 -1
  154. package/dist/connect/index.cjs +8799 -2057
  155. package/dist/connect/index.cjs.map +1 -1
  156. package/dist/connect/index.d.ts +11 -2
  157. package/dist/connect/index.js +8578 -1884
  158. package/dist/connect/index.js.map +1 -1
  159. package/dist/connect/viewer.cjs +1229 -0
  160. package/dist/connect/viewer.cjs.map +1 -0
  161. package/dist/connect/viewer.d.ts +8 -0
  162. package/dist/connect/viewer.js +1226 -0
  163. package/dist/connect/viewer.js.map +1 -0
  164. package/dist/connection/ConnectedWorkflowsTable.d.ts +2 -12
  165. package/dist/connection/ai.d.ts +2 -9
  166. package/dist/connection/billing/AddAddonDialog.d.ts +24 -0
  167. package/dist/connection/billing/BillingCard.d.ts +18 -0
  168. package/dist/connection/billing/BillingProjectEntity.d.ts +9 -0
  169. package/dist/connection/billing/ChangePlanDialog.d.ts +20 -0
  170. package/dist/connection/billing/ChangeProPlan.d.ts +20 -0
  171. package/dist/connection/billing/CheckoutTotal.d.ts +12 -0
  172. package/dist/connection/billing/DailyCapEditor.d.ts +4 -0
  173. package/dist/connection/billing/InvoicesModal.d.ts +6 -0
  174. package/dist/connection/billing/NewProjectFlow.d.ts +14 -0
  175. package/dist/connection/billing/PlanChangeLines.d.ts +13 -0
  176. package/dist/connection/billing/PlanSelector.d.ts +50 -0
  177. package/dist/connection/billing/ProjectBilling.d.ts +24 -0
  178. package/dist/connection/billing/ProjectDetail.d.ts +16 -0
  179. package/dist/connection/billing/ProjectUsageCard.d.ts +21 -0
  180. package/dist/connection/billing/ProjectUsageContent.d.ts +18 -0
  181. package/dist/connection/billing/ProjectsTable.d.ts +13 -0
  182. package/dist/connection/billing/ReduceAddonDialog.d.ts +18 -0
  183. package/dist/connection/billing/ReferralReward.d.ts +32 -0
  184. package/dist/connection/billing/SharedProjects.d.ts +13 -0
  185. package/dist/connection/billing/StripeCheckoutModal.d.ts +32 -0
  186. package/dist/connection/billing/SubscriptionPlans.d.ts +15 -0
  187. package/dist/connection/billing/SubscriptionStatus.d.ts +10 -0
  188. package/dist/connection/billing/addon-pricing.d.ts +97 -0
  189. package/dist/connection/billing/api-error.d.ts +6 -0
  190. package/dist/connection/billing/billing-country.d.ts +14 -0
  191. package/dist/connection/billing/billing-focus.d.ts +11 -0
  192. package/dist/connection/billing/index.d.ts +22 -0
  193. package/dist/connection/billing/plan-badge.d.ts +15 -0
  194. package/dist/connection/billing/plan-change-outcome.d.ts +15 -0
  195. package/dist/connection/billing/plan-constants.d.ts +29 -0
  196. package/dist/connection/billing/plan-pricing.d.ts +67 -0
  197. package/dist/connection/billing/quota-items.d.ts +33 -0
  198. package/dist/connection/billing/referral-reward.d.ts +28 -0
  199. package/dist/connection/billing/refusal-copy.d.ts +5 -0
  200. package/dist/connection/billing/reward-balance.d.ts +19 -0
  201. package/dist/connection/billing/support.d.ts +35 -0
  202. package/dist/connection/billing/tax-quote.d.ts +36 -0
  203. package/dist/connection/billing/useAddonPurchase.d.ts +32 -0
  204. package/dist/connection/billing/useAutoRefreshPendingProjects.d.ts +11 -0
  205. package/dist/connection/billing/useCheckoutQuote.d.ts +30 -0
  206. package/dist/connection/billing/useOpenBillingPortal.d.ts +12 -0
  207. package/dist/connection/calendar/CalendarSettingsDialog.d.ts +1 -1
  208. package/dist/connection/connectors/ConnectedAppsSettings.d.ts +24 -0
  209. package/dist/connection/connectors/ConnectedDriveSyncDialog.d.ts +12 -0
  210. package/dist/connection/connectors/ConnectedMailboxSyncDialog.d.ts +12 -0
  211. package/dist/connection/connectors/index.d.ts +4 -0
  212. package/dist/connection/connectors/sync-labels.d.ts +21 -0
  213. package/dist/connection/facts/ConnectedFactsPage.d.ts +50 -0
  214. package/dist/connection/facts/FactMarkdownEditor.d.ts +57 -0
  215. package/dist/connection/facts/FactSourcesPopover.d.ts +38 -0
  216. package/dist/connection/facts/FactTextEditor.d.ts +2 -0
  217. package/dist/connection/facts/factNouns.d.ts +4 -0
  218. package/dist/connection/facts/factPageColumns.d.ts +37 -0
  219. package/dist/connection/facts/types.d.ts +127 -0
  220. package/dist/connection/facts/useFactActions.d.ts +10 -0
  221. package/dist/connection/facts/useFactComposer.d.ts +54 -0
  222. package/dist/connection/facts/useFactFilters.d.ts +101 -0
  223. package/dist/connection/facts/useFactSelection.d.ts +82 -0
  224. package/dist/connection/facts/useFactsGrid.d.ts +87 -0
  225. package/dist/connection/facts/useFactsPageView.d.ts +4 -0
  226. package/dist/connection/mail/ConnectedMailComposer.d.ts +3 -1
  227. package/dist/connection/mail/ConnectedMailbox.d.ts +4 -2
  228. package/dist/connection/mail/MailComposerForm.d.ts +4 -2
  229. package/dist/connection/mail/MailRecipientInput.d.ts +14 -0
  230. package/dist/connection/mail/index.d.ts +1 -1
  231. package/dist/connection/mail/types.d.ts +10 -0
  232. package/dist/connection/search/ConnectedSearchPage.d.ts +64 -0
  233. package/dist/connection/search/SearchResultRows.d.ts +38 -0
  234. package/dist/connection/search/index.d.ts +2 -0
  235. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +4 -0
  236. package/dist/connection/settings-page/index.d.ts +1 -1
  237. package/dist/connection/tags/ConnectedTagTable.d.ts +108 -0
  238. package/dist/connection/tags/ConnectedTagsPage.d.ts +55 -0
  239. package/dist/connection/tags/DocTagPassages.d.ts +25 -0
  240. package/dist/connection/tags/GlossaryExport.d.ts +7 -0
  241. package/dist/connection/tags/TagCombineFilter.d.ts +14 -0
  242. package/dist/connection/tags/TagPlacement.d.ts +16 -0
  243. package/dist/connection/tags/TagsPageSections.d.ts +36 -0
  244. package/dist/connection/tags/tagCombine.d.ts +55 -0
  245. package/dist/connection/useConnectedWorkNotifications.d.ts +7 -24
  246. package/dist/connection/viewer/ConnectedDocumentToolsProvider.d.ts +11 -0
  247. package/dist/connection/viewer/ConnectedDocumentViewer.d.ts +21 -0
  248. package/dist/connection/viewer/FinaliseTranslationButton.d.ts +15 -0
  249. package/dist/connection/viewer/ViewerPdfPane.d.ts +46 -0
  250. package/dist/connection/viewer/support.d.ts +79 -0
  251. package/dist/connection/viewer/useImageCrop.d.ts +13 -0
  252. package/dist/connection/viewer/useViewedDocument.d.ts +70 -0
  253. package/dist/connection/viewer/useViewerBlobs.d.ts +15 -0
  254. package/dist/connection/viewer/useViewerTabs.d.ts +18 -0
  255. package/dist/connection/viewer/useViewerVersions.d.ts +11 -0
  256. package/dist/connection/workspace-settings/useConnectedWorkspaceSettings.d.ts +6 -0
  257. package/dist/document-tools/index.cjs +59 -652
  258. package/dist/document-tools/index.cjs.map +1 -1
  259. package/dist/document-tools/index.js +2 -641
  260. package/dist/document-tools/index.js.map +1 -1
  261. package/dist/docx/index.cjs +48 -47
  262. package/dist/docx/index.js +4 -3
  263. package/dist/facts/FactsBulkBar.d.ts +6 -3
  264. package/dist/facts/cited-version-ref.d.ts +1 -0
  265. package/dist/facts/index.cjs +206 -1942
  266. package/dist/facts/index.cjs.map +1 -1
  267. package/dist/facts/index.d.ts +1 -0
  268. package/dist/facts/index.js +15 -1897
  269. package/dist/facts/index.js.map +1 -1
  270. package/dist/files/ViewerChrome.d.ts +5 -4
  271. package/dist/files/ViewerControlBar.d.ts +12 -0
  272. package/dist/files/doc-labels.d.ts +35 -0
  273. package/dist/files/grid/FilterButton.d.ts +12 -0
  274. package/dist/files/grid/RowDensityControl.d.ts +18 -0
  275. package/dist/files/grid/row-density.d.ts +27 -0
  276. package/dist/files/index.cjs +779 -7100
  277. package/dist/files/index.cjs.map +1 -1
  278. package/dist/files/index.d.ts +5 -0
  279. package/dist/files/index.js +14 -6919
  280. package/dist/files/index.js.map +1 -1
  281. package/dist/home/index.cjs +2 -2
  282. package/dist/home/index.js +2 -2
  283. package/dist/index.cjs +1043 -1259
  284. package/dist/index.cjs.map +1 -1
  285. package/dist/index.js +27 -360
  286. package/dist/index.js.map +1 -1
  287. package/dist/retrieval/SearchSnippet.d.ts +6 -0
  288. package/dist/retrieval/index.cjs +75 -42
  289. package/dist/retrieval/index.d.ts +2 -0
  290. package/dist/retrieval/index.js +3 -2
  291. package/dist/retrieval/search-results.d.ts +46 -0
  292. package/dist/settings/Billing.d.ts +0 -66
  293. package/dist/settings/PlanBadge.d.ts +1 -1
  294. package/dist/settings/SubscriptionParts.d.ts +1 -50
  295. package/dist/settings/index.cjs +501 -3714
  296. package/dist/settings/index.cjs.map +1 -1
  297. package/dist/settings/index.d.ts +3 -2
  298. package/dist/settings/index.js +10 -3527
  299. package/dist/settings/index.js.map +1 -1
  300. package/dist/settings/inverted-index-filter.d.ts +26 -0
  301. package/dist/shell/index.cjs +2 -2
  302. package/dist/shell/index.js +2 -2
  303. package/dist/site/index.cjs +5 -5
  304. package/dist/site/index.js +1 -1
  305. package/dist/studio/index.cjs +6 -6
  306. package/dist/studio/index.js +5 -5
  307. package/dist/tags/definitions.d.ts +10 -0
  308. package/dist/tags/index.d.ts +4 -1
  309. package/dist/tags/page/ExtractEntitiesDialog.d.ts +24 -0
  310. package/dist/tags/page/TagPicker.d.ts +16 -0
  311. package/dist/tags/page/tagsPageLabels.d.ts +36 -0
  312. package/dist/workflow-canvas/index.cjs +21 -22
  313. package/dist/workflow-canvas/index.cjs.map +1 -1
  314. package/dist/workflow-canvas/index.js +8 -9
  315. package/dist/workflow-canvas/index.js.map +1 -1
  316. package/node_modules/@arbidocs/coedit/package.json +1 -1
  317. package/package.json +13 -4
  318. package/dist/calendar/access-setup.d.ts +0 -8
  319. package/dist/chunk-2MJWWPHY.js.map +0 -1
  320. package/dist/chunk-3AFWGEDJ.cjs +0 -53
  321. package/dist/chunk-3AFWGEDJ.cjs.map +0 -1
  322. package/dist/chunk-5YHEHEJT.js +0 -1667
  323. package/dist/chunk-5YHEHEJT.js.map +0 -1
  324. package/dist/chunk-6HCJ3ZEU.js.map +0 -1
  325. package/dist/chunk-6YTHQ73P.cjs.map +0 -1
  326. package/dist/chunk-7RJTEWYM.js.map +0 -1
  327. package/dist/chunk-A6IU4GIW.js.map +0 -1
  328. package/dist/chunk-AOSUHWIL.js.map +0 -1
  329. package/dist/chunk-B3AHCIV5.js.map +0 -1
  330. package/dist/chunk-C3CGJK7A.cjs.map +0 -1
  331. package/dist/chunk-CSI2B2H5.js.map +0 -1
  332. package/dist/chunk-DETZZBG2.cjs.map +0 -1
  333. package/dist/chunk-EVUEIBNU.js.map +0 -1
  334. package/dist/chunk-FUTMU4FR.js.map +0 -1
  335. package/dist/chunk-I2QSDQQV.cjs.map +0 -1
  336. package/dist/chunk-J5CWKFSC.js +0 -170
  337. package/dist/chunk-J5CWKFSC.js.map +0 -1
  338. package/dist/chunk-MFMASSEO.cjs.map +0 -1
  339. package/dist/chunk-MHFF5N65.cjs.map +0 -1
  340. package/dist/chunk-NRFAWUVD.js.map +0 -1
  341. package/dist/chunk-O4YPVYPO.cjs.map +0 -1
  342. package/dist/chunk-O6IEZDRC.cjs.map +0 -1
  343. package/dist/chunk-OBWYM25Y.js.map +0 -1
  344. package/dist/chunk-ODRHHWHY.cjs.map +0 -1
  345. package/dist/chunk-OPTBQSCV.cjs.map +0 -1
  346. package/dist/chunk-QI6AIHWP.cjs.map +0 -1
  347. package/dist/chunk-QXMR5YHC.js.map +0 -1
  348. package/dist/chunk-RFXJYIDV.js +0 -50
  349. package/dist/chunk-RFXJYIDV.js.map +0 -1
  350. package/dist/chunk-U73KPFYH.cjs +0 -1717
  351. package/dist/chunk-U73KPFYH.cjs.map +0 -1
  352. package/dist/chunk-XVUOMWMD.cjs +0 -177
  353. package/dist/chunk-XVUOMWMD.cjs.map +0 -1
  354. package/dist/chunk-YSHIC4NJ.cjs.map +0 -1
  355. package/dist/connection/ConnectedTagTable.d.ts +0 -32
  356. package/dist/connection/calendar/CopyField.d.ts +0 -9
  357. package/dist/connection/calendar/OpenAccessPanel.d.ts +0 -7
@@ -1,410 +1,29 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var chunkTAWPVD6C_cjs = require('../chunk-TAWPVD6C.cjs');
5
+ require('../chunk-2WLXQGWC.cjs');
4
6
  var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
5
- var chunk2WLXQGWC_cjs = require('../chunk-2WLXQGWC.cjs');
6
7
  var chunkUTTTJSQU_cjs = require('../chunk-UTTTJSQU.cjs');
7
- var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
8
+ require('../chunk-VPPX5XUF.cjs');
8
9
  var chunkRC25WMVB_cjs = require('../chunk-RC25WMVB.cjs');
9
- var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
10
+ require('../chunk-V4ISCZJ7.cjs');
10
11
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
11
12
  var chunkC2CWWEHO_cjs = require('../chunk-C2CWWEHO.cjs');
12
- var chunkBIXHB4LV_cjs = require('../chunk-BIXHB4LV.cjs');
13
- var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
14
- require('../chunk-FX3K6LNZ.cjs');
15
- var chunkPPCATBOY_cjs = require('../chunk-PPCATBOY.cjs');
16
- var chunkMHVNT4J3_cjs = require('../chunk-MHVNT4J3.cjs');
13
+ require('../chunk-7RGLTF76.cjs');
14
+ require('../chunk-BIXHB4LV.cjs');
17
15
  require('../chunk-KPZZ5FHE.cjs');
18
16
  require('../chunk-ULWRNGGE.cjs');
17
+ require('../chunk-FX3K6LNZ.cjs');
18
+ require('../chunk-PPCATBOY.cjs');
19
+ var chunkMHVNT4J3_cjs = require('../chunk-MHVNT4J3.cjs');
19
20
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
20
21
  require('../chunk-DES3K4SD.cjs');
21
- var lucideReact = require('lucide-react');
22
+ var react = require('react');
22
23
  var ui = require('@arbidocs/react/ui');
23
24
  var jsxRuntime = require('react/jsx-runtime');
24
- var react = require('react');
25
- var artifacts = require('@arbidocs/react/artifacts');
25
+ var lucideReact = require('lucide-react');
26
26
 
27
- var DEFAULT_FACT_COLUMN_LABELS = {
28
- inChatHeaderTooltip: "Facts added to this chat are always in context for this chat",
29
- inChatTitle: "In this chat \u2014 always in context for it. Click to remove from chat.",
30
- notInChatTitle: "Add to chat \u2014 always in context for this chat",
31
- removeFromChat: "Remove from chat",
32
- addToChat: "Add to chat",
33
- fact: "Fact",
34
- dates: "Dates",
35
- dateTitle: "Date of the fact itself, not when this was saved",
36
- labels: "Labels",
37
- verified: "Verified",
38
- verifiedTooltip: "Verified by a human",
39
- shared: "Shared",
40
- sharedTooltip: "Shared with the workspace, or private to you & your agents",
41
- createdBy: "Created by",
42
- sources: "Sources",
43
- sourcedFrom: (n) => `Sourced from ${n} document${n === 1 ? "" : "s"} \u2014 open the fact to see them`,
44
- createdAt: "Created at",
45
- updated: "Updated",
46
- id: "ID"
47
- };
48
- var ISO_DATE_FILTER_PARAMS = {
49
- browserDatePicker: true,
50
- comparator: (filterDate, cellValue) => {
51
- if (!cellValue || typeof cellValue !== "string") return -1;
52
- const cell = new Date(cellValue);
53
- if (Number.isNaN(cell.getTime())) return -1;
54
- const cellDay = Date.UTC(cell.getUTCFullYear(), cell.getUTCMonth(), cell.getUTCDate());
55
- const filterDay = Date.UTC(
56
- filterDate.getFullYear(),
57
- filterDate.getMonth(),
58
- filterDate.getDate()
59
- );
60
- return cellDay < filterDay ? -1 : cellDay > filterDay ? 1 : 0;
61
- }
62
- };
63
- function sourceDocCount(fact) {
64
- return fact?.citations?.length ?? 0;
65
- }
66
- var DEFAULT_FACT_COLUMN_ORDER = [
67
- "in_chat",
68
- "text",
69
- "sources",
70
- "tags",
71
- "date",
72
- "confirmed",
73
- "shared",
74
- "created_by",
75
- "created_at",
76
- "updated_at",
77
- "note_id"
78
- ];
79
- function createFactColumns(slots) {
80
- const fieldOf = (name) => name;
81
- const l = { ...DEFAULT_FACT_COLUMN_LABELS, ...slots.labels };
82
- const ids = slots.testIds;
83
- const { isInChat, onToggleInChat } = slots;
84
- const inChatColumn = isInChat && onToggleInChat ? [
85
- {
86
- colId: "in_chat",
87
- headerName: "",
88
- headerComponent: () => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { className: "size-3.5 text-muted-foreground" }) }),
89
- valueGetter: (params) => params.data ? isInChat(params.data) : false,
90
- width: 44,
91
- minWidth: 44,
92
- maxWidth: 44,
93
- sortable: true,
94
- resizable: false,
95
- headerTooltip: l.inChatHeaderTooltip,
96
- cellClass: "cell-hcenter",
97
- // A toggle, not a readout: a fact in the chat rides every message of it, so it flips
98
- // in place.
99
- cellRenderer: (params) => {
100
- if (!params.data) return null;
101
- const fact = params.data;
102
- const inChat = isInChat(fact);
103
- return /* @__PURE__ */ jsxRuntime.jsx(
104
- "button",
105
- {
106
- type: "button",
107
- onClick: () => onToggleInChat(fact),
108
- title: inChat ? l.inChatTitle : l.notInChatTitle,
109
- "aria-label": inChat ? l.removeFromChat : l.addToChat,
110
- "aria-pressed": inChat,
111
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(ids?.inChat?.(fact.external_id), {
112
- testId: `facts-grid-in-chat-${fact.external_id}`
113
- }),
114
- className: "flex h-full items-center",
115
- children: /* @__PURE__ */ jsxRuntime.jsx(
116
- lucideReact.Paperclip,
117
- {
118
- className: ui.cn(
119
- "size-3.5",
120
- inChat ? "text-primary" : "text-muted-foreground/30 transition-colors hover:text-muted-foreground"
121
- )
122
- }
123
- )
124
- }
125
- );
126
- }
127
- }
128
- ] : [];
129
- const columns = [
130
- ...inChatColumn,
131
- {
132
- colId: "text",
133
- suppressHeaderFilterButton: true,
134
- headerComponent: (p) => slots.renderHeader(p, "text"),
135
- headerName: l.fact,
136
- field: fieldOf("text"),
137
- flex: 3,
138
- minWidth: 280,
139
- sortable: true,
140
- filter: "agTextColumnFilter",
141
- // Decode the editor's whitespace entities (`&#x20;` for a trailing space) so the tooltip
142
- // reads as typed, not as raw markdown references.
143
- tooltipValueGetter: (p) => chunkRC25WMVB_cjs.decodeWhitespaceEntities(p.data?.text),
144
- // Editable only via the grid api (Rename in the row's menu); clicks never open the editor
145
- // (suppressClickEdit on the grid).
146
- editable: true,
147
- cellEditor: "agLargeTextCellEditor",
148
- cellEditorPopup: true,
149
- cellEditorParams: { rows: 8, cols: 60 },
150
- valueSetter: (params) => {
151
- if (!params.data) return false;
152
- params.data.text = params.newValue;
153
- return true;
154
- },
155
- // NOT `cell-multiline`: this cell has its OWN clamp (the `.fact-clamp` span below, sized
156
- // from the row height). A second clamp cut the text in half at the minimum row height.
157
- cellClass: "relative",
158
- cellRenderer: (params) => {
159
- if (!params.data) return null;
160
- const fact = params.data;
161
- const rowH = params.node.rowHeight ?? 52;
162
- const clampLines = Math.max(1, Math.floor(rowH / 20));
163
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex size-full items-start pr-6", children: [
164
- /* @__PURE__ */ jsxRuntime.jsx(
165
- "span",
166
- {
167
- className: "fact-clamp whitespace-normal break-words text-sm leading-snug text-foreground",
168
- style: { ["--fact-clamp-lines"]: clampLines },
169
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(ids?.text?.(fact.external_id), {
170
- testId: `facts-grid-text-${fact.external_id}`
171
- }),
172
- children: chunkRC25WMVB_cjs.decodeWhitespaceEntities(fact.text)
173
- }
174
- ),
175
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "facts-row-kebab absolute right-0.5 top-1/2 -translate-y-1/2", children: slots.renderRowActions(fact, params) })
176
- ] });
177
- }
178
- },
179
- {
180
- colId: "date",
181
- // AG Grid's DEFAULT header, so the sort arrow and filter button are the native ones,
182
- // identical to the Files table's Date columns.
183
- headerName: l.dates,
184
- // Sort on the raw bound rather than the rendered string ("Oct 2019" sorts April first).
185
- field: fieldOf("date_start"),
186
- flex: 0.8,
187
- minWidth: 132,
188
- sortable: true,
189
- filter: "agDateColumnFilter",
190
- filterParams: ISO_DATE_FILTER_PARAMS,
191
- // The edit value is the date-only slice: a lexical sort matches a chronological one, and
192
- // the inline editor shows "2024-03-12" rather than a full ISO timestamp. Inline typing
193
- // accepts YYYY, YYYY-MM or YYYY-MM-DD; clearing the cell undates the fact.
194
- editable: true,
195
- singleClickEdit: true,
196
- valueGetter: (params) => params.data?.date_start ? params.data.date_start.slice(0, 10) : null,
197
- valueSetter: (params) => {
198
- if (!params.data) return false;
199
- params.data.date_start = params.newValue;
200
- return true;
201
- },
202
- cellClass: "relative cell-tnum",
203
- cellRenderer: (params) => {
204
- const when = chunkVPPX5XUF_cjs.formatSpan(
205
- params.data?.date_start,
206
- params.data?.date_end,
207
- params.data?.timezone
208
- );
209
- if (!when) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/50", children: "\u2014" });
210
- return /* @__PURE__ */ jsxRuntime.jsxs(
211
- "span",
212
- {
213
- className: "inline-flex items-center gap-1",
214
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(ids?.date?.(params.data?.external_id ?? ""), {
215
- testId: `facts-grid-date-${params.data?.external_id}`
216
- }),
217
- title: l.dateTitle,
218
- children: [
219
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarDays, { className: "size-3 opacity-70" }),
220
- when
221
- ]
222
- }
223
- );
224
- }
225
- },
226
- {
227
- colId: "tags",
228
- suppressHeaderFilterButton: true,
229
- headerComponent: (p) => slots.renderHeader(p, "tags"),
230
- headerName: l.labels,
231
- flex: 0.9,
232
- // Never narrower than its own header, even with the filter button and sort indicator.
233
- minWidth: 160,
234
- sortable: true,
235
- filter: "agTextColumnFilter",
236
- cellClass: "overflow-visible",
237
- valueGetter: (params) => (params.data?.tags ?? []).map((t) => t.name).join(", "),
238
- // Editable in place: toggling a label persists immediately, no dialog round-trip.
239
- cellRenderer: (params) => params.data ? slots.renderLabels(params.data, params) : null
240
- },
241
- {
242
- colId: "confirmed",
243
- headerName: l.verified,
244
- headerTooltip: l.verifiedTooltip,
245
- field: fieldOf("confirmed"),
246
- // minWidth matches width so the header can't be clamped narrow enough to ellipsize.
247
- width: 116,
248
- minWidth: 116,
249
- sortable: true,
250
- cellDataType: "boolean",
251
- valueGetter: (params) => params.data?.confirmed ?? false,
252
- cellClass: "cell-hcenter",
253
- headerClass: "header-hcenter",
254
- cellRenderer: (params) => params.data ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: slots.renderVerified(params.data) }) : null
255
- },
256
- {
257
- colId: "shared",
258
- headerName: l.shared,
259
- headerTooltip: l.sharedTooltip,
260
- field: fieldOf("shared"),
261
- // minWidth (not just width) is raised too: AG Grid clamps any persisted width up to it.
262
- width: 110,
263
- minWidth: 110,
264
- sortable: true,
265
- headerClass: "header-hcenter",
266
- cellDataType: "boolean",
267
- valueGetter: (params) => params.data?.shared ?? false,
268
- cellRenderer: (params) => params.data ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: slots.renderShared(params.data, params) }) : null
269
- },
270
- {
271
- colId: "created_by",
272
- headerName: l.createdBy,
273
- headerTooltip: l.createdBy,
274
- width: 138,
275
- minWidth: 138,
276
- sortable: true,
277
- valueGetter: (params) => slots.getCreatorName(params),
278
- cellRenderer: (params) => params.data ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: slots.renderCreator(params.data, params) }) : null
279
- },
280
- {
281
- colId: "sources",
282
- headerName: l.sources,
283
- width: 112,
284
- minWidth: 104,
285
- sortable: true,
286
- // A hand-written fact has no sources, which is information rather than a gap: it reads as
287
- // an em dash instead of a zero.
288
- valueGetter: (params) => sourceDocCount(params.data),
289
- cellRenderer: (params) => {
290
- const n = sourceDocCount(params.data);
291
- if (n === 0) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/40", children: "\u2014" });
292
- return /* @__PURE__ */ jsxRuntime.jsxs(
293
- "span",
294
- {
295
- className: "inline-flex items-center gap-1 text-xs text-muted-foreground",
296
- title: l.sourcedFrom(n),
297
- children: [
298
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Quote, { className: "size-3 opacity-70" }),
299
- n
300
- ]
301
- }
302
- );
303
- }
304
- },
305
- {
306
- colId: "created_at",
307
- suppressHeaderFilterButton: true,
308
- headerComponent: (p) => slots.renderHeader(p, "created_at"),
309
- headerName: l.createdAt,
310
- field: fieldOf("created_at"),
311
- width: 162,
312
- minWidth: 154,
313
- sortable: true,
314
- filter: "agDateColumnFilter",
315
- filterParams: ISO_DATE_FILTER_PARAMS,
316
- // Display-only: a valueFormatter avoids mounting a React component per row.
317
- cellClass: "text-muted-foreground",
318
- valueFormatter: (params) => params.value ? slots.formatDate(params.value) : ""
319
- },
320
- {
321
- colId: "updated_at",
322
- suppressHeaderFilterButton: true,
323
- headerComponent: (p) => slots.renderHeader(p, "updated_at"),
324
- headerName: l.updated,
325
- field: fieldOf("updated_at"),
326
- width: 140,
327
- minWidth: 140,
328
- // Hidden by default: a column-menu opt-in like the documents grid's long tail.
329
- hide: true,
330
- sortable: true,
331
- filter: "agDateColumnFilter",
332
- filterParams: ISO_DATE_FILTER_PARAMS,
333
- valueFormatter: (params) => params.value ? slots.formatDate(params.value) : ""
334
- },
335
- {
336
- colId: "note_id",
337
- headerName: l.id,
338
- field: fieldOf("external_id"),
339
- width: 120,
340
- minWidth: 100,
341
- sortable: true,
342
- filter: "agTextColumnFilter",
343
- // Hidden by default like the documents ID column: needed when quoting a fact to support.
344
- hide: true,
345
- cellClass: "font-mono text-xs text-muted-foreground"
346
- }
347
- ];
348
- return DEFAULT_FACT_COLUMN_ORDER.map((id) => columns.find((c) => c.colId === id)).filter(
349
- (c) => c !== void 0
350
- );
351
- }
352
- var DEFAULT_FACT_ROW_ACTIONS_LABELS = {
353
- actions: "Fact actions",
354
- edit: "Edit",
355
- editRestricted: "Only the creator or a workspace owner can reword this fact",
356
- delete: "Delete"
357
- };
358
- function FactRowActions({
359
- onEdit,
360
- canEdit = true,
361
- onDelete,
362
- labels,
363
- testIds
364
- }) {
365
- const l = { ...DEFAULT_FACT_ROW_ACTIONS_LABELS, ...labels };
366
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
367
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
368
- "button",
369
- {
370
- type: "button",
371
- onClick: (e) => e.stopPropagation(),
372
- className: "flex size-6 pointer-coarse:size-11 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground data-[state=open]:bg-muted data-[state=open]:text-foreground",
373
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.trigger, { testId: "fact-row-actions" }),
374
- "aria-label": l.actions,
375
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "size-4" })
376
- }
377
- ) }),
378
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", onClick: (e) => e.stopPropagation(), children: [
379
- /* @__PURE__ */ jsxRuntime.jsxs(
380
- ui.DropdownMenuItem,
381
- {
382
- onSelect: onEdit,
383
- disabled: !canEdit,
384
- title: canEdit ? void 0 : l.editRestricted,
385
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.edit, { testId: "fact-action-edit" }),
386
- children: [
387
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "mr-2 size-4" }),
388
- l.edit
389
- ]
390
- }
391
- ),
392
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSeparator, {}),
393
- /* @__PURE__ */ jsxRuntime.jsxs(
394
- ui.DropdownMenuItem,
395
- {
396
- onSelect: onDelete,
397
- className: "text-red-text focus:text-red-text",
398
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.delete, { testId: "fact-action-delete" }),
399
- children: [
400
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "mr-2 size-4" }),
401
- l.delete
402
- ]
403
- }
404
- )
405
- ] })
406
- ] });
407
- }
408
27
  function FactSwitch({ checked, label, onToggle, testId }) {
409
28
  return /* @__PURE__ */ jsxRuntime.jsx(
410
29
  "button",
@@ -456,13 +75,13 @@ function FactsTable({
456
75
  gridProps,
457
76
  testId = "facts-table"
458
77
  }) {
459
- const l = { ...DEFAULT_FACT_COLUMN_LABELS, ...columnLabels };
78
+ const l = { ...chunkTAWPVD6C_cjs.DEFAULT_FACT_COLUMN_LABELS, ...columnLabels };
460
79
  const columnDefs = react.useMemo(
461
- () => createFactColumns({
80
+ () => chunkTAWPVD6C_cjs.createFactColumns({
462
81
  isInChat,
463
82
  onToggleInChat,
464
83
  renderHeader: (params) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12.5px] font-medium", children: params.displayName }),
465
- renderRowActions: (fact) => onEdit && onDelete ? /* @__PURE__ */ jsxRuntime.jsx(FactRowActions, { onEdit: () => onEdit(fact), onDelete: () => onDelete(fact) }) : null,
84
+ renderRowActions: (fact) => onEdit && onDelete ? /* @__PURE__ */ jsxRuntime.jsx(chunkTAWPVD6C_cjs.FactRowActions, { onEdit: () => onEdit(fact), onDelete: () => onDelete(fact) }) : null,
466
85
  renderLabels: (fact) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex flex-wrap items-center gap-1", children: (fact.tags ?? []).map((tag) => /* @__PURE__ */ jsxRuntime.jsx(
467
86
  "span",
468
87
  {
@@ -558,1332 +177,6 @@ function toFactRow(record) {
558
177
  function toFactRows(records) {
559
178
  return records.map(toFactRow);
560
179
  }
561
- var DEFAULT_FACT_LABELS_CELL_LABELS = {
562
- edit: "Edit labels",
563
- searchPlaceholder: "Search or create...",
564
- create: (name) => `Create \u201C${name}\u201D`,
565
- empty: "No labels yet"
566
- };
567
- var CHIP_ROW_H = 24;
568
- var CHIP_GAP = 4;
569
- var FactLabelsCell = react.memo(function FactLabelsCell2({
570
- options,
571
- selectedIds,
572
- onChange,
573
- onCreate,
574
- rowHeight = 52,
575
- labels,
576
- testIds
577
- }) {
578
- const l = { ...DEFAULT_FACT_LABELS_CELL_LABELS, ...labels };
579
- const [open, setOpen] = react.useState(false);
580
- const [search, setSearch] = react.useState("");
581
- const applied = react.useMemo(
582
- () => new Set(selectedIds.filter((id) => options.some((o) => o.id === id))),
583
- [selectedIds, options]
584
- );
585
- const toggle = (option) => onChange(
586
- applied.has(option.id) ? selectedIds.filter((id) => id !== option.id) : [...selectedIds, option.id]
587
- );
588
- const createAndApply = async (name) => {
589
- const trimmed = name.trim();
590
- if (!trimmed) return;
591
- const existing = options.find((o) => o.name.toLowerCase() === trimmed.toLowerCase());
592
- if (existing) {
593
- if (!applied.has(existing.id)) onChange([...selectedIds, existing.id]);
594
- setSearch("");
595
- return;
596
- }
597
- const id = await onCreate(trimmed);
598
- if (id) onChange([...selectedIds, id]);
599
- setSearch("");
600
- };
601
- const clampRows = Math.max(1, Math.floor((rowHeight + CHIP_GAP) / (CHIP_ROW_H + CHIP_GAP)));
602
- const appliedOptions = options.filter((o) => applied.has(o.id));
603
- const chipsRef = react.useRef(null);
604
- const [hasOverflow, setHasOverflow] = react.useState(false);
605
- react.useEffect(() => {
606
- const el = chipsRef.current;
607
- if (!el) return;
608
- const measure = () => setHasOverflow(el.scrollHeight > el.clientHeight + 1);
609
- measure();
610
- return chunkPPCATBOY_cjs.observeResize(el, measure);
611
- }, [applied, clampRows, rowHeight, options]);
612
- const searchMatchesExisting = options.some(
613
- (o) => o.name.toLowerCase() === search.trim().toLowerCase()
614
- );
615
- return /* @__PURE__ */ jsxRuntime.jsxs(
616
- ui.Popover,
617
- {
618
- open,
619
- onOpenChange: (next) => {
620
- setOpen(next);
621
- if (!next) setSearch("");
622
- },
623
- children: [
624
- /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
625
- "button",
626
- {
627
- type: "button",
628
- "aria-label": l.edit,
629
- "data-slot": "fact-labels-cell",
630
- className: "group relative flex h-full w-full min-w-0 cursor-pointer items-center gap-1 pr-4 text-left hover:bg-muted",
631
- children: appliedOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-muted-foreground opacity-50", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilLine, { className: "size-3.5" }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
632
- /* @__PURE__ */ jsxRuntime.jsx(
633
- "div",
634
- {
635
- ref: chipsRef,
636
- className: "flex min-w-0 flex-1 flex-wrap content-start gap-1 overflow-hidden",
637
- style: { maxHeight: CHIP_ROW_H * clampRows + CHIP_GAP * (clampRows - 1) },
638
- children: appliedOptions.map((o) => /* @__PURE__ */ jsxRuntime.jsxs(
639
- "span",
640
- {
641
- className: "inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-xs font-medium",
642
- title: o.name,
643
- style: { borderColor: o.color },
644
- children: [
645
- /* @__PURE__ */ jsxRuntime.jsx(
646
- "span",
647
- {
648
- className: "flex size-3.5 shrink-0 items-center justify-center rounded",
649
- style: { backgroundColor: o.color },
650
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-2.5 text-white", strokeWidth: 3 })
651
- }
652
- ),
653
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[80px] truncate", children: o.name })
654
- ]
655
- },
656
- o.id
657
- ))
658
- }
659
- ),
660
- hasOverflow && /* @__PURE__ */ jsxRuntime.jsx(
661
- "span",
662
- {
663
- className: "pointer-events-none absolute bottom-0.5 right-0.5 text-xs font-semibold leading-none text-muted-foreground",
664
- "aria-hidden": true,
665
- children: "\u2026"
666
- }
667
- )
668
- ] })
669
- }
670
- ) }),
671
- open && /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { className: "w-[360px] p-0", align: "start", side: "bottom", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Command, { shouldFilter: true, children: [
672
- /* @__PURE__ */ jsxRuntime.jsx(
673
- ui.CommandInput,
674
- {
675
- placeholder: l.searchPlaceholder,
676
- value: search,
677
- onValueChange: setSearch,
678
- onKeyDown: (e) => {
679
- if (e.key === "Enter" && search.trim() && !searchMatchesExisting) {
680
- e.preventDefault();
681
- void createAndApply(search);
682
- }
683
- }
684
- }
685
- ),
686
- /* @__PURE__ */ jsxRuntime.jsxs(ui.CommandList, { children: [
687
- /* @__PURE__ */ jsxRuntime.jsx(ui.CommandEmpty, { children: search.trim() ? /* @__PURE__ */ jsxRuntime.jsx(
688
- "button",
689
- {
690
- type: "button",
691
- onClick: () => void createAndApply(search),
692
- onPointerDown: (e) => e.preventDefault(),
693
- className: "w-full cursor-pointer rounded px-2 py-1.5 text-left text-sm text-primary hover:bg-accent pointer-coarse:min-h-11",
694
- children: l.create(search.trim())
695
- }
696
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: l.empty }) }),
697
- /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { children: options.map((o) => {
698
- const isApplied = applied.has(o.id);
699
- return /* @__PURE__ */ jsxRuntime.jsxs(
700
- ui.CommandItem,
701
- {
702
- value: o.name,
703
- onSelect: () => toggle(o),
704
- onPointerDown: (e) => e.preventDefault(),
705
- className: "cursor-pointer pointer-coarse:min-h-11",
706
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.option?.(o.id), {
707
- testId: `fact-label-select-${o.id}`
708
- }),
709
- children: [
710
- /* @__PURE__ */ jsxRuntime.jsx(
711
- "span",
712
- {
713
- className: "mr-2 flex size-4 shrink-0 items-center justify-center rounded border-2",
714
- style: isApplied ? { borderColor: o.color, backgroundColor: o.color } : { borderColor: o.color },
715
- children: isApplied && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3 text-white", strokeWidth: 3 })
716
- }
717
- ),
718
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-sm", children: o.name })
719
- ]
720
- },
721
- o.id
722
- );
723
- }) })
724
- ] })
725
- ] }) })
726
- ]
727
- }
728
- );
729
- });
730
-
731
- // src/facts/fact-date.ts
732
- var EMPTY_FACT_DATE_FIELDS = {
733
- date: "",
734
- time: "",
735
- timezone: "",
736
- endDate: "",
737
- endTime: ""
738
- };
739
- function isMidnightUtc(d) {
740
- return d.getUTCHours() === 0 && d.getUTCMinutes() === 0 && d.getUTCSeconds() === 0;
741
- }
742
- function isEndOfDayUtc(d) {
743
- return d.getUTCHours() === 23 && d.getUTCMinutes() === 59;
744
- }
745
- function dayKeyUtc(d) {
746
- return d.toISOString().slice(0, 10);
747
- }
748
- function safeTimeZone(tz) {
749
- try {
750
- new Intl.DateTimeFormat("en-US", { timeZone: tz });
751
- return tz;
752
- } catch {
753
- return "UTC";
754
- }
755
- }
756
- function isoToZonedParts(iso, timeZone) {
757
- const d = new Date(iso);
758
- const parts = Object.fromEntries(
759
- new Intl.DateTimeFormat("en-US", {
760
- timeZone: safeTimeZone(timeZone),
761
- hourCycle: "h23",
762
- year: "numeric",
763
- month: "2-digit",
764
- day: "2-digit",
765
- hour: "2-digit",
766
- minute: "2-digit"
767
- }).formatToParts(d).map((p) => [p.type, p.value])
768
- );
769
- return {
770
- date: `${parts.year}-${parts.month}-${parts.day}`,
771
- time: `${parts.hour}:${parts.minute}`
772
- };
773
- }
774
- function zonedPartsToIso(date, time, timeZone) {
775
- const tz = safeTimeZone(timeZone);
776
- const guess = /* @__PURE__ */ new Date(`${date}T${time}:00Z`);
777
- const zoned = isoToZonedParts(guess.toISOString(), tz);
778
- const [y, m, dd] = zoned.date.split("-").map(Number);
779
- const [hh, mi] = zoned.time.split(":").map(Number);
780
- const asIfUtc = Date.UTC(y, m - 1, dd, hh, mi);
781
- const offsetMs = asIfUtc - guess.getTime();
782
- return new Date(guess.getTime() - offsetMs).toISOString();
783
- }
784
- function factDateSpanToFields(dateStart, dateEnd, timezone) {
785
- if (!dateStart) return EMPTY_FACT_DATE_FIELDS;
786
- const start = new Date(dateStart);
787
- if (Number.isNaN(start.getTime())) return EMPTY_FACT_DATE_FIELDS;
788
- const end = dateEnd ? new Date(dateEnd) : start;
789
- const dateOnly = isMidnightUtc(start) && (!dateEnd || isEndOfDayUtc(end));
790
- if (dateOnly) {
791
- const startKey = dayKeyUtc(start);
792
- const endKey = dateEnd ? dayKeyUtc(end) : startKey;
793
- return { ...EMPTY_FACT_DATE_FIELDS, date: startKey, endDate: endKey !== startKey ? endKey : "" };
794
- }
795
- const tz = timezone || "UTC";
796
- const startParts = isoToZonedParts(dateStart, tz);
797
- const isInstant = !dateEnd || dateStart === dateEnd;
798
- const endParts = isInstant ? null : isoToZonedParts(dateEnd, tz);
799
- return {
800
- date: startParts.date,
801
- time: startParts.time,
802
- timezone: tz,
803
- endDate: endParts?.date ?? "",
804
- endTime: endParts?.time ?? ""
805
- };
806
- }
807
- function factDateFieldsToSpan(fields) {
808
- if (!fields.date) return { date: null, date_end: null, timezone: null };
809
- const tz = fields.timezone || chunkBIXHB4LV_cjs.detectTimeZone();
810
- const startIso = fields.time ? zonedPartsToIso(fields.date, fields.time, tz) : `${fields.date}T00:00:00.000Z`;
811
- let endIso;
812
- if (fields.endDate) {
813
- endIso = fields.time && fields.endTime ? zonedPartsToIso(fields.endDate, fields.endTime, tz) : `${fields.endDate}T23:59:59.000Z`;
814
- } else {
815
- endIso = fields.time ? startIso : `${fields.date}T23:59:59.000Z`;
816
- }
817
- return { date: startIso, date_end: endIso, timezone: fields.time ? tz : null };
818
- }
819
- var DEFAULT_FACT_DATE_INPUT_LABELS = {
820
- weekdays: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
821
- months: [
822
- "January",
823
- "February",
824
- "March",
825
- "April",
826
- "May",
827
- "June",
828
- "July",
829
- "August",
830
- "September",
831
- "October",
832
- "November",
833
- "December"
834
- ],
835
- previousMonth: "Previous month",
836
- earlierYears: "Earlier years",
837
- nextMonth: "Next month",
838
- laterYears: "Later years",
839
- pickYear: "Pick a year",
840
- addDate: "Add a date",
841
- startTime: "Start time",
842
- endTime: "End time",
843
- setStartFirst: "Set a start time first",
844
- timezone: "Timezone",
845
- endDate: "End date (optional)",
846
- clearDate: "Clear date"
847
- };
848
- function dayKey(year, monthIndex, day) {
849
- const m = String(monthIndex + 1).padStart(2, "0");
850
- const d = String(day).padStart(2, "0");
851
- return `${year}-${m}-${d}`;
852
- }
853
- function prettyDay(iso) {
854
- const [y, m, d] = iso.split("-").map(Number);
855
- if (!y || !m || !d) return iso;
856
- return new Date(Date.UTC(y, m - 1, d)).toLocaleDateString(void 0, {
857
- year: "numeric",
858
- month: "short",
859
- day: "numeric",
860
- timeZone: "UTC"
861
- });
862
- }
863
- function summarizeWithTimes(v) {
864
- const start = `${prettyDay(v.date)}, ${v.time}`;
865
- const endDay = v.endDate || v.date;
866
- if (v.endTime) return `${start} \u2013 ${prettyDay(endDay)}, ${v.endTime}`;
867
- if (v.endDate && v.endDate !== v.date) return `${start} \u2013 ${prettyDay(v.endDate)}`;
868
- return start;
869
- }
870
- function MonthCalendar({
871
- selected,
872
- onSelect,
873
- labels: l,
874
- testIds
875
- }) {
876
- const now = /* @__PURE__ */ new Date();
877
- const todayKey = dayKey(now.getFullYear(), now.getMonth(), now.getDate());
878
- const initial = react.useMemo(() => {
879
- if (selected) {
880
- const [y, m] = selected.split("-").map(Number);
881
- if (y && m) return { year: y, monthIndex: m - 1 };
882
- }
883
- return { year: now.getFullYear(), monthIndex: now.getMonth() };
884
- }, []);
885
- const [view, setView] = react.useState(initial);
886
- const [mode, setMode] = react.useState("days");
887
- const [yearStart, setYearStart] = react.useState(initial.year - 5);
888
- const firstWeekday = new Date(view.year, view.monthIndex, 1).getDay();
889
- const daysInMonth = new Date(view.year, view.monthIndex + 1, 0).getDate();
890
- const cells = [
891
- ...Array.from({ length: firstWeekday }, () => null),
892
- ...Array.from({ length: daysInMonth }, (_, i) => i + 1)
893
- ];
894
- const step = (delta) => {
895
- const next = view.monthIndex + delta;
896
- setView({
897
- year: view.year + Math.floor(next / 12),
898
- monthIndex: (next % 12 + 12) % 12
899
- });
900
- };
901
- const openYears = () => {
902
- setYearStart(view.year - 5);
903
- setMode("years");
904
- };
905
- const pickYear = (year) => {
906
- setView((v) => ({ ...v, year }));
907
- setMode("days");
908
- };
909
- const years = Array.from({ length: 12 }, (_, i) => yearStart + i);
910
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-[248px]", children: [
911
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-1 pb-2", children: [
912
- /* @__PURE__ */ jsxRuntime.jsx(
913
- "button",
914
- {
915
- type: "button",
916
- onClick: () => mode === "days" ? step(-1) : setYearStart((s) => s - 12),
917
- className: "rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground pointer-coarse:p-3",
918
- "aria-label": mode === "days" ? l.previousMonth : l.earlierYears,
919
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "size-4" })
920
- }
921
- ),
922
- mode === "days" ? /* @__PURE__ */ jsxRuntime.jsxs(
923
- "button",
924
- {
925
- type: "button",
926
- onClick: openYears,
927
- className: "rounded px-1.5 py-0.5 text-sm font-medium hover:bg-accent hover:text-foreground",
928
- "aria-label": l.pickYear,
929
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.caption, { testId: "fact-calendar-caption" }),
930
- children: [
931
- l.months[view.monthIndex],
932
- " ",
933
- view.year
934
- ]
935
- }
936
- ) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-medium", children: [
937
- yearStart,
938
- " \u2013 ",
939
- yearStart + 11
940
- ] }),
941
- /* @__PURE__ */ jsxRuntime.jsx(
942
- "button",
943
- {
944
- type: "button",
945
- onClick: () => mode === "days" ? step(1) : setYearStart((s) => s + 12),
946
- className: "rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground pointer-coarse:p-3",
947
- "aria-label": mode === "days" ? l.nextMonth : l.laterYears,
948
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-4" })
949
- }
950
- )
951
- ] }),
952
- mode === "days" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-7 gap-0.5", children: [
953
- l.weekdays.map((w) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1 text-center text-xs font-medium text-muted-foreground", children: w }, w)),
954
- cells.map((day, i) => {
955
- if (day === null) return /* @__PURE__ */ jsxRuntime.jsx("div", {}, `blank-${i}`);
956
- const key = dayKey(view.year, view.monthIndex, day);
957
- const isSelected = key === selected;
958
- const isToday = key === todayKey;
959
- return /* @__PURE__ */ jsxRuntime.jsx(
960
- "button",
961
- {
962
- type: "button",
963
- onClick: () => onSelect(key),
964
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.day?.(key), { testId: `fact-calendar-day-${key}` }),
965
- className: ui.cn(
966
- "h-8 rounded text-xs transition-colors hover:bg-accent pointer-coarse:h-11",
967
- isSelected && "bg-primary text-primary-foreground hover:bg-primary",
968
- !isSelected && isToday && "ring-1 ring-inset ring-primary/50"
969
- ),
970
- children: day
971
- },
972
- key
973
- );
974
- })
975
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-1", children: years.map((y) => /* @__PURE__ */ jsxRuntime.jsx(
976
- "button",
977
- {
978
- type: "button",
979
- onClick: () => pickYear(y),
980
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.year?.(y), { testId: `fact-calendar-year-${y}` }),
981
- className: ui.cn(
982
- "h-9 rounded text-xs transition-colors hover:bg-accent pointer-coarse:h-11",
983
- y === view.year && "bg-primary text-primary-foreground hover:bg-primary"
984
- ),
985
- children: y
986
- },
987
- y
988
- )) })
989
- ] });
990
- }
991
- function FactDateInput({ value, onChange, idPrefix, labels, testIds }) {
992
- const l = { ...DEFAULT_FACT_DATE_INPUT_LABELS, ...labels };
993
- const [open, setOpen] = react.useState(false);
994
- const timezones = react.useMemo(() => chunkBIXHB4LV_cjs.listTimeZones(), []);
995
- const timezoneListId = `${idPrefix}-timezone-options`;
996
- const span = factDateFieldsToSpan(value);
997
- const summary = value.time || value.endTime ? summarizeWithTimes(value) : chunkVPPX5XUF_cjs.formatSpan(span.date, span.date_end, span.timezone);
998
- const setDate = (dateKey) => onChange({ ...value, date: dateKey, endDate: value.endDate && dateKey ? value.endDate : "" });
999
- const setStartTime = (time) => onChange({
1000
- ...value,
1001
- time,
1002
- timezone: time ? value.timezone || chunkBIXHB4LV_cjs.detectTimeZone() : "",
1003
- endTime: time ? value.endTime : ""
1004
- });
1005
- const setEndTime = (endTime) => onChange({
1006
- ...value,
1007
- endTime,
1008
- endDate: endTime ? value.endDate || value.date : value.endDate
1009
- });
1010
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-1.5", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open, onOpenChange: setOpen, children: [
1011
- /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1012
- "button",
1013
- {
1014
- type: "button",
1015
- className: ui.cn(
1016
- "inline-flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1017
- !summary && "text-muted-foreground"
1018
- ),
1019
- "data-testid": `${idPrefix}-date-trigger`,
1020
- children: [
1021
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarDays, { className: "size-4 shrink-0 text-muted-foreground" }),
1022
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: summary || l.addDate })
1023
- ]
1024
- }
1025
- ) }),
1026
- /* @__PURE__ */ jsxRuntime.jsxs(ui.PopoverContent, { className: "w-auto p-3", align: "start", children: [
1027
- /* @__PURE__ */ jsxRuntime.jsx(MonthCalendar, { selected: value.date, onSelect: setDate, labels: l, testIds }),
1028
- value.date && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex flex-col gap-2 border-t border-border pt-3", children: [
1029
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
1030
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex flex-col gap-1", children: [
1031
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground", children: l.startTime }),
1032
- /* @__PURE__ */ jsxRuntime.jsx(
1033
- ui.Input,
1034
- {
1035
- type: "time",
1036
- value: value.time,
1037
- onChange: (e) => setStartTime(e.target.value),
1038
- className: "h-8 text-xs",
1039
- "data-testid": `${idPrefix}-time`
1040
- }
1041
- )
1042
- ] }),
1043
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex flex-col gap-1", children: [
1044
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground", children: l.endTime }),
1045
- /* @__PURE__ */ jsxRuntime.jsx(
1046
- ui.Input,
1047
- {
1048
- type: "time",
1049
- value: value.endTime,
1050
- onChange: (e) => setEndTime(e.target.value),
1051
- disabled: !value.time,
1052
- title: value.time ? void 0 : l.setStartFirst,
1053
- className: "h-8 text-xs",
1054
- "data-testid": `${idPrefix}-end-time`
1055
- }
1056
- )
1057
- ] })
1058
- ] }),
1059
- value.time && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex flex-col gap-1", children: [
1060
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground", children: l.timezone }),
1061
- /* @__PURE__ */ jsxRuntime.jsx(
1062
- ui.Input,
1063
- {
1064
- list: timezoneListId,
1065
- value: value.timezone,
1066
- onChange: (e) => onChange({ ...value, timezone: e.target.value }),
1067
- placeholder: chunkBIXHB4LV_cjs.detectTimeZone(),
1068
- className: "h-8 text-xs",
1069
- "data-testid": `${idPrefix}-timezone`
1070
- }
1071
- ),
1072
- /* @__PURE__ */ jsxRuntime.jsx("datalist", { id: timezoneListId, children: timezones.map((tz) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: tz }, tz)) })
1073
- ] }),
1074
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex flex-col gap-1", children: [
1075
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground", children: l.endDate }),
1076
- /* @__PURE__ */ jsxRuntime.jsx(
1077
- ui.Input,
1078
- {
1079
- type: "date",
1080
- value: value.endDate,
1081
- min: value.date,
1082
- onChange: (e) => onChange({ ...value, endDate: e.target.value }),
1083
- className: "h-8 text-xs",
1084
- "data-testid": `${idPrefix}-end-date`
1085
- }
1086
- )
1087
- ] }),
1088
- /* @__PURE__ */ jsxRuntime.jsxs(
1089
- ui.Button,
1090
- {
1091
- type: "button",
1092
- variant: "ghost",
1093
- size: "sm",
1094
- className: "h-7 self-start text-muted-foreground hover:text-foreground",
1095
- onClick: () => onChange(EMPTY_FACT_DATE_FIELDS),
1096
- "data-testid": `${idPrefix}-clear-date`,
1097
- children: [
1098
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "mr-1 size-3.5" }),
1099
- " ",
1100
- l.clearDate
1101
- ]
1102
- }
1103
- )
1104
- ] })
1105
- ] })
1106
- ] }) });
1107
- }
1108
- var DEFAULT_FACT_SOURCE_GROUP_LABELS = {
1109
- remove: "Remove this document",
1110
- wholeDocument: "Whole document \u2014 open it to cite specific passages"
1111
- };
1112
- function FactSourceGroup({
1113
- docId,
1114
- document: document2,
1115
- isViewing,
1116
- onRemove,
1117
- children,
1118
- hasPassages,
1119
- labels,
1120
- testIds
1121
- }) {
1122
- const l = { ...DEFAULT_FACT_SOURCE_GROUP_LABELS, ...labels };
1123
- return /* @__PURE__ */ jsxRuntime.jsxs(
1124
- "div",
1125
- {
1126
- className: "flex flex-col gap-1",
1127
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.root?.(docId), { testId: `citation-doc-${docId}` }),
1128
- "data-viewing": isViewing || void 0,
1129
- "data-slot": "fact-source-group",
1130
- children: [
1131
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 px-1 text-sm", children: [
1132
- document2,
1133
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
1134
- onRemove && /* @__PURE__ */ jsxRuntime.jsx(
1135
- "button",
1136
- {
1137
- type: "button",
1138
- onClick: onRemove,
1139
- "aria-label": l.remove,
1140
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.remove?.(docId), {
1141
- testId: `fact-source-remove-${docId}`
1142
- }),
1143
- className: "shrink-0 rounded p-0.5 hover:bg-destructive/20 hover:text-destructive pointer-coarse:p-3",
1144
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3" })
1145
- }
1146
- )
1147
- ] }),
1148
- hasPassages ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 text-xs text-muted-foreground", children: l.wholeDocument })
1149
- ]
1150
- }
1151
- );
1152
- }
1153
- var DEFAULT_FACTS_VIEW_TOGGLE_LABELS = {
1154
- table: "Table",
1155
- calendar: "Calendar",
1156
- timeline: "Timeline",
1157
- smartSearch: "Smart Search"
1158
- };
1159
- var createOptions = (l) => [
1160
- { value: "table", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table2, { className: "size-3.5" }), label: l.table },
1161
- { value: "calendar", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarRange, { className: "size-3.5" }), label: l.calendar },
1162
- { value: "gantt", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GanttChartSquare, { className: "size-3.5" }), label: l.timeline },
1163
- // Facts-only semantic/keyword recall — mirrors the Files "Smart Search" view
1164
- // (same Search icon + label), but searches this workspace's facts, not docs.
1165
- { value: "smart_search", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-3.5" }), label: l.smartSearch }
1166
- ];
1167
- function FactsViewToggle({
1168
- viewMode,
1169
- onChange,
1170
- collapsed = false,
1171
- labels,
1172
- testIdPrefix,
1173
- testIds
1174
- }) {
1175
- const options = createOptions({ ...DEFAULT_FACTS_VIEW_TOGGLE_LABELS, ...labels }).map((o) => ({
1176
- ...o,
1177
- testId: testIds?.[o.value]
1178
- }));
1179
- return /* @__PURE__ */ jsxRuntime.jsx(
1180
- chunk2WLXQGWC_cjs.ViewToggle,
1181
- {
1182
- options,
1183
- value: viewMode,
1184
- onChange: (value) => onChange(value),
1185
- testIdPrefix: chunkMHVNT4J3_cjs.testIdOr(testIdPrefix, { testId: "facts-layout" }),
1186
- showLabels: !collapsed,
1187
- size: "sm"
1188
- }
1189
- );
1190
- }
1191
- var DEFAULT_FACTS_FIELDS_BUTTON_LABELS = {
1192
- fields: "Fields",
1193
- defaultView: "Default view",
1194
- columns: "Columns",
1195
- columnNames: { in_chat: "In chat" }
1196
- };
1197
- function FactsFieldsButton({
1198
- getGridApi,
1199
- labels,
1200
- testIds
1201
- }) {
1202
- const l = { ...DEFAULT_FACTS_FIELDS_BUTTON_LABELS, ...labels };
1203
- const [open, setOpen] = react.useState(false);
1204
- const [version, setVersion] = react.useState(0);
1205
- const columns = react.useMemo(() => {
1206
- if (!open) return [];
1207
- const api = getGridApi();
1208
- if (!api || api.isDestroyed()) return [];
1209
- const state = api.getColumnState();
1210
- return state.filter((c) => c.colId !== "ag-Grid-SelectionColumn").map((c) => {
1211
- const def = api.getColumnDef(c.colId);
1212
- const label = def?.headerName && def.headerName.trim() || l.columnNames[c.colId] || c.colId;
1213
- return { colId: c.colId, label, visible: !c.hide };
1214
- });
1215
- }, [open, version, getGridApi, l.columnNames]);
1216
- const visibleCount = columns.filter((c) => c.visible).length;
1217
- const toggle = (colId, visible) => {
1218
- const api = getGridApi();
1219
- if (!api || api.isDestroyed()) return;
1220
- if (visible && visibleCount <= 1) return;
1221
- api.setColumnsVisible([colId], !visible);
1222
- setVersion((v) => v + 1);
1223
- };
1224
- const resetToDefault = () => {
1225
- const api = getGridApi();
1226
- if (!api || api.isDestroyed()) return;
1227
- api.resetColumnState();
1228
- setVersion((v) => v + 1);
1229
- };
1230
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open, onOpenChange: setOpen, children: [
1231
- /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1232
- ui.Button,
1233
- {
1234
- variant: "ghost",
1235
- size: "sm",
1236
- className: "h-7 px-2 text-sm gap-1.5 text-muted-foreground hover:text-foreground font-light!",
1237
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.trigger, { testId: "facts-fields-trigger" }),
1238
- children: [
1239
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns3, { className: "size-3.5" }),
1240
- l.fields,
1241
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-3" })
1242
- ]
1243
- }
1244
- ) }),
1245
- /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { className: "w-[220px] p-0", align: "end", side: "bottom", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Command, { shouldFilter: false, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.CommandList, { className: "max-h-[60dvh]", children: [
1246
- /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1247
- ui.CommandItem,
1248
- {
1249
- onSelect: resetToDefault,
1250
- className: "cursor-pointer text-sm text-muted-foreground",
1251
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.defaultView, {
1252
- testId: "facts-fields-default-view"
1253
- }),
1254
- children: [
1255
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "mr-2 size-3.5" }),
1256
- l.defaultView
1257
- ]
1258
- }
1259
- ) }),
1260
- /* @__PURE__ */ jsxRuntime.jsx(ui.CommandSeparator, {}),
1261
- /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { heading: l.columns, children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(
1262
- ui.CommandItem,
1263
- {
1264
- onSelect: () => toggle(col.colId, col.visible),
1265
- className: "cursor-pointer text-sm",
1266
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.toggle?.(col.colId), {
1267
- testId: `facts-fields-toggle-${col.colId}`
1268
- }),
1269
- children: [
1270
- /* @__PURE__ */ jsxRuntime.jsx(
1271
- "div",
1272
- {
1273
- className: ui.cn(
1274
- "mr-2 flex size-3.5 items-center justify-center rounded-sm border border-primary",
1275
- col.visible ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
1276
- ),
1277
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3" })
1278
- }
1279
- ),
1280
- col.label
1281
- ]
1282
- },
1283
- col.colId
1284
- )) })
1285
- ] }) }) })
1286
- ] });
1287
- }
1288
- var DEFAULT_FACT_TIMELINE_LABELS = {
1289
- ganttEmpty: "Give a fact a date and it appears here."
1290
- };
1291
- function FactsCalendar({
1292
- facts,
1293
- onSelect,
1294
- selectedId,
1295
- navigatorContainer,
1296
- navigatorTotal,
1297
- testId
1298
- }) {
1299
- const calendarTestId = chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "facts-calendar" });
1300
- const items = react.useMemo(
1301
- () => facts.filter((f) => f.date_start).map((f) => ({
1302
- id: f.external_id,
1303
- label: f.text,
1304
- start: f.date_start,
1305
- end: f.date_end,
1306
- fact: f
1307
- })),
1308
- [facts]
1309
- );
1310
- const rootRef = react.useRef(null);
1311
- const entryId = chunkMHVNT4J3_cjs.testIdOr(testId && `${testId}-entry-${selectedId}`, {
1312
- testId: `facts-calendar-entry-${selectedId}`
1313
- });
1314
- react.useEffect(() => {
1315
- const root = rootRef.current;
1316
- if (!root) return;
1317
- root.querySelectorAll(".fact-cal-selected").forEach((el) => el.classList.remove("fact-cal-selected"));
1318
- if (!selectedId) return;
1319
- root.querySelectorAll(`[data-testid="${entryId}"]`).forEach((el) => el.classList.add("fact-cal-selected"));
1320
- }, [selectedId, items, entryId]);
1321
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: rootRef, className: "h-full border-t border-border", "data-slot": "facts-calendar", children: /* @__PURE__ */ jsxRuntime.jsx(
1322
- chunkVPPX5XUF_cjs.TimelineCalendar,
1323
- {
1324
- items,
1325
- testId: calendarTestId,
1326
- maxLanes: Infinity,
1327
- selectedIds: selectedId ? [selectedId] : [],
1328
- onSelect: (item) => onSelect?.(item.fact),
1329
- navigatorContainer,
1330
- navigatorTotal
1331
- }
1332
- ) });
1333
- }
1334
- function FactsGanttPane({
1335
- testId,
1336
- emptyMessage,
1337
- labels,
1338
- ...props
1339
- }) {
1340
- const l = { ...DEFAULT_FACT_TIMELINE_LABELS, ...labels };
1341
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "facts-gantt h-full border-t border-border", "data-slot": "facts-gantt", children: /* @__PURE__ */ jsxRuntime.jsx(
1342
- chunkVPPX5XUF_cjs.TimelineGantt,
1343
- {
1344
- testId: chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "gantt" }),
1345
- emptyMessage: emptyMessage ?? l.ganttEmpty,
1346
- ...props
1347
- }
1348
- ) });
1349
- }
1350
- var DEFAULT_FACTS_EMPTY_STATE_LABELS = {
1351
- title: "Everything this workspace knows",
1352
- intro: "Facts are durable knowledge \u2014 a deadline, a decision, a preference. Write them yourself, or let the assistant distill them from your documents and chats.",
1353
- tryAdding: "Try adding a fact",
1354
- kinds: [
1355
- {
1356
- label: "Deadlines & dates",
1357
- desc: "A due date or milestone \u2014 it lands on the calendar and timeline"
1358
- },
1359
- { label: "Decisions", desc: "What was agreed, and why \u2014 so it is not lost in a thread" },
1360
- { label: "Preferences", desc: "How this workspace likes things done" }
1361
- ],
1362
- examples: [
1363
- "The renewal deadline is March 31, 2026",
1364
- "Payment terms are net 30",
1365
- "The team prefers email over phone for updates",
1366
- "Board approved the Q3 budget on May 12"
1367
- ],
1368
- loading: "Loading facts\u2026",
1369
- loadError: "Could not load facts.",
1370
- retry: "Try again"
1371
- };
1372
- var KIND_ICONS = [lucideReact.CalendarClock, lucideReact.Scale, lucideReact.Lightbulb];
1373
- function FactsEmptyState({ onUseExample, labels, testIds }) {
1374
- const l = { ...DEFAULT_FACTS_EMPTY_STATE_LABELS, ...labels };
1375
- return /* @__PURE__ */ jsxRuntime.jsx(
1376
- "div",
1377
- {
1378
- className: "flex min-h-full items-center justify-center p-10",
1379
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.root, { testId: "facts-page-empty-state" }),
1380
- "data-slot": "facts-empty-state",
1381
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-xl text-center", children: [
1382
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto mb-4 flex size-12 items-center justify-center rounded-lg bg-accent text-accent-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Milestone, { className: "size-6" }) }),
1383
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "mt-2 text-xl font-semibold text-foreground", children: l.title }),
1384
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: l.intro }),
1385
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-7 grid gap-3 text-left @xl:grid-cols-3", children: l.kinds.map(({ label, desc }, i) => {
1386
- const KindIcon = KIND_ICONS[i % KIND_ICONS.length];
1387
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border bg-card p-3 shadow-xs", children: [
1388
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-sm font-medium text-foreground", children: [
1389
- /* @__PURE__ */ jsxRuntime.jsx(KindIcon, { className: "size-4 text-primary" }),
1390
- label
1391
- ] }),
1392
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs leading-snug text-muted-foreground", children: desc })
1393
- ] }, label);
1394
- }) }),
1395
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-10 text-sm font-medium text-muted-foreground", children: l.tryAdding }),
1396
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 flex flex-wrap justify-center gap-2.5", children: l.examples.map((fact) => /* @__PURE__ */ jsxRuntime.jsxs(
1397
- "button",
1398
- {
1399
- type: "button",
1400
- onClick: () => onUseExample(fact),
1401
- className: "group inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-3.5 py-2 text-sm text-foreground transition-colors hover:border-ring/50 hover:bg-accent/40 pointer-coarse:min-h-11",
1402
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.example, { testId: "facts-page-example" }),
1403
- children: [
1404
- fact,
1405
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "size-3.5 text-muted-foreground transition-colors group-hover:text-primary" })
1406
- ]
1407
- },
1408
- fact
1409
- )) })
1410
- ] })
1411
- }
1412
- );
1413
- }
1414
- function FactsLoading({
1415
- label = DEFAULT_FACTS_EMPTY_STATE_LABELS.loading
1416
- }) {
1417
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center py-10 text-muted-foreground", children: [
1418
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-2 size-4 animate-spin" }),
1419
- " ",
1420
- label
1421
- ] });
1422
- }
1423
- function FactsLoadError({
1424
- onRetry,
1425
- message = DEFAULT_FACTS_EMPTY_STATE_LABELS.loadError,
1426
- retryLabel = DEFAULT_FACTS_EMPTY_STATE_LABELS.retry
1427
- }) {
1428
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center gap-3 px-6 py-10 text-center", children: [
1429
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: message }),
1430
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", size: "sm", onClick: onRetry, children: retryLabel })
1431
- ] });
1432
- }
1433
- var DEFAULT_FACT_COMPOSER_LABELS = {
1434
- shared: "Shared",
1435
- verified: "Verified",
1436
- dates: "Dates",
1437
- deleteFact: "Delete fact",
1438
- cancel: "Cancel",
1439
- saveFact: "Save fact",
1440
- saving: "Saving\u2026",
1441
- addFact: "Add fact",
1442
- adding: "Adding\u2026"
1443
- };
1444
- var DEFAULT_FACT_SOURCES_ROW_LABELS = {
1445
- sources: "Sources",
1446
- hintButton: "How to add sources",
1447
- hint: "In the picker, tick a document's checkbox to add it as a source, or click its name to just open it. Inside a document, click a passage to add it \u2014 shift-click to take a whole range. Add as many as you like, from as many documents as you like."
1448
- };
1449
- function FactFieldRow({
1450
- label,
1451
- children,
1452
- className
1453
- }) {
1454
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-col gap-1.5", className), "data-slot": "fact-field-row", children: [
1455
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: label }),
1456
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children })
1457
- ] });
1458
- }
1459
- function FactSourcesRow({ toggle, picker, labels, hintTestId }) {
1460
- const l = { ...DEFAULT_FACT_SOURCES_ROW_LABELS, ...labels };
1461
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", "data-slot": "fact-sources-row", children: [
1462
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 text-sm font-medium text-foreground", children: [
1463
- l.sources,
1464
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
1465
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1466
- "button",
1467
- {
1468
- type: "button",
1469
- "aria-label": l.hintButton,
1470
- className: "text-muted-foreground hover:text-foreground",
1471
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(hintTestId, { testId: "facts-source-hint" }),
1472
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { className: "size-3.5" })
1473
- }
1474
- ) }),
1475
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { className: "max-w-xs", children: l.hint })
1476
- ] })
1477
- ] }),
1478
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
1479
- toggle,
1480
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: picker })
1481
- ] })
1482
- ] });
1483
- }
1484
- function FactComposer({
1485
- isOpen,
1486
- panelRef,
1487
- editor,
1488
- labels,
1489
- sharedToggle,
1490
- verifiedToggle,
1491
- dateInput,
1492
- isEditing,
1493
- canSave,
1494
- isSaving,
1495
- isDeleting,
1496
- onSave,
1497
- onCancel,
1498
- onDelete,
1499
- error,
1500
- uiLabels: labelOverrides,
1501
- testIds
1502
- }) {
1503
- const l = { ...DEFAULT_FACT_COMPOSER_LABELS, ...labelOverrides };
1504
- return /* @__PURE__ */ jsxRuntime.jsx(
1505
- "div",
1506
- {
1507
- className: ui.cn(
1508
- "grid shrink-0 transition-[grid-template-rows,opacity] duration-500 ease-in-out",
1509
- isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
1510
- ),
1511
- "data-slot": "fact-composer",
1512
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(
1513
- "div",
1514
- {
1515
- ref: panelRef,
1516
- className: "facts-composer flex flex-col gap-4 border-b border-border bg-muted px-4 py-4",
1517
- children: [
1518
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
1519
- editor,
1520
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
1521
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [
1522
- /* @__PURE__ */ jsxRuntime.jsx(
1523
- "div",
1524
- {
1525
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.tags, { testId: "facts-page-composer-tags" }),
1526
- className: "min-w-[14rem] flex-1",
1527
- children: labels
1528
- }
1529
- ),
1530
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-6", children: [
1531
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
1532
- sharedToggle,
1533
- l.shared
1534
- ] }),
1535
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
1536
- verifiedToggle,
1537
- l.verified
1538
- ] })
1539
- ] })
1540
- ] }),
1541
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: [
1542
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-[10rem] flex-1 flex-col gap-1.5", children: [
1543
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: l.dates }),
1544
- dateInput
1545
- ] }),
1546
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 self-end max-sm:w-full max-sm:justify-end", children: [
1547
- isEditing && /* @__PURE__ */ jsxRuntime.jsx(
1548
- ui.Button,
1549
- {
1550
- variant: "ghost",
1551
- size: "sm",
1552
- className: "size-7 p-0 text-destructive hover:bg-destructive/10 hover:text-destructive pointer-coarse:size-11",
1553
- onClick: onDelete,
1554
- disabled: isDeleting,
1555
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.delete, {
1556
- testId: "facts-page-composer-delete"
1557
- }),
1558
- "aria-label": l.deleteFact,
1559
- title: l.deleteFact,
1560
- children: isDeleting ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-3.5" })
1561
- }
1562
- ),
1563
- /* @__PURE__ */ jsxRuntime.jsx(
1564
- ui.Button,
1565
- {
1566
- variant: "ghost",
1567
- size: "sm",
1568
- className: "h-7 pointer-coarse:h-11",
1569
- onClick: onCancel,
1570
- children: l.cancel
1571
- }
1572
- ),
1573
- /* @__PURE__ */ jsxRuntime.jsx(
1574
- ui.Button,
1575
- {
1576
- size: "sm",
1577
- className: "h-7 pointer-coarse:h-11",
1578
- disabled: !canSave,
1579
- onClick: onSave,
1580
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.save, { testId: "facts-page-composer-save" }),
1581
- children: isEditing ? isSaving ? l.saving : l.saveFact : isSaving ? l.adding : l.addFact
1582
- }
1583
- )
1584
- ] })
1585
- ] })
1586
- ] })
1587
- ] }),
1588
- error && /* @__PURE__ */ jsxRuntime.jsx(
1589
- "p",
1590
- {
1591
- className: "text-xs text-destructive",
1592
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.error, { testId: "facts-page-composer-error" }),
1593
- children: error
1594
- }
1595
- )
1596
- ]
1597
- }
1598
- ) })
1599
- }
1600
- );
1601
- }
1602
- var DEFAULT_FACTS_BULK_BAR_LABELS = {
1603
- removeFromChat: "Remove from Chat",
1604
- addToChat: "Add to Chat",
1605
- label: "Label",
1606
- shared: "Shared",
1607
- more: "More",
1608
- export: "Export",
1609
- delete: "Delete",
1610
- budgetHint: "Facts added to this chat are always in ARBI's context for this chat, so they share one budget. This estimates the tokens they add (\u22484 characters per token), capped at ~2,000.",
1611
- budget: (tokens, cap) => `~${tokens}/${cap} tokens`,
1612
- removeFromChatTooltip: (n) => `Remove the selected ${n} from this chat`,
1613
- addToChatTooltip: (n) => `Add the selected ${n} to this chat, so they are always in its context`,
1614
- labelTooltip: (n) => `Add or remove labels from selected ${n}`
1615
- };
1616
- function FactsBulkBar({
1617
- count,
1618
- onClear,
1619
- allSelectedInChat,
1620
- onToggleInChat,
1621
- onLabel,
1622
- sharedToggle,
1623
- onExport,
1624
- onDelete,
1625
- budget,
1626
- pluralNoun = "facts",
1627
- labels,
1628
- testIds
1629
- }) {
1630
- const l = { ...DEFAULT_FACTS_BULK_BAR_LABELS, ...labels };
1631
- const none = count === 0;
1632
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-3", "data-slot": "facts-bulk-bar", children: /* @__PURE__ */ jsxRuntime.jsx(
1633
- chunkV4ISCZJ7_cjs.SelectionBar,
1634
- {
1635
- count,
1636
- onClear,
1637
- status: budget ? /* @__PURE__ */ jsxRuntime.jsx(
1638
- "span",
1639
- {
1640
- className: ui.cn(
1641
- "shrink-0 text-xs tabular-nums",
1642
- budget.isOver ? "text-destructive" : "text-muted-foreground"
1643
- ),
1644
- title: l.budgetHint,
1645
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.budget, { testId: "facts-page-chat-budget" }),
1646
- children: l.budget(budget.tokens.toLocaleString(), budget.cap.toLocaleString())
1647
- }
1648
- ) : null,
1649
- children: (isCompact) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1650
- /* @__PURE__ */ jsxRuntime.jsx(
1651
- chunkV4ISCZJ7_cjs.SelectionBarAction,
1652
- {
1653
- icon: lucideReact.Paperclip,
1654
- label: allSelectedInChat ? l.removeFromChat : l.addToChat,
1655
- onClick: onToggleInChat,
1656
- disabled: none,
1657
- isCompact,
1658
- className: "border-blue-border text-blue-text hover:bg-blue-bg hover:text-blue-text",
1659
- tooltip: allSelectedInChat ? l.removeFromChatTooltip(pluralNoun) : l.addToChatTooltip(pluralNoun),
1660
- testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.inChat, { testId: "bulk-in-chat-facts-button" })
1661
- }
1662
- ),
1663
- /* @__PURE__ */ jsxRuntime.jsx(
1664
- chunkV4ISCZJ7_cjs.SelectionBarAction,
1665
- {
1666
- icon: lucideReact.Tags,
1667
- label: l.label,
1668
- onClick: onLabel,
1669
- disabled: none,
1670
- isCompact,
1671
- className: "border-green-border text-green-text hover:bg-green-bg hover:text-green-text",
1672
- tooltip: l.labelTooltip(pluralNoun),
1673
- testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.label, { testId: "bulk-label-facts-button" })
1674
- }
1675
- ),
1676
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1", children: [
1677
- sharedToggle,
1678
- !isCompact && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: l.shared })
1679
- ] }),
1680
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
1681
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1682
- ui.Button,
1683
- {
1684
- variant: "outline",
1685
- size: "sm",
1686
- className: "h-7 gap-1.5 px-2 pointer-coarse:h-11",
1687
- disabled: none,
1688
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.more, { testId: "facts-bulk-more-button" }),
1689
- children: [
1690
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "size-4" }),
1691
- !isCompact && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: l.more })
1692
- ]
1693
- }
1694
- ) }),
1695
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
1696
- /* @__PURE__ */ jsxRuntime.jsxs(
1697
- ui.DropdownMenuItem,
1698
- {
1699
- onClick: onExport,
1700
- disabled: none,
1701
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.export, { testId: "export-facts-button" }),
1702
- children: [
1703
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderUp, { className: "mr-2 size-4" }),
1704
- l.export
1705
- ]
1706
- }
1707
- ),
1708
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSeparator, {}),
1709
- /* @__PURE__ */ jsxRuntime.jsxs(
1710
- ui.DropdownMenuItem,
1711
- {
1712
- onClick: onDelete,
1713
- disabled: none,
1714
- className: "text-red-text focus:text-red-text",
1715
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.delete, { testId: "bulk-delete-facts-button" }),
1716
- children: [
1717
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "mr-2 size-4" }),
1718
- l.delete
1719
- ]
1720
- }
1721
- )
1722
- ] })
1723
- ] })
1724
- ] })
1725
- }
1726
- ) });
1727
- }
1728
- var DEFAULT_FACTS_TOOLBAR_LABELS = {
1729
- tags: "Tags",
1730
- newFact: "New fact"
1731
- };
1732
- function FactsToolbar({
1733
- count,
1734
- hasActiveFilters,
1735
- filterText,
1736
- onFilterTextChange,
1737
- searchFields,
1738
- onSearchFieldsChange,
1739
- quickFilter,
1740
- onOpenTags,
1741
- viewMode,
1742
- onViewModeChange,
1743
- onNewFact,
1744
- navSlotRef,
1745
- navigator,
1746
- tools,
1747
- showToolbarRow = true,
1748
- labels,
1749
- testIds,
1750
- filterLabels,
1751
- filterTestIds,
1752
- viewToggleLabels,
1753
- viewToggleTestIdPrefix
1754
- }) {
1755
- const l = { ...DEFAULT_FACTS_TOOLBAR_LABELS, ...labels };
1756
- const headerRef = react.useRef(null);
1757
- const [viewsCollapsed, setViewsCollapsed] = react.useState(false);
1758
- const [isNarrow, setIsNarrow] = react.useState(false);
1759
- react.useEffect(() => {
1760
- const el = headerRef.current;
1761
- if (!el) return;
1762
- const measure = () => {
1763
- const w = el.clientWidth;
1764
- setViewsCollapsed((prev) => prev ? w < 990 : w < 950);
1765
- const narrowAt = window.matchMedia?.("(pointer: coarse)")?.matches ? 820 : 640;
1766
- setIsNarrow((prev) => prev ? w < narrowAt + 20 : w < narrowAt);
1767
- };
1768
- measure();
1769
- return chunkPPCATBOY_cjs.observeResize(el, measure);
1770
- }, []);
1771
- const tabs = [
1772
- {
1773
- id: "facts",
1774
- // No name: the page needs no self-label, but the fact glyph stays in front of the count.
1775
- countIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Milestone, { className: "size-3.5" }),
1776
- label: "",
1777
- count,
1778
- countPlacement: "leading",
1779
- hasActiveFilters,
1780
- testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.tab, { testId: "facts-tab" }),
1781
- presentation: "count"
1782
- }
1783
- ];
1784
- const filterControls = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: isNarrow ? "flex w-full items-center gap-1.5" : "flex items-center gap-1.5", children: [
1785
- /* @__PURE__ */ jsxRuntime.jsx(
1786
- chunk2EI7NCUA_cjs.FilterInput,
1787
- {
1788
- value: filterText,
1789
- onChange: onFilterTextChange,
1790
- fields: searchFields,
1791
- onFieldsChange: onSearchFieldsChange,
1792
- filter: quickFilter,
1793
- className: isNarrow ? "min-w-0 flex-1" : void 0,
1794
- labels: filterLabels,
1795
- testIds: filterTestIds
1796
- }
1797
- ),
1798
- onOpenTags && /* @__PURE__ */ jsxRuntime.jsxs(
1799
- ui.Button,
1800
- {
1801
- variant: "outline",
1802
- size: "sm",
1803
- className: "h-6 shrink-0 gap-1.5 px-2 pointer-coarse:h-11",
1804
- onClick: onOpenTags,
1805
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.tagsButton, { testId: "facts-tags-button" }),
1806
- children: [
1807
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BookMarked, { className: "size-3.5" }),
1808
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: l.tags })
1809
- ]
1810
- }
1811
- )
1812
- ] });
1813
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: headerRef, className: "sticky top-0 z-10 bg-background", "data-slot": "facts-toolbar", children: [
1814
- /* @__PURE__ */ jsxRuntime.jsx(
1815
- chunk7RGLTF76_cjs.TabHeader,
1816
- {
1817
- tabs,
1818
- activeTabId: "notes",
1819
- onTabChange: () => {
1820
- },
1821
- firstTabContent: isNarrow ? null : filterControls,
1822
- centerContent: isNarrow ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
1823
- FactsViewToggle,
1824
- {
1825
- viewMode,
1826
- onChange: onViewModeChange,
1827
- collapsed: viewsCollapsed,
1828
- labels: viewToggleLabels,
1829
- testIdPrefix: viewToggleTestIdPrefix
1830
- }
1831
- ) }),
1832
- rightContent: /* @__PURE__ */ jsxRuntime.jsxs(
1833
- ui.Button,
1834
- {
1835
- onClick: onNewFact,
1836
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.newFact, { testId: "facts-page-new" }),
1837
- children: [
1838
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "mr-0.5 size-4" }),
1839
- l.newFact
1840
- ]
1841
- }
1842
- )
1843
- }
1844
- ),
1845
- isNarrow && /* @__PURE__ */ jsxRuntime.jsxs(
1846
- "div",
1847
- {
1848
- className: "flex flex-col gap-1.5 border-b border-border px-3 py-1.5",
1849
- "data-slot": "facts-toolbar-stack",
1850
- children: [
1851
- filterControls,
1852
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
1853
- FactsViewToggle,
1854
- {
1855
- viewMode,
1856
- onChange: onViewModeChange,
1857
- collapsed: true,
1858
- labels: viewToggleLabels,
1859
- testIdPrefix: viewToggleTestIdPrefix
1860
- }
1861
- ) })
1862
- ]
1863
- }
1864
- ),
1865
- showToolbarRow && /* @__PURE__ */ jsxRuntime.jsxs(
1866
- "div",
1867
- {
1868
- className: "flex min-h-8 flex-wrap items-center gap-x-1.5 border-b border-border bg-background px-3 py-0.5",
1869
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.filterBar, { testId: "facts-filter-bar" }),
1870
- children: [
1871
- /* @__PURE__ */ jsxRuntime.jsx(
1872
- "div",
1873
- {
1874
- ref: navSlotRef,
1875
- className: "flex shrink-0 items-center empty:hidden",
1876
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.filterBarNav, { testId: "facts-filter-bar-nav" }),
1877
- children: navigator
1878
- }
1879
- ),
1880
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
1881
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center", children: tools })
1882
- ]
1883
- }
1884
- )
1885
- ] });
1886
- }
1887
180
  var DEFAULT_FACT_SEARCH_BAR_LABELS = {
1888
181
  search: "Search:",
1889
182
  // An example query rather than an instruction: shows the quoted-phrase syntax.
@@ -2115,181 +408,199 @@ function FactSearchResult({
2115
408
  )
2116
409
  ] });
2117
410
  }
2118
- function toFactCitations(citations) {
2119
- if (!citations) return null;
2120
- return citations.map((d) => ({
2121
- doc_ext_id: d.doc_ext_id,
2122
- ...d.version ? { version: d.version } : {},
2123
- chunks: d.chunks ?? []
2124
- }));
2125
- }
2126
- function isWholeDoc(doc) {
2127
- return doc.chunks.length === 0;
2128
- }
2129
- function docIdsOf(citations) {
2130
- return (citations ?? []).map((d) => d.doc_ext_id);
2131
- }
2132
- function chunkIdsOf(citations) {
2133
- return (citations ?? []).flatMap((d) => d.chunks.map((c) => c.chunk_id));
2134
- }
2135
- function hasChunk(citations, chunkId) {
2136
- return (citations ?? []).some((d) => d.chunks.some((c) => c.chunk_id === chunkId));
2137
- }
2138
- function withDoc(citations, docExtId) {
2139
- const list = citations ?? [];
2140
- if (list.some((d) => d.doc_ext_id === docExtId)) return list;
2141
- return [...list, { doc_ext_id: docExtId, chunks: [] }];
2142
- }
2143
- function withoutDoc(citations, docExtId) {
2144
- const remaining = (citations ?? []).filter((d) => d.doc_ext_id !== docExtId);
2145
- return remaining.length ? remaining : null;
2146
- }
2147
- function withChunk(citations, docExtId, chunk) {
2148
- const list = citations ?? [];
2149
- const idx = list.findIndex((d) => d.doc_ext_id === docExtId);
2150
- if (idx === -1) return [...list, { doc_ext_id: docExtId, chunks: [chunk] }];
2151
- const doc = list[idx];
2152
- if (doc.chunks.some((c) => c.chunk_id === chunk.chunk_id)) return list;
2153
- const next = [...list];
2154
- next[idx] = { ...doc, chunks: [...doc.chunks, chunk] };
2155
- return next;
2156
- }
2157
- function withoutChunk(citations, chunkId, opts = {}) {
2158
- const keepDoc = opts.keepDoc ?? true;
2159
- const list = citations ?? [];
2160
- if (!hasChunk(list, chunkId)) return citations ?? null;
2161
- const next = [];
2162
- for (const doc of list) {
2163
- if (!doc.chunks.some((c) => c.chunk_id === chunkId)) {
2164
- next.push(doc);
2165
- continue;
2166
- }
2167
- const chunks = doc.chunks.filter((c) => c.chunk_id !== chunkId);
2168
- if (chunks.length || keepDoc) next.push({ ...doc, chunks });
2169
- }
2170
- return next.length ? next : null;
2171
- }
2172
- function repairBoldFlanking(md) {
2173
- return md.replace(/([.,;:!?"'’”)\]])(\*\*|__)(?=[A-Za-z0-9])/g, "$1$2 ");
2174
- }
2175
- var CHAT_LEAD_IN = /^(?:here(?:'s| is| are)|below (?:is|are)|sure|certainly)\b[^\n]*:[ \t]*(?:\n+|$)/i;
2176
- function dropChatLeadIn(md) {
2177
- const body = md.replace(CHAT_LEAD_IN, "");
2178
- return body.trim() ? body : md;
2179
- }
2180
- function buildFactCitations(content, activeCitations, citationData) {
2181
- const text = dropChatLeadIn(repairBoldFlanking(artifacts.unwrapCitationLinks(content)).trim()).trim();
2182
- if (!activeCitations) return { text, citations: null };
2183
- const chunkMeta = /* @__PURE__ */ new Map();
2184
- for (const chunks of Object.values(citationData)) {
2185
- if (!Array.isArray(chunks)) continue;
2186
- for (const chunk of chunks) {
2187
- const meta = {
2188
- doc_ext_id: chunk.metadata?.doc_ext_id ?? null,
2189
- page: chunk.metadata?.page_number ?? null
2190
- };
2191
- for (const key of [chunk.metadata?.chunk_ext_id, chunk.chunk_id]) {
2192
- if (key && !chunkMeta.has(key)) chunkMeta.set(key, meta);
2193
- }
2194
- }
2195
- }
2196
- let citations = null;
2197
- for (const chunkIds of Object.values(activeCitations)) {
2198
- for (const chunkId of chunkIds) {
2199
- const meta = chunkMeta.get(chunkId);
2200
- if (!meta?.doc_ext_id) continue;
2201
- citations = withChunk(citations, meta.doc_ext_id, { chunk_id: chunkId, page: meta.page });
2202
- }
2203
- }
2204
- return { text, citations };
2205
- }
2206
-
2207
- // src/facts/fact-table-column-resize.ts
2208
- var EDGE = 6;
2209
- var MIN_WIDTH = 48;
2210
- function enableFactTableColumnResize(container) {
2211
- let drag = null;
2212
- const cellFromEvent = (e) => {
2213
- const el = e.target;
2214
- const cell = el?.closest?.("td, th");
2215
- if (!cell || cell.hasAttribute("data-tool-cell")) return null;
2216
- if (!container.contains(cell)) return null;
2217
- return cell;
2218
- };
2219
- const nearRightEdge = (cell, clientX) => {
2220
- const rect = cell.getBoundingClientRect();
2221
- return clientX >= rect.right - EDGE && clientX <= rect.right + 2;
2222
- };
2223
- const colForCell = (cell) => {
2224
- const row = cell.parentElement;
2225
- const table = cell.closest("table");
2226
- const colgroup = table?.querySelector("colgroup");
2227
- if (!row || !table || !colgroup) return null;
2228
- const index = Array.prototype.indexOf.call(row.children, cell);
2229
- return colgroup.children[index] ?? null;
2230
- };
2231
- const freezeWidths = (table) => {
2232
- const colgroup = table.querySelector("colgroup");
2233
- if (!colgroup) return;
2234
- const ruler = table.querySelector("thead tr") ?? table.querySelector("tbody tr");
2235
- const cells = ruler ? Array.from(ruler.children) : [];
2236
- Array.from(colgroup.children).forEach((node, i) => {
2237
- const col = node;
2238
- const cell = cells[i];
2239
- if (!col.style.width && cell) col.style.width = `${cell.getBoundingClientRect().width}px`;
2240
- });
2241
- table.style.tableLayout = "fixed";
2242
- };
2243
- const onPointerMove = (e) => {
2244
- if (drag) {
2245
- const next = Math.max(MIN_WIDTH, drag.startWidth + (e.clientX - drag.startX));
2246
- drag.col.style.width = `${next}px`;
2247
- e.preventDefault();
2248
- return;
2249
- }
2250
- const cell = cellFromEvent(e);
2251
- if (cell && nearRightEdge(cell, e.clientX)) {
2252
- cell.style.cursor = "col-resize";
2253
- } else if (cell) {
2254
- cell.style.cursor = "";
2255
- }
2256
- };
2257
- const endDrag = () => {
2258
- if (!drag) return;
2259
- drag = null;
2260
- document.documentElement.classList.remove("fact-col-resizing");
2261
- document.removeEventListener("pointermove", onPointerMove, true);
2262
- document.removeEventListener("pointerup", endDrag, true);
2263
- };
2264
- const onPointerDown = (e) => {
2265
- if (e.button !== 0) return;
2266
- const cell = cellFromEvent(e);
2267
- if (!cell || !nearRightEdge(cell, e.clientX)) return;
2268
- const table = cell.closest("table");
2269
- if (!table) return;
2270
- freezeWidths(table);
2271
- const col = colForCell(cell);
2272
- if (!col) return;
2273
- drag = {
2274
- col,
2275
- table,
2276
- startX: e.clientX,
2277
- startWidth: parseFloat(col.style.width) || cell.getBoundingClientRect().width
2278
- };
2279
- e.preventDefault();
2280
- document.documentElement.classList.add("fact-col-resizing");
2281
- document.addEventListener("pointermove", onPointerMove, true);
2282
- document.addEventListener("pointerup", endDrag, true);
2283
- };
2284
- container.addEventListener("pointerdown", onPointerDown);
2285
- container.addEventListener("pointermove", onPointerMove);
2286
- return () => {
2287
- endDrag();
2288
- container.removeEventListener("pointerdown", onPointerDown);
2289
- container.removeEventListener("pointermove", onPointerMove);
2290
- };
2291
- }
2292
411
 
412
+ Object.defineProperty(exports, "DEFAULT_FACTS_BULK_BAR_LABELS", {
413
+ enumerable: true,
414
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_BULK_BAR_LABELS; }
415
+ });
416
+ Object.defineProperty(exports, "DEFAULT_FACTS_EMPTY_STATE_LABELS", {
417
+ enumerable: true,
418
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_EMPTY_STATE_LABELS; }
419
+ });
420
+ Object.defineProperty(exports, "DEFAULT_FACTS_FIELDS_BUTTON_LABELS", {
421
+ enumerable: true,
422
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_FIELDS_BUTTON_LABELS; }
423
+ });
424
+ Object.defineProperty(exports, "DEFAULT_FACTS_TOOLBAR_LABELS", {
425
+ enumerable: true,
426
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_TOOLBAR_LABELS; }
427
+ });
428
+ Object.defineProperty(exports, "DEFAULT_FACTS_VIEW_TOGGLE_LABELS", {
429
+ enumerable: true,
430
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_VIEW_TOGGLE_LABELS; }
431
+ });
432
+ Object.defineProperty(exports, "DEFAULT_FACT_COLUMN_LABELS", {
433
+ enumerable: true,
434
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_COLUMN_LABELS; }
435
+ });
436
+ Object.defineProperty(exports, "DEFAULT_FACT_COLUMN_ORDER", {
437
+ enumerable: true,
438
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_COLUMN_ORDER; }
439
+ });
440
+ Object.defineProperty(exports, "DEFAULT_FACT_COMPOSER_LABELS", {
441
+ enumerable: true,
442
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_COMPOSER_LABELS; }
443
+ });
444
+ Object.defineProperty(exports, "DEFAULT_FACT_DATE_INPUT_LABELS", {
445
+ enumerable: true,
446
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_DATE_INPUT_LABELS; }
447
+ });
448
+ Object.defineProperty(exports, "DEFAULT_FACT_LABELS_CELL_LABELS", {
449
+ enumerable: true,
450
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_LABELS_CELL_LABELS; }
451
+ });
452
+ Object.defineProperty(exports, "DEFAULT_FACT_ROW_ACTIONS_LABELS", {
453
+ enumerable: true,
454
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_ROW_ACTIONS_LABELS; }
455
+ });
456
+ Object.defineProperty(exports, "DEFAULT_FACT_SOURCES_ROW_LABELS", {
457
+ enumerable: true,
458
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_SOURCES_ROW_LABELS; }
459
+ });
460
+ Object.defineProperty(exports, "DEFAULT_FACT_SOURCE_GROUP_LABELS", {
461
+ enumerable: true,
462
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_SOURCE_GROUP_LABELS; }
463
+ });
464
+ Object.defineProperty(exports, "DEFAULT_FACT_TIMELINE_LABELS", {
465
+ enumerable: true,
466
+ get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_TIMELINE_LABELS; }
467
+ });
468
+ Object.defineProperty(exports, "EMPTY_FACT_DATE_FIELDS", {
469
+ enumerable: true,
470
+ get: function () { return chunkTAWPVD6C_cjs.EMPTY_FACT_DATE_FIELDS; }
471
+ });
472
+ Object.defineProperty(exports, "FactComposer", {
473
+ enumerable: true,
474
+ get: function () { return chunkTAWPVD6C_cjs.FactComposer; }
475
+ });
476
+ Object.defineProperty(exports, "FactDateInput", {
477
+ enumerable: true,
478
+ get: function () { return chunkTAWPVD6C_cjs.FactDateInput; }
479
+ });
480
+ Object.defineProperty(exports, "FactFieldRow", {
481
+ enumerable: true,
482
+ get: function () { return chunkTAWPVD6C_cjs.FactFieldRow; }
483
+ });
484
+ Object.defineProperty(exports, "FactLabelsCell", {
485
+ enumerable: true,
486
+ get: function () { return chunkTAWPVD6C_cjs.FactLabelsCell; }
487
+ });
488
+ Object.defineProperty(exports, "FactRowActions", {
489
+ enumerable: true,
490
+ get: function () { return chunkTAWPVD6C_cjs.FactRowActions; }
491
+ });
492
+ Object.defineProperty(exports, "FactSourceGroup", {
493
+ enumerable: true,
494
+ get: function () { return chunkTAWPVD6C_cjs.FactSourceGroup; }
495
+ });
496
+ Object.defineProperty(exports, "FactSourcesRow", {
497
+ enumerable: true,
498
+ get: function () { return chunkTAWPVD6C_cjs.FactSourcesRow; }
499
+ });
500
+ Object.defineProperty(exports, "FactsBulkBar", {
501
+ enumerable: true,
502
+ get: function () { return chunkTAWPVD6C_cjs.FactsBulkBar; }
503
+ });
504
+ Object.defineProperty(exports, "FactsCalendar", {
505
+ enumerable: true,
506
+ get: function () { return chunkTAWPVD6C_cjs.FactsCalendar; }
507
+ });
508
+ Object.defineProperty(exports, "FactsEmptyState", {
509
+ enumerable: true,
510
+ get: function () { return chunkTAWPVD6C_cjs.FactsEmptyState; }
511
+ });
512
+ Object.defineProperty(exports, "FactsFieldsButton", {
513
+ enumerable: true,
514
+ get: function () { return chunkTAWPVD6C_cjs.FactsFieldsButton; }
515
+ });
516
+ Object.defineProperty(exports, "FactsGanttPane", {
517
+ enumerable: true,
518
+ get: function () { return chunkTAWPVD6C_cjs.FactsGanttPane; }
519
+ });
520
+ Object.defineProperty(exports, "FactsLoadError", {
521
+ enumerable: true,
522
+ get: function () { return chunkTAWPVD6C_cjs.FactsLoadError; }
523
+ });
524
+ Object.defineProperty(exports, "FactsLoading", {
525
+ enumerable: true,
526
+ get: function () { return chunkTAWPVD6C_cjs.FactsLoading; }
527
+ });
528
+ Object.defineProperty(exports, "FactsToolbar", {
529
+ enumerable: true,
530
+ get: function () { return chunkTAWPVD6C_cjs.FactsToolbar; }
531
+ });
532
+ Object.defineProperty(exports, "FactsViewToggle", {
533
+ enumerable: true,
534
+ get: function () { return chunkTAWPVD6C_cjs.FactsViewToggle; }
535
+ });
536
+ Object.defineProperty(exports, "ISO_DATE_FILTER_PARAMS", {
537
+ enumerable: true,
538
+ get: function () { return chunkTAWPVD6C_cjs.ISO_DATE_FILTER_PARAMS; }
539
+ });
540
+ Object.defineProperty(exports, "buildFactCitations", {
541
+ enumerable: true,
542
+ get: function () { return chunkTAWPVD6C_cjs.buildFactCitations; }
543
+ });
544
+ Object.defineProperty(exports, "chunkIdsOf", {
545
+ enumerable: true,
546
+ get: function () { return chunkTAWPVD6C_cjs.chunkIdsOf; }
547
+ });
548
+ Object.defineProperty(exports, "citedVersionRef", {
549
+ enumerable: true,
550
+ get: function () { return chunkTAWPVD6C_cjs.citedVersionRef; }
551
+ });
552
+ Object.defineProperty(exports, "createFactColumns", {
553
+ enumerable: true,
554
+ get: function () { return chunkTAWPVD6C_cjs.createFactColumns; }
555
+ });
556
+ Object.defineProperty(exports, "docIdsOf", {
557
+ enumerable: true,
558
+ get: function () { return chunkTAWPVD6C_cjs.docIdsOf; }
559
+ });
560
+ Object.defineProperty(exports, "enableFactTableColumnResize", {
561
+ enumerable: true,
562
+ get: function () { return chunkTAWPVD6C_cjs.enableFactTableColumnResize; }
563
+ });
564
+ Object.defineProperty(exports, "factDateFieldsToSpan", {
565
+ enumerable: true,
566
+ get: function () { return chunkTAWPVD6C_cjs.factDateFieldsToSpan; }
567
+ });
568
+ Object.defineProperty(exports, "factDateSpanToFields", {
569
+ enumerable: true,
570
+ get: function () { return chunkTAWPVD6C_cjs.factDateSpanToFields; }
571
+ });
572
+ Object.defineProperty(exports, "hasChunk", {
573
+ enumerable: true,
574
+ get: function () { return chunkTAWPVD6C_cjs.hasChunk; }
575
+ });
576
+ Object.defineProperty(exports, "isWholeDoc", {
577
+ enumerable: true,
578
+ get: function () { return chunkTAWPVD6C_cjs.isWholeDoc; }
579
+ });
580
+ Object.defineProperty(exports, "sourceDocCount", {
581
+ enumerable: true,
582
+ get: function () { return chunkTAWPVD6C_cjs.sourceDocCount; }
583
+ });
584
+ Object.defineProperty(exports, "toFactCitations", {
585
+ enumerable: true,
586
+ get: function () { return chunkTAWPVD6C_cjs.toFactCitations; }
587
+ });
588
+ Object.defineProperty(exports, "withChunk", {
589
+ enumerable: true,
590
+ get: function () { return chunkTAWPVD6C_cjs.withChunk; }
591
+ });
592
+ Object.defineProperty(exports, "withDoc", {
593
+ enumerable: true,
594
+ get: function () { return chunkTAWPVD6C_cjs.withDoc; }
595
+ });
596
+ Object.defineProperty(exports, "withoutChunk", {
597
+ enumerable: true,
598
+ get: function () { return chunkTAWPVD6C_cjs.withoutChunk; }
599
+ });
600
+ Object.defineProperty(exports, "withoutDoc", {
601
+ enumerable: true,
602
+ get: function () { return chunkTAWPVD6C_cjs.withoutDoc; }
603
+ });
2293
604
  Object.defineProperty(exports, "DEFAULT_FACT_PASSAGES_LABELS", {
2294
605
  enumerable: true,
2295
606
  get: function () { return chunk5FYU7ZIU_cjs.DEFAULT_FACT_PASSAGES_LABELS; }
@@ -2326,62 +637,15 @@ Object.defineProperty(exports, "FactsFilterInput", {
2326
637
  enumerable: true,
2327
638
  get: function () { return chunk2EI7NCUA_cjs.FilterInput; }
2328
639
  });
2329
- exports.DEFAULT_FACTS_BULK_BAR_LABELS = DEFAULT_FACTS_BULK_BAR_LABELS;
2330
- exports.DEFAULT_FACTS_EMPTY_STATE_LABELS = DEFAULT_FACTS_EMPTY_STATE_LABELS;
2331
- exports.DEFAULT_FACTS_FIELDS_BUTTON_LABELS = DEFAULT_FACTS_FIELDS_BUTTON_LABELS;
2332
- exports.DEFAULT_FACTS_TOOLBAR_LABELS = DEFAULT_FACTS_TOOLBAR_LABELS;
2333
- exports.DEFAULT_FACTS_VIEW_TOGGLE_LABELS = DEFAULT_FACTS_VIEW_TOGGLE_LABELS;
2334
- exports.DEFAULT_FACT_COLUMN_LABELS = DEFAULT_FACT_COLUMN_LABELS;
2335
- exports.DEFAULT_FACT_COLUMN_ORDER = DEFAULT_FACT_COLUMN_ORDER;
2336
- exports.DEFAULT_FACT_COMPOSER_LABELS = DEFAULT_FACT_COMPOSER_LABELS;
2337
- exports.DEFAULT_FACT_DATE_INPUT_LABELS = DEFAULT_FACT_DATE_INPUT_LABELS;
2338
- exports.DEFAULT_FACT_LABELS_CELL_LABELS = DEFAULT_FACT_LABELS_CELL_LABELS;
2339
- exports.DEFAULT_FACT_ROW_ACTIONS_LABELS = DEFAULT_FACT_ROW_ACTIONS_LABELS;
2340
640
  exports.DEFAULT_FACT_SEARCH_BAR_LABELS = DEFAULT_FACT_SEARCH_BAR_LABELS;
2341
641
  exports.DEFAULT_FACT_SEARCH_RESULT_LABELS = DEFAULT_FACT_SEARCH_RESULT_LABELS;
2342
- exports.DEFAULT_FACT_SOURCES_ROW_LABELS = DEFAULT_FACT_SOURCES_ROW_LABELS;
2343
- exports.DEFAULT_FACT_SOURCE_GROUP_LABELS = DEFAULT_FACT_SOURCE_GROUP_LABELS;
2344
- exports.DEFAULT_FACT_TIMELINE_LABELS = DEFAULT_FACT_TIMELINE_LABELS;
2345
- exports.EMPTY_FACT_DATE_FIELDS = EMPTY_FACT_DATE_FIELDS;
2346
- exports.FactComposer = FactComposer;
2347
- exports.FactDateInput = FactDateInput;
2348
- exports.FactFieldRow = FactFieldRow;
2349
- exports.FactLabelsCell = FactLabelsCell;
2350
- exports.FactRowActions = FactRowActions;
2351
642
  exports.FactSearchBar = FactSearchBar;
2352
643
  exports.FactSearchNoMatches = FactSearchNoMatches;
2353
644
  exports.FactSearchPending = FactSearchPending;
2354
645
  exports.FactSearchResult = FactSearchResult;
2355
646
  exports.FactSearchTotals = FactSearchTotals;
2356
- exports.FactSourceGroup = FactSourceGroup;
2357
- exports.FactSourcesRow = FactSourcesRow;
2358
- exports.FactsBulkBar = FactsBulkBar;
2359
- exports.FactsCalendar = FactsCalendar;
2360
- exports.FactsEmptyState = FactsEmptyState;
2361
- exports.FactsFieldsButton = FactsFieldsButton;
2362
- exports.FactsGanttPane = FactsGanttPane;
2363
- exports.FactsLoadError = FactsLoadError;
2364
- exports.FactsLoading = FactsLoading;
2365
647
  exports.FactsTable = FactsTable;
2366
- exports.FactsToolbar = FactsToolbar;
2367
- exports.FactsViewToggle = FactsViewToggle;
2368
- exports.ISO_DATE_FILTER_PARAMS = ISO_DATE_FILTER_PARAMS;
2369
- exports.buildFactCitations = buildFactCitations;
2370
- exports.chunkIdsOf = chunkIdsOf;
2371
- exports.createFactColumns = createFactColumns;
2372
- exports.docIdsOf = docIdsOf;
2373
- exports.enableFactTableColumnResize = enableFactTableColumnResize;
2374
- exports.factDateFieldsToSpan = factDateFieldsToSpan;
2375
- exports.factDateSpanToFields = factDateSpanToFields;
2376
- exports.hasChunk = hasChunk;
2377
- exports.isWholeDoc = isWholeDoc;
2378
- exports.sourceDocCount = sourceDocCount;
2379
- exports.toFactCitations = toFactCitations;
2380
648
  exports.toFactRow = toFactRow;
2381
649
  exports.toFactRows = toFactRows;
2382
- exports.withChunk = withChunk;
2383
- exports.withDoc = withDoc;
2384
- exports.withoutChunk = withoutChunk;
2385
- exports.withoutDoc = withoutDoc;
2386
650
  //# sourceMappingURL=index.cjs.map
2387
651
  //# sourceMappingURL=index.cjs.map