@arbidocs/blocks 0.5.65 → 0.5.67

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 (199) hide show
  1. package/README.md +5 -0
  2. package/dist/{ConnectedCallDock-GJAGY75U.cjs → ConnectedCallDock-FFIDDYGH.cjs} +6 -6
  3. package/dist/{ConnectedCallDock-GJAGY75U.cjs.map → ConnectedCallDock-FFIDDYGH.cjs.map} +1 -1
  4. package/dist/{ConnectedCallDock-DEAEFUUD.js → ConnectedCallDock-VMEBH4LG.js} +6 -6
  5. package/dist/{ConnectedCallDock-DEAEFUUD.js.map → ConnectedCallDock-VMEBH4LG.js.map} +1 -1
  6. package/dist/{ConnectedCallRoom-DI7UYRHE.js → ConnectedCallRoom-2FNSX2VG.js} +6 -6
  7. package/dist/{ConnectedCallRoom-DI7UYRHE.js.map → ConnectedCallRoom-2FNSX2VG.js.map} +1 -1
  8. package/dist/{ConnectedCallRoom-KLE2PCMQ.cjs → ConnectedCallRoom-HYRLJUIV.cjs} +6 -6
  9. package/dist/{ConnectedCallRoom-KLE2PCMQ.cjs.map → ConnectedCallRoom-HYRLJUIV.cjs.map} +1 -1
  10. package/dist/{ConnectedDocumentViewer-YSZWOVGN.cjs → ConnectedDocumentViewer-IQHDCAZ5.cjs} +12 -12
  11. package/dist/{ConnectedDocumentViewer-YSZWOVGN.cjs.map → ConnectedDocumentViewer-IQHDCAZ5.cjs.map} +1 -1
  12. package/dist/{ConnectedDocumentViewer-HKIBNGGG.js → ConnectedDocumentViewer-NIZBKBJN.js} +11 -11
  13. package/dist/{ConnectedDocumentViewer-HKIBNGGG.js.map → ConnectedDocumentViewer-NIZBKBJN.js.map} +1 -1
  14. package/dist/{ConnectedNativeDocxComparison-PSAP3Q7D.js → ConnectedNativeDocxComparison-FPW3BNBN.js} +6 -6
  15. package/dist/ConnectedNativeDocxComparison-FPW3BNBN.js.map +1 -0
  16. package/dist/{ConnectedNativeDocxComparison-L3R3ROPZ.cjs → ConnectedNativeDocxComparison-HJ4FTVH6.cjs} +7 -7
  17. package/dist/ConnectedNativeDocxComparison-HJ4FTVH6.cjs.map +1 -0
  18. package/dist/{ConnectedNativeDocxEditor-VDBC4XRT.cjs → ConnectedNativeDocxEditor-PF46MU5H.cjs} +7 -7
  19. package/dist/ConnectedNativeDocxEditor-PF46MU5H.cjs.map +1 -0
  20. package/dist/{ConnectedNativeDocxEditor-PI6QTPXZ.js → ConnectedNativeDocxEditor-S7NJMDSU.js} +5 -5
  21. package/dist/ConnectedNativeDocxEditor-S7NJMDSU.js.map +1 -0
  22. package/dist/{ConnectedStreamedWordArtifact-V4MTKVNE.js → ConnectedStreamedWordArtifact-5MHLV24V.js} +6 -6
  23. package/dist/ConnectedStreamedWordArtifact-5MHLV24V.js.map +1 -0
  24. package/dist/{ConnectedStreamedWordArtifact-YSW6D7AG.cjs → ConnectedStreamedWordArtifact-LNGW7YGV.cjs} +7 -7
  25. package/dist/ConnectedStreamedWordArtifact-LNGW7YGV.cjs.map +1 -0
  26. package/dist/{DocumentReviewCard-TQQADJ36.js → DocumentReviewCard-5U3TGJZA.js} +6 -6
  27. package/dist/{DocumentReviewCard-TQQADJ36.js.map → DocumentReviewCard-5U3TGJZA.js.map} +1 -1
  28. package/dist/{DocumentReviewCard-BQ6ZD5MD.cjs → DocumentReviewCard-VFNMJSK7.cjs} +6 -6
  29. package/dist/{DocumentReviewCard-BQ6ZD5MD.cjs.map → DocumentReviewCard-VFNMJSK7.cjs.map} +1 -1
  30. package/dist/{WorkspaceTableView-GKMVTECZ.cjs → WorkspaceTableView-DHMCJRC6.cjs} +6 -6
  31. package/dist/{WorkspaceTableView-GKMVTECZ.cjs.map → WorkspaceTableView-DHMCJRC6.cjs.map} +1 -1
  32. package/dist/{WorkspaceTableView-YFLVFRJL.js → WorkspaceTableView-EH5CEB44.js} +4 -4
  33. package/dist/{WorkspaceTableView-YFLVFRJL.js.map → WorkspaceTableView-EH5CEB44.js.map} +1 -1
  34. package/dist/agents/index.cjs +283 -283
  35. package/dist/agents/index.js +5 -5
  36. package/dist/calls/index.cjs +2 -2
  37. package/dist/calls/index.js +2 -2
  38. package/dist/chat/index.cjs +57 -57
  39. package/dist/chat/index.js +4 -4
  40. package/dist/{chunk-D27BBGUF.cjs → chunk-23ACBETH.cjs} +4 -4
  41. package/dist/{chunk-D27BBGUF.cjs.map → chunk-23ACBETH.cjs.map} +1 -1
  42. package/dist/{chunk-4CI42DCG.js → chunk-323R76RZ.js} +50 -5
  43. package/dist/chunk-323R76RZ.js.map +1 -0
  44. package/dist/{chunk-DJE2E7YH.cjs → chunk-3VFQYKB5.cjs} +3 -3
  45. package/dist/{chunk-DJE2E7YH.cjs.map → chunk-3VFQYKB5.cjs.map} +1 -1
  46. package/dist/{chunk-JSHBC47B.cjs → chunk-45Y7ASBC.cjs} +53 -47
  47. package/dist/chunk-45Y7ASBC.cjs.map +1 -0
  48. package/dist/{chunk-TVHTXO6V.cjs → chunk-56WWEK6I.cjs} +4 -4
  49. package/dist/{chunk-TVHTXO6V.cjs.map → chunk-56WWEK6I.cjs.map} +1 -1
  50. package/dist/{chunk-CGCTODPC.cjs → chunk-6PGTH2HD.cjs} +4 -4
  51. package/dist/{chunk-CGCTODPC.cjs.map → chunk-6PGTH2HD.cjs.map} +1 -1
  52. package/dist/{chunk-PBIFISDD.js → chunk-7P24MJQN.js} +3 -3
  53. package/dist/{chunk-PBIFISDD.js.map → chunk-7P24MJQN.js.map} +1 -1
  54. package/dist/{chunk-6QZ35CTZ.js → chunk-AD76WTGR.js} +3 -3
  55. package/dist/{chunk-6QZ35CTZ.js.map → chunk-AD76WTGR.js.map} +1 -1
  56. package/dist/{chunk-ROWJU4SK.cjs → chunk-AKGV6JUC.cjs} +12 -128
  57. package/dist/chunk-AKGV6JUC.cjs.map +1 -0
  58. package/dist/{chunk-UIUWCTIZ.js → chunk-APXW5XGA.js} +165 -4
  59. package/dist/chunk-APXW5XGA.js.map +1 -0
  60. package/dist/{chunk-SEVFIBF3.cjs → chunk-BFIHXDO6.cjs} +4 -4
  61. package/dist/{chunk-SEVFIBF3.cjs.map → chunk-BFIHXDO6.cjs.map} +1 -1
  62. package/dist/{chunk-6OMIIF76.js → chunk-BWWND4Y7.js} +3 -3
  63. package/dist/{chunk-6OMIIF76.js.map → chunk-BWWND4Y7.js.map} +1 -1
  64. package/dist/{chunk-EG3BB32W.cjs → chunk-CCSF7RI4.cjs} +3 -3
  65. package/dist/{chunk-EG3BB32W.cjs.map → chunk-CCSF7RI4.cjs.map} +1 -1
  66. package/dist/{chunk-QK546T4C.cjs → chunk-CKNUL4LM.cjs} +3 -3
  67. package/dist/{chunk-QK546T4C.cjs.map → chunk-CKNUL4LM.cjs.map} +1 -1
  68. package/dist/{chunk-TJ7QEGVP.cjs → chunk-COZDIUG7.cjs} +18 -18
  69. package/dist/{chunk-TJ7QEGVP.cjs.map → chunk-COZDIUG7.cjs.map} +1 -1
  70. package/dist/{chunk-YQEXBJVO.js → chunk-DF5X27QX.js} +42 -5
  71. package/dist/chunk-DF5X27QX.js.map +1 -0
  72. package/dist/{chunk-B3CRSCLK.cjs → chunk-EOIJ5JYP.cjs} +4 -4
  73. package/dist/{chunk-B3CRSCLK.cjs.map → chunk-EOIJ5JYP.cjs.map} +1 -1
  74. package/dist/{chunk-GPYLXEZO.js → chunk-FCOK73I3.js} +6 -120
  75. package/dist/chunk-FCOK73I3.js.map +1 -0
  76. package/dist/{chunk-CJF7B5A7.cjs → chunk-FHXXDPNU.cjs} +12 -12
  77. package/dist/{chunk-CJF7B5A7.cjs.map → chunk-FHXXDPNU.cjs.map} +1 -1
  78. package/dist/{chunk-ITRI47DF.cjs → chunk-GMGEAWFX.cjs} +41 -4
  79. package/dist/chunk-GMGEAWFX.cjs.map +1 -0
  80. package/dist/{chunk-LNH6NYG4.js → chunk-I3VBVP6R.js} +121 -6
  81. package/dist/chunk-I3VBVP6R.js.map +1 -0
  82. package/dist/{chunk-ZZHMJXM5.cjs → chunk-IXZCXK6Q.cjs} +122 -5
  83. package/dist/chunk-IXZCXK6Q.cjs.map +1 -0
  84. package/dist/{chunk-SBAM3UZX.js → chunk-JWRTUYLC.js} +3 -3
  85. package/dist/{chunk-SBAM3UZX.js.map → chunk-JWRTUYLC.js.map} +1 -1
  86. package/dist/{chunk-PLEMVK2W.js → chunk-KQLUMK56.js} +3 -3
  87. package/dist/{chunk-PLEMVK2W.js.map → chunk-KQLUMK56.js.map} +1 -1
  88. package/dist/{chunk-PNZVUH46.cjs → chunk-LAQ3Y5JP.cjs} +6 -6
  89. package/dist/{chunk-PNZVUH46.cjs.map → chunk-LAQ3Y5JP.cjs.map} +1 -1
  90. package/dist/{chunk-AESJLGMC.cjs → chunk-LEW4GUFW.cjs} +7 -7
  91. package/dist/{chunk-AESJLGMC.cjs.map → chunk-LEW4GUFW.cjs.map} +1 -1
  92. package/dist/{chunk-2LUA7UDE.js → chunk-NDVLCOWS.js} +7 -7
  93. package/dist/{chunk-2LUA7UDE.js.map → chunk-NDVLCOWS.js.map} +1 -1
  94. package/dist/{chunk-43IVRSFX.js → chunk-NVXNTHL4.js} +3 -3
  95. package/dist/{chunk-43IVRSFX.js.map → chunk-NVXNTHL4.js.map} +1 -1
  96. package/dist/{chunk-IRXPUQFP.js → chunk-OZL5ABLF.js} +3 -3
  97. package/dist/{chunk-IRXPUQFP.js.map → chunk-OZL5ABLF.js.map} +1 -1
  98. package/dist/{chunk-5EGTGHBW.js → chunk-PGKZBAJB.js} +12 -6
  99. package/dist/chunk-PGKZBAJB.js.map +1 -0
  100. package/dist/{chunk-KNOSLLTC.js → chunk-PKDPQS6Z.js} +3 -3
  101. package/dist/{chunk-KNOSLLTC.js.map → chunk-PKDPQS6Z.js.map} +1 -1
  102. package/dist/{chunk-VWM3J6ES.js → chunk-PVPGD6QR.js} +3 -3
  103. package/dist/{chunk-VWM3J6ES.js.map → chunk-PVPGD6QR.js.map} +1 -1
  104. package/dist/{chunk-C2S246BV.js → chunk-RAGITH2N.js} +4 -4
  105. package/dist/{chunk-C2S246BV.js.map → chunk-RAGITH2N.js.map} +1 -1
  106. package/dist/{chunk-4Q7ON335.js → chunk-RFKAE6WS.js} +5 -5
  107. package/dist/{chunk-4Q7ON335.js.map → chunk-RFKAE6WS.js.map} +1 -1
  108. package/dist/{chunk-2C4YUIVX.js → chunk-T2VGD4X6.js} +3 -3
  109. package/dist/{chunk-2C4YUIVX.js.map → chunk-T2VGD4X6.js.map} +1 -1
  110. package/dist/{chunk-CEKOZAGO.js → chunk-TAI23FCY.js} +3 -3
  111. package/dist/{chunk-CEKOZAGO.js.map → chunk-TAI23FCY.js.map} +1 -1
  112. package/dist/{chunk-WBLCPCWR.cjs → chunk-UDMII47W.cjs} +7 -7
  113. package/dist/{chunk-WBLCPCWR.cjs.map → chunk-UDMII47W.cjs.map} +1 -1
  114. package/dist/{chunk-SFTQO3TU.js → chunk-UO3FS6ZF.js} +3 -3
  115. package/dist/{chunk-SFTQO3TU.js.map → chunk-UO3FS6ZF.js.map} +1 -1
  116. package/dist/{chunk-BELZ2WD2.js → chunk-W5D5GFP2.js} +3 -3
  117. package/dist/{chunk-BELZ2WD2.js.map → chunk-W5D5GFP2.js.map} +1 -1
  118. package/dist/{chunk-LFS6UWSJ.cjs → chunk-XWUGPV7H.cjs} +5 -5
  119. package/dist/{chunk-LFS6UWSJ.cjs.map → chunk-XWUGPV7H.cjs.map} +1 -1
  120. package/dist/{chunk-K26RLK2Y.cjs → chunk-Y6ZNWC7E.cjs} +3 -3
  121. package/dist/{chunk-K26RLK2Y.cjs.map → chunk-Y6ZNWC7E.cjs.map} +1 -1
  122. package/dist/{chunk-F777MGVA.cjs → chunk-YBVBDVQX.cjs} +18 -18
  123. package/dist/{chunk-F777MGVA.cjs.map → chunk-YBVBDVQX.cjs.map} +1 -1
  124. package/dist/{chunk-OM5IVNEW.cjs → chunk-Z4KXF7WS.cjs} +165 -2
  125. package/dist/chunk-Z4KXF7WS.cjs.map +1 -0
  126. package/dist/{chunk-7MOQO6NO.cjs → chunk-ZIQGSFHG.cjs} +53 -5
  127. package/dist/chunk-ZIQGSFHG.cjs.map +1 -0
  128. package/dist/connect/docx.cjs +11 -11
  129. package/dist/connect/docx.js +7 -7
  130. package/dist/connect/index.cjs +1723 -1149
  131. package/dist/connect/index.cjs.map +1 -1
  132. package/dist/connect/index.d.ts +3 -0
  133. package/dist/connect/index.js +1191 -633
  134. package/dist/connect/index.js.map +1 -1
  135. package/dist/connect/viewer.cjs +10 -10
  136. package/dist/connect/viewer.js +9 -9
  137. package/dist/connection/billing/index.d.ts +1 -0
  138. package/dist/connection/billing/payment-required.d.ts +45 -0
  139. package/dist/connection/runtime/ConnectedAppRuntime.d.ts +1 -1
  140. package/dist/connection/runtime/index.d.ts +1 -1
  141. package/dist/connection/runtime/requests.d.ts +8 -0
  142. package/dist/connection/runtime/useWelcomeDialog.d.ts +3 -0
  143. package/dist/connection/settings-page/ConnectedModelConnectionsSettings.d.ts +1 -0
  144. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +3 -0
  145. package/dist/connection/settings-page/index.d.ts +2 -1
  146. package/dist/connection/tips/ConnectedGettingStarted.d.ts +20 -0
  147. package/dist/connection/tips/ConnectedTipBar.d.ts +49 -0
  148. package/dist/connection/tips/useGettingStarted.d.ts +51 -0
  149. package/dist/connection/workflows/useWorkflowsPageState.d.ts +1 -1
  150. package/dist/dashboards/index.cjs +1 -1
  151. package/dist/dashboards/index.js +1 -1
  152. package/dist/document-tools/index.cjs +17 -17
  153. package/dist/document-tools/index.js +2 -2
  154. package/dist/embed/index.cjs +9 -9
  155. package/dist/embed/index.js +6 -6
  156. package/dist/facts/index.cjs +1 -1
  157. package/dist/facts/index.js +1 -1
  158. package/dist/files/index.cjs +1 -1
  159. package/dist/files/index.js +1 -1
  160. package/dist/home/index.cjs +23 -178
  161. package/dist/home/index.cjs.map +1 -1
  162. package/dist/home/index.js +3 -164
  163. package/dist/home/index.js.map +1 -1
  164. package/dist/index.cjs +606 -634
  165. package/dist/index.cjs.map +1 -1
  166. package/dist/index.js +23 -62
  167. package/dist/index.js.map +1 -1
  168. package/dist/shell/index.cjs +73 -73
  169. package/dist/shell/index.js +4 -4
  170. package/dist/site/index.cjs +17 -17
  171. package/dist/site/index.js +1 -1
  172. package/dist/studio/index.cjs +10 -10
  173. package/dist/studio/index.js +7 -7
  174. package/dist/tips/index.d.ts +1 -1
  175. package/dist/tips/visibility.d.ts +7 -0
  176. package/dist/workflow-canvas/index.cjs +27 -27
  177. package/dist/workflow-canvas/index.cjs.map +1 -1
  178. package/dist/workflow-canvas/index.js +12 -12
  179. package/dist/workflow-canvas/index.js.map +1 -1
  180. package/node_modules/@arbidocs/coedit/package.json +1 -1
  181. package/package.json +5 -5
  182. package/dist/ConnectedNativeDocxComparison-L3R3ROPZ.cjs.map +0 -1
  183. package/dist/ConnectedNativeDocxComparison-PSAP3Q7D.js.map +0 -1
  184. package/dist/ConnectedNativeDocxEditor-PI6QTPXZ.js.map +0 -1
  185. package/dist/ConnectedNativeDocxEditor-VDBC4XRT.cjs.map +0 -1
  186. package/dist/ConnectedStreamedWordArtifact-V4MTKVNE.js.map +0 -1
  187. package/dist/ConnectedStreamedWordArtifact-YSW6D7AG.cjs.map +0 -1
  188. package/dist/chunk-4CI42DCG.js.map +0 -1
  189. package/dist/chunk-5EGTGHBW.js.map +0 -1
  190. package/dist/chunk-7MOQO6NO.cjs.map +0 -1
  191. package/dist/chunk-GPYLXEZO.js.map +0 -1
  192. package/dist/chunk-ITRI47DF.cjs.map +0 -1
  193. package/dist/chunk-JSHBC47B.cjs.map +0 -1
  194. package/dist/chunk-LNH6NYG4.js.map +0 -1
  195. package/dist/chunk-OM5IVNEW.cjs.map +0 -1
  196. package/dist/chunk-ROWJU4SK.cjs.map +0 -1
  197. package/dist/chunk-UIUWCTIZ.js.map +0 -1
  198. package/dist/chunk-YQEXBJVO.js.map +0 -1
  199. package/dist/chunk-ZZHMJXM5.cjs.map +0 -1
