@arbidocs/blocks 0.4.152 → 0.4.154

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 (221) hide show
  1. package/dist/{ConnectedNativeDocxComparison-OFPIXNJB.js → ConnectedNativeDocxComparison-OLWRQSRS.js} +11 -11
  2. package/dist/{ConnectedNativeDocxComparison-OFPIXNJB.js.map → ConnectedNativeDocxComparison-OLWRQSRS.js.map} +1 -1
  3. package/dist/{ConnectedNativeDocxComparison-Y5BNLNH6.cjs → ConnectedNativeDocxComparison-YORMOPPN.cjs} +12 -12
  4. package/dist/{ConnectedNativeDocxComparison-Y5BNLNH6.cjs.map → ConnectedNativeDocxComparison-YORMOPPN.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxEditor-LRYU5HPA.js → ConnectedNativeDocxEditor-34EBIIFS.js} +10 -10
  6. package/dist/{ConnectedNativeDocxEditor-LRYU5HPA.js.map → ConnectedNativeDocxEditor-34EBIIFS.js.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-HTEW5JAH.cjs → ConnectedNativeDocxEditor-EHTWGGX3.cjs} +12 -12
  8. package/dist/{ConnectedNativeDocxEditor-HTEW5JAH.cjs.map → ConnectedNativeDocxEditor-EHTWGGX3.cjs.map} +1 -1
  9. package/dist/{ConnectedStreamedWordArtifact-QW74LKHN.cjs → ConnectedStreamedWordArtifact-5DK6QGYN.cjs} +12 -12
  10. package/dist/ConnectedStreamedWordArtifact-5DK6QGYN.cjs.map +1 -0
  11. package/dist/{ConnectedStreamedWordArtifact-QAUVUCSX.js → ConnectedStreamedWordArtifact-GLIDLSAS.js} +11 -11
  12. package/dist/{ConnectedStreamedWordArtifact-QAUVUCSX.js.map → ConnectedStreamedWordArtifact-GLIDLSAS.js.map} +1 -1
  13. package/dist/WorkspaceTableView-5OWX53R5.js +376 -0
  14. package/dist/WorkspaceTableView-5OWX53R5.js.map +1 -0
  15. package/dist/WorkspaceTableView-ZFMAYHUD.cjs +378 -0
  16. package/dist/WorkspaceTableView-ZFMAYHUD.cjs.map +1 -0
  17. package/dist/agents/index.cjs +282 -282
  18. package/dist/agents/index.js +7 -7
  19. package/dist/{chunk-RQ2Y7USX.cjs → chunk-2VHYOTWW.cjs} +3 -3
  20. package/dist/chunk-2VHYOTWW.cjs.map +1 -0
  21. package/dist/{chunk-DTROMMDX.cjs → chunk-3VULDTNL.cjs} +4 -4
  22. package/dist/{chunk-DTROMMDX.cjs.map → chunk-3VULDTNL.cjs.map} +1 -1
  23. package/dist/{chunk-UTTTJSQU.cjs → chunk-4RPBUMHB.cjs} +4 -4
  24. package/dist/{chunk-UTTTJSQU.cjs.map → chunk-4RPBUMHB.cjs.map} +1 -1
  25. package/dist/chunk-53RCZPMR.cjs +496 -0
  26. package/dist/chunk-53RCZPMR.cjs.map +1 -0
  27. package/dist/chunk-5TDGVOR5.js +142 -0
  28. package/dist/chunk-5TDGVOR5.js.map +1 -0
  29. package/dist/{chunk-CU2O32Z4.cjs → chunk-6QAAIDQQ.cjs} +62 -99
  30. package/dist/chunk-6QAAIDQQ.cjs.map +1 -0
  31. package/dist/chunk-7HHYMDPE.js +431 -0
  32. package/dist/chunk-7HHYMDPE.js.map +1 -0
  33. package/dist/{chunk-SMN32BQ3.cjs → chunk-7NL6WJER.cjs} +3 -160
  34. package/dist/chunk-7NL6WJER.cjs.map +1 -0
  35. package/dist/{chunk-T74Q3MCZ.cjs → chunk-BDA3RHYD.cjs} +4 -4
  36. package/dist/{chunk-T74Q3MCZ.cjs.map → chunk-BDA3RHYD.cjs.map} +1 -1
  37. package/dist/{chunk-IXWJGOM2.js → chunk-BQ77KSXU.js} +3 -3
  38. package/dist/{chunk-IXWJGOM2.js.map → chunk-BQ77KSXU.js.map} +1 -1
  39. package/dist/chunk-BTF4AZMG.js +148 -0
  40. package/dist/chunk-BTF4AZMG.js.map +1 -0
  41. package/dist/{chunk-HALD6ZB5.cjs → chunk-C3SMTA3C.cjs} +4 -4
  42. package/dist/{chunk-HALD6ZB5.cjs.map → chunk-C3SMTA3C.cjs.map} +1 -1
  43. package/dist/{chunk-GAYMJWTC.cjs → chunk-CB4TIDEX.cjs} +6 -6
  44. package/dist/{chunk-GAYMJWTC.cjs.map → chunk-CB4TIDEX.cjs.map} +1 -1
  45. package/dist/{chunk-KPZZ5FHE.cjs → chunk-CNHUJRQ4.cjs} +10 -6
  46. package/dist/chunk-CNHUJRQ4.cjs.map +1 -0
  47. package/dist/{chunk-Q4BY2CQQ.cjs → chunk-CQCNU5KT.cjs} +28 -28
  48. package/dist/{chunk-Q4BY2CQQ.cjs.map → chunk-CQCNU5KT.cjs.map} +1 -1
  49. package/dist/{chunk-GRGS5M6O.cjs → chunk-CROGFB46.cjs} +160 -3
  50. package/dist/chunk-CROGFB46.cjs.map +1 -0
  51. package/dist/{chunk-QN47Q4N7.js → chunk-CU6LDQ57.js} +3 -3
  52. package/dist/{chunk-QN47Q4N7.js.map → chunk-CU6LDQ57.js.map} +1 -1
  53. package/dist/{chunk-EF4ZLKRM.js → chunk-DEPF5LQI.js} +3 -3
  54. package/dist/{chunk-EF4ZLKRM.js.map → chunk-DEPF5LQI.js.map} +1 -1
  55. package/dist/{chunk-JAANWQGB.js → chunk-ETZ5A3GU.js} +3 -3
  56. package/dist/{chunk-JAANWQGB.js.map → chunk-ETZ5A3GU.js.map} +1 -1
  57. package/dist/{chunk-TBEVGWY3.js → chunk-F57LNUSZ.js} +10 -6
  58. package/dist/chunk-F57LNUSZ.js.map +1 -0
  59. package/dist/{chunk-GFNELPDP.cjs → chunk-FM3IRQJW.cjs} +10 -5
  60. package/dist/chunk-FM3IRQJW.cjs.map +1 -0
  61. package/dist/chunk-FPHTSNOE.js +465 -0
  62. package/dist/chunk-FPHTSNOE.js.map +1 -0
  63. package/dist/{chunk-OVR3XMYL.js → chunk-FYZXDZM7.js} +3 -3
  64. package/dist/{chunk-OVR3XMYL.js.map → chunk-FYZXDZM7.js.map} +1 -1
  65. package/dist/{chunk-2FLWPM3B.cjs → chunk-GC2FSPSQ.cjs} +7 -7
  66. package/dist/{chunk-2FLWPM3B.cjs.map → chunk-GC2FSPSQ.cjs.map} +1 -1
  67. package/dist/{chunk-DB2OXRQC.js → chunk-GO3BN76C.js} +7 -7
  68. package/dist/{chunk-DB2OXRQC.js.map → chunk-GO3BN76C.js.map} +1 -1
  69. package/dist/{chunk-XZIYRKLW.cjs → chunk-H32DV7XS.cjs} +5 -139
  70. package/dist/chunk-H32DV7XS.cjs.map +1 -0
  71. package/dist/{chunk-4236BRZK.js → chunk-HP2C4MD3.js} +29 -3
  72. package/dist/chunk-HP2C4MD3.js.map +1 -0
  73. package/dist/{chunk-ZP6Q3KXU.cjs → chunk-HUATKA3M.cjs} +4 -4
  74. package/dist/{chunk-ZP6Q3KXU.cjs.map → chunk-HUATKA3M.cjs.map} +1 -1
  75. package/dist/chunk-ISHFVKVU.js +304 -0
  76. package/dist/chunk-ISHFVKVU.js.map +1 -0
  77. package/dist/chunk-JUUOJP7I.cjs +164 -0
  78. package/dist/chunk-JUUOJP7I.cjs.map +1 -0
  79. package/dist/{chunk-4KMLM3GY.cjs → chunk-KBO75NLM.cjs} +7 -7
  80. package/dist/{chunk-4KMLM3GY.cjs.map → chunk-KBO75NLM.cjs.map} +1 -1
  81. package/dist/{chunk-Z4NQ3TED.js → chunk-KCSIX7CY.js} +3 -3
  82. package/dist/{chunk-Z4NQ3TED.js.map → chunk-KCSIX7CY.js.map} +1 -1
  83. package/dist/{chunk-DN2KI4BU.js → chunk-KDLX5AA7.js} +3 -3
  84. package/dist/{chunk-DN2KI4BU.js.map → chunk-KDLX5AA7.js.map} +1 -1
  85. package/dist/{chunk-WFA2GVZJ.js → chunk-MF5KQ4PS.js} +3 -3
  86. package/dist/{chunk-WFA2GVZJ.js.map → chunk-MF5KQ4PS.js.map} +1 -1
  87. package/dist/{chunk-YXNNNP57.js → chunk-MNG7N6M2.js} +4 -4
  88. package/dist/{chunk-YXNNNP57.js.map → chunk-MNG7N6M2.js.map} +1 -1
  89. package/dist/chunk-MSFQDELO.cjs +482 -0
  90. package/dist/chunk-MSFQDELO.cjs.map +1 -0
  91. package/dist/{chunk-KSHKTOY2.js → chunk-NUSBINUM.js} +3 -3
  92. package/dist/chunk-NUSBINUM.js.map +1 -0
  93. package/dist/{chunk-EYKISBDO.cjs → chunk-OALEDG67.cjs} +5 -5
  94. package/dist/{chunk-EYKISBDO.cjs.map → chunk-OALEDG67.cjs.map} +1 -1
  95. package/dist/{chunk-COCGRJLA.cjs → chunk-OFV3PRF2.cjs} +7 -7
  96. package/dist/{chunk-COCGRJLA.cjs.map → chunk-OFV3PRF2.cjs.map} +1 -1
  97. package/dist/chunk-OOU4QLRK.cjs +319 -0
  98. package/dist/chunk-OOU4QLRK.cjs.map +1 -0
  99. package/dist/chunk-OU3RGQFX.cjs +136 -0
  100. package/dist/chunk-OU3RGQFX.cjs.map +1 -0
  101. package/dist/{chunk-3PCBYOIZ.js → chunk-P6RIBIVN.js} +38 -7
  102. package/dist/chunk-P6RIBIVN.js.map +1 -0
  103. package/dist/{chunk-LXTOOUEN.cjs → chunk-Q7CQYYZW.cjs} +5 -5
  104. package/dist/{chunk-LXTOOUEN.cjs.map → chunk-Q7CQYYZW.cjs.map} +1 -1
  105. package/dist/{chunk-CROTH2BS.js → chunk-QKR5LWDO.js} +9 -40
  106. package/dist/{chunk-CROTH2BS.js.map → chunk-QKR5LWDO.js.map} +1 -1
  107. package/dist/{chunk-HUJF2XM2.js → chunk-RE7NULEY.js} +3 -3
  108. package/dist/{chunk-HUJF2XM2.js.map → chunk-RE7NULEY.js.map} +1 -1
  109. package/dist/chunk-REH7PX3N.cjs +145 -0
  110. package/dist/chunk-REH7PX3N.cjs.map +1 -0
  111. package/dist/chunk-RQKWYKZY.js +127 -0
  112. package/dist/chunk-RQKWYKZY.js.map +1 -0
  113. package/dist/{chunk-U6JQ4KMX.cjs → chunk-SN2GZ4ZM.cjs} +29 -2
  114. package/dist/chunk-SN2GZ4ZM.cjs.map +1 -0
  115. package/dist/{chunk-R6VCPDPF.js → chunk-SZSJGZSO.js} +156 -6
  116. package/dist/chunk-SZSJGZSO.js.map +1 -0
  117. package/dist/{chunk-US3S4DCB.js → chunk-TF7HN5EU.js} +10 -5
  118. package/dist/chunk-TF7HN5EU.js.map +1 -0
  119. package/dist/{chunk-YKQ2DPIP.js → chunk-VF5EUAIV.js} +3 -3
  120. package/dist/{chunk-YKQ2DPIP.js.map → chunk-VF5EUAIV.js.map} +1 -1
  121. package/dist/{chunk-KMZWKSKO.cjs → chunk-VZPFYZZU.cjs} +4 -4
  122. package/dist/{chunk-KMZWKSKO.cjs.map → chunk-VZPFYZZU.cjs.map} +1 -1
  123. package/dist/{chunk-ZLEYLCE4.js → chunk-WK6FVIF7.js} +6 -156
  124. package/dist/chunk-WK6FVIF7.js.map +1 -0
  125. package/dist/{chunk-COA3S3CZ.js → chunk-XI37A7HH.js} +4 -4
  126. package/dist/{chunk-COA3S3CZ.js.map → chunk-XI37A7HH.js.map} +1 -1
  127. package/dist/{chunk-LGBAZD37.js → chunk-XRL4R2TT.js} +7 -139
  128. package/dist/chunk-XRL4R2TT.js.map +1 -0
  129. package/dist/{chunk-4JNKXOFZ.cjs → chunk-YBJ4QGNH.cjs} +11 -11
  130. package/dist/{chunk-4JNKXOFZ.cjs.map → chunk-YBJ4QGNH.cjs.map} +1 -1
  131. package/dist/{chunk-GFOEWPAP.cjs → chunk-YF3QUHKN.cjs} +49 -12
  132. package/dist/chunk-YF3QUHKN.cjs.map +1 -0
  133. package/dist/{chunk-H4D7WKDY.js → chunk-YNMO3DSR.js} +3 -3
  134. package/dist/{chunk-H4D7WKDY.js.map → chunk-YNMO3DSR.js.map} +1 -1
  135. package/dist/citations/index.cjs +10 -10
  136. package/dist/citations/index.js +2 -2
  137. package/dist/collaboration/index.cjs +77 -77
  138. package/dist/collaboration/index.js +2 -2
  139. package/dist/connect/docx.cjs +14 -14
  140. package/dist/connect/docx.js +10 -10
  141. package/dist/connect/index.cjs +1577 -962
  142. package/dist/connect/index.cjs.map +1 -1
  143. package/dist/connect/index.d.ts +3 -0
  144. package/dist/connect/index.js +1014 -450
  145. package/dist/connect/index.js.map +1 -1
  146. package/dist/connect/viewer.cjs +66 -66
  147. package/dist/connect/viewer.js +10 -10
  148. package/dist/connection/ConnectionProvider.d.ts +7 -0
  149. package/dist/connection/projects/ConnectedProjectsPanel.d.ts +34 -0
  150. package/dist/connection/projects/index.d.ts +1 -0
  151. package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.d.ts +37 -0
  152. package/dist/connection/workspace-dashboard/dashboard-rows.d.ts +42 -0
  153. package/dist/connection/workspace-dashboard/index.d.ts +1 -0
  154. package/dist/connection/workspace-list/ConnectedWorkspaceList.d.ts +37 -0
  155. package/dist/connection/workspace-list/WorkspaceCardsView.d.ts +15 -0
  156. package/dist/connection/workspace-list/WorkspaceFilterMenu.d.ts +4 -0
  157. package/dist/connection/workspace-list/WorkspaceTableView.d.ts +13 -0
  158. package/dist/connection/workspace-list/index.d.ts +5 -0
  159. package/dist/connection/workspace-list/projectBilling.d.ts +21 -0
  160. package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +251 -0
  161. package/dist/connection/workspace-list/workspaceTable.d.ts +58 -0
  162. package/dist/connection/workspace-settings/ConnectedWorkspaceMembers.d.ts +26 -0
  163. package/dist/connection/workspace-settings/ConnectedWorkspaceSettings.d.ts +7 -9
  164. package/dist/connection/workspace-settings/index.d.ts +2 -1
  165. package/dist/connection/workspace-settings/useConnectedWorkspaceSettings.d.ts +0 -1
  166. package/dist/facts/index.cjs +3 -3
  167. package/dist/facts/index.js +2 -2
  168. package/dist/files/index.cjs +169 -169
  169. package/dist/files/index.js +3 -3
  170. package/dist/home/index.cjs +119 -459
  171. package/dist/home/index.cjs.map +1 -1
  172. package/dist/home/index.js +13 -419
  173. package/dist/home/index.js.map +1 -1
  174. package/dist/index.cjs +510 -510
  175. package/dist/index.js +18 -18
  176. package/dist/provider/BlocksProvider.d.ts +9 -1
  177. package/dist/retrieval/index.cjs +4 -4
  178. package/dist/retrieval/index.js +2 -2
  179. package/dist/settings/index.cjs +169 -165
  180. package/dist/settings/index.d.ts +1 -0
  181. package/dist/settings/index.js +2 -2
  182. package/dist/settings/tri-state-filters.d.ts +13 -0
  183. package/dist/shell/index.cjs +44 -44
  184. package/dist/shell/index.js +3 -3
  185. package/dist/site/index.cjs +5 -5
  186. package/dist/site/index.js +1 -1
  187. package/dist/studio/index.cjs +14 -14
  188. package/dist/studio/index.js +6 -6
  189. package/dist/workflow-canvas/index.cjs +27 -27
  190. package/dist/workflow-canvas/index.js +9 -9
  191. package/dist/workspaces/index.cjs +110 -369
  192. package/dist/workspaces/index.cjs.map +1 -1
  193. package/dist/workspaces/index.d.ts +2 -0
  194. package/dist/workspaces/index.js +12 -350
  195. package/dist/workspaces/index.js.map +1 -1
  196. package/dist/workspaces/workspace-groups.d.ts +90 -0
  197. package/dist/workspaces/workspace-roles.d.ts +11 -0
  198. package/node_modules/@arbidocs/coedit/package.json +1 -1
  199. package/package.json +5 -5
  200. package/dist/ConnectedStreamedWordArtifact-QW74LKHN.cjs.map +0 -1
  201. package/dist/chunk-3PCBYOIZ.js.map +0 -1
  202. package/dist/chunk-4236BRZK.js.map +0 -1
  203. package/dist/chunk-CU2O32Z4.cjs.map +0 -1
  204. package/dist/chunk-EV7W64B6.js +0 -134
  205. package/dist/chunk-EV7W64B6.js.map +0 -1
  206. package/dist/chunk-GFNELPDP.cjs.map +0 -1
  207. package/dist/chunk-GFOEWPAP.cjs.map +0 -1
  208. package/dist/chunk-GRGS5M6O.cjs.map +0 -1
  209. package/dist/chunk-KPZZ5FHE.cjs.map +0 -1
  210. package/dist/chunk-KSHKTOY2.js.map +0 -1
  211. package/dist/chunk-LGBAZD37.js.map +0 -1
  212. package/dist/chunk-R6VCPDPF.js.map +0 -1
  213. package/dist/chunk-RQ2Y7USX.cjs.map +0 -1
  214. package/dist/chunk-RXK3XP62.cjs +0 -144
  215. package/dist/chunk-RXK3XP62.cjs.map +0 -1
  216. package/dist/chunk-SMN32BQ3.cjs.map +0 -1
  217. package/dist/chunk-TBEVGWY3.js.map +0 -1
  218. package/dist/chunk-U6JQ4KMX.cjs.map +0 -1
  219. package/dist/chunk-US3S4DCB.js.map +0 -1
  220. package/dist/chunk-XZIYRKLW.cjs.map +0 -1
  221. package/dist/chunk-ZLEYLCE4.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { useConnectedDocuments, useConnectedTags, useConnectedConversations } from './chunk-DN2KI4BU.js';
