ryco-cli 0.1.30 → 0.1.31
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/{AcpAdapter-DjP0IHpH.cjs → AcpAdapter-ByUp9-wk.cjs} +71 -51
- package/dist/{AcpAdapter-CKWzfB3Q.mjs → AcpAdapter-CY_ANTKu.mjs} +73 -53
- package/dist/{AcpNativeLogging-Do0LktDb.mjs → AcpNativeLogging-C7PC6imv.mjs} +30 -4
- package/dist/{AcpNativeLogging-5gTPK9Fq.cjs → AcpNativeLogging-OQeAya9d.cjs} +33 -1
- package/dist/{AcpRegistryDriver-BblCFfev.cjs → AcpRegistryDriver-CD9GN7rI.cjs} +3 -3
- package/dist/{AcpRegistryDriver-BzohT-PC.mjs → AcpRegistryDriver-DMZ5VBWJ.mjs} +4 -4
- package/dist/AzureDevOpsSourceControlProvider-5giVYoNi.mjs +2053 -0
- package/dist/AzureDevOpsSourceControlProvider-BKMXEUaN.cjs +2055 -0
- package/dist/{BitbucketSourceControlProvider-D5UVAc9z.mjs → BitbucketSourceControlProvider-BVUBsEUF.mjs} +63 -23
- package/dist/{BitbucketSourceControlProvider-Bvl_q1o2.cjs → BitbucketSourceControlProvider-BWnnrbch.cjs} +62 -22
- package/dist/{BunPTY-Dcl1Lp62.mjs → BunPTY-CMbDQ1Xb.mjs} +1 -1
- package/dist/{ClaudeDriver-DZkz0QPr.cjs → ClaudeDriver-DCrqouOR.cjs} +1373 -191
- package/dist/{ClaudeDriver-BuQ_azDw.mjs → ClaudeDriver-DVOss8cC.mjs} +1375 -193
- package/dist/{CodexDriver-6Ph2cjAW.cjs → CodexDriver-CBQPHJqU.cjs} +258 -28
- package/dist/{CodexDriver-Bi49RIL4.mjs → CodexDriver-DJoTky7Z.mjs} +261 -31
- package/dist/{CodexTextGeneration-C5TIspJA.mjs → CodexTextGeneration-BSgNgfZv.mjs} +6 -6
- package/dist/{CodexTextGeneration-sXPR9eld.cjs → CodexTextGeneration-C9MDQmZm.cjs} +7 -7
- package/dist/{CopilotDriver-Bcdpz6U_.mjs → CopilotDriver-CUkdPXcH.mjs} +78 -20
- package/dist/{CopilotDriver-D6P0xgRX.cjs → CopilotDriver-DbaMDH16.cjs} +76 -18
- package/dist/{CursorDriver-CRnDGwEv.mjs → CursorDriver-B-ZilXJB.mjs} +114 -97
- package/dist/{CursorDriver-DMJ7sGSx.cjs → CursorDriver-DKQqPbKH.cjs} +114 -97
- package/dist/{ForgejoSourceControlProvider-D4jGdaJX.cjs → ForgejoSourceControlProvider-CgpjFECj.cjs} +94 -60
- package/dist/{ForgejoSourceControlProvider-Dl_Fk3RY.mjs → ForgejoSourceControlProvider-DemMYUye.mjs} +95 -61
- package/dist/{GitHubSourceControlProvider-QMe-zymI.cjs → GitHubSourceControlProvider-C4un6hOK.cjs} +218 -119
- package/dist/{GitHubSourceControlProvider-DnwKf0ap.mjs → GitHubSourceControlProvider-CRSDYcjc.mjs} +206 -108
- package/dist/GitLabSourceControlProvider-D8W1ZLPh.cjs +2260 -0
- package/dist/GitLabSourceControlProvider-DpWkJ0M3.mjs +2258 -0
- package/dist/{GrokDriver-jy8JIvYY.cjs → GrokDriver-BQ6G_7ZZ.cjs} +6 -7
- package/dist/{GrokDriver-Bvq1jP3S.mjs → GrokDriver-Buvas9-q.mjs} +5 -6
- package/dist/{Metrics-CnmjpbWk.mjs → Metrics-C3vLS9rz.mjs} +123 -13
- package/dist/{Metrics-C0LSU8s7.cjs → Metrics-DjRPLE98.cjs} +170 -12
- package/dist/{NodePTY-D7tFWuQe.mjs → NodePTY-DgnuBruq.mjs} +1 -1
- package/dist/{OpenCodeDriver-DhyVaBMT.mjs → OpenCodeDriver-BWEZD841.mjs} +183 -49
- package/dist/{OpenCodeDriver-Bu5D19tl.cjs → OpenCodeDriver-qUiX0RLH.cjs} +183 -49
- package/dist/{SideQuestionIsolation-B-aE6aBz.mjs → SideQuestionIsolation-B1T-DsR0.mjs} +1 -1
- package/dist/{SideQuestionIsolation-CtJ4wX83.cjs → SideQuestionIsolation-BPC-Bxsz.cjs} +1 -1
- package/dist/bin.cjs +37021 -10253
- package/dist/bin.mjs +36892 -10178
- package/dist/client/assets/AccountSettings-B88Q_w9Y.js +1 -0
- package/dist/client/assets/AiFocusSettings-Bb0TrCPn.js +1 -0
- package/dist/client/assets/{AnimatedHeight-UXn4-nUd.js → AnimatedHeight-epXOsgdm.js} +1 -1
- package/dist/client/assets/AppearanceSettings-XS9WRVPU.js +1 -0
- package/dist/client/assets/AutomationsDialog-bZckh4Y3.js +1 -0
- package/dist/client/assets/AutomationsSummary-wPFZCF49.js +1 -0
- package/dist/client/assets/BranchToolbar.logic-DjzLKbbB.js +3 -0
- package/dist/client/assets/BrowserPanel-CdBLnnfz.js +1 -0
- package/dist/client/assets/ChatRightPanel-BCINd0vP.js +34 -0
- package/dist/client/assets/ChatThreadRouteView-BFZ0Si-l.js +1 -0
- package/dist/client/assets/ColorSwatchPicker-CGyo99o0.js +1 -0
- package/dist/client/assets/CommandPalette.logic-BIOMtnEQ.js +1 -0
- package/dist/client/assets/CommandPaletteDialog-Db4LH--z.js +2 -0
- package/dist/client/assets/CompositeRoot-DtnwMJKj.js +1 -0
- package/dist/client/assets/ComputerUseSettings-CkqCqDsU.js +1 -0
- package/dist/client/assets/ConnectionsSettings-B9mxExdG.js +7 -0
- package/dist/client/assets/CreatePullRequestDialog-CJ7pNCue.js +1 -0
- package/dist/client/assets/CreatePullRequestDialogHost-n4ZjdSr4.js +1 -0
- package/dist/client/assets/DiagnosticsSettings-f9rFG9re.js +2 -0
- package/dist/client/assets/DiagnosticsSettings.logic-Byf-Bu4S.js +1 -0
- package/dist/client/assets/DialogHandle-C0c_rK3I.js +1 -0
- package/dist/client/assets/{DialogPopup-NfwDyR5c.js → DialogPopup-BKW1PEEa.js} +1 -1
- package/dist/client/assets/DialogRoot-BIubqrv0.js +1 -0
- package/dist/client/assets/DialogTitle-BAX_FLoG.js +1 -0
- package/dist/client/assets/{DialogViewport-B6w_ROOE.js → DialogViewport-C2iOUx0O.js} +1 -1
- package/dist/client/assets/DiffPanel-BkqDt_SS.js +25 -0
- package/dist/client/assets/DisclosureRegion-B8556yU0.js +1 -0
- package/dist/client/assets/DraftChatThreadRouteView-BKgRKJ2w.js +1 -0
- package/dist/client/assets/{ExternalIdentityWeb.logic-BlKX8J9h.js → ExternalIdentityWeb.logic-Cu6suNrN.js} +1 -1
- package/dist/client/assets/GlassSurface-DLYYzRdP.js +1 -0
- package/dist/client/assets/HostedConnectionControls-CoVqtnrK.js +1 -0
- package/dist/client/assets/HostedHubRoot-CM2CwPUr.js +2 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-j7oSlakZ.js → HostedNativeAuthorizationRoute-Bizmqrh_.js} +2 -2
- package/dist/client/assets/HostedNodeRenameDialog-SXWMsTO0.js +1 -0
- package/dist/client/assets/HostedRelayTrustNotice-BfTyrBi5.js +1 -0
- package/dist/client/assets/InboxStatusGlyph-BPTqzp7l.js +1 -0
- package/dist/client/assets/IntegrationsSettingsPanel-DAPvkV4i.js +1 -0
- package/dist/client/assets/KeybindingsSettings-B8g-YI2O.js +1 -0
- package/dist/client/assets/LazyBrowserPanel-Ds9cdOC_.js +2 -0
- package/dist/client/assets/McpServersSettings-Dw6G3ff3.js +6 -0
- package/dist/client/assets/MobileSheet-DfgXNWbd.js +1 -0
- package/dist/client/assets/ModelTuningDial-DQBAbuNL.js +1 -0
- package/dist/client/assets/NewWorktreeDialog-CDZAJmK6.js +4 -0
- package/dist/client/assets/NodeSecuritySettings-3MELA9ru.js +1 -0
- package/dist/client/assets/NullStore-gT_6_xZE.js +1 -0
- package/dist/client/assets/OnboardingDialog-CAAtNnJf.js +1 -0
- package/dist/client/assets/OpinionatedPluginsSettings-AiDB0Vl4.js +1 -0
- package/dist/client/assets/{PdfAttachmentPreview-C8-hT8KQ.js → PdfAttachmentPreview-BFNW2wjN.js} +2 -2
- package/dist/client/assets/{PhoneGetAppInterstitial-Zh0zpBgT.js → PhoneGetAppInterstitial-D8fwZ8E9.js} +1 -1
- package/dist/client/assets/PhoneHome-YHgHljA0.js +1 -0
- package/dist/client/assets/PhoneSettingsSurface-BVxJppvK.js +2 -0
- package/dist/client/assets/PreviewPanel-BYcEnkv9.js +643 -0
- package/dist/client/assets/ProjectScriptDialog-K34K2Kzm.js +1 -0
- package/dist/client/assets/ProjectsPage-DXnMYLjb.js +1 -0
- package/dist/client/assets/PromoteChatDialog-CAY7_wJ-.js +1 -0
- package/dist/client/assets/ProviderLimitWindow-CK04BSkM.js +1 -0
- package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BMBrDDOC.js +1 -0
- package/dist/client/assets/ProvidersSettingsPanel-C85PX9Es.js +1 -0
- package/dist/client/assets/PullRequestsPage-C0rgfGwB.js +1 -0
- package/dist/client/assets/{QuitShortcutFeedback-Qs9XsuZ4.js → QuitShortcutFeedback-DSkKqETs.js} +1 -1
- package/dist/client/assets/RedactedSensitiveText-DQ0YveQd.js +1 -0
- package/dist/client/assets/RollingText-BzvpP5fa.js +1 -0
- package/dist/client/assets/RootAppShell-BYQ-eGNT.js +6 -0
- package/dist/client/assets/{Separator-B6Esv57Y.js → Separator-DpiW19Vw.js} +1 -1
- package/dist/client/assets/SettingsPage-BCFN7Ju2.js +2 -0
- package/dist/client/assets/SettingsPanels-CP6z2b1x.js +3 -0
- package/dist/client/assets/SettingsPanels.editor-D8U-TWWG.js +1 -0
- package/dist/client/assets/SettingsSelect-DEhNaz3E.js +1 -0
- package/dist/client/assets/Sidebar.logic-D_ODfSpl.js +1 -0
- package/dist/client/assets/SimulatorPanel-DCT6fZ0X.js +1 -0
- package/dist/client/assets/SourceControlSettings-DxUtvPMK.js +1 -0
- package/dist/client/assets/StatisticsPage-C9SrwtM4.js +1 -0
- package/dist/client/assets/StatisticsPanel-BMYLETs0.js +1 -0
- package/dist/client/assets/ThreadLinkList-BN5z5EpS.js +169 -0
- package/dist/client/assets/ThreadTerminalDrawer-CgIFOlR-.js +18 -0
- package/dist/client/assets/ThreadWorkspacePanel-DvXoqQPF.js +3 -0
- package/dist/client/assets/ToolbarRootContext-8FsV9Cpj.js +1 -0
- package/dist/client/assets/TraitsPicker-DcrpJahy.js +1 -0
- package/dist/client/assets/Virtualizer-CwXeUPla.js +1345 -0
- package/dist/client/assets/WorkspacePullRequestPanel-3mlcJn9G.js +1 -0
- package/dist/client/assets/WorkspaceReview-UGbCgXeK.js +2 -0
- package/dist/client/assets/{abnfDiagram-N423BO3Z-ByEe3mC0.js → abnfDiagram-N423BO3Z-DVEM6Scc.js} +1 -1
- package/dist/client/assets/{activity-CwTUF6lv.js → activity-DVCuAejY.js} +1 -1
- package/dist/client/assets/{alert-DQEkrtUJ.js → alert-FV7ZIit_.js} +1 -1
- package/dist/client/assets/alert-dialog-CgXR9tED.js +1 -0
- package/dist/client/assets/app-window-3xtwqZgI.js +1 -0
- package/dist/client/assets/appChrome-COCz-T7w.js +1 -0
- package/dist/client/assets/{appearancePreferences-nFx4MHoI.js → appearancePreferences-NnsvXwBe.js} +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-DXXb_0_g.js +1 -0
- package/dist/client/assets/{architectureDiagram-T3A2C74G-Bd-yxaTr.js → architectureDiagram-T3A2C74G-B6pcKiCj.js} +1 -1
- package/dist/client/assets/{arrow-left-DUOpzEbP.js → arrow-left-Blu3LSE2.js} +1 -1
- package/dist/client/assets/{arrow-right-HOYJnPKw.js → arrow-right-CO3CH0ne.js} +1 -1
- package/dist/client/assets/arrow-up-B69gV2Bq.js +1 -0
- package/dist/client/assets/{arrow-up-right-DHnMKuVA.js → arrow-up-right-BbPGFOLA.js} +1 -1
- package/dist/client/assets/authorization-Ob6YwWiI.js +1 -0
- package/dist/client/assets/autocomplete-RVpjsrDv.js +1 -0
- package/dist/client/assets/ban-BIm2PVkE.js +1 -0
- package/dist/client/assets/{blockDiagram-VBNYF7ZC-CPDBonMC.js → blockDiagram-VBNYF7ZC-WNerGp9V.js} +1 -1
- package/dist/client/assets/{bot-DxjPA7Bw.js → bot-C9nWtaWq.js} +1 -1
- package/dist/client/assets/browserState-jt47YsqD.js +1 -0
- package/dist/client/assets/{c4Diagram-5PPSVZJV-BM6pAiqT.js → c4Diagram-5PPSVZJV-wp1ioOoM.js} +1 -1
- package/dist/client/assets/camera-C13VoW3c.js +1 -0
- package/dist/client/assets/capabilities-CfOhq009.js +1 -0
- package/dist/client/assets/channel-56r2qL2v.js +1 -0
- package/dist/client/assets/{chart-column-Cg7d41tb.js → chart-column-DRv0YtL_.js} +1 -1
- package/dist/client/assets/checkbox-CIIIY9FA.js +1 -0
- package/dist/client/assets/checks-Dw022Bvy.js +1 -0
- package/dist/client/assets/{chunk-2GRJ4B5K-DVKozJ41.js → chunk-2GRJ4B5K-DRl3ILpc.js} +1 -1
- package/dist/client/assets/{chunk-4I5QYGJK-BRoMwPkW.js → chunk-4I5QYGJK-CYTRl4bo.js} +1 -1
- package/dist/client/assets/{chunk-5RXB4S5H-DFMKyoqP.js → chunk-5RXB4S5H-VCNwRsOa.js} +1 -1
- package/dist/client/assets/{chunk-6Q2QTUOP-Ba6UENe9.js → chunk-6Q2QTUOP-DnSeKGPG.js} +1 -1
- package/dist/client/assets/{chunk-7Z6QIM7H-B87gYLWH.js → chunk-7Z6QIM7H-Cjilh9TF.js} +1 -1
- package/dist/client/assets/{chunk-GF5L2VYU-DZ840GRQ.js → chunk-GF5L2VYU-CGR7AW0t.js} +1 -1
- package/dist/client/assets/{chunk-I66GZJ75-BO6p4Aqg.js → chunk-I66GZJ75-CXSn8dDu.js} +1 -1
- package/dist/client/assets/{chunk-JQJVKLGR-5dTfVinz.js → chunk-JQJVKLGR-Dro-75lU.js} +1 -1
- package/dist/client/assets/{chunk-KBJHAD2P-BeWfBZdP.js → chunk-KBJHAD2P-BDqN2kVf.js} +1 -1
- package/dist/client/assets/{chunk-NSK5VX7P-DuRkdn5k.js → chunk-NSK5VX7P-DGo5UczH.js} +1 -1
- package/dist/client/assets/{chunk-QR6OTTB3-Duz4Y_uE.js → chunk-QR6OTTB3-RWuyWnBI.js} +1 -1
- package/dist/client/assets/{chunk-UBXNYLIW-D-z8URgN.js → chunk-UBXNYLIW-BPRzeB0w.js} +1 -1
- package/dist/client/assets/{chunk-W5SLKNZC-AGjFjjoJ.js → chunk-W5SLKNZC-DYWocTFi.js} +1 -1
- package/dist/client/assets/{chunk-WRU74C26-BgY3UiXB.js → chunk-WRU74C26-ChbB1jY3.js} +1 -1
- package/dist/client/assets/circle-stop-D8B4hRpY.js +1 -0
- package/dist/client/assets/circle-x-CNLfrTqR.js +1 -0
- package/dist/client/assets/classDiagram-JCYQIIEL-DGvmFev3.js +1 -0
- package/dist/client/assets/classDiagram-v2-OCEON4UE-DGvmFev3.js +1 -0
- package/dist/client/assets/{clipboard-copy-BWf3JuTE.js → clipboard-copy-DGi8FKNO.js} +1 -1
- package/dist/client/assets/clock-3-DmJ4_XPI.js +1 -0
- package/dist/client/assets/clock-DZIuPtNG.js +1 -0
- package/dist/client/assets/color-picker-BdBXje-a.js +1 -0
- package/dist/client/assets/columns-2-CWlMOClK.js +1 -0
- package/dist/client/assets/combobox-Dtjtf7AB.js +1 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-BuOAGqlK.js → cynefin-OW5HDTMX-TuShvMuM.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-MW4NZA55-DqV0Aokp.js → cynefinDiagram-MW4NZA55-B0Edt2Em.js} +1 -1
- package/dist/client/assets/{dagre-VZM6K2ZE-D_GFquDW.js → dagre-VZM6K2ZE-D-eiuqHx.js} +1 -1
- package/dist/client/assets/{data-list-BJCq3CVP.js → data-list-BAx6jBY1.js} +1 -1
- package/dist/client/assets/desktopUpdateAtoms-BjrLa3tl.js +1 -0
- package/dist/client/assets/desktopWorkspace-C2wXVBhc.js +1 -0
- package/dist/client/assets/{deviceName-C2N8ZRX3.js → deviceName-B4youG0v.js} +1 -1
- package/dist/client/assets/{diagram-7IWD3JNH-B1wlsNg2.js → diagram-7IWD3JNH-DgM6lMlR.js} +1 -1
- package/dist/client/assets/{diagram-B4RE2ZJO-D-CYoym7.js → diagram-B4RE2ZJO-CyHNDjzV.js} +1 -1
- package/dist/client/assets/{diagram-LBJQPF4R-DqJ9NCqt.js → diagram-LBJQPF4R-DDzuLIN5.js} +1 -1
- package/dist/client/assets/{diagram-Q27KOJAE-3yp1D2u4.js → diagram-Q27KOJAE-BaBvK9QB.js} +1 -1
- package/dist/client/assets/{diagram-UB23O5K3-Byp25nGC.js → diagram-UB23O5K3-CzZ2ewuZ.js} +1 -1
- package/dist/client/assets/dialogWords-Cg0YkJVg.js +1 -0
- package/dist/client/assets/diffRouteSearch-D2MKN_ah.js +1 -0
- package/dist/client/assets/disclosureMotion-cbMJn5-z.js +1 -0
- package/dist/client/assets/{download-DsYNYJeu.js → download-TvtXS4hE.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-BXEA7PRR-B_IM1l6o.js → ebnfDiagram-BXEA7PRR-CL1vdOKi.js} +1 -1
- package/dist/client/assets/editorPreferences-DqKyA-2Z.js +1 -0
- package/dist/client/assets/ellipsis-CDK1dNFZ.js +1 -0
- package/dist/client/assets/ellipsis-vertical-CwzEUTwV.js +1 -0
- package/dist/client/assets/{empty-BbJHvskr.js → empty-BovKoxbn.js} +1 -1
- package/dist/client/assets/{erDiagram-JOGREHBK--OtcrCRJ.js → erDiagram-JOGREHBK-DmQR2if6.js} +1 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-D272GIcY.js +1 -0
- package/dist/client/assets/external-link-CJeVJZ7s.js +1 -0
- package/dist/client/assets/eye-BUmrXqzg.js +1 -0
- package/dist/client/assets/file-diff-BWc3mYsz.js +1 -0
- package/dist/client/assets/flowDiagram-UKHOOZJN-DLyS38Mm.js +1 -0
- package/dist/client/assets/folder-git-2-CPxg5wKP.js +1 -0
- package/dist/client/assets/folder-open-DcMymvp1.js +1 -0
- package/dist/client/assets/formatCount-B4KLI651.js +1 -0
- package/dist/client/assets/{ganttDiagram-PKOTCBZU-w0seBi3Q.js → ganttDiagram-PKOTCBZU-1q2nUL92.js} +1 -1
- package/dist/client/assets/git-pull-request-BFPwpm3c.js +1 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-BOJ0lcSW.js → gitGraph-4MIJSDKK-COtwmv2S.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-BMfOCCYn.js → gitGraphDiagram-DS77QQ5N-ChsvaxX4.js} +1 -1
- package/dist/client/assets/{group-tVMKGp7Q.js → group-DWWn0dTx.js} +1 -1
- package/dist/client/assets/hammer-BXo-EU88.js +1 -0
- package/dist/client/assets/hostedConnectionCoordinator-BkAE-RhA.js +1 -0
- package/dist/client/assets/{index-BqZvnGNr.js → index-DARIYokI.js} +2 -2
- package/dist/client/assets/{info-A6RAGUB7-acjBTQ5o.js → info-A6RAGUB7-CI2qZ9wW.js} +1 -1
- package/dist/client/assets/{infoDiagram-6WML65LV-DB01Nc2m.js → infoDiagram-6WML65LV-BPmgcTPH.js} +1 -1
- package/dist/client/assets/{input-BDWSVClC.js → input-CCie4mm1.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-KhZTvm-J.js → ishikawaDiagram-WSZJBQD7-LyS9p3Yg.js} +1 -1
- package/dist/client/assets/{journeyDiagram-NVQOT4AX-C3JCYk-2.js → journeyDiagram-NVQOT4AX-BYaAmN65.js} +1 -1
- package/dist/client/assets/{kanban-definition-27J2QSJJ-Dbo0C1s6.js → kanban-definition-27J2QSJJ-D-pwzqFt.js} +1 -1
- package/dist/client/assets/{key-round-CETZqe3h.js → key-round-BlrUTfxB.js} +1 -1
- package/dist/client/assets/keyboard-DlBdq6sz.js +1 -0
- package/dist/client/assets/label-ChtVI9lp.js +1 -0
- package/dist/client/assets/layers-BB-ruGvd.js +1 -0
- package/dist/client/assets/lifecycleSuggestionPolicy-0ERe_O53.js +1 -0
- package/dist/client/assets/list-checks-BkM_ZRsj.js +1 -0
- package/dist/client/assets/loader-3vQnfqIT.js +1 -0
- package/dist/client/assets/{log-out-D5-aSBAz.js → log-out-CKq9YiLY.js} +1 -1
- package/dist/client/assets/{logging-B_qXVrk6.js → logging-CCg76rgn.js} +1 -1
- package/dist/client/assets/main-Ch0bwS-M.js +9 -0
- package/dist/client/assets/main-Di0isH9D.css +2 -0
- package/dist/client/assets/{mermaid-parser.core-B6Q-3x_q.js → mermaid-parser.core-RK9ah5RM.js} +2 -2
- package/dist/client/assets/{mermaidEngine-DksLcesB.js → mermaidEngine-Dr8UsPhH.js} +3 -3
- package/dist/client/assets/message-circle-dashed-BrjwqS7-.js +1 -0
- package/dist/client/assets/messageQueueDrain-B7R7Qmq6.js +1 -0
- package/dist/client/assets/messages-square-cDTkDJv_.js +1 -0
- package/dist/client/assets/{mindmap-definition-FAOFIHXS-LaMzRxqw.js → mindmap-definition-FAOFIHXS-DVudWasx.js} +1 -1
- package/dist/client/assets/{packet-AYTQ26CC-BHhg59Si.js → packet-AYTQ26CC-DnkTsVhD.js} +1 -1
- package/dist/client/assets/panels-top-left-B7jZiLth.js +1 -0
- package/dist/client/assets/path-text-3Rfu6lt8.js +1 -0
- package/dist/client/assets/{pegDiagram-VL7TDLO6-s7l7UD9d.js → pegDiagram-VL7TDLO6-Do5PIp8B.js} +1 -1
- package/dist/client/assets/pencil-Bzg-nc6d.js +1 -0
- package/dist/client/assets/{pie-WAS4IAKB-DygX31Z9.js → pie-WAS4IAKB-B_nNQOzn.js} +1 -1
- package/dist/client/assets/{pieDiagram-7S7Q4E2Y-bb6I9TtZ.js → pieDiagram-7S7Q4E2Y-D_IG4xwA.js} +1 -1
- package/dist/client/assets/{play-DUvOxTpL.js → play-DpXXQ1qB.js} +1 -1
- package/dist/client/assets/popover-OWEv6cQz.js +48 -0
- package/dist/client/assets/presentationTier-DPVAxTK4.js +1 -0
- package/dist/client/assets/previewRouteSearch-BjZdTuSf.js +1 -0
- package/dist/client/assets/primary-Cf-xJExj.js +4 -0
- package/dist/client/assets/primitives-CxTBN7D4.js +1 -0
- package/dist/client/assets/projectCheckouts.logic-DUT4AxXr.js +1 -0
- package/dist/client/assets/projectPaths-B8aVmOZX.js +1 -0
- package/dist/client/assets/projectPreferences-CzWBItFj.js +1 -0
- package/dist/client/assets/providerCapabilities-B2YOPsLN.js +1 -0
- package/dist/client/assets/providerDriverMeta-BHHL9uw0.js +1 -0
- package/dist/client/assets/providerModels-v9PYbzRE.js +1 -0
- package/dist/client/assets/providerStatus-CDPaqb0S.js +1 -0
- package/dist/client/assets/pullRequestsModel.logic-Dv_om_C4.js +1 -0
- package/dist/client/assets/{qr-code-dbkTo07n.js → qr-code-BlbiBIwH.js} +1 -1
- package/dist/client/assets/{qr-code-D4CtBq2F.js → qr-code-DywzVgQC.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-Cj1Y68ZF.js → quadrantDiagram-CIZ2JOQS-DY6fJyrM.js} +1 -1
- package/dist/client/assets/{radar-RG4KPBEZ-FHM3ftPp.js → radar-RG4KPBEZ-D9689I5m.js} +1 -1
- package/dist/client/assets/radio-group-DVwD6Cuy.js +1 -0
- package/dist/client/assets/{railroad-74A4TZTK-CPMn18Cm.js → railroad-74A4TZTK-DVzWbQnl.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-C_2P6umA.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-aGlR3R3z.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-DCB9oE8y.js +1 -0
- package/dist/client/assets/{railroadDiagram-AXF67PYL-DyV3SuDj.js → railroadDiagram-AXF67PYL-D1oJ6Jtl.js} +1 -1
- package/dist/client/assets/readCache-B7cDPz2O.js +1 -0
- package/dist/client/assets/{refresh-cw-CgDa2Ok_.js → refresh-cw-CRUTivd6.js} +1 -1
- package/dist/client/assets/{requirementDiagram-LRYGKXZP-_xEAGWaH.js → requirementDiagram-LRYGKXZP-7RM8iREp.js} +1 -1
- package/dist/client/assets/rotate-ccw-BE2ZCwL6.js +1 -0
- package/dist/client/assets/roving-radio-group-NMPWrDqe.js +1 -0
- package/dist/client/assets/rows-2-DDS4dGTX.js +1 -0
- package/dist/client/assets/runtime-DjjjAcTE.js +18 -0
- package/dist/client/assets/safePolygon-C1AzMRS4.js +1 -0
- package/dist/client/assets/{sankeyDiagram-W5VNT64P-Clf6oTLi.js → sankeyDiagram-W5VNT64P-C1tKAPGN.js} +1 -1
- package/dist/client/assets/{save-C8h0AMdl.js → save-OZdkPs_y.js} +1 -1
- package/dist/client/assets/scroll-area-80P7vbjw.js +1 -0
- package/dist/client/assets/{scrollEdges-BXYnwntN.js → scrollEdges-C0Oc-5qi.js} +1 -1
- package/dist/client/assets/select-Cb9FUPHD.js +1 -0
- package/dist/client/assets/separator-CO8bC7Wc.js +1 -0
- package/dist/client/assets/{sequenceDiagram-SI44F4Z6-CcYtQLSe.js → sequenceDiagram-SI44F4Z6-DGVpb7jL.js} +1 -1
- package/dist/client/assets/settings-2-PrRDu6Lc.js +1 -0
- package/dist/client/assets/settingsLayout-CRFNCk_D.js +1 -0
- package/dist/client/assets/sheet-C5DW7qVO.js +1 -0
- package/dist/client/assets/{shield-DPC4oHTi.js → shield-CBHYqlkR.js} +1 -1
- package/dist/client/assets/{shield-alert-CwH36qZb.js → shield-alert-Dc2cGwyR.js} +1 -1
- package/dist/client/assets/{shield-check-CGD7sEeF.js → shield-check-_wl7R4Js.js} +1 -1
- package/dist/client/assets/sidebar-0BBaFNm3.js +1 -0
- package/dist/client/assets/sidebarProjectFolders-BjWzbt8C.js +3 -0
- package/dist/client/assets/sidebarProjectGrouping-nQRStWrZ.js +1 -0
- package/dist/client/assets/sidebarStatusText-BBKuNies.js +1 -0
- package/dist/client/assets/sidebarUndo-Dfq1lvyF.js +1 -0
- package/dist/client/assets/{skeleton-rS3IgBob.js → skeleton-DfUe6VV_.js} +1 -1
- package/dist/client/assets/sliders-horizontal-BGXkwvKv.js +1 -0
- package/dist/client/assets/sliding-tabs-BnDSjRU3.js +39 -0
- package/dist/client/assets/{smartphone-DgVJfbv3.js → smartphone-OEAQOTdv.js} +1 -1
- package/dist/client/assets/spinner-lHRJWsym.js +1 -0
- package/dist/client/assets/square-B05NKv3e.js +1 -0
- package/dist/client/assets/{star-Cqay-Cae.js → star-C8mHmfZu.js} +1 -1
- package/dist/client/assets/{stateDiagram-OKZ733FA-DEKURpRP.js → stateDiagram-OKZ733FA-CCOAegCG.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-D60qqBed.js +1 -0
- package/dist/client/assets/storeSelectors-BichCKDC.js +1 -0
- package/dist/client/assets/surfaceMorph-BTRijmlU.js +1 -0
- package/dist/client/assets/{swimlanes-SLNWSIFB-DrR6sbi6.js → swimlanes-SLNWSIFB-CFsLYT4h.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-D0SaJgSn.js +8 -0
- package/dist/client/assets/switch-oQc7Ifbl.js +1 -0
- package/dist/client/assets/text-wrap-DSRdSfDm.js +1 -0
- package/dist/client/assets/textarea-VyiIZ0wQ.js +1 -0
- package/dist/client/assets/threadPriorityRefreshRuntime-H656C1J_.js +1 -0
- package/dist/client/assets/ticker-CPutfhZ4.js +1 -0
- package/dist/client/assets/{timeline-definition-Z64GVDOM-bQJvmJx5.js → timeline-definition-Z64GVDOM-B4agmO7R.js} +1 -1
- package/dist/client/assets/toggle-DFqtCPt-.js +1 -0
- package/dist/client/assets/toggle-group-C5ICmqkI.js +1 -0
- package/dist/client/assets/{tokenModePresentation-BkS-mry_.js → tokenModePresentation-umDRm4k1.js} +1 -1
- package/dist/client/assets/tooltip-DbqhseXd.js +1 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-D4Ex5QTp.js → treeView-Q6P3EWNA-C_S3udFB.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-C4B6Y6qM.js → treemap-WGGIJYW6-B-kUSAkE.js} +1 -1
- package/dist/client/assets/undo-2-lyluTGMW.js +1 -0
- package/dist/client/assets/{unplug-B1dczi-t.js → unplug-D6iu-qlh.js} +1 -1
- package/dist/client/assets/usage-ClF-eUmy.js +1 -0
- package/dist/client/assets/useActiveIndicator-R5NWu8Fg.js +1 -0
- package/dist/client/assets/useAppSidebarCollapsed-BbMxfio5.js +1 -0
- package/dist/client/assets/useAppearancePreference-Ix13pMKy.js +1 -0
- package/dist/client/assets/useAtlassian-BYDCc9lv.js +0 -0
- package/dist/client/assets/useCheckoutResolution-CR-oOp5-.js +1 -0
- package/dist/client/assets/useDesktopRelaunchGuard-Jmh615iZ.js +1 -0
- package/dist/client/assets/useDiffFileNavigation-DeuzdD5E.js +15 -0
- package/dist/client/assets/useDiffLayout-DhcXwhBL.js +1 -0
- package/dist/client/assets/useEnvironmentSettingsTarget-DM6BRDT7.js +1 -0
- package/dist/client/assets/useFocus-CV0KIZwg.js +1 -0
- package/dist/client/assets/useGit-CUcs7h5_.js +1 -0
- package/dist/client/assets/useGitBranchSearch-CeKFtnCL.js +1 -0
- package/dist/client/assets/useHostedDraftExecutionTarget-DvQU5UOq.js +1 -0
- package/dist/client/assets/useLabelableId-CEgCRi6q.js +1 -0
- package/dist/client/assets/useLandingFlash-BfOOlFtW.js +1 -0
- package/dist/client/assets/useLogicalProjectSnapshots-CRNZke74.js +1 -0
- package/dist/client/assets/useNavigate-sQZthdyT.js +1 -0
- package/dist/client/assets/usePageLeadingInsetClass-Bf4nUvx4.js +1 -0
- package/dist/client/assets/usePhoneThreadActions-VaQ-mZex.js +1 -0
- package/dist/client/assets/usePopupHandleStore-DimKo2Yy.js +1 -0
- package/dist/client/assets/usePopupViewport-YeqX_UM3.js +1 -0
- package/dist/client/assets/usePresentationTier-B9kCQ4YH.js +1 -0
- package/dist/client/assets/useProject-Kt74Z12J.js +1 -0
- package/dist/client/assets/useProviderOptionsUpdater-CTzNh2B7.js +2 -0
- package/dist/client/assets/usePullRequestFilesViewed-D5Snmzys.js +1 -0
- package/dist/client/assets/usePullRequestsModel-DJL5HHbP.js +40 -0
- package/dist/client/assets/useScrollLock-CLZ31xsK.js +1 -0
- package/dist/client/assets/useSidebarThreadActions-n6EkLATf.js +6 -0
- package/dist/client/assets/{useStatistics-B76_r68I.js → useStatistics-DD0mYS4J.js} +14 -14
- package/dist/client/assets/{useTheme-B441xg4F.js → useTheme-Bdy-BDs-.js} +1 -1
- package/dist/client/assets/useValueChanged-DoumqMnV.js +1 -0
- package/dist/client/assets/{user-round-CLy1Qy1Y.js → user-round-BPDXr8Gq.js} +1 -1
- package/dist/client/assets/{vennDiagram-T6HMQDX7-8iiroXim.js → vennDiagram-T6HMQDX7-B1UEn_j_.js} +1 -1
- package/dist/client/assets/{vscode-icons-CJBVQtq5.js → vscode-icons-Ccy-gzFN.js} +1 -1
- package/dist/client/assets/{wardley-WFR3VGLG-DpyNUbTc.js → wardley-WFR3VGLG-gPdyDc-7.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-T6FBY63Y-CI7is3QO.js → wardleyDiagram-T6FBY63Y-2aDcwOA4.js} +1 -1
- package/dist/client/assets/workspaceLifecycle-OJ1aKksw.js +3 -0
- package/dist/client/assets/workspaceMetadataProjection-CyEyJhUa.js +1 -0
- package/dist/client/assets/workspaceRouteSearch-CCavUdbH.js +1 -0
- package/dist/client/assets/{wrench-7pbbxqrZ.js → wrench-CPUCA_rn.js} +1 -1
- package/dist/client/assets/wsTransport-C88seBPA.js +15 -0
- package/dist/client/assets/{xychartDiagram-ELKLHX3M-BTEX3m2y.js → xychartDiagram-ELKLHX3M-C1_7Q-1i.js} +1 -1
- package/dist/client/favicon.svg +1 -1
- package/dist/client/index.html +1 -1
- package/dist/collectUint8StreamText-BsLSgI8i.mjs +710 -0
- package/dist/collectUint8StreamText-D5olwfpM.cjs +757 -0
- package/dist/{deviceHostWorker-L8C9wy38.mjs → deviceHostWorker-B-Dn-6An.mjs} +1 -1
- package/dist/{makeManagedServerProvider-CF776SAO.cjs → makeManagedServerProvider-B5tP7tvg.cjs} +1 -1
- package/dist/{makeManagedServerProvider-B90UKjnv.mjs → makeManagedServerProvider-B65ipCxM.mjs} +2 -2
- package/dist/resource-monitor/linux-arm64/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
- package/dist/{runtimeSession-V3RIy8Ao.mjs → runtimeSession-D_BZ-wRH.mjs} +1 -1
- package/dist/{src-CARHuYkT.cjs → src-FmeCeBJ9.cjs} +2291 -72
- package/dist/{src-CtsgPPhb.mjs → src-VTj60bUm.mjs} +1974 -61
- package/package.json +1 -1
- package/dist/AzureDevOpsSourceControlProvider-CKSvfuDS.cjs +0 -190
- package/dist/AzureDevOpsSourceControlProvider-DRWSXTml.mjs +0 -188
- package/dist/GitLabSourceControlProvider-Cj07OTBD.mjs +0 -186
- package/dist/GitLabSourceControlProvider-CvvN5pHt.cjs +0 -188
- package/dist/client/assets/AccountSettings-v6-r6gYl.js +0 -1
- package/dist/client/assets/AiFocusSettings-BVdLON0q.js +0 -1
- package/dist/client/assets/AppearanceSettings-DRChsQnN.js +0 -1
- package/dist/client/assets/BranchToolbar.logic-YN3KjVr9.js +0 -3
- package/dist/client/assets/BrowserPanel-Dxw3stFP.js +0 -1
- package/dist/client/assets/ChatRightPanel-CygpcJiF.js +0 -201
- package/dist/client/assets/ChatThreadRouteView-DYLZFHu0.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-BRvBzP1R.js +0 -1
- package/dist/client/assets/CompositeRoot-BeEGGWwn.js +0 -1
- package/dist/client/assets/ComputerUseSettings-Cq8Pi0ZU.js +0 -1
- package/dist/client/assets/ConnectionsSettings-RSYtexxd.js +0 -7
- package/dist/client/assets/ContextHandoffEndpointLabel-CeGDLNA4.js +0 -4
- package/dist/client/assets/DiagnosticsSettings-CDa6MVx4.js +0 -2
- package/dist/client/assets/DialogHandle-BE7egDQQ.js +0 -1
- package/dist/client/assets/DialogRoot-C4mtzigX.js +0 -1
- package/dist/client/assets/DialogTitle-B_Q4DykI.js +0 -1
- package/dist/client/assets/DialogTrigger-BSqd4Crj.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-JW_bXVrM.js +0 -1
- package/dist/client/assets/GlassSurface-DDG4eTlj.js +0 -1
- package/dist/client/assets/HostedConnectionControls-CscV6hm1.js +0 -1
- package/dist/client/assets/HostedHubRoot-gp7-ClBP.js +0 -2
- package/dist/client/assets/HostedNodeRenameDialog-D1DSiTpx.js +0 -1
- package/dist/client/assets/HostedRelayTrustNotice-B9jp4SRh.js +0 -1
- package/dist/client/assets/IntegrationsSettingsPanel-DH7SfWtV.js +0 -2
- package/dist/client/assets/KeybindingsSettings-DkgYYSHS.js +0 -7
- package/dist/client/assets/LazyBrowserPanel-D4e76vc_.js +0 -2
- package/dist/client/assets/McpServersSettings-Dc1kPa-X.js +0 -6
- package/dist/client/assets/MobileSheet-lT--mLEz.js +0 -1
- package/dist/client/assets/NodeSecuritySettings-DcfSx4KT.js +0 -1
- package/dist/client/assets/NullStore-8d2s-Re3.js +0 -1
- package/dist/client/assets/OnboardingDialog-CnLjwM6Z.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-BTJyS3rN.js +0 -1
- package/dist/client/assets/PhoneHome-CIMkuDJF.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-CfZQxJNI.js +0 -2
- package/dist/client/assets/ProvidersSettingsPanel-DAVSiwE1.js +0 -1
- package/dist/client/assets/RedactedSensitiveText-BHGbQJwB.js +0 -1
- package/dist/client/assets/RootAppShell-T056pByH.js +0 -7
- package/dist/client/assets/SettingsDialog-BERU2Qg7.js +0 -2
- package/dist/client/assets/SettingsPanels-De_XZOQF.js +0 -3
- package/dist/client/assets/SettingsPanels.editor-Dkva9gX_.js +0 -2
- package/dist/client/assets/SourceControlSettings-B4HS17cB.js +0 -1
- package/dist/client/assets/StatisticsPage-Bj2ftFdH.js +0 -1
- package/dist/client/assets/StatisticsPanel-Dw7GBBmd.js +0 -1
- package/dist/client/assets/StatisticsSettingsLink-_XL3ABoI.js +0 -1
- package/dist/client/assets/ThreadTerminalDrawer-CPPzQSXN.js +0 -18
- package/dist/client/assets/ThreadWorkspacePanel-DWKU7Omm.js +0 -2073
- package/dist/client/assets/appChrome-TkWLAGxk.js +0 -1
- package/dist/client/assets/architecture-7GRP2DOG-HS59zfrk.js +0 -1
- package/dist/client/assets/authorization-D8dOcEYq.js +0 -1
- package/dist/client/assets/badge-2AZ3HfVS.js +0 -1
- package/dist/client/assets/capabilities-CsHjxjab.js +0 -1
- package/dist/client/assets/channel-Dn3_cOkm.js +0 -1
- package/dist/client/assets/chevron-right-Dsw16yGn.js +0 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-ZQvrS8No.js +0 -1
- package/dist/client/assets/classDiagram-v2-OCEON4UE-ZQvrS8No.js +0 -1
- package/dist/client/assets/compiler-runtime-C4g8XhC5.js +0 -1
- package/dist/client/assets/desktopWorkspace-_iM6B9Kf.js +0 -1
- package/dist/client/assets/editorPreferences-D8q1ItMW.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-Dj71kuPV.js +0 -1
- package/dist/client/assets/flowDiagram-UKHOOZJN-BaAiwuvL.js +0 -1
- package/dist/client/assets/hostedConnectionCoordinator-BuRWCvUG.js +0 -1
- package/dist/client/assets/hubRoutes-jcMPIFy3.js +0 -1
- package/dist/client/assets/kbd-Dxm5Elqj.js +0 -1
- package/dist/client/assets/layers-Dqez1Uq8.js +0 -1
- package/dist/client/assets/liquidGlass-CA2o_Cq0.js +0 -1
- package/dist/client/assets/liquidGlass.worker-icvLJKHf.js +0 -1
- package/dist/client/assets/main-BqSANuAs.css +0 -2
- package/dist/client/assets/main-DAbEANjY.js +0 -9
- package/dist/client/assets/motion-BdscFixQ.js +0 -1
- package/dist/client/assets/palette-92ylWqeC.js +0 -1
- package/dist/client/assets/perfInstrumentation-BT27w4tn.js +0 -1
- package/dist/client/assets/presentationTier-xlIjcFab.js +0 -1
- package/dist/client/assets/primary-DZjgHvyf.js +0 -5
- package/dist/client/assets/providerDriverMeta-T2YbXzuS.js +0 -1
- package/dist/client/assets/providerStatus-DBGvvkyF.js +0 -1
- package/dist/client/assets/radio-group-CRnHYWa8.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DxU7Mt1k.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BYAPVjRd.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-BOqgR_X7.js +0 -1
- package/dist/client/assets/runtime-BwHA1GUS.js +0 -18
- package/dist/client/assets/scroll-area-7n2X_RLQ.js +0 -1
- package/dist/client/assets/separator-CL1qjMqJ.js +0 -1
- package/dist/client/assets/settingsLayout-DxsFwhF0.js +0 -1
- package/dist/client/assets/sheet-CGiaw8-i.js +0 -1
- package/dist/client/assets/sidebar-Cc6ANbOP.js +0 -1
- package/dist/client/assets/sidebarProjectFolders-DO2Uv84F.js +0 -4
- package/dist/client/assets/sidebarStatusText-B4AtFXZo.js +0 -1
- package/dist/client/assets/sidebarUndo-gdSrfa4O.js +0 -1
- package/dist/client/assets/square-Cr9X8U6y.js +0 -1
- package/dist/client/assets/src-C3Y_imaX.js +0 -14
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CWtHILqh.js +0 -1
- package/dist/client/assets/storeSelectors-CTDWheMy.js +0 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DuaPce9O.js +0 -8
- package/dist/client/assets/switch-DnpJB2xv.js +0 -48
- package/dist/client/assets/toggle-D10FsFoE.js +0 -1
- package/dist/client/assets/toggle-group-BhzbQPEQ.js +0 -1
- package/dist/client/assets/tooltip-BlweKBxc.js +0 -1
- package/dist/client/assets/usage-BBwaxMif.js +0 -1
- package/dist/client/assets/useAppSidebarCollapsed-CFy476E3.js +0 -1
- package/dist/client/assets/useAppearancePreference-Dlh9P8iu.js +0 -1
- package/dist/client/assets/useBaseUiId-DKOjzmu3.js +0 -1
- package/dist/client/assets/useLabelableId-DQbY2GG1.js +0 -1
- package/dist/client/assets/useNavigate-B8oXtF30.js +0 -1
- package/dist/client/assets/usePhoneThreadActions-6DCLiyJ5.js +0 -1
- package/dist/client/assets/usePopupViewport-CNWcP7Od.js +0 -1
- package/dist/client/assets/usePresentationTier-hxB7Yv_Q.js +0 -1
- package/dist/client/assets/useScrollLock-BbKeKZdj.js +0 -1
- package/dist/client/assets/useTriggerFocusGuards-BC4Wb3GI.js +0 -1
- package/dist/client/assets/useValueChanged-BkTbyZdO.js +0 -1
- package/dist/client/assets/workspaceMetadataProjection-aqZEXDrQ.js +0 -1
- package/dist/collectUint8StreamText-BAUF-vzz.mjs +0 -37
- package/dist/collectUint8StreamText-vagpNUMJ.cjs +0 -42
- package/dist/git-9xWsJYIH.mjs +0 -132
- package/dist/git-xIkXFy_l.cjs +0 -218
- package/dist/sourceControl-B0D1Op29.cjs +0 -253
- package/dist/sourceControl-BiEBxN01.mjs +0 -224
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{nn as t}from"./primary-Cf-xJExj.js";import{$i as n,As as r,Bi as i,Gi as a,U as o,Xn as s,ad as c,ca as l,dr as u,ms as d,qi as f,qn as p,sr as m,wr as h,yr as g}from"./runtime-DjjjAcTE.js";import{t as _}from"./react-CwJFpaho.js";import{i as v}from"./presentationTier-DPVAxTK4.js";import{a as y,r as b,t as ee}from"./tooltip-DbqhseXd.js";import{t as te}from"./useNavigate-sQZthdyT.js";import{a as ne,c as x,d as S,h as C,i as w,m as T,n as E,p as re,r as D,s as O,t as k,u as A}from"./ChatRightPanel-BCINd0vP.js";import{t as j}from"./ban-BIm2PVkE.js";import{K as ie,N as ae,Q as oe}from"./messageQueueDrain-B7R7Qmq6.js";import{C as M,h as N,i as se,p as ce,t as P}from"./InboxStatusGlyph-BPTqzp7l.js";import{t as F}from"./columns-2-CWlMOClK.js";import{t as I}from"./rows-2-DDS4dGTX.js";import{D as L,O as le,k as R}from"./useProviderOptionsUpdater-CTzNh2B7.js";import{t as ue}from"./usePresentationTier-B9kCQ4YH.js";import{c as de}from"./Sidebar.logic-D_ODfSpl.js";import{r as fe}from"./desktopWorkspace-C2wXVBhc.js";import"./storeSelectors-BichCKDC.js";import{o as pe}from"./providerModels-v9PYbzRE.js";import{u as me}from"./workspaceRouteSearch-CCavUdbH.js";import{o as he}from"./sidebar-0BBaFNm3.js";import{t as ge}from"./useAppSidebarCollapsed-BbMxfio5.js";import{A as _e,At as z,Ct as ve,Dt as ye,Et as be,Mt as B,Nt as xe,Ot as Se,Pt as Ce,St as V,Tt as we,Vt as Te,b as Ee,bt as De,h as Oe,i as ke,jt as H,kt as U,m as Ae,ot as je,wt as Me,xt as Ne,yt as Pe}from"./main-Ch0bwS-M.js";var W=e(_(),1),Fe=v(),G=c();function Ie(e,t){let n=(0,Fe.c)(17),r;n[0]===e?r=n[1]:(r=t=>u(t,e),n[0]=e,n[1]=r);let i=h(r),a;n[2]===e?a=n[3]:(a=t=>t.threadLastVisitedAtById[z(e)],n[2]=e,n[3]=a);let s=o(a);if(!i){let e;return n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={title:`Thread`,glyph:null},n[4]=e):e=n[4],e}let c,l,d;if(n[5]!==t||n[6]!==s||n[7]!==i){let e=M(i),r=e.state===`idle`&&!t&&de(i.latestTurn?.completedAt,s);d=i.title||`Untitled task`,c=N(e,r),l=ce(e,r),n[5]=t,n[6]=s,n[7]=i,n[8]=c,n[9]=l,n[10]=d}else c=n[8],l=n[9],d=n[10];let f;n[11]!==c||n[12]!==l?(f={kind:c,label:l},n[11]=c,n[12]=l,n[13]=f):f=n[13];let p;return n[14]!==d||n[15]!==f?(p={title:d,glyph:f},n[14]=d,n[15]=f,n[16]=p):p=n[16],p}function Le(e){let t=(0,Fe.c)(10),{title:r,glyph:i}=Ie(e.threadRef,e.focused),a;t[0]===e.className?a=t[1]:(a=n(`flex min-w-0 items-center gap-2`,e.className),t[0]=e.className,t[1]=a);let o;t[2]===i?o=t[3]:(o=i?(0,G.jsx)(P,{kind:i.kind,label:i.label},i.kind):null,t[2]=i,t[3]=o);let s;t[4]===r?s=t[5]:(s=(0,G.jsx)(`span`,{className:`truncate`,children:r}),t[4]=r,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,G.jsxs)(`span`,{className:a,children:[o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Re(e){let t=(0,Fe.c)(44),r=`pane ${e.index+1}`,i=e.motion===`staged`&&`h-0 border-b-0 opacity-0`,a=e.motion===`in`&&`chat-pane-header-in`,o=e.motion===`out`&&`chat-pane-header-out`,s;t[0]!==i||t[1]!==a||t[2]!==o?(s=n(`relative flex shrink-0 items-center gap-1 overflow-hidden border-b border-border/70 pr-1 pl-2.5 text-xs`,`h-8`,i,a,o),t[0]=i,t[1]=a,t[2]=o,t[3]=s):s=t[3];let c=e.motion===`out`||e.motion===`staged`||void 0,l;t[4]===e?l=t[5]:(l=t=>{t.target===t.currentTarget&&e.onMotionEnd()},t[4]=e,t[5]=l);let u=e.draggable,f=`Focus ${r}`,p=e.draggable&&`cursor-grab active:cursor-grabbing`,m;t[6]===p?m=t[7]:(m=n(`flex min-w-0 flex-1 self-stretch rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,p),t[6]=p,t[7]=m);let h=e.onActivate,g=e.onDragStart,_=e.onDragEnd,v=e.threadRef,te=e.focused,ne=e.focused?`font-medium text-foreground`:`text-muted-foreground group-hover/pane:text-foreground/80`,x;t[8]===ne?x=t[9]:(x=n(`transition-colors duration-(--app-motion-duration-chip)`,ne),t[8]=ne,t[9]=x);let S;t[10]!==e.focused||t[11]!==e.threadRef||t[12]!==x?(S=(0,G.jsx)(Le,{threadRef:v,focused:te,className:x}),t[10]=e.focused,t[11]=e.threadRef,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==e.draggable||t[15]!==e.onActivate||t[16]!==e.onDragEnd||t[17]!==e.onDragStart||t[18]!==S||t[19]!==f||t[20]!==m?(C=(0,G.jsx)(`button`,{type:`button`,draggable:u,"aria-label":f,className:m,onClick:h,onDragStart:g,onDragEnd:_,children:S}),t[14]=e.draggable,t[15]=e.onActivate,t[16]=e.onDragEnd,t[17]=e.onDragStart,t[18]=S,t[19]=f,t[20]=m,t[21]=C):C=t[21];let w=`Close ${r}`,T;t[22]===e?T=t[23]:(T=t=>{t.stopPropagation(),e.onClose()},t[22]=e,t[23]=T);let E;t[24]!==w||t[25]!==T?(E=(0,G.jsx)(`button`,{type:`button`,"data-pane-close":!0,"aria-label":w,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 outline-none transition-colors duration-(--app-motion-duration-chip) hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,onClick:T}),t[24]=w,t[25]=T,t[26]=E):E=t[26];let re;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,G.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),t[27]=re):re=t[27];let D;t[28]===E?D=t[29]:(D=(0,G.jsx)(y,{render:E,children:re}),t[28]=E,t[29]=D);let O;t[30]!==e.closeShortcut||t[31]!==e.focused?(O=e.focused&&e.closeShortcut?(0,G.jsx)(pe,{className:`ml-1.5`,children:e.closeShortcut}):null,t[30]=e.closeShortcut,t[31]=e.focused,t[32]=O):O=t[32];let k;t[33]===O?k=t[34]:(k=(0,G.jsxs)(b,{side:`bottom`,children:[`Close pane`,O]}),t[33]=O,t[34]=k);let A;t[35]!==D||t[36]!==k?(A=(0,G.jsxs)(ee,{children:[D,k]}),t[35]=D,t[36]=k,t[37]=A):A=t[37];let j;return t[38]!==C||t[39]!==A||t[40]!==s||t[41]!==c||t[42]!==l?(j=(0,G.jsxs)(`div`,{className:s,inert:c,onAnimationEnd:l,children:[C,A]}),t[38]=C,t[39]=A,t[40]=s,t[41]=c,t[42]=l,t[43]=j):j=t[43],j}function ze(e){switch(e.kind){case`split`:return`Open here`;case`move`:return`Move here`;case`noop`:return null;case`refused`:switch(e.reason){case`full`:return`Split view holds 4 threads · close one first`;case`environment`:return`Only threads from the same machine can share a split`;case`axis`:return e.alternative===`vertical`?`Drop on the top or bottom edge`:e.alternative===`horizontal`?`Drop on the left or right edge`:`This pane can't split further`}}}function Be(e){let t=(0,Fe.c)(23),{drop:r}=e,i=r.verdict.kind===`refused`,a;t[0]===r.verdict?a=t[1]:(a=ze(r.verdict),t[0]=r.verdict,t[1]=a);let o=a,s=r.side===`left`||r.side===`right`?F:I,c=r.verdict.kind,l=r.visible?`opacity-100`:`opacity-0`,u;t[2]===l?u=t[3]:(u=n(`chat-pane-drop-in pointer-events-none absolute z-50 p-1.5 transition-[left,top,width,height,opacity] duration-(--app-motion-duration-pop) ease-(--app-motion-spring-gentle)`,l),t[2]=l,t[3]=u);let d=`${r.rect.left}%`,f=`${r.rect.top}%`,p=`${r.rect.width}%`,m=`${r.rect.height}%`,h;t[4]!==d||t[5]!==f||t[6]!==p||t[7]!==m?(h={left:d,top:f,width:p,height:m},t[4]=d,t[5]=f,t[6]=p,t[7]=m,t[8]=h):h=t[8];let g=i?`border-dashed border-muted-foreground/45 bg-background/80`:`border-foreground/30 bg-foreground/[0.07]`,_;t[9]===g?_=t[10]:(_=n(`flex size-full items-center justify-center rounded-lg border transition-[background-color,border-color] duration-(--app-motion-duration-pop)`,g),t[9]=g,t[10]=_);let v;t[11]!==s||t[12]!==o||t[13]!==i?(v=o?(0,G.jsxs)(`span`,{className:n(`inline-flex max-w-[calc(100%-1.5rem)] items-center gap-1.5 rounded-full border bg-popover px-2.5 py-1 text-xs font-medium shadow-sm`,i?`text-muted-foreground`:`text-foreground`),children:[i?(0,G.jsx)(j,{"aria-hidden":!0,className:`size-3.5 shrink-0`}):(0,G.jsx)(s,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:o})]}):null,t[11]=s,t[12]=o,t[13]=i,t[14]=v):v=t[14];let y;t[15]!==_||t[16]!==v?(y=(0,G.jsx)(`div`,{className:_,children:v}),t[15]=_,t[16]=v,t[17]=y):y=t[17];let b;return t[18]!==r.verdict.kind||t[19]!==y||t[20]!==u||t[21]!==h?(b=(0,G.jsx)(`div`,{"aria-hidden":!0,"data-pane-drop":c,className:u,style:h,children:y}),t[18]=r.verdict.kind,t[19]=y,t[20]=u,t[21]=h,t[22]=b):b=t[22],b}var Ve={left:0,top:0,width:100,height:100},He={left:{"--chat-pane-shift-x":`-100%`},right:{"--chat-pane-shift-x":`100%`},top:{"--chat-pane-shift-y":`-100%`},bottom:{"--chat-pane-shift-y":`100%`}},Ue=`transition-[left,top,width,height] duration-(--app-motion-duration-pane) ease-(--app-motion-ease)`,We={left:`shadow-[1px_0_0_0_var(--border)]`,right:`shadow-[-1px_0_0_0_var(--border)]`,top:`shadow-[0_1px_0_0_var(--border)]`,bottom:`shadow-[0_-1px_0_0_var(--border)]`},Ge={leaving:[],entering:new Set,headerIn:null,headerOut:null,staged:null,newDividers:new Set};function Ke(e){return`${e.axis}:${z(H(e.first)[0])}|${z(H(e.second)[0])}`}function qe(e){let t=0,n=0,r=0;return t=window.requestAnimationFrame(()=>{t=window.requestAnimationFrame(()=>{typeof window.requestIdleCallback==`function`?n=window.requestIdleCallback(e,{timeout:180}):r=window.setTimeout(e,32)})}),()=>{window.cancelAnimationFrame(t),n&&window.cancelIdleCallback(n),window.clearTimeout(r)}}function Je(e,t,n){let r=U(t).leaves;if(!n||!Ce(e.root,t))return{root:t,leaves:r,...Ge};let i=new Set(r.map(e=>z(e.ref))),a=new Set(e.leaves.map(e=>z(e.ref))),o=e.root.kind===`split`,s=t.kind===`split`,c=new Set(r.filter(e=>!a.has(z(e.ref))).map(e=>z(e.ref))),l=new Set(U(e.root).dividers.map(e=>Ke(e.node)));return{root:t,leaves:r,staged:c.size?new Map(e.leaves.filter(e=>i.has(z(e.ref))).map(e=>[z(e.ref),e.rect])):null,newDividers:new Set(U(t).dividers.map(e=>Ke(e.node)).filter(e=>!l.has(e))),headerIn:!o&&s?z(H(e.root)[0]):null,headerOut:o&&!s?z(H(t)[0]):null,leaving:[...e.leaving.filter(e=>!i.has(z(e.ref))),...e.leaves.flatMap((e,t)=>i.has(z(e.ref))?[]:[{...e,index:t}])],entering:c}}function K(e){return{left:`${e.left}%`,top:`${e.top}%`,width:`${e.width}%`,height:`${e.height}%`}}function q(e,t,n){if(n.kind===`refused`&&n.reason!==`axis`)return e;let r=ye(t);return{left:e.left+e.width*r.left/100,top:e.top+e.height*r.top/100,width:e.width*r.width/100,height:e.height*r.height/100}}function J(e){let t=(0,Fe.c)(16),{threadRef:n,focused:r,children:i,guards:a,inSplit:o}=e,s,c;t[0]!==n.environmentId||t[1]!==n.threadId?(s=()=>fe(n.environmentId,n.threadId),c=[n.environmentId,n.threadId],t[0]=n.environmentId,t[1]=n.threadId,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,W.useEffect)(s,c);let l;t[4]!==a||t[5]!==n?(l=e=>{let t=z(n),r=a.get(t)??new Set;return r.add(e),a.set(t,r),()=>{r.delete(e),r.size||a.delete(t)}},t[4]=a,t[5]=n,t[6]=l):l=t[6];let u=l,d=o?n:null,f;t[7]!==i||t[8]!==u?(f=(0,G.jsx)(L,{value:u,children:i}),t[7]=i,t[8]=u,t[9]=f):f=t[9];let p;t[10]!==r||t[11]!==f?(p=(0,G.jsx)(le,{value:r,children:f}),t[10]=r,t[11]=f,t[12]=p):p=t[12];let m;return t[13]!==d||t[14]!==p?(m=(0,G.jsx)(R,{value:d,children:p}),t[13]=d,t[14]=p,t[15]=m):m=t[15],m}function Ye(e){let t=(0,Fe.c)(3),{threadRef:n,children:r}=e,i;t[0]===n?i=t[1]:(i=e=>g(e,n)&&!u(e,n)?.archivedAt,t[0]=n,t[1]=i);let a=h(i),o=T(n);if(!a&&!o){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`div`,{className:`m-auto p-4 text-center text-sm text-muted-foreground`,role:`status`,children:`Thread unavailable. Reconnect to its machine or close this pane.`}),t[2]=e):e=t[2],e}return r}function Xe({threadRef:e,children:t,enabled:i=!0}){let o=V(e=>e.root),s=(0,W.useMemo)(()=>i&&o&&be(o,e)?o:{kind:`thread`,ref:e},[i,o,e]),c=s.kind===`split`,l=te(),u=r(),p=Te(),m=(0,W.useRef)(null),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(h),y=_!==h;(0,W.useEffect)(()=>{if(!y)return;let e=window.requestAnimationFrame(()=>v(h));return()=>window.cancelAnimationFrame(e)},[h,y]);let[b,ee]=(0,W.useState)(null),[ne,x]=(0,W.useState)(null),S=(0,W.useRef)(null),C=(0,W.useRef)(s);(0,W.useLayoutEffect)(()=>{C.current=s},[s]);let[w,T]=(0,W.useState)(()=>({root:s,leaves:U(s).leaves,...Ge}));w.root!==s&&T(Je(w,s,i&&!h&&_e(`--app-motion-duration-pane`,360)>0));let E=(0,W.useCallback)(e=>{T(t=>{let n=t.leaving.filter(t=>z(t.ref)!==e);return n.length===t.leaving.length?t:{...t,leaving:n}})},[]),re=(0,W.useCallback)(e=>{T(t=>{if(!t.entering.has(e))return t;let n=new Set(t.entering);return n.delete(e),{...t,entering:n}})},[]),D=(0,W.useCallback)(e=>{T(t=>t.headerIn===e||t.headerOut===e?{...t,headerIn:null,headerOut:null}:t)},[]),O=w.staged;(0,W.useEffect)(()=>{if(O)return qe(()=>T(e=>e.staged===O?{...e,staged:null}:e))},[O]);let k=w.leaving.length,A=w.headerOut!==null;(0,W.useEffect)(()=>{if(!k&&!A)return;let e=window.setTimeout(()=>T(e=>({...e,leaving:[],headerOut:null})),_e(`--app-motion-duration-pane`,360)+400);return()=>window.clearTimeout(e)},[A,k]);let j=(0,W.useRef)({ready:!1,enabled:!0});(0,W.useEffect)(()=>{j.current.ready=!0},[]);let[ie]=(0,W.useState)(()=>new Map),ae=(0,W.useRef)(null);(0,W.useLayoutEffect)(()=>{let e=new AbortController;return ae.current=e,()=>e.abort()},[]);let oe=(0,W.useRef)(!1),M=(0,W.useRef)(null),N=(0,W.useRef)(!0);(0,W.useLayoutEffect)(()=>(N.current=!0,()=>{N.current=!1}),[]);let ce=(0,W.useCallback)(async t=>{if(z(t)===z(e))return;let n=u.buildLocation({to:`/$environmentId/$threadId`,params:f(t)});await ke(n.pathname,()=>l({to:`/$environmentId/$threadId`,params:f(t)}),ae.current.signal)},[ae,l,u,e]);(0,W.useEffect)(()=>(V.getState().setActiveRef(i?e:null),()=>V.getState().setActiveRef(null)),[i,e]),(0,W.useLayoutEffect)(()=>{let e=m.current;if(!e)return;let t=()=>g(e.clientWidth<900||e.clientHeight<520);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let P=async t=>{if(oe.current)return;oe.current=!0;let n=C.current;try{for(let e of ie.get(z(t))??[])if(!await e()){a.add({type:`warning`,title:`Finish or discard this pane’s unsent selection draft before closing it`});return}if(!await Ee()){a.add({type:`error`,title:`Editor changes could not be saved`,description:`This pane and its draft are preserved. Resolve the error in File Preview before closing.`});return}if(C.current!==n)return;let r=Me(n,t);if(!r)return;if(z(t)===z(e)){let e=H(r)[0];await ce(e);let t=u.buildLocation({to:`/$environmentId/$threadId`,params:f(e)});if(u.state.location.pathname!==t.pathname)return}V.getState().root===n&&V.getState().setRoot(r)}catch{a.add({type:`error`,title:`Could not close the pane`,description:`The pane and its draft are preserved.`})}finally{oe.current=!1}},F=async(e,t)=>{if(!oe.current){oe.current=!0;try{await ce(e);let n=u.buildLocation({to:`/$environmentId/$threadId`,params:f(e)});if(!N.current)return;u.state.location.pathname===n.pathname&&t?.isConnected?t.focus({preventScroll:!0}):M.current?.isConnected&&M.current.focus({preventScroll:!0})}catch{a.add({type:`error`,title:`Could not activate the thread pane`}),N.current&&M.current?.focus({preventScroll:!0})}finally{oe.current=!1}}},I=(0,W.useRef)({activate:F,close:P,split:c,threadRef:e});(0,W.useLayoutEffect)(()=>{I.current={activate:F,close:P,split:c,threadRef:e}}),(0,W.useEffect)(()=>{if(i)return V.getState().registerController({focusSibling:e=>{let t=I.current,n=H(C.current);if(!t.split||n.length<2)return!1;let r=n[(n.findIndex(e=>z(e)===z(t.threadRef))+e+n.length)%n.length],i=m.current?.querySelector(`[data-pane-thread="${CSS.escape(z(r))}"]`)?.querySelector(`[data-testid="composer-editor"]`);return t.activate(r,i),!0},closeFocused:()=>{let e=I.current;return e.split?(e.close(e.threadRef),!0):!1}})},[i]);let L=(0,W.useCallback)(()=>{ee(e=>e?.visible?{...e,visible:!1}:e)},[]);(0,W.useEffect)(()=>{if(b?.visible)return window.addEventListener(`dragend`,L),window.addEventListener(`drop`,L),()=>{window.removeEventListener(`dragend`,L),window.removeEventListener(`drop`,L)}},[b?.visible,L]);let le=(e,t,n,r)=>{if(n.kind===`noop`){L();return}ee(i=>i?.visible&&i.key===e&&i.side===t&&i.verdict.kind===n.kind?i:{session:i?i.session+ +!i.visible:0,key:e,side:t,verdict:n,rect:q(r,t,n),visible:!0})},R=(e,t)=>Ne(e.dataTransfer,t,`move`),ue=()=>{Pe(),L()},de=je(p,`pane.close`),fe=U(ne?.root??s),pe=fe.leaves.findIndex(t=>z(t.ref)===z(e)),me=i&&!h&&!y&&!ne,he=(r,o,l)=>{let{ref:u}=r,d=z(u),f=!l&&d===z(e),p=l||!c||!h||f,m=h&&!l?Ve:O?.get(d)??r.rect,g=!l&&w.entering.has(d),_=(g||l)&&r.side?He[r.side]:null,v=g&&O!==null&&_!==null,y=c||l,b=l?null:w.headerIn===d?O?`staged`:`in`:w.headerOut===d?`out`:null;return(0,G.jsxs)(`section`,{"data-pane-thread":l?void 0:d,"data-pane-leaving":l?d:void 0,"data-pane-focused":f,"aria-label":`Thread pane ${o+1}`,"aria-hidden":l?!0:void 0,className:n(`group/pane absolute isolate flex min-h-0 min-w-0 flex-col overflow-hidden bg-background`,me&&!l&&Ue,_&&g&&!v&&`chat-pane-enter`,l&&`chat-pane-exit pointer-events-none`,_&&r.side&&n(`z-30`,We[r.side])),hidden:!p,inert:!p||l?!0:void 0,style:{display:p?void 0:`none`,...K(m),..._,...v?{transform:`translate(var(--chat-pane-shift-x, 0), var(--chat-pane-shift-y, 0))`}:{}},onAnimationEnd:e=>{e.target===e.currentTarget&&(e.animationName===`chat-pane-exit`&&E(d),e.animationName===`chat-pane-enter`&&re(d))},onPointerDownCapture:e=>{if(l||f||e.target instanceof Element&&e.target.closest(`[data-pane-close]`))return;let t=e.target instanceof HTMLElement?e.target:null;t?.closest(`[draggable=true]`)||e.preventDefault(),F(u,t)},onFocusCapture:e=>{if(l||e.target.closest(`[data-pane-close]`))return;if(f){M.current=e.target;return}let t=e.target;t.blur(),M.current?.focus({preventScroll:!0}),F(u,t)},onClickCapture:e=>{!l&&!f&&!(e.target instanceof Element&&e.target.closest(`[data-pane-close]`))&&(e.preventDefault(),e.stopPropagation())},onDragOver:e=>{if(l||!i||!e.dataTransfer.types.includes(`application/x-ryco-thread-pane`)||h&&c)return;e.preventDefault(),e.stopPropagation();let t=Se(e.currentTarget.getBoundingClientRect(),e.clientX,e.clientY);if(!t)return;let n=De(),r=n?xe(s,u,n,t):{kind:`split`};n&&(e.dataTransfer.dropEffect=r.kind===`split`?`copy`:r.kind===`move`?`move`:`none`),le(d,t,r,m)},onDrop:e=>{if(l||!i||!e.dataTransfer.types.includes(`application/x-ryco-thread-pane`))return;e.preventDefault(),e.stopPropagation(),L(),Pe();let t=Se(e.currentTarget.getBoundingClientRect(),e.clientX,e.clientY),n=null;try{n=we(JSON.parse(e.dataTransfer.getData(ve)))}catch{}if(!n||!t)return;let r=xe(s,u,n,t);if(r.kind===`refused`){a.add({type:`info`,title:ze(r)??`Cannot split`});return}r.kind!==`noop`&&V.getState().open(n,t,u)},children:[y&&(!h||l)||b===`out`?(0,G.jsx)(se,{value:j,children:(0,G.jsx)(Re,{threadRef:u,index:o,focused:f,motion:b,onMotionEnd:()=>D(d),draggable:!h&&!l,closeShortcut:de,onActivate:()=>void F(u),onClose:()=>void P(u),onDragStart:e=>R(e,u),onDragEnd:ue})}):null,(0,G.jsx)(J,{threadRef:u,focused:f&&p,guards:ie,inSplit:y,children:t(u,f&&p)}),c&&!l&&!h?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{"aria-hidden":!0,"data-pane-scrim":!0,className:n(`pointer-events-none absolute inset-x-0 top-8 bottom-0 z-[60] bg-background transition-opacity duration-(--app-motion-duration-stack) ease-(--app-motion-ease)`,f?`opacity-0`:`opacity-35 group-hover/pane:opacity-15`)}),(0,G.jsx)(`div`,{"aria-hidden":!0,"data-pane-frame":!0,className:n(`pointer-events-none absolute inset-0 z-[60] shadow-[inset_0_0_0_1px_var(--ring)] transition-opacity duration-(--app-motion-duration-stack) ease-(--app-motion-ease)`,f?`opacity-55`:`opacity-0`)})]}):null]},d)};return(0,G.jsxs)(`div`,{ref:m,"data-chat-panes":!0,className:`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[c&&h?(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b p-1`,children:[(0,G.jsx)(se,{value:j,children:(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 gap-1 overflow-x-auto`,role:`tablist`,"aria-label":`Split threads`,children:fe.leaves.map(({ref:t})=>{let n=z(t)===z(e);return(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n,className:`max-w-56 min-w-0 shrink-0 rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors duration-(--app-motion-duration-chip) hover:text-foreground aria-selected:bg-accent aria-selected:text-foreground`,onClick:()=>void F(t),children:(0,G.jsx)(Le,{threadRef:t,focused:n})},z(t))})})}),(0,G.jsx)(`button`,{type:`button`,"data-pane-close":!0,"aria-label":`Close pane ${pe+1}`,title:`Close this pane`,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 transition-colors duration-(--app-motion-duration-chip) hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:()=>void P(e),children:(0,G.jsx)(d,{"aria-hidden":!0,className:`size-3.5`})})]}):null,(0,G.jsxs)(`div`,{className:`relative min-h-0 flex-1`,onDragOver:()=>L(),onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||L()},children:[fe.leaves.map((e,t)=>he(e,t,!1)),w.leaving.map(e=>he(e,e.index,!0)),!h&&fe.dividers.map(e=>{let{node:t,rect:r,path:i}=e,a=t.axis===`horizontal`,o=ne?.path===i,c=w.newDividers.has(Ke(t))&&(O!==null||w.entering.size>0);return(0,G.jsxs)(`div`,{role:`separator`,tabIndex:0,"aria-label":`Resize thread panes`,"aria-orientation":a?`vertical`:`horizontal`,"aria-valuemin":25,"aria-valuemax":75,"aria-valuenow":Math.round(t.ratio*100),title:`Drag to resize · Double-click to reset`,"data-resizing":o?``:void 0,className:n(`group/divider absolute z-40 touch-none outline-none`,a?`cursor-col-resize`:`cursor-row-resize`,me&&`transition-[left,top,width,height,opacity] duration-(--app-motion-duration-pane) ease-(--app-motion-ease)`,c&&`pointer-events-none opacity-0`),style:{left:a?`calc(${r.left+r.width*t.ratio}% - 4.5px)`:`${r.left}%`,top:a?`${r.top}%`:`calc(${r.top+r.height*t.ratio}% - 4.5px)`,width:a?9:`${r.width}%`,height:a?`${r.height}%`:9},onKeyDown:e=>{let n=a?`ArrowLeft`:`ArrowUp`,r=a?`ArrowRight`:`ArrowDown`;[n,r,`Home`,`End`,`Enter`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),V.getState().setRoot(B(s,i,e.key===`Enter`?.5:e.key===`Home`?.25:e.key===`End`?.75:t.ratio+(e.key===r?.05:-.05))))},onDoubleClick:()=>{t.ratio!==.5&&V.getState().setRoot(B(s,i,.5))},onPointerDown:t=>{t.button===0&&m.current&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),S.current={divider:e,bounds:t.currentTarget.parentElement.getBoundingClientRect(),original:s,current:s,pointerId:t.pointerId})},onPointerMove:e=>{let t=S.current;if(!t||t.pointerId!==e.pointerId)return;let n=((a?(e.clientX-t.bounds.left)/t.bounds.width*100:(e.clientY-t.bounds.top)/t.bounds.height*100)-(a?r.left:r.top))/(a?r.width:r.height);t.current=B(t.original,i,n),x({root:t.current,path:i})},onPointerUp:()=>{let e=S.current;S.current=null,x(null),e&&V.getState().root===e.original&&V.getState().setRoot(e.current)},onLostPointerCapture:()=>{S.current=null,x(null)},onPointerCancel:()=>{S.current=null,x(null)},children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:n(`pointer-events-none absolute bg-border transition-[background-color,width,height] duration-(--app-motion-duration-chip) ease-(--app-motion-ease) group-hover/divider:bg-foreground/25 group-focus-visible/divider:bg-ring group-data-resizing/divider:bg-ring`,a?`inset-y-0 left-1/2 w-px -translate-x-1/2 group-hover/divider:w-[3px] group-focus-visible/divider:w-[3px] group-data-resizing/divider:w-[3px]`:`inset-x-0 top-1/2 h-px -translate-y-1/2 group-hover/divider:h-[3px] group-focus-visible/divider:h-[3px] group-data-resizing/divider:h-[3px]`)}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:n(`pointer-events-none absolute top-1/2 left-1/2 -translate-1/2 rounded-full bg-foreground/45 opacity-0 scale-75 transition-[opacity,scale] duration-(--app-motion-duration-pop) ease-(--app-motion-spring-snappy) group-hover/divider:scale-100 group-hover/divider:opacity-100 group-focus-visible/divider:scale-100 group-focus-visible/divider:opacity-100 group-data-resizing/divider:scale-100 group-data-resizing/divider:opacity-100`,a?`h-7 w-[5px]`:`h-[5px] w-7`)})]},i)}),b?(0,G.jsx)(Be,{drop:b},b.session):null]})]})}function Ze(e){let r=(0,Fe.c)(146),{threadRef:a,search:o}=e;oe(`ChatThreadRouteView`);let c=te(),u=ue(),d=a?`${a.environmentId}:${a.threadId}`:null,_=a?.environmentId??null,v=a?.threadId??null,y;r[0]!==c||r[1]!==a?(y=e=>{a&&c({to:`/$environmentId/$threadId`,params:f(a),replace:!0,search:e})},r[0]=c,r[1]=a,r[2]=y):y=r[2];let b=y,ee;r[3]!==d||r[4]!==b||r[5]!==o?(ee={threadKey:d,search:o,replaceSearch:b},r[3]=d,r[4]=b,r[5]=o,r[6]=ee):ee=r[6];let j=x(ee),M;r[7]===a?.environmentId?M=r[8]:(M=e=>m(e,a?.environmentId??null).bootstrapComplete,r[7]=a?.environmentId,r[8]=M);let N=h(M),se;r[9]===a?se=r[10]:(se=s(a),r[9]=a,r[10]=se);let ce=h(se),P;r[11]===a?P=r[12]:(P=e=>g(e,a),r[11]=a,r[12]=P);let F=h(P),I;r[13]===a?.environmentId?I=r[14]:(I=e=>m(e,a?.environmentId??null).threadIds.length>0,r[13]=a?.environmentId,r[14]=I);let L=h(I),le=i(tt),R;r[15]!==le||r[16]!==a?.environmentId?(R=()=>p(a?.environmentId??null,le),r[15]=le,r[16]=a?.environmentId,r[17]=R):R=r[17],a?.environmentId;let de;r[18]===R?de=r[19]:(de=R(),r[18]=R,r[19]=de);let pe=h(de),me=T(a),_e=re(a),z=C(a?.environmentId),ve=V(et),ye;r[20]!==ve||r[21]!==u||r[22]!==a?(ye=u!==`phone`&&!!a&&!!ve&&be(ve,a),r[20]=ve,r[21]=u,r[22]=a,r[23]=ye):ye=r[23];let B=ye,xe=F||me,Se;r[24]===ce?Se=r[25]:(Se=ae(ce),r[24]=ce,r[25]=Se);let Ce=Se,we=L||z,Te=B||xe&&(me||N||ce!==void 0),Ee;r[26]===j?Ee=r[27]:(Ee=Ae(j),r[26]=j,r[27]=Ee);let De=Ee,ke;r[28]===j?ke=r[29]:(ke=Oe(j),r[28]=j,r[29]=ke);let H=ke,U=j.workspaceTab===`agent`&&j.workspaceAgentKey?j.workspaceAgentKey:null,je=j.workspaceTab===`render`?j.workspaceRender??null:null,Me=ie(O),Ne;r[30]===d?Ne=r[31]:(Ne=e=>d?e.pendingOpenByThreadKey[d]:void 0,r[30]=d,r[31]=Ne);let Pe=t(Ne),Ie=t($e),Le=ge(),Re=!Me&&u!==`phone`,ze;r[32]!==d||r[33]!==H||r[34]!==Re?(ze={threadKey:d,open:H,canMaximize:Re},r[32]=d,r[33]=H,r[34]=Re,r[35]=ze):ze=r[35];let{maximized:Be,toggleMaximized:Ve}=S(ze),He,Ue;r[36]!==_||r[37]!==v?(He=()=>{if(_&&v)return fe(_,v)},Ue=[_,v],r[36]=_,r[37]=v,r[38]=He,r[39]=Ue):(He=r[38],Ue=r[39]),(0,W.useEffect)(He,Ue);let We,Ge;r[40]!==Ie||r[41]!==c||r[42]!==Pe||r[43]!==u||r[44]!==a?(We=()=>{a&&Pe&&u!==`phone`&&(Ie(a.environmentId,a.threadId),c({to:`/$environmentId/$threadId`,params:f(a),search:Qe}))},Ge=[Ie,c,Pe,u,a],r[40]=Ie,r[41]=c,r[42]=Pe,r[43]=u,r[44]=a,r[45]=We,r[46]=Ge):(We=r[45],Ge=r[46]),(0,W.useEffect)(We,Ge);let Ke;r[47]!==c||r[48]!==a?(Ke=e=>{a&&c({to:`/$environmentId/$threadId`,params:f(a),search:e})},r[47]=c,r[48]=a,r[49]=Ke):Ke=r[49];let qe=Ke,Je;r[50]!==U||r[51]!==je||r[52]!==d||r[53]!==qe||r[54]!==De||r[55]!==H?(Je={scopeKey:d,rightPanelMode:De,rightPanelOpen:H,activeAgentKey:U,activeRenderKey:je,defaultLastMode:`review`,navigateSearch:qe},r[50]=U,r[51]=je,r[52]=d,r[53]=qe,r[54]=De,r[55]=H,r[56]=Je):Je=r[56];let{openedPanelModes:K,openedAgentKeys:q,openedRenderKey:J,lastOpenedRightPanelMode:Ze,markRightPanelOpened:Y,openRightPanel:nt,closeRightPanel:X,toggleRightPanel:Z,closePanelTab:Q,shouldRenderRightPanelContent:rt,shouldRenderPhoneRightPanelContent:it}=A(Je),at,ot;r[57]!==N||r[58]!==we||r[59]!==pe||r[60]!==c||r[61]!==B||r[62]!==xe||r[63]!==a?(at=()=>{a&&N&&!B&&!xe&&we&&c(pe?{to:`/$environmentId/$threadId`,params:f(pe),replace:!0}:{to:`/`,replace:!0})},ot=[N,we,pe,c,xe,B,a],r[57]=N,r[58]=we,r[59]=pe,r[60]=c,r[61]=B,r[62]=xe,r[63]=a,r[64]=at,r[65]=ot):(at=r[64],ot=r[65]),(0,W.useEffect)(at,ot);let st;r[66]!==_e?.promotedTo||r[67]!==Ce||r[68]!==a?(st=()=>{a&&Ce&&_e?.promotedTo&&l(a)},r[66]=_e?.promotedTo,r[67]=Ce,r[68]=a,r[69]=st):st=r[69];let ct=_e?.promotedTo,lt;if(r[70]!==Ce||r[71]!==ct||r[72]!==a?(lt=[ct,Ce,a],r[70]=Ce,r[71]=ct,r[72]=a,r[73]=lt):lt=r[73],(0,W.useEffect)(st,lt),!a||!Te)return null;let $=H?De:Ze;if(u===`phone`){let e;r[74]!==Y||r[75]!==H||r[76]!==a||r[77]!==Z?(e=()=>(0,G.jsx)(Ye,{threadRef:a,children:(0,G.jsx)(D,{environmentId:a.environmentId,threadId:a.threadId,onDiffPanelOpen:()=>Y(`review`),onPreviewPanelOpen:()=>Y(`files`),onTerminalPanelOpen:()=>Y(`terminal`),onAgentPanelOpen:()=>Y(`agent`),workspacePanelOpen:H,onToggleWorkspacePanel:Z,routeKind:`server`})}),r[74]=Y,r[75]=H,r[76]=a,r[77]=Z,r[78]=e):e=r[78];let t;r[79]!==e||r[80]!==a?(t=(0,G.jsx)(he,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,G.jsx)(Xe,{threadRef:a,enabled:!1,children:e})}),r[79]=e,r[80]=a,r[81]=t):t=r[81];let n;r[82]!==Q||r[83]!==$||r[84]!==q||r[85]!==K||r[86]!==J||r[87]!==it?(n=it?(0,G.jsx)(k,{mode:`phone`,panelMode:$,openedPanelModes:K,openedAgentKeys:q,openedRenderKey:J,onClosePanelTab:Q}):null,r[82]=Q,r[83]=$,r[84]=q,r[85]=K,r[86]=J,r[87]=it,r[88]=n):n=r[88];let i;r[89]!==X||r[90]!==H||r[91]!==n?(i=(0,G.jsx)(ne,{label:`Workspace`,open:H,onClose:X,children:n}),r[89]=X,r[90]=H,r[91]=n,r[92]=i):i=r[92];let o;return r[93]!==t||r[94]!==i?(o=(0,G.jsxs)(G.Fragment,{children:[t,i]}),r[93]=t,r[94]=i,r[95]=o):o=r[95],o}if(!Me){let e=Be&&`w-0 flex-none`,t;r[96]===e?t=r[97]:(t=n(`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,e),r[96]=e,r[97]=t);let i=Be?!0:void 0,o;r[98]!==Y||r[99]!==H||r[100]!==Z?(o=(e,t)=>(0,G.jsx)(Ye,{threadRef:e,children:(0,G.jsx)(D,{environmentId:e.environmentId,threadId:e.threadId,onDiffPanelOpen:()=>Y(`review`),onPreviewPanelOpen:()=>Y(`files`),onTerminalPanelOpen:()=>Y(`terminal`),onAgentPanelOpen:()=>Y(`agent`),workspacePanelOpen:t&&H,onToggleWorkspacePanel:()=>{t&&Z()},routeKind:`server`,reserveTitleBarControlInset:t})}),r[98]=Y,r[99]=H,r[100]=Z,r[101]=o):o=r[101];let s;r[102]!==o||r[103]!==a?(s=(0,G.jsx)(Xe,{threadRef:a,children:o}),r[102]=o,r[103]=a,r[104]=s):s=r[104];let c;r[105]!==t||r[106]!==i||r[107]!==s?(c=(0,G.jsx)(he,{className:t,inert:i,children:s}),r[105]=t,r[106]=i,r[107]=s,r[108]=c):c=r[108];let l=Be&&Le,u;r[109]!==Q||r[110]!==X||r[111]!==$||r[112]!==nt||r[113]!==q||r[114]!==K||r[115]!==J||r[116]!==Be||r[117]!==H||r[118]!==rt||r[119]!==l||r[120]!==Ve?(u=(0,G.jsx)(E,{open:H,panelMode:$,openedPanelModes:K,openedAgentKeys:q,openedRenderKey:J,onClosePanelTab:Q,onClose:X,onOpen:nt,renderContent:rt,maximized:Be,onToggleMaximized:Ve,reserveChromeInset:l}),r[109]=Q,r[110]=X,r[111]=$,r[112]=nt,r[113]=q,r[114]=K,r[115]=J,r[116]=Be,r[117]=H,r[118]=rt,r[119]=l,r[120]=Ve,r[121]=u):u=r[121];let d;return r[122]!==c||r[123]!==u?(d=(0,G.jsxs)(G.Fragment,{children:[c,u]}),r[122]=c,r[123]=u,r[124]=d):d=r[124],d}let ut;r[125]!==Y||r[126]!==H||r[127]!==Z?(ut=(e,t)=>(0,G.jsx)(Ye,{threadRef:e,children:(0,G.jsx)(D,{environmentId:e.environmentId,threadId:e.threadId,onDiffPanelOpen:()=>Y(`review`),onPreviewPanelOpen:()=>Y(`files`),onTerminalPanelOpen:()=>Y(`terminal`),onAgentPanelOpen:()=>Y(`agent`),workspacePanelOpen:t&&H,onToggleWorkspacePanel:()=>{t&&Z()},routeKind:`server`,reserveTitleBarControlInset:t})}),r[125]=Y,r[126]=H,r[127]=Z,r[128]=ut):ut=r[128];let dt;r[129]!==ut||r[130]!==a?(dt=(0,G.jsx)(he,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,G.jsx)(Xe,{threadRef:a,children:ut})}),r[129]=ut,r[130]=a,r[131]=dt):dt=r[131];let ft;r[132]!==Q||r[133]!==$||r[134]!==q||r[135]!==K||r[136]!==J||r[137]!==rt?(ft=rt?(0,G.jsx)(k,{mode:`sheet`,panelMode:$,openedPanelModes:K,openedAgentKeys:q,openedRenderKey:J,onClosePanelTab:Q}):null,r[132]=Q,r[133]=$,r[134]=q,r[135]=K,r[136]=J,r[137]=rt,r[138]=ft):ft=r[138];let pt;r[139]!==X||r[140]!==H||r[141]!==ft?(pt=(0,G.jsx)(w,{open:H,onClose:X,children:ft}),r[139]=X,r[140]=H,r[141]=ft,r[142]=pt):pt=r[142];let mt;return r[143]!==dt||r[144]!==pt?(mt=(0,G.jsxs)(G.Fragment,{children:[dt,pt]}),r[143]=dt,r[144]=pt,r[145]=mt):mt=r[145],mt}function Qe(e){return me(e)}function $e(e){return e.consumeOpenRequest}function et(e){return e.root}function tt(e){return e.sidebarThreadSortOrder}export{Ze as ChatThreadRouteView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$i as t,Cs as n,ad as r,ws as i}from"./runtime-DjjjAcTE.js";import{t as a}from"./react-CwJFpaho.js";import{i as o}from"./presentationTier-DPVAxTK4.js";import{a as s,r as c,t as l}from"./tooltip-DbqhseXd.js";import{t as u}from"./color-picker-BdBXje-a.js";var d={name:`pipette`,size:24,node:[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]};d.node;var f=i(d),p=o(),m=e(a(),1),h=r(),g=`relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full outline-none ring-offset-2 ring-offset-card transition-[transform,box-shadow] duration-(--app-motion-duration-chip) ease-(--app-motion-ease) hover:scale-110 focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50`;function _(e,t){return(e??``).toLowerCase()===(t??``).toLowerCase()}function v(e){let r=(0,p.c)(49),{value:i,onChange:a,swatches:o,ariaLabel:d,defaultOption:v,disabled:y,commitDelayMs:b}=e,x=b===void 0?160:b,[S,C]=(0,m.useState)(i),w=(0,m.useRef)(null),T=(0,m.useRef)(a),E;r[0]===a?E=r[1]:(E=()=>{T.current=a},r[0]=a,r[1]=E),(0,m.useEffect)(E);let D,O;r[2]===i?(D=r[3],O=r[4]):(D=()=>{w.current===null&&C(i)},O=[i],r[2]=i,r[3]=D,r[4]=O),(0,m.useEffect)(D,O);let k,A;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>()=>{w.current!==null&&window.clearTimeout(w.current)},A=[],r[5]=k,r[6]=A):(k=r[5],A=r[6]),(0,m.useEffect)(k,A);let j;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{w.current!==null&&(window.clearTimeout(w.current),w.current=null),C(e),T.current(e)},r[7]=j):j=r[7];let M=j,N;r[8]===x?N=r[9]:(N=e=>{C(e),w.current!==null&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{w.current=null,T.current(e)},x)},r[8]=x,r[9]=N);let P=N,F;r[10]!==S||r[11]!==o?(F=S!==null&&!o.some(e=>_(e,S)),r[10]=S,r[11]=o,r[12]=F):F=r[12];let I=F,L;r[13]!==v||r[14]!==y||r[15]!==S?(L=v?(0,h.jsxs)(l,{children:[(0,h.jsx)(s,{render:(0,h.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":S===null,"aria-label":v.label,disabled:y,onClick:()=>M(null),className:t(g,`border border-border bg-background`,S===null&&`ring-2 ring-foreground/80`),children:(0,h.jsx)(`span`,{"aria-hidden":!0,className:`absolute h-px w-4 rotate-45 rounded-full bg-muted-foreground/70`})})}),(0,h.jsx)(c,{side:`top`,children:v.label})]}):null,r[13]=v,r[14]=y,r[15]=S,r[16]=L):L=r[16];let R;if(r[17]!==y||r[18]!==S||r[19]!==o){let e;r[21]!==y||r[22]!==S?(e=e=>{let r=_(e,S);return(0,h.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e}`,disabled:y,onClick:()=>M(e),className:t(g,`shadow-[inset_0_0_0_1px_--theme(--color-black/12%)] dark:shadow-[inset_0_0_0_1px_--theme(--color-white/14%)]`,r&&`ring-2 ring-foreground/80`),style:{backgroundColor:e},children:r?(0,h.jsx)(n,{"aria-hidden":!0,className:`size-3.5 text-white drop-shadow-sm`}):null},e)},r[21]=y,r[22]=S,r[23]=e):e=r[23],R=o.map(e),r[17]=y,r[18]=S,r[19]=o,r[20]=R}else R=r[20];let z;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,h.jsx)(`span`,{"aria-hidden":!0,className:`mx-0.5 h-4 w-px bg-border`}),r[24]=z):z=r[24];let B=S??o[0]??`#888888`,V=`${d}: custom`,H=I&&`ring-2 ring-foreground/80`,U=y&&`pointer-events-none opacity-50`,W;r[25]!==H||r[26]!==U?(W=t(g,`overflow-visible rounded-full border-0`,H,U),r[25]=H,r[26]=U,r[27]=W):W=r[27];let G=I?S??void 0:`conic-gradient(from 180deg, #f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e)`,K;r[28]===G?K=r[29]:(K=(0,h.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 rounded-full`,style:{background:G}}),r[28]=G,r[29]=K);let q=I?`text-white`:`text-white/90`,J;r[30]===q?J=r[31]:(J=t(`relative size-3 drop-shadow-sm`,q),r[30]=q,r[31]=J);let Y;r[32]===J?Y=r[33]:(Y=(0,h.jsx)(f,{"aria-hidden":!0,className:J}),r[32]=J,r[33]=Y);let X;r[34]!==P||r[35]!==B||r[36]!==V||r[37]!==W||r[38]!==K||r[39]!==Y?(X=(0,h.jsxs)(u,{value:B,onChange:P,align:`end`,ariaLabel:V,triggerClassName:W,children:[K,Y]}),r[34]=P,r[35]=B,r[36]=V,r[37]=W,r[38]=K,r[39]=Y,r[40]=X):X=r[40];let Z;r[41]===S?Z=r[42]:(Z=S?(0,h.jsx)(`span`,{className:`ml-1 font-mono text-[11px] uppercase text-muted-foreground tabular-nums`,children:S}):null,r[41]=S,r[42]=Z);let Q;return r[43]!==d||r[44]!==L||r[45]!==R||r[46]!==X||r[47]!==Z?(Q=(0,h.jsxs)(`div`,{role:`radiogroup`,"aria-label":d,className:`flex flex-wrap items-center gap-2`,children:[L,R,z,X,Z]}),r[43]=d,r[44]=L,r[45]=R,r[46]=X,r[47]=Z,r[48]=Q):Q=r[48],Q}export{v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{nr as e}from"./runtime-DjjjAcTE.js";import{q as t}from"./popover-OWEv6cQz.js";import"./Sidebar.logic-D_ODfSpl.js";var n=`size-4 text-muted-foreground/80`,r=`size-4`;function i(e){return e.isAlias?`browse:alias:${e.name}:${e.fullPath}`:`browse:${e.fullPath}`}function a(e){let t=e.browseFilterQuery.toLowerCase(),n=e.browseFilterQuery.startsWith(`.`),r=e.browseEntries.filter(e=>e.name.toLowerCase().startsWith(t)&&(n||!e.name.startsWith(`.`))),a=null,o=e.highlightedItemValue;o&&o.startsWith(`browse:`)&&(a=r.find(e=>i(e)===o)??null);let s=e.browseFilterQuery.length>0?r.find(t=>t.name===e.browseFilterQuery)??null:null;return{filteredEntries:r,highlightedEntry:a,exactEntry:s}}function o(e){return e.trim().toLowerCase().replace(/\s+/g,` `)}function s(e){return e.projects.map(t=>({kind:`action`,value:`${e.valuePrefix}:${t.environmentId}:${t.id}`,searchTerms:[t.name,t.cwd],title:t.name,description:t.cwd,icon:e.icon(t),run:async()=>{await e.runProject(t)}}))}function c(n){let r=e(n.threads.filter(e=>e.archivedAt===null),n.sortOrder);return(n.limit===void 0?r:r.slice(0,n.limit)).map(e=>{let r=n.projectTitleById.get(e.projectId),i=[];r&&i.push(r),e.branch&&i.push(`#${e.branch}`),e.id===n.activeThreadId&&i.push(`Current thread`);let a=n.renderLeadingContent?.(e),o=n.renderTrailingContent?.(e);return Object.assign({kind:`action`,value:`thread:${e.id}`,searchTerms:[e.title,r??``,e.branch??``],title:e.title,description:i.join(` · `),timestamp:t(e.latestUserMessageAt??e.updatedAt??e.createdAt),icon:n.icon},a?{titleLeadingContent:a}:{},o?{titleTrailingContent:o}:{},{run:async()=>{await n.runThread(e)}})})}function l(e,t){let n=o(e);return n.length===0||!n.includes(t)?-1/0:n===t?3:n.startsWith(t)?2:1}function u(e,t){let n=e.searchTerms.filter(e=>e.length>0);if(n.length===0)return 0;for(let[e,r]of n.entries()){let n=l(r,t);if(n!==-1/0)return 1e3-e*100+n}return 0}function d(e){return e.searchResults.map(n=>{let r=e.threadTitleById.get(n.threadId)??`Thread`,i=e.projectTitleByThreadId.get(n.threadId),a=[r,i].filter(Boolean).join(` · `);return{kind:`action`,value:`message:${n.environmentId}:${n.threadId}:${n.messageId}`,searchTerms:[n.snippet,r,i??``],title:n.snippet,description:a,timestamp:t(n.timestamp),icon:e.icon,run:async()=>{await e.runMessage(n)}}})}function f(e){let t=e.query.startsWith(`>`),n=o(t?e.query.slice(1):e.query);if(n.length===0)return t?e.activeGroups.filter(e=>e.value===`actions`):[...e.activeGroups];let r=[...e.activeGroups];t?r=r.filter(e=>e.value===`actions`):e.isInSubmenu||(r=r.filter(e=>e.value!==`recent-threads`));let i=[...r];return!e.isInSubmenu&&!t&&(e.projectSearchItems.length>0&&i.push({value:`projects-search`,label:`Projects`,items:e.projectSearchItems}),e.threadSearchItems.length>0&&i.push({value:`threads-search`,label:`Threads`,items:e.threadSearchItems}),e.messageSearchItems&&e.messageSearchItems.length>0&&i.push({value:`messages-search`,label:`Messages`,items:e.messageSearchItems})),i.flatMap(e=>{let t=e.items.map((e,t)=>o(e.searchTerms.join(` `)).includes(n)?{item:e,index:t,rank:u(e,n)}:null).filter(e=>e!==null).toSorted((e,t)=>t.rank-e.rank||e.index-t.index).map(e=>e.item);return t.length===0?[]:[{value:e.value,label:e.label,items:t}]})}function p(e){let t=[];e.canBrowseUp&&t.push({kind:`action`,value:`browse:up`,searchTerms:[e.browseQuery,`..`],title:`..`,icon:e.upIcon,keepOpen:!0,run:async()=>{e.browseUp()}});for(let n of e.browseEntries)t.push({kind:`action`,value:i(n),searchTerms:[e.browseQuery,n.fullPath,n.name],title:n.name,icon:n.isSymlink?e.symlinkIcon:e.directoryIcon,keepOpen:!0,run:async()=>{n.isAlias?e.browseToPath(n.fullPath):e.browseTo(n.name)}});return[{value:`directories`,label:`Directories`,items:t}]}function m(e){return e.currentView?e.isBrowsing?`submenu-browse`:`submenu`:e.isBrowsing?`root-browse`:`root`}function h(e){let t=[];return e.actionItems.length>0&&t.push({value:`actions`,label:`Actions`,items:e.actionItems}),e.recentThreadItems.length>0&&t.push({value:`recent-threads`,label:`Recent Threads`,items:e.recentThreadItems}),t}function g(e){switch(e){case`root`:return`Search commands, projects, and threads...`;case`root-browse`:return`Enter project path (e.g. ~/projects/my-app)`;case`submenu`:return`Search...`;case`submenu-browse`:return`Enter path (e.g. ~/projects/my-app)`}}export{s as a,a as c,m as d,d as i,f as l,n,h as o,p as r,c as s,r as t,g as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-Di0isH9D.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-DARIYokI.js";import{$ as n,K as r,Q as i,X as a,Z as o,a as s,an as c,cn as l,ln as u,on as d,q as f,r as ee}from"./primary-Cf-xJExj.js";import{Gi as p,ft as te,kc as m,l as ne,x as re}from"./wsTransport-C88seBPA.js";import{$i as h,Ai as ie,Bi as ae,Gi as g,J as oe,Mt as se,O as ce,P as le,U as ue,Ur as de,W as fe,Xu as pe,Zi as me,Zr as he,aa as ge,ad as _,ai as _e,as as ve,bs as ye,ci as be,cs as xe,ea as Se,er as Ce,fr as we,ji as Te,lr as Ee,ls as De,na as Oe,oi as ke,p as v,qi as Ae,ta as je,ts as Me,wr as Ne,ws as y,x as Pe}from"./runtime-DjjjAcTE.js";import{t as b}from"./react-CwJFpaho.js";import{Mt as Fe,rt as Ie}from"./sliding-tabs-BnDSjRU3.js";import{$ as Le,I as Re,et as ze}from"./popover-OWEv6cQz.js";import{i as Be,t as Ve}from"./presentationTier-DPVAxTK4.js";import{a as He,r as Ue,t as We}from"./tooltip-DbqhseXd.js";import{t as Ge}from"./useNavigate-sQZthdyT.js";import{a as Ke,i as qe,o as Je,r as Ye}from"./RootAppShell-BYQ-eGNT.js";import{n as Xe,t as Ze}from"./arrow-up-B69gV2Bq.js";import{t as Qe}from"./arrow-left-Blu3LSE2.js";import{A as $e,T as et}from"./dialogWords-Cg0YkJVg.js";import{t as tt}from"./chart-column-DRv0YtL_.js";import{ct as x,dt as S,et as nt,ft as rt,it,lt as at,mt as C,nt as ot,ot as st,st as ct,tt as lt,ut}from"./messageQueueDrain-B7R7Qmq6.js";import{E as dt,g as ft,p as pt,v as mt,y as ht}from"./useSidebarThreadActions-n6EkLATf.js";import{On as gt,Tn as _t}from"./formatCount-B4KLI651.js";import{C as vt,I as yt,d as bt,g as w,h as T,x as xt,y as St}from"./workspaceLifecycle-OJ1aKksw.js";import{t as Ct}from"./columns-2-CWlMOClK.js";import{t as E}from"./download-TvtXS4hE.js";import{t as wt}from"./folder-git-2-CPxg5wKP.js";import{h as D}from"./WorkspaceReview-UGbCgXeK.js";import{t as Tt}from"./git-pull-request-BFPwpm3c.js";import{t as Et}from"./message-circle-dashed-BrjwqS7-.js";import{l as Dt}from"./sidebarProjectFolders-BjWzbt8C.js";import{t as Ot}from"./settings-2-PrRDu6Lc.js";import{r as O}from"./capabilities-CfOhq009.js";import{n as kt}from"./NewWorktreeDialog-CDZAJmK6.js";import{t as k}from"./toastHelpers-CSQRKo4F.js";import{f as A,p as At}from"./authorization-Ob6YwWiI.js";import{n as jt}from"./sidebarUndo-Dfq1lvyF.js";import{t as Mt}from"./usePresentationTier-B9kCQ4YH.js";import{f as j,o as Nt}from"./BranchToolbar.logic-DjzLKbbB.js";import"./Sidebar.logic-D_ODfSpl.js";import{a as Pt,c as Ft,d as It,i as Lt,l as Rt,n as M,o as zt,r as Bt,s as Vt,t as N,u as Ht}from"./CommandPalette.logic-BIOMtnEQ.js";import{o as Ut}from"./desktopWorkspace-C2wXVBhc.js";import{i as Wt,n as Gt,r as Kt}from"./deviceName-B4youG0v.js";import{t as qt}from"./useProject-Kt74Z12J.js";import{t as Jt}from"./shallow-B--PNURq.js";import{t as Yt}from"./useLogicalProjectSnapshots-CRNZke74.js";import{a as Xt,c as Zt,d as Qt,f as $t,g as en,h as tn,i as nn,l as rn,n as an,o as on,r as sn,s as cn,t as ln,u as un}from"./projectPaths-B8aVmOZX.js";import{i as dn,t as fn}from"./projectCheckouts.logic-DUT4AxXr.js";import{o as P,s as F}from"./providerModels-v9PYbzRE.js";import{p as pn}from"./workspaceRouteSearch-CCavUdbH.js";import{F as mn,P as hn,St as gn,Vt as _n,Wt as vn,_t as yn,gt as bn,ht as xn,ot as Sn,vt as Cn}from"./main-Ch0bwS-M.js";var wn={name:`corner-left-up`,size:24,node:[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]};wn.node;var Tn=y(wn),I={name:`folder-symlink`,size:24,node:[[`path`,{d:`M2 9.35V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7`,key:`y8kt7d`}],[`path`,{d:`m8 16 3-3-3-3`,key:`rlqrt1`}]]};I.node;var En=y(I),Dn={name:`git-pull-request-create`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v3`,key:`1jb6z3`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]};Dn.node;var On=y(Dn),L=e(b(),1),kn=Be();async function An(e,t){let s=he(e.environmentId),c=v(e.environmentId),l={...p(e.environmentId)},u=()=>{let t=p(e.environmentId),n=le.getState();return v(e.environmentId)===c&&t.phase===`connected`&&t.connectedAt===l.connectedAt&&t.disconnectedAt===l.disconnectedAt&&At({hosted:f(),role:n.effectiveRole,fresh:n.directoryStatus===`ready`&&n.transportStatus===`online`,browserCurrent:n.browserStatus===`current`,sessionReady:A(n,te.getThreadWindow),method:te.getThreadWindow}).allowed};if(!s||!u())throw Error(a);let d=await o({api:s,threadId:e.threadId,signal:t,isCurrent:u}),ee=i(d),m=n(d.title);if(t.throwIfAborted(),!u())throw Error(a);if(new TextEncoder().encode(ee).length>33554432)throw Error(`Conversation exceeds the 32 MiB export limit. No partial file was saved.`);if(r){if(!window.desktopBridge?.saveThreadExport)throw Error(`Update the desktop app to save conversation exports.`);return(await window.desktopBridge.saveThreadExport({filename:m,contents:ee})).status}return j(m,ee),`downloaded`}var R=_();function jn(e){let t=(0,L.useRef)(null),[n,r]=(0,L.useState)(!1);(0,L.useEffect)(()=>()=>t.current?.abort(),[]);let i=O(te.getThreadWindow);return{kind:`action`,keepOpen:!0,value:`action:export-thread-markdown`,title:n?`Cancel thread export`:`Export thread as Markdown`,searchTerms:[`export`,`markdown`,`download`,`conversation`],icon:(0,R.jsx)(E,{className:M}),disabled:!n&&(!e||!i.allowed),run:async()=>{if(t.current){t.current.abort();return}if(!e||!i.allowed)return;let n=new AbortController;t.current=n,r(!0);let a=g.add({title:`Loading retained conversation…`,timeout:0,actionProps:{children:`Cancel`,onClick:()=>n.abort()}});try{let t=await An(e,n.signal);t!==`cancelled`&&g.add({type:`success`,title:t===`saved`?`Conversation saved`:`Conversation download started`})}catch(e){n.signal.aborted||g.add({type:`error`,title:`Export failed`,description:e instanceof Error?e.message:`No file was saved. Retry the export.`})}finally{g.close(a),t.current=null,r(!1)}}}}function Mn(e){let t=(0,kn.c)(13);if(e.groups.length===0){let n=e.emptyStateMessage??(e.isActionsOnly?`No matching actions.`:`No matching commands, projects, or threads.`),r;return t[0]===n?r=t[1]:(r=(0,R.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:n}),t[0]=n,t[1]=r),r}let n;if(t[2]!==e.groups||t[3]!==e.highlightedItemValue||t[4]!==e.keybindings||t[5]!==e.onExecuteItem){let r;t[7]!==e.highlightedItemValue||t[8]!==e.keybindings||t[9]!==e.onExecuteItem?(r=t=>(0,R.jsxs)(ct,{items:t.items,children:[(0,R.jsx)(x,{children:t.label}),(0,R.jsx)(ot,{children:t=>t.disabled?(0,R.jsx)(Nn,{item:t},t.value):(0,R.jsx)(Pn,{item:t,keybindings:e.keybindings,isActive:e.highlightedItemValue===t.value,onExecuteItem:e.onExecuteItem},t.value)})]},t.value),t[7]=e.highlightedItemValue,t[8]=e.keybindings,t[9]=e.onExecuteItem,t[10]=r):r=t[10],n=e.groups.map(r),t[2]=e.groups,t[3]=e.highlightedItemValue,t[4]=e.keybindings,t[5]=e.onExecuteItem,t[6]=n}else n=t[6];let r;return t[11]===n?r=t[12]:(r=(0,R.jsx)(S,{children:n}),t[11]=n,t[12]=r),r}function Nn(e){let t=(0,kn.c)(8),n;t[0]!==e.item.description||t[1]!==e.item.title||t[2]!==e.item.titleLeadingContent?(n=e.item.description?(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,R.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),(0,R.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:e.item.description})]}):(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,R.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),t[0]=e.item.description,t[1]=e.item.title,t[2]=e.item.titleLeadingContent,t[3]=n):n=t[3];let r;return t[4]!==e.item.icon||t[5]!==e.item.titleTrailingContent||t[6]!==n?(r=(0,R.jsxs)(`div`,{className:`flex min-h-8 select-none items-center gap-2 rounded-sm px-2 py-1.5 text-base opacity-64 sm:min-h-7 sm:text-sm`,children:[e.item.icon,n,e.item.titleTrailingContent]}),t[4]=e.item.icon,t[5]=e.item.titleTrailingContent,t[6]=n,t[7]=r):r=t[7],r}function Pn(e){let t=(0,kn.c)(27),n;t[0]!==e.item.shortcutCommand||t[1]!==e.keybindings?(n=e.item.shortcutCommand?Sn(e.keybindings,e.item.shortcutCommand):null,t[0]=e.item.shortcutCommand,t[1]=e.keybindings,t[2]=n):n=t[2];let r=n,i=e.item.value,a=e.isActive&&`bg-accent! text-accent-foreground!`,o;t[3]===a?o=t[4]:(o=h(`cursor-pointer gap-2 hover:bg-transparent hover:text-inherit data-highlighted:bg-transparent data-highlighted:text-inherit data-selected:bg-transparent data-selected:text-inherit [&[data-highlighted][data-selected]]:bg-transparent [&[data-highlighted][data-selected]]:text-inherit`,a),t[3]=a,t[4]=o);let s;t[5]===e?s=t[6]:(s=()=>{e.onExecuteItem(e.item)},t[5]=e,t[6]=s);let c;t[7]!==e.item.description||t[8]!==e.item.title||t[9]!==e.item.titleLeadingContent?(c=e.item.description?(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,R.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),(0,R.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:e.item.description})]}):(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,R.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),t[7]=e.item.description,t[8]=e.item.title,t[9]=e.item.titleLeadingContent,t[10]=c):c=t[10];let l;t[11]===e.item.timestamp?l=t[12]:(l=e.item.timestamp?(0,R.jsx)(`span`,{className:`min-w-12 shrink-0 text-right text-[10px] tabular-nums text-muted-foreground/70`,children:e.item.timestamp}):null,t[11]=e.item.timestamp,t[12]=l);let u;t[13]===r?u=t[14]:(u=r?(0,R.jsx)(C,{children:r}):null,t[13]=r,t[14]=u);let d;t[15]===e.item.kind?d=t[16]:(d=e.item.kind===`submenu`?(0,R.jsx)(ze,{className:`ml-auto size-4 shrink-0 text-muted-foreground/50`}):null,t[15]=e.item.kind,t[16]=d);let f;return t[17]!==e.item.icon||t[18]!==e.item.titleTrailingContent||t[19]!==e.item.value||t[20]!==o||t[21]!==s||t[22]!==c||t[23]!==l||t[24]!==u||t[25]!==d?(f=(0,R.jsxs)(ut,{value:i,className:o,onMouseDown:Fn,onClick:s,children:[e.item.icon,c,e.item.titleTrailingContent,l,u,d]}),t[17]=e.item.icon,t[18]=e.item.titleTrailingContent,t[19]=e.item.value,t[20]=o,t[21]=s,t[22]=c,t[23]=l,t[24]=u,t[25]=d,t[26]=f):f=t[26],f}function Fn(e){e.preventDefault()}var In=u()(e=>({open:!1,request:null,openFor:t=>e({open:!0,request:t}),setOpen:t=>e({open:t})})),Ln=[],Rn=3e4,zn=2,Bn=20;function Vn(e){return Se(e)?`Finder`:je(e)?`Explorer`:`Files`}function Hn(e){return e===`windows`?`Win32`:e===`darwin`?`MacIntel`:e===`linux`?`Linux`:typeof navigator>`u`?``:navigator.platform}var Un=[`url`,`github`,`gitlab`,`forgejo`,`bitbucket`,`azure-devops`],z=[`github`,`gitlab`,`forgejo`,`bitbucket`,`azure-devops`];function Wn(e){switch(e){case`github`:return`GitHub`;case`gitlab`:return`GitLab`;case`forgejo`:return`Forgejo`;case`bitbucket`:return`Bitbucket`;case`azure-devops`:return`Azure DevOps`;case`url`:return`Git URL`}}function Gn(e){switch(e){case`github`:return`owner/repo`;case`gitlab`:return`group/project`;case`forgejo`:return`owner/repo`;case`bitbucket`:return`workspace/repository`;case`azure-devops`:return`project/repository`;case`url`:return`URL`}}function Kn(e){return e===`url`?null:e}function B(e,t){switch(e){case`github`:return(0,R.jsx)(xt,{className:t});case`gitlab`:return(0,R.jsx)(vt,{className:t});case`forgejo`:return(0,R.jsx)(St,{className:t});case`bitbucket`:return(0,R.jsx)(w,{className:t});case`azure-devops`:return(0,R.jsx)(T,{className:t});case`url`:return(0,R.jsx)(vn,{className:t})}}function qn(e){return!e||e.step===`confirm`?null:e.source===`url`?`Enter Git clone URL`:`Enter ${Wn(e.source)} repository (${Gn(e.source)})`}function Jn(e){return e.split(`/`).at(-1)?.trim()??e}function Yn(e){return`remote-repository:${e.provider}:${encodeURIComponent(e.nameWithOwner)}`}function Xn(e,t){return e===`bitbucket`?t.url:t.sshUrl}function Zn(e){return!e.includes(`/`)&&!e.includes(`:`)}function Qn(e){return e===`url`?null:e}function $n(e){return z.toSorted((t,n)=>{let r=e[t].ready;return r===e[n].ready?Wn(t).localeCompare(Wn(n)):r?-1:1})}function er(e){let t={ready:!1,hint:`Provider status unavailable. Open Settings -> Source Control and rescan.`},n={url:{ready:!0,hint:null},github:t,gitlab:t,forgejo:t,bitbucket:t,"azure-devops":t};if(!e)return n;let r=new Map(e.sourceControlProviders.map(e=>[e.kind,e])),i={...n};for(let e of Un){let n=Qn(e);if(!n)continue;let a=r.get(n);if(!a){i[e]=t;continue}if(a.status!==`available`){i[e]={ready:!1,hint:a.installHint};continue}if(a.auth.status===`unauthenticated`){i[e]={ready:!1,hint:m(a.auth.detail)??`${a.label} is not authenticated. Open Settings -> Source Control for setup guidance.`};continue}i[e]={ready:!0,hint:null}}return i}function tr(e){return e instanceof Error&&e.message.trim().length>0?e.message:`An error occurred.`}var nr=(0,L.lazy)(()=>t(()=>import(`./CreatePullRequestDialogHost-n4ZjdSr4.js`).then(e=>({default:e.CreatePullRequestDialogHost})),__vite__mapDeps([0])));function rr(){let e=(0,kn.c)(10),t=se(or),n=se(ar),r=In(ir),i,a;e[0]===n?(i=e[1],a=e[2]):(i=()=>()=>{n(!1)},a=[n],e[0]=n,e[1]=i,e[2]=a),(0,L.useEffect)(i,a);let o;e[3]===t?o=e[4]:(o=t?(0,R.jsx)(sr,{}):null,e[3]=t,e[4]=o);let s;e[5]===r?s=e[6]:(s=r?(0,R.jsx)(L.Suspense,{fallback:null,children:(0,R.jsx)(nr,{})}):null,e[5]=r,e[6]=s);let c;return e[7]!==o||e[8]!==s?(c=(0,R.jsxs)(R.Fragment,{children:[o,s]}),e[7]=o,e[8]=s,e[9]=c):c=e[9],c}function ir(e){return e.request!==null}function ar(e){return e.setOpen}function or(e){return e.open}function sr(){let e=O(te.dispatchCommand),t=O(ne.projectsAdd),n=O(ne.serverGetStatistics),i=O(ne.sourceControlListChangeRequests),a=O(ne.projectsList),o=O(re.automationCentre),u=O(ne.sourceControlCreateChangeRequest),f=In(e=>e.openFor),p=Ge(),m=se(e=>e.setOpen),_=se(e=>e.openIntent),v=se(e=>e.clearOpenIntent),je=nt(),[y,b]=(0,L.useState)(``),ze=(0,L.useDeferredValue)(y),Be=ze.startsWith(`>`),[x,S]=(0,L.useState)(null),C=ae(),ot=ue(e=>e.pinnedThreadKeys),ct=pe(),{activeContextIsChat:ut,activeDraftThread:vt,activeThread:w,chatTarget:T,defaultProjectRef:xt,handleNewChat:St,handleNewThread:E}=jt(),A=Ne(Jt(Ee)),At=(0,L.useMemo)(()=>xe(A),[A]),j=Ne(Jt(we)),vn=_n(),[Sn,wn]=(0,L.useState)([]),I=Sn.at(-1)??null,Dn=I===null,[kn,An]=(0,L.useState)(0),[Nn,Pn]=(0,L.useState)(null),[Fn,Un]=(0,L.useState)(!1),[z,Qn]=(0,L.useState)(null),[nr,rr]=(0,L.useState)(!1),[ir,ar]=(0,L.useState)(!1),[or,sr]=(0,L.useState)([]),V=s(),cr=Gt(),lr=Ut(),ur=le(e=>e.nodes),dr=_e(e=>e.byId),H=ke(e=>e.byId),fr=(0,L.useMemo)(()=>{let e=[],t=new Set;V&&(t.add(V),e.push({environmentId:V,label:Nt({isPrimary:!0,environmentId:V,runtimeLabel:cr}),isPrimary:!0}));for(let n of Object.values(dr)){if(t.has(n.environmentId)||Kt(n.environmentId,V,lr.localEnvironmentId))continue;let i=H[n.environmentId];e.push({environmentId:n.environmentId,label:Wt({environmentId:n.environmentId,machines:r?lr.machines:ur,fallback:Nt({isPrimary:!1,environmentId:n.environmentId,runtimeLabel:i?.descriptor?.label??null,savedLabel:n.label})}),isPrimary:!1})}return e.sort((e,t)=>e.isPrimary===t.isPrimary?e.label.localeCompare(t.label):e.isPrimary?-1:1),e},[V,cr,lr,ur,dr,H]),pr=fr[0]?.environmentId??null,U=Nn??pr,mr=(0,L.useMemo)(()=>Hn(U&&V&&U===V?ee()?.platform.os??null:U?H[U]?.descriptor?.platform.os??H[U]?.serverConfig?.environment.platform.os??null:null),[U,V,H]),hr=z!==null,gr=z?.step===`repository`,W=gr&&z?Kn(z.source):null,_r=gr?ze.trim():``,G=Ie({environmentId:z?.step===`repository`?z.environmentId:null,provider:W,query:_r,limit:25,enabled:z?.step===`repository`&&z.source!==`url`&&W===`bitbucket`}),K=!gr&&un(y,mr),vr=It({currentView:I,isBrowsing:K}),yr=Dn&&!Be&&!K&&!hr,br=yr?ze.trim():``,[xr]=gt(br,{wait:200}),Sr=(0,L.useMemo)(()=>{let e=new Set,t=[];for(let n of j)e.has(n.environmentId)||(e.add(n.environmentId),t.push(n.environmentId));for(let n of A)e.has(n.environmentId)||(e.add(n.environmentId),t.push(n.environmentId));return t},[A,j]);(0,L.useEffect)(()=>{let e=xr.trim();if(!yr||e.length<zn||Sr.length===0){sr([]);return}let t=!1,n=Sr.map(async t=>{let n=he(t);if(!n)return[];try{return(await n.orchestration.searchThreadMessages({query:e,limit:Bn})).map(e=>Object.assign({environmentId:t},e))}catch{return[]}});return Promise.all(n).then(e=>{t||sr(e.flat().toSorted((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,Bn))}),()=>{t=!0}},[yr,xr,Sr]);let Cr=(0,L.useCallback)(e=>{let t=e&&V&&e===V?ct:e?H[e]?.serverConfig:null,n=e&&V&&e===V?C:e?H[e]?.serverConfig?.settings:null;return tn({workspaceAccessRoot:t?.workspaceAccessRoot,configuredBaseDirectory:n?.addProjectBaseDirectory})},[V,ct,H,C]),wr=(0,L.useMemo)(()=>new Map(A.map(e=>[e.id,e.cwd])),[A]),q=(0,L.useMemo)(()=>new Map(A.map(e=>[e.id,ve(e,e.name)])),[A]),Tr=(0,L.useMemo)(()=>new Map(j.map(e=>[e.id,e.title])),[j]),Er=(0,L.useMemo)(()=>new Map(j.map(e=>[e.id,q.get(e.projectId)??``])),[q,j]),Dr=w?.environmentId??null,Or=w?.id??null,kr=(0,L.useCallback)(async e=>{let t=d(e.environmentId,e.threadId);await p({to:`/$environmentId/$threadId`,params:Ae(t),search:n=>({...pn(n,{from:Dr&&Or?d(Dr,Or):null,to:t}),messageId:e.messageId})})},[p,Dr,Or]),Ar=(0,L.useMemo)(()=>Lt({searchResults:or,threadTitleById:Tr,projectTitleByThreadId:Er,icon:(0,R.jsx)(Fe,{className:M}),runMessage:kr}),[or,kr,Er,Tr]),jr=w?.id,Mr=w?l(d(w.environmentId,w.id)):null,Nr=hn({threadKey:Mr,pinned:Mr?ot[Mr]===!0:!1}),Pr=w?.environmentId??vt?.environmentId??null,J=w?.projectId??vt?.projectId??null,Fr=J?wr.get(J)??null:null,Y=U&&Pr===U?Fr:null,X=ce(y.trim())&&Y===null,Ir=K?Xt(y):``,Lr=K&&!Zt(y)?on(y):``,Rr=qt({environmentId:U,partialPath:Ir,cwd:Y,staleTime:Rn,enabled:K&&Ir.length>0&&U!==null&&!X}),Z=Rr.data,zr=Rr.isPending,Br=Z?.entries??Ln,Vr=Z?.workspaceAccessRoot!==void 0&&Qt(Z.parentPath,Z.workspaceAccessRoot),Hr=K&&!X&&!Vr&&an(Ir),{filteredEntries:Ur,exactEntry:Wr}=(0,L.useMemo)(()=>Ft({browseEntries:Br,browseFilterQuery:Lr,highlightedItemValue:x}),[Br,Lr,x]),Gr=(0,L.useCallback)(e=>{de({environmentId:U,partialPath:e,cwd:Y,staleTime:Rn})},[U,Y]);(0,L.useEffect)(()=>{K&&Hr&&Gr(cn(y))},[Hr,K,Gr,y]);let Kr=(0,L.useMemo)(()=>async e=>{ue.getState().setProjectExpanded(Pe(e,C),!0);let t=Ce(j.filter(t=>t.environmentId===e.environmentId),e.id,C.sidebarThreadSortOrder);if(t){await p({to:`/$environmentId/$threadId`,params:Ae(d(t.environmentId,t.id))});return}await E(c(e.environmentId,e.id),{envMode:C.defaultThreadEnvMode})},[E,p,C,j]),qr=(0,L.useMemo)(()=>Pt({projects:At,valuePrefix:`project`,icon:e=>(0,R.jsx)(Re,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.id,customAvatarContentHash:e.customAvatarContentHash??null,className:M}),runProject:Kr}),[Kr,At]),{snapshots:Jr}=Yt(),Yr=(0,L.useMemo)(()=>fn(Jr),[Jr]),Xr=(0,L.useCallback)((e,t)=>{let n=Yr,r=new Map(A.map(e=>[`${e.environmentId}\0${e.id}`,e]));return n.map(i=>{let a=dn(i,n),o=r.get(`${i.environmentId}\0${i.projectId}`);return{kind:`action`,value:`${e}:${i.environmentId}:${i.projectId}`,searchTerms:[i.name,i.cwd,...a?[a]:[]],title:a?`${i.name} · ${a}`:i.name,description:i.cwd,icon:(0,R.jsx)(Re,{environmentId:i.environmentId,cwd:i.cwd,projectId:i.projectId,customAvatarContentHash:o?.customAvatarContentHash??null,className:M}),run:()=>t(i)}})},[Yr,A]),Zr=(0,L.useMemo)(()=>Xr(`pull-requests-in`,async e=>{await p(_t({environmentId:e.environmentId,projectId:e.projectId}))}),[Xr,p]),Qr=(0,L.useMemo)(()=>Xr(`project-in`,async e=>{await p(bt({environmentId:e.environmentId,projectId:e.projectId}))}),[Xr,p]),$r=(0,L.useCallback)(e=>{m(!1),f({environmentId:e.environmentId,projectId:e.projectId,cwd:e.cwd,repositoryName:e.name})},[f,m]),ei=(0,L.useMemo)(()=>Xr(`new-pull-request-in`,async e=>{$r(e)}),[Xr,$r]),ti=(0,L.useMemo)(()=>({activeContextIsChat:ut,activeDraftThread:vt,activeThread:w,chatTarget:T,defaultProjectRef:xt,defaultThreadEnvMode:C.defaultThreadEnvMode,handleNewChat:St,handleNewThread:E}),[ut,vt,w,T,xt,St,E,C.defaultThreadEnvMode]),ni=(0,L.useMemo)(()=>{if(!w)return null;let e=A.find(e=>e.environmentId===w.environmentId&&e.id===w.projectId);return e&&De(e)?{projectRef:c(e.environmentId,e.id),threadRef:d(w.environmentId,w.id),title:w.title}:null},[w,A]),ri=ft(ni?.projectRef.environmentId??null),ii=(0,L.useMemo)(()=>T?{kind:`action`,value:`new-thread-in:no-project`,searchTerms:[Me,`chat`,`without project`,`no project`,`scratch`],title:Me,description:`A chat in its own folder · turn it into a project later`,icon:(0,R.jsx)(Et,{className:M}),run:async()=>{await xn(ti)}}:null,[T,ti]),ai=(0,L.useMemo)(()=>[...ii?[ii]:[],...Pt({projects:At,valuePrefix:`new-thread-in`,icon:e=>(0,R.jsx)(Re,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.id,customAvatarContentHash:e.customAvatarContentHash??null,className:M}),runProject:async e=>{await yn(ti,c(e.environmentId,e.id))}})],[ii,At,ti]),oi=(0,L.useMemo)(()=>Vt({threads:j,...jr?{activeThreadId:jr}:{},projectTitleById:q,sortOrder:C.sidebarThreadSortOrder,icon:(0,R.jsx)(Fe,{className:M}),renderLeadingContent:e=>(0,R.jsx)(mt,{thread:e}),renderTrailingContent:e=>(0,R.jsx)(ht,{thread:e}),runThread:async e=>{await p({to:`/$environmentId/$threadId`,params:Ae(d(e.environmentId,e.id))})}}),[jr,p,q,C.sidebarThreadSortOrder,j]),si=oi.slice(0,12),ci=gn(e=>e.root),li=gn(e=>e.activeRef),ui=(0,L.useMemo)(()=>li?Vt({threads:j.filter(e=>Cn(ci,li,d(e.environmentId,e.id))!==null),projectTitleById:q,sortOrder:C.sidebarThreadSortOrder,icon:(0,R.jsx)(Ct,{className:M}),renderLeadingContent:e=>(0,R.jsx)(mt,{thread:e}),renderTrailingContent:e=>(0,R.jsx)(ht,{thread:e}),runThread:async e=>{gn.getState().open(d(e.environmentId,e.id))}}):[],[li,ci,q,C.sidebarThreadSortOrder,j]);function di(e){wn(t=>[...t,{addonIcon:e.addonIcon,groups:e.groups,...e.initialQuery?{initialQuery:e.initialQuery}:{}}]),S(null),b(e.initialQuery??``)}function fi(e){di({addonIcon:e.addonIcon,groups:e.groups,...e.initialQuery?{initialQuery:e.initialQuery}:{}})}function pi(){Qn(null),Sn.length<=1&&Pn(null),wn(e=>e.slice(0,-1)),S(null),b(``)}function mi(e){S(null),b(e),e===``&&I?.initialQuery&&pi()}let hi=(0,L.useCallback)(e=>{Pn(e),Qn(null),di({addonIcon:(0,R.jsx)(D,{className:N}),groups:[],initialQuery:Cr(e)})},[Cr]),gi=(0,L.useCallback)((e,t)=>{Pn(e),Qn({step:`repository`,environmentId:e,source:t}),di({addonIcon:B(t,N),groups:[],initialQuery:``})},[]),_i=oe(e=>e.openSettings),vi=(0,L.useCallback)(()=>{m(!1),_i(`source-control`)},[_i,m]),yi=(0,L.useCallback)((e,t)=>{let n=[{kind:`action`,value:`action:add-project:${e}:local`,searchTerms:[`local`,`folder`,`directory`,`browse`],title:`Local folder`,description:`Browse a folder on disk`,icon:(0,R.jsx)(D,{className:M}),keepOpen:!0,run:async()=>{hi(e)}}],r=[`url`,...$n(t)];for(let i of r){let r=Wn(i),a=i===`url`?`Git URL`:`${r} repository`,o=i===`url`?`Clone from a remote URL`:`Clone ${r} ${Gn(i)}`,s=t[i],c=s.hint,l=s.ready?void 0:(0,R.jsx)(`span`,{className:`ml-auto`,children:(0,R.jsxs)(We,{children:[(0,R.jsx)(He,{render:(0,R.jsx)(me,{variant:`outline`,size:`xs`,className:`h-5 rounded-sm px-1.5 text-[10px] text-warning-foreground`,onClick:()=>{vi()},children:`Setup Required`})}),(0,R.jsx)(Ue,{align:`end`,side:`left`,children:c??`Open Settings -> Source Control to configure this provider.`})]})});if(!s.ready){n.push({kind:`action`,value:`action:add-project:${e}:${i}:not-ready`,searchTerms:[`clone`,`remote`,`repository`,`repo`,`git`,r,`setup required`],title:a,description:o,disabled:!0,icon:B(i,M),...l?{titleTrailingContent:l}:{},run:async()=>{}});continue}n.push({kind:`action`,value:`action:add-project:${e}:${i}`,searchTerms:[`clone`,`remote`,`repository`,`repo`,`git`,r],title:a,description:o,icon:B(i,M),...l?{titleTrailingContent:l}:{},keepOpen:!0,run:async()=>{gi(e,i)}})}return[{value:`sources:${e}`,label:`Sources`,items:n}]},[vi,hi,gi]),bi=(0,L.useCallback)(e=>{Pn(e),Qn(null);let t={environmentId:e},n=ie(t).data;di({addonIcon:(0,R.jsx)(D,{className:N}),groups:yi(e,er(n))}),Te(t).then(t=>{wn(n=>n.at(-1)?.groups[0]?.value===`sources:${e}`?[...n.slice(0,-1),{addonIcon:(0,R.jsx)(D,{className:N}),groups:yi(e,er(t))}]:n)})},[yi]),xi=fr.map(e=>({kind:`action`,value:`action:add-project:environment:${e.environmentId}`,searchTerms:[e.label,e.environmentId,e.isPrimary?`this device`:``],title:e.label,description:`Projects on ${e.label}`,icon:(0,R.jsx)(yt,{environmentId:e.environmentId,label:e.label,className:M}),keepOpen:!0,run:async()=>{bi(e.environmentId)}})),Si=(0,L.useMemo)(()=>[{value:`environments`,label:`Environments`,items:xi}],[xi]),Ci=(0,L.useCallback)(()=>{if(!t.allowed){g.add(k({type:`error`,title:`Unable to add project`,description:t.reason??`This action is unavailable.`}));return}if(fr.length>1){di({addonIcon:(0,R.jsx)(D,{className:N}),groups:Si});return}let e=pr;if(!e){g.add(k({type:`error`,title:`Unable to browse projects`,description:`No environment is available.`}));return}bi(e)},[t.allowed,t.reason,Si,fr.length,pr,bi]);(0,L.useLayoutEffect)(()=>{_?.kind===`add-project`&&(v(),Ci())},[v,Ci,_]),(0,L.useLayoutEffect)(()=>{_?.kind===`search`&&(v(),S(null),b(_.query))},[v,_]);let wi={addonIcon:(0,R.jsx)(Ct,{className:N}),groups:[{value:`split-threads`,label:`Open in split view`,items:ui}]};(0,L.useLayoutEffect)(()=>{if(_?.kind===`split-thread`){if(v(),ui.length===0){m(!1),g.add({type:`info`,title:li?`No thread can join this split`:`Open a thread first`,description:li?`Split view holds up to 4 threads from the same machine.`:`Split view starts from the thread you are viewing.`});return}di(wi)}},[_]);let Ti=jn(w?d(w.environmentId,w.id):null),Ei=Mt(),Q=Ei===`phone`?[]:[Ti];if(Q.push({kind:`action`,value:`action:show-inbox-sidebar`,searchTerms:[`sidebar`,`inbox`,`tasks`,`activity`],title:`Show Inbox sidebar`,icon:(0,R.jsx)(qe,{className:M}),shortcutCommand:`sidebar.showInbox`,run:async()=>{fe.getState().clearSelection(),ue.getState().setSidebarMode(`inbox`),m(!1)}},{kind:`action`,value:`action:show-projects-sidebar`,searchTerms:[`sidebar`,`projects`,`tree`,`folders`],title:`Show Projects sidebar`,icon:(0,R.jsx)(Je,{className:M}),shortcutCommand:`sidebar.showProjects`,run:async()=>{fe.getState().clearSelection(),ue.getState().setSidebarMode(`projects`),m(!1)}}),Ei!==`phone`&&ui.length>0&&Q.push({kind:`submenu`,value:`action:open-in-split`,searchTerms:[`split`,`side by side`,`pane`,`open beside`,`compare`],title:`Open thread in split view...`,icon:(0,R.jsx)(Ct,{className:M}),shortcutCommand:`pane.split`,...wi}),Q.push({kind:`action`,value:`action:toggle-current-thread-pin`,searchTerms:[`pin`,`unpin`,`thread`,`favorite`,`keep at top`],title:Nr.title,...Nr.description?{description:Nr.description}:{},disabled:Nr.disabled,icon:Nr.pinned?(0,R.jsx)(Ye,{className:M}):(0,R.jsx)(Dt,{className:M}),shortcutCommand:`thread.pinToggle`,run:async()=>{w&&Mr&&await mn({threadKey:Mr,threadTitle:w.title,confirmUnpin:C.confirmThreadUnpin})}}),T&&Q.push({kind:`action`,value:`action:new-chat-without-project`,searchTerms:[`new chat`,`no project`,`without project`,`chat`,`scratch`,`folder`],title:`New chat without a project`,icon:(0,R.jsx)(Et,{className:M}),shortcutCommand:`chat.newWithoutProject`,...e.reason?{description:e.reason}:{},disabled:!e.allowed,run:async()=>{await xn(ti)}}),ni&&ri&&Q.push({kind:`action`,value:`action:turn-chat-into-project`,searchTerms:[`turn into project`,`promote`,`convert`,`project`,`git`,`move chat`,`chat folder`],title:`Turn chat into project…`,description:`Move its folder somewhere permanent and add Git`,icon:(0,R.jsx)(wt,{className:M}),run:async()=>{m(!1),pt(ni)}}),At.length>0||T){let t=J&&!ut?q.get(J)??null:null;t&&Q.push({kind:`action`,value:`action:new-thread`,searchTerms:[`new thread`,`chat`,`create`,`draft`],title:(0,R.jsxs)(R.Fragment,{children:[`New thread in `,(0,R.jsx)(`span`,{className:`font-semibold`,children:t})]}),icon:(0,R.jsx)(kt,{className:M}),shortcutCommand:`chat.new`,...e.reason?{description:e.reason}:{},disabled:!e.allowed,run:async()=>{await bn(ti)}}),Q.push({kind:`submenu`,value:`action:new-thread-in`,searchTerms:[`new thread`,`project`,`pick`,`choose`,`select`],title:`New thread in...`,icon:(0,R.jsx)(kt,{className:M}),addonIcon:(0,R.jsx)(kt,{className:N}),groups:[{value:`projects`,label:`Projects`,items:ai}],...e.reason?{description:e.reason}:{},disabled:!e.allowed})}if(Q.push({kind:`action`,value:`action:add-project`,searchTerms:[`add project`,`folder`,`directory`,`browse`,`clone`,`remote`,`repository`,`repo`,`git`,`github`,`gitlab`,`forgejo`,`codeberg`,`bitbucket`,`azure`,`devops`,`url`,`environment`],title:`Add project`,...t.reason?{description:t.reason}:{},disabled:!t.allowed,icon:(0,R.jsx)(D,{className:M}),keepOpen:!0,run:async()=>{Ci()}}),Ve()!==`phone`){Q.push({kind:`action`,value:`action:statistics`,searchTerms:[`statistics`,`usage`,`activity`,`tokens`,`cost`,`history`],title:`Open statistics`,...n.reason?{description:n.reason}:{},disabled:!n.allowed,icon:(0,R.jsx)(tt,{className:M}),run:async()=>{m(!1),await p({to:`/statistics`})}}),Q.push({kind:`action`,value:`action:pull-requests`,searchTerms:[`pull requests`,`prs`,`review`,`merge`,`stack`,`checks`,`code review`],title:`Open pull requests`,...i.reason?{description:i.reason}:{},disabled:!i.allowed,icon:(0,R.jsx)(Tt,{className:M}),shortcutCommand:`pullRequests.open`,run:async()=>{m(!1),await p(_t())}}),Zr.length>1&&Q.push({kind:`submenu`,value:`action:pull-requests-in`,searchTerms:[`pull requests`,`prs`,`review`,`repository`,`repo`,`project`],title:`Open pull requests in...`,icon:(0,R.jsx)(Tt,{className:M}),addonIcon:(0,R.jsx)(Tt,{className:N}),groups:[{value:`repositories`,label:`Repositories`,items:Zr}],...i.reason?{description:i.reason}:{},disabled:!i.allowed});let e=Yr.length===1?Yr[0]:void 0,t={searchTerms:[`new pull request`,`create pull request`,`open pull request`,`pr`,`merge request`],title:`New pull request…`,icon:(0,R.jsx)(On,{className:M}),...u.reason?{description:u.reason}:{},disabled:!u.allowed};e?Q.push({kind:`action`,value:`action:new-pull-request`,...t,run:async()=>{$r(e)}}):ei.length>1&&Q.push({kind:`submenu`,value:`action:new-pull-request`,...t,addonIcon:(0,R.jsx)(On,{className:N}),groups:[{value:`repositories`,label:`Repositories`,items:ei}]});let r={...a.reason?{description:a.reason}:{},disabled:!a.allowed};Q.push({kind:`action`,value:`action:projects`,searchTerms:[`projects`,`manage projects`,`project settings`,`scripts`,`actions`,`worktrees`,`remotes`,`devices`],title:`Open projects page`,icon:(0,R.jsx)(Ke,{className:M}),shortcutCommand:`projects.open`,...r,run:async()=>{m(!1),await p(bt())}});let s=J&&!ut?q.get(J)??null:null;Pr&&J&&s&&Q.push({kind:`action`,value:`action:current-project-settings`,searchTerms:[`project settings`,`configure project`,`project`,s],title:(0,R.jsxs)(R.Fragment,{children:[`Project settings for `,(0,R.jsx)(`span`,{className:`font-semibold`,children:s})]}),icon:(0,R.jsx)(Ot,{className:M}),...r,run:async()=>{m(!1),await p(bt({environmentId:Pr,projectId:J,view:`settings`}))}}),Ei!==`phone`&&Q.push({kind:`action`,value:`action:automations`,searchTerms:[`automations`,`schedules`,`scheduled runs`,`recurring`,`cron`,`approve run`,...s?[s]:[]],title:`Automations…`,...o.reason?{description:o.reason}:{},disabled:!o.allowed,icon:(0,R.jsx)($e,{className:M}),run:async()=>{m(!1),et(Pr&&J&&!ut?{environmentId:Pr,projectId:J}:{})}}),Qr.length>1&&Q.push({kind:`submenu`,value:`action:project-in`,searchTerms:[`open project`,`project overview`,`project settings`,`projects`],title:`Open project…`,icon:(0,R.jsx)(Ke,{className:M}),addonIcon:(0,R.jsx)(Ke,{className:N}),groups:[{value:`projects`,label:`Projects`,items:Qr}],...r})}Q.push({kind:`action`,value:`action:settings`,searchTerms:[`settings`,`preferences`,`configuration`,`keybindings`],title:`Open settings`,icon:(0,R.jsx)(dt,{className:M}),run:async()=>{m(!1),_i()}});let Di=zt({actionItems:Q,recentThreadItems:si}),Oi=I?I.groups:Di,ki=Rt({activeGroups:Oi,query:ze,isInSubmenu:I!==null,projectSearchItems:qr,threadSearchItems:oi,messageSearchItems:Ar}),Ai=(0,L.useCallback)(async(e,t)=>{let n=t?.environmentId??U;if(!n){g.add(k({type:`error`,title:`Failed to add project`,description:`Choose an environment and try again.`}));return}let r=t?.api??he(n);if(!r){g.add(k({type:`error`,title:`Failed to add project`,description:`The environment is still reconnecting. Try again shortly.`}));return}if($t(e.trim(),mr)){g.add(k({type:`error`,title:`Failed to add project`,description:`Windows-style paths are only supported on Windows.`}));return}if(ce(e.trim())&&!Y){g.add(k({type:`error`,title:`Failed to add project`,description:`Relative paths require an active project.`}));return}let i=en(e,Y);if(i.length===0)return;let a=nn(A.filter(e=>e.environmentId===n),i);if(a){ue.getState().setProjectExpanded(Pe(a,C),!0);let e=Ce(j.filter(e=>e.environmentId===a.environmentId),a.id,C.sidebarThreadSortOrder);e?await p({to:`/$environmentId/$threadId`,params:Ae(d(e.environmentId,e.id))}):await E(c(a.environmentId,a.id),{envMode:C.defaultThreadEnvMode}).catch(()=>void 0),m(!1);return}try{let e=ge();await r.orchestration.dispatchCommand({type:`project.create`,commandId:Oe(),projectId:e,title:rn(i),workspaceRoot:i,projectMetadataDir:`.ryco`,createWorkspaceRootIfMissing:!0,createdAt:new Date().toISOString()}),await E(c(n,e),{envMode:C.defaultThreadEnvMode}).catch(()=>void 0),m(!1)}catch(e){g.add(k({type:`error`,title:`Failed to add project`,description:e instanceof Error?e.message:`An error occurred.`}))}},[U,mr,Y,E,p,A,m,C,j]),ji=(0,L.useCallback)(e=>Cr(e),[Cr]),$=(0,L.useCallback)(e=>{let t=ji(e.flow.environmentId);Qn({step:`confirm`,environmentId:e.flow.environmentId,source:e.flow.source,repositoryInput:e.repositoryInput,repository:e.repository,remoteUrl:e.remoteUrl}),S(null),b(t),An(e=>e+1)},[ji]);async function Mi(e){if(!z)return;let t=he(z.environmentId);if(!t){g.add(k({type:`error`,title:`Unable to clone project`,description:`Environment API is not available.`}));return}if(z.step===`repository`){let e=y.trim();if(e.length===0||nr)return;let n=Kn(z.source);if(!n){$({flow:z,repositoryInput:e,repository:null,remoteUrl:e});return}let r=G.data?.repositories??[];if(Zn(e)&&_r===e&&r.length===1){let e=r[0];$({flow:z,repositoryInput:e.nameWithOwner,repository:e,remoteUrl:Xn(z.source,e)});return}rr(!0);try{let r=await t.sourceControl.lookupRepository({provider:n,repository:e});$({flow:z,repositoryInput:e,repository:r,remoteUrl:Xn(z.source,r)})}catch(e){g.add(k({type:`error`,title:`Repository lookup failed`,description:tr(e)}))}finally{rr(!1)}return}let n=(e??y).trim();if(n.length===0||ir)return;if($t(n,mr)){g.add(k({type:`error`,title:`Clone failed`,description:`Windows-style paths are only supported on Windows.`}));return}if(ce(n)&&!Y){g.add(k({type:`error`,title:`Clone failed`,description:`Relative paths require an active project.`}));return}let r=en(n,Y);if(r.length!==0){ar(!0);try{let e=Kn(z.source),n=await t.sourceControl.cloneRepository({...e&&z.repository?{provider:e,repository:z.repository.nameWithOwner,remoteUrl:z.remoteUrl,...z.source===`bitbucket`?{protocol:`https`}:{}}:{remoteUrl:z.remoteUrl},destinationPath:r});await Ai(n.cwd,{environmentId:z.environmentId,api:t})}catch(e){g.add(k({type:`error`,title:`Clone failed`,description:tr(e)}))}finally{ar(!1)}}}function Ni(e){let t=ln(y,e);S(null),b(t),An(e=>e+1)}function Pi(e){let t=sn(e);S(null),b(t),An(e=>e+1)}function Fi(){if(!Hr)return;let e=cn(y);e!==null&&(S(null),b(e),An(e=>e+1))}let Ii=Zt(y)?Z?.parentPath??y.trim():Wr?.fullPath??y.trim(),Li=[...Rr.error?[{value:`browse-status`,label:`Filesystem`,items:[{kind:`action`,value:`browse-status:error`,searchTerms:[`filesystem`,`unavailable`,`error`],title:`Unable to browse folders`,description:tr(Rr.error),icon:(0,R.jsx)(ye,{className:M}),disabled:!0,run:async()=>{}}]}]:[],...Bt({browseEntries:Ur,browseQuery:y,canBrowseUp:Hr,upIcon:(0,R.jsx)(Tn,{className:M}),directoryIcon:(0,R.jsx)(Le,{className:M}),symlinkIcon:(0,R.jsx)(En,{className:M}),browseUp:Fi,browseTo:Ni,browseToPath:Pi})],Ri=Li.map(e=>e.value===`directories`?{...e,label:`Select where to clone`}:e),zi=(0,L.useMemo)(()=>z?.step===`confirm`?{title:z.repository?.nameWithOwner??z.repositoryInput,description:z.repository?.url??z.remoteUrl,icon:B(z.source,M)}:null,[z]),Bi=(0,L.useMemo)(()=>{if(z?.step!==`repository`||z.source===`url`||W!==`bitbucket`)return[];let e=G.data?.repositories??[];return e.length>0?[{value:`remote-repositories:${z.environmentId}:${W}`,label:_r.length>0?`Matching repositories`:`Available repositories`,items:e.map(e=>({kind:`action`,value:Yn(e),searchTerms:[e.nameWithOwner,Jn(e.nameWithOwner),e.url,e.sshUrl],title:e.nameWithOwner,description:e.url,icon:B(z.source,M),keepOpen:!0,run:async()=>{$({flow:z,repositoryInput:e.nameWithOwner,repository:e,remoteUrl:Xn(z.source,e)})}}))}]:G.isFetching?[{value:`remote-repositories:${z.environmentId}:${W}:loading`,label:`Repositories`,items:[{kind:`action`,value:`remote-repositories:loading`,searchTerms:[`loading`,`repository`,`repo`],title:`Loading repositories`,description:`Reading available Bitbucket workspaces`,icon:B(z.source,M),disabled:!0,run:async()=>{}}]}]:G.error===null?[]:[{value:`remote-repositories:${z.environmentId}:${W}:error`,label:`Repositories`,items:[{kind:`action`,value:`remote-repositories:error`,searchTerms:[`error`,`repository`,`repo`],title:`Unable to load repositories`,description:tr(G.error),icon:B(z.source,M),disabled:!0,run:async()=>{}}]}]},[z,$,W,_r,G.data?.repositories,G.error,G.isFetching]),Vi=z?.step===`repository`&&z.source===`bitbucket`?_r.length===0?`No repositories found. Enter workspace/repository manually.`:`No matching repositories. Enter workspace/repository manually.`:null,Hi=ki;z?.step===`repository`?Hi=Bi:z?.step===`confirm`?Hi=X?[]:Ri:K&&(Hi=X?[]:Li);let Ui=qn(z)??Ht(vr),Wi=vr===`submenu`||vr===`submenu-browse`,Gi=x?.startsWith(`browse:`)??!1,Ki=K&&!X,qi=Ki&&!zr&&y.trim().length>0&&!Gi&&(Zt(y)?!Z:Wr===null),Ji=Se(navigator.platform),Yi=Ji?`⌘`:`Ctrl`,Xi=z?.step===`confirm`,Zi=Xi?qi?`Create & Clone`:`Clone`:qi?`Create & Add`:`Add`,Qi=Gi?`${Yi} Enter`:`Enter`,$i=z?z.source===`url`?`Continue`:`Lookup`:null,ea=nr||ir,ta=z?.step===`repository`&&y.trim().length>0&&!ea,na=Vn(navigator.platform),ra=K&&U!==null&&V!==null&&U===V&&typeof window<`u`&&window.desktopBridge!==void 0,ia=(0,L.useMemo)(()=>{if(!ra)return;let e=y.trim();if(e.length===0)return;let t=Zt(y)?Z?.parentPath??e:Ir||e,n=en(t,Y);return n.length>0?n:void 0},[Ir,Z?.parentPath,ra,Y,y]);function aa(e){return Ji?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function oa(e){if(z?.step===`repository`&&e.key===`Enter`){e.preventDefault();let t=G.data?.repositories.find(e=>Yn(e)===x);if(t){$({flow:z,repositoryInput:t.nameWithOwner,repository:t,remoteUrl:Xn(z.source,t)});return}Mi();return}if(Ki&&e.key===`Enter`&&(!Gi||aa(e))){e.preventDefault(),Xi?Mi(Ii):Ai(Ii);return}e.key===`Backspace`&&y===``&&Wi&&(e.preventDefault(),pi())}function sa(e){if(!e.disabled){if(e.kind===`submenu`){fi(e);return}e.keepOpen||m(!1),e.run().catch(e=>{g.add(k({type:`error`,title:`Unable to run command`,description:e instanceof Error?e.message:`An unexpected error occurred.`}))})}}let ca=(0,L.useCallback)(async()=>{if(!ra||Fn)return;let e=be();if(!e)return;Un(!0);let t=null;try{t=await e.dialogs.pickFolder(ia?{initialPath:ia}:void 0)}catch{Un(!1);return}Un(!1),t&&await Ai(t)},[ra,ia,Ai,Fn]);return(0,R.jsx)(it,{"aria-label":`Command palette`,className:`project-glass-surface overflow-hidden p-0`,"data-testid":`command-palette`,surface:`glass`,finalFocus:()=>(je?.current?.focusAtEnd(),!1),onBackdropPointerDown:()=>{m(!1)},children:(0,R.jsxs)(lt,{"aria-label":`Command palette`,autoHighlight:K||hr?!1:`always`,mode:`none`,onItemHighlighted:e=>{S(typeof e==`string`?e:null)},onValueChange:mi,value:y,children:[(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(at,{className:z?.step===`repository`?`pe-32`:K?qi?`pe-36`:`pe-16`:void 0,placeholder:Ui,wrapperClassName:Wi?`[&_[data-slot=autocomplete-start-addon]]:pointer-events-auto`:void 0,...Wi?{startAddon:(0,R.jsx)(`button`,{type:`button`,className:`flex cursor-pointer items-center`,"aria-label":`Back`,onClick:pi,children:(0,R.jsx)(Qe,{})})}:K&&!Wi?{startAddon:(0,R.jsx)(D,{})}:{},onKeyDown:oa}),z?.step===`repository`?(0,R.jsxs)(me,{variant:`outline`,size:`xs`,tabIndex:-1,className:`absolute inset-e-2.5 top-1/2 gap-1.5 pe-1 ps-2 -translate-y-1/2`,"aria-label":`${$i??`Continue`} (Enter)`,disabled:!ta,onMouseDown:e=>{e.preventDefault()},onClick:()=>{Mi()},title:`${$i??`Continue`} (Enter)`,children:[(0,R.jsx)(`span`,{children:ea?`Working`:$i}),(0,R.jsx)(F,{className:`pointer-events-none -me-0.5 items-center gap-1 pointer-coarse:hidden`,children:(0,R.jsx)(P,{children:`Enter`})})]}):K?(0,R.jsxs)(me,{variant:`outline`,size:`xs`,tabIndex:-1,className:h(`absolute inset-e-2.5 top-1/2 pe-1 ps-2 -translate-y-1/2`,Gi?`gap-1`:`gap-1.5`),"aria-label":`${Zi} (${Qi})`,disabled:X||Xi&&ea,onMouseDown:e=>{e.preventDefault()},onClick:()=>{X||(Xi?Mi(Ii):Ai(Ii))},title:`${Zi} (${Qi})`,children:[(0,R.jsx)(`span`,{children:Xi&&ea?`Cloning`:Zi}),(0,R.jsx)(F,{className:`pointer-events-none -me-0.5 items-center gap-1 pointer-coarse:hidden`,children:(0,R.jsx)(P,{children:Gi?`${Yi} Enter`:`Enter`})})]}):null]}),(0,R.jsxs)(rt,{className:`max-h-[min(28rem,70vh)] bg-transparent`,children:[zi?(0,R.jsxs)(`div`,{className:`p-2 pb-0`,children:[(0,R.jsx)(`div`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`Repository`}),(0,R.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2 rounded-sm px-2 py-1.5`,children:[zi.icon,(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsx)(`span`,{className:`truncate text-foreground text-sm`,children:zi.title}),(0,R.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:zi.description})]})]})]}):null,(0,R.jsx)(Mn,{groups:Hi,highlightedItemValue:x,isActionsOnly:Be,keybindings:vn,onExecuteItem:sa,...z?.step===`repository`?{emptyStateMessage:z.source===`url`?`Enter a Git clone URL and press Enter to continue.`:Vi??`Enter a repository path and press Enter to look it up.`}:z?.step===`confirm`?{emptyStateMessage:`Choose a destination path and press Enter to clone.`}:X?{emptyStateMessage:`Relative paths require an active project.`}:qi?{emptyStateMessage:`Press Enter to create this folder and add it as a project.`}:{}})]}),(0,R.jsxs)(st,{className:`gap-3 max-sm:flex-col max-sm:items-start`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 pointer-coarse:hidden`,children:[(0,R.jsxs)(F,{className:`items-center gap-1.5`,children:[(0,R.jsx)(P,{children:(0,R.jsx)(Ze,{})}),(0,R.jsx)(P,{children:(0,R.jsx)(Xe,{})}),(0,R.jsx)(`span`,{className:h(`text-muted-foreground/80`),children:`Navigate`})]}),z?.step===`repository`?(0,R.jsxs)(F,{className:`items-center gap-1.5`,children:[(0,R.jsx)(P,{children:`Enter`}),(0,R.jsx)(`span`,{className:h(`text-muted-foreground/80`),children:$i??`Continue`})]}):!Ki||Gi?(0,R.jsxs)(F,{className:`items-center gap-1.5`,children:[(0,R.jsx)(P,{children:`Enter`}),(0,R.jsx)(`span`,{className:h(`text-muted-foreground/80`),children:`Select`})]}):null,Wi?(0,R.jsxs)(F,{className:`items-center gap-1.5`,children:[(0,R.jsx)(P,{children:`Backspace`}),(0,R.jsx)(`span`,{className:h(`text-muted-foreground/80`),children:`Back`})]}):null,(0,R.jsxs)(F,{className:`items-center gap-1.5`,children:[(0,R.jsx)(P,{children:`Esc`}),(0,R.jsx)(`span`,{className:h(`text-muted-foreground/80`),children:`Close`})]})]}),ra?(0,R.jsx)(me,{variant:`ghost`,size:`xs`,className:`h-auto px-2 text-xs text-muted-foreground/80 hover:bg-transparent hover:text-foreground`,disabled:Fn,onClick:()=>{ca()},children:`Open in ${na}`}):null]})]},`${Sn.length}-${kn}-${K}-${z?.step??`none`}`)})}export{rr as CommandPaletteDialog,In as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$s as t,Cl as n,El as r,Hc as i,Ku as a,Lu as o,Sl as s,Tl as c,Uu as l,ad as u,al as d,bl as f,cl as p,qu as m,uu as h}from"./runtime-DjjjAcTE.js";import{t as g}from"./react-CwJFpaho.js";import{a as _,d as v,f as y,i as b,l as x,o as S,r as C,s as w}from"./useScrollLock-CLZ31xsK.js";import{i as T}from"./ToolbarRootContext-8FsV9Cpj.js";import{l as E}from"./select-Cb9FUPHD.js";var D=e(g(),1),O=`data-composite-item-active`;function k(e){let{loopFocus:t=!0,orientation:i=`both`,grid:u,onLoop:d,direction:m,highlightedIndex:g,onHighlightedIndexChange:x,rootRef:T,enableHomeAndEndKeys:O=!1,stopEventPropagation:k,disabledIndices:M,modifierKeys:N=a}=e,[P,F]=D.useState(0),I=u!=null,L=D.useRef(null),R=p(L,T),z=D.useRef([]),B=D.useRef(!1),V=D.useRef(null),H=g??P,U=o((e,t=!1)=>{if(V.current=z.current[e]??null,(x??F)(e),t){let t=z.current[e];y(L.current,t,m,i)}}),W=o(e=>{if(e.size===0)return;if(B.current){let e=z.current,t=e.indexOf(V.current);if(t===-1){let t=e[H];!t||r(e,H,M)?U(A(e,M)):V.current=t}else t!==H&&U(t);return}B.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,a=n?e.get(n)?.index??-1:-1;if(a!==-1)U(a);else if(r(t,H,M)){let e=f(t,{disabledIndices:M});c(t,e)||U(e)}y(L.current,n,m,i)});l(()=>{if(M==null||g!=null||!B.current)return;let e=z.current;if(r(e,H,M)){let t=f(e,{disabledIndices:M});c(e,t)||U(t)}},[M,g,H,z,U]);let G=o((e,t,n)=>d?d(e,t,n,z):n),K=o(e=>{let r=e.key===`Home`||e.key===`End`;if(!w.has(e.key)||!O&&r||j(e,N)||!L.current)return;let a=m===`rtl`,o=a?b:_,l=a?_:b,p=i===`vertical`?C:o,g=i===`vertical`?S:l,y=h(e.nativeEvent);if(y!=null&&v(y)&&!E(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==g&&t<r.length||e.key!==p&&t>0)return}let x=H,T=n(z,M),D=s(z,M);u!=null&&(x=u({disabledIndices:M,elementsRef:z,event:e,highlightedIndex:H,loopFocus:t,maxIndex:D,minIndex:T,onLoop:G,orientation:i,rtl:a}));let A=i!==`vertical`&&e.key===o||i!==`horizontal`&&e.key===`ArrowDown`,P=i!==`vertical`&&e.key===l||i!==`horizontal`&&e.key===`ArrowUp`;O&&(e.key===`Home`?x=T:e.key===`End`&&(x=D)),x===H&&(A||P)&&(t&&x===D&&A?(x=T,d&&(x=d(e,H,x,z))):t&&x===T&&P?(x=D,d&&(x=d(e,H,x,z))):x=f(z.current,{startingIndex:x,decrement:P,disabledIndices:M})),x!==H&&!c(z.current,x)&&(k&&e.stopPropagation(),(I||r||A||P)&&e.preventDefault(),U(x,!0),queueMicrotask(()=>{z.current[x]?.focus()}))});return{props:{ref:R,onFocus(e){let t=L.current,n=h(e.nativeEvent);t&&n!=null&&v(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:K},highlightedIndex:H,onHighlightedIndexChange:U,elementsRef:z,onMapChange:W,relayKeyboardEvent:K}}function A(e,t){let n=-1;for(let i=0;i<e.length;i+=1){let a=e[i];if(a&&!r(e,i,t)){if(a.hasAttribute(`data-composite-item-active`))return i;n===-1&&(n=i)}}return Math.max(n,0)}function j(e,t){for(let n of x)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var M=u();function N(e){let{render:n,className:r,style:o,refs:s=a,props:c=a,state:l=m,stateAttributesMapping:u,highlightedIndex:f,onHighlightedIndexChange:p,orientation:h,grid:g,loopFocus:_,onLoop:v,enableHomeAndEndKeys:y,onMapChange:b,stopEventPropagation:x=!0,rootRef:S,disabledIndices:C,modifierKeys:w,highlightItemOnHover:E=!1,tag:O=`div`,...A}=e,{props:j,highlightedIndex:N,onHighlightedIndexChange:P,elementsRef:F,onMapChange:I,relayKeyboardEvent:L}=k({grid:g,loopFocus:_,onLoop:v,orientation:h,highlightedIndex:f,onHighlightedIndexChange:p,rootRef:S,stopEventPropagation:x,enableHomeAndEndKeys:y,direction:t(),disabledIndices:C,modifierKeys:w}),R=d(O,e,{state:l,ref:s,props:[j,...c,A],stateAttributesMapping:u}),z=D.useMemo(()=>({highlightedIndex:N,onHighlightedIndexChange:P,highlightItemOnHover:E,relayKeyboardEvent:L}),[N,P,E,L]);return(0,M.jsx)(i.Provider,{value:z,children:(0,M.jsx)(T,{elementsRef:F,onMapChange:e=>{b?.(e),I(e)},children:R})})}export{O as n,N as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$i as t,Xi as n,Zi as r,ad as i,ws as a,ys as o}from"./runtime-DjjjAcTE.js";import{t as s}from"./react-CwJFpaho.js";import{i as c}from"./presentationTier-DPVAxTK4.js";import{n as l,t as u}from"./circle-x-CNLfrTqR.js";import{t as d}from"./folder-open-DcMymvp1.js";import{t as f}from"./ColorSwatchPicker-CGyo99o0.js";import{t as p}from"./square-B05NKv3e.js";import{t as m}from"./input-CCie4mm1.js";import{c as h}from"./select-Cb9FUPHD.js";import{t as g}from"./textarea-VyiIZ0wQ.js";import{t as _}from"./switch-oQc7Ifbl.js";import{c as v,d as y,i as b,n as x,u as S}from"./settingsLayout-CRFNCk_D.js";import{t as C}from"./SettingsSelect-DEhNaz3E.js";var w={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};w.node;var T=a(w),E=e(s(),1),D=c(),O=i();function k(e,t){return e===`granted`?{label:`Granted`,tone:`success`}:e===`restricted`?{label:`Restricted`,tone:`error`}:e===`denied`?{label:`Not granted`,tone:`error`}:e===`not_required`?{label:`Not required`,tone:`neutral`}:{label:t?`Could not check`:`Not checked`,tone:`neutral`}}function A(e){let t=(0,D.c)(11),{status:n,checked:r}=e,i=r===void 0||r,a;t[0]!==i||t[1]!==n?(a=k(n,i),t[0]=i,t[1]=n,t[2]=a):a=t[2];let{label:s,tone:c}=a,d=c===`success`?o:c===`error`?u:l,f=n??`unknown`,p=c===`success`?`success`:c===`error`?`error`:`secondary`,m;t[3]===d?m=t[4]:(m=(0,O.jsx)(d,{"aria-hidden":!0}),t[3]=d,t[4]=m);let g;return t[5]!==s||t[6]!==f||t[7]!==p||t[8]!==m||t[9]!==c?(g=(0,O.jsxs)(h,{size:`sm`,"data-permission-status":f,"data-tone":c,variant:p,children:[m,s]}),t[5]=s,t[6]=f,t[7]=p,t[8]=m,t[9]=c,t[10]=g):g=t[10],g}var j=[`#e8794a`,`#f43f5e`,`#a855f7`,`#3b82f6`,`#14b8a6`,`#22c55e`];function M(){let e=window.desktopBridge?.computerBeta,[t,n]=(0,E.useState)(null),[i,a]=(0,E.useState)(null),[o,s]=(0,E.useState)(!1),[c,l]=(0,E.useState)(null);if((0,E.useEffect)(()=>{if(!e)return;let t=!0,r=()=>{e.checkPermissions().then(e=>{t&&n(e)}).catch(()=>void 0)};e.getState().then(e=>{t&&n(e)}).catch(()=>void 0);let i=e.onUpdate(e=>{e.type===`state`&&n(e.state)});return window.addEventListener(`focus`,r),()=>{t=!1,i(),window.removeEventListener(`focus`,r)}},[e]),!e||t?.supported===!1)return null;let u=async e=>{s(!0),a(null);try{n(await e())}catch(e){a(e instanceof Error?e.message:`Computer setup failed.`)}finally{s(!1)}},d=n=>{t&&u(()=>e.setPreferences({...t.preferences,...n}))};return(0,O.jsxs)(y,{title:`Computer Use`,description:(0,O.jsxs)(O.Fragment,{children:[`Use Mac apps and an isolated browser from chat. Start one task with`,` `,(0,O.jsx)(`code`,{className:`font-mono text-foreground`,children:`/computer-use`}),`, or turn it on by default. Requires Agent Control and a supported provider.`]}),headerAction:(0,O.jsx)(h,{size:`sm`,variant:`outline`,children:`Beta`}),children:[(0,O.jsx)(S,{title:`Use by default`,description:`Start every new task with Computer Use available.`,control:(0,O.jsx)(_,{"aria-label":`Enable Computer by default`,disabled:o||!t,checked:t?.preferences.defaultEnabled??!1,onCheckedChange:e=>d({defaultEnabled:!!e})})}),(0,O.jsx)(S,{title:`Mac permissions`,description:`Grant access to this Ryco app in System Settings. Setup checks each grant again when you return, and never sends your prompt.`,control:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(r,{size:`xs`,variant:`outline`,disabled:o,onClick:()=>void u(()=>e.checkPermissions()),children:`Check permissions`}),(0,O.jsx)(r,{size:`xs`,disabled:o,onClick:()=>void u(()=>e.setup()),children:`Set up Computer`})]}),children:(0,O.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-3`,children:[[`Accessibility`,`accessibilityPermission`],[`Input Monitoring`,`inputMonitoringPermission`],[`Screen Recording`,`screenRecordingPermission`]].map(([e,n])=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-[min(var(--radius-md),0.5rem)] bg-muted/50 px-2.5 py-2 text-xs`,children:[(0,O.jsx)(`span`,{className:`truncate text-foreground`,children:e}),(0,O.jsx)(A,{status:t?.permissions[n],checked:t?.permissions[n]!==void 0})]},n))})}),(0,O.jsx)(S,{title:`Show preview automatically`,description:`Open a view-only preview while an agent works. It is never added to model context.`,control:(0,O.jsx)(_,{"aria-label":`Show preview automatically`,disabled:!t||o,checked:t?.preferences.autoPreview??!0,onCheckedChange:e=>d({autoPreview:!!e})})}),(0,O.jsx)(S,{title:`Preview size`,description:`How much room the live preview takes beside the conversation.`,control:(0,O.jsx)(C,{ariaLabel:`Preview size`,width:`sm`,value:t?.preferences.previewSize??`compact`,disabled:!t||o,onValueChange:e=>d({previewSize:e}),options:[{value:`compact`,label:`Compact`},{value:`large`,label:`Large`}]})}),(0,O.jsx)(S,{title:`Agent cursor color`,description:`The color of the agent's own cursor, so you can tell its actions from yours.`,children:(0,O.jsx)(f,{ariaLabel:`Agent cursor color`,value:t?.preferences.cursorColor??null,disabled:!t,swatches:j,defaultOption:{label:`Default cursor`},onChange:e=>d({cursorColor:e})})}),(0,O.jsx)(S,{title:`Recent actions`,description:`Bounded local activity history. Typed values and clipboard contents are omitted.`,status:c?.truncated?`Some older activity is no longer retained.`:void 0,control:(0,O.jsxs)(O.Fragment,{children:[c?.nextCursor?(0,O.jsx)(r,{size:`xs`,variant:`ghost`,onClick:()=>void e.getHistory({before:c.nextCursor}).then(l).catch(()=>a(`Could not load older actions.`)),children:`Older actions`}):null,(0,O.jsx)(r,{size:`xs`,variant:`outline`,onClick:()=>void e.getHistory().then(l).catch(()=>a(`Could not load recent actions.`)),children:c?`Refresh`:`Load recent actions`})]}),children:c?c.entries.length?(0,O.jsx)(`ul`,{className:`max-h-64 divide-y divide-border/60 overflow-y-auto rounded-[min(var(--radius-md),0.5rem)] bg-muted/40 text-xs`,children:c.entries.map(e=>(0,O.jsxs)(`li`,{className:`flex justify-between gap-4 px-3 py-2`,children:[(0,O.jsx)(`span`,{className:`truncate capitalize text-foreground`,children:e.tool.replaceAll(`_`,` `)}),(0,O.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[e.effect.replaceAll(`-`,` `),` · `,new Date(e.ts).toLocaleTimeString()]})]},e.id))}):(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No actions recorded.`}):null}),(0,O.jsx)(b,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Escape interrupts the current action and requires a fresh observation. Stop in chat ends the task. Your own input pauses foreground work.`}),i||t?.error?(0,O.jsx)(b,{children:(0,O.jsx)(v,{tone:`error`,role:`alert`,children:i??t?.error})}):null]})}var N=[{id:`ryco`,label:`Ryco Browser`},{id:`chrome`,label:`Google Chrome`},{id:`brave`,label:`Brave`},{id:`edge`,label:`Microsoft Edge`}];function P(){let e=window.desktopBridge?.computerUse,[i,a]=(0,E.useState)(null),[o,s]=(0,E.useState)(null),[c,l]=(0,E.useState)(!1),[u,f]=(0,E.useState)(``),[w,D]=(0,E.useState)(null),[k,j]=(0,E.useState)(null),[P,F]=(0,E.useState)(null),I=(0,E.useRef)(!1),{copyToClipboard:L,isCopied:R}=n({onError:()=>s(`Could not copy. Select the text and copy it manually.`)});if((0,E.useEffect)(()=>{if(!e)return;let t=!0,n=!1,r=async(r=!1)=>{if(!n&&t){n=!0;try{let n=await(r?e.checkPermissions():e.getState());t&&a(n)}catch{t&&s(`Computer-use settings could not be loaded.`)}finally{n=!1}}};r();let i=()=>{I.current&&r(!0)},o=()=>{document.visibilityState===`visible`&&i()};window.addEventListener(`focus`,i),document.addEventListener(`visibilitychange`,o);let c=e.onState(e=>{t&&a(e)});return()=>{t=!1,c(),window.removeEventListener(`focus`,i),document.removeEventListener(`visibilitychange`,o)}},[e]),!e)return null;let z=async e=>{l(!0),s(null);try{await e()}catch(e){s(e instanceof Error?e.message:`Computer-use request failed.`)}finally{l(!1)}},B=t=>{i&&z(async()=>{a(await e.setPolicy({...i.policy,...t})),t.enabled!==void 0&&(I.current=t.enabled,t.enabled&&a(await e.checkPermissions())),D(null)})},V=t=>{I.current=!0,z(()=>e.requestPermission(t))},H=new Map(Object.keys(i?.policy.apps??{}).map(e=>[e,{id:e,name:e.replaceAll(`\\`,`/`).split(`/`).pop()??e}]));for(let e of i?.apps??[])H.set(e.id,e);for(let e of N)H.set(`browser:${e.id}`,{id:`browser:${e.id}`,name:e.label});let U=i?.policy.enabled??!1,W=!!i?.permissionInfo?.checkedAt,G=i?[...H.values()].filter(e=>!u||e.name.toLowerCase().includes(u.toLowerCase())||i.policy.apps[e.id]!==void 0):[];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(M,{}),(0,O.jsxs)(y,{title:`Browser and app control`,description:`Let agents work in apps on this computer while you keep working. An independent Ryco cursor shows their actions. Native tools require Agent Control and a new provider session.`,children:[(0,O.jsx)(S,{title:`Enable on this computer`,description:U?`Stop any time with ⌘/Ctrl + Shift + Escape. A stopped turn must be restarted.`:`Off. Agents cannot inspect or operate apps or browsers through Ryco.`,control:(0,O.jsx)(_,{"aria-label":`Enable computer use on this computer`,checked:U,disabled:c||!i,onCheckedChange:e=>B({enabled:!!e})})}),o||i?.error?(0,O.jsx)(b,{children:(0,O.jsx)(v,{tone:`error`,role:`alert`,children:o??i?.error})}):null,i?.policy.enabled?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(S,{title:(0,O.jsxs)(`span`,{className:`flex items-center gap-2`,role:`status`,children:[(0,O.jsx)(T,{className:`size-3.5 text-muted-foreground`}),i.activity?`Working in ${i.activity.target} · ${i.activity.mode}`:`Waiting for an agent`]}),description:`Current activity on this computer.`,control:(0,O.jsxs)(r,{size:`xs`,variant:`outline`,onClick:()=>void z(()=>e.stop()),children:[(0,O.jsx)(p,{className:`size-3`}),`Stop all`]})}),(0,O.jsx)(S,{title:`Native permissions`,description:i.permissionInfo?.development?`Development build: grant permissions to ${i.permissionInfo.appName} in macOS Settings. If Screen Recording stays denied after granting it, restart this build.`:`Click a permission to request it. Access is checked again when you return from System Settings.`,status:i.permissionInfo?.error?(0,O.jsx)(`span`,{role:`alert`,className:`text-destructive-foreground`,children:i.permissionInfo.error}):void 0,control:(0,O.jsx)(r,{variant:`ghost`,size:`xs`,disabled:c,onClick:()=>void z(async()=>{I.current=!0,a(await e.checkPermissions())}),children:`Check permissions`}),children:(0,O.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[[`Accessibility`,`accessibility`],[`Screen recording`,`screenRecording`]].map(([e,t])=>(0,O.jsxs)(`button`,{type:`button`,disabled:c,onClick:()=>V(t),className:`flex items-center justify-between gap-2 rounded-[min(var(--radius-md),0.5rem)] bg-muted/50 px-2.5 py-2 text-left text-xs text-foreground outline-hidden transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60`,children:[e,` `,(0,O.jsx)(A,{status:i[t],checked:W})]},t))})}),(0,O.jsx)(S,{title:`Allow foreground takeover requests`,description:`Ask before taking over your mouse and keyboard when background control is unavailable.`,control:(0,O.jsx)(_,{"aria-label":`Allow foreground takeover requests`,checked:i.policy.foregroundEnabled,disabled:c,onCheckedChange:e=>B({foregroundEnabled:!!e})})})]}):null]}),(0,O.jsx)(y,{title:`Browser Use`,description:i?.policy.enabled?`Ryco Browser has a separate profile. Pair Chrome, Brave, or Edge to use your existing tabs and sign-ins.`:`Enable browser and app control above to configure Ryco Browser or pair Chrome, Brave, and Edge.`,headerAction:i?.policy.enabled?(0,O.jsxs)(r,{variant:`ghost`,size:`xs`,className:`text-muted-foreground hover:text-foreground`,onClick:()=>void z(async()=>{F(await e.showExtension())}),children:[(0,O.jsx)(d,{}),`Show browser extension folder`]}):null,bare:!i?.policy.enabled,children:i?.policy.enabled?(0,O.jsxs)(O.Fragment,{children:[N.map(t=>{let n=i.connectedBrowsers.includes(t.id);return(0,O.jsx)(S,{title:(0,O.jsxs)(`span`,{className:`flex items-center gap-2`,children:[t.label,(0,O.jsx)(h,{size:`sm`,variant:t.id===`ryco`?`outline`:n?`success`:`outline`,children:t.id===`ryco`?`Built in`:n?`Connected`:`Not connected`})]}),control:(0,O.jsxs)(O.Fragment,{children:[t.id!==`ryco`&&i.policy.browsers.includes(t.id)?(0,O.jsx)(r,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void z(async()=>{D(JSON.stringify(await e.pairBrowser(t.id))),j(t.id)}),children:`Pair`}):null,(0,O.jsx)(_,{"aria-label":`Enable ${t.label} control`,checked:i.policy.browsers.includes(t.id),disabled:c,onCheckedChange:e=>B({browsers:e?[...i.policy.browsers,t.id]:i.policy.browsers.filter(e=>e!==t.id)})})]})},t.id)}),w?(0,O.jsxs)(b,{className:`bg-muted/30`,children:[(0,O.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:`Connect your browser`}),(0,O.jsxs)(`ol`,{className:`mt-2 list-decimal space-y-1 pl-4 text-xs text-muted-foreground`,children:[(0,O.jsx)(`li`,{children:`Open Extensions, enable Developer mode, then choose Load unpacked.`}),(0,O.jsx)(`li`,{children:`Select the Ryco extension folder shown below. On macOS, paste its path with ⌘ + Shift + G in the folder chooser.`}),(0,O.jsx)(`li`,{children:`Open Ryco Browser Control in the browser toolbar and paste the pairing configuration.`})]}),(0,O.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[k?(0,O.jsx)(r,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void z(()=>e.openBrowserSetup(k)),children:`Open browser Extensions`}):null,(0,O.jsx)(r,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void z(async()=>{F(await e.showExtension())}),children:`Show extension folder`}),(0,O.jsx)(r,{size:`xs`,variant:`outline`,onClick:()=>L(w,void 0),children:`Copy pairing configuration`}),(0,O.jsx)(r,{size:`xs`,variant:`ghost`,onClick:()=>D(null),children:`Hide configuration`})]}),P?(0,O.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,O.jsx)(m,{size:`sm`,"aria-label":`Extension folder path`,readOnly:!0,value:P,className:`min-w-0 flex-1 font-mono text-xs`,onFocus:e=>e.currentTarget.select()}),(0,O.jsx)(r,{size:`xs`,variant:`ghost`,onClick:()=>L(P,void 0),children:`Copy folder path`})]}):null,(0,O.jsx)(g,{"aria-label":`Browser pairing configuration`,readOnly:!0,value:w,className:`mt-3 font-mono text-xs`,onFocus:e=>e.currentTarget.select()}),(0,O.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[R?(0,O.jsxs)(`span`,{role:`status`,className:`text-success-foreground`,children:[`Copied.`,` `]}):null,`Pairing replaces the previous connection. Pair again after restarting Ryco.`]})]}):null]}):null}),i?.policy.enabled?(0,O.jsxs)(y,{title:`App access`,description:`Apps ask on first use. Blocked apps cannot be inspected or controlled. Changing access stops current work.`,children:[(0,O.jsx)(b,{children:(0,O.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),z(async()=>{a(await e.refresh(u||void 0))})},children:[(0,O.jsx)(m,{size:`sm`,"aria-label":`Find installed apps`,placeholder:`Find installed apps…`,value:u,onChange:e=>f(e.target.value),className:`min-w-0 flex-1`}),(0,O.jsx)(r,{type:`submit`,variant:`outline`,size:`sm`,disabled:c,children:`Find apps`})]})}),(0,O.jsx)(b,{flush:!0,children:(0,O.jsx)(`ul`,{className:`max-h-80 divide-y divide-border/60 overflow-y-auto`,children:G.map(e=>(0,O.jsxs)(`li`,{className:t(`flex items-center justify-between gap-4 py-2.5`,x),children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`truncate text-[13px] text-foreground`,children:e.name}),(0,O.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,title:e.id,children:e.id})]}),(0,O.jsx)(C,{ariaLabel:`Access to ${e.name}`,width:`sm`,size:`sm`,disabled:c,value:i.policy.apps[e.id]??`ask`,onValueChange:t=>B({apps:{...i.policy.apps,[e.id]:t}}),options:[{value:`ask`,label:`Ask`},{value:`allow`,label:`Always allow`},{value:`block`,label:`Block`}]})]},e.id))})})]}):null]})}export{P as ComputerUseSettings};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,F as r,M as i,T as a,U as o,et as s,g as c,h as l,j as u,k as d,m as f,p,u as m}from"./primary-Cf-xJExj.js";import{Pi as h,Ro as g}from"./wsTransport-C88seBPA.js";import{$i as _,Bt as v,Gi as y,J as b,Kt as x,Oi as S,Ss as C,Td as w,U as T,Xi as E,Xu as D,Zi as O,ad as k,ai as A,ea as j,h as M,hs as N,l as P,m as F,n as I,oi as L,r as R,s as z,wr as B,ws as V}from"./runtime-DjjjAcTE.js";import{t as H}from"./react-CwJFpaho.js";import{A as U,D as ee,F as te,G as ne,M as re,N as ie,O as ae,P as oe,S as se,W,_ as ce,a as le,d as ue,f as de,j as fe,k as pe,l as me,m as he,p as ge,r as _e,t as ve}from"./popover-OWEv6cQz.js";import{i as ye}from"./presentationTier-DPVAxTK4.js";import{a as be,r as xe,t as Se}from"./tooltip-DbqhseXd.js";import{a as G,o as Ce,s as K}from"./SettingsPanels-CP6z2b1x.js";import{t as q}from"./arrow-up-right-BbPGFOLA.js";import{B as we}from"./workspaceLifecycle-OJ1aKksw.js";import{t as Te}from"./qr-code-DywzVgQC.js";import{t as Ee}from"./refresh-cw-CRUTivd6.js";import{n as De,r as J}from"./pairingUrl-Dn1e2CVw.js";import{t as Oe}from"./toastHelpers-CSQRKo4F.js";import{i as ke,t as Ae}from"./hostedPairing-5n5srRC9.js";import{n as je,o as Me,t as Ne}from"./desktopWorkspace-C2wXVBhc.js";import{t as Pe}from"./input-CCie4mm1.js";import{t as Fe}from"./scroll-area-80P7vbjw.js";import{c as Ie}from"./select-Cb9FUPHD.js";import{a as Le,i as Re,n as ze,o as Be,r as Ve,s as He,t as Ue}from"./alert-dialog-CgXR9tED.js";import{t as We}from"./spinner-lHRJWsym.js";import{t as Ge}from"./textarea-VyiIZ0wQ.js";import{t as Ke}from"./AnimatedHeight-epXOsgdm.js";import{t as qe}from"./switch-oQc7Ifbl.js";import{d as Je,l as Y,p as Ye,u as X}from"./settingsLayout-CRFNCk_D.js";import{n as Xe,t as Ze}from"./data-list-BAx6jBY1.js";import{i as Qe,n as $e,r as et,t as tt}from"./useDesktopRelaunchGuard-Jmh615iZ.js";import{n as nt,t as rt}from"./group-DWWn0dTx.js";import{t as it}from"./qr-code-BlbiBIwH.js";import{Ut as at}from"./main-Ch0bwS-M.js";var ot={name:`chevrons-left-right-ellipsis`,size:24,node:[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`m17 7 5 5-5 5`,key:`1xlxn0`}],[`path`,{d:`m7 7-5 5 5 5`,key:`19njba`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]};ot.node;var st=V(ot),Z=e(H(),1),ct=ye();function lt(e,t){let n=new URL(e);return n.pathname=`/pair`,J(n,t).toString()}function ut(e,t){return new URL(e).protocol===`https:`?Ae({host:e,token:t}):null}var dt=`/assets/relay-architecture-YeimmXuP.html`,Q=k();function ft(e,t){return e===null||t===null||!e.fileSecretStoreFallbackSupported?!1:t.enrolled===`none`||t.enrolled===`unknown`&&!e.allowFileSecretStore}function pt(e,t){return e===null||t===null?`Loading local launch configuration and identity state.`:e.fileSecretStoreFallbackSupported?t.enrolled===`active`||t.enrolled===`pending`?`Locked while this machine holds Hub identity material. Leave the Hub before changing it.`:t.enrolled===`unknown`?e.allowFileSecretStore?`Identity custody is unreadable, so an enabled fallback cannot be turned off.`:`Enable this only as a recovery action when an existing file-backed identity cannot be read.`:`Ryco still prefers the system credential store. This only permits the hardened POSIX file fallback when that store is unavailable.`:`Unavailable on Windows. Ryco requires the system credential store on this host.`}function mt(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KiB`}function $(e,t){if(e===null)return[{label:`Protocol`,value:`Loading`},{label:`Channels`,value:`Loading`},{label:`Relay queue`,value:`Loading`},{label:`Reconnect`,value:`Loading`}];let n=e.state===`online`&&e.protocolMajor!==void 0&&e.protocolMinor!==void 0?`${e.protocolMajor}.${e.protocolMinor}`:`Not negotiated`,r=e.nextRetryAt===void 0?e.reconnectAttempt===void 0?`Not scheduled`:`Attempt ${e.reconnectAttempt}`:`Attempt ${e.reconnectAttempt??0}, ${Math.max(0,Math.ceil((Date.parse(e.nextRetryAt)-t)/1e3))}s`;return[{label:`Protocol`,value:n},{label:`Channels`,value:String(e.activeChannels)},{label:`Relay queue`,value:mt(e.queuedBytes)},{label:`Reconnect`,value:r}]}function ht(e){let t=(0,ct.c)(84),{config:n,identity:r,status:i,nowMs:a,savingFileFallback:o,configError:s,onFileFallbackChange:c,onOpenGuide:l}=e,[u,d]=(0,Z.useState)(!1),f;t[0]!==n||t[1]!==r?(f=ft(n,r),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p=f,m,h,g,_,v,y,b,x,S,w,T,E,D,k,A,j;if(t[3]!==p||t[4]!==n||t[5]!==s||t[6]!==r||t[7]!==a||t[8]!==c||t[9]!==l||t[10]!==u||t[11]!==o||t[12]!==i){let e=$(i,a);g=G,y=u,b=d;let f=u?`Hide advanced options`:`Show advanced options`,M;t[29]===f?M=t[30]:(M=(0,Q.jsx)(`span`,{className:`block text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:f}),t[29]=f,t[30]=M);let N;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground/80`,children:`Key custody, startup ownership, CLI flags, and bounded relay diagnostics.`}),t[31]=N):N=t[31];let P;t[32]===s?P=t[33]:(P=s?(0,Q.jsx)(`span`,{className:`mt-1 block text-[11px] text-destructive`,children:s}):null,t[32]=s,t[33]=P);let F;t[34]!==M||t[35]!==P?(F=(0,Q.jsxs)(`span`,{children:[M,N,P]}),t[34]=M,t[35]=P,t[36]=F):F=t[36];let I=`size-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${u?`rotate-180`:``}`,L;t[37]===I?L=t[38]:(L=(0,Q.jsx)(C,{className:I,"aria-hidden":!0}),t[37]=I,t[38]=L),t[39]!==F||t[40]!==L?(x=(0,Q.jsxs)(K,{className:`group flex w-full items-center justify-between gap-4 border-t border-border/60 px-4 py-3.5 text-left transition-colors hover:bg-muted/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:px-5`,children:[F,L]}),t[39]=F,t[40]=L,t[41]=x):x=t[41],h=Ce,v=`motion-reduce:transition-none`,k=`border-t border-border/60 bg-muted/10`;let R;t[42]!==n||t[43]!==r?(R=pt(n,r),t[42]=n,t[43]=r,t[44]=R):R=t[44];let z=n?.allowFileSecretStore??!1,B=!p||o,V;t[45]===c?V=t[46]:(V=e=>c(!!e),t[45]=c,t[46]=V);let H;t[47]!==z||t[48]!==B||t[49]!==V?(H=(0,Q.jsx)(qe,{checked:z,disabled:B,onCheckedChange:V,"aria-label":`Allow permissioned-file Hub key storage`}),t[47]=z,t[48]=B,t[49]=V,t[50]=H):H=t[50],t[51]!==R||t[52]!==H?(A=(0,Q.jsx)(X,{title:`Protected key fallback`,description:R,status:`Changing this launch setting restarts Ryco. It never moves or exports an existing key.`,control:H}),t[51]=R,t[52]=H,t[53]=A):A=t[53],t[54]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(X,{title:`Who owns startup`,description:`The desktop app owns Hub launch values for its bundled server and restarts that server to apply them. Exported Hub environment variables do not override this panel.`,status:`The Hub address stays outside ordinary server settings, diagnostics, and support output.`}),t[54]=j):j=t[54],t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(X,{title:`CLI equivalents`,description:`Use these flags for a headless Ryco node. Explicit flags override matching environment variables.`,status:`Use RYCO_HUB_NODE_NAME instead of --hub-node-name when environment configuration is preferable. Boolean flags also support canonical --no-... forms.`,children:(0,Q.jsx)(`div`,{className:`pb-3.5 pt-3`,children:(0,Q.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border border-border/60 bg-background/70 px-3 py-2.5 font-mono text-[11px] leading-5 text-foreground`,children:(0,Q.jsx)(`code`,{children:`ryco serve \\
|
|
2
|
+
--hub-connector-enabled \\
|
|
3
|
+
--hub-origin https://app.ryco.space \\
|
|
4
|
+
--hub-node-name "Build node"
|
|
5
|
+
|
|
6
|
+
# Optional on supported POSIX hosts
|
|
7
|
+
ryco serve --hub-allow-file-secret-store`})})})}),t[55]=_):_=t[55],m=X,T=`Relay diagnostics`,E=`Bounded local counters only. No Hub address, key, ticket, project, path, or payload is exposed here.`;let U;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(q,{className:`size-3`}),t[56]=U):U=t[56],t[57]===l?D=t[58]:(D=(0,Q.jsxs)(O,{size:`xs`,variant:`outline`,onClick:l,children:[`Open relay guide`,U]}),t[57]=l,t[58]=D),S=`grid grid-cols-2 gap-x-6 gap-y-3 pb-3.5 pt-3 sm:grid-cols-4`,w=e.map(gt),t[3]=p,t[4]=n,t[5]=s,t[6]=r,t[7]=a,t[8]=c,t[9]=l,t[10]=u,t[11]=o,t[12]=i,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=k,t[27]=A,t[28]=j}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],w=t[22],T=t[23],E=t[24],D=t[25],k=t[26],A=t[27],j=t[28];let M;t[59]!==S||t[60]!==w?(M=(0,Q.jsx)(`dl`,{className:S,children:w}),t[59]=S,t[60]=w,t[61]=M):M=t[61];let N;t[62]!==m||t[63]!==M||t[64]!==T||t[65]!==E||t[66]!==D?(N=(0,Q.jsx)(m,{title:T,description:E,control:D,children:M}),t[62]=m,t[63]=M,t[64]=T,t[65]=E,t[66]=D,t[67]=N):N=t[67];let P;t[68]!==_||t[69]!==N||t[70]!==k||t[71]!==A||t[72]!==j?(P=(0,Q.jsxs)(`div`,{className:k,children:[A,j,_,N]}),t[68]=_,t[69]=N,t[70]=k,t[71]=A,t[72]=j,t[73]=P):P=t[73];let F;t[74]!==h||t[75]!==v||t[76]!==P?(F=(0,Q.jsx)(h,{className:v,children:P}),t[74]=h,t[75]=v,t[76]=P,t[77]=F):F=t[77];let I;return t[78]!==g||t[79]!==y||t[80]!==b||t[81]!==x||t[82]!==F?(I=(0,Q.jsxs)(g,{open:y,onOpenChange:b,children:[x,F]}),t[78]=g,t[79]=y,t[80]=b,t[81]=x,t[82]=F,t[83]=I):I=t[83],I}function gt(e){return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`dt`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground/65`,children:e.label}),(0,Q.jsx)(`dd`,{className:`mt-1 truncate font-mono text-[11px] text-foreground`,children:e.value})]},e.label)}var _t={configuration_invalid:{headline:`Hub configuration is invalid`,detail:`The address this backend started with was rejected. Check it and restart.`,action:`none`},identity_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The system keychain is locked or unavailable. Unlock it, then try again.`,action:`retry`},identity_store_unavailable:{headline:`Can't open a key store for this machine's Hub key`,detail:`No system credential store answered when Ryco started. Unlock or start it (on Linux, a Secret Service such as GNOME Keyring), or allow the permissioned-file fallback in advanced options, then restart Ryco.`,action:`restart`},identity_origin_mismatch:{headline:`Enrolled with a different Hub`,detail:`This machine's key belongs to another Hub. Leave that Hub to enrol here.`,action:`leave`},enrollment_unavailable:{headline:`Enrollment was denied`,detail:`Someone declined this request on the Hub. Check with them before trying again.`,action:`enroll`},enrollment_expired:{headline:`Enrollment expired`,detail:`The request timed out before it was approved.`,action:`enroll`},authentication_failed:{headline:`The Hub rejected this machine's key`,detail:`Check this node's status on the Hub. If it was removed there, leave and enrol again.`,action:`retry`},connection_replaced:{headline:`Another process connected as this machine`,detail:`Two copies of Ryco can't share one Hub identity. Stop the other one, then retry.`,action:`retry`},protocol_invalid:{headline:`The Hub connection kept failing`,detail:`Ryco stopped retrying after repeated protocol errors. Update Ryco and the Hub.`,action:`retry`},network_unavailable:{headline:`Can't reach the Hub`,detail:null,action:`none`},tls_unavailable:{headline:`Can't reach the Hub securely`,detail:null,action:`none`},authentication_timeout:{headline:`The Hub didn't respond`,detail:null,action:`none`},server_draining:{headline:`The Hub is restarting`,detail:null,action:`none`},rate_limited:{headline:`The Hub is rate limiting`,detail:null,action:`none`},heartbeat_timeout:{headline:`The Hub stopped responding`,detail:null,action:`none`},slow_consumer:{headline:`The connection fell behind`,detail:null,action:`none`},internal_error:{headline:`The Hub connection failed`,detail:null,action:`none`}},vt={identity_unavailable:{hint:`Unlock the system keychain to reconnect sooner.`,secondaryAction:`none`},connection_replaced:{hint:`Another copy of Ryco is using this machine's Hub identity. Stop it to connect here.`,secondaryAction:`none`},authentication_failed:{hint:`If this machine was removed on the Hub, leave and enrol again.`,secondaryAction:`leave`}},yt=(e,t)=>{let n=new Date(e).getTime()-t;if(Number.isNaN(n))return null;if(n<=0)return`now`;let r=Math.ceil(n/1e3);return r<60?`${r}s`:`${Math.ceil(r/60)}m`};function bt(e,t,n){switch(e.state){case`disabled`:return t.enrolled===`none`?{dot:`idle`,ping:!1,headline:`Not connected`,detail:null,action:`enable`,secondaryAction:`none`,retrying:!1}:{dot:`idle`,ping:!1,headline:`Turned off`,detail:`This machine stays enrolled.`,action:`enable`,secondaryAction:`leave`,retrying:!1};case`enrolling`:return{dot:`warning`,ping:!1,headline:`Ready to enrol`,detail:`Start enrollment, then approve this machine on your Hub.`,action:`enroll`,secondaryAction:`disable`,retrying:!1};case`awaiting_approval`:return{dot:`warning`,ping:!0,headline:`Waiting for approval on the Hub`,detail:`Compare every field below before approving.`,action:`open-hub`,secondaryAction:`cancel-enrollment`,retrying:!1};case`connecting`:return{dot:`warning`,ping:!0,headline:`Connecting`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`authenticating`:return{dot:`warning`,ping:!0,headline:`Authenticating`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`online`:return{dot:`success`,ping:!0,headline:`Connected`,detail:e.activeChannels===1?`1 active session`:`${e.activeChannels} active sessions`,action:`disable`,secondaryAction:`none`,retrying:!1};case`degraded`:{if(e.degradedMode===`backing_off`){let t=e.nextRetryAt===void 0?null:yt(e.nextRetryAt,n),r=e.failure===void 0?void 0:vt[e.failure];if(e.failure!==void 0&&r!==void 0)return{dot:`warning`,ping:!0,headline:_t[e.failure].headline,detail:`${t===null?`Retrying automatically.`:t===`now`?`Retrying now.`:`Retrying automatically in ${t}.`} ${r.hint}`,action:`retry`,secondaryAction:r.secondaryAction,retrying:!0};let i=e.reconnectAttempt;return{dot:`warning`,ping:!0,headline:`Reconnecting`,detail:[t===null?null:t===`now`?`Retrying now`:`Next attempt in ${t}`,i===void 0||i===0?null:`attempt ${i}`].filter(e=>e!==null).join(` · `),action:`none`,secondaryAction:`none`,retrying:!0}}let t=_t[e.failure??`internal_error`];return{dot:`destructive`,ping:!1,headline:t.headline,detail:t.detail,action:t.action,secondaryAction:t.action===`leave`?`none`:`leave`,retrying:!1}}case`revoked`:return{dot:`destructive`,ping:!1,headline:`Revoked at the Hub`,detail:`This will not retry. Leaving erases this machine's key so you can enrol again.`,action:`leave`,secondaryAction:`open-hub`,retrying:!1};case`version_incompatible`:return{dot:`destructive`,ping:!1,headline:`Incompatible Hub version`,detail:`This will not retry. Update Ryco, or the Hub, so both speak the same protocol.`,action:`none`,secondaryAction:`none`,retrying:!1};case`stopping`:return{dot:`idle`,ping:!1,headline:`Shutting down`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1}}}function xt(e){return e.enrolled===`none`}function St(e){let{config:t}=e,n=t!==null&&t.origin!==null&&t.hostedIdentitySupported===!0&&e.bridgeOffersAccountSetup,r=n&&e.identity?.enrolled===`none`;return{path:n?`native-account`:`device-code`,showAccountRow:n,automaticNativeSetup:r,automaticNativeSetupWaiting:r&&(e.action===`enable`||e.action===`enroll`)}}function Ct(e){return e.automaticNativeSetupWaiting||e.restartRequired&&e.action===`enroll`?`none`:e.action}var wt=`ryco:hub-enroll-after-enable`;function Tt(e,t){try{e?.setItem(wt,String(t))}catch{}}function Et(e){try{e?.removeItem(wt)}catch{}}function Dt(e,t){let n;try{n=e?.getItem(wt)??null}catch{return!1}if(n===null)return!1;Et(e);let r=Number(n);return Number.isFinite(r)&&r<=t&&t-r<=6e5}var Ot=5e3,kt=15e3,At={enable:`Enable`,disable:`Turn off`,enroll:`Start enrollment`,"cancel-enrollment":`Cancel`,"open-hub":`Open Hub`,retry:`Retry now`,leave:`Leave this Hub`,restart:`Restart Ryco`},jt=1e4;function Mt(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function Nt({desktopBridge:e}){let t=Ye(1e3),n=Me(),[i,o]=(0,Z.useState)(null),[s,u]=(0,Z.useState)(null),p=(0,Z.useRef)(new Map),g=b(e=>e.closeSettings),[_,v]=(0,Z.useState)(null),[y,C]=(0,Z.useState)(``),[w,T]=(0,Z.useState)(null),[D,k]=(0,Z.useState)(``),[A,j]=(0,Z.useState)(null),[M,P]=(0,Z.useState)(null),[F,I]=(0,Z.useState)(``),[L,R]=(0,Z.useState)(null),[z,V]=(0,Z.useState)(!1),[H,U]=(0,Z.useState)(null),[ee,te]=(0,Z.useState)(null),[ne,re]=(0,Z.useState)(null),[ie,ae]=(0,Z.useState)(!1),[oe,se]=(0,Z.useState)(!1),[W,ce]=(0,Z.useState)(null),[le,ue]=(0,Z.useState)(!1),[de,fe]=(0,Z.useState)(null),[pe,me]=(0,Z.useState)(!1),[he,ge]=(0,Z.useState)(null),[_e,ve]=(0,Z.useState)(!1),[ye,be]=(0,Z.useState)(null),[xe,Se]=(0,Z.useState)(``),G=(0,Z.useRef)(!0),Ce=(0,Z.useRef)(null),{guardRelaunch:K,dialog:q}=Qe(),{copyToClipboard:we}=E(),Te=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;(0,Z.useEffect)(()=>(G.current=!0,()=>{G.current=!1}),[]);let Ee=(0,Z.useCallback)(async()=>{try{let[e,t]=await Promise.all([c(),l()]),n=e.state===`awaiting_approval`?await f():null;if(!G.current)return;o({status:e,identity:t,enrollment:n,readAt:Date.now()}),U(null)}catch(e){if(!G.current)return;U(e instanceof Error?e.message:`Unable to read Hub status.`)}},[]);(0,Z.useEffect)(()=>{let e=x({lifecycle:S,run:Ee,resolveDelayMs:()=>Ot,jitterRatio:.1});return Ce.current=e,()=>{Ce.current===e&&(Ce.current=null),e.stop()}},[Ee]);let De=(0,Z.useCallback)(()=>Ce.current?.refresh()??Ee(),[Ee]),J=(0,Z.useCallback)(async()=>{if(e)try{let t=await e.getHubLaunchConfig();G.current&&T(t)}catch{}},[e]);(0,Z.useEffect)(()=>{e&&e.getHubLaunchConfig().then(e=>{G.current&&(T(e),k(e.origin??``),I(e.nodeName??``),te(null))}).catch(e=>{G.current&&te(e instanceof Error?e.message:`Unable to read Hub launch configuration.`)})},[e]),(0,Z.useEffect)(()=>()=>{for(let e of p.current.values())e();p.current.clear()},[]),(0,Z.useEffect)(()=>{e?.getHostedIdentityState&&e.getHostedIdentityState().then(e=>{G.current&&(ce(e),fe(null))}).catch(()=>{G.current&&(ce({status:`unavailable`}),fe(`Unable to read the native account setup state.`))})},[e]);let Oe=(0,Z.useCallback)(async t=>{let n=t===`connect`?e?.connectHostedIdentity:e?.disconnectHostedIdentity;if(n){ue(!0),fe(null);try{let r=await n();if(!G.current)return;if(ce(r),t===`connect`&&e){let t=await $e({bridge:e,guardRelaunch:K});t!==null&&G.current&&T(t)}}catch{if(!G.current)return;ce({status:`unavailable`}),fe(t===`connect`?`Automatic secure setup did not finish. Retry when the Hub is reachable.`:`Unable to clear the native account session.`)}finally{G.current&&ue(!1)}}},[e,K]),ke=(0,Z.useCallback)(async()=>{if(e?.refreshDesktopWorkspaceCatalog){u(null);try{await e.refreshDesktopWorkspaceCatalog()}catch{u(`Unable to refresh this account's machine directory.`)}}},[e]);(0,Z.useEffect)(()=>{W?.status===`ready`&&ke()},[W?.status,ke]);let Ae=(0,Z.useCallback)(e=>{p.current.has(e)||p.current.set(e,Ne(e))},[]),Fe=(0,Z.useCallback)(e=>{p.current.get(e)?.(),p.current.delete(e)},[]),Ie=(0,Z.useCallback)(e=>{Ae(e),B.getState().setActiveEnvironmentId(e),g()},[g,Ae]),We=(0,Z.useCallback)(async()=>{if(e?.verifyDesktopWorkspaceApproval&&_){u(null);try{await e.verifyDesktopWorkspaceApproval({nodeId:_.nodeId,environmentId:h.make(_.environmentId),payload:y.trim()});let t=je(h.make(_.environmentId));globalThis.setTimeout(t,jt),await e.cancelDesktopWorkspaceVerification?.(_.handle).catch(()=>void 0),v(null),C(``)}catch{u(`That approval code does not match this Desktop client, machine, account, or current node security state.`)}}},[e,y,_]),Ge=(0,Z.useCallback)(async t=>{if(e?.beginDesktopWorkspaceVerification){u(null);try{_&&await e.cancelDesktopWorkspaceVerification?.(_.handle).catch(()=>void 0);let n=await e.beginDesktopWorkspaceVerification({nodeId:t.nodeId,environmentId:h.make(t.environmentId)});v({...t,handle:n.handle}),C(``)}catch{u(`Unable to introduce this Desktop client to that machine. Confirm it is online and retry.`)}}},[e,_]),qe=(0,Z.useCallback)(async(t,n)=>{let r=t===`connect`?e?.connectHostedGitHub:e?.disconnectHostedGitHub;if(r){me(!0),ge(null);try{let e=await r(n?{totpCode:n}:void 0);if(!G.current)return;ce(e.state),e.outcome===`step-up-required`?(be(t),Se(``)):(be(null),Se(``),ve(!1),e.outcome===`last-primary-credential`?ge(`Add another primary sign-in method before disconnecting GitHub.`):e.outcome===`unavailable`&&ge(`GitHub account access is temporarily unavailable.`))}catch{G.current&&ge(`GitHub account access is temporarily unavailable.`)}finally{G.current&&me(!1)}}},[e]),Y=i===null?null:bt(i.status,i.identity,t),nt=St({config:w,bridgeOffersAccountSetup:e?.getHostedIdentityState!==void 0&&e.connectHostedIdentity!==void 0,identity:i?.identity??null,action:Y?.action??null}),rt=nt.path===`device-code`&&i?.identity.enrolled===`none`,it=(0,Z.useCallback)(async t=>{re(t),U(null);try{switch(t){case`enroll`:w?.enabled!==!0&&e&&(await e.setHubLaunchConfig({enabled:!0,applyOnNextLaunch:!0}).catch(()=>{throw Error(`Ryco couldn't save the Hub connection setting, so enrollment didn't start.`)}),G.current&&T(e=>e===null?null:{...e,enabled:!0})),await r();break;case`cancel-enrollment`:Et(Mt()),await m();break;case`retry`:await d();break;case`leave`:await a();break;case`enable`:case`disable`:{if(!e)return;let n=tt(e,{enabled:t===`enable`}),r=await K(async e=>{t===`enable`&&rt?Tt(Mt(),Date.now()):Et(Mt()),await n(e)});(r===`scheduled`||r===`applied`)&&await J();return}case`restart`:{let t=e?.restartApp;if(!t)throw Error(`Desktop restart is unavailable.`);await K(et(t));return}case`open-hub`:{let e=w?.origin;e&&window.open(e,`_blank`,`noopener,noreferrer`);return}default:return}await De()}catch(e){if(!G.current)return;U(e instanceof Error?e.message:`That didn't work.`)}finally{G.current&&re(null)}},[w,e,rt,K,De,J]),at=i?.status.state,ot=w?.restartRequired===!0;(0,Z.useEffect)(()=>{at===`enrolling`&&rt&&ne===null&&(ot||Dt(Mt(),Date.now())&&it(`enroll`))},[at,rt,ne,ot,it]);let st=(0,Z.useCallback)(async()=>{if(!e||D.trim()===``){j(null),P(null);return}let t=await e.validateHubOrigin(D);if(G.current){if(t.ok){k(t.origin),j(null),P(null);return}P(t.suggestion??null),j({empty:`Enter a Hub address.`,too_long:`That address is too long.`,not_a_url:`That doesn't look like an address.`,insecure_scheme:`A Hub address must use https.`,has_credentials:`Remove the username and password from the address.`,has_path:`Use the Hub's address only, without a path.`,invalid:`That address can't be used.`}[t.reason])}},[e,D]),ct=(0,Z.useCallback)(async t=>{if(e){re(`enable`);try{let n=await K(tt(e,{origin:t}));(n===`scheduled`||n===`applied`)&&await J(),n!==`relaunched`&&G.current&&re(null)}catch(e){if(!G.current)return;U(e instanceof Error?e.message:`Unable to save the Hub address.`),re(null)}}},[e,K,J]),lt=(0,Z.useCallback)(e=>{I(e),R(e.trim().length>100?`Use 100 characters or fewer.`:null)},[]),ut=(0,Z.useCallback)(async()=>{if(!e)return;let t=F.trim();if(t.length>100){R(`Use 100 characters or fewer.`);return}V(!0),R(null);try{let n=await K(tt(e,{nodeName:t===``?null:t}));(n===`scheduled`||n===`applied`)&&await J(),n!==`relaunched`&&G.current&&V(!1)}catch(e){if(!G.current)return;R(e instanceof Error?e.message:`Unable to save the Hub node name.`),V(!1)}},[e,K,F,J]),ft=(0,Z.useCallback)(async t=>{if(e&&await e.confirm(t?`Allow permissioned-file storage when the system credential store is unavailable? Ryco will restart. Existing keys are not moved.`:`Stop allowing permissioned-file Hub key storage? Ryco will restart.`)&&G.current){ae(!0),te(null);try{let n=await K(tt(e,{allowFileSecretStore:t}));(n===`scheduled`||n===`applied`)&&await J(),n!==`relaunched`&&G.current&&ae(!1)}catch(e){if(!G.current)return;te(e instanceof Error?e.message:`Unable to save the key storage setting.`),ae(!1)}}},[e,K,J]),pt=(0,Z.useCallback)(async()=>{if(e)try{let t=new URL(dt,window.location.href).toString();if(!await e.openExternal(t))throw Error(`The relay guide could not be opened.`);te(null)}catch(e){if(!G.current)return;te(e instanceof Error?e.message:`Unable to open the relay guide.`)}},[e]);if(!e)return null;let mt=i!==null&&t-i.readAt>kt,$=i!==null&&xt(i.identity),gt=D.trim()!==(w?.origin??``),_t=F.trim()!==(w?.nodeName??``),vt=nt.automaticNativeSetupWaiting,yt=(e,t)=>e===`none`?null:(0,Q.jsx)(O,{size:`xs`,variant:t,disabled:ne!==null,onClick:()=>{if(e===`leave`){se(!0);return}it(e)},children:ne===e?`Working…`:At[e]});return(0,Q.jsxs)(Je,{title:`Hub`,children:[(0,Q.jsx)(X,{title:`Connection`,description:vt?`Connect your Ryco account below. Ryco will register this computer with this Hub automatically.`:Y===null?`Loading…`:Y.detail===null?`Reach this computer from anywhere, including behind NAT or CGNAT, without opening a port.`:Y.detail,status:(0,Q.jsxs)(Q.Fragment,{children:[Y===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${mt?`bg-muted-foreground/40`:Y.dot===`success`?`bg-success`:Y.dot===`warning`?`bg-warning`:Y.dot===`destructive`?`bg-destructive`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),mt?`${Y.headline} · last checked ${Math.round((t-i.readAt)/1e3)}s ago`:vt?`Ready for account setup`:Y.headline]}),H?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:H}):null,ot?(0,Q.jsx)(`span`,{className:`block text-warning`,children:`Saved Hub settings apply after Ryco restarts.`}):null]}),control:Y===null?null:(0,Q.jsxs)(Q.Fragment,{children:[ot&&Y.action!==`restart`?yt(`restart`,`outline`):null,yt(Ct({action:Y.action,automaticNativeSetupWaiting:vt,restartRequired:ot}),Y.action===`leave`?`destructive-outline`:`outline`),yt(Ct({action:Y.secondaryAction,automaticNativeSetupWaiting:vt,restartRequired:ot}),Y.secondaryAction===`leave`?`destructive-outline`:`outline`)]}),children:(0,Q.jsx)(Ke,{children:i?.enrollment?(0,Q.jsxs)(`div`,{className:`pb-3.5`,children:[(0,Q.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground/80`,children:`Compare every field with the Hub's approval screen before approving.`}),(0,Q.jsxs)(Ze,{className:`rounded-[min(var(--radius-lg),0.625rem)] bg-muted/40 p-3`,children:[(0,Q.jsx)(Xe,{term:`Label`,children:i.enrollment.label}),(0,Q.jsx)(Xe,{term:`Platform`,children:`${i.enrollment.platformOs} · ${i.enrollment.platformArch}`}),(0,Q.jsx)(Xe,{term:`Version`,mono:!0,children:i.enrollment.clientVersion}),(0,Q.jsx)(Xe,{term:`Algorithm`,children:i.enrollment.algorithm}),(0,Q.jsx)(Xe,{term:`Fingerprint`,mono:!0,children:i.enrollment.fingerprint}),(0,Q.jsx)(Xe,{term:`Expires`,children:new Date(i.enrollment.expiresAt).toLocaleString()}),(0,Q.jsx)(Xe,{term:`Device code`,mono:!0,action:Te?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>we(i.enrollment.deviceCode),children:`Copy`}):null,children:i.enrollment.deviceCode})]}),(0,Q.jsx)(`p`,{className:`pt-2 text-xs text-muted-foreground/80`,children:w?.origin&&!ot?`Approve it at ${w.origin}: open your machines, choose Enroll node, and enter the device code.`:`Approve it on your Hub: open your machines, choose Enroll node, and enter the device code.`}),(0,Q.jsx)(`p`,{className:`pt-2 text-[11px] text-muted-foreground/70`,children:`The device code only routes the request. It does not prove which machine you are approving.`}),(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 pt-2 text-xs text-warning`,children:[(0,Q.jsx)(N,{className:`size-3.5 shrink-0`}),`If the fingerprint on the Hub differs by even one character, deny it there and cancel here.`]})]}):null})}),nt.showAccountRow?(0,Q.jsx)(X,{title:`Ryco account`,description:W===null?`Checking this Mac's native account setup…`:vt&&W.status===`ready`?`You are signed in. Finish setup to register this Mac with the Hub and verify local trust automatically.`:W.status===`ready`?`You are signed in. Ryco chooses this device's secure connection automatically; this Mac's node status is shown above.`:W.status===`signed-out`?`Sign in in your browser. Ryco will claim this Mac's node and verify its local trust automatically.`:`Automatic secure setup did not finish. Existing node and trust state are preserved while you retry.`,status:(0,Q.jsxs)(Q.Fragment,{children:[W===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${vt&&W.status===`ready`?`bg-warning`:W.status===`ready`?`bg-success`:W.status===`unavailable`?`bg-warning`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),W.status===`ready`?vt?`Signed in · Node setup needed`:`Secure setup complete`:W.status===`unavailable`?`Setup needs attention`:`Not signed in`]}),de?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:de}):null]}),control:W===null?null:vt&&W.status===`ready`?(0,Q.jsx)(O,{size:`xs`,disabled:le||!e.connectHostedIdentity,onClick:()=>void Oe(`connect`),children:le?`Finishing setup…`:`Finish setup`}):W.status===`ready`?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:le||!e.disconnectHostedIdentity,onClick:()=>void Oe(`disconnect`),children:le?`Working…`:`Sign out`}):(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:le||!e.connectHostedIdentity,onClick:()=>void Oe(`connect`),children:le?`Opening browser…`:W.status===`unavailable`?`Retry secure setup`:`Connect account`})}):null,W?.status===`ready`&&e?.getDesktopWorkspaceState?(0,Q.jsxs)(X,{title:`Workspace machines`,description:`Connect, open, and manage each machine independently. Cached lists remain read-only until connected.`,status:s??`${n.machines.filter(e=>e.online).length} online · ${n.activeConnectionCount} connected`,control:(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>void ke(),children:`Refresh`}),children:[(0,Q.jsx)(Ze,{children:n.machines.map(e=>(0,Q.jsx)(Xe,{term:e.label,action:(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:[e.nodeId&&e.online&&(e.nativeTrust===`unverified`||e.nativeTrust===`unknown`||e.nativeTrust===`account-trusted`)?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>{Ge({nodeId:e.nodeId,environmentId:e.environmentId})},children:e.nativeTrust===`account-trusted`?`Verify independently`:`Verify`}):null,(e.nativeTrust===`verified`||e.nativeTrust===`account-trusted`)&&e.online?e.connectionState===`connected`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>Ie(e.environmentId),children:`Open`}),(0,Q.jsx)(O,{size:`xs`,variant:`ghost`,onClick:()=>Fe(e.environmentId),children:`Disconnect`})]}):(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>Ae(e.environmentId),children:`Connect`}):null]}),children:e.nativeTrust===`verified`?e.online?`Encrypted · Verified locally · ${e.connectionState===`connected`?`Connected`:`Online`}`:`Encrypted · Verified locally · Offline`:e.nativeTrust===`account-trusted`?e.online?`Encrypted · Account trusted · ${e.connectionState===`connected`?`Connected`:`Online`}`:`Encrypted · Account trusted · Offline`:e.nativeTrust===`identity-conflict`?`Identity changed · Locked`:e.online?`Needs verification`:`Needs verification · Offline`},`${e.nodeId??`unknown`}:${e.environmentId}`))}),_?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 border-t border-border/60 py-3 sm:flex-row`,children:[(0,Q.jsx)(Pe,{value:y,onChange:e=>C(e.target.value),placeholder:`Paste the approval code shown by this exact node`,"aria-label":`Machine approval code`}),(0,Q.jsx)(O,{size:`sm`,disabled:y.trim().length===0,onClick:()=>void We(),children:`Verify`}),(0,Q.jsx)(O,{size:`sm`,variant:`ghost`,onClick:()=>{e.cancelDesktopWorkspaceVerification?.(_.handle).catch(()=>void 0),v(null),C(``)},children:`Cancel`})]}):null]}):null,W?.status===`ready`&&W.github!==void 0?(0,Q.jsx)(X,{title:W.github.identity?`GitHub · @${W.github.identity.login}`:`GitHub`,description:W.github.identity?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,status:he?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:he}):W.github.identity?.displayName?W.github.identity.displayName:null,control:W.github.linkAvailable?W.github.identity?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:pe||!e?.disconnectHostedGitHub,onClick:()=>ve(!0),children:pe?`Working…`:`Disconnect`}):(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:pe||!e?.connectHostedGitHub,onClick:()=>void qe(`connect`),children:pe?`Opening browser…`:`Connect GitHub`}):null}):null,(0,Q.jsx)(X,{title:`Hub address`,description:$?`The address of the Hub you or your team operate.`:`Locked while this machine is enrolled. Leave this Hub to change it.`,status:A?(0,Q.jsxs)(`span`,{className:`block text-destructive`,children:[A,M?(0,Q.jsxs)(`button`,{type:`button`,className:`ml-1 break-all rounded-sm underline underline-offset-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>{k(M),j(null),P(null)},children:[`Use `,M]}):null]}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pe,{value:D,disabled:!$||ne!==null,placeholder:`https://…`,className:`w-64 font-mono text-xs`,onChange:e=>k(e.currentTarget.value),onBlur:()=>void st()}),$&>&&A===null&&D.trim()!==``?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:ne!==null,onClick:()=>void ct(D.trim()),children:`Save and restart`}):null]})}),(0,Q.jsx)(X,{title:`Device name`,description:$?`Choose the name proposed on the Hub approval screen. Leave it blank for a stable automatic name.`:i?.identity.enrolled===`pending`?`Locked while enrollment is pending. Cancel enrollment to change the proposed name.`:`After enrollment, rename the device in Device settings or its Hub details. The name is shared across your apps.`,status:L?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:L}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pe,{value:F,disabled:!$||ne!==null||z,placeholder:`Automatic: machine name · node code`,"aria-label":`Hub node name`,className:`w-64 text-xs`,onChange:e=>lt(e.currentTarget.value)}),$&&_t&&L===null?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:ne!==null||z,onClick:()=>void ut(),children:z?`Saving…`:`Save and restart`}):null]})}),i!==null&&i.status.state===`online`?(0,Q.jsx)(X,{title:`Who can connect`,description:`Managed on the Hub, not here. Sessions arriving through the Hub carry a role: viewer reads, operator edits files and runs terminals, owner also changes credentials and server policy.`}):null,(0,Q.jsx)(ht,{config:w,identity:i?.identity??null,status:i?.status??null,nowMs:t,savingFileFallback:ie||ne!==null,configError:ee,onFileFallbackChange:e=>void ft(e),onOpenGuide:()=>void pt()}),q,(0,Q.jsx)(Ue,{open:oe,onOpenChange:se,children:(0,Q.jsxs)(Be,{children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(He,{children:`Leave this Hub?`}),(0,Q.jsxs)(Ve,{children:[`This erases this machine's Hub key. You can enrol again afterwards, but it will join as a new machine and needs a new approval.`,(0,Q.jsx)(`br`,{}),(0,Q.jsx)(`br`,{}),`It does `,(0,Q.jsx)(`strong`,{children:`not`}),` revoke anything on the Hub. The old entry stays there until an owner removes it.`]})]}),(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ze,{render:(0,Q.jsx)(O,{variant:`outline`}),children:`Keep it`}),(0,Q.jsx)(O,{variant:`destructive`,disabled:ne!==null,onClick:()=>{se(!1),it(`leave`)},children:`Erase this machine's key`})]})]})}),(0,Q.jsx)(Ue,{open:_e,onOpenChange:ve,children:(0,Q.jsxs)(Be,{children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(He,{children:`Disconnect GitHub?`}),(0,Q.jsx)(Ve,{children:`GitHub stops working as a Ryco sign-in method. Ryco refuses this change when it is your only primary sign-in method. Repository access is separate.`})]}),(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ze,{render:(0,Q.jsx)(O,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(O,{variant:`destructive`,disabled:pe,onClick:()=>void qe(`disconnect`),children:`Disconnect GitHub`})]})]})}),(0,Q.jsx)(Ue,{open:ye!==null,onOpenChange:t=>{!t&&!pe&&(ye===`connect`&&e?.cancelHostedGitHubConnection?.(),be(null),Se(``))},children:(0,Q.jsxs)(Be,{children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(He,{children:`Confirm this account change`}),(0,Q.jsx)(Ve,{children:`Enter a current code from your authenticator app. The pending GitHub authorization is reused; Ryco does not reopen the browser.`})]}),(0,Q.jsx)(`div`,{className:`px-6 pb-4`,children:(0,Q.jsx)(Pe,{"aria-label":`Authenticator code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,value:xe,onChange:e=>Se(e.currentTarget.value.replace(/\D/gu,``))})}),(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ze,{render:(0,Q.jsx)(O,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(O,{disabled:pe||xe.length<6,onClick:()=>{ye!==null&&qe(ye,xe)},children:`Confirm`})]})]})})]})}function Pt(e){return j(e)?`this Mac`:`this computer`}function Ft(e,t){return e===null?`Loading…`:e.enabled?e.reachable?e.onBattery?`Paused on battery power. Ryco keeps ${t} awake again when it is plugged in.`:e.active?`Ryco keeps ${t} awake so other devices can reach it. The display can still sleep.`:`Ryco keeps ${t} awake while it is plugged in and reachable.`:`Turns on once other devices can reach ${t} through the Hub, the network, or Tailscale.`:`${It(t)} may sleep when idle. Devices that reach it lose access until it wakes.`}function It(e){return e.length===0?e:`${e[0].toUpperCase()}${e.slice(1)}`}var Lt=15e3;function Rt({desktopBridge:e}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),s=(0,Z.useRef)(!0),c=Pt(typeof navigator>`u`?``:navigator.platform);(0,Z.useEffect)(()=>{s.current=!0;let t=e.getKeepAwakeState;if(!t)return;let r=x({lifecycle:S,run:async()=>{let e=await t();s.current&&n(e)},resolveDelayMs:()=>Lt});return()=>{s.current=!1,r.stop()}},[e]);let l=(0,Z.useCallback)(async t=>{let r=e.setKeepAwakeEnabled;if(r){i(!0),o(null);try{let e=await r(t);s.current&&n(e)}catch{s.current&&o(`Unable to change this setting.`)}finally{s.current&&i(!1)}}},[e]);return!e.getKeepAwakeState||!e.setKeepAwakeEnabled?null:(0,Q.jsx)(X,{title:`Keep ${c} awake while plugged in`,description:Ft(t,c),status:a?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:a}):null,control:(0,Q.jsx)(qe,{checked:t?.enabled??!0,disabled:t===null||r,onCheckedChange:e=>void l(!!e),"aria-label":`Keep ${c} awake while plugged in`})})}var zt=864e5;function Bt(e,t){return e?.authState===`requires-auth`&&!t.desktopSsh}function Vt(e){let t=new URL(e.httpBaseUrl);return t.pathname===`/`&&t.search===``&&t.hash===``?t.origin:e.httpBaseUrl}function Ht(e){return e.isConnected?e.isDisconnecting?`Disconnecting…`:`Disconnect`:e.isConnecting?`Connecting…`:e.needsRepair?`Retry`:`Connect`}function Ut(e){let t=Math.round((e===`browser`?Math.min(w,s):s)/zt);return`The pairing code is not kept; ${e===`browser`?`this browser`:`this app`} stores a session token that renews itself while in use. Pair again after ${t} days without use, or one year after pairing.`}var Wt=443,Gt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Kt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:Gt.format(t)}function qt(e){let t=(0,ct.c)(21),{tooltipText:n,dotClassName:r,pingClassName:i}=e,a;t[0]===i?a=t[1]:(a=i?(0,Q.jsx)(`span`,{className:_(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,i)}):null,t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=_(`relative inline-flex size-2 rounded-full`,r),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,Q.jsx)(`span`,{className:o}),t[4]=o,t[5]=s);let c;t[6]!==a||t[7]!==s?(c=(0,Q.jsxs)(Q.Fragment,{children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8];let l=c;if(!n){let e;return t[9]===l?e=t[10]:(e=(0,Q.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:l}),t[9]=l,t[10]=e),e}let u;t[11]!==l||t[12]!==n?(u=(0,Q.jsx)(`button`,{type:`button`,title:n,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:l}),t[11]=l,t[12]=n,t[13]=u):u=t[13];let d=u,f;t[14]===d?f=t[15]:(f=(0,Q.jsx)(be,{render:d}),t[14]=d,t[15]=f);let p;t[16]===n?p=t[17]:(p=(0,Q.jsx)(xe,{side:`top`,className:`max-w-80 whitespace-pre-wrap leading-tight`,children:n}),t[16]=n,t[17]=p);let m;return t[18]!==f||t[19]!==p?(m=(0,Q.jsxs)(Se,{children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function Jt(e,t,n){let r=e?.connectionState??`disconnected`;if(Bt(e,t))return e?.lastError??`This environment no longer accepts its saved pairing.`;if(r===`connected`){let r=e?.connectedAt??t.lastConnectedAt;return r?`Connected for ${W(r,n)}`:null}return r===`connecting`?null:r===`error`?e?.lastError??`An unknown connection error occurred.`:t.lastConnectedAt?`Last connected at ${Kt(t.lastConnectedAt)}`:`Not connected yet.`}function Yt(e){let t=e.username?`${e.username}@${e.hostname}`:e.hostname;return e.port?`${t}:${e.port}`:t}function Xt(e){let t=e.host.trim();if(t.length===0)throw Error(`SSH host or alias is required.`);let n=t,r=e.username.trim()||null,i=null,a=n.lastIndexOf(`@`);if(a>0){let e=n.slice(0,a).trim();n=n.slice(a+1).trim(),!r&&e.length>0&&(r=e)}let o=/^\[([^\]]+)\](?::(\d+))?$/u.exec(n);if(o)n=o[1].trim(),o[2]&&(i=Number.parseInt(o[2],10));else{let e=n.split(`:`);e.length===2&&/^\d+$/u.test(e[1]??``)&&(n=e[0].trim(),i=Number.parseInt(e[1],10))}let s=e.port.trim();if(s.length>0&&(i=Number.parseInt(s,10)),n.length===0)throw Error(`SSH host or alias is required.`);if(i!==null&&(!Number.isInteger(i)||i<=0||i>65535))throw Error(`SSH port must be between 1 and 65535.`);return{alias:n,hostname:n,username:r,port:i}}function Zt(e){let t=e.trim();if(!t)return null;try{let e=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//u.test(t)||t.startsWith(`//`)?t:`https://${t}`,n=new URL(e,window.location.origin),r=ke(n);if(r)return{host:r.host,pairingCode:r.token};let i=De(n);return i?{host:n.origin,pairingCode:i}:null}catch{return null}}function Qt(e){let t=Zt(e.host);if(t)return t;let n=e.host.trim(),r=e.pairingCode.trim();if(!n)throw Error(`Enter a backend host.`);if(!r)throw Error(`Enter a pairing code.`);return{host:n,pairingCode:r}}function $t(e){let t=`Failed to connect SSH host.`;return(e instanceof Error?e.message:t).replace(/^Error invoking remote method 'desktop:ensure-ssh-environment':\s*/u,``).replace(/^Ssh[A-Za-z]+Error:\s*/u,``).trim()||t}var en=`border-t border-border/60 px-4 py-3.5 first:border-t-0 sm:px-5`,tn=`border-t border-border/60 px-4 py-2.5 first:border-t-0 sm:px-5`,nn=`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`;function rn(e){return en}function an(e,t){return e===`endpoint-rail`?_(`relative border-t border-border/60 px-4 py-3.5 first:border-t-0 sm:px-5`,!t&&`bg-muted/20`):_(tn,!t&&`bg-muted/24`)}function on(e){return[...e].toSorted((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function sn(e){return[...e].toSorted((e,t)=>e.current===t.current?e.connected===t.connected?new Date(t.issuedAt).getTime()-new Date(e.issuedAt).getTime():e.connected?-1:1:e.current?-1:1)}function cn(e){return{...e,createdAt:g(e.createdAt),expiresAt:g(e.expiresAt)}}function ln(e){return{...e,issuedAt:g(e.issuedAt),expiresAt:g(e.expiresAt),lastConnectedAt:e.lastConnectedAt===null?null:g(e.lastConnectedAt)}}function un(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return on([...e,t]);let r=[...e];return r[n]=t,on(r)}function dn(e,t){return e.filter(e=>e.id!==t)}function fn(e,t){let n=e.findIndex(e=>e.sessionId===t.sessionId);if(n===-1)return sn([...e,t]);let r=[...e];return r[n]=t,sn(r)}function pn(e,t){return e.filter(e=>e.sessionId!==t)}function mn(e,t){let n=e.filter(e=>e.status!==`unavailable`);if(t){let e=n.find(e=>gn(e)===t);if(e)return e}return n.find(e=>e.isDefault)??n.find(e=>e.reachability!==`loopback`)??n.find(e=>e.compatibility.hostedHttpsApp===`compatible`)??null}function hn(e){return e.id.startsWith(`tailscale-magicdns:`)}function gn(e){if(e.id.startsWith(`desktop-loopback:`)||e.id.startsWith(`server-loopback:`))return`desktop-core:loopback:http`;if(e.id.startsWith(`desktop-lan:`)||e.id.startsWith(`server-network:`))return`desktop-core:lan:http`;if(e.id.startsWith(`tailscale-ip:`))return`tailscale:ip:http`;if(hn(e))return`tailscale:magicdns:https`;let t=`unknown`;try{t=new URL(e.httpBaseUrl).protocol.replace(/:$/u,``)}catch{}return`${e.provider.id}:${e.reachability}:${t}:${e.label}`}function _n(e){switch(e){case`mixed-content-blocked`:return`Hosted app blocked`;case`requires-configuration`:return`Setup required for hosted app`;default:return null}}function vn(e){switch(e){case`mixed-content-blocked`:return`The hosted HTTPS app cannot connect to HTTP endpoints because browsers block mixed content.`;case`requires-configuration`:return`Configure HTTPS access before using this endpoint from the hosted app.`;default:return null}}function yn(e,t){return e.compatibility.hostedHttpsApp===`compatible`?ut(e.httpBaseUrl,t)??lt(e.httpBaseUrl,t):lt(e.httpBaseUrl,t)}function bn(e){let t=new URL(`/pair`,window.location.href);return J(t,e).toString()}function xn(e){try{let t=new URL(e);return t.pathname===`/pair`&&t.searchParams.has(`host`)}catch{return!1}}var Sn=(0,Z.memo)(function(e){let t=(0,ct.c)(146),{pairingLink:n,endpointUrl:r,endpoints:i,defaultEndpointKey:a,presentation:s,revokingPairingLinkId:c,onRevoke:l}=e,u=s===void 0?`current`:s,d=Ye(1e3),f;t[0]===n.expiresAt?f=t[1]:(f=new Date(n.expiresAt).getTime(),t[0]=n.expiresAt,t[1]=f);let p=f,[m,h]=(0,Z.useState)(!1),g;t[2]===n.credential?g=t[3]:(g=bn(n.credential),t[2]=n.credential,t[3]=g);let _=g,v;t[4]!==r||t[5]!==n.credential?(v=r!=null&&r!==``?ut(r,n.credential):null,t[4]=r,t[5]=n.credential,t[6]=v):v=t[6];let b=v,x;if(t[7]!==a||t[8]!==i||t[9]!==n.credential){let e=mn(i,a);x=e?yn(e,n.credential):null,t[7]=a,t[8]=i,t[9]=n.credential,t[10]=x}else x=t[10];let S=x,w;if(t[11]!==i||t[12]!==n.credential){let e;t[14]===n.credential?e=t[15]:(e=e=>{let t=yn(e,n.credential);return{key:gn(e),label:e.label,url:t,detail:xn(t)?`Hosted app link`:`Backend pairing URL`}},t[14]=n.credential,t[15]=e),w=i.filter(Nn).map(e),t[11]=i,t[12]=n.credential,t[13]=w}else w=t[13];let T=w,D;t[16]!==_||t[17]!==S||t[18]!==r||t[19]!==b||t[20]!==n.credential?(D=S??(r!=null&&r!==``?b??lt(r,n.credential):o(window.location.hostname)?null:_),t[16]=_,t[17]=S,t[18]=r,t[19]=b,t[20]=n.credential,t[21]=D):D=t[21];let k=D,A=k??n.credential,j=k!==null&&xn(k),M=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null,N;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(N={onCopy:Pn,onError:(e,t)=>{h(!0),y.add(Oe({type:`error`,title:M?t===`hosted-link`?`Could not copy hosted app link`:t===`link`?`Could not copy pairing URL`:`Could not copy pairing code`:`Clipboard copy unavailable`,description:M?e.message:`Showing the full value instead.`}))}},t[22]=N):N=t[22];let{copyToClipboard:P}=E(N),F;t[23]===P?F=t[24]:(F=(e,t)=>{P(e,t)},t[23]=P,t[24]=F);let I=F,L=Fn,R;t[25]!==I||t[26]!==n.credential?(R=()=>{I(n.credential,`code`)},t[25]=I,t[26]=n.credential,t[27]=R):R=t[27];let z=R,B;t[28]!==I||t[29]!==k?(B=()=>{k&&I(k,L(k))},t[28]=I,t[29]=k,t[30]=B):B=t[30];let V=B,H;t[31]===n.expiresAt?H=t[32]:(H=Kt(n.expiresAt),t[31]=n.expiresAt,t[32]=H);let ae=H,W=n.role===`owner`?`Owner`:`Client`,ye=n.label??`${W} link`,be;t[33]!==a||t[34]!==T?(be=T.find(e=>e.key===a)??T[0]??null,t[33]=a,t[34]=T,t[35]=be):be=t[35];let xe=be?.label??`URL`,Se,G,Ce,K,q,we,Ee,De,J;if(t[36]!==I||t[37]!==xe||t[38]!==T||t[39]!==ae||t[40]!==p||t[41]!==z||t[42]!==V||t[43]!==m||t[44]!==d||t[45]!==n.createdAt||t[46]!==n.expiresAt||t[47]!==u||t[48]!==ye||t[49]!==W||t[50]!==k){J=Symbol.for(`react.early_return_sentinel`);bb0:{let e=T.filter(In),r=T.filter(Ln),i;t[60]!==I||t[61]!==T?(i=(e,t)=>{let n=e===void 0?T:e,r=t===void 0||t;return n.map(e=>(0,Q.jsx)(ge,{onClick:()=>I(e.url,L(e.url)),children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:e.label}),r?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.detail}):null]})},e.key))},t[60]=I,t[61]=T,t[62]=i):i=t[62];let a=i,o;t[63]===z?o=t[64]:(o=e=>(0,Q.jsx)(ge,{onClick:z,children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:`Copy code`}),e===void 0||e?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:`Token only`}):null]})}),t[63]=z,t[64]=o);let s=o,c;t[65]===a?c=t[66]:(c=(e,t,n)=>t.length>0?(0,Q.jsxs)(Q.Fragment,{children:[n?(0,Q.jsx)(ce,{}):null,(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(de,{children:e}),a(t,!1)]})]}):null,t[65]=a,t[66]=c);let l=c,f=t=>(0,Q.jsxs)(Q.Fragment,{children:[t?.codeFirst?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(de,{children:`Pairing code`}),s(!1)]}),T.length>0?(0,Q.jsx)(ce,{}):null]}):null,l(`Pairing URLs`,e,!1),l(`Hosted app link`,r,e.length>0),t?.codeFirst?null:(0,Q.jsxs)(Q.Fragment,{children:[T.length>0?(0,Q.jsx)(ce,{}):null,(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(de,{children:`Pairing code`}),s(!1)]})]})]});if(p<=d){J=null;break bb0}t[67]===u?De=t[68]:(De=rn(u),t[67]=u,t[68]=De),we=nn;let g;t[69]===n.createdAt?g=t[70]:(g=Kt(n.createdAt),t[69]=n.createdAt,t[70]=g);let _=`Link created at ${g}`,v;t[71]===_?v=t[72]:(v=(0,Q.jsx)(qt,{tooltipText:_,dotClassName:`bg-warning`}),t[71]=_,t[72]=v);let y;t[73]===ye?y=t[74]:(y=(0,Q.jsx)(`h3`,{className:`min-w-0 truncate text-[13px] font-medium text-foreground`,children:ye}),t[73]=ye,t[74]=y);let b;t[75]===k?b=t[76]:(b=k?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(le,{openOnHover:!0,delay:250,closeDelay:100,render:(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground/50 outline-none hover:text-foreground`,"aria-label":`Show QR code`}),children:(0,Q.jsx)(Te,{"aria-hidden":!0,className:`size-3`})}),(0,Q.jsx)(_e,{side:`top`,align:`start`,tooltipStyle:!0,className:`w-max`,children:(0,Q.jsx)(it,{value:k,size:88,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})})]}):null,t[75]=k,t[76]=b);let x;t[77]===b?x=t[78]:(x=(0,Q.jsx)(ve,{children:b}),t[77]=b,t[78]=x);let S;t[79]!==v||t[80]!==y||t[81]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[v,y,x]}),t[79]=v,t[80]=y,t[81]=x,t[82]=S):S=t[82];let w;t[83]!==d||t[84]!==n.expiresAt?(w=ne(n.expiresAt,d),t[83]=d,t[84]=n.expiresAt,t[85]=w):w=t[85];let E;t[86]!==W||t[87]!==w?(E=[W,w],t[86]=W,t[87]=w,t[88]=E):E=t[88];let D=E.join(` · `),A;t[89]!==ae||t[90]!==D?(A=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,title:ae,children:D}),t[89]=ae,t[90]=D,t[91]=A):A=t[91];let j;t[92]===k?j=t[93]:(j=k===null?(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Copy the token and pair from another client using this backend's reachable host.`}):null,t[92]=k,t[93]=j),t[94]!==S||t[95]!==A||t[96]!==j?(Ee=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[S,A,j]}),t[94]=S,t[95]=A,t[96]=j,t[97]=Ee):Ee=t[97],q=`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,Se=ee,G=m,Ce=h,K=M?(0,Q.jsx)(Q.Fragment,{children:k?(0,Q.jsxs)(rt,{"aria-label":`Copy selected endpoint`,children:[(0,Q.jsx)(O,{size:`xs`,variant:`outline`,className:`max-w-56`,title:`Copy pairing URL for: ${xe}`,onClick:V,children:(0,Q.jsxs)(`span`,{className:`truncate`,children:[`Copy pairing URL for: `,xe]})}),(0,Q.jsx)(nt,{}),(0,Q.jsxs)(me,{children:[(0,Q.jsx)(se,{render:(0,Q.jsx)(O,{size:`icon-xs`,variant:`outline`,"aria-label":`Choose endpoint to copy`}),children:(0,Q.jsx)(C,{className:`size-3.5`})}),(0,Q.jsx)(he,{align:`end`,className:`min-w-60`,children:f()})]})]}):(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:z,children:`Copy code`})}):(0,Q.jsx)(te,{render:(0,Q.jsx)(O,{size:`xs`,variant:`outline`}),children:k?`Show link`:`Show code`})}t[36]=I,t[37]=xe,t[38]=T,t[39]=ae,t[40]=p,t[41]=z,t[42]=V,t[43]=m,t[44]=d,t[45]=n.createdAt,t[46]=n.expiresAt,t[47]=u,t[48]=ye,t[49]=W,t[50]=k,t[51]=Se,t[52]=G,t[53]=Ce,t[54]=K,t[55]=q,t[56]=we,t[57]=Ee,t[58]=De,t[59]=J}else Se=t[51],G=t[52],Ce=t[53],K=t[54],q=t[55],we=t[56],Ee=t[57],De=t[58],J=t[59];if(J!==Symbol.for(`react.early_return_sentinel`))return J;let ke=k?j?`Hosted app pairing link`:`Pairing link`:`Pairing code`,Ae;t[98]===ke?Ae=t[99]:(Ae=(0,Q.jsx)(oe,{children:ke}),t[98]=ke,t[99]=Ae);let je=k?j?`Clipboard copy is unavailable here. Open or manually copy this hosted app link on the device you want to connect.`:`Clipboard copy is unavailable here. Open or manually copy this full pairing URL on the device you want to connect.`:`Clipboard copy is unavailable here. Manually copy this code into another client.`,Me;t[100]===je?Me=t[101]:(Me=(0,Q.jsx)(pe,{children:je}),t[100]=je,t[101]=Me);let Ne;t[102]!==Ae||t[103]!==Me?(Ne=(0,Q.jsxs)(fe,{children:[Ae,Me]}),t[102]=Ae,t[103]=Me,t[104]=Ne):Ne=t[104];let Pe=k?4:3,Fe;t[105]!==A||t[106]!==Pe?(Fe=(0,Q.jsx)(Ge,{readOnly:!0,value:A,rows:Pe,className:`text-xs leading-relaxed`,onFocus:Rn,onClick:zn}),t[105]=A,t[106]=Pe,t[107]=Fe):Fe=t[107];let Ie;t[108]===k?Ie=t[109]:(Ie=k?(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border/60 bg-muted/30 p-4`,children:(0,Q.jsx)(it,{value:k,size:132,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})}):null,t[108]=k,t[109]=Ie);let Le;t[110]!==Fe||t[111]!==Ie?(Le=(0,Q.jsxs)(re,{className:`space-y-4`,children:[Fe,Ie]}),t[110]=Fe,t[111]=Ie,t[112]=Le):Le=t[112];let Re;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Q.jsx)(O,{variant:`outline`,onClick:()=>h(!1),children:`Done`}),t[113]=Re):Re=t[113];let ze;t[114]===z?ze=t[115]:(ze=M?(0,Q.jsx)(O,{variant:`outline`,size:`xs`,onClick:z,children:`Copy code`}):null,t[114]=z,t[115]=ze);let Be;t[116]===ze?Be=t[117]:(Be=(0,Q.jsxs)(U,{variant:`bare`,children:[Re,ze]}),t[116]=ze,t[117]=Be);let Ve;t[118]!==Ne||t[119]!==Le||t[120]!==Be?(Ve=(0,Q.jsxs)(ie,{className:`max-w-md`,children:[Ne,Le,Be]}),t[118]=Ne,t[119]=Le,t[120]=Be,t[121]=Ve):Ve=t[121];let He;t[122]!==Se||t[123]!==G||t[124]!==Ce||t[125]!==K||t[126]!==Ve?(He=(0,Q.jsxs)(Se,{open:G,onOpenChange:Ce,children:[K,Ve]}),t[122]=Se,t[123]=G,t[124]=Ce,t[125]=K,t[126]=Ve,t[127]=He):He=t[127];let Ue=c===n.id,We;t[128]!==l||t[129]!==n.id?(We=()=>void l(n.id),t[128]=l,t[129]=n.id,t[130]=We):We=t[130];let Ke=c===n.id?`Revoking…`:`Revoke`,qe;t[131]!==Ue||t[132]!==We||t[133]!==Ke?(qe=(0,Q.jsx)(O,{size:`xs`,variant:`destructive-outline`,disabled:Ue,onClick:We,children:Ke}),t[131]=Ue,t[132]=We,t[133]=Ke,t[134]=qe):qe=t[134];let Je;t[135]!==q||t[136]!==He||t[137]!==qe?(Je=(0,Q.jsxs)(`div`,{className:q,children:[He,qe]}),t[135]=q,t[136]=He,t[137]=qe,t[138]=Je):Je=t[138];let Y;t[139]!==we||t[140]!==Ee||t[141]!==Je?(Y=(0,Q.jsxs)(`div`,{className:we,children:[Ee,Je]}),t[139]=we,t[140]=Ee,t[141]=Je,t[142]=Y):Y=t[142];let X;return t[143]!==De||t[144]!==Y?(X=(0,Q.jsx)(`div`,{className:De,children:Y}),t[143]=De,t[144]=Y,t[145]=X):X=t[145],X}),Cn=(0,Z.memo)(function(e){let t=(0,ct.c)(50),{clientSession:n,presentation:r,revokingClientSessionId:i,onRevokeSession:a}=e,o=r===void 0?`current`:r,s=Ye(1e3),c=n.current||n.connected,l=n.lastConnectedAt,u;t[0]!==c||t[1]!==l||t[2]!==s?(u=c?l?`Connected for ${W(l,s)}`:`Connected`:l?`Last connected at ${Kt(l)}`:`Not connected yet.`,t[0]=c,t[1]=l,t[2]=s,t[3]=u):u=t[3];let d=u,f=n.role===`owner`?`Owner`:`Client`,p;t[4]===n.client.deviceType?p=t[5]:(p=n.client.deviceType===`unknown`?null:n.client.deviceType[0]?.toUpperCase()+n.client.deviceType.slice(1),t[4]=n.client.deviceType,t[5]=p);let m=n.client.os??null,h=n.client.browser??null,g=n.client.ipAddress??null,_;t[6]!==p||t[7]!==m||t[8]!==h||t[9]!==g?(_=[p,m,h,g].filter(Bn),t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=_,y;t[11]!==n.client.browser||t[12]!==n.client.label||t[13]!==n.client.os||t[14]!==n.subject?(y=n.client.label??([n.client.os,n.client.browser].filter(Boolean).join(` · `)||n.subject),t[11]=n.client.browser,t[12]=n.client.label,t[13]=n.client.os,t[14]=n.subject,t[15]=y):y=t[15];let b=y,x;t[16]===o?x=t[17]:(x=rn(o),t[16]=o,t[17]=x);let S=c?`bg-success`:`bg-muted-foreground/30`,C;t[18]!==d||t[19]!==S?(C=(0,Q.jsx)(qt,{tooltipText:d,dotClassName:S,pingClassName:null}),t[18]=d,t[19]=S,t[20]=C):C=t[20];let w;t[21]===b?w=t[22]:(w=(0,Q.jsx)(`h3`,{className:`min-w-0 truncate text-[13px] font-medium text-foreground`,children:b}),t[21]=b,t[22]=w);let T;t[23]===n.current?T=t[24]:(T=n.current?(0,Q.jsx)(Ie,{size:`sm`,variant:`outline`,className:`shrink-0`,children:`Current session`}):null,t[23]=n.current,t[24]=T);let E;t[25]!==C||t[26]!==w||t[27]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[C,w,T]}),t[25]=C,t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==v||t[30]!==f?(D=[f,...v],t[29]=v,t[30]=f,t[31]=D):D=t[31];let k=D.join(` · `),A;t[32]===k?A=t[33]:(A=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:k}),t[32]=k,t[33]=A);let j;t[34]!==E||t[35]!==A?(j=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,A]}),t[34]=E,t[35]=A,t[36]=j):j=t[36];let M;t[37]!==n.current||t[38]!==n.sessionId||t[39]!==a||t[40]!==i?(M=n.current?null:(0,Q.jsx)(O,{size:`xs`,variant:`destructive-outline`,disabled:i===n.sessionId,onClick:()=>void a(n.sessionId),children:i===n.sessionId?`Revoking…`:`Revoke`}),t[37]=n.current,t[38]=n.sessionId,t[39]=a,t[40]=i,t[41]=M):M=t[41];let N;t[42]===M?N=t[43]:(N=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:M}),t[42]=M,t[43]=N);let P;t[44]!==j||t[45]!==N?(P=(0,Q.jsxs)(`div`,{className:nn,children:[j,N]}),t[44]=j,t[45]=N,t[46]=P):P=t[46];let F;return t[47]!==P||t[48]!==x?(F=(0,Q.jsx)(`div`,{className:x,children:P}),t[47]=P,t[48]=x,t[49]=F):F=t[49],F}),wn=(0,Z.memo)(function({clientSessions:e,isRevokingOtherClients:t,onRevokeOtherClients:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),l=(0,Z.useCallback)(async()=>{c(!0);try{await p(a),o(``),i(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to create pairing URL.`;y.add(Oe({type:`error`,title:`Could not create pairing URL`,description:t}))}finally{c(!1)}},[a]);return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(O,{size:`xs`,variant:`destructive-outline`,disabled:t||e.every(e=>e.current),onClick:()=>void n(),children:t?`Revoking…`:`Revoke others`}),(0,Q.jsxs)(ee,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Q.jsx)(te,{render:(0,Q.jsxs)(O,{size:`xs`,variant:`default`,children:[(0,Q.jsx)(at,{className:`size-3`}),`Create link`]})}),(0,Q.jsxs)(ie,{className:`max-w-sm`,children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(oe,{children:`Create pairing link`}),(0,Q.jsx)(pe,{children:`Generate a one-time link that another device can use to pair with this backend as an authorized client.`})]}),(0,Q.jsx)(re,{children:(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Client label (optional)`}),(0,Q.jsx)(Pe,{value:a,onChange:e=>o(e.target.value),placeholder:`e.g. Living room iPad`,disabled:s,autoFocus:!0})]})}),(0,Q.jsxs)(U,{variant:`bare`,children:[(0,Q.jsx)(O,{variant:`outline`,disabled:s,onClick:()=>i(!1),children:`Cancel`}),(0,Q.jsx)(O,{disabled:s,onClick:()=>void l(),children:s?`Creating…`:`Create link`})]})]})]})]})}),Tn=(0,Z.memo)(function(e){let t=(0,ct.c)(33),{endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:a,isLoading:o,pairingLinks:s,clientSessions:c,revokingPairingLinkId:l,revokingClientSessionId:u,onRevokePairingLink:d,onRevokeClientSession:f}=e,p=a===void 0?`current`:a,m;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==d||t[4]!==s||t[5]!==p||t[6]!==l){let e;t[8]!==i||t[9]!==n||t[10]!==r||t[11]!==d||t[12]!==p||t[13]!==l?(e=e=>(0,Q.jsx)(Sn,{pairingLink:e,endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:p,revokingPairingLinkId:l,onRevoke:d},e.id),t[8]=i,t[9]=n,t[10]=r,t[11]=d,t[12]=p,t[13]=l,t[14]=e):e=t[14],m=s.map(e),t[0]=i,t[1]=n,t[2]=r,t[3]=d,t[4]=s,t[5]=p,t[6]=l,t[7]=m}else m=t[7];let h;if(t[15]!==c||t[16]!==f||t[17]!==p||t[18]!==u){let e;t[20]!==f||t[21]!==p||t[22]!==u?(e=e=>(0,Q.jsx)(Cn,{clientSession:e,presentation:p,revokingClientSessionId:u,onRevokeSession:f},e.sessionId),t[20]=f,t[21]=p,t[22]=u,t[23]=e):e=t[23],h=c.map(e),t[15]=c,t[16]=f,t[17]=p,t[18]=u,t[19]=h}else h=t[19];let g;t[24]!==c.length||t[25]!==o||t[26]!==s.length||t[27]!==p?(g=s.length===0&&c.length===0&&!o?(0,Q.jsx)(`div`,{className:rn(p),children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:`No pairing links or client sessions.`})}):null,t[24]=c.length,t[25]=o,t[26]=s.length,t[27]=p,t[28]=g):g=t[28];let _;return t[29]!==m||t[30]!==h||t[31]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[m,h,g]}),t[29]=m,t[30]=h,t[31]=g,t[32]=_):_=t[32],_}),En=(0,Z.memo)(function(e){let t=(0,ct.c)(58),{endpoint:n,isDefault:r,presentation:i,onSetDefault:a,onSetupTailscaleServe:o,onDisableTailscaleServe:s,isUpdatingTailscaleServe:c}=e,l=i===void 0?`current`:i,u=n.status===`available`,d;t[0]===n?d=t[1]:(d=hn(n)&&n.status!==`available`,t[0]=n,t[1]=d);let f=d,p;t[2]===n.compatibility.hostedHttpsApp?p=t[3]:(p=_n(n.compatibility.hostedHttpsApp),t[2]=n.compatibility.hostedHttpsApp,t[3]=p);let m=p,h;t[4]===n.compatibility.hostedHttpsApp?h=t[5]:(h=vn(n.compatibility.hostedHttpsApp),t[4]=n.compatibility.hostedHttpsApp,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=hn(n)&&n.status===`available`,t[6]=n,t[7]=_);let v=_,y=!f,b=l===`endpoint-rail`,x;t[8]!==u||t[9]!==l?(x=an(l,u),t[8]=u,t[9]=l,t[10]=x):x=t[10];let S;t[11]!==r||t[12]!==b?(S=b&&r?(0,Q.jsx)(`span`,{className:`absolute inset-y-2 left-0 w-1 rounded-r-full bg-primary`,"aria-hidden":!0}):null,t[11]=r,t[12]=b,t[13]=S):S=t[13];let C;t[14]===n.label?C=t[15]:(C=(0,Q.jsx)(`h3`,{className:`shrink-0 text-[13px] leading-5 font-medium text-foreground`,children:n.label}),t[14]=n.label,t[15]=C);let w;t[16]!==n.httpBaseUrl||t[17]!==y?(w=y?(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs leading-5 text-muted-foreground`,title:n.httpBaseUrl,children:n.httpBaseUrl}):null,t[16]=n.httpBaseUrl,t[17]=y,t[18]=w):w=t[18];let T;t[19]===u?T=t[20]:(T=u?null:(0,Q.jsx)(Ie,{size:`sm`,variant:`outline`,className:`shrink-0`,children:`Setup required`}),t[19]=u,t[20]=T);let E;t[21]!==g||t[22]!==m?(E=m?(0,Q.jsx)(`span`,{className:`inline-flex shrink-0`,title:g??void 0,children:(0,Q.jsxs)(Ie,{size:`sm`,variant:`warning`,children:[(0,Q.jsx)(N,{"aria-hidden":!0}),m]})}):null,t[21]=g,t[22]=m,t[23]=E):E=t[23];let D;t[24]!==T||t[25]!==E||t[26]!==C||t[27]!==w?(D=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[C,w,T,E]}),t[24]=T,t[25]=E,t[26]=C,t[27]=w,t[28]=D):D=t[28];let k;t[29]===r?k=t[30]:(k=r?(0,Q.jsx)(Ie,{size:`sm`,variant:`info`,children:`Default`}):null,t[29]=r,t[30]=k);let A;t[31]!==n||t[32]!==c||t[33]!==f||t[34]!==o?(A=f?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>o(n),disabled:c,children:c?`Restarting…`:`Setup`}):null,t[31]=n,t[32]=c,t[33]=f,t[34]=o,t[35]=A):A=t[35];let j;t[36]!==v||t[37]!==n||t[38]!==c||t[39]!==s?(j=v?(0,Q.jsx)(O,{size:`xs`,variant:`destructive-outline`,onClick:()=>s(n),disabled:c,children:c?`Restarting…`:`Disable`}):null,t[36]=v,t[37]=n,t[38]=c,t[39]=s,t[40]=j):j=t[40];let M;t[41]!==n||t[42]!==r||t[43]!==f||t[44]!==a?(M=!f&&!r?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>a(n),children:`Set as default`}):null,t[41]=n,t[42]=r,t[43]=f,t[44]=a,t[45]=M):M=t[45];let P;t[46]!==k||t[47]!==A||t[48]!==j||t[49]!==M?(P=(0,Q.jsxs)(`div`,{className:`ml-auto flex min-h-6 shrink-0 items-center justify-end gap-2`,children:[k,A,j,M]}),t[46]=k,t[47]=A,t[48]=j,t[49]=M,t[50]=P):P=t[50];let F;t[51]!==D||t[52]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex min-h-6 min-w-0 flex-col gap-2 sm:-my-0.5 sm:flex-row sm:items-center`,children:[D,P]}),t[51]=D,t[52]=P,t[53]=F):F=t[53];let I;return t[54]!==F||t[55]!==x||t[56]!==S?(I=(0,Q.jsxs)(`div`,{className:x,children:[S,F]}),t[54]=F,t[55]=x,t[56]=S,t[57]=I):I=t[57],I});function Dn(e){let t=(0,ct.c)(12),{message:n,busy:r,onRestart:i,onUndo:a}=e,o;t[0]===n?o=t[1]:(o=(0,Q.jsx)(`span`,{className:`text-warning`,children:n}),t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i?(s=i?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,disabled:r,onClick:i,children:`Restart`}):null,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c;t[5]!==r||t[6]!==a?(c=(0,Q.jsx)(O,{size:`xs`,variant:`ghost`,disabled:r,onClick:a,children:`Undo`}),t[5]=r,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==o||t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[o,s,c]}),t[8]=o,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function On(e){let t=(0,ct.c)(17),{endpoint:n,hiddenEndpointCount:r,expanded:i,onToggleExpanded:a,fallback:o}=e;if(!n)return o;let s;t[0]===n.httpBaseUrl?s=t[1]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:n.httpBaseUrl}),t[0]=n.httpBaseUrl,t[1]=s);let c;t[2]===n.compatibility.hostedHttpsApp?c=t[3]:(c=_n(n.compatibility.hostedHttpsApp)?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[11px] text-warning-foreground`,title:vn(n.compatibility.hostedHttpsApp)??void 0,children:[(0,Q.jsx)(N,{"aria-hidden":!0,className:`size-3`}),_n(n.compatibility.hostedHttpsApp)]}):null,t[2]=n.compatibility.hostedHttpsApp,t[3]=c);let l;t[4]!==i||t[5]!==r?(l=r>0?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs font-medium`,children:i?`Hide`:`+${r}`}):null,t[4]=i,t[5]=r,t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d=u,f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Reachable at`}),t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==d?(p=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-1`,children:[f,r>0?(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-baseline gap-2 border-b border-dotted border-muted-foreground/60 text-left text-muted-foreground underline-offset-4 hover:border-foreground hover:text-foreground`,onClick:a,"aria-expanded":i,children:d}):(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-2`,children:d})]}),t[12]=i,t[13]=r,t[14]=a,t[15]=d,t[16]=p):p=t[16],p}function kn(e){let t=(0,ct.c)(88),{environmentId:n,reconnectingEnvironmentId:r,disconnectingEnvironmentId:i,removingEnvironmentId:a,onConnect:o,onDisconnect:s,onRepair:c,onRemove:l}=e,u=Ye(1e3),d;t[0]===n?d=t[1]:(d=e=>e.byId[n]??null,t[0]=n,t[1]=d);let f=A(d),p;t[2]===n?p=t[3]:(p=e=>e.byId[n]??null,t[2]=n,t[3]=p);let m=L(p);if(!f)return null;let h=m?.connectionState??`disconnected`,g=h===`connected`,_=h===`connecting`||r===n,y=i===n,b,x,S,C,w,T,E,D,k,j,M;if(t[4]!==h||t[5]!==n||t[6]!==g||t[7]!==_||t[8]!==y||t[9]!==u||t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==m){let e=!_&&Bt(m,f),r=h===`connected`?`bg-success`:h===`connecting`?`bg-warning`:h===`error`||e?`bg-destructive`:`bg-muted-foreground/40`,i=m?.role?m.role===`owner`?`Owner`:`Client`:null,a=m?.descriptor?.label??null??f.label,l;t[26]!==u||t[27]!==f||t[28]!==m?(l=Jt(m,f,u),t[26]=u,t[27]=f,t[28]=m,t[29]=l):l=t[29];let d=l,p=m?.serverConfig,A;t[30]===p?A=t[31]:(A=v(p),t[30]=p,t[31]=A);let P=A,F;t[32]===f.desktopSsh?F=t[33]:(F=f.desktopSsh?`SSH ${Yt(f.desktopSsh)}`:null,t[32]=f.desktopSsh,t[33]=F);let I;t[34]===f.lastConnectedAt?I=t[35]:(I=f.lastConnectedAt?`Last connected ${Kt(f.lastConnectedAt)}`:null,t[34]=f.lastConnectedAt,t[35]=I);let L;t[36]!==i||t[37]!==F||t[38]!==I?(L=[F,i,I].filter(An),t[36]=i,t[37]=F,t[38]=I,t[39]=L):L=t[39];let R=L;C=en,x=nn;let z=h===`connecting`?`bg-warning/60 duration-2000`:null,B;t[40]!==r||t[41]!==d||t[42]!==z?(B=(0,Q.jsx)(qt,{tooltipText:d,dotClassName:r,pingClassName:z}),t[40]=r,t[41]=d,t[42]=z,t[43]=B):B=t[43];let V;t[44]===a?V=t[45]:(V=(0,Q.jsx)(`h3`,{className:`min-w-0 truncate text-[13px] font-medium text-foreground`,children:a}),t[44]=a,t[45]=V);let H;t[46]!==B||t[47]!==V?(H=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[B,V]}),t[46]=B,t[47]=V,t[48]=H):H=t[48];let U;t[49]===R?U=t[50]:(U=R.length>0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:R.join(` · `)}):null,t[49]=R,t[50]=U);let ee;t[51]===P?ee=t[52]:(ee=P?(0,Q.jsxs)(`p`,{className:`flex items-center gap-1 text-warning text-xs`,children:[(0,Q.jsx)(N,{className:`size-3.5 shrink-0`}),`Version drift: client `,P.clientVersion,`, server`,` `,P.serverVersion,`.`]}):null,t[51]=P,t[52]=ee),t[53]!==H||t[54]!==U||t[55]!==ee?(S=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[H,U,ee]}),t[53]=H,t[54]=U,t[55]=ee,t[56]=S):S=t[56],j=`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,M=e?(0,Q.jsx)(O,{size:`xs`,variant:`outline`,onClick:()=>c(n),children:`Re-pair`}):null,b=O,w=`xs`,T=`outline`,E=g?y:_,t[57]!==n||t[58]!==g||t[59]!==o||t[60]!==s?(D=()=>void(g?s(n):o(n)),t[57]=n,t[58]=g,t[59]=o,t[60]=s,t[61]=D):D=t[61],k=Ht({isConnected:g,isConnecting:_,isDisconnecting:y,needsRepair:e}),t[4]=h,t[5]=n,t[6]=g,t[7]=_,t[8]=y,t[9]=u,t[10]=o,t[11]=s,t[12]=c,t[13]=f,t[14]=m,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D,t[23]=k,t[24]=j,t[25]=M}else b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20],E=t[21],D=t[22],k=t[23],j=t[24],M=t[25];let P;t[62]!==b||t[63]!==w||t[64]!==T||t[65]!==E||t[66]!==D||t[67]!==k?(P=(0,Q.jsx)(b,{size:w,variant:T,disabled:E,onClick:D,children:k}),t[62]=b,t[63]=w,t[64]=T,t[65]=E,t[66]=D,t[67]=k,t[68]=P):P=t[68];let F=a===n,I;t[69]!==n||t[70]!==l?(I=()=>void l(n),t[69]=n,t[70]=l,t[71]=I):I=t[71];let R=a===n?`Removing…`:`Remove`,z;t[72]!==F||t[73]!==I||t[74]!==R?(z=(0,Q.jsx)(O,{size:`xs`,variant:`destructive-outline`,disabled:F,onClick:I,children:R}),t[72]=F,t[73]=I,t[74]=R,t[75]=z):z=t[75];let B;t[76]!==P||t[77]!==z||t[78]!==j||t[79]!==M?(B=(0,Q.jsxs)(`div`,{className:j,children:[M,P,z]}),t[76]=P,t[77]=z,t[78]=j,t[79]=M,t[80]=B):B=t[80];let V;t[81]!==x||t[82]!==S||t[83]!==B?(V=(0,Q.jsxs)(`div`,{className:x,children:[S,B]}),t[81]=x,t[82]=S,t[83]=B,t[84]=V):V=t[84];let H;return t[85]!==C||t[86]!==V?(H=(0,Q.jsx)(`div`,{className:C,children:V}),t[85]=C,t[86]=V,t[87]=H):H=t[87],H}function An(e){return e!==null}var jn=(0,Z.memo)(function(e){let t=(0,ct.c)(24),{target:n,connectingHostAlias:r,onConnect:i}=e,a;t[0]===n?a=t[1]:(a=Yt(n),t[0]=n,t[1]=a);let o=a,s=o!==n.alias,c=r===n.alias?`Adding…`:`Add environment`,l;t[2]===n.alias?l=t[3]:(l=(0,Q.jsx)(`h3`,{className:`truncate text-[13px] font-medium text-foreground`,children:n.alias}),t[2]=n.alias,t[3]=l);let u;t[4]!==o||t[5]!==s?(u=s?(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:o}):null,t[4]=o,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=r===n.alias,p;t[10]!==i||t[11]!==n?(p=()=>i(n),t[10]=i,t[11]=n,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==n.alias?(m=r===n.alias?(0,Q.jsx)(Ee,{className:`size-3 animate-spin`}):null,t[13]=r,t[14]=n.alias,t[15]=m):m=t[15];let h;t[16]!==c||t[17]!==f||t[18]!==p||t[19]!==m?(h=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:(0,Q.jsxs)(O,{size:`xs`,variant:`outline`,disabled:f,onClick:p,children:[m,c]})}),t[16]=c,t[17]=f,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==d||t[22]!==h?(g=(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3.5 first:border-t-0 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:nn,children:[d,h]})}),t[21]=d,t[22]=h,t[23]=g):g=t[23],g});function Mn(){let e=window.desktopBridge,[r,a]=(0,Z.useState)(e?`owner`:null),[o,s]=(0,Z.useState)(null),c=A(e=>e.byId),l=(0,Z.useMemo)(()=>Object.values(c).toSorted((e,t)=>e.label.localeCompare(t.label)).map(e=>e.environmentId),[c]),d=(0,Z.useMemo)(()=>Object.values(c).reduce((e,t)=>(t.desktopSsh?.alias&&(e[t.desktopSsh.alias]=t),e),{}),[c]),f=(0,Z.useMemo)(()=>{let e=new Set;for(let t of Object.values(c)){let n=t.desktopSsh;n&&(e.add(n.alias),e.add(Yt(n)))}return e},[c]),[p,m]=(0,Z.useState)([]),[h,g]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),[w,E]=(0,Z.useState)(null),[k,j]=(0,Z.useState)(null),[L,B]=(0,Z.useState)([]),[V,H]=(0,Z.useState)(null),[ne,se]=(0,Z.useState)([]),[W,ce]=(0,Z.useState)([]),[le,ue]=(0,Z.useState)(null),[de,me]=(0,Z.useState)(!1),[he,ge]=(0,Z.useState)(null),[_e,ve]=(0,Z.useState)(null),[ye,G]=(0,Z.useState)(!1),[Ce,K]=(0,Z.useState)(!1),[q,Te]=(0,Z.useState)(`remote`),[De,J]=(0,Z.useState)(``),[ke,Ae]=(0,Z.useState)(``),[je,Me]=(0,Z.useState)(``),[Ne,Ie]=(0,Z.useState)(``),[Ge,Ye]=(0,Z.useState)(``),[Xe,Ze]=(0,Z.useState)(null),[$e,tt]=(0,Z.useState)(!1),nt=(0,Z.useMemo)(()=>p.filter(e=>{let t=Yt(e);return!f.has(e.alias)&&!f.has(t)}),[p,f]),[rt,it]=(0,Z.useState)(null),[ot,ct]=(0,Z.useState)(null),[lt,ut]=(0,Z.useState)(null),[dt,ft]=(0,Z.useState)(!1),[pt,mt]=(0,Z.useState)(!1),[$,ht]=(0,Z.useState)(!1),[gt,_t]=(0,Z.useState)(null),[vt,yt]=(0,Z.useState)(!1),[bt,xt]=(0,Z.useState)(String(Wt)),[St,Ct]=(0,Z.useState)(null),wt=D(),Tt=v(wt),{guardRelaunch:Et,dialog:Dt}=Qe(),[Ot,kt]=(0,Z.useState)(!1),At=T(e=>e.defaultAdvertisedEndpointKey),jt=T(e=>e.setDefaultAdvertisedEndpointKey),Mt=r===`owner`,Pt=e?k?.mode===`network-accessible`:o===`remote-reachable`,Ft=bt.trim(),It=Number(Ft),Lt=/^\d+$/u.test(Ft)&&Number.isInteger(It)&&It>=1&&It<=65535,zt=(0,Z.useMemo)(()=>{if(!gt)return null;if(!Lt||It===Wt)return gt.httpBaseUrl;try{let e=new URL(gt.httpBaseUrl);return e.port=String(It),e.toString().replace(/\/$/u,``)}catch{return gt.httpBaseUrl}},[Lt,It,gt]),Bt=(0,Z.useCallback)(async t=>{if(e){ft(!0),H(null);try{let n=t?`network-accessible`:`local-only`;await Et(async t=>{let r=await(t===`deferred`?e.setServerExposureMode(n,{deferRelaunch:!0}):e.setServerExposureMode(n));j(r)},{beforePrompt:()=>mt(!1)}),mt(!1),ft(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to update network exposure.`;mt(!1),H(t),y.add(Oe({type:`error`,title:`Could not update network access`,description:t})),ft(!1)}}},[e,Et]),Ht=(0,Z.useCallback)(()=>{St!==null&&Bt(St===`network-accessible`)},[Bt,St]),Gt=(0,Z.useCallback)(async()=>{if(e&&Lt){ht(!0),H(null);try{await Et(async t=>{let n=await e.setTailscaleServeEnabled({enabled:!0,port:It,...t===`deferred`?{deferRelaunch:!0}:{}});j(n)},{beforePrompt:()=>_t(null)}),_t(null)}catch(e){let t=e instanceof Error?e.message:`Failed to configure Tailscale HTTPS.`;H(t),y.add(Oe({type:`error`,title:`Could not set up Tailscale HTTPS`,description:t}))}finally{ht(!1)}}},[e,Et,Lt,It]),Kt=(0,Z.useCallback)(e=>{xt(String(k?.tailscaleServePort??Wt)),_t(e)},[k?.tailscaleServePort]),qt=(0,Z.useCallback)(async()=>{if(e){ht(!0),H(null);try{await Et(async t=>{let n=await e.setTailscaleServeEnabled({enabled:!1,port:k?.tailscaleServePort??Wt,...t===`deferred`?{deferRelaunch:!0}:{}});j(n)},{beforePrompt:()=>yt(!1)}),yt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to disable Tailscale HTTPS.`;H(t),y.add(Oe({type:`error`,title:`Could not disable Tailscale HTTPS`,description:t}))}finally{ht(!1)}}},[e,k?.tailscaleServePort,Et]),Jt=(0,Z.useCallback)(e=>{yt(!0)},[]),tn=(0,Z.useMemo)(()=>{let t=e?.restartApp;return t?()=>{Et(et(t)).catch(e=>{y.add(Oe({type:`error`,title:`Ryco could not restart`,description:e instanceof Error?e.message:`Restart Ryco to apply it.`}))})}:null},[e,Et]),nn=(0,Z.useCallback)(async()=>{if(e&&k){ft(!0),H(null);try{j(await e.setServerExposureMode(k.mode))}catch(e){H(e instanceof Error?e.message:`Failed to update network exposure.`)}finally{ft(!1)}}},[e,k]),an=(0,Z.useCallback)(async()=>{if(e&&k){ht(!0),H(null);try{j(await e.setTailscaleServeEnabled({enabled:k.tailscaleServeEnabled,port:k.tailscaleServePort}))}catch(e){H(e instanceof Error?e.message:`Failed to update Tailscale HTTPS.`)}finally{ht(!1)}}},[e,k]),_n=(0,Z.useCallback)(async e=>{ge(e),ue(null);try{await i(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke pairing link.`;ue(t),y.add(Oe({type:`error`,title:`Could not revoke pairing link`,description:t}))}finally{ge(null)}},[]),vn=(0,Z.useCallback)(async e=>{ve(e),ue(null);try{await u(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke client access.`;ue(t),y.add(Oe({type:`error`,title:`Could not revoke client access`,description:t}))}finally{ve(null)}},[]),yn=(0,Z.useCallback)(async()=>{G(!0),ue(null);try{let e=await t();y.add({type:`success`,title:e===1?`Revoked 1 other client`:`Revoked ${e} clients`,description:`Other paired clients will need a new pairing link before reconnecting.`})}catch(e){let t=e instanceof Error?e.message:`Failed to revoke other clients.`;ue(t),y.add(Oe({type:`error`,title:`Could not revoke other clients`,description:t}))}finally{G(!1)}},[]),bn=(0,Z.useCallback)(async()=>{if(q===`ssh`){tt(!0),Ze(null);try{let e=Xt({host:je,username:Ne,port:Ge}),t=await R(e,{label:``});J(``),Ae(``),Me(``),Ie(``),Ye(``),K(!1),y.add({type:`success`,title:`Environment connected`,description:`${t.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=$t(e);Ze(t)}finally{tt(!1)}return}tt(!0),Ze(null);try{let e=Qt({host:De,pairingCode:ke}),t=await I({label:``,...e});J(``),Ae(``),Me(``),Ie(``),Ye(``),K(!1),y.add({type:`success`,title:`Backend added`,description:`${t.label} is now saved and will reconnect on app startup.`})}catch(e){let t=e instanceof Error?e.message:`Failed to add backend.`;Ze(t),y.add(Oe({type:`error`,title:`Could not add backend`,description:t}))}finally{tt(!1)}},[De,q,ke,je,Ge,Ne]),xn=(0,Z.useCallback)(async e=>{it(e),Ze(null);try{await F(e)}catch(e){let t=e instanceof Error?e.message:`Failed to connect backend.`;Ze(t),y.add(Oe({type:`error`,title:`Could not connect backend`,description:t}))}finally{it(null)}},[]),Sn=(0,Z.useCallback)(e=>{let t=A.getState().byId[e];t&&(Te(`remote`),J(Vt(t)),Ae(``),Ze(null),K(!0))},[]),Cn=(0,Z.useCallback)(async e=>{ct(e),Ze(null);try{await z(e)}catch(e){let t=e instanceof Error?e.message:`Failed to disconnect backend.`;Ze(t),y.add(Oe({type:`error`,title:`Could not disconnect backend`,description:t}))}finally{ct(null)}},[]),An=(0,Z.useCallback)(async e=>{ut(e),Ze(null);try{await M(e)}catch(e){let t=e instanceof Error?e.message:`Failed to remove backend.`;Ze(t),y.add(Oe({type:`error`,title:`Could not remove backend`,description:t}))}finally{ut(null)}},[]),Mn=(0,Z.useCallback)(async()=>{if(!e){m([]),g(!1),C(null);return}x(!0),C(null);try{let t=await e.discoverSshHosts();m(t),g(!0)}catch(e){let t=e instanceof Error?e.message:`Failed to discover SSH hosts.`;C(t),g(!0)}finally{x(!1)}},[e]),Nn=(0,Z.useCallback)(async(e,t)=>{E(e.alias),q===`ssh`?Ze(null):C(null);try{let n=await R(e,t===void 0?void 0:{label:t});Me(``),Ie(``),Ye(``),K(!1),y.add({type:`success`,title:d[e.alias]?`Environment reconnected`:`Environment connected`,description:`${n.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=$t(e);q===`ssh`?Ze(t):C(t)}finally{E(null)}},[q,d]);(0,Z.useEffect)(()=>{e&&Ce&&q===`ssh`&&(h||b||Mn())},[Ce,e,h,b,Mn,q]),(0,Z.useEffect)(()=>{if(e){a(`owner`);return}let t=!1;return n().then(e=>{t||(a(e.authenticated?e.role??null:null),s(e.auth.policy))}).catch(()=>{t||(a(null),s(null))}),()=>{t=!0}},[e]),(0,Z.useEffect)(()=>{if(!Mt)return;let t=!1;me(!0);let n=P().client.server.subscribeAuthAccess(e=>{if(!t){switch(e.type){case`snapshot`:se(on(e.payload.pairingLinks.map(e=>cn(e)))),ce(sn(e.payload.clientSessions.map(e=>ln(e))));break;case`pairingLinkUpserted`:se(t=>un(t,cn(e.payload)));break;case`pairingLinkRemoved`:se(t=>dn(t,e.payload.id));break;case`clientUpserted`:ce(t=>fn(t,ln(e.payload)));break;case`clientRemoved`:ce(t=>pn(t,e.payload.sessionId))}ue(null),me(!1)}},{onResubscribe:()=>{t||me(!0)}});return e?(e.getServerExposureState().then(e=>{t||j(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load network exposure state.`;H(n)}),e.getAdvertisedEndpoints().then(e=>{t||B(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;H(n)})):(j(null),P().client.server.getAdvertisedEndpoints().then(e=>{t||B(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;H(n)})),()=>{t=!0,n()}},[Mt,e]),(0,Z.useEffect)(()=>{Mt||(me(!1),se([]),ce([]),ue(null),j(null),B([]),H(null))},[Mt]);let Pn=(0,Z.useMemo)(()=>ne.filter(e=>e.role===`client`),[ne]),Fn=(0,Z.useMemo)(()=>L.find(hn)??null,[L]),In=(0,Z.useMemo)(()=>Pt?L.filter(e=>!hn(e)):[],[L,Pt]),Ln=(0,Z.useMemo)(()=>Fn?[...In,Fn]:In,[Fn,In]),Rn=Pt||Fn?.status===`available`,zn=(0,Z.useMemo)(()=>mn(In,At),[At,In]),Bn=(0,Z.useMemo)(()=>zn??mn(Fn?[Fn]:[],At),[At,zn,Fn]),Vn=Bn?gn(Bn):null,Hn=(0,Z.useCallback)(e=>{jt(gn(e))},[jt]),Un=(0,Z.useCallback)(e=>{let t=Zt(e);if(t){J(t.host),Ae(t.pairingCode);return}J(e)},[]),Wn=e=>{let t=q===e.mode;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:_(`group flex min-h-24 items-start gap-3 rounded-lg border p-4 text-left`,t?`border-primary/50 bg-primary/5`:`border-border/60 hover:bg-muted/40`),disabled:$e,onClick:()=>{Te(e.mode)},children:[e.icon?(0,Q.jsx)(`span`,{className:_(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border`,t?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-background text-muted-foreground group-hover:text-foreground`),children:e.icon}):null,(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})},Gn=()=>(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Host`}),(0,Q.jsx)(Pe,{value:De,onChange:e=>Un(e.target.value),placeholder:`backend.example.com`,disabled:$e,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Pairing code`}),(0,Q.jsx)(Pe,{value:ke,onChange:e=>Ae(e.target.value),placeholder:`PAIRCODE`,disabled:$e,spellCheck:!1})]})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:[`Paste a full pairing URL here to fill both fields automatically.`,` `,Ut(e?`desktop`:`browser`)]})})]}),Kn=()=>(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[Gn(),Xe?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:Xe}):null,(0,Q.jsxs)(O,{variant:`outline`,className:`w-full`,disabled:$e,onClick:()=>void bn(),children:[(0,Q.jsx)(at,{className:`size-3.5`}),$e?`Adding…`:`Add environment`]})]}),qn=()=>(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`SSH host or alias`}),(0,Q.jsx)(Pe,{value:je,onChange:e=>Me(e.target.value),placeholder:`Search hosts or type devbox`,disabled:$e,spellCheck:!1})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_7rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Username`}),(0,Q.jsx)(Pe,{value:Ne,onChange:e=>Ie(e.target.value),placeholder:`root`,disabled:$e,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Port`}),(0,Q.jsx)(Pe,{value:Ge,onChange:e=>Ye(e.target.value),placeholder:`22`,inputMode:`numeric`,disabled:$e,spellCheck:!1})]})]}),Xe||S?(0,Q.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:Xe??S}):null,(0,Q.jsxs)(O,{variant:`outline`,className:`w-full`,disabled:$e,onClick:()=>void bn(),children:[(0,Q.jsx)(at,{className:`size-3.5`}),$e?`Adding…`:`Add environment`]})]}),(0,Q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border/60`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/60 bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Suggested hosts`}),(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`From SSH config and known hosts`})]}),(0,Q.jsxs)(O,{size:`xs`,variant:`ghost`,disabled:b,onClick:()=>void Mn(),children:[b?(0,Q.jsx)(Ee,{className:`size-3 animate-spin`}):(0,Q.jsx)(Ee,{className:`size-3`}),`Refresh`]})]}),(0,Q.jsx)(Fe,{scrollFade:!0,className:`max-h-56`,children:(0,Q.jsxs)(`div`,{children:[nt.map(e=>(0,Q.jsx)(jn,{target:e,connectingHostAlias:w,onConnect:e=>void Nn(e)},`${e.alias}:${e.hostname}:${e.port??``}`)),h&&!b&&nt.length===0?(0,Q.jsx)(`div`,{className:en,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No new SSH hosts were discovered.`})}):null]})})]})]}),Jn=()=>(0,Q.jsx)(qe,{checked:k?.mode===`network-accessible`,disabled:!k||dt,onCheckedChange:e=>{Ct(e?`network-accessible`:`local-only`),mt(!0)},"aria-label":`Enable network access`}),Yn=e=>Ot?In.map(t=>{let n=gn(t);return(0,Q.jsx)(En,{endpoint:t,isDefault:n===Vn,presentation:e,onSetDefault:Hn,onSetupTailscaleServe:Kt,onDisableTailscaleServe:Jt,isUpdatingTailscaleServe:$},t.id)}):null,Xn=k?.pendingTailscaleServe;return(0,Q.jsxs)(Y,{children:[Mt?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Je,{title:`Manage local backend`,children:[Tt?(0,Q.jsx)(X,{title:`Version drift`,description:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,Q.jsx)(N,{className:`size-3.5 shrink-0`}),`Client `,Tt.clientVersion,`, server`,` `,Tt.serverVersion,`. Sync them if RPC calls or reconnects fail.`]})}):null,e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{title:`Network access`,description:Pt?(0,Q.jsx)(On,{endpoint:zn,hiddenEndpointCount:Math.max(In.length-1,0),expanded:Ot,onToggleExpanded:()=>kt(e=>!e),fallback:k?.endpointUrl?`Reachable at ${k.endpointUrl}`:k?.advertisedHost?`Exposed on all interfaces. Pairing links use ${k.advertisedHost}.`:`Exposed on all interfaces.`}):k?`Limited to this machine.`:`Loading…`,status:k?.pendingMode||V?(0,Q.jsxs)(Q.Fragment,{children:[k?.pendingMode?(0,Q.jsx)(Dn,{message:k.pendingMode===`network-accessible`?`Saved to turn on when Ryco restarts.`:`Saved to turn off when Ryco restarts.`,busy:dt,onRestart:tn,onUndo:()=>void nn()}):null,V?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:V}):null]}):null,control:Jn()}),Yn(`endpoint-rail`),(0,Q.jsx)(X,{title:`Tailscale HTTPS`,description:Fn?Fn.status===`available`?Fn.httpBaseUrl:`Use Tailscale Serve to expose this backend through a MagicDNS HTTPS URL.`:`Start Tailscale to set up HTTPS access through MagicDNS.`,status:Xn?(0,Q.jsx)(Dn,{message:Xn.enabled?k?.tailscaleServeEnabled?`Saved to serve on port ${Xn.port} when Ryco restarts.`:`Saved to turn on when Ryco restarts.`:`Saved to turn off when Ryco restarts.`,busy:$,onRestart:tn,onUndo:()=>void an()}):null,control:Fn?(0,Q.jsx)(qe,{checked:Fn.status===`available`,disabled:$,onCheckedChange:e=>{if(e){Kt(Fn);return}Jt(Fn)},"aria-label":`Enable Tailscale HTTPS`}):null}),(0,Q.jsx)(Rt,{desktopBridge:e})]}):(0,Q.jsx)(X,{title:`Network access`,description:o===`remote-reachable`?`This backend is already configured for remote access. Network exposure changes must be made where the server is launched.`:`This backend is only reachable on this machine. Restart it with a non-loopback host to enable remote pairing.`,control:(0,Q.jsxs)(Se,{children:[(0,Q.jsx)(be,{render:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(qe,{checked:Pt,disabled:!0,"aria-label":`Enable network access`})})}),(0,Q.jsx)(xe,{side:`top`,children:`Network exposure changes restart the backend and must be controlled where the server process is launched.`})]})})]}),Rn?(0,Q.jsx)(Je,{title:`Authorized clients`,headerAction:(0,Q.jsx)(wn,{clientSessions:W,isRevokingOtherClients:ye,onRevokeOtherClients:yn}),children:(e=>(0,Q.jsxs)(Q.Fragment,{children:[le?(0,Q.jsx)(`div`,{className:rn(e),children:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:le})}):null,(0,Q.jsx)(Tn,{endpointUrl:k?.endpointUrl,endpoints:Ln,defaultEndpointKey:Vn,presentation:e,isLoading:de,pairingLinks:Pn,clientSessions:W,revokingPairingLinkId:he,revokingClientSessionId:_e,onRevokePairingLink:_n,onRevokeClientSession:vn})]}))(`current`)}):null,(0,Q.jsx)(Ue,{open:pt,onOpenChange:e=>{dt||mt(e)},onOpenChangeComplete:e=>{e||Ct(null)},children:(0,Q.jsxs)(Be,{children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(He,{children:St===`network-accessible`?`Enable network access?`:`Disable network access?`}),(0,Q.jsx)(Ve,{children:St===`network-accessible`?`Ryco will restart to expose this environment over the network.`:`Ryco will restart and limit this environment back to this machine.`})]}),(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ze,{disabled:dt,render:(0,Q.jsx)(O,{variant:`outline`,disabled:dt}),children:`Cancel`}),(0,Q.jsx)(O,{variant:St===`local-only`?`destructive`:`default`,onClick:Ht,disabled:St===null||dt,children:dt?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(We,{className:`size-3.5`}),`Restarting…`]}):St===`network-accessible`?`Restart and enable`:`Restart and disable`})]})]})}),(0,Q.jsx)(Ue,{open:vt,onOpenChange:e=>{$||yt(e)},children:(0,Q.jsxs)(Be,{children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(He,{children:`Disable Tailscale HTTPS?`}),(0,Q.jsx)(Ve,{children:`Ryco will restart the local backend without Tailscale Serve.`})]}),(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ze,{disabled:$,render:(0,Q.jsx)(O,{variant:`outline`,disabled:$}),children:`Cancel`}),(0,Q.jsx)(O,{variant:`destructive`,onClick:()=>void qt(),disabled:$,children:$?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(We,{className:`size-3.5`}),`Restarting…`]}):`Restart and disable`})]})]})}),(0,Q.jsx)(ee,{open:gt!==null,onOpenChange:e=>{$||e||_t(null)},children:(0,Q.jsxs)(ie,{className:`max-w-md`,children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(oe,{children:`Set up Tailscale HTTPS?`}),(0,Q.jsx)(pe,{children:`Ryco will restart the local backend with Tailscale Serve enabled and ask Tailscale to proxy HTTPS traffic to this backend.`})]}),(0,Q.jsxs)(re,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`HTTPS port`}),(0,Q.jsx)(Pe,{className:`mt-2`,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:bt,onChange:e=>xt(e.target.value),disabled:$})]}),Lt?null:(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:`Enter a port from 1 to 65535.`}),(0,Q.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-muted/20 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`HTTPS endpoint`}),(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm text-foreground`,title:zt??void 0,children:zt??`Pending MagicDNS endpoint`})]})]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(ae,{disabled:$,render:(0,Q.jsx)(O,{variant:`outline`,disabled:$}),children:`Cancel`}),(0,Q.jsx)(O,{onClick:()=>void Gt(),disabled:$||!Lt,children:$?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(We,{className:`size-3.5`}),`Restarting…`]}):`Enable`})]})]})})]}):(0,Q.jsx)(Je,{title:`Local backend access`,children:(0,Q.jsx)(X,{title:`Owner tools`,description:`Pairing links and client-session management are only available to owner sessions for this backend.`})}),Dt,e?(0,Q.jsx)(Nt,{desktopBridge:e}):null,(0,Q.jsxs)(Je,{title:`Remote environments`,headerAction:(0,Q.jsxs)(ee,{open:Ce,onOpenChange:e=>{K(e),e||Ze(null)},children:[(0,Q.jsx)(te,{render:(0,Q.jsxs)(O,{size:`xs`,variant:`outline`,children:[(0,Q.jsx)(at,{className:`size-3`}),`Add environment`]})}),(0,Q.jsxs)(ie,{className:`max-h-[80dvh] sm:max-w-3xl`,children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(oe,{children:`Add Environment`}),(0,Q.jsx)(pe,{children:`Pair another environment to this client.`})]}),(0,Q.jsx)(re,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Wn({mode:`remote`,title:`Remote link`,description:`Enter a backend host and pairing code.`,icon:(0,Q.jsx)(st,{"aria-hidden":!0,className:`size-4`})}),e?Wn({mode:`ssh`,title:`SSH`,description:`Use local SSH config, agent, and tunnels for the backend.`,icon:(0,Q.jsx)(we,{"aria-hidden":!0,className:`size-4`})}):null]}),(0,Q.jsx)(Ke,{children:q===`ssh`?qn():Kn()})]})})]})]}),children:[l.map(e=>(0,Q.jsx)(kn,{environmentId:e,reconnectingEnvironmentId:rt,disconnectingEnvironmentId:ot,removingEnvironmentId:lt,onConnect:xn,onDisconnect:Cn,onRepair:Sn,onRemove:An},e)),l.length===0?(0,Q.jsx)(`div`,{className:en,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No remote environments yet. Click “Add environment” to pair another environment.`})}):null]})]})}function Nn(e){return e.status!==`unavailable`}function Pn(e){y.add({type:`success`,title:e===`hosted-link`?`Hosted app link copied`:e===`link`?`Pairing URL copied`:`Pairing code copied`,description:e===`hosted-link`?`Open it in the browser on the device you want to connect.`:e===`link`?`Open it in the client you want to pair to this environment.`:`Paste it into another client to finish pairing.`})}function Fn(e){return xn(e)?`hosted-link`:`link`}function In(e){return!xn(e.url)}function Ln(e){return xn(e.url)}function Rn(e){return e.currentTarget.select()}function zn(e){return e.currentTarget.select()}function Bn(e){return e!==null}export{Mn as ConnectionsSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$i as t,Fi as n,Gi as r,Ii as i,Ss as a,Zi as o,Zr as s,ad as c,bs as l}from"./runtime-DjjjAcTE.js";import{t as u}from"./react-CwJFpaho.js";import{Ht as d,Kt as f,Ut as p,X as m,z as h}from"./sliding-tabs-BnDSjRU3.js";import{A as g,D as _,M as v,N as y,P as ee,j as te,k as b}from"./popover-OWEv6cQz.js";import{i as x}from"./presentationTier-DPVAxTK4.js";import{t as S}from"./checkbox-CIIIY9FA.js";import{a as C,i as ne,l as re,n as ie,r as w,s as T,t as ae,u as oe}from"./combobox-Dtjtf7AB.js";import{f as se,g as ce,h as E,p as le}from"./pullRequestsModel.logic-Dv_om_C4.js";import{t as D}from"./spinner-lHRJWsym.js";import{a as ue}from"./useGit-CUcs7h5_.js";import{n as de,t as fe}from"./useGitBranchSearch-CeKFtnCL.js";var O=e(u(),1),pe=x(),k=`origin`;function A(e){if(!e.isRemote)return{name:e.name,refName:e.name,isRemote:!1};let t=e.remoteName??e.name.slice(0,Math.max(0,e.name.indexOf(`/`)));if(t!==`origin`)return null;let n=e.name.slice(t.length+1);return n.length===0||n===`HEAD`?null:{name:n,refName:e.name,isRemote:!0}}function j(e){let t=e.status?.refName??e.refs.find(e=>e.current&&!e.isRemote)?.name??null;return t===null?null:{name:t,refName:t,isRemote:!1}}var M=[`main`,`master`];function N(e){let t=e.refs.flatMap(e=>{let t=A(e);return t?[{ref:e,branch:t}]:[]}),n=t.find(({ref:e})=>e.isDefault&&!e.isRemote)?.branch??M.map(e=>t.find(({branch:t})=>t.name===e)?.branch).find(e=>e!==void 0)??null;return n&&n.name!==e.head?n:null}function P(e){let{head:t,status:n}=e;if(!t)return{kind:`none`};if(t.isRemote)return{kind:`pushed`,unpushedCommits:0};if(n&&n.refName===t.name)return n.hasUpstream?{kind:`pushed`,unpushedCommits:n.aheadCount}:{kind:`unpushed`};switch(e.remote){case`present`:return{kind:`pushed`,unpushedCommits:0};case`absent`:return{kind:`unpushed`};case`checking`:return{kind:`checking`};case`failed`:return{kind:`unknown`}}}function me(e,t){return e!==null&&!e.isRemote&&t?.refName!==e.name}function F(e){return!e.rows||e.head===null||e.base===null?null:e.rows.find(t=>t.state===`open`&&t.isCrossRepository!==!0&&t.headRefName===e.head&&t.baseRefName===e.base)??null}function I(e){let{head:t,base:n,pushState:r}=e,i=e.title.trim().length>0;return!t||!n?{canSubmit:!1,notice:null}:t.name===n.name?{canSubmit:!1,notice:{kind:`same-branch`,tone:`blocker`,branch:t.name}}:r.kind===`unpushed`?{canSubmit:!1,notice:{kind:`unpushed`,tone:`blocker`,branch:t.name}}:e.existing?{canSubmit:!1,notice:{kind:`already-open`,tone:`blocker`,number:e.existing.number,branch:t.name}}:r.kind===`checking`?{canSubmit:!1,notice:{kind:`checking`,tone:`note`,branch:t.name}}:{canSubmit:i,notice:r.kind===`pushed`&&r.unpushedCommits>0?{kind:`unpushed-commits`,tone:`note`,branch:t.name,count:r.unpushedCommits}:null}}function L(e,t){switch(e.kind){case`same-branch`:return`The ${t.longName} needs a base other than ${e.branch}.`;case`unpushed`:return`${e.branch} isn't on ${k} yet. Push it, then open the ${t.longName}.`;case`already-open`:return`#${e.number} is already open from ${e.branch}.`;case`checking`:return`Checking ${k} for ${e.branch}…`;case`unpushed-commits`:return`${e.count===1?`1 local commit isn't`:`${e.count} local commits aren't`} on ${k} yet; the ${t.longName} opens without ${e.count===1?`it`:`them`}.`}}function R(e){let t=e.draft&&e.capabilities.create.draft;return{cwd:e.cwd,baseRefName:e.base.name,headRefName:e.head.name,title:e.title.trim(),body:e.body.trimEnd(),...t?{draft:!0}:{}}}var z=c();function B(e){let t=new Map;for(let n of e){let e=A(n);e&&!t.has(e.refName)&&t.set(e.refName,{ref:n,branch:e})}return t}function V(e){let t=(0,pe.c)(56),{environmentId:n,cwd:r}=e,[i,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(``),u=(0,O.useRef)(null),d;t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==c?(d={environmentId:n,cwd:r,open:i,query:c},t[0]=r,t[1]=n,t[2]=i,t[3]=c,t[4]=d):d=t[4];let f=de(d),p;t[5]===f.refs?p=t[6]:(p=B(f.refs),t[5]=f.refs,t[6]=p);let m=p,h;t[7]===m?h=t[8]:(h=[...m.keys()],t[7]=m,t[8]=h);let g=h,_;t[9]!==g||t[10]!==f.matches?(_=g.filter(f.matches),t[9]=g,t[10]=f.matches,t[11]=_):_=t[11];let v=_,y;t[12]!==m||t[13]!==e?(y=t=>{let n=m.get(t);s(!1),l(``),n&&e.onChange(n.branch)},t[12]=m,t[13]=e,t[14]=y):y=t[14];let ee=y,te=e.value?.refName??null,b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{s(e),e||l(``)},t[15]=b):b=t[15];let x=`${e.label}: ${e.value?.name??`none`}`,S;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,z.jsx)(o,{type:`button`,variant:`outline`,size:`sm`}),t[16]=S):S=t[16];let se=e.value?`truncate`:`truncate text-muted-foreground`,ce=e.value?.name??e.placeholder,E;t[17]!==ce||t[18]!==se?(E=(0,z.jsx)(`span`,{className:se,children:ce}),t[17]=ce,t[18]=se,t[19]=E):E=t[19];let le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,z.jsx)(a,{"aria-hidden":!0,className:`size-3.5 shrink-0 opacity-60`}),t[20]=le):le=t[20];let D;t[21]!==E||t[22]!==x?(D=(0,z.jsxs)(oe,{ref:u,"aria-label":x,render:S,className:`min-w-0 max-w-[15rem] justify-between gap-1.5 px-2 font-mono text-xs font-normal`,children:[E,le]}),t[21]=E,t[22]=x,t[23]=D):D=t[23];let ue;t[24]===e.label?ue=t[25]:(ue=e.label.toLowerCase(),t[24]=e.label,t[25]=ue);let k=`Find a ${ue}`,A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>l(e.target.value),t[26]=A):A=t[26];let j;t[27]!==c||t[28]!==k?(j=(0,z.jsx)(`div`,{className:`border-b p-1`,children:(0,z.jsx)(w,{"aria-label":k,className:`rounded-md [&_input]:font-sans`,inputClassName:`ring-0`,placeholder:`Find a branch`,showTrigger:!1,size:`sm`,value:c,onChange:A})}),t[27]=c,t[28]=k,t[29]=j):j=t[29];let M=f.isPending&&g.length===0,N;t[30]===M?N=t[31]:(N=fe(M),t[30]=M,t[31]=N);let P;t[32]===N?P=t[33]:(P=(0,z.jsx)(ie,{children:N}),t[32]=N,t[33]=P);let me=e.label,F;t[34]!==m||t[35]!==ee||t[36]!==v||t[37]!==e?(F=v.map((t,n)=>{let r=m.get(t);if(!r)return null;let i=e.tagFor(r.ref);return(0,z.jsx)(ne,{index:n,value:t,onClick:()=>ee(t),children:(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`truncate font-mono text-xs`,children:t}),i?(0,z.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:i}):null]})},t)}),t[34]=m,t[35]=ee,t[36]=v,t[37]=e,t[38]=F):F=t[38];let I;t[39]!==e.label||t[40]!==F?(I=(0,z.jsx)(C,{"aria-label":me,className:`max-h-64`,children:F}),t[39]=e.label,t[40]=F,t[41]=I):I=t[41];let L;t[42]===f.status?L=t[43]:(L=f.status?(0,z.jsx)(re,{children:f.status}):null,t[42]=f.status,t[43]=L);let R;t[44]!==j||t[45]!==P||t[46]!==I||t[47]!==L?(R=(0,z.jsxs)(T,{anchor:u,align:`start`,className:`w-80 overflow-hidden`,children:[j,P,I,L]}),t[44]=j,t[45]=P,t[46]=I,t[47]=L,t[48]=R):R=t[48];let V;return t[49]!==v||t[50]!==g||t[51]!==i||t[52]!==D||t[53]!==R||t[54]!==te?(V=(0,z.jsxs)(ae,{items:g,filteredItems:v,autoHighlight:!0,open:i,value:te,onOpenChange:b,children:[D,R]}),t[49]=v,t[50]=g,t[51]=i,t[52]=D,t[53]=R,t[54]=te,t[55]=V):V=t[55],V}function he(e){let t=(0,pe.c)(9),{environmentId:n,cwd:r,branch:i}=e,[a,o]=(0,O.useState)(0),[c,l]=(0,O.useState)(null),u=`${n}\0${r}\0${i??``}\0${a}`,d,f;t[0]!==i||t[1]!==r||t[2]!==n||t[3]!==u?(d=()=>{if(i===null)return;let e=!1,t=`${k}/${i}`,a=s(n);return(a?a.vcs.listRefs({cwd:r,originOnly:!0,query:t,limit:100}):Promise.reject(Error(`Git refs are unavailable.`))).then(n=>{if(e)return;let r=n.refs.some(e=>e.isRemote&&e.name===t);l({key:u,presence:r?`present`:`absent`})},()=>{e||l({key:u,presence:`failed`})}),()=>{e=!0}},f=[i,r,n,u],t[0]=i,t[1]=r,t[2]=n,t[3]=u,t[4]=d,t[5]=f):(d=t[4],f=t[5]),(0,O.useEffect)(d,f);let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>o(ge),t[6]=p):p=t[6];let m=p,h=i===null?`failed`:c?.key===u?c.presence:`checking`,g;return t[7]===h?g=t[8]:(g={presence:h,recheck:m},t[7]=h,t[8]=g),g}function ge(e){return e+1}function _e(e){return e.length===0?e:`${e[0].toUpperCase()}${e.slice(1)}`}function H(e){let t=(0,pe.c)(9),[n,r]=(0,O.useState)(0),[i,a]=(0,O.useState)(e.open);e.open!==i&&(a(e.open),e.open&&r(ve));let o=(0,O.useRef)(null),s;t[0]!==n||t[1]!==e?(s=e.target?(0,z.jsx)(ye,{...e,target:e.target,titleRef:o,onClose:()=>e.onOpenChange(!1)},n):null,t[0]=n,t[1]=e,t[2]=s):s=t[2];let c;t[3]===s?c=t[4]:(c=(0,z.jsx)(y,{className:`max-w-xl`,showCloseButton:!1,initialFocus:o,children:s}),t[3]=s,t[4]=c);let l;return t[5]!==e.onOpenChange||t[6]!==e.open||t[7]!==c?(l=(0,z.jsx)(_,{open:e.open,onOpenChange:e.onOpenChange,children:c}),t[5]=e.onOpenChange,t[6]=e.open,t[7]=c,t[8]=l):l=t[8],l}function ve(e){return e+1}function ye(e){let t=(0,pe.c)(33),{environmentId:n,cwd:r,repositoryName:a}=e.target,s;t[0]!==r||t[1]!==n?(s={environmentId:n,cwd:r},t[0]=r,t[1]=n,t[2]=s):s=t[2];let c=i(s),l=c.data,u=e.provider===void 0?l?.sourceControlProvider??null:e.provider,m;t[3]!==e.capabilities||t[4]!==u?.kind?(m=e.capabilities??p(u?.kind??`unknown`),t[3]=e.capabilities,t[4]=u?.kind,t[5]=m):m=t[5];let h=m,_;t[6]===u?_=t[7]:(_=f(u),t[6]=u,t[7]=_);let y=_,x=e.capabilities===void 0&&u===null&&c.isPending,S=`New ${y.longName}`;if(!x&&!h.create.supported){let n;t[8]===S?n=t[9]:(n=(0,z.jsx)(ee,{className:`text-base`,children:S}),t[8]=S,t[9]=n);let r;t[10]===a?r=t[11]:(r=(0,z.jsx)(b,{children:a}),t[10]=a,t[11]=r);let i;t[12]!==n||t[13]!==r?(i=(0,z.jsxs)(te,{children:[n,r]}),t[12]=n,t[13]=r,t[14]=i):i=t[14];let s;t[15]!==y.pluralLongName||t[16]!==u?.kind?(s=d(u?.kind??`unknown`,{operation:`createChangeRequest`})??`Ryco can't open ${y.pluralLongName} here.`,t[15]=y.pluralLongName,t[16]=u?.kind,t[17]=s):s=t[17];let c;t[18]===s?c=t[19]:(c=(0,z.jsx)(v,{children:(0,z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s})}),t[18]=s,t[19]=c);let l;t[20]===e.onClose?l=t[21]:(l=(0,z.jsx)(g,{variant:`bare`,children:(0,z.jsx)(o,{variant:`outline`,onClick:e.onClose,children:`Close`})}),t[20]=e.onClose,t[21]=l);let f;return t[22]!==i||t[23]!==c||t[24]!==l?(f=(0,z.jsxs)(z.Fragment,{children:[i,c,l]}),t[22]=i,t[23]=c,t[24]=l,t[25]=f):f=t[25],f}let C;return t[26]!==h||t[27]!==S||t[28]!==x||t[29]!==y||t[30]!==e||t[31]!==l?(C=(0,z.jsx)(U,{...e,heading:S,presentation:y,capabilities:h,hostPending:x,status:l}),t[26]=h,t[27]=S,t[28]=x,t[29]=y,t[30]=e,t[31]=l,t[32]=C):C=t[32],C}function U(e){let i=(0,pe.c)(108),{target:a,presentation:s,capabilities:c,status:l,titleRef:u,onClose:d,onCreated:f}=e,{environmentId:p,cwd:_}=a,y;i[0]!==_||i[1]!==p?(y={environmentId:p,cwd:_,query:``},i[0]=_,i[1]=p,i[2]=y):y=i[2];let x=ue(y),[C,ne]=(0,O.useState)(null),[re,ie]=(0,O.useState)(null),w=C??j({status:l,refs:x.refs}),T=re??N({refs:x.refs,head:w?.name??null}),ae=he({environmentId:p,cwd:_,branch:w&&me(w,l)?w.name:null}),oe=P({head:w,status:l,remote:ae.presence}),de;i[3]!==_||i[4]!==p?(de={environmentId:p,cwd:_,state:`open`,limit:100},i[3]=_,i[4]=p,i[5]=de):de=i[5];let fe=F({rows:m(de).data,head:w?.name??null,base:T?.name??null}),[k,A]=(0,O.useState)(``),[M,L]=(0,O.useState)(``),[B,ge]=(0,O.useState)(!1),H=I({head:w,base:T,title:k,pushState:oe,existing:fe}),ve;i[6]===p?ve=i[7]:(ve={environmentId:p},i[6]=p,i[7]=ve);let ye=h(ve),[U,Ce]=(0,O.useState)(!1),[we,Te]=(0,O.useState)(null),W=H.canSubmit&&!U&&!e.hostPending,Ee=B&&c.create.draft,De;i[8]!==T||i[9]!==M||i[10]!==W||i[11]!==c||i[12]!==ye||i[13]!==_||i[14]!==B||i[15]!==w||i[16]!==f||i[17]!==s||i[18]!==k?(De=async()=>{if(W&&w&&T){Ce(!0),Te(null);try{let e=await ye.mutateAsync(R({cwd:_,head:w,base:T,title:k,body:M,draft:B,capabilities:c}));r.add({type:`success`,title:`${_e(s.longName)} #${e.number} opened`,description:e.title}),f(e)}catch(e){Te(ce(e,`Could not open the ${s.longName}.`)),Ce(!1)}}},i[8]=T,i[9]=M,i[10]=W,i[11]=c,i[12]=ye,i[13]=_,i[14]=B,i[15]=w,i[16]=f,i[17]=s,i[18]=k,i[19]=De):De=i[19];let G=De,Oe;i[20]!==_||i[21]!==p||i[22]!==ae?(Oe=()=>{ae.recheck(),n({environmentId:p,cwd:_})},i[20]=_,i[21]=p,i[22]=ae,i[23]=Oe):Oe=i[23];let ke=Oe,Ae;i[24]!==W||i[25]!==G||i[26]!==k||i[27]!==u||i[28]!==H.notice?.tone?(Ae=e=>{if(!e.defaultPrevented&&e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.contains(e.target)){if(e.preventDefault(),!W&&H.notice?.tone!==`blocker`&&k.trim().length===0){u.current?.focus();return}G()}},i[24]=W,i[25]=G,i[26]=k,i[27]=u,i[28]=H.notice?.tone,i[29]=Ae):Ae=i[29];let je=Ae,Me;i[30]===Symbol.for(`react.memo_cache_sentinel`)?(Me=e=>{ne(e),Te(null)},i[30]=Me):Me=i[30];let Ne=Me,Pe;i[31]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=e=>{ie(e),Te(null)},i[31]=Pe):Pe=i[31];let Fe=Pe,K;i[32]===e.heading?K=i[33]:(K=(0,z.jsx)(ee,{className:`text-base`,children:e.heading}),i[32]=e.heading,i[33]=K);let q;i[34]===a.repositoryName?q=i[35]:(q=(0,z.jsx)(b,{children:a.repositoryName}),i[34]=a.repositoryName,i[35]=q);let J;i[36]!==K||i[37]!==q?(J=(0,z.jsxs)(te,{className:`gap-1 pb-3`,children:[K,q]}),i[36]=K,i[37]=q,i[38]=J):J=i[38];let Ie;i[39]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,z.jsx)(`span`,{children:`From`}),i[39]=Ie):Ie=i[39];let Le=x.isPending?`Loading…`:`Pick a branch`,Y;i[40]!==_||i[41]!==p||i[42]!==w||i[43]!==Le?(Y=(0,z.jsx)(V,{label:`Head branch`,environmentId:p,cwd:_,value:w,onChange:Ne,tagFor:be,placeholder:Le}),i[40]=_,i[41]=p,i[42]=w,i[43]=Le,i[44]=Y):Y=i[44];let Re;i[45]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,z.jsx)(`span`,{children:`into`}),i[45]=Re):Re=i[45];let ze=x.isPending?`Loading…`:`Pick a base`,X;i[46]!==T||i[47]!==_||i[48]!==p||i[49]!==ze?(X=(0,z.jsx)(V,{label:`Base branch`,environmentId:p,cwd:_,value:T,onChange:Fe,tagFor:xe,placeholder:ze}),i[46]=T,i[47]=_,i[48]=p,i[49]=ze,i[50]=X):X=i[50];let Z;i[51]!==Y||i[52]!==X?(Z=(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 text-[13px] text-muted-foreground`,children:[Ie,Y,Re,X]}),i[51]=Y,i[52]=X,i[53]=Z):Z=i[53];let Be;i[54]!==s||i[55]!==e.onOpenExisting||i[56]!==ke||i[57]!==H.notice?(Be=H.notice?(0,z.jsx)(Se,{notice:H.notice,presentation:s,onOpenExisting:e.onOpenExisting,onRecheck:ke}):null,i[54]=s,i[55]=e.onOpenExisting,i[56]=ke,i[57]=H.notice,i[58]=Be):Be=i[58];let Ve;i[59]===A?Ve=i[60]:(Ve=e=>{A(e.target.value),Te(null)},i[59]=A,i[60]=Ve);let He;i[61]!==U||i[62]!==Ve||i[63]!==k||i[64]!==u?(He=(0,z.jsx)(`div`,{className:se,children:(0,z.jsx)(`input`,{ref:u,type:`text`,"aria-label":`Title`,placeholder:`Title`,autoComplete:`off`,value:k,disabled:U,onChange:Ve,className:`block h-9 w-full bg-transparent px-3 text-sm font-medium text-foreground outline-none placeholder:font-normal placeholder:text-muted-foreground/70 disabled:opacity-64`})}),i[61]=U,i[62]=Ve,i[63]=k,i[64]=u,i[65]=He):He=i[65];let Q;i[66]===L?Q=i[67]:(Q=e=>L(e.target.value),i[66]=L,i[67]=Q);let Ue;i[68]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=t(le,`min-h-36`),i[68]=Ue):Ue=i[68];let We;i[69]!==M||i[70]!==U||i[71]!==Q?(We=(0,z.jsx)(`div`,{className:se,children:(0,z.jsx)(`textarea`,{"aria-label":`Description`,placeholder:`Describe the change. Markdown works.`,value:M,disabled:U,onChange:Q,className:Ue})}),i[69]=M,i[70]=U,i[71]=Q,i[72]=We):We=i[72];let Ge;i[73]===we?Ge=i[74]:(Ge=we?(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:we}):null,i[73]=we,i[74]=Ge);let Ke;i[75]!==Z||i[76]!==Be||i[77]!==He||i[78]!==We||i[79]!==Ge?(Ke=(0,z.jsxs)(v,{className:`flex flex-col gap-3`,scrollFade:!1,children:[Z,Be,He,We,Ge]}),i[75]=Z,i[76]=Be,i[77]=He,i[78]=We,i[79]=Ge,i[80]=Ke):Ke=i[80];let qe;i[81]!==c.create.draft||i[82]!==B||i[83]!==U||i[84]!==ge?(qe=c.create.draft?(0,z.jsxs)(`label`,{className:`mr-auto flex cursor-default items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,z.jsx)(S,{checked:B,disabled:U,onCheckedChange:e=>ge(e===!0)}),`Create as draft`]}):null,i[81]=c.create.draft,i[82]=B,i[83]=U,i[84]=ge,i[85]=qe):qe=i[85];let Je;i[86]!==d||i[87]!==U?(Je=(0,z.jsx)(o,{variant:`ghost`,disabled:U,onClick:d,children:`Cancel`}),i[86]=d,i[87]=U,i[88]=Je):Je=i[88];let Ye=!W,Xe;i[89]===G?Xe=i[90]:(Xe=()=>void G(),i[89]=G,i[90]=Xe);let Ze;i[91]===U?Ze=i[92]:(Ze=U?(0,z.jsx)(D,{className:`size-3.5`}):null,i[91]=U,i[92]=Ze);let Qe=Ee?`Create draft`:`Create`,$e;i[93]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,z.jsx)(E,{}),i[93]=$e):$e=i[93];let et;i[94]!==Ye||i[95]!==Xe||i[96]!==Ze||i[97]!==Qe?(et=(0,z.jsxs)(o,{disabled:Ye,"aria-keyshortcuts":`Meta+Enter`,onClick:Xe,children:[Ze,Qe,$e]}),i[94]=Ye,i[95]=Xe,i[96]=Ze,i[97]=Qe,i[98]=et):et=i[98];let $;i[99]!==qe||i[100]!==Je||i[101]!==et?($=(0,z.jsxs)(g,{variant:`bare`,className:`sm:items-center`,children:[qe,Je,et]}),i[99]=qe,i[100]=Je,i[101]=et,i[102]=$):$=i[102];let tt;return i[103]!==je||i[104]!==J||i[105]!==Ke||i[106]!==$?(tt=(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-col`,onKeyDown:je,children:[J,Ke,$]}),i[103]=je,i[104]=J,i[105]=Ke,i[106]=$,i[107]=tt):tt=i[107],tt}function be(e){return e.current?`current`:null}function xe(e){return e.isDefault?`default`:null}function Se(e){let n=(0,pe.c)(19),{notice:r}=e,i=r.tone===`blocker`,a=i?`text-foreground/85`:`text-muted-foreground`,s;n[0]===a?s=n[1]:(s=t(`flex min-h-6 items-center gap-1.5 text-xs`,a),n[0]=a,n[1]=s);let c;n[2]!==i||n[3]!==r.kind?(c=r.kind===`checking`?(0,z.jsx)(D,{"aria-hidden":!0,className:`size-3 shrink-0`}):i?(0,z.jsx)(l,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-warning`}):null,n[2]=i,n[3]=r.kind,n[4]=c):c=n[4];let u;n[5]!==r||n[6]!==e.presentation?(u=L(r,e.presentation),n[5]=r,n[6]=e.presentation,n[7]=u):u=n[7];let d;n[8]===u?d=n[9]:(d=(0,z.jsx)(`span`,{className:`min-w-0`,children:u}),n[8]=u,n[9]=d);let f;n[10]!==r.kind||n[11]!==r.number||n[12]!==e?(f=r.kind===`already-open`?(0,z.jsx)(o,{size:`xs`,variant:`ghost`,className:`ml-auto shrink-0`,onClick:()=>e.onOpenExisting(r.number),children:`Open`}):r.kind===`unpushed`?(0,z.jsx)(o,{size:`xs`,variant:`ghost`,className:`ml-auto shrink-0`,onClick:e.onRecheck,children:`Check again`}):null,n[10]=r.kind,n[11]=r.number,n[12]=e,n[13]=f):f=n[13];let p;return n[14]!==s||n[15]!==c||n[16]!==d||n[17]!==f?(p=(0,z.jsxs)(`div`,{role:`status`,className:s,children:[c,d,f]}),n[14]=s,n[15]=c,n[16]=d,n[17]=f,n[18]=p):p=n[18],p}export{H as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ad as e}from"./runtime-DjjjAcTE.js";import{i as t}from"./presentationTier-DPVAxTK4.js";import{t as n}from"./useNavigate-sQZthdyT.js";import{wn as r}from"./formatCount-B4KLI651.js";import{t as i}from"./CommandPaletteDialog-Db4LH--z.js";import{t as a}from"./CreatePullRequestDialog-CJ7pNCue.js";var o=t(),s=e();function c(){let e=(0,o.c)(12),t=i(d),c=i(u),f=i(l),p=n(),m;e[0]!==p||e[1]!==c||e[2]!==f?(m=e=>{f(!1),c&&p(r({environmentId:c.environmentId,projectId:c.projectId,number:e}))},e[0]=p,e[1]=c,e[2]=f,e[3]=m):m=e[3];let h=m,g;e[4]===h?g=e[5]:(g=e=>h(e.number),e[4]=h,e[5]=g);let _;return e[6]!==t||e[7]!==c||e[8]!==f||e[9]!==h||e[10]!==g?(_=(0,s.jsx)(a,{open:t,onOpenChange:f,target:c,onCreated:g,onOpenExisting:h}),e[6]=t,e[7]=c,e[8]=f,e[9]=h,e[10]=g,e[11]=_):_=e[11],_}function l(e){return e.setOpen}function u(e){return e.request}function d(e){return e.open}export{c as CreatePullRequestDialogHost};
|