@arbidocs/blocks 0.5.161 → 0.5.162

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 (133) hide show
  1. package/dist/{ConnectedCallDock-SD4DKTMX.cjs → ConnectedCallDock-ML4ZTABN.cjs} +21 -21
  2. package/dist/{ConnectedCallDock-SD4DKTMX.cjs.map → ConnectedCallDock-ML4ZTABN.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-2FLGH3JB.cjs → ConnectedCallRoom-GBTP2LT2.cjs} +14 -14
  4. package/dist/{ConnectedCallRoom-2FLGH3JB.cjs.map → ConnectedCallRoom-GBTP2LT2.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxComparison-PV3SDVMZ.cjs → ConnectedNativeDocxComparison-EDG5V4ZD.cjs} +15 -15
  6. package/dist/{ConnectedNativeDocxComparison-PV3SDVMZ.cjs.map → ConnectedNativeDocxComparison-EDG5V4ZD.cjs.map} +1 -1
  7. package/dist/{ConnectedPresentation-J42JPUVR.cjs → ConnectedPresentation-LTVAUJ7Z.cjs} +19 -19
  8. package/dist/{ConnectedPresentation-J42JPUVR.cjs.map → ConnectedPresentation-LTVAUJ7Z.cjs.map} +1 -1
  9. package/dist/{ConnectedProductionSetDialog-LB5B7OXR.cjs → ConnectedProductionSetDialog-7J4T3L6U.cjs} +3 -3
  10. package/dist/{ConnectedProductionSetDialog-LB5B7OXR.cjs.map → ConnectedProductionSetDialog-7J4T3L6U.cjs.map} +1 -1
  11. package/dist/{ConnectedSlidesTab-BYS7HFNK.cjs → ConnectedSlidesTab-VLRDE7YI.cjs} +14 -14
  12. package/dist/{ConnectedSlidesTab-BYS7HFNK.cjs.map → ConnectedSlidesTab-VLRDE7YI.cjs.map} +1 -1
  13. package/dist/{ConnectedStreamedWordArtifact-T6GE5GME.cjs → ConnectedStreamedWordArtifact-YBJ4R6ZK.cjs} +15 -15
  14. package/dist/{ConnectedStreamedWordArtifact-T6GE5GME.cjs.map → ConnectedStreamedWordArtifact-YBJ4R6ZK.cjs.map} +1 -1
  15. package/dist/{DocumentReviewCard-UXGPQNTN.cjs → DocumentReviewCard-DZJP7FXQ.cjs} +15 -15
  16. package/dist/{DocumentReviewCard-UXGPQNTN.cjs.map → DocumentReviewCard-DZJP7FXQ.cjs.map} +1 -1
  17. package/dist/{FilesViewerDialog-D6XDCE2U.cjs → FilesViewerDialog-3GFV36JQ.cjs} +47 -47
  18. package/dist/{FilesViewerDialog-D6XDCE2U.cjs.map → FilesViewerDialog-3GFV36JQ.cjs.map} +1 -1
  19. package/dist/{WorkspaceTableView-NMERZJZZ.cjs → WorkspaceTableView-CPNVJDSS.cjs} +8 -8
  20. package/dist/{WorkspaceTableView-NMERZJZZ.cjs.map → WorkspaceTableView-CPNVJDSS.cjs.map} +1 -1
  21. package/dist/agents/index.cjs +284 -284
  22. package/dist/{ai-QFY4LYQZ.cjs → ai-NFZHPSS2.cjs} +25 -25
  23. package/dist/ai-NFZHPSS2.cjs.map +1 -0
  24. package/dist/calls/index.cjs +120 -120
  25. package/dist/chat/index.cjs +1 -1
  26. package/dist/{chunk-VU2MESEX.cjs → chunk-3F2ZZHGC.cjs} +36 -36
  27. package/dist/{chunk-VU2MESEX.cjs.map → chunk-3F2ZZHGC.cjs.map} +1 -1
  28. package/dist/{chunk-UJHQ4DA4.cjs → chunk-4GT4JLKS.cjs} +6 -6
  29. package/dist/{chunk-UJHQ4DA4.cjs.map → chunk-4GT4JLKS.cjs.map} +1 -1
  30. package/dist/{chunk-6OK7ESTL.cjs → chunk-63FEMB6U.cjs} +20 -8
  31. package/dist/chunk-63FEMB6U.cjs.map +1 -0
  32. package/dist/{chunk-MTN6HOY3.cjs → chunk-7KUMSKUX.cjs} +50 -50
  33. package/dist/{chunk-MTN6HOY3.cjs.map → chunk-7KUMSKUX.cjs.map} +1 -1
  34. package/dist/{chunk-K4763GD5.cjs → chunk-AIKPZJNI.cjs} +42 -8
  35. package/dist/chunk-AIKPZJNI.cjs.map +1 -0
  36. package/dist/{chunk-WQ2KG4LS.cjs → chunk-BCU65RJM.cjs} +3 -3
  37. package/dist/{chunk-WQ2KG4LS.cjs.map → chunk-BCU65RJM.cjs.map} +1 -1
  38. package/dist/{chunk-BX3WRCXV.cjs → chunk-C3LSYGSB.cjs} +4 -4
  39. package/dist/{chunk-BX3WRCXV.cjs.map → chunk-C3LSYGSB.cjs.map} +1 -1
  40. package/dist/{chunk-7UPEFZCV.cjs → chunk-C6EMTQHQ.cjs} +12 -12
  41. package/dist/{chunk-7UPEFZCV.cjs.map → chunk-C6EMTQHQ.cjs.map} +1 -1
  42. package/dist/{chunk-KCTQM3WO.cjs → chunk-DMPNQG4I.cjs} +28 -28
  43. package/dist/{chunk-KCTQM3WO.cjs.map → chunk-DMPNQG4I.cjs.map} +1 -1
  44. package/dist/{chunk-TD5V5BZ3.cjs → chunk-DN6VM5M5.cjs} +6 -6
  45. package/dist/{chunk-TD5V5BZ3.cjs.map → chunk-DN6VM5M5.cjs.map} +1 -1
  46. package/dist/{chunk-ZC7X4ZIX.cjs → chunk-ENKO65VY.cjs} +15 -15
  47. package/dist/{chunk-ZC7X4ZIX.cjs.map → chunk-ENKO65VY.cjs.map} +1 -1
  48. package/dist/{chunk-ZPBTXRMG.cjs → chunk-EOZWMKEJ.cjs} +4 -4
  49. package/dist/{chunk-ZPBTXRMG.cjs.map → chunk-EOZWMKEJ.cjs.map} +1 -1
  50. package/dist/{chunk-U4YOVI5D.cjs → chunk-FDIZWCYF.cjs} +6 -6
  51. package/dist/{chunk-U4YOVI5D.cjs.map → chunk-FDIZWCYF.cjs.map} +1 -1
  52. package/dist/{chunk-WOVNXJK5.cjs → chunk-GHGMOVQL.cjs} +3 -3
  53. package/dist/{chunk-WOVNXJK5.cjs.map → chunk-GHGMOVQL.cjs.map} +1 -1
  54. package/dist/{chunk-UD3LPATQ.cjs → chunk-HKKNHHBB.cjs} +6 -6
  55. package/dist/{chunk-UD3LPATQ.cjs.map → chunk-HKKNHHBB.cjs.map} +1 -1
  56. package/dist/{chunk-K4U4TM23.cjs → chunk-J6OMDBRT.cjs} +69 -69
  57. package/dist/{chunk-K4U4TM23.cjs.map → chunk-J6OMDBRT.cjs.map} +1 -1
  58. package/dist/{chunk-XTWHFHEK.cjs → chunk-JL4AL3ZJ.cjs} +4 -4
  59. package/dist/{chunk-XTWHFHEK.cjs.map → chunk-JL4AL3ZJ.cjs.map} +1 -1
  60. package/dist/{chunk-6P4U63HO.cjs → chunk-KAKEFIDS.cjs} +13 -13
  61. package/dist/{chunk-6P4U63HO.cjs.map → chunk-KAKEFIDS.cjs.map} +1 -1
  62. package/dist/{chunk-ZC6EPBVL.cjs → chunk-KHTM7M6E.cjs} +4 -4
  63. package/dist/{chunk-ZC6EPBVL.cjs.map → chunk-KHTM7M6E.cjs.map} +1 -1
  64. package/dist/{chunk-EG3DPKXM.cjs → chunk-L3MYUPSH.cjs} +5 -5
  65. package/dist/{chunk-EG3DPKXM.cjs.map → chunk-L3MYUPSH.cjs.map} +1 -1
  66. package/dist/{chunk-G3MRW4WB.cjs → chunk-LK4TQBV6.cjs} +3 -3
  67. package/dist/{chunk-G3MRW4WB.cjs.map → chunk-LK4TQBV6.cjs.map} +1 -1
  68. package/dist/{chunk-AHUEBRLX.cjs → chunk-LYDSETR7.cjs} +4 -4
  69. package/dist/{chunk-AHUEBRLX.cjs.map → chunk-LYDSETR7.cjs.map} +1 -1
  70. package/dist/{chunk-CYWOL2LS.cjs → chunk-MSFWSDRS.cjs} +3 -3
  71. package/dist/{chunk-CYWOL2LS.cjs.map → chunk-MSFWSDRS.cjs.map} +1 -1
  72. package/dist/{chunk-TU46WKTN.cjs → chunk-OIYKKUAN.cjs} +3 -3
  73. package/dist/{chunk-TU46WKTN.cjs.map → chunk-OIYKKUAN.cjs.map} +1 -1
  74. package/dist/{chunk-ZVQMCGUK.cjs → chunk-OQGESEWK.cjs} +26 -26
  75. package/dist/{chunk-ZVQMCGUK.cjs.map → chunk-OQGESEWK.cjs.map} +1 -1
  76. package/dist/{chunk-73KNWWBW.cjs → chunk-P4KNRU7Y.cjs} +48 -48
  77. package/dist/{chunk-73KNWWBW.cjs.map → chunk-P4KNRU7Y.cjs.map} +1 -1
  78. package/dist/{chunk-HIG4DR7Z.cjs → chunk-P6BN2XBX.cjs} +25 -15
  79. package/dist/chunk-P6BN2XBX.cjs.map +1 -0
  80. package/dist/{chunk-2EWDPIGO.cjs → chunk-Q5UQF2UZ.cjs} +4 -4
  81. package/dist/{chunk-2EWDPIGO.cjs.map → chunk-Q5UQF2UZ.cjs.map} +1 -1
  82. package/dist/{chunk-UWJ63GLD.cjs → chunk-QWRMC7H6.cjs} +7 -7
  83. package/dist/{chunk-UWJ63GLD.cjs.map → chunk-QWRMC7H6.cjs.map} +1 -1
  84. package/dist/{chunk-V27WLYTG.cjs → chunk-UEQNTXWV.cjs} +3 -3
  85. package/dist/{chunk-V27WLYTG.cjs.map → chunk-UEQNTXWV.cjs.map} +1 -1
  86. package/dist/{chunk-PIWXX2M4.cjs → chunk-UOE6VC36.cjs} +11 -11
  87. package/dist/{chunk-PIWXX2M4.cjs.map → chunk-UOE6VC36.cjs.map} +1 -1
  88. package/dist/{chunk-DYIZ7W4P.cjs → chunk-VBSEYTRN.cjs} +3 -3
  89. package/dist/{chunk-DYIZ7W4P.cjs.map → chunk-VBSEYTRN.cjs.map} +1 -1
  90. package/dist/{chunk-LLVE5TST.cjs → chunk-VJRO6J37.cjs} +3 -3
  91. package/dist/{chunk-LLVE5TST.cjs.map → chunk-VJRO6J37.cjs.map} +1 -1
  92. package/dist/{chunk-CX4VR3ZT.cjs → chunk-W3ZYBEFE.cjs} +64 -64
  93. package/dist/{chunk-CX4VR3ZT.cjs.map → chunk-W3ZYBEFE.cjs.map} +1 -1
  94. package/dist/{chunk-GF6AYAMI.cjs → chunk-XBZP5J24.cjs} +7 -7
  95. package/dist/{chunk-GF6AYAMI.cjs.map → chunk-XBZP5J24.cjs.map} +1 -1
  96. package/dist/{chunk-JARBYN6Z.cjs → chunk-Y3OI7ZP7.cjs} +3 -3
  97. package/dist/{chunk-JARBYN6Z.cjs.map → chunk-Y3OI7ZP7.cjs.map} +1 -1
  98. package/dist/{chunk-35UL4GE7.cjs → chunk-ZBE5O7S3.cjs} +4 -4
  99. package/dist/{chunk-35UL4GE7.cjs.map → chunk-ZBE5O7S3.cjs.map} +1 -1
  100. package/dist/{chunk-GS2C25ID.cjs → chunk-ZXXNVW34.cjs} +10 -10
  101. package/dist/{chunk-GS2C25ID.cjs.map → chunk-ZXXNVW34.cjs.map} +1 -1
  102. package/dist/connect/docx.cjs +18 -18
  103. package/dist/connect/index.cjs +1078 -1076
  104. package/dist/connect/index.cjs.map +1 -1
  105. package/dist/connect/viewer.cjs +35 -35
  106. package/dist/connection/calendar/arbi-call.d.ts +6 -0
  107. package/dist/connection/calendar/arbi-call.js +14 -4
  108. package/dist/connection/calendar/arbi-call.js.map +2 -2
  109. package/dist/connection/calendar/useConnectedCalendarCalls.js +2 -2
  110. package/dist/connection/calendar/useConnectedCalendarCalls.js.map +2 -2
  111. package/dist/connection/messenger/ConnectedChatThread.d.ts +1 -1
  112. package/dist/connection/messenger/ConnectedChatThread.js +12 -10
  113. package/dist/connection/messenger/ConnectedChatThread.js.map +2 -2
  114. package/dist/connection/panels/useSessionPanelMode.d.ts +2 -3
  115. package/dist/connection/panels/useSessionPanelMode.js +20 -4
  116. package/dist/connection/panels/useSessionPanelMode.js.map +2 -2
  117. package/dist/dashboards/index.cjs +1 -1
  118. package/dist/embed/index.cjs +38 -38
  119. package/dist/files/index.cjs +228 -228
  120. package/dist/index.cjs +1751 -1751
  121. package/dist/pages/index.cjs +24 -24
  122. package/dist/settings/index.cjs +137 -137
  123. package/dist/shell/PanelPortal.js +41 -7
  124. package/dist/shell/PanelPortal.js.map +3 -3
  125. package/dist/shell/index.cjs +84 -84
  126. package/dist/studio/index.cjs +28 -28
  127. package/dist/workflow-canvas/index.cjs +55 -55
  128. package/node_modules/@arbidocs/coedit/package.json +1 -1
  129. package/package.json +5 -5
  130. package/dist/ai-QFY4LYQZ.cjs.map +0 -1
  131. package/dist/chunk-6OK7ESTL.cjs.map +0 -1
  132. package/dist/chunk-HIG4DR7Z.cjs.map +0 -1
  133. package/dist/chunk-K4763GD5.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk2EWDPIGO_cjs = require('./chunk-2EWDPIGO.cjs');