3
- import { useConnectedWorkspace } from './chunk-US3S4DCB.js';
2
+ import { useConnectedDocuments, useConnectedTags, useConnectedConversations } from './chunk-KDLX5AA7.js';
3
+ import { useConnectedWorkspace } from './chunk-TF7HN5EU.js';
4
4
  import { loadDocxFonts, isCandidate } from './chunk-MTSKK3BN.js';
5
5
  import { NativeDocxEditor, contentPath, builtinHouseTemplate } from './chunk-265GOG4W.js';
6
6
  import { parseDeepLinkPath, buildDeepLinkUrl } from './chunk-SV65E4QW.js';
7
- import { buildWorkflowScopeSource, documentScopeLabels, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, workflowTriggerType } from './chunk-COA3S3CZ.js';
8
- import { DocumentPicker } from './chunk-KSHKTOY2.js';
7
+ import { buildWorkflowScopeSource, documentScopeLabels, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, workflowTriggerType } from './chunk-XI37A7HH.js';
8
+ import { DocumentPicker } from './chunk-NUSBINUM.js';
9
9
  import { useRegisterOpenDocument } from './chunk-YBLIKTJK.js';
10
- import { useBlocksEnvironment } from './chunk-TBEVGWY3.js';
10
+ import { useBlocksEnvironment } from './chunk-F57LNUSZ.js';
11
11
  import { fmtDate } from './chunk-OXF2IFXG.js';
