@arbidocs/blocks 0.5.157 → 0.5.158
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.
- package/dist/{ConnectedCallDock-TGI43VKB.cjs → ConnectedCallDock-ML4ZTABN.cjs} +27 -27
- package/dist/{ConnectedCallDock-TGI43VKB.cjs.map → ConnectedCallDock-ML4ZTABN.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-FBTDSG3N.cjs → ConnectedCallRoom-GBTP2LT2.cjs} +19 -19
- package/dist/{ConnectedCallRoom-FBTDSG3N.cjs.map → ConnectedCallRoom-GBTP2LT2.cjs.map} +1 -1
- package/dist/{ConnectedMailInviteCard-LV2VARX3.cjs → ConnectedMailInviteCard-VMFTQ5PW.cjs} +5 -5
- package/dist/{ConnectedMailInviteCard-LV2VARX3.cjs.map → ConnectedMailInviteCard-VMFTQ5PW.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-7VD4ZIHO.cjs → ConnectedNativeDocxComparison-JB77U5MF.cjs} +23 -23
- package/dist/{ConnectedNativeDocxComparison-7VD4ZIHO.cjs.map → ConnectedNativeDocxComparison-JB77U5MF.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-FDYO2TSX.cjs → ConnectedPresentation-SQZJG6ZG.cjs} +22 -22
- package/dist/{ConnectedPresentation-FDYO2TSX.cjs.map → ConnectedPresentation-SQZJG6ZG.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-4N7R7SFZ.cjs → ConnectedProductionSetDialog-7J4T3L6U.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-4N7R7SFZ.cjs.map → ConnectedProductionSetDialog-7J4T3L6U.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-NM2UEE77.cjs → ConnectedSlidesTab-VLRDE7YI.cjs} +18 -18
- package/dist/{ConnectedSlidesTab-NM2UEE77.cjs.map → ConnectedSlidesTab-VLRDE7YI.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-ISLZLV4V.cjs → ConnectedStreamedWordArtifact-HL7PQWLF.cjs} +23 -23
- package/dist/{ConnectedStreamedWordArtifact-ISLZLV4V.cjs.map → ConnectedStreamedWordArtifact-HL7PQWLF.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5CVWGOZQ.cjs → DocumentReviewCard-KYC4PXXF.cjs} +28 -28
- package/dist/{DocumentReviewCard-5CVWGOZQ.cjs.map → DocumentReviewCard-KYC4PXXF.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-PXUXYTPK.cjs → FilesViewerDialog-SHS35TMG.cjs} +63 -63
- package/dist/{FilesViewerDialog-PXUXYTPK.cjs.map → FilesViewerDialog-SHS35TMG.cjs.map} +1 -1
- package/dist/RechartsRenderer-KFHFIEIQ.cjs +347 -0
- package/dist/RechartsRenderer-KFHFIEIQ.cjs.map +1 -0
- package/dist/TimeSeriesDrawing-UHDFZPYG.cjs +166 -0
- package/dist/TimeSeriesDrawing-UHDFZPYG.cjs.map +1 -0
- package/dist/{WorkspaceTableView-HR4KTFSX.cjs → WorkspaceTableView-BO3N2NYC.cjs} +14 -14
- package/dist/{WorkspaceTableView-HR4KTFSX.cjs.map → WorkspaceTableView-BO3N2NYC.cjs.map} +1 -1
- package/dist/agents/index.cjs +385 -385
- package/dist/agents/tasks/WorkflowsTable.js +10 -6
- package/dist/agents/tasks/WorkflowsTable.js.map +2 -2
- package/dist/{ai-HME7CNDE.cjs → ai-NFZHPSS2.cjs} +28 -28
- package/dist/ai-NFZHPSS2.cjs.map +1 -0
- package/dist/auth/index.cjs +2 -2
- package/dist/calendar/index.cjs +106 -106
- package/dist/calls/index.cjs +155 -155
- package/dist/chat/index.cjs +22 -22
- package/dist/{chunk-ST5EZE2O.cjs → chunk-2I7Z3XFC.cjs} +12 -12
- package/dist/{chunk-ST5EZE2O.cjs.map → chunk-2I7Z3XFC.cjs.map} +1 -1
- package/dist/{chunk-NGATAD62.cjs → chunk-2P7VH2SK.cjs} +3 -3
- package/dist/{chunk-NGATAD62.cjs.map → chunk-2P7VH2SK.cjs.map} +1 -1
- package/dist/{chunk-BAZZTZW5.cjs → chunk-2XHJVYNY.cjs} +6 -6
- package/dist/{chunk-BAZZTZW5.cjs.map → chunk-2XHJVYNY.cjs.map} +1 -1
- package/dist/{chunk-PFGRONAI.cjs → chunk-3GQQUR27.cjs} +4 -4
- package/dist/{chunk-PFGRONAI.cjs.map → chunk-3GQQUR27.cjs.map} +1 -1
- package/dist/{chunk-N362DFM4.cjs → chunk-3RAW2ZH5.cjs} +3 -3
- package/dist/{chunk-N362DFM4.cjs.map → chunk-3RAW2ZH5.cjs.map} +1 -1
- package/dist/{chunk-HJDMKDAE.cjs → chunk-4GT4JLKS.cjs} +7 -7
- package/dist/{chunk-HJDMKDAE.cjs.map → chunk-4GT4JLKS.cjs.map} +1 -1
- package/dist/{chunk-KL7R2IBY.cjs → chunk-4M3OIBIS.cjs} +2 -2
- package/dist/{chunk-KL7R2IBY.cjs.map → chunk-4M3OIBIS.cjs.map} +1 -1
- package/dist/{chunk-JUOGNUQR.cjs → chunk-4RR7ZZPD.cjs} +50 -8
- package/dist/chunk-4RR7ZZPD.cjs.map +1 -0
- package/dist/{chunk-GQIH6ALC.cjs → chunk-5AQHL4E3.cjs} +742 -742
- package/dist/chunk-5AQHL4E3.cjs.map +1 -0
- package/dist/{chunk-LZZSCW7D.cjs → chunk-5HPUGSTJ.cjs} +18 -17
- package/dist/chunk-5HPUGSTJ.cjs.map +1 -0
- package/dist/{chunk-5NWTA4Y4.cjs → chunk-6AFAYGJW.cjs} +5 -5
- package/dist/{chunk-5NWTA4Y4.cjs.map → chunk-6AFAYGJW.cjs.map} +1 -1
- package/dist/{chunk-AVXJSCRN.cjs → chunk-AEAK3ZBS.cjs} +60 -8
- package/dist/chunk-AEAK3ZBS.cjs.map +1 -0
- package/dist/{chunk-IDV6I7GX.cjs → chunk-ATHPGGUH.cjs} +51 -51
- package/dist/{chunk-IDV6I7GX.cjs.map → chunk-ATHPGGUH.cjs.map} +1 -1
- package/dist/{chunk-WQ2KG4LS.cjs → chunk-BCU65RJM.cjs} +3 -3
- package/dist/{chunk-WQ2KG4LS.cjs.map → chunk-BCU65RJM.cjs.map} +1 -1
- package/dist/{chunk-KZFE65SA.cjs → chunk-C6EMTQHQ.cjs} +12 -12
- package/dist/{chunk-KZFE65SA.cjs.map → chunk-C6EMTQHQ.cjs.map} +1 -1
- package/dist/{chunk-4ZC6YLVQ.cjs → chunk-CMPCSONE.cjs} +4 -4
- package/dist/{chunk-4ZC6YLVQ.cjs.map → chunk-CMPCSONE.cjs.map} +1 -1
- package/dist/{chunk-L2Q2UHRY.cjs → chunk-CULUTYOD.cjs} +4 -4
- package/dist/{chunk-L2Q2UHRY.cjs.map → chunk-CULUTYOD.cjs.map} +1 -1
- package/dist/{chunk-K4SFQPOF.cjs → chunk-D4SJT3NG.cjs} +3 -3
- package/dist/{chunk-K4SFQPOF.cjs.map → chunk-D4SJT3NG.cjs.map} +1 -1
- package/dist/{chunk-7WENPOCP.cjs → chunk-DN6VM5M5.cjs} +6 -6
- package/dist/{chunk-7WENPOCP.cjs.map → chunk-DN6VM5M5.cjs.map} +1 -1
- package/dist/{chunk-U4YOVI5D.cjs → chunk-FDIZWCYF.cjs} +6 -6
- package/dist/{chunk-U4YOVI5D.cjs.map → chunk-FDIZWCYF.cjs.map} +1 -1
- package/dist/{chunk-UYBTXYYW.cjs → chunk-FX5TZ6JU.cjs} +16 -12
- package/dist/chunk-FX5TZ6JU.cjs.map +1 -0
- package/dist/{chunk-LFO3HNBX.cjs → chunk-GHPLRXB4.cjs} +34 -34
- package/dist/{chunk-LFO3HNBX.cjs.map → chunk-GHPLRXB4.cjs.map} +1 -1
- package/dist/{chunk-KIXB7V7A.cjs → chunk-GOKS55KC.cjs} +28 -28
- package/dist/{chunk-KIXB7V7A.cjs.map → chunk-GOKS55KC.cjs.map} +1 -1
- package/dist/{chunk-C4JRUDAY.cjs → chunk-GP4UC2K4.cjs} +12 -12
- package/dist/{chunk-C4JRUDAY.cjs.map → chunk-GP4UC2K4.cjs.map} +1 -1
- package/dist/{chunk-WKIESVWJ.cjs → chunk-HKKNHHBB.cjs} +6 -6
- package/dist/{chunk-WKIESVWJ.cjs.map → chunk-HKKNHHBB.cjs.map} +1 -1
- package/dist/{chunk-YPNGDJLX.cjs → chunk-IO3MNT4N.cjs} +4 -4
- package/dist/{chunk-YPNGDJLX.cjs.map → chunk-IO3MNT4N.cjs.map} +1 -1
- package/dist/{chunk-FQXZZXS2.cjs → chunk-JEHGTPS2.cjs} +5 -5
- package/dist/{chunk-FQXZZXS2.cjs.map → chunk-JEHGTPS2.cjs.map} +1 -1
- package/dist/{chunk-KJ65QZJI.cjs → chunk-KAKEFIDS.cjs} +13 -13
- package/dist/{chunk-KJ65QZJI.cjs.map → chunk-KAKEFIDS.cjs.map} +1 -1
- package/dist/{chunk-JXKUWLFZ.cjs → chunk-KMMKGJPX.cjs} +4 -4
- package/dist/{chunk-JXKUWLFZ.cjs.map → chunk-KMMKGJPX.cjs.map} +1 -1
- package/dist/{chunk-UYTFPMEA.cjs → chunk-LK4TQBV6.cjs} +9 -9
- package/dist/{chunk-UYTFPMEA.cjs.map → chunk-LK4TQBV6.cjs.map} +1 -1
- package/dist/{chunk-BCCMCR2U.cjs → chunk-MQS2PCCN.cjs} +67 -67
- package/dist/{chunk-BCCMCR2U.cjs.map → chunk-MQS2PCCN.cjs.map} +1 -1
- package/dist/{chunk-Q6ASMKFN.cjs → chunk-N2YOVDEN.cjs} +19 -19
- package/dist/{chunk-Q6ASMKFN.cjs.map → chunk-N2YOVDEN.cjs.map} +1 -1
- package/dist/{chunk-CZCSDIQY.cjs → chunk-NBKYVMAK.cjs} +4 -4
- package/dist/{chunk-CZCSDIQY.cjs.map → chunk-NBKYVMAK.cjs.map} +1 -1
- package/dist/{chunk-PA5CCOBU.cjs → chunk-NGM4HIPP.cjs} +140 -140
- package/dist/chunk-NGM4HIPP.cjs.map +1 -0
- package/dist/{chunk-GTWCDGXH.cjs → chunk-NPY5XQSN.cjs} +4 -4
- package/dist/{chunk-GTWCDGXH.cjs.map → chunk-NPY5XQSN.cjs.map} +1 -1
- package/dist/{chunk-7SJXYEZI.cjs → chunk-OAIOOVFN.cjs} +36 -36
- package/dist/chunk-OAIOOVFN.cjs.map +1 -0
- package/dist/{chunk-LBYJUPMV.cjs → chunk-P4KNRU7Y.cjs} +71 -71
- package/dist/{chunk-LBYJUPMV.cjs.map → chunk-P4KNRU7Y.cjs.map} +1 -1
- package/dist/{chunk-ZJ4P5QE5.cjs → chunk-PC2ZGCSX.cjs} +37 -37
- package/dist/{chunk-ZJ4P5QE5.cjs.map → chunk-PC2ZGCSX.cjs.map} +1 -1
- package/dist/{chunk-QA2MTHMN.cjs → chunk-QAPDDRE4.cjs} +80 -80
- package/dist/{chunk-QA2MTHMN.cjs.map → chunk-QAPDDRE4.cjs.map} +1 -1
- package/dist/{chunk-PBPO54KZ.cjs → chunk-QEMGGJB6.cjs} +97 -5
- package/dist/chunk-QEMGGJB6.cjs.map +1 -0
- package/dist/chunk-S3UNLRVM.cjs +87 -0
- package/dist/chunk-S3UNLRVM.cjs.map +1 -0
- package/dist/{chunk-PDDC5JOE.cjs → chunk-SGYURQ23.cjs} +10 -10
- package/dist/{chunk-PDDC5JOE.cjs.map → chunk-SGYURQ23.cjs.map} +1 -1
- package/dist/{chunk-RLRDQICM.cjs → chunk-SH7W4WVI.cjs} +103 -104
- package/dist/chunk-SH7W4WVI.cjs.map +1 -0
- package/dist/{chunk-C2VVBU7K.cjs → chunk-SLCH5JRI.cjs} +3 -3
- package/dist/{chunk-C2VVBU7K.cjs.map → chunk-SLCH5JRI.cjs.map} +1 -1
- package/dist/{chunk-RI367OOL.cjs → chunk-UEQNTXWV.cjs} +3 -3
- package/dist/{chunk-RI367OOL.cjs.map → chunk-UEQNTXWV.cjs.map} +1 -1
- package/dist/{chunk-PIWXX2M4.cjs → chunk-UOE6VC36.cjs} +11 -11
- package/dist/{chunk-PIWXX2M4.cjs.map → chunk-UOE6VC36.cjs.map} +1 -1
- package/dist/{chunk-DYIZ7W4P.cjs → chunk-VBSEYTRN.cjs} +3 -3
- package/dist/{chunk-DYIZ7W4P.cjs.map → chunk-VBSEYTRN.cjs.map} +1 -1
- package/dist/{chunk-LLVE5TST.cjs → chunk-VJRO6J37.cjs} +3 -3
- package/dist/{chunk-LLVE5TST.cjs.map → chunk-VJRO6J37.cjs.map} +1 -1
- package/dist/{chunk-I3GFGJSX.cjs → chunk-XBZP5J24.cjs} +7 -7
- package/dist/{chunk-I3GFGJSX.cjs.map → chunk-XBZP5J24.cjs.map} +1 -1
- package/dist/{chunk-JARBYN6Z.cjs → chunk-Y3OI7ZP7.cjs} +3 -3
- package/dist/{chunk-JARBYN6Z.cjs.map → chunk-Y3OI7ZP7.cjs.map} +1 -1
- package/dist/{chunk-JB26AJ2L.cjs → chunk-YFO2VHYQ.cjs} +139 -48
- package/dist/chunk-YFO2VHYQ.cjs.map +1 -0
- package/dist/{chunk-FV6AKSI7.cjs → chunk-YHXJWYOF.cjs} +4 -4
- package/dist/{chunk-FV6AKSI7.cjs.map → chunk-YHXJWYOF.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +13 -13
- package/dist/connect/docx.cjs +26 -26
- package/dist/connect/index.cjs +1461 -1532
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +51 -51
- package/dist/connection/dashboards/DashboardPanel.js +1 -1
- package/dist/connection/dashboards/DashboardPanel.js.map +2 -2
- package/dist/connection/dashboards/PanelEditor.d.ts +4 -0
- package/dist/connection/dashboards/PanelEditor.js +45 -3
- package/dist/connection/dashboards/PanelEditor.js.map +2 -2
- package/dist/connection/export/ConnectedExportPanel.js +12 -7
- package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
- package/dist/connection/export/transfer-text.d.ts +5 -0
- package/dist/connection/export/transfer-text.js +6 -1
- package/dist/connection/export/transfer-text.js.map +2 -2
- package/dist/connection/pages/PageTransferDialog.js +19 -2
- package/dist/connection/pages/PageTransferDialog.js.map +2 -2
- package/dist/dashboards/ChartRenderer.js +3 -2
- package/dist/dashboards/ChartRenderer.js.map +2 -2
- package/dist/dashboards/RechartsRenderer.js +171 -2
- package/dist/dashboards/RechartsRenderer.js.map +2 -2
- package/dist/dashboards/chartModel.d.ts +52 -2
- package/dist/dashboards/chartModel.js +95 -3
- package/dist/dashboards/chartModel.js.map +2 -2
- package/dist/dashboards/index.cjs +774 -25
- package/dist/dashboards/index.cjs.map +1 -1
- package/dist/dashboards/index.d.ts +3 -2
- package/dist/dashboards/index.js +9 -2
- package/dist/dashboards/index.js.map +2 -2
- package/dist/dashboards/monitor/LogViewer.d.ts +47 -0
- package/dist/dashboards/monitor/LogViewer.js +279 -0
- package/dist/dashboards/monitor/LogViewer.js.map +7 -0
- package/dist/dashboards/monitor/RequestTimeline.d.ts +68 -0
- package/dist/dashboards/monitor/RequestTimeline.js +228 -0
- package/dist/dashboards/monitor/RequestTimeline.js.map +7 -0
- package/dist/dashboards/monitor/StackedBar.d.ts +41 -0
- package/dist/dashboards/monitor/StackedBar.js +131 -0
- package/dist/dashboards/monitor/StackedBar.js.map +7 -0
- package/dist/dashboards/monitor/TimeSeriesChart.d.ts +60 -0
- package/dist/dashboards/monitor/TimeSeriesChart.js +116 -0
- package/dist/dashboards/monitor/TimeSeriesChart.js.map +7 -0
- package/dist/dashboards/monitor/TimeSeriesDrawing.d.ts +14 -0
- package/dist/dashboards/monitor/TimeSeriesDrawing.js +173 -0
- package/dist/dashboards/monitor/TimeSeriesDrawing.js.map +7 -0
- package/dist/dashboards/monitor/index.d.ts +10 -0
- package/dist/dashboards/monitor/index.js +44 -0
- package/dist/dashboards/monitor/index.js.map +7 -0
- package/dist/dashboards/monitor/units.d.ts +30 -0
- package/dist/dashboards/monitor/units.js +85 -0
- package/dist/dashboards/monitor/units.js.map +7 -0
- package/dist/document-tools/index.cjs +21 -21
- package/dist/embed/index.cjs +55 -55
- package/dist/facts/index.cjs +65 -65
- package/dist/files/TransferParts.d.ts +18 -1
- package/dist/files/TransferParts.js +55 -3
- package/dist/files/TransferParts.js.map +2 -2
- package/dist/files/index.cjs +235 -231
- package/dist/files/index.d.ts +1 -1
- package/dist/files/index.js +2 -0
- package/dist/files/index.js.map +2 -2
- package/dist/home/index.cjs +24 -24
- package/dist/index.cjs +1869 -1869
- package/dist/pages/index.cjs +66 -51
- package/dist/pages/index.cjs.map +1 -1
- package/dist/settings/index.cjs +141 -141
- package/dist/shell/index.cjs +81 -81
- package/dist/site/index.cjs +5 -5
- package/dist/studio/index.cjs +44 -44
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/widgets.js +1 -1
- package/dist/studio/widgets.js.map +2 -2
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +77 -77
- package/dist/workspaces/index.cjs +9 -9
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/RechartsRenderer-EPVL5QZA.cjs +0 -186
- package/dist/RechartsRenderer-EPVL5QZA.cjs.map +0 -1
- package/dist/ai-HME7CNDE.cjs.map +0 -1
- package/dist/chunk-7SJXYEZI.cjs.map +0 -1
- package/dist/chunk-AVXJSCRN.cjs.map +0 -1
- package/dist/chunk-GQIH6ALC.cjs.map +0 -1
- package/dist/chunk-JB26AJ2L.cjs.map +0 -1
- package/dist/chunk-JUOGNUQR.cjs.map +0 -1
- package/dist/chunk-LZZSCW7D.cjs.map +0 -1
- package/dist/chunk-PA5CCOBU.cjs.map +0 -1
- package/dist/chunk-PBPO54KZ.cjs.map +0 -1
- package/dist/chunk-RLRDQICM.cjs.map +0 -1
- package/dist/chunk-UYBTXYYW.cjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkOAIOOVFN_cjs = require('./chunk-OAIOOVFN.cjs');
|
|
5
|
+
var chunk3GQQUR27_cjs = require('./chunk-3GQQUR27.cjs');
|
|
6
|
+
var chunkNGM4HIPP_cjs = require('./chunk-NGM4HIPP.cjs');
|
|
7
|
+
var chunkSH7W4WVI_cjs = require('./chunk-SH7W4WVI.cjs');
|
|
5
8
|
var chunkT26UYA6Q_cjs = require('./chunk-T26UYA6Q.cjs');
|
|
6
|
-
var chunkPFGRONAI_cjs = require('./chunk-PFGRONAI.cjs');
|
|
7
|
-
var chunkPA5CCOBU_cjs = require('./chunk-PA5CCOBU.cjs');
|
|
8
|
-
var chunkRLRDQICM_cjs = require('./chunk-RLRDQICM.cjs');
|
|
9
9
|
var chunkDWN5AUMH_cjs = require('./chunk-DWN5AUMH.cjs');
|
|
10
10
|
var chunkGB5MN5FC_cjs = require('./chunk-GB5MN5FC.cjs');
|
|
11
|
+
var chunkMOIZ2R5X_cjs = require('./chunk-MOIZ2R5X.cjs');
|
|
12
|
+
var chunkZBP4ZSAJ_cjs = require('./chunk-ZBP4ZSAJ.cjs');
|
|
11
13
|
var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
|
|
12
14
|
var chunkZT5MIFLC_cjs = require('./chunk-ZT5MIFLC.cjs');
|
|
13
|
-
var chunkZBP4ZSAJ_cjs = require('./chunk-ZBP4ZSAJ.cjs');
|
|
14
15
|
var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
|
|
15
|
-
var chunkMOIZ2R5X_cjs = require('./chunk-MOIZ2R5X.cjs');
|
|
16
16
|
var react = require('@arbidocs/react');
|
|
17
17
|
var react$1 = require('react');
|
|
18
18
|
var lucideReact = require('lucide-react');
|
|
@@ -20,563 +20,207 @@ var ui = require('@arbidocs/react/ui');
|
|
|
20
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
21
21
|
var browser = require('@arbidocs/sdk/browser');
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
function StartCallButton(props) {
|
|
24
|
+
const enabled = react.useCallsEnabled();
|
|
25
|
+
const canHost = react.useCanHostCalls();
|
|
26
|
+
return enabled && (canHost || props.isLive) ? /* @__PURE__ */ jsxRuntime.jsx(EnabledStartCallButton, { ...props }) : null;
|
|
27
|
+
}
|
|
28
|
+
function EnabledStartCallButton({
|
|
29
|
+
onStart,
|
|
30
|
+
isLive = false,
|
|
31
|
+
label = "Start call",
|
|
32
|
+
testId = "start-call-button"
|
|
29
33
|
}) {
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
const [isStarting, setIsStarting] = react$1.useState(false);
|
|
35
|
+
const inCall = react.useCallSession((s) => s.active !== null);
|
|
36
|
+
const text = inCall ? "Already in a call" : isLive ? "Join call" : label;
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
ui.Button,
|
|
40
|
+
{
|
|
41
|
+
type: "button",
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
size: "icon",
|
|
44
|
+
"aria-label": isLive ? "Join call" : label,
|
|
45
|
+
"data-testid": testId,
|
|
46
|
+
"data-live": isLive || void 0,
|
|
47
|
+
disabled: isStarting || inCall,
|
|
48
|
+
onClick: () => {
|
|
49
|
+
setIsStarting(true);
|
|
50
|
+
void onStart().finally(() => setIsStarting(false));
|
|
51
|
+
},
|
|
52
|
+
className: ui.cn(
|
|
53
|
+
"text-muted-foreground hover:text-foreground",
|
|
54
|
+
isLive && "text-green-text hover:text-green-text"
|
|
55
|
+
),
|
|
56
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: ui.cn("size-5", isLive && "animate-pulse") })
|
|
57
|
+
}
|
|
58
|
+
) }),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
var INVITE_LINK_HINT = "will get an invitation to create an ARBI account and join";
|
|
63
|
+
var NO_KEY_REASON = "Cannot receive encrypted calls yet";
|
|
64
|
+
var NO_EMAIL_REASON = "No e-mail address to send a link to";
|
|
65
|
+
function contactName(contact) {
|
|
66
|
+
return contact.card?.name?.trim() || [contact.card?.given_name, contact.card?.family_name].filter(Boolean).join(" ") || (contact.user ? ui.getUserDisplayName(contact.user) : "") || contactEmail(contact) || "Contact";
|
|
67
|
+
}
|
|
68
|
+
function contactEmail(contact) {
|
|
69
|
+
return contact.email ?? contact.user?.email ?? contact.card?.emails?.[0]?.email ?? null;
|
|
70
|
+
}
|
|
71
|
+
function callContactOf(contact) {
|
|
72
|
+
if (!contact.external_id || contact.status === "failed") return null;
|
|
73
|
+
if (contact.user && ui.isAgent(contact.user)) return null;
|
|
74
|
+
return {
|
|
75
|
+
contactExtId: contact.external_id,
|
|
76
|
+
user: contact.user ?? null,
|
|
77
|
+
name: contactName(contact),
|
|
78
|
+
email: contactEmail(contact)
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function userCandidate(user, section, status, contactExtId = null) {
|
|
82
|
+
const ringable = status !== "ring" || !!user.encryption_public_key;
|
|
83
|
+
return {
|
|
84
|
+
id: user.external_id,
|
|
85
|
+
name: ui.getUserDisplayName(user) || user.email,
|
|
86
|
+
email: user.email ?? null,
|
|
87
|
+
section,
|
|
88
|
+
status: ringable ? status : "unavailable",
|
|
89
|
+
reason: ringable ? void 0 : NO_KEY_REASON,
|
|
90
|
+
user,
|
|
91
|
+
contactExtId
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function buildCallCandidates(opts) {
|
|
95
|
+
const seen = /* @__PURE__ */ new Set();
|
|
96
|
+
const out = [];
|
|
97
|
+
const add = (c) => {
|
|
98
|
+
if (seen.has(c.id)) return;
|
|
99
|
+
seen.add(c.id);
|
|
100
|
+
out.push(c);
|
|
101
|
+
};
|
|
102
|
+
const people = (users) => users.filter((u) => !ui.isAgent(u) && u.external_id !== opts.me);
|
|
103
|
+
if (opts.scope !== "contacts") {
|
|
104
|
+
for (const u of people(opts.members)) add(userCandidate(u, "members", "ring"));
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
107
|
+
const contacts = (opts.contacts ?? []).filter((c) => !(c.user && ui.isAgent(c.user)));
|
|
108
|
+
const contactOf = new Map(
|
|
109
|
+
contacts.filter((c) => c.user).map((c) => [c.user.external_id, c.contactExtId])
|
|
110
|
+
);
|
|
111
|
+
for (const u of people(opts.members)) {
|
|
112
|
+
const contactId = contactOf.get(u.external_id) ?? opts.contactIdOf?.(u) ?? null;
|
|
113
|
+
add(userCandidate(u, "members", contactId ? "ring" : "add-contact", contactId));
|
|
114
|
+
}
|
|
115
|
+
for (const c of contacts) {
|
|
116
|
+
if (c.user) {
|
|
117
|
+
if (c.user.external_id === opts.me) continue;
|
|
118
|
+
add(userCandidate(c.user, "contacts", "ring", c.contactExtId));
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const status = c.email ? "invite" : "unavailable";
|
|
122
|
+
add({
|
|
123
|
+
id: c.contactExtId,
|
|
124
|
+
name: c.name,
|
|
125
|
+
email: c.email,
|
|
126
|
+
section: "contacts",
|
|
127
|
+
status,
|
|
128
|
+
reason: c.email ? INVITE_LINK_HINT : NO_EMAIL_REASON,
|
|
129
|
+
user: null,
|
|
130
|
+
contactExtId: c.contactExtId
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
function isPickable(c) {
|
|
136
|
+
return c.status === "ring" || c.status === "invite";
|
|
137
|
+
}
|
|
138
|
+
function matchesQuery(c, query) {
|
|
139
|
+
const q = query.trim().toLowerCase();
|
|
140
|
+
if (!q) return true;
|
|
141
|
+
return c.name.toLowerCase().includes(q) || (c.email ?? "").toLowerCase().includes(q);
|
|
142
|
+
}
|
|
143
|
+
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
144
|
+
var COPY = {
|
|
145
|
+
workspace: {
|
|
146
|
+
title: "Call thread members",
|
|
147
|
+
description: "Only members of this thread\u2019s workspace can join. Pick who to ring \u2014 or nobody, and share the call from the thread.",
|
|
148
|
+
action: "Start call"
|
|
149
|
+
},
|
|
150
|
+
chat: {
|
|
151
|
+
title: "Call the group",
|
|
152
|
+
description: "The people you pick are rung.",
|
|
153
|
+
action: "Start call"
|
|
154
|
+
},
|
|
155
|
+
contacts: {
|
|
156
|
+
title: "New call",
|
|
157
|
+
description: "Your contacts with an ARBI account are rung. Others get an invitation to create an account and join.",
|
|
158
|
+
action: "Start call"
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
function CandidateRow({
|
|
162
|
+
candidate,
|
|
163
|
+
checked,
|
|
164
|
+
onToggle,
|
|
165
|
+
onAddContact,
|
|
166
|
+
adding
|
|
167
|
+
}) {
|
|
168
|
+
const pickable = isPickable(candidate);
|
|
169
|
+
const hint = candidate.status === "invite" ? candidate.reason : candidate.status === "add-contact" ? "Not in your contacts" : void 0;
|
|
170
|
+
const row = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
171
|
+
"li",
|
|
50
172
|
{
|
|
51
|
-
className:
|
|
52
|
-
|
|
53
|
-
|
|
173
|
+
className: ui.cn(
|
|
174
|
+
"flex items-center gap-3 rounded-md px-2 py-1.5",
|
|
175
|
+
pickable ? "hover:bg-muted" : "opacity-60"
|
|
176
|
+
),
|
|
177
|
+
"data-testid": `call-picker-row-${candidate.id}`,
|
|
178
|
+
"data-status": candidate.status,
|
|
179
|
+
"aria-disabled": !pickable || void 0,
|
|
54
180
|
children: [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
181
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
182
|
+
ui.Checkbox,
|
|
183
|
+
{
|
|
184
|
+
checked,
|
|
185
|
+
disabled: !pickable,
|
|
186
|
+
onCheckedChange: onToggle,
|
|
187
|
+
"aria-label": `Invite ${candidate.name}`,
|
|
188
|
+
"data-testid": `call-picker-check-${candidate.id}`
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm", children: candidate.name }),
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block truncate text-xs text-muted-foreground", children: [
|
|
194
|
+
candidate.email,
|
|
195
|
+
hint && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-1 inline-flex items-center gap-1", children: [
|
|
196
|
+
candidate.status === "invite" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3", "aria-hidden": true }),
|
|
197
|
+
candidate.email ? `\xB7 ${hint}` : hint
|
|
198
|
+
] })
|
|
199
|
+
] })
|
|
200
|
+
] }),
|
|
201
|
+
candidate.status === "add-contact" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
59
202
|
ui.Button,
|
|
60
203
|
{
|
|
61
204
|
type: "button",
|
|
62
205
|
size: "sm",
|
|
63
|
-
|
|
64
|
-
disabled:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
children: inThisCall ? "In call" : "Join"
|
|
206
|
+
variant: "outline",
|
|
207
|
+
disabled: adding,
|
|
208
|
+
onClick: onAddContact,
|
|
209
|
+
"data-testid": `call-picker-add-${candidate.id}`,
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "mr-1 size-3.5" }),
|
|
212
|
+
"Add contact"
|
|
213
|
+
]
|
|
72
214
|
}
|
|
73
215
|
)
|
|
74
216
|
]
|
|
75
217
|
}
|
|
76
218
|
);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const profile = me ? arbi.user.profile() : null;
|
|
83
|
-
return react$1.useMemo(() => {
|
|
84
|
-
if (profile)
|
|
85
|
-
return ui.getUserDisplayName({ given_name: profile.givenName, family_name: profile.familyName });
|
|
86
|
-
const user = byId(identity);
|
|
87
|
-
if (user) return ui.getUserDisplayName(user);
|
|
88
|
-
return (fallbackName || identity).trim().split(/\s+/).join(" ");
|
|
89
|
-
}, [profile, byId, identity, fallbackName]);
|
|
90
|
-
}
|
|
91
|
-
function CallConversationEmpty({ callExtId }) {
|
|
92
|
-
const { inCall, transcribing } = chunk7SJXYEZI_cjs.useMyCallStatus(callExtId);
|
|
93
|
-
const live = react.useCallSession((s) => !!s.liveCalls[callExtId]) || inCall;
|
|
94
|
-
if (!live) {
|
|
95
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
-
chunkZW6FPIFC_cjs.EmptyState,
|
|
97
|
-
{
|
|
98
|
-
icon: lucideReact.AudioLines,
|
|
99
|
-
title: "No transcript",
|
|
100
|
-
description: "This call was not transcribed. When a call here is transcribed, what people say appears in this conversation.",
|
|
101
|
-
className: "mx-auto my-8 max-w-xl",
|
|
102
|
-
testId: "call-conversation-empty"
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
-
chunkZW6FPIFC_cjs.EmptyState,
|
|
108
|
-
{
|
|
109
|
-
icon: transcribing ? lucideReact.Captions : lucideReact.CaptionsOff,
|
|
110
|
-
title: "Call in progress \u2014 the transcript will appear here",
|
|
111
|
-
description: transcribing ? "Transcription is on: what people say shows up here as they speak." : "Transcription is off. The host can turn it on with CC in the call.",
|
|
112
|
-
className: "mx-auto my-8 max-w-xl",
|
|
113
|
-
testId: "call-conversation-empty"
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
function ProvisionalRow({ identity }) {
|
|
118
|
-
const name = useCallPersonName(identity);
|
|
119
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
120
|
-
chunkZBP4ZSAJ_cjs.ProvisionalTranscriptLine,
|
|
121
|
-
{
|
|
122
|
-
speakerId: identity,
|
|
123
|
-
speakerName: name,
|
|
124
|
-
speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity })
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
function ProvisionalSpeakers({ ids }) {
|
|
129
|
-
if (!ids.length) return null;
|
|
130
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2", "data-testid": "transcript-provisional-rows", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsx(ProvisionalRow, { identity: id }, id)) });
|
|
131
|
-
}
|
|
132
|
-
var LINE_WAIT_MS = 1e4;
|
|
133
|
-
var MIN_SPEECH_MS = 800;
|
|
134
|
-
function useProvisionalSpeakers(callExtId, lines) {
|
|
135
|
-
const { inCall, transcribing } = chunk7SJXYEZI_cjs.useMyCallStatus(callExtId);
|
|
136
|
-
const speaking = chunk7SJXYEZI_cjs.useSpeakingIds();
|
|
137
|
-
const pending = react$1.useRef(/* @__PURE__ */ new Map());
|
|
138
|
-
const [, tick] = react$1.useState(0);
|
|
139
|
-
const active = inCall && transcribing;
|
|
140
|
-
const now = Date.now();
|
|
141
|
-
if (active) {
|
|
142
|
-
for (const id of speaking) {
|
|
143
|
-
const p = pending.current.get(id);
|
|
144
|
-
if (p) p.lastHeardAt = now;
|
|
145
|
-
else pending.current.set(id, { startedAt: now, lastHeardAt: now });
|
|
146
|
-
}
|
|
147
|
-
} else if (pending.current.size) {
|
|
148
|
-
pending.current.clear();
|
|
149
|
-
}
|
|
150
|
-
const latest = react$1.useMemo(() => {
|
|
151
|
-
const m = /* @__PURE__ */ new Map();
|
|
152
|
-
for (const l of lines) m.set(l.speakerId, Math.max(m.get(l.speakerId) ?? 0, l.at));
|
|
153
|
-
return m;
|
|
154
|
-
}, [lines]);
|
|
155
|
-
for (const [id, p] of [...pending.current]) {
|
|
156
|
-
const arrived = (latest.get(id) ?? 0) >= p.startedAt - 3e3;
|
|
157
|
-
const stale = !speaking.includes(id) && now - p.lastHeardAt > LINE_WAIT_MS;
|
|
158
|
-
if (arrived && !speaking.includes(id) || stale) pending.current.delete(id);
|
|
159
|
-
else if (arrived) p.startedAt = now;
|
|
160
|
-
}
|
|
161
|
-
const waiting = pending.current.size > 0;
|
|
162
|
-
react$1.useEffect(() => {
|
|
163
|
-
if (!waiting) return;
|
|
164
|
-
const id = setInterval(() => tick((n) => n + 1), 1e3);
|
|
165
|
-
return () => clearInterval(id);
|
|
166
|
-
}, [waiting]);
|
|
167
|
-
return [...pending.current].filter(([, p]) => p.lastHeardAt - p.startedAt >= MIN_SPEECH_MS).map(([id]) => id);
|
|
168
|
-
}
|
|
169
|
-
var { isTranscriptMessage, parseTranscriptContent } = browser.chats;
|
|
170
|
-
function ConnectedCallChatHistory({
|
|
171
|
-
chat,
|
|
172
|
-
messages,
|
|
173
|
-
items,
|
|
174
|
-
renderItem,
|
|
175
|
-
renderEntriesBefore,
|
|
176
|
-
entriesAfter,
|
|
177
|
-
loadOlder,
|
|
178
|
-
memberById,
|
|
179
|
-
senderName,
|
|
180
|
-
myExtId,
|
|
181
|
-
formatTime,
|
|
182
|
-
formatDay
|
|
183
|
-
}) {
|
|
184
|
-
const arbi = react.useArbi();
|
|
185
|
-
const [view, setView] = react$1.useState("all");
|
|
186
|
-
react$1.useEffect(() => setView("all"), [chat?.external_id]);
|
|
187
|
-
const recordingsCallExtId = chat?.call_ext_id ?? null;
|
|
188
|
-
const pendingRecording = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
189
|
-
react$1.useEffect(() => {
|
|
190
|
-
if (pendingRecording && recordingsCallExtId) setView("recordings");
|
|
191
|
-
}, [pendingRecording, recordingsCallExtId]);
|
|
192
|
-
const latestCallCards = react$1.useMemo(() => {
|
|
193
|
-
const latest = /* @__PURE__ */ new Map();
|
|
194
|
-
for (const m of messages)
|
|
195
|
-
if (m.kind === "call" && m.call_ext_id && !m.deleted) latest.set(m.call_ext_id, m.external_id);
|
|
196
|
-
return new Set(latest.values());
|
|
197
|
-
}, [messages]);
|
|
198
|
-
const hasRecTranscript = react$1.useMemo(
|
|
199
|
-
() => react.hasRecordingTranscript(messages, react.chatTranscriptRef),
|
|
200
|
-
[messages]
|
|
201
|
-
);
|
|
202
|
-
const recordingWindows = react.useRecordingWindows(recordingsCallExtId, hasRecTranscript);
|
|
203
|
-
const supersededTranscript = react$1.useMemo(
|
|
204
|
-
() => react.supersededTranscriptLines(messages, react.chatTranscriptRef, recordingWindows),
|
|
205
|
-
[messages, recordingWindows]
|
|
206
|
-
);
|
|
207
|
-
const transcriptMessages = react$1.useMemo(
|
|
208
|
-
() => react.sortTranscriptMessages(
|
|
209
|
-
messages.filter((m) => isTranscriptMessage(m) && !m.deleted && !supersededTranscript.has(m))
|
|
210
|
-
),
|
|
211
|
-
[messages, supersededTranscript]
|
|
212
|
-
);
|
|
213
|
-
const hasTranscript = transcriptMessages.length > 0;
|
|
214
|
-
const { data: meetingCall } = react.useCall(hasTranscript ? chat?.call_ext_id : null);
|
|
215
|
-
const isHost = !!meetingCall?.is_creator;
|
|
216
|
-
const [meetingTitle, setMeetingTitle] = react$1.useState(null);
|
|
217
|
-
react$1.useEffect(() => {
|
|
218
|
-
if (!chat || !isHost && !recordingsCallExtId) return;
|
|
219
|
-
let cancelled = false;
|
|
220
|
-
arbi.chats.title(chat).then((t) => !cancelled && setMeetingTitle(t)).catch(() => void 0);
|
|
221
|
-
return () => {
|
|
222
|
-
cancelled = true;
|
|
223
|
-
};
|
|
224
|
-
}, [arbi, isHost, chat, recordingsCallExtId]);
|
|
225
|
-
const transcriptSpeaker = (msg) => {
|
|
226
|
-
const parsed = msg.decryptFailed ? null : parseTranscriptContent(msg.content);
|
|
227
|
-
return { parsed, speakerId: parsed?.speaker_identity || msg.sender_ext_id || "" };
|
|
228
|
-
};
|
|
229
|
-
const transcriptExport = react$1.useMemo(
|
|
230
|
-
() => transcriptMessages.filter((m) => !m.decryptFailed).map((m) => {
|
|
231
|
-
const parsed = parseTranscriptContent(m.content);
|
|
232
|
-
const speakerId = parsed?.speaker_identity || m.sender_ext_id || "";
|
|
233
|
-
return {
|
|
234
|
-
speaker: parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : "") || "Former member",
|
|
235
|
-
at: parsed?.started_at ?? m.created_at,
|
|
236
|
-
text: parsed?.text ?? m.content ?? ""
|
|
237
|
-
};
|
|
238
|
-
}),
|
|
239
|
-
[transcriptMessages, memberById, senderName]
|
|
240
|
-
);
|
|
241
|
-
const transcriptLayout = react$1.useMemo(() => {
|
|
242
|
-
const shown = view === "transcript" ? transcriptMessages : messages;
|
|
243
|
-
const continued = chunkZBP4ZSAJ_cjs.transcriptRuns(
|
|
244
|
-
shown,
|
|
245
|
-
(m) => isTranscriptMessage(m) && !supersededTranscript.has(m) ? transcriptSpeaker(m).speakerId : null,
|
|
246
|
-
(m) => Date.parse(transcriptSpeaker(m).parsed?.started_at ?? m.created_at ?? "") || 0
|
|
247
|
-
);
|
|
248
|
-
return { continued };
|
|
249
|
-
}, [view, messages, transcriptMessages, supersededTranscript]);
|
|
250
|
-
const transcriptEntry = (msg) => {
|
|
251
|
-
const { parsed, speakerId } = transcriptSpeaker(msg);
|
|
252
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
253
|
-
chunkPFGRONAI_cjs.TranscriptEntry,
|
|
254
|
-
{
|
|
255
|
-
speakerId,
|
|
256
|
-
speakerName: speakerId === myExtId ? "Me" : parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : senderName(msg.sender_ext_id)),
|
|
257
|
-
text: parsed?.text ?? msg.content ?? "",
|
|
258
|
-
at: parsed?.started_at ?? msg.created_at,
|
|
259
|
-
continued: transcriptLayout.continued.has(msg)
|
|
260
|
-
},
|
|
261
|
-
msg.external_id
|
|
262
|
-
);
|
|
263
|
-
};
|
|
264
|
-
const chatLines = react$1.useMemo(
|
|
265
|
-
() => transcriptMessages.map((m) => {
|
|
266
|
-
const { parsed, speakerId } = transcriptSpeaker(m);
|
|
267
|
-
return { speakerId, at: Date.parse(parsed?.started_at ?? m.created_at ?? "") || 0 };
|
|
268
|
-
}),
|
|
269
|
-
[transcriptMessages]
|
|
270
|
-
);
|
|
271
|
-
const provisionalSpeakers = useProvisionalSpeakers(recordingsCallExtId, chatLines);
|
|
272
|
-
const chatItem = (item, i) => {
|
|
273
|
-
const { message: msg, isFirstOfDay } = item;
|
|
274
|
-
const deleted = !!msg.deleted;
|
|
275
|
-
if (deleted && isTranscriptMessage(msg)) return null;
|
|
276
|
-
const separator = isFirstOfDay && /* @__PURE__ */ jsxRuntime.jsx(react.DateSeparator, { children: formatDay(msg.created_at) });
|
|
277
|
-
if (isTranscriptMessage(msg)) {
|
|
278
|
-
if (view === "chat") return null;
|
|
279
|
-
const superseded = supersededTranscript.has(msg);
|
|
280
|
-
if (superseded && !isFirstOfDay) return null;
|
|
281
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
282
|
-
separator,
|
|
283
|
-
!superseded && transcriptEntry(msg)
|
|
284
|
-
] }, msg.external_id);
|
|
285
|
-
}
|
|
286
|
-
if (msg.kind === "recording" && msg.call_ext_id && !deleted) {
|
|
287
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
288
|
-
separator,
|
|
289
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
290
|
-
chunkPA5CCOBU_cjs.RecordingCard,
|
|
291
|
-
{
|
|
292
|
-
callExtId: msg.call_ext_id,
|
|
293
|
-
recordingExtId: msg.recording_ext_id ?? null,
|
|
294
|
-
title: meetingTitle,
|
|
295
|
-
time: formatTime(msg.created_at)
|
|
296
|
-
}
|
|
297
|
-
)
|
|
298
|
-
] }, msg.external_id);
|
|
299
|
-
}
|
|
300
|
-
if (msg.kind === "call" && msg.call_ext_id && !deleted) {
|
|
301
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
302
|
-
separator,
|
|
303
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
-
ChatCallCard,
|
|
305
|
-
{
|
|
306
|
-
callExtId: msg.call_ext_id,
|
|
307
|
-
senderName: msg.sender_ext_id ? senderName(msg.sender_ext_id) : null,
|
|
308
|
-
latest: latestCallCards.has(msg.external_id),
|
|
309
|
-
name: senderName,
|
|
310
|
-
time: formatTime(msg.created_at)
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
] }, msg.external_id);
|
|
314
|
-
}
|
|
315
|
-
return renderItem(item, i);
|
|
316
|
-
};
|
|
317
|
-
const filterOptions = [
|
|
318
|
-
{ value: "all", label: "All" },
|
|
319
|
-
{ value: "chat", label: "Chat", testId: "chat-filter" },
|
|
320
|
-
{
|
|
321
|
-
value: "transcript",
|
|
322
|
-
label: "Transcript",
|
|
323
|
-
count: transcriptMessages.length,
|
|
324
|
-
testId: "transcript-filter"
|
|
325
|
-
},
|
|
326
|
-
...recordingsCallExtId ? [{ value: "recordings", label: "Recordings", testId: "recordings-filter" }] : []
|
|
327
|
-
];
|
|
328
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
329
|
-
messages.length === 0 && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(CallConversationEmpty, { callExtId: recordingsCallExtId }),
|
|
330
|
-
(hasTranscript || recordingsCallExtId) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 flex justify-center py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
331
|
-
chunkZBP4ZSAJ_cjs.ConversationFilter,
|
|
332
|
-
{
|
|
333
|
-
value: view,
|
|
334
|
-
options: filterOptions,
|
|
335
|
-
onChange: setView
|
|
336
|
-
}
|
|
337
|
-
) }),
|
|
338
|
-
view === "recordings" && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkPA5CCOBU_cjs.RecordingsList, { callExtId: recordingsCallExtId, title: meetingTitle, className: "py-1" }),
|
|
339
|
-
loadOlder,
|
|
340
|
-
view === "transcript" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col py-1", "data-testid": "transcript-view", children: [
|
|
341
|
-
isHost && /* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
-
chunkPA5CCOBU_cjs.SaveTranscriptToThread,
|
|
343
|
-
{
|
|
344
|
-
title: meetingTitle,
|
|
345
|
-
lines: transcriptExport,
|
|
346
|
-
className: "mx-3 mb-2 self-start"
|
|
347
|
-
}
|
|
348
|
-
),
|
|
349
|
-
transcriptMessages.map((msg) => transcriptEntry(msg)),
|
|
350
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
351
|
-
] }),
|
|
352
|
-
(view === "all" || view === "chat") && items.map((item, i) => (
|
|
353
|
-
// A shared file's card sits among the messages, by time.
|
|
354
|
-
/* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
355
|
-
renderEntriesBefore(i),
|
|
356
|
-
chatItem(item, i)
|
|
357
|
-
] }, item.message.external_id)
|
|
358
|
-
)),
|
|
359
|
-
(view === "all" || view === "chat") && entriesAfter,
|
|
360
|
-
view === "all" && /* @__PURE__ */ jsxRuntime.jsx(ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
361
|
-
] });
|
|
362
|
-
}
|
|
363
|
-
function StartCallButton(props) {
|
|
364
|
-
const enabled = react.useCallsEnabled();
|
|
365
|
-
const canHost = react.useCanHostCalls();
|
|
366
|
-
return enabled && (canHost || props.isLive) ? /* @__PURE__ */ jsxRuntime.jsx(EnabledStartCallButton, { ...props }) : null;
|
|
367
|
-
}
|
|
368
|
-
function EnabledStartCallButton({
|
|
369
|
-
onStart,
|
|
370
|
-
isLive = false,
|
|
371
|
-
label = "Start call",
|
|
372
|
-
testId = "start-call-button"
|
|
373
|
-
}) {
|
|
374
|
-
const [isStarting, setIsStarting] = react$1.useState(false);
|
|
375
|
-
const inCall = react.useCallSession((s) => s.active !== null);
|
|
376
|
-
const text = inCall ? "Already in a call" : isLive ? "Join call" : label;
|
|
377
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
378
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
379
|
-
ui.Button,
|
|
380
|
-
{
|
|
381
|
-
type: "button",
|
|
382
|
-
variant: "ghost",
|
|
383
|
-
size: "icon",
|
|
384
|
-
"aria-label": isLive ? "Join call" : label,
|
|
385
|
-
"data-testid": testId,
|
|
386
|
-
"data-live": isLive || void 0,
|
|
387
|
-
disabled: isStarting || inCall,
|
|
388
|
-
onClick: () => {
|
|
389
|
-
setIsStarting(true);
|
|
390
|
-
void onStart().finally(() => setIsStarting(false));
|
|
391
|
-
},
|
|
392
|
-
className: ui.cn(
|
|
393
|
-
"text-muted-foreground hover:text-foreground",
|
|
394
|
-
isLive && "text-green-text hover:text-green-text"
|
|
395
|
-
),
|
|
396
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: ui.cn("size-5", isLive && "animate-pulse") })
|
|
397
|
-
}
|
|
398
|
-
) }),
|
|
399
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
400
|
-
] });
|
|
401
|
-
}
|
|
402
|
-
function DmCallButton({ peer }) {
|
|
403
|
-
const arbi = react.useArbi();
|
|
404
|
-
const name = react.userDisplayName(peer);
|
|
405
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
406
|
-
StartCallButton,
|
|
407
|
-
{
|
|
408
|
-
onStart: () => react.startDmCall(arbi, {
|
|
409
|
-
external_id: peer.external_id,
|
|
410
|
-
encryption_public_key: peer.encryption_public_key ?? null,
|
|
411
|
-
name
|
|
412
|
-
}),
|
|
413
|
-
label: `Call ${name}`,
|
|
414
|
-
testId: "dm-call-button"
|
|
415
|
-
}
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
var INVITE_LINK_HINT = "will get an invitation to create an ARBI account and join";
|
|
419
|
-
var NO_KEY_REASON = "Cannot receive encrypted calls yet";
|
|
420
|
-
var NO_EMAIL_REASON = "No e-mail address to send a link to";
|
|
421
|
-
function contactName(contact) {
|
|
422
|
-
return contact.card?.name?.trim() || [contact.card?.given_name, contact.card?.family_name].filter(Boolean).join(" ") || (contact.user ? ui.getUserDisplayName(contact.user) : "") || contactEmail(contact) || "Contact";
|
|
423
|
-
}
|
|
424
|
-
function contactEmail(contact) {
|
|
425
|
-
return contact.email ?? contact.user?.email ?? contact.card?.emails?.[0]?.email ?? null;
|
|
426
|
-
}
|
|
427
|
-
function callContactOf(contact) {
|
|
428
|
-
if (!contact.external_id || contact.status === "failed") return null;
|
|
429
|
-
if (contact.user && ui.isAgent(contact.user)) return null;
|
|
430
|
-
return {
|
|
431
|
-
contactExtId: contact.external_id,
|
|
432
|
-
user: contact.user ?? null,
|
|
433
|
-
name: contactName(contact),
|
|
434
|
-
email: contactEmail(contact)
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function userCandidate(user, section, status, contactExtId = null) {
|
|
438
|
-
const ringable = status !== "ring" || !!user.encryption_public_key;
|
|
439
|
-
return {
|
|
440
|
-
id: user.external_id,
|
|
441
|
-
name: ui.getUserDisplayName(user) || user.email,
|
|
442
|
-
email: user.email ?? null,
|
|
443
|
-
section,
|
|
444
|
-
status: ringable ? status : "unavailable",
|
|
445
|
-
reason: ringable ? void 0 : NO_KEY_REASON,
|
|
446
|
-
user,
|
|
447
|
-
contactExtId
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
function buildCallCandidates(opts) {
|
|
451
|
-
const seen = /* @__PURE__ */ new Set();
|
|
452
|
-
const out = [];
|
|
453
|
-
const add = (c) => {
|
|
454
|
-
if (seen.has(c.id)) return;
|
|
455
|
-
seen.add(c.id);
|
|
456
|
-
out.push(c);
|
|
457
|
-
};
|
|
458
|
-
const people = (users) => users.filter((u) => !ui.isAgent(u) && u.external_id !== opts.me);
|
|
459
|
-
if (opts.scope !== "contacts") {
|
|
460
|
-
for (const u of people(opts.members)) add(userCandidate(u, "members", "ring"));
|
|
461
|
-
return out;
|
|
462
|
-
}
|
|
463
|
-
const contacts = (opts.contacts ?? []).filter((c) => !(c.user && ui.isAgent(c.user)));
|
|
464
|
-
const contactOf = new Map(
|
|
465
|
-
contacts.filter((c) => c.user).map((c) => [c.user.external_id, c.contactExtId])
|
|
466
|
-
);
|
|
467
|
-
for (const u of people(opts.members)) {
|
|
468
|
-
const contactId = contactOf.get(u.external_id) ?? opts.contactIdOf?.(u) ?? null;
|
|
469
|
-
add(userCandidate(u, "members", contactId ? "ring" : "add-contact", contactId));
|
|
470
|
-
}
|
|
471
|
-
for (const c of contacts) {
|
|
472
|
-
if (c.user) {
|
|
473
|
-
if (c.user.external_id === opts.me) continue;
|
|
474
|
-
add(userCandidate(c.user, "contacts", "ring", c.contactExtId));
|
|
475
|
-
continue;
|
|
476
|
-
}
|
|
477
|
-
const status = c.email ? "invite" : "unavailable";
|
|
478
|
-
add({
|
|
479
|
-
id: c.contactExtId,
|
|
480
|
-
name: c.name,
|
|
481
|
-
email: c.email,
|
|
482
|
-
section: "contacts",
|
|
483
|
-
status,
|
|
484
|
-
reason: c.email ? INVITE_LINK_HINT : NO_EMAIL_REASON,
|
|
485
|
-
user: null,
|
|
486
|
-
contactExtId: c.contactExtId
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
return out;
|
|
490
|
-
}
|
|
491
|
-
function isPickable(c) {
|
|
492
|
-
return c.status === "ring" || c.status === "invite";
|
|
493
|
-
}
|
|
494
|
-
function matchesQuery(c, query) {
|
|
495
|
-
const q = query.trim().toLowerCase();
|
|
496
|
-
if (!q) return true;
|
|
497
|
-
return c.name.toLowerCase().includes(q) || (c.email ?? "").toLowerCase().includes(q);
|
|
498
|
-
}
|
|
499
|
-
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
500
|
-
var COPY = {
|
|
501
|
-
workspace: {
|
|
502
|
-
title: "Call thread members",
|
|
503
|
-
description: "Only members of this thread\u2019s workspace can join. Pick who to ring \u2014 or nobody, and share the call from the thread.",
|
|
504
|
-
action: "Start call"
|
|
505
|
-
},
|
|
506
|
-
chat: {
|
|
507
|
-
title: "Call the group",
|
|
508
|
-
description: "The people you pick are rung.",
|
|
509
|
-
action: "Start call"
|
|
510
|
-
},
|
|
511
|
-
contacts: {
|
|
512
|
-
title: "New call",
|
|
513
|
-
description: "Your contacts with an ARBI account are rung. Others get an invitation to create an account and join.",
|
|
514
|
-
action: "Start call"
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
function CandidateRow({
|
|
518
|
-
candidate,
|
|
519
|
-
checked,
|
|
520
|
-
onToggle,
|
|
521
|
-
onAddContact,
|
|
522
|
-
adding
|
|
523
|
-
}) {
|
|
524
|
-
const pickable = isPickable(candidate);
|
|
525
|
-
const hint = candidate.status === "invite" ? candidate.reason : candidate.status === "add-contact" ? "Not in your contacts" : void 0;
|
|
526
|
-
const row = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
527
|
-
"li",
|
|
528
|
-
{
|
|
529
|
-
className: ui.cn(
|
|
530
|
-
"flex items-center gap-3 rounded-md px-2 py-1.5",
|
|
531
|
-
pickable ? "hover:bg-muted" : "opacity-60"
|
|
532
|
-
),
|
|
533
|
-
"data-testid": `call-picker-row-${candidate.id}`,
|
|
534
|
-
"data-status": candidate.status,
|
|
535
|
-
"aria-disabled": !pickable || void 0,
|
|
536
|
-
children: [
|
|
537
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
538
|
-
ui.Checkbox,
|
|
539
|
-
{
|
|
540
|
-
checked,
|
|
541
|
-
disabled: !pickable,
|
|
542
|
-
onCheckedChange: onToggle,
|
|
543
|
-
"aria-label": `Invite ${candidate.name}`,
|
|
544
|
-
"data-testid": `call-picker-check-${candidate.id}`
|
|
545
|
-
}
|
|
546
|
-
),
|
|
547
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
548
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm", children: candidate.name }),
|
|
549
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block truncate text-xs text-muted-foreground", children: [
|
|
550
|
-
candidate.email,
|
|
551
|
-
hint && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-1 inline-flex items-center gap-1", children: [
|
|
552
|
-
candidate.status === "invite" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3", "aria-hidden": true }),
|
|
553
|
-
candidate.email ? `\xB7 ${hint}` : hint
|
|
554
|
-
] })
|
|
555
|
-
] })
|
|
556
|
-
] }),
|
|
557
|
-
candidate.status === "add-contact" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
558
|
-
ui.Button,
|
|
559
|
-
{
|
|
560
|
-
type: "button",
|
|
561
|
-
size: "sm",
|
|
562
|
-
variant: "outline",
|
|
563
|
-
disabled: adding,
|
|
564
|
-
onClick: onAddContact,
|
|
565
|
-
"data-testid": `call-picker-add-${candidate.id}`,
|
|
566
|
-
children: [
|
|
567
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "mr-1 size-3.5" }),
|
|
568
|
-
"Add contact"
|
|
569
|
-
]
|
|
570
|
-
}
|
|
571
|
-
)
|
|
572
|
-
]
|
|
573
|
-
}
|
|
574
|
-
);
|
|
575
|
-
if (candidate.status !== "unavailable" || !candidate.reason) return row;
|
|
576
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
577
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: row }),
|
|
578
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: candidate.reason }) })
|
|
579
|
-
] });
|
|
219
|
+
if (candidate.status !== "unavailable" || !candidate.reason) return row;
|
|
220
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
221
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: row }),
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: candidate.reason }) })
|
|
223
|
+
] });
|
|
580
224
|
}
|
|
581
225
|
function InviteLinks({ callExtId }) {
|
|
582
226
|
const { notify } = chunk46LX6EQT_cjs.useBlocksEnvironment();
|
|
@@ -839,6 +483,48 @@ function CallPeoplePicker({
|
|
|
839
483
|
] })
|
|
840
484
|
] }) });
|
|
841
485
|
}
|
|
486
|
+
function ThreadCallButton({
|
|
487
|
+
conversationId
|
|
488
|
+
}) {
|
|
489
|
+
const arbi = react.useArbi();
|
|
490
|
+
const { data: conversations } = chunkDWN5AUMH_cjs.useConnectedConversations();
|
|
491
|
+
const { workspaceId: workspaceExtId } = chunkGB5MN5FC_cjs.useConnectedWorkspace();
|
|
492
|
+
const liveCallId = react.useCallSession((s) => react.threadLiveCallId(s, conversationId));
|
|
493
|
+
const isLive = liveCallId !== null;
|
|
494
|
+
const canHost = react.useCanHostCalls();
|
|
495
|
+
const [picking, setPicking] = react$1.useState(false);
|
|
496
|
+
const conversation = conversations.find((c) => c.external_id === conversationId);
|
|
497
|
+
if (!conversation?.is_shared) return null;
|
|
498
|
+
const title = conversation.title ?? null;
|
|
499
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
500
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
501
|
+
StartCallButton,
|
|
502
|
+
{
|
|
503
|
+
onStart: async () => {
|
|
504
|
+
if (liveCallId && !canHost) return react.openCall(arbi, { callExtId: liveCallId });
|
|
505
|
+
if (isLive) return react.startThreadCall(arbi, { threadExtId: conversationId, title, ring: [] });
|
|
506
|
+
setPicking(true);
|
|
507
|
+
return true;
|
|
508
|
+
},
|
|
509
|
+
isLive,
|
|
510
|
+
label: "Call thread members",
|
|
511
|
+
testId: "thread-call-button"
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
515
|
+
CallPeoplePicker,
|
|
516
|
+
{
|
|
517
|
+
open: true,
|
|
518
|
+
onOpenChange: setPicking,
|
|
519
|
+
scope: "workspace",
|
|
520
|
+
workspaceExtId,
|
|
521
|
+
onSubmit: async ({ ring }) => {
|
|
522
|
+
await react.startThreadCall(arbi, { threadExtId: conversationId, title, ring });
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
)
|
|
526
|
+
] });
|
|
527
|
+
}
|
|
842
528
|
function GroupCallButton({
|
|
843
529
|
chatExtId,
|
|
844
530
|
title,
|
|
@@ -852,222 +538,536 @@ function GroupCallButton({
|
|
|
852
538
|
const [picking, setPicking] = react$1.useState(false);
|
|
853
539
|
const others = members.filter((u) => u.external_id !== me && !ui.isAgent(u));
|
|
854
540
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
855
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
856
|
-
StartCallButton,
|
|
541
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
542
|
+
StartCallButton,
|
|
543
|
+
{
|
|
544
|
+
onStart: async () => {
|
|
545
|
+
if (liveCallId && !canHost) return react.openCall(arbi, { callExtId: liveCallId });
|
|
546
|
+
if (isLive) return react.startChatCall(arbi, { chatExtId, title, ring: [] });
|
|
547
|
+
setPicking(true);
|
|
548
|
+
return true;
|
|
549
|
+
},
|
|
550
|
+
isLive,
|
|
551
|
+
label: "Call the group",
|
|
552
|
+
testId: "group-call-button"
|
|
553
|
+
}
|
|
554
|
+
),
|
|
555
|
+
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
556
|
+
CallPeoplePicker,
|
|
557
|
+
{
|
|
558
|
+
open: true,
|
|
559
|
+
onOpenChange: setPicking,
|
|
560
|
+
scope: "chat",
|
|
561
|
+
members: others,
|
|
562
|
+
preselected: others.map((u) => u.external_id),
|
|
563
|
+
onSubmit: async ({ ring }) => {
|
|
564
|
+
await react.startChatCall(arbi, { chatExtId, title, ring });
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
)
|
|
568
|
+
] });
|
|
569
|
+
}
|
|
570
|
+
function DmCallButton({ peer }) {
|
|
571
|
+
const arbi = react.useArbi();
|
|
572
|
+
const name = react.userDisplayName(peer);
|
|
573
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
574
|
+
StartCallButton,
|
|
575
|
+
{
|
|
576
|
+
onStart: () => react.startDmCall(arbi, {
|
|
577
|
+
external_id: peer.external_id,
|
|
578
|
+
encryption_public_key: peer.encryption_public_key ?? null,
|
|
579
|
+
name
|
|
580
|
+
}),
|
|
581
|
+
label: `Call ${name}`,
|
|
582
|
+
testId: "dm-call-button"
|
|
583
|
+
}
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
function NewCallChip() {
|
|
587
|
+
return react.useCanHostCalls() ? /* @__PURE__ */ jsxRuntime.jsx(EnabledNewCallChip, {}) : null;
|
|
588
|
+
}
|
|
589
|
+
function EnabledNewCallChip() {
|
|
590
|
+
const arbi = react.useArbi();
|
|
591
|
+
const inCall = react.useCallSession((s) => s.active !== null);
|
|
592
|
+
const [open, setOpen] = react$1.useState(false);
|
|
593
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
594
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
595
|
+
chunkMOIZ2R5X_cjs.DmInviteChip,
|
|
596
|
+
{
|
|
597
|
+
testId: "dm-new-call-chip",
|
|
598
|
+
title: "New call",
|
|
599
|
+
description: inCall ? "You are already in a call" : "Call people from your contacts",
|
|
600
|
+
onClick: () => !inCall && setOpen(true)
|
|
601
|
+
}
|
|
602
|
+
),
|
|
603
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
604
|
+
CallPeoplePicker,
|
|
605
|
+
{
|
|
606
|
+
open: true,
|
|
607
|
+
onOpenChange: setOpen,
|
|
608
|
+
scope: "contacts",
|
|
609
|
+
onSubmit: async ({ ring, invites }) => {
|
|
610
|
+
await react.startContactsCall(arbi, {
|
|
611
|
+
title: chunkSH7W4WVI_cjs.contactsCallTitle([
|
|
612
|
+
...ring.map((u) => ui.getUserDisplayName(u)),
|
|
613
|
+
...invites.map((g) => g.name)
|
|
614
|
+
]),
|
|
615
|
+
ring,
|
|
616
|
+
invites
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
)
|
|
621
|
+
] });
|
|
622
|
+
}
|
|
623
|
+
function useMeetingThreadMessages(meetingCallExtId, messageHistory) {
|
|
624
|
+
const hasRecTranscript = react$1.useMemo(
|
|
625
|
+
() => !!meetingCallExtId && react.hasRecordingTranscript(messageHistory, react.threadTranscriptRef),
|
|
626
|
+
[meetingCallExtId, messageHistory]
|
|
627
|
+
);
|
|
628
|
+
const recordingWindows = react.useRecordingWindows(meetingCallExtId, hasRecTranscript);
|
|
629
|
+
return react$1.useMemo(
|
|
630
|
+
() => hasRecTranscript ? react.supersedeLiveTranscript(messageHistory, react.threadTranscriptRef, recordingWindows) : messageHistory,
|
|
631
|
+
[hasRecTranscript, messageHistory, recordingWindows]
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
function MeetingThreadTranscriptAction({
|
|
635
|
+
conversationExtId,
|
|
636
|
+
meetingCallExtId,
|
|
637
|
+
title,
|
|
638
|
+
messages
|
|
639
|
+
}) {
|
|
640
|
+
const { data: call } = react.useCall(meetingCallExtId);
|
|
641
|
+
const { data: workspaceUsers = [] } = react.useWorkspaceUsers();
|
|
642
|
+
const lines = react$1.useMemo(
|
|
643
|
+
() => react.threadTranscriptLines(messages, (id) => {
|
|
644
|
+
const user = workspaceUsers.find((wu) => wu.user.external_id === id)?.user;
|
|
645
|
+
return user ? ui.getUserDisplayName(user) : null;
|
|
646
|
+
}),
|
|
647
|
+
[messages, workspaceUsers]
|
|
648
|
+
);
|
|
649
|
+
if (!meetingCallExtId || !call?.is_creator) return null;
|
|
650
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
651
|
+
chunkNGM4HIPP_cjs.SaveTranscriptToThread,
|
|
652
|
+
{
|
|
653
|
+
title,
|
|
654
|
+
lines,
|
|
655
|
+
excludeConversationExtId: conversationExtId,
|
|
656
|
+
iconOnly: true
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
function MeetingThreadRecordingsAction({
|
|
661
|
+
meetingCallExtId,
|
|
662
|
+
title
|
|
663
|
+
}) {
|
|
664
|
+
const [open, setOpen] = react$1.useState(false);
|
|
665
|
+
const pending = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
666
|
+
react$1.useEffect(() => {
|
|
667
|
+
if (pending) setOpen(true);
|
|
668
|
+
}, [pending]);
|
|
669
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
670
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
671
|
+
chunkSH7W4WVI_cjs.HeaderAction,
|
|
672
|
+
{
|
|
673
|
+
label: "Recordings",
|
|
674
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Disc, { className: "size-3.5", "aria-hidden": true }),
|
|
675
|
+
iconOnly: true,
|
|
676
|
+
onClick: () => setOpen(true),
|
|
677
|
+
testId: "meeting-recordings"
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: true, onOpenChange: (o) => !o && setOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "sm:max-w-2xl", "data-testid": "meeting-recordings-dialog", children: [
|
|
681
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
|
|
682
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Recordings" }),
|
|
683
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "Recordings of this meeting, encrypted under the workspace key. Playing or downloading one decrypts it in this browser." })
|
|
684
|
+
] }),
|
|
685
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
686
|
+
chunkNGM4HIPP_cjs.RecordingsList,
|
|
687
|
+
{
|
|
688
|
+
callExtId: meetingCallExtId,
|
|
689
|
+
title,
|
|
690
|
+
className: "max-h-[60vh] overflow-y-auto"
|
|
691
|
+
}
|
|
692
|
+
)
|
|
693
|
+
] }) })
|
|
694
|
+
] });
|
|
695
|
+
}
|
|
696
|
+
function ConnectedConversationCallActions() {
|
|
697
|
+
const conversationId = react.useArbiSessionState((state) => state.conversationId);
|
|
698
|
+
const { conversations } = react.useConversationItems();
|
|
699
|
+
const conversation = conversationId ? conversations.find((c) => c.external_id === conversationId) : void 0;
|
|
700
|
+
const meetingCallExtId = conversation?.meeting_call_ext_id ?? null;
|
|
701
|
+
const { messageHistory } = react.useConversationData();
|
|
702
|
+
const threadMessages = useMeetingThreadMessages(meetingCallExtId, messageHistory);
|
|
703
|
+
const meetingMessages = react$1.useMemo(
|
|
704
|
+
() => meetingCallExtId ? threadMessages.map((m) => ({
|
|
705
|
+
content: m.content,
|
|
706
|
+
created_at: m.created_at,
|
|
707
|
+
tools: m.tools ?? m.meta?.tools
|
|
708
|
+
})) : [],
|
|
709
|
+
[meetingCallExtId, threadMessages]
|
|
710
|
+
);
|
|
711
|
+
if (!conversationId) return null;
|
|
712
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx(ThreadCallButton, { conversationId }),
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkT26UYA6Q_cjs.ScheduleCallButton, { conversationId }),
|
|
715
|
+
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
716
|
+
MeetingThreadTranscriptAction,
|
|
857
717
|
{
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
return true;
|
|
863
|
-
},
|
|
864
|
-
isLive,
|
|
865
|
-
label: "Call the group",
|
|
866
|
-
testId: "group-call-button"
|
|
718
|
+
conversationExtId: conversationId,
|
|
719
|
+
meetingCallExtId,
|
|
720
|
+
title: conversation?.title,
|
|
721
|
+
messages: meetingMessages
|
|
867
722
|
}
|
|
868
723
|
),
|
|
869
|
-
|
|
870
|
-
|
|
724
|
+
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
725
|
+
MeetingThreadRecordingsAction,
|
|
871
726
|
{
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
scope: "chat",
|
|
875
|
-
members: others,
|
|
876
|
-
preselected: others.map((u) => u.external_id),
|
|
877
|
-
onSubmit: async ({ ring }) => {
|
|
878
|
-
await react.startChatCall(arbi, { chatExtId, title, ring });
|
|
879
|
-
}
|
|
727
|
+
meetingCallExtId,
|
|
728
|
+
title: conversation?.title
|
|
880
729
|
}
|
|
881
730
|
)
|
|
882
731
|
] });
|
|
883
732
|
}
|
|
884
|
-
function
|
|
885
|
-
|
|
733
|
+
function ChatCallCard({
|
|
734
|
+
callExtId,
|
|
735
|
+
senderName,
|
|
736
|
+
latest,
|
|
737
|
+
name,
|
|
738
|
+
time
|
|
739
|
+
}) {
|
|
740
|
+
const arbi = react.useArbi();
|
|
741
|
+
const { data: call } = react.useCall(latest ? callExtId : null);
|
|
742
|
+
const liveNow = react.useCallSession((s) => callExtId in s.liveCalls);
|
|
743
|
+
const inThisCall = react.useCallSession((s) => s.active?.callExtId === callExtId);
|
|
744
|
+
const inAnotherCall = react.useCallSession((s) => !!s.active && s.active.callExtId !== callExtId);
|
|
745
|
+
const [busy, setBusy] = react$1.useState(false);
|
|
746
|
+
const live = latest && chunkSH7W4WVI_cjs.isCallLive(call, liveNow);
|
|
747
|
+
let summary;
|
|
748
|
+
if (live) summary = senderName ? `${senderName} started a call` : "Call in progress";
|
|
749
|
+
else if (latest && call?.started_at && call.ended_at) {
|
|
750
|
+
const seconds = (Date.parse(call.ended_at) - Date.parse(call.started_at)) / 1e3;
|
|
751
|
+
const joined = (call.last_participants ?? []).map(name);
|
|
752
|
+
summary = [
|
|
753
|
+
"Call",
|
|
754
|
+
chunkSH7W4WVI_cjs.formatCallDuration(seconds),
|
|
755
|
+
joined.length ? `joined ${joined.join(", ")}` : null
|
|
756
|
+
].filter(Boolean).join(" \xB7 ");
|
|
757
|
+
} else summary = senderName ? `Call started by ${senderName}` : "Call";
|
|
758
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
759
|
+
"div",
|
|
760
|
+
{
|
|
761
|
+
className: "mx-auto my-2 flex w-fit max-w-full flex-wrap items-center justify-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-xs",
|
|
762
|
+
"data-testid": "chat-call-card",
|
|
763
|
+
"data-live": live || void 0,
|
|
764
|
+
children: [
|
|
765
|
+
live ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: "size-4 animate-pulse text-green-text", "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PhoneOff, { className: "size-4 text-muted-foreground", "aria-hidden": true }),
|
|
766
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "chat-call-card-summary", children: summary }),
|
|
767
|
+
time && /* @__PURE__ */ jsxRuntime.jsx("time", { className: "text-muted-foreground", children: time }),
|
|
768
|
+
live && /* @__PURE__ */ jsxRuntime.jsx(
|
|
769
|
+
ui.Button,
|
|
770
|
+
{
|
|
771
|
+
type: "button",
|
|
772
|
+
size: "sm",
|
|
773
|
+
className: "h-7 bg-green-600 text-white hover:bg-green-700",
|
|
774
|
+
disabled: busy || inThisCall || inAnotherCall,
|
|
775
|
+
title: inAnotherCall ? "You are already in a call" : void 0,
|
|
776
|
+
onClick: () => {
|
|
777
|
+
setBusy(true);
|
|
778
|
+
void react.openCall(arbi, { callExtId }).finally(() => setBusy(false));
|
|
779
|
+
},
|
|
780
|
+
"data-testid": "chat-call-card-join",
|
|
781
|
+
children: inThisCall ? "In call" : "Join"
|
|
782
|
+
}
|
|
783
|
+
)
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
);
|
|
886
787
|
}
|
|
887
|
-
function
|
|
788
|
+
function useCallPersonName(identity, fallbackName) {
|
|
888
789
|
const arbi = react.useArbi();
|
|
889
|
-
const
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
{
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
790
|
+
const { byId } = react.usePeople();
|
|
791
|
+
const me = arbi.isLoggedIn && arbi.user.identity()?.externalId === identity;
|
|
792
|
+
const profile = me ? arbi.user.profile() : null;
|
|
793
|
+
return react$1.useMemo(() => {
|
|
794
|
+
if (profile)
|
|
795
|
+
return ui.getUserDisplayName({ given_name: profile.givenName, family_name: profile.familyName });
|
|
796
|
+
const user = byId(identity);
|
|
797
|
+
if (user) return ui.getUserDisplayName(user);
|
|
798
|
+
return (fallbackName || identity).trim().split(/\s+/).join(" ");
|
|
799
|
+
}, [profile, byId, identity, fallbackName]);
|
|
800
|
+
}
|
|
801
|
+
function CallConversationEmpty({ callExtId }) {
|
|
802
|
+
const { inCall, transcribing } = chunkOAIOOVFN_cjs.useMyCallStatus(callExtId);
|
|
803
|
+
const live = react.useCallSession((s) => !!s.liveCalls[callExtId]) || inCall;
|
|
804
|
+
if (!live) {
|
|
805
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
806
|
+
chunkZW6FPIFC_cjs.EmptyState,
|
|
903
807
|
{
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
title: chunkRLRDQICM_cjs.contactsCallTitle([
|
|
910
|
-
...ring.map((u) => ui.getUserDisplayName(u)),
|
|
911
|
-
...invites.map((g) => g.name)
|
|
912
|
-
]),
|
|
913
|
-
ring,
|
|
914
|
-
invites
|
|
915
|
-
});
|
|
916
|
-
}
|
|
808
|
+
icon: lucideReact.AudioLines,
|
|
809
|
+
title: "No transcript",
|
|
810
|
+
description: "This call was not transcribed. When a call here is transcribed, what people say appears in this conversation.",
|
|
811
|
+
className: "mx-auto my-8 max-w-xl",
|
|
812
|
+
testId: "call-conversation-empty"
|
|
917
813
|
}
|
|
918
|
-
)
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
817
|
+
chunkZW6FPIFC_cjs.EmptyState,
|
|
818
|
+
{
|
|
819
|
+
icon: transcribing ? lucideReact.Captions : lucideReact.CaptionsOff,
|
|
820
|
+
title: "Call in progress \u2014 the transcript will appear here",
|
|
821
|
+
description: transcribing ? "Transcription is on: what people say shows up here as they speak." : "Transcription is off. The host can turn it on with CC in the call.",
|
|
822
|
+
className: "mx-auto my-8 max-w-xl",
|
|
823
|
+
testId: "call-conversation-empty"
|
|
824
|
+
}
|
|
925
825
|
);
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
826
|
+
}
|
|
827
|
+
function ProvisionalRow({ identity }) {
|
|
828
|
+
const name = useCallPersonName(identity);
|
|
829
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
830
|
+
chunkZBP4ZSAJ_cjs.ProvisionalTranscriptLine,
|
|
831
|
+
{
|
|
832
|
+
speakerId: identity,
|
|
833
|
+
speakerName: name,
|
|
834
|
+
speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkSH7W4WVI_cjs.CallUserPill, { identity })
|
|
835
|
+
}
|
|
930
836
|
);
|
|
931
837
|
}
|
|
932
|
-
function
|
|
933
|
-
|
|
838
|
+
function ProvisionalSpeakers({ ids }) {
|
|
839
|
+
if (!ids.length) return null;
|
|
840
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2", "data-testid": "transcript-provisional-rows", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsx(ProvisionalRow, { identity: id }, id)) });
|
|
841
|
+
}
|
|
842
|
+
var LINE_WAIT_MS = 1e4;
|
|
843
|
+
var MIN_SPEECH_MS = 800;
|
|
844
|
+
function useProvisionalSpeakers(callExtId, lines) {
|
|
845
|
+
const { inCall, transcribing } = chunkOAIOOVFN_cjs.useMyCallStatus(callExtId);
|
|
846
|
+
const speaking = chunkOAIOOVFN_cjs.useSpeakingIds();
|
|
847
|
+
const pending = react$1.useRef(/* @__PURE__ */ new Map());
|
|
848
|
+
const [, tick] = react$1.useState(0);
|
|
849
|
+
const active = inCall && transcribing;
|
|
850
|
+
const now = Date.now();
|
|
851
|
+
if (active) {
|
|
852
|
+
for (const id of speaking) {
|
|
853
|
+
const p = pending.current.get(id);
|
|
854
|
+
if (p) p.lastHeardAt = now;
|
|
855
|
+
else pending.current.set(id, { startedAt: now, lastHeardAt: now });
|
|
856
|
+
}
|
|
857
|
+
} else if (pending.current.size) {
|
|
858
|
+
pending.current.clear();
|
|
859
|
+
}
|
|
860
|
+
const latest = react$1.useMemo(() => {
|
|
861
|
+
const m = /* @__PURE__ */ new Map();
|
|
862
|
+
for (const l of lines) m.set(l.speakerId, Math.max(m.get(l.speakerId) ?? 0, l.at));
|
|
863
|
+
return m;
|
|
864
|
+
}, [lines]);
|
|
865
|
+
for (const [id, p] of [...pending.current]) {
|
|
866
|
+
const arrived = (latest.get(id) ?? 0) >= p.startedAt - 3e3;
|
|
867
|
+
const stale = !speaking.includes(id) && now - p.lastHeardAt > LINE_WAIT_MS;
|
|
868
|
+
if (arrived && !speaking.includes(id) || stale) pending.current.delete(id);
|
|
869
|
+
else if (arrived) p.startedAt = now;
|
|
870
|
+
}
|
|
871
|
+
const waiting = pending.current.size > 0;
|
|
872
|
+
react$1.useEffect(() => {
|
|
873
|
+
if (!waiting) return;
|
|
874
|
+
const id = setInterval(() => tick((n) => n + 1), 1e3);
|
|
875
|
+
return () => clearInterval(id);
|
|
876
|
+
}, [waiting]);
|
|
877
|
+
return [...pending.current].filter(([, p]) => p.lastHeardAt - p.startedAt >= MIN_SPEECH_MS).map(([id]) => id);
|
|
878
|
+
}
|
|
879
|
+
var { isTranscriptMessage, parseTranscriptContent } = browser.chats;
|
|
880
|
+
function ConnectedCallChatHistory({
|
|
881
|
+
chat,
|
|
882
|
+
messages,
|
|
883
|
+
items,
|
|
884
|
+
renderItem,
|
|
885
|
+
renderEntriesBefore,
|
|
886
|
+
entriesAfter,
|
|
887
|
+
loadOlder,
|
|
888
|
+
memberById,
|
|
889
|
+
senderName,
|
|
890
|
+
myExtId,
|
|
891
|
+
formatTime,
|
|
892
|
+
formatDay
|
|
934
893
|
}) {
|
|
935
894
|
const arbi = react.useArbi();
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
895
|
+
const [view, setView] = react$1.useState("all");
|
|
896
|
+
react$1.useEffect(() => setView("all"), [chat?.external_id]);
|
|
897
|
+
const recordingsCallExtId = chat?.call_ext_id ?? null;
|
|
898
|
+
const pendingRecording = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
899
|
+
react$1.useEffect(() => {
|
|
900
|
+
if (pendingRecording && recordingsCallExtId) setView("recordings");
|
|
901
|
+
}, [pendingRecording, recordingsCallExtId]);
|
|
902
|
+
const latestCallCards = react$1.useMemo(() => {
|
|
903
|
+
const latest = /* @__PURE__ */ new Map();
|
|
904
|
+
for (const m of messages)
|
|
905
|
+
if (m.kind === "call" && m.call_ext_id && !m.deleted) latest.set(m.call_ext_id, m.external_id);
|
|
906
|
+
return new Set(latest.values());
|
|
907
|
+
}, [messages]);
|
|
908
|
+
const hasRecTranscript = react$1.useMemo(
|
|
909
|
+
() => react.hasRecordingTranscript(messages, react.chatTranscriptRef),
|
|
910
|
+
[messages]
|
|
911
|
+
);
|
|
912
|
+
const recordingWindows = react.useRecordingWindows(recordingsCallExtId, hasRecTranscript);
|
|
913
|
+
const supersededTranscript = react$1.useMemo(
|
|
914
|
+
() => react.supersededTranscriptLines(messages, react.chatTranscriptRef, recordingWindows),
|
|
915
|
+
[messages, recordingWindows]
|
|
916
|
+
);
|
|
917
|
+
const transcriptMessages = react$1.useMemo(
|
|
918
|
+
() => react.sortTranscriptMessages(
|
|
919
|
+
messages.filter((m) => isTranscriptMessage(m) && !m.deleted && !supersededTranscript.has(m))
|
|
959
920
|
),
|
|
960
|
-
|
|
961
|
-
|
|
921
|
+
[messages, supersededTranscript]
|
|
922
|
+
);
|
|
923
|
+
const hasTranscript = transcriptMessages.length > 0;
|
|
924
|
+
const { data: meetingCall } = react.useCall(hasTranscript ? chat?.call_ext_id : null);
|
|
925
|
+
const isHost = !!meetingCall?.is_creator;
|
|
926
|
+
const [meetingTitle, setMeetingTitle] = react$1.useState(null);
|
|
927
|
+
react$1.useEffect(() => {
|
|
928
|
+
if (!chat || !isHost && !recordingsCallExtId) return;
|
|
929
|
+
let cancelled = false;
|
|
930
|
+
arbi.chats.title(chat).then((t) => !cancelled && setMeetingTitle(t)).catch(() => void 0);
|
|
931
|
+
return () => {
|
|
932
|
+
cancelled = true;
|
|
933
|
+
};
|
|
934
|
+
}, [arbi, isHost, chat, recordingsCallExtId]);
|
|
935
|
+
const transcriptSpeaker = (msg) => {
|
|
936
|
+
const parsed = msg.decryptFailed ? null : parseTranscriptContent(msg.content);
|
|
937
|
+
return { parsed, speakerId: parsed?.speaker_identity || msg.sender_ext_id || "" };
|
|
938
|
+
};
|
|
939
|
+
const transcriptExport = react$1.useMemo(
|
|
940
|
+
() => transcriptMessages.filter((m) => !m.decryptFailed).map((m) => {
|
|
941
|
+
const parsed = parseTranscriptContent(m.content);
|
|
942
|
+
const speakerId = parsed?.speaker_identity || m.sender_ext_id || "";
|
|
943
|
+
return {
|
|
944
|
+
speaker: parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : "") || "Former member",
|
|
945
|
+
at: parsed?.started_at ?? m.created_at,
|
|
946
|
+
text: parsed?.text ?? m.content ?? ""
|
|
947
|
+
};
|
|
948
|
+
}),
|
|
949
|
+
[transcriptMessages, memberById, senderName]
|
|
950
|
+
);
|
|
951
|
+
const transcriptLayout = react$1.useMemo(() => {
|
|
952
|
+
const shown = view === "transcript" ? transcriptMessages : messages;
|
|
953
|
+
const continued = chunkZBP4ZSAJ_cjs.transcriptRuns(
|
|
954
|
+
shown,
|
|
955
|
+
(m) => isTranscriptMessage(m) && !supersededTranscript.has(m) ? transcriptSpeaker(m).speakerId : null,
|
|
956
|
+
(m) => Date.parse(transcriptSpeaker(m).parsed?.started_at ?? m.created_at ?? "") || 0
|
|
957
|
+
);
|
|
958
|
+
return { continued };
|
|
959
|
+
}, [view, messages, transcriptMessages, supersededTranscript]);
|
|
960
|
+
const transcriptEntry = (msg) => {
|
|
961
|
+
const { parsed, speakerId } = transcriptSpeaker(msg);
|
|
962
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
963
|
+
chunk3GQQUR27_cjs.TranscriptEntry,
|
|
962
964
|
{
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
meetingCallExtId,
|
|
977
|
-
title,
|
|
978
|
-
messages
|
|
979
|
-
}) {
|
|
980
|
-
const { data: call } = react.useCall(meetingCallExtId);
|
|
981
|
-
const { data: workspaceUsers = [] } = react.useWorkspaceUsers();
|
|
982
|
-
const lines = react$1.useMemo(
|
|
983
|
-
() => react.threadTranscriptLines(messages, (id) => {
|
|
984
|
-
const user = workspaceUsers.find((wu) => wu.user.external_id === id)?.user;
|
|
985
|
-
return user ? ui.getUserDisplayName(user) : null;
|
|
965
|
+
speakerId,
|
|
966
|
+
speakerName: speakerId === myExtId ? "Me" : parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : senderName(msg.sender_ext_id)),
|
|
967
|
+
text: parsed?.text ?? msg.content ?? "",
|
|
968
|
+
at: parsed?.started_at ?? msg.created_at,
|
|
969
|
+
continued: transcriptLayout.continued.has(msg)
|
|
970
|
+
},
|
|
971
|
+
msg.external_id
|
|
972
|
+
);
|
|
973
|
+
};
|
|
974
|
+
const chatLines = react$1.useMemo(
|
|
975
|
+
() => transcriptMessages.map((m) => {
|
|
976
|
+
const { parsed, speakerId } = transcriptSpeaker(m);
|
|
977
|
+
return { speakerId, at: Date.parse(parsed?.started_at ?? m.created_at ?? "") || 0 };
|
|
986
978
|
}),
|
|
987
|
-
[
|
|
979
|
+
[transcriptMessages]
|
|
988
980
|
);
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
981
|
+
const provisionalSpeakers = useProvisionalSpeakers(recordingsCallExtId, chatLines);
|
|
982
|
+
const chatItem = (item, i) => {
|
|
983
|
+
const { message: msg, isFirstOfDay } = item;
|
|
984
|
+
const deleted = !!msg.deleted;
|
|
985
|
+
if (deleted && isTranscriptMessage(msg)) return null;
|
|
986
|
+
const separator = isFirstOfDay && /* @__PURE__ */ jsxRuntime.jsx(react.DateSeparator, { children: formatDay(msg.created_at) });
|
|
987
|
+
if (isTranscriptMessage(msg)) {
|
|
988
|
+
if (view === "chat") return null;
|
|
989
|
+
const superseded = supersededTranscript.has(msg);
|
|
990
|
+
if (superseded && !isFirstOfDay) return null;
|
|
991
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
992
|
+
separator,
|
|
993
|
+
!superseded && transcriptEntry(msg)
|
|
994
|
+
] }, msg.external_id);
|
|
997
995
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
996
|
+
if (msg.kind === "recording" && msg.call_ext_id && !deleted) {
|
|
997
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
998
|
+
separator,
|
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1000
|
+
chunkNGM4HIPP_cjs.RecordingCard,
|
|
1001
|
+
{
|
|
1002
|
+
callExtId: msg.call_ext_id,
|
|
1003
|
+
recordingExtId: msg.recording_ext_id ?? null,
|
|
1004
|
+
title: meetingTitle,
|
|
1005
|
+
time: formatTime(msg.created_at)
|
|
1006
|
+
}
|
|
1007
|
+
)
|
|
1008
|
+
] }, msg.external_id);
|
|
1009
|
+
}
|
|
1010
|
+
if (msg.kind === "call" && msg.call_ext_id && !deleted) {
|
|
1011
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
1012
|
+
separator,
|
|
1013
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1014
|
+
ChatCallCard,
|
|
1015
|
+
{
|
|
1016
|
+
callExtId: msg.call_ext_id,
|
|
1017
|
+
senderName: msg.sender_ext_id ? senderName(msg.sender_ext_id) : null,
|
|
1018
|
+
latest: latestCallCards.has(msg.external_id),
|
|
1019
|
+
name: senderName,
|
|
1020
|
+
time: formatTime(msg.created_at)
|
|
1021
|
+
}
|
|
1022
|
+
)
|
|
1023
|
+
] }, msg.external_id);
|
|
1024
|
+
}
|
|
1025
|
+
return renderItem(item, i);
|
|
1026
|
+
};
|
|
1027
|
+
const filterOptions = [
|
|
1028
|
+
{ value: "all", label: "All" },
|
|
1029
|
+
{ value: "chat", label: "Chat", testId: "chat-filter" },
|
|
1030
|
+
{
|
|
1031
|
+
value: "transcript",
|
|
1032
|
+
label: "Transcript",
|
|
1033
|
+
count: transcriptMessages.length,
|
|
1034
|
+
testId: "transcript-filter"
|
|
1035
|
+
},
|
|
1036
|
+
...recordingsCallExtId ? [{ value: "recordings", label: "Recordings", testId: "recordings-filter" }] : []
|
|
1037
|
+
];
|
|
1009
1038
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1010
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1011
|
-
|
|
1039
|
+
messages.length === 0 && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(CallConversationEmpty, { callExtId: recordingsCallExtId }),
|
|
1040
|
+
(hasTranscript || recordingsCallExtId) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 flex justify-center py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1041
|
+
chunkZBP4ZSAJ_cjs.ConversationFilter,
|
|
1012
1042
|
{
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
onClick: () => setOpen(true),
|
|
1017
|
-
testId: "meeting-recordings"
|
|
1043
|
+
value: view,
|
|
1044
|
+
options: filterOptions,
|
|
1045
|
+
onChange: setView
|
|
1018
1046
|
}
|
|
1019
|
-
),
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1026
|
-
chunkPA5CCOBU_cjs.RecordingsList,
|
|
1047
|
+
) }),
|
|
1048
|
+
view === "recordings" && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkNGM4HIPP_cjs.RecordingsList, { callExtId: recordingsCallExtId, title: meetingTitle, className: "py-1" }),
|
|
1049
|
+
loadOlder,
|
|
1050
|
+
view === "transcript" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col py-1", "data-testid": "transcript-view", children: [
|
|
1051
|
+
isHost && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1052
|
+
chunkNGM4HIPP_cjs.SaveTranscriptToThread,
|
|
1027
1053
|
{
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
className: "
|
|
1054
|
+
title: meetingTitle,
|
|
1055
|
+
lines: transcriptExport,
|
|
1056
|
+
className: "mx-3 mb-2 self-start"
|
|
1031
1057
|
}
|
|
1032
|
-
)
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
content: m.content,
|
|
1046
|
-
created_at: m.created_at,
|
|
1047
|
-
tools: m.tools ?? m.meta?.tools
|
|
1048
|
-
})) : [],
|
|
1049
|
-
[meetingCallExtId, threadMessages]
|
|
1050
|
-
);
|
|
1051
|
-
if (!conversationId) return null;
|
|
1052
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1053
|
-
/* @__PURE__ */ jsxRuntime.jsx(ThreadCallButton, { conversationId }),
|
|
1054
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkT26UYA6Q_cjs.ScheduleCallButton, { conversationId }),
|
|
1055
|
-
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
|
-
MeetingThreadTranscriptAction,
|
|
1057
|
-
{
|
|
1058
|
-
conversationExtId: conversationId,
|
|
1059
|
-
meetingCallExtId,
|
|
1060
|
-
title: conversation?.title,
|
|
1061
|
-
messages: meetingMessages
|
|
1062
|
-
}
|
|
1063
|
-
),
|
|
1064
|
-
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1065
|
-
MeetingThreadRecordingsAction,
|
|
1066
|
-
{
|
|
1067
|
-
meetingCallExtId,
|
|
1068
|
-
title: conversation?.title
|
|
1069
|
-
}
|
|
1070
|
-
)
|
|
1058
|
+
),
|
|
1059
|
+
transcriptMessages.map((msg) => transcriptEntry(msg)),
|
|
1060
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
1061
|
+
] }),
|
|
1062
|
+
(view === "all" || view === "chat") && items.map((item, i) => (
|
|
1063
|
+
// A shared file's card sits among the messages, by time.
|
|
1064
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
1065
|
+
renderEntriesBefore(i),
|
|
1066
|
+
chatItem(item, i)
|
|
1067
|
+
] }, item.message.external_id)
|
|
1068
|
+
)),
|
|
1069
|
+
(view === "all" || view === "chat") && entriesAfter,
|
|
1070
|
+
view === "all" && /* @__PURE__ */ jsxRuntime.jsx(ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
1071
1071
|
] });
|
|
1072
1072
|
}
|
|
1073
1073
|
|
|
@@ -1091,5 +1091,5 @@ exports.matchesQuery = matchesQuery;
|
|
|
1091
1091
|
exports.useCallPersonName = useCallPersonName;
|
|
1092
1092
|
exports.useMeetingThreadMessages = useMeetingThreadMessages;
|
|
1093
1093
|
exports.useProvisionalSpeakers = useProvisionalSpeakers;
|
|
1094
|
-
//# sourceMappingURL=chunk-
|
|
1095
|
-
//# sourceMappingURL=chunk-
|
|
1094
|
+
//# sourceMappingURL=chunk-5AQHL4E3.cjs.map
|
|
1095
|
+
//# sourceMappingURL=chunk-5AQHL4E3.cjs.map
|