4
+ var chunkQ5UQF2UZ_cjs = require('./chunk-Q5UQF2UZ.cjs');
5
5
  var zustand = require('zustand');
6
6
  var middleware = require('zustand/middleware');
7
7
 
@@ -50,7 +50,7 @@ var useFilesPrefs = zustand.create()(
50
50
  (state) => state.viewModes[prefsKey] === viewMode ? state : { viewModes: { ...state.viewModes, [prefsKey]: viewMode } }
51
51
  ),
52
52
  // New users start at the compact minimum (more rows at once).
53
- rowHeight: chunk2EWDPIGO_cjs.DOCUMENTS_ROW_HEIGHT_INITIAL,
53
+ rowHeight: chunkQ5UQF2UZ_cjs.DOCUMENTS_ROW_HEIGHT_INITIAL,
54
54
  setRowHeight: (rowHeight) => set({ rowHeight })
55
55
  }),
56
56
  {
@@ -121,5 +121,5 @@ exports.useFilesGridStates = useFilesGridStates;
121
121
  exports.useFilesPrefs = useFilesPrefs;
122
122
  exports.useFilesStore = useFilesStore;
123
123
  exports.usePendingFolders = usePendingFolders;
124
- //# sourceMappingURL=chunk-35UL4GE7.cjs.map
125
- //# sourceMappingURL=chunk-35UL4GE7.cjs.map
124
+ //# sourceMappingURL=chunk-ZBE5O7S3.cjs.map
125
+ //# sourceMappingURL=chunk-ZBE5O7S3.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/files/store.ts"],"names":["create","persist","createJSONStorage","DOCUMENTS_ROW_HEIGHT_INITIAL"],"mappings":";;;;;;AAmBO,IAAM,gBAAgBA,cAAA,EAAmB;AAAA,EAC9CC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,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GAAA,CAAI,CAAC,aAAa,EAAE,UAAA,EAAY,EAAE,GAAG,QAAQ,UAAA,EAAY,CAAC,MAAM,GAAG,KAAA,IAAQ,CAAE;AAAA,KACjF,CAAA;AAAA,IACA,EAAE,IAAA,EAAM,kBAAA,EAAoB,SAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAE;AAE/E;AA0BO,IAAM,eAAA,GAAkBF,cAAA,EAA0B,CAAE,CAAC,GAAA,MAAS;AAAA,EACnE,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,CAAC,MAAA,GAAS,IAAA,KAAS,GAAA,CAAI,EAAE,IAAA,EAAM,EAAE,MAAA,EAAO,EAAG,CAAA;AAAA,EACrD,WAAW,MAAM,GAAA,CAAI,EAAE,IAAA,EAAM,MAAM,CAAA;AAAA,EACnC,YAAA,EAAc,KAAA;AAAA,EACd,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc,CAAA;AAAA,EACvD,aAAA,EAAe,IAAA;AAAA,EACf,eAAe,CAAC,aAAA,KAAkB,GAAA,CAAI,EAAE,eAAe,CAAA;AAAA,EACvD,UAAA,EAAY,KAAA;AAAA,EACZ,eAAe,CAAC,UAAA,KAAe,GAAA,CAAI,EAAE,YAAY;AACnD,CAAA,CAAE","file":"chunk-35UL4GE7.cjs","sourcesContent":["/**\n * The Files kits' own state: empty folders the user created (a folder exists only through its\n * documents, so a new one is a placeholder until something is moved into it), per workspace, for\n * the session (kept in `sessionStorage`, so a reload keeps them).\n */\n\nimport type { GridState } from 'ag-grid-community'\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport { DOCUMENTS_ROW_HEIGHT_INITIAL } from '../../files/documentColumns'\nimport type { ExplorerFolder } from '../../files/folders/folderPaths'\n\ninterface FilesState {\n /** Placeholder folder paths per workspace. */\n pendingFolders: Readonly<Record<string, readonly string[]>>\n addPendingFolder: (workspaceId: string, path: string) => void\n removePendingFolder: (workspaceId: string, path: string) => void\n}\n\nexport const useFilesStore = create<FilesState>()(\n persist(\n (set) => ({\n pendingFolders: {},\n addPendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (current.includes(path)) return state\n return { pendingFolders: { ...state.pendingFolders, [workspaceId]: [...current, path] } }\n }),\n removePendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (!current.includes(path)) return state\n return {\n pendingFolders: {\n ...state.pendingFolders,\n [workspaceId]: current.filter((p) => p !== path),\n },\n }\n }),\n }),\n {\n name: 'arbi_explorer_pending_folders',\n storage: createJSONStorage(() => sessionStorage),\n partialize: (state) => ({ pendingFolders: state.pendingFolders }),\n }\n )\n)\n\nconst NONE: readonly string[] = []\n\n/** A workspace's placeholder folders. */\nexport function usePendingFolders(workspaceId: string | null | undefined): readonly string[] {\n return useFilesStore(\n (state) => (workspaceId ? state.pendingFolders[workspaceId] : undefined) ?? NONE\n )\n}\n\n/** How the files page shows the documents: a table, the explorer, review one by one, or search. */\nexport type FilesViewMode = 'grid' | 'explorer' | 'navigator' | 'search'\n\n/** The files page's own preferences key (`ConnectedFilesPage` `prefsKey`). */\nexport const FILES_PREFS_KEY = 'files'\nconst DEFAULT_VIEW_MODE: FilesViewMode = 'explorer'\n\ninterface FilesPrefsState {\n /** The documents list's tri-state filters (filter id → include / exclude / off). */\n documentFilters: Readonly<Record<string, 'include' | 'exclude' | null>>\n setDocumentFilters: (filters: Record<string, 'include' | 'exclude' | null>) => void\n /**\n * Each files page's view, by its `prefsKey` (a page that is the same kit in another role, e.g.\n * a tabular review in the table view, keeps its own). Absent: that page's default.\n */\n viewModes: Readonly<Record<string, FilesViewMode>>\n /** Set a page's view (default: the files page's). */\n setViewMode: (mode: FilesViewMode, prefsKey?: string) => void\n /** The table's row height (density). */\n rowHeight: number\n setRowHeight: (height: number) => void\n}\n\n/** The Files kits' preferences, kept on this device (`localStorage`) across sessions. */\nexport const useFilesPrefs = create<FilesPrefsState>()(\n persist(\n (set) => ({\n documentFilters: {},\n setDocumentFilters: (documentFilters) => set({ documentFilters }),\n viewModes: {},\n setViewMode: (viewMode, prefsKey = FILES_PREFS_KEY) =>\n set((state) =>\n state.viewModes[prefsKey] === viewMode\n ? state\n : { viewModes: { ...state.viewModes, [prefsKey]: viewMode } }\n ),\n // New users start at the compact minimum (more rows at once).\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n setRowHeight: (rowHeight) => set({ rowHeight }),\n }),\n {\n name: 'arbi_files_prefs',\n storage: createJSONStorage(() => localStorage),\n version: 1,\n // Version 0 kept one view for every files page: it becomes the files page's own.\n migrate: (persisted, version) => {\n const state = (persisted ?? {}) as Record<string, unknown>\n if (version >= 1) return state as Partial<FilesPrefsState>\n const { viewMode, ...rest } = state\n return {\n ...rest,\n viewModes: viewMode ? { [FILES_PREFS_KEY]: viewMode as FilesViewMode } : {},\n } as Partial<FilesPrefsState>\n },\n partialize: (state) => ({\n documentFilters: state.documentFilters,\n viewModes: state.viewModes,\n rowHeight: state.rowHeight,\n }),\n }\n )\n)\n\n/** A files page's view (`prefsKey`, default the files page's), else its `defaultViewMode`. */\nexport function filesViewMode(\n state: Pick<FilesPrefsState, 'viewModes'>,\n prefsKey: string = FILES_PREFS_KEY,\n defaultViewMode: FilesViewMode = DEFAULT_VIEW_MODE\n): FilesViewMode {\n return state.viewModes[prefsKey] ?? defaultViewMode\n}\n\n/** An AI review run: the fields, the documents, and which of them the server finished. */\nexport interface AiReviewRun {\n tags: { id: string; name: string }[]\n docIds: string[]\n /** The documents the server finished (a finished cell with no value will not fill). */\n finishedDocIds?: string[]\n /** It replaces values already there: a cell shows its new value only once finished. */\n replacing?: boolean\n}\n\ninterface AiReviewState {\n /** The AI review dialog is open. */\n open: boolean\n /** The run on screen, kept after closing so \"View results\" can bring the answers back. */\n run: AiReviewRun | null\n setOpen: (open: boolean) => void\n setRun: (run: AiReviewRun | null) => void\n /** The server finished these documents of the run (with or without a value). */\n markFinished: (docIds: string[]) => void\n}\n\n/** The AI review dialog and its run, reachable from outside React (a finished-run notice). */\nexport const useAiReviewStore = create<AiReviewState>()((set) => ({\n open: false,\n run: null,\n setOpen: (open) => set({ open }),\n setRun: (run) => set({ run }),\n markFinished: (docIds) =>\n set((state) => {\n const run = state.run\n if (!run) return state\n const finished = new Set(run.finishedDocIds ?? [])\n const added = docIds.filter((id) => run.docIds.includes(id) && !finished.has(id))\n if (added.length === 0) return state\n return { run: { ...run, finishedDocIds: [...finished, ...added] } }\n }),\n}))\n\ninterface GridStatesState {\n /** AG Grid's saved state (columns, widths, sort) per grid id. */\n gridStates: Readonly<Record<string, GridState>>\n setGridState: (gridId: string, state: GridState) => void\n}\n\n/** The Files grids' saved state, kept on this device, for hosts that keep none of their own. */\nexport const useFilesGridStates = create<GridStatesState>()(\n persist(\n (set) => ({\n gridStates: {},\n setGridState: (gridId, state) =>\n set((current) => ({ gridStates: { ...current.gridStates, [gridId]: state } })),\n }),\n { name: 'arbi_files_grids', storage: createJSONStorage(() => localStorage) }\n )\n)\n\n/** A document the Delete confirmation asks about. */\nexport interface DeleteRequestDocument {\n external_id: string\n file_name?: string | null\n doc_metadata?: { title?: string | null } | null\n}\n\ninterface FilesDialogsState {\n /** Move the selection (or `folder`) to a folder. */\n move: { folder: ExplorerFolder | null } | null\n openMove: (folder?: ExplorerFolder | null) => void\n closeMove: () => void\n /** Edit the selection's labels and fields. */\n bulkTagsOpen: boolean\n setBulkTagsOpen: (open: boolean) => void\n /** Confirm deleting one document. */\n deleteRequest: DeleteRequestDocument | null\n requestDelete: (doc: DeleteRequestDocument | null) => void\n /** Export, copy or move the selection (the page's own dialog, when the host has none). */\n exportOpen: boolean\n setExportOpen: (open: boolean) => void\n}\n\n/** The files page's dialogs, also opened from outside it (commands, the viewer's related files). */\nexport const useFilesDialogs = create<FilesDialogsState>()((set) => ({\n move: null,\n openMove: (folder = null) => set({ move: { folder } }),\n closeMove: () => set({ move: null }),\n bulkTagsOpen: false,\n setBulkTagsOpen: (bulkTagsOpen) => set({ bulkTagsOpen }),\n deleteRequest: null,\n requestDelete: (deleteRequest) => set({ deleteRequest }),\n exportOpen: false,\n setExportOpen: (exportOpen) => set({ exportOpen }),\n}))\n"]}
1
+ {"version":3,"sources":["../src/connection/files/store.ts"],"names":["create","persist","createJSONStorage","DOCUMENTS_ROW_HEIGHT_INITIAL"],"mappings":";;;;;;AAmBO,IAAM,gBAAgBA,cAAA,EAAmB;AAAA,EAC9CC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,gBAAgB,EAAC;AAAA,MACjB,kBAAkB,CAAC,WAAA,EAAa,IAAA,KAC9B,GAAA,CAAI,CAAC,KAAA,KAAU;AACb,QAAA,MAAM,OAAA,GAAU,KAAA,CAAM,cAAA,CAAe,WAAW,KAAK,EAAC;AACtD,QAAA,IAAI,OAAA,CAAQ,QAAA,CAAS,IAAI,CAAA,EAAG,OAAO,KAAA;AACnC,QAAA,OAAO,EAAE,cAAA,EAAgB,EAAE,GAAG,MAAM,cAAA,EAAgB,CAAC,WAAW,GAAG,CAAC,GAAG,OAAA,EAAS,IAAI,GAAE,EAAE;AAAA,MAC1F,CAAC,CAAA;AAAA,MACH,qBAAqB,CAAC,WAAA,EAAa,IAAA,KACjC,GAAA,CAAI,CAAC,KAAA,KAAU;AACb,QAAA,MAAM,OAAA,GAAU,KAAA,CAAM,cAAA,CAAe,WAAW,KAAK,EAAC;AACtD,QAAA,IAAI,CAAC,OAAA,CAAQ,QAAA,CAAS,IAAI,GAAG,OAAO,KAAA;AACpC,QAAA,OAAO;AAAA,UACL,cAAA,EAAgB;AAAA,YACd,GAAG,KAAA,CAAM,cAAA;AAAA,YACT,CAAC,WAAW,GAAG,OAAA,CAAQ,OAAO,CAAC,CAAA,KAAM,MAAM,IAAI;AAAA;AACjD,SACF;AAAA,MACF,CAAC;AAAA,KACL,CAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,+BAAA;AAAA,MACN,OAAA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AAA,KAAW,CAAA,EAAG,OAAO,KAAA;AAC/B,IAAA,OAAO,EAAE,GAAA,EAAK,EAAE,GAAG,GAAA,EAAK,cAAA,EAAgB,CAAC,GAAG,QAAA,EAAU,GAAG,KAAK,CAAA,EAAE,EAAE;AAAA,EACpE,CAAC;AACL,CAAA,CAAE;AASK,IAAM,qBAAqBA,cAAA,EAAwB;AAAA,EACxDC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,YAAY,EAAC;AAAA,MACb,cAAc,CAAC,MAAA,EAAQ,UACrB,GAAA,CAAI,CAAC,aAAa,EAAE,UAAA,EAAY,EAAE,GAAG,QAAQ,UAAA,EAAY,CAAC,MAAM,GAAG,KAAA,IAAQ,CAAE;AAAA,KACjF,CAAA;AAAA,IACA,EAAE,IAAA,EAAM,kBAAA,EAAoB,SAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAE;AAE/E;AA0BO,IAAM,eAAA,GAAkBF,cAAA,EAA0B,CAAE,CAAC,GAAA,MAAS;AAAA,EACnE,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,CAAC,MAAA,GAAS,IAAA,KAAS,GAAA,CAAI,EAAE,IAAA,EAAM,EAAE,MAAA,EAAO,EAAG,CAAA;AAAA,EACrD,WAAW,MAAM,GAAA,CAAI,EAAE,IAAA,EAAM,MAAM,CAAA;AAAA,EACnC,YAAA,EAAc,KAAA;AAAA,EACd,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc,CAAA;AAAA,EACvD,aAAA,EAAe,IAAA;AAAA,EACf,eAAe,CAAC,aAAA,KAAkB,GAAA,CAAI,EAAE,eAAe,CAAA;AAAA,EACvD,UAAA,EAAY,KAAA;AAAA,EACZ,eAAe,CAAC,UAAA,KAAe,GAAA,CAAI,EAAE,YAAY;AACnD,CAAA,CAAE","file":"chunk-ZBE5O7S3.cjs","sourcesContent":["/**\n * The Files kits' own state: empty folders the user created (a folder exists only through its\n * documents, so a new one is a placeholder until something is moved into it), per workspace, for\n * the session (kept in `sessionStorage`, so a reload keeps them).\n */\n\nimport type { GridState } from 'ag-grid-community'\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport { DOCUMENTS_ROW_HEIGHT_INITIAL } from '../../files/documentColumns'\nimport type { ExplorerFolder } from '../../files/folders/folderPaths'\n\ninterface FilesState {\n /** Placeholder folder paths per workspace. */\n pendingFolders: Readonly<Record<string, readonly string[]>>\n addPendingFolder: (workspaceId: string, path: string) => void\n removePendingFolder: (workspaceId: string, path: string) => void\n}\n\nexport const useFilesStore = create<FilesState>()(\n persist(\n (set) => ({\n pendingFolders: {},\n addPendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (current.includes(path)) return state\n return { pendingFolders: { ...state.pendingFolders, [workspaceId]: [...current, path] } }\n }),\n removePendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (!current.includes(path)) return state\n return {\n pendingFolders: {\n ...state.pendingFolders,\n [workspaceId]: current.filter((p) => p !== path),\n },\n }\n }),\n }),\n {\n name: 'arbi_explorer_pending_folders',\n storage: createJSONStorage(() => sessionStorage),\n partialize: (state) => ({ pendingFolders: state.pendingFolders }),\n }\n )\n)\n\nconst NONE: readonly string[] = []\n\n/** A workspace's placeholder folders. */\nexport function usePendingFolders(workspaceId: string | null | undefined): readonly string[] {\n return useFilesStore(\n (state) => (workspaceId ? state.pendingFolders[workspaceId] : undefined) ?? NONE\n )\n}\n\n/** How the files page shows the documents: a table, the explorer, review one by one, or search. */\nexport type FilesViewMode = 'grid' | 'explorer' | 'navigator' | 'search'\n\n/** The files page's own preferences key (`ConnectedFilesPage` `prefsKey`). */\nexport const FILES_PREFS_KEY = 'files'\nconst DEFAULT_VIEW_MODE: FilesViewMode = 'explorer'\n\ninterface FilesPrefsState {\n /** The documents list's tri-state filters (filter id → include / exclude / off). */\n documentFilters: Readonly<Record<string, 'include' | 'exclude' | null>>\n setDocumentFilters: (filters: Record<string, 'include' | 'exclude' | null>) => void\n /**\n * Each files page's view, by its `prefsKey` (a page that is the same kit in another role, e.g.\n * a tabular review in the table view, keeps its own). Absent: that page's default.\n */\n viewModes: Readonly<Record<string, FilesViewMode>>\n /** Set a page's view (default: the files page's). */\n setViewMode: (mode: FilesViewMode, prefsKey?: string) => void\n /** The table's row height (density). */\n rowHeight: number\n setRowHeight: (height: number) => void\n}\n\n/** The Files kits' preferences, kept on this device (`localStorage`) across sessions. */\nexport const useFilesPrefs = create<FilesPrefsState>()(\n persist(\n (set) => ({\n documentFilters: {},\n setDocumentFilters: (documentFilters) => set({ documentFilters }),\n viewModes: {},\n setViewMode: (viewMode, prefsKey = FILES_PREFS_KEY) =>\n set((state) =>\n state.viewModes[prefsKey] === viewMode\n ? state\n : { viewModes: { ...state.viewModes, [prefsKey]: viewMode } }\n ),\n // New users start at the compact minimum (more rows at once).\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n setRowHeight: (rowHeight) => set({ rowHeight }),\n }),\n {\n name: 'arbi_files_prefs',\n storage: createJSONStorage(() => localStorage),\n version: 1,\n // Version 0 kept one view for every files page: it becomes the files page's own.\n migrate: (persisted, version) => {\n const state = (persisted ?? {}) as Record<string, unknown>\n if (version >= 1) return state as Partial<FilesPrefsState>\n const { viewMode, ...rest } = state\n return {\n ...rest,\n viewModes: viewMode ? { [FILES_PREFS_KEY]: viewMode as FilesViewMode } : {},\n } as Partial<FilesPrefsState>\n },\n partialize: (state) => ({\n documentFilters: state.documentFilters,\n viewModes: state.viewModes,\n rowHeight: state.rowHeight,\n }),\n }\n )\n)\n\n/** A files page's view (`prefsKey`, default the files page's), else its `defaultViewMode`. */\nexport function filesViewMode(\n state: Pick<FilesPrefsState, 'viewModes'>,\n prefsKey: string = FILES_PREFS_KEY,\n defaultViewMode: FilesViewMode = DEFAULT_VIEW_MODE\n): FilesViewMode {\n return state.viewModes[prefsKey] ?? defaultViewMode\n}\n\n/** An AI review run: the fields, the documents, and which of them the server finished. */\nexport interface AiReviewRun {\n tags: { id: string; name: string }[]\n docIds: string[]\n /** The documents the server finished (a finished cell with no value will not fill). */\n finishedDocIds?: string[]\n /** It replaces values already there: a cell shows its new value only once finished. */\n replacing?: boolean\n}\n\ninterface AiReviewState {\n /** The AI review dialog is open. */\n open: boolean\n /** The run on screen, kept after closing so \"View results\" can bring the answers back. */\n run: AiReviewRun | null\n setOpen: (open: boolean) => void\n setRun: (run: AiReviewRun | null) => void\n /** The server finished these documents of the run (with or without a value). */\n markFinished: (docIds: string[]) => void\n}\n\n/** The AI review dialog and its run, reachable from outside React (a finished-run notice). */\nexport const useAiReviewStore = create<AiReviewState>()((set) => ({\n open: false,\n run: null,\n setOpen: (open) => set({ open }),\n setRun: (run) => set({ run }),\n markFinished: (docIds) =>\n set((state) => {\n const run = state.run\n if (!run) return state\n const finished = new Set(run.finishedDocIds ?? [])\n const added = docIds.filter((id) => run.docIds.includes(id) && !finished.has(id))\n if (added.length === 0) return state\n return { run: { ...run, finishedDocIds: [...finished, ...added] } }\n }),\n}))\n\ninterface GridStatesState {\n /** AG Grid's saved state (columns, widths, sort) per grid id. */\n gridStates: Readonly<Record<string, GridState>>\n setGridState: (gridId: string, state: GridState) => void\n}\n\n/** The Files grids' saved state, kept on this device, for hosts that keep none of their own. */\nexport const useFilesGridStates = create<GridStatesState>()(\n persist(\n (set) => ({\n gridStates: {},\n setGridState: (gridId, state) =>\n set((current) => ({ gridStates: { ...current.gridStates, [gridId]: state } })),\n }),\n { name: 'arbi_files_grids', storage: createJSONStorage(() => localStorage) }\n )\n)\n\n/** A document the Delete confirmation asks about. */\nexport interface DeleteRequestDocument {\n external_id: string\n file_name?: string | null\n doc_metadata?: { title?: string | null } | null\n}\n\ninterface FilesDialogsState {\n /** Move the selection (or `folder`) to a folder. */\n move: { folder: ExplorerFolder | null } | null\n openMove: (folder?: ExplorerFolder | null) => void\n closeMove: () => void\n /** Edit the selection's labels and fields. */\n bulkTagsOpen: boolean\n setBulkTagsOpen: (open: boolean) => void\n /** Confirm deleting one document. */\n deleteRequest: DeleteRequestDocument | null\n requestDelete: (doc: DeleteRequestDocument | null) => void\n /** Export, copy or move the selection (the page's own dialog, when the host has none). */\n exportOpen: boolean\n setExportOpen: (open: boolean) => void\n}\n\n/** The files page's dialogs, also opened from outside it (commands, the viewer's related files). */\nexport const useFilesDialogs = create<FilesDialogsState>()((set) => ({\n move: null,\n openMove: (folder = null) => set({ move: { folder } }),\n closeMove: () => set({ move: null }),\n bulkTagsOpen: false,\n setBulkTagsOpen: (bulkTagsOpen) => set({ bulkTagsOpen }),\n deleteRequest: null,\n requestDelete: (deleteRequest) => set({ deleteRequest }),\n exportOpen: false,\n setExportOpen: (exportOpen) => set({ exportOpen }),\n}))\n"]}
@@ -4,20 +4,20 @@
4
4
  var chunk4ONPEVTP_cjs = require('./chunk-4ONPEVTP.cjs');
5
5
  var chunkV3KLUWQQ_cjs = require('./chunk-V3KLUWQQ.cjs');
6
6
  var chunk5GBM7BQB_cjs = require('./chunk-5GBM7BQB.cjs');
7
- var chunkUD3LPATQ_cjs = require('./chunk-UD3LPATQ.cjs');
7
+ var chunkHKKNHHBB_cjs = require('./chunk-HKKNHHBB.cjs');
8
8
  var chunkLH3PDPJP_cjs = require('./chunk-LH3PDPJP.cjs');
9
- var chunkTU46WKTN_cjs = require('./chunk-TU46WKTN.cjs');
9
+ var chunkOIYKKUAN_cjs = require('./chunk-OIYKKUAN.cjs');
10
10
  var chunk3YEXZX4H_cjs = require('./chunk-3YEXZX4H.cjs');
11
+ var chunkY3GJBLAI_cjs = require('./chunk-Y3GJBLAI.cjs');
11
12
  var chunkDKY67DA6_cjs = require('./chunk-DKY67DA6.cjs');
13
+ var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
12
14
  var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
13
15
  var chunkDWN5AUMH_cjs = require('./chunk-DWN5AUMH.cjs');
14
16
  var chunkGB5MN5FC_cjs = require('./chunk-GB5MN5FC.cjs');
15
17
  var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
16
- var chunkY3GJBLAI_cjs = require('./chunk-Y3GJBLAI.cjs');
17
- var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
18
+ var chunkLJJJ6CYH_cjs = require('./chunk-LJJJ6CYH.cjs');
18
19
  var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
19
20
  var chunkCVPV4I7Z_cjs = require('./chunk-CVPV4I7Z.cjs');
20
- var chunkLJJJ6CYH_cjs = require('./chunk-LJJJ6CYH.cjs');
21
21
  var react$1 = require('react');
22
22
  var react = require('@arbidocs/react');
23
23
  var ui = require('@arbidocs/react/ui');
@@ -215,7 +215,7 @@ function ConnectedWorkflowsTable({
215
215
  };
216
216
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
217
217
  /* @__PURE__ */ jsxRuntime.jsx(
218
- chunkTU46WKTN_cjs.WorkflowsTable,
218
+ chunkOIYKKUAN_cjs.WorkflowsTable,
219
219
  {
220
220
  ...tableProps,
221
221
  workflows,
@@ -311,7 +311,7 @@ function ReferencePicker({
311
311
  onSelect
312
312
  }) {
313
313
  const groups = react$1.useMemo(() => {
314
- const docs = documents.filter(isTopLevel).map(chunkUD3LPATQ_cjs.toWorkflowFieldDocument).sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()));
314
+ const docs = documents.filter(isTopLevel).map(chunkHKKNHHBB_cjs.toWorkflowFieldDocument).sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()));
315
315
  return [{ id: "all", heading: "In this workspace", docs }];
316
316
  }, [documents]);
317
317
  const selected = groups[0].docs.find((d) => d.id === selectedId);
@@ -335,7 +335,7 @@ function useConnectedDocxReferences() {
335
335
  documentsRef.current = documents;
336
336
  return react$1.useMemo(
337
337
  () => ({
338
- documents: async () => documentsRef.current.filter(isTopLevel).map((d) => ({ id: d.external_id, title: chunkUD3LPATQ_cjs.toWorkflowFieldDocument(d).title })),
338
+ documents: async () => documentsRef.current.filter(isTopLevel).map((d) => ({ id: d.external_id, title: chunkHKKNHHBB_cjs.toWorkflowFieldDocument(d).title })),
339
339
  passages: async (documentId) => {
340
340
  const parsed = await arbi.documents.getParsedContent(documentId, "final");
341
341
  return (parsed.chunks ?? []).flatMap(
@@ -626,5 +626,5 @@ exports.useConnectedNativeDocxAdapter = useConnectedNativeDocxAdapter;
626
626
  exports.useConnectedWorkspaceRole = useConnectedWorkspaceRole;
627
627
  exports.useDocxCommentTarget = useDocxCommentTarget;
628
628
  exports.useNativeDocxSupport = useNativeDocxSupport;
629
- //# sourceMappingURL=chunk-GS2C25ID.cjs.map
630
- //# sourceMappingURL=chunk-GS2C25ID.cjs.map
629
+ //# sourceMappingURL=chunk-ZXXNVW34.cjs.map
630
+ //# sourceMappingURL=chunk-ZXXNVW34.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/workflows/StartWorkflowInDialog.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/save-native-version.ts","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","getEntityLabel","useWorkspaces","useMemo","useState","jsxs","ModalScaffold","jsx","Button","useConnectedWorkspace","useWorkspaceUsers","fmtDate","useBlocksEnvironment","useOpenWorkflow","workflowSteps","useWorkflows","useConnectedConversations","useAgents","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","isScheduledWorkflow","useEffect","Fragment","WorkflowsTable","workflowSignal","workflowTriggerType","confirmShareWithWorkspace","toWorkflowFieldDocument","DocumentPicker","useArbi","useListedDocuments","useRef","buildDeepLinkUrl","parseDeepLinkPath","useSetWorkspaceHouseTemplate","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useArbiSessionStore","useQueryClient","useOptionalDocumentTools","getUserEncryptionKeypair","registerDocumentTurnFlush","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACbO,IAAM,gCAAA,GAAgE;AAAA,EAC3E,KAAA,EAAO,CAAC,IAAA,KAAS,CAAA,YAAA,EAAU,IAAI,CAAA,eAAA,CAAA;AAAA,EAC/B,aAAa,CAAA,8DAAA,EAAiEC,iBAAA,CAAe,WAAW,CAAA,CAAE,aAAa,CAAA,GAAA,CAAA;AAAA,EACvH,QAAQ,CAAA,SAAA,EAAYA,iBAAA,CAAe,WAAW,CAAA,CAAE,aAAa,CAAA,CAAA;AAAA,EAC7D,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,MAAM,CAAA,uBAAA,EAA0BA,iBAAA,CAAe,WAAW,CAAA,CAAE,aAAa,CAAA,CAAA;AAC3E,CAAA;AASO,SAAS,qBAAA,CAAsB;AAAA,EACpC,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAA+B;AAC7B,EAAA,MAAM,CAAA,GAAI,EAAE,GAAG,gCAAA,EAAkC,GAAG,MAAA,EAAO;AAC3D,EAAA,MAAM,EAAE,IAAA,EAAM,UAAA,GAAa,EAAC,KAAMC,mBAAA,EAAc;AAEhD,EAAA,MAAM,OAAA,GAAUC,eAAA;AAAA,IACd,MACE,UAAA,CAAW,M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ACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-GS2C25ID.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * Start a shared workflow in another workspace: the person picks one of the workspaces they belong\n * to (a matter's, for a process of the skills workspace), and the workflow's run page opens there\n * (`openWorkflow(id, { view: 'run', runIn })`), its pickers that workspace's. The server refuses a\n * start by someone who is not a member of both.\n */\n\nimport { useMemo, useState } from 'react'\nimport { useWorkspaces, type WorkflowResponse } from '@arbidocs/react'\nimport { Button, getEntityLabel } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../../settings/ModalScaffold'\n\nexport interface StartWorkflowInDialogLabels {\n title: (name: string) => string\n description: string\n choose: string\n start: string\n cancel: string\n none: string\n}\n\nexport const DEFAULT_START_WORKFLOW_IN_LABELS: StartWorkflowInDialogLabels = {\n title: (name) => `Start “${name}” in…`,\n description: `The run happens there: its files, people and threads are that ${getEntityLabel('WORKSPACE').toLowerCase()}'s.`,\n choose: `Choose a ${getEntityLabel('WORKSPACE').toLowerCase()}`,\n start: 'Start',\n cancel: 'Cancel',\n none: `You belong to no other ${getEntityLabel('WORKSPACE').toLowerCase()}.`,\n}\n\nexport interface StartWorkflowInDialogProps {\n workflow: WorkflowResponse\n onStart: (workspaceId: string) => void\n onClose: () => void\n labels?: Partial<StartWorkflowInDialogLabels>\n}\n\nexport function StartWorkflowInDialog({\n workflow,\n onStart,\n onClose,\n labels,\n}: StartWorkflowInDialogProps) {\n const l = { ...DEFAULT_START_WORKFLOW_IN_LABELS, ...labels }\n const { data: workspaces = [] } = useWorkspaces()\n // The workspaces the person belongs to, other than the workflow's own (a run there is its Run).\n const targets = useMemo(\n () =>\n workspaces.filter(\n (ws) => ws.is_member !== false && ws.external_id !== workflow.workspace_ext_id\n ),\n [workspaces, workflow.workspace_ext_id]\n )\n const [chosen, setChosen] = useState('')\n return (\n <ModalScaffold\n open\n onOpenChange={(open) => !open && onClose()}\n title={l.title(workflow.name)}\n description={l.description}\n showDescription\n size=\"sm\"\n testId=\"start-workflow-in-dialog\"\n >\n <ModalScaffold.Body>\n {targets.length ? (\n <select\n aria-label={l.choose}\n value={chosen}\n onChange={(e) => setChosen(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-input bg-background px-2 text-sm shadow-sm\"\n data-testid=\"start-workflow-in-select\"\n >\n <option value=\"\">{l.choose}</option>\n {targets.map((ws) => (\n <option key={ws.external_id} value={ws.external_id}>\n {ws.name}\n </option>\n ))}\n </select>\n ) : (\n <p className=\"text-sm text-muted-foreground\">{l.none}</p>\n )}\n </ModalScaffold.Body>\n <ModalScaffold.Footer>\n <Button variant=\"outline\" onClick={onClose}>\n {l.cancel}\n </Button>\n <Button\n disabled={!chosen}\n onClick={() => onStart(chosen)}\n data-testid=\"start-workflow-in-confirm\"\n >\n {l.start}\n </Button>\n </ModalScaffold.Footer>\n </ModalScaffold>\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 * The host's catalogue (the host configuration's `workflows.catalogue`), when it has one, is listed\n * in its categories above the saved workflows: an entry opens in the builder (`onOpenTemplate`) or\n * runs (the environment's `openWorkflow(id, { view: 'run' })`). A filtered list (`filter`) is about\n * saved workflows only and leaves the catalogue out.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport type { WorkflowCatalogueRow } from '../agents/tasks/WorkflowCatalogueSections'\nimport {\n isScheduledWorkflow,\n workflowSignal,\n workflowTriggerType,\n} from '../agents/tasks/workflowRows'\nimport { workflowSteps } from '../agents/workflows/run'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useOpenWorkflow } from './workflows/useOpenWorkflow'\nimport { useHost } from '../provider/host'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\nimport { confirmShareWithWorkspace } from '../collaboration/sharing/one-way'\nimport { StartWorkflowInDialog } from './workflows/StartWorkflowInDialog'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n /** When a workflow that starts on a step signal starts (the default trigger text). */\n signalTrigger: (signal: string) => string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n signalTrigger: (signal) => `When a step signals ${signal}`,\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n | 'catalogue'\n | 'categories'\n | 'renderIcon'\n> {\n /**\n * Which saved workflows to list: `scheduled` (those that start on a date or a repeat), or a\n * predicate. Default: all.\n */\n filter?: 'scheduled' | ((workflow: WorkflowResponse) => boolean)\n /**\n * When a workflow starts, in the host's words. Default: the step signal it starts on, else its\n * trigger type.\n */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger,\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n onRunTemplate,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const openWorkflow = useOpenWorkflow()\n const host = useHost().workflows\n // A filtered list (the scheduled workflows) is about saved workflows only.\n const catalogueEntries = filter ? undefined : host?.catalogue\n const catalogue = useMemo(\n () =>\n catalogueEntries?.map(({ workflow, category, note, runnable }): WorkflowCatalogueRow => ({\n id: workflow.id,\n title: workflow.title,\n description: workflow.description,\n icon: workflow.icon,\n category,\n stepCount: workflowSteps(workflow).length,\n note,\n runnable,\n })),\n [catalogueEntries]\n )\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n // The shared workflow being started in another workspace (\"Start in…\").\n const [startingIn, setStartingIn] = useState<WorkflowResponse | null>(null)\n\n const workflows = useMemo(() => {\n const keep = filter === 'scheduled' ? isScheduledWorkflow : filter\n return keep ? saved.filter(keep) : saved\n }, [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <>\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={\n describeTrigger ??\n ((w) => {\n const signal = workflowSignal(w)\n return signal ? l.signalTrigger(signal) : workflowTriggerType(w).replaceAll('_', ' ')\n })\n }\n catalogue={catalogue}\n categories={host?.categories}\n renderIcon={host?.renderIcon}\n onRunTemplate={\n onRunTemplate ?? (openWorkflow && ((id) => openWorkflow(id, { view: 'run' })))\n }\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 (async () => {\n // Sharing is one-way: it asks first, saying so; nothing offers it back.\n if (!shared) return\n const ok = await confirmShareWithWorkspace(confirm, {\n count: 1,\n noun: { singular: 'workflow', plural: 'workflows' },\n })\n if (ok)\n await act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared: true } })\n )\n })()\n }\n onStartIn={openWorkflow ? (workflow) => setStartingIn(workflow) : undefined}\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 {startingIn && openWorkflow && (\n <StartWorkflowInDialog\n workflow={startingIn}\n onClose={() => setStartingIn(null)}\n onStart={(workspaceId) => {\n setStartingIn(null)\n openWorkflow(startingIn.external_id, { view: 'run', runIn: workspaceId })\n }}\n />\n )}\n </>\n )\n}\n","import type { NativeDocxAdapter } from '../../docx/NativeDocxEditor'\n\n/** Older servers reject the new body field; retain their ordinary version save during rollout. */\nexport async function saveNativeVersion(\n request: NativeDocxAdapter['request'],\n documentId: string,\n state?: string,\n autosave = false\n): ReturnType<NativeDocxAdapter['save']> {\n const send = async (rolling: boolean) =>\n (\n await request(`/${encodeURIComponent(documentId)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state, ...(rolling ? { autosave: true } : {}) }),\n })\n ).json()\n try {\n return await send(autosave)\n } catch (error) {\n if (\n !autosave ||\n !error ||\n typeof error !== 'object' ||\n !('status' in error) ||\n error.status !== 422\n )\n throw error\n return send(false)\n }\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The 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/content-path'\nimport type { HouseTemplate, HouseTemplateHost } 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 // The built-in template comes with the Word editor's template code: loaded on demand.\n return (await import('../../docx/template/HouseTemplate')).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 { saveNativeVersion } from './save-native-version'\nimport { useMemo, useRef, useState } from 'react'\nimport { getUserEncryptionKeypair } from '@arbidocs/client'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useArbiSessionStore, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport type { NativeDocxAdapter, NativeDocxEditorProps } from '../../docx/NativeDocxEditor'\nimport { NativeDocxEditor } from '../../docx/lazy'\nimport { registerDocumentTurnFlush } from '@arbidocs/react'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter' | 'compact'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn&apos;t available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, userId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const sessionStore = useArbiSessionStore()\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 recoveryOrigin = arbi.getConnectionInfo()?.baseUrl || window.location.origin\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n recoveryScope:\n workspaceId && userId ? `${recoveryOrigin}\\0${workspaceId}\\0${userId}` : undefined,\n recoveryIsCurrent: () =>\n arbi.isLoggedIn &&\n !!workspaceId &&\n !!userId &&\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) === recoveryOrigin &&\n sessionStore.getState().workspaceId === workspaceId &&\n arbi.user.identity()?.externalId === userId,\n onRecoveryInvalidated: (listener) => {\n if (!arbi.isLoggedIn) return () => {}\n const auth = arbi.getClient().session\n const check = () => {\n const state = auth.getState()\n if (\n !state.signedIn ||\n state.userExtId !== userId ||\n sessionStore.getState().workspaceId !== workspaceId\n )\n listener()\n }\n const stopAuth = auth.subscribe(check),\n stopWorkspace = sessionStore.subscribe(check)\n check()\n return () => {\n stopAuth()\n stopWorkspace()\n }\n },\n recoveryIdentity: async () => {\n const before = arbi.user.identity()?.externalId\n if (\n !arbi.isLoggedIn ||\n !workspaceId ||\n !userId ||\n before !== userId ||\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin ||\n sessionStore.getState().workspaceId !== workspaceId\n )\n return null\n const keypair = await getUserEncryptionKeypair()\n if (!keypair) return null\n if (\n !arbi.isLoggedIn ||\n arbi.user.identity()?.externalId !== before ||\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin ||\n sessionStore.getState().workspaceId !== workspaceId\n ) {\n keypair.secretKey.fill(0)\n return null\n }\n return { workspaceId: JSON.stringify([recoveryOrigin, workspaceId]), keypair }\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: (id, state, autosave) => saveNativeVersion(arbi.editor.request, id, state, autosave),\n loadFonts: () => import('../../docx/fonts').then((m) => m.loadDocxFonts(fontBaseUrl)),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n registerTurnFlush: registerDocumentTurnFlush,\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, version) => {\n if (onDocumentsChanged) await onDocumentsChanged([id], 'version')\n if (version || !onDocumentsChanged) {\n const fresh = await refreshDocuments(queries, arbi, [id])\n if (\n version &&\n !fresh.some((doc) => doc.external_id === id && (doc.current_version ?? 0) >= version)\n ) {\n throw new Error(\n 'The version was saved, but its current status could not be confirmed. Please try again.'\n )\n }\n }\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n workspaceId,\n recoveryOrigin,\n userId,\n sessionStore,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/workflows/StartWorkflowInDialog.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/save-native-version.ts","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","getEntityLabel","useWorkspaces","useMemo","useState","jsxs","ModalScaffold","jsx","Button","useConnectedWorkspace","useWorkspaceUsers","fmtDate","useBlocksEnvironment","useOpenWorkflow","workflowSteps","useWorkflows","useConnectedConversations","useAgents","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","isScheduledWorkflow","useEffect","Fragment","WorkflowsTable","workflowSignal","workflowTriggerType","confirmShareWithWorkspace","toWorkflowFieldDocument","DocumentPicker","useArbi","useListedDocuments","useRef","buildDeepLinkUrl","parseDeepLinkPath","useSetWorkspaceHouseTemplate","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useArbiSessionStore","useQueryClient","useOptionalDocumentTools","getUserEncryptionKeypair","registerDocumentTurnFlush","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACbO,IAAM,gCAAA,GAAgE;AAAA,EAC3E,KAAA,EAAO,CAAC,IAAA,KAAS,CAAA,YAAA,EAAU,IAAI,CAAA,eAAA,CAAA;AAAA,EAC/B,aAAa,CAAA,8DAAA,EAAiEC,iBAAA,CAAe,WAAW,CAAA,CAAE,aAAa,CAAA,GAAA,CAAA;AAAA,EACvH,QAAQ,CAAA,SAAA,EAAYA,iBAAA,CAAe,WAAW,CAAA,CAAE,aAAa,CAAA,CAAA;AAAA,EAC7D,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,MAAM,CAAA,uBAAA,EAA0BA,iBAAA,CAAe,WAAW,CAAA,CAAE,aAAa,CAAA,CAAA;AAC3E,CAAA;AASO,SAAS,qBAAA,CAAsB;AAAA,EACpC,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA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AAA,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;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-ZXXNVW34.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * Start a shared workflow in another workspace: the person picks one of the workspaces they belong\n * to (a matter's, for a process of the skills workspace), and the workflow's run page opens there\n * (`openWorkflow(id, { view: 'run', runIn })`), its pickers that workspace's. The server refuses a\n * start by someone who is not a member of both.\n */\n\nimport { useMemo, useState } from 'react'\nimport { useWorkspaces, type WorkflowResponse } from '@arbidocs/react'\nimport { Button, getEntityLabel } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../../settings/ModalScaffold'\n\nexport interface StartWorkflowInDialogLabels {\n title: (name: string) => string\n description: string\n choose: string\n start: string\n cancel: string\n none: string\n}\n\nexport const DEFAULT_START_WORKFLOW_IN_LABELS: StartWorkflowInDialogLabels = {\n title: (name) => `Start “${name}” in…`,\n description: `The run happens there: its files, people and threads are that ${getEntityLabel('WORKSPACE').toLowerCase()}'s.`,\n choose: `Choose a ${getEntityLabel('WORKSPACE').toLowerCase()}`,\n start: 'Start',\n cancel: 'Cancel',\n none: `You belong to no other ${getEntityLabel('WORKSPACE').toLowerCase()}.`,\n}\n\nexport interface StartWorkflowInDialogProps {\n workflow: WorkflowResponse\n onStart: (workspaceId: string) => void\n onClose: () => void\n labels?: Partial<StartWorkflowInDialogLabels>\n}\n\nexport function StartWorkflowInDialog({\n workflow,\n onStart,\n onClose,\n labels,\n}: StartWorkflowInDialogProps) {\n const l = { ...DEFAULT_START_WORKFLOW_IN_LABELS, ...labels }\n const { data: workspaces = [] } = useWorkspaces()\n // The workspaces the person belongs to, other than the workflow's own (a run there is its Run).\n const targets = useMemo(\n () =>\n workspaces.filter(\n (ws) => ws.is_member !== false && ws.external_id !== workflow.workspace_ext_id\n ),\n [workspaces, workflow.workspace_ext_id]\n )\n const [chosen, setChosen] = useState('')\n return (\n <ModalScaffold\n open\n onOpenChange={(open) => !open && onClose()}\n title={l.title(workflow.name)}\n description={l.description}\n showDescription\n size=\"sm\"\n testId=\"start-workflow-in-dialog\"\n >\n <ModalScaffold.Body>\n {targets.length ? (\n <select\n aria-label={l.choose}\n value={chosen}\n onChange={(e) => setChosen(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-input bg-background px-2 text-sm shadow-sm\"\n data-testid=\"start-workflow-in-select\"\n >\n <option value=\"\">{l.choose}</option>\n {targets.map((ws) => (\n <option key={ws.external_id} value={ws.external_id}>\n {ws.name}\n </option>\n ))}\n </select>\n ) : (\n <p className=\"text-sm text-muted-foreground\">{l.none}</p>\n )}\n </ModalScaffold.Body>\n <ModalScaffold.Footer>\n <Button variant=\"outline\" onClick={onClose}>\n {l.cancel}\n </Button>\n <Button\n disabled={!chosen}\n onClick={() => onStart(chosen)}\n data-testid=\"start-workflow-in-confirm\"\n >\n {l.start}\n </Button>\n </ModalScaffold.Footer>\n </ModalScaffold>\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 * The host's catalogue (the host configuration's `workflows.catalogue`), when it has one, is listed\n * in its categories above the saved workflows: an entry opens in the builder (`onOpenTemplate`) or\n * runs (the environment's `openWorkflow(id, { view: 'run' })`). A filtered list (`filter`) is about\n * saved workflows only and leaves the catalogue out.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport type { WorkflowCatalogueRow } from '../agents/tasks/WorkflowCatalogueSections'\nimport {\n isScheduledWorkflow,\n workflowSignal,\n workflowTriggerType,\n} from '../agents/tasks/workflowRows'\nimport { workflowSteps } from '../agents/workflows/run'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useOpenWorkflow } from './workflows/useOpenWorkflow'\nimport { useHost } from '../provider/host'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\nimport { confirmShareWithWorkspace } from '../collaboration/sharing/one-way'\nimport { StartWorkflowInDialog } from './workflows/StartWorkflowInDialog'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n /** When a workflow that starts on a step signal starts (the default trigger text). */\n signalTrigger: (signal: string) => string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n signalTrigger: (signal) => `When a step signals ${signal}`,\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n | 'catalogue'\n | 'categories'\n | 'renderIcon'\n> {\n /**\n * Which saved workflows to list: `scheduled` (those that start on a date or a repeat), or a\n * predicate. Default: all.\n */\n filter?: 'scheduled' | ((workflow: WorkflowResponse) => boolean)\n /**\n * When a workflow starts, in the host's words. Default: the step signal it starts on, else its\n * trigger type.\n */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger,\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n onRunTemplate,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const openWorkflow = useOpenWorkflow()\n const host = useHost().workflows\n // A filtered list (the scheduled workflows) is about saved workflows only.\n const catalogueEntries = filter ? undefined : host?.catalogue\n const catalogue = useMemo(\n () =>\n catalogueEntries?.map(({ workflow, category, note, runnable }): WorkflowCatalogueRow => ({\n id: workflow.id,\n title: workflow.title,\n description: workflow.description,\n icon: workflow.icon,\n category,\n stepCount: workflowSteps(workflow).length,\n note,\n runnable,\n })),\n [catalogueEntries]\n )\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n // The shared workflow being started in another workspace (\"Start in…\").\n const [startingIn, setStartingIn] = useState<WorkflowResponse | null>(null)\n\n const workflows = useMemo(() => {\n const keep = filter === 'scheduled' ? isScheduledWorkflow : filter\n return keep ? saved.filter(keep) : saved\n }, [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <>\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={\n describeTrigger ??\n ((w) => {\n const signal = workflowSignal(w)\n return signal ? l.signalTrigger(signal) : workflowTriggerType(w).replaceAll('_', ' ')\n })\n }\n catalogue={catalogue}\n categories={host?.categories}\n renderIcon={host?.renderIcon}\n onRunTemplate={\n onRunTemplate ?? (openWorkflow && ((id) => openWorkflow(id, { view: 'run' })))\n }\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 (async () => {\n // Sharing is one-way: it asks first, saying so; nothing offers it back.\n if (!shared) return\n const ok = await confirmShareWithWorkspace(confirm, {\n count: 1,\n noun: { singular: 'workflow', plural: 'workflows' },\n })\n if (ok)\n await act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared: true } })\n )\n })()\n }\n onStartIn={openWorkflow ? (workflow) => setStartingIn(workflow) : undefined}\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 {startingIn && openWorkflow && (\n <StartWorkflowInDialog\n workflow={startingIn}\n onClose={() => setStartingIn(null)}\n onStart={(workspaceId) => {\n setStartingIn(null)\n openWorkflow(startingIn.external_id, { view: 'run', runIn: workspaceId })\n }}\n />\n )}\n </>\n )\n}\n","import type { NativeDocxAdapter } from '../../docx/NativeDocxEditor'\n\n/** Older servers reject the new body field; retain their ordinary version save during rollout. */\nexport async function saveNativeVersion(\n request: NativeDocxAdapter['request'],\n documentId: string,\n state?: string,\n autosave = false\n): ReturnType<NativeDocxAdapter['save']> {\n const send = async (rolling: boolean) =>\n (\n await request(`/${encodeURIComponent(documentId)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state, ...(rolling ? { autosave: true } : {}) }),\n })\n ).json()\n try {\n return await send(autosave)\n } catch (error) {\n if (\n !autosave ||\n !error ||\n typeof error !== 'object' ||\n !('status' in error) ||\n error.status !== 422\n )\n throw error\n return send(false)\n }\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The 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/content-path'\nimport type { HouseTemplate, HouseTemplateHost } 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 // The built-in template comes with the Word editor's template code: loaded on demand.\n return (await import('../../docx/template/HouseTemplate')).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 { saveNativeVersion } from './save-native-version'\nimport { useMemo, useRef, useState } from 'react'\nimport { getUserEncryptionKeypair } from '@arbidocs/client'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useArbiSessionStore, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport type { NativeDocxAdapter, NativeDocxEditorProps } from '../../docx/NativeDocxEditor'\nimport { NativeDocxEditor } from '../../docx/lazy'\nimport { registerDocumentTurnFlush } from '@arbidocs/react'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter' | 'compact'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn&apos;t available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, userId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const sessionStore = useArbiSessionStore()\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 recoveryOrigin = arbi.getConnectionInfo()?.baseUrl || window.location.origin\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n recoveryScope:\n workspaceId && userId ? `${recoveryOrigin}\\0${workspaceId}\\0${userId}` : undefined,\n recoveryIsCurrent: () =>\n arbi.isLoggedIn &&\n !!workspaceId &&\n !!userId &&\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) === recoveryOrigin &&\n sessionStore.getState().workspaceId === workspaceId &&\n arbi.user.identity()?.externalId === userId,\n onRecoveryInvalidated: (listener) => {\n if (!arbi.isLoggedIn) return () => {}\n const auth = arbi.getClient().session\n const check = () => {\n const state = auth.getState()\n if (\n !state.signedIn ||\n state.userExtId !== userId ||\n sessionStore.getState().workspaceId !== workspaceId\n )\n listener()\n }\n const stopAuth = auth.subscribe(check),\n stopWorkspace = sessionStore.subscribe(check)\n check()\n return () => {\n stopAuth()\n stopWorkspace()\n }\n },\n recoveryIdentity: async () => {\n const before = arbi.user.identity()?.externalId\n if (\n !arbi.isLoggedIn ||\n !workspaceId ||\n !userId ||\n before !== userId ||\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin ||\n sessionStore.getState().workspaceId !== workspaceId\n )\n return null\n const keypair = await getUserEncryptionKeypair()\n if (!keypair) return null\n if (\n !arbi.isLoggedIn ||\n arbi.user.identity()?.externalId !== before ||\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin ||\n sessionStore.getState().workspaceId !== workspaceId\n ) {\n keypair.secretKey.fill(0)\n return null\n }\n return { workspaceId: JSON.stringify([recoveryOrigin, workspaceId]), keypair }\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: (id, state, autosave) => saveNativeVersion(arbi.editor.request, id, state, autosave),\n loadFonts: () => import('../../docx/fonts').then((m) => m.loadDocxFonts(fontBaseUrl)),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n registerTurnFlush: registerDocumentTurnFlush,\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, version) => {\n if (onDocumentsChanged) await onDocumentsChanged([id], 'version')\n if (version || !onDocumentsChanged) {\n const fresh = await refreshDocuments(queries, arbi, [id])\n if (\n version &&\n !fresh.some((doc) => doc.external_id === id && (doc.current_version ?? 0) >= version)\n ) {\n throw new Error(\n 'The version was saved, but its current status could not be confirmed. Please try again.'\n )\n }\n }\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n workspaceId,\n recoveryOrigin,\n userId,\n sessionStore,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
@@ -1,73 +1,73 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkZC6EPBVL_cjs = require('../chunk-ZC6EPBVL.cjs');
5
- var chunkXTWHFHEK_cjs = require('../chunk-XTWHFHEK.cjs');
4
+ var chunkKHTM7M6E_cjs = require('../chunk-KHTM7M6E.cjs');
5
+ var chunkJL4AL3ZJ_cjs = require('../chunk-JL4AL3ZJ.cjs');
6
6
  require('../chunk-WN6BLSAZ.cjs');
7
7
  require('../chunk-BLJET4KG.cjs');
8
8
  require('../chunk-BD7P4KYQ.cjs');
9
9
  require('../chunk-GA5ZO4YA.cjs');
10
10
  require('../chunk-VG5XNE4H.cjs');
11
11
  require('../chunk-DDWLMYRO.cjs');
12
- var chunkGS2C25ID_cjs = require('../chunk-GS2C25ID.cjs');
12
+ var chunkZXXNVW34_cjs = require('../chunk-ZXXNVW34.cjs');
13
13
  require('../chunk-4ONPEVTP.cjs');
14
14
  require('../chunk-V3KLUWQQ.cjs');
15
15
  require('../chunk-5GBM7BQB.cjs');
16
- require('../chunk-UD3LPATQ.cjs');
16
+ require('../chunk-HKKNHHBB.cjs');
17
17
  require('../chunk-7NJKDJVO.cjs');
18
18
  require('../chunk-UKOYN2WD.cjs');
19
19
  require('../chunk-RC25WMVB.cjs');
20
20
  require('../chunk-LH3PDPJP.cjs');
21
- require('../chunk-TU46WKTN.cjs');
21
+ require('../chunk-75BNMCUX.cjs');
22
+ require('../chunk-OIYKKUAN.cjs');
22
23
  require('../chunk-3YEXZX4H.cjs');
23
24
  require('../chunk-4PA6VCCR.cjs');
24
- require('../chunk-G3MRW4WB.cjs');
25
+ require('../chunk-LK4TQBV6.cjs');
25
26
  require('../chunk-AHDJXIUB.cjs');
26
27
  require('../chunk-S3GVFAFB.cjs');
27
28
  require('../chunk-6UZC4XVV.cjs');
28
29
  require('../chunk-SLCH5JRI.cjs');
30
+ require('../chunk-Y3GJBLAI.cjs');
31
+ require('../chunk-SQCCQU3K.cjs');
32
+ require('../chunk-UDSHVNU3.cjs');
29
33
  require('../chunk-DKY67DA6.cjs');
30
34
  require('../chunk-YA6GXWC2.cjs');
35
+ require('../chunk-IPSHAMO2.cjs');
31
36
  require('../chunk-ZVEW3JBT.cjs');
32
37
  require('../chunk-VZOOGA47.cjs');
33
38
  require('../chunk-DWN5AUMH.cjs');
34
39
  require('../chunk-GB5MN5FC.cjs');
35
40
  require('../chunk-3YZKDCWY.cjs');
36
41
  require('../chunk-SJSGSHIT.cjs');
37
- require('../chunk-ZW6FPIFC.cjs');
38
- require('../chunk-75BNMCUX.cjs');
39
- require('../chunk-Y3GJBLAI.cjs');
40
- require('../chunk-SQCCQU3K.cjs');
41
- require('../chunk-UDSHVNU3.cjs');
42
- require('../chunk-IPSHAMO2.cjs');
43
42
  require('../chunk-PPCATBOY.cjs');
43
+ require('../chunk-ZW6FPIFC.cjs');
44
+ require('../chunk-LJJJ6CYH.cjs');
44
45
  require('../chunk-46LX6EQT.cjs');
45
46
  require('../chunk-K67VMSOX.cjs');
46
47
  require('../chunk-CVPV4I7Z.cjs');
47
- require('../chunk-LJJJ6CYH.cjs');
48
48
  require('../chunk-PLIF5CUV.cjs');
49
49
  var react = require('react');
50
50
 
51
51
  function useConnectedMailWordEditor() {
52
- const adapter = chunkGS2C25ID_cjs.useConnectedNativeDocxAdapter();
52
+ const adapter = chunkZXXNVW34_cjs.useConnectedNativeDocxAdapter();
53
53
  return react.useMemo(() => ({ adapter }), [adapter]);
54
54
  }
55
55
 
56
56
  Object.defineProperty(exports, "ConnectedStreamedWordArtifact", {
57
57
  enumerable: true,
58
- get: function () { return chunkZC6EPBVL_cjs.ConnectedStreamedWordArtifact; }
58
+ get: function () { return chunkKHTM7M6E_cjs.ConnectedStreamedWordArtifact; }
59
59
  });
60
60
  Object.defineProperty(exports, "ConnectedNativeDocxComparison", {
61
61
  enumerable: true,
62
- get: function () { return chunkXTWHFHEK_cjs.ConnectedNativeDocxComparison; }
62
+ get: function () { return chunkJL4AL3ZJ_cjs.ConnectedNativeDocxComparison; }
63
63
  });
64
64
  Object.defineProperty(exports, "ConnectedNativeDocxEditor", {
65
65
  enumerable: true,
66
- get: function () { return chunkGS2C25ID_cjs.ConnectedNativeDocxEditor; }
66
+ get: function () { return chunkZXXNVW34_cjs.ConnectedNativeDocxEditor; }
67
67
  });
68
68
  Object.defineProperty(exports, "useConnectedNativeDocxAdapter", {
69
69
  enumerable: true,
70
- get: function () { return chunkGS2C25ID_cjs.useConnectedNativeDocxAdapter; }
70
+ get: function () { return chunkZXXNVW34_cjs.useConnectedNativeDocxAdapter; }
71
71
  });
72
72
  exports.useConnectedMailWordEditor = useConnectedMailWordEditor;
73
73
  //# sourceMappingURL=docx.cjs.map