12
12
  import { createContext, useContext, useMemo, useRef, useState, useCallback, useEffect } from 'react';
13
13
  import { useQueryClient } from '@tanstack/react-query';
@@ -540,5 +540,5 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
540
540
  }
541
541
 
542
542
  export { ConnectedNativeDocxEditor, ConnectedWorkflowDocumentsField, ConnectedWorkflowLauncher, ConnectedWorkflowsTable, DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, NativeDocxSupportProvider, toWorkflowFieldDocument, useConnectedAgentOptions, useConnectedNativeDocxAdapter, useConnectedWorkflowScopeSource, useConnectedWorkspaceRole, useNativeDocxSupport };
543
- //# sourceMappingURL=chunk-DB2OXRQC.js.map
544
- //# sourceMappingURL=chunk-DB2OXRQC.js.map
543
+ //# sourceMappingURL=chunk-GO3BN76C.js.map
544
+ //# sourceMappingURL=chunk-GO3BN76C.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/support.tsx","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["jsx","useMemo","useRef","useAgents","useState","useArbi","jsxs","useWorkspaceUsers"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAM,wBAAA,GAA2B,aAAA,CAAiC,EAAE,CAAA;AAE7D,SAAS,yBAAA,CAA0B;AAAA,EACxC,KAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,uBACE,GAAA,CAAC,wBAAA,CAAyB,QAAA,EAAzB,EAAkC,OAAe,QAAA,EAAS,CAAA;AAE/D;AAEO,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAO,WAAW,wBAAwB,CAAA;AAC5C;AChBA,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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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;AACF,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-DB2OXRQC.js","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. Every field is optional; without a\n * provider the editor simply offers less (no Defined term, no Generate image).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\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). */\n commentTarget?: { documentId: string; commentId: string } | null\n}\n\nconst NativeDocxSupportContext = createContext<NativeDocxSupport>({})\n\nexport function NativeDocxSupportProvider({\n value,\n children,\n}: {\n value: NativeDocxSupport\n children: ReactNode\n}) {\n return (\n <NativeDocxSupportContext.Provider value={value}>{children}</NativeDocxSupportContext.Provider>\n )\n}\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useContext(NativeDocxSupportContext)\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/BlocksProvider'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedDocuments, useConnectedTags, 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 } = useConnectedDocuments()\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 } = useConnectedDocuments()\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/BlocksProvider'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useConnectedDocuments, 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 } = useConnectedDocuments()\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\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 { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/BlocksProvider'\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}\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}\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> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\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 = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\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(() => (filter ? saved.filter(filter) : saved), [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={describeTrigger}\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 { useOptionalDocumentTools } 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 '../../chat/open-document'\nimport { useBlocksEnvironment } from '../../provider/BlocksProvider'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { 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 (a `ConnectionProvider`, or\n * the host's own `ArbiProvider` + 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 } = useNativeDocxSupport()\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 (`NativeDocxSupportProvider`).\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 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 ]\n )\n return adapter\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/support.tsx","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["jsx","useMemo","useRef","useAgents","useState","useArbi","jsxs","useWorkspaceUsers"],"mappings":";;;;;;;;;;;;;;;;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KAAY;AACnC,QAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,MAAA,CAAO,QAAQ,CAAA,CAAA,EAAI,kBAAA,CAAmB,EAAE,CAAC,CAAA,SAAA,CAAA,EAAa;AAAA,UAChF,MAAA,EAAQ,MAAA;AAAA,UACR,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA,EAAmB;AAAA,UAC9C,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,YACnB,YAAY,OAAA,CAAQ,SAAA;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;AACF,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-GO3BN76C.js","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. Every field is optional; without a\n * provider the editor simply offers less (no Defined term, no Generate image).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\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). */\n commentTarget?: { documentId: string; commentId: string } | null\n}\n\nconst NativeDocxSupportContext = createContext<NativeDocxSupport>({})\n\nexport function NativeDocxSupportProvider({\n value,\n children,\n}: {\n value: NativeDocxSupport\n children: ReactNode\n}) {\n return (\n <NativeDocxSupportContext.Provider value={value}>{children}</NativeDocxSupportContext.Provider>\n )\n}\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useContext(NativeDocxSupportContext)\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/BlocksProvider'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedDocuments, useConnectedTags, 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 } = useConnectedDocuments()\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 } = useConnectedDocuments()\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/BlocksProvider'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useConnectedDocuments, 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 } = useConnectedDocuments()\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\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 { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/BlocksProvider'\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}\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}\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> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\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 = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\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(() => (filter ? saved.filter(filter) : saved), [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={describeTrigger}\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 { useOptionalDocumentTools } 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 '../../chat/open-document'\nimport { useBlocksEnvironment } from '../../provider/BlocksProvider'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { 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 (a `ConnectionProvider`, or\n * the host's own `ArbiProvider` + 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 } = useNativeDocxSupport()\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 (`NativeDocxSupportProvider`).\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 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 ]\n )\n return adapter\n}\n"]}
@@ -1,145 +1,13 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var sortable = require('@dnd-kit/sortable');
5
+ var utilities = require('@dnd-kit/utilities');
4
6
  var lucideReact = require('lucide-react');
