dorkos 0.120.0 → 0.122.0
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/bin/cli.js +497 -356
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-Y8O56Cz5.js → AboutPage-ClN3P9B8.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DlROxqde.js → ActivityErrorState-B2lq1pyE.js} +1 -1
- package/dist/client/assets/{ActivityPage-BdV90CV2.js → ActivityPage-htTkSy18.js} +1 -1
- package/dist/client/assets/{ActivityRow-B5yiD_uD.js → ActivityRow-BqV0B1T0.js} +1 -1
- package/dist/client/assets/{AdapterIcon-Dyq92Eup.js → AdapterIcon-DlkN0YJo.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-D9tqz7Hl.js → AdapterSetupWizard-RyNPjSmU.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-BeRqDo7c.js → AgentOptionRow-DSievGfL.js} +1 -1
- package/dist/client/assets/{AgentPicker-BRyYVJZu.js → AgentPicker-BCtWrhsA.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-xX6fAKgO.js → AgentRequestCard-BHIHWNRz.js} +4 -4
- package/dist/client/assets/{AppearancePage-DKF9BqRt.js → AppearancePage-B2eduuT0.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-CPvtr_-f.js → ApplyToOverridesDialog-C7G2t3X2.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-vBfioH1A.js → AttentionSignalRow-_8thTHYX.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-B50zNtwB.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-WpZU5xiO.js} +1 -1
- package/dist/client/assets/{BindingDialog-CSNjws3F.js → BindingDialog-BAwbHFq3.js} +1 -1
- package/dist/client/assets/BlintzCanvas-BEtRmEbL.js +1231 -0
- package/dist/client/assets/{BlintzCanvas-GgiCXV7C.css → BlintzCanvas-DCXOV_yN.css} +1 -1
- package/dist/client/assets/{CanvasCsvContent-0Mb7uOuA.js → CanvasCsvContent--6i2ETyZ.js} +2 -2
- package/dist/client/assets/CanvasFileContent-C86nyLbI.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-wYHHAovt.js +2 -0
- package/dist/client/assets/{ChatAppsOff-CLRB0YU5.js → ChatAppsOff-2Wvch1rr.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-B4uFJD6g.js → CodeMirrorDiff-s1TWguZ8.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-rYOrBAZc.js → CodeMirrorEditor-1ndoTbcZ.js} +1 -1
- package/dist/client/assets/{CommitmentList-i-IZ4gbr.js → CommitmentList-BK97ndab.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-ChO1JkrE.js → CommitmentsPage-_nd37gVX.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-pLuD2ie6.js → ComputerResourceView-C2Broer4.js} +1 -1
- package/dist/client/assets/{ComputerViewer-D7tPmpY5.js → ComputerViewer-DgG7t2KZ.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-D6VH1vX3.js → ConnectionAccessLists-Pbo2lft8.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-7x5olD9q.js → ConnectionsPage-Dm2d9owX.js} +2 -2
- package/dist/client/assets/{ConventionPage-BTYLWw6p.js → ConventionPage-BUltejHJ.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-A9AdBBbw.js → ExtensionPageRoute-DAomCiMw.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-ayv0yz1C.js → FloatingTanStackRouterDevtools-CqogiFob-5fT29ZEV.js} +1 -1
- package/dist/client/assets/HandlePage-BoBFGnUB.js +1 -0
- package/dist/client/assets/{HeartbeatPage-Dh6W9Qg5.js → HeartbeatPage-BW0X4YAL.js} +1 -1
- package/dist/client/assets/{KeyEntry-owhPGtw3.js → KeyEntry-ClqAj0dS.js} +1 -1
- package/dist/client/assets/{LexicalField-B1NFMLD6.js → LexicalField-CbswpPQ7.js} +1 -1
- package/dist/client/assets/{ManagesPage-BAnBmBdo.js → ManagesPage-Daqs8hys.js} +1 -1
- package/dist/client/assets/{Marketplace-67maxdwz.js → Marketplace-BNMIm8g_.js} +1 -1
- package/dist/client/assets/{MarketplaceSourcesView-CzPBNJJj.js → MarketplaceSourcesView-B4WpzVpr.js} +1 -1
- package/dist/client/assets/{McpAppFrame-CuObpQTg.js → McpAppFrame-Dbg_Ni39.js} +1 -1
- package/dist/client/assets/{McpSigninBody-B-ayj6bQ.js → McpSigninBody-ZmmY1BZ4.js} +1 -1
- package/dist/client/assets/{Model3dViewer-DRVqxazk.js → Model3dViewer-DT8x0h7T.js} +1 -1
- package/dist/client/assets/NamePage-bC_9FOtD.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-B3DxayR2.js → NewDirectMessageMenu-BbehZd6I.js} +1 -1
- package/dist/client/assets/{NotificationsPage-BavEo7VZ.js → NotificationsPage-B9zEN26O.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-BwkX2Toa.js → OpenMeshSwitch-D-AYDXjH.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-CtWgz2yi.js → OperatorIdentityForm-BdAqzVEG.js} +1 -1
- package/dist/client/assets/{PermissionHistory-DvM0F2bS.js → PermissionHistory-IOgLQ7qN.js} +1 -1
- package/dist/client/assets/{PermissionsPage-D1DJHezV.js → PermissionsPage-CKfDf5Pj.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-BV-9wfIl.js → PersonalityPopover-CHPTuHIH.js} +1 -1
- package/dist/client/assets/PhotoPage-BOe3xwyN.js +1 -0
- package/dist/client/assets/{PresetPicker-BOQKgYAK.js → PresetPicker-BcKF2ds8.js} +2 -2
- package/dist/client/assets/{PreviewRefusedNotice-BdhUln2h.js → PreviewRefusedNotice-BuVUhjq3.js} +1 -1
- package/dist/client/assets/{ProfileFields-DFRnRR38.js → ProfileFields-DimHNpR4.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-CkxX9Dps.js → ProfilePanelContainer-FRZ5Px2L.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-BSYi_luB.js → ProfileRolePicker-UWhM5yuR.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-r08GqBH1.js → PromptSuggestionChips-DQaDSd7Y.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-BcsM5Eia.js → ReportsToPopover-BOuCM8il.js} +1 -1
- package/dist/client/assets/RoomSurface-Dhv-LkWz.js +44 -0
- package/dist/client/assets/{RoomsPage-CQqsdVvB.js → RoomsPage-glKYJBpq.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-DFb4xEhP.js → RunsOnPopover-BvxoHUeo.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-pKFJlNSJ.js → RuntimeConnectFlow-CgB_X5wo.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-DvBJbrmj.js → RuntimeSetupDialog-r1Ss_YQW.js} +1 -1
- package/dist/client/assets/{SessionsPage-CGgnEPh7.js → SessionsPage-CFLDx-aF.js} +1 -1
- package/dist/client/assets/{SettingsDialog-D0cmzjrH.js → SettingsDialog-BT5rYJUm.js} +3 -3
- package/dist/client/assets/{SkillsPage-DDoPlsn2.js → SkillsPage-CUQZ4I_r.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-DoIVzbKU.js → TaskDialogWrapper-DWpxyxBb.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-B68O6dnT.js → TasksEmptyState-B4TjUm8G.js} +2 -2
- package/dist/client/assets/{TasksPage-BsBDphim.js → TasksPage-D_vFBDA1.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CoQ4EsDm.js → TeamComputerEntry-EQ1fjMRb.js} +1 -1
- package/dist/client/assets/{ToolsPage-Cl1aOpev.js → ToolsPage-CyNXCe2l.js} +1 -1
- package/dist/client/assets/TopologyGraph-DsPEpDjt.js +30 -0
- package/dist/client/assets/{TourHost-4O6TJzc-.js → TourHost-D1z2mH5S.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DIMY60Fi.js → UnlinkDialog-q-6B4Ftt.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-CzWw_SPD.js → WidgetErrorCard-BYMiUiAf.js} +23 -23
- package/dist/client/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/dist/client/assets/_shell-scIpUrVY.js +80 -0
- package/dist/client/assets/{_shell._home-DG3Vw7S5.js → _shell._home-D-8JcUYq.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-COI96oAO.js → _shell._home.activity-xJKxWbtL.js} +1 -1
- package/dist/client/assets/{_shell._home.index-CTwsTjcQ.js → _shell._home.index-C74gh1aE.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-DOVoPYaf.js → _shell._home.tasks-Bh8jwRYJ.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-ApZhnjwy.js → _shell._home.workspaces-BKkUl6wW.js} +1 -1
- package/dist/client/assets/_shell.channels-B2A1G9n8.js +10 -0
- package/dist/client/assets/{_shell.connections-bhAK3jnE.js → _shell.connections-eDlPXmuG.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-k43R8-rW.js → _shell.feedback-requests-Cdbl3oKj.js} +1 -1
- package/dist/client/assets/_shell.marketplace-FHQpZxgB.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-DXv90Z-v.js +1 -0
- package/dist/client/assets/_shell.session-BNeYm91q.js +63 -0
- package/dist/client/assets/{_shell.team-DHCM1QoO.js → _shell.team-Consxq97.js} +4 -4
- package/dist/client/assets/_shell.x._extensionId-DirEl_qN.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DirEl_qN.js +1 -0
- package/dist/client/assets/abnfDiagram-WEYOIA3C-DXTlLd8s.js +1 -0
- package/dist/client/assets/{access-copy-BVzi1REx.js → access-copy-B1SlOYEi.js} +1 -1
- package/dist/client/assets/arc-B3IW5TXq.js +1 -0
- package/dist/client/assets/architectureDiagram-ZHVYKT53-Bx-4szWe.js +36 -0
- package/dist/client/assets/{banner-3xXXsU5J.js → banner-RKoWGrEp.js} +1 -1
- package/dist/client/assets/blockDiagram-RJAE7QA3-D_B3EDQ1.js +140 -0
- package/dist/client/assets/c4Diagram-XDPPPE54-CSBl4ROD.js +38 -0
- package/dist/client/assets/{card-Bt6IU-Bh.js → card-DTMhLU7B.js} +1 -1
- package/dist/client/assets/channel-BlEJg4XA.js +1 -0
- package/dist/client/assets/chunk-2E7WHVMD-QSgLcVHQ.js +88 -0
- package/dist/client/assets/chunk-2Q5K7J3B-CAEYyBSj.js +1 -0
- package/dist/client/assets/chunk-4EMNKR2T-CQ_90aiz.js +1 -0
- package/dist/client/assets/chunk-55XCU76K-jsUyUA3N.js +1 -0
- package/dist/client/assets/chunk-5VM5RSS4-JHkf15PA.js +15 -0
- package/dist/client/assets/chunk-JWPE2WC7-BT-3krv8.js +1 -0
- package/dist/client/assets/chunk-VQ5W62QI-CJP11I5o.js +1 -0
- package/dist/client/assets/chunk-XXDRQBXY-BpqBecnj.js +1 -0
- package/dist/client/assets/chunk-ZCHMQSOR-BLb4KcT4.js +2 -0
- package/dist/client/assets/classDiagram-v2-4MYWR3UA-DwLyYGkw.js +217 -0
- package/dist/client/assets/{command-CWokzKS1.js → command-DDSiiJlP.js} +1 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-CxYTET88.js +1 -0
- package/dist/client/assets/{cpu-BzByzE9V.js → cpu--56q_Ey0.js} +1 -1
- package/dist/client/assets/cynefin-EF2NZ3EQ-9fHLZRHz.js +141 -0
- package/dist/client/assets/cynefinDiagram-WF24UDRP-DpfQecff.js +62 -0
- package/dist/client/assets/cytoscape.esm-BLAcgzS2.js +331 -0
- package/dist/client/assets/dagre-NK4GIZVX-DuV6buEQ.js +4 -0
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/client/assets/diagram-CBK3MWTC-B-A9Sx5n.js +24 -0
- package/dist/client/assets/diagram-I5XIIV2D-Ds5Hq9aV.js +24 -0
- package/dist/client/assets/diagram-ODIL2UCW-UUfSjM-R.js +30 -0
- package/dist/client/assets/diagram-PFBEJUXE-CUzSSYf9.js +3 -0
- package/dist/client/assets/diagram-RJA3I4VV-Cgp6U3q1.js +41 -0
- package/dist/client/assets/diagram-TYUNFSNR-BxVgzMNE.js +200 -0
- package/dist/client/assets/ebnfDiagram-V4P3TTPT-BgDiHzoi.js +1 -0
- package/dist/client/assets/elk-QONTBCTQ-BCCN6mFs.js +27 -0
- package/dist/client/assets/{empty-state-BgnQDiMZ.js → empty-state-BsA3jcrO.js} +1 -1
- package/dist/client/assets/erDiagram-KYQIGQAA-5RkmUbLz.js +99 -0
- package/dist/client/assets/{execution-config-D5-SEt2t.js → execution-config-CRkSeCj7.js} +1 -1
- package/dist/client/assets/{file-VHDTQub2.js → file-Bg_qGvWR.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DbWvGys0.js → file-exclamation-point-BWsLZQVN.js} +1 -1
- package/dist/client/assets/{file-text-BAhi2zct.js → file-text-DQThCdY3.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-Z0HPVqeK.js → find-latest-widget-fence-DFpYPIlS.js} +1 -1
- package/dist/client/assets/flowDiagram-IUGLLWBU-C2FFT_4u.js +213 -0
- package/dist/client/assets/{form-Blrb1xBU.js → form-DjMe15QR.js} +1 -1
- package/dist/client/assets/{format-cron-lKWqEmle.js → format-cron-Bo3D4N9C.js} +1 -1
- package/dist/client/assets/ganttDiagram-R7GPNTJY-BHG-HNDj.js +292 -0
- package/dist/client/assets/{git-branch-BObm8Rlz.js → git-branch-CJ1NlVLY.js} +1 -1
- package/dist/client/assets/gitGraphDiagram-PDYL7XHY-D4bvs6_J.js +106 -0
- package/dist/client/assets/graph-D8MBmHRU.js +1 -0
- package/dist/client/assets/{heart-Du7nuefC.js → heart-Beze5rli.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-B_GO7V1P.js → highlighted-body-KPVGNVTW-B-za1R0D.js} +1 -1
- package/dist/client/assets/{image-lightbox-BZ1TV3mN.js → image-lightbox-a4gqhNXS.js} +1 -1
- package/dist/client/assets/{image-off-hnjcBIzN.js → image-off-dQCXn9D_.js} +1 -1
- package/dist/client/assets/{index-DoMJUxt_.js → index--vwACals.js} +1 -1
- package/dist/client/assets/{index-BVKXIbLh.js → index-B3VKw60l.js} +1 -1
- package/dist/client/assets/index-B3ybVnXe.js +23 -0
- package/dist/client/assets/{index-HxT_wkaZ.js → index-BJv8b9cZ.js} +1 -1
- package/dist/client/assets/{index-aXm0xP_2.js → index-BMhblg3s.js} +1 -1
- package/dist/client/assets/{index-4GC2fkeO.js → index-BMktWriw.js} +1 -1
- package/dist/client/assets/{index-Ci74HAFs.js → index-BPa0ZczY.js} +1 -1
- package/dist/client/assets/{index-1I8qHZDt.js → index-BTVsyrd0.js} +1 -1
- package/dist/client/assets/{index-DRea_Gi0.js → index-BTfwunle.js} +1 -1
- package/dist/client/assets/{index-BtbZpz4b.js → index-BaocSCDH.js} +1 -1
- package/dist/client/assets/{index-CCg7yRe1.js → index-Bk6YahnN.js} +1 -1
- package/dist/client/assets/{index-B0tAedq7.js → index-BqwfU5a7.js} +1 -1
- package/dist/client/assets/index-BydIKjk5.js +1 -0
- package/dist/client/assets/{index-Bm0z9mHt.js → index-C38pc-JE.js} +1 -1
- package/dist/client/assets/{index-Df7a-2P5.js → index-C9qjJR0B.js} +1 -1
- package/dist/client/assets/{index-CqoIjNC2.js → index-CAGOE4EU.js} +2 -2
- package/dist/client/assets/{index-D5TZCu8j.js → index-CDm1XkU1.js} +1 -1
- package/dist/client/assets/{index-CQCN6kWR.js → index-CGVRWEpN.js} +1 -1
- package/dist/client/assets/{index-CiQxS4Bn.js → index-CMlVfxJv.js} +1 -1
- package/dist/client/assets/{index-BeVbHOwX.js → index-CPxcbKL6.js} +2 -2
- package/dist/client/assets/{index-4PAAWURd.js → index-CU-gekzq.js} +1 -1
- package/dist/client/assets/{index-BnNTKsbt.js → index-Ckv0K82u.js} +1 -1
- package/dist/client/assets/{index-BUOcbPfv.js → index-CocSe_I3.js} +3 -3
- package/dist/client/assets/index-CodC2rG4.js +1 -0
- package/dist/client/assets/{index-BgzgdvDn.js → index-CxWJDJW7.js} +1 -1
- package/dist/client/assets/index-D18FqQKB.js +1 -0
- package/dist/client/assets/{index-BaRQVgiN.js → index-D4mYlxG0.js} +1 -1
- package/dist/client/assets/{index-Dc5cpBoO.js → index-DBdO-_iL.js} +240 -240
- package/dist/client/assets/{index-r_O6CmXY.js → index-DFN-GU8r.js} +1 -1
- package/dist/client/assets/{index-DkhM0fDi.js → index-DLdpa3d4.js} +1 -1
- package/dist/client/assets/{index-EZHlD3gf.js → index-DNlhbCX_.js} +1 -1
- package/dist/client/assets/{index-ox3ce99A.js → index-D_KBdkA4.js} +1 -1
- package/dist/client/assets/{index-WxtASL5_.js → index-Dbt6ttQb.js} +1 -1
- package/dist/client/assets/index-DfSOcv9s.js +74 -0
- package/dist/client/assets/{index-CBm3whA-.js → index-DnfhvN3q.js} +1 -1
- package/dist/client/assets/{index-BvjuGXcS.js → index-DpX_xwGs.js} +1 -1
- package/dist/client/assets/{index-C60RrnTd.js → index-DqD-Sg0W.js} +1 -1
- package/dist/client/assets/{index-Lh82Rz5C.js → index-Ds-LCBb6.js} +1 -1
- package/dist/client/assets/index-dnaC3n0i.js +17 -0
- package/dist/client/assets/{index-DB8TDRSm.js → index-hKY0860x.js} +1 -1
- package/dist/client/assets/{index-BP68J4pb.js → index-vNaWkS8Y.js} +1 -1
- package/dist/client/assets/{index-Ch-ON5gw.js → index-vieeLeZH.js} +1 -1
- package/dist/client/assets/{index-D6y4WeTi.js → index-yDf4EVDy.js} +1 -1
- package/dist/client/assets/{index.esm-DXsF3Bua.js → index.esm-Ruqz-OsH.js} +1 -1
- package/dist/client/assets/infoDiagram-MVDRKAX5-CmDlX3lx.js +2 -0
- package/dist/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/client/assets/{inline-code-DAEoWvTf.js → inline-code-plzdKGm9.js} +1 -1
- package/dist/client/assets/ishikawaDiagram-HPEHV2GE-DZFRAvrx.js +70 -0
- package/dist/client/assets/journeyDiagram-BOSHW7O7-B140KXYu.js +139 -0
- package/dist/client/assets/kanban-definition-FNSA4HC5-QCZgRJic.js +89 -0
- package/dist/client/assets/katex-DLorvT8M.js +257 -0
- package/dist/client/assets/{layers-CsM34LRv.js → layers-Br3LALac.js} +1 -1
- package/dist/client/assets/{lightbulb-B8JAixK_.js → lightbulb-CeJgUDoT.js} +1 -1
- package/dist/client/assets/linear-BT-xgETh.js +1 -0
- package/dist/client/assets/{link-2-Csc6okl3.js → link-2-BXcZwTAC.js} +1 -1
- package/dist/client/assets/{list-runtime-types-DQrZNB7x.js → list-runtime-types-CqKIrt9D.js} +1 -1
- package/dist/client/assets/{markdown-content-DPc7aD1j.js → markdown-content-BKbjOTI2.js} +1 -1
- package/dist/client/assets/{mention-pill-8P_w4muj.js → mention-pill-B-FgNE6o.js} +1 -1
- package/dist/client/assets/mermaid.core-Br9hJ7FR.js +312 -0
- package/dist/client/assets/{message-square-off-D5DXu2cY.js → message-square-off-Co0W--np.js} +1 -1
- package/dist/client/assets/mindmap-definition-6OY57UG3-BxjSZAec.js +98 -0
- package/dist/client/assets/{more-details-DEeu2M-p.js → more-details-BsdCkGTg.js} +1 -1
- package/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/client/assets/{owner-notice-BW4k1ycg.js → owner-notice-BxltHzJH.js} +1 -1
- package/dist/client/assets/{package-BSwwAFVm.js → package-DPgmy9lP.js} +1 -1
- package/dist/client/assets/{page-container-CjPUNtNw.js → page-container-HokGbFg_.js} +1 -1
- package/dist/client/assets/{paperclip-DQaRz34E.js → paperclip-BDnApT-_.js} +1 -1
- package/dist/client/assets/{path-input-CgXSYNZn.js → path-input-C22n3ghr.js} +1 -1
- package/dist/client/assets/pegDiagram-ECIUJNBX-utA2pUiu.js +1 -0
- package/dist/client/assets/pieDiagram-GNMPY74T-DjEry_VP.js +39 -0
- package/dist/client/assets/{plug-BaUXMfIl.js → plug-tLTAmXis.js} +1 -1
- package/dist/client/assets/{primer-trigger-DHB0vilf.js → primer-trigger-CfVHNFbe.js} +2 -2
- package/dist/client/assets/{profile-errors-JW2XTgia.js → profile-errors-Dvm4O6MR.js} +1 -1
- package/dist/client/assets/{progress-CErAw8zp.js → progress-BduTwXMX.js} +1 -1
- package/dist/client/assets/quadrantDiagram-D57K4MC3-DO9NgnEq.js +7 -0
- package/dist/client/assets/{query-error-state-BFWpEXsl.js → query-error-state-puwJHnzi.js} +1 -1
- package/dist/client/assets/query-keys-DeYqUDia.js +1 -0
- package/dist/client/assets/{radio-Bkx216ga.js → radio-DR4E05zZ.js} +1 -1
- package/dist/client/assets/railroadDiagram-Y72NRBL7-BTilAS9p.js +1 -0
- package/dist/client/assets/registry-B3Ss4ItQ.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-DiZj_AFV.js → relay-trace-schemas-DwqIIDB9.js} +2 -2
- package/dist/client/assets/requirementDiagram-EQYSW5RA-C6rzY7GK.js +84 -0
- package/dist/client/assets/{room-files-source-BilZvdpf.js → room-files-source-Duo4oiqX.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-D_SO1stN.js → rotate-ccw-clock-RJuoRE3k.js} +1 -1
- package/dist/client/assets/{rotate-cw-C68kM23F.js → rotate-cw-C0EpbK5k.js} +1 -1
- package/dist/client/assets/sankeyDiagram-SY24JHO5-BqpJRY1t.js +40 -0
- package/dist/client/assets/{scroll-area-CVWFUmJV.js → scroll-area-07T90PR6.js} +1 -1
- package/dist/client/assets/{search-x-BTFVvyA2.js → search-x-DQabogEL.js} +1 -1
- package/dist/client/assets/sequenceDiagram-BLEHNHQU-BHfzZpFt.js +169 -0
- package/dist/client/assets/{shield-check-Dpxi6WqO.js → shield-check-DbbCy17l.js} +1 -1
- package/dist/client/assets/{shield-x-CdCCgyXk.js → shield-x-Cuo1GTv4.js} +1 -1
- package/dist/client/assets/{signed-in-BxAnDo0S.js → signed-in-CFtA8gTK.js} +1 -1
- package/dist/client/assets/sizeCapture-INFHLROL-U0MO-4ua.js +1 -0
- package/dist/client/assets/{soul-file-CRfKVJX3.js → soul-file-wKTqbR0Y.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-A6IESKWZ-fzo1sDsX.js +291 -0
- package/dist/client/assets/swimlanes-B3ENRKFQ-B7QcCUBU.js +1 -0
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CgZZnzbW.js +8 -0
- package/dist/client/assets/{table-BL3xUC41.js → table-BjHA85BX.js} +1 -1
- package/dist/client/assets/{terminal-u_UCRzSM.js → terminal-qfxxVZaa.js} +1 -1
- package/dist/client/assets/timeline-definition-JXYKGLGB-okVlmef4.js +120 -0
- package/dist/client/assets/transform-BqqRT-Iy.js +1 -0
- package/dist/client/assets/{trust-posture-B-v4BWo7.js → trust-posture-BmW0KVP6.js} +1 -1
- package/dist/client/assets/{unplug-CFbC-L5W.js → unplug-BYKBdSMl.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-ZUqscVFM.js → unverified-catalog-notice-CQHA4Cst.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-Z4MDWZAZ.js → use-adapter-catalog-rB4qQQ5D.js} +1 -1
- package/dist/client/assets/{use-bindings-CsTavmf-.js → use-bindings-DiFC7kWg.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-BY2dTvep.js → use-composer-prefs-DHY5vJ0l.js} +1 -1
- package/dist/client/assets/{use-connector-management-L9l21yTi.js → use-connector-management-CoinXIID.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-Bn2ZUtDY.js → use-deep-link-scroll-Cm8BRFAE.js} +1 -1
- package/dist/client/assets/{use-delete-binding-DLvdHtPD.js → use-delete-binding-FtM6qPfF.js} +1 -1
- package/dist/client/assets/{use-dev-links-DFvL8mIg.js → use-dev-links-TQFCV3vk.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-Be57G4tz.js → use-external-adapter-catalog-Lx8LZDAa.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-Cp3lYXdi.js → use-full-activity-feed-CmcBAvUM.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-BB9kHnYm.js +1 -0
- package/dist/client/assets/use-is-hub-ab4UGRdN.js +1 -0
- package/dist/client/assets/{use-jump-back-in-ChH1FSEK.js → use-jump-back-in-V8G_6fYj.js} +3 -3
- package/dist/client/assets/{use-local-browser-zA8gMhcC.js → use-local-browser-CbS4typW.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-CvoD-L1G.js → use-mesh-topology-DZ1qMT3J.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-Ch0wqQry.js → use-mounted-ref-DUbNzP-m.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-DeR05zhp.js → use-notification-prefs-BAsICJ96.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-DdjrmaoK.js → use-panel-tab-placements-ymrpuL_s.js} +1 -1
- package/dist/client/assets/use-pending-read-BkCvAuX4.js +1 -0
- package/dist/client/assets/{use-personality-commit-qQfISO2-.js → use-personality-commit-rJOmDgC2.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CwGoE7b-.js → use-promo-activation-BKeBloMI.js} +2 -2
- package/dist/client/assets/{use-promo-dismissals-BBqVN4hx.js → use-promo-dismissals-Cio8QMjL.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-BKW7tjvX.js → use-pulse-freshness-DZkMVbSM.js} +1 -1
- package/dist/client/assets/{use-relay-config-D5iieBXl.js → use-relay-config-CbZQKFhZ.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-BwZh2ZPH.js → use-room-follow-claim-DbJIsuWz.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-Ct7yDAUE.js → use-roving-tab-list-B4nZ7trj.js} +1 -1
- package/dist/client/assets/use-session-canvas-sAwc2L1A.js +25 -0
- package/dist/client/assets/{use-session-diagnostics-Dn-Wnyhh.js → use-session-diagnostics-0gcI762B.js} +2 -2
- package/dist/client/assets/{use-unclaimed-chats-M-c5tjXH.js → use-unclaimed-chats-BWIqOrvs.js} +1 -1
- package/dist/client/assets/use-update-config-DTL7WyZV.js +1 -0
- package/dist/client/assets/{useMutationState-Cd-VqRAv.js → useMutationState-C9Q5lRej.js} +1 -1
- package/dist/client/assets/usecaseDiagram-WPOLBNNX-CMjVaeX9.js +370 -0
- package/dist/client/assets/value-wA6veExk.js +1 -0
- package/dist/client/assets/vennDiagram-Q3Y3IDCW-BajZBf0H.js +34 -0
- package/dist/client/assets/wardleyDiagram-IVAIDKWA-BN4xF6JT.js +78 -0
- package/dist/client/assets/xychartDiagram-4URNHDU4-Cy0Z9a28.js +7 -0
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +31467 -29078
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/BlintzCanvas-ClOKWzws.js +0 -1141
- package/dist/client/assets/CanvasFileContent-B_8zsIas.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-UokbHY9i.js +0 -2
- package/dist/client/assets/HandlePage-BdRWgke2.js +0 -1
- package/dist/client/assets/NamePage-DyH8JAqT.js +0 -1
- package/dist/client/assets/PhotoPage-BHvRQnex.js +0 -1
- package/dist/client/assets/RoomSurface-DaRCf4og.js +0 -44
- package/dist/client/assets/TopologyGraph-D3CxaLGX.js +0 -30
- package/dist/client/assets/_shell-BRH2Y-U-.js +0 -80
- package/dist/client/assets/_shell.channels-CRkJHU5R.js +0 -10
- package/dist/client/assets/_shell.marketplace-DGN_IdZY.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-2YMpLInp.js +0 -1
- package/dist/client/assets/_shell.session-D871zZl3.js +0 -61
- package/dist/client/assets/_shell.x._extensionId-D3-n5IRW.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-D3-n5IRW.js +0 -1
- package/dist/client/assets/index-Cdyszxoa.js +0 -17
- package/dist/client/assets/index-DCOOlbEt.js +0 -1
- package/dist/client/assets/index-DHYvT3nr.js +0 -23
- package/dist/client/assets/index-Dain_3cO.js +0 -1
- package/dist/client/assets/index-_5Dn0bFm.js +0 -74
- package/dist/client/assets/registry-Ce1VRIS3.js +0 -1
- package/dist/client/assets/use-is-below-desktop-DmekpHAF.js +0 -1
- package/dist/client/assets/use-is-hub-el7LTkg3.js +0 -1
- package/dist/client/assets/use-pending-read-DBpte0GI.js +0 -1
- package/dist/client/assets/use-session-canvas-CJrfZrYG.js +0 -24
- package/dist/client/assets/use-update-config-DhlbZldm.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-rYOrBAZc.js","assets/index-Dc5cpBoO.js","assets/index-CrflCTqO.css","assets/index-CBm3whA-.js","assets/index-BUOcbPfv.js","assets/BlintzCanvas-ClOKWzws.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as n,aW as z,gB as re,j as t,B as S,a3 as ne,G as se,J as ae,go as ie,gC as ce,aX as $,a1 as ue,gD as oe,a2 as le}from"./index-Dc5cpBoO.js";import{u as de,a as fe}from"./use-session-canvas-CJrfZrYG.js";import{R as he}from"./rotate-cw-C68kM23F.js";import"./index.esm-DXsF3Bua.js";import"./WidgetErrorCard-CzWw_SPD.js";import"./index-Ch-ON5gw.js";import"./card-Bt6IU-Bh.js";import"./progress-CErAw8zp.js";import"./markdown-content-DPc7aD1j.js";import"./table-BL3xUC41.js";import"./terminal-u_UCRzSM.js";import"./package-BSwwAFVm.js";import"./heart-Du7nuefC.js";import"./git-branch-BObm8Rlz.js";import"./file-text-BAhi2zct.js";import"./file-VHDTQub2.js";import"./McpAppFrame-CuObpQTg.js";import"./more-details-DEeu2M-p.js";function B(e,i){return["canvas-file",e,i]}function ve({documentId:e,sourcePath:i,binding:j,save:o,draftRef:x,revisionRef:r,finishAttemptRef:C,timerRef:g,finalSaveRef:b,invalidateConfirmedFile:d}){const m=n.useRef({binding:j,save:o,invalidateConfirmedFile:d}),F=n.useRef(null),l=n.useRef(null);return n.useLayoutEffect(()=>{m.current={binding:j,save:o,invalidateConfirmedFile:d}}),n.useLayoutEffect(()=>{const k=z.getState().openDocuments.find(f=>f.id===e);if(!k||typeof k.openedAt!="number")return;const w=re(e,k.openedAt,i,{required:()=>!!m.current.binding,current:()=>{const f=l.current;return!!f&&f.revision===r.current&&f.attempt===C.current&&f.binding===m.current.binding&&f.save===m.current.save&&f.binding.current()},invalidateConfirmedFile:()=>m.current.invalidateConfirmedFile(),prepare:async()=>{var a;l.current=null;const{binding:f,save:_}=m.current;if(!(f!=null&&f.current()))return!1;g.current&&(clearTimeout(g.current),g.current=null);const N=x.current,y=r.current,u=++C.current,s=await _(N);return s.status!=="changed"&&s.status!=="no_op"||s.confirmed.content!==N||r.current!==y||C.current!==u||m.current.binding!==f||m.current.save!==_||!f.current()?!1:((a=b.current)==null||a.cancel(),b.current=null,l.current={revision:y,attempt:u,binding:f,save:_},!0)}});return F.current=w,()=>w.retire()},[e,i,x,r,C,g,b]),F}function pe(e,i,j){var u;const o=n.useRef(e),x=n.useRef(null),r=n.useRef(null),[C,g]=n.useState({identity:e.identity,phase:"pending",busy:!1});n.useLayoutEffect(()=>{o.current=e},[e]);const b=n.useCallback((s,a)=>{x.current===s&&o.current.identity===s&&o.current.current()&&g(h=>({identity:s,...a,historical:a.historical??(h.identity===s?h.historical:void 0)}))},[]),d=n.useCallback(s=>{x.current!==s||o.current.identity!==s||g(a=>a.identity===s?{...a,phase:"unavailable",busy:!1}:{identity:s,phase:"unavailable",busy:!1})},[]),m=e.identity,F=e.supported;n.useLayoutEffect(()=>{const s=o.current;r.current=null,x.current=m;let a=!1;return F&&i==="ready"&&s.discover().then(h=>{a||(h.status==="observed"?b(m,{phase:"ready",discovery:h.value,busy:!1}):h.status!=="idle"?b(m,{phase:"unavailable",busy:!1}):d(m))}),()=>{a=!0,r.current=null,x.current===m&&(x.current=null)}},[m,F,i,j,b,d]);const l=C.identity===e.identity?C:void 0,k=n.useCallback(async()=>{const s=o.current,a=s.identity;if(x.current!==a||!s.current())return;r.current=null,g(c=>({identity:a,phase:"pending",busy:!0,historical:c.identity===a?c.historical:void 0}));const h=await s.discover(!0);h.status==="observed"?b(a,{phase:"ready",discovery:h.value,busy:!1}):h.status!=="idle"?b(a,{phase:"unavailable",busy:!1}):d(a)},[b,d]),w=n.useCallback(async s=>{const a=o.current,h=a.identity;if(x.current!==h||!a.current())return;r.current=null,g(p=>({identity:h,phase:"pending",busy:!0,discovery:p.identity===h?p.discovery:void 0,historical:p.identity===h?p.historical:void 0}));const c=await a.recover(s);c.status==="observed"?b(h,{phase:"ready",discovery:c.value.discovery,historical:c.value.result.entry,busy:!1}):c.status!=="idle"?b(h,{phase:c.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}):d(h)},[b,d]),f=n.useCallback(async()=>{const s=o.current,a=s.identity;if(x.current!==a||!s.current())return{status:"idle"};const h={};r.current=h,g(p=>p.identity===a?{...p,phase:"pending",busy:!0}:p);const c=await s.inspectCurrent();return r.current!==h?{status:"idle"}:(r.current=null,c.status==="idle"&&d(a),x.current===a&&o.current.identity===a&&s.current()&&c.status!=="idle"&&g(p=>p.identity===a?{...p,phase:c.status==="observed"?"ready":c.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}:p),c)},[d]),_=e.supported&&i==="ready",N=i==="pending"?"pending":(l==null?void 0:l.phase)??"pending",y=_&&(N!=="ready"||((u=l==null?void 0:l.discovery)==null?void 0:u.admission)==="blocked");return{supported:_,phase:N,editBlocked:y,busy:(l==null?void 0:l.busy)??N==="pending",discovery:l==null?void 0:l.discovery,historical:l==null?void 0:l.historical,refresh:k,recover:w,inspectCurrent:f}}function me({recovery:e,editing:i,loadCurrent:j}){var o,x;return e.supported?t.jsxs("section",{"aria-label":"Previous file saves",className:"mx-2 mt-2 rounded border p-2 text-sm",children:[e.phase==="pending"&&t.jsx("p",{role:"status",children:"Checking previous saves…"}),e.phase==="unavailable"&&t.jsx("p",{role:"alert",children:"Previous save evidence is unavailable. New saves stay blocked until it can be checked."}),e.phase==="local_uncertain"&&t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."}),((o=e.discovery)==null?void 0:o.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),e.discovery&&t.jsxs(t.Fragment,{children:[!e.discovery.entries.length&&t.jsx("p",{children:"No matching recent saves."}),e.discovery.hasMore&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),t.jsx("ul",{children:e.discovery.entries.map(r=>t.jsxs("li",{children:[t.jsxs("span",{children:[r.eventId,":"," ",r.state==="receipt"?"Historical save recorded":r.state==="review"?"Original save needs review":r.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),r.state==="review"&&(r.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(S,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.recover(r.eventId),children:"Recover original receipt"})]}))]},r.eventId))})]}),((x=e.historical)==null?void 0:x.state)==="receipt"&&t.jsxs("div",{role:"status",children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(S,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(S,{type:"button",size:"sm",variant:"ghost",disabled:i||e.editBlocked||e.busy,onClick:j,children:"Load current file"})]}),t.jsx("p",{children:"These controls don’t resend drafts or confirm agent delivery. Use Load current file."})]}):null}const ye=n.lazy(()=>$(()=>import("./CodeMirrorEditor-rYOrBAZc.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),xe=n.lazy(()=>$(()=>import("./BlintzCanvas-ClOKWzws.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),be=500;function ge(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function je(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function G({content:e,documentId:i,cwd:j,loaded:o,theme:x,isEditing:r,onEditingChange:C,setDocumentEditing:g,observedBinding:b,fileSaveObservation:d="unavailable",recoveryBinding:m}){const F=e.readOnly!==!0,l=ge(e.sourcePath,e.language),k=ne(),[w,f]=n.useState(o),[_,N]=n.useState(),y=n.useRef(b);n.useLayoutEffect(()=>{y.current=b},[b]);const u=de({documentId:i,sourcePath:e.sourcePath,cwd:j,loadedContent:o,documentSaveBinding:_,documentRecoveryBinding:m}),s=pe(u.recovery,d,m),a=n.useRef(!1),h=n.useRef(r);n.useLayoutEffect(()=>(a.current=!0,h.current=r,()=>{a.current=!1}),[r]);const c=n.useRef(null),p=n.useRef(w),L=n.useRef(0),O=n.useRef(0),E=n.useRef(u.save),I=n.useRef(u.prepareFinalSave),Q=n.useRef(u.waitForCloseDrain),D=n.useRef(null),U=n.useRef(C),H=ve({documentId:i,sourcePath:e.sourcePath,binding:_,save:u.save,draftRef:p,revisionRef:L,finishAttemptRef:O,timerRef:c,finalSaveRef:D,invalidateConfirmedFile:()=>{k.invalidateQueries({queryKey:B(j,e.sourcePath)}).catch(()=>{})}});n.useEffect(()=>{p.current=w,E.current=u.save,I.current=u.prepareFinalSave,Q.current=u.waitForCloseDrain,U.current=C});const K=n.useCallback(v=>{var R;L.current+=1,p.current=v,f(v),(R=D.current)==null||R.cancel(),D.current=I.current(v),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,E.current(p.current)},be)},[]),J=()=>{var P;if(s.editBlocked||d==="pending"||d==="ready"&&!((P=y.current)!=null&&P.current()))return;const v=y.current,R=v&&Object.freeze({...v.incarnation});N(v!=null&&v.current()&&R?{incarnation:R,current:()=>{const T=y.current;return!!T&&ce(R,T.incarnation)&&T.current()}}:void 0),L.current+=1,p.current=o,f(o),C(!0),g(i,!0)},W=async()=>{c.current&&(clearTimeout(c.current),c.current=null);const v=p.current,R=L.current,P=++O.current,T=await E.current(v);if(T.status!=="changed"&&T.status!=="no_op"||L.current!==R||O.current!==P||T.confirmed.content!==v)return;const A=T.confirmed;A.content===p.current&&k.setQueryData(B(j,e.sourcePath),M=>M&&{...M,content:A.content,hash:A.hash}),C(!1),g(i,!1)},X=()=>{k.invalidateQueries({queryKey:B(j,e.sourcePath)})};n.useEffect(()=>{var v;r||(c.current&&clearTimeout(c.current),c.current=null,(v=D.current)==null||v.cancel(),D.current=null)},[r]),n.useEffect(()=>{const v=H.current;return()=>{var T;c.current&&(clearTimeout(c.current),c.current=null);const R=(T=D.current)==null?void 0:T.flush(),P=p.current;v==null||v.settleRetirement(Promise.resolve(R).then(()=>Q.current(P))),D.current=null,g(i,!1),U.current(!1)}},[i,g,H]);const Z=async()=>{if(r||!a.current||s.editBlocked)return;const v=L.current,R=await s.inspectCurrent();R.status!=="observed"||!a.current||h.current||L.current!==v||!u.recovery.current()||k.setQueryData(B(j,e.sourcePath),P=>P&&{...P,...R.value})},ee=()=>{const v=u.adoptDisk();v!=null&&f(v)},te=()=>{u.overwrite(p.current)},V=u.status==="saved"?u.confirmedContent!==w?"Unsaved changes":u.documentReceipt?"Save recorded":"Saved to file":je(u.status),Y=r?w:o;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[F&&V&&t.jsx("span",{className:se("mt-3 text-xs",u.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:V}),!r&&d==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!r&&t.jsx(S,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:X,"aria-label":"Refresh from disk",children:t.jsx(he,{className:"size-4"})}),F&&t.jsx(S,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:r?()=>void W():J,"aria-label":r?"Finish editing":"Edit file",disabled:!r&&(d==="pending"||s.editBlocked),"data-document-save-observation":d,children:r?t.jsx(ae,{className:"size-4"}):t.jsx(ie,{className:"size-4"})})]}),t.jsx(me,{recovery:s,editing:r,loadCurrent:()=>void Z()}),u.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:()=>void u.retryUnconfirmed(),children:"Retry original save"})]}),u.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(S,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ee,children:"Reload"}),t.jsx(S,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:te,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:l?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(xe,{value:Y,editable:r,onChange:r?K:void 0})}):t.jsx(ye,{value:Y,editable:r,filename:e.sourcePath,languageHint:e.language,theme:x,onChange:r?K:void 0})})})]})}function Ce(e){const{fileSaveBinding:i,fileSaveObservation:j}=fe(e.documentId);return t.jsx(G,{...e,observedBinding:i,recoveryBinding:i,fileSaveObservation:j})}function Re(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function Qe({content:e,documentId:i}){const j=ue(),o=z(y=>y.selectedCwd),x=z(y=>y.setDocumentEditing),r=z(y=>{var u;return((u=y.openDocuments.find(s=>s.id===i))==null?void 0:u.editing)??!1}),C=oe(),g=z(y=>y.canvasSessionId),b=z(y=>y.roomCanvasLiveRoomId),{data:d,error:m,isLoading:F}=le({queryKey:B(o,e.sourcePath),enabled:o!==null,queryFn:()=>j.readFileContent(o,e.sourcePath),staleTime:3e4,retry:!1}),[l,k]=n.useState(null),w=y=>{k(y&&d?{pinnedHash:d.hash}:null)};if(o===null)return t.jsx(q,{children:"Open a chat to view files."});if(F)return t.jsx(q,{children:"Loading file…"});if(m||!d)return t.jsx(q,{children:Re(m)});const f=l!==null&&r,_=(f?l==null?void 0:l.pinnedHash:null)??d.hash,N=g&&!b?Ce:G;return t.jsx(N,{content:e,documentId:i,cwd:o,loaded:d.content,theme:C,isEditing:f,onEditingChange:w,setDocumentEditing:x},`${e.sourcePath}:${_}`)}function q({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{Qe as CanvasFileContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-DRVqxazk.js","assets/index-Dc5cpBoO.js","assets/index-CrflCTqO.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a1 as m,aW as n,r as s,j as t,aX as p}from"./index-Dc5cpBoO.js";import{r as u}from"./use-session-canvas-CJrfZrYG.js";import"./rotate-cw-C68kM23F.js";import"./index.esm-DXsF3Bua.js";import"./WidgetErrorCard-CzWw_SPD.js";import"./index-Ch-ON5gw.js";import"./card-Bt6IU-Bh.js";import"./progress-CErAw8zp.js";import"./markdown-content-DPc7aD1j.js";import"./table-BL3xUC41.js";import"./terminal-u_UCRzSM.js";import"./package-BSwwAFVm.js";import"./heart-Du7nuefC.js";import"./git-branch-BObm8Rlz.js";import"./file-text-BAhi2zct.js";import"./file-VHDTQub2.js";import"./McpAppFrame-CuObpQTg.js";import"./more-details-DEeu2M-p.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-DRVqxazk.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var o;const r=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function A({content:e}){const r=m(),o=n(i=>i.selectedCwd),l=s.useMemo(()=>u(e.src,i=>r.mediaUrl(o??"",i)),[e.src,r,o]),a=s.useMemo(()=>f(e.src),[e.src]);return l.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(d,{url:l.url,format:a,label:e.title??"Canvas 3D model"})})})}export{A as CanvasModel3dContent,f as formatOf};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Dc5cpBoO.js";import{a as t}from"./ProfileFields-DFRnRR38.js";import"./profile-errors-JW2XTgia.js";import"./use-mounted-ref-Ch0wqQry.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Dc5cpBoO.js";import{P as m}from"./ProfileFields-DFRnRR38.js";import"./profile-errors-JW2XTgia.js";import"./use-mounted-ref-Ch0wqQry.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-Dc5cpBoO.js";import{b as t}from"./ProfileFields-DFRnRR38.js";import"./profile-errors-JW2XTgia.js";import"./use-mounted-ref-Ch0wqQry.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cdyszxoa.js","assets/index-Dc5cpBoO.js","assets/index-CrflCTqO.css","assets/room-files-source-BilZvdpf.js","assets/markdown-content-DPc7aD1j.js","assets/file-exclamation-point-DbWvGys0.js","assets/composer-insert-BpyATrmR.js","assets/index-4GC2fkeO.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-C68kM23F.js","assets/link-2-Csc6okl3.js","assets/file-VHDTQub2.js","assets/git-branch-BObm8Rlz.js","assets/more-details-DEeu2M-p.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{W as ee,r as a,mF as Gt,j as i,g as Vt,ia as Qt,G as Q,a1 as te,a2 as Yt,bk as K,a3 as ye,lL as Ke,aW as ne,mG as oe,mH as Jt,mI as Xt,aK as Zt,mJ as re,mK as en,mL as tn,a4 as le,mM as nn,mN as ke,mO as Ge,mP as sn,mQ as on,mR as rn,lv as an,mS as ln,lx as cn,mT as dn,dz as un,g7 as mn,mC as fn,mU as pn,a0 as hn,bw as gn,mV as xn,mW as yn,iP as bn,hD as vn,ip as Y,kn as Ve,mX as lt,bK as Rn,km as ue,kr as ct,mY as kn,ks as dt,ai as wn,bO as ut,hy as mt,B as _e,x as Sn,mZ as Nn,c4 as Ee,m_ as In,s as fe,eo as Cn,jM as ft,m$ as pt,aX as jn,e as ae,n0 as be,h9 as ht,kq as gt,n1 as An,n2 as Mn,n as Tn,q as Ie,kp as _n,n3 as xt,eM as se,a7 as yt,fl as En,n4 as On,n5 as Pn,n6 as Dn,n7 as Ln,l as bt,ar as Oe,ka as $n,aj as Fn,n8 as Bn,n9 as qn,na as Hn,b6 as zn,bW as Un,nb as Wn,nc as Kn,nd as Gn,ne as Vn,bx as Ce,dH as Qn,kg as Yn,kl as Jn,ke as Xn,nf as Zn,ng as es,nh as ts,ni as ns,eL as ss,kh as os,nj as rs,nk as as,nl as is,dM as ls,X as cs,nm as ds,nn as Qe,no as us,ad as ms,np as fs,io as ps,nq as hs,nr as gs,aH as Ye}from"./index-Dc5cpBoO.js";import{R as xs,A as ys,u as bs,P as vs,a as Rs}from"./use-jump-back-in-ChH1FSEK.js";import{m as je,a as Je,f as Pe,b as De,d as vt,e as Rt,g as kt,E as ks,h as ws,i as Ss,M as V,F as Ns,D as Is,U as Cs,C as X,u as js,j as As,k as Ms}from"./index-DHYvT3nr.js";import{a as Ts}from"./use-room-follow-claim-BwZh2ZPH.js";import"./WidgetErrorCard-CzWw_SPD.js";import{M as _s}from"./markdown-content-DPc7aD1j.js";import{W as Es,a as Os}from"./find-latest-widget-fence-Z0HPVqeK.js";import{f as Ps}from"./format-duration-BCr6uzby.js";import{H as Ds,a as Ls,b as $s}from"./RuntimeSetupDialog-DvBJbrmj.js";import{M as Xe}from"./mention-pill-8P_w4muj.js";import{R as Fs}from"./rotate-ccw-clock-D_SO1stN.js";import{U as Bs}from"./unplug-CFbC-L5W.js";import{M as qs}from"./message-square-off-D5DXu2cY.js";import{i as Hs}from"./registry-Ce1VRIS3.js";import{f as zs}from"./use-connector-management-L9l21yTi.js";import{A as Us}from"./AgentRequestCard-xX6fAKgO.js";/**
|
|
3
|
-
* @license lucide-react v1.48.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const wt={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};wt.node;const Ws=ee(wt);/**
|
|
8
|
-
* @license lucide-react v1.48.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const St={name:"link-2-off",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]};St.node;const Ks=ee(St);/**
|
|
13
|
-
* @license lucide-react v1.48.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const Nt={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};Nt.node;const Gs=ee(Nt);/**
|
|
18
|
-
* @license lucide-react v1.48.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const It={name:"power-off",size:24,node:[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};It.node;const Vs=ee(It);/**
|
|
23
|
-
* @license lucide-react v1.48.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const Ct={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};Ct.node;const Qs=ee(Ct);/**
|
|
28
|
-
* @license lucide-react v1.48.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const jt={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};jt.node;const Ys=ee(jt);/**
|
|
33
|
-
* @license lucide-react v1.48.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const At={name:"user-minus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};At.node;const Ze=ee(At);/**
|
|
38
|
-
* @license lucide-react v1.48.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const Mt={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};Mt.node;const Js=ee(Mt),Xs=300;function ce({className:e,children:t}){return i.jsx("span",{className:Q("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:t})}function Tt({identity:e,children:t,onViewProfile:s,className:n}){const{kind:o,displayName:r,handle:l,color:c,emoji:h,imageUrl:p,origin:u,agent:d}=e,k=c??"hsl(var(--muted-foreground))",f=typeof u=="object"&&u!==null,g=o==="agent"&&(d==null?void 0:d.working)!=null?d.working:null,[y,x]=a.useState(!1),N=a.useRef(!1),m=a.useRef(null),b=Gt({onLongPress:()=>{N.current&&x(!0)}});return i.jsxs(Ds,{open:y,onOpenChange:x,openDelay:Xs,children:[i.jsx(Ls,{asChild:!0,ref:m,"data-gesture-priority":"",...b,onPointerDown:T=>{N.current=T.pointerType==="touch"||T.pointerType==="pen",b.onPointerDown(T)},children:t}),i.jsxs($s,{"data-slot":"identity-hover-card",align:"start",className:Q("flex w-64 flex-col gap-0 overflow-hidden p-0",n),children:[i.jsxs("div",{className:"flex items-center gap-3 p-3",children:[i.jsx(Vt,{"aria-hidden":!0,color:k,emoji:h,imageUrl:p,fallback:Qt(r),kind:o,origin:u,status:g?"working":"idle",size:"md"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:r}),l&&i.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",l]})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[o==="agent"&&((d==null?void 0:d.runtime)||(d==null?void 0:d.model))&&i.jsx(ce,{children:[d.runtime,d.model].filter(Boolean).join(" · ")}),g&&i.jsxs(ce,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Ps(g.forMs)]}),o==="human"&&i.jsx(ce,{children:f?u.platform:"On this machine"}),o==="agent"&&(d==null?void 0:d.managedBy)&&i.jsxs(ce,{children:["Managed by"," ",d.managedBy.handle?`@${d.managedBy.handle}`:d.managedBy.displayName]})]}),s?i.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var T;(T=m.current)==null||T.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):i.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[i.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),i.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function _t(e,t={}){const s=te();return Yt({queryKey:K.sessions(e??""),queryFn:()=>s.listRoomSessions(e),enabled:e!==null&&t.enabled===!0})}function Zs(e,t){const s=e??[];return s.some(n=>n.seq===t.seq)?s:s.length===0||s[s.length-1].seq<t.seq?[...s,t]:[...s,t].sort((n,o)=>n.seq-o.seq)}function eo(e,t){const s=e??[],n=s.findIndex(c=>c.id===t.id);if(n===-1)return s;const o=s[n];if(o.seq!==t.seq||o.roomId!==t.roomId||JSON.stringify(o.body)===JSON.stringify(t.body)&&JSON.stringify(o.mentions)===JSON.stringify(t.mentions)&&JSON.stringify(o.mentionSpans)===JSON.stringify(t.mentionSpans))return s;const l=[...s];return l[n]={...o,body:t.body,mentions:t.mentions,mentionSpans:t.mentionSpans},l}function to(e,t){if(t.kind!=="notice"||t.body.notice!=="turn_failed")return;const s=t.body.subjectAuthorId;s!==void 0&&re.getState().clearAuthor(e,s)}function no(e,t){const s=e.getQueryData(K.entries(t));return s&&s.length>0?s[s.length-1].seq:0}function so(e,t){var s;return((s=e.getQueryData(K.detail(t)))==null?void 0:s.viewerAuthorId)??null}const oo=2e3;function ro(){const e=a.useRef(null),t=a.useCallback(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),s=a.useCallback(o=>{t(),ne.getState().endRoomCanvasCycle(o)},[t]),n=a.useCallback(o=>{t(),e.current=setTimeout(()=>{e.current=null,ne.getState().endRoomCanvasCycle(o)},oo)},[t]);return a.useEffect(()=>t,[t]),{arm:n,now:s}}function ao(e){const t=Math.min(oe.BACKOFF_CAP_MS,oe.BACKOFF_BASE_MS*2**e);return Math.random()*t}const io=50;function lo(e,t){return new Promise(s=>{if(t.aborted)return s();const n=()=>{clearTimeout(o),t.removeEventListener("abort",n),s()},o=setTimeout(n,e);t.addEventListener("abort",n,{once:!0})})}function co(e,t){const s=te(),n=ye(),[o,r]=a.useState(null),[l,c]=a.useState(null),[h,p]=a.useState(0),u=a.useRef(!1),d=ro(),k=a.useCallback(()=>p(y=>y+1),[]),f=a.useRef(null),g=a.useCallback(()=>{f.current===null&&(f.current=setTimeout(()=>{f.current=null,p(y=>y+1)},io))},[]);return a.useEffect(()=>{if(e===null)return;const y=()=>g();let x=null;const N=()=>{if(document.visibilityState!=="visible"){x=Date.now();return}const T=x===null?0:Date.now()-x;x=null,(u.current||T>=oe.VISIBILITY_GRACE_MS)&&g()};let m=Ke.getListConnectionState();const b=Ke.subscribeListConnectionState(T=>{const _=T==="connected"&&m==="reconnecting";m=T,_&&g()});return window.addEventListener("online",y),document.addEventListener("visibilitychange",N),()=>{window.removeEventListener("online",y),document.removeEventListener("visibilitychange",N),b(),f.current!==null&&(clearTimeout(f.current),f.current=null)}},[e,g]),a.useEffect(()=>(ne.getState().setRoomCanvasLiveRoom(e),()=>ne.getState().setRoomCanvasLiveRoom(null)),[e]),a.useEffect(()=>{if(e===null||!t)return;const y=new AbortController;let x=!0,N;return(async()=>{r(null),c(null),u.current=!1;let m=0,b=!1;const T=()=>{m=0,u.current=!1,b&&(b=!1,r(_=>_===e?null:_))};for(;x&&!y.signal.aborted;){const _=Date.now();u.current=!1,ne.getState().beginRoomCanvasCycle(e),d.arm(e);const D=setTimeout(T,oe.STABILITY_WINDOW_MS);let C;try{if(C=Jt(s,e,no(n,e),y.signal),N=C,!x||y.signal.aborted){C.retire();return}for await(const S of C.stream){if(!x||y.signal.aborted||(T(),!C.current()))return;if(S.type==="canvas_event"||S.type==="canvas_channel_snapshot"){if(C.publish(S),!C.current())return;continue}if(S.type==="signal"){Xt(S)?Zt.getState().observe(e,S):(re.getState().observe(e,S),ne.getState().applyRoomCanvasPresence(e,S));continue}if(S.type==="reaction"){n.setQueryData(K.entries(e),O=>je(O,S.entryId,S.reactions));continue}if(S.type==="revision"){if(S.entry.roomId!==e)continue;n.setQueryData(K.entries(e),O=>eo(O,S.entry));continue}if(S.type==="canvas"){ne.getState().applyRoomCanvasFrame(e,S,so(n,e)),S.change!==void 0?d.now(e):d.arm(e);continue}re.getState().clearAuthor(e,S.entry.authorId),to(e,S.entry),en.getState().settle(e,S.entry.id),n.setQueryData(K.entries(e),O=>Zs(O,S.entry))}}catch(S){if(y.signal.aborted)return;if(console.warn("[rooms] live stream dropped",{roomId:e,err:S}),tn(S)){re.getState().clearRoom(e),c(e),r(e),clearTimeout(D);return}}finally{try{C==null||C.retire()}finally{clearTimeout(D)}}if(y.signal.aborted)return;Date.now()-_>=oe.STABILITY_WINDOW_MS&&(m=0),m+=1,u.current=!0,m>=oe.DISCONNECTED_THRESHOLD&&!b&&(re.getState().clearRoom(e),r(e),b=!0),await lo(ao(m),y.signal)}})(),()=>{x=!1;try{N==null||N.retire()}finally{y.abort()}}},[e,t,s,n,h]),{stalled:o!==null&&o===e,unavailable:l!==null&&l===e,retry:k}}function uo(){const e=te();return le({mutationFn:({roomId:t,authorId:s})=>e.haltRoomAgent(t,s),meta:{errorLabel:"Couldn’t stop this agent"}})}function mo(){const e=te();return le({mutationFn:({roomId:t,authorId:s})=>e.promoteHold(t,s),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function fo(){const e=te(),t=ye();return le({onMutate:({roomId:s,entryId:n,emoji:o,viewerAuthorId:r})=>{var u;const l=t.getQueryData(K.entries(s)),c=(u=l==null?void 0:l.find(d=>d.id===n))==null?void 0:u.reactions,{reactions:h,on:p}=Je(c,o,r);return t.setQueryData(K.entries(s),d=>je(d,n,h)),{on:p}},mutationFn:({roomId:s,entryId:n,emoji:o,viewerAuthorId:r})=>{var h,p;const l=t.getQueryData(K.entries(s)),c=((p=(h=l==null?void 0:l.find(u=>u.id===n))==null?void 0:h.reactions)==null?void 0:p.some(u=>u.emoji===o&&u.authorIds.includes(r)))??!1;return e.toggleReaction(s,n,{emoji:o,on:c})},onError:(s,{roomId:n,entryId:o,emoji:r,viewerAuthorId:l},c)=>{c!==void 0&&t.setQueryData(K.entries(n),h=>{var d;const p=(d=h==null?void 0:h.find(k=>k.id===o))==null?void 0:d.reactions,{reactions:u}=Je(p,r,l,!c.on);return je(h,o,u)})},onSuccess:({frequents:s},{roomId:n})=>{t.setQueryData(K.detail(n),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function Z(e){return e.threadRootEntryId??e.parentEntryId}function Et(e){return Z(e)??e.id}function Le(e,t){return Math.max(t??0,e)}function po(e,t,s){let n=e[0],o=0;for(const r of e)r.seq>n.seq&&(n=r),t!==null&&r.seq>t&&(o+=1);return{count:Le(e.length,s),lastAt:n.createdAt,unread:o}}function ho(e){const t=te(),s=ye(),n=nn(e),o=ke(u=>{var d;return e===null?null:((d=u.paging[e])==null?void 0:d.cursor)??null}),r=le({mutationFn:async u=>{var x;const d=(x=ke.getState().paging[u])==null?void 0:x.cursor;if(d==null)return;const k=await t.listRoomEntries(u,{before:d,limit:Ge}),f=K.entries(u),g=s.getQueryData(f),y=sn(g,k);s.setQueryData(f,y),ke.getState().notePage(u,on(k)??d,rn(k,Ge)||y.length===((g==null?void 0:g.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:l,isPending:c}=r,h=a.useRef(!1),p=a.useCallback(async()=>{if(!(e===null||h.current)){h.current=!0;try{await l(e).catch(()=>{})}finally{h.current=!1}}},[e,l]);return{canLoadOlder:n,isLoadingOlder:c,cursor:o,loadOlder:p}}function go(e){return i.jsx(Os,{code:e.code,isIncomplete:e.isIncomplete})}const xo=[{language:Es,component:go}],yo={turn_failed:{Icon:hn,tone:"text-status-warning"},agent_busy:{Icon:pn},agent_gone:{Icon:Js,tone:"text-status-warning"},agent_left:{Icon:Ze,tone:"text-status-warning"},room_archived:{Icon:fn},runtime_gone:{Icon:Vs,tone:"text-status-warning"},agent_paused:{Icon:mn},agent_declined:{Icon:qs},agent_unavailable:{Icon:un},awaiting_approval:{Icon:Ws,tone:"text-status-warning"},halted:{Icon:dn},budget_reached:{Icon:cn},cascade_stopped:{Icon:ln},addressing_changed:{Icon:Gs},bridge_blocked:{Icon:Bs,tone:"text-status-warning"},bridge_undelivered:{Icon:an,tone:"text-status-warning"},bridge_rate_limited:{Icon:Ys},bridge_second_agent_refused:{Icon:Ze},bridge_disconnected:{Icon:Ks},bridge_agent_swapped:{Icon:xs},bridge_history_note:{Icon:Fs}},bo={Icon:gn},we=80;function vo(e){const t=e.trim();if(t.length<=we)return t;const s=t.slice(0,we),n=s.lastIndexOf(" ");return`${(n>we/2?s.slice(0,n):s).trimEnd()}…`}function Ro(e,t,s){const n=ko(e,s),o=r=>i.jsx("a",{href:t.href,onClick:t.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-2",children:r});return n===null?i.jsxs(i.Fragment,{children:[e," ",o("Open chat")]}):i.jsxs(i.Fragment,{children:[e.slice(0,n.index),o(n.words),e.slice(n.index+n.words.length)]})}function ko(e,t){if(t!==void 0){const n=xn(t),o=e.lastIndexOf(n);if(o!==-1)return{index:o,words:n}}const s=yn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function wo({entry:e,feedPosition:t,rowId:s,sessionLink:n,subjectName:o}){const{Icon:r,tone:l}=(e.body.notice&&yo[e.body.notice])??bo;return i.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...t&&{role:"article","aria-label":vo(e.body.text)},...Pe(t),className:Q("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",l??"text-muted-foreground"),children:[i.jsx(r,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),i.jsx("span",{children:n?Ro(e.body.text,n,o):e.body.text})]})}const So=Hs.moment;function No({entry:e,moment:t,subject:s,subjectIdentity:n,feedPosition:o,rowId:r}){const l=De(e.createdAt);return i.jsx("div",{id:r,"data-slot":"moment-row","data-testid":"room-moment","data-moment":t.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...Pe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:i.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[i.jsx(Tt,{identity:{kind:s.kind,displayName:s.displayName,handle:n==null?void 0:n.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:n==null?void 0:n.origin,agent:n==null?void 0:n.agent},children:i.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[i.jsx(vt,{author:s}),i.jsx("span",{className:"sr-only",children:s.displayName})]})}),i.jsx(So,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),i.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),l.length>0&&i.jsx("time",{dateTime:e.createdAt,title:Rt(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:l})]})})}function Io({id:e,summary:t,open:s,onOpen:n}){const{capabilities:o}=kt(),{count:r,lastAt:l,unread:c}=t,h=De(l),[p,u]=a.useState({count:r,bumped:!1});p.count!==r&&u({count:r,bumped:!0});const d=p.count===r&&p.bumped;return o.threads?i.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":c>0?"":void 0,"aria-expanded":s,onClick:n,className:Q("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",c>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[i.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),i.jsx("span",{className:Q(d&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:r},r),r===1?" reply":" replies",h.length>0&&i.jsxs(i.Fragment,{children:[" · last ",i.jsx("time",{dateTime:l,title:Rt(l),children:h})]}),c>0&&` · ${c} new`]}):null}function Co(e,t){const s=ue.getState(),n=s.drafts[e]??"",o=n===""||n.endsWith(" ")||n.endsWith(`
|
|
43
|
-
`)?"":" ";s.set(e,`${n}${o}@${t} `)}function jo({roomId:e,entry:t,author:s,viewerAuthorId:n,onViewProfile:o}){const r=Et(t),l=t.body.text,c=(s==null?void 0:s.id)===n?void 0:(s==null?void 0:s.handle)??void 0,h=s==null?void 0:s.displayName,{copy:p}=bn({toastOnSettle:!0});return a.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Qs,run:()=>{Y.getState().openThread(e,r,!0),Ve.getState().requestFocus(lt(e,r))}},copy:{id:"copy",label:"Copy text",icon:vn,run:()=>void p(l)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:Rn,run:o}),c!==void 0&&(u.mention={id:"mention",label:h===void 0?"Mention author":`Mention ${h}`,icon:ys,run:()=>{Co(e,c),Ve.getState().requestFocus(e)}}),ks.map(d=>u[d]).filter(d=>d!==void 0)},[e,r,l,c,h,o,p])}function Ao(e){if(e.kind==="notice")return{kind:"notice"};const t=e.body.moment;return t?{kind:"moment",moment:t}:{kind:"message"}}function $e(e,t=[]){return new Map([...t.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function pe(e,t){const s=e.body.subjectAuthorId;return s===void 0||t.has(e.authorId)?e.authorId:s}function J(e,t,s){const n=t.get(e),o=ct({record:{kind:(n==null?void 0:n.kind)??"system",id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:n==null?void 0:n.emoji,color:n==null?void 0:n.color,imageUrl:n==null?void 0:n.imageUrl},override:(n==null?void 0:n.agentRef)===void 0?null:s==null?void 0:s.get(n.agentRef)});return{kind:o.kind,id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(n==null?void 0:n.origin)=="object"&&(n==null?void 0:n.origin)!==null,...(n==null?void 0:n.retired)===!0?{retired:!0}:{}}}function Mo(e){const t=new Set;for(const r of e)Z(r)===null&&t.add(r.id);const s=[],n=new Map,o=new Set;for(const r of e){const l=Z(r);if(l===null){s.push(r);continue}if(!t.has(l)){s.push(r),o.add(r.id);continue}const c=n.get(l);c?c.push(r):n.set(l,[r])}return{topLevel:s,repliesByRoot:n,orphaned:o}}function Ot(e){return`thread-${e}`}function he(e){return`thread-row-${e}`}function Ae(e){return`thread-panel-entry-${e}`}function ge(e){return`room-entry-${e}`}function Fe(e,t){const s=e.find(c=>c.id===t);if(s===void 0)return null;const n=Z(s)??null,o={rowId:t,domId:ge(t)};if(n===null)return o;const r=e.find(c=>c.id===n);return r!==void 0&&(Z(r)??null)===null?{rowId:Ot(n),domId:he(n)}:o}function To(e,t){if(t===null)return null;const s=e.find(n=>n.seq===t);return s===void 0?null:Fe(e,s.id)}const et=48;function Pt(e,t,s){const n=e.body.answersEntryId;if(n===void 0||n===e.id||t!==void 0&&t.id===n)return null;const o=s(n);if(o===void 0)return null;const r=o.body.text.replace(/\s+/gu," ").trim();return r.length===0?null:{entryId:n,excerpt:r.length>et?`${r.slice(0,et).trimEnd()}…`:r}}function _o(e,t){const s=new Map;for(const n of e){const o=t[n.projectPath];if(!o)continue;const r=kn({runtime:o.runtime,model:o.model});s.set(dt(n.projectPath),{memberId:n.id,visual:wn(o),runtime:r.label,...r.modelLabel!==null&&{model:r.modelLabel}})}return s}function Eo(e){const t=new Map;for(const[s,n]of e)t.set(s,n.visual);return t}const Oo={info:new Map,faces:new Map},Be=a.createContext(Oo);function Dt({known:e,children:t}){return i.jsx(Be.Provider,{value:e,children:t})}function qe(){const e=ut(),t=a.useMemo(()=>{var l;return((l=e.data)==null?void 0:l.agents)??[]},[e.data]),s=a.useMemo(()=>t.map(l=>l.projectPath),[t]),n=mt(s),o=a.useMemo(()=>_o(t,n.data??{}),[t,n.data]),r=a.useMemo(()=>Eo(o),[o]);return a.useMemo(()=>({info:o,faces:r}),[o,r])}function Me(e){const t=a.useContext(Be);return e===void 0?void 0:t.info.get(e)}function Po(){return a.useContext(Be).faces}function Do({loading:e,onLoad:t}){return i.jsx("div",{className:"flex justify-center px-4 py-3",children:i.jsxs(_e,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&i.jsx(Sn,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}function Lo({showAuthorHeader:e,headerId:t,displayName:s,time:n,summary:o,contentId:r,summaryId:l,feedPosition:c}){return{...e?{"aria-labelledby":t}:{"aria-label":n.length>0?`${s}, ${n}`:s},"aria-describedby":o===null?r:l,...Pe(c)}}const me=120,$o="code block";function Fo(e){if(e.length<=me&&!e.includes("```"))return null;const t=Bo(e);return t.length===0?null:t}function Bo(e){const t=e.replace(/```[\s\S]*?(?:```|$)/g,` ${$o} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(t.length<=me)return t;const s=qo(t,me),n=s.lastIndexOf(" ");return`${(n>me/2?s.slice(0,n):s).trimEnd()}…`}function qo(e,t){if(typeof Intl.Segmenter=="function"){const n=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:r}of n.segment(e)){if(o.length+r.length>t)break;o+=r}return o}let s="";for(const n of e){if(s.length+n.length>t)break;s+=n}return s}function Ho({roomId:e,entry:t,viewerAuthorId:s,reactionFrequents:n,streamStalled:o,isMember:r=!0}){const l=fo(),c=o===!0||!r,h=a.useMemo(()=>t.reactions??[],[t.reactions]),p=a.useMemo(()=>h.filter(k=>ws(k,s)).map(k=>k.emoji),[h,s]),u=a.useCallback(k=>l.mutate({roomId:e,entryId:t.id,emoji:k,viewerAuthorId:s}),[l,e,t.id,s]),d=a.useMemo(()=>({quick:n,mine:p,onToggle:u,disabled:c}),[n,p,u,c]);return{reactions:h,toggle:u,quickRow:d}}function zo({barRef:e,pillsRef:t,hasReactions:s}){return n=>{var r,l;if(n.target!==n.currentTarget)return;const{key:o}=n;if(o==="ArrowDown"&&s){n.preventDefault(),(r=t.current)==null||r.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(n.preventDefault(),(l=e.current)==null||l.focusFirst())}}function Uo(e,t){var d,k;const s=t.body.subjectAuthorId,n=t.body.notice,o=t.kind==="notice"&&n!==void 0&&s!==void 0&&Nn.includes(n),r=_t(e,{enabled:o}),l=Ee(),c=ye(),h=te(),p=o?((k=(d=r.data)==null?void 0:d.bindings.find(f=>f.authorId===s))==null?void 0:k.sessionId)??null:null,u=a.useCallback(f=>{f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),!(p===null||s===void 0)&&In({queryClient:c,transport:h},e,s).then(g=>{g.kind!=="none"&&l(fe({session:g.kind==="bound"?g.sessionId:p}))}))},[s,l,c,e,p,h]);return a.useMemo(()=>p===null?null:{href:Cn({session:p}),onOpen:u},[u,p])}const xe="mention",He="author_id",Wo={[xe]:[He]},Ko=[xe];function Go(e,t){if(!t||t.length===0)return e;const s=Vo(e,t);if(s.length===0)return e;let n=e;for(let o=s.length-1;o>=0;o--){const{offset:r,length:l,authorId:c}=s[o],h=n.slice(0,r),p=n.slice(r,r+l),u=n.slice(r+l);n=`${h}<${xe} ${He}="${c}">${p}</${xe}>${u}`}return n}function Vo(e,t){const s=[...t].sort((r,l)=>r.offset-l.offset),n=[];let o=0;for(const r of s)r.offset<o||r.offset+r.length>e.length||(n.push(r),o=r.offset+r.length);return n}const Qo=new Map,Lt=a.createContext(Qo);function Yo({authors:e,children:t}){return i.jsx(Lt.Provider,{value:e,children:t})}function Jo(e){const t=a.useContext(Lt);return e===void 0?void 0:t.get(e)}function Xo(e){return typeof e=="string"?e.replace(/^@/,""):""}function Zo({authorId:e,children:t}){const s=Jo(e),n=Me(s==null?void 0:s.agentRef),{open:o}=ft();if(!s)return i.jsx(Xe,{kind:"human",label:Xo(t),resolved:!1});const r=ct({record:s,override:n==null?void 0:n.visual}),l=pt(s,n==null?void 0:n.memberId),c=l===void 0?void 0:()=>o(l),h=c?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:c,onKeyDown:p=>{p.key!=="Enter"&&p.key!==" "||(p.preventDefault(),c())}}:{};return i.jsx(Tt,{onViewProfile:c,identity:{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:r.color,emoji:r.emoji,imageUrl:r.imageUrl,origin:s.origin,agent:n&&{runtime:n.runtime,...n.model&&{model:n.model}}},children:i.jsx(Xe,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:c!==void 0,...h})})}function er(e){return{mention:t=>{const s=t[He],n=typeof s=="string"?s:void 0;return!n||!e.has(n)?i.jsx(i.Fragment,{children:t.children}):i.jsx(Zo,{authorId:n,children:t.children})}}}function tr({entry:e,authors:t}){const s=a.useMemo(()=>Go(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),n=a.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(l=>l.authorId))??[])},[e.mentionSpans]),o=a.useMemo(()=>er(n),[n]);return i.jsx(Yo,{authors:t,children:i.jsx(_s,{content:s,className:"msg-prose",allowedTags:Wo,literalTagContent:Ko,components:o,renderers:xo})})}function nr(e){return function(s){return i.jsx(tr,{entry:s,authors:e})}}const $t="the top folder";function tt(e){return e.slice(e.lastIndexOf("/")+1)}function sr(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function or(e){return e===""?$t:`${e}/`}function Se(e){return e.target!==void 0?e.target===""?$t:e.target:or(sr(e.paths[0]??""))}function rr(e,t){const s=e.paths[0]??"",n=e.target;switch(e.kind){case"edit":return`${t} edited ${n??s}`;case"add":return`${t} added ${n??s}`;case"upload":return e.pathCount===1?`${t} uploaded ${tt(s)} to ${Se(e)}`:`${t} uploaded ${e.pathCount} files to ${Se(e)}`;case"rename":{const o=e.from??"";return n!==void 0?`${t} renamed ${o} to ${n}`:o.endsWith("/")?`${t} renamed ${o}`:`${t} renamed ${o} to ${s}`}case"delete":return n!==void 0?`${t} deleted ${n}`:e.pathCount===1?`${t} deleted ${s}`:`${t} deleted ${e.pathCount} files`;case"from-attachment":return`${t} saved ${tt(s)} from the chat to ${Se(e)}`}}const ar=a.lazy(()=>jn(()=>import("./index-Cdyszxoa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(e=>({default:e.SaveToRoomFilesButton})));function Ft({roomId:e,entry:t,author:s,authorRef:n,authors:o,viewerAuthorId:r,authorNames:l,reactionFrequents:c,streamStalled:h,isMember:p=!0,grouping:u,orphanedReply:d,answers:k,feedPosition:f,rowId:g}){const y=De(t.createdAt),x=a.useMemo(()=>{const G=Fo(t.body.text),Re=Ss(t.attachments??[]);if(Re===null)return G;const We=G??t.body.text.trim();return We.length>0?`${We} ${Re}`:Re},[t.body.text,t.attachments]),N=a.useId(),m=`${N}-author`,b=`${N}-content`,T=`${N}-summary`,_=a.useRef(null),D=a.useRef(null),C=a.useRef(null),{reactions:S,toggle:O,quickRow:I}=Ho({roomId:e,entry:t,viewerAuthorId:r,reactionFrequents:c,streamStalled:h,isMember:p}),$=Me(n==null?void 0:n.agentRef),{open:L}=ft(),E=n===void 0?void 0:pt(n,$==null?void 0:$.memberId),q=a.useCallback(()=>{E!==void 0&&L(E)},[L,E]),F=E===void 0?void 0:q,H=jo({roomId:e,entry:t,author:n,viewerAuthorId:r,onViewProfile:F}),W=zo({barRef:D,pillsRef:C,hasReactions:S.length>0}),B=a.useCallback(()=>{var G;return(G=_.current)==null?void 0:G.focus()},[]),z=a.useMemo(()=>nr(o),[o]),w=a.useCallback(G=>i.jsx(a.Suspense,{fallback:null,children:i.jsx(ar,{roomId:e,attachment:G})}),[e]),v=Po(),P=t.body.subjectAuthorId??t.authorId,M=o.get(P),R=Me(M==null?void 0:M.agentRef),A=Uo(e,t),j=Ao(t);if(j.kind==="notice")return i.jsx(wo,{entry:t,feedPosition:f,rowId:g,sessionLink:A,subjectName:M==null?void 0:M.displayName});if(j.kind==="moment")return i.jsx(No,{entry:t,moment:j.moment,subject:P===t.authorId?s:J(P,o,v),subjectIdentity:{handle:(M==null?void 0:M.handle)??void 0,origin:M==null?void 0:M.origin,agent:R&&{runtime:R.runtime,...R.model&&{model:R.model}}},feedPosition:f,rowId:g});const U=u.position==="first"||u.position==="only";return i.jsxs(V.Root,{ref:_,id:g,position:u.position,actions:H,reactions:I,"data-testid":"room-entry",tabIndex:0,...Lo({showAuthorHeader:U,headerId:m,displayName:s.displayName,time:y,summary:x,contentId:b,summaryId:T,feedPosition:f}),onKeyDown:W,children:[i.jsx(V.Gutter,{author:s,at:t.createdAt,onViewProfile:F,isSelf:t.authorId===r}),i.jsxs(V.Body,{children:[i.jsx(V.Author,{id:m,author:s,at:t.createdAt,origin:n==null?void 0:n.origin}),d===!0&&i.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),k!=null&&i.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${k.excerpt}”`}),i.jsx(V.Content,{id:b,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:t.body.fileChange?i.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:rr(t.body.fileChange,(M==null?void 0:M.displayName)??"Somebody")}):z(t,{rowId:t.id,isStreaming:!1})}),x!==null&&i.jsx("span",{id:T,className:"hidden",children:x}),i.jsx(V.Attachments,{items:t.attachments??[],renderAction:p?w:void 0}),i.jsx(V.Reactions,{ref:C,reactions:S,viewerAuthorId:r,names:l,frequents:c,onToggle:O,disabled:h===!0||!p,onExit:B}),i.jsx(V.Actions,{actions:H,reactions:I,barRef:D,onExit:B})]})]})}const ir="room-load-older",lr=4;function Bt({roomName:e}){return i.jsx(Ns,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:lr},(t,s)=>i.jsxs("div",{className:"flex gap-3",children:[i.jsx(ae,{className:"size-7 shrink-0 rounded-full"}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[i.jsx(ae,{className:"h-3 w-24"}),i.jsx(ae,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${s}`))})}function cr({roomId:e,roomName:t,viewerAuthorId:s,entries:n,members:o,formerAuthors:r,lastReadSeq:l,reactionFrequents:c,streamStalled:h,isLoading:p,error:u,onAddAgents:d,openThreadId:k,onOpenThread:f,resumeRow:g,landOnRow:y,onTopRow:x,canLoadOlder:N=!1,isLoadingOlder:m=!1,onLoadOlder:b,ref:T}){const _=a.useMemo(()=>$e(o,r),[o,r]),D=be(o,s),C=qe(),S=a.useMemo(()=>new Map([..._].map(([v,P])=>[v,P.displayName])),[_]),O=ht(),I=gt(e,null),{topLevel:$,repliesByRoot:L,orphaned:E}=a.useMemo(()=>Mo(n),[n]),q=a.useMemo(()=>new Map(n.map(v=>[v.id,v])),[n]),F=a.useMemo(()=>{const v=An($,l),P=Mn($.map(R=>({id:R.id,authorId:R.body.moment?`moment:${R.id}`:R.authorId,timestamp:R.createdAt})),{now:O,lastSeenId:v.lastSeenId,unreadFromStart:v.fromStart}),M=[];N&&!p&&M.push({kind:"load-older",id:ir});for(const R of P){if(R.kind==="day-divider"){M.push({kind:"day-divider",id:R.key,label:R.label});continue}if(R.kind==="unread-divider"){M.push({kind:"unread-divider",id:R.key});continue}const A=$[R.index];M.push({kind:"message",id:A.id,entry:A,grouping:R.grouping,position:R.index+1,answers:Pt(A,$[R.index-1],q.get.bind(q))});const j=L.get(A.id);j&&M.push({kind:"thread-reply",id:Ot(A.id),rootId:A.id,replies:j,totalReplies:A.threadReplyCount})}return M},[$,L,q,l,O,N,p]),H=a.useMemo(()=>F.map(v=>v.kind==="load-older"?{kind:"notice",id:v.id,at:"",body:null}:v.kind==="day-divider"?{kind:"day-divider",id:v.id,label:v.label}:v.kind==="unread-divider"?{kind:"unread-divider",id:v.id}:v.kind==="thread-reply"?{kind:"thread-reply",id:v.id,rootId:v.rootId,replyCount:Le(v.replies.length,v.totalReplies),lastAt:v.replies[v.replies.length-1].createdAt}:{kind:"message",id:v.id,payload:v.entry,grouping:v.grouping,author:J(pe(v.entry,_),_,C.faces),at:v.entry.createdAt}),[F,_,C.faces]),W=a.useCallback((v,P)=>{const M=F[P.index];if(M.kind==="load-older")return b===void 0?null:i.jsx(Do,{loading:m,onLoad:b});if(M.kind==="day-divider")return i.jsx(Is,{label:M.label});if(M.kind==="unread-divider")return i.jsx(Cs,{});if(M.kind==="thread-reply"){if(P.onOpenThread===void 0)return null;const A=P.onOpenThread;return i.jsx(Io,{id:he(M.rootId),summary:po(M.replies,l,M.totalReplies),open:k===M.rootId,onOpen:()=>A(M.rootId)})}const R=pe(M.entry,_);return i.jsx(Ft,{roomId:e,entry:M.entry,author:J(R,_,C.faces),authorRef:_.get(R),authors:_,viewerAuthorId:s,authorNames:S,reactionFrequents:c,streamStalled:h,isMember:D,grouping:M.grouping,orphanedReply:E.has(M.entry.id),answers:M.answers,feedPosition:{index:M.position,total:-1},rowId:ge(M.entry.id)})},[F,e,_,C.faces,s,S,c,h,D,E,l,k,m,b]),B=a.useCallback(v=>{if(v.kind==="message")return ge(v.id);if(v.kind==="thread-reply")return he(v.rootId)},[]);if(u)return i.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[i.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),i.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const z=o.some(v=>v.author.kind==="agent"),w=i.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[i.jsx(Tn,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),i.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),i.jsx("p",{className:"max-w-sm",children:z?"Say something to get it going.":"Nothing answers until you add an agent."}),i.jsx(_e,{type:"button",size:"sm",variant:z?"ghost":"default",onClick:d,className:"mt-1",children:z?"Add more agents":"Add agents"})]});return i.jsx(Dt,{known:C,children:i.jsx(X.Timeline,{ref:T,conversationId:e,label:`Messages in ${t}`,rows:H,renderRow:W,onOpenThread:f,domIdOf:B,...g===void 0?{}:{resumeRow:g},...y===void 0?{}:{landOnRow:y},...x===void 0?{}:{onTopRow:x},pending:I,viewerAuthorId:s,loading:p?i.jsx(Bt,{roomName:t}):void 0,empty:w,feedTestId:"room-timeline"})})}const ze={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function dr(e){const t=te(),[s,n]=a.useState([]),o=a.useRef(new Map),r=a.useCallback(f=>{const g=f.map(y=>({id:crypto.randomUUID(),file:y,status:"pending",progress:0}));n(y=>[...y,...g])},[]),l=a.useCallback(f=>{o.current.delete(f),n(g=>g.filter(y=>y.id!==f))},[]),c=a.useCallback(f=>{if(!f){o.current.clear(),n([]);return}const g=new Set(f);for(const y of g)o.current.delete(y);n(y=>y.filter(x=>!g.has(x.id)))},[]),h=a.useCallback(f=>{o.current.delete(f),n(g=>g.map(y=>y.id===f&&y.status==="error"?{...y,status:"pending",progress:0,error:void 0}:y))},[]),p=a.useRef(null),u=le({meta:{suppressErrorToast:!0},mutationFn:async f=>{n(N=>N.map(m=>f.some(b=>b.id===m.id)?{...m,status:"uploading"}:m));const g=N=>{n(m=>m.map(b=>b.status==="uploading"?{...b,progress:N.percentage}:b))},y=new AbortController;p.current=y;const x=f.map(N=>N.file);return t.uploadRoomAttachments(e,x,g,y.signal)},onSettled:()=>{p.current=null},onSuccess:(f,g)=>{g.forEach((y,x)=>{const N=f[x];N&&o.current.set(y.id,N.id)}),n(y=>y.map(x=>g.findIndex(m=>m.id===x.id)===-1?x:{...x,status:"uploaded",progress:100}))},onError:f=>{n(g=>g.map(y=>y.status==="uploading"?{...y,status:"error",error:f.message}:y))}}),d=a.useCallback(()=>{var f;(f=p.current)==null||f.abort()},[]),k=a.useCallback(async()=>{const f=s.filter(y=>y.status==="error");if(f.length>0)throw new Error(f.length===1?`${f[0].file.name} didn’t upload. Try again or remove it.`:`${f.length} files didn’t upload. Try again or remove them.`);const g=s.filter(y=>y.status==="pending");return g.length>0&&await u.mutateAsync(g),s.map(y=>o.current.get(y.id)).filter(y=>y!==void 0)},[s,u]);return{pendingFiles:s,addFiles:r,removeFile:l,retryFile:h,clearFiles:c,cancelUpload:d,uploadAndGetIds:k,hasPendingFiles:s.length>0,hasFailedUpload:s.some(f=>f.status==="error"),isUploading:u.isPending}}function qt(e){const{room:t,threadRootId:s}=e,n=js(),o=As(),r=dr((t==null?void 0:t.id)??""),l=t!==void 0&&be(t.members,t.viewerAuthorId),c=a.useRef({attachments:r,post:n,reply:o,room:t,threadRootId:s});a.useEffect(()=>{c.current={attachments:r,post:n,reply:o,room:t,threadRootId:s}});const h=a.useCallback(m=>c.current.attachments.addFiles(m),[]),p=a.useCallback(m=>c.current.attachments.removeFile(m),[]),u=a.useCallback(m=>c.current.attachments.retryFile(m),[]),d=a.useCallback(()=>c.current.attachments.cancelUpload(),[]),{pendingFiles:k,hasFailedUpload:f,isUploading:g}=r,y=a.useMemo(()=>({staged:k,add:h,remove:p,retry:u,cancel:d,hasFailed:f,isUploading:g,holdsSendWhileUploading:!1}),[k,f,g,h,p,u,d]),x=a.useCallback(async m=>{const{attachments:b,post:T,reply:_,room:D,threadRootId:C}=c.current;if(D===void 0)throw new Error("That room isn’t loaded yet.");if(D.archived)throw new Error("This room is archived.");Ie.getState().recordOpened("room",D.id);const S=_n(),O=b.pendingFiles.map(E=>E.file.name),I=b.pendingFiles.map(E=>E.id),$=await b.uploadAndGetIds();b.clearFiles(I);const L=m.parentEntryId??C;if(L!==void 0){_.mutate({roomId:D.id,rootEntryId:L,text:m.text,clientId:S,attachmentIds:$,attachmentNames:O});return}T.mutate({roomId:D.id,text:m.text,clientId:S,attachmentIds:$,attachmentNames:O})},[]);return{target:a.useMemo(()=>({kind:"room",id:(t==null?void 0:t.id)??"",placeholder:t===void 0?"Message…":s===void 0?`Message ${se(t)}…`:"Reply in this thread…",canSend:t!==void 0&&!t.archived&&l,...t===void 0?{canSendReason:"Still opening this room…"}:t.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:l?{}:{canSendReason:xt},send:x,attachments:y}),[t,s,l,y,x]),attachments:r}}function ur(e){const{roomId:t,entrySeq:s,entries:n,historyLoaded:o}=e,r=s===void 0?null:`${t}:${s}`,l=a.useMemo(()=>{if(s===void 0)return null;const g=n.find(m=>m.seq===s);if(g===void 0)return null;const y=Fe(n,g.id);if(y===null)return null;const x=Z(g)??null,N=x!==null&&y.rowId!==g.id;return{roomRowId:y.rowId,threadRootId:N?x:null,entryId:g.id}},[n,s]),c=a.useRef(null),h=(l==null?void 0:l.threadRootId)??null;a.useEffect(()=>{r===null||h===null||c.current!==r&&(c.current=r,Y.getState().openThread(t,h))},[r,t,h]);const p=a.useRef(null);a.useEffect(()=>{r===null||!o||l===null&&p.current!==r&&(p.current=r,yt.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,o,l]);const u=a.useRef(null),d=a.useCallback(()=>{if(!(r===null||u.current===r))return u.current=r,l==null?void 0:l.roomRowId},[r,l]),k=a.useRef(null),f=a.useCallback(()=>{if(!(r===null||k.current===r))return k.current=r,(l==null?void 0:l.threadRootId)===null||l==null?void 0:l.entryId},[r,l]);return{roomRow:s===void 0?void 0:d,threadRow:s===void 0?void 0:f}}function mr(e,t){const[s,n]=a.useState({roomId:null,seq:null});return s.roomId===e?s.seq:e===null?(n({roomId:null,seq:null}),null):t===null?null:(n({roomId:e,seq:t}),t)}const fr=600;function pr(e){return document.getElementById(he(e))??document.getElementById(ge(e))}function hr(){const e=a.useRef(null);return a.useEffect(()=>()=>{var s;return(s=e.current)==null?void 0:s.call(e)},[]),{arm:a.useCallback(s=>{var c;(c=e.current)==null||c.call(e);let n=0;const o=Date.now()+fr;let r=!1;const l=()=>{if(r)return;const h=document.activeElement;if(h===null||h===document.body||!h.isConnected){const u=pr(s);if(u!==null){u.focus();return}}Date.now()>=o||(n=requestAnimationFrame(l))};n=requestAnimationFrame(l),e.current=()=>{r=!0,cancelAnimationFrame(n)}},[])}}function gr({roomId:e,route:t,urlThreadId:s,openThreadId:n,entries:o,historyLoaded:r}){const l=En(),c=a.useRef(null);a.useEffect(()=>{if(e!==null){if(c.current!==e&&(c.current=e,s!==void 0)){Y.getState().openThread(e,s);return}if(r&&n!==void 0){const h=o.find(u=>u.id===n),p=h===void 0?void 0:Et(h);if(p!==void 0&&p!==n){const u=Y.getState().open[e];Y.getState().openThread(e,p,(u==null?void 0:u.focusComposer)??!1);return}}n!==s&&(l==null||l({to:t,search:h=>({...h,thread:n}),replace:!0}))}},[e,t,n,s,o,r,l])}const xr=6,Ht="jump-back-in-listbox";function Ue(e){return`jump-back-in-item-${e}`}const yr='[role="combobox"]';function ie(e){return e instanceof Element&&e.matches(yr)}function br({value:e,yieldToPalette:t=!1,enabled:s=!0}){const n=Ee(),o=On(),[r,l]=a.useState(!1),[c,h]=a.useState({stamp:"",index:0}),[p,u]=a.useState(!1),[d,k]=a.useState(!1);e.length>0&&!d&&k(!0);const f=a.useRef(!1);a.useEffect(()=>{f.current=!0},[]);const{data:g}=ut({enabled:s}),y=a.useMemo(()=>((g==null?void 0:g.agents)??[]).map(w=>w.projectPath),[g]),{data:x}=mt(y,{enabled:s}),N=a.useMemo(()=>x??{},[x]),m=a.useMemo(()=>Pn(y,N),[y,N]),b=a.useMemo(()=>new Map(y.map(w=>[dt(w),w])),[y]),T=a.useCallback(w=>Dn({room:w,agentsByPath:N,pathByAgentRef:b}),[N,b]),_=a.useMemo(()=>Ln(o.muted),[o.muted]),{items:D}=bs({mutedRoomIds:_,enabled:s}),C=a.useMemo(()=>D.slice(0,xr),[D]),S=s&&r&&!p&&!d&&!t&&e.length===0&&C.length>0,O=`${S}:${C.length}`,I=c.stamp===O?c.index:0,$=a.useCallback(w=>{f.current&&ie(w.target)&&(u(!1),k(!1),l(!0))},[]),L=a.useCallback(w=>{ie(w.target)&&l(!0)},[]),E=a.useCallback(w=>{ie(w.target)&&l(!1)},[]),q=a.useCallback(w=>{C.length!==0&&h(v=>{const P=v.stamp===O?v.index:0;return{stamp:O,index:(P+w+C.length)%C.length}})},[C.length,O]),F=a.useCallback(()=>q(1),[q]),H=a.useCallback(()=>q(-1),[q]),W=a.useCallback(()=>{u(!0)},[]),B=a.useCallback(w=>{if(u(!0),w.kind==="session"){w.session.cwd&&Ie.getState().recordOpened("agent",w.session.cwd),n(fe({dir:w.session.cwd??void 0,session:w.session.id}));return}Ie.getState().recordOpened("room",w.room.id),n({...bt.channels(),search:{id:w.room.id}})},[n]),z=a.useCallback(()=>{const w=C[I];!S||!w||B(w)},[S,C,I,B]);return{isOpen:S,hasRows:C.length>0,rows:C,agents:N,displayNames:m,visualOf:T,selectedIndex:I,activeDescendantId:S&&C[I]!==void 0?Ue(I):void 0,listboxId:S?Ht:void 0,handleFocus:$,handleBlur:E,handlePointerDown:L,moveDown:F,moveUp:H,selectHighlighted:z,selectRow:B,dismiss:W}}function zt({mark:e,label:t,title:s,summary:n,lastActivityAt:o,index:r,isSelected:l,now:c,onSelect:h}){const p=a.useMemo(()=>Number.isNaN(Date.parse(o))?null:zn(o),[o,c]);return i.jsxs("div",{id:Ue(r),role:"option","aria-selected":l,"data-selected":l,title:s,onClick:h,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[i.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),i.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[i.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:t}),p!==null&&i.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:p})]}),n!==null&&i.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:n})]})]})}function vr({item:e,agent:t,displayName:s,index:n,isSelected:o,now:r,onSelect:l}){const c=$n(t,e.session.cwd??s);return i.jsx(zt,{mark:i.jsx(Fn,{color:c.color,emoji:c.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:n,isSelected:o,now:r,onSelect:l})}function Rr({item:e,visual:t,index:s,isSelected:n,now:o,onSelect:r}){return i.jsx(zt,{mark:i.jsx(qn,{room:e.room,participants:e.room.participants,visuals:Hn(t)}),label:i.jsx(Bn,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:n,now:o,onSelect:r})}function kr({rows:e,selectedIndex:t,agents:s={},displayNames:n={},visualOf:o,onSelect:r}){const l=ht(6e4);return a.useEffect(()=>{var c,h;(h=(c=document.getElementById(Ue(t)))==null?void 0:c.scrollIntoView)==null||h.call(c,{block:"nearest"})},[t]),i.jsx(Oe.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:c=>c.preventDefault(),children:i.jsx("div",{id:Ht,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((c,h)=>{var p;return c.kind==="session"?i.jsx(vr,{item:c,agent:c.session.cwd&&s[c.session.cwd]||null,displayName:c.session.cwd&&n[c.session.cwd]||((p=c.session.cwd)==null?void 0:p.split("/").pop())||"Agent",index:h,isSelected:h===t,now:l,onSelect:()=>r(c)},`session-${c.id}`):i.jsx(Rr,{item:c,visual:o(c.room),index:h,isSelected:h===t,now:l,onSelect:()=>r(c)},`room-${c.id}`)})})})}const nt={people:"People",agents:"Agents"},wr=["people","agents"];function Sr(e,t){const s=[];for(const{author:n}of e){if(n.kind==="system"||n.id===t||n.retired)continue;const o=n.handle;s.push({section:n.kind==="agent"?"agents":"people",authorId:n.id,label:n.displayName,...o?{handle:o}:{},...n.emoji?{emoji:n.emoji}:{},...n.color?{color:n.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function Nr(e,t,s){const n=t.trim().toLowerCase(),o=e.map((r,l)=>({row:r,position:l,tier:Ir(r,n)})).filter(r=>r.tier!==null).sort((r,l)=>r.tier-l.tier||r.position-l.position);return s.flatMap(r=>o.filter(l=>l.row.section===r).map(({row:l})=>l))}function Ir(e,t){var o;if(t==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(r=>r!==void 0);let n=null;for(const r of s){const l=r===t?0:r.startsWith(t)?1:r.includes(t)?2:null;l!==null&&(n===null||l<n)&&(n=l)}return n}function de(e,t,s){var r;const n=e.length;if(n===0)return 0;let o=(t%n+n)%n;for(let l=0;l<n;l++){if(!((r=e[o])!=null&&r.disabled))return o;o=(o+s+n)%n}return 0}function Cr(e,t,s,n){const o=e.slice(0,t),r=e.slice(t+1+s.length),l=`@${n}`,c=r.startsWith(" ")?"":" ";return{value:o+l+c+r,cursorPos:o.length+l.length+1}}const jr=/(^|\s)@([A-Za-z0-9_.-]*)$/,Ut="mention-palette-listbox";function Te(e){return`mention-item-${e}`}function Ar({members:e,viewerAuthorId:t,text:s,sectionOrder:n=wr}){var L;const[o,r]=a.useState(!1),[l,c]=a.useState(""),[h,p]=a.useState(-1),u=Un(s),d=a.useRef(!1),k=a.useMemo(()=>Sr(e,t),[e,t]),f=a.useMemo(()=>o?Nr(k,l,n):[],[k,l,o,n]),[g,y]=a.useState(null),x=g!==null&&g.query===l&&g.open===o?g.index:de(f,0,1),N=f[x],m=f.length===0||N!==void 0&&!N.disabled?x:de(f,0,1),b=a.useCallback((E,q)=>{const F=E.slice(0,q).match(jr);if(!F){r(!1);return}r(!0),c(F[2]),p((F.index??0)+F[1].length)},[]),T=a.useCallback(E=>{u.write(E),d.current=!1},[u]),_=a.useCallback(E=>{d.current||b(u.read(),E)},[b,u]),D=a.useCallback(()=>{y({query:l,open:o,index:de(f,m+1,1)})},[f,m,l,o]),C=a.useCallback(()=>{y({query:l,open:o,index:de(f,m-1,-1)})},[f,m,l,o]),S=a.useCallback(E=>E.disabled||E.handle===void 0?null:(d.current=!0,r(!1),Cr(u.read(),h,l,E.handle)),[h,l,u]),O=a.useCallback(()=>{const E=f[m];return E?S(E):(r(!1),null)},[f,m,S]),I=a.useCallback(()=>{d.current=!0,r(!1)},[]),$=f.some(E=>!E.disabled);return{isOpen:o,hasSelectableRows:$,rows:f,selectedIndex:m,activeDescendantId:o&&((L=f[m])==null?void 0:L.disabled)===!1?Te(m):void 0,listboxId:o?Ut:void 0,noteTextChange:T,handleCursorChange:_,moveDown:D,moveUp:C,selectHighlighted:O,selectRow:S,dismiss:I}}function Mr({rows:e,selectedIndex:t,onSelect:s}){const n=a.useMemo(()=>{const o=[];return e.forEach((r,l)=>{const c=o[o.length-1];c&&c.section===r.section?c.items.push({row:r,index:l}):o.push({section:r.section,items:[{row:r,index:l}]})}),o},[e]);return a.useEffect(()=>{var o;(o=document.getElementById(Te(t)))==null||o.scrollIntoView({block:"nearest"})},[t]),i.jsx(Oe.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:i.jsx("div",{id:Ut,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?i.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):n.map(({section:o,items:r},l)=>i.jsxs("div",{role:"group","aria-label":nt[o],children:[l>0&&i.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),i.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:nt[o]}),r.map(({row:c,index:h})=>{const p=h===t;return i.jsxs("div",{id:Te(h),role:"option","aria-selected":p,"aria-disabled":c.disabled,"data-selected":p,"data-disabled":c.disabled,onClick:()=>{c.disabled||s(c)},className:c.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[i.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:c.emoji}),i.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:c.label}),c.handle!==void 0&&i.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",c.handle]}),c.disabledReason!==void 0&&i.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:c.disabledReason})]},c.authorId)})]},o))})})}function Wt({room:e,threadRootId:t,focusOnMount:s,offerJumpBackIn:n,onFocusChange:o,attachments:r}){const l=t===void 0?e.id:lt(e.id,t),c=Wn(l),{target:h}=kt(),p=Kn(),u=Gn(l),d=a.useRef(null),k=be(e.members,e.viewerAuthorId),f=a.useRef(!1),g=Ar({members:e.members,viewerAuthorId:e.viewerAuthorId,text:c}),y=n===!0,x=br({value:c,yieldToPalette:g.isOpen,enabled:y}),N=a.useRef(u);a.useEffect(()=>{var I;u!==N.current&&(N.current=u,(I=d.current)==null||I.focus())},[u]),a.useEffect(()=>{var I;s===!0&&((I=d.current)==null||I.focusUnlessTouch())},[]);const m=a.useCallback(I=>ue.getState().set(l,I),[l]),[b,T]=a.useState(null);a.useLayoutEffect(()=>{var I;b!==null&&((I=d.current)==null||I.focusAt(b.pos))},[b]);const _=a.useCallback(I=>{I&&(m(I.value),T({pos:I.cursorPos}))},[m]),D=a.useCallback(I=>_(g.selectRow(I)),[g,_]),C=a.useCallback(()=>_(g.selectHighlighted()),[g,_]),S=()=>{if(h===null||!h.canSend||f.current)return;g.dismiss();const I=ue.getState().take(l).trim();if(I==="")return;const $=r.pendingFiles.length>0;$&&(f.current=!0),h.send({text:I}).catch(()=>{const L=ue.getState(),E=L.drafts[l]??"";L.set(l,E===""?I:`${I}
|
|
44
|
-
${E}`)}).finally(()=>{$&&(f.current=!1)})};if(!k)return i.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[i.jsx("p",{className:"text-muted-foreground text-sm",children:xt}),i.jsx(_e,{type:"button",size:"sm",variant:"outline",disabled:p.isPending,onClick:()=>p.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>yt.success(`You joined ${se(e)}`)}),children:Vn})]});const O=i.jsx(X.Composer,{inputRef:d,value:c,onChange:I=>{m(I),g.noteTextChange(I)},onSubmit:S,head:i.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g.isOpen&&g.rows.length===0?"No one by that name.":""}),mentionPicker:i.jsx(Ce,{children:g.isOpen&&i.jsx(Mr,{rows:g.rows,selectedIndex:g.selectedIndex,onSelect:D})}),overlays:i.jsx(i.Fragment,{children:i.jsx(Ce,{children:x.isOpen&&i.jsx(kr,{rows:x.rows,selectedIndex:x.selectedIndex,agents:x.agents,displayNames:x.displayNames,visualOf:x.visualOf,onSelect:x.selectRow})})}),input:{onCursorChange:g.handleCursorChange,isStreaming:!1,isPaletteOpen:g.isOpen||x.isOpen,paletteHasResults:x.isOpen?x.hasRows:g.hasSelectableRows,onArrowUp:x.isOpen?x.moveUp:g.moveUp,onArrowDown:x.isOpen?x.moveDown:g.moveDown,onCommandSelect:x.isOpen?x.selectHighlighted:C,onEscape:x.isOpen?x.dismiss:g.dismiss,tabPicks:!x.isOpen,onClear:()=>{m(""),g.dismiss()},activeDescendantId:x.isOpen?x.activeDescendantId:g.activeDescendantId,paletteListboxId:x.isOpen?x.listboxId:g.listboxId,contextKey:l,...r.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!y&&o===void 0?O:i.jsx("section",{className:"flex flex-col","data-testid":Qn.homeComposer,onFocus:I=>{x.handleFocus(I),ie(I.target)&&(o==null||o(!0))},onBlur:I=>{x.handleBlur(I),ie(I.target)&&(o==null||o(!1))},onPointerDown:x.handlePointerDown,children:O})}function Tr(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(t=>t.author.kind==="agent")}function _r({room:e,hasEntries:t,onAddAgents:s}){return!t||!Tr(e)?null:i.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",i.jsx("button",{type:"button",onClick:s,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function Er({roomId:e}){const{approvals:t}=Yn(),s=Jn(t).filter(n=>n.roomId===e);return s.length===0?null:i.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:i.jsx(Xn,{approvals:s})})}function Or({roomId:e}){const{data:t}=zs("pending"),s=(t??[]).filter(n=>n.roomId===e);return s.length===0?null:i.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:s.map(n=>i.jsx(Us,{request:n},n.requestId))})}const Pr="An agent",st=64,Ne=3,Dr=new Set;function Kt({room:e,entries:t,scope:s,laneScope:n,stalled:o,unavailable:r=!1,onRetry:l,onScrollToRow:c}){const h=Ee(),p=Zn(e.id,s),u=es(e.id,s),d=ts(e.id,s),[k,f]=a.useState(!1),g=_t(e.id,{enabled:k}),y=ns(),{mutate:x}=uo(),[N,m]=a.useState(Dr),b=a.useCallback(R=>{m(A=>new Set(A).add(R)),x({roomId:e.id,authorId:R},{onSettled:()=>m(A=>{const j=new Set(A);return j.delete(R),j})})},[x,e.id]),T=mo(),[_,D]=a.useState(()=>new Map),C=ss(),S=qe(),O=a.useMemo(()=>$e(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=a.useCallback(R=>{var A;return((A=O.get(R))==null?void 0:A.displayName)??Pr},[O]),{interactions:$}=os(),L=a.useMemo(()=>$.filter(R=>R.roomId===e.id),[$,e.id]),E=a.useMemo(()=>{var A;const R={};for(const j of L){if(j.roomAuthorId===void 0)continue;const U=(A=O.get(j.roomAuthorId))==null?void 0:A.displayName;U!==void 0&&(R[j.sessionId]=U)}return R},[L,O]),q=a.useMemo(()=>p.map(R=>({authorId:R.authorId,name:I(R.authorId),state:R.state,since:R.since,activity:R.activity??null})),[p,I]),F=a.useMemo(()=>u.map(R=>{var j;const A=(j=C.data)==null?void 0:j.find(U=>U.id===R.behindRoomId);return{authorId:R.authorId,name:I(R.authorId),since:R.since,behind:{roomId:R.behindRoomId,title:A===void 0?null:se(A)},othersWaiting:R.othersWaiting,severalInTheWay:R.severalInTheWay}}),[u,I,C.data]),H=a.useMemo(()=>{const R=new Set;for(const A of u)_.get(A.authorId)===A.entryId&&R.add(A.authorId);return R},[u,_]),W=a.useMemo(()=>d===null?null:{authorId:d.authorId,name:I(d.authorId)},[d,I]),B=a.useMemo(()=>Ms({capabilities:ze,asks:L,agentNames:E,stalled:o,presence:q,held:F,silentFinish:W,turn:null}),[L,E,q,F,W,o]),z=a.useMemo(()=>{var A;const R=new Map;for(const j of((A=g.data)==null?void 0:A.bindings)??[])R.set(j.authorId,j.sessionId);return R},[g.data]),w=a.useCallback(R=>{const A=t.find(U=>U.id===R);if(A===void 0)return null;const j=A.body.text.replace(/\s+/gu," ").trim();return j.length===0?null:j.length>st?`${j.slice(0,st).trimEnd()}…`:j},[t]),v=a.useCallback(R=>{var A;return n==="thread"?Ae(R):((A=Fe(t,R))==null?void 0:A.domId)??null},[t,n]),P=a.useMemo(()=>{const R=p.map(j=>{const U=w(j.entryId),G=v(j.entryId);return{authorId:j.authorId,author:J(j.authorId,O,S.faces),state:j.state,since:j.since,doing:rs(j.activity),replyingTo:U===null||G===null?null:{entryId:j.entryId,excerpt:U,rowId:G},sessionId:z.get(j.authorId)??null}}),A=F.map(j=>({authorId:j.authorId,author:J(j.authorId,O,S.faces),state:"held",since:j.since,doing:null,replyingTo:null,sessionId:null,behind:j.behind,othersWaiting:j.othersWaiting}));return[...R,...A]},[p,F,O,S.faces,w,v,z]),M=a.useMemo(()=>{if(p.length===0)return null;const R=p.slice(0,Ne);return i.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[R.map(A=>i.jsx(vt,{author:J(A.authorId,O,S.faces),className:"ring-background size-4 ring-2"},A.authorId)),p.length>Ne&&i.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${p.length-Ne}`})]})},[p,O,S.faces]);return i.jsx(X.LiveLane,{state:B,scope:n,onRetry:l,unavailable:r,faces:M,onPeekOpenChange:f,askCard:B.kind==="ask"?i.jsx(as,{ask:B.ask,...E[B.ask.sessionId]?{agentName:E[B.ask.sessionId]}:{},onOpenSession:R=>{h(fe({session:R}))},className:"border-l-0"}):void 0,peek:i.jsx(X.LivePeek,{rows:P,onScrollToRow:c,onOpenSession:R=>{h(fe({session:R}))},onOpenRoom:R=>{h({...bt.channels(),search:{id:R}})},onAnswerFirst:R=>{const A=u.find(j=>j.authorId===R);A!==void 0&&D(j=>new Map(j).set(R,A.entryId)),T.mutate({roomId:e.id,authorId:R})},promoted:H,onStopAll:()=>y.mutate({roomId:e.id}),stopping:y.isPending,onStopAgent:b,stoppingAgents:N})})}const ot=3e3;function Lr(e,t,s,n=Date.now){const o=a.useRef(null),r=a.useRef(new Map),l=a.useRef(new Map),c=o.current,h=r.current,p=l.current,u=n();for(const d of e){if(p.has(d.id))continue;if(c===null){p.set(d.id,"at-rest");continue}const k=h.get(d.authorId);p.set(d.id,k!==void 0&&u-k<ot?"handed-off":"dropped")}return a.useEffect(()=>{if(!s)return;o.current=new Set(e.map(k=>k.id));const d=n();for(const k of t)r.current.set(k,d);for(const[k,f]of r.current)d-f>ot&&r.current.delete(k);for(const k of l.current.keys())o.current.has(k)||l.current.delete(k)}),p}function $r({kind:e}){return e==="thread-error"?i.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[i.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),i.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?i.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[i.jsx(ae,{className:"h-3 w-24"}),i.jsx(ae,{className:"h-3 w-full max-w-sm"})]}):i.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function Fr({room:e,rootEntryId:t,focusComposer:s,entries:n,reactionFrequents:o,streamStalled:r,streamUnavailable:l,onRetryStream:c,historyLoaded:h,historyFailed:p=!1,landOnRow:u,pushed:d,onClose:k}){const f=a.useMemo(()=>$e(e.members,e.formerAuthors),[e.members,e.formerAuthors]),g=qt({room:e,threadRootId:t}),y=be(e.members,e.viewerAuthorId),x=qe(),N=a.useMemo(()=>new Map([...f].map(([w,v])=>[w,v.displayName])),[f]),{root:m,replies:b}=a.useMemo(()=>{let w;const v=[];for(const P of n)P.id===t?w=P:Z(P)===t&&v.push(P);return{root:w,replies:v}},[n,t]),T=m==null?void 0:m.threadReplyCount,_=T!==void 0&&T>b.length,D=m===void 0||_?-1:1+b.length,C=Le(b.length,T),S=a.useMemo(()=>new Set(b.map(w=>w.id)),[b]),O=a.useMemo(()=>({replyIds:S,inside:!0}),[S]),I=is(e.id,O),$=gt(e.id,t),L=Lr(b,I,h),E=a.useRef(null),q=a.useCallback(w=>{var v;(v=E.current)==null||v.scrollToRow(w)},[]),F=a.useRef(null);a.useEffect(()=>{var w;s||(w=F.current)==null||w.focus()},[t,s]);const H=w=>{w.key!=="Escape"||w.defaultPrevented||(w.stopPropagation(),k())},W=a.useMemo(()=>{const w=[];if(m===void 0){const v=p?"thread-error":h?"thread-orphan":"thread-waiting";w.push({kind:"notice",id:v,at:"",body:null})}else w.push({kind:"message",id:m.id,payload:m,grouping:{position:"only"},author:J(pe(m,f),f,x.faces),at:m.createdAt});for(const v of b)w.push({kind:"message",id:v.id,payload:v,grouping:{position:"only"},author:J(pe(v,f),f,x.faces),at:v.createdAt});return w},[m,b,f,x.faces,p,h]),B=a.useCallback(w=>{if(w.kind==="notice")return i.jsx($r,{kind:w.id});if(w.kind!=="message")return null;const v=w.payload,P=m!==void 0&&v.id===m.id,M=b.findIndex(j=>j.id===v.id),R=i.jsx(Ft,{roomId:e.id,entry:v,rowId:Ae(v.id),author:w.author,authorRef:f.get(v.authorId),authors:f,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:o,streamStalled:r,isMember:y,grouping:{position:"only"},answers:Pt(v,M<=0?m:b[M-1],j=>(m==null?void 0:m.id)===j?m:b.find(U=>U.id===j)),feedPosition:{index:P?1:(m===void 0?0:1)+M+1,total:D}});if(P)return C===0?R:i.jsxs(i.Fragment,{children:[R,i.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[i.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:C===1?"1 reply":`${C} replies`}),i.jsx("span",{className:"bg-border h-px flex-1"})]})]});const A=L.get(v.id)??"at-rest";return i.jsx("div",{className:Q(A==="dropped"&&"motion-safe:animate-thread-reply-in",A==="handed-off"&&"motion-safe:animate-reply-settle"),children:R})},[m,b,C,L,e.id,e.viewerAuthorId,f,N,o,r,y,D]),z=a.useCallback(w=>w.kind==="message"?Ae(w.id):void 0,[]);return i.jsx(Dt,{known:x,children:i.jsx(X.Root,{surface:"room",capabilities:ze,target:g.target,anchor:"rail",children:i.jsxs("section",{ref:F,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:H,className:Q("bg-card flex min-h-0 flex-col outline-none",d?"h-full w-full":"w-full border-l"),children:[i.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[i.jsx("button",{type:"button",onClick:k,"aria-label":d?`Back to ${se(e)}`:"Close thread",className:Q("focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1","after:absolute after:-inset-2.5 md:after:hidden"),children:d?i.jsx(ls,{"aria-hidden":!0,className:"size-4"}):i.jsx(cs,{"aria-hidden":!0,className:"size-4"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Thread"}),i.jsx("p",{className:"text-muted-foreground truncate text-xs",children:se(e)})]})]}),i.jsx(X.Timeline,{ref:E,conversationId:`thread-${t}`,label:`Thread in ${se(e)}`,busy:!h&&!p,rows:W,renderRow:B,domIdOf:z,...u===void 0?{}:{landOnRow:u},pending:$,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),i.jsx(Kt,{room:e,entries:n,scope:O,laneScope:"thread",stalled:d&&r===!0,unavailable:l,onRetry:d?c:void 0,onScrollToRow:q}),i.jsx(Wt,{room:e,threadRootId:t,attachments:g.attachments,focusOnMount:s},t)]})})})}const ve="room-thread-split",Br=320,qr=360,Hr=40,zr=50,Ur=25;function rt(e,t){return t<=0?Ur:Math.min(Math.round(e/t*1e3)/10,zr)}function Wr(e){const t=rt(Br,e),s=Math.round((100-rt(qr,e))*10)/10;return{minPct:t,maxPct:s,defaultPct:Math.min(Math.max(Hr,t),s)}}function Kr(e,t,s){if(e===null||t===null||t<=0)return s.defaultPct;const n=e/t*100;return Math.round(Math.min(Math.max(n,s.minPct),s.maxPct)*10)/10}function Gr(e){try{const t=localStorage.getItem(e),s=t===null?NaN:Number(t);return Number.isFinite(s)&&s>0?s:null}catch{return null}}function Vr(e,t){try{localStorage.setItem(e,String(Math.round(t)))}catch{}}const Qr="react-resizable-panels:room-thread-split";function Yr(){try{localStorage.removeItem(Qr)}catch{}}function Jr(){const[e,t]=a.useState(null),[s,n]=a.useState(null);return{ref:a.useCallback(r=>{if(r===null)return;t(r);const l=()=>n(r.offsetWidth);l();const c=new ResizeObserver(l);return c.observe(r),()=>{c.disconnect(),t(null),n(null)}},[]),element:e,width:s,sizing:Wr(s??0)}}const Xr=`${ve}-room`,at=`${ve}-thread`,it=`${ve}-handle`,Zr=4;function ea({room:e,thread:t,storageKey:s=us.ROOM_THREAD_WIDTH}){const{ref:n,element:o,width:r,sizing:l}=Jr(),[c,h]=a.useState(()=>Gr(s)),[p,u]=a.useState(null),d=a.useRef(null),k=Kr(c,r,l),f=r===null||(l.maxPct-l.minPct)/100*r<Zr,g=t!==!1;a.useEffect(Yr,[]);const y=a.useRef(!1);a.useLayoutEffect(()=>{var b;y.current&&((b=d.current)==null||b.resize(k))},[k,g]);const x=a.useRef(null),N=()=>{var D;const b=(D=d.current)==null?void 0:D.getSize(),T=x.current;if(x.current=null,b===void 0||r===null||r<=0||T===b)return;const _=Math.round(b/100*r);h(_),Vr(s,_)},m=p??k;return a.useLayoutEffect(()=>{const b=o==null?void 0:o.querySelector(`[data-panel-resize-handle-id="${it}"]`);b&&(b.setAttribute("aria-controls",at),b.setAttribute("aria-valuenow",String(Math.round(m))),b.setAttribute("aria-valuemin",String(Math.round(l.minPct))),b.setAttribute("aria-valuemax",String(Math.round(l.maxPct))))}),i.jsx("div",{ref:n,className:"h-full overflow-hidden",children:i.jsxs(ds,{direction:"horizontal",id:ve,onLayout:b=>{y.current=b.length>1,u(y.current?b[1]:null)},children:[i.jsx(Qe,{id:Xr,order:1,className:"flex",children:e}),g&&i.jsxs(i.Fragment,{children:[i.jsx(vs,{id:it,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:f,onDragging:b=>{var T;b&&(x.current=((T=d.current)==null?void 0:T.getSize())??null)},onKeyDownCapture:b=>{var T,_;f||(x.current=((T=d.current)==null?void 0:T.getSize())??null,!(b.key!=="Home"&&b.key!=="End")&&(b.preventDefault(),(_=d.current)==null||_.resize(b.key==="Home"?l.minPct:l.maxPct)))},onResizeEnd:N}),i.jsx(Qe,{ref:d,id:at,order:2,defaultSize:k,minSize:l.minPct,maxSize:l.maxPct,className:"flex",children:t})]})]})})}function xa({roomId:e,threadId:t,entrySeq:s,threadRoute:n,aboveTimeline:o,aboveComposer:r,offerJumpBackIn:l,onComposerFocusChange:c}){const h=ms(),p=Rs(),u=fs(e),d=u==null?void 0:u.rootEntryId,k=hr(),f=a.useCallback(()=>{var P;const v=(P=Y.getState().open[e])==null?void 0:P.rootEntryId;Y.getState().closeThread(e),v!==void 0&&k.arm(v)},[e,k]),g=a.useCallback(v=>{Y.getState().openThread(e,v)},[e]),y=ps(e),x=hs(e),N=co(e,x.isSuccess);Ts(e);const m=y.data,b=a.useMemo(()=>x.data??[],[x.data]),T=qt({room:m});gr({roomId:e,route:n,urlThreadId:t,openThreadId:d,entries:b,historyLoaded:x.isSuccess});const _=a.useMemo(()=>{var v;return((v=m==null?void 0:m.members.find(P=>P.author.id===m.viewerAuthorId))==null?void 0:v.lastReadSeq)??null},[m]),D=mr(e,_);gs(m,b);const C=a.useRef(null),S=a.useRef(void 0),O=a.useCallback(v=>{S.current=v},[]),I=a.useCallback(()=>S.current,[]);a.useLayoutEffect(()=>{S.current=void 0},[e]);const $=a.useCallback(v=>{var P;(P=C.current)==null||P.scrollToRow(v)},[]),L=ho(e),{loadOlder:E,cursor:q}=L,F=a.useCallback(()=>{const v=To(b,q);E().then(()=>{v!==null&&requestAnimationFrame(()=>{var P;return(P=C.current)==null?void 0:P.scrollToRow(v.domId)})})},[b,q,E]),H=ur({roomId:e,entrySeq:s,entries:b,historyLoaded:x.isSuccess}),W=a.useMemo(()=>d===void 0?void 0:{replyIds:new Set(b.filter(P=>Z(P)===d).map(P=>P.id)),inside:!1},[b,d]);if(y.isLoading)return i.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:i.jsx(Bt,{})});if(y.isError||!m)return i.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[i.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),i.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const B=u!==void 0&&i.jsx(Fr,{room:m,rootEntryId:u.rootEntryId,focusComposer:u.focusComposer,entries:b,reactionFrequents:m.reactionFrequents,streamStalled:N.stalled,streamUnavailable:N.unavailable,onRetryStream:N.retry,historyLoaded:x.isSuccess,historyFailed:x.isError,...H.threadRow===void 0?{}:{landOnRow:H.threadRow},pushed:h,onClose:f},u.rootEntryId),z=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[o,i.jsx(cr,{ref:C,roomId:m.id,roomName:se(m),viewerAuthorId:m.viewerAuthorId,entries:b,members:m.members,formerAuthors:m.formerAuthors,lastReadSeq:D,reactionFrequents:m.reactionFrequents,streamStalled:N.stalled,isLoading:x.isLoading,error:x.error,onAddAgents:()=>Ye("add",m.id),openThreadId:d,onOpenThread:g,resumeRow:I,...H.roomRow===void 0?{}:{landOnRow:H.roomRow},onTopRow:O,canLoadOlder:L.canLoadOlder,isLoadingOlder:L.isLoadingOlder,onLoadOlder:F}),r,i.jsx(Er,{roomId:m.id}),i.jsx(Or,{roomId:m.id}),i.jsx(Kt,{room:m,entries:b,scope:W,laneScope:"room",stalled:N.stalled,unavailable:N.unavailable,onRetry:N.retry,onScrollToRow:$}),i.jsx(_r,{room:m,hasEntries:b.length>0,onAddAgents:()=>Ye("add",m.id)}),i.jsx(Wt,{room:m,attachments:T.attachments,offerJumpBackIn:l,onFocusChange:c},m.id)]}),w={surface:"room",capabilities:ze,target:T.target,anchor:"rail"};return h?i.jsx(X.Root,{...w,children:i.jsx(Ce,{initial:!1,mode:"wait",children:i.jsx(Oe.div,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:16},transition:{duration:.15,ease:[0,0,.2,1]},style:{paddingBottom:p},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:B===!1?z:B},B?`thread-${d}`:"room")})}):i.jsx(X.Root,{...w,children:i.jsx(ea,{room:z,thread:B})})}export{Tt as I,Bt as R,Io as T,xa as a,ie as i};
|