dorkos 0.126.3 → 0.127.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 +7771 -7141
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-ycWTfXI8.js → AboutPage-BnnwvwU1.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DBecAo4-.js → ActivityErrorState-DW-plne9.js} +1 -1
- package/dist/client/assets/{ActivityPage-CGuIeDGm.js → ActivityPage-BMrtNC9t.js} +1 -1
- package/dist/client/assets/{ActivityRow-BRiUvjHA.js → ActivityRow-BnBDxJqK.js} +1 -1
- package/dist/client/assets/{AdapterIcon-z6z9LKwd.js → AdapterIcon-J2UUIfEX.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-MDV6zwYC.js +2 -0
- package/dist/client/assets/{AgentOptionRow-BLuSwpNh.js → AgentOptionRow-Dj2MlE6E.js} +1 -1
- package/dist/client/assets/{AgentPicker-DazquIgR.js → AgentPicker-D6MsFN_H.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BoRmxLKy.js → AgentRequestCard-BTyuNOhU.js} +1 -1
- package/dist/client/assets/{AppearancePage-BMiVpe48.js → AppearancePage-DJfJUAkw.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-BHIrnfPf.js → ApplyToOverridesDialog-Akw0_458.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-CjN8lCWI.js → AttentionSignalRow-Cx9-sStN.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMBnO0fv.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CRlmlore.js} +3 -3
- package/dist/client/assets/BindingDialog-ZAX-h6D4.js +1 -0
- package/dist/client/assets/{BlintzCanvas-Dd3bC9vw.js → BlintzCanvas-fEMJgpNx.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-B2S75f6B.js → CanvasCsvContent-CUoIFG7g.js} +3 -3
- package/dist/client/assets/{CanvasFileContent-CVSfg4MO.js → CanvasFileContent-Cg2jcXse.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-CNmJsBTS.js → CanvasModel3dContent-BL-UiHAj.js} +2 -2
- package/dist/client/assets/ChannelComposer-BHxXoQwT.js +44 -0
- package/dist/client/assets/{ChatAppsOff-D7anOG3n.js → ChatAppsOff-CSSu_yVC.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-CfOmRCky.js → CodeMirrorDiff-dfcDpguR.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-Cyz227_1.js → CodeMirrorEditor-C1YQ35ki.js} +1 -1
- package/dist/client/assets/{CommitmentList-DKo1Fb1A.js → CommitmentList-B6RG_hWB.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-DIcEZ2ka.js → CommitmentsPage-CDFvo1lt.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Ck7rJ-SP.js → ComputerResourceView-vJ8UfRNm.js} +1 -1
- package/dist/client/assets/{ComputerViewer-Dw_VpNjD.js → ComputerViewer-BTqPuZyh.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-CETLVH7o.js → ConnectionAccessLists-DPnmOuiA.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-ZVWDffcl.js → ConnectionsPage-CSHnGkha.js} +2 -2
- package/dist/client/assets/{ConventionPage-DkJ91wrN.js → ConventionPage-C6WsAvm4.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-FbJo1Qc0.js → ExtensionPageRoute-CGjw2Cwy.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-DCLR3iKw.js → FloatingTanStackRouterDevtools-CqogiFob-CKlmwuIc.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-Buy5XlH7.js → ForwardConsentHost-D8rVtTRp.js} +1 -1
- package/dist/client/assets/HandlePage-BciCIffv.js +1 -0
- package/dist/client/assets/{HeartbeatPage-GXBEcZoJ.js → HeartbeatPage-DQImR4dY.js} +1 -1
- package/dist/client/assets/{KeyEntry-g2VQ33KW.js → KeyEntry-BerpQFQT.js} +1 -1
- package/dist/client/assets/{LexicalField-CLd77PuB.js → LexicalField-CkcKNJGL.js} +1 -1
- package/dist/client/assets/{ManagesPage-qCwzJ4Cx.js → ManagesPage-CV4xieFk.js} +1 -1
- package/dist/client/assets/{Marketplace-DdkdIVPQ.js → Marketplace-Cp0e4Nv8.js} +4 -4
- package/dist/client/assets/{MarketplaceSourcesView-D44G21ff.js → MarketplaceSourcesView-ZBNnVSuv.js} +1 -1
- package/dist/client/assets/{McpAppFrame-DVNWJHrn.js → McpAppFrame-BtKAUDBg.js} +2 -2
- package/dist/client/assets/{McpSigninBody-BO0OkvOw.js → McpSigninBody-DjGrp_sO.js} +1 -1
- package/dist/client/assets/{Model3dViewer-Cvcyx2yv.js → Model3dViewer-BSX1QGsE.js} +1 -1
- package/dist/client/assets/NamePage-tBV32PJI.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-C_hXtliM.js → NewDirectMessageMenu-DTQ7vFsa.js} +1 -1
- package/dist/client/assets/{NotificationsPage-DP4HAVMA.js → NotificationsPage-q7BDVKOz.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-0Mkl8abo.js → OpenMeshSwitch-aAMKDAyc.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-BRftJqRq.js → OperatorIdentityForm-CCAvadEZ.js} +1 -1
- package/dist/client/assets/{PermissionHistory-Czl5PWN3.js → PermissionHistory-_8m4ohGq.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DAsbrl6Q.js → PermissionsPage-DHl8sCfQ.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-liTJ0Lns.js → PersonalityPopover-DOql0nWB.js} +1 -1
- package/dist/client/assets/PhotoPage-DtX2GEvQ.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-DcD1EY2c.js → PreviewRefusedNotice-BfvSYL-w.js} +1 -1
- package/dist/client/assets/{ProfileFields-Bi_AfHOE.js → ProfileFields-CX2mdPAV.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-BIbOulLu.js → ProfilePanelContainer-Cj_57NEG.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-BadkFi4V.js → ProfileRolePicker-D7F0PDw9.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-C653MlaU.js → PromptSuggestionChips-BopMvYe7.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-dIbt6aes.js → ReportsToPopover-CG_hjT_U.js} +1 -1
- package/dist/client/assets/{RoomSurface-CssMcozl.js → RoomSurface-Mt3dk4_6.js} +1 -1
- package/dist/client/assets/{RoomsPage-CxwTRRNu.js → RoomsPage-ByHhS_HA.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-lp8n4lgI.js → RunsOnPopover-DS8_Au0B.js} +1 -1
- package/dist/client/assets/RuntimeConnectFlow-hhvWVRMu.js +1 -0
- package/dist/client/assets/{RuntimeSetupDialog-E6f7Rd2W.js → RuntimeSetupDialog-NKy3mLEH.js} +1 -1
- package/dist/client/assets/SeenDevices-65oxnxk6.js +19 -0
- package/dist/client/assets/{SessionsPage-BNZTufty.js → SessionsPage-WbWf0huR.js} +1 -1
- package/dist/client/assets/SettingsDialog-e33ltTb6.js +12 -0
- package/dist/client/assets/{SkillsPage-DiqUOZup.js → SkillsPage-Cj3XrV8s.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-5gb-f-Uo.js → TaskDialogWrapper-DJAGQuab.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-g-CavcMv.js → TasksEmptyState-DNI1C274.js} +2 -2
- package/dist/client/assets/{TasksPage-BexV_pxB.js → TasksPage-Dc1j_X1K.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-BFYqGL-G.js → TeamComputerEntry-DWenh1bP.js} +1 -1
- package/dist/client/assets/{ToolsPage-Dxt6qOdF.js → ToolsPage-CXKq_axq.js} +2 -2
- package/dist/client/assets/{TopologyGraph-Cx_6gdbV.js → TopologyGraph-DgTGLoaA.js} +3 -3
- package/dist/client/assets/TourHost-C4KKDX9k.js +1 -0
- package/dist/client/assets/{UnlinkDialog-fgubvOUd.js → UnlinkDialog-GfsbP91q.js} +1 -1
- package/dist/client/assets/{UnreadDivider-BoLcTO_Z.js → UnreadDivider-C52_nmrB.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-CgRMeAEO.js → WidgetErrorCard-BZkAK-Ke.js} +3 -3
- package/dist/client/assets/{WithheldExtensionsNotice-CFHBDyIh.js → WithheldExtensionsNotice-Dt51QZLT.js} +1 -1
- package/dist/client/assets/{WorkView-5jzcnod5.js → WorkView-YozVoXhb.js} +15 -15
- package/dist/client/assets/{_shell-DFfXd1ys.js → _shell-BScdINMH.js} +2 -2
- package/dist/client/assets/{_shell._home-D2GJeGbi.js → _shell._home-CUusDXBM.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-DRXBBtAq.js → _shell._home.activity-DPjJ1_vZ.js} +1 -1
- package/dist/client/assets/_shell._home.index-CTBWy5Au.js +3 -0
- package/dist/client/assets/{_shell._home.tasks-Cr4gak8T.js → _shell._home.tasks-DWFh5Qbq.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-DbWciI1g.js → _shell._home.workspaces-DWjB1sCd.js} +1 -1
- package/dist/client/assets/{_shell.channels-C31Txlqh.js → _shell.channels-C6v3yOzH.js} +1 -1
- package/dist/client/assets/_shell.connections-jXaP35mN.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-CQc7aVrV.js → _shell.feedback-requests-CyV-aboj.js} +1 -1
- package/dist/client/assets/_shell.marketplace-Cp2Udmlv.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-Dg0YgG-u.js +1 -0
- package/dist/client/assets/_shell.session-DyKnijqi.js +1 -0
- package/dist/client/assets/{_shell.team-BlLU5BMC.js → _shell.team-BPevCu33.js} +4 -4
- package/dist/client/assets/{_shell.threads-YmF9dQnZ.js → _shell.threads-gzYSpt7x.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-BA0u_ZTU.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-BA0u_ZTU.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-DLiXaMmC.js → abnfDiagram-WEYOIA3C-iUnN9Com.js} +1 -1
- package/dist/client/assets/{access-copy-xWnaUps1.js → access-copy-CP0B1ZT9.js} +1 -1
- package/dist/client/assets/{arc-AndXXvZc.js → arc-BVSQ4HBO.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-CM4tGveM.js → architectureDiagram-ZHVYKT53-_zlUU8PS.js} +1 -1
- package/dist/client/assets/{banner-BH1gXPTc.js → banner-DTCBttcQ.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DenkdFXV.js → blockDiagram-RJAE7QA3-COqNq2ny.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-DMAlFuoX.js → c4Diagram-XDPPPE54-Caa3QxQ_.js} +1 -1
- package/dist/client/assets/{card-TbpEl6EH.js → card-D9DO5nt4.js} +1 -1
- package/dist/client/assets/channel-CenDG0-I.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-u0q5vCEc.js → chunk-2E7WHVMD-BqirxZIN.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-DBTggfjR.js → chunk-2Q5K7J3B-CYGt3XQf.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-zu55wq-c.js → chunk-4EMNKR2T-Bx234GPP.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-XLIA3Qss.js → chunk-55XCU76K-CAA7du3_.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DmGjbtZg.js → chunk-5VM5RSS4-Dxl-FvVz.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-ikMrk6md.js → chunk-JWPE2WC7-CjcTenhr.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-cfwin8SC.js → chunk-VQ5W62QI-COdK9J2i.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-Cn3e0QEQ.js → chunk-XXDRQBXY-DeXzMeSy.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-7RkBP94K.js → chunk-ZCHMQSOR-C7r0u2k6.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-CqVol7t8.js → classDiagram-v2-4MYWR3UA-BSI2Eza3.js} +1 -1
- package/dist/client/assets/{command-2pl_Cn7b.js → command-C7Cl56dV.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-m0tmlDnx.js → cose-bilkent-JH36ORCC-CLzQXbOG.js} +1 -1
- package/dist/client/assets/{cpu-CdCfSlSR.js → cpu-CLfYM0zq.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-Cf7ajLou.js → cynefin-EF2NZ3EQ-e_0nKhb5.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-Dl8GJr0l.js → cynefinDiagram-WF24UDRP-Cflfw_GE.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-2yAF6nW_.js → dagre-NK4GIZVX-D66Simjb.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-DaBb9JFm.js → diagram-CBK3MWTC-CJEeUCUY.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-BMeCfhD1.js → diagram-I5XIIV2D-BPSiDLoN.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-ClVKCieB.js → diagram-ODIL2UCW-DJptgW_s.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-DFIKk-tB.js → diagram-PFBEJUXE-BECklqVg.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-DzC_xtYu.js → diagram-RJA3I4VV-B-veBl7Z.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-BroMVHm2.js → diagram-TYUNFSNR-U8kleemE.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-GMsyIh86.js → ebnfDiagram-V4P3TTPT-DlwBfJCe.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-DIpw6SW5.js → elk-QONTBCTQ-DnFzEb3y.js} +1 -1
- package/dist/client/assets/{empty-state-B7ufhAFk.js → empty-state-2mQX7azC.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-CsezeWpx.js → erDiagram-KYQIGQAA-CYTM37Ws.js} +1 -1
- package/dist/client/assets/{execution-config-DRqIsff0.js → execution-config-COqY7hHn.js} +1 -1
- package/dist/client/assets/{file-DHPgnMgj.js → file-CKSjJRX5.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DtjBa2XX.js → file-exclamation-point-ad7FedZ9.js} +1 -1
- package/dist/client/assets/{file-text-wmrSy3Io.js → file-text-DXPPkxAL.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-Bv9D10ve.js → find-latest-widget-fence-BsDq4SYp.js} +3 -3
- package/dist/client/assets/{flowDiagram-IUGLLWBU-BGwNqglr.js → flowDiagram-IUGLLWBU-DD259OPj.js} +1 -1
- package/dist/client/assets/{form-CA_eiUg-.js → form-C9cPRNOV.js} +1 -1
- package/dist/client/assets/{format-cron-YPhIy57w.js → format-cron-DIw9_M6c.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-4IlzTCzA.js → ganttDiagram-R7GPNTJY-BmoAVY6N.js} +1 -1
- package/dist/client/assets/{git-branch-BLIYLcM4.js → git-branch-DlUQMA-U.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-HeaC8vlP.js → gitGraphDiagram-PDYL7XHY-Db8GGxGr.js} +1 -1
- package/dist/client/assets/{graph-Ch9lnHSS.js → graph-BqwkokGk.js} +1 -1
- package/dist/client/assets/{heart-D4fTvM5q.js → heart-CRoafWCm.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-KPma22SA.js → highlighted-body-KPVGNVTW-D-QIuqsv.js} +1 -1
- package/dist/client/assets/{image-lightbox-DI18fB2Q.js → image-lightbox-BZBT_ptW.js} +1 -1
- package/dist/client/assets/{image-off-DRgXXpgv.js → image-off-Bc6AP3w0.js} +1 -1
- package/dist/client/assets/{index-3UGWygRZ.js → index-78G8l1M7.js} +1 -1
- package/dist/client/assets/{index-C-X6jaVm.js → index-AxYQRAoO.js} +1 -1
- package/dist/client/assets/index-B48IJBNm.js +1058 -0
- package/dist/client/assets/{index-DuvW22xi.js → index-BHNwprrd.js} +1 -1
- package/dist/client/assets/{index-CucieFDK.js → index-B_i3pTpf.js} +1 -1
- package/dist/client/assets/{index-mRMaqxu5.js → index-Be3_cvW0.js} +1 -1
- package/dist/client/assets/{index-EDXuyCOT.js → index-BeCzlnZ3.js} +1 -1
- package/dist/client/assets/{index--2mMmier.js → index-Bw1l5I4w.js} +1 -1
- package/dist/client/assets/{index-DHZS9Lod.js → index-BwOvHDL2.js} +1 -1
- package/dist/client/assets/{index-Dbujw1c2.js → index-ByyXrDny.js} +1 -1
- package/dist/client/assets/{index-Ix2nCAz0.js → index-CFV7Ggyj.js} +1 -1
- package/dist/client/assets/index-CMWttCLt.js +1 -0
- package/dist/client/assets/{index-ClbMjgcZ.js → index-CNsZn6QE.js} +1 -1
- package/dist/client/assets/{index-2J89pJxF.js → index-CTFwtIJP.js} +1 -1
- package/dist/client/assets/{index-qEI7Rsr1.js → index-CWfreKgt.js} +1 -1
- package/dist/client/assets/{index-DTRAR0KK.js → index-CWx_JEio.js} +1 -1
- package/dist/client/assets/{index-CTTaeOCw.js → index-CZ4wx2F3.js} +1 -1
- package/dist/client/assets/{index-B_56Srtt.js → index-Clr1ssap.js} +1 -1
- package/dist/client/assets/{index-D9w0FBQG.js → index-CoFRHepD.js} +1 -1
- package/dist/client/assets/{index-zvAbU6ah.js → index-CptdhVbC.js} +1 -1
- package/dist/client/assets/{index-Dy9bWvna.js → index-Cpy9wOYc.js} +1 -1
- package/dist/client/assets/{index-COoO8dzi.js → index-Cs9yQ5zH.js} +1 -1
- package/dist/client/assets/{index-QSo53dH-.js → index-Cx2slDvh.js} +1 -1
- package/dist/client/assets/{index-rPJ8b_DO.js → index-DDGc0Nfu.js} +1 -1
- package/dist/client/assets/{index-B-4XmK5Q.js → index-DMlo5rLX.js} +1 -1
- package/dist/client/assets/index-DSt16Y0s.js +1 -0
- package/dist/client/assets/{index-D0cIffaH.js → index-DV5hFlfw.js} +1 -1
- package/dist/client/assets/index-DfWZORsm.js +1 -0
- package/dist/client/assets/{index-CujX3mpY.css → index-Dry_agqN.css} +1 -1
- package/dist/client/assets/{index-uG06zgQo.js → index-Dtb34mrg.js} +1 -1
- package/dist/client/assets/{index-DpvGUFpV.js → index-DwyVu2Mh.js} +1 -1
- package/dist/client/assets/{index-BY0SKYuc.js → index-Hf3kLtiJ.js} +1 -1
- package/dist/client/assets/{index-BmlBYrxT.js → index-a8LKmWxN.js} +1 -1
- package/dist/client/assets/{index-C3IsCAxA.js → index-bSzhhjtG.js} +1 -1
- package/dist/client/assets/{index-BtRM2yox.js → index-eF6QtmU6.js} +1 -1
- package/dist/client/assets/{index-BAd8jUzo.js → index-jIAsl-Y5.js} +2 -2
- package/dist/client/assets/{index-DbV3-jog.js → index-mrbr3BaJ.js} +1 -1
- package/dist/client/assets/{index-CRCfkwyN.js → index-okP_lDUw.js} +1 -1
- package/dist/client/assets/{index-JoxvTUfo.js → index-sCJ7YWzB.js} +3 -3
- package/dist/client/assets/index-sZ8Dddnp.js +1 -0
- package/dist/client/assets/{index-uy36h8lC.js → index-x0XGESNQ.js} +1 -1
- package/dist/client/assets/{index-bzM-k5lI.js → index-y1yAU07O.js} +1 -1
- package/dist/client/assets/{index-DSIdPh8G.js → index-zIfhHvVv.js} +1 -1
- package/dist/client/assets/{index-jk2K24il.js → index-zSj20f3H.js} +1 -1
- package/dist/client/assets/{index.esm-CxXuMuQv.js → index.esm-uC5dql6Q.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-g9EeD2xH.js → infoDiagram-MVDRKAX5-y6U3OQ5m.js} +1 -1
- package/dist/client/assets/{inline-code-14c1Gacs.js → inline-code-BCFlKPIb.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-Zv5DrRnv.js → ishikawaDiagram-HPEHV2GE-D32SA0vX.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-COiWWTez.js → journeyDiagram-BOSHW7O7-D1X0dI8X.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-DnQa8qXB.js → kanban-definition-FNSA4HC5-gU9KcKa4.js} +1 -1
- package/dist/client/assets/{layers-D_NEJsnH.js → layers-A4MxcGWV.js} +1 -1
- package/dist/client/assets/{lightbulb-EadQi_Lr.js → lightbulb-Dh2dYHMS.js} +1 -1
- package/dist/client/assets/{link-2-DugR2HHU.js → link-2-qEUih2FP.js} +1 -1
- package/dist/client/assets/{list-runtime-types-iJaKcim4.js → list-runtime-types-B1J9AtqH.js} +1 -1
- package/dist/client/assets/{markdown-content-BFHUHPgi.js → markdown-content-BA0KEJH_.js} +1 -1
- package/dist/client/assets/mention-pill-0aHe3D1A.js +1 -0
- package/dist/client/assets/{mermaid.core-C6ckWvkG.js → mermaid.core-Birdr1kF.js} +4 -4
- package/dist/client/assets/{message-square-off-BH8wbm2a.js → message-square-off-DvVenheW.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-DV4PNLc-.js → mindmap-definition-6OY57UG3-CLlh3nSF.js} +1 -1
- package/dist/client/assets/{more-details-DhdX4DGU.js → more-details-Bo2AAXHj.js} +1 -1
- package/dist/client/assets/{owner-notice-FMj3k7-f.js → owner-notice-DReCUEf1.js} +1 -1
- package/dist/client/assets/{package-0mI7-RiJ.js → package-CxZe6vve.js} +1 -1
- package/dist/client/assets/{page-container-DRyYoDkA.js → page-container-Bx1sr900.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-OBc3uYxQ.js → pane-resize-handle-ojhYGmDs.js} +1 -1
- package/dist/client/assets/{paperclip-BsTJpkyE.js → paperclip-D3-8ygf1.js} +1 -1
- package/dist/client/assets/{path-input-CFm1b1pk.js → path-input-D_o1_pAa.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-Cboo0f6B.js → pegDiagram-ECIUJNBX-BeMd_oXJ.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CiihSor1.js → pieDiagram-GNMPY74T-CXUXnp_A.js} +1 -1
- package/dist/client/assets/{plug-BdnJAo1j.js → plug-Du5LK0oZ.js} +1 -1
- package/dist/client/assets/primer-trigger-BxofQe1n.js +3 -0
- package/dist/client/assets/{profile-errors-B08zStmk.js → profile-errors-C0BgTjzk.js} +1 -1
- package/dist/client/assets/{progress-CpiQE0rv.js → progress-AKcr8opu.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-dF0oKeMn.js → quadrantDiagram-D57K4MC3-FTkKRlZm.js} +1 -1
- package/dist/client/assets/{query-error-state-B0RUeb10.js → query-error-state-CRmZMMkL.js} +1 -1
- package/dist/client/assets/{radio-CAGXbJK_.js → radio-DQHR6Su5.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-ClkFJVq1.js → railroadDiagram-Y72NRBL7-D5TdGrPg.js} +1 -1
- package/dist/client/assets/{registry-Cog_2xvt.js → registry-BxY1lah6.js} +4 -4
- package/dist/client/assets/registry-CWK5lzYs.js +1 -0
- package/dist/client/assets/relay-trace-schemas---fuhTF2.js +6 -0
- package/dist/client/assets/{repeat-Dag80z5v.js → repeat-zL9y24zY.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-Cey6FmFd.js → requirementDiagram-EQYSW5RA-Dxiv9lE0.js} +1 -1
- package/dist/client/assets/{room-files-source-BKUFMU_b.js → room-files-source-B0WR4gIC.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-egrvXlKX.js → rotate-ccw-clock-BUhy2_cF.js} +1 -1
- package/dist/client/assets/{rotate-cw-Po-L3HFe.js → rotate-cw-CCrNd4eJ.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-BsIuHjbJ.js → sankeyDiagram-SY24JHO5-C3jjstXq.js} +1 -1
- package/dist/client/assets/{scroll-area-C7vKp2H4.js → scroll-area-D6gNpFjK.js} +1 -1
- package/dist/client/assets/search-x-CUZ1LRYe.js +6 -0
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BJZXJxwu.js → sequenceDiagram-BLEHNHQU-CIDmjz0x.js} +1 -1
- package/dist/client/assets/{shield-x-hHpT8rAA.js → shield-x-Ch7sY2XD.js} +1 -1
- package/dist/client/assets/{signed-in-BhArfIJC.js → signed-in-BQ44fFH5.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-DYCQyn7S.js → sizeCapture-INFHLROL-Dkp-75Wy.js} +1 -1
- package/dist/client/assets/{soul-file-Doekkv7n.js → soul-file-CTFcpRMh.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-C6bUDAO7.js → stateDiagram-v2-A6IESKWZ-L_51UnwV.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-DGyTrJBT.js → swimlanes-B3ENRKFQ-D-etAQQd.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-zjIBWGY4.js +8 -0
- package/dist/client/assets/{table-9KRGRv_s.js → table-D6BUawIb.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-CHAJwSq6.js → timeline-definition-JXYKGLGB-DNxnC3VG.js} +1 -1
- package/dist/client/assets/{trust-posture-BQE9NSf_.js → trust-posture-5IWBJmA5.js} +1 -1
- package/dist/client/assets/{unplug-CklGWwz7.js → unplug-BVIT6OSL.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-9mykZSlO.js → unverified-catalog-notice-BA7_V-80.js} +1 -1
- package/dist/client/assets/{use-bindings-CPbqKyo6.js → use-bindings-DdWRXvtd.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-C7v03Xx_.js → use-composer-prefs-DC5w4eWw.js} +1 -1
- package/dist/client/assets/{use-connector-management-COqWo76Y.js → use-connector-management-DDlpD6tk.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-BuYR3PaO.js → use-deep-link-scroll-Cvv0VcXx.js} +1 -1
- package/dist/client/assets/{use-delete-binding-Dfz8BlLn.js → use-delete-binding-D585ISkL.js} +1 -1
- package/dist/client/assets/{use-dev-links-Cu2JmM-_.js → use-dev-links-BwS5hgur.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-DobIp_O4.js → use-direct-message-panel--unflmj8.js} +1 -1
- package/dist/client/assets/use-external-adapter-catalog-DUyh1bH1.js +1 -0
- package/dist/client/assets/use-full-activity-feed-DsNOIkL8.js +1 -0
- package/dist/client/assets/use-is-below-desktop-C-4kc5lS.js +1 -0
- package/dist/client/assets/{use-local-browser-DPdkgs06.js → use-local-browser-DGIut7R4.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-Ci7r-pAi.js → use-mesh-topology-DNXD7seM.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-CWXhSyZ8.js → use-mounted-ref-7xoMthh4.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-GJ2coibL.js → use-notification-prefs-CzibxpTZ.js} +1 -1
- package/dist/client/assets/use-pending-read-BTR5-HXf.js +1 -0
- package/dist/client/assets/{use-personality-commit-Da2BJ_58.js → use-personality-commit-isaMS7W5.js} +1 -1
- package/dist/client/assets/{use-promo-activation-D4PAd7pd.js → use-promo-activation-DesLEeyi.js} +3 -3
- package/dist/client/assets/{use-promo-dismissals-BCBu0s3k.js → use-promo-dismissals-DQi8tey8.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CHLSUL-h.js → use-pulse-freshness-DPplpvcq.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-BSijPV3c.js → use-room-follow-claim-C4UikQzz.js} +1 -1
- package/dist/client/assets/{use-room-sessions-CNqHgLVa.js → use-room-sessions-C6wsszcG.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-EsqX22Ik.js → use-roving-tab-list-DEh387tR.js} +1 -1
- package/dist/client/assets/{use-session-canvas-DAGOz8a6.js → use-session-canvas-B2CM1KZu.js} +8 -8
- package/dist/client/assets/{use-status-budget-CHln-8aP.js → use-status-budget-CltxSIUD.js} +3 -3
- package/dist/client/assets/{use-transform-BmyqpcvO.js → use-transform-CNLqlc2h.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-9Clj_rwl.js → use-unclaimed-chats-DJyl7A1E.js} +1 -1
- package/dist/client/assets/use-update-config-B2rsDnxk.js +1 -0
- package/dist/client/assets/{useMutationState-B61VoWtY.js → useMutationState-BX-ggHVY.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-BUqj8rIH.js → usecaseDiagram-WPOLBNNX-2l6yZUUH.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-B09oli-Z.js → vennDiagram-Q3Y3IDCW-DIOfjNDq.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-BE7gzLdw.js → wardleyDiagram-IVAIDKWA-B5Hx1we8.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-CbGKfmuW.js → xychartDiagram-4URNHDU4-sy90CqIK.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +30051 -25401
- package/dist/server/index.js.map +2 -2
- package/package.json +9 -9
- package/dist/client/assets/AdapterSetupWizard-Cp56Zx24.js +0 -2
- package/dist/client/assets/BindingDialog-Bw55sMTh.js +0 -1
- package/dist/client/assets/ChannelComposer-7KpffyFv.js +0 -44
- package/dist/client/assets/HandlePage-CByGC3B8.js +0 -1
- package/dist/client/assets/NamePage-5VUtswMH.js +0 -1
- package/dist/client/assets/PhotoPage-DDcbiGjb.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-BAqkzthF.js +0 -1
- package/dist/client/assets/SeenDevices-xdR3YQNr.js +0 -19
- package/dist/client/assets/SettingsDialog-d7SQTDNy.js +0 -12
- package/dist/client/assets/TourHost-DvAjpsug.js +0 -1
- package/dist/client/assets/_shell._home.index-CA_GnaUK.js +0 -3
- package/dist/client/assets/_shell.connections-gfevZyC-.js +0 -1
- package/dist/client/assets/_shell.marketplace-BepG1fJe.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-BBQESbqU.js +0 -1
- package/dist/client/assets/_shell.session-DzeI9YIK.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-ByRocZjS.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-ByRocZjS.js +0 -1
- package/dist/client/assets/channel-5-dQamNX.js +0 -1
- package/dist/client/assets/index-B9X2-pzp.js +0 -1
- package/dist/client/assets/index-BMYGo6Ki.js +0 -1
- package/dist/client/assets/index-ButY6gKr.js +0 -1
- package/dist/client/assets/index-CgpRBcA4.js +0 -1
- package/dist/client/assets/index-p3WivF1M.js +0 -1053
- package/dist/client/assets/mention-pill-DXBno6EY.js +0 -1
- package/dist/client/assets/primer-trigger-BV4xZfFz.js +0 -3
- package/dist/client/assets/registry-DLWJMbtY.js +0 -1
- package/dist/client/assets/relay-trace-schemas-CNDSmhcJ.js +0 -6
- package/dist/client/assets/search-x-C_BEqIuX.js +0 -6
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DrZ99xGr.js +0 -8
- package/dist/client/assets/use-adapter-catalog-CDxy08u_.js +0 -1
- package/dist/client/assets/use-external-adapter-catalog-OLn4l20Q.js +0 -1
- package/dist/client/assets/use-full-activity-feed-DNrhQueu.js +0 -1
- package/dist/client/assets/use-is-below-desktop-7gY1n-47.js +0 -1
- package/dist/client/assets/use-pending-read-DcVJ8fZb.js +0 -1
- package/dist/client/assets/use-relay-config-C6rPlEud.js +0 -1
- package/dist/client/assets/use-update-config-T78vOnRy.js +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f3 as Ee,a1 as xe,aW as Re,r as ve,a2 as Se,j,G as Ce}from"./index-B48IJBNm.js";import{u as Oe}from"./index-ByyXrDny.js";import{r as Te}from"./use-session-canvas-B2CM1KZu.js";import"./rotate-cw-CCrNd4eJ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-uC5dql6Q.js";import"./WidgetErrorCard-BZkAK-Ke.js";import"./index-Hf3kLtiJ.js";import"./card-D9DO5nt4.js";import"./progress-AKcr8opu.js";import"./markdown-content-BA0KEJH_.js";import"./table-D6BUawIb.js";import"./package-CxZe6vve.js";import"./heart-CRoafWCm.js";import"./git-branch-DlUQMA-U.js";import"./file-text-DXPPkxAL.js";import"./file-CKSjJRX5.js";import"./McpAppFrame-BtKAUDBg.js";import"./more-details-Bo2AAXHj.js";var he={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.7.0
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
5
5
|
License: MIT
|
|
6
|
-
*/var Ie=he.exports,ke;function Ae(){return ke||(ke=1,(function(H,X){((G,m)=>{H.exports=m()})(Ie,function G(){var m=typeof self<"u"?self:typeof window<"u"?window:m!==void 0?m:{},C=!m.document&&!!m.postMessage,N=m.IS_PAPA_WORKER||!1,J={},Y=0,o={};function P(t){return t.charCodeAt(0)===65279?t.slice(1):t}function z(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var r=de(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new pe(r),(this._handle.streamer=this)._config=r}).call(this,t),this.parseChunk=function(e,r){var s=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<s){let g=this._config.newline;g||(i=this._config.quoteChar||'"',g=this._handle.guessLineEndings(e,i)),e=[...e.split(g).slice(s)].join(g)}this.isFirstChunk&&E(this._config.beforeFirstChunk)&&(i=this._config.beforeFirstChunk(e))!==void 0&&(e=i),this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e,i=(this._partialLine="",this._handle.parse(s,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=i.meta.cursor,s=(this._finished||(this._partialLine=s.substring(e-this._baseIndex),this._baseIndex=e),i&&i.data&&(this._rowCount+=i.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),N)m.postMessage({results:i,workerId:o.WORKER_ID,finished:s});else if(E(this._config.chunk)&&!r){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=i=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!s||!E(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||i&&i.meta.paused||this._nextChunk(),i}this._halted=!0},this._sendError=function(e){E(this._config.error)?this._config.error(e):N&&this._config.error&&m.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function re(t){var e;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),z.call(this,t),this._nextChunk=C?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),C||(e.onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)),e.ontimeout=$(this._chunkTimeout,this),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!C),this._config.downloadTimeout&&!C&&(e.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var r,s=this._config.downloadRequestHeaders;for(r in s)e.setRequestHeader(r,s[r])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+i));try{e.send(this._config.downloadRequestBody)}catch(g){this._chunkError(g.message)}C&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(r){r=e.statusText||r,this._sendError(new Error(r))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function oe(t){(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),z.call(this,t);var e,r,s=typeof FileReader<"u";this.stream=function(i){this._input=i,r=i.slice||i.webkitSlice||i.mozSlice,s?((e=new FileReader).onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var i=this._input,g=(this._config.chunkSize&&(g=Math.min(this._start+this._config.chunkSize,this._input.size),i=r.call(i,this._start,g)),e.readAsText(i,this._config.encoding));s||this._chunkLoaded({target:{result:g}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(e.error)}}function ie(t){var e;z.call(this,t=t||{}),this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){var r,s;if(!this._finished)return r=this._config.chunkSize,e=r?(s=e.substring(0,r),e.substring(r)):(s=e,""),this._finished=!e,this.parseChunk(s)}}function ue(t){z.call(this,t=t||{});var e=[],r=!0,s=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=$(function(i){try{e.push(typeof i=="string"?i:i.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(g){this._streamError(g)}},this),this._streamError=$(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=$(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function pe(t){var e,r,s,i,g=Math.pow(2,53),I=-g,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,w=this,A=0,u=0,D=!1,l=!1,d=[],n={data:[],errors:[],meta:{}};function F(p){return t.skipEmptyLines==="greedy"?p.join("").trim()==="":p.length===1&&p[0].length===0}function k(){if(n&&s&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),t.skipEmptyLines&&(n.data=n.data.filter(function(a){return!F(a)})),x()){let a=function(R){d.push(R)};if(n)if(Array.isArray(n.data[0])){for(var p=0;x()&&p<n.data.length;p++)n.data[p].forEach(a);n.data.splice(0,1)}else n.data.forEach(a)}function f(a,R){for(var O=t.header?{}:[],_=0;_<a.length;_++){var y=_,c=a[_],c=((q,h)=>(v=>(t.dynamicTypingFunction&&t.dynamicTyping[v]===void 0&&(t.dynamicTyping[v]=t.dynamicTypingFunction(v)),(t.dynamicTyping[v]||t.dynamicTyping)===!0))(q)?h==="true"||h==="TRUE"||h!=="false"&&h!=="FALSE"&&((v=>{if(U.test(v)&&(v=parseFloat(v),I<v&&v<g))return 1})(h)?parseFloat(h):Q.test(h)?new Date(h):h===""?null:h):h)(y=t.header?_>=d.length?"__parsed_extra":d[_]:y,c=t.transform?t.transform(c,y):c);y==="__parsed_extra"?(O[y]=O[y]||[],O[y].push(c)):O[y]=c}return t.header&&(_>d.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+_,u+R):_<d.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+d.length+" fields but parsed "+_,u+R)),O}var b;n&&(t.header||t.dynamicTyping||t.transform)&&(b=1,!n.data.length||Array.isArray(n.data[0])?(n.data=n.data.map(f),b=n.data.length):n.data=f(n.data,0),t.header&&n.meta&&(n.meta.fields=d),u+=b)}function x(){return t.header&&d.length===0}function M(p,f,b,a){p={type:p,code:f,message:b},a!==void 0&&(p.row=a),n.errors.push(p)}E(t.step)&&(i=t.step,t.step=function(p){n=p,x()?k():(k(),n.data.length!==0&&(A+=p.data.length,t.preview&&A>t.preview?r.abort():(n.data=n.data[0],i(n,w))))}),this.parse=function(p,f,b){var a=t.quoteChar||'"',a=(t.newline||(t.newline=this.guessLineEndings(p,a)),s=!1,t.delimiter?E(t.delimiter)&&(t.delimiter=t.delimiter(p),n.meta.delimiter=t.delimiter):((a=((R,O,_,y,c)=>{var q,h,v,Z;c=c||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var ee=0;ee<c.length;ee++){for(var
|
|
6
|
+
*/var Ie=he.exports,ke;function Ae(){return ke||(ke=1,(function(H,X){((G,m)=>{H.exports=m()})(Ie,function G(){var m=typeof self<"u"?self:typeof window<"u"?window:m!==void 0?m:{},C=!m.document&&!!m.postMessage,N=m.IS_PAPA_WORKER||!1,J={},Y=0,o={};function P(t){return t.charCodeAt(0)===65279?t.slice(1):t}function z(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var r=de(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new pe(r),(this._handle.streamer=this)._config=r}).call(this,t),this.parseChunk=function(e,r){var s=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<s){let g=this._config.newline;g||(i=this._config.quoteChar||'"',g=this._handle.guessLineEndings(e,i)),e=[...e.split(g).slice(s)].join(g)}this.isFirstChunk&&E(this._config.beforeFirstChunk)&&(i=this._config.beforeFirstChunk(e))!==void 0&&(e=i),this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e,i=(this._partialLine="",this._handle.parse(s,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=i.meta.cursor,s=(this._finished||(this._partialLine=s.substring(e-this._baseIndex),this._baseIndex=e),i&&i.data&&(this._rowCount+=i.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),N)m.postMessage({results:i,workerId:o.WORKER_ID,finished:s});else if(E(this._config.chunk)&&!r){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=i=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!s||!E(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||i&&i.meta.paused||this._nextChunk(),i}this._halted=!0},this._sendError=function(e){E(this._config.error)?this._config.error(e):N&&this._config.error&&m.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function re(t){var e;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),z.call(this,t),this._nextChunk=C?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),C||(e.onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)),e.ontimeout=$(this._chunkTimeout,this),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!C),this._config.downloadTimeout&&!C&&(e.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var r,s=this._config.downloadRequestHeaders;for(r in s)e.setRequestHeader(r,s[r])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+i));try{e.send(this._config.downloadRequestBody)}catch(g){this._chunkError(g.message)}C&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(r){r=e.statusText||r,this._sendError(new Error(r))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function oe(t){(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),z.call(this,t);var e,r,s=typeof FileReader<"u";this.stream=function(i){this._input=i,r=i.slice||i.webkitSlice||i.mozSlice,s?((e=new FileReader).onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var i=this._input,g=(this._config.chunkSize&&(g=Math.min(this._start+this._config.chunkSize,this._input.size),i=r.call(i,this._start,g)),e.readAsText(i,this._config.encoding));s||this._chunkLoaded({target:{result:g}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(e.error)}}function ie(t){var e;z.call(this,t=t||{}),this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){var r,s;if(!this._finished)return r=this._config.chunkSize,e=r?(s=e.substring(0,r),e.substring(r)):(s=e,""),this._finished=!e,this.parseChunk(s)}}function ue(t){z.call(this,t=t||{});var e=[],r=!0,s=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=$(function(i){try{e.push(typeof i=="string"?i:i.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(g){this._streamError(g)}},this),this._streamError=$(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=$(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function pe(t){var e,r,s,i,g=Math.pow(2,53),I=-g,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,w=this,A=0,u=0,D=!1,l=!1,d=[],n={data:[],errors:[],meta:{}};function F(p){return t.skipEmptyLines==="greedy"?p.join("").trim()==="":p.length===1&&p[0].length===0}function k(){if(n&&s&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),t.skipEmptyLines&&(n.data=n.data.filter(function(a){return!F(a)})),x()){let a=function(R){d.push(R)};if(n)if(Array.isArray(n.data[0])){for(var p=0;x()&&p<n.data.length;p++)n.data[p].forEach(a);n.data.splice(0,1)}else n.data.forEach(a)}function f(a,R){for(var O=t.header?{}:[],_=0;_<a.length;_++){var y=_,c=a[_],c=((q,h)=>(v=>(t.dynamicTypingFunction&&t.dynamicTyping[v]===void 0&&(t.dynamicTyping[v]=t.dynamicTypingFunction(v)),(t.dynamicTyping[v]||t.dynamicTyping)===!0))(q)?h==="true"||h==="TRUE"||h!=="false"&&h!=="FALSE"&&((v=>{if(U.test(v)&&(v=parseFloat(v),I<v&&v<g))return 1})(h)?parseFloat(h):Q.test(h)?new Date(h):h===""?null:h):h)(y=t.header?_>=d.length?"__parsed_extra":d[_]:y,c=t.transform?t.transform(c,y):c);y==="__parsed_extra"?(O[y]=O[y]||[],O[y].push(c)):O[y]=c}return t.header&&(_>d.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+_,u+R):_<d.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+d.length+" fields but parsed "+_,u+R)),O}var b;n&&(t.header||t.dynamicTyping||t.transform)&&(b=1,!n.data.length||Array.isArray(n.data[0])?(n.data=n.data.map(f),b=n.data.length):n.data=f(n.data,0),t.header&&n.meta&&(n.meta.fields=d),u+=b)}function x(){return t.header&&d.length===0}function M(p,f,b,a){p={type:p,code:f,message:b},a!==void 0&&(p.row=a),n.errors.push(p)}E(t.step)&&(i=t.step,t.step=function(p){n=p,x()?k():(k(),n.data.length!==0&&(A+=p.data.length,t.preview&&A>t.preview?r.abort():(n.data=n.data[0],i(n,w))))}),this.parse=function(p,f,b){var a=t.quoteChar||'"',a=(t.newline||(t.newline=this.guessLineEndings(p,a)),s=!1,t.delimiter?E(t.delimiter)&&(t.delimiter=t.delimiter(p),n.meta.delimiter=t.delimiter):((a=((R,O,_,y,c)=>{var q,h,v,Z;c=c||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var ee=0;ee<c.length;ee++){for(var W,se=c[ee],T=0,B=0,S=0,L=(v=void 0,new le({comments:y,delimiter:se,newline:O,preview:10}).parse(R)),V=0;V<L.data.length;V++)_&&F(L.data[V])?S++:(W=L.data[V].length,B+=W,v===void 0?v=W:0<W&&(T+=Math.abs(W-v),v=W));0<L.data.length&&(B/=L.data.length-S),1.99<B&&(h===void 0||T<h||T===h&&Z<B)&&(h=T,q=se,Z=B)}return{successful:!!(t.delimiter=q),bestDelimiter:q}})(p,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=a.bestDelimiter:(s=!0,t.delimiter=o.DefaultDelimiter),n.meta.delimiter=t.delimiter),de(t));return a.header=x(),t.preview&&t.header&&a.preview++,e=p,r=new le(a),n=r.parse(e,f,b),k(),D?{meta:{paused:!0}}:n||{meta:{paused:!1}}},this.paused=function(){return D},this.pause=function(){D=!0,r.abort(),e=E(t.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){w.streamer._halted?(D=!1,w.streamer.parseChunk(e,!0)):setTimeout(w.resume,3)},this.aborted=function(){return l},this.abort=function(){l=!0,r.abort(),n.meta.aborted=!0,E(t.complete)&&t.complete(n),e=""},this.guessLineEndings=function(R,a){R=R.substring(0,1048576);var a=new RegExp(ne(a)+"([^]*?)"+ne(a),"gm"),b=(R=R.replace(a,"")).split("\r"),a=R.split(`
|
|
7
7
|
`),R=1<a.length&&a[0].length<b[0].length;if(b.length===1||R)return`
|
|
8
8
|
`;for(var O=0,_=0;_<b.length;_++)b[_][0]===`
|
|
9
9
|
`&&O++;return O>=b.length/2?`\r
|
|
10
10
|
`:"\r"}}function ne(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(t){var e=(t=t||{}).delimiter,r=t.newline,s=t.comments,i=t.step,g=t.preview,I=t.fastMode,U=null,Q=!1,w=t.quoteChar==null?'"':t.quoteChar,A=w;if(t.escapeChar!==void 0&&(A=t.escapeChar),(typeof e!="string"||-1<o.BAD_DELIMITERS.indexOf(e))&&(e=","),s===e)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||-1<o.BAD_DELIMITERS.indexOf(s))&&(s=!1),r!==`
|
|
11
11
|
`&&r!=="\r"&&r!==`\r
|
|
12
12
|
`&&(r=`
|
|
13
|
-
`);var u=0,D=!1;this.parse=function(l,d,n){if(typeof l!="string")throw new Error("Input must be a string");var F=l.length,k=e.length,x=r.length,M=s.length,p=E(i),f=[],b=[],a=[],R=u=0;if(!l)return T();if(I||I!==!1&&l.indexOf(w)===-1){for(var O=l.split(r),_=0;_<O.length;_++){if(a=O[_],u+=a.length,_!==O.length-1)u+=r.length;else if(n)return T();if(!s||a.substring(0,M)!==s){if(p){if(f=[],Z(a.split(e)),
|
|
13
|
+
`);var u=0,D=!1;this.parse=function(l,d,n){if(typeof l!="string")throw new Error("Input must be a string");var F=l.length,k=e.length,x=r.length,M=s.length,p=E(i),f=[],b=[],a=[],R=u=0;if(!l)return T();if(I||I!==!1&&l.indexOf(w)===-1){for(var O=l.split(r),_=0;_<O.length;_++){if(a=O[_],u+=a.length,_!==O.length-1)u+=r.length;else if(n)return T();if(!s||a.substring(0,M)!==s){if(p){if(f=[],Z(a.split(e)),B(),D)return T()}else Z(a.split(e));if(g&&g<=_)return f=f.slice(0,g),T(!0)}}return T()}for(var y=l.indexOf(e,u),c=l.indexOf(r,u),q=new RegExp(ne(A)+ne(w),"g"),h=l.indexOf(w,u);;)if(l[u]===w)for(h=u,u++;;){if((h=l.indexOf(w,h+1))===-1)return n||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:f.length,index:u}),W();if(h===F-1)return W(l.substring(u,h).replace(q,w));if(w===A&&l[h+1]===A)h++;else if(w===A||h===0||l[h-1]!==A){y!==-1&&y<h+1&&(y=l.indexOf(e,h+1));var v=ee((c=c!==-1&&c<h+1?l.indexOf(r,h+1):c)===-1?y:Math.min(y,c));if(l.substr(h+1+v,k)===e){a.push(l.substring(u,h).replace(q,w)),l[u=h+1+v+k]!==w&&(h=l.indexOf(w,u)),y=l.indexOf(e,u),c=l.indexOf(r,u);break}if(v=ee(c),l.substring(h+1+v,h+1+v+x)===r){if(a.push(l.substring(u,h).replace(q,w)),se(h+1+v+x),y=l.indexOf(e,u),h=l.indexOf(w,u),p&&(B(),D))return T();if(g&&f.length>=g)return T(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:f.length,index:u}),h++}}else if(s&&a.length===0&&l.substring(u,u+M)===s){if(c===-1)return T();u=c+x,c=l.indexOf(r,u),y=l.indexOf(e,u)}else if(y!==-1&&(y<c||c===-1))a.push(l.substring(u,y)),u=y+k,y=l.indexOf(e,u);else{if(c===-1)break;if(a.push(l.substring(u,c)),se(c+x),p&&(B(),D))return T();if(g&&f.length>=g)return T(!0)}return W();function Z(S){f.push(S),R=u}function ee(S){var L=0;return L=S!==-1&&(S=l.substring(h+1,S))&&S.trim()===""?S.length:L}function W(S){return n||(S===void 0&&(S=l.substring(u)),a.push(S),u=F,Z(a),p&&B()),T()}function se(S){u=S,Z(a),a=[],c=l.indexOf(r,u)}function T(S){if(t.header&&!d&&f.length&&!Q){var L=f[0],V=Object.create(null),fe=new Set(L);let me=!1;for(let te=0;te<L.length;te++){let K=P(L[te]);if(V[K=E(t.transformHeader)?t.transformHeader(K,te):K]){let ae,ye=V[K];for(;ae=K+"_"+ye,ye++,fe.has(ae););fe.add(ae),L[te]=ae,V[K]++,me=!0,(U=U===null?{}:U)[ae]=K}else V[K]=1,L[te]=K;fe.add(K)}me&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:f,errors:b,meta:{delimiter:e,linebreak:r,aborted:D,truncated:!!S,cursor:R+(d||0),renamedHeaders:U}}}function B(){i(T()),f=[],b=[]}},this.abort=function(){D=!0},this.getCharIndex=function(){return u}}function be(t){var e=t.data,r=J[e.workerId],s=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){s=!0,ge(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_e,resume:_e};if(E(r.userStep)){for(var g=0;g<e.results.data.length&&(r.userStep({data:e.results.data[g],errors:e.results.errors,meta:e.results.meta},i),!s);g++);delete e.results}else E(r.userChunk)&&(r.userChunk(e.results,i,e.file),delete e.results)}e.finished&&!s&&ge(e.workerId,e.results)}function ge(t,e){var r=J[t];E(r.userComplete)&&r.userComplete(e),r.terminate(),delete J[t]}function _e(){throw new Error("Not implemented.")}function de(t){if(typeof t!="object"||t===null)return t;var e,r=Array.isArray(t)?[]:{};for(e in t)r[e]=de(t[e]);return r}function $(t,e){return function(){t.apply(e,arguments)}}function E(t){return typeof t=="function"}return o.parse=function(t,e){var r=(e=e||{}).dynamicTyping||!1;if(E(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=!!E(e.transform)&&e.transform,e.downloadTimeout!==void 0){var r=parseInt(e.downloadTimeout);if(isNaN(r))throw new Error("Config downloadTimeout value ("+e.downloadTimeout+") not parsable by parseInt(val).");e.downloadTimeout=r}if(!e.worker||!o.WORKERS_SUPPORTED)return r=null,o.NODE_STREAM_INPUT,typeof t=="string"?(t=P(t),r=new(e.download?re:ie)(e)):t.readable===!0&&E(t.read)&&E(t.on)?r=new ue(e):(m.File&&t instanceof File||t instanceof Object)&&(r=new oe(e)),r.stream(t);(r=(()=>{var s;return!!o.WORKERS_SUPPORTED&&(s=(()=>{var i=m.URL||m.webkitURL||null,g=G.toString();return o.BLOB_URL||(o.BLOB_URL=i.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",g,")();"],{type:"text/javascript"})))})(),(s=new m.Worker(s)).onmessage=be,s.id=Y++,J[s.id]=s)})()).userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=E(e.step),e.chunk=E(e.chunk),e.complete=E(e.complete),e.error=E(e.error),delete e.worker,r.postMessage({input:t,config:e,workerId:r.id})},o.unparse=function(t,e){var r=!1,s=!0,i=",",g=`\r
|
|
14
14
|
`,I='"',U=I+I,Q=!1,w=null,A=!1,u=((()=>{if(typeof e=="object"){if(typeof e.delimiter!="string"||o.BAD_DELIMITERS.filter(function(d){return e.delimiter.indexOf(d)!==-1}).length||(i=e.delimiter),typeof e.quotes!="boolean"&&typeof e.quotes!="function"&&!Array.isArray(e.quotes)||(r=e.quotes),typeof e.skipEmptyLines!="boolean"&&typeof e.skipEmptyLines!="string"||(Q=e.skipEmptyLines),typeof e.newline=="string"&&(g=e.newline),typeof e.quoteChar=="string"&&(I=e.quoteChar,U=I+I),typeof e.header=="boolean"&&(s=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");w=e.columns}e.escapeChar!==void 0&&(U=e.escapeChar+I),e.escapeFormulae instanceof RegExp?A=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(A=/^[=+\-@\t\r].*$/)}})(),new RegExp(ne(I),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return D(null,t,Q);if(typeof t[0]=="object")return D(w||Object.keys(t[0]),t,Q)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||w),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),D(t.fields||[],t.data||[],Q);throw new Error("Unable to serialize unrecognized input");function D(d,n,F){var k="",x=(typeof d=="string"&&(d=JSON.parse(d)),typeof n=="string"&&(n=JSON.parse(n)),Array.isArray(d)&&0<d.length),M=!Array.isArray(n[0]);if(x&&s){for(var p=0;p<d.length;p++)0<p&&(k+=i),k+=l(d[p],p);0<n.length&&(k+=g)}for(var f=0;f<n.length;f++){var b=(x?d:n[f]).length,a=!1,R=x?Object.keys(n[f]).length===0:n[f].length===0;if(F&&!x&&(a=F==="greedy"?n[f].join("").trim()==="":n[f].length===1&&n[f][0].length===0),F==="greedy"&&x){for(var O=[],_=0;_<b;_++){var y=M?d[_]:_;O.push(n[f][y])}a=O.join("").trim()===""}if(!a){for(var c=0;c<b;c++){0<c&&!R&&(k+=i);var q=x&&M?d[c]:c;k+=l(n[f][q],c)}f<n.length-1&&(!F||0<b&&!R)&&(k+=g)}}return k}function l(d,n){var F,k,x;return d==null?"":d.constructor===Date?isNaN(d.getTime())?"":d.toISOString():(x=!1,A&&typeof d=="string"&&A.test(d)&&(d="'"+d,x=!0),k=(F=d.toString()).replace(u,U),(x=x||r===!0||typeof r=="function"&&r(d,n)||Array.isArray(r)&&r[n]||((M,p)=>{for(var f=0;f<p.length;f++)if(-1<M.indexOf(p[f]))return!0;return!1})(k,o.BAD_DELIMITERS)||-1<k.indexOf(i)||-1<F.indexOf(I)||k.charAt(0)===" "||k.charAt(k.length-1)===" ")?I+k+I:k)}},o.RECORD_SEP="",o.UNIT_SEP="",o.BYTE_ORDER_MARK="\uFEFF",o.BAD_DELIMITERS=["\r",`
|
|
15
15
|
`,'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!C&&!!m.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=le,o.ParserHandle=pe,o.NetworkStreamer=re,o.FileStreamer=oe,o.StringStreamer=ie,o.ReadableStreamStreamer=ue,N&&(m.onmessage=function(t){t=t.data,o.WORKER_ID===void 0&&t&&(o.WORKER_ID=t.workerId),typeof t.input=="string"?m.postMessage({workerId:o.WORKER_ID,results:o.parse(t.input,t.config),finished:!0}):(m.File&&t.input instanceof File||t.input instanceof Object)&&(t=o.parse(t.input,t.config))&&m.postMessage({workerId:o.WORKER_ID,results:t,finished:!0})}),(re.prototype=Object.create(z.prototype)).constructor=re,(oe.prototype=Object.create(z.prototype)).constructor=oe,(ie.prototype=Object.create(ie.prototype)).constructor=ie,(ue.prototype=Object.create(z.prototype)).constructor=ue,o})})(he)),he.exports}var De=Ae();const Le=Ee(De),we=32;function et({content:H}){const X=xe(),G=Re(P=>P.selectedCwd),m=ve.useMemo(()=>Te(H.src,P=>X.mediaUrl(G??"",P)),[H.src,X,G]),{data:C,error:N,isLoading:J}=Se({queryKey:["canvas-csv",m.url],enabled:m.url!==null,queryFn:async()=>{const P=await fetch(m.url);if(!P.ok)throw new Error(`Failed to load CSV (${P.status})`);const z=await P.text();return Le.parse(z.trim(),{skipEmptyLines:!0}).data},staleTime:6e4,retry:!1});if(m.url===null)return j.jsx(ce,{children:"This CSV source can’t be displayed here."});if(J)return j.jsx(ce,{children:"Loading CSV…"});if(N||!C||C.length===0)return j.jsx(ce,{children:"This CSV couldn’t be loaded."});const[Y,...o]=C;return j.jsx(je,{header:Y,rows:o})}function je({header:H,rows:X}){const G=ve.useRef(null),m=Oe({count:X.length,getScrollElement:()=>G.current,estimateSize:()=>we,overscan:12});return j.jsx("div",{ref:G,className:"h-full overflow-auto",children:j.jsxs("table",{className:"w-full border-collapse text-sm",children:[j.jsx("thead",{className:"bg-muted sticky top-0 z-10",children:j.jsx("tr",{children:H.map((C,N)=>j.jsx("th",{className:"text-muted-foreground border-b px-3 py-1.5 text-left font-medium whitespace-nowrap",children:C},N))})}),j.jsx("tbody",{style:{height:m.getTotalSize(),position:"relative"},children:m.getVirtualItems().map(C=>{const N=X[C.index];return j.jsx("tr",{className:Ce("absolute flex w-full",C.index%2===1&&"bg-muted/30"),style:{transform:`translateY(${C.start}px)`,height:we},children:H.map((J,Y)=>j.jsx("td",{className:"flex-1 truncate border-b px-3 py-1.5 whitespace-nowrap",title:N[Y]??"",children:N[Y]??""},Y))},C.key)})})]})})}function ce({children:H}){return j.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:j.jsx("p",{children:H})})}export{et as CanvasCsvContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-
|
|
2
|
-
import{r as a,aY as z,h7 as ce,j as t,G as O,g1 as oe,g2 as le,B as D,g3 as ue,g4 as de,g5 as Z,h8 as fe,dl as he,dm as pe,J as me,gh as ve,dn as xe,a3 as ge,h9 as be,aZ as ee,a1 as ye,ha as je,a2 as Ce}from"./index-p3WivF1M.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-DAGOz8a6.js";import{R as Te}from"./rotate-cw-Po-L3HFe.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CxXuMuQv.js";import"./WidgetErrorCard-CgRMeAEO.js";import"./index-BY0SKYuc.js";import"./card-TbpEl6EH.js";import"./progress-CpiQE0rv.js";import"./markdown-content-BFHUHPgi.js";import"./table-9KRGRv_s.js";import"./package-0mI7-RiJ.js";import"./heart-D4fTvM5q.js";import"./git-branch-BLIYLcM4.js";import"./file-text-wmrSy3Io.js";import"./file-DHPgnMgj.js";import"./McpAppFrame-DVNWJHrn.js";import"./more-details-DhdX4DGU.js";function B(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=z.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function X({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{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.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(Z,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(Z,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(X,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(X,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const Ee=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-Cyz227_1.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ze=a.lazy(()=>ee(()=>import("./BlintzCanvas-Dd3bC9vw.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Be=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(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 te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),E=a.useRef(null),Y=a.useRef(C),V=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:E,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,Y.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=E.current)==null||k.cancel(),E.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Be)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const q=N.confirmed;q.content===S.current&&w.setQueryData(B(d,e.sourcePath),Q=>Q&&{...Q,content:q.content,hash:q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=E.current)==null||v.cancel(),E.current=null)},[s]),a.useEffect(()=>{const v=V.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=E.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),E.current=null,y(r,!1),Y.current(!1)}},[r,y,V]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(B(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},J=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),W=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&J&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:J}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.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(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.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(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ze,{value:W,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(Ee,{value:W,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(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 at({content:e,documentId:r}){const d=ye(),n=z(g=>g.selectedCwd),o=z(g=>g.setDocumentEditing),s=z(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=z(g=>g.canvasSessionId),b=z(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:B(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({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{at as CanvasFileContent};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-C1YQ35ki.js","assets/index-B48IJBNm.js","assets/index-Dry_agqN.css","assets/index-okP_lDUw.js","assets/index-sCJ7YWzB.js","assets/BlintzCanvas-fEMJgpNx.js","assets/index-zIfhHvVv.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as a,aW as z,h7 as ce,j as t,G as O,g0 as oe,g1 as le,B as D,g2 as ue,g3 as de,g4 as X,h8 as fe,dj as he,dk as pe,J as me,gh as ve,dl as xe,a3 as ge,h9 as be,aX as ee,a1 as ye,ha as je,a2 as Ce}from"./index-B48IJBNm.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-B2CM1KZu.js";import{R as Te}from"./rotate-cw-CCrNd4eJ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-uC5dql6Q.js";import"./WidgetErrorCard-BZkAK-Ke.js";import"./index-Hf3kLtiJ.js";import"./card-D9DO5nt4.js";import"./progress-AKcr8opu.js";import"./markdown-content-BA0KEJH_.js";import"./table-D6BUawIb.js";import"./package-CxZe6vve.js";import"./heart-CRoafWCm.js";import"./git-branch-DlUQMA-U.js";import"./file-text-DXPPkxAL.js";import"./file-CKSjJRX5.js";import"./McpAppFrame-BtKAUDBg.js";import"./more-details-Bo2AAXHj.js";function B(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=z.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function Z({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{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.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(X,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(X,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(Z,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(Z,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const Ee=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-C1YQ35ki.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ze=a.lazy(()=>ee(()=>import("./BlintzCanvas-fEMJgpNx.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Be=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(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 te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),E=a.useRef(null),V=a.useRef(C),Y=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:E,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,V.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=E.current)==null||k.cancel(),E.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Be)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const q=N.confirmed;q.content===S.current&&w.setQueryData(B(d,e.sourcePath),Q=>Q&&{...Q,content:q.content,hash:q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=E.current)==null||v.cancel(),E.current=null)},[s]),a.useEffect(()=>{const v=Y.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=E.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),E.current=null,y(r,!1),V.current(!1)}},[r,y,Y]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(B(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},W=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),J=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&W&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:W}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.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(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.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(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ze,{value:J,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(Ee,{value:J,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(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 at({content:e,documentId:r}){const d=ye(),n=z(g=>g.selectedCwd),o=z(g=>g.setDocumentEditing),s=z(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=z(g=>g.canvasSessionId),b=z(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:B(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({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{at as CanvasFileContent};
|
package/dist/client/assets/{CanvasModel3dContent-CNmJsBTS.js → CanvasModel3dContent-BL-UiHAj.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-
|
|
2
|
-
import{a1 as m,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-BSX1QGsE.js","assets/index-B48IJBNm.js","assets/index-Dry_agqN.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-B48IJBNm.js";import{r as u}from"./use-session-canvas-B2CM1KZu.js";import"./rotate-cw-CCrNd4eJ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-uC5dql6Q.js";import"./WidgetErrorCard-BZkAK-Ke.js";import"./index-Hf3kLtiJ.js";import"./card-D9DO5nt4.js";import"./progress-AKcr8opu.js";import"./markdown-content-BA0KEJH_.js";import"./table-D6BUawIb.js";import"./package-CxZe6vve.js";import"./heart-CRoafWCm.js";import"./git-branch-DlUQMA-U.js";import"./file-text-DXPPkxAL.js";import"./file-CKSjJRX5.js";import"./McpAppFrame-BtKAUDBg.js";import"./more-details-Bo2AAXHj.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-BSX1QGsE.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};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-bSzhhjtG.js","assets/index-B48IJBNm.js","assets/index-Dry_agqN.css","assets/room-files-source-B0WR4gIC.js","assets/markdown-content-BA0KEJH_.js","assets/file-exclamation-point-ad7FedZ9.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-ByyXrDny.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-CCrNd4eJ.js","assets/link-2-qEUih2FP.js","assets/file-CKSjJRX5.js","assets/git-branch-DlUQMA-U.js","assets/more-details-Bo2AAXHj.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{O as F,r as c,j as l,B as ue,h4 as bn,n2 as vn,g as kn,k4 as wn,G as te,a1 as fe,a3 as De,a4 as Pe,aN as H,ch as Fe,ci as In,cX as Nn,n3 as Rn,lB as Cn,n4 as An,h as Mn,av as Sn,co as Le,gw as se,q as Z,dD as Be,s as pe,l$ as jn,n5 as _n,mF as On,n6 as En,eR as Tn,g8 as $n,e2 as Dn,n0 as Pn,n7 as Fn,n8 as Ln,a0 as Bn,bv as Un,n9 as Hn,na as Kn,ju as qn,it as Wn,gB as zn,kV as Ie,nb as Ue,bU as Vn,kU as X,kY as He,nc as Gn,cg as ge,ag as Yn,bY as he,im as Ke,nd as Jn,cs as qe,ne as Xn,fe as Qn,kl as We,nf as ze,aX as Zn,gy as Ve,kX as et,ng as Ge,nh as nt,ni as tt,nj as st,nk as Ne,eT as ot,nl as at,nm as rt,nn as it,no as ct,np as lt,nq as dt,l as ut,hh as mt,ap as Ye,kM as ft,ah as pt,nr as gt,ns as ht,nt as xt,b6 as yt,c4 as bt,nu as vt,nv as kt,nw as wt,nx as It,bw as Re,f2 as Nt}from"./index-B48IJBNm.js";import{g as Ce,m as Ae,h as xe,f as Je,M as Rt,a as Ct,E as At,i as Mt,j as St,c as P,k as jt,b as _t,l as Ot,u as Et,C as Tt}from"./registry-BxY1lah6.js";import"./WidgetErrorCard-BZkAK-Ke.js";import{R as $t,A as Xe}from"./repeat-zL9y24zY.js";import{u as Dt}from"./use-room-sessions-C6wsszcG.js";import{M as Pt}from"./markdown-content-BA0KEJH_.js";import{W as Ft,a as Lt}from"./find-latest-widget-fence-BsDq4SYp.js";import{f as Bt}from"./format-duration-BCr6uzby.js";import{H as Ut,a as Ht,b as Kt}from"./RuntimeSetupDialog-NKy3mLEH.js";import{M as Me}from"./mention-pill-0aHe3D1A.js";import{R as qt}from"./rotate-ccw-clock-BUhy2_cF.js";import{U as Wt}from"./unplug-BVIT6OSL.js";import{M as zt}from"./message-square-off-DvVenheW.js";import{i as Vt}from"./registry-CWK5lzYs.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 Qe={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"}]]};Qe.node;const Gt=F(Qe);/**
|
|
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 Ze={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"}]]};Ze.node;const Yt=F(Ze);/**
|
|
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 en={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"}]]};en.node;const Jt=F(en);/**
|
|
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 nn={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"}]]};nn.node;const Xt=F(nn);/**
|
|
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 tn={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"}]]};tn.node;const Qt=F(tn);/**
|
|
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 sn={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"}]]};sn.node;const Zt=F(sn);/**
|
|
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 on={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"}]]};on.node;const Se=F(on);/**
|
|
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 an={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"}]]};an.node;const es=F(an),ns='[data-slot="identity-hover-card-actions"] button:not(:disabled)';function ts(e){const{open:t,setOpen:s,triggerRef:n,enabled:o}=e,a=c.useRef(null),r=c.useRef(!1);c.useEffect(()=>{if(!t||!r.current)return;r.current=!1;let u=0,x=0;const v=()=>{var f;const m=(f=a.current)==null?void 0:f.querySelector(ns);if(m)return m.focus();++u<10&&(x=requestAnimationFrame(v))};return v(),()=>cancelAnimationFrame(x)},[t]);const i=c.useCallback(u=>{var x;!u&&((x=a.current)!=null&&x.contains(document.activeElement))||s(u)},[s]),d=c.useCallback(u=>{!o||u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),r.current=!0,s(!0))},[o,s]),p=c.useMemo(()=>({onEscapeKeyDown:()=>{var u;return(u=n.current)==null?void 0:u.focus()},onBlur:u=>{var v,m,f;const x=u.relatedTarget;x&&((v=a.current)!=null&&v.contains(x)||(m=n.current)!=null&&m.contains(x))||(f=a.current)!=null&&f.contains(document.activeElement)||s(!1)}}),[s,n]);return{contentRef:a,handleOpenChange:i,onTriggerKeyDown:d,contentHandlers:p}}function ce(e){const t=e.key==="ArrowRight"||e.key==="ArrowDown",s=e.key==="ArrowLeft"||e.key==="ArrowUp",n=e.key==="Tab";if(!t&&!s&&!n)return;const o=e.currentTarget.closest('[data-slot="identity-hover-card-actions"]');if(!o)return;const a=Array.from(o.querySelectorAll("button:not(:disabled)")),r=a.indexOf(document.activeElement);if(r===-1||a.length===0)return;e.preventDefault();const i=s||n&&e.shiftKey?-1:1;a[(r+i+a.length)%a.length].focus()}function ss({kind:e,about:t}){const n=[e==="agent"?"Agent":e==="human"?"Person":null,t.role].filter(Boolean).join(" · ");return!n&&!t.status?null:l.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 px-3 pb-3","data-slot":"identity-hover-card-about",children:[n&&l.jsx("p",{className:"text-muted-foreground truncate text-xs",title:n,children:n}),t.status&&l.jsx("p",{className:"text-foreground/80 truncate text-xs","data-slot":"identity-hover-card-status",children:t.status})]})}function os({actions:e,onAct:t}){const s=n=>()=>{t(),n()};return l.jsxs("div",{className:"border-border mt-auto flex flex-col gap-2 border-t p-3","data-slot":"identity-hover-card-actions",role:"group","aria-label":"Actions",children:[l.jsxs("div",{className:"flex gap-2",children:[e.onMessage&&l.jsx(ue,{size:"xs",className:"flex-1",onClick:s(e.onMessage),onKeyDown:ce,children:"Message"}),e.onViewProfile&&l.jsx(ue,{size:"xs",variant:"outline",className:"flex-1",onClick:s(e.onViewProfile),onKeyDown:ce,children:"Profile"})]}),e.session&&l.jsxs("button",{type:"button","data-slot":"identity-hover-card-session",onClick:s(e.session.onOpen),onKeyDown:ce,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[l.jsx(bn,{className:"size-3.5 shrink-0","aria-hidden":!0}),l.jsx("span",{className:"truncate",children:e.session.label})]})]})}const as=300;function G({className:e,children:t}){return l.jsx("span",{className:te("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 ye({identity:e,children:t,onViewProfile:s,about:n,actions:o,onOpenChange:a,openOnClick:r=!1,className:i}){const{kind:d,displayName:p,handle:u,color:x,emoji:v,imageUrl:m,origin:f,agent:g}=e,w=x??"hsl(var(--muted-foreground))",h=typeof f=="object"&&f!==null,y=d==="agent"&&(g==null?void 0:g.working)!=null?g.working:null,[I,S]=c.useState(!1),M=c.useCallback(k=>{S(k),a==null||a(k)},[a]),C=c.useRef(!1),N=c.useRef(null),A=vn({onLongPress:()=>{C.current&&M(!0)}}),{contentRef:_,handleOpenChange:j,onTriggerKeyDown:b,contentHandlers:O}=ts({open:I,setOpen:M,triggerRef:N,enabled:r&&o!==void 0});return l.jsxs(Ut,{open:I,onOpenChange:j,openDelay:as,children:[l.jsx(Ht,{asChild:!0,ref:N,"data-gesture-priority":"",...A,onPointerDown:k=>{C.current=k.pointerType==="touch"||k.pointerType==="pen",A.onPointerDown(k)},...r?{onClick:()=>M(!0),onKeyDown:b}:{},children:t}),l.jsxs(Kt,{ref:_,...O,...o?{role:"dialog","aria-label":p}:{},"data-slot":"identity-hover-card",align:"start",className:te("flex w-64 flex-col gap-0 overflow-hidden p-0",i),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",children:[l.jsx(kn,{"aria-hidden":!0,color:w,emoji:v,imageUrl:m,fallback:wn(p),kind:d,origin:f,status:y?"working":"idle",size:"md"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:p}),u&&l.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",u]})]})]}),n&&l.jsx(ss,{kind:d,about:n}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[d==="agent"&&((g==null?void 0:g.runtime)||(g==null?void 0:g.model))&&l.jsx(G,{children:[g.runtime,g.model].filter(Boolean).join(" · ")}),y&&l.jsxs(G,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Bt(y.forMs)]}),d==="human"&&l.jsx(G,{children:h?f.platform:"On this machine"}),d==="agent"&&(g==null?void 0:g.managedBy)&&l.jsxs(G,{children:["Managed by"," ",g.managedBy.handle?`@${g.managedBy.handle}`:g.managedBy.displayName]})]}),o?l.jsx(os,{actions:o,onAct:()=>{var k;(k=N.current)==null||k.focus(),M(!1)}}):s?l.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var k;(k=N.current)==null||k.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"}):l.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),l.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function rs(){const e=fe(),t=De();return Pe({onMutate:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var u;const r=t.getQueryData(H.entries(s)),i=(u=r==null?void 0:r.find(x=>x.id===n))==null?void 0:u.reactions,{reactions:d,on:p}=Ce(i,o,a);return t.setQueryData(H.entries(s),x=>Ae(x,n,d)),{on:p}},mutationFn:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var d,p;const r=t.getQueryData(H.entries(s)),i=((p=(d=r==null?void 0:r.find(u=>u.id===n))==null?void 0:d.reactions)==null?void 0:p.some(u=>u.emoji===o&&u.authorIds.includes(a)))??!1;return e.toggleReaction(s,n,{emoji:o,on:i})},onError:(s,{roomId:n,entryId:o,emoji:a,viewerAuthorId:r},i)=>{i!==void 0&&t.setQueryData(H.entries(n),d=>{var x;const p=(x=d==null?void 0:d.find(v=>v.id===o))==null?void 0:x.reactions,{reactions:u}=Ce(p,a,r,!i.on);return Ae(d,o,u)})},onSuccess:({frequents:s},{roomId:n})=>{t.setQueryData(H.detail(n),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function q(e){return e.threadRootEntryId??e.parentEntryId}function is(e){return q(e)??e.id}function cs(e,t){return Math.max(t??0,e)}function Zo(e,t,s){let n=e[0],o=0;for(const a of e)a.seq>n.seq&&(n=a),t!==null&&a.seq>t&&(o+=1);return{count:cs(e.length,s),lastAt:n.createdAt,unread:o}}function ls(e){var M,C;const{agentPath:t,displayName:s,onViewProfile:n,engaged:o}=e,a=Fe(),r=In(),i=a&&o&&t!==void 0,d=Nn(i?t:null),p=Rn(d.member),u=Cn(),x=An(),v=Mn(),m=Sn(),{data:f}=Le({enabled:i&&r}),g=m.status==="ready"?m.roomId:null,w=f==null?void 0:f.find(N=>N.id===g),h=w?se(w):null,y=(C=(M=d.member)==null?void 0:M.agent)==null?void 0:C.effectiveRuntimeId,I=c.useCallback(()=>{t!==void 0&&(Z.getState().recordOpened("agent",t),u({agentPath:t},y?{runtime:y}:{}))},[t,u,y]),S=c.useCallback(async()=>{if(t===void 0||!v)return;const N=await x(t);if(N===null){Be(`${s} has no session in ${h??"this room"} yet`);return}v(pe({session:N}))},[t,v,x,s,h]);return c.useMemo(()=>!a||t===void 0?null:{about:{role:d.role,status:p},actions:{onMessage:I,...n?{onViewProfile:n}:{},...r&&h?{session:{label:`Session in ${h}`,onOpen:()=>void S()}}:{}}},[a,t,d.role,p,I,n,r,h,S])}function ds({identity:e,agentPath:t,onViewProfile:s,openOnClick:n=!1,children:o}){const[a,r]=c.useState(!1),i=ls({agentPath:t,displayName:e.displayName,onViewProfile:s,engaged:a}),d=c.useCallback(p=>{p&&r(!0)},[]);return l.jsx(ye,{identity:e,onViewProfile:s,onOpenChange:d,openOnClick:n&&i!==null,...i?{about:i.about,actions:i.actions}:{},children:o})}function us(e){return l.jsx(Lt,{code:e.code,isIncomplete:e.isIncomplete})}const ms=[{language:Ft,component:us}],fs={turn_failed:{Icon:Bn,tone:"text-status-warning"},agent_busy:{Icon:Ln},agent_gone:{Icon:es,tone:"text-status-warning"},agent_left:{Icon:Se,tone:"text-status-warning"},room_archived:{Icon:Fn},agent_reseated:{Icon:Pn},handle_changed:{Icon:Xe},files_set_up:{Icon:Dn},runtime_gone:{Icon:Xt,tone:"text-status-warning"},agent_paused:{Icon:$n},agent_declined:{Icon:zt},agent_unavailable:{Icon:Tn},awaiting_approval:{Icon:Gt,tone:"text-status-warning"},halted:{Icon:En},budget_reached:{Icon:On},cascade_stopped:{Icon:_n},addressing_changed:{Icon:Jt},bridge_blocked:{Icon:Wt,tone:"text-status-warning"},bridge_undelivered:{Icon:jn,tone:"text-status-warning"},bridge_rate_limited:{Icon:Zt},bridge_second_agent_refused:{Icon:Se},bridge_disconnected:{Icon:Yt},bridge_agent_swapped:{Icon:$t},bridge_history_note:{Icon:qt}},ps={Icon:Un},le=80;function gs(e){const t=e.trim();if(t.length<=le)return t;const s=t.slice(0,le),n=s.lastIndexOf(" ");return`${(n>le/2?s.slice(0,n):s).trimEnd()}…`}function hs(e,t,s){const n=xs(e,s),o=a=>l.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:a});return n===null?l.jsxs(l.Fragment,{children:[e," ",o("Open chat")]}):l.jsxs(l.Fragment,{children:[e.slice(0,n.index),o(n.words),e.slice(n.index+n.words.length)]})}function xs(e,t){if(t!==void 0){const n=Hn(t),o=e.lastIndexOf(n);if(o!==-1)return{index:o,words:n}}const s=Kn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function ys({entry:e,feedPosition:t,rowId:s,sessionLink:n,subjectName:o}){const{Icon:a,tone:r}=(e.body.notice&&fs[e.body.notice])??ps;return l.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...t&&{role:"article","aria-label":gs(e.body.text)},...xe(t),className:te("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",r??"text-muted-foreground"),children:[l.jsx(a,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),l.jsx("span",{children:n?hs(e.body.text,n,o):e.body.text})]})}const bs=Vt.moment;function vs({entry:e,moment:t,subject:s,subjectIdentity:n,feedPosition:o,rowId:a}){const r=Je(e.createdAt);return l.jsx("div",{id:a,"data-slot":"moment-row","data-testid":"room-moment","data-moment":t.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...xe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:l.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[l.jsx(ye,{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:l.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[l.jsx(Rt,{author:s}),l.jsx("span",{className:"sr-only",children:s.displayName})]})}),l.jsx(bs,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),l.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),r.length>0&&l.jsx("time",{dateTime:e.createdAt,title:Ct(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:r})]})})}function ks(e,t){const s=X.getState(),n=s.drafts[e]??"",o=n===""||n.endsWith(" ")||n.endsWith(`
|
|
43
|
+
`)?"":" ";s.set(e,`${n}${o}@${t} `)}function ws({roomId:e,entry:t,author:s,viewerAuthorId:n,onViewProfile:o}){const a=is(t),r=t.body.text,i=(s==null?void 0:s.id)===n?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:p}=qn({toastOnSettle:!0});return c.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Qt,run:()=>{zn.getState().openThread(e,a,!0),Ie.getState().requestFocus(Ue(e,a))}},copy:{id:"copy",label:"Copy text",icon:Wn,run:()=>void p(r)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:Vn,run:o}),i!==void 0&&(u.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:Xe,run:()=>{ks(e,i),Ie.getState().requestFocus(e)}}),At.map(x=>u[x]).filter(x=>x!==void 0)},[e,a,r,i,d,o,p])}function Is(e){if(e.kind==="notice")return{kind:"notice"};const t=e.body.moment;return t?{kind:"moment",moment:t}:{kind:"message"}}function ea(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 na(e,t){const s=e.body.subjectAuthorId;return s===void 0||t.has(e.authorId)?e.authorId:s}function Ns(e,t,s){const n=t.get(e),o=He({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 ta(e){const t=new Set;for(const a of e)q(a)===null&&t.add(a.id);const s=[],n=new Map,o=new Set;for(const a of e){const r=q(a);if(r===null){s.push(a);continue}if(!t.has(r)){s.push(a),o.add(a.id);continue}const i=n.get(r);i?i.push(a):n.set(r,[a])}return{topLevel:s,repliesByRoot:n,orphaned:o}}function Rs(e){return`thread-${e}`}function Cs(e){return`thread-row-${e}`}function sa(e){return`thread-panel-entry-${e}`}function As(e){return`room-entry-${e}`}function Ms(e,t){const s=e.find(i=>i.id===t);if(s===void 0)return null;const n=q(s)??null,o={rowId:t,domId:As(t)};if(n===null)return o;const a=e.find(i=>i.id===n);return a!==void 0&&(q(a)??null)===null?{rowId:Rs(n),domId:Cs(n)}:o}function oa(e,t){if(t===null)return null;const s=e.find(n=>n.seq===t);return s===void 0?null:Ms(e,s.id)}const je=48;function aa(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 a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:n,excerpt:a.length>je?`${a.slice(0,je).trimEnd()}…`:a}}function Ss(e,t){const s=new Map;for(const n of e){const o=t[n.projectPath];if(!o)continue;const a=Gn({runtime:o.runtime,model:o.model});s.set(ge(n.projectPath),{memberId:n.id,visual:Yn(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function js(e){const t=new Map;for(const[s,n]of e)t.set(s,n.visual);return t}const _s={info:new Map,faces:new Map},be=c.createContext(_s);function ra({known:e,children:t}){return l.jsx(be.Provider,{value:e,children:t})}function ia(){const e=he(),t=c.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=c.useMemo(()=>t.map(r=>r.projectPath),[t]),n=Ke(s),o=c.useMemo(()=>Ss(t,n.data??{}),[t,n.data]),a=c.useMemo(()=>js(o),[o]);return c.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const t=c.useContext(be);return e===void 0?void 0:t.info.get(e)}function Os(){return c.useContext(be).faces}function Es({showAuthorHeader:e,headerId:t,displayName:s,time:n,summary:o,contentId:a,summaryId:r,feedPosition:i}){return{...e?{"aria-labelledby":t}:{"aria-label":n.length>0?`${s}, ${n}`:s},"aria-describedby":o===null?a:r,...xe(i)}}const Q=120,Ts="code block";function $s(e){if(e.length<=Q&&!e.includes("```"))return null;const t=Ds(e);return t.length===0?null:t}function Ds(e){const t=e.replace(/```[\s\S]*?(?:```|$)/g,` ${Ts} `).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<=Q)return t;const s=Ps(t,Q),n=s.lastIndexOf(" ");return`${(n>Q/2?s.slice(0,n):s).trimEnd()}…`}function Ps(e,t){if(typeof Intl.Segmenter=="function"){const n=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of n.segment(e)){if(o.length+a.length>t)break;o+=a}return o}let s="";for(const n of e){if(s.length+n.length>t)break;s+=n}return s}function Fs({roomId:e,entry:t,viewerAuthorId:s,reactionFrequents:n,streamStalled:o,isMember:a=!0}){const r=rs(),i=o===!0||!a,d=c.useMemo(()=>t.reactions??[],[t.reactions]),p=c.useMemo(()=>d.filter(v=>Mt(v,s)).map(v=>v.emoji),[d,s]),u=c.useCallback(v=>r.mutate({roomId:e,entryId:t.id,emoji:v,viewerAuthorId:s}),[r,e,t.id,s]),x=c.useMemo(()=>({quick:n,mine:p,onToggle:u,disabled:i}),[n,p,u,i]);return{reactions:d,toggle:u,quickRow:x}}function Ls({barRef:e,pillsRef:t,hasReactions:s}){return n=>{var a,r;if(n.target!==n.currentTarget)return;const{key:o}=n;if(o==="ArrowDown"&&s){n.preventDefault(),(a=t.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(n.preventDefault(),(r=e.current)==null||r.focusFirst())}}function Bs(e,t){var x,v;const s=t.body.subjectAuthorId,n=t.body.notice,o=t.kind==="notice"&&n!==void 0&&s!==void 0&&Jn.includes(n),a=Dt(e,{enabled:o}),r=qe(),i=De(),d=fe(),p=o?((v=(x=a.data)==null?void 0:x.bindings.find(m=>m.authorId===s))==null?void 0:v.sessionId)??null:null,u=c.useCallback(m=>{m.button!==0||m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||(m.preventDefault(),!(p===null||s===void 0)&&Xn({queryClient:i,transport:d},e,s).then(f=>{f.kind!=="none"&&r(pe({session:f.kind==="bound"?f.sessionId:p}))}))},[s,r,i,e,p,d]);return c.useMemo(()=>p===null?null:{href:Qn({session:p}),onOpen:u},[u,p])}const ne="mention",ve="author_id",Us={[ne]:[ve]},Hs=[ne];function Ks(e,t){if(!t||t.length===0)return e;const s=qs(e,t);if(s.length===0)return e;let n=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:i}=s[o],d=n.slice(0,a),p=n.slice(a,a+r),u=n.slice(a+r);n=`${d}<${ne} ${ve}="${i}">${p}</${ne}>${u}`}return n}function qs(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(n.push(a),o=a.offset+a.length);return n}const Ws=/^[\s,&+/]*(?:and[\s,&+/]+)?$/i;function zs(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=new Set;let o=!0;return s.map((a,r)=>{if(o&&r>0){const i=s[r-1];o=Ws.test(e.slice(i.offset+i.length,a.offset))}return o&&n.add(a.authorId),n.has(a.authorId)?a:{...a,cc:!0}})}function Vs(e){const t=new Set(e.filter(n=>!n.cc).map(n=>n.authorId)),s=[];for(const n of e)n.cc&&!t.has(n.authorId)&&!s.includes(n.authorId)&&s.push(n.authorId);return s}const Gs=new Map,rn=c.createContext(Gs);function Ys({authors:e,children:t}){return l.jsx(rn.Provider,{value:e,children:t})}function Js(e){const t=c.useContext(rn);return e===void 0?void 0:t.get(e)}const _e=new WeakMap;function Xs(e){const t=_e.get(e);if(t)return t;const s=new Map(e.map(n=>[ge(n.projectPath),n.projectPath]));return _e.set(e,s),s}function Qs(e){var n;const s=(n=he().data)==null?void 0:n.agents;return c.useMemo(()=>e===void 0||!s?void 0:Xs(s).get(e),[s,e])}function cn(e){const{agentRef:t,identity:s,onViewProfile:n}=e,o=Fe(),a=Qs(o?t:void 0),r=ee(t);return c.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const i={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(p,u={})=>l.jsx(ds,{identity:i,agentPath:a,onViewProfile:n,openOnClick:u.openOnClick??!1,children:p});return{wrap:d,wrapAvatar:p=>d(l.jsx("button",{type:"button",tabIndex:-1,"aria-label":s.displayName,"aria-haspopup":"dialog",className:"focus-ring inline-flex cursor-pointer rounded-sm","data-slot":"room-agent-card-face",children:p}),{openOnClick:!0}),wrapName:p=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:te(p.props.className,"focus-ring cursor-pointer rounded-sm text-left underline-offset-4 hover:underline"),"data-slot":"room-agent-card-name",children:s.displayName}),{openOnClick:!0})}},[o,s,a,r,n])}const Zs={kind:"human",displayName:""};function eo(e){return typeof e=="string"?e.replace(/^@/,""):""}function no({authorId:e,children:t,cc:s}){const n=Js(e),o=ee(n==null?void 0:n.agentRef),{open:a}=We(),r=n?He({record:n,override:o==null?void 0:o.visual}):null,i=n?ze(n,o==null?void 0:o.memberId):void 0,d=c.useMemo(()=>i===void 0?void 0:()=>a(i),[i,a]),p=r==null?void 0:r.color,u=r==null?void 0:r.emoji,x=r==null?void 0:r.imageUrl,v=c.useMemo(()=>n?{kind:n.kind,displayName:n.displayName,handle:n.handle??void 0,color:p,emoji:u,imageUrl:x,origin:n.origin,agent:o&&{runtime:o.runtime,...o.model&&{model:o.model}}}:null,[n,p,u,x,o]),m=cn({agentRef:n==null?void 0:n.agentRef,identity:v??Zs,onViewProfile:d});if(!n||!v)return l.jsx(Me,{kind:"human",label:eo(t),resolved:!1});const g=m?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:d?{role:"button",tabIndex:0,"aria-label":`View ${n.displayName}’s profile`,onClick:d,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),d())}}:{},w=l.jsx(Me,{kind:n.kind,label:n.displayName,handle:n.handle??void 0,color:n.color,origin:n.origin,resolved:!0,interactive:d!==void 0,...g,cc:s});return m?m.wrap(w,{openOnClick:!0}):l.jsx(ye,{onViewProfile:d,identity:v,children:w})}function to(e,t=new Set){return{mention:s=>{const n=s[ve],o=typeof n=="string"?n:void 0;return!o||!e.has(o)?l.jsx(l.Fragment,{children:s.children}):l.jsx(no,{authorId:o,cc:t.has(o),children:s.children})}}}function so({entry:e,authors:t}){const s=c.useMemo(()=>Ks(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),n=c.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(i=>i.authorId))??[])},[e.mentionSpans]),o=c.useMemo(()=>new Set(Vs(e.mentionSpans??[])),[e.mentionSpans]),a=c.useMemo(()=>to(n,o),[n,o]);return l.jsx(Ys,{authors:t,children:l.jsx(Pt,{content:s,className:"msg-prose",allowedTags:Us,literalTagContent:Hs,components:a,renderers:ms})})}function oo(e){return function(s){return l.jsx(so,{entry:s,authors:e})}}const ln="the top folder";function Oe(e){return e.slice(e.lastIndexOf("/")+1)}function ao(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function ro(e){return e===""?ln:`${e}/`}function de(e){return e.target!==void 0?e.target===""?ln:e.target:ro(ao(e.paths[0]??""))}function io(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 ${Oe(s)} to ${de(e)}`:`${t} uploaded ${e.pathCount} files to ${de(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 ${Oe(s)} from the chat to ${de(e)}`}}const co=c.lazy(()=>Zn(()=>import("./index-bSzhhjtG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function ca({roomId:e,entry:t,author:s,authorRef:n,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:i,streamStalled:d,isMember:p=!0,grouping:u,orphanedReply:x,answers:v,feedPosition:m,rowId:f}){const g=Je(t.createdAt),w=c.useMemo(()=>{const L=$s(t.body.text),ie=St(t.attachments??[]);if(ie===null)return L;const we=L??t.body.text.trim();return we.length>0?`${we} ${ie}`:ie},[t.body.text,t.attachments]),h=c.useId(),y=`${h}-author`,I=`${h}-content`,S=`${h}-summary`,M=c.useRef(null),C=c.useRef(null),N=c.useRef(null),{reactions:A,toggle:_,quickRow:j}=Fs({roomId:e,entry:t,viewerAuthorId:a,reactionFrequents:i,streamStalled:d,isMember:p}),b=ee(n==null?void 0:n.agentRef),{open:O}=We(),k=n===void 0?void 0:ze(n,b==null?void 0:b.memberId),T=c.useCallback(()=>{k!==void 0&&O(k)},[O,k]),$=k===void 0?void 0:T,W=ws({roomId:e,entry:t,author:n,viewerAuthorId:a,onViewProfile:$}),z=(n==null?void 0:n.handle)??void 0,B=c.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:z,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,z,s.color,s.emoji,s.imageUrl]),D=cn({agentRef:n==null?void 0:n.agentRef,identity:B,onViewProfile:$}),R=Ls({barRef:C,pillsRef:N,hasReactions:A.length>0}),U=c.useCallback(()=>{var L;return(L=M.current)==null?void 0:L.focus()},[]),oe=c.useMemo(()=>oo(o),[o]),gn=c.useCallback(L=>l.jsx(c.Suspense,{fallback:null,children:l.jsx(co,{roomId:e,attachment:L})}),[e]),hn=Os(),ae=t.body.subjectAuthorId??t.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),xn=Bs(e,t),re=Is(t);if(re.kind==="notice")return l.jsx(ys,{entry:t,feedPosition:m,rowId:f,sessionLink:xn,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(vs,{entry:t,moment:re.moment,subject:ae===t.authorId?s:Ns(ae,o,hn),subjectIdentity:{handle:(E==null?void 0:E.handle)??void 0,origin:E==null?void 0:E.origin,agent:V&&{runtime:V.runtime,...V.model&&{model:V.model}}},feedPosition:m,rowId:f});const yn=u.position==="first"||u.position==="only";return l.jsxs(P.Root,{ref:M,id:f,position:u.position,actions:W,reactions:j,"data-testid":"room-entry",tabIndex:0,...Es({showAuthorHeader:yn,headerId:y,displayName:s.displayName,time:g,summary:w,contentId:I,summaryId:S,feedPosition:m}),onKeyDown:R,children:[l.jsx(P.Gutter,{author:s,at:t.createdAt,onViewProfile:D?void 0:$,isSelf:t.authorId===a,renderAvatar:D==null?void 0:D.wrapAvatar}),l.jsxs(P.Body,{children:[l.jsx(P.Author,{id:y,author:s,at:t.createdAt,origin:n==null?void 0:n.origin,renderName:D==null?void 0:D.wrapName}),x===!0&&l.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),v!=null&&l.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${v.excerpt}”`}),t.body.via&&l.jsx(jt,{via:t.body.via}),l.jsx(P.Content,{id:I,className:"wrap-anywhere [&_pre]:overflow-x-auto [&_pre]:wrap-normal",children:t.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:io(t.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):oe(t,{rowId:t.id,isStreaming:!1})}),w!==null&&l.jsx("span",{id:S,className:"hidden",children:w}),l.jsx(P.Attachments,{items:t.attachments??[],renderAction:p?gn:void 0}),l.jsx(P.Reactions,{ref:N,reactions:A,viewerAuthorId:a,names:r,frequents:i,onToggle:_,disabled:d===!0||!p,onExit:U}),l.jsx(P.Actions,{actions:W,reactions:j,barRef:C,onExit:U})]})]})}const la={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function lo(e){const t=fe(),[s,n]=c.useState([]),o=c.useRef(new Map),a=c.useCallback(m=>{const f=m.map(g=>({id:crypto.randomUUID(),file:g,status:"pending",progress:0}));n(g=>[...g,...f])},[]),r=c.useCallback(m=>{o.current.delete(m),n(f=>f.filter(g=>g.id!==m))},[]),i=c.useCallback(m=>{if(!m){o.current.clear(),n([]);return}const f=new Set(m);for(const g of f)o.current.delete(g);n(g=>g.filter(w=>!f.has(w.id)))},[]),d=c.useCallback(m=>{o.current.delete(m),n(f=>f.map(g=>g.id===m&&g.status==="error"?{...g,status:"pending",progress:0,error:void 0}:g))},[]),p=c.useRef(null),u=Pe({meta:{suppressErrorToast:!0},mutationFn:async m=>{n(h=>h.map(y=>m.some(I=>I.id===y.id)?{...y,status:"uploading"}:y));const f=h=>{n(y=>y.map(I=>I.status==="uploading"?{...I,progress:h.percentage}:I))},g=new AbortController;p.current=g;const w=m.map(h=>h.file);return t.uploadRoomAttachments(e,w,f,g.signal)},onSettled:()=>{p.current=null},onSuccess:(m,f)=>{f.forEach((g,w)=>{const h=m[w];h&&o.current.set(g.id,h.id)}),n(g=>g.map(w=>f.findIndex(y=>y.id===w.id)===-1?w:{...w,status:"uploaded",progress:100}))},onError:m=>{n(f=>f.map(g=>g.status==="uploading"?{...g,status:"error",error:m.message}:g))}}),x=c.useCallback(()=>{var m;(m=p.current)==null||m.abort()},[]),v=c.useCallback(async()=>{const m=s.filter(g=>g.status==="error");if(m.length>0)throw new Error(m.length===1?`${m[0].file.name} didn’t upload. Try again or remove it.`:`${m.length} files didn’t upload. Try again or remove them.`);const f=s.filter(g=>g.status==="pending");return f.length>0&&await u.mutateAsync(f),s.map(g=>o.current.get(g.id)).filter(g=>g!==void 0)},[s,u]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:i,cancelUpload:x,uploadAndGetIds:v,hasPendingFiles:s.length>0,hasFailedUpload:s.some(m=>m.status==="error"),isUploading:u.isPending}}function da(e){const{room:t,threadRootId:s}=e,n=_t(),o=Ot(),a=lo((t==null?void 0:t.id)??""),r=t!==void 0&&Ve(t.members,t.viewerAuthorId),i=c.useRef({attachments:a,post:n,reply:o,room:t,threadRootId:s});c.useEffect(()=>{i.current={attachments:a,post:n,reply:o,room:t,threadRootId:s}});const d=c.useCallback(y=>i.current.attachments.addFiles(y),[]),p=c.useCallback(y=>i.current.attachments.removeFile(y),[]),u=c.useCallback(y=>i.current.attachments.retryFile(y),[]),x=c.useCallback(()=>i.current.attachments.cancelUpload(),[]),{pendingFiles:v,hasFailedUpload:m,isUploading:f}=a,g=c.useMemo(()=>({staged:v,add:d,remove:p,retry:u,cancel:x,hasFailed:m,isUploading:f,holdsSendWhileUploading:!1}),[v,m,f,d,p,u,x]),w=c.useCallback(async y=>{const{attachments:I,post:S,reply:M,room:C,threadRootId:N}=i.current;if(C===void 0)throw new Error("That room isn’t loaded yet.");if(C.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",C.id);const A=et(),_=I.pendingFiles.map(k=>k.file.name),j=I.pendingFiles.map(k=>k.id),b=await I.uploadAndGetIds();I.clearFiles(j);const O=y.parentEntryId??N;if(O!==void 0){M.mutate({roomId:C.id,rootEntryId:O,text:y.text,clientId:A,attachmentIds:b,attachmentNames:_});return}S.mutate({roomId:C.id,text:y.text,clientId:A,attachmentIds:b,attachmentNames:_})},[]);return{target:c.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&&r,...t===void 0?{canSendReason:"Still opening this room…"}:t.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Ge},send:w,attachments:g}),[t,s,r,g,w]),attachments:a}}const dn=8;function un(e){if(e==null)return null;const t=e.replace(/\s+/g," ").trim();return t.length===0?null:t}function uo(e){if(st(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const t=e.working??0;return t>0?t===1?"1 agent working":`${t} agents working`:un(e.topic)}function Ee(e){return{kind:"session",id:e.id,name:tt(e.title),summary:un(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function mo(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:se(e),summary:uo(e),lastActivityAt:e.lastActivityAt,room:e}}function Y(e){if(e===void 0)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}function fo(e){return e.kind==="session"?Ne("session",e.id):Ne("room",e.id)}function Te(e,t){const s=[Y(t[fo(e)]),...e.kind==="session"?[Y(e.session.lastTouchedByYouAt),Y(e.session.userLastMessageAt)]:[]].filter(n=>n!==null);return s.length>0?Math.max(...s):Y(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function po(e){return(t,s)=>Te(s,e)-Te(t,e)||s.id.localeCompare(t.id)}function go(e){const t=new Set;return e.filter(s=>{const n=`${s.kind}:${s.id}`;return t.has(n)?!1:(t.add(n),!0)})}function ho(e,t){return!(t.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function xo({sessions:e,rooms:t,mutedRoomIds:s=new Set,interactions:n={},limit:o=dn}){const{yours:a,spinOffs:r,automated:i}=nt(e),d=po(n),p=[...a.map(Ee),...t.filter(u=>ho(u,s)).map(mo)].sort(d);return{items:go(p).slice(0,o),automated:[...r,...i].map(Ee).sort(d).slice(0,o)}}const yo=3,bo=rt;function vo({limit:e=dn,mutedRoomIds:t,enabled:s=!0}={}){var p,u;const n=ot(Math.max(e*yo,bo),{enabled:s}),o=Le({enabled:s}),a=at(),r=(p=n.data)==null?void 0:p.sessions,i=o.data;return{...c.useMemo(()=>xo({sessions:r??[],rooms:i??[],mutedRoomIds:t,interactions:a,limit:e}),[r,i,t,a,e]),isLoading:s&&(n.isLoading||o.isLoading),warnings:((u=n.data)==null?void 0:u.warnings)??[]}}const ko=6,mn="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const wo='[role="combobox"]';function K(e){return e instanceof Element&&e.matches(wo)}function Io({value:e,yieldToPalette:t=!1,enabled:s=!0}){const n=qe(),o=it(),[a,r]=c.useState(!1),[i,d]=c.useState({stamp:"",index:0}),[p,u]=c.useState(!1),[x,v]=c.useState(!1);e.length>0&&!x&&v(!0);const m=c.useRef(!1);c.useEffect(()=>{m.current=!0},[]);const{data:f}=he({enabled:s}),g=c.useMemo(()=>((f==null?void 0:f.agents)??[]).map(R=>R.projectPath),[f]),{data:w}=Ke(g,{enabled:s}),h=c.useMemo(()=>w??{},[w]),y=c.useMemo(()=>ct(g,h),[g,h]),I=c.useMemo(()=>new Map(g.map(R=>[ge(R),R])),[g]),S=c.useCallback(R=>lt({room:R,agentsByPath:h,pathByAgentRef:I}),[h,I]),M=c.useMemo(()=>dt(o.muted),[o.muted]),{items:C}=vo({mutedRoomIds:M,enabled:s}),N=c.useMemo(()=>C.slice(0,ko),[C]),A=s&&a&&!p&&!x&&!t&&e.length===0&&N.length>0,_=`${A}:${N.length}`,j=i.stamp===_?i.index:0,b=c.useCallback(R=>{m.current&&K(R.target)&&(u(!1),v(!1),r(!0))},[]),O=c.useCallback(R=>{K(R.target)&&r(!0)},[]),k=c.useCallback(R=>{K(R.target)&&r(!1)},[]),T=c.useCallback(R=>{N.length!==0&&d(U=>{const oe=U.stamp===_?U.index:0;return{stamp:_,index:(oe+R+N.length)%N.length}})},[N.length,_]),$=c.useCallback(()=>T(1),[T]),W=c.useCallback(()=>T(-1),[T]),z=c.useCallback(()=>{u(!0)},[]),B=c.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Z.getState().recordOpened("agent",R.session.cwd),n(pe({dir:R.session.cwd??void 0,session:R.session.id}));return}Z.getState().recordOpened("room",R.room.id),n({...ut.channels(),search:{id:R.room.id}})},[n]),D=c.useCallback(()=>{const R=N[j];!A||!R||B(R)},[A,N,j,B]);return{isOpen:A,hasRows:N.length>0,rows:N,agents:h,displayNames:y,visualOf:S,selectedIndex:j,activeDescendantId:A&&N[j]!==void 0?ke(j):void 0,listboxId:A?mn:void 0,handleFocus:b,handleBlur:k,handlePointerDown:O,moveDown:$,moveUp:W,selectHighlighted:D,selectRow:B,dismiss:z}}function fn({mark:e,label:t,title:s,summary:n,lastActivityAt:o,index:a,isSelected:r,now:i,onSelect:d}){const p=c.useMemo(()=>Number.isNaN(Date.parse(o))?null:yt(o),[o,i]);return l.jsxs("div",{id:ke(a),role:"option","aria-selected":r,"data-selected":r,title:s,onClick:d,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:[l.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),l.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[l.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:t}),p!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:p})]}),n!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:n})]})]})}function No({item:e,agent:t,displayName:s,index:n,isSelected:o,now:a,onSelect:r}){const i=ft(t,e.session.cwd??s);return l.jsx(fn,{mark:l.jsx(pt,{color:i.color,emoji:i.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:n,isSelected:o,now:a,onSelect:r})}function Ro({item:e,visual:t,index:s,isSelected:n,now:o,onSelect:a}){return l.jsx(fn,{mark:l.jsx(ht,{room:e.room,participants:e.room.participants,visuals:xt(t)}),label:l.jsx(gt,{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:a})}function Co({rows:e,selectedIndex:t,agents:s={},displayNames:n={},visualOf:o,onSelect:a}){const r=mt(6e4);return c.useEffect(()=>{var i,d;(d=(i=document.getElementById(ke(t)))==null?void 0:i.scrollIntoView)==null||d.call(i,{block:"nearest"})},[t]),l.jsx(Ye.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:i=>i.preventDefault(),children:l.jsx("div",{id:mn,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((i,d)=>{var p;return i.kind==="session"?l.jsx(No,{item:i,agent:i.session.cwd&&s[i.session.cwd]||null,displayName:i.session.cwd&&n[i.session.cwd]||((p=i.session.cwd)==null?void 0:p.split("/").pop())||"Agent",index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`session-${i.id}`):l.jsx(Ro,{item:i,visual:o(i.room),index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`room-${i.id}`)})})})}const $e={people:"People",agents:"Agents"},Ao=["people","agents"];function Mo(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 So(e,t,s){const n=t.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:jo(a,n)})).filter(a=>a.tier!==null).sort((a,r)=>a.tier-r.tier||a.position-r.position);return s.flatMap(a=>o.filter(r=>r.row.section===a).map(({row:r})=>r))}function jo(e,t){var o;if(t==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let n=null;for(const a of s){const r=a===t?0:a.startsWith(t)?1:a.includes(t)?2:null;r!==null&&(n===null||r<n)&&(n=r)}return n}function J(e,t,s){var a;const n=e.length;if(n===0)return 0;let o=(t%n+n)%n;for(let r=0;r<n;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+n)%n}return 0}function _o(e,t,s,n){const o=e.slice(0,t),a=e.slice(t+1+s.length),r=`@${n}`,i=a.startsWith(" ")?"":" ";return{value:o+r+i+a,cursorPos:o.length+r.length+1}}const Oo=/(^|\s)@([A-Za-z0-9_.-]*)$/,pn="mention-palette-listbox";function me(e){return`mention-item-${e}`}function Eo({members:e,viewerAuthorId:t,text:s,sectionOrder:n=Ao}){var O;const[o,a]=c.useState(!1),[r,i]=c.useState(""),[d,p]=c.useState(-1),u=bt(s),x=c.useRef(!1),v=c.useMemo(()=>Mo(e,t),[e,t]),m=c.useMemo(()=>o?So(v,r,n):[],[v,r,o,n]),[f,g]=c.useState(null),w=f!==null&&f.query===r&&f.open===o?f.index:J(m,0,1),h=m[w],y=m.length===0||h!==void 0&&!h.disabled?w:J(m,0,1),I=c.useCallback((k,T)=>{const $=k.slice(0,T).match(Oo);if(!$){a(!1);return}a(!0),i($[2]),p(($.index??0)+$[1].length)},[]),S=c.useCallback(k=>{u.write(k),x.current=!1},[u]),M=c.useCallback(k=>{x.current||I(u.read(),k)},[I,u]),C=c.useCallback(()=>{g({query:r,open:o,index:J(m,y+1,1)})},[m,y,r,o]),N=c.useCallback(()=>{g({query:r,open:o,index:J(m,y-1,-1)})},[m,y,r,o]),A=c.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),_o(u.read(),d,r,k.handle)),[d,r,u]),_=c.useCallback(()=>{const k=m[y];return k?A(k):(a(!1),null)},[m,y,A]),j=c.useCallback(()=>{x.current=!0,a(!1)},[]),b=m.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:b,rows:m,selectedIndex:y,activeDescendantId:o&&((O=m[y])==null?void 0:O.disabled)===!1?me(y):void 0,listboxId:o?pn:void 0,noteTextChange:S,handleCursorChange:M,moveDown:C,moveUp:N,selectHighlighted:_,selectRow:A,dismiss:j}}function To({rows:e,selectedIndex:t,onSelect:s}){const n=c.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const i=o[o.length-1];i&&i.section===a.section?i.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return c.useEffect(()=>{var o;(o=document.getElementById(me(t)))==null||o.scrollIntoView({block:"nearest"})},[t]),l.jsx(Ye.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:l.jsx("div",{id:pn,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?l.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:a},r)=>l.jsxs("div",{role:"group","aria-label":$e[o],children:[r>0&&l.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),l.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:$e[o]}),a.map(({row:i,index:d})=>{const p=d===t;return l.jsxs("div",{id:me(d),role:"option","aria-selected":p,"aria-disabled":i.disabled,"data-selected":p,"data-disabled":i.disabled,onClick:()=>{i.disabled||s(i)},className:i.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:[l.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:i.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:i.label}),i.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",i.handle]}),i.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:i.disabledReason})]},i.authorId)})]},o))})})}const $o=/@([A-Za-z0-9][A-Za-z0-9_.-]*)/g,Do=/[.\-_]+$/;function Po(e,t){const s=new Map;for(const{author:o}of t)o.handle&&s.set(o.handle.toLowerCase(),o.handle);const n=[];for(const o of e.matchAll($o)){if(o.index===void 0)continue;const a=o[1].toLowerCase(),r=a.replace(Do,""),i=s.get(a)??s.get(r);if(!i)continue;const d=(s.has(a)?a.length:r.length)+1;n.push({offset:o.index,length:d,authorId:i,handle:i})}return n}function Fo(e,t){const s=zs(e,Po(e,t)),n=[],o=[];for(const r of s){const i=r.cc?o:n;i.includes(r.handle)||i.push(r.handle)}if(o.length===0||n.length===0)return null;const a=r=>r.map(i=>`@${i}`).join(", ");return`Asks ${a(n)} · cc ${a(o)}`}function ua({room:e,threadRootId:t,focusOnMount:s,offerJumpBackIn:n,onFocusChange:o,attachments:a}){const r=t===void 0?e.id:Ue(e.id,t),i=vt(r),{target:d}=Et(),p=kt(),u=wt(r),x=c.useRef(null),v=Ve(e.members,e.viewerAuthorId),m=c.useRef(!1),f=Eo({members:e.members,viewerAuthorId:e.viewerAuthorId,text:i}),g=c.useMemo(()=>e.kind==="channel"?Fo(i,e.members):null,[e.kind,e.members,i]),w=n===!0,h=Io({value:i,yieldToPalette:f.isOpen,enabled:w}),y=c.useRef(u);c.useEffect(()=>{var b;u!==y.current&&(y.current=u,(b=x.current)==null||b.focus())},[u]),c.useEffect(()=>{var b;s===!0&&((b=x.current)==null||b.focusUnlessTouch())},[]);const I=c.useCallback(b=>X.getState().set(r,b),[r]),[S,M]=c.useState(null);c.useLayoutEffect(()=>{var b;S!==null&&((b=x.current)==null||b.focusAt(S.pos))},[S]);const C=c.useCallback(b=>{b&&(I(b.value),M({pos:b.cursorPos}))},[I]),N=c.useCallback(b=>C(f.selectRow(b)),[f,C]),A=c.useCallback(()=>C(f.selectHighlighted()),[f,C]),_=()=>{if(d===null||!d.canSend||m.current)return;f.dismiss();const b=X.getState().take(r).trim();if(b==="")return;const O=a.pendingFiles.length>0;O&&(m.current=!0),d.send({text:b}).catch(()=>{const k=X.getState(),T=k.drafts[r]??"";k.set(r,T===""?b:`${b}
|
|
44
|
+
${T}`)}).finally(()=>{O&&(m.current=!1)})};if(!v)return l.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[l.jsx("p",{className:"text-muted-foreground text-sm",children:Ge}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:p.isPending,onClick:()=>p.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>Be.success(`You joined ${se(e)}`)}),children:It})]});const j=l.jsx(Tt.Composer,{inputRef:x,value:i,onChange:b=>{I(b),f.noteTextChange(b)},onSubmit:_,footer:g?l.jsx("p",{"data-slot":"cc-line",className:"text-muted-foreground px-3 pb-2 text-xs",children:g}):void 0,head:l.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f.isOpen&&f.rows.length===0?"No one by that name.":""}),mentionPicker:l.jsx(Re,{children:f.isOpen&&l.jsx(To,{rows:f.rows,selectedIndex:f.selectedIndex,onSelect:N})}),overlays:l.jsx(l.Fragment,{children:l.jsx(Re,{children:h.isOpen&&l.jsx(Co,{rows:h.rows,selectedIndex:h.selectedIndex,agents:h.agents,displayNames:h.displayNames,visualOf:h.visualOf,onSelect:h.selectRow})})}),input:{onCursorChange:f.handleCursorChange,isStreaming:!1,isPaletteOpen:f.isOpen||h.isOpen,paletteHasResults:h.isOpen?h.hasRows:f.hasSelectableRows,onArrowUp:h.isOpen?h.moveUp:f.moveUp,onArrowDown:h.isOpen?h.moveDown:f.moveDown,onCommandSelect:h.isOpen?h.selectHighlighted:A,onEscape:h.isOpen?h.dismiss:f.dismiss,tabPicks:!h.isOpen,onClear:()=>{I(""),f.dismiss()},activeDescendantId:h.isOpen?h.activeDescendantId:f.activeDescendantId,paletteListboxId:h.isOpen?h.listboxId:f.listboxId,contextKey:r,...a.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!w&&o===void 0?j:l.jsx("section",{className:"flex flex-col","data-testid":Nt.homeComposer,onFocus:b=>{h.handleFocus(b),K(b.target)&&(o==null||o(!0))},onBlur:b=>{h.handleBlur(b),K(b.target)&&(o==null||o(!1))},onPointerDown:h.handlePointerDown,children:j})}export{ra as A,ua as C,ye as I,la as R,ea as a,ca as b,Ns as c,na as d,ia as e,aa as f,ta as g,Rs as h,cs as i,Zo as j,Cs as k,As as l,Ms as m,sa as n,oa as o,K as p,is as r,q as t,da as u};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{O as m,a1 as x,
|
|
1
|
+
import{O as m,a1 as x,aW as k,r as v,j as t,B as d,G as p,dD as y}from"./index-B48IJBNm.js";import{u as D}from"./use-update-config-B2rsDnxk.js";import{I as O}from"./inline-code-BCFlKPIb.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const g={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};g.node;const
|
|
6
|
+
*/const g={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};g.node;const R=m(g);function S(){const e=typeof window<"u"?window.electronAPI:void 0;if(typeof(e==null?void 0:e.restartServer)!="function"||typeof e.resetAllData!="function")return null;const{restartServer:r,resetAllData:c}=e;return{restartServer:()=>r(),resetAllData:()=>c()}}function C(e){if(!e.ok)throw new Error(e.message)}async function w(e){const r=S();r?C(await r.restartServer()):await e.restartServer()}function b(e){return e.isLoading||e.isError||e.enabled?null:e.initError?"failed":e.lockedByEnv?"env":e.enabledInConfig===!0?"restart":"off"}function I({relay:e,variant:r}){const c=x(),a=D(),h=k(i=>i.setRestartOverlayOpen),[n,u]=v.useState(!1),l=b(e);if(!l)return null;const f=async()=>{u(!0);try{await w(c),h(!0)}catch(i){y.error("Couldn’t restart DorkOS.",{description:i instanceof Error?i.message:"It may not have restarted. Try again."})}finally{u(!1)}};let s,o=null;switch(l){case"env":s=t.jsxs(t.Fragment,{children:["Chat apps are off: ",t.jsx(O,{children:"DORKOS_RELAY_ENABLED"})," overrides the setting. Remove it, then restart DorkOS."]});break;case"failed":s="Chat apps didn’t start. Restarting DorkOS tries again.",o=t.jsx(d,{size:"sm",variant:"secondary",disabled:n,onClick:()=>void f(),children:n?"Restarting…":"Restart DorkOS"});break;case"restart":s="Chat apps turn on when DorkOS restarts. Restarting stops anything running right now.",o=t.jsx(d,{size:"sm",disabled:n,onClick:()=>void f(),children:n?"Restarting…":"Restart DorkOS"});break;case"off":s="Chat apps are off. Turn them on to reach agents from Telegram, Slack or webhooks.",o=t.jsx(d,{size:"sm",disabled:a.isPending,onClick:()=>a.mutate({relay:{enabled:!0}}),children:a.isPending?"Turning on…":"Turn on chat apps"});break}return t.jsxs("div",{"data-testid":"chat-apps-off","data-reason":l,className:p(r==="line"?"flex flex-wrap items-center gap-x-3 gap-y-2":"flex flex-col items-center gap-3 p-8 text-center"),children:[r==="block"&&t.jsx(R,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),t.jsx("p",{className:p("text-muted-foreground",r==="line"?"text-xs":"text-sm"),role:"status",children:s}),o,a.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save. Check that DorkOS is running, then try again."})]})}export{I as C,R,S as g,w as r,C as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as J,r as T}from"./index-p3WivF1M.js";import{R as lt}from"./index-CRCfkwyN.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,F as Ve,R as N,W as Y,G as oe,y as ot,z as at,A as je,B as Ie,H as ft,V as dt,m as ht,n as ct}from"./index-JoxvTUfo.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=dt.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(ot),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
1
|
+
import{j as J,r as T}from"./index-B48IJBNm.js";import{R as lt}from"./index-okP_lDUw.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,F as Ve,R as N,W as Y,G as oe,y as ot,z as at,A as je,B as Ie,H as ft,V as dt,m as ht,n as ct}from"./index-sCJ7YWzB.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=dt.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(ot),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
2
2
|
`){m.firstChild||m.appendChild(document.createElement("br")),m=S(),A++;continue}let L=D,ce=w+(C?" cm-deletedText":""),ue=!1,X=c.indexOf(`
|
|
3
3
|
`,A);if(X>-1&&X<D&&(L=X),o&&g<p.length){let j=Math.max(0,C?p[g].toA:p[g].fromA);j<=L&&(L=j,C&&g++,ue=!0)}if(L>A){let j=document.createTextNode(c.slice(A,L));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(j)}else m.appendChild(j);A=L}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),D=0;at(x,{style:w=>ft(t,w)},(w,A,L)=>{w>D&&R(D,w,""),R(w,A,L),D=A}),R(D,c.length,"")}else R(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),d},r=M.widget({block:!0,side:-1,widget:new rt(i)});return ye.set(e.changes,r),r}function Nt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(f=>f.fromB<=l&&f.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(V);i.fromB!=i.toB&&i.toA<=s.length&&(r+=t.state.lineBreak);let o=Ne.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:r},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function Ft(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!i)return!1;let s=n.field(V).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function Re(t){let e=new N;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&it(t,n);e.add(n.fromB,n.fromB,Gt(t,n,!!l))}return e.finish()}const Vt=H.define({create:t=>Re(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Re(e.state):t},provide:t=>B.decorations.from(t)}),Te=new WeakMap;function it(t,e){let n=Te.get(e);if(n!==void 0)return n;n=null;let l=t.field(V),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==s&&r<10){let o=[],f=0,h=e.fromA,a=e.fromB;for(let d of e.changes){if(d.fromA<d.toA){f+=d.toA-d.fromA;let c=l.sliceString(h+d.fromA,h+d.toA);if(/\n/.test(c))break e;o.push(M.widget({widget:new jt(c),side:-1}).range(a+d.fromB))}d.fromB<d.toB&&o.push(tt.range(a+d.fromB,a+d.toB))}f<e.endA-e.fromA-r*2&&(n=o)}return Te.set(e,n),n}class jt extends Y{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const It=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Ut=M.line({class:"cm-inlineChangedLine"});function Wt(t,e,n,l){let i=it(t,e),r=0;if(!i)return!1;for(let s=t.doc.lineAt(e.fromB);;){for(l&&l.add(s.from,s.from,It),n.add(s.from,s.from,Ut);r<i.length&&i[r].to<=s.to;){let o=i[r++];n.add(o.from,o.to,o.value)}if(s.to>=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}function Ht(t){const[e,n]=T.useState([]);return T.useEffect(()=>{let l=!1;const i=ht.matchFilename(ct,t);if(!i){n([]);return}return i.load().then(r=>{l||n([r])}).catch(()=>{l||n([])}),()=>{l=!0}},[t]),e}function Kt({baseline:t,current:e,theme:n,filename:l,sideBySide:i,onRejectHunk:r,onHunkCountChange:s}){const o=Ht(l);return i?J.jsx(Pt,{baseline:t,current:e,theme:n,languageExtension:o}):J.jsx(zt,{baseline:t,current:e,theme:n,languageExtension:o,onRejectHunk:r,onHunkCountChange:s})}function zt({baseline:t,current:e,theme:n,languageExtension:l,onRejectHunk:i,onHunkCountChange:r}){const s=T.useRef(-1),o=T.useMemo(()=>[B.lineWrapping,Tt({original:t,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),...l],[t,l]);return J.jsx(lt,{value:e,editable:!1,readOnly:!0,theme:n,height:"100%",className:"desktop:select-text h-full text-sm",extensions:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},onChange:f=>i(f),onUpdate:f=>{var a;const h=((a=vt(f.state))==null?void 0:a.chunks.length)??null;h!==null&&h!==s.current&&(s.current=h,r(h))}})}function Pt({baseline:t,current:e,theme:n,languageExtension:l}){const i=T.useRef(null);return T.useEffect(()=>{const r=i.current;if(!r)return;const s=[B.editable.of(!1),ne.readOnly.of(!0),B.lineWrapping,...n==="dark"?[qt()]:[],...l],o=new Et({a:{doc:t,extensions:s},b:{doc:e,extensions:s},parent:r,collapseUnchanged:{margin:3,minSize:4},highlightChanges:!0,gutter:!0});return()=>o.destroy()},[t,e,n,l]),J.jsx("div",{ref:i,className:"cm-diff-split h-full overflow-auto text-sm"})}function qt(){return B.theme({"&":{backgroundColor:"transparent",color:"inherit"}},{dark:!0})}export{Kt as CodeMirrorDiff};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as f}from"./index-
|
|
1
|
+
import{r as n,j as f}from"./index-B48IJBNm.js";import{R as l}from"./index-okP_lDUw.js";import{m as a,n as c,E as x}from"./index-sCJ7YWzB.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
|