5
7
  var ui = require('@arbidocs/react/ui');
6
8
  var jsxRuntime = require('react/jsx-runtime');
7
- var sortable = require('@dnd-kit/sortable');
8
- var utilities = require('@dnd-kit/utilities');
9
9
 
10
- // src/home/CollapsibleSection.tsx
11
- var DEFAULT_COLLAPSIBLE_SECTION_LABELS = {
12
- collapseSection: "Collapse section",
13
- expandSection: "Expand section"
14
- };
15
- function CollapsibleSection({
16
- title,
17
- icon,
18
- isExpanded,
19
- onToggle,
20
- children,
21
- count,
22
- hasActiveFilters = false,
23
- expandWhenEmpty = false,
24
- childrenClassName,
25
- headerClassName,
26
- className,
27
- rightContent,
28
- collapsible = true,
29
- onHeaderClick,
30
- labels
31
- }) {
32
- const l = { ...DEFAULT_COLLAPSIBLE_SECTION_LABELS, ...labels };
33
- const hasCount = count !== void 0;
34
- const shouldBeExpanded = !collapsible ? true : hasCount ? count > 0 ? isExpanded : expandWhenEmpty && isExpanded : isExpanded;
35
- const hasContent = hasCount ? count > 0 || expandWhenEmpty : true;
36
- const chevron = /* @__PURE__ */ jsxRuntime.jsx(
37
- lucideReact.ChevronRight,
38
- {
39
- className: ui.cn("size-4 shrink-0 transition-transform", shouldBeExpanded && "rotate-90")
40
- }
41
- );
42
- const titleBlock = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
43
- icon,
44
- typeof title === "string" ? title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: title }) : title,
45
- hasCount && /* @__PURE__ */ jsxRuntime.jsx(
46
- "span",
47
- {
48
- className: ui.cn(
49
- "ml-1 text-xs tabular-nums",
50
- hasActiveFilters ? "rounded-full bg-primary px-1.5 font-medium text-primary-foreground" : "font-normal text-muted-foreground"
51
- ),
52
- children: count
53
- }
54
- )
55
- ] });
56
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("w-full", className), "data-slot": "collapsible-section", children: [
57
- onHeaderClick ? /* @__PURE__ */ jsxRuntime.jsxs(
58
- "div",
59
- {
60
- role: "button",
61
- tabIndex: 0,
62
- onClick: onHeaderClick,
63
- onKeyDown: (e) => {
64
- if (e.key === "Enter" || e.key === " ") {
65
- e.preventDefault();
66
- onHeaderClick();
67
- }
68
- },
69
- className: ui.cn(
70
- "mb-4 flex cursor-pointer items-center justify-between gap-2 font-semibold pointer-coarse:min-h-11 transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
71
- headerClassName
72
- ),
73
- "data-slot": "collapsible-section-header",
74
- children: [
75
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2 text-left", children: [
76
- /* @__PURE__ */ jsxRuntime.jsx(
77
- "button",
78
- {
79
- type: "button",
80
- "aria-expanded": shouldBeExpanded,
81
- "aria-label": shouldBeExpanded ? l.collapseSection : l.expandSection,
82
- disabled: !hasContent,
83
- onClick: (e) => {
84
- e.stopPropagation();
85
- if (hasContent) onToggle();
86
- },
87
- className: "-ml-0.5 shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 pointer-coarse:p-3.5",
88
- children: chevron
89
- }
90
- ),
91
- titleBlock
92
- ] }),
93
- rightContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center", children: rightContent })
94
- ]
95
- }
96
- ) : !collapsible ? /* @__PURE__ */ jsxRuntime.jsxs(
97
- "div",
98
- {
99
- className: ui.cn("mb-4 flex items-center justify-between", headerClassName),
100
- "data-slot": "collapsible-section-header",
101
- children: [
102
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center gap-2 text-left font-medium", children: titleBlock }),
103
- rightContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center", children: rightContent })
104
- ]
105
- }
106
- ) : /* @__PURE__ */ jsxRuntime.jsxs(
107
- "div",
108
- {
109
- className: ui.cn("mb-4 flex items-center justify-between", headerClassName),
110
- "data-slot": "collapsible-section-header",
111
- children: [
112
- /* @__PURE__ */ jsxRuntime.jsxs(
113
- "div",
114
- {
115
- role: "button",
116
- tabIndex: hasContent ? 0 : -1,
117
- "aria-expanded": shouldBeExpanded,
118
- "aria-disabled": !hasContent,
119
- onClick: hasContent ? onToggle : void 0,
120
- onKeyDown: hasContent ? (e) => {
121
- if (e.key === "Enter" || e.key === " ") {
122
- e.preventDefault();
123
- onToggle();
124
- }
125
- } : void 0,
126
- className: ui.cn(
127
- "touch-hit flex min-w-0 items-center gap-2 rounded-md text-left font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
128
- hasContent ? "cursor-pointer hover:text-muted-foreground" : "cursor-default opacity-60"
129
- ),
130
- children: [
131
- chevron,
132
- titleBlock
133
- ]
134
- }
135
- ),
136
- rightContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center", children: rightContent })
137
- ]
138
- }
139
- ),
140
- shouldBeExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: childrenClassName ?? "mb-8 flex flex-wrap justify-start gap-6", children })
141
- ] });
142
- }
10
+ // src/home/KeyValueRow.tsx
143
11
  var DEFAULT_KEY_VALUE_ROW_LABELS = {
144
12
  hideField: "Hide this field",
145
13
  showField: "Show this field",
@@ -338,10 +206,8 @@ function KeyValueRow({
338
206
  );
339
207
  }
340
208
 
341
- exports.CollapsibleSection = CollapsibleSection;
342
- exports.DEFAULT_COLLAPSIBLE_SECTION_LABELS = DEFAULT_COLLAPSIBLE_SECTION_LABELS;
343
209
  exports.DEFAULT_KEY_VALUE_ROW_LABELS = DEFAULT_KEY_VALUE_ROW_LABELS;
344
210
  exports.KeyValueContainer = KeyValueContainer;
345
211
  exports.KeyValueRow = KeyValueRow;
346
- //# sourceMappingURL=chunk-XZIYRKLW.cjs.map
347
- //# sourceMappingURL=chunk-XZIYRKLW.cjs.map
212
+ //# sourceMappingURL=chunk-H32DV7XS.cjs.map
213
+ //# sourceMappingURL=chunk-H32DV7XS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/home/KeyValueRow.tsx"],"names":["cn","Tooltip","jsx","TooltipTrigger","TooltipContent","jsxs","ArrowDownFromLine","ArrowUpFromLine","useSortable","GripVertical","CSS"],"mappings":";;;;;;;;;AAaO,IAAM,4BAAA,GAAkD;AAAA,EAC7D,SAAA,EAAW,iBAAA;AAAA,EACX,SAAA,EAAW,iBAAA;AAAA,EACX,aAAA,EAAe;AACjB;AA6BO,SAAS,iBAAA,CAAkB;AAAA,EAChC,QAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,sCAAQ,KAAA,EAAA,EAAI,SAAA,EAAWA,MAAG,YAAA,EAAc,SAAS,GAAI,QAAA,EAAS,CAAA;AAChE;AAGA,SAAS,gBAAA,CAAiB;AAAA,EACxB,OAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAIG;AACD,EAAA,uCACGC,UAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAAC,cAAA,CAACC,iBAAA,EAAA,EAAe,SAAO,IAAA,EACrB,QAAA,kBAAAD,cAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAK,QAAA;AAAA,QACL,OAAA;AAAA,QACA,YAAA,EAAY,KAAA;AAAA,QACZ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,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAA;AAAA,QACA,SAAA;AAAA,QACA,SAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA,EAAQ,YAAA;AAAA,QAEP;AAAA;AAAA,KACH;AAAA,EAEJ;AAEA,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAWF,KAAA,CAAG,SAAA,EAAW,MAAA,IAAU,cAAc,SAAS,CAAA;AAAA,MAC1D,WAAA,EAAU,eAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MAEb,QAAA,kBAAAE,cAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAM,IAAA;AAAA,UACN,IAAA;AAAA,UACA,OAAA;AAAA,UACA,SAAA;AAAA,UACA,KAAA;AAAA,UACA,MAAA;AAAA,UACA,MAAA,EAAQ,YAAA;AAAA,UAEP;AAAA;AAAA;AACH;AAAA,GACF;AAEJ","file":"chunk-H32DV7XS.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { useSortable } from '@dnd-kit/sortable'\nimport { CSS } from '@dnd-kit/utilities'\nimport { ArrowDownFromLine, ArrowUpFromLine, GripVertical } from 'lucide-react'\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\n\n/** Fixed strings of the row controls. */\nexport interface KeyValueRowLabels {\n hideField: string\n showField: string\n dragToReorder: string\n}\n\nexport const DEFAULT_KEY_VALUE_ROW_LABELS: KeyValueRowLabels = {\n hideField: 'Hide this field',\n showField: 'Show this field',\n dragToReorder: 'Drag to reorder',\n}\n\nexport interface KeyValueRowProps {\n /** Label text; also the accessible name when `labelSlot` replaces it visually. */\n label: string\n /** Glyph before the label. */\n icon?: ReactNode\n /** Id of the control in the value: renders the label as a real `<label for>`. */\n htmlFor?: string\n /** Replaces the icon + label (e.g. a tag pill that is itself the label). */\n labelSlot?: ReactNode\n /** The value, on the right (or below the label when the container is narrow). */\n children: ReactNode\n className?: string\n 'data-testid'?: string\n /** Enables drag reordering; requires a parent `DndContext` + `SortableContext`. */\n sortableId?: string\n /** Shows a \"hide this field\" control on the label line. */\n onHide?: () => void\n /** Shows a \"show this field\" control (for hidden rows, rendered dimmed). */\n onShow?: () => void\n labels?: Partial<KeyValueRowLabels>\n}\n\n/**\n * Wrap rows in this to switch on container-query responsiveness: a row stacks\n * its label above its value in a narrow container and goes side by side when\n * wider, by the container's width and not the viewport's.\n */\nexport function KeyValueContainer({\n children,\n className,\n}: {\n children: ReactNode\n className?: string\n}) {\n return <div className={cn('@container', className)}>{children}</div>\n}\n\n/** Small square control, sized to sit on the label line (44px on touch). */\nfunction RowControlButton({\n onClick,\n label,\n icon,\n}: {\n onClick: () => void\n label: string\n icon: ReactNode\n}) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n className=\"flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11\"\n >\n {icon}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\">\n <p>{label}</p>\n </TooltipContent>\n </Tooltip>\n )\n}\n\ninterface RowBodyProps {\n grip: ReactNode\n icon?: ReactNode\n htmlFor?: string\n labelSlot?: ReactNode\n label: string\n children: ReactNode\n onHide?: () => void\n onShow?: () => void\n labels: KeyValueRowLabels\n}\n\n/**\n * The shared row body: a label line (grip + hide/show + icon/label) beside the\n * value. Controls sit on the label's line so they align with the label even\n * when the value is a tall multi-line field.\n */\nfunction RowBody({\n grip,\n icon,\n htmlFor,\n labelSlot,\n label,\n children,\n onHide,\n onShow,\n labels,\n}: RowBodyProps) {\n const LabelText = htmlFor ? 'label' : 'span'\n return (\n <div className=\"flex min-w-0 flex-1 flex-col gap-1 py-1.5 @[400px]:flex-row @[400px]:items-start @[400px]:gap-4\">\n <div\n className=\"flex w-full shrink-0 items-center gap-1 @[400px]:w-44 @[400px]:pt-2\"\n data-slot=\"key-value-label\"\n >\n {grip}\n {onHide && (\n <RowControlButton\n onClick={onHide}\n label={labels.hideField}\n icon={<ArrowDownFromLine className=\"size-3.5\" />}\n />\n )}\n {onShow && (\n <RowControlButton\n onClick={onShow}\n label={labels.showField}\n icon={<ArrowUpFromLine className=\"size-3.5 text-primary\" />}\n />\n )}\n {labelSlot ?? (\n <span className=\"inline-flex min-w-0 items-center gap-1.5\">\n {icon && (\n <span className=\"inline-flex shrink-0 items-center justify-center text-muted-foreground/60\">\n {icon}\n </span>\n )}\n <LabelText\n {...(htmlFor ? { htmlFor } : null)}\n className=\"truncate text-sm font-medium text-muted-foreground\"\n >\n {label}\n </LabelText>\n </span>\n )}\n </div>\n <div className=\"min-w-0 flex-1\" data-slot=\"key-value-value\">\n {children}\n </div>\n </div>\n )\n}\n\nconst ROW_CLASS =\n 'group flex items-start rounded-md pl-1 pr-1.5 transition-colors hover:bg-muted/50'\n\ntype SortableRowProps = Omit<KeyValueRowProps, 'data-testid' | 'labels'> & {\n labels: KeyValueRowLabels\n sortableId: string\n testId?: string\n}\n\nfunction SortableKeyValueRow({\n sortableId,\n label,\n icon,\n htmlFor,\n labelSlot,\n children,\n className,\n testId,\n onHide,\n onShow,\n labels,\n}: SortableRowProps) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id: sortableId,\n })\n\n const grip = (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={labels.dragToReorder}\n className=\"flex size-5 shrink-0 cursor-grab touch-none items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing pointer-coarse:size-11\"\n {...attributes}\n {...listeners}\n >\n <GripVertical className=\"size-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\">\n <p>{labels.dragToReorder}</p>\n </TooltipContent>\n </Tooltip>\n )\n\n return (\n <div\n ref={setNodeRef}\n style={{\n transform: CSS.Transform.toString(transform),\n transition,\n opacity: isDragging ? 0 : 1,\n }}\n className={cn(ROW_CLASS, className)}\n data-slot=\"key-value-row\"\n data-testid={testId}\n >\n <RowBody\n grip={grip}\n icon={icon}\n htmlFor={htmlFor}\n labelSlot={labelSlot}\n label={label}\n onHide={onHide}\n onShow={onShow}\n labels={labels}\n >\n {children}\n </RowBody>\n </div>\n )\n}\n\n/**\n * A label/value row for forms, settings and detail views. Optionally sortable\n * (drag handle) and hideable (hide/show controls), all visible without hover.\n */\nexport function KeyValueRow({\n label,\n icon,\n htmlFor,\n labelSlot,\n children,\n className,\n 'data-testid': testId,\n sortableId,\n onHide,\n onShow,\n labels,\n}: KeyValueRowProps) {\n const mergedLabels = { ...DEFAULT_KEY_VALUE_ROW_LABELS, ...labels }\n if (sortableId) {\n return (\n <SortableKeyValueRow\n sortableId={sortableId}\n label={label}\n icon={icon}\n htmlFor={htmlFor}\n labelSlot={labelSlot}\n className={className}\n testId={testId}\n onHide={onHide}\n onShow={onShow}\n labels={mergedLabels}\n >\n {children}\n </SortableKeyValueRow>\n )\n }\n\n return (\n <div\n className={cn(ROW_CLASS, onShow && 'opacity-60', className)}\n data-slot=\"key-value-row\"\n data-testid={testId}\n >\n <RowBody\n grip={null}\n icon={icon}\n htmlFor={htmlFor}\n labelSlot={labelSlot}\n label={label}\n onShow={onShow}\n labels={mergedLabels}\n >\n {children}\n </RowBody>\n </div>\n )\n}\n"]}
@@ -2011,6 +2011,32 @@ function SyncFolderStatus({
2011
2011
  }
2012
2012
  );
2013
2013
  }
