@arbidocs/blocks 0.5.58 → 0.5.60

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 (210) hide show
  1. package/README.md +40 -0
  2. package/dist/{ConnectedCallDock-SWDSHWTE.cjs → ConnectedCallDock-NEXHEXVL.cjs} +9 -9
  3. package/dist/{ConnectedCallDock-SWDSHWTE.cjs.map → ConnectedCallDock-NEXHEXVL.cjs.map} +1 -1
  4. package/dist/{ConnectedCallDock-HFQNXBH2.js → ConnectedCallDock-PMCWZXCO.js} +8 -8
  5. package/dist/{ConnectedCallDock-HFQNXBH2.js.map → ConnectedCallDock-PMCWZXCO.js.map} +1 -1
  6. package/dist/{ConnectedCallRoom-JOUQ5SM5.cjs → ConnectedCallRoom-GE2TMDIL.cjs} +9 -9
  7. package/dist/{ConnectedCallRoom-JOUQ5SM5.cjs.map → ConnectedCallRoom-GE2TMDIL.cjs.map} +1 -1
  8. package/dist/{ConnectedCallRoom-EGPYH7XF.js → ConnectedCallRoom-RJZT5ZUA.js} +8 -8
  9. package/dist/{ConnectedCallRoom-EGPYH7XF.js.map → ConnectedCallRoom-RJZT5ZUA.js.map} +1 -1
  10. package/dist/{ConnectedDocumentViewer-PGFWDHBI.cjs → ConnectedDocumentViewer-2KDPYQDT.cjs} +14 -13
  11. package/dist/{ConnectedDocumentViewer-PGFWDHBI.cjs.map → ConnectedDocumentViewer-2KDPYQDT.cjs.map} +1 -1
  12. package/dist/{ConnectedDocumentViewer-KIZCVZXV.js → ConnectedDocumentViewer-GYLXZV72.js} +13 -12
  13. package/dist/{ConnectedDocumentViewer-KIZCVZXV.js.map → ConnectedDocumentViewer-GYLXZV72.js.map} +1 -1
  14. package/dist/{ConnectedNativeDocxComparison-XJ66AM6C.cjs → ConnectedNativeDocxComparison-2OC37MR5.cjs} +8 -8
  15. package/dist/ConnectedNativeDocxComparison-2OC37MR5.cjs.map +1 -0
  16. package/dist/{ConnectedNativeDocxComparison-NGS4IMUZ.js → ConnectedNativeDocxComparison-7PD2LD7L.js} +7 -7
  17. package/dist/ConnectedNativeDocxComparison-7PD2LD7L.js.map +1 -0
  18. package/dist/{ConnectedNativeDocxEditor-23O5EH7F.cjs → ConnectedNativeDocxEditor-FPIX7SWU.cjs} +8 -8
  19. package/dist/ConnectedNativeDocxEditor-FPIX7SWU.cjs.map +1 -0
  20. package/dist/{ConnectedNativeDocxEditor-MJUFY74T.js → ConnectedNativeDocxEditor-UMENIC3E.js} +6 -6
  21. package/dist/ConnectedNativeDocxEditor-UMENIC3E.js.map +1 -0
  22. package/dist/{ConnectedStreamedWordArtifact-567Q2AOX.cjs → ConnectedStreamedWordArtifact-3UZN4UHY.cjs} +8 -8
  23. package/dist/ConnectedStreamedWordArtifact-3UZN4UHY.cjs.map +1 -0
  24. package/dist/{ConnectedStreamedWordArtifact-VWG2BXSW.js → ConnectedStreamedWordArtifact-K7HVTZIG.js} +7 -7
  25. package/dist/ConnectedStreamedWordArtifact-K7HVTZIG.js.map +1 -0
  26. package/dist/{DocumentReviewCard-4KB66DX4.cjs → DocumentReviewCard-B3RRCJBD.cjs} +5 -5
  27. package/dist/{DocumentReviewCard-4KB66DX4.cjs.map → DocumentReviewCard-B3RRCJBD.cjs.map} +1 -1
  28. package/dist/{DocumentReviewCard-AKIBUBPA.js → DocumentReviewCard-RPETGTSK.js} +5 -5
  29. package/dist/{DocumentReviewCard-AKIBUBPA.js.map → DocumentReviewCard-RPETGTSK.js.map} +1 -1
  30. package/dist/{WorkspaceTableView-ZXIW3MQ5.cjs → WorkspaceTableView-2XRSJECY.cjs} +8 -8
  31. package/dist/{WorkspaceTableView-ZXIW3MQ5.cjs.map → WorkspaceTableView-2XRSJECY.cjs.map} +1 -1
  32. package/dist/{WorkspaceTableView-3VP56J6F.js → WorkspaceTableView-F4QG4226.js} +6 -6
  33. package/dist/{WorkspaceTableView-3VP56J6F.js.map → WorkspaceTableView-F4QG4226.js.map} +1 -1
  34. package/dist/agents/index.cjs +341 -341
  35. package/dist/agents/index.js +5 -5
  36. package/dist/calendar/index.cjs +116 -116
  37. package/dist/calendar/index.js +1 -1
  38. package/dist/calls/index.cjs +2 -2
  39. package/dist/calls/index.js +2 -2
  40. package/dist/chat/index.cjs +82 -82
  41. package/dist/chat/index.js +5 -5
  42. package/dist/chunk-34HQO4ZQ.cjs +72 -0
  43. package/dist/chunk-34HQO4ZQ.cjs.map +1 -0
  44. package/dist/{chunk-EQ3WRY2N.js → chunk-3EWS6ECM.js} +9 -6
  45. package/dist/chunk-3EWS6ECM.js.map +1 -0
  46. package/dist/{chunk-Y564AOO6.js → chunk-6HMWZY3U.js} +3 -3
  47. package/dist/{chunk-Y564AOO6.js.map → chunk-6HMWZY3U.js.map} +1 -1
  48. package/dist/{chunk-FB6DTNMF.cjs → chunk-6TMA6MPT.cjs} +8 -8
  49. package/dist/{chunk-FB6DTNMF.cjs.map → chunk-6TMA6MPT.cjs.map} +1 -1
  50. package/dist/{chunk-WIW3XGHO.js → chunk-75Z5AUMM.js} +3 -3
  51. package/dist/{chunk-WIW3XGHO.js.map → chunk-75Z5AUMM.js.map} +1 -1
  52. package/dist/{chunk-4TCJDGIM.js → chunk-7EOO6ZCK.js} +3 -3
  53. package/dist/{chunk-4TCJDGIM.js.map → chunk-7EOO6ZCK.js.map} +1 -1
  54. package/dist/{chunk-AJCMN23Q.js → chunk-AGDOBXHY.js} +3 -3
  55. package/dist/{chunk-AJCMN23Q.js.map → chunk-AGDOBXHY.js.map} +1 -1
  56. package/dist/{chunk-E5RN3LWS.js → chunk-AWVGKHJT.js} +2 -2
  57. package/dist/{chunk-E5RN3LWS.js.map → chunk-AWVGKHJT.js.map} +1 -1
  58. package/dist/{chunk-4TQGWQHK.js → chunk-B63TSC3W.js} +96 -5
  59. package/dist/chunk-B63TSC3W.js.map +1 -0
  60. package/dist/{chunk-HC4GCNCQ.js → chunk-B7XMGAWP.js} +3 -32
  61. package/dist/chunk-B7XMGAWP.js.map +1 -0
  62. package/dist/{chunk-I5BYLF6V.cjs → chunk-BSITLJMQ.cjs} +4 -4
  63. package/dist/{chunk-I5BYLF6V.cjs.map → chunk-BSITLJMQ.cjs.map} +1 -1
  64. package/dist/{chunk-K3B3V6EA.js → chunk-CYECDWVY.js} +3 -3
  65. package/dist/{chunk-K3B3V6EA.js.map → chunk-CYECDWVY.js.map} +1 -1
  66. package/dist/{chunk-C3FVQIBJ.js → chunk-DP7XGB2D.js} +3 -3
  67. package/dist/{chunk-C3FVQIBJ.js.map → chunk-DP7XGB2D.js.map} +1 -1
  68. package/dist/{chunk-K7OBYDUO.cjs → chunk-ECJOIWF4.cjs} +52 -14
  69. package/dist/chunk-ECJOIWF4.cjs.map +1 -0
  70. package/dist/{chunk-AMZNWDTN.cjs → chunk-GCMNPIKB.cjs} +6 -6
  71. package/dist/{chunk-AMZNWDTN.cjs.map → chunk-GCMNPIKB.cjs.map} +1 -1
  72. package/dist/{chunk-4MSQJ6GX.js → chunk-GYONAUKV.js} +8 -8
  73. package/dist/{chunk-4MSQJ6GX.js.map → chunk-GYONAUKV.js.map} +1 -1
  74. package/dist/chunk-IRPDQJNT.js +70 -0
  75. package/dist/chunk-IRPDQJNT.js.map +1 -0
  76. package/dist/{chunk-Q5BWRMET.cjs → chunk-IZXJTVOS.cjs} +44 -7
  77. package/dist/chunk-IZXJTVOS.cjs.map +1 -0
  78. package/dist/{chunk-JFNF6HTE.cjs → chunk-J2A7LVTM.cjs} +67 -67
  79. package/dist/{chunk-JFNF6HTE.cjs.map → chunk-J2A7LVTM.cjs.map} +1 -1
  80. package/dist/{chunk-HIDCHFFI.js → chunk-JLR67BW2.js} +46 -10
  81. package/dist/chunk-JLR67BW2.js.map +1 -0
  82. package/dist/{chunk-OMWOPRQR.cjs → chunk-JZ4LN4Q6.cjs} +3 -3
  83. package/dist/{chunk-OMWOPRQR.cjs.map → chunk-JZ4LN4Q6.cjs.map} +1 -1
  84. package/dist/{chunk-SUW7USWW.js → chunk-L4JJKGUD.js} +3 -3
  85. package/dist/{chunk-SUW7USWW.js.map → chunk-L4JJKGUD.js.map} +1 -1
  86. package/dist/{chunk-2LK27F43.cjs → chunk-LVC4ZGYW.cjs} +17 -17
  87. package/dist/{chunk-2LK27F43.cjs.map → chunk-LVC4ZGYW.cjs.map} +1 -1
  88. package/dist/{chunk-HXAWPMRJ.cjs → chunk-LXKALYOS.cjs} +5 -5
  89. package/dist/{chunk-HXAWPMRJ.cjs.map → chunk-LXKALYOS.cjs.map} +1 -1
  90. package/dist/{chunk-TM2D4XT4.cjs → chunk-MZZ3SBQL.cjs} +9 -6
  91. package/dist/chunk-MZZ3SBQL.cjs.map +1 -0
  92. package/dist/{chunk-RJ7753W5.js → chunk-NMU723IY.js} +5 -5
  93. package/dist/{chunk-RJ7753W5.js.map → chunk-NMU723IY.js.map} +1 -1
  94. package/dist/{chunk-T2DUORCT.cjs → chunk-NUAG57PG.cjs} +18 -18
  95. package/dist/{chunk-T2DUORCT.cjs.map → chunk-NUAG57PG.cjs.map} +1 -1
  96. package/dist/{chunk-ICQWNUDD.js → chunk-NXSPX7AP.js} +3 -3
  97. package/dist/{chunk-ICQWNUDD.js.map → chunk-NXSPX7AP.js.map} +1 -1
  98. package/dist/{chunk-N27CI32R.cjs → chunk-OM5IVNEW.cjs} +7 -7
  99. package/dist/{chunk-N27CI32R.cjs.map → chunk-OM5IVNEW.cjs.map} +1 -1
  100. package/dist/{chunk-I3BF67WQ.cjs → chunk-Q5GFVDFM.cjs} +9 -9
  101. package/dist/{chunk-I3BF67WQ.cjs.map → chunk-Q5GFVDFM.cjs.map} +1 -1
  102. package/dist/{chunk-ELY7WGBN.js → chunk-QCDS3ZCF.js} +3 -3
  103. package/dist/{chunk-ELY7WGBN.js.map → chunk-QCDS3ZCF.js.map} +1 -1
  104. package/dist/{chunk-VEMJON3H.cjs → chunk-QUTIWGWO.cjs} +3 -3
  105. package/dist/{chunk-VEMJON3H.cjs.map → chunk-QUTIWGWO.cjs.map} +1 -1
  106. package/dist/{chunk-PPXY4F3C.js → chunk-R6UKY6NA.js} +5 -5
  107. package/dist/{chunk-PPXY4F3C.js.map → chunk-R6UKY6NA.js.map} +1 -1
  108. package/dist/{chunk-HG5J7G5H.js → chunk-RGRQWMTF.js} +43 -6
  109. package/dist/chunk-RGRQWMTF.js.map +1 -0
  110. package/dist/{chunk-HWT2IHT4.js → chunk-S45JNJK7.js} +3 -3
  111. package/dist/{chunk-HWT2IHT4.js.map → chunk-S45JNJK7.js.map} +1 -1
  112. package/dist/{chunk-WH2BIMAZ.js → chunk-SBVOYSOO.js} +3 -3
  113. package/dist/{chunk-WH2BIMAZ.js.map → chunk-SBVOYSOO.js.map} +1 -1
  114. package/dist/chunk-SUVMOGTC.js +132 -0
  115. package/dist/chunk-SUVMOGTC.js.map +1 -0
  116. package/dist/chunk-TAVQOU3M.cjs +137 -0
  117. package/dist/chunk-TAVQOU3M.cjs.map +1 -0
  118. package/dist/{chunk-VO3VUC44.cjs → chunk-TFTGDUE4.cjs} +27 -27
  119. package/dist/{chunk-VO3VUC44.cjs.map → chunk-TFTGDUE4.cjs.map} +1 -1
  120. package/dist/{chunk-53AGHUFO.cjs → chunk-TX4CIWH5.cjs} +96 -3
  121. package/dist/chunk-TX4CIWH5.cjs.map +1 -0
  122. package/dist/{chunk-Q3SG3BWO.js → chunk-UIUWCTIZ.js} +3 -3
  123. package/dist/{chunk-Q3SG3BWO.js.map → chunk-UIUWCTIZ.js.map} +1 -1
  124. package/dist/{chunk-T6C5Z4CS.cjs → chunk-UR3MPRJA.cjs} +4 -4
  125. package/dist/{chunk-T6C5Z4CS.cjs.map → chunk-UR3MPRJA.cjs.map} +1 -1
  126. package/dist/{chunk-OFYTC2QC.js → chunk-VB7VPTMB.js} +9 -9
  127. package/dist/{chunk-OFYTC2QC.js.map → chunk-VB7VPTMB.js.map} +1 -1
  128. package/dist/{chunk-QJHU6BEE.cjs → chunk-VTY44LKS.cjs} +11 -11
  129. package/dist/{chunk-QJHU6BEE.cjs.map → chunk-VTY44LKS.cjs.map} +1 -1
  130. package/dist/{chunk-LM7DVT7C.cjs → chunk-W3PSIIMN.cjs} +2 -2
  131. package/dist/{chunk-LM7DVT7C.cjs.map → chunk-W3PSIIMN.cjs.map} +1 -1
  132. package/dist/{chunk-Z2KOIA5D.cjs → chunk-W427WPYF.cjs} +2 -32
  133. package/dist/chunk-W427WPYF.cjs.map +1 -0
  134. package/dist/{chunk-FDETJCMV.cjs → chunk-XNZSVCNR.cjs} +4 -4
  135. package/dist/{chunk-FDETJCMV.cjs.map → chunk-XNZSVCNR.cjs.map} +1 -1
  136. package/dist/{chunk-CWV4SLRT.js → chunk-YA2H33OW.js} +4 -4
  137. package/dist/{chunk-CWV4SLRT.js.map → chunk-YA2H33OW.js.map} +1 -1
  138. package/dist/{chunk-X2AIPVIT.cjs → chunk-YD3RN2FY.cjs} +3 -3
  139. package/dist/{chunk-X2AIPVIT.cjs.map → chunk-YD3RN2FY.cjs.map} +1 -1
  140. package/dist/{chunk-22UJW54C.js → chunk-YXX63XJD.js} +3 -3
  141. package/dist/{chunk-22UJW54C.js.map → chunk-YXX63XJD.js.map} +1 -1
  142. package/dist/{chunk-OS27G5ZI.js → chunk-Z3MWFHZC.js} +3 -3
  143. package/dist/{chunk-OS27G5ZI.js.map → chunk-Z3MWFHZC.js.map} +1 -1
  144. package/dist/{chunk-XUEJYHEP.cjs → chunk-ZDZY6OPL.cjs} +3 -3
  145. package/dist/{chunk-XUEJYHEP.cjs.map → chunk-ZDZY6OPL.cjs.map} +1 -1
  146. package/dist/{chunk-SNUWLNVU.cjs → chunk-ZQDJRROK.cjs} +22 -22
  147. package/dist/{chunk-SNUWLNVU.cjs.map → chunk-ZQDJRROK.cjs.map} +1 -1
  148. package/dist/{chunk-QDHVZ56E.cjs → chunk-ZTTR5MMZ.cjs} +8 -8
  149. package/dist/{chunk-QDHVZ56E.cjs.map → chunk-ZTTR5MMZ.cjs.map} +1 -1
  150. package/dist/components/Banner.d.ts +9 -3
  151. package/dist/components/ErrorBoundary.d.ts +16 -1
  152. package/dist/components/LoadingIndicator.d.ts +14 -1
  153. package/dist/connect/docx.cjs +10 -10
  154. package/dist/connect/docx.js +6 -6
  155. package/dist/connect/index.cjs +840 -840
  156. package/dist/connect/index.js +29 -29
  157. package/dist/connect/viewer.cjs +13 -12
  158. package/dist/connect/viewer.js +11 -10
  159. package/dist/facts/index.cjs +56 -56
  160. package/dist/facts/index.js +4 -4
  161. package/dist/files/index.cjs +1 -1
  162. package/dist/files/index.js +1 -1
  163. package/dist/home/index.cjs +29 -29
  164. package/dist/home/index.js +4 -4
  165. package/dist/index.cjs +678 -661
  166. package/dist/index.cjs.map +1 -1
  167. package/dist/index.d.ts +1 -1
  168. package/dist/index.js +19 -18
  169. package/dist/index.js.map +1 -1
  170. package/dist/settings/ErrorDialog.d.ts +21 -1
  171. package/dist/settings/error-report.d.ts +26 -0
  172. package/dist/settings/index.cjs +163 -155
  173. package/dist/settings/index.d.ts +2 -1
  174. package/dist/settings/index.js +3 -3
  175. package/dist/shell/AccountBanners.d.ts +22 -0
  176. package/dist/shell/Toaster.d.ts +24 -2
  177. package/dist/shell/index.cjs +61 -44
  178. package/dist/shell/index.d.ts +2 -1
  179. package/dist/shell/index.js +3 -2
  180. package/dist/site/index.cjs +55 -54
  181. package/dist/site/index.js +3 -2
  182. package/dist/studio/index.cjs +54 -53
  183. package/dist/studio/index.cjs.map +1 -1
  184. package/dist/studio/index.js +7 -6
  185. package/dist/studio/index.js.map +1 -1
  186. package/dist/workflow-canvas/index.cjs +36 -36
  187. package/dist/workflow-canvas/index.js +11 -11
  188. package/node_modules/@arbidocs/coedit/package.json +1 -1
  189. package/package.json +5 -5
  190. package/src/blocks.css +83 -2
  191. package/dist/ConnectedNativeDocxComparison-NGS4IMUZ.js.map +0 -1
  192. package/dist/ConnectedNativeDocxComparison-XJ66AM6C.cjs.map +0 -1
  193. package/dist/ConnectedNativeDocxEditor-23O5EH7F.cjs.map +0 -1
  194. package/dist/ConnectedNativeDocxEditor-MJUFY74T.js.map +0 -1
  195. package/dist/ConnectedStreamedWordArtifact-567Q2AOX.cjs.map +0 -1
  196. package/dist/ConnectedStreamedWordArtifact-VWG2BXSW.js.map +0 -1
  197. package/dist/chunk-4TQGWQHK.js.map +0 -1
  198. package/dist/chunk-53AGHUFO.cjs.map +0 -1
  199. package/dist/chunk-EQ3WRY2N.js.map +0 -1
  200. package/dist/chunk-HC4GCNCQ.js.map +0 -1
  201. package/dist/chunk-HG5J7G5H.js.map +0 -1
  202. package/dist/chunk-HIDCHFFI.js.map +0 -1
  203. package/dist/chunk-K7OBYDUO.cjs.map +0 -1
  204. package/dist/chunk-Q5BWRMET.cjs.map +0 -1
  205. package/dist/chunk-SOZQJTHB.js +0 -34
  206. package/dist/chunk-SOZQJTHB.js.map +0 -1
  207. package/dist/chunk-TM2D4XT4.cjs.map +0 -1
  208. package/dist/chunk-VTQOMJW7.cjs +0 -37
  209. package/dist/chunk-VTQOMJW7.cjs.map +0 -1
  210. package/dist/chunk-Z2KOIA5D.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chat/mermaid-normalize.ts","../src/connection/conversation/MermaidDiagram.tsx","../src/connection/conversation/DocumentWorkspaceContext.tsx","../src/connection/conversation/ConnectedMarkdown.tsx","../src/connection/viewer/documentViewerTabs.ts","../src/connection/viewer/ConnectedDocumentToolsProvider.tsx","../src/connection/viewer/support.ts"],"names":["useState","useId","useEffect","jsxs","jsx","createContext","useContext","useBlocksEnvironment","React","useArbiSession","MentionChip","QuietLink","useArbiHost","Fragment","useDocument","EntityPill","FileText","DocumentEntity","Mail","mentionFromHref","MarkdownLink","workspaceDocIdFromHref","MarkdownStreamingContext","MarkdownCode","rehypeDocEntityPills","useMemo","KitMarkdownRenderer","useOptionalDocumentTools","useArbi","useQueryClient","useHost","useConnectedWorkspace","useCallback","refreshDocuments","arbiQueryKeys","documentBytesKey","clientUpload","DocumentToolsProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBO,SAAS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C,EAAC;AAEpC,SAAS,wBAAA,GAAkD;AAChE,EAAA,OAAOP,yBAAA,GAAU,MAAA,IAAU,UAAA;AAC7B;AAEA,IAAM,OAAO,MAAM,MAAA;AACnB,IAAM,WAAW,MAAM,KAAA;AAGhB,SAAS,2BACd,UAAA,EACqC;AACrC,EAAA,MAAM,YAAA,GAAe,wBAAA,EAAyB,CAAE,oBAAA,IAAwB,IAAA;AACxE,EAAA,OAAO,aAAa,UAAU,CAAA;AAChC;AAGO,SAAS,uBAAuB,OAAA,EAAkD;AACvF,EAAA,MAAM,QAAA,GAAW,wBAAA,EAAyB,CAAE,gBAAA,IAAoB,IAAA;AAChE,EAAA,OAAO,SAAS,OAAO,CAAA;AACzB;AAGO,SAAS,wBAAA,GAAwD;AACtE,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,kBAAA,IAAsB,IAAA;AACrE,EAAA,OAAO,WAAA,EAAY;AACrB;AAGO,SAAS,mBAAA,GAA+B;AAC7C,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,aAAA,IAAiB,QAAA;AAChE,EAAA,OAAO,WAAA,EAAY;AACrB","file":"chunk-OMWOPRQR.cjs","sourcesContent":["/**\n * Defensive normalizer for single-line `graph` / `flowchart` Mermaid source.\n *\n * Some LLMs emit the entire diagram on one line. Mermaid's parser splits\n * statements on newlines, so a single-line graph fails outright. This helper\n * inserts newlines on safe statement boundaries so the diagram has a chance\n * of parsing. Only attempts normalization when:\n * 1. The source has no embedded newlines (i.e. is genuinely single-line), and\n * 2. The first directive is `graph` or `flowchart`.\n *\n * Other diagram types (sequenceDiagram, classDiagram, gantt, …) have very\n * different syntaxes — applying these heuristics to them would corrupt valid\n * input, so they're left untouched.\n *\n * Boundaries we split on:\n * - After the diagram-type header (`graph TD`, `flowchart LR`, …).\n * - Before each `style` / `classDef` / `class` / `linkStyle` / `click`\n * / `subgraph` keyword.\n * - Before/after `end` (closes a subgraph block).\n * - After a `]` (label close) that's followed by another node identifier\n * starting a new edge or node declaration.\n */\nexport function normalizeMermaidGraph(source: string): string {\n // Already multi-line — assume it's well-formed; don't touch it.\n if (/\\n/.test(source)) return source\n\n const headerMatch = source.match(/^\\s*(graph|flowchart)\\s+\\w+\\s+/)\n if (!headerMatch) return source\n\n const header = headerMatch[0].trimEnd()\n let body = source.slice(headerMatch[0].length)\n\n // Insert newline before keywords that always start a new statement.\n body = body.replace(/\\s+(style|classDef|class|linkStyle|click|subgraph)\\s/g, '\\n$1 ')\n\n // `end` closes a subgraph: put it on its own line, with a break after it\n // too so any trailing statements don't stay attached.\n body = body.replace(/\\s+end\\b\\s*/g, '\\nend\\n')\n\n // After a label close (`]`), if the next token looks like a Mermaid node id\n // followed by another `[` or `-->`, that's a new statement starting.\n body = body.replace(/\\]\\s+(?=[A-Za-z_][\\w-]*\\s*(?:\\[|-->))/g, ']\\n')\n\n // Collapse any accidental runs of blank lines we may have produced.\n body = body.replace(/\\n{2,}/g, '\\n')\n\n return `${header}\\n${body.trimStart()}`\n}\n","/**\n * MermaidDiagram Component\n *\n * Renders a Mermaid diagram from source code.\n * Used inside MarkdownRenderer to handle ```mermaid code blocks.\n * Lazy-loads the mermaid library to avoid bloating the initial bundle.\n */\n\nimport { useState, useEffect, useId } from 'react'\nimport { normalizeMermaidGraph } from '../../chat/mermaid-normalize'\n\ninterface MermaidDiagramProps {\n /** Mermaid diagram source code */\n chart: string\n}\n\n// Lazy-load and initialize mermaid once\nlet mermaidInstance: typeof import('mermaid').default | null = null\nlet mermaidLoadPromise: Promise<typeof import('mermaid').default> | null = null\n\nasync function getMermaid() {\n if (mermaidInstance) return mermaidInstance\n if (!mermaidLoadPromise) {\n mermaidLoadPromise = import('mermaid').then((mod) => {\n const m = mod.default\n m.initialize({\n startOnLoad: false,\n theme: 'default',\n securityLevel: 'strict',\n flowchart: { useMaxWidth: true, curve: 'basis' },\n })\n mermaidInstance = m\n return m\n })\n }\n return mermaidLoadPromise\n}\n\nexport function MermaidDiagram({ chart }: MermaidDiagramProps) {\n const [svg, setSvg] = useState<string | null>(null)\n const [error, setError] = useState<string | null>(null)\n const uniqueId = useId().replace(/:/g, '-')\n\n useEffect(() => {\n let cancelled = false\n\n async function render() {\n const mermaid = await getMermaid()\n const diagramId = `mermaid${uniqueId}`\n\n // Validate with parse() before render(). In Mermaid v11 a render() with\n // bad source can return a \"Syntax error in text\" bomb SVG instead of\n // throwing — and it appends DOM side-effects of its own — so a try/catch\n // around render() doesn't reliably catch failures and the bomb leaks\n // into the page (especially under React StrictMode where effects run\n // twice). parse() throws cleanly with no DOM side-effects.\n //\n // Defensive rescue: some LLMs emit single-line `graph`/`flowchart`\n // source. If the original parse fails, try a normalized variant. The\n // normalizer is a no-op on already-multi-line source and on non-graph\n // diagram types, so this only helps the bad-source case and never\n // corrupts valid input.\n let validSource: string | null = null\n let firstErr: unknown\n try {\n await mermaid.parse(chart)\n validSource = chart\n } catch (err) {\n firstErr = err\n const normalized = normalizeMermaidGraph(chart)\n if (normalized !== chart) {\n try {\n await mermaid.parse(normalized)\n validSource = normalized\n } catch (retryErr) {\n console.warn('Mermaid normalized parse also failed', retryErr)\n }\n }\n }\n\n if (cancelled) return\n\n if (!validSource) {\n console.warn('Mermaid parse failed, showing source', firstErr)\n setError('Failed to render diagram')\n setSvg(null)\n return\n }\n\n try {\n const { svg: renderedSvg } = await mermaid.render(diagramId, validSource)\n if (!cancelled) {\n setSvg(renderedSvg)\n setError(null)\n }\n } catch (renderErr) {\n if (!cancelled) {\n console.warn('Mermaid render failed despite parse success', renderErr)\n setError('Failed to render diagram')\n setSvg(null)\n }\n }\n }\n\n render()\n return () => {\n cancelled = true\n }\n }, [chart, uniqueId])\n\n if (error) {\n // Fall back to showing the raw source in a code block\n return (\n <div className=\"code-block\" data-testid=\"mermaid-error\">\n <div className=\"text-sm text-muted-foreground mb-1\">{error}</div>\n <code className=\"language-mermaid\">{chart}</code>\n </div>\n )\n }\n\n if (!svg) {\n return (\n <div\n className=\"flex items-center justify-center py-8 text-muted-foreground text-sm\"\n data-testid=\"mermaid-loading\"\n >\n Rendering diagram...\n </div>\n )\n }\n\n return (\n <div\n className=\"mermaid-diagram my-4 overflow-x-auto rounded-md border border-border bg-background p-4\"\n data-testid=\"mermaid-diagram\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n )\n}\n","/**\n * The workspace a conversation's document references belong to, when it is not the open one: an\n * agent's direct-message thread runs in the agent's workspace, so the documents it names are there.\n * A reference then opens that workspace first (`openDocument(id, { workspaceId })`).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\n/** The workspace of the documents referenced inside it (null: the open workspace). */\nexport const DocumentWorkspaceContext = createContext<string | null>(null)\nexport const useDocumentWorkspace = () => useContext(DocumentWorkspaceContext)\n\n/** A reference to a document of another workspace: opening it opens that workspace first. */\nexport function WorkspaceDocumentReference({\n workspaceId,\n docId,\n children,\n className = 'inline-flex rounded-full border px-2 py-0.5 text-xs hover:bg-muted',\n}: {\n workspaceId: string\n docId: string\n children?: ReactNode\n className?: string\n}) {\n const { openDocument } = useBlocksEnvironment()\n return (\n <button\n type=\"button\"\n className={className}\n onClick={() => openDocument(docId, { workspaceId })}\n >\n {children ?? docId}\n </button>\n )\n}\n","/**\n * The conversation's markdown: the kit's `MarkdownRenderer` (`@arbidocs/react`: sanitised HTML,\n * slugs, lazy KaTeX, streaming blocks, tables, code) with what a conversation adds: @mention chips,\n * workspace documents opening in the viewer, quiet external links, document and email pills (the\n * host's chips, `ArbiChatHost.renderDocumentChip` / `renderMailChip`) and Mermaid diagrams.\n */\nimport { useArbiHost, useArbiSession, useDocument } from '@arbidocs/react'\nimport { mentionFromHref, type MentionKind } from '@arbidocs/react/shell'\nimport {\n EntityPill,\n MarkdownCode,\n MarkdownLink,\n MarkdownRenderer as KitMarkdownRenderer,\n MarkdownStreamingContext,\n type MarkdownRendererProps as KitMarkdownRendererProps,\n DocumentEntity,\n} from '@arbidocs/react/ui'\nimport React, { useContext, useMemo } from 'react'\nimport { FileText, Mail } from 'lucide-react'\n\n/** The markdown element overrides, as the kit's renderer takes them. */\ntype Components = NonNullable<KitMarkdownRendererProps['components']>\nimport { MentionChip } from '../../chat/MentionMenu'\nimport { QuietLink } from '../../citations/QuietMarks'\nimport { rehypeDocEntityPills } from '../../chat/rehype-doc-entity-pills'\nimport { workspaceDocIdFromHref } from '../../chat/doc-links'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { MermaidDiagram } from './MermaidDiagram'\nimport { useDocumentWorkspace, WorkspaceDocumentReference } from './DocumentWorkspaceContext'\n\n/** Plain text of a link's children (the `@Label` of a mention link). */\nfunction childrenText(children: React.ReactNode): string {\n return React.Children.toArray(children)\n .map((child) => (typeof child === 'string' || typeof child === 'number' ? String(child) : ''))\n .join('')\n}\n\n/** A mention chip; a mention of the reader stands out. */\nfunction MentionLink({ kind, id, text }: { kind: MentionKind; id: string; text: string }) {\n const currentUserId = useArbiSession().user?.external_id\n return (\n <MentionChip\n kind={kind}\n id={id}\n label={text.replace(/^@/, '')}\n isSelf={kind === 'user' && id === currentUserId}\n />\n )\n}\n\n/**\n * A link to elsewhere, as quiet text. Its menu (Open link / Copy link) is the deliberate step\n * the old confirmation dialog used to be; nothing opens until the menu's primary row is chosen.\n */\nexport function ExternalLink({ href, children }: React.ComponentPropsWithoutRef<'a'>) {\n return (\n <QuietLink href={href} kind=\"external\">\n {children}\n </QuietLink>\n )\n}\n\n/**\n * A workspace document referenced by a link's href rather than by its text.\n *\n * `rehypeDocEntityPills` turns a bare `doc-…` id into a pill, but it only walks\n * TEXT nodes — so `[NVDA DCF Valuation Report](…doc-abc12345…)`, which is how an\n * answer links an artifact it just saved, keeps the id in the href where the\n * plugin never looks. The link then fell through to `ExternalLink`, and opening\n * your own workspace document asked you to confirm an \"external link\" and\n * launched a new tab. It opens in the document viewer, like the pill and the\n * artifact card already do.\n */\nexport function InternalDocLink({\n docId,\n href,\n children,\n}: React.ComponentPropsWithoutRef<'a'> & { docId: string }) {\n const { openDocument } = useBlocksEnvironment()\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) {\n return (\n <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId}>\n {children}\n </WorkspaceDocumentReference>\n )\n }\n\n return (\n <QuietLink href={href} kind=\"document\" onOpen={() => openDocument(docId)}>\n {children}\n </QuietLink>\n )\n}\n\n/** A document of the workspace, as a pill: the host's chip, else the document entity. */\nexport function DocumentChip({ docId }: { docId: string }) {\n const render = useArbiHost().chat?.renderDocumentChip\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) return <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId} />\n return render ? <>{render(docId)}</> : <DefaultDocumentChip docId={docId} />\n}\n\nfunction DefaultDocumentChip({ docId }: { docId: string }) {\n const { data: doc } = useDocument(docId)\n const { openDocument } = useBlocksEnvironment()\n if (!doc)\n return (\n <EntityPill\n icon={<FileText className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label={docId}\n size=\"sm\"\n onClick={() => openDocument(docId)}\n data-testid=\"doc-entity-pill\"\n />\n )\n return (\n <DocumentEntity doc={doc} onClick={() => openDocument(docId)} data-testid=\"doc-entity-pill\" />\n )\n}\n\n/** An email of the person's mailbox, as a pill: the host's chip, else a plain \"Email\". */\nexport function MailChip({ mailId }: { mailId: string }) {\n const render = useArbiHost().chat?.renderMailChip\n if (render) return <>{render(mailId)}</>\n return (\n <EntityPill\n icon={<Mail className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label=\"Email\"\n size=\"sm\"\n data-testid=\"mail-entity-pill\"\n />\n )\n}\n\n/**\n * The conversation's overrides, layered on the kit's defaults. Module scope, so the reference is stable\n * and memoised markdown blocks do not re-parse.\n */\nconst conversationMarkdownComponents: Partial<Components> = {\n a: function ConversationMarkdownLink({\n href,\n children,\n ...props\n }: React.ComponentPropsWithoutRef<'a'>) {\n const deploymentDomain = useBlocksEnvironment().runtimeConfig.deploymentDomain\n // @mentions: `linkMentions` turned them into `#mention-<id>` links; draw them as chips.\n const mention = mentionFromHref(href)\n if (mention) {\n return <MentionLink kind={mention.kind} id={mention.id} text={childrenText(children)} />\n }\n // Bookmarks: in-page anchors are near-invisible text; the menu jumps or copies the place.\n if (href?.startsWith('#') && !href.startsWith('#cite-')) {\n return (\n <QuietLink href={href} kind=\"anchor\">\n {children}\n </QuietLink>\n )\n }\n // Citations, `cite:` references and bare links: the kit's link.\n if (!href || href.startsWith('#') || href.startsWith('cite:')) {\n return (\n <MarkdownLink href={href} {...props}>\n {children}\n </MarkdownLink>\n )\n }\n // A workspace document is not an external link, wherever it is hosted: it opens in the viewer.\n const docId = workspaceDocIdFromHref(href, deploymentDomain)\n if (docId) {\n return (\n <InternalDocLink docId={docId} href={href} {...props}>\n {children}\n </InternalDocLink>\n )\n }\n return (\n <ExternalLink href={href} {...props}>\n {children}\n </ExternalLink>\n )\n },\n code: function ConversationMarkdownCode(\n props: React.ComponentPropsWithoutRef<'code'> & { inline?: boolean }\n ) {\n const isStreaming = useContext(MarkdownStreamingContext)\n const { className, children } = props\n const language = /language-(\\w+)/.exec(className || '')?.[1]\n if (!language) {\n // Answers often backtick a bare doc id (`doc-f7b3eeb5`). The text-node pass skips code, so\n // the id would stay monospace text; show it as the document pill. Only a whole id (eight\n // alphanumerics): while streaming, a partial one (\"doc-e\") would be looked up and 404.\n const codeText = typeof children === 'string' ? children.trim() : ''\n if (/^doc-[a-zA-Z0-9]{8}$/.test(codeText)) return <DocumentChip docId={codeText} />\n if (/^eml-[a-zA-Z0-9]{8}$/.test(codeText)) return <MailChip mailId={codeText} />\n }\n // Mermaid lazy-loads its own bundle and re-renders SVG on every change. While streaming the\n // fence is almost always partial, so it stays a code block until generation completes.\n if (language === 'mermaid' && !isStreaming) {\n return <MermaidDiagram chart={String(children).replace(/\\n$/, '')} />\n }\n return <MarkdownCode {...props} />\n },\n span: ({ children, className, ...props }: React.ComponentPropsWithoutRef<'span'>) => {\n const docId = (props as Record<string, unknown>)['data-doc-id'] as string | undefined\n if (docId) return <DocumentChip docId={docId} />\n const mailId = (props as Record<string, unknown>)['data-mail-id'] as string | undefined\n if (mailId) return <MailChip mailId={mailId} />\n return (\n <span className={className} {...props}>\n {children}\n </span>\n )\n },\n}\n\n/** Bare `doc-…` / `eml-…` ids in text become `<span data-doc-id>` / `<span data-mail-id>` pills. */\nconst conversationRehypePlugins = [rehypeDocEntityPills]\n\nexport type ConnectedMarkdownProps = Omit<KitMarkdownRendererProps, 'rehypePlugins'>\n\n/**\n * The kit's renderer with the conversation's overrides; a caller's `components` (e.g. the citation\n * core's) still win over both.\n */\nfunction ConnectedMarkdownComponent({ components, ...props }: ConnectedMarkdownProps) {\n const merged = useMemo(\n () =>\n components\n ? { ...conversationMarkdownComponents, ...components }\n : conversationMarkdownComponents,\n [components]\n )\n return (\n <KitMarkdownRenderer {...props} components={merged} rehypePlugins={conversationRehypePlugins} />\n )\n}\n\nexport const ConnectedMarkdown = React.memo(ConnectedMarkdownComponent)\n","/** The views of the document dialog (`ConnectedDocumentViewer layout=\"dialog\"`). */\n\n/**\n * - `review`: the parsed document with its AI findings, a cited passage marked;\n * - `document`: the whole viewer (PDF and text, markup, signing, versions, sharing);\n * - `ask`: a question about the document, which starts a thread about it.\n */\nexport type DocumentViewerTab = 'review' | 'document' | 'ask'\n\nexport const DEFAULT_DOCUMENT_VIEWER_TABS: readonly DocumentViewerTab[] = [\n 'review',\n 'document',\n 'ask',\n]\n\n/** The dialog's words; each has a neutral default. */\nexport interface DocumentViewerDialogLabels {\n review?: string\n document?: string\n ask?: string\n /** Above the ask bar. */\n askIntro?: string\n /** The ask bar's placeholder; `{title}` is the document's title. */\n askPlaceholder?: string\n}\n\nexport const DEFAULT_DOCUMENT_VIEWER_LABELS: Required<DocumentViewerDialogLabels> = {\n review: 'Review',\n document: 'Document',\n ask: 'Ask AI',\n askIntro:\n 'Your question starts a new thread about this document. The answer cites its passages and takes follow-ups.',\n askPlaceholder: 'Ask about {title}…',\n}\n\nexport const DEFAULT_ASK_SUGGESTIONS: readonly string[] = [\n 'Summarise the key points',\n 'List the dates and deadlines it mentions',\n 'Who are the people and organisations named, and what are their roles?',\n]\n","/**\n * The PDF document tools (markup, Freeze, signing, signature requests, productions) on the\n * signed-in session, for any host: the API client, the signed-in user, the host's notices and\n * document opening (`BlocksEnvironment`), and the shared caches a change refreshes. A host with its\n * own binding (its own lists to refresh, an XHR upload with progress, Mail) gives it as the host\n * configuration's `documentTools`, field by field. An enclosing `DocumentToolsProvider` (a dialog\n * with its own client) wins.\n */\n\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { arbiQueryKeys, refreshDocuments, useArbi } from '@arbidocs/react'\nimport {\n DocumentToolsProvider,\n clientUpload,\n documentBytesKey,\n useOptionalDocumentTools,\n type DocumentChange,\n type DocumentToolsClient,\n type DocumentToolsEnvironment,\n type DocumentToolsNotify,\n type DocumentUploadRequest,\n} from '@arbidocs/react/document-tools'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\n\n/** What a host binds of the document tools itself; each absent field is the kit's own. */\nexport interface DocumentToolsHost {\n /** The API client the tools call. Default: the host `arbi`'s. */\n client?: DocumentToolsClient\n /** The deployment domain keys are derived for (signing). Default: the host `arbi`'s. */\n deploymentDomain?: string\n /** Open a document or a version the tools made. Default: the environment's `openDocument`. */\n openDocument?: (documentRef: string) => void\n /** Refresh the host's lists after a change. Default: the shared document caches. */\n onDocumentsChanged?: DocumentToolsEnvironment['onDocumentsChanged']\n /** Upload a derived copy. Default: through the API client, into the open workspace. */\n uploadDocument?: DocumentToolsEnvironment['uploadDocument']\n /**\n * Where \"View certificate\" goes for a signature `reference` (e.g. the site's own verify page).\n * Default: the certificate link the API returns (on the deployment domain).\n */\n certificateUrl?: (reference: string) => string\n /** Email a document (a hook): absent, or returning nothing, when mail is not offered. */\n useEmailDocument?: () => ((documentRef: string) => void) | undefined\n}\n\nconst NO_EMAIL = () => undefined\n\nexport function ConnectedDocumentToolsProvider({ children }: { children: ReactNode }) {\n const enclosing = useOptionalDocumentTools()\n return enclosing ? <>{children}</> : <OwnDocumentTools>{children}</OwnDocumentTools>\n}\n\nfunction OwnDocumentTools({ children }: { children: ReactNode }) {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const host = useHost().documentTools\n const { user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { notify: environmentNotify, openDocument: openInHost } = useBlocksEnvironment()\n const useEmailDocument = host?.useEmailDocument ?? NO_EMAIL\n const emailDocument = useEmailDocument()\n const client = host?.client ?? (arbi.isLoggedIn ? arbi.getClient().fetch : null)\n const signer = useMemo(\n () => (user ? { name: user.name, email: user.email, externalId: user.externalId } : null),\n [user]\n )\n const notify = useCallback<DocumentToolsNotify>(\n (message, kind, options) =>\n environmentNotify(message, kind, {\n description: options?.description,\n action: options?.action,\n }),\n [environmentNotify]\n )\n const ownDocumentsChanged = useCallback(\n async (ids: string[], change: DocumentChange) => {\n // The list carries each version's markup count and the copies; a signature or a saved\n // version is a new current version, with new versions and a new rendered PDF.\n const refresh: Promise<unknown>[] = [refreshDocuments(queryClient, arbi, ids)]\n if (change === 'signed' || change === 'version')\n for (const id of ids)\n refresh.push(\n queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documentVersions(id) }),\n queryClient.invalidateQueries({ queryKey: documentBytesKey(id) })\n )\n await Promise.all(refresh)\n },\n [queryClient, arbi]\n )\n // The server files an upload in the session's open workspace: re-assert it first.\n const ownUpload = useCallback(\n async (request: DocumentUploadRequest) => {\n if (!client) throw new Error('Sign in to save a copy.')\n await ensureWorkspaceOpen()\n return clientUpload(client)(request)\n },\n [client, ensureWorkspaceOpen]\n )\n const ownOpenDocument = useCallback((ref: string) => openInHost(ref), [openInHost])\n if (!client) return <>{children}</>\n return (\n <DocumentToolsProvider\n client={client}\n deploymentDomain={host?.deploymentDomain}\n user={signer}\n notify={notify}\n openDocument={host?.openDocument ?? ownOpenDocument}\n onDocumentsChanged={host?.onDocumentsChanged ?? ownDocumentsChanged}\n uploadDocument={host?.uploadDocument ?? ownUpload}\n emailDocument={emailDocument}\n certificateUrl={host?.certificateUrl}\n >\n {children}\n </DocumentToolsProvider>\n )\n}\n","/**\n * What a host adds to the connected document viewer. The viewer reads documents, versions, PDFs,\n * markup and signatures on the signed-in session by itself; these are the host's own things it\n * cannot know: documents the host makes on the client (an artifact streaming in from a chat, an\n * unsaved draft), the host's dialogs and workflows a document action opens, and how the host lays\n * the viewer out. It is the host configuration's `viewer`. Every field is optional: without one the\n * viewer offers less (no Translate button, no draft controls), never something that does nothing.\n * What changes while the viewer is open is read through hooks (`use…`).\n */\n\nimport type { ReactNode } from 'react'\nimport type { components } from '@arbidocs/client'\nimport { useHost } from '../../provider/host'\n\n/** A document's record, as the viewer reads it. */\nexport type ViewerDocumentRecord = components['schemas']['DocResponse']\n\n/** An artifact being generated in a chat, shown in the viewer as it streams. */\nexport interface ViewerStreamingDocument {\n title?: string | null\n /** The content so far (Markdown, or the html/react source of a live artifact). */\n content: string\n /** How it is carried: a document draft, a live `html` / `react` artifact, an `image`. */\n mode?: string | null\n isComplete: boolean\n}\n\n/** A document the user started on the client, with no backend record until it is saved. */\nexport interface ViewerDraftDocument {\n kind: 'text' | 'audio' | 'photo' | 'video'\n title?: string | null\n /** A text draft's starting content. */\n content?: string | null\n}\n\nexport interface DocumentViewerSupport {\n /** The artifact streaming in as this document, if one is (a hook). */\n useStreamingDocument?: (documentId: string) => ViewerStreamingDocument | undefined\n /** The unsaved draft with this client id, if there is one (a hook). */\n useDraftDocument?: (draftId: string) => ViewerDraftDocument | undefined\n /** A draft's kind (text, photo, audio, video), in place of the tabs. */\n renderDraftKind?: (draftId: string) => ReactNode\n /** A draft's name (editable), in place of the title. */\n renderDraftTitle?: (draftId: string) => ReactNode\n /** The recorder of a photo, audio or video draft: the whole body of the viewer. */\n renderCaptureDraft?: (draftId: string) => ReactNode\n /** A text draft was saved as `documentId`; the viewer shows it next. */\n onDraftSaved?: (draftId: string, documentId: string) => void\n /** Documents related to the one open (near duplicates), beside its name. */\n renderRelated?: (document: ViewerDocumentRecord) => ReactNode\n /** A document as a pill (the comparison's other side). Default: its name. */\n renderDocumentPill?: (documentId: string) => ReactNode\n /** Open the host's share dialog for the document. Default: share it with the workspace. */\n share?: (document: { id: string; name: string | undefined; isPrivate: boolean }) => void\n /** Ask the assistant about a version (`doc-…@v2`) open read-only. Absent: not offered. */\n askAboutVersion?: (versionRef: string) => void\n /** Translate the document (or the version) on screen. Absent: not offered. */\n translate?: (documentRef: string) => void\n /** Start an image generation from the image on screen. Absent: not offered. */\n useImageAsReference?: (documentId: string) => void\n /**\n * A citation being edited elsewhere (a fact's sources, a field's) picks its passages in the text\n * view: clicks and selections there are handed to it (a hook). Absent: passages are not pickable.\n */\n usePassageCitation?: () => PassageCitation | undefined\n /** Open the document's passages in the host's navigator (a passage's menu). Absent: not offered. */\n openInNavigator?: (documentId: string) => void\n /** Start a new label or field in the host's editor (the passage tagging panel). Absent: not offered. */\n createTag?: () => void\n /** How dates read (versions, signatures). Default: `fmtDate`. */\n formatDate?: (iso: string) => string\n /** Whether the viewer is shown in another window, where PDF pages render without the page's web\n * fonts (a hook). */\n useIsDetached?: () => boolean\n}\n\n/** A passage picked for a citation: its chunk and, when known, its page. */\nexport interface PickedPassage {\n chunk_id: string\n page?: number\n}\n\n/** The citation a host is editing, as the text view sees it. */\nexport interface PassageCitation {\n /** The citation picking passages now, and the document it picks in; null when none is. */\n active: { documentId: string; key: string | null } | null\n /** Passages to light (a fact's cited passages while its sources are open). */\n highlighted: readonly string[]\n /** Passages added to the citation. */\n pick: (passages: PickedPassage[]) => void\n /** Passages taken off it. */\n unpick: (chunkIds: string[]) => void\n}\n\nconst NO_SUPPORT: DocumentViewerSupport = {}\n\nexport function useDocumentViewerSupport(): DocumentViewerSupport {\n return useHost().viewer ?? NO_SUPPORT\n}\n\nconst NONE = () => undefined\nconst ATTACHED = () => false\n\n/** The artifact streaming in as this document (none without the host's). */\nexport function useViewerStreamingDocument(\n documentId: string\n): ViewerStreamingDocument | undefined {\n const useStreaming = useDocumentViewerSupport().useStreamingDocument ?? NONE\n return useStreaming(documentId)\n}\n\n/** The unsaved draft with this id (none without the host's). */\nexport function useViewerDraftDocument(draftId: string): ViewerDraftDocument | undefined {\n const useDraft = useDocumentViewerSupport().useDraftDocument ?? NONE\n return useDraft(draftId)\n}\n\n/** The citation picking passages (none without the host's). */\nexport function useViewerPassageCitation(): PassageCitation | undefined {\n const useCitation = useDocumentViewerSupport().usePassageCitation ?? NONE\n return useCitation()\n}\n\n/** Whether the viewer is in another window (never without the host's). */\nexport function useViewerIsDetached(): boolean {\n const useDetached = useDocumentViewerSupport().useIsDetached ?? ATTACHED\n return useDetached()\n}\n"]}
1
+ {"version":3,"sources":["../src/chat/mermaid-normalize.ts","../src/connection/conversation/MermaidDiagram.tsx","../src/connection/conversation/DocumentWorkspaceContext.tsx","../src/connection/conversation/ConnectedMarkdown.tsx","../src/connection/viewer/documentViewerTabs.ts","../src/connection/viewer/ConnectedDocumentToolsProvider.tsx","../src/connection/viewer/support.ts"],"names":["useState","useId","useEffect","jsxs","jsx","createContext","useContext","useBlocksEnvironment","React","useArbiSession","MentionChip","QuietLink","useArbiHost","Fragment","useDocument","EntityPill","FileText","DocumentEntity","Mail","mentionFromHref","MarkdownLink","workspaceDocIdFromHref","MarkdownStreamingContext","MarkdownCode","rehypeDocEntityPills","useMemo","KitMarkdownRenderer","useOptionalDocumentTools","useArbi","useQueryClient","useHost","useConnectedWorkspace","useCallback","refreshDocuments","arbiQueryKeys","documentBytesKey","clientUpload","DocumentToolsProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBO,SAAS,sBAAsB,MAAA,EAAwB;AAE5D,EAAA,IAAI,IAAA,CAAK,IAAA,CAAK,MAAM,CAAA,EAAG,OAAO,MAAA;AAE9B,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,KAAA,CAAM,gC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AAGhB,SAAS,2BACd,UAAA,EACqC;AACrC,EAAA,MAAM,YAAA,GAAe,wBAAA,EAAyB,CAAE,oBAAA,IAAwB,IAAA;AACxE,EAAA,OAAO,aAAa,UAAU,CAAA;AAChC;AAGO,SAAS,uBAAuB,OAAA,EAAkD;AACvF,EAAA,MAAM,QAAA,GAAW,wBAAA,EAAyB,CAAE,gBAAA,IAAoB,IAAA;AAChE,EAAA,OAAO,SAAS,OAAO,CAAA;AACzB;AAGO,SAAS,wBAAA,GAAwD;AACtE,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,kBAAA,IAAsB,IAAA;AACrE,EAAA,OAAO,WAAA,EAAY;AACrB;AAGO,SAAS,mBAAA,GAA+B;AAC7C,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,aAAA,IAAiB,QAAA;AAChE,EAAA,OAAO,WAAA,EAAY;AACrB","file":"chunk-JZ4LN4Q6.cjs","sourcesContent":["/**\n * Defensive normalizer for single-line `graph` / `flowchart` Mermaid source.\n *\n * Some LLMs emit the entire diagram on one line. Mermaid's parser splits\n * statements on newlines, so a single-line graph fails outright. This helper\n * inserts newlines on safe statement boundaries so the diagram has a chance\n * of parsing. Only attempts normalization when:\n * 1. The source has no embedded newlines (i.e. is genuinely single-line), and\n * 2. The first directive is `graph` or `flowchart`.\n *\n * Other diagram types (sequenceDiagram, classDiagram, gantt, …) have very\n * different syntaxes — applying these heuristics to them would corrupt valid\n * input, so they're left untouched.\n *\n * Boundaries we split on:\n * - After the diagram-type header (`graph TD`, `flowchart LR`, …).\n * - Before each `style` / `classDef` / `class` / `linkStyle` / `click`\n * / `subgraph` keyword.\n * - Before/after `end` (closes a subgraph block).\n * - After a `]` (label close) that's followed by another node identifier\n * starting a new edge or node declaration.\n */\nexport function normalizeMermaidGraph(source: string): string {\n // Already multi-line — assume it's well-formed; don't touch it.\n if (/\\n/.test(source)) return source\n\n const headerMatch = source.match(/^\\s*(graph|flowchart)\\s+\\w+\\s+/)\n if (!headerMatch) return source\n\n const header = headerMatch[0].trimEnd()\n let body = source.slice(headerMatch[0].length)\n\n // Insert newline before keywords that always start a new statement.\n body = body.replace(/\\s+(style|classDef|class|linkStyle|click|subgraph)\\s/g, '\\n$1 ')\n\n // `end` closes a subgraph: put it on its own line, with a break after it\n // too so any trailing statements don't stay attached.\n body = body.replace(/\\s+end\\b\\s*/g, '\\nend\\n')\n\n // After a label close (`]`), if the next token looks like a Mermaid node id\n // followed by another `[` or `-->`, that's a new statement starting.\n body = body.replace(/\\]\\s+(?=[A-Za-z_][\\w-]*\\s*(?:\\[|-->))/g, ']\\n')\n\n // Collapse any accidental runs of blank lines we may have produced.\n body = body.replace(/\\n{2,}/g, '\\n')\n\n return `${header}\\n${body.trimStart()}`\n}\n","/**\n * MermaidDiagram Component\n *\n * Renders a Mermaid diagram from source code.\n * Used inside MarkdownRenderer to handle ```mermaid code blocks.\n * Lazy-loads the mermaid library to avoid bloating the initial bundle.\n */\n\nimport { useState, useEffect, useId } from 'react'\nimport { normalizeMermaidGraph } from '../../chat/mermaid-normalize'\n\ninterface MermaidDiagramProps {\n /** Mermaid diagram source code */\n chart: string\n}\n\n// Lazy-load and initialize mermaid once\nlet mermaidInstance: typeof import('mermaid').default | null = null\nlet mermaidLoadPromise: Promise<typeof import('mermaid').default> | null = null\n\nasync function getMermaid() {\n if (mermaidInstance) return mermaidInstance\n if (!mermaidLoadPromise) {\n mermaidLoadPromise = import('mermaid').then((mod) => {\n const m = mod.default\n m.initialize({\n startOnLoad: false,\n theme: 'default',\n securityLevel: 'strict',\n flowchart: { useMaxWidth: true, curve: 'basis' },\n })\n mermaidInstance = m\n return m\n })\n }\n return mermaidLoadPromise\n}\n\nexport function MermaidDiagram({ chart }: MermaidDiagramProps) {\n const [svg, setSvg] = useState<string | null>(null)\n const [error, setError] = useState<string | null>(null)\n const uniqueId = useId().replace(/:/g, '-')\n\n useEffect(() => {\n let cancelled = false\n\n async function render() {\n const mermaid = await getMermaid()\n const diagramId = `mermaid${uniqueId}`\n\n // Validate with parse() before render(). In Mermaid v11 a render() with\n // bad source can return a \"Syntax error in text\" bomb SVG instead of\n // throwing — and it appends DOM side-effects of its own — so a try/catch\n // around render() doesn't reliably catch failures and the bomb leaks\n // into the page (especially under React StrictMode where effects run\n // twice). parse() throws cleanly with no DOM side-effects.\n //\n // Defensive rescue: some LLMs emit single-line `graph`/`flowchart`\n // source. If the original parse fails, try a normalized variant. The\n // normalizer is a no-op on already-multi-line source and on non-graph\n // diagram types, so this only helps the bad-source case and never\n // corrupts valid input.\n let validSource: string | null = null\n let firstErr: unknown\n try {\n await mermaid.parse(chart)\n validSource = chart\n } catch (err) {\n firstErr = err\n const normalized = normalizeMermaidGraph(chart)\n if (normalized !== chart) {\n try {\n await mermaid.parse(normalized)\n validSource = normalized\n } catch (retryErr) {\n console.warn('Mermaid normalized parse also failed', retryErr)\n }\n }\n }\n\n if (cancelled) return\n\n if (!validSource) {\n console.warn('Mermaid parse failed, showing source', firstErr)\n setError('Failed to render diagram')\n setSvg(null)\n return\n }\n\n try {\n const { svg: renderedSvg } = await mermaid.render(diagramId, validSource)\n if (!cancelled) {\n setSvg(renderedSvg)\n setError(null)\n }\n } catch (renderErr) {\n if (!cancelled) {\n console.warn('Mermaid render failed despite parse success', renderErr)\n setError('Failed to render diagram')\n setSvg(null)\n }\n }\n }\n\n render()\n return () => {\n cancelled = true\n }\n }, [chart, uniqueId])\n\n if (error) {\n // Fall back to showing the raw source in a code block\n return (\n <div className=\"code-block\" data-testid=\"mermaid-error\">\n <div className=\"text-sm text-muted-foreground mb-1\">{error}</div>\n <code className=\"language-mermaid\">{chart}</code>\n </div>\n )\n }\n\n if (!svg) {\n return (\n <div\n className=\"flex items-center justify-center py-8 text-muted-foreground text-sm\"\n data-testid=\"mermaid-loading\"\n >\n Rendering diagram...\n </div>\n )\n }\n\n return (\n <div\n className=\"mermaid-diagram my-4 overflow-x-auto rounded-md border border-border bg-background p-4\"\n data-testid=\"mermaid-diagram\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n )\n}\n","/**\n * The workspace a conversation's document references belong to, when it is not the open one: an\n * agent's direct-message thread runs in the agent's workspace, so the documents it names are there.\n * A reference then opens that workspace first (`openDocument(id, { workspaceId })`).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\n/** The workspace of the documents referenced inside it (null: the open workspace). */\nexport const DocumentWorkspaceContext = createContext<string | null>(null)\nexport const useDocumentWorkspace = () => useContext(DocumentWorkspaceContext)\n\n/** A reference to a document of another workspace: opening it opens that workspace first. */\nexport function WorkspaceDocumentReference({\n workspaceId,\n docId,\n children,\n className = 'inline-flex rounded-full border px-2 py-0.5 text-xs hover:bg-muted',\n}: {\n workspaceId: string\n docId: string\n children?: ReactNode\n className?: string\n}) {\n const { openDocument } = useBlocksEnvironment()\n return (\n <button\n type=\"button\"\n className={className}\n onClick={() => openDocument(docId, { workspaceId })}\n >\n {children ?? docId}\n </button>\n )\n}\n","/**\n * The conversation's markdown: the kit's `MarkdownRenderer` (`@arbidocs/react`: sanitised HTML,\n * slugs, lazy KaTeX, streaming blocks, tables, code) with what a conversation adds: @mention chips,\n * workspace documents opening in the viewer, quiet external links, document and email pills (the\n * host's chips, `ArbiChatHost.renderDocumentChip` / `renderMailChip`) and Mermaid diagrams.\n */\nimport { useArbiHost, useArbiSession, useDocument } from '@arbidocs/react'\nimport { mentionFromHref, type MentionKind } from '@arbidocs/react/shell'\nimport {\n EntityPill,\n MarkdownCode,\n MarkdownLink,\n MarkdownRenderer as KitMarkdownRenderer,\n MarkdownStreamingContext,\n type MarkdownRendererProps as KitMarkdownRendererProps,\n DocumentEntity,\n} from '@arbidocs/react/ui'\nimport React, { useContext, useMemo } from 'react'\nimport { FileText, Mail } from 'lucide-react'\n\n/** The markdown element overrides, as the kit's renderer takes them. */\ntype Components = NonNullable<KitMarkdownRendererProps['components']>\nimport { MentionChip } from '../../chat/MentionMenu'\nimport { QuietLink } from '../../citations/QuietMarks'\nimport { rehypeDocEntityPills } from '../../chat/rehype-doc-entity-pills'\nimport { workspaceDocIdFromHref } from '../../chat/doc-links'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { MermaidDiagram } from './MermaidDiagram'\nimport { useDocumentWorkspace, WorkspaceDocumentReference } from './DocumentWorkspaceContext'\n\n/** Plain text of a link's children (the `@Label` of a mention link). */\nfunction childrenText(children: React.ReactNode): string {\n return React.Children.toArray(children)\n .map((child) => (typeof child === 'string' || typeof child === 'number' ? String(child) : ''))\n .join('')\n}\n\n/** A mention chip; a mention of the reader stands out. */\nfunction MentionLink({ kind, id, text }: { kind: MentionKind; id: string; text: string }) {\n const currentUserId = useArbiSession().user?.external_id\n return (\n <MentionChip\n kind={kind}\n id={id}\n label={text.replace(/^@/, '')}\n isSelf={kind === 'user' && id === currentUserId}\n />\n )\n}\n\n/**\n * A link to elsewhere, as quiet text. Its menu (Open link / Copy link) is the deliberate step\n * the old confirmation dialog used to be; nothing opens until the menu's primary row is chosen.\n */\nexport function ExternalLink({ href, children }: React.ComponentPropsWithoutRef<'a'>) {\n return (\n <QuietLink href={href} kind=\"external\">\n {children}\n </QuietLink>\n )\n}\n\n/**\n * A workspace document referenced by a link's href rather than by its text.\n *\n * `rehypeDocEntityPills` turns a bare `doc-…` id into a pill, but it only walks\n * TEXT nodes — so `[NVDA DCF Valuation Report](…doc-abc12345…)`, which is how an\n * answer links an artifact it just saved, keeps the id in the href where the\n * plugin never looks. The link then fell through to `ExternalLink`, and opening\n * your own workspace document asked you to confirm an \"external link\" and\n * launched a new tab. It opens in the document viewer, like the pill and the\n * artifact card already do.\n */\nexport function InternalDocLink({\n docId,\n href,\n children,\n}: React.ComponentPropsWithoutRef<'a'> & { docId: string }) {\n const { openDocument } = useBlocksEnvironment()\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) {\n return (\n <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId}>\n {children}\n </WorkspaceDocumentReference>\n )\n }\n\n return (\n <QuietLink href={href} kind=\"document\" onOpen={() => openDocument(docId)}>\n {children}\n </QuietLink>\n )\n}\n\n/** A document of the workspace, as a pill: the host's chip, else the document entity. */\nexport function DocumentChip({ docId }: { docId: string }) {\n const render = useArbiHost().chat?.renderDocumentChip\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) return <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId} />\n return render ? <>{render(docId)}</> : <DefaultDocumentChip docId={docId} />\n}\n\nfunction DefaultDocumentChip({ docId }: { docId: string }) {\n const { data: doc } = useDocument(docId)\n const { openDocument } = useBlocksEnvironment()\n if (!doc)\n return (\n <EntityPill\n icon={<FileText className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label={docId}\n size=\"sm\"\n onClick={() => openDocument(docId)}\n data-testid=\"doc-entity-pill\"\n />\n )\n return (\n <DocumentEntity doc={doc} onClick={() => openDocument(docId)} data-testid=\"doc-entity-pill\" />\n )\n}\n\n/** An email of the person's mailbox, as a pill: the host's chip, else a plain \"Email\". */\nexport function MailChip({ mailId }: { mailId: string }) {\n const render = useArbiHost().chat?.renderMailChip\n if (render) return <>{render(mailId)}</>\n return (\n <EntityPill\n icon={<Mail className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label=\"Email\"\n size=\"sm\"\n data-testid=\"mail-entity-pill\"\n />\n )\n}\n\n/**\n * The conversation's overrides, layered on the kit's defaults. Module scope, so the reference is stable\n * and memoised markdown blocks do not re-parse.\n */\nconst conversationMarkdownComponents: Partial<Components> = {\n a: function ConversationMarkdownLink({\n href,\n children,\n ...props\n }: React.ComponentPropsWithoutRef<'a'>) {\n const deploymentDomain = useBlocksEnvironment().runtimeConfig.deploymentDomain\n // @mentions: `linkMentions` turned them into `#mention-<id>` links; draw them as chips.\n const mention = mentionFromHref(href)\n if (mention) {\n return <MentionLink kind={mention.kind} id={mention.id} text={childrenText(children)} />\n }\n // Bookmarks: in-page anchors are near-invisible text; the menu jumps or copies the place.\n if (href?.startsWith('#') && !href.startsWith('#cite-')) {\n return (\n <QuietLink href={href} kind=\"anchor\">\n {children}\n </QuietLink>\n )\n }\n // Citations, `cite:` references and bare links: the kit's link.\n if (!href || href.startsWith('#') || href.startsWith('cite:')) {\n return (\n <MarkdownLink href={href} {...props}>\n {children}\n </MarkdownLink>\n )\n }\n // A workspace document is not an external link, wherever it is hosted: it opens in the viewer.\n const docId = workspaceDocIdFromHref(href, deploymentDomain)\n if (docId) {\n return (\n <InternalDocLink docId={docId} href={href} {...props}>\n {children}\n </InternalDocLink>\n )\n }\n return (\n <ExternalLink href={href} {...props}>\n {children}\n </ExternalLink>\n )\n },\n code: function ConversationMarkdownCode(\n props: React.ComponentPropsWithoutRef<'code'> & { inline?: boolean }\n ) {\n const isStreaming = useContext(MarkdownStreamingContext)\n const { className, children } = props\n const language = /language-(\\w+)/.exec(className || '')?.[1]\n if (!language) {\n // Answers often backtick a bare doc id (`doc-f7b3eeb5`). The text-node pass skips code, so\n // the id would stay monospace text; show it as the document pill. Only a whole id (eight\n // alphanumerics): while streaming, a partial one (\"doc-e\") would be looked up and 404.\n const codeText = typeof children === 'string' ? children.trim() : ''\n if (/^doc-[a-zA-Z0-9]{8}$/.test(codeText)) return <DocumentChip docId={codeText} />\n if (/^eml-[a-zA-Z0-9]{8}$/.test(codeText)) return <MailChip mailId={codeText} />\n }\n // Mermaid lazy-loads its own bundle and re-renders SVG on every change. While streaming the\n // fence is almost always partial, so it stays a code block until generation completes.\n if (language === 'mermaid' && !isStreaming) {\n return <MermaidDiagram chart={String(children).replace(/\\n$/, '')} />\n }\n return <MarkdownCode {...props} />\n },\n span: ({ children, className, ...props }: React.ComponentPropsWithoutRef<'span'>) => {\n const docId = (props as Record<string, unknown>)['data-doc-id'] as string | undefined\n if (docId) return <DocumentChip docId={docId} />\n const mailId = (props as Record<string, unknown>)['data-mail-id'] as string | undefined\n if (mailId) return <MailChip mailId={mailId} />\n return (\n <span className={className} {...props}>\n {children}\n </span>\n )\n },\n}\n\n/** Bare `doc-…` / `eml-…` ids in text become `<span data-doc-id>` / `<span data-mail-id>` pills. */\nconst conversationRehypePlugins = [rehypeDocEntityPills]\n\nexport type ConnectedMarkdownProps = Omit<KitMarkdownRendererProps, 'rehypePlugins'>\n\n/**\n * The kit's renderer with the conversation's overrides; a caller's `components` (e.g. the citation\n * core's) still win over both.\n */\nfunction ConnectedMarkdownComponent({ components, ...props }: ConnectedMarkdownProps) {\n const merged = useMemo(\n () =>\n components\n ? { ...conversationMarkdownComponents, ...components }\n : conversationMarkdownComponents,\n [components]\n )\n return (\n <KitMarkdownRenderer {...props} components={merged} rehypePlugins={conversationRehypePlugins} />\n )\n}\n\nexport const ConnectedMarkdown = React.memo(ConnectedMarkdownComponent)\n","/** The views of the document dialog (`ConnectedDocumentViewer layout=\"dialog\"`). */\n\n/**\n * - `review`: the parsed document with its AI findings, a cited passage marked;\n * - `document`: the whole viewer (PDF and text, markup, signing, versions, sharing);\n * - `ask`: a question about the document, which starts a thread about it.\n */\nexport type DocumentViewerTab = 'review' | 'document' | 'ask'\n\nexport const DEFAULT_DOCUMENT_VIEWER_TABS: readonly DocumentViewerTab[] = [\n 'review',\n 'document',\n 'ask',\n]\n\n/** The dialog's words; each has a neutral default. */\nexport interface DocumentViewerDialogLabels {\n review?: string\n document?: string\n ask?: string\n /** Above the ask bar. */\n askIntro?: string\n /** The ask bar's placeholder; `{title}` is the document's title. */\n askPlaceholder?: string\n}\n\nexport const DEFAULT_DOCUMENT_VIEWER_LABELS: Required<DocumentViewerDialogLabels> = {\n review: 'Review',\n document: 'Document',\n ask: 'Ask AI',\n askIntro:\n 'Your question starts a new thread about this document. The answer cites its passages and takes follow-ups.',\n askPlaceholder: 'Ask about {title}…',\n}\n\nexport const DEFAULT_ASK_SUGGESTIONS: readonly string[] = [\n 'Summarise the key points',\n 'List the dates and deadlines it mentions',\n 'Who are the people and organisations named, and what are their roles?',\n]\n","/**\n * The PDF document tools (markup, Freeze, signing, signature requests, productions) on the\n * signed-in session, for any host: the API client, the signed-in user, the host's notices and\n * document opening (`BlocksEnvironment`), and the shared caches a change refreshes. A host with its\n * own binding (its own lists to refresh, an XHR upload with progress, Mail) gives it as the host\n * configuration's `documentTools`, field by field. An enclosing `DocumentToolsProvider` (a dialog\n * with its own client) wins.\n */\n\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { arbiQueryKeys, refreshDocuments, useArbi } from '@arbidocs/react'\nimport {\n DocumentToolsProvider,\n clientUpload,\n documentBytesKey,\n useOptionalDocumentTools,\n type DocumentChange,\n type DocumentToolsClient,\n type DocumentToolsEnvironment,\n type DocumentToolsNotify,\n type DocumentUploadRequest,\n} from '@arbidocs/react/document-tools'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\n\n/** What a host binds of the document tools itself; each absent field is the kit's own. */\nexport interface DocumentToolsHost {\n /** The API client the tools call. Default: the host `arbi`'s. */\n client?: DocumentToolsClient\n /** The deployment domain keys are derived for (signing). Default: the host `arbi`'s. */\n deploymentDomain?: string\n /** Open a document or a version the tools made. Default: the environment's `openDocument`. */\n openDocument?: (documentRef: string) => void\n /** Refresh the host's lists after a change. Default: the shared document caches. */\n onDocumentsChanged?: DocumentToolsEnvironment['onDocumentsChanged']\n /** Upload a derived copy. Default: through the API client, into the open workspace. */\n uploadDocument?: DocumentToolsEnvironment['uploadDocument']\n /**\n * Where \"View certificate\" goes for a signature `reference` (e.g. the site's own verify page).\n * Default: the certificate link the API returns (on the deployment domain).\n */\n certificateUrl?: (reference: string) => string\n /** Email a document (a hook): absent, or returning nothing, when mail is not offered. */\n useEmailDocument?: () => ((documentRef: string) => void) | undefined\n}\n\nconst NO_EMAIL = () => undefined\n\nexport function ConnectedDocumentToolsProvider({ children }: { children: ReactNode }) {\n const enclosing = useOptionalDocumentTools()\n return enclosing ? <>{children}</> : <OwnDocumentTools>{children}</OwnDocumentTools>\n}\n\nfunction OwnDocumentTools({ children }: { children: ReactNode }) {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const host = useHost().documentTools\n const { user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { notify: environmentNotify, openDocument: openInHost } = useBlocksEnvironment()\n const useEmailDocument = host?.useEmailDocument ?? NO_EMAIL\n const emailDocument = useEmailDocument()\n const client = host?.client ?? (arbi.isLoggedIn ? arbi.getClient().fetch : null)\n const signer = useMemo(\n () => (user ? { name: user.name, email: user.email, externalId: user.externalId } : null),\n [user]\n )\n const notify = useCallback<DocumentToolsNotify>(\n (message, kind, options) =>\n environmentNotify(message, kind, {\n description: options?.description,\n action: options?.action,\n }),\n [environmentNotify]\n )\n const ownDocumentsChanged = useCallback(\n async (ids: string[], change: DocumentChange) => {\n // The list carries each version's markup count and the copies; a signature or a saved\n // version is a new current version, with new versions and a new rendered PDF.\n const refresh: Promise<unknown>[] = [refreshDocuments(queryClient, arbi, ids)]\n if (change === 'signed' || change === 'version')\n for (const id of ids)\n refresh.push(\n queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documentVersions(id) }),\n queryClient.invalidateQueries({ queryKey: documentBytesKey(id) })\n )\n await Promise.all(refresh)\n },\n [queryClient, arbi]\n )\n // The server files an upload in the session's open workspace: re-assert it first.\n const ownUpload = useCallback(\n async (request: DocumentUploadRequest) => {\n if (!client) throw new Error('Sign in to save a copy.')\n await ensureWorkspaceOpen()\n return clientUpload(client)(request)\n },\n [client, ensureWorkspaceOpen]\n )\n const ownOpenDocument = useCallback((ref: string) => openInHost(ref), [openInHost])\n if (!client) return <>{children}</>\n return (\n <DocumentToolsProvider\n client={client}\n deploymentDomain={host?.deploymentDomain}\n user={signer}\n notify={notify}\n openDocument={host?.openDocument ?? ownOpenDocument}\n onDocumentsChanged={host?.onDocumentsChanged ?? ownDocumentsChanged}\n uploadDocument={host?.uploadDocument ?? ownUpload}\n emailDocument={emailDocument}\n certificateUrl={host?.certificateUrl}\n >\n {children}\n </DocumentToolsProvider>\n )\n}\n","/**\n * What a host adds to the connected document viewer. The viewer reads documents, versions, PDFs,\n * markup and signatures on the signed-in session by itself; these are the host's own things it\n * cannot know: documents the host makes on the client (an artifact streaming in from a chat, an\n * unsaved draft), the host's dialogs and workflows a document action opens, and how the host lays\n * the viewer out. It is the host configuration's `viewer`. Every field is optional: without one the\n * viewer offers less (no Translate button, no draft controls), never something that does nothing.\n * What changes while the viewer is open is read through hooks (`use…`).\n */\n\nimport type { ReactNode } from 'react'\nimport type { components } from '@arbidocs/client'\nimport { useHost } from '../../provider/host'\n\n/** A document's record, as the viewer reads it. */\nexport type ViewerDocumentRecord = components['schemas']['DocResponse']\n\n/** An artifact being generated in a chat, shown in the viewer as it streams. */\nexport interface ViewerStreamingDocument {\n title?: string | null\n /** The content so far (Markdown, or the html/react source of a live artifact). */\n content: string\n /** How it is carried: a document draft, a live `html` / `react` artifact, an `image`. */\n mode?: string | null\n isComplete: boolean\n}\n\n/** A document the user started on the client, with no backend record until it is saved. */\nexport interface ViewerDraftDocument {\n kind: 'text' | 'audio' | 'photo' | 'video'\n title?: string | null\n /** A text draft's starting content. */\n content?: string | null\n}\n\nexport interface DocumentViewerSupport {\n /** The artifact streaming in as this document, if one is (a hook). */\n useStreamingDocument?: (documentId: string) => ViewerStreamingDocument | undefined\n /** The unsaved draft with this client id, if there is one (a hook). */\n useDraftDocument?: (draftId: string) => ViewerDraftDocument | undefined\n /** A draft's kind (text, photo, audio, video), in place of the tabs. */\n renderDraftKind?: (draftId: string) => ReactNode\n /** A draft's name (editable), in place of the title. */\n renderDraftTitle?: (draftId: string) => ReactNode\n /** The recorder of a photo, audio or video draft: the whole body of the viewer. */\n renderCaptureDraft?: (draftId: string) => ReactNode\n /** A text draft was saved as `documentId`; the viewer shows it next. */\n onDraftSaved?: (draftId: string, documentId: string) => void\n /** Documents related to the one open (near duplicates), beside its name. */\n renderRelated?: (document: ViewerDocumentRecord) => ReactNode\n /** A document as a pill (the comparison's other side). Default: its name. */\n renderDocumentPill?: (documentId: string) => ReactNode\n /** Open the host's share dialog for the document. Default: share it with the workspace. */\n share?: (document: { id: string; name: string | undefined; isPrivate: boolean }) => void\n /** Ask the assistant about a version (`doc-…@v2`) open read-only. Absent: not offered. */\n askAboutVersion?: (versionRef: string) => void\n /** Translate the document (or the version) on screen. Absent: not offered. */\n translate?: (documentRef: string) => void\n /** Start an image generation from the image on screen. Absent: not offered. */\n useImageAsReference?: (documentId: string) => void\n /**\n * A citation being edited elsewhere (a fact's sources, a field's) picks its passages in the text\n * view: clicks and selections there are handed to it (a hook). Absent: passages are not pickable.\n */\n usePassageCitation?: () => PassageCitation | undefined\n /** Open the document's passages in the host's navigator (a passage's menu). Absent: not offered. */\n openInNavigator?: (documentId: string) => void\n /** Start a new label or field in the host's editor (the passage tagging panel). Absent: not offered. */\n createTag?: () => void\n /** How dates read (versions, signatures). Default: `fmtDate`. */\n formatDate?: (iso: string) => string\n /** Whether the viewer is shown in another window, where PDF pages render without the page's web\n * fonts (a hook). */\n useIsDetached?: () => boolean\n}\n\n/** A passage picked for a citation: its chunk and, when known, its page. */\nexport interface PickedPassage {\n chunk_id: string\n page?: number\n}\n\n/** The citation a host is editing, as the text view sees it. */\nexport interface PassageCitation {\n /** The citation picking passages now, and the document it picks in; null when none is. */\n active: { documentId: string; key: string | null } | null\n /** Passages to light (a fact's cited passages while its sources are open). */\n highlighted: readonly string[]\n /** Passages added to the citation. */\n pick: (passages: PickedPassage[]) => void\n /** Passages taken off it. */\n unpick: (chunkIds: string[]) => void\n}\n\nconst NO_SUPPORT: DocumentViewerSupport = {}\n\nexport function useDocumentViewerSupport(): DocumentViewerSupport {\n return useHost().viewer ?? NO_SUPPORT\n}\n\nconst NONE = () => undefined\nconst ATTACHED = () => false\n\n/** The artifact streaming in as this document (none without the host's). */\nexport function useViewerStreamingDocument(\n documentId: string\n): ViewerStreamingDocument | undefined {\n const useStreaming = useDocumentViewerSupport().useStreamingDocument ?? NONE\n return useStreaming(documentId)\n}\n\n/** The unsaved draft with this id (none without the host's). */\nexport function useViewerDraftDocument(draftId: string): ViewerDraftDocument | undefined {\n const useDraft = useDocumentViewerSupport().useDraftDocument ?? NONE\n return useDraft(draftId)\n}\n\n/** The citation picking passages (none without the host's). */\nexport function useViewerPassageCitation(): PassageCitation | undefined {\n const useCitation = useDocumentViewerSupport().usePassageCitation ?? NONE\n return useCitation()\n}\n\n/** Whether the viewer is in another window (never without the host's). */\nexport function useViewerIsDetached(): boolean {\n const useDetached = useDocumentViewerSupport().useIsDetached ?? ATTACHED\n return useDetached()\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { NativeDocxComparison } from './chunk-AEXFUPO7.js';
3
- import { useConnectedNativeDocxAdapter } from './chunk-CWV4SLRT.js';
3
+ import { useConnectedNativeDocxAdapter } from './chunk-YA2H33OW.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  function ConnectedNativeDocxComparison({
@@ -12,5 +12,5 @@ function ConnectedNativeDocxComparison({
12
12
  }
13
13
 
14
14
  export { ConnectedNativeDocxComparison };
15
- //# sourceMappingURL=chunk-SUW7USWW.js.map
16
- //# sourceMappingURL=chunk-SUW7USWW.js.map
15
+ //# sourceMappingURL=chunk-L4JJKGUD.js.map
16
+ //# sourceMappingURL=chunk-L4JJKGUD.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/ConnectedNativeDocxComparison.tsx"],"names":[],"mappings":";;;;AAOO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAyF;AACvF,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,2BAAQ,oBAAA,EAAA,EAAsB,GAAG,OAAO,OAAA,EAAkB,UAAA,EAAY,QAAQ,cAAA,EAAgB,CAAA;AAChG","file":"chunk-SUW7USWW.js","sourcesContent":["import {\n NativeDocxComparison,\n type NativeDocxComparisonProps,\n} from '../../docx/NativeDocxComparison'\nimport { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\n\n/** The Word redline of two documents or versions, on the signed-in session. */\nexport function ConnectedNativeDocxComparison({\n fontBaseUrl,\n ...props\n}: Omit<NativeDocxComparisonProps, 'adapter' | 'onCompared'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <NativeDocxComparison {...props} adapter={adapter} onCompared={adapter.onVersionSaved} />\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/ConnectedNativeDocxComparison.tsx"],"names":[],"mappings":";;;;AAOO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAyF;AACvF,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,2BAAQ,oBAAA,EAAA,EAAsB,GAAG,OAAO,OAAA,EAAkB,UAAA,EAAY,QAAQ,cAAA,EAAgB,CAAA;AAChG","file":"chunk-L4JJKGUD.js","sourcesContent":["import {\n NativeDocxComparison,\n type NativeDocxComparisonProps,\n} from '../../docx/NativeDocxComparison'\nimport { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\n\n/** The Word redline of two documents or versions, on the signed-in session. */\nexport function ConnectedNativeDocxComparison({\n fontBaseUrl,\n ...props\n}: Omit<NativeDocxComparisonProps, 'adapter' | 'onCompared'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <NativeDocxComparison {...props} adapter={adapter} onCompared={adapter.onVersionSaved} />\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkRFIBUWLF_cjs = require('./chunk-RFIBUWLF.cjs');
5
- var chunkQDHVZ56E_cjs = require('./chunk-QDHVZ56E.cjs');
6
- var chunkXUEJYHEP_cjs = require('./chunk-XUEJYHEP.cjs');
5
+ var chunkZTTR5MMZ_cjs = require('./chunk-ZTTR5MMZ.cjs');
6
+ var chunkZDZY6OPL_cjs = require('./chunk-ZDZY6OPL.cjs');
7
7
  var chunkAQPZ4QMV_cjs = require('./chunk-AQPZ4QMV.cjs');
8
8
  var chunkSIB6C7P7_cjs = require('./chunk-SIB6C7P7.cjs');
9
9
  var chunkDVUZTGVL_cjs = require('./chunk-DVUZTGVL.cjs');
@@ -17,8 +17,8 @@ var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
17
17
  var chunkINIHNWTA_cjs = require('./chunk-INIHNWTA.cjs');
18
18
  var chunk555BS22J_cjs = require('./chunk-555BS22J.cjs');
19
19
  var chunkCQ2YSHIF_cjs = require('./chunk-CQ2YSHIF.cjs');
20
- var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
21
20
  var chunkUFEXJIEY_cjs = require('./chunk-UFEXJIEY.cjs');
21
+ var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
22
22
  var chunkT6GRWWRY_cjs = require('./chunk-T6GRWWRY.cjs');
23
23
  var chunkGMM3RBIB_cjs = require('./chunk-GMM3RBIB.cjs');
24
24
  var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
@@ -85,7 +85,7 @@ function defaultScopeRenderer(scopeSource) {
85
85
  if (!scopeSource) return void 0;
86
86
  return function renderScope(_field, value, onChange) {
87
87
  return /* @__PURE__ */ jsxRuntime.jsx(
88
- chunkXUEJYHEP_cjs.ScopePicker,
88
+ chunkZDZY6OPL_cjs.ScopePicker,
89
89
  {
90
90
  folders: scopeSource.folders,
91
91
  unfiledCount: scopeSource.unfiledCount,
@@ -1756,7 +1756,7 @@ function WorkflowRunner({
1756
1756
  /* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
1757
1757
  /* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
1758
1758
  /* @__PURE__ */ jsxRuntime.jsx("fieldset", { disabled: run.isLocked(step.id), className: "contents", children: /* @__PURE__ */ jsxRuntime.jsx(
1759
- chunkQDHVZ56E_cjs.SchemaForm,
1759
+ chunkZTTR5MMZ_cjs.SchemaForm,
1760
1760
  {
1761
1761
  fields: step.inputs,
1762
1762
  values: run.inputs,
@@ -1810,7 +1810,7 @@ function WorkflowRunner({
1810
1810
  /* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
1811
1811
  !(run.phaseOf(step.id) === "done" && run.stateOf(step.id)?.by) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", "data-testid": tid(`${step.id}-status`), children: run.phaseOf(step.id) === "done" ? l.approved : run.phaseOf(step.id) === "skipped" ? l.skipped : l.awaitingReview }),
1812
1812
  (step.fields ?? []).length > 0 && run.phaseOf(step.id) === "ready" && /* @__PURE__ */ jsxRuntime.jsx(
1813
- chunkQDHVZ56E_cjs.SchemaForm,
1813
+ chunkZTTR5MMZ_cjs.SchemaForm,
1814
1814
  {
1815
1815
  fields: step.fields ?? [],
1816
1816
  values: run.inputs,
@@ -2895,7 +2895,7 @@ function WorkflowStepAction({
2895
2895
  const errors = chunk555BS22J_cjs.validateInputs(asForm(step), values);
2896
2896
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 p-1", "data-testid": tid, children: [
2897
2897
  /* @__PURE__ */ jsxRuntime.jsx(
2898
- chunkQDHVZ56E_cjs.SchemaForm,
2898
+ chunkZTTR5MMZ_cjs.SchemaForm,
2899
2899
  {
2900
2900
  fields,
2901
2901
  values,
@@ -3599,7 +3599,7 @@ function AgentCreator({
3599
3599
  ] })
3600
3600
  ] }),
3601
3601
  /* @__PURE__ */ jsxRuntime.jsx(
3602
- chunkXUEJYHEP_cjs.FoldSection,
3602
+ chunkZDZY6OPL_cjs.FoldSection,
3603
3603
  {
3604
3604
  label: l.advanced,
3605
3605
  open: advancedOpen,
@@ -6149,7 +6149,7 @@ function TaskTable(props) {
6149
6149
  isMe: mine
6150
6150
  };
6151
6151
  };
6152
- const renderPerson = props.renderPerson ?? ((person) => /* @__PURE__ */ jsxRuntime.jsx(chunkQDHVZ56E_cjs.PersonPill, { person }));
6152
+ const renderPerson = props.renderPerson ?? ((person) => /* @__PURE__ */ jsxRuntime.jsx(chunkZTTR5MMZ_cjs.PersonPill, { person }));
6153
6153
  const q = (query.trim() || (props.filterText ?? "").trim()).toLowerCase();
6154
6154
  const counts = react.useMemo(() => {
6155
6155
  const map = new Map(STATUS_ORDER.map((s) => [s, 0]));
@@ -6763,7 +6763,7 @@ function TaskInbox(p) {
6763
6763
  else next.add(id);
6764
6764
  return next;
6765
6765
  });
6766
- p.renderPerson ?? ((value) => /* @__PURE__ */ jsxRuntime.jsx(chunkQDHVZ56E_cjs.PersonPill, { person: value }));
6766
+ p.renderPerson ?? ((value) => /* @__PURE__ */ jsxRuntime.jsx(chunkZTTR5MMZ_cjs.PersonPill, { person: value }));
6767
6767
  const taskById = new Map(all.map((t) => [t.external_id, t]));
6768
6768
  const visible = new Set(rows.map((t) => t.external_id));
6769
6769
  for (const task of rows) {
@@ -9566,7 +9566,7 @@ function TaskRunsDialog({
9566
9566
  "rounded-full px-2 py-0.5 text-xs font-medium capitalize",
9567
9567
  STATUS_STYLE[data.status] ?? "text-muted-foreground"
9568
9568
  ),
9569
- children: chunkQDHVZ56E_cjs.workflowRunStatusLabel(data.status)
9569
+ children: chunkZTTR5MMZ_cjs.workflowRunStatusLabel(data.status)
9570
9570
  }
9571
9571
  )
9572
9572
  },
@@ -10082,7 +10082,7 @@ function WorkflowComposer({
10082
10082
  },
10083
10083
  "data-testid": `${id}-dropzone`,
10084
10084
  children: /* @__PURE__ */ jsxRuntime.jsx(
10085
- chunkXUEJYHEP_cjs.AddFilesFirst,
10085
+ chunkZDZY6OPL_cjs.AddFilesFirst,
10086
10086
  {
10087
10087
  reason: l.addFilesReason,
10088
10088
  action: addFilesAction,
@@ -10092,7 +10092,7 @@ function WorkflowComposer({
10092
10092
  }
10093
10093
  ),
10094
10094
  !noFiles && workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
10095
- chunkQDHVZ56E_cjs.SchemaForm,
10095
+ chunkZTTR5MMZ_cjs.SchemaForm,
10096
10096
  {
10097
10097
  fields,
10098
10098
  values: values.inputs,
@@ -10725,7 +10725,7 @@ function WorkTaskComposer({
10725
10725
  )
10726
10726
  ] }),
10727
10727
  workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
10728
- chunkQDHVZ56E_cjs.SchemaForm,
10728
+ chunkZTTR5MMZ_cjs.SchemaForm,
10729
10729
  {
10730
10730
  fields,
10731
10731
  values: values.inputs,
@@ -11285,7 +11285,7 @@ function notifiedLabel(notified, missed) {
11285
11285
  var describeSignalTrigger = (signal) => `When a step signals ${signal}`;
11286
11286
  function describeTrigger(workflow) {
11287
11287
  if (workflow.after_conversation_ext_id) return "After a thread is marked done";
11288
- const signal = chunkQDHVZ56E_cjs.workflowSignal(workflow);
11288
+ const signal = chunkZTTR5MMZ_cjs.workflowSignal(workflow);
11289
11289
  if (signal) return describeSignalTrigger(signal);
11290
11290
  if (workflow.event_kind)
11291
11291
  return AUTOMATION_EVENTS.find((event) => event.id === workflow.event_kind)?.label ?? workflow.event_kind.replaceAll("_", " ");
@@ -13282,5 +13282,5 @@ exports.workflowTaskFields = workflowTaskFields;
13282
13282
  exports.workflowToComposerValues = workflowToComposerValues;
13283
13283
  exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
13284
13284
  exports.workflowWhen = workflowWhen;
13285
- //# sourceMappingURL=chunk-2LK27F43.cjs.map
13286
- //# sourceMappingURL=chunk-2LK27F43.cjs.map
13285
+ //# sourceMappingURL=chunk-LVC4ZGYW.cjs.map
13286
+ //# sourceMappingURL=chunk-LVC4ZGYW.cjs.map