@@ -4,7 +4,7 @@
4
4
  var chunk464YPRAE_cjs = require('./chunk-464YPRAE.cjs');
5
5
  var chunkPICGTGEB_cjs = require('./chunk-PICGTGEB.cjs');
6
6
  var chunkT35SGVB2_cjs = require('./chunk-T35SGVB2.cjs');
7
- var chunkK26RLK2Y_cjs = require('./chunk-K26RLK2Y.cjs');
7
+ var chunkY6ZNWC7E_cjs = require('./chunk-Y6ZNWC7E.cjs');
8
8
  var chunk3YEXZX4H_cjs = require('./chunk-3YEXZX4H.cjs');
9
9
  var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
10
10
  var chunk7JVP3LS6_cjs = require('./chunk-7JVP3LS6.cjs');
@@ -47,7 +47,7 @@ function toWorkflowFieldDocument(doc) {
47
47
  function useConnectedWorkflowScopeSource() {
48
48
  const { data: docs } = chunk7JVP3LS6_cjs.useListedDocuments();
49
49
  const { data: tags } = chunk7JVP3LS6_cjs.useConnectedTags();
50
- return react.useMemo(() => chunkK26RLK2Y_cjs.buildWorkflowScopeSource(docs, chunkK26RLK2Y_cjs.documentScopeLabels(tags)), [docs, tags]);
50
+ return react.useMemo(() => chunkY6ZNWC7E_cjs.buildWorkflowScopeSource(docs, chunkY6ZNWC7E_cjs.documentScopeLabels(tags)), [docs, tags]);
51
51
  }
52
52
  function useConnectedAgentOptions() {
53
53
  const { data: agents } = react$1.useAgents();
@@ -104,7 +104,7 @@ function ConnectedWorkflowDocumentsField({
104
104
  }
105
105
  ),
106
106
  /* @__PURE__ */ jsxRuntime.jsx(
107
- chunkK26RLK2Y_cjs.WorkflowDocumentsField,
107
+ chunkY6ZNWC7E_cjs.WorkflowDocumentsField,
108
108
  {
109
109
  field,
110
110
  value,
@@ -126,7 +126,7 @@ function ConnectedWorkflowLauncher({
126
126
  const scopeSource = useConnectedWorkflowScopeSource();
127
127
  const agents = useConnectedAgentOptions();
128
128
  return /* @__PURE__ */ jsxRuntime.jsx(
129
- chunkK26RLK2Y_cjs.WorkflowLauncher,
129
+ chunkY6ZNWC7E_cjs.WorkflowLauncher,
130
130
  {
131
131
  ...props,
132
132
  scopeSource,
@@ -333,7 +333,7 @@ function ConnectedWorkflowsTable({
333
333
  await act(workflow, () => remove.mutateAsync(workflow.external_id));
334
334
  };
335
335
  return /* @__PURE__ */ jsxRuntime.jsx(
336
- chunkK26RLK2Y_cjs.WorkflowsTable,
336
+ chunkY6ZNWC7E_cjs.WorkflowsTable,
337
337
  {
338
338
  ...tableProps,
339
339
  workflows,
@@ -598,5 +598,5 @@ exports.useConnectedWorkflowScopeSource = useConnectedWorkflowScopeSource;
598
598
  exports.useConnectedWorkspaceRole = useConnectedWorkspaceRole;
599
599
  exports.useDocxCommentTarget = useDocxCommentTarget;
600
600
  exports.useNativeDocxSupport = useNativeDocxSupport;
601
- //# sourceMappingURL=chunk-WBLCPCWR.cjs.map
602
- //# sourceMappingURL=chunk-WBLCPCWR.cjs.map
601
+ //# sourceMappingURL=chunk-UDMII47W.cjs.map
602
+ //# sourceMappingURL=chunk-UDMII47W.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useListedDocuments","useConnectedTags","useMemo","buildWorkflowScopeSource","documentScopeLabels","useAgents","useBlocksEnvironment","useConnectedWorkspace","useUploadDocuments","useThumbnails","useRef","useState","useCallback","jsxs","Fragment","jsx","WorkflowDocumentsField","WorkflowLauncher","DocumentPicker","useArbi","buildDeepLinkUrl","parseDeepLinkPath","useWorkspaceUsers","fmtDate","useOpenWorkflow","workflowSteps","useWorkflows","useConnectedConversations","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","isScheduledWorkflow","useEffect","WorkflowsTable","workflowSignal","workflowTriggerType","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","builtinHouseTemplate","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useQueryClient","useOptionalDocumentTools","loadDocxFonts","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,CAAC,CAAA;AAG9E,SAAS,wBAAwB,GAAA,EAA+C;AAErF,EAAA,MAAM,UAAU,gBAAA,CAAiB,GAAA,CAAA,CAAK,IAAI,SAAA,IAAa,EAAA,EAAI,aAAa,CAAA;AACxE,EAAA,OAAO;AAAA,IACL,IAAI,GAAA,CAAI,WAAA;AAAA,IACR,OAAO,GAAA,CAAI,YAAA,EAAc,KAAA,IAAS,GAAA,CAAI,aAAa,GAAA,CAAI,WAAA;AAAA,IACvD,UAAU,GAAA,CAAI,SAAA;AAAA,IACd,KAAA,EAAO,OAAA,GAAU,IAAA,GAAQ,GAAA,CAAI,OAAA,IAAW,IAAA;AAAA,IACxC,MAAA,EAAQ,OAAA,GAAU,IAAA,GAAQ,GAAA,CAAI,MAAA,IAAU,IAAA;AAAA,IACxC,QAAQ,GAAA,CAAI,MAAA;AAAA,IACZ;AAAA,GACF;AACF;AAGO,SAAS,+BAAA,GAAuD;AACrE,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAK,GAAIC,oCAAA,EAAmB;AAC1C,EAAA,MA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;AAAA,YACpB,aAAa,OAAA,CAAQ,WAAA;AAAA,YACrB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,eAAe,OAAA,CAAQ;AAAA,WACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-WBLCPCWR.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedTags, useListedDocuments, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useListedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useListedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n *\n * `groupBy=\"category\"` lists the host's catalogue (the host configuration's `workflows.catalogue`)\n * in its categories above the saved workflows: an entry opens in the builder (`onOpenTemplate`) or\n * runs (the environment's `openWorkflow(id, { view: 'run' })`).\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport type { WorkflowCatalogueRow } from '../agents/tasks/WorkflowCatalogueSections'\nimport {\n isScheduledWorkflow,\n workflowSignal,\n workflowTriggerType,\n} from '../agents/tasks/workflowRows'\nimport { workflowSteps } from '../agents/workflows/run'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useOpenWorkflow } from './workflows/useOpenWorkflow'\nimport { useHost } from '../provider/host'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n /** When a workflow that starts on a step signal starts (the default trigger text). */\n signalTrigger: (signal: string) => string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n signalTrigger: (signal) => `When a step signals ${signal}`,\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n | 'catalogue'\n | 'categories'\n> {\n /**\n * Which saved workflows to list: `scheduled` (those that start on a date or a repeat), or a\n * predicate. Default: all.\n */\n filter?: 'scheduled' | ((workflow: WorkflowResponse) => boolean)\n /**\n * When a workflow starts, in the host's words. Default: the step signal it starts on, else its\n * trigger type.\n */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger,\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n groupBy,\n renderIcon,\n onRunTemplate,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const openWorkflow = useOpenWorkflow()\n const host = useHost().workflows\n const catalogueEntries = groupBy === 'category' ? host?.catalogue : undefined\n const catalogue = useMemo(\n () =>\n catalogueEntries?.map(({ workflow, category, note, runnable }): WorkflowCatalogueRow => ({\n id: workflow.id,\n title: workflow.title,\n description: workflow.description,\n icon: workflow.icon,\n category,\n stepCount: workflowSteps(workflow).length,\n note,\n runnable,\n })),\n [catalogueEntries]\n )\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => {\n const keep = filter === 'scheduled' ? isScheduledWorkflow : filter\n return keep ? saved.filter(keep) : saved\n }, [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={\n describeTrigger ??\n ((w) => {\n const signal = workflowSignal(w)\n return signal ? l.signalTrigger(signal) : workflowTriggerType(w).replaceAll('_', ' ')\n })\n }\n groupBy={groupBy}\n catalogue={catalogue}\n categories={host?.categories}\n renderIcon={renderIcon ?? host?.renderIcon}\n onRunTemplate={onRunTemplate ?? (openWorkflow && ((id) => openWorkflow(id, { view: 'run' })))}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn&apos;t available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useListedDocuments","useConnectedTags","useMemo","buildWorkflowScopeSource","documentScopeLabels","useAgents","useBlocksEnvironment","useConnectedWorkspace","useUploadDocuments","useThumbnails","useRef","useState","useCallback","jsxs","Fragment","jsx","WorkflowDocumentsField","WorkflowLauncher","DocumentPicker","useArbi","buildDeepLinkUrl","parseDeepLinkPath","useWorkspaceUsers","fmtDate","useOpenWorkflow","workflowSteps","useWorkflows","useConnectedConversations","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","isScheduledWorkflow","useEffect","WorkflowsTable","workflowSignal","workflowTriggerType","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","builtinHouseTemplate","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useQueryClient","useOptionalDocumentTools","loadDocxFonts","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,CAAC,CAAA;AAG9E,SAAS,wBAAw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AA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-UDMII47W.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedTags, useListedDocuments, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useListedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useListedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n *\n * `groupBy=\"category\"` lists the host's catalogue (the host configuration's `workflows.catalogue`)\n * in its categories above the saved workflows: an entry opens in the builder (`onOpenTemplate`) or\n * runs (the environment's `openWorkflow(id, { view: 'run' })`).\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport type { WorkflowCatalogueRow } from '../agents/tasks/WorkflowCatalogueSections'\nimport {\n isScheduledWorkflow,\n workflowSignal,\n workflowTriggerType,\n} from '../agents/tasks/workflowRows'\nimport { workflowSteps } from '../agents/workflows/run'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useOpenWorkflow } from './workflows/useOpenWorkflow'\nimport { useHost } from '../provider/host'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n /** When a workflow that starts on a step signal starts (the default trigger text). */\n signalTrigger: (signal: string) => string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n signalTrigger: (signal) => `When a step signals ${signal}`,\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n | 'catalogue'\n | 'categories'\n> {\n /**\n * Which saved workflows to list: `scheduled` (those that start on a date or a repeat), or a\n * predicate. Default: all.\n */\n filter?: 'scheduled' | ((workflow: WorkflowResponse) => boolean)\n /**\n * When a workflow starts, in the host's words. Default: the step signal it starts on, else its\n * trigger type.\n */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger,\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n groupBy,\n renderIcon,\n onRunTemplate,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const openWorkflow = useOpenWorkflow()\n const host = useHost().workflows\n const catalogueEntries = groupBy === 'category' ? host?.catalogue : undefined\n const catalogue = useMemo(\n () =>\n catalogueEntries?.map(({ workflow, category, note, runnable }): WorkflowCatalogueRow => ({\n id: workflow.id,\n title: workflow.title,\n description: workflow.description,\n icon: workflow.icon,\n category,\n stepCount: workflowSteps(workflow).length,\n note,\n runnable,\n })),\n [catalogueEntries]\n )\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => {\n const keep = filter === 'scheduled' ? isScheduledWorkflow : filter\n return keep ? saved.filter(keep) : saved\n }, [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={\n describeTrigger ??\n ((w) => {\n const signal = workflowSignal(w)\n return signal ? l.signalTrigger(signal) : workflowTriggerType(w).replaceAll('_', ' ')\n })\n }\n groupBy={groupBy}\n catalogue={catalogue}\n categories={host?.categories}\n renderIcon={renderIcon ?? host?.renderIcon}\n onRunTemplate={onRunTemplate ?? (openWorkflow && ((id) => openWorkflow(id, { view: 'run' })))}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn&apos;t available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useAssistantDock } from './chunk-PLEMVK2W.js';
2
+ import { useAssistantDock } from './chunk-KQLUMK56.js';
3
3
  import { useChatSurface } from './chunk-OR6GABIG.js';
4
4
  import { Toaster } from './chunk-SUVMOGTC.js';
5
5
  import { Search, Pin, X, CheckCircle, Tag, Check } from 'lucide-react';
@@ -388,5 +388,5 @@ function AssistantToaster(props) {
388
388
  }
389
389
 
390
390
  export { AssistantToaster, ContextActionButton, ContextCheckRow, ContextPanelContent, ContextPanelFooter, ContextPanelTabs, ContextPickerList, ContextPickerRow, ContextSearchInput, ContextSelectList, ContextSelectRow, DEFAULT_LABEL_PIN_ROW_LABELS, DEFAULT_PINNED_DOC_CHIP_LABELS, LabelPinRow, PinnedDocChip, useDismissibleCard };
391
- //# sourceMappingURL=chunk-SFTQO3TU.js.map
392
- //# sourceMappingURL=chunk-SFTQO3TU.js.map
391
+ //# sourceMappingURL=chunk-UO3FS6ZF.js.map
392
+ //# sourceMappingURL=chunk-UO3FS6ZF.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chat/PinnedDocChip.tsx","../src/chat/ContextPanel.tsx","../src/lib/useDismissibleCard.ts","../src/chat/LabelPinRow.tsx","../src/chat/AssistantToaster.tsx"],"names":["ContextPanelContent","jsx","cn","jsxs","ContextSearchInput","ContextActionButton","TagIcon"],"mappings":";;;;;;;;AAUO,IAAM,8BAAA,GAAsD;AAAA,EACjE,KAAA,EAAO,OAAA;AAAA,EACP,aAAA,EAAe,CAAC,KAAA,KAAU,CAAA,MAAA,EAAS,KAAK,CAAA;AAC1C;AAiBO,SAAS,aAAA,CAAc;AAAA,EAC5B,KAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA,GAAS;AACX,CAAA,EAAuB;AACrB,EAAA,MAAM,CAAA,GAAI,EAAE,GAAG,8BAAA,EAAgC,GAAG,MAAA,EAAO;AACzD,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,QAAA,EAAU,CAAA;AAAA,MACV,WAAA,EAAU,iBAAA;AAAA,MACV,OAAA,EAAS,CAAC,CAAA,KAAM;AACd,QAAA,CAAA,CAAE,eAAA,EAAgB;AAClB,QAAA,OAAA,EAAQ;AAAA,MACV,CAAA;AAAA,MACA,SAAA,EAAW,CAAC,CAAA,KAAM;AAChB,QAAA,IAAI,CAAA,CAAE,GAAA,KAAQ,OAAA,IAAW,CAAA,CAAE,QAAQ,GAAA,EAAK;AACtC,UAAA,CAAA,CAAE,eAAA,EAAgB;AAClB,UAAA,OAAA,EAAQ;AAAA,QACV;AAAA,MACF,CAAA;AAAA,MACA,OAAO,CAAA,CAAE,KAAA;AAAA,MACT,YAAA,EAAY,CAAA,CAAE,aAAA,CAAc,KAAK,CAAA;AAAA,MACjC,SAAA,EAAW,EAAA;AAAA,QACT,i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AAA,oBACV,KAAA,EAAO,EAAE,eAAA,EAAiB,KAAA,CAAM,KAAA,EAAM;AAAA,oBACtC,aAAA,EAAW;AAAA;AAAA,iBACb;AAAA,gCAEFA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,wBAAA,EAA0B,gBAAM,IAAA,EAAK,CAAA;AAAA,gCACrDA,GAAAA,CAAC,MAAA,EAAA,EAAK,WAAU,yBAAA,EAA2B,QAAA,EAAA,KAAA,CAAM,QAAQ,MAAA,EAAO;AAAA;AAAA,aAAA;AAAA,YAlC3D,KAAA,CAAM;AAAA,WAmCb;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,GACH;AAEJ;AC7FO,SAAS,iBAAiB,KAAA,EAA8B;AAC7D,EAAA,MAAM,OAAO,gBAAA,EAAiB;AAC9B,EAAA,MAAM,EAAE,eAAA,EAAgB,GAAI,cAAA,EAAe;AAC3C,EAAA,uBAAOA,IAAC,OAAA,EAAA,EAAS,GAAG,OAAO,QAAA,EAAU,IAAA,CAAK,UAAU,eAAA,EAAiB,CAAA;AACvE","file":"chunk-SFTQO3TU.js","sourcesContent":["import { Pin, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\n/** Every fixed string of the chip. Pass a partial `labels` to translate or reword. */\nexport interface PinnedDocChipLabels {\n unpin: string\n /** Accessible name; `title` is the pinned document's name. */\n unpinDocument: (title: string) => string\n}\n\nexport const DEFAULT_PINNED_DOC_CHIP_LABELS: PinnedDocChipLabels = {\n unpin: 'Unpin',\n unpinDocument: (title) => `Unpin ${title}`,\n}\n\nexport interface PinnedDocChipProps {\n title: string\n onUnpin: () => void\n className?: string\n labels?: Partial<PinnedDocChipLabels>\n testId?: string\n}\n\n/**\n * The pinned-document chip that lives inside a composer's attach button: shows which document\n * holds the full-context pin and unpins it in ONE tap (the X is always visible, so touch and\n * keyboard reach it). It is a span with button semantics because it sits inside the attach\n * `<button>`, where nested buttons are invalid; `stopPropagation` keeps the tap from also\n * triggering the parent.\n */\nexport function PinnedDocChip({\n title,\n onUnpin,\n className,\n labels,\n testId = 'unpin-document-button',\n}: PinnedDocChipProps) {\n const l = { ...DEFAULT_PINNED_DOC_CHIP_LABELS, ...labels }\n return (\n <span\n role=\"button\"\n tabIndex={0}\n data-slot=\"pinned-doc-chip\"\n onClick={(e) => {\n e.stopPropagation()\n onUnpin()\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.stopPropagation()\n onUnpin()\n }\n }}\n title={l.unpin}\n aria-label={l.unpinDocument(title)}\n className={cn(\n '-mx-0.5 flex min-w-0 items-center gap-1 rounded-sm px-1 text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className\n )}\n data-testid={testId}\n >\n <Pin className=\"h-3 w-3 shrink-0 fill-primary\" />\n <X className=\"order-last h-3 w-3 shrink-0 text-muted-foreground\" />\n <span className=\"truncate text-sm\">{title}</span>\n </span>\n )\n}\n","import {\n forwardRef,\n Fragment,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type MouseEventHandler,\n type ReactNode,\n} from 'react'\nimport { Check, CheckCircle, Search } from 'lucide-react'\nimport {\n Badge,\n Button,\n HoverCardContent,\n Input,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n type ButtonProps,\n} from '@arbidocs/react/ui'\n\n/**\n * Parts of the composer's \"in this chat\" panels (files, facts): a card that opens upward from the\n * composer, a grouped pick list, and below it the labels, search and bulk actions.\n */\n\n/** The card itself: width follows the chat input (`--chat-input-width`), bounded on small screens. */\nexport const ContextPanelContent = forwardRef<\n ElementRef<typeof HoverCardContent>,\n ComponentPropsWithoutRef<typeof HoverCardContent>\n>(function ContextPanelContent({ className, onClick, ...props }, ref) {\n return (\n <HoverCardContent\n ref={ref}\n side=\"top\"\n align=\"start\"\n data-slot=\"context-panel\"\n // Clicks inside must not bubble (via the React portal) to a click-to-toggle wrapper.\n onClick={(e) => {\n e.stopPropagation()\n onClick?.(e)\n }}\n className={cn(\n 'w-[var(--chat-input-width,var(--radix-hover-card-content-available-width))] max-h-[var(--radix-hover-card-content-available-height)] max-w-[95vw] overflow-y-auto overscroll-contain rounded-md border border-border bg-muted p-3 shadow-lg',\n className\n )}\n {...props}\n />\n )\n})\n\nexport interface ContextPickerGroup {\n key: string\n heading: string\n /** Id of the heading element. */\n testId?: string\n /** Shown after the heading as `(n)`. */\n count: number\n children: ReactNode\n}\n\nexport interface ContextPickerListProps {\n groups: ContextPickerGroup[]\n /** Shown instead of the groups when every group is empty. */\n emptyText: string\n testId: string\n className?: string\n}\n\n/**\n * Two (or more) headed groups, e.g. \"In this conversation\" then \"In this workspace\". Each heading\n * pins to the top of the scroller and is pushed out by the next one; the second parks below the\n * first (32px = a heading's own height), so both stay visible however far down you scroll.\n */\nexport function ContextPickerList({\n groups,\n emptyText,\n testId,\n className,\n}: ContextPickerListProps) {\n const isEmpty = groups.every((g) => g.count === 0)\n return (\n <div\n className={cn('max-h-[400px] space-y-1 overflow-y-auto', className)}\n data-slot=\"context-picker-list\"\n data-testid={testId}\n onClick={(e) => e.stopPropagation()}\n >\n {isEmpty ? (\n <p className=\"p-2 text-sm text-muted-foreground\">{emptyText}</p>\n ) : (\n groups.map((g, index) => (\n <Fragment key={g.key}>\n <div\n className={cn(\n 'sticky z-10 bg-muted px-2 py-1.5 text-sm font-medium text-muted-foreground',\n index === 0 ? 'top-0' : 'top-8'\n )}\n data-testid={g.testId}\n >\n {g.heading} ({g.count})\n </div>\n {g.children}\n </Fragment>\n ))\n )}\n </div>\n )\n}\n\nfunction CheckGlyph({ isChecked, className }: { isChecked: boolean; className?: string }) {\n return (\n <span\n className={cn(\n 'flex size-3.5 shrink-0 items-center justify-center rounded-sm border',\n isChecked ? 'border-primary bg-primary text-primary-foreground' : 'border-input',\n className\n )}\n >\n {isChecked && <Check className=\"size-3\" />}\n </span>\n )\n}\n\nexport interface ContextPickerRowProps {\n isSelected: boolean\n onToggle: () => void\n testId?: string\n children: ReactNode\n}\n\n/** A whole-row toggle (e.g. a fact): check glyph then clamped text. */\nexport function ContextPickerRow({\n isSelected,\n onToggle,\n testId,\n children,\n}: ContextPickerRowProps) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onToggle()\n }}\n aria-pressed={isSelected}\n data-testid={testId}\n className={cn(\n 'flex w-full items-start gap-2 rounded p-2 text-left text-sm transition-colors pointer-coarse:min-h-11',\n isSelected ? 'bg-primary/10' : 'bg-card hover:bg-muted'\n )}\n >\n <CheckGlyph isChecked={isSelected} className=\"mt-0.5\" />\n <span className=\"line-clamp-2 min-w-0 text-foreground\">{children}</span>\n </button>\n )\n}\n\nexport interface ContextCheckRowProps {\n isSelected: boolean\n /** The check toggle: accessible name (e.g. \"Add to conversation\"), handler and test id. */\n toggle: { label: string; onToggle: () => void; testId?: string }\n /** Status glyph between the toggle and the content. */\n status?: ReactNode\n testId?: string\n /** The row's content (e.g. a document pill that opens the document). */\n children: ReactNode\n}\n\n/** A row with its own check toggle plus a content slot (e.g. a document, which opens on click). */\nexport function ContextCheckRow({\n isSelected,\n toggle,\n status,\n testId,\n children,\n}: ContextCheckRowProps) {\n return (\n <div\n className=\"flex items-center gap-2 rounded px-1 py-0.5\"\n data-slot=\"context-check-row\"\n data-testid={testId}\n >\n <button\n type=\"button\"\n aria-label={toggle.label}\n aria-pressed={isSelected}\n onClick={toggle.onToggle}\n data-testid={toggle.testId}\n className=\"flex shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11\"\n >\n <CheckGlyph isChecked={isSelected} />\n </button>\n {status}\n {children}\n </div>\n )\n}\n\nexport interface ContextSelectListProps {\n children: ReactNode\n}\n\n/** Compact single-select list (e.g. choose the document to pin). */\nexport function ContextSelectList({ children }: ContextSelectListProps) {\n return <div className=\"max-h-[150px] space-y-2 overflow-y-auto\">{children}</div>\n}\n\nexport interface ContextSelectRowProps {\n isSelected: boolean\n onSelect: MouseEventHandler<HTMLButtonElement>\n status?: ReactNode\n title: string\n testId?: string\n}\n\nexport function ContextSelectRow({\n isSelected,\n onSelect,\n status,\n title,\n testId,\n}: ContextSelectRowProps) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onSelect(e)\n }}\n aria-pressed={isSelected}\n data-testid={testId}\n className={cn(\n 'flex w-full items-center gap-2 rounded p-2 text-left text-sm transition-colors pointer-coarse:min-h-11',\n isSelected ? 'border border-primary/30 bg-primary/10' : 'bg-card hover:bg-muted'\n )}\n >\n {status}\n <span className=\"min-w-0 flex-1 truncate text-foreground\" title={title}>\n {title}\n </span>\n {isSelected && <CheckCircle className=\"size-3.5 shrink-0 text-primary\" />}\n </button>\n )\n}\n\nexport interface ContextPanelFooterProps {\n /** Label shortcut chips (host-supplied row). */\n labels?: ReactNode\n /** The search box. */\n search: ReactNode\n /** Icon + title of the panel; omit when tabs already name it. */\n title?: ReactNode\n /** The action buttons, right aligned. */\n actions: ReactNode\n}\n\n/** Everything below the list: the panel opens upward, so its controls sit nearest the button. */\nexport function ContextPanelFooter({ labels, search, title, actions }: ContextPanelFooterProps) {\n return (\n <div className=\"mt-3 space-y-2 border-t border-border pt-3\" data-slot=\"context-panel-footer\">\n {labels}\n {search}\n <div\n className={cn(\n 'flex flex-wrap items-center gap-x-2 gap-y-1.5',\n title ? 'justify-between' : 'justify-end'\n )}\n >\n {title && (\n <div className=\"flex min-w-0 items-center gap-2 text-sm font-medium text-foreground\">\n {title}\n </div>\n )}\n <div className=\"flex flex-wrap items-center gap-1.5\">{actions}</div>\n </div>\n </div>\n )\n}\n\nexport const ContextSearchInput = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof Input>\n>(function ContextSearchInput({ className, onClick, ...props }, ref) {\n return (\n <div className=\"relative\" onClick={(e) => e.stopPropagation()}>\n <Search className=\"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground\" />\n <Input\n ref={ref}\n className={cn('h-7 bg-background pl-7 text-sm', className)}\n onClick={onClick}\n {...props}\n />\n </div>\n )\n})\n\nexport interface ContextActionButtonProps extends Omit<ButtonProps, 'size'> {\n icon?: ReactNode\n /** Badge after the label; hidden at 0 / undefined. */\n count?: number\n /** Put the icon after the label (bulk Add / Remove) rather than before it. */\n isIconTrailing?: boolean\n}\n\n/** Compact action of the panel footer (stops click propagation so the card stays open). */\nexport const ContextActionButton = forwardRef<HTMLButtonElement, ContextActionButtonProps>(\n function ContextActionButton(\n { icon, count, isIconTrailing, onClick, children, className, variant = 'outline', ...props },\n ref\n ) {\n return (\n <Button\n ref={ref}\n variant={variant}\n size=\"sm\"\n className={cn('flex h-6 items-center gap-1 px-2 text-sm pointer-coarse:h-11', className)}\n onClick={(e) => {\n e.stopPropagation()\n onClick?.(e)\n }}\n {...props}\n >\n {!isIconTrailing && icon}\n {children}\n {isIconTrailing && icon}\n {count != null && count > 0 && (\n <Badge variant=\"outline\" className=\"badge-count ml-1\">\n {count}\n </Badge>\n )}\n </Button>\n )\n }\n)\n\nexport interface ContextTab {\n value: string\n /** Visible tab name, e.g. \"Documents\". */\n label: string\n /** Count shown in the tab label. */\n count: number\n testId?: string\n content: ReactNode\n}\n\nexport interface ContextPanelTabsProps {\n tabs: ContextTab[]\n value: string\n onValueChange: (value: string) => void\n testId?: string\n /** Extra classes for the tab strip (e.g. leave room for a sheet's close button). */\n listClassName?: string\n}\n\n/** The panel's tab strip (Radix tabs: roving tabindex, arrow keys) and the active tab's content. */\nexport function ContextPanelTabs({\n tabs,\n value,\n onValueChange,\n testId,\n listClassName,\n}: ContextPanelTabsProps) {\n return (\n <Tabs value={value} onValueChange={onValueChange} data-testid={testId}>\n <TabsList\n className={cn('grid h-auto w-full grid-cols-2 pointer-coarse:h-auto', listClassName)}\n >\n {tabs.map((t) => (\n <TabsTrigger key={t.value} value={t.value} data-testid={t.testId} className=\"gap-1.5\">\n {t.label}\n <Badge variant=\"outline\" className=\"badge-count\">\n {t.count}\n </Badge>\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t) => (\n <TabsContent key={t.value} value={t.value} className=\"mt-3\">\n {t.content}\n </TabsContent>\n ))}\n </Tabs>\n )\n}\n","import { useEffect, type RefObject } from 'react'\n\nexport interface UseDismissibleCardOptions {\n isOpen: boolean\n onClose: () => void\n /** The card's content: clicks inside never dismiss. */\n contentRef: RefObject<HTMLElement | null>\n /** Focused when the card opens (the panel is opened to find something: typing just works). */\n focusRef?: RefObject<HTMLElement | null>\n}\n\n/**\n * Behaviour of a click-opened card: focus its search box on open, Escape closes it, and a press\n * outside it (or outside any portaled popper that belongs to it, e.g. a dropdown menu opened from\n * inside) closes it too. Bound only while open.\n */\nexport function useDismissibleCard({\n isOpen,\n onClose,\n contentRef,\n focusRef,\n}: UseDismissibleCardOptions): void {\n // rAF lets the portaled content mount before focusing.\n useEffect(() => {\n if (!isOpen) return\n const id = requestAnimationFrame(() => focusRef?.current?.focus())\n return () => cancelAnimationFrame(id)\n }, [isOpen, focusRef])\n\n useEffect(() => {\n if (!isOpen) return\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Escape') return\n e.stopPropagation()\n onClose()\n }\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [isOpen, onClose])\n\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (e: MouseEvent) => {\n const target = e.target as HTMLElement | null\n if (!target) return\n if (contentRef.current?.contains(target)) return\n if (target.closest('[data-radix-popper-content-wrapper]')) return\n onClose()\n }\n document.addEventListener('mousedown', onPointerDown)\n return () => document.removeEventListener('mousedown', onPointerDown)\n }, [isOpen, onClose, contentRef])\n}\n","import { Tag as TagIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface PinnableLabel {\n id: string\n name: string\n /** The label's own colour (any CSS colour): the same hue everywhere the label appears. */\n color: string\n /** Ids of the items carrying this label. */\n itemIds: string[]\n}\n\nexport interface LabelPinRowLabels {\n remove: (count: number, name: string) => string\n add: (count: number, name: string) => string\n}\n\nexport const DEFAULT_LABEL_PIN_ROW_LABELS: LabelPinRowLabels = {\n remove: (count, name) => `Remove the ${count} “${name}” item(s) from this chat`,\n add: (count, name) => `Add the ${count} “${name}” item(s) to this chat`,\n}\n\nexport interface LabelPinRowProps {\n labels: PinnableLabel[]\n /** Ids currently in the conversation. */\n selectedIds: string[]\n /** Add every id (already de-duplicated against the chat). */\n onAdd: (ids: string[]) => void\n /** Remove every id. */\n onRemove: (ids: string[]) => void\n testId?: string\n copy?: Partial<LabelPinRowLabels>\n}\n\n/**\n * Label shortcuts inside the in-chat panels: one chip per label in use; clicking it pins\n * everything carrying that label. A chip whose items are ALL in the chat reads as active and\n * clicking it takes them back out, so a label is a toggle rather than a one-way add.\n */\nexport function LabelPinRow({\n labels,\n selectedIds,\n onAdd,\n onRemove,\n testId = 'label-pin-row',\n copy,\n}: LabelPinRowProps) {\n const l = { ...DEFAULT_LABEL_PIN_ROW_LABELS, ...copy }\n const usable = labels.filter((label) => label.itemIds.length > 0)\n if (usable.length === 0) return null\n\n const selectedSet = new Set(selectedIds)\n\n return (\n <div\n className=\"flex flex-wrap items-center gap-1\"\n data-slot=\"label-pin-row\"\n data-testid={testId}\n >\n <TagIcon className=\"size-3.5 shrink-0 text-muted-foreground\" aria-hidden />\n {usable.map((label) => {\n const allIn = label.itemIds.every((id) => selectedSet.has(id))\n return (\n <button\n key={label.id}\n type=\"button\"\n aria-pressed={allIn}\n title={\n allIn\n ? l.remove(label.itemIds.length, label.name)\n : l.add(label.itemIds.length, label.name)\n }\n onClick={() =>\n allIn\n ? onRemove(label.itemIds)\n : onAdd(label.itemIds.filter((id) => !selectedSet.has(id)))\n }\n className={cn(\n 'flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n allIn ? 'text-white' : 'bg-muted text-foreground hover:brightness-95'\n )}\n // Pinned reads as the label filled in with its own colour; at rest it's the muted\n // pill with the colour on the dot, matching the label pills on documents and facts.\n style={\n allIn\n ? { backgroundColor: label.color, borderColor: label.color }\n : { borderColor: `${label.color}66` }\n }\n data-testid={`${testId}-${label.id}`}\n >\n {!allIn && (\n <span\n className=\"size-1.5 shrink-0 rounded-full\"\n style={{ backgroundColor: label.color }}\n aria-hidden\n />\n )}\n <span className=\"max-w-[120px] truncate\">{label.name}</span>\n <span className=\"tabular-nums opacity-70\">{label.itemIds.length}</span>\n </button>\n )\n })}\n </div>\n )\n}\n","import { Toaster, type ShellToasterProps } from '../shell/Toaster'\nimport { useAssistantDock } from './AssistantDock'\nimport { useChatSurface } from './chat-surface'\n\nexport type AssistantToasterProps = Omit<ShellToasterProps, 'dockOpen'>\n\n/**\n * The shell `Toaster` wired to the assistant dock: while the dock is open (and offered: a mounted\n * page chat hides it) a right-aligned toast stack slides clear of it. Pass `dockWidth` when the\n * `AssistantDock` has a custom `width`.\n */\nexport function AssistantToaster(props: AssistantToasterProps) {\n const dock = useAssistantDock()\n const { isDockAvailable } = useChatSurface()\n return <Toaster {...props} dockOpen={dock.isOpen && isDockAvailable} />\n}\n"]}
1
+ {"version":3,"sources":["../src/chat/PinnedDocChip.tsx","../src/chat/ContextPanel.tsx","../src/lib/useDismissibleCard.ts","../src/chat/LabelPinRow.tsx","../src/chat/AssistantToaster.tsx"],"names":["ContextPanelContent","jsx","cn","jsxs","ContextSearchInput","ContextActionButton","TagIcon"],"mappings":";;;;;;;;AAUO,IAAM,8BAAA,GAAsD;AAAA,EACjE,KAAA,EAAO,OAAA;AAAA,EACP,aAAA,EAAe,CAAC,KAAA,KAAU,CAAA,MAAA,EAAS,KAAK,CAAA;AAC1C;AAiBO,SAAS,aAAA,CAAc;AAAA,EAC5B,KAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA,GAAS;AACX,CAAA,EAAuB;AACrB,EAAA,MAAM,CAAA,GAAI,EAAE,GA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,OAAA,EAAA,EAAS,GAAG,OAAO,QAAA,EAAU,IAAA,CAAK,UAAU,eAAA,EAAiB,CAAA;AACvE","file":"chunk-UO3FS6ZF.js","sourcesContent":["import { Pin, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\n/** Every fixed string of the chip. Pass a partial `labels` to translate or reword. */\nexport interface PinnedDocChipLabels {\n unpin: string\n /** Accessible name; `title` is the pinned document's name. */\n unpinDocument: (title: string) => string\n}\n\nexport const DEFAULT_PINNED_DOC_CHIP_LABELS: PinnedDocChipLabels = {\n unpin: 'Unpin',\n unpinDocument: (title) => `Unpin ${title}`,\n}\n\nexport interface PinnedDocChipProps {\n title: string\n onUnpin: () => void\n className?: string\n labels?: Partial<PinnedDocChipLabels>\n testId?: string\n}\n\n/**\n * The pinned-document chip that lives inside a composer's attach button: shows which document\n * holds the full-context pin and unpins it in ONE tap (the X is always visible, so touch and\n * keyboard reach it). It is a span with button semantics because it sits inside the attach\n * `<button>`, where nested buttons are invalid; `stopPropagation` keeps the tap from also\n * triggering the parent.\n */\nexport function PinnedDocChip({\n title,\n onUnpin,\n className,\n labels,\n testId = 'unpin-document-button',\n}: PinnedDocChipProps) {\n const l = { ...DEFAULT_PINNED_DOC_CHIP_LABELS, ...labels }\n return (\n <span\n role=\"button\"\n tabIndex={0}\n data-slot=\"pinned-doc-chip\"\n onClick={(e) => {\n e.stopPropagation()\n onUnpin()\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.stopPropagation()\n onUnpin()\n }\n }}\n title={l.unpin}\n aria-label={l.unpinDocument(title)}\n className={cn(\n '-mx-0.5 flex min-w-0 items-center gap-1 rounded-sm px-1 text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className\n )}\n data-testid={testId}\n >\n <Pin className=\"h-3 w-3 shrink-0 fill-primary\" />\n <X className=\"order-last h-3 w-3 shrink-0 text-muted-foreground\" />\n <span className=\"truncate text-sm\">{title}</span>\n </span>\n )\n}\n","import {\n forwardRef,\n Fragment,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type MouseEventHandler,\n type ReactNode,\n} from 'react'\nimport { Check, CheckCircle, Search } from 'lucide-react'\nimport {\n Badge,\n Button,\n HoverCardContent,\n Input,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n type ButtonProps,\n} from '@arbidocs/react/ui'\n\n/**\n * Parts of the composer's \"in this chat\" panels (files, facts): a card that opens upward from the\n * composer, a grouped pick list, and below it the labels, search and bulk actions.\n */\n\n/** The card itself: width follows the chat input (`--chat-input-width`), bounded on small screens. */\nexport const ContextPanelContent = forwardRef<\n ElementRef<typeof HoverCardContent>,\n ComponentPropsWithoutRef<typeof HoverCardContent>\n>(function ContextPanelContent({ className, onClick, ...props }, ref) {\n return (\n <HoverCardContent\n ref={ref}\n side=\"top\"\n align=\"start\"\n data-slot=\"context-panel\"\n // Clicks inside must not bubble (via the React portal) to a click-to-toggle wrapper.\n onClick={(e) => {\n e.stopPropagation()\n onClick?.(e)\n }}\n className={cn(\n 'w-[var(--chat-input-width,var(--radix-hover-card-content-available-width))] max-h-[var(--radix-hover-card-content-available-height)] max-w-[95vw] overflow-y-auto overscroll-contain rounded-md border border-border bg-muted p-3 shadow-lg',\n className\n )}\n {...props}\n />\n )\n})\n\nexport interface ContextPickerGroup {\n key: string\n heading: string\n /** Id of the heading element. */\n testId?: string\n /** Shown after the heading as `(n)`. */\n count: number\n children: ReactNode\n}\n\nexport interface ContextPickerListProps {\n groups: ContextPickerGroup[]\n /** Shown instead of the groups when every group is empty. */\n emptyText: string\n testId: string\n className?: string\n}\n\n/**\n * Two (or more) headed groups, e.g. \"In this conversation\" then \"In this workspace\". Each heading\n * pins to the top of the scroller and is pushed out by the next one; the second parks below the\n * first (32px = a heading's own height), so both stay visible however far down you scroll.\n */\nexport function ContextPickerList({\n groups,\n emptyText,\n testId,\n className,\n}: ContextPickerListProps) {\n const isEmpty = groups.every((g) => g.count === 0)\n return (\n <div\n className={cn('max-h-[400px] space-y-1 overflow-y-auto', className)}\n data-slot=\"context-picker-list\"\n data-testid={testId}\n onClick={(e) => e.stopPropagation()}\n >\n {isEmpty ? (\n <p className=\"p-2 text-sm text-muted-foreground\">{emptyText}</p>\n ) : (\n groups.map((g, index) => (\n <Fragment key={g.key}>\n <div\n className={cn(\n 'sticky z-10 bg-muted px-2 py-1.5 text-sm font-medium text-muted-foreground',\n index === 0 ? 'top-0' : 'top-8'\n )}\n data-testid={g.testId}\n >\n {g.heading} ({g.count})\n </div>\n {g.children}\n </Fragment>\n ))\n )}\n </div>\n )\n}\n\nfunction CheckGlyph({ isChecked, className }: { isChecked: boolean; className?: string }) {\n return (\n <span\n className={cn(\n 'flex size-3.5 shrink-0 items-center justify-center rounded-sm border',\n isChecked ? 'border-primary bg-primary text-primary-foreground' : 'border-input',\n className\n )}\n >\n {isChecked && <Check className=\"size-3\" />}\n </span>\n )\n}\n\nexport interface ContextPickerRowProps {\n isSelected: boolean\n onToggle: () => void\n testId?: string\n children: ReactNode\n}\n\n/** A whole-row toggle (e.g. a fact): check glyph then clamped text. */\nexport function ContextPickerRow({\n isSelected,\n onToggle,\n testId,\n children,\n}: ContextPickerRowProps) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onToggle()\n }}\n aria-pressed={isSelected}\n data-testid={testId}\n className={cn(\n 'flex w-full items-start gap-2 rounded p-2 text-left text-sm transition-colors pointer-coarse:min-h-11',\n isSelected ? 'bg-primary/10' : 'bg-card hover:bg-muted'\n )}\n >\n <CheckGlyph isChecked={isSelected} className=\"mt-0.5\" />\n <span className=\"line-clamp-2 min-w-0 text-foreground\">{children}</span>\n </button>\n )\n}\n\nexport interface ContextCheckRowProps {\n isSelected: boolean\n /** The check toggle: accessible name (e.g. \"Add to conversation\"), handler and test id. */\n toggle: { label: string; onToggle: () => void; testId?: string }\n /** Status glyph between the toggle and the content. */\n status?: ReactNode\n testId?: string\n /** The row's content (e.g. a document pill that opens the document). */\n children: ReactNode\n}\n\n/** A row with its own check toggle plus a content slot (e.g. a document, which opens on click). */\nexport function ContextCheckRow({\n isSelected,\n toggle,\n status,\n testId,\n children,\n}: ContextCheckRowProps) {\n return (\n <div\n className=\"flex items-center gap-2 rounded px-1 py-0.5\"\n data-slot=\"context-check-row\"\n data-testid={testId}\n >\n <button\n type=\"button\"\n aria-label={toggle.label}\n aria-pressed={isSelected}\n onClick={toggle.onToggle}\n data-testid={toggle.testId}\n className=\"flex shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11\"\n >\n <CheckGlyph isChecked={isSelected} />\n </button>\n {status}\n {children}\n </div>\n )\n}\n\nexport interface ContextSelectListProps {\n children: ReactNode\n}\n\n/** Compact single-select list (e.g. choose the document to pin). */\nexport function ContextSelectList({ children }: ContextSelectListProps) {\n return <div className=\"max-h-[150px] space-y-2 overflow-y-auto\">{children}</div>\n}\n\nexport interface ContextSelectRowProps {\n isSelected: boolean\n onSelect: MouseEventHandler<HTMLButtonElement>\n status?: ReactNode\n title: string\n testId?: string\n}\n\nexport function ContextSelectRow({\n isSelected,\n onSelect,\n status,\n title,\n testId,\n}: ContextSelectRowProps) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onSelect(e)\n }}\n aria-pressed={isSelected}\n data-testid={testId}\n className={cn(\n 'flex w-full items-center gap-2 rounded p-2 text-left text-sm transition-colors pointer-coarse:min-h-11',\n isSelected ? 'border border-primary/30 bg-primary/10' : 'bg-card hover:bg-muted'\n )}\n >\n {status}\n <span className=\"min-w-0 flex-1 truncate text-foreground\" title={title}>\n {title}\n </span>\n {isSelected && <CheckCircle className=\"size-3.5 shrink-0 text-primary\" />}\n </button>\n )\n}\n\nexport interface ContextPanelFooterProps {\n /** Label shortcut chips (host-supplied row). */\n labels?: ReactNode\n /** The search box. */\n search: ReactNode\n /** Icon + title of the panel; omit when tabs already name it. */\n title?: ReactNode\n /** The action buttons, right aligned. */\n actions: ReactNode\n}\n\n/** Everything below the list: the panel opens upward, so its controls sit nearest the button. */\nexport function ContextPanelFooter({ labels, search, title, actions }: ContextPanelFooterProps) {\n return (\n <div className=\"mt-3 space-y-2 border-t border-border pt-3\" data-slot=\"context-panel-footer\">\n {labels}\n {search}\n <div\n className={cn(\n 'flex flex-wrap items-center gap-x-2 gap-y-1.5',\n title ? 'justify-between' : 'justify-end'\n )}\n >\n {title && (\n <div className=\"flex min-w-0 items-center gap-2 text-sm font-medium text-foreground\">\n {title}\n </div>\n )}\n <div className=\"flex flex-wrap items-center gap-1.5\">{actions}</div>\n </div>\n </div>\n )\n}\n\nexport const ContextSearchInput = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof Input>\n>(function ContextSearchInput({ className, onClick, ...props }, ref) {\n return (\n <div className=\"relative\" onClick={(e) => e.stopPropagation()}>\n <Search className=\"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground\" />\n <Input\n ref={ref}\n className={cn('h-7 bg-background pl-7 text-sm', className)}\n onClick={onClick}\n {...props}\n />\n </div>\n )\n})\n\nexport interface ContextActionButtonProps extends Omit<ButtonProps, 'size'> {\n icon?: ReactNode\n /** Badge after the label; hidden at 0 / undefined. */\n count?: number\n /** Put the icon after the label (bulk Add / Remove) rather than before it. */\n isIconTrailing?: boolean\n}\n\n/** Compact action of the panel footer (stops click propagation so the card stays open). */\nexport const ContextActionButton = forwardRef<HTMLButtonElement, ContextActionButtonProps>(\n function ContextActionButton(\n { icon, count, isIconTrailing, onClick, children, className, variant = 'outline', ...props },\n ref\n ) {\n return (\n <Button\n ref={ref}\n variant={variant}\n size=\"sm\"\n className={cn('flex h-6 items-center gap-1 px-2 text-sm pointer-coarse:h-11', className)}\n onClick={(e) => {\n e.stopPropagation()\n onClick?.(e)\n }}\n {...props}\n >\n {!isIconTrailing && icon}\n {children}\n {isIconTrailing && icon}\n {count != null && count > 0 && (\n <Badge variant=\"outline\" className=\"badge-count ml-1\">\n {count}\n </Badge>\n )}\n </Button>\n )\n }\n)\n\nexport interface ContextTab {\n value: string\n /** Visible tab name, e.g. \"Documents\". */\n label: string\n /** Count shown in the tab label. */\n count: number\n testId?: string\n content: ReactNode\n}\n\nexport interface ContextPanelTabsProps {\n tabs: ContextTab[]\n value: string\n onValueChange: (value: string) => void\n testId?: string\n /** Extra classes for the tab strip (e.g. leave room for a sheet's close button). */\n listClassName?: string\n}\n\n/** The panel's tab strip (Radix tabs: roving tabindex, arrow keys) and the active tab's content. */\nexport function ContextPanelTabs({\n tabs,\n value,\n onValueChange,\n testId,\n listClassName,\n}: ContextPanelTabsProps) {\n return (\n <Tabs value={value} onValueChange={onValueChange} data-testid={testId}>\n <TabsList\n className={cn('grid h-auto w-full grid-cols-2 pointer-coarse:h-auto', listClassName)}\n >\n {tabs.map((t) => (\n <TabsTrigger key={t.value} value={t.value} data-testid={t.testId} className=\"gap-1.5\">\n {t.label}\n <Badge variant=\"outline\" className=\"badge-count\">\n {t.count}\n </Badge>\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t) => (\n <TabsContent key={t.value} value={t.value} className=\"mt-3\">\n {t.content}\n </TabsContent>\n ))}\n </Tabs>\n )\n}\n","import { useEffect, type RefObject } from 'react'\n\nexport interface UseDismissibleCardOptions {\n isOpen: boolean\n onClose: () => void\n /** The card's content: clicks inside never dismiss. */\n contentRef: RefObject<HTMLElement | null>\n /** Focused when the card opens (the panel is opened to find something: typing just works). */\n focusRef?: RefObject<HTMLElement | null>\n}\n\n/**\n * Behaviour of a click-opened card: focus its search box on open, Escape closes it, and a press\n * outside it (or outside any portaled popper that belongs to it, e.g. a dropdown menu opened from\n * inside) closes it too. Bound only while open.\n */\nexport function useDismissibleCard({\n isOpen,\n onClose,\n contentRef,\n focusRef,\n}: UseDismissibleCardOptions): void {\n // rAF lets the portaled content mount before focusing.\n useEffect(() => {\n if (!isOpen) return\n const id = requestAnimationFrame(() => focusRef?.current?.focus())\n return () => cancelAnimationFrame(id)\n }, [isOpen, focusRef])\n\n useEffect(() => {\n if (!isOpen) return\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Escape') return\n e.stopPropagation()\n onClose()\n }\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [isOpen, onClose])\n\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (e: MouseEvent) => {\n const target = e.target as HTMLElement | null\n if (!target) return\n if (contentRef.current?.contains(target)) return\n if (target.closest('[data-radix-popper-content-wrapper]')) return\n onClose()\n }\n document.addEventListener('mousedown', onPointerDown)\n return () => document.removeEventListener('mousedown', onPointerDown)\n }, [isOpen, onClose, contentRef])\n}\n","import { Tag as TagIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface PinnableLabel {\n id: string\n name: string\n /** The label's own colour (any CSS colour): the same hue everywhere the label appears. */\n color: string\n /** Ids of the items carrying this label. */\n itemIds: string[]\n}\n\nexport interface LabelPinRowLabels {\n remove: (count: number, name: string) => string\n add: (count: number, name: string) => string\n}\n\nexport const DEFAULT_LABEL_PIN_ROW_LABELS: LabelPinRowLabels = {\n remove: (count, name) => `Remove the ${count} “${name}” item(s) from this chat`,\n add: (count, name) => `Add the ${count} “${name}” item(s) to this chat`,\n}\n\nexport interface LabelPinRowProps {\n labels: PinnableLabel[]\n /** Ids currently in the conversation. */\n selectedIds: string[]\n /** Add every id (already de-duplicated against the chat). */\n onAdd: (ids: string[]) => void\n /** Remove every id. */\n onRemove: (ids: string[]) => void\n testId?: string\n copy?: Partial<LabelPinRowLabels>\n}\n\n/**\n * Label shortcuts inside the in-chat panels: one chip per label in use; clicking it pins\n * everything carrying that label. A chip whose items are ALL in the chat reads as active and\n * clicking it takes them back out, so a label is a toggle rather than a one-way add.\n */\nexport function LabelPinRow({\n labels,\n selectedIds,\n onAdd,\n onRemove,\n testId = 'label-pin-row',\n copy,\n}: LabelPinRowProps) {\n const l = { ...DEFAULT_LABEL_PIN_ROW_LABELS, ...copy }\n const usable = labels.filter((label) => label.itemIds.length > 0)\n if (usable.length === 0) return null\n\n const selectedSet = new Set(selectedIds)\n\n return (\n <div\n className=\"flex flex-wrap items-center gap-1\"\n data-slot=\"label-pin-row\"\n data-testid={testId}\n >\n <TagIcon className=\"size-3.5 shrink-0 text-muted-foreground\" aria-hidden />\n {usable.map((label) => {\n const allIn = label.itemIds.every((id) => selectedSet.has(id))\n return (\n <button\n key={label.id}\n type=\"button\"\n aria-pressed={allIn}\n title={\n allIn\n ? l.remove(label.itemIds.length, label.name)\n : l.add(label.itemIds.length, label.name)\n }\n onClick={() =>\n allIn\n ? onRemove(label.itemIds)\n : onAdd(label.itemIds.filter((id) => !selectedSet.has(id)))\n }\n className={cn(\n 'flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n allIn ? 'text-white' : 'bg-muted text-foreground hover:brightness-95'\n )}\n // Pinned reads as the label filled in with its own colour; at rest it's the muted\n // pill with the colour on the dot, matching the label pills on documents and facts.\n style={\n allIn\n ? { backgroundColor: label.color, borderColor: label.color }\n : { borderColor: `${label.color}66` }\n }\n data-testid={`${testId}-${label.id}`}\n >\n {!allIn && (\n <span\n className=\"size-1.5 shrink-0 rounded-full\"\n style={{ backgroundColor: label.color }}\n aria-hidden\n />\n )}\n <span className=\"max-w-[120px] truncate\">{label.name}</span>\n <span className=\"tabular-nums opacity-70\">{label.itemIds.length}</span>\n </button>\n )\n })}\n </div>\n )\n}\n","import { Toaster, type ShellToasterProps } from '../shell/Toaster'\nimport { useAssistantDock } from './AssistantDock'\nimport { useChatSurface } from './chat-surface'\n\nexport type AssistantToasterProps = Omit<ShellToasterProps, 'dockOpen'>\n\n/**\n * The shell `Toaster` wired to the assistant dock: while the dock is open (and offered: a mounted\n * page chat hides it) a right-aligned toast stack slides clear of it. Pass `dockWidth` when the\n * `AssistantDock` has a custom `width`.\n */\nexport function AssistantToaster(props: AssistantToasterProps) {\n const dock = useAssistantDock()\n const { isDockAvailable } = useChatSurface()\n return <Toaster {...props} dockOpen={dock.isOpen && isDockAvailable} />\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { useConnectedThreadActivity, useSelectWorkspace } from './chunk-CRHY7DBO.js';
3
3
  import { DocumentUser } from './chunk-UO7KDCM2.js';
4
- import { MessageJsonTree } from './chunk-ZZTH27G7.js';
5
4
  import { buildFactCitations, citedVersionRef, chronologyFactBodies } from './chunk-KGUSKGZE.js';
5
+ import { MessageJsonTree } from './chunk-ZZTH27G7.js';
6
6
  import { ConnectedMarkdown, InternalDocLink, ExternalLink } from './chunk-HGFU47TY.js';
7
7
  import { ModalBreadcrumbHeader, ModalCrumbs } from './chunk-RC6VTY2H.js';
8
8
  import { EntityTooltip, EntityTooltipHeader, EntityTooltipSection, EntityTooltipHint } from './chunk-3UIJLUXN.js';
@@ -3301,5 +3301,5 @@ function ArbiChat({ apiUrl, deploymentDomain, ...props }) {
3301
3301
  }
3302
3302
 
3303
3303
  export { AgentSteps, AnswerTable, ArbiChat, AskAgainContext, CompactLogin, ConnectedBranchControls, ConnectedCitationRenderer, ConnectedCompactConversation, ConnectedConversationDocumentPicker, ConnectedEmbeddedChat, ConnectedMessage, ConnectedMessageArea, ConnectedMessageList, ConnectedThreadsPreview, ConnectedUserEntity, ConversationComposer2 as ConversationComposer, EmbeddedChatPanel, MessageDetailsModal, MessageLiveSeconds, RunningSubagents, SourceChips, WorkflowStepMessage, backUpOnSignup, completeSsoSignIn, defaultHost, renderConnectedUser, resolveSsoName, ssoAccountStatus, useAuthPages, useLoginActions, useLoginForm, useOpenChunk, useOpenWorkspaceIcon, useRegisterSubmitState, useSlashItems, useSsoSignIn, useWorkspaceDocTitles };
3304
- //# sourceMappingURL=chunk-BELZ2WD2.js.map
3305
- //# sourceMappingURL=chunk-BELZ2WD2.js.map
3304
+ //# sourceMappingURL=chunk-W5D5GFP2.js.map
3305
+ //# sourceMappingURL=chunk-W5D5GFP2.js.map