2014
+
2015
+ // src/settings/tri-state-filters.ts
2016
+ function applyTriStateFilters(items, filterStates, getAttributes) {
2017
+ const includeKeys = [];
2018
+ const excludeKeys = [];
2019
+ for (const [key, state] of filterStates.entries()) {
2020
+ if (state === "include") includeKeys.push(key);
2021
+ else if (state === "exclude") excludeKeys.push(key);
2022
+ }
2023
+ if (includeKeys.length === 0 && excludeKeys.length === 0) {
2024
+ return items;
2025
+ }
2026
+ return items.filter((item) => {
2027
+ const attributes = getAttributes(item);
2028
+ for (const key of excludeKeys) {
2029
+ if (attributes[key]) return false;
2030
+ }
2031
+ if (includeKeys.length === 0) {
2032
+ return true;
2033
+ }
2034
+ for (const key of includeKeys) {
2035
+ if (attributes[key]) return true;
2036
+ }
2037
+ return false;
2038
+ });
2039
+ }
2014
2040
  function FilterChip({
2015
2041
  label,
2016
2042
  state,
@@ -4999,6 +5025,6 @@ function buildInvertedIndex(items, getId, getKeys) {
4999
5025
  return index;
5000
5026
  }
5001
5027
 
5002
- export { ActiveSessionsDialog, AppearanceSettings, AvatarPicker, CONVERSATION_TITLE_MAX, CheckoutDialogFrame, ConfigSwitcherBar, ConnectionCard, ConnectionsEmpty, ConnectionsError, ConnectionsLoading, ConversationTitleSection, DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS, DEFAULT_APPEARANCE_PAIRING_IDS, DEFAULT_AVATAR_PICKER_LABELS, DEFAULT_CHECKOUT_DIALOG_LABELS, DEFAULT_CONFIG_SWITCHER_BAR_LABELS, DEFAULT_CONNECTION_CARD_LABELS, DEFAULT_CONVERSATION_TITLE_SECTION_LABELS, DEFAULT_DAILY_CAP_FIELD_LABELS, DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS, DEFAULT_EMAIL_WORKSPACE_DIALOG_LABELS, DEFAULT_ERROR_DIALOG_LABELS, DEFAULT_IDENTITY_VERIFICATION_LABELS, DEFAULT_INVITE_CONTACTS_DIALOG_LABELS, DEFAULT_INVOICES_DIALOG_LABELS, DEFAULT_LOGOUT_DIALOG_LABELS, DEFAULT_MODEL_SELECTION_SECTION_LABELS, DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS, DEFAULT_PLAN_CARD_LABELS, DEFAULT_PROFILE_CARD_LABELS, DEFAULT_PROJECT_DETAIL_HEADER_LABELS, DEFAULT_PROJECT_LIST_LABELS, DEFAULT_QUOTA_EXCEEDED_DIALOG_LABELS, DEFAULT_REFERRAL_REWARD_LABELS, DEFAULT_RENAME_DIALOG_LABELS, DEFAULT_SETTINGS_DANGER_ZONE_LABELS, DEFAULT_SHARED_PROJECTS_SECTION_LABELS, DEFAULT_SUBSCRIPTION_STATUS_LABELS, DEFAULT_SUPPORT_PANEL_LABELS, DEFAULT_SYNC_DIALOG_FOOTER_LABELS, DEFAULT_SYNC_FOLDER_ROW_LABELS, DEFAULT_TIPS_EDITOR_LABELS, DEFAULT_USAGE_LINE_CHART_LABELS, DEFAULT_USAGE_PANEL_LABELS, DEFAULT_USAGE_PROPORTION_BAR_LABELS, DEFAULT_WELCOME_DIALOG_LABELS, DEFAULT_WORK_OFFLINE_LABELS, DailyCapField, DeleteAccountDialog, DraggableHeader, EMAIL_NOTIFICATION_CATEGORIES, EMAIL_NOTIFICATION_KEYS, EmailWorkspaceDialogView, ErrorDialogView, FilterChip, FloatingPanel, IdentityVerificationCard, IdentityVerificationDialog, InviteContactsDialog, InvoicesDialog, JsonTree, LogoutDialog, MessageJsonTree, ModelProviderLabel, ModelSelectionSection, MoreInfo, MoreInfoList, NotificationCategoryList, PanelActionsRow, PanelAddButton, PanelFrame, PanelFrameBody, PanelNote, PanelScroll, PanelTitleBar, PasswordChangeDialog, PlanActionButton, PlanActionRow, PlanBadge, PlanCard, PlanCardGrid, PlanDialogFrame, PlanInfoPopover, PlanNotice, PlanPickerCard, PlanPickerHeader, PlanStack, PlanTierOption, PremiumModelsFrame, PricingToggle, ProfileCard, ProjectDetailHeader, ProjectDetailSection, ProjectGroup, ProjectList, ProjectRow, PromoCodeInput, QuotaExceededDialogView, QuotaMeter, ReferralRewardBadge, ReferralRewardNote, ReferralRewardSummary, RenameDialog, RequireVerified, SegmentedControl, ServerConnectionButton, SettingsActionRow, SettingsCard, SettingsDangerZone, SettingsPage, SettingsPanel, SettingsRow, SettingsSection, SettingsSwitchGroup, SettingsSwitchRow, SharedProjectRow, SharedProjectsSection, SubscriptionStatusView, SupportPanel, SupportUnavailable, SyncCheckList, SyncDialogBody, SyncDialogFooter, SyncField, SyncFolderRow, SyncFolderStatus, SyncLinkButton, SyncLinkRow, SyncLoading, SyncNote, SyncOptionToggle, SyncOptions, SyncReconnectNotice, SyncSelect, SyncSmallNote, SyncTreeFrame, ThreadPreviewDialog, TipsEditorDialog, UsageActionButton, UsageLegend, UsageLineChart, UsagePanel, UsageProportionBar, UsageQuotaHint, UsageSection, UsageSummary, UsageToggle, WelcomeDialog, WelcomeProjectPicker, WorkOfflineToggle, applyInvertedIndexFilter, buildInvertedIndex, formatSessionTtl, resolveSettingsSection, serverConnectionView, toActiveSessionViews, toDeleteBlockerViews, toLogoutSessionViews, toNotificationCategories };
5003
- //# sourceMappingURL=chunk-4236BRZK.js.map
5004
- //# sourceMappingURL=chunk-4236BRZK.js.map
5028
+ export { ActiveSessionsDialog, AppearanceSettings, AvatarPicker, CONVERSATION_TITLE_MAX, CheckoutDialogFrame, ConfigSwitcherBar, ConnectionCard, ConnectionsEmpty, ConnectionsError, ConnectionsLoading, ConversationTitleSection, DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS, DEFAULT_APPEARANCE_PAIRING_IDS, DEFAULT_AVATAR_PICKER_LABELS, DEFAULT_CHECKOUT_DIALOG_LABELS, DEFAULT_CONFIG_SWITCHER_BAR_LABELS, DEFAULT_CONNECTION_CARD_LABELS, DEFAULT_CONVERSATION_TITLE_SECTION_LABELS, DEFAULT_DAILY_CAP_FIELD_LABELS, DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS, DEFAULT_EMAIL_WORKSPACE_DIALOG_LABELS, DEFAULT_ERROR_DIALOG_LABELS, DEFAULT_IDENTITY_VERIFICATION_LABELS, DEFAULT_INVITE_CONTACTS_DIALOG_LABELS, DEFAULT_INVOICES_DIALOG_LABELS, DEFAULT_LOGOUT_DIALOG_LABELS, DEFAULT_MODEL_SELECTION_SECTION_LABELS, DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS, DEFAULT_PLAN_CARD_LABELS, DEFAULT_PROFILE_CARD_LABELS, DEFAULT_PROJECT_DETAIL_HEADER_LABELS, DEFAULT_PROJECT_LIST_LABELS, DEFAULT_QUOTA_EXCEEDED_DIALOG_LABELS, DEFAULT_REFERRAL_REWARD_LABELS, DEFAULT_RENAME_DIALOG_LABELS, DEFAULT_SETTINGS_DANGER_ZONE_LABELS, DEFAULT_SHARED_PROJECTS_SECTION_LABELS, DEFAULT_SUBSCRIPTION_STATUS_LABELS, DEFAULT_SUPPORT_PANEL_LABELS, DEFAULT_SYNC_DIALOG_FOOTER_LABELS, DEFAULT_SYNC_FOLDER_ROW_LABELS, DEFAULT_TIPS_EDITOR_LABELS, DEFAULT_USAGE_LINE_CHART_LABELS, DEFAULT_USAGE_PANEL_LABELS, DEFAULT_USAGE_PROPORTION_BAR_LABELS, DEFAULT_WELCOME_DIALOG_LABELS, DEFAULT_WORK_OFFLINE_LABELS, DailyCapField, DeleteAccountDialog, DraggableHeader, EMAIL_NOTIFICATION_CATEGORIES, EMAIL_NOTIFICATION_KEYS, EmailWorkspaceDialogView, ErrorDialogView, FilterChip, FloatingPanel, IdentityVerificationCard, IdentityVerificationDialog, InviteContactsDialog, InvoicesDialog, JsonTree, LogoutDialog, MessageJsonTree, ModelProviderLabel, ModelSelectionSection, MoreInfo, MoreInfoList, NotificationCategoryList, PanelActionsRow, PanelAddButton, PanelFrame, PanelFrameBody, PanelNote, PanelScroll, PanelTitleBar, PasswordChangeDialog, PlanActionButton, PlanActionRow, PlanBadge, PlanCard, PlanCardGrid, PlanDialogFrame, PlanInfoPopover, PlanNotice, PlanPickerCard, PlanPickerHeader, PlanStack, PlanTierOption, PremiumModelsFrame, PricingToggle, ProfileCard, ProjectDetailHeader, ProjectDetailSection, ProjectGroup, ProjectList, ProjectRow, PromoCodeInput, QuotaExceededDialogView, QuotaMeter, ReferralRewardBadge, ReferralRewardNote, ReferralRewardSummary, RenameDialog, RequireVerified, SegmentedControl, ServerConnectionButton, SettingsActionRow, SettingsCard, SettingsDangerZone, SettingsPage, SettingsPanel, SettingsRow, SettingsSection, SettingsSwitchGroup, SettingsSwitchRow, SharedProjectRow, SharedProjectsSection, SubscriptionStatusView, SupportPanel, SupportUnavailable, SyncCheckList, SyncDialogBody, SyncDialogFooter, SyncField, SyncFolderRow, SyncFolderStatus, SyncLinkButton, SyncLinkRow, SyncLoading, SyncNote, SyncOptionToggle, SyncOptions, SyncReconnectNotice, SyncSelect, SyncSmallNote, SyncTreeFrame, ThreadPreviewDialog, TipsEditorDialog, UsageActionButton, UsageLegend, UsageLineChart, UsagePanel, UsageProportionBar, UsageQuotaHint, UsageSection, UsageSummary, UsageToggle, WelcomeDialog, WelcomeProjectPicker, WorkOfflineToggle, applyInvertedIndexFilter, applyTriStateFilters, buildInvertedIndex, formatSessionTtl, resolveSettingsSection, serverConnectionView, toActiveSessionViews, toDeleteBlockerViews, toLogoutSessionViews, toNotificationCategories };
5029
+ //# sourceMappingURL=chunk-HP2C4MD3.js.map
5030
+ //# sourceMappingURL=chunk-HP2C4MD3.js.map