ryco-cli 0.1.24 → 0.1.26
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/{GrokDriver-DSPEmiwq.mjs → AcpAdapter-BemMQNbj.mjs} +102 -604
- package/dist/{GrokDriver-RyyFeh_q.cjs → AcpAdapter-CadxcdZV.cjs} +129 -612
- package/dist/AcpNativeLogging-BsbZRRD7.mjs +312 -0
- package/dist/AcpNativeLogging-DZPZNoju.cjs +383 -0
- package/dist/AcpRegistryDriver-BfCPf8FX.cjs +222 -0
- package/dist/AcpRegistryDriver-BpXCjh9I.mjs +221 -0
- package/dist/{AzureDevOpsSourceControlProvider-CrvgKNf2.cjs → AzureDevOpsSourceControlProvider-B9N_8NJg.cjs} +14 -14
- package/dist/{AzureDevOpsSourceControlProvider-BNGEg1R8.mjs → AzureDevOpsSourceControlProvider-BcQO_CyW.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-Bt21jw68.mjs → BitbucketSourceControlProvider-BTUY2ZT8.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-BzhsQwH-.cjs → BitbucketSourceControlProvider-C9WuwvY2.cjs} +14 -14
- package/dist/{BunPTY-TbHbSc8S.mjs → BunPTY-DdnqQAdw.mjs} +1 -1
- package/dist/{ClaudeDriver-B7mbf51W.cjs → ClaudeDriver-BSTxNNGO.cjs} +162 -126
- package/dist/{ClaudeDriver-C4yu7Jit.mjs → ClaudeDriver-Csnp78qR.mjs} +129 -93
- package/dist/{CodexDriver-CR0S17Lb.cjs → CodexDriver-BK4HVNV4.cjs} +145 -60
- package/dist/{CodexDriver-DnnqkGoY.mjs → CodexDriver-fwcV84hX.mjs} +99 -14
- package/dist/{CodexTextGeneration-tlfe1S5W.cjs → CodexTextGeneration-Y2GSS7f1.cjs} +145 -99
- package/dist/{CodexTextGeneration-Cw-FZbSS.mjs → CodexTextGeneration-_4aT5BHa.mjs} +141 -95
- package/dist/{CopilotDriver-GxKLX5pL.mjs → CopilotDriver-B12ZJ-L_.mjs} +69 -7
- package/dist/{CopilotDriver-IBd27Ji2.cjs → CopilotDriver-C7IyIwVW.cjs} +98 -36
- package/dist/{CursorDriver-C4Enoe9N.cjs → CursorDriver-BWmCfJ-w.cjs} +38 -32
- package/dist/{CursorDriver-CNo9Uzo8.mjs → CursorDriver-C_p0v-ul.mjs} +12 -6
- package/dist/{ForgejoSourceControlProvider-Dh6DOoc8.cjs → ForgejoSourceControlProvider-DTRrllIH.cjs} +14 -14
- package/dist/{ForgejoSourceControlProvider-BGXysSX6.mjs → ForgejoSourceControlProvider-DmOGJEaJ.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-8hsv_kCE.cjs → GitHubSourceControlProvider-D-YV8WP6.cjs} +16 -17
- package/dist/{GitHubSourceControlProvider-CPCYV8Xo.mjs → GitHubSourceControlProvider-sQGcwnr3.mjs} +6 -7
- package/dist/{GitLabSourceControlProvider-B0ZbF9Zx.cjs → GitLabSourceControlProvider-kKYYnpER.cjs} +14 -14
- package/dist/{GitLabSourceControlProvider-Bvknpaon.mjs → GitLabSourceControlProvider-mIl-K-4F.mjs} +3 -3
- package/dist/GrokDriver-BFOniP_K.cjs +567 -0
- package/dist/GrokDriver-CDcWkiAi.mjs +552 -0
- package/dist/{Metrics-a1h4iBQi.mjs → Metrics-C-3MahDy.mjs} +1 -107
- package/dist/{Metrics-Bcb9vCAe.cjs → Metrics-DCKbdeoH.cjs} +0 -168
- package/dist/{NodePTY-B_p5tLYO.mjs → NodePTY-DArvQ9bX.mjs} +1 -1
- package/dist/{OpenCodeDriver-CDcvPT9v.cjs → OpenCodeDriver-CckbFEQJ.cjs} +459 -141
- package/dist/{OpenCodeDriver-0q44rSQX.mjs → OpenCodeDriver-CnWJHyDJ.mjs} +430 -112
- package/dist/SideQuestionIsolation-5eGFRW0t.mjs +26 -0
- package/dist/SideQuestionIsolation-DvVKZWxi.cjs +37 -0
- package/dist/{SourceControlProviderDiscoveryCatalog-B37RHe2u.mjs → SourceControlProviderDiscoveryCatalog-BVvq7liJ.mjs} +2 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-DreaAH1H.cjs → SourceControlProviderDiscoveryCatalog-CyUhKJLD.cjs} +6 -5
- package/dist/bin.cjs +12772 -3149
- package/dist/bin.mjs +10669 -1075
- package/dist/client/assets/AccountSettings-DLbcE2w-.js +1 -0
- package/dist/client/assets/Adobe-CNS1-UCS2-fO900upv.bcmap +0 -0
- package/dist/client/assets/Adobe-GB1-UCS2-BA083yIo.bcmap +0 -0
- package/dist/client/assets/Adobe-Japan1-UCS2-BL-4M2vS.bcmap +0 -0
- package/dist/client/assets/Adobe-Korea1-UCS2-BEQZuOdo.bcmap +0 -0
- package/dist/client/assets/AiFocusSettings-FKvdkl4P.js +1 -0
- package/dist/client/assets/{AnimatedHeight-i0YhvlGD.js → AnimatedHeight-CbIEyMLg.js} +1 -1
- package/dist/client/assets/AppearanceSettings-B2LsGKmL.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-AgPy06Mx.js → BranchToolbar.logic-BqkvYNPk.js} +1 -1
- package/dist/client/assets/{BrowserPanel-BWztlNuL.js → BrowserPanel-C_C4zjrh.js} +1 -1
- package/dist/client/assets/ChatRightPanel-ibiQ79jI.js +195 -0
- package/dist/client/assets/{ChatThreadRouteView-CWoBLzR_.js → ChatThreadRouteView-c7AXmbSk.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-DdPKN6rv.js +1 -0
- package/dist/client/assets/CompositeRoot-DKwS-ADi.js +1 -0
- package/dist/client/assets/ComputerUseSettings-DM17BYP5.js +1 -0
- package/dist/client/assets/ConnectionsSettings-D6wysIC8.js +7 -0
- package/dist/client/assets/ContextHandoffEndpointLabel-CsF_maM_.js +4 -0
- package/dist/client/assets/{DiagnosticsSettings-DvnNz2AZ.js → DiagnosticsSettings-Bq2l-C4J.js} +2 -2
- package/dist/client/assets/{DialogHandle-8o3kfoiI.js → DialogHandle-DuKTleCw.js} +1 -1
- package/dist/client/assets/{DialogPopup-CLw6NCkW.js → DialogPopup-Dt7DzTWv.js} +1 -1
- package/dist/client/assets/DialogRoot-DRyawL6l.js +1 -0
- package/dist/client/assets/{DialogTitle-DCHX74Tz.js → DialogTitle-BaxfPC6e.js} +1 -1
- package/dist/client/assets/DialogTrigger-D0PJ8bRT.js +1 -0
- package/dist/client/assets/{DialogViewport-DVDl03yd.js → DialogViewport-C3B2JZWQ.js} +1 -1
- package/dist/client/assets/DraftChatThreadRouteView-B8YiD5NP.js +1 -0
- package/dist/client/assets/ETHK-B5-H-1MLb5v9x.bcmap +0 -0
- package/dist/client/assets/{ExternalIdentityWeb.logic-arHvT6AX.js → ExternalIdentityWeb.logic-CrcNfdHK.js} +1 -1
- package/dist/client/assets/FoxitDingbats-BaQLufoW.pfb +0 -0
- package/dist/client/assets/FoxitFixed-Dyd5Nipw.pfb +0 -0
- package/dist/client/assets/FoxitFixedBold-D5TuYRwj.pfb +0 -0
- package/dist/client/assets/FoxitFixedBoldItalic-BqlXQ_Yv.pfb +0 -0
- package/dist/client/assets/FoxitFixedItalic-DqjQkmbS.pfb +0 -0
- package/dist/client/assets/FoxitSerif-qbgiDIe-.pfb +0 -0
- package/dist/client/assets/FoxitSerifBold-DZZ4CclT.pfb +0 -0
- package/dist/client/assets/FoxitSerifBoldItalic-DSQtwd_X.pfb +0 -0
- package/dist/client/assets/FoxitSerifItalic-CQs5lx9Y.pfb +0 -0
- package/dist/client/assets/FoxitSymbol-BVtbc20u.pfb +0 -0
- package/dist/client/assets/GBK-EUC-H-CAORqCkf.bcmap +0 -0
- package/dist/client/assets/GBK2K-H-Cv55KPk8.bcmap +0 -0
- package/dist/client/assets/GBKp-EUC-H-CElrnV5g.bcmap +0 -0
- package/dist/client/assets/GBT-EUC-H-BTsQIL1M.bcmap +0 -0
- package/dist/client/assets/GBT-H-DL9h-WkS.bcmap +0 -0
- package/dist/client/assets/GBTpc-EUC-H-DnIh5WJ3.bcmap +0 -0
- package/dist/client/assets/{GlassSurface-GY6owikG.js → GlassSurface-CBIEgwt1.js} +1 -1
- package/dist/client/assets/HKscs-B5-H-CXbBbq6g.bcmap +0 -0
- package/dist/client/assets/{HostedConnectionControls-COUhSe9x.js → HostedConnectionControls-DOpTlXzE.js} +1 -1
- package/dist/client/assets/HostedHubRoot-C1jq8cM6.js +2 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-DZhYxv--.js → HostedNativeAuthorizationRoute-Clw1DHQW.js} +2 -2
- package/dist/client/assets/HostedNodeRenameDialog-Bd_Qu_ek.js +1 -0
- package/dist/client/assets/{HostedRelayTrustNotice-Bl6On0Yi.js → HostedRelayTrustNotice-CGcBpT9m.js} +1 -1
- package/dist/client/assets/IntegrationsSettingsPanel-J0qODRW-.js +2 -0
- package/dist/client/assets/KSC-Johab-H-CGtV3MPT.bcmap +0 -0
- package/dist/client/assets/{KeybindingsSettings-CPtXx-W2.js → KeybindingsSettings-CwxIHsFy.js} +1 -1
- package/dist/client/assets/{LazyBrowserPanel-SUIBB7B4.js → LazyBrowserPanel-VNAn6AUL.js} +2 -2
- package/dist/client/assets/LiberationSans-Bold-BPt4bU5Z.ttf +0 -0
- package/dist/client/assets/LiberationSans-BoldItalic-Bj53-jFw.ttf +0 -0
- package/dist/client/assets/LiberationSans-Italic-5QhGB3P9.ttf +0 -0
- package/dist/client/assets/LiberationSans-Regular-cbskN6YR.ttf +0 -0
- package/dist/client/assets/McpServersSettings-1pkIeutq.js +6 -0
- package/dist/client/assets/MobileSheet-DddfN8c2.js +1 -0
- package/dist/client/assets/{NodeSecuritySettings-BFifrshE.js → NodeSecuritySettings-BOIZeFZo.js} +1 -1
- package/dist/client/assets/OpinionatedPluginsSettings-oTIrPtIb.js +1 -0
- package/dist/client/assets/PdfAttachmentPreview-BCMO9OHD.js +54 -0
- package/dist/client/assets/{PhoneGetAppInterstitial-R0cqI17q.js → PhoneGetAppInterstitial-0EOj-PbW.js} +1 -1
- package/dist/client/assets/PhoneHome-Cg7l3b1T.js +1 -0
- package/dist/client/assets/PhoneSettingsSurface-BXAUtZ9M.js +2 -0
- package/dist/client/assets/ProvidersSettingsPanel-BaJgypXu.js +1 -0
- package/dist/client/assets/{QuitShortcutFeedback-CklL3jMd.js → QuitShortcutFeedback-DgJFEd6b.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-CLPBtvH1.js → RedactedSensitiveText-D1VC2xa7.js} +1 -1
- package/dist/client/assets/RootAppShell-D2RjZ9jQ.js +7 -0
- package/dist/client/assets/Separator-CeMncdkm.js +1 -0
- package/dist/client/assets/SettingsDialog-B2hEb6u8.js +2 -0
- package/dist/client/assets/SettingsPanels-DtWLQDne.js +3 -0
- package/dist/client/assets/{SettingsPanels.editor-9pSZP875.js → SettingsPanels.editor-DJRckD71.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-C1F3Brcn.js → SourceControlSettings-IpoZrjt5.js} +1 -1
- package/dist/client/assets/StatisticsPage-CUpE_5Gr.js +1 -0
- package/dist/client/assets/StatisticsPanel-CHrAY5AP.js +1 -0
- package/dist/client/assets/StatisticsSettingsLink-bGWuxNG3.js +1 -0
- package/dist/client/assets/{ThreadTerminalDrawer-CHZ60lPI.js → ThreadTerminalDrawer-BEv83xrk.js} +11 -11
- package/dist/client/assets/ThreadWorkspacePanel-BdMdJVHJ.js +2073 -0
- package/dist/client/assets/UniCNS-UCS2-H-DWzv8UhH.bcmap +0 -0
- package/dist/client/assets/UniCNS-UTF16-H-Bw0JKgCq.bcmap +0 -0
- package/dist/client/assets/UniCNS-UTF32-H-IE_GrH2i.bcmap +0 -0
- package/dist/client/assets/UniCNS-UTF8-H-BbLcFh6Q.bcmap +0 -0
- package/dist/client/assets/UniGB-UCS2-H-D7xzRvZN.bcmap +0 -0
- package/dist/client/assets/UniGB-UTF16-H-DKjbEwc0.bcmap +0 -0
- package/dist/client/assets/UniGB-UTF32-H-Behfouj5.bcmap +0 -0
- package/dist/client/assets/UniGB-UTF8-H-EROft1ro.bcmap +0 -0
- package/dist/client/assets/UniJIS-UCS2-H-2DbZ0MaQ.bcmap +0 -0
- package/dist/client/assets/UniJIS-UTF16-H-BlDDPdCK.bcmap +0 -0
- package/dist/client/assets/UniJIS-UTF32-H-BIQPWkjv.bcmap +0 -0
- package/dist/client/assets/UniJIS-UTF8-H-CGusholx.bcmap +0 -0
- package/dist/client/assets/UniJIS2004-UTF16-H-KXixH-HI.bcmap +0 -0
- package/dist/client/assets/UniJIS2004-UTF32-H-CXrD-9YE.bcmap +0 -0
- package/dist/client/assets/UniJIS2004-UTF8-H-BkOctZjn.bcmap +0 -0
- package/dist/client/assets/UniJISX0213-UTF32-H-BavAhZjb.bcmap +0 -0
- package/dist/client/assets/UniJISX02132004-UTF32-H-DAH-AgUq.bcmap +0 -0
- package/dist/client/assets/UniKS-UCS2-H-YeUc7k1L.bcmap +0 -0
- package/dist/client/assets/UniKS-UTF16-H-B0dvB-Td.bcmap +0 -0
- package/dist/client/assets/UniKS-UTF32-H-olR_LtmR.bcmap +0 -0
- package/dist/client/assets/UniKS-UTF8-H-CbpebD-y.bcmap +0 -0
- package/dist/client/assets/{activity-BMBx2Fu0.js → activity-BmRcsTyL.js} +1 -1
- package/dist/client/assets/{alert-CXnC_RJc.js → alert-C5UiA2xk.js} +1 -1
- package/dist/client/assets/{appChrome-BzM66lXM.js → appChrome-CsZ2ylc1.js} +1 -1
- package/dist/client/assets/{arrow-left-CymyVbCi.js → arrow-left-CSz-z20j.js} +1 -1
- package/dist/client/assets/{arrow-right-9wyq4YVq.js → arrow-right-DEi91hao.js} +1 -1
- package/dist/client/assets/{arrow-up-right-mfU38K6p.js → arrow-up-right-D7SpcTV9.js} +1 -1
- package/dist/client/assets/authorization-B1YXfej3.js +1 -0
- package/dist/client/assets/badge-BjvTY7-E.js +1 -0
- package/dist/client/assets/{bot-BR3RyOWP.js → bot-SC4UGZyw.js} +1 -1
- package/dist/client/assets/{capabilities-C8sxDbKT.js → capabilities-BCkDNe83.js} +1 -1
- package/dist/client/assets/{chart-column-CcRi3pAd.js → chart-column-C08MuLgY.js} +1 -1
- package/dist/client/assets/chevron-right-DgB53U1_.js +1 -0
- package/dist/client/assets/{clipboard-copy-ezz8rnaT.js → clipboard-copy-D74Wvnon.js} +1 -1
- package/dist/client/assets/{data-list-ZLhzdlED.js → data-list-CZ4Utnfl.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-P28r2lN2.js → desktopWorkspace-DVfn9ZT_.js} +1 -1
- package/dist/client/assets/{download-BA9L9tK9.js → download-Dio40wIJ.js} +1 -1
- package/dist/client/assets/editorPreferences-2dG4uloq.js +1 -0
- package/dist/client/assets/{empty-3NpXLnAM.js → empty-6LExKYgQ.js} +1 -1
- package/dist/client/assets/{group-D5qBdsaB.js → group-D_mu0Kiq.js} +1 -1
- package/dist/client/assets/{hostedConnectionCoordinator-CLV-JD1S.js → hostedConnectionCoordinator-YkDLnATK.js} +1 -1
- package/dist/client/assets/{hubRoutes-EWJ3Gdod.js → hubRoutes-D3quWvU7.js} +1 -1
- package/dist/client/assets/{index-DxCd1PgA.js → index-7MTgf8YI.js} +2 -2
- package/dist/client/assets/{input-DrOL1KPS.js → input-CfVJycb1.js} +1 -1
- package/dist/client/assets/jbig2-CNFLgX9F.wasm +0 -0
- package/dist/client/assets/kbd-uFa_tY-L.js +1 -0
- package/dist/client/assets/{key-round-D2DtQ7aS.js → key-round-C-oUSjpF.js} +1 -1
- package/dist/client/assets/{layers-DtSJWmwy.js → layers-Co2a5C1k.js} +1 -1
- package/dist/client/assets/{log-out-YAp9fsOg.js → log-out-pWFhbvwr.js} +1 -1
- package/dist/client/assets/{logging-BuUPX1SP.js → logging-JMrwaeZh.js} +1 -1
- package/dist/client/assets/main-BNPtp9Z0.css +2 -0
- package/dist/client/assets/main-CGeD6yVE.js +9 -0
- package/dist/client/assets/openjpeg-MeY6OQBn.wasm +0 -0
- package/dist/client/assets/{palette-D18VboLH.js → palette-B_6C4fD6.js} +1 -1
- package/dist/client/assets/pdf.worker.min-Dswkl-cV.mjs +29 -0
- package/dist/client/assets/{play-d3KUi4G6.js → play-DFtc9zBy.js} +1 -1
- package/dist/client/assets/primary-CNUdEGcv.js +2 -0
- package/dist/client/assets/providerDriverMeta-Cg_XLUfo.js +1 -0
- package/dist/client/assets/{ProviderModelPicker-dwWhl7Uf.js → providerInstances-JaDrOWPZ.js} +1 -1
- package/dist/client/assets/providerModels-5uOq3qPC.js +1 -0
- package/dist/client/assets/qcms_bg-3PJi_GXR.wasm +0 -0
- package/dist/client/assets/{qr-code-Bk1kdf_k.js → qr-code-BU354aLS.js} +1 -1
- package/dist/client/assets/{qr-code-MAZkoKtL.js → qr-code-DaHWf7Oq.js} +1 -1
- package/dist/client/assets/quickjs-eval-zJSp5SB4.wasm +0 -0
- package/dist/client/assets/radio-group-DKaA1eey.js +2 -0
- package/dist/client/assets/{refresh-cw-DY3_Ph-S.js → refresh-cw-CY5BeUEr.js} +1 -1
- package/dist/client/assets/runtime-BKneT96Q.js +17 -0
- package/dist/client/assets/{save-ugJXuJRM.js → save-DIHMjHXd.js} +1 -1
- package/dist/client/assets/{scroll-area-BMnGzd2a.js → scroll-area-Cq4SX9P8.js} +1 -1
- package/dist/client/assets/{scrollEdges-QLSFwGSQ.js → scrollEdges-BaWRjrac.js} +1 -1
- package/dist/client/assets/{separator-BwUYkCkX.js → separator-BN705fC0.js} +1 -1
- package/dist/client/assets/{settingsLayout-C6SUmJVB.js → settingsLayout-DQERzSce.js} +1 -1
- package/dist/client/assets/{sheet-DLy4aeVa.js → sheet-CFvRY7T6.js} +1 -1
- package/dist/client/assets/{shield-Zq_ygsnJ.js → shield-Zn2kFj5M.js} +1 -1
- package/dist/client/assets/{shield-alert-DfUhTI4-.js → shield-alert-DMB5gKiC.js} +1 -1
- package/dist/client/assets/{shield-check-CO4SMhAs.js → shield-check-DyNf6Bky.js} +1 -1
- package/dist/client/assets/{sidebar-DNnW-a2V.js → sidebar-Bsh64sLK.js} +1 -1
- package/dist/client/assets/sidebarProjectFolders-CQbpO9ZI.js +4 -0
- package/dist/client/assets/{sidebarStatusText-CawrXnx0.js → sidebarStatusText-DCo-whyK.js} +1 -1
- package/dist/client/assets/{skeleton-DRm4_OvB.js → skeleton-DEuowfjY.js} +1 -1
- package/dist/client/assets/{smartphone-O2VACDhU.js → smartphone-BLWJ7C9-.js} +1 -1
- package/dist/client/assets/{sparkles-isHutYWU.js → sparkles-DAXDXp_s.js} +1 -1
- package/dist/client/assets/src-DPpEXU6w.js +14 -0
- package/dist/client/assets/{star-7UHEnC3x.js → star-CjQxHYbD.js} +1 -1
- package/dist/client/assets/switch-LahPAvrd.js +48 -0
- package/dist/client/assets/{toggle-CaKBNe6W.js → toggle-45lsrmyi.js} +1 -1
- package/dist/client/assets/{toggle-group-UeFeTI3u.js → toggle-group-D5pl24ED.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-DV56ekA4.js → tokenModePresentation-CPUsUGY4.js} +1 -1
- package/dist/client/assets/tooltip-B8-izeMo.js +1 -0
- package/dist/client/assets/{unplug-DisTpujT.js → unplug-Bjpxv8i0.js} +1 -1
- package/dist/client/assets/usage-8vQUo0mr.js +1 -0
- package/dist/client/assets/useAppSidebarCollapsed-uwz9Hlgc.js +1 -0
- package/dist/client/assets/useBaseUiId-BtuL7q77.js +1 -0
- package/dist/client/assets/useLabelableId-N_LsKNbf.js +1 -0
- package/dist/client/assets/useNavigate-DADLi29i.js +1 -0
- package/dist/client/assets/usePhoneThreadActions-B9_HK7tn.js +1 -0
- package/dist/client/assets/usePopupViewport-w8BEny9j.js +1 -0
- package/dist/client/assets/useScrollLock-bCmUzTgK.js +1 -0
- package/dist/client/assets/useStatistics-DJtONxT0.js +55 -0
- package/dist/client/assets/useTriggerFocusGuards-C7JWO2LT.js +1 -0
- package/dist/client/assets/useValueChanged-DkoUO9bY.js +1 -0
- package/dist/client/assets/{user-round-DctamWV6.js → user-round-DEWIPpNs.js} +1 -1
- package/dist/client/assets/{vscode-icons-Dw-LGJAv.js → vscode-icons-DTH-Vj-_.js} +1 -1
- package/dist/client/assets/workspaceMetadataProjection-BnpxBe8S.js +1 -0
- package/dist/client/assets/{wrench-Ds8eZerZ.js → wrench-36WYdK_a.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/collectUint8StreamText-BAUF-vzz.mjs +37 -0
- package/dist/collectUint8StreamText-vagpNUMJ.cjs +42 -0
- package/dist/deviceHostWorker-C-BSnmkn.mjs +167 -0
- package/dist/deviceHostWorker-CYnrwfrv.cjs +169 -0
- package/dist/git-C4iJMbBu.mjs +132 -0
- package/dist/git-irmB8_k7.cjs +218 -0
- package/dist/{makeManagedServerProvider-GZcpSLrW.mjs → makeManagedServerProvider-BINne1KE.mjs} +3 -38
- package/dist/{makeManagedServerProvider-VzxWN-04.cjs → makeManagedServerProvider-DGbd8BhM.cjs} +1 -60
- 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-Bj0OUcNJ.cjs +63 -0
- package/dist/runtimeSession-CA6cLWg0.mjs +40 -0
- package/dist/schemaJson-CaG1bOvo.mjs +49 -0
- package/dist/schemaJson-CuhFxa8p.cjs +66 -0
- package/dist/{collectUint8StreamText-DStwNTTK.cjs → src-BlzIcnVG.cjs} +573 -117
- package/dist/{collectUint8StreamText-C_VNyArd.mjs → src-DtEOcXdl.mjs} +389 -95
- package/package.json +1 -1
- package/dist/AcpNativeLogging-COepku4a.cjs +0 -5130
- package/dist/AcpNativeLogging-D7e1dn7s.mjs +0 -5015
- package/dist/client/assets/AccountSettings-ApnDA1f-.js +0 -1
- package/dist/client/assets/AiFocusSettings-CNmGHEcA.js +0 -1
- package/dist/client/assets/AppearanceSettings-BG8W4DP0.js +0 -1
- package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +0 -194
- package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +0 -1
- package/dist/client/assets/CompositeRoot-C1G-Ejus.js +0 -1
- package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +0 -1
- package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +0 -7
- package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +0 -4
- package/dist/client/assets/DialogRoot-SKkIuQHA.js +0 -1
- package/dist/client/assets/DialogTrigger-Bl_fcIV2.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-CEDYjbKq.js +0 -1
- package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +0 -2
- package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +0 -2
- package/dist/client/assets/McpServersSettings-BWIUud0Z.js +0 -6
- package/dist/client/assets/MobileSheet-NTayGHF6.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-D7WuuNWZ.js +0 -1
- package/dist/client/assets/PhoneHome-FqWvnJP_.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +0 -2
- package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +0 -1
- package/dist/client/assets/RootAppShell-BdQCs2XJ.js +0 -7
- package/dist/client/assets/Separator-CpYBhf-I.js +0 -1
- package/dist/client/assets/SettingsDialog-DeMzEeCP.js +0 -2
- package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +0 -3
- package/dist/client/assets/StatisticsPage-C7v-6CTr.js +0 -1
- package/dist/client/assets/StatisticsPanel-CeIjiBm8.js +0 -1
- package/dist/client/assets/StatisticsSettingsLink-5s_violW.js +0 -1
- package/dist/client/assets/ThreadWorkspacePanel-Ct5kMcuY.js +0 -2073
- package/dist/client/assets/authorization-CjOFkg7b.js +0 -1
- package/dist/client/assets/badge-Dg7mXiOh.js +0 -1
- package/dist/client/assets/chevron-right-CuUjBsQV.js +0 -1
- package/dist/client/assets/editorPreferences-DeKdSV3s.js +0 -1
- package/dist/client/assets/kbd-rWDjJnWX.js +0 -1
- package/dist/client/assets/main-BbtLAX7M.js +0 -9
- package/dist/client/assets/main-D4CtFNPY.css +0 -2
- package/dist/client/assets/monitor-OyD484tI.js +0 -1
- package/dist/client/assets/primary-D_D7eLwT.js +0 -2
- package/dist/client/assets/providerDriverMeta-DNTocCcU.js +0 -1
- package/dist/client/assets/providerModels-bFbEIfL9.js +0 -1
- package/dist/client/assets/radio-group-D-VCGinX.js +0 -2
- package/dist/client/assets/runtime-Djy96GJd.js +0 -17
- package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +0 -4
- package/dist/client/assets/src-BSuAGqhK.js +0 -14
- package/dist/client/assets/switch-DD1qVLgN.js +0 -48
- package/dist/client/assets/tooltip-DXvXxL37.js +0 -1
- package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +0 -1
- package/dist/client/assets/useBaseUiId-CJN4MvrU.js +0 -1
- package/dist/client/assets/useLabelableId-BsDFG9Oj.js +0 -1
- package/dist/client/assets/useNavigate-cLfxn_9L.js +0 -1
- package/dist/client/assets/usePhoneThreadActions-rekHL1Mi.js +0 -1
- package/dist/client/assets/usePopupViewport-kXU31P6l.js +0 -1
- package/dist/client/assets/useScrollLock-DjMxrUJe.js +0 -1
- package/dist/client/assets/useStatistics-BYP-9CmW.js +0 -55
- package/dist/client/assets/useTriggerFocusGuards-DuAm2B8C.js +0 -1
- package/dist/client/assets/useValueChanged-DreFjrMK.js +0 -1
- package/dist/client/assets/workspaceMetadataProjection-BL4sEIL2.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D4CtFNPY.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-DxCd1PgA.js";import"./src-BSuAGqhK.js";import{Ar as r,Da as i,F as a,I as o,Ma as s,N as c,Na as l,Nn as u,Oa as d,P as f,Rr as p,Ta as m,Vr as h,_l as g,ja as _,jr as v,kn as y,wa as b,zr as x}from"./runtime-Djy96GJd.js";import{Ft as S,It as C,Mt as w,Nt as T,Pt as E,an as D,jt as O,kt as k,r as A}from"./switch-DD1qVLgN.js";import{t as j}from"./compiler-runtime-qmuS0Svy.js";import{a as M,n as N,o as P}from"./hostedConnectionCoordinator-CLV-JD1S.js";import{t as F}from"./useNavigate-cLfxn_9L.js";import{h as I,t as L}from"./RootAppShell-BdQCs2XJ.js";import{t as R}from"./arrow-left-CymyVbCi.js";import{a as z,c as B,d as V,f as H,i as U,l as ee,o as te,t as W,u as ne}from"./HostedConnectionControls-COUhSe9x.js";import{t as re}from"./chevron-right-CuUjBsQV.js";import{t as ie}from"./key-round-D2DtQ7aS.js";import{t as ae}from"./log-out-YAp9fsOg.js";import{t as oe}from"./palette-D18VboLH.js";import{t as se}from"./refresh-cw-DY3_Ph-S.js";import{t as G}from"./shield-check-CO4SMhAs.js";import{t as ce}from"./user-round-DctamWV6.js";import{_ as le,b as K,ht as ue,o as q}from"./authorization-CjOFkg7b.js";import{n as J,t as Y}from"./input-DrOL1KPS.js";import{a as de,i as fe,n as pe,o as me,r as he,s as ge,t as _e}from"./sheet-DLy4aeVa.js";import{t as ve}from"./skeleton-DRm4_OvB.js";import{t as ye}from"./usePresentationTier-B_SCFvN7.js";import{i as be,r as xe,t as Se}from"./alert-CXnC_RJc.js";import{a as Ce,i as we,n as Te,o as Ee,r as De,t as Oe}from"./MobileSheet-NTayGHF6.js";import{a as ke,i as Ae,n as je,o as Me,r as Ne,t as Pe}from"./empty-3NpXLnAM.js";import{c as Fe,n as Ie,r as Le,t as Re}from"./ExternalIdentityWeb.logic-arHvT6AX.js";import{a as ze}from"./settingsLayout-C6SUmJVB.js";import{a as Be,i as Ve,n as He,o as Ue,r as We}from"./hubRoutes-EWJ3Gdod.js";import{t as Ge}from"./HostedRelayTrustNotice-Bl6On0Yi.js";import{n as X,t as Ke}from"./data-list-ZLhzdlED.js";import{C as qe,a as Je,o as Ye,s as Xe}from"./main-BbtLAX7M.js";var Ze={name:`life-buoy`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]};Ze.node;var Qe=l(Ze),$e={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};$e.node;var et=l($e),Z=e(t(),1),Q=j(),tt=/^[A-Za-z0-9_-]{43}$/u,nt=/^signup_[A-Za-z0-9_-]{22,43}$/u;function rt(e){if(e.pathname===`/public-signup/verify`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash),n=t.get(`attempt`),r=t.get(`attempt_secret`),i=t.get(`token`);return n!==null&&nt.test(n)&&r!==null&&tt.test(r)&&i!==null&&tt.test(i)?{kind:`signup-verification`,attemptId:n,attemptSecret:r,token:i}:{kind:`invalid-signup-verification`}}if(e.pathname===`/password-reset`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&tt.test(t)?{kind:`password-reset`,token:t}:{kind:`invalid-password-reset`}}if(e.pathname===`/email-verification`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&tt.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function it(e){let t=new URL(e.href),n=rt(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function at(){let e=(0,Q.c)(3),t=f(lt),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=st,n=()=>{document.visibilityState===`hidden`?(M(!0),q.suspendBrowser(`hidden`)):e()},r=ot,i=()=>e(),a=()=>e();return document.addEventListener(`visibilitychange`,n),window.addEventListener(`offline`,r),window.addEventListener(`online`,i),window.addEventListener(`pageshow`,a),navigator.onLine||r(),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`offline`,r),window.removeEventListener(`online`,i),window.removeEventListener(`pageshow`,a)}},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function ot(){M(!0),q.suspendBrowser(`offline`)}function st(){document.visibilityState===`visible`&&navigator.onLine&&q.resumeBrowser().then(ct)}function ct(){return M(!1)}function lt(e){return e.accountStatus}var $=g(),ut=100;function dt(e){let t=(0,Q.c)(52),{node:n,open:r,onOpenChange:i,onRename:a}=e,[o,s]=(0,Z.useState)(n.label),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f,p;t[0]!==n.label||t[1]!==r?(f=()=>{r&&(s(n.label),l(!1),d(null))},p=[n.label,r],t[0]=n.label,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Z.useEffect)(f,p);let m;t[4]===o?m=t[5]:(m=o.trim(),t[4]=o,t[5]=m);let h=m,g=h.length===0?`Enter a node name.`:h.length>ut?`Use 100 characters or fewer.`:null,_=g===null&&h!==n.label&&!c,v;t[6]!==_||t[7]!==h||t[8]!==i||t[9]!==a?(v=async()=>{if(_){l(!0),d(null);try{await a(h),i(!1)}catch(e){let t=e;d(t instanceof Error?t.message:`Unable to rename this node.`),l(!1)}}},t[6]=_,t[7]=h,t[8]=i,t[9]=a,t[10]=v):v=t[10];let y=v,b=!c,D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{children:`Rename node`}),(0,$.jsx)(O,{children:`This is the canonical name shown to everyone authorized to use this node.`})]}),t[11]=D):D=t[11];let A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Node name`}),t[12]=A):A=t[12];let j=g!==null||u!==null,M;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{s(e.currentTarget.value),d(null)},t[13]=M):M=t[13];let N;t[14]!==_||t[15]!==y?(N=e=>{e.key===`Enter`&&_&&y()},t[14]=_,t[15]=y,t[16]=N):N=t[16];let P;t[17]!==o||t[18]!==c||t[19]!==N||t[20]!==j?(P=(0,$.jsx)(Y,{id:`hosted-node-name`,value:o,autoFocus:!0,disabled:c,"aria-invalid":j,onChange:M,onKeyDown:N}),t[17]=o,t[18]=c,t[19]=N,t[20]=j,t[21]=P):P=t[21];let F;t[22]===g?F=t[23]:(F=g?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:g}):null,t[22]=g,t[23]=F);let I;t[24]===u?I=t[25]:(I=u?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u}):null,t[24]=u,t[25]=I);let L;t[26]!==P||t[27]!==F||t[28]!==I?(L=(0,$.jsxs)(E,{className:`space-y-2`,children:[A,P,F,I]}),t[26]=P,t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]===i?R=t[31]:(R=()=>i(!1),t[30]=i,t[31]=R);let z;t[32]!==c||t[33]!==R?(z=(0,$.jsx)(x,{variant:`outline`,disabled:c,onClick:R,children:`Cancel`}),t[32]=c,t[33]=R,t[34]=z):z=t[34];let B=!_,V;t[35]===y?V=t[36]:(V=()=>void y(),t[35]=y,t[36]=V);let H=c?`Saving…`:`Save`,U;t[37]!==B||t[38]!==V||t[39]!==H?(U=(0,$.jsx)(x,{disabled:B,onClick:V,children:H}),t[37]=B,t[38]=V,t[39]=H,t[40]=U):U=t[40];let ee;t[41]!==z||t[42]!==U?(ee=(0,$.jsxs)(w,{children:[z,U]}),t[41]=z,t[42]=U,t[43]=ee):ee=t[43];let te;t[44]!==L||t[45]!==ee||t[46]!==b?(te=(0,$.jsxs)(S,{className:`max-w-md`,showCloseButton:b,children:[D,L,ee]}),t[44]=L,t[45]=ee,t[46]=b,t[47]=te):te=t[47];let W;return t[48]!==i||t[49]!==r||t[50]!==te?(W=(0,$.jsx)(k,{open:r,onOpenChange:i,children:te}),t[48]=i,t[49]=r,t[50]=te,t[51]=W):W=t[51],W}var ft=`owner_revoked`,pt=Object.freeze([Object.freeze({id:`access`,text:`Every Hub grant on this node stops working immediately, for everyone authorized through this Hub — not only for you — and any relay channel it has open right now closes.`}),Object.freeze({id:`direct`,text:`Clients paired directly with that machine are separate and keep working. Those are managed on the machine itself, with the ryco auth command.`}),Object.freeze({id:`directory`,text:`It leaves the directory for every account on this Hub, not only yours, and stays gone. There is no undo here and no state it can return to.`}),Object.freeze({id:`return`,text:`Putting that machine back starts on the machine itself: use “Leave this Hub” there, then enroll it again with a new device code and your approval. It is a new enrollment, not a reconnection.`}),Object.freeze({id:`reach`,text:`All of that is recorded here, on the Hub. A node that is offline, unreachable, or long gone is revoked in exactly the same way — which is the point of doing it from here.`})]),mt=`Check the identifier below against the machine you meant. Two nodes can carry the same name, and this is the only value that tells them apart.`;function ht(e){return{title:`Revoke ${e.label}?`,consequences:pt,subjectPrompt:mt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var gt=`Revoke`;function _t(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function vt(e){return e===null||e.outcome===`unchanged`}var yt=e=>Object.freeze(e),bt=Object.freeze([yt({id:`invalidResponse`,probe:Object.freeze({code:`invalid_response`,status:502}),selects:(e,t)=>t===`invalid_response`,failure:Object.freeze({message:`The Hub accepted the request and its answer could not be read, so whether this node was revoked is not known here. Refresh the list and check before trying again.`,outcome:`unknown`})}),yt({id:`transport`,probe:Object.freeze({code:`unavailable`,status:0}),selects:(e,t)=>e===0||t===`timeout`||t===`unavailable`,failure:Object.freeze({message:`The request left this browser and no answer came back, so whether this node was revoked is not known here. Check your connection, then refresh the list and look before trying again.`,outcome:`unknown`})}),yt({id:`csrf`,probe:Object.freeze({code:`csrf_rejected`,status:403}),selects:(e,t)=>t===`csrf_rejected`,failure:Object.freeze({message:`This request could not be verified, so nothing was changed. Refresh the page and try again.`,outcome:`unchanged`})}),yt({id:`unauthorized`,probe:Object.freeze({code:`session_invalid`,status:401}),selects:(e,t)=>e===401||t===`session_invalid`,failure:Object.freeze({message:`Your Hub session is no longer valid, so nothing was changed. Sign in and try again.`,outcome:`unchanged`})}),yt({id:`forbidden`,probe:Object.freeze({code:`forbidden`,status:403}),selects:e=>e===403,failure:Object.freeze({message:`Only an owner of this Hub can revoke a node. Nothing was changed.`,outcome:`unchanged`})}),yt({id:`notFound`,probe:Object.freeze({code:`not_found`,status:404}),selects:e=>e===404,failure:Object.freeze({message:`The Hub has no active node under this identifier: it was already revoked, or it is not this Hub's. Either way there is nothing here left to revoke.`,outcome:`already-gone`})}),yt({id:`conflict`,probe:Object.freeze({code:`conflict`,status:409}),selects:e=>e===409,failure:Object.freeze({message:`The Hub reported a conflicting change on this node, so nothing was changed. Refresh and look at it again before retrying.`,outcome:`unchanged`})}),yt({id:`rateLimited`,probe:Object.freeze({code:`node_rate_limited`,status:429}),selects:e=>e===429,failure:Object.freeze({message:`The Hub is refusing further owner changes for now, so nothing was changed. Wait a little and try again.`,outcome:`unchanged`})}),yt({id:`badRequest`,probe:Object.freeze({code:`invalid_request`,status:400}),selects:(e,t)=>e===400||t===`invalid_request`,failure:Object.freeze({message:`The Hub refused this request, so nothing was changed.`,outcome:`unchanged`})})]),xt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function St(e){let t=Ct(e),n=wt(e);for(let e of bt)if(e.selects(t,n))return e.failure;return xt}function Ct(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function wt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var Tt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Et(e){return e===null||!Number.isFinite(e)?null:Tt.format(new Date(e))}function Dt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Ot(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function kt(e){return Ot(e)}function At(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return Et(e)??`unknown`;let r=Math.floor(n/6e4);if(r<2)return`just now`;if(r<60)return`${String(r)} min ago`;let i=Math.floor(r/60);return i<24?`${String(i)} h ago`:Et(e)??`unknown`}function jt(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${At(e.lastAuthenticatedAt,t)}`:`Last seen ${At(e.presence.lastHeartbeatAt,t)}`}function Mt(e){let t=`${Dt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${kt(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function Nt(e){return e.toSorted((e,t)=>{let n=e.revokedAt===null?0:1,r=t.revokedAt===null?0:1;return n===r?e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`}):n-r})}function Pt(e){return e.filter(e=>e.revokedAt===null).length}function Ft(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function It(e){let t=Pt(e),n=Ft(e),r=e.length-t,i=`${String(t)} authorized · ${n===0?`none online`:`${String(n)} online`}`;return r===0?i:`${i} · ${String(r)} revoked`}function Lt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Rt(e){return e.node.capabilities?.nativeClientRequired===!0?`Open this node in Desktop/Mobile.`:e.node.revokedAt===null?e.directoryStatus!==`ready`||e.browserStatus!==`current`?`Node switching is unavailable until the directory and this browser are current.`:null:`Access to this node was revoked.`}function zt({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=ht(e),l=vt(o);(0,Z.useEffect)(()=>{t&&!i&&(a(!1),s(null))},[e.id,t]);let u=async()=>{if(!i){a(!0),s(null);try{await r(),n(!1)}catch(e){s(St(e)),a(!1)}}};return(0,$.jsx)(k,{open:t,onOpenChange:e=>{(e||!i)&&n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(S,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{children:c.title}),(0,$.jsx)(O,{children:c.subjectPrompt})]}),(0,$.jsxs)(E,{className:`space-y-4`,children:[(0,$.jsxs)(Ke,{children:[(0,$.jsx)(X,{term:`Node`,children:e.label}),(0,$.jsx)(X,{term:`Node ID`,mono:!0,children:c.subjectId}),(0,$.jsx)(X,{term:`Platform`,children:`${Dt(e.platformOs)} · ${e.platformArch}`})]}),(0,$.jsx)(`ul`,{className:`space-y-2 text-xs leading-relaxed text-muted-foreground`,children:c.consequences.map(e=>(0,$.jsx)(`li`,{children:e.text},e.id))}),o?(0,$.jsxs)(`p`,{role:`alert`,className:`flex items-start gap-2 text-xs leading-relaxed text-destructive`,children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(x,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Bt(e){let t=(0,Q.c)(57),{node:n}=e,r=ze(6e4),{copyToClipboard:a,isCopied:o}=p(),c;t[0]===n.createdAt?c=t[1]:(c=Et(n.createdAt),t[0]=n.createdAt,t[1]=c);let l=c,u;t[2]===n.lastAuthenticatedAt?u=t[3]:(u=Et(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=u);let d=u,f;t[4]===n.revokedAt?f=t[5]:(f=Et(n.revokedAt),t[4]=n.revokedAt,t[5]=f);let m=f,h=n.grant.role!==n.effectiveRole,g;t[6]===n?g=t[7]:(g=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(U,{node:n})}),t[6]=n,t[7]=g);let _;t[8]!==n.presence.lastHeartbeatAt||t[9]!==r?(_=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:Et(n.presence.lastHeartbeatAt)??void 0,children:At(n.presence.lastHeartbeatAt,r)}),t[8]=n.presence.lastHeartbeatAt,t[9]=r,t[10]=_):_=t[10];let v;t[11]===_?v=t[12]:(v=(0,$.jsx)(X,{term:`Last heartbeat`,children:_}),t[11]=_,t[12]=v);let y=d??`Never`,b;t[13]===y?b=t[14]:(b=(0,$.jsx)(X,{term:`Last connected`,children:y}),t[13]=y,t[14]=b);let S;t[15]===n.platformOs?S=t[16]:(S=Dt(n.platformOs),t[15]=n.platformOs,t[16]=S);let C=`${S} · ${n.platformArch}`,w;t[17]===C?w=t[18]:(w=(0,$.jsx)(X,{term:`Platform`,children:C}),t[17]=C,t[18]=w);let T;t[19]===n.clientVersion?T=t[20]:(T=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=T);let E;t[21]===n.effectiveRole?E=t[22]:(E=kt(n.effectiveRole),t[21]=n.effectiveRole,t[22]=E);let D;t[23]===E?D=t[24]:(D=(0,$.jsx)(X,{term:`Your role`,children:E}),t[23]=E,t[24]=D);let O;t[25]!==h||t[26]!==n.grant.role?(O=h?(0,$.jsxs)(X,{term:`Granted role`,children:[kt(n.grant.role),(0,$.jsx)(`span`,{className:`mt-1 block text-muted-foreground`,children:`The role on your grant differs from the role in effect.`})]}):null,t[25]=h,t[26]=n.grant.role,t[27]=O):O=t[27];let k=l??`Not reported`,A;t[28]===k?A=t[29]:(A=(0,$.jsx)(X,{term:`Enrolled`,children:k}),t[28]=k,t[29]=A);let j;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==m?(j=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${m??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=m,t[33]=j):j=t[33];let M=o?`Copied`:`Copy node ID`,N;t[34]!==a||t[35]!==n.id?(N=()=>a(n.id,void 0),t[34]=a,t[35]=n.id,t[36]=N):N=t[36];let P;t[37]===o?P=t[38]:(P=o?(0,$.jsx)(s,{"aria-hidden":!0}):(0,$.jsx)(i,{"aria-hidden":!0}),t[37]=o,t[38]=P);let F;t[39]!==M||t[40]!==N||t[41]!==P?(F=(0,$.jsx)(x,{size:`icon-xs`,variant:`ghost`,"aria-label":M,onClick:N,children:P}),t[39]=M,t[40]=N,t[41]=P,t[42]=F):F=t[42];let I;t[43]!==n.id||t[44]!==F?(I=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:F,children:n.id}),t[43]=n.id,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==w||t[47]!==T||t[48]!==D||t[49]!==O||t[50]!==A||t[51]!==j||t[52]!==I||t[53]!==g||t[54]!==v||t[55]!==b?(L=(0,$.jsxs)(Ke,{children:[g,v,b,w,T,D,O,A,j,I]}),t[46]=w,t[47]=T,t[48]=D,t[49]=O,t[50]=A,t[51]=j,t[52]=I,t[53]=g,t[54]=v,t[55]=b,t[56]=L):L=t[56],L}function Vt(e){let t=(0,Q.c)(93),{node:n,directoryStatus:r,browserStatus:i,canRename:a,canRevoke:o,onOpenChange:s,onConnect:c,onRename:l,onRevoke:u}=e,d=ye()===`phone`,[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),g=n!==null;if(!n)return null;let _;t[0]!==i||t[1]!==r||t[2]!==n?(_=Lt({directoryStatus:r,browserStatus:i,node:n}),t[0]=i,t[1]=r,t[2]=n,t[3]=_):_=t[3];let v=_,y;t[4]!==i||t[5]!==r||t[6]!==n?(y=Rt({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=y):y=t[7];let b=y,S;t[8]!==n||t[9]!==c||t[10]!==s?(S=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=S):S=t[11];let C=S,w=v&&b?b:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(Ee,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=Mt(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Te,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(we,{children:[r,a]}),t[18]=r,t[19]=a,t[20]=o):o=t[20];let c;t[21]===n?c=t[22]:(c=(0,$.jsx)(Bt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===w?l=t[24]:(l=w?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:w}):null,t[23]=w,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(Ce,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==v||t[29]!==C?(d=(0,$.jsx)(De,{children:(0,$.jsx)(x,{className:`min-h-11`,disabled:v,onClick:C,children:`Connect`})}),t[28]=v,t[29]=C,t[30]=d):d=t[30];let f;return t[31]!==s||t[32]!==g||t[33]!==u||t[34]!==d||t[35]!==e||t[36]!==o?(f=(0,$.jsxs)(Oe,{open:g,onOpenChange:s,label:e,children:[o,u,d]}),t[31]=s,t[32]=g,t[33]=u,t[34]=d,t[35]=e,t[36]=o,t[37]=f):f=t[37],f}let T=o&&n.revokedAt===null,E;t[38]!==s||t[39]!==f||t[40]!==m?(E=e=>{(e||m===null&&f===null)&&(e||(p(null),h(null)),s(e))},t[38]=s,t[39]=f,t[40]=m,t[41]=E):E=t[41];let D;t[42]===n.label?D=t[43]:(D=(0,$.jsx)(ge,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=D);let O;t[44]===n?O=t[45]:(O=Mt(n),t[44]=n,t[45]=O);let k;t[46]===O?k=t[47]:(k=(0,$.jsx)(pe,{children:O}),t[46]=O,t[47]=k);let A;t[48]!==D||t[49]!==k?(A=(0,$.jsxs)(fe,{children:[D,k]}),t[48]=D,t[49]=k,t[50]=A):A=t[50];let j;t[51]===n?j=t[52]:(j=(0,$.jsx)(Bt,{node:n}),t[51]=n,t[52]=j);let M;t[53]===w?M=t[54]:(M=w?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:w}):null,t[53]=w,t[54]=M);let N;t[55]!==M||t[56]!==j?(N=(0,$.jsxs)(de,{children:[j,M]}),t[55]=M,t[56]=j,t[57]=N):N=t[57];let P;t[58]!==n.id||t[59]!==T?(P=T?(0,$.jsx)(x,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:gt}):null,t[58]=n.id,t[59]=T,t[60]=P):P=t[60];let F;t[61]!==a||t[62]!==n.id?(F=a?(0,$.jsx)(x,{variant:`outline`,onClick:()=>p(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=F):F=t[63];let I;t[64]!==v||t[65]!==C?(I=(0,$.jsx)(x,{disabled:v,onClick:C,children:`Connect`}),t[64]=v,t[65]=C,t[66]=I):I=t[66];let L;t[67]!==P||t[68]!==F||t[69]!==I?(L=(0,$.jsxs)(he,{children:[P,F,I]}),t[67]=P,t[68]=F,t[69]=I,t[70]=L):L=t[70];let R;t[71]!==N||t[72]!==L||t[73]!==A?(R=(0,$.jsxs)(me,{side:`right`,className:`w-full sm:max-w-md`,children:[A,N,L]}),t[71]=N,t[72]=L,t[73]=A,t[74]=R):R=t[74];let z;t[75]!==g||t[76]!==R||t[77]!==E?(z=(0,$.jsx)(_e,{open:g,onOpenChange:E,children:R}),t[75]=g,t[76]=R,t[77]=E,t[78]=z):z=t[78];let B;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==f?(B=a?(0,$.jsx)(dt,{node:n,open:f===n.id,onOpenChange:e=>p(e?n.id:null),onRename:e=>l(n,e)}):null,t[79]=a,t[80]=n,t[81]=l,t[82]=f,t[83]=B):B=t[83];let V;t[84]!==n||t[85]!==u||t[86]!==T||t[87]!==m?(V=T?(0,$.jsx)(zt,{node:n,open:m===n.id,onOpenChange:e=>h(e?n.id:null),onRevoke:()=>u(n)}):null,t[84]=n,t[85]=u,t[86]=T,t[87]=m,t[88]=V):V=t[88];let H;return t[89]!==z||t[90]!==B||t[91]!==V?(H=(0,$.jsxs)($.Fragment,{children:[z,B,V]}),t[89]=z,t[90]=B,t[91]=V,t[92]=H):H=t[92],H}function Ht(e){let t=(0,Q.c)(18),{children:n,title:r,description:i,actions:a,titleRef:o}=e,s;t[0]!==r||t[1]!==o?(s=(0,$.jsx)(`h1`,{ref:o,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[0]=r,t[1]=o,t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=i===void 0?null:(0,$.jsx)(`div`,{className:`mt-1.5 text-muted-foreground text-sm`,children:i}),t[3]=i,t[4]=c);let l;t[5]!==s||t[6]!==c?(l=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=a===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:a}),t[8]=a,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-3`,children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n?f=t[14]:(f=(0,$.jsx)(`div`,{className:`mt-8`,children:n}),t[13]=n,t[14]=f);let p;return t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Ut(e){let t=(0,Q.c)(12),{children:n,className:r,title:i,description:a,actions:o}=e,s;t[0]===r?s=t[1]:(s=h(`app-surface relative rounded-2xl border not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,r),t[0]=r,t[1]=s);let c;t[2]!==o||t[3]!==a||t[4]!==i?(c=i===void 0&&o===void 0?null:(0,$.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2 border-border/60 border-b px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i===void 0?null:(0,$.jsx)(`h2`,{className:`font-medium text-base`,children:i}),a===void 0?null:(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-sm leading-relaxed`,children:a})]}),o===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),t[2]=o,t[3]=a,t[4]=i,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n===void 0?null:(0,$.jsx)(`div`,{className:`px-5 py-4`,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`section`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Wt(e){let t=(0,Q.c)(8),{className:n,size:r}=e,i=r===void 0?`default`:r,a=i===`lg`?`gap-2.5 text-lg`:`gap-2 text-sm`,o;t[0]!==n||t[1]!==a?(o=h(`inline-flex items-center font-semibold text-foreground`,a,n),t[0]=n,t[1]=a,t[2]=o):o=t[2];let s=i===`lg`?`h-6`:`h-4.5`,c;t[3]===s?c=t[4]:(c=(0,$.jsx)(qe,{className:s}),t[3]=s,t[4]=c);let l;return t[5]!==o||t[6]!==c?(l=(0,$.jsxs)(`span`,{className:o,children:[c,Ye]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Gt=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Kt=`px-4 sm:px-6 phone:px-[max(1rem,env(safe-area-inset-left),env(safe-area-inset-right))] phone:pt-[max(2.5rem,calc(env(safe-area-inset-top)+1rem))] phone:pb-[max(2.5rem,calc(env(safe-area-inset-bottom)+1rem))]`,qt=`flex min-h-full flex-col`,Jt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function Yt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=h(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=h(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Jt.page),o=(0,$.jsx)(Wt,{}),t[0]=i,t[1]=a,t[2]=o):(i=t[0],a=t[1],o=t[2]);let s;t[3]===n?s=t[4]:(s=n===void 0?null:(0,$.jsx)(`nav`,{"aria-label":`Hub`,className:`min-w-0 flex-1`,children:n}),t[3]=n,t[4]=s);let c;t[5]===n?c=t[6]:(c=n===void 0?(0,$.jsx)(`div`,{className:`flex-1`}):null,t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=r===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:r}),t[7]=r,t[8]=l);let u;return t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,$.jsx)(`header`,{className:i,children:(0,$.jsxs)(`div`,{className:a,children:[o,s,c,l]})}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Xt(e){let t=(0,Q.c)(16),{children:n,nav:i,trailing:a,scrollRef:o,measure:s}=e,c=s===void 0?`page`:s,l=ye()===`phone`,u;t[0]!==l||t[1]!==i||t[2]!==a?(u=l?null:(0,$.jsx)(Yt,{nav:i,trailing:a}),t[0]=l,t[1]=i,t[2]=a,t[3]=u):u=t[3];let d=l?`min-h-full py-10`:`pt-8 pb-16`,f=Jt[c],p;t[4]!==d||t[5]!==f?(p=h(`mx-auto flex w-full flex-col`,d,Kt,f),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m;t[7]!==n||t[8]!==p?(m=(0,$.jsx)(`section`,{className:p,children:n}),t[7]=n,t[8]=p,t[9]=m):m=t[9];let g;t[10]!==o||t[11]!==m?(g=(0,$.jsx)(`main`,{ref:o,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:m}),t[10]=o,t[11]=m,t[12]=g):g=t[12];let _;return t[13]!==u||t[14]!==g?(_=(0,$.jsx)(v,{children:(0,$.jsx)(r,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[u,g]})})}),t[13]=u,t[14]=g,t[15]=_):_=t[15],_}var Zt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-ApnDA1f-.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),Qt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-BG8W4DP0.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),$t=[{id:`overview`,label:`Overview`,icon:ce},{id:`security`,label:`Security`,icon:G},{id:`appearance`,label:`Appearance`,icon:oe}];function en(e){let t=(0,Q.c)(17),{section:n}=e,r=f(nn),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(x,{variant:`ghost`,onClick:tn,children:[(0,$.jsx)(R,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a=n===`appearance`?`Browser appearance`:`Account`,o;t[1]!==r||t[2]!==n?(o=n===`appearance`?`Saved in this browser. Your other apps and devices keep their own appearance.`:r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=n,t[3]=o):o=t[3];let s;t[4]===n?s=t[5]:(s=$t.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(x,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>Ve({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[4]=n,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(`nav`,{"aria-label":`Account`,className:`shrink-0 sm:w-48`,children:(0,$.jsx)(`ul`,{className:`flex gap-1 overflow-x-auto sm:flex-col sm:overflow-visible`,children:s})}),t[6]=s,t[7]=c);let l;t[8]===n?l=t[9]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(rn,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(ve,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Zt,{}):(0,$.jsx)(Qt,{surface:`hub`})})}),t[8]=n,t[9]=l);let u;t[10]!==c||t[11]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d;return t[13]!==a||t[14]!==o||t[15]!==u?(d=(0,$.jsx)(Xt,{measure:`page`,trailing:i,children:(0,$.jsx)(Ht,{title:a,description:o,children:u})}),t[13]=a,t[14]=o,t[15]=u,t[16]=d):d=t[16],d}function tn(){return Ve({kind:`nodes`})}function nn(e){return e.account}function rn(){let e=(0,Q.c)(11),t=f(an),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Display name`}),e[0]=n):n=e[0];let r=t?.displayName??`—`,i;e[1]===r?i=e[2]:(i=(0,$.jsxs)(`div`,{children:[n,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:r})]}),e[1]=r,e[2]=i);let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Role`}),e[3]=a):a=e[3];let o;e[4]===t?o=e[5]:(o=t===null?`—`:`${t.role.charAt(0).toUpperCase()}${t.role.slice(1)}`,e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=s);let c;return e[8]!==i||e[9]!==s?(c=(0,$.jsx)(Ut,{title:`Your account`,description:`Identity this Hub knows you by.`,children:(0,$.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-4 sm:grid-cols-2`,children:[i,s]})}),e[8]=i,e[9]=s,e[10]=c):c=e[10],c}function an(e){return e.account}function on(e){let t=(0,Q.c)(7),{links:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?[]:n,t[0]=n,t[1]=r);let i=r,a=typeof window>`u`?null:window.location.host,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=a===null?null:(0,$.jsxs)(`p`,{children:[`Signing in to `,(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:a})]}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i.length===0?null:(0,$.jsx)(`ul`,{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1`,children:i.map(sn)}),t[3]=i,t[4]=s);let c;return t[5]===s?c=t[6]:(c=(0,$.jsxs)(`footer`,{className:`mt-10 flex flex-col items-center gap-2 text-center text-muted-foreground text-xs`,children:[o,s]}),t[5]=s,t[6]=c),c}function sn(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(`a`,{className:`rounded-sm underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,href:e.href,rel:`noreferrer`,target:`_blank`,children:e.label})},e.href)}function cn(e){let t=(0,Q.c)(25),{children:n,title:r,description:i,actions:a,trailing:o,scrollRef:s,titleRef:c,measure:l}=e,u=l===void 0?`form`:l,d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=h(Gt,`hub-ambient`),f=h(qt,Kt,`py-10`),t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p=Jt[u],m;t[2]===p?m=t[3]:(m=h(`my-auto w-full self-center phone:my-0 phone:flex phone:max-w-none phone:flex-1 phone:flex-col`,p),t[2]=p,t[3]=m);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Wt,{size:`lg`})}),t[4]=g):g=t[4];let _;t[5]!==r||t[6]!==c?(_=(0,$.jsx)(`h1`,{ref:c,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[5]=r,t[6]=c,t[7]=_):_=t[7];let v;t[8]===i?v=t[9]:(v=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=v);let y;t[10]===n?y=t[11]:(y=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=y);let b;t[12]!==a||t[13]!==_||t[14]!==v||t[15]!==y||t[16]!==o?(b=(0,$.jsxs)(`section`,{className:`hub-gateway-panel app-surface relative rounded-2xl border p-6 not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] sm:p-8 phone:flex phone:flex-1 phone:flex-col phone:rounded-none phone:border-0 phone:p-0 phone:shadow-none phone:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:[_,v,y,a,o]}),t[12]=a,t[13]=_,t[14]=v,t[15]=y,t[16]=o,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(on,{}),t[18]=x):x=t[18];let S;t[19]!==b||t[20]!==m?(S=(0,$.jsx)(`div`,{className:f,children:(0,$.jsxs)(`div`,{className:m,children:[g,b,x]})}),t[19]=b,t[20]=m,t[21]=S):S=t[21];let C;return t[22]!==s||t[23]!==S?(C=(0,$.jsx)(`main`,{ref:s,className:d,children:S}),t[22]=s,t[23]=S,t[24]=C):C=t[24],C}function ln({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(null),[a,s]=(0,Z.useState)(`input`),[c,l]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(null),p=(0,Z.useRef)(``),m=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{m.current?.abort(),m.current=null,p.current=``},[]);let h=()=>{m.current?.abort();let e=new AbortController;return m.current=e,l(!0),f(null),e},g=e=>{m.current===e&&(m.current=null,l(!1))},_=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof le&&e.status===401){p.current=``,n(``),i(null),await q.expireSession();return}f(t??(e instanceof le?e.message:`Hub is temporarily unavailable.`))}},v=async e=>{e.preventDefault();let r=t.trim();n(``),p.current=``;let a=h();try{let e=await o.lookupNodeEnrollment(r,a.signal);if(a.signal.aborted)return;p.current=r,i(e),s(`review`)}catch(e){await _(e)}finally{g(a)}},y=async()=>{let e=p.current;if(!e||!r)return;let t=h();try{if(await o.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;p.current=``,i(null),s(`approved`),await q.refreshDirectory()}catch(e){p.current=``,i(null),s(`input`),await _(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{g(t)}},S=async()=>{let e=p.current;if(!e||!r)return;let t=h();try{if(await o.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;p.current=``,i(null),s(`denied`)}catch(e){await _(e)}finally{g(t)}},C=()=>{m.current?.abort(),p.current=``,n(``),i(null),e()};return a===`approved`||a===`denied`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(d,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:a===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:a===`approved`?`The node can now finish enrollment and connect. Online presence may take a few seconds.`:`This ceremony cannot be reused. Start a new enrollment on the node if needed.`}),(0,$.jsx)(x,{className:`mt-5`,onClick:C,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Review node enrollment`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Compare every field, especially the fingerprint, with the node or a trusted operator channel before approving.`}),(0,$.jsxs)(Ke,{className:`mt-5 rounded-xl border border-border bg-background p-4`,children:[(0,$.jsx)(X,{term:`Label`,children:(0,$.jsx)(`span`,{className:`font-medium break-words`,children:r.label})}),(0,$.jsx)(X,{term:`Platform`,children:`${r.platformOs} · ${r.platformArch}`}),(0,$.jsx)(X,{term:`Version`,mono:!0,children:r.clientVersion}),(0,$.jsx)(X,{term:`Algorithm`,children:r.algorithm}),(0,$.jsx)(X,{term:`Fingerprint`,mono:!0,children:r.fingerprint}),(0,$.jsx)(X,{term:`Expires`,children:new Date(r.expiresAt).toLocaleString()})]}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,a===`confirm-denial`?(0,$.jsxs)(`div`,{className:`mt-4 rounded-lg border border-destructive/30 bg-destructive/5 p-3`,children:[(0,$.jsxs)(`p`,{className:`flex gap-2 text-sm`,children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),` Denial is permanent for this device code.`]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{variant:`destructive`,disabled:c,onClick:()=>void S(),children:`Confirm denial`}),(0,$.jsx)(x,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{disabled:c,onClick:()=>void y(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(x,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(x,{variant:`ghost`,disabled:c,onClick:C,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Enroll a Ryco node`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Start enrollment on the node, then enter the short device code shown there. Codes expire after ten minutes.`}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,(0,$.jsxs)(`form`,{className:`mt-5 space-y-4`,autoComplete:`off`,onSubmit:e=>void v(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-node-device-code`,children:`Device code`}),(0,$.jsx)(Y,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${J}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(x,{type:`button`,variant:`outline`,onClick:C,children:`Cancel`})]})]})]})}function un(e){let t=(0,Q.c)(14),{step:n,total:r,label:i}=e,a=Math.min(Math.max(n,1),r),o;t[0]===i?o=t[1]:(o=i===void 0?null:(0,$.jsxs)(`span`,{className:`sr-only`,children:[`: `,i]}),t[0]=i,t[1]=o);let s;t[2]!==a||t[3]!==o||t[4]!==r?(s=(0,$.jsxs)(`p`,{className:`font-medium text-muted-foreground text-xs`,children:[`Step `,a,` of `,r,o]}),t[2]=a,t[3]=o,t[4]=r,t[5]=s):s=t[5];let c;if(t[6]!==a||t[7]!==r){let e;t[9]===a?e=t[10]:(e=(e,t)=>(0,$.jsx)(`span`,{className:`h-1 flex-1 rounded-full transition-colors ${t<a?`bg-primary`:`bg-border`}`},t),t[9]=a,t[10]=e),c=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex flex-1 items-center gap-1.5`,children:Array.from({length:r},e)}),t[6]=a,t[7]=r,t[8]=c}else c=t[8];let l;return t[11]!==s||t[12]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}var dn=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,fn=null;function pn(){return window.turnstile?Promise.resolve(window.turnstile):fn||(fn=new Promise((e,t)=>{let n=document.querySelector(`script[src="${dn}"]`),r=n??document.createElement(`script`);r.addEventListener(`load`,()=>{window.turnstile?e(window.turnstile):t(Error(`Turnstile did not initialize`))},{once:!0}),r.addEventListener(`error`,()=>t(Error(`Turnstile could not be loaded`)),{once:!0}),n||(r.src=dn,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw fn=null,e}),fn)}function mn(e){let t=(0,Q.c)(10),{siteKey:n,action:r,onToken:i}=e,a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(!1),c,l;t[0]!==r||t[1]!==i||t[2]!==n?(c=()=>{let e=!1,t=null;return i(null),s(!1),pn().then(o=>{e||a.current===null||(t={api:o,id:o.render(a.current,{sitekey:n,action:r,theme:document.documentElement.classList.contains(`dark`)?`dark`:`light`,callback:t=>{e||i(t)},"expired-callback":()=>{e||i(null)},"error-callback":()=>{e||(i(null),s(!0))}})})}).catch(()=>{e||s(!0)}),()=>{e=!0,i(null),t&&t.api.remove(t.id)}},l=[r,i,n],t[0]=r,t[1]=i,t[2]=n,t[3]=c,t[4]=l):(c=t[3],l=t[4]),(0,Z.useEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{ref:a,"aria-label":`Anti-bot verification`,className:`min-h-[65px]`}),t[5]=u):u=t[5];let d;t[6]===o?d=t[7]:(d=o?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Verification could not load. Check your connection and try again.`}):null,t[6]=o,t[7]=d);let f;return t[8]===d?f=t[9]:(f=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[u,d]}),t[8]=d,t[9]=f),f}function hn(e,t){return e instanceof le?e.message:t}function gn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),ue(e)}function _n(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(!0),a,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=new AbortController;return o.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||i(!1)}),()=>e.abort()},s=[],e[0]=a,e[1]=s):(a=e[0],s=e[1]),(0,Z.useEffect)(a,s);let c;return e[2]!==t||e[3]!==r?(c={config:t,loading:r},e[2]=t,e[3]=r,e[4]=c):c=e[4],c}function vn(e){return e!==null&&`activationSecret`in e}function yn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[i,a]=(0,Z.useState)(t?.kind===`signup-verification`||t?.kind===`invalid-signup-verification`?`verifying`:`details`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(null),[b,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=(0,Z.useRef)(null),E=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(E.current||t===null)return;if(E.current=!0,t.kind!==`signup-verification`){t.kind===`invalid-signup-verification`&&(w(`This verification link is incomplete or expired. Start signup again.`),a(`details`));return}let e=new AbortController;return S(!0),o.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,a(`credential`)}).catch(e=>w(hn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||S(!1)}),()=>e.abort()},[t,n]);let D=async t=>{if(t.preventDefault(),b||e===null)return;let n=e.antiBot.provider===`bypass`?`development`:v??``;if(!n){w(`Complete the anti-bot check before continuing.`);return}S(!0),w(null);try{let e=await o.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,a(`check-email`)}catch(e){w(hn(e,`Account creation is temporarily unavailable.`))}finally{S(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!b&&t!==null&&`attemptSecret`in t){S(!0),w(null);try{let e=await o.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});f(``),T.current=e,a(`credential`)}catch(e){w(hn(e,`That email code could not be verified.`))}finally{S(!1)}}},k=async e=>{let t=T.current;if(b||!vn(t))return;if(e===`password`&&p!==g){w(`The passwords do not match.`);return}S(!0),w(null);let n=p;h(``),_(``);try{let r=e===`passkey`?await o.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:gn()}):await o.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:gn()});T.current=null,await q.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(hn(e,`Account creation did not complete.`))}finally{S(!1)}},j=i===`details`?1:i===`check-email`||i===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(un,{step:j,total:3,label:j===1?`Your details`:j===2?`Verify your email`:`Choose how you sign in`}),i===`details`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void D(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(Y,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:J,onChange:e=>c(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, numbers, and underscores.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-email`,children:`Email`}),(0,$.jsx)(Y,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:J,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(mn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(wn,{value:C}),(0,$.jsx)(Tn,{onCancel:r,pending:b,submitLabel:`Send verification email`,submitDisabled:e===null})]}):i===`check-email`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void O(e),children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(et,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Enter the six-digit code, or open the verification link on this device.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-code`,children:`Verification code`}),(0,$.jsx)(Y,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:J,onChange:e=>f(e.currentTarget.value)})]}),(0,$.jsx)(wn,{value:C}),(0,$.jsx)(Tn,{onCancel:r,pending:b,submitLabel:`Verify email`})]}):i===`password`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),k(`password`)},children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(Y,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:J,onChange:e=>h(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(Y,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:g,className:J,onChange:e=>_(e.currentTarget.value)})]}),(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`At least `,12,` characters. Password sign-in always asks for an email or authenticator code too.`]}),(0,$.jsx)(wn,{value:C}),(0,$.jsx)(Tn,{onCancel:()=>a(`credential`),pending:b,submitLabel:`Create account`})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(G,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:i===`verifying`?`Verifying your email…`:`Choose how you sign in`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`A passkey is the strongest and easiest option. A password always requires a second factor on future sign-ins.`})]}),(0,$.jsx)(wn,{value:C}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${Je}`,children:[(0,$.jsxs)(x,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||i===`verifying`,onClick:()=>void k(`passkey`),children:[b?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(ie,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(x,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||i===`verifying`,onClick:()=>a(`password`),children:`Use a password instead`}),(0,$.jsx)(x,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function bn({pendingSignup:e,config:t,onCancel:n}){let[r,i]=(0,Z.useState)(e.suggestedUsername??``),[a,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=async e=>{if(e.preventDefault(),c||t===null)return;let n=t.antiBot.provider===`bypass`?`development`:a??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await o.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:gn()});await q.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(hn(e,`GitHub signup did not complete.`))}finally{l(!1)}};return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void f(e),children:[(0,$.jsx)(un,{step:1,total:1,label:`Confirm your Ryco username`}),(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(G,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`GitHub verified`}),(0,$.jsxs)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:[e.displayName?`${e.displayName} authorized Ryco through GitHub. `:`GitHub authorized this account. `,`Choose the public username Ryco should use. Nothing is created until you confirm.`]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-external-signup-username`,children:`Username`}),(0,$.jsx)(Y,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:J,onChange:e=>i(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`GitHub suggested this name. You can change it before creating the account.`})]}),t?.antiBot.provider===`turnstile`?(0,$.jsx)(mn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(wn,{value:u}),(0,$.jsx)(Tn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function xn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,i]=(0,Z.useState)(``),[a,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),g=async e=>{if(e.preventDefault(),!f){p(!0),h(null);try{if(u===null){let e=await o.startPasswordLogin({identifier:r.trim().toLowerCase(),password:a});s(``),d(e)}else{let e=await o.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await q.adoptPublicBrowserIdentity(e)}}catch(e){h(hn(e,`Password sign-in did not complete.`))}finally{p(!1)}}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void g(e),children:[u===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-identifier`,children:`Username or verified email`}),(0,$.jsx)(Y,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:J,onChange:e=>i(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(Y,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:a,className:J,onChange:e=>s(e.currentTarget.value)})]})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-second-factor`,children:u.factor===`totp`?`Authenticator code`:`Email code`}),(0,$.jsx)(Y,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:J,onChange:e=>l(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u.factor===`totp`?`Enter the current code from your authenticator app.`:`We sent a six-digit code to your verified email address.`})]}),(0,$.jsx)(wn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Tn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function Sn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,i]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[a,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),S=(0,Z.useRef)(!1),C=async(e,t)=>{let n=await o.verifyPasswordReset({token:e},t);b.current=n,l(``),i(`password`)};(0,Z.useEffect)(()=>{if(S.current||e===null)return;if(S.current=!0,e.kind!==`password-reset`){e.kind===`invalid-password-reset`&&(y(`This reset link is incomplete or expired. Request a new one.`),i(`request`));return}let n=new AbortController;return _(!0),C(e.token,n.signal).catch(e=>y(hn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||_(!1)}),()=>n.abort()},[e,t]);let w=async e=>{if(e.preventDefault(),!g){_(!0),y(null);try{if(r===`request`)await o.requestPasswordReset({identifier:a.trim().toLowerCase()}),i(`check-email`);else if(r===`check-email`)await C(c.trim());else if(r===`password`){let e=b.current;if(e===null)return;if(u!==f){y(`The passwords do not match.`);return}let t=u;d(``),p(``),await o.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:m.trim()}:{kind:`none`}}),h(``),b.current=null,i(`complete`)}}catch(e){y(hn(e,`Password reset did not complete.`))}finally{_(!1)}}},T=r===`request`?1:r===`check-email`||r===`verifying`?2:3;return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void w(e),children:[r===`complete`?null:(0,$.jsx)(un,{step:T,total:3,label:T===1?`Find your account`:T===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(Y,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:a,className:J,onChange:e=>s(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`If the account is eligible, its verified address receives a single-use reset link.`})]}):r===`check-email`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(et,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Open the reset link, or paste its token below.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-token`,children:`Reset token`}),(0,$.jsx)(Y,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:J,onChange:e=>l(e.currentTarget.value)})]})]}):r===`password`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-password`,children:`New password`}),(0,$.jsx)(Y,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:J,onChange:e=>d(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(Y,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:f,className:J,onChange:e=>p(e.currentTarget.value)})]}),b.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(Y,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:m,className:J,onChange:e=>h(e.currentTarget.value)})]}):null]}):r===`complete`?(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(G,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Password changed`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`Every previous session was revoked. Sign in again with the new password and its normal second factor.`})]}):(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Verifying your reset link…`}),(0,$.jsx)(wn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${Je}`,children:(0,$.jsx)(x,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Tn,{onCancel:n,pending:g,submitLabel:r===`request`?`Send reset email`:r===`check-email`?`Verify reset token`:r===`password`?`Change password`:`Verifying…`,submitDisabled:r===`verifying`})]})}function Cn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(!1),[a,s]=(0,Z.useState)(null),c=async e=>{if(e.preventDefault(),r)return;i(!0),s(null);let a=t;n(``);try{await o.signInWithRecoveryCode(a),await q.bootstrap()}catch(e){s(hn(e,`That recovery code could not be used.`))}finally{i(!1)}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void c(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(Y,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:J,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(wn,{value:a}),(0,$.jsx)(Tn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function wn(e){let t=(0,Q.c)(2),{value:n}=e,r;return t[0]===n?r=t[1]:(r=n?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,t[0]=n,t[1]=r),r}function Tn(e){let t=(0,Q.c)(12),{onCancel:n,pending:r,submitLabel:i,submitDisabled:a}=e,o=r||a!==void 0&&a,s;t[0]===r?s=t[1]:(s=r?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):null,t[0]=r,t[1]=s);let c=r?`Working…`:i,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsxs)(x,{type:`submit`,size:`lg`,className:`min-h-11 w-full`,disabled:o,children:[s,c]}),t[2]=o,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]!==n||t[7]!==r?(u=(0,$.jsx)(x,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,disabled:r,onClick:n,children:`Back`}),t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${Je}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var En;function Dn(){if(window.location.pathname!==`/email-verification`)return null;if(En!==void 0)return En;let e=it({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return En=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,En}function On(){let e=(0,Q.c)(3),t=Ue(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=Xe(t===null?void 0:We(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function kn(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(Dn),r=f(Ln),i=f(In),o=f(Fn),s=f(Pn),c=f(Nn),l=f(Mn),d=a(jn),p=H(),m;e[0]===p.logicalPathname?m=e[1]:(m=B(p.logicalPathname),e[0]=p.logicalPathname,e[1]=m);let h=m,g;e[2]===h?g=e[3]:(g=e=>y(e,h),e[2]=h,e[3]=g);let _=u(g),v=ne();V();let b;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],e[4]=b):b=e[4],(0,Z.useEffect)(An,b),at(),On();let x=Ue(),S;e[5]!==r||e[6]!==x?.kind?(S=()=>{r===`authenticated`&&x?.kind===`sign-up`&&Be(`/`,{replace:!0})},e[5]=r,e[6]=x?.kind,e[7]=S):S=e[7];let C;if(e[8]!==r||e[9]!==x?(C=[r,x],e[8]=r,e[9]=x,e[10]=C):C=e[10],(0,Z.useEffect)(S,C),t?.kind===`email-verification`||t?.kind===`invalid-email-verification`){let r;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{window.history.replaceState(window.history.state,``,`/`),n(null)},e[11]=r):r=e[11];let i;return e[12]===t?i=e[13]:(i=(0,$.jsx)(Rn,{link:t,onContinue:r}),e[12]=t,e[13]=i),i}if(r!==`authenticated`){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jn,{}),e[14]=t):t=e[14],t}if(o.length>0&&!d){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Zn,{}),e[15]=t):t=e[15],t}if(x?.kind===`account`){let t;return e[16]===x.section?t=e[17]:(t=(0,$.jsx)(en,{section:x.section}),e[16]=x.section,e[17]=t),t}if(x?.kind===`nodes`||x?.kind===`nodes-enroll`){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(nr,{}),e[18]=t):t=e[18],t}if(p.nodeId===null){if(v||p.malformed){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(nr,{}),e[19]=t):t=e[19],t}if(i&&c){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(L,{authGateState:{status:`hosted-hub`}}),e[20]=t):t=e[20],t}let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(L,{authGateState:{status:`hosted-cached`}}),e[21]=t):t=e[21],t}if(!i||i.id!==p.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Wn,{}),e[22]=t):t=e[22],t}if(s===`terminal-failure`){let t;return e[23]!==l||e[24]!==i?(t=(0,$.jsx)(Vn,{node:i,message:l}),e[23]=l,e[24]=i,e[25]=t):t=e[25],t}if(!c){if(_){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(L,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]===i?t=e[28]:(t=(0,$.jsx)(Gn,{node:i}),e[27]=i,e[28]=t),t}let w;return e[29]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(L,{authGateState:{status:`hosted-hub`}}),e[29]=w):w=e[29],w}function An(){return P()}function jn(e){return e.leased}function Mn(e){return e.errorMessage}function Nn(e){return e.sessionEstablished}function Pn(e){return e.transportStatus}function Fn(e){return e.recoveryCodes}function In(e){return e.selectedNode}function Ln(e){return e.accountStatus}function Rn(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[i,a]=(0,Z.useState)(n.kind===`email-verification`?`verifying`:`invalid`),s;t[0]!==n.kind||t[1]!==n.token?(s=()=>{if(n.kind!==`email-verification`)return;let e=new AbortController;return o.confirmEmailVerification(n.token,e.signal).then(()=>a(`verified`)).catch(()=>{e.signal.aborted||a(`invalid`)}).finally(zn),()=>e.abort()},t[0]=n.kind,t[1]=n.token,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=[n],t[3]=n,t[4]=c),(0,Z.useEffect)(s,c);let l=i===`verifying`?`Verifying your email`:i===`verified`?`Email verified`:`This verification link is unavailable`,u=i===`verifying`?`This will only take a moment.`:i===`verified`?`Your address is now available for account recovery.`:`The link is incomplete, expired, or has already been used. Request a new one from Account settings.`,d;t[5]!==r||t[6]!==i?(d=i===`verifying`?void 0:(0,$.jsx)(x,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=i,t[7]=d):d=t[7];let f;t[8]===i?f=t[9]:(f=i===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{}),`Confirming the link…`]}):null,t[8]=i,t[9]=f);let p;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsx)(cn,{title:l,description:u,actions:d,children:f}),t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function zn(){En=void 0}function Bn(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{"aria-hidden":!0,className:`mr-2 inline size-4 animate-spin align-[-0.15em] motion-reduce:animate-none`}),e[0]=t):t=e[0],t}function Vn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(W,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(b,{"aria-hidden":!0,className:`size-8 text-destructive`}),t[1]=a):a=t[1];let o=`Unable to connect to ${n.label}`,s=r??`The relay session could not be established. Choose another node or retry.`,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`p`,{role:`alert`,className:`text-muted-foreground text-sm`,children:s}),t[2]=s,t[3]=c);let l;t[4]===r?l=t[5]:(l=r===`Ryco state could not be synchronized.`?(0,$.jsxs)(x,{className:`mt-5`,onClick:Hn,children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Retry`]}):null,t[4]=r,t[5]=l);let u;return t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,$.jsx)(Xt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Un,{tone:`destructive`,icon:a,title:o,children:[c,l]})}),t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function Hn(){q.retrySelectedNode()}function Un(e){let t=(0,Q.c)(9),{children:n,icon:r,title:i,tone:a}=e,o=`mt-4 font-semibold text-2xl tracking-tight ${(a===void 0?`default`:a)===`destructive`?`text-foreground`:``}`,s;t[0]!==o||t[1]!==i?(s=(0,$.jsx)(`h1`,{className:o,children:i}),t[0]=o,t[1]=i,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(`div`,{className:`mt-2`,children:n}),t[3]=n,t[4]=c);let l;return t[5]!==r||t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center pt-10 text-center`,children:[r,s,c]}),t[5]=r,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Wn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Xt,{measure:`content`,children:(0,$.jsx)(Un,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Gn(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=z(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),t[0]=i):i=t[0];let a=`Connecting to ${n.label}`,o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{}),`Preparing a private relay session and synchronizing Ryco state…`]}),t[1]=o):o=t[1];let s;t[2]===r?s=t[3]:(s=(0,$.jsx)(x,{variant:`outline`,className:`mt-5 phone:min-h-11`,onClick:()=>void r(),children:`Back to nodes`}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,$.jsx)(Xt,{measure:`content`,children:(0,$.jsxs)(Un,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Kn(e){let t=(0,Q.c)(15),{bootstrapAvailable:n,publicSignupEnabled:r}=e,[i,a]=(0,Z.useState)(!1),o=(0,Z.useId)(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>a(qn),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,l;t[1]===c?l=t[2]:(l=(0,$.jsx)(_,{"aria-hidden":!0,className:c}),t[1]=c,t[2]=l);let u;t[3]!==i||t[4]!==o||t[5]!==l?(u=(0,$.jsxs)(x,{variant:`ghost`,size:`sm`,"aria-expanded":i,"aria-controls":o,className:`-mx-2 h-auto min-h-8 max-w-full whitespace-normal py-1.5 text-left phone:min-h-11`,onClick:s,children:[`New to this Hub?`,l]}),t[3]=i,t[4]=o,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==r?(d=i?(0,$.jsxs)(`div`,{id:o,className:`mt-2 space-y-2 text-xs leading-relaxed text-muted-foreground`,children:[(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`Getting access.`}),` Accounts are`,r?` open to signup on this Hub. Verify your email, then choose a passkey or password.`:` created by invitation. An owner sends you an invitation code; redeem it below to create your account.`]}),(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`What a passkey is here.`}),` The passkey is created by your browser or password manager and never leaves it. It is the only credential this Hub treats as strong.`]}),n?(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`If this Hub is brand new.`}),` No owner exists yet. “Set up first owner” claims this Hub with a bootstrap credential from whoever deployed it.`]}):null]}):null,t[7]=n,t[8]=i,t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;return t[12]!==u||t[13]!==d?(f=(0,$.jsxs)(`div`,{className:`mt-4`,children:[u,d]}),t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function qn(e){return!e}function Jn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=f(e=>e.accountStatus),r=f(e=>e.errorMessage),i=f(e=>e.errorReason??null),a=f(e=>e.bootstrapAvailable),[s,l]=(0,Z.useState)(()=>it({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),u=(0,Z.useCallback)(()=>l(null),[]),{config:d}=_n(),p=c(e=>e.externalIdentityConfiguration),h=Le(p),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),[C,w]=(0,Z.useState)(void 0),T=Ue(),E=T?.kind===`sign-up`||T?.kind===`sign-up-verify`?`public`:T?.kind===`invitation`?`invitation`:T?.kind===`setup`?`bootstrap`:null,O=T?.kind===`sign-in-password`?`password`:T?.kind===`sign-in-recovery-code`?`recovery-code`:T?.kind===`reset-password`?`password-reset`:null,k=e=>{Ve(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},A=e=>{Ve(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},j=(0,Z.useRef)(null),M=(0,Z.useRef)(null),N=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{q.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(E!==`public`&&e!==`native-authorization`){w(void 0);return}let t=new AbortController;return w(void 0),o.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||w(e)}).catch(()=>{t.signal.aborted||w({status:`none`})}),()=>t.abort()},[e,E]);let P=(0,Z.useCallback)(async()=>{if(!g){_(!0),y(null);try{await Re({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:He({kind:`sign-up`}),start:e=>o.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){y(e instanceof le?e.message:`GitHub sign-in is temporarily unavailable.`),_(!1)}}},[e,g]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||h?.login!==!0||C?.status!==`none`||S.current||(S.current=!0,P())},[t,e,C?.status,h?.login,P,n]),(0,Z.useEffect)(()=>{E===`invitation`||E===`bootstrap`?M.current?.focus({preventScroll:!0}):j.current?.focus({preventScroll:!0})},[O,E]),(0,Z.useEffect)(()=>{N.current?.scrollTo({top:0,left:0})},[O,E]);let F=E===`invitation`||E===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${Je}`,children:[(0,$.jsx)(x,{type:`submit`,form:Yn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:E===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(x,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>q.cancelAuthentication():()=>k(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,I=E||O?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${Je}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[h?.login?(0,$.jsxs)(x,{size:`lg`,className:`phone:min-h-11`,disabled:g||n===`authenticating`||n===`signing-out`,onClick:()=>void P(),children:[g?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(D,{"aria-hidden":!0}),g?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(x,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void q.signIn(),children:[(0,$.jsx)(ie,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(x,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>q.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[d?.status===`enabled`?(0,$.jsx)(x,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`public`),children:`Create account`}):null,(0,$.jsx)(x,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(x,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`bootstrap`),children:`Set up first owner`}):null]})]})}),L=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(x,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void q.bootstrap(),children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),R=i?K(i):null,z=v??r??R?.message,B=v===null&&R!==null?R.title:`Sign-in did not complete`,V=z?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`error`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(be,{children:B}),(0,$.jsx)(xe,{children:z})]})}):null,H=C?.status===`signup`?C:null,U=C?.status===`error`?C:null,ee=e===`native-authorization`&&E!==`public`;if(E===`public`||ee&&(H!==null||U!==null)){let e=()=>{ee?w({status:`none`}):k(null)};return(0,$.jsxs)(cn,{title:`Create your account`,description:ee?`Choose your Ryco username, then return to approving this device.`:`Pick a username and confirm your email. You choose a passkey or a password at the end.`,trailing:L,scrollRef:N,titleRef:j,children:[V,C===void 0?(0,$.jsx)(ve,{className:`h-64 w-full rounded-2xl`}):H?(0,$.jsx)(bn,{pendingSignup:H,config:d?.status===`enabled`?d:null,onCancel:e}):U?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(Se,{variant:`warning`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(be,{children:`GitHub signup did not continue`}),(0,$.jsx)(xe,{children:Ie(U.code)})]}),(0,$.jsx)(x,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(yn,{config:d?.status===`enabled`?d:null,initialLink:s,onConsumeLink:u,onCancel:()=>{u(),k(null)}})]})}if(E===`invitation`||E===`bootstrap`)return(0,$.jsxs)(cn,{title:E===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:E===`invitation`?`Enter the invitation code an owner sent you. Your browser creates a passkey at the same time.`:`No owner exists yet. The bootstrap credential from whoever deployed this Hub makes you its first owner.`,actions:F,trailing:L,scrollRef:N,titleRef:j,children:[V,(0,$.jsx)(Xn,{mode:E,credentialRef:M})]});if(O!==null){let e={password:{title:`Sign in with a password`,description:`Password sign-in always asks for a second factor — an authenticator code, or a code sent to your verified email.`},"recovery-code":{title:`Use a recovery code`,description:`One of the single-use codes you saved when your account was created. Each code works once.`},"password-reset":{title:`Reset your password`,description:`We email a single-use link. Setting a new password signs out every device, including this one.`}}[O];return(0,$.jsxs)(cn,{title:e.title,description:e.description,trailing:L,scrollRef:N,titleRef:j,children:[V,O===`password`?(0,$.jsx)(xn,{onCancel:()=>A(null),onUseRecoveryCode:()=>A(`recovery-code`),onResetPassword:()=>A(`password-reset`)}):O===`recovery-code`?(0,$.jsx)(Cn,{onCancel:()=>A(null)}):(0,$.jsx)(Sn,{initialLink:s,onConsumeLink:u,onCancel:()=>{u(),A(null)}})]})}return(0,$.jsxs)(cn,{title:e===`native-authorization`?`Sign in to continue on your device`:n===`session-expired`?`Your session expired`:`Connect to your Ryco nodes`,description:e===`native-authorization`?`Authenticate in this browser first. Ryco will ask again before it authorizes the mobile app.`:`Ryco Hub reaches the developer machines an owner has authorized for your account. Your session lives in an HttpOnly cookie — nothing about it is readable by this page.`,actions:I,trailing:L,scrollRef:N,titleRef:j,children:[(0,$.jsx)(Ge,{}),(0,$.jsx)(Kn,{bootstrapAvailable:a,publicSignupEnabled:d?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(x,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>A(`password`),children:[(0,$.jsx)(Qe,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(te,{}),V]})}var Yn=`hub-registration-form`;function Xn(e){let t=(0,Q.c)(29),{mode:n,credentialRef:r}=e,[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),u;t[0]!==i||t[1]!==o||t[2]!==n||t[3]!==c?(u=async e=>{e.preventDefault();let t=i;a(``);let r={displayName:o.trim(),passkeyLabel:c.trim()||null};n===`invitation`?await q.redeemInvitation({secret:t,...r}):await q.bootstrapOwner({credential:t,...r})},t[0]=i,t[1]=o,t[2]=n,t[3]=c,t[4]=u):u=t[4];let d=u,f;t[5]===d?f=t[6]:(f=e=>void d(e),t[5]=d,t[6]=f);let p=n===`invitation`?`Invitation code`:`Bootstrap credential`,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(A,{htmlFor:`hub-registration-credential`,children:p}),t[7]=p,t[8]=m);let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>a(e.currentTarget.value),t[9]=h):h=t[9];let g;t[10]!==i||t[11]!==r?(g=(0,$.jsx)(Y,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:J,onChange:h}),t[10]=i,t[11]=r,t[12]=g):g=t[12];let _;t[13]!==m||t[14]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=_):_=t[15];let v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(A,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=v):v=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>s(e.currentTarget.value),t[17]=y):y=t[17];let b;t[18]===o?b=t[19]:(b=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[v,(0,$.jsx)(Y,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:J,onChange:y})]}),t[18]=o,t[19]=b);let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(A,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=x):x=t[20];let S;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>l(e.currentTarget.value),t[21]=S):S=t[21];let C;t[22]===c?C=t[23]:(C=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[x,(0,$.jsx)(Y,{id:`hub-passkey-label`,maxLength:100,value:c,className:J,onChange:S})]}),t[22]=c,t[23]=C);let w;return t[24]!==b||t[25]!==C||t[26]!==f||t[27]!==_?(w=(0,$.jsxs)(`form`,{id:Yn,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[_,b,C]}),t[24]=b,t[25]=C,t[26]=f,t[27]=_,t[28]=w):w=t[28],w}function Zn(){let e=(0,Q.c)(20),t=f(er),{copyToClipboard:n,isCopied:r}=p(),a=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,o;e[0]!==n||e[1]!==t?(o=()=>n(Fe(t),void 0),e[0]=n,e[1]=t,e[2]=o):o=e[2];let c;e[3]===r?c=e[4]:(c=r?(0,$.jsx)(s,{"aria-hidden":!0}):(0,$.jsx)(i,{"aria-hidden":!0}),e[3]=r,e[4]=c);let l=r?`Copied`:`Copy codes`,u;e[5]!==o||e[6]!==c||e[7]!==l?(u=(0,$.jsxs)(x,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:o,children:[c,l]}),e[5]=o,e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(x,{size:`cta`,className:`mt-3 w-full`,onClick:$n,children:`I saved the codes`}),e[9]=d):d=e[9];let m;e[10]===u?m=e[11]:(m=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${Je}`,children:[u,d]}),e[10]=u,e[11]=m);let h;e[12]===t?h=e[13]:(h=t.map(Qn),e[12]=t,e[13]=h);let g;e[14]===h?g=e[15]:(g=(0,$.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:h}),e[14]=h,e[15]=g);let _;return e[16]!==a||e[17]!==m||e[18]!==g?(_=(0,$.jsx)(cn,{title:`Save your recovery codes`,description:a,actions:m,children:g}),e[16]=a,e[17]=m,e[18]=g,e[19]=_):_=e[19],_}function Qn(e){return(0,$.jsx)(`li`,{children:e},e)}function $n(){return q.dismissRecoveryCodes()}function er(e){return e.recoveryCodes}function tr(e){let t=(0,Q.c)(38),{node:n,nowMs:r,disabled:i,onConnect:a,onOpenDetail:o}=e,s;t[0]!==n||t[1]!==r?(s=jt(n,r),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]===n?l=t[4]:(l=N(n),t[3]=n,t[4]=l);let u=l,d=i||u,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(I,{"aria-hidden":!0,className:`size-4`})}),t[5]=f):f=t[5];let p;t[6]===n.label?p=t[7]:(p=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[6]=n.label,t[7]=p);let m;t[8]===n?m=t[9]:(m=Mt(n),t[8]=n,t[9]=m);let h;t[10]===m?h=t[11]:(h=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:m}),t[10]=m,t[11]=h);let g;t[12]===u?g=t[13]:(g=u?(0,$.jsx)(`span`,{className:`block truncate text-xs font-medium text-muted-foreground`,children:`Open in Desktop/Mobile`}):null,t[12]=u,t[13]=g);let _;t[14]!==p||t[15]!==h||t[16]!==g?(_=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[p,h,g]}),t[14]=p,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]===n?v=t[19]:(v=(0,$.jsx)(U,{node:n}),t[18]=n,t[19]=v);let y;t[20]===c?y=t[21]:(y=c?(0,$.jsx)(`span`,{className:`whitespace-nowrap text-[11px] text-muted-foreground max-sm:hidden phone:hidden`,children:c}):null,t[20]=c,t[21]=y);let b;t[22]!==v||t[23]!==y?(b=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[v,y]}),t[22]=v,t[23]=y,t[24]=b):b=t[24];let x;t[25]!==a||t[26]!==b||t[27]!==d||t[28]!==_?(x=(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:a,className:`flex min-h-16 min-w-0 flex-1 flex-wrap items-center gap-3 px-4 py-3 text-left outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:opacity-60 disabled:hover:bg-transparent phone:min-h-18`,children:[f,_,b]}),t[25]=a,t[26]=b,t[27]=d,t[28]=_,t[29]=x):x=t[29];let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[30]=S):S=t[30];let C=`Node details: ${n.label}`,w;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(re,{"aria-hidden":!0,className:`size-4`}),t[31]=w):w=t[31];let T;t[32]!==o||t[33]!==C?(T=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:o,className:`flex w-[44px] shrink-0 items-center justify-center text-muted-foreground outline-none hover:bg-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:w}),t[32]=o,t[33]=C,t[34]=T):T=t[34];let E;return t[35]!==x||t[36]!==T?(E=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[x,S,T]}),t[35]=x,t[36]=T,t[37]=E):E=t[37],E}function nr(){let e=(0,Q.c)(110),t=f(gr),n=f(hr),r=f(mr),i=f(pr),a=f(fr),s=f(dr),c=ne(),l=F(),u=ye()===`phone`,d=Ue()?.kind===`nodes-enroll`,p=ur,[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(null),S=ze(6e4),C,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{y.current?.focus({preventScroll:!0})},w=[],e[0]=C,e[1]=w):(C=e[0],w=e[1]),(0,Z.useEffect)(C,w);let T;e[2]===l?T=e[3]:(T=async e=>{ee(e.id)||(await l({to:`/`,replace:!0}),await q.selectNode(e.id))},e[2]=l,e[3]=T);let E=T;if(d){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Xt,{measure:`content`,children:(0,$.jsx)(ln,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,A,j,M,N,P,L,R,z,B,V,H,U,W,re,ie;if(e[5]!==a||e[6]!==r||e[7]!==h||e[8]!==i||e[9]!==u||e[10]!==t||e[11]!==S||e[12]!==_||e[13]!==c||e[14]!==E||e[15]!==s||e[16]!==n){let o=Nt(t),l;e[35]!==h||e[36]!==t?(l=h===null?null:t.find(e=>e.id===h)??null,e[35]=h,e[36]=t,e[37]=l):l=e[37],A=l,N=a?.role===`owner`;let d=n===`ready`&&t.length===0;M=N&&!d;let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(x,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:lr,children:[(0,$.jsx)(ce,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let v;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(x,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:cr,children:[(0,$.jsx)(ae,{"aria-hidden":!0}),` Sign out`]}),e[39]=v):v=e[39],L=v;let C=u?`mt-3 phone:min-h-11 phone:w-full`:void 0,w,T;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>p(!0),T=(0,$.jsx)(I,{"aria-hidden":!0}),e[40]=w,e[41]=T):(w=e[40],T=e[41]);let F;e[42]===C?F=e[43]:(F=(0,$.jsxs)(x,{className:C,onClick:w,children:[T,` Enroll node`]}),e[42]=C,e[43]=F),j=F;let ee=u?`mt-3 phone:min-h-11 phone:w-full`:void 0,te=n===`loading`,ne;e[44]===n?ne=e[45]:(ne=n===`loading`?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(se,{"aria-hidden":!0}),e[44]=n,e[45]=ne);let oe;e[46]!==ee||e[47]!==te||e[48]!==ne?(oe=(0,$.jsxs)(x,{className:ee,variant:`outline`,disabled:te,onClick:sr,children:[ne,`Refresh nodes`]}),e[46]=ee,e[47]=te,e[48]=ne,e[49]=oe):oe=e[49],P=oe,O=Xt;let G;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(x,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:or,children:(0,$.jsx)(ce,{"aria-hidden":!0})}),e[50]=G):G=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsxs)($.Fragment,{children:[G,(0,$.jsx)(x,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:ar,children:(0,$.jsx)(ae,{"aria-hidden":!0})})]}),e[51]=z):z=e[51],D=Ht,B=y,V=t.length===1?`Your node`:`Your nodes`;let le=a?.displayName??`Hub account`,K;e[52]===a?K=e[53]:(K=a?` · ${a.role.charAt(0).toUpperCase()}${a.role.slice(1)}`:``,e[52]=a,e[53]=K);let ue;e[54]!==le||e[55]!==K?(ue=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,le,K]}),e[54]=le,e[55]=K,e[56]=ue):ue=e[56];let q;e[57]===t?q=e[58]:(q=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:It(t)}):null,e[57]=t,e[58]=q),e[59]!==ue||e[60]!==q?(H=(0,$.jsxs)($.Fragment,{children:[ue,q]}),e[59]=ue,e[60]=q,e[61]=H):H=e[61],e[62]!==j||e[63]!==M||e[64]!==u||e[65]!==P?(U=u?void 0:(0,$.jsxs)($.Fragment,{children:[P,M?j:null]}),e[62]=j,e[63]=M,e[64]=u,e[65]=P,e[66]=U):U=e[66],e[67]===n?W=e[68]:(W=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`warning`,role:`status`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(xe,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=W),e[69]===_?re=e[70]:(re=_?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`warning`,role:`status`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(xe,{children:_})]})}):null,e[69]=_,e[70]=re);let J=n===`stale`?null:i;e[71]!==c||e[72]!==s||e[73]!==J?(ie=(0,$.jsx)(_r,{selection:s,routeNotice:c,error:J}),e[71]=c,e[72]=s,e[73]=J,e[74]=ie):ie=e[74],R=d?(0,$.jsx)(vr,{isOwner:N,onEnroll:()=>p(!0)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`ul`,{role:`list`,className:`mt-5 space-y-2`,"aria-busy":n===`loading`,children:[o.map(e=>(0,$.jsx)(tr,{node:e,nowMs:S,disabled:Lt({directoryStatus:n,browserStatus:r,node:e}),onConnect:()=>void E(e),onOpenDetail:()=>g(e.id)},`${e.id}:${e.environmentId}`)),n===`loading`&&t.length===0?(0,$.jsx)($.Fragment,{children:[0,1,2].map(ir)}):null]}),n===`loading`&&t.length===0?(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:`Loading authorized nodes…`}):null,t.length>0?(0,$.jsx)(`p`,{className:`mt-2 px-1 text-[11px] text-muted-foreground`,children:`Presence refreshes about every 20 seconds.`}):null]}),e[5]=a,e[6]=r,e[7]=h,e[8]=i,e[9]=u,e[10]=t,e[11]=S,e[12]=_,e[13]=c,e[14]=E,e[15]=s,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=A,e[21]=j,e[22]=M,e[23]=N,e[24]=P,e[25]=L,e[26]=R,e[27]=z,e[28]=B,e[29]=V,e[30]=H,e[31]=U,e[32]=W,e[33]=re,e[34]=ie}else D=e[17],O=e[18],k=e[19],A=e[20],j=e[21],M=e[22],N=e[23],P=e[24],L=e[25],R=e[26],z=e[27],B=e[28],V=e[29],H=e[30],U=e[31],W=e[32],re=e[33],ie=e[34];let oe,G;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Ge,{})}),G=(0,$.jsx)(te,{}),e[75]=oe,e[76]=G):(oe=e[75],G=e[76]);let le;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e||g(null)},e[77]=le):le=e[77];let K;e[78]===E?K=e[79]:(K=e=>void E(e),e[78]=E,e[79]=K);let ue;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(ue=async e=>{await o.revokeNode(e.id,ft),v(_t(e.label)),await q.refreshDirectory(),g(null)},e[80]=ue):ue=e[80];let J;e[81]!==r||e[82]!==A||e[83]!==N||e[84]!==n||e[85]!==K?(J=(0,$.jsx)(Vt,{node:A,directoryStatus:n,browserStatus:r,canRename:N,canRevoke:N,onOpenChange:le,onConnect:K,onRename:rr,onRevoke:ue}),e[81]=r,e[82]=A,e[83]=N,e[84]=n,e[85]=K,e[86]=J):J=e[86];let Y;e[87]!==D||e[88]!==R||e[89]!==J||e[90]!==B||e[91]!==V||e[92]!==H||e[93]!==U||e[94]!==W||e[95]!==re||e[96]!==ie?(Y=(0,$.jsxs)(D,{titleRef:B,title:V,description:H,actions:U,children:[W,re,ie,R,oe,G,J]}),e[87]=D,e[88]=R,e[89]=J,e[90]=B,e[91]=V,e[92]=H,e[93]=U,e[94]=W,e[95]=re,e[96]=ie,e[97]=Y):Y=e[97];let de;e[98]!==k||e[99]!==j||e[100]!==M||e[101]!==u||e[102]!==P||e[103]!==L?(de=u?(0,$.jsxs)(`div`,{className:`mt-auto ${Je}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,L]}),M?j:null,P]}):null,e[98]=k,e[99]=j,e[100]=M,e[101]=u,e[102]=P,e[103]=L,e[104]=de):de=e[104];let fe;return e[105]!==O||e[106]!==z||e[107]!==Y||e[108]!==de?(fe=(0,$.jsxs)(O,{trailing:z,children:[Y,de]}),e[105]=O,e[106]=z,e[107]=Y,e[108]=de,e[109]=fe):fe=e[109],fe}async function rr(e,t){await o.renameNode(e.id,t),await q.refreshDirectory()}function ir(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(ve,{className:`h-16 w-full rounded-xl`})},e)}function ar(){q.signOut()}function or(){Ve({kind:`account`,section:`security`})}function sr(){q.refreshDirectory()}function cr(){q.signOut()}function lr(){Ve({kind:`account`,section:`security`})}function ur(e){return Ve(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function dr(e){return e.selectionStatus}function fr(e){return e.account}function pr(e){return e.errorMessage}function mr(e){return e.browserStatus}function hr(e){return e.directoryStatus}function gr(e){return e.nodes}function _r(e){let t=(0,Q.c)(3),{selection:n,routeNotice:r,error:i}=e,a=(n===`authorization-removed`?`Authorization for the previous node was removed.`:n===`revoked`?`The previous node or grant was revoked.`:n===`incompatible`?`The previous node uses an incompatible relay version.`:null)??r??i;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(b,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;return t[1]===a?s=t[2]:(s=(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`error`,children:[o,(0,$.jsx)(xe,{children:a})]})}),t[1]=a,t[2]=s),s}function vr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(ke,{variant:`icon`,children:n?(0,$.jsx)(I,{"aria-hidden":!0}):(0,$.jsx)(G,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Me,{children:`No nodes yet`}),t[2]=a):a=t[2];let o=n?`A node appears here once the Ryco client on that machine has been enrolled. Start enrollment on the node, then enter the short device code it shows — codes expire after ten minutes.`:`A node appears here once an owner of this Hub authorizes your account for it.`,s;t[3]===o?s=t[4]:(s=(0,$.jsx)(Ne,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Ae,{children:[i,a,s]}),t[5]=i,t[6]=s,t[7]=c):c=t[7];let l;t[8]!==n||t[9]!==r?(l=n?(0,$.jsx)(je,{children:(0,$.jsxs)(x,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(I,{"aria-hidden":!0}),` Enroll node`]})}):null,t[8]=n,t[9]=r,t[10]=l):l=t[10];let u;return t[11]!==c||t[12]!==l?(u=(0,$.jsxs)(Pe,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Jn as HostedAuthenticationSurface,kn as HostedHubRoot};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D4CtFNPY.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-DxCd1PgA.js";import{a as r}from"./primary-D_D7eLwT.js";import{c as i,t as a,ti as o}from"./src-BSuAGqhK.js";import{$n as s,Ma as c,Na as l,Nr as u,Oa as d,Or as f,_l as p,ea as m,gl as h,hl as g,kr as _,wa as v,zr as y}from"./runtime-Djy96GJd.js";import{t as b}from"./switch-DD1qVLgN.js";import{t as x}from"./compiler-runtime-qmuS0Svy.js";import{t as S}from"./badge-Dg7mXiOh.js";import{t as C}from"./bot-BR3RyOWP.js";import{K as w,Y as T}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as E}from"./chevron-right-CuUjBsQV.js";import{t as D}from"./key-round-D2DtQ7aS.js";import{t as O}from"./refresh-cw-DY3_Ph-S.js";import{t as k}from"./save-ugJXuJRM.js";import{t as A}from"./shield-check-CO4SMhAs.js";import{t as j}from"./unplug-DisTpujT.js";import{t as M}from"./wrench-Ds8eZerZ.js";import{t as N}from"./toastHelpers-CSQRKo4F.js";import{t as P}from"./input-DrOL1KPS.js";import{t as F}from"./capabilities-C8sxDbKT.js";import"./providerModels-bFbEIfL9.js";import{r as I}from"./providerDriverMeta-DNTocCcU.js";import{It as L}from"./main-BbtLAX7M.js";var R={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};R.node;var z=l(R),B={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};B.node;var V=l(B),H={name:`link-2-off`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]};H.node;var ee=l(H),te=()=>({integrations:[],topology:{available:!1,reason:`Not loaded.`},pairingCodes:{}}),ne=(e,t)=>({integrations:t.integrations,topology:t.topology,pairingCodes:{}}),re=(e,t)=>({...e,integrations:[...e.integrations.filter(e=>e.integration.integrationId!==t.detail.integration.integrationId),t.detail],pairingCodes:{...e.pairingCodes,[t.detail.integration.integrationId]:t.pairingCode}}),ie=(e,t)=>{let n={...e.pairingCodes};return delete n[t],{...e,integrations:e.integrations.filter(e=>e.integration.integrationId!==t),pairingCodes:n}},ae=()=>({installations:[]}),oe=e=>[...e].toSorted((e,t)=>e.driver.localeCompare(t.driver)||e.createdAt.localeCompare(t.createdAt)||e.installationId.localeCompare(t.installationId)),se=(e,t)=>({installations:oe(t.installations)}),U=(e,t)=>{let n=e.installations.find(e=>e.installationId===t.installation.installationId);return n&&n.revision>t.installation.revision?e:{installations:oe([...e.installations.filter(e=>e.installationId!==t.installation.installationId),t.installation])}},W=e(t(),1),G=x(),ce=[50,100,200,400],le=e=>e instanceof Error&&e.message.trim()===`Agent Control is disabled.`,ue=e=>new Promise(t=>window.setTimeout(t,e));async function de(e,t=ue){for(let n of ce)try{return await e()}catch(e){if(!le(e))throw e;await t(n)}return e()}var K=p(),fe={codex:`Codex`,"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"generic-mcp":`Generic MCP`},pe=[{capability:i.externalListProjects,label:`List allowed projects`,description:`Discover only projects inside this integration's scope.`},{capability:i.externalCreateTask,label:`Request tasks`,description:`Submit one task to Ryco's normal approval queue.`},{capability:i.externalReadTask,label:`Read own tasks`,description:`Read or wait only for tasks created by this integration.`},{capability:i.externalReadAutomations,label:`Read automations`,description:`Read bounded schedules and run outcomes inside the selected project scope.`},{capability:i.externalManageAutomations,label:`Request automations`,description:`Propose schedule changes; each due run still requires separate approval.`},{capability:i.externalReadActivity,label:`Read activity`,description:`Read bounded payload-free project and provider event summaries.`},{capability:i.externalReadDiagnostics,label:`Read diagnostics`,description:`Read redacted count-only health summaries for allowed projects.`},{capability:i.externalSharedCheckout,label:`Request shared checkout`,description:`May request the local checkout; each request still needs approval.`},{capability:i.externalFullAccess,label:`Request full access`,description:`May request a full-access runtime; each request still needs approval.`}],q=()=>({displayName:``,clientKind:`codex`,scopeKind:`all`,projectIds:``,capabilities:[i.externalListProjects,i.externalCreateTask,i.externalReadTask],expiresAt:``,rateLimitPerMinute:`60`,activeTaskLimit:`1`});function J(e,t){u.add(N({type:`error`,title:e,description:t instanceof Error?t.message:`The request failed.`}))}function me(e,t){return[e,...t.map(e=>JSON.stringify(e))].join(` `)}function Y(e){return e===null?`Never`:new Date(e).toLocaleString()}function he(e){let t=e.integration;return t.revokedAt===null?t.expiresAt!==null&&Date.parse(t.expiresAt)<=Date.now()?{label:`Expired`,variant:`error`}:t.pairingState===`paired`?{label:`Paired`,variant:`success`}:t.pairingState===`pending`?{label:`Pairing`,variant:`warning`}:{label:`Unpaired`,variant:`outline`}:{label:`Revoked`,variant:`error`}}function ge(e){let t=e.integration;return{displayName:t.displayName,clientKind:t.clientKind,scopeKind:t.projectScope.kind,projectIds:t.projectScope.kind===`selected`?t.projectScope.projectIds.join(`, `):``,capabilities:t.capabilities,expiresAt:t.expiresAt===null?``:new Date(t.expiresAt).toISOString().slice(0,16),rateLimitPerMinute:String(t.rateLimitPerMinute),activeTaskLimit:String(t.activeTaskLimit)}}function X(e){let t=e.projectIds.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>o.make(e)),n=e.scopeKind===`all`?{kind:`all`}:{kind:`selected`,projectIds:t},r=Number(e.rateLimitPerMinute),i=Number(e.activeTaskLimit);if(!e.displayName.trim())throw Error(`A display name is required.`);if(e.scopeKind===`selected`&&t.length===0)throw Error(`Enter at least one project ID for selected-project scope.`);if(!Number.isInteger(r)||r<1)throw Error(`Rate limit must be a positive whole number.`);if(!Number.isInteger(i)||i<1)throw Error(`Active-task limit must be a positive whole number.`);return{displayName:e.displayName.trim(),clientKind:e.clientKind,projectScope:n,capabilities:e.capabilities,expiresAt:e.expiresAt?new Date(e.expiresAt).toISOString():null,rateLimitPerMinute:r,activeTaskLimit:i}}function Z(e){let t=(0,G.c)(85),{form:n,onChange:r,clientLocked:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=e=>r({...n,displayName:e.target.value}),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s;t[3]!==n.displayName||t[4]!==o?(s=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Display name`,(0,K.jsx)(P,{value:n.displayName,placeholder:`Local Codex`,onChange:o})]}),t[3]=n.displayName,t[4]=o,t[5]=s):s=t[5];let c=n.clientKind,l;t[6]!==n||t[7]!==r?(l=e=>r({...n,clientKind:e.target.value}),t[6]=n,t[7]=r,t[8]=l):l=t[8];let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.entries(fe).map(_e),t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n.clientKind||t[12]!==l?(d=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Client`,(0,K.jsx)(`select`,{className:`h-9 rounded-lg border border-input bg-background px-3 text-sm`,value:c,disabled:a,onChange:l,children:u})]}),t[10]=a,t[11]=n.clientKind,t[12]=l,t[13]=d):d=t[13];let f;t[14]!==s||t[15]!==d?(f=(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[s,d]}),t[14]=s,t[15]=d,t[16]=f):f=t[16];let p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(`legend`,{className:`text-xs font-medium`,children:`Project scope`}),t[17]=p):p=t[17];let m=n.scopeKind===`all`,h;t[18]!==n||t[19]!==r?(h=()=>r({...n,scopeKind:`all`}),t[18]=n,t[19]=r,t[20]=h):h=t[20];let g;t[21]!==m||t[22]!==h?(g=(0,K.jsx)(`input`,{type:`radio`,checked:m,onChange:h}),t[21]=m,t[22]=h,t[23]=g):g=t[23];let _;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsxs)(`span`,{children:[`All current and future projects`,(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`The client can discover every project on this local Ryco instance.`})]}),t[24]=_):_=t[24];let v;t[25]===g?v=t[26]:(v=(0,K.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[g,_]}),t[25]=g,t[26]=v);let y=n.scopeKind===`selected`,b;t[27]!==n||t[28]!==r?(b=()=>r({...n,scopeKind:`selected`}),t[27]=n,t[28]=r,t[29]=b):b=t[29];let x;t[30]!==y||t[31]!==b?(x=(0,K.jsx)(`input`,{type:`radio`,checked:y,onChange:b}),t[30]=y,t[31]=b,t[32]=x):x=t[32];let S=n.scopeKind!==`selected`,C;t[33]!==n||t[34]!==r?(C=e=>r({...n,projectIds:e.target.value}),t[33]=n,t[34]=r,t[35]=C):C=t[35];let w;t[36]!==n.projectIds||t[37]!==S||t[38]!==C?(w=(0,K.jsx)(P,{className:`mt-1.5`,value:n.projectIds,disabled:S,placeholder:`project-id-1, project-id-2`,"aria-label":`Selected project IDs`,onChange:C}),t[36]=n.projectIds,t[37]=S,t[38]=C,t[39]=w):w=t[39];let T;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`Comma-separated stable project IDs. Unknown IDs remain inaccessible.`}),t[40]=T):T=t[40];let E;t[41]===w?E=t[42]:(E=(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Selected projects`,w,T]}),t[41]=w,t[42]=E);let D;t[43]!==x||t[44]!==E?(D=(0,K.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[x,E]}),t[43]=x,t[44]=E,t[45]=D):D=t[45];let O;t[46]!==v||t[47]!==D?(O=(0,K.jsxs)(`fieldset`,{className:`grid gap-2`,children:[p,v,D]}),t[46]=v,t[47]=D,t[48]=O):O=t[48];let k;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,K.jsx)(`legend`,{className:`text-xs font-medium`,children:`Capability grants`}),t[49]=k):k=t[49];let A;t[50]!==n||t[51]!==r?(A=pe.map(e=>(0,K.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:n.capabilities.includes(e.capability),onChange:t=>r({...n,capabilities:t.target.checked?[...n.capabilities,e.capability]:n.capabilities.filter(t=>t!==e.capability)})}),(0,K.jsxs)(`span`,{children:[e.label,(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]})]},e.capability)),t[50]=n,t[51]=r,t[52]=A):A=t[52];let j;t[53]===A?j=t[54]:(j=(0,K.jsxs)(`fieldset`,{className:`grid gap-2`,children:[k,A]}),t[53]=A,t[54]=j);let M;t[55]!==n||t[56]!==r?(M=e=>r({...n,expiresAt:e.target.value}),t[55]=n,t[56]=r,t[57]=M):M=t[57];let N;t[58]!==n.expiresAt||t[59]!==M?(N=(0,K.jsx)(P,{type:`datetime-local`,value:n.expiresAt,onChange:M}),t[58]=n.expiresAt,t[59]=M,t[60]=N):N=t[60];let F;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,K.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Empty means no expiry.`}),t[61]=F):F=t[61];let I;t[62]===N?I=t[63]:(I=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Expires`,N,F]}),t[62]=N,t[63]=I);let L;t[64]!==n||t[65]!==r?(L=e=>r({...n,rateLimitPerMinute:e.target.value}),t[64]=n,t[65]=r,t[66]=L):L=t[66];let R;t[67]!==n.rateLimitPerMinute||t[68]!==L?(R=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Requests per minute`,(0,K.jsx)(P,{type:`number`,min:1,max:600,value:n.rateLimitPerMinute,onChange:L})]}),t[67]=n.rateLimitPerMinute,t[68]=L,t[69]=R):R=t[69];let z;t[70]!==n||t[71]!==r?(z=e=>r({...n,activeTaskLimit:e.target.value}),t[70]=n,t[71]=r,t[72]=z):z=t[72];let B;t[73]!==n.activeTaskLimit||t[74]!==z?(B=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Concurrent active tasks`,(0,K.jsx)(P,{type:`number`,min:1,max:32,value:n.activeTaskLimit,onChange:z})]}),t[73]=n.activeTaskLimit,t[74]=z,t[75]=B):B=t[75];let V;t[76]!==I||t[77]!==R||t[78]!==B?(V=(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[I,R,B]}),t[76]=I,t[77]=R,t[78]=B,t[79]=V):V=t[79];let H;return t[80]!==O||t[81]!==j||t[82]!==V||t[83]!==f?(H=(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[f,O,j,V]}),t[80]=O,t[81]=j,t[82]=V,t[83]=f,t[84]=H):H=t[84],H}function _e(e){let[t,n]=e;return(0,K.jsx)(`option`,{value:t,children:n},t)}function ve(){let e=h(),t=r(),n=e?.environmentId??t,[i,a]=(0,W.useState)(te),[o,l]=(0,W.useState)(q),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(null),[m,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(null),b=(0,W.useMemo)(()=>n===null?void 0:s(n)?.agentControl,[n]),x=(0,W.useCallback)(async()=>{if(b)try{let e=await de(()=>b.listIntegrations());a(t=>ne(t,e))}catch(e){J(`Failed to load external integrations`,e)}},[b]);(0,W.useEffect)(()=>{x()},[x]);let C=(0,W.useCallback)(async(e,t)=>{await navigator.clipboard.writeText(t),v(e),window.setTimeout(()=>v(t=>t===e?null:t),1500)},[]),T=async()=>{if(b)try{g(`new`);let e=await b.createIntegration(X(o));a(t=>re(t,e)),l(q()),d(!1)}catch(e){J(`Failed to create integration`,e)}finally{g(null)}},E=async e=>{if(b)try{g(e.integration.integrationId);let t=X(o);await b.updateIntegration({integrationId:e.integration.integrationId,...t}),p(null),await x()}catch(e){J(`Failed to update integration`,e)}finally{g(null)}},j=async e=>{if(!b)return;let t=e.integration.integrationId;try{g(t);let e=await b.resumeIntegrationPairing({integrationId:t});a(t=>re(t,e))}catch(e){J(`Failed to resume pairing`,e)}finally{g(null)}},M=async e=>{if(!b)return;let t=e.integration.integrationId;try{g(t),await b.revokeIntegration({integrationId:t}),await x()}catch(e){J(`Failed to revoke integration`,e)}finally{g(null)}},N=async e=>{if(!b)return;let t=e.integration.integrationId;if(window.confirm(`Delete ${e.integration.displayName}? This cannot be undone.`))try{g(t),(await b.deleteIntegration({integrationId:t})).deleted&&a(e=>ie(e,t))}catch(e){J(`Failed to delete integration`,e)}finally{g(null)}};return(0,K.jsx)(`section`,{"data-testid":`external-integrations`,className:`border-b bg-muted/10 p-6 sm:p-8`,children:(0,K.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl gap-5`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(A,{className:`size-3.5`}),`Agent Control`]}),(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`External integrations`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Pair a local MCP client with a revocable identity. Every task request waits in Ryco for explicit user approval before a thread is created.`})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(y,{size:`icon`,variant:`outline`,"aria-label":`Refresh integrations`,onClick:()=>void x(),children:(0,K.jsx)(O,{})}),(0,K.jsxs)(y,{disabled:!b||!i.topology.available,onClick:()=>{p(null),l(q()),d(e=>!e)},children:[(0,K.jsx)(L,{}),`New integration`]})]})]}),i.topology.available?null:(0,K.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-warning/30 bg-warning/8 p-4 text-sm`,children:[(0,K.jsx)(ee,{className:`mt-0.5 size-4 shrink-0 text-warning-foreground`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-medium`,children:`Local pairing is unavailable`}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[i.topology.reason??`Ryco could not prove a direct loopback-only topology.`,` `,`External setup fails closed while Ryco is remotely exposed or Hub-connected.`]})]})]}),u?(0,K.jsxs)(`div`,{className:`grid gap-4 rounded-xl border bg-card p-4`,children:[(0,K.jsx)(Z,{form:o,onChange:l}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,K.jsx)(y,{variant:`ghost`,onClick:()=>d(!1),children:`Cancel`}),(0,K.jsxs)(y,{disabled:m===`new`,onClick:()=>void T(),children:[(0,K.jsx)(D,{}),`Create and pair`]})]})]}):null,i.integrations.length===0&&!u?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground`,children:`No external integrations are configured.`}):null,i.integrations.map(e=>{let t=e.integration,n=he(e),r=i.pairingCodes[t.integrationId],a=me(e.setup.pairCommand.command,e.setup.pairCommand.args),s=f===t.integrationId;return(0,K.jsxs)(`article`,{className:`grid gap-4 rounded-xl border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`font-semibold`,children:t.displayName}),(0,K.jsx)(S,{variant:n.variant,children:n.label}),(0,K.jsx)(S,{variant:`outline`,children:fe[t.clientKind]})]}),(0,K.jsx)(`p`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:t.integrationId})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,onClick:()=>{p(s?null:t.integrationId),l(ge(e))},children:s?`Close editor`:`Edit`}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,disabled:!i.topology.available||m===t.integrationId||t.revokedAt!==null,onClick:()=>void j(e),children:[(0,K.jsx)(D,{}),`Pair again`]}),(0,K.jsx)(y,{size:`sm`,variant:`outline`,disabled:m===t.integrationId||t.revokedAt!==null,onClick:()=>void M(e),children:`Revoke`}),(0,K.jsx)(y,{size:`icon-sm`,variant:`ghost`,"aria-label":`Delete ${t.displayName}`,disabled:m===t.integrationId,onClick:()=>void N(e),children:(0,K.jsx)(w,{})})]})]}),s?(0,K.jsxs)(`div`,{className:`grid gap-4 border-t pt-4`,children:[(0,K.jsx)(Z,{form:o,onChange:l}),(0,K.jsx)(`div`,{className:`flex justify-end`,children:(0,K.jsxs)(y,{disabled:m===t.integrationId,onClick:()=>void E(e),children:[(0,K.jsx)(k,{}),`Save changes`]})})]}):(0,K.jsxs)(`div`,{className:`grid gap-3 text-xs sm:grid-cols-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Project scope`}),(0,K.jsx)(`p`,{className:`mt-0.5 break-words font-medium`,children:t.projectScope.kind===`all`?`All current and future projects`:t.projectScope.projectIds.join(`, `)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Limits`}),(0,K.jsxs)(`p`,{className:`mt-0.5 font-medium`,children:[t.rateLimitPerMinute,`/minute · `,t.activeTaskCount,`/`,t.activeTaskLimit,` active`]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Expiry`}),(0,K.jsx)(`p`,{className:`mt-0.5 font-medium`,children:Y(t.expiresAt)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Last used`}),(0,K.jsx)(`p`,{className:`mt-0.5 font-medium`,children:Y(t.lastUsedAt)})]}),(0,K.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,K.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:t.capabilities.map(e=>(0,K.jsx)(S,{variant:`outline`,children:e},e))})]})]}),t.pairingState===`pending`?(0,K.jsxs)(`div`,{className:`grid gap-3 rounded-lg border bg-muted/20 p-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:`Finish pairing locally`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pairing code expires `,Y(t.pairingCodeExpiresAt),`. The code is shown only for this ceremony; the generated MCP configuration never contains it.`]})]}),r?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`code`,{"data-testid":`external-pairing-code`,className:`rounded bg-background px-3 py-2 font-mono text-sm tracking-[0.18em]`,children:r}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,onClick:()=>void C(`code-${t.integrationId}`,r),children:[_===`code-${t.integrationId}`?(0,K.jsx)(c,{}):(0,K.jsx)(V,{}),`Copy code`]})]}):(0,K.jsx)(`p`,{className:`text-xs text-warning-foreground`,children:`The pairing code is no longer displayed. Choose Pair again to generate a new one.`}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:`Run this bridge command, then enter the code`}),(0,K.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,K.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto rounded bg-background p-2 text-[11px]`,children:a}),(0,K.jsx)(y,{size:`icon-sm`,variant:`outline`,"aria-label":`Copy pairing command`,onClick:()=>void C(`pair-${t.integrationId}`,a),children:_===`pair-${t.integrationId}`?(0,K.jsx)(c,{}):(0,K.jsx)(V,{})})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:`MCP configuration`}),(0,K.jsx)(`pre`,{"data-testid":`external-mcp-configuration`,className:`max-h-48 overflow-auto rounded bg-background p-3 text-[11px] leading-relaxed`,children:e.setup.configuration}),(0,K.jsxs)(y,{className:`justify-self-start`,size:`sm`,variant:`outline`,onClick:()=>void C(`config-${t.integrationId}`,e.setup.configuration),children:[_===`config-${t.integrationId}`?(0,K.jsx)(c,{}):(0,K.jsx)(V,{}),`Copy configuration`]})]})]}):null]},t.integrationId)})]})})}var ye=[],be=[];function xe(e){return e.displayName??I(e.driver)?.label??m(e.driver)}function Q(e){return e.providerDisplayName??I(e.driver)?.label??m(e.driver)}function Se(e){return e.driver===`codex`?`codex`:e.driver===`claudeAgent`?`claude-code`:`generic-mcp`}function Ce(e){return{...q(),displayName:`${Q(e)} Agent Control`,clientKind:Se(e)}}function we(e,t){return e.filter(e=>e.workspaceId===t).toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt))[0]}function Te(e){if(!e)return{label:`Not connected`,variant:`outline`};switch(e.state){case`connected`:return{label:`Connected`,variant:`success`};case`repair-needed`:return{label:`Needs repair`,variant:`error`};case`disconnected`:case`revoked`:return{label:`Disconnected`,variant:`outline`};case`disconnecting`:return{label:`Disconnecting`,variant:`warning`};case`planned`:case`credential-written`:case`provider-written`:case`verifying`:return{label:`Connecting`,variant:`warning`}}}function Ee(e,t){u.add(N({type:`success`,title:e,description:t}))}function $(e,t){u.add(N({type:`error`,title:e,description:t instanceof Error?t.message:`The request failed.`}))}function De(){let e=h(),t=r(),n=e?.environmentId??t,[i,a]=(0,W.useState)(ye),[o,c]=(0,W.useState)(be),[l,u]=(0,W.useState)(ae),[f,p]=(0,W.useState)(null),[m,g]=(0,W.useState)(!0),[_,b]=(0,W.useState)(null),[x,w]=(0,W.useState)(null),[E,D]=(0,W.useState)(q),k=(0,W.useMemo)(()=>n===null?void 0:s(n),[n]),A=k?.agentControl,N=k?.mcp,P=(0,W.useCallback)(async()=>{if(!A||!N){g(!1);return}try{let[e,t,n]=await de(()=>Promise.all([N.listWorkspaces(),A.listMcpInstallations(),A.listIntegrations()]));a(e.providers),c(e.workspaces),u(e=>se(e,t)),p(n.topology)}catch(e){$(`Failed to load Agent Control providers`,e)}finally{g(!1)}},[A,N]);(0,W.useEffect)(()=>{P()},[P]);let F=async(e,t)=>{if(A)try{b(e.id);let n=t?(()=>{let{clientKind:t,...n}=X(E);return{workspaceId:e.id,...n}})():{workspaceId:e.id},r=await A.connectMcpInstallation(n);u(e=>U(e,r)),w(null),Ee(`${Q(e)} connected`,`The credential was stored locally and was not shown to the browser.`)}catch(t){$(`Failed to connect ${Q(e)}`,t),await P()}finally{b(null)}},L=async(e,t)=>{if(A)try{b(e.id);let n=await A.repairMcpInstallation({installationId:t.installationId});u(e=>U(e,n)),Ee(`${Q(e)} repaired`)}catch(t){$(`Failed to repair ${Q(e)}`,t),await P()}finally{b(null)}},R=async(e,t)=>{if(A&&window.confirm(`Disconnect Agent Control from ${Q(e)}?`))try{b(e.id);let n=await A.disconnectMcpInstallation({installationId:t.installationId});u(e=>U(e,n)),Ee(`${Q(e)} disconnected`)}catch(t){$(`Failed to disconnect ${Q(e)}`,t),await P()}finally{b(null)}},B=o.filter(e=>e.capabilities.externalAgentControl===`available`);return(0,K.jsx)(`section`,{"data-testid":`agent-control-mcp-installations`,className:`border-b bg-muted/10 p-6 sm:p-8`,children:(0,K.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl gap-8`,children:[(0,K.jsxs)(`section`,{className:`grid gap-4`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(C,{className:`size-3.5`}),`Ryco sessions`]}),(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`Automatic inside Ryco`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Supported sessions started by Ryco receive Agent Control automatically. There is nothing to install in those provider profiles.`})]}),m?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border p-4 text-sm text-muted-foreground`,children:[(0,K.jsx)(T,{className:`size-4 animate-spin`}),` Loading providers…`]}):i.length===0?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-4 text-sm text-muted-foreground`,children:`No configured provider instances were found.`}):(0,K.jsx)(`div`,{className:`divide-y overflow-hidden rounded-xl border bg-card`,children:i.map(e=>{let t=I(e.driver)?.icon??C,n=e.enabled&&e.capabilities.automaticAgentControl===`available`;return(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg border bg-background`,children:(0,K.jsx)(t,{className:`size-4 text-muted-foreground`})}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:xe(e)}),(0,K.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-muted-foreground`,children:e.instanceId}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n?`Available in every new Ryco-managed session.`:e.enabled?`This provider does not expose automatic Agent Control yet.`:`This provider instance is disabled.`})]})]}),(0,K.jsx)(S,{variant:n?`success`:`outline`,children:n?`Automatic`:e.enabled?`Unavailable`:`Disabled`})]},e.instanceId)})})]}),(0,K.jsxs)(`section`,{className:`grid gap-4`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(z,{className:`size-3.5`}),`External agents`]}),(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`Connect an installed provider`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Ryco detects local provider profiles and writes their native MCP configuration. The default grants project listing and task request/read access, limited to 60 requests per minute and one active task. Every task still requires approval.`})]}),(0,K.jsx)(y,{size:`icon`,variant:`outline`,"aria-label":`Refresh Agent Control providers`,disabled:m,onClick:()=>void P(),children:(0,K.jsx)(O,{})})]}),f&&!f.available?(0,K.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-warning/30 bg-warning/8 p-4 text-sm`,children:[(0,K.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-warning-foreground`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-medium`,children:`Local installation is unavailable`}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:f.reason??`Ryco could not prove a direct loopback-only topology.`})]})]}):null,!m&&(!A||!N)?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-4 text-sm text-muted-foreground`,children:`This Ryco environment does not expose provider MCP installation yet.`}):!m&&B.length===0?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-4 text-sm text-muted-foreground`,children:`No installable provider profiles were detected. Configure a supported provider instance first, then refresh.`}):(0,K.jsx)(`div`,{className:`grid gap-3`,children:B.map(e=>{let t=we(l.installations,e.id),n=Te(t),r=t?.state===`connected`,i=t?.state===`repair-needed`,a=_===e.id,o=x===e.id,s=I(e.driver)?.icon??z;return(0,K.jsxs)(`article`,{className:`grid gap-4 rounded-xl border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg border bg-background`,children:(0,K.jsx)(s,{className:`size-4 text-muted-foreground`})}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold`,children:Q(e)}),(0,K.jsx)(S,{variant:n.variant,children:n.label})]}),(0,K.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:e.displayPath}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.providerInstances.length,` configured provider`,e.providerInstances.length===1?` instance`:` instances`,t?` · MCP name ${t.serverName}`:``]})]})]}),(0,K.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-2 sm:justify-end`,children:i&&t?(0,K.jsxs)(y,{size:`sm`,disabled:a||f?.available===!1,onClick:()=>void L(e,t),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(M,{}),`Repair`]}):r&&t?(0,K.jsxs)(y,{size:`sm`,variant:`outline`,disabled:a,onClick:()=>void R(e,t),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(j,{}),`Disconnect`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,disabled:a||f?.available===!1,onClick:()=>{o?w(null):(D(Ce(e)),w(e.id))},children:o?`Close`:`Customize`}),(0,K.jsxs)(y,{size:`sm`,disabled:a||f?.available===!1,onClick:()=>void F(e,!1),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(d,{}),`Connect`]})]})})]}),t?.lastError?(0,K.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive`,children:t.lastError}):null,t?.preservedUserChanges?(0,K.jsx)(`div`,{className:`rounded-lg border border-warning/30 bg-warning/8 p-3 text-xs text-warning-foreground`,children:`Ryco left this provider's MCP entry untouched because it had been edited after installation.`}):null,o?(0,K.jsxs)(`div`,{className:`grid gap-4 border-t pt-4`,children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Customize the credential scope and limits before Ryco installs it. The provider profile is fixed to this detected workspace.`}),(0,K.jsx)(Z,{form:E,onChange:D,clientLocked:!0}),(0,K.jsx)(`div`,{className:`flex justify-end`,children:(0,K.jsxs)(y,{disabled:a||f?.available===!1,onClick:()=>void F(e,!0),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(z,{}),`Connect with these permissions`]})})]}):null]},e.id)})})]})]})})}var Oe=(0,W.lazy)(()=>n(()=>import(`./ComputerUseSettings-CPwWoHWj.js`).then(e=>({default:e.ComputerUseSettings})),__vite__mapDeps([0])));function ke(){let e=(0,G.c)(7),t=g(),n;e[0]===t?n=e[1]:(n=t!==`client`&&(0,K.jsx)(Ae,{}),e[0]=t,e[1]=n);let r;e[2]===t?r=e[3]:(r=t!==`node`&&window.desktopBridge?.computerUse&&(0,K.jsx)(W.Suspense,{fallback:(0,K.jsx)(`p`,{className:`p-6`,children:`Loading device integrations…`}),children:(0,K.jsx)(Oe,{})}),e[2]=t,e[3]=r);let i;return e[4]!==n||e[5]!==r?(i=(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[n,r]}),e[4]=n,e[5]=r,e[6]=i):i=e[6],i}function Ae(){let e=(0,G.c)(25),t=f(je),{updateSettings:n}=_(),r=F(a.serverUpdateSettings),i,o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Private Agent Control`}),o=(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`Private tools for every agent`}),s=(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Ryco sessions receive the tools automatically. Connect supported standalone provider profiles with one click. Every requested change still waits for explicit approval.`}),e[0]=i,e[1]=o,e[2]=s):(i=e[0],o=e[1],s=e[2]);let c=t?`Enabled. New Ryco-managed sessions receive Agent Control without changing the provider's global MCP configuration.`:`Disabled. Agent Control is unavailable to Ryco sessions and external clients.`,l;e[3]===c?l=e[4]:(l=(0,K.jsx)(`p`,{className:`mt-2 max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:c}),e[3]=c,e[4]=l);let u;e[5]!==r.allowed||e[6]!==r.reason?(u=!r.allowed&&r.reason?(0,K.jsx)(`p`,{className:`mt-2 max-w-2xl text-xs leading-relaxed text-destructive`,children:r.reason}):null,e[5]=r.allowed,e[6]=r.reason,e[7]=u):u=e[7];let d;e[8]!==l||e[9]!==u?(d=(0,K.jsxs)(`div`,{children:[i,o,s,l,u]}),e[8]=l,e[9]=u,e[10]=d):d=e[10];let p=!r.allowed,m;e[11]===n?m=e[12]:(m=e=>n({agentControl:{enabled:!!e}}),e[11]=n,e[12]=m);let h;e[13]!==t||e[14]!==p||e[15]!==m?(h=(0,K.jsx)(b,{checked:t,disabled:p,onCheckedChange:m,"aria-label":`Enable Agent Control`}),e[13]=t,e[14]=p,e[15]=m,e[16]=h):h=e[16];let g;e[17]!==d||e[18]!==h?(g=(0,K.jsx)(`section`,{"data-settings-section":`Private Agent Control`,className:`scroll-mt-6 border-b bg-muted/10 p-6 sm:p-8`,children:(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[d,h]})}),e[17]=d,e[18]=h,e[19]=g):g=e[19];let v;e[20]===t?v=e[21]:(v=t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(De,{}),(0,K.jsxs)(`details`,{className:`group border-b bg-muted/5`,children:[(0,K.jsxs)(`summary`,{className:`mx-auto flex w-full max-w-4xl cursor-pointer list-none items-center gap-3 px-6 py-5 sm:px-8 [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-lg border bg-background`,children:(0,K.jsx)(D,{className:`size-4 text-muted-foreground`})}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block text-sm font-semibold`,children:`Advanced manual setup`}),(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Create a revocable pairing for another MCP client or a profile Ryco cannot detect.`})]}),(0,K.jsx)(E,{className:`size-4 text-muted-foreground transition-transform group-open:rotate-90`})]}),(0,K.jsx)(ve,{})]})]}):null,e[20]=t,e[21]=v);let y;return e[22]!==g||e[23]!==v?(y=(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[g,v]}),e[22]=g,e[23]=v,e[24]=y):y=e[24],y}function je(e){return e.agentControl.enabled}export{ke as IntegrationsSettingsPanel};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{m as n,p as r}from"./src-BSuAGqhK.js";import{$n as i,Na as a,Nr as o,Oa as s,Vr as c,_l as l,ea as u,gl as d,ja as f,or as ee,wa as p,zr as m}from"./runtime-Djy96GJd.js";import{Ft as h,Gn as g,It as _,Mt as v,Nt as y,Pt as b,jt as x,kt as S,st as C,t as w}from"./switch-DD1qVLgN.js";import{t as T}from"./compiler-runtime-qmuS0Svy.js";import{i as te,n as ne,t as re}from"./tooltip-DXvXxL37.js";import{a as E,c as D,n as O,o as k,s as A,t as j}from"./badge-Dg7mXiOh.js";import{h as M}from"./RootAppShell-BdQCs2XJ.js";import{K as ie,Y as N}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as P}from"./refresh-cw-DY3_Ph-S.js";import{t as F}from"./save-ugJXuJRM.js";import{t as I}from"./wrench-Ds8eZerZ.js";import{t as L}from"./toastHelpers-CSQRKo4F.js";import{t as R}from"./input-DrOL1KPS.js";import"./providerModels-bFbEIfL9.js";import{r as z}from"./providerDriverMeta-DNTocCcU.js";import{It as B}from"./main-BbtLAX7M.js";var V={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};V.node;var ae=a(V),H={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};H.node;var oe=a(H),U=e(t(),1),W=T(),G=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function K(){return{name:``,transport:`stdio`,command:``,argsText:``,cwd:``,url:``,bearerTokenEnvVar:``,envText:``,envVarsText:``,httpHeadersText:``,envHttpHeadersText:``,enabled:!0,required:!1,startupTimeoutSec:``,toolTimeoutSec:``,enabledToolsText:``,disabledToolsText:``,oauthScopesText:``,secretFields:[],clearedSecretFields:[]}}function q(e){return e.join(`
|
|
2
|
-
`)}function J(e){return Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
|
|
3
|
-
`)}function se(e){let t=e.config;return{name:e.name,transport:t.transport===`http`?`http`:`stdio`,command:t.command??``,argsText:q(t.args),cwd:t.cwd??``,url:t.url??``,bearerTokenEnvVar:t.bearerTokenEnvVar??``,envText:J(t.env),envVarsText:q(t.envVars),httpHeadersText:J(t.httpHeaders),envHttpHeadersText:J(t.envHttpHeaders),enabled:t.enabled,required:t.required??!1,startupTimeoutSec:t.startupTimeoutSec?.toString()??``,toolTimeoutSec:t.toolTimeoutSec?.toString()??``,enabledToolsText:q(t.enabledTools),disabledToolsText:q(t.disabledTools),oauthScopesText:q(t.oauthScopes),secretFields:Object.entries(t.secretFields??{}).filter(([,e])=>e===`present`).map(([e])=>e).toSorted(),clearedSecretFields:[]}}function Y(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0)}function ce(e){let t={};for(let n of Y(e)){let e=n.indexOf(`=`);if(e<=0)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r.length>0&&(t[r]=i)}return t}function le(e){let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)&&n>0?n:NaN}function ue(e){let t=e.name.trim();if(!G.test(t))return`Server name must start with a letter and use only letters, numbers, dashes, and underscores.`;if(e.transport===`stdio`&&e.command.trim().length===0)return`Stdio servers need a command.`;if(e.transport===`http`&&e.url.trim().length===0)return`HTTP servers need a URL.`;for(let[t,n]of[[`Startup timeout`,e.startupTimeoutSec],[`Tool timeout`,e.toolTimeoutSec]]){let e=le(n);if(Number.isNaN(e))return`${t} must be a positive number.`}return null}function de(e){let t=le(e.startupTimeoutSec),n=le(e.toolTimeoutSec);return{transport:e.transport,command:e.command.trim(),args:Y(e.argsText),cwd:e.cwd.trim()||null,url:e.url.trim(),bearerTokenEnvVar:e.bearerTokenEnvVar.trim()||null,env:ce(e.envText),envVars:Y(e.envVarsText),httpHeaders:ce(e.httpHeadersText),envHttpHeaders:ce(e.envHttpHeadersText),enabled:e.enabled,required:e.required,...t===void 0||Number.isNaN(t)?{}:{startupTimeoutSec:t},...n===void 0||Number.isNaN(n)?{}:{toolTimeoutSec:n},enabledTools:Y(e.enabledToolsText),disabledTools:Y(e.disabledToolsText),oauthScopes:Y(e.oauthScopesText)}}function fe(e){return Object.fromEntries(e.secretFields.map(t=>[t,e.clearedSecretFields.includes(t)?{action:`clear`}:{action:`retain`}]))}function pe(e){let t=e.config;return t.transport===`http`?t.url||`HTTP`:t.transport===`stdio`?[t.command,...t.args].filter(Boolean).join(` `)||`stdio`:`Configured outside the known MCP schema`}var X=l(),me=[],he=[];function Z(e){if(!e)throw Error(`MCP settings are unavailable before a backend is paired.`);return e}function Q(e,t){o.add(L({type:`error`,title:e,description:t instanceof Error?t.message:`An error occurred.`}))}function ge(e){switch(e){case`user`:return`User config`;case`project`:return`Project`;case`system`:return`System`;case`managed`:return`Managed`;case`mixed`:return`Mixed`;case`unknown`:return`Unknown`}}function _e(e){return e.startupStatus===`failed`?`error`:e.startupStatus===`disabled`?`outline`:e.authStatus===`notLoggedIn`?`warning`:e.startupStatus===`ready`?`success`:`outline`}function ve(e){return e.startupStatus===`disabled`?`Disabled`:e.startupStatus===`failed`?`Failed`:e.authStatus===`notLoggedIn`?`Login needed`:e.startupStatus===`ready`?`Ready`:`Unknown`}function ye(e){return e.enabled?e.status===`managed`?`success`:e.status===`external`?`warning`:`outline`:`outline`}function be(e){if(!e.enabled)return`Disabled`;switch(e.status){case`managed`:return`Managed`;case`external`:return`External config`;case`unsupported`:return`Not wired`}}function xe(e){return e.displayName??z(e.driver)?.label??u(e.driver)}function Se(e){return e?e.providerDisplayName??z(e.driver)?.label??u(e.driver):`the provider`}function $(e){let t=(0,W.c)(5),n;t[0]===e.label?n=t[1]:(n=(0,X.jsx)(`span`,{children:e.label}),t[0]=e.label,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,X.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-foreground/80`,children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function Ce(e){let t=(0,W.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground/70`,children:n}),t[0]=n,t[1]=r),r}function we(e){let t=(0,W.c)(5),{value:n,onChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={value:`stdio`,label:`Stdio`,icon:g},t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[i,{value:`http`,label:`HTTP`,icon:ae}],t[1]=a):a=t[1];let o;return t[2]!==r||t[3]!==n?(o=(0,X.jsx)(`div`,{className:`grid grid-cols-2 rounded-lg border bg-muted/30 p-1`,children:a.map(e=>{let t=e.icon,i=n===e.value;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),className:c(`flex h-8 items-center justify-center gap-2 rounded-md text-xs font-medium transition-colors`,i?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:[(0,X.jsx)(t,{className:`size-3.5`}),e.label]},e.value)})}),t[2]=r,t[3]=n,t[4]=o):o=t[4],o}function Te({open:e,server:t,providerName:n,onOpenChange:r,onSubmit:i}){let[a,o]=(0,U.useState)(()=>K()),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(!1),d=t!==null;(0,U.useEffect)(()=>{e&&(o(t?se(t):K()),c(null))},[e,t]);let f=(e,t)=>{o(n=>({...n,[e]:t}))},ee=async()=>{let e=ue(a);if(e){c(e);return}u(!0);try{await i(a),r(!1)}catch(e){Q(`Failed to save MCP server`,e)}finally{u(!1)}};return(0,X.jsx)(S,{open:e,onOpenChange:r,children:(0,X.jsxs)(h,{className:`max-w-2xl`,bottomStickOnMobile:!1,children:[(0,X.jsxs)(y,{children:[(0,X.jsx)(_,{children:d?`Edit MCP server`:`Add MCP server`}),(0,X.jsxs)(x,{children:[`Configuration is written through `,n,`'s native MCP management surface. Existing secret values are never loaded into this form and are retained unless you enter replacements with the same keys.`]})]}),(0,X.jsxs)(b,{className:`space-y-5`,children:[(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-[1fr_12rem]`,children:[(0,X.jsx)($,{label:`Server name`,children:(0,X.jsx)(R,{value:a.name,disabled:d,onChange:e=>f(`name`,e.target.value),placeholder:`github`,spellCheck:!1})}),(0,X.jsx)($,{label:`Transport`,children:(0,X.jsx)(we,{value:a.transport,onChange:e=>f(`transport`,e)})})]}),a.transport===`stdio`?(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[(0,X.jsx)($,{label:`Command`,children:(0,X.jsx)(R,{value:a.command,onChange:e=>f(`command`,e.target.value),placeholder:`npx`,spellCheck:!1})}),(0,X.jsxs)($,{label:`Arguments`,children:[(0,X.jsx)(C,{value:a.argsText,onChange:e=>f(`argsText`,e.target.value),placeholder:`-y
|
|
4
|
-
@modelcontextprotocol/server-filesystem
|
|
5
|
-
/tmp/project`,spellCheck:!1}),(0,X.jsx)(Ce,{children:`One argument per line.`})]}),(0,X.jsx)($,{label:`Working directory`,children:(0,X.jsx)(R,{value:a.cwd,onChange:e=>f(`cwd`,e.target.value),placeholder:`/path/to/project`,spellCheck:!1})})]}):(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[(0,X.jsx)($,{label:`URL`,children:(0,X.jsx)(R,{value:a.url,onChange:e=>f(`url`,e.target.value),placeholder:`https://mcp.example.com/mcp`,spellCheck:!1})}),(0,X.jsx)($,{label:`Bearer token env var`,children:(0,X.jsx)(R,{value:a.bearerTokenEnvVar,onChange:e=>f(`bearerTokenEnvVar`,e.target.value),placeholder:`MCP_TOKEN`,spellCheck:!1})}),(0,X.jsxs)($,{label:`HTTP headers`,children:[(0,X.jsx)(C,{value:a.httpHeadersText,onChange:e=>f(`httpHeadersText`,e.target.value),placeholder:`X-Client=ryco`,spellCheck:!1}),(0,X.jsx)(Ce,{children:`Static headers as KEY=VALUE lines.`})]}),(0,X.jsxs)($,{label:`Env-backed HTTP headers`,children:[(0,X.jsx)(C,{value:a.envHttpHeadersText,onChange:e=>f(`envHttpHeadersText`,e.target.value),placeholder:`Authorization=GITHUB_TOKEN`,spellCheck:!1}),(0,X.jsx)(Ce,{children:`Header name to environment variable name, one per line.`})]})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,X.jsxs)($,{label:`Environment values`,children:[(0,X.jsx)(C,{value:a.envText,onChange:e=>f(`envText`,e.target.value),placeholder:`API_BASE=https://example.com`,spellCheck:!1}),(0,X.jsx)(Ce,{children:`KEY=VALUE lines stored by the selected provider.`})]}),(0,X.jsxs)($,{label:`Environment allow-list`,children:[(0,X.jsx)(C,{value:a.envVarsText,onChange:e=>f(`envVarsText`,e.target.value),placeholder:`GITHUB_TOKEN
|
|
6
|
-
SENTRY_AUTH_TOKEN`,spellCheck:!1}),(0,X.jsx)(Ce,{children:`One env var name per line.`})]})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:`Startup timeout seconds`,children:(0,X.jsx)(R,{value:a.startupTimeoutSec,onChange:e=>f(`startupTimeoutSec`,e.target.value),inputMode:`decimal`,placeholder:`10`})}),(0,X.jsx)($,{label:`Tool timeout seconds`,children:(0,X.jsx)(R,{value:a.toolTimeoutSec,onChange:e=>f(`toolTimeoutSec`,e.target.value),inputMode:`decimal`,placeholder:`60`})})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,X.jsx)($,{label:`Enabled tools`,children:(0,X.jsx)(C,{value:a.enabledToolsText,onChange:e=>f(`enabledToolsText`,e.target.value),spellCheck:!1})}),(0,X.jsx)($,{label:`Disabled tools`,children:(0,X.jsx)(C,{value:a.disabledToolsText,onChange:e=>f(`disabledToolsText`,e.target.value),spellCheck:!1})}),(0,X.jsx)($,{label:`OAuth scopes`,children:(0,X.jsx)(C,{value:a.oauthScopesText,onChange:e=>f(`oauthScopesText`,e.target.value),spellCheck:!1})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5 border-t pt-4`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-xs font-medium text-foreground/80`,children:[(0,X.jsx)(w,{checked:a.enabled,onCheckedChange:e=>f(`enabled`,!!e)}),`Enabled`]}),(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-xs font-medium text-foreground/80`,children:[(0,X.jsx)(w,{checked:a.required,onCheckedChange:e=>f(`required`,!!e)}),`Required`]})]}),a.secretFields.length>0?(0,X.jsxs)(`fieldset`,{className:`grid gap-2 border-t pt-4`,children:[(0,X.jsx)(`legend`,{className:`text-xs font-medium`,children:`Stored secret fields`}),(0,X.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground/70`,children:`Values remain inside the provider configuration and are never loaded by this page. Select a field only when you want it removed on save.`}),a.secretFields.map(e=>(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:a.clearedSecretFields.includes(e),onChange:t=>f(`clearedSecretFields`,t.target.checked?[...a.clearedSecretFields,e]:a.clearedSecretFields.filter(t=>t!==e))}),`Clear `,(0,X.jsx)(`code`,{className:`font-mono`,children:e})]},e))]}):null,s?(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/6 px-3 py-2 text-xs text-destructive-foreground`,children:[(0,X.jsx)(p,{className:`mt-0.5 size-3.5`}),(0,X.jsx)(`span`,{children:s})]}):null]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(m,{variant:`outline`,onClick:()=>r(!1),disabled:l,children:`Cancel`}),(0,X.jsxs)(m,{onClick:()=>void ee(),disabled:l,children:[l?(0,X.jsx)(N,{className:`animate-spin`}):(0,X.jsx)(F,{}),`Save`]})]})]})})}function Ee(e){let t=(0,W.c)(18),{workspaces:n,selectedWorkspaceId:r,onChange:i}=e;if(n.length<=1||!r)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===r?e=t[4]:(e=e=>e.id===r,t[3]=r,t[4]=e),a=n.find(e),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o=a,s;t[5]===i?s=t[6]:(s=e=>{e&&i(e)},t[5]=i,t[6]=s);let c=o?.displayPath??`Select workspace`,l;t[7]===c?l=t[8]:(l=(0,X.jsx)(A,{className:`w-full sm:w-72`,"aria-label":`MCP workspace`,children:(0,X.jsx)(D,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===n?u=t[10]:(u=n.map(De),t[9]=n,t[10]=u);let d;t[11]===u?d=t[12]:(d=(0,X.jsx)(k,{align:`end`,alignItemWithTrigger:!1,children:u}),t[11]=u,t[12]=d);let f;return t[13]!==r||t[14]!==s||t[15]!==l||t[16]!==d?(f=(0,X.jsxs)(O,{value:r,onValueChange:s,children:[l,d]}),t[13]=r,t[14]=s,t[15]=l,t[16]=d,t[17]=f):f=t[17],f}function De(e){return(0,X.jsx)(E,{hideIndicator:!0,value:e.id,children:(0,X.jsx)(`span`,{className:`truncate`,children:e.displayPath})},e.id)}function Oe(e){let t=(0,W.c)(10),{providers:n,selectedWorkspaceId:r,onSelectWorkspace:i}=e;if(n.length===0)return null;let a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(`div`,{className:`border-b px-4 py-3`,children:(0,X.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Provider MCP support`})}),t[0]=a):a=t[0];let o;if(t[1]!==i||t[2]!==n||t[3]!==r){let e;t[5]!==i||t[6]!==r?(e=e=>{let t=z(e.driver),n=t?.icon??M,a=e.workspaceId!==void 0&&e.workspaceId===r,o=e.workspaceId!==void 0&&!a;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,X.jsxs)(`div`,{className:`relative mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg border bg-background`,children:[(0,X.jsx)(n,{className:`size-4 text-muted-foreground`}),e.accentColor?(0,X.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border border-background`,style:{backgroundColor:e.accentColor}}):null]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:xe(e)}),(0,X.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:e.instanceId})]}),(0,X.jsx)(`p`,{className:`mt-1 max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:e.message})]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 sm:justify-end`,children:[(0,X.jsx)(j,{variant:ye(e),children:be(e)}),e.workspaceId?(0,X.jsxs)(m,{size:`xs`,variant:a?`secondary`:`outline`,disabled:!o,onClick:()=>{e.workspaceId&&i(e.workspaceId)},children:[t?.label??u(e.driver),` `,`workspace`]}):null]})]},e.instanceId)},t[5]=i,t[6]=r,t[7]=e):e=t[7],o=n.map(e),t[1]=i,t[2]=n,t[3]=r,t[4]=o}else o=t[4];let s;return t[8]===o?s=t[9]:(s=(0,X.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm/4`,children:[a,(0,X.jsx)(`div`,{className:`divide-y`,children:o})]}),t[8]=o,t[9]=s),s}function ke(e){let t=(0,W.c)(20),{server:n}=e;if(n.tools.length===0&&n.resources.length===0&&n.resourceTemplates.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:`No tools or resources reported.`}),t[0]=e):e=t[0],e}let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`h4`,{className:`mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Tools`}),t[1]=r):r=t[1];let i;t[2]===n.tools?i=t[3]:(i=n.tools.slice(0,12).map(Me),t[2]=n.tools,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,X.jsxs)(`div`,{children:[r,(0,X.jsx)(`div`,{className:`space-y-1`,children:i})]}),t[4]=i,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`h4`,{className:`mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Resources`}),t[6]=o):o=t[6];let s;t[7]===n.resources?s=t[8]:(s=n.resources.slice(0,10).map(je),t[7]=n.resources,t[8]=s);let c;t[9]===s?c=t[10]:(c=(0,X.jsxs)(`div`,{children:[o,(0,X.jsx)(`div`,{className:`space-y-1`,children:s})]}),t[9]=s,t[10]=c);let l;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(`h4`,{className:`mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Templates`}),t[11]=l):l=t[11];let u;t[12]===n.resourceTemplates?u=t[13]:(u=n.resourceTemplates.slice(0,10).map(Ae),t[12]=n.resourceTemplates,t[13]=u);let d;t[14]===u?d=t[15]:(d=(0,X.jsxs)(`div`,{children:[l,(0,X.jsx)(`div`,{className:`space-y-1`,children:u})]}),t[14]=u,t[15]=d);let f;return t[16]!==a||t[17]!==c||t[18]!==d?(f=(0,X.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[a,c,d]}),t[16]=a,t[17]=c,t[18]=d,t[19]=f):f=t[19],f}function Ae(e){return(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/60 px-2 py-1.5`,children:[(0,X.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.title??e.name}),(0,X.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground/75`,children:e.uriTemplate})]},e.uriTemplate)}function je(e){return(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/60 px-2 py-1.5`,children:[(0,X.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.title??e.name}),(0,X.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground/75`,children:e.uri})]},e.uri)}function Me(e){return(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/60 px-2 py-1.5`,children:[(0,X.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.title??e.name}),e.description?(0,X.jsx)(`div`,{className:`line-clamp-2 text-[11px] text-muted-foreground/75`,children:e.description}):null]},e.name)}function Ne(e){let t=(0,W.c)(88),{server:n,capabilities:r,writable:i,mutating:a,onToggleEnabled:o,onEdit:s,onRemove:l,onOauthLogin:u}=e,[d,ee]=(0,U.useState)(!1),p;t[0]===n?p=t[1]:(p=pe(n),t[0]=n,t[1]=p);let h=p,_=r.inventory===`available`,v=_?`${n.tools.length} tools · ${n.resources.length+n.resourceTemplates.length} resources`:`Inventory not available`,y;t[2]===n.config.transport?y=t[3]:(y=n.config.transport===`http`?(0,X.jsx)(ae,{className:`size-4 text-muted-foreground`}):(0,X.jsx)(g,{className:`size-4 text-muted-foreground`}),t[2]=n.config.transport,t[3]=y);let b;t[4]===n.name?b=t[5]:(b=(0,X.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:n.name}),t[4]=n.name,t[5]=b);let x;t[6]!==y||t[7]!==b?(x=(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[y,b]}),t[6]=y,t[7]=b,t[8]=x):x=t[8];let S;t[9]===n?S=t[10]:(S=_e(n),t[9]=n,t[10]=S);let C;t[11]===n?C=t[12]:(C=ve(n),t[11]=n,t[12]=C);let T;t[13]!==S||t[14]!==C?(T=(0,X.jsx)(j,{variant:S,children:C}),t[13]=S,t[14]=C,t[15]=T):T=t[15];let E;t[16]===n.source?E=t[17]:(E=ge(n.source),t[16]=n.source,t[17]=E);let D;t[18]===E?D=t[19]:(D=(0,X.jsx)(j,{variant:`outline`,children:E}),t[18]=E,t[19]=D);let O;t[20]!==x||t[21]!==T||t[22]!==D?(O=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[x,T,D]}),t[20]=x,t[21]=T,t[22]=D,t[23]=O):O=t[23];let k;t[24]===h?k=t[25]:(k=(0,X.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground/80`,children:h}),t[24]=h,t[25]=k);let A;t[26]===n.config.transport?A=t[27]:(A=n.config.transport.toUpperCase(),t[26]=n.config.transport,t[27]=A);let M;t[28]===A?M=t[29]:(M=(0,X.jsx)(`span`,{children:A}),t[28]=A,t[29]=M);let N;t[30]===v?N=t[31]:(N=(0,X.jsx)(`span`,{children:v}),t[30]=v,t[31]=N);let P;t[32]===n.authStatus?P=t[33]:(P=(0,X.jsxs)(`span`,{children:[`Auth: `,n.authStatus]}),t[32]=n.authStatus,t[33]=P);let F;t[34]!==M||t[35]!==N||t[36]!==P?(F=(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-[11px] text-muted-foreground`,children:[M,N,P]}),t[34]=M,t[35]=N,t[36]=P,t[37]=F):F=t[37];let I;t[38]===n.error?I=t[39]:(I=n.error?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:n.error}):null,t[38]=n.error,t[39]=I);let L;t[40]!==O||t[41]!==k||t[42]!==F||t[43]!==I?(L=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[O,k,F,I]}),t[40]=O,t[41]=k,t[42]=F,t[43]=I,t[44]=L):L=t[44];let R;t[45]!==r.oauth||t[46]!==a||t[47]!==u||t[48]!==n?(R=r.oauth===`available`&&n.authStatus===`notLoggedIn`?(0,X.jsxs)(re,{children:[(0,X.jsx)(te,{render:(0,X.jsx)(m,{size:`icon-sm`,variant:`outline`,disabled:a,onClick:()=>u(n),"aria-label":`Log in to ${n.name}`,children:(0,X.jsx)(oe,{})})}),(0,X.jsx)(ne,{children:`Start OAuth login`})]}):null,t[45]=r.oauth,t[46]=a,t[47]=u,t[48]=n,t[49]=R):R=t[49];let z;t[50]!==r.upsert||t[51]!==a||t[52]!==s||t[53]!==n||t[54]!==i?(z=i&&r.upsert===`available`?(0,X.jsx)(m,{size:`sm`,variant:`outline`,onClick:()=>s(n),disabled:a,children:`Edit`}):null,t[50]=r.upsert,t[51]=a,t[52]=s,t[53]=n,t[54]=i,t[55]=z):z=t[55];let B;t[56]!==r.remove||t[57]!==a||t[58]!==l||t[59]!==n||t[60]!==i?(B=i&&r.remove===`available`?(0,X.jsxs)(re,{children:[(0,X.jsx)(te,{render:(0,X.jsx)(m,{size:`icon-sm`,variant:`destructive-outline`,disabled:a,onClick:()=>l(n),"aria-label":`Remove ${n.name}`,children:(0,X.jsx)(ie,{})})}),(0,X.jsx)(ne,{children:`Remove server`})]}):null,t[56]=r.remove,t[57]=a,t[58]=l,t[59]=n,t[60]=i,t[61]=B):B=t[61];let V;t[62]!==r.enableDisable||t[63]!==a||t[64]!==o||t[65]!==n||t[66]!==i?(V=i&&r.enableDisable===`available`?(0,X.jsx)(w,{checked:n.config.enabled,disabled:a,onCheckedChange:e=>o(n,!!e),"aria-label":`Enable ${n.name}`}):null,t[62]=r.enableDisable,t[63]=a,t[64]=o,t[65]=n,t[66]=i,t[67]=V):V=t[67];let H;t[68]!==d||t[69]!==_||t[70]!==n.name?(H=_?(0,X.jsx)(m,{size:`icon-sm`,variant:`ghost`,onClick:()=>ee(Pe),"aria-label":`Toggle ${n.name} inventory`,children:(0,X.jsx)(f,{className:c(`transition-transform`,d&&`rotate-180`)})}):null,t[68]=d,t[69]=_,t[70]=n.name,t[71]=H):H=t[71];let G;t[72]!==R||t[73]!==z||t[74]!==B||t[75]!==V||t[76]!==H?(G=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[R,z,B,V,H]}),t[72]=R,t[73]=z,t[74]=B,t[75]=V,t[76]=H,t[77]=G):G=t[77];let K;t[78]!==L||t[79]!==G?(K=(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-start sm:justify-between`,children:[L,G]}),t[78]=L,t[79]=G,t[80]=K):K=t[80];let q;t[81]!==d||t[82]!==_||t[83]!==n?(q=d&&_?(0,X.jsx)(`div`,{className:`border-t bg-muted/20 p-4`,children:(0,X.jsx)(ke,{server:n})}):null,t[81]=d,t[82]=_,t[83]=n,t[84]=q):q=t[84];let J;return t[85]!==K||t[86]!==q?(J=(0,X.jsxs)(`article`,{className:`rounded-lg border bg-card text-card-foreground shadow-sm/4`,children:[K,q]}),t[85]=K,t[86]=q,t[87]=J):J=t[87],J}function Pe(e){return!e}function Fe(){let e=d(),t=(0,U.useMemo)(()=>e?i(e.environmentId)?.mcp:ee().mcp,[e]),[a,l]=(0,U.useState)(null),[u,f]=(0,U.useState)(null),[h,g]=(0,U.useState)(null),[_,v]=(0,U.useState)(!0),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(null),[C,w]=(0,U.useState)(!1),[T,E]=(0,U.useState)(null),[D,O]=(0,U.useState)(null),k=a?.workspaces??me,A=a?.providers??he,j=(0,U.useMemo)(()=>k.find(e=>e.id===u)??null,[u,k]),ie=j?.capabilities,F=Se(j),R=(0,U.useCallback)(async(e,r)=>{r?.quiet||b(!0),O(null);try{let r=await Z(t).listServers({workspaceId:n.make(e),detail:`full`});g(r)}catch(e){O(e instanceof Error?e.message:`Failed to load MCP servers.`),Q(`Failed to load MCP servers`,e)}finally{b(!1)}},[t]),z=(0,U.useCallback)(async()=>{v(!0),O(null);try{let e=await Z(t).listWorkspaces();l(e);let n=e.workspaces.find(e=>e.id===u)?.id??e.workspaces[0]?.id??null;f(n),n?await R(n,{quiet:!0}):g(null)}catch(e){O(e instanceof Error?e.message:`Failed to load MCP workspaces.`),Q(`Failed to load MCP workspaces`,e)}finally{v(!1)}},[R,t,u]);(0,U.useEffect)(()=>{z()},[z]);let V=async()=>{if(!u){await z();return}await R(u)},ae=async()=>{if(u){b(!0);try{let e=await Z(t).reloadServers({workspaceId:n.make(u)});g(e),o.add(L({type:`success`,title:`MCP servers reloaded`}))}catch(e){Q(`Failed to reload MCP servers`,e)}finally{b(!1)}}},H=async e=>{if(!u)return;let i=await Z(t).upsertServer({workspaceId:n.make(u),name:r.make(e.name.trim()),config:de(e),secretMutations:fe(e)});g(i),o.add(L({type:`success`,title:`MCP server saved`}))},oe=async(e,r)=>{if(u){S(e.name);try{let i=await Z(t).setServerEnabled({workspaceId:n.make(u),name:e.name,enabled:r});g(i)}catch(e){Q(`Failed to update MCP server`,e)}finally{S(null)}}},W=async e=>{if(u&&await ee().dialogs.confirm(`Remove MCP server "${e.name}"?`)){S(e.name);try{let r=await Z(t).removeServer({workspaceId:n.make(u),name:e.name});g(r),o.add(L({type:`success`,title:`MCP server removed`}))}catch(e){Q(`Failed to remove MCP server`,e)}finally{S(null)}}},G=async e=>{if(u){S(e.name);try{let r=await Z(t).startOauthLogin({workspaceId:n.make(u),serverName:e.name,scopes:e.config.oauthScopes});await ee().shell.openExternal(r.authorizationUrl),o.add(L({type:`success`,title:`OAuth login opened`}))}catch(e){Q(`Failed to start OAuth login`,e)}finally{S(null)}}},K=()=>{E(null),w(!0)},q=e=>{E(e),w(!0)};return(0,X.jsxs)(`div`,{className:`flex-1 p-6 sm:p-8`,children:[(0,X.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6`,children:[(0,X.jsxs)(`header`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,X.jsx)(M,{className:`size-3.5`}),`Provider MCP`]}),(0,X.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`MCP Servers`}),(0,X.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Manage MCP servers through each provider's native configuration surface. Controls appear only when that provider exposes a reliable operation.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(Ee,{workspaces:k,selectedWorkspaceId:u,onChange:e=>{f(e),R(e)}}),(0,X.jsxs)(re,{children:[(0,X.jsx)(te,{render:(0,X.jsx)(m,{size:`icon`,variant:`outline`,onClick:()=>void V(),disabled:_||y,"aria-label":`Refresh MCP servers`,children:(0,X.jsx)(P,{className:c((_||y)&&`animate-spin`)})})}),(0,X.jsx)(ne,{children:`Refresh`})]}),ie?.reload===`available`?(0,X.jsxs)(m,{variant:`outline`,disabled:!u||y,onClick:()=>void ae(),children:[(0,X.jsx)(I,{}),`Reload`]}):null,ie?.upsert===`available`?(0,X.jsxs)(m,{disabled:!u,onClick:K,children:[(0,X.jsx)(B,{}),`Add server`]}):null]})]}),(0,X.jsx)(Oe,{providers:A,selectedWorkspaceId:u,onSelectWorkspace:e=>{f(e),R(e)}}),j?(0,X.jsxs)(`div`,{className:`rounded-lg border bg-muted/20 px-4 py-3 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,X.jsx)(`span`,{className:`min-w-0 break-all font-mono`,children:j.displayPath}),(0,X.jsxs)(`span`,{children:[j.nativeScope,` scope · `,j.formatGeneration]}),(0,X.jsxs)(`span`,{children:[`Used by`,` `,j.providerInstances.map(e=>e.displayName??e.instanceId).join(`, `)]})]}),h?.configPath?(0,X.jsx)(`div`,{className:`mt-1 break-all font-mono text-[11px] text-muted-foreground/70`,children:h.configPath}):null]}):null,a?.issues.length?(0,X.jsx)(`div`,{className:`space-y-2 rounded-lg border border-warning/30 bg-warning/6 p-3`,children:a.issues.map(e=>(0,X.jsxs)(`div`,{className:`flex gap-2 text-xs`,children:[(0,X.jsx)(p,{className:`mt-0.5 size-3.5 text-warning-foreground`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.instanceId}),`: `,e.message]})]},`${e.instanceId}:${e.message}`))}):null,D?(0,X.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/6 p-3 text-sm text-destructive-foreground`,children:D}):null,j?(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[j.capabilities.health===`available`?null:(0,X.jsxs)(`span`,{children:[`Live health is not reported by `,F,`.`]}),j.capabilities.inventory===`available`?null:(0,X.jsx)(`span`,{children:`Tool and resource inventory is unavailable.`}),j.capabilities.enableDisable===`available`?null:(0,X.jsx)(`span`,{children:`Individual enable/disable is not supported.`})]}):null,_?(0,X.jsx)(`div`,{className:`flex min-h-48 items-center justify-center rounded-lg border border-dashed`,children:(0,X.jsx)(N,{className:`size-5 animate-spin text-muted-foreground`})}):k.length===0?(0,X.jsxs)(`div`,{className:`rounded-lg border border-dashed p-8 text-center`,children:[(0,X.jsx)(M,{className:`mx-auto size-7 text-muted-foreground/60`}),(0,X.jsx)(`h3`,{className:`mt-3 text-sm font-semibold`,children:`No MCP provider profiles`}),(0,X.jsx)(`p`,{className:`mx-auto mt-1 max-w-md text-sm text-muted-foreground/80`,children:`Add or enable a provider instance with a supported MCP configuration surface.`})]}):h?.servers.length===0?(0,X.jsxs)(`div`,{className:`rounded-lg border border-dashed p-8 text-center`,children:[(0,X.jsx)(s,{className:`mx-auto size-7 text-muted-foreground/60`}),(0,X.jsx)(`h3`,{className:`mt-3 text-sm font-semibold`,children:`No MCP servers configured`}),(0,X.jsxs)(`p`,{className:`mx-auto mt-1 max-w-md text-sm text-muted-foreground/80`,children:[`Add a stdio or HTTP server to make its tools available to `,F,`sessions.`]}),ie?.upsert===`available`?(0,X.jsxs)(m,{className:`mt-4`,onClick:K,children:[(0,X.jsx)(B,{}),`Add server`]}):null]}):(0,X.jsx)(`div`,{className:`grid gap-3`,children:h?.servers.map(e=>(0,X.jsx)(Ne,{server:e,capabilities:ie??{readConfiguration:`unavailable`,upsert:`unavailable`,remove:`unavailable`,enableDisable:`unavailable`,reload:`unavailable`,health:`unavailable`,inventory:`unavailable`,oauth:`unavailable`,externalAgentControl:`unavailable`,automaticAgentControl:`unavailable`,scopes:[]},writable:e.source===`user`||e.source===`project`&&j?.nativeScope===`project`,mutating:x===e.name,onToggleEnabled:(e,t)=>void oe(e,t),onEdit:q,onRemove:e=>void W(e),onOauthLogin:e=>void G(e)},e.name))})]}),(0,X.jsx)(Te,{open:C,server:T,providerName:F,onOpenChange:w,onSubmit:H})]})}export{Fe as McpServersSettings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{Ac as n,Ca as r,Kc as i,Mc as a,Qc as o,Rc as s,Vr as c,Wc as l,Wo as u,Zc as d,_c as f,_l as p,as as m,ec as h,es as g,hs as _,jc as v,ko as y,ms as b,nl as x,ns as S,os as C,rs as w,ts as ee,uc as T,us as E,vc as D,wc as O,wo as k,yc as A,zc as j,zr as M}from"./runtime-Djy96GJd.js";import{t as N}from"./compiler-runtime-qmuS0Svy.js";import{f as P}from"./usePopupViewport-kXU31P6l.js";import{p as F,s as I}from"./useScrollLock-DjMxrUJe.js";import{i as L,n as R,o as z,s as B,t as te}from"./DialogViewport-DVDl03yd.js";import{n as V,r as H,t as ne}from"./DialogTitle-DCHX74Tz.js";import{t as re}from"./useControlled-DQwgzrEC.js";import{t as ie}from"./GlassSurface-GY6owikG.js";var U=e(t(),1),W=N(),G=120;function K(e){let t=e.replace(/\s+/gu,` `).trim();return t.length<=G?t:`${t.slice(0,119)}…`}var q=p();function J(e){let t=(0,W.c)(37),{label:n,icon:r,secondaryText:i,trailing:a,disabled:o,disabledReason:s,destructive:l,selected:u,onClick:d,className:f}=e,p=o!==void 0&&o,m=l!==void 0&&l,h=(0,U.useId)(),g;t[0]!==p||t[1]!==s?(g=p&&s?K(s):null,t[0]=p,t[1]=s,t[2]=g):g=t[2];let _=g,v=`${h}-label`,y=`${h}-secondary`,b=`${h}-trailing`,x=`${h}-reason`,S=i?y:null,C=a?b:null,w;t[3]!==v||t[4]!==S||t[5]!==C?(w=[v,S,C].filter(Y),t[3]=v,t[4]=S,t[5]=C,t[6]=w):w=t[6];let ee=w.join(` `),T=_?ee:void 0,E=_?x:void 0,D=m&&!p&&`text-destructive`,O=u&&`bg-accent/60 font-medium`,k;t[7]!==f||t[8]!==O||t[9]!==D?(k=c(`flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:text-muted-foreground/60`,D,O,f),t[7]=f,t[8]=O,t[9]=D,t[10]=k):k=t[10];let A;t[11]!==n||t[12]!==v?(A=(0,q.jsx)(`span`,{id:v,className:`truncate`,children:n}),t[11]=n,t[12]=v,t[13]=A):A=t[13];let j;t[14]!==y||t[15]!==i?(j=i?(0,q.jsx)(`span`,{id:y,className:`truncate text-xs text-muted-foreground`,children:i}):null,t[14]=y,t[15]=i,t[16]=j):j=t[16];let M;t[17]!==_||t[18]!==x?(M=_?(0,q.jsx)(`span`,{id:x,className:`truncate text-xs text-muted-foreground/80`,children:_}):null,t[17]=_,t[18]=x,t[19]=M):M=t[19];let N;t[20]!==A||t[21]!==j||t[22]!==M?(N=(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[A,j,M]}),t[20]=A,t[21]=j,t[22]=M,t[23]=N):N=t[23];let P;t[24]!==a||t[25]!==b?(P=a?(0,q.jsx)(`span`,{id:b,className:`flex shrink-0 items-center gap-2`,children:a}):null,t[24]=a,t[25]=b,t[26]=P):P=t[26];let F;return t[27]!==p||t[28]!==r||t[29]!==d||t[30]!==u||t[31]!==k||t[32]!==N||t[33]!==P||t[34]!==T||t[35]!==E?(F=(0,q.jsxs)(`button`,{type:`button`,disabled:p,"aria-labelledby":T,"aria-describedby":E,"aria-pressed":u,className:k,"data-slot":`mobile-list-row`,onClick:d,children:[r,N,P]}),t[27]=p,t[28]=r,t[29]=d,t[30]=u,t[31]=k,t[32]=N,t[33]=P,t[34]=T,t[35]=E,t[36]=F):F=t[36],F}function Y(e){return e!==null}var ae=`--nested-drawers`,oe=`--drawer-height`,se=`--drawer-frontmost-height`,ce=`--drawer-swipe-movement-x`,le=`--drawer-swipe-movement-y`,X=`--drawer-snap-point-offset`,ue=`--drawer-swipe-strength`,de=`--drawer-swipe-progress`,fe=U.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=B(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return b(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:h,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[de]:`0`,[ue]:`1`}},o],enabled:a||!l})}),pe=H,me=`data-drawer-content`,he=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return B(),b(`div`,e,{ref:t,props:[{[me]:``},a]})}),ge=V,_e=U.createContext(void 0);function ve(){return U.useContext(_e)}var ye=`data-expanded`,be=`data-nested-drawer-open`,Z=`data-nested-drawer-swiping`,xe=`data-swipe-dismiss`,Se=`data-swipe-direction`,Ce=`data-swiping`,we=U.createContext(void 0);function Te(e){let t=U.useContext(we);if(e!==!0&&t===void 0)throw Error(d(90));return t}function Ee(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function Q(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?m(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function De(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function Oe(){let e=B(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:s}=Te(),c=e.useState(`viewportElement`),[l,u]=U.useState(0),[d,f]=U.useState(16),p=i(()=>{let e=a(c).documentElement;u(c?c.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&f(t)});o(()=>{if(p(),!c||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(p);return e.observe(c),()=>{e.disconnect()}},[p,c]);let h=U.useMemo(()=>{if(!t||t.length===0||l<=0||s<=0)return[];let e=Math.min(s,l),n=t.map(t=>{let n=Q(t,l,d);if(n===null)return null;let r=m(n,0,e);return{value:t,height:r,offset:Math.max(0,s-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],i=[];for(let e=n.length-1;e>=0;--e){let t=n[e];i.some(e=>Math.abs(e-t.height)<=1)||(i.push(t.height),r.push(t))}return r.reverse(),r},[s,d,t,l]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:s,viewportHeight:l,resolvedSnapPoints:h,activeSnapPointOffset:U.useMemo(()=>{if(n===null)return;let e=h.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(s,l),r=Q(n,l,d);if(r===null)return;let i=m(r,0,t);return h[De(h.map(e=>e.height),i)]},[n,s,h,d,l])?.offset??null}}var ke=U.createContext(null);function Ae(){return U.useContext(ke)}var je=!1;function Me(){je||=(typeof CSS<`u`&&`registerProperty`in CSS&&([ce,le,X].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:de,initialValue:`0`},{name:ue,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var Ne={...h,expanded(e){return e?{[ye]:``}:null},nestedDrawerOpen(e){return e?{[be]:``}:null},nestedDrawerSwiping(e){return e?{[Z]:``}:null},swipeDirection(e){return{[Se]:e}},swiping(e){return e?{[Ce]:``}:null}},$=U.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:s,initialFocus:c,...l}=e,u=B(),d=u.context.popupRef,{swipeDirection:f,frontmostHeight:p,hasNestedDrawer:m,nestedSwiping:h,nestedSwipeProgressStore:g,onPopupHeightChange:_,notifyParentFrontmostHeight:v,notifyParentHasNestedDrawer:y}=Te(),S=u.useState(`descriptionElementId`),C=u.useState(`disablePointerDismissal`),w=u.useState(`floatingRootContext`),ee=u.useState(`popupProps`),T=u.useState(`modal`),D=u.useState(`mounted`),O=u.useState(`nested`),k=u.useState(`nestedOpenDrawerCount`),A=u.useState(`transitionStatus`),j=u.useState(`open`),M=u.useState(`openMethod`),N=u.useState(`titleElementId`),L=u.useState(`role`),R=w.useState(`floatingId`),te=l.id??R,V=Ae();z();let{snapPoints:H,activeSnapPoint:ne,activeSnapPointOffset:re}=Oe(),ie=k>0,W=V?.swiping??!1,G=V?.swipeStrength??null,[K,J]=U.useState(0),Y=U.useRef(0),ce=i(()=>{let e=d.current;if(!e)return;let t=e.offsetHeight;if(Y.current>0&&p>Y.current&&t>Y.current)return;if(Y.current>0&&m){let e=Y.current;J(e),_(e);return}let n=t;n!==Y.current&&(Y.current=n,J(n),_(n))});o(()=>{if(!D){Y.current=0,J(0),_(0);return}let e=d.current;if(!e||(Me(),ce(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(ce);return t.observe(e),()=>{t.disconnect()}},[ce,D,ie,_,d]),o(()=>{let e=()=>{let e=d.current;if(!e)return;let t=g.getSnapshot();t>0?e.style.setProperty(de,`${t}`):e.style.setProperty(de,`0`)};e();let t=g.subscribe(e),n=d.current;return()=>{t(),n&&n.style.setProperty(de,`0`)}},[g,d]),o(()=>{if(j)return v?.(p),()=>{v?.(0)}},[p,j,v]),o(()=>{if(y)return y(j||A===`ending`),()=>{y(!1)}},[y,j,A]),E({open:j,ref:d,onComplete(){j&&u.context.onOpenChangeComplete?.(!0)}});let fe=c===void 0?d:c,pe=u.useStateSetter(`popupElement`),me={open:j,nested:O,transitionStatus:A,expanded:ne===1,nestedDrawerOpen:ie,nestedDrawerSwiping:h,swipeDirection:f,swiping:W},he;K&&(m||A===`ending`)&&(he=`${K}px`);let ge=H&&H.length>0&&(f===`down`||f===`up`),_e=null;ge&&re!==null&&(_e=f===`up`?-re:re);let ve=V?V.getDragStyles():x;if(ge&&f===`down`){let e=re??0,t=Number.parseFloat(String(ve[le]));ve=W&&Number.isFinite(t)?{...ve,transform:void 0,[le]:`${Ee(e,t)}px`}:{...ve,transform:void 0}}let ye=b(`div`,e,{state:me,props:[ee,{id:te,"aria-labelledby":N,"aria-describedby":S,role:L,...P,hidden:!D,onKeyDown(e){I.has(e.key)&&e.stopPropagation()},style:{...ve,[de]:`0`,[ae]:k,[oe]:he,[X]:typeof _e==`number`?`${_e}px`:`0px`,[se]:p?`${p}px`:void 0,[ue]:typeof G==`number`&&Number.isFinite(G)&&G>0?`${G}`:`1`}},l],ref:[t,d,pe],stateAttributesMapping:Ne});return(0,q.jsx)(F,{context:w,openInteractionType:M,disabled:!D,closeOnFocusOut:!C,initialFocus:fe,returnFocus:s,modal:T!==!1,restoreFocus:`popup`,children:ye})}),Pe=L,Fe,Ie;function Le(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null,swipeDirection:p=`down`,snapToSequentialPoints:m=!1,snapPoints:h,snapPoint:g,defaultSnapPoint:_,onSnapPointChange:v}=e,y=Te(!0),b=y?.onNestedSwipeProgressChange,x=y?.onNestedFrontmostHeightChange,S=y?.onNestedSwipingChange,C=y?.onNestedDrawerPresenceChange,[w,ee]=U.useState(0),[T,E]=U.useState(0),[D,O]=U.useState(!1),[A,j]=U.useState(!1),[M]=U.useState(Re),N=_===void 0?h?.[0]??null:_,P=g!==void 0,[F,I]=re({controlled:g,default:N,name:`Drawer`,state:`snapPoint`}),L=U.useRef(!1),z=U.useRef(!1),B=i((e,t)=>{let n=t??k(`none`);v?.(e,n),!n.isCanceled&&I(e)}),te=U.useMemo(()=>P||!h||h.length===0?F:F===null||!h.some(e=>Object.is(e,F))?N:F,[F,P,N,h]),V=i(e=>{ee(e),!L.current&&e>0&&E(e)}),H=i(e=>{if(e>0){L.current=!0,E(e);return}L.current=!1,w>0&&E(w)}),ne=i(e=>{O(e)}),ie=i(e=>{M.set(e),b?.(e)}),W=i(e=>{j(e),S?.(e)}),G=i((e,t)=>{a?.(e,t),!t.isCanceled&&!e&&h&&h.length>0&&B(N,k(t.reason,t.event,t.trigger))}),K=U.useMemo(()=>({swipeDirection:p,swipeAreaActiveRef:z,snapToSequentialPoints:m,snapPoints:h,activeSnapPoint:te,setActiveSnapPoint:B,frontmostHeight:T,popupHeight:w,hasNestedDrawer:D,nestedSwiping:A,nestedSwipeProgressStore:M,onNestedDrawerPresenceChange:ne,onPopupHeightChange:V,onNestedFrontmostHeightChange:H,onNestedSwipingChange:W,onNestedSwipeProgressChange:ie,notifyParentFrontmostHeight:x,notifyParentSwipingChange:S,notifyParentSwipeProgressChange:b,notifyParentHasNestedDrawer:C}),[te,T,D,A,M,C,b,S,x,ne,H,ie,W,V,w,B,h,m,z,p]),J=typeof t==`function`?e=>(0,q.jsxs)(U.Fragment,{children:[Fe||=(0,q.jsx)(ze,{}),t(e)]}):(0,q.jsxs)(U.Fragment,{children:[Ie||=(0,q.jsx)(ze,{}),t]}),Y=R(`drawer`,{open:n,defaultOpen:r,onOpenChange:G,onOpenChangeComplete:o,disablePointerDismissal:s,modal:c,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f,children:J});return(0,q.jsx)(we.Provider,{value:K,children:Y})}function Re(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function ze(){let e=ve(),t=B(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,i=t.useState(`open`),a=t.useState(`nestedOpenDialogCount`),c=t.useState(`popupElement`),l=a===0;return o(()=>{if(r)return()=>{r(t)}},[r,t]),o(()=>{n?.(t,i)},[i,n,t]),U.useEffect(()=>{if(!i||!l||!O)return;let e=s(c).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,k(y,e))}let r=new e,a=v(r,`close`,n);return()=>{a(),r.destroy()}},[t,l,i,c]),null}var Be=ne,Ve=e(l(),1),He=`data-nested-dialog-open`,Ue=U.createContext(void 0);function We(){return U.useContext(Ue)}var Ge=10,Ke=.5,qe=.5,Je=300,Ye=4,Xe=.2,Ze=4,Qe=80,$e=360,et=.1,tt=6,nt=2,rt=`[${me}]`,it=U.forwardRef(function(e,t){let{render:r,className:s,style:c,children:l,...d}=e,f=B(),p=f.context.popupRef,h=f.context.backdropRef,{swipeDirection:y,notifyParentSwipingChange:b,notifyParentSwipeProgressChange:x,frontmostHeight:C,snapToSequentialPoints:E,swipeAreaActiveRef:O}=Te(),M=ve(),{snapPoints:N,resolvedSnapPoints:P,activeSnapPoint:F,activeSnapPointOffset:I,setActiveSnapPoint:L,popupHeight:R}=Oe(),z=f.useState(`open`),V=f.useState(`mounted`),H=f.useState(`nested`),ne=f.useState(`nestedOpenDrawerCount`),re=f.useState(`viewportElement`),ie=f.useState(`popupElement`),W=M?.visualStateStore,G=ne>0,K=y===`left`||y===`right`?`horizontal`:`vertical`,J=K===`vertical`,Y=J?`horizontal`:`vertical`,[ae,se]=U.useState(null),X=U.useRef(void 0),ue=U.useRef(null),fe=n(),pe=U.useRef(!1),me=U.useRef(!1),he=U.useRef(``),ge=U.useRef(!1),_e=U.useRef(!1),ye=U.useRef(null),be=We(),Z=U.useMemo(()=>{if(!N||N.length<2||P.length<2||y!==`down`&&y!==`up`)return null;let e=P.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[P,N,y]),Se=U.useMemo(()=>!Z||I===null?null:m((I-Z.minOffset)/Z.range,0,1),[I,Z]),Ce=U.useMemo(()=>N&&N.length>0&&(y===`down`||y===`up`)?y===`down`?[`down`,`up`]:[`up`,`down`]:[y],[N,y]),we=i(e=>{p.current?.toggleAttribute(xe,e),h.current?.toggleAttribute(xe,e)}),Q=i(()=>{we(!1),p.current?.removeAttribute(T),se(null)}),Ae=i(()=>{me.current&&(me.current=!1,b?.(!1))}),je=i((e,t,n)=>{let r=z&&!H&&t,i=r?e:0,a=z&&t?e:0;n&&x&&(x(a),a<=0&&Ae()),W?.set({swipeProgress:i,frontmostHeight:i>0?C:0});let o=h.current;if(!o)return;let s=r&&i>0;o.style.setProperty(de,s?`${i}`:`0`),s&&C>0?o.style.setProperty(oe,`${C}px`):o.style.removeProperty(oe)});function Me(e,t,n,r,i,a,o,s){let c=ct(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&N&&N.length>0?I??0:0)+g(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=g(t,o,s),f=Math.abs(d)>0?d:g(t,i,a);if(f<=Xe)return null;let p=m(f,Xe,Ze);return et+(m(u/p,Qe,$e)-Qe)/280*.9}function Ne(e){if(me.current||!e)return;let t=e.direction??y,n=g(t,e.deltaX,e.deltaY);Math.abs(n)<Ge||(me.current=!0,b?.(!0))}let $=ee({enabled:V&&!G,directions:Ce,elementRef:f.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:ce,y:le},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=p.current,n=a(t).getSelection?.();if(!n||n.isCollapsed)return;let r=j(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=j(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(D(t,r)||D(t,i))&&n.removeAllRanges()},onSwipingChange(e){pe.current=e,at(f.context.backdropRef.current,e),!e&&!x&&Ae()},swipeThreshold({element:e,direction:t}){return lt(e,t)},canStart(e,t){let n=f.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=S(n.getRootNode(),e.x,e.y);if(!i||!D(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&pt(r,n))},onProgress(e,t){let n=pe.current;n&&Ne(t);let r=!!(N&&N.length>0);if(n&&y===`down`&&r&&t){let e=f.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(le,`${Ee(I??0,t.deltaY)}px`))}let i=e;if(Z&&R>0){let e=I??Z.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>m((e-Z.minOffset)/Z.range,0,1))(m(e+t.deltaY,0,R)):Se!==null&&(i=Se)}n||(x?.(0),Ae()),je(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:i,velocityY:a,releaseVelocityX:o,releaseVelocityY:s}){let c=f.context.popupRef.current;if(!c){Q();return}let l=c;function d(e){Ae(),we(!0),l.style.removeProperty(`transition`),l.setAttribute(T,``),Ve.flushSync(()=>{se(Me(l,e,t,n,i,a,o,s))})}if(!N||N.length===0){if(!r){Q();return}let e=g(r,t,n);if(e<=0)return Q(),!1;if(g(r,i,a)>=Ke)return d(r),!0;let o=e>lt(l,r);return o?d(r):Q(),o}if(y!==`down`&&y!==`up`){Q();return}if(!R)return Q(),!1;if(P.length===0){Q();return}let p=y===`down`?n:-n,h=Math.sign(p),_=y===`down`?s:-s,v=y===`down`?a:-a,b=_;if(h!==0&&Math.abs(p)>=Ge){let e=Math.sign(b);e!==0&&e!==h&&(b=v)}let x=I??0,S=m(x+p,0,R),C=Math.abs(b)>=qe?m(b,-4,Ye)*Je:0,w=E?S:m(S+C,0,R),ee=k(u,e),D=()=>(je(0,!0,!0),Q(),!1),O=e=>(L(e.value,ee),D()),A=e=>r?(L(null,ee),ee.isCanceled?D():(X.current=F,d(y),!0)):O(e);if(E){let e=[...P].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=De(t,x),r=e[De(t,w)],i=Math.sign(b),a=h!==0&&i!==0&&i===h&&Math.abs(b)>=qe,o=w;if(a){let t=m(n+h,0,e.length-1);if(t!==n){let n=e[t];(h>0?w<n.offset:w>n.offset)&&(r=n,o=n.offset)}else if(h>0)return A(r)}return Math.abs(o-R)<Math.abs(o-r.offset)?A(r):O(r)}let j=P[De(P.map(e=>e.offset),w)];return b>=Ke&&p>0||Math.abs(w-R)<Math.abs(w-j.offset)?A(j):O(j)},onDismiss(e){W?.set({swipeProgress:0,frontmostHeight:0});let t=f.context.backdropRef.current;t&&(t.style.setProperty(de,`0`),t.style.removeProperty(oe));let n=k(u,e);if(f.setOpen(!1,n),n.isCanceled){let t=X.current;t!==void 0&&L(t,k(u,e)),X.current=void 0,ue.current?.(),Q();return}if(f.select(`open`)){let t=e;fe.request(()=>{if(f.select(`open`)){let e=X.current;e!==void 0&&L(e,k(u,t)),X.current=void 0,Q(),ue.current?.()}else X.current=void 0});return}X.current=void 0,we(!0)}}),Pe=$.getPointerProps(),Fe=$.getTouchProps(),{moveNative:Ie,reset:Le}=$;ue.current=Le,U.useEffect(()=>{let e=re??ie;if(!e)return;let t=e,n=a(t);function r(e,r,i){let a=J?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||pt(n,t)||!z||!V||G||_t(r,e,i,J))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ie(e,t);return}if(!vt(o,K)){e.cancelable&&e.preventDefault(),e.stopPropagation();return}if(a!==0){let t=xt(o,K,y,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),Ie(e,t))}function i(e){if(be?.onTouchMove(e),_e.current)return;let t=ye.current,n=e.touches[0];n&&t&&(r(e,t,n),gt(t,n))}return v(n,`touchmove`,i,{passive:!1,capture:!0})},[V,G,z,ie,J,K,y,Ie,re,be]),o(()=>{Z&&!$.swiping&&je(!z||H?0:Se??0,!0,!1)},[je,C,H,x,z,Se,Z,$.swiping,f,W]),o(()=>{if(x)return z||x(0),()=>{x(0)}},[x,z]),o(()=>{z&&(O.current||Le(),Q())},[Q,z,Le,O]),o(()=>{let e=h.current;return()=>{W?.set({swipeProgress:0,frontmostHeight:0}),at(e,!1);let t=h.current;t!==e&&at(t,!1),Ae()}},[h,Ae,W]);let Re=U.useMemo(()=>({swiping:$.swiping,getDragStyles:$.getDragStyles,swipeStrength:ae??null,setSwipeDismissed:we}),[we,$.getDragStyles,$.swiping,ae]);function ze(e){_e.current=e,ye.current=null}function Be(){ze(!1),he.current=``,ge.current=!1}function Ue(e){return he.current=``,e.pointerType!==`touch`}return(0,q.jsx)(te,{ref:t,className:s,style:c,render:r,..._(d,{onPointerDown(e){if(he.current=e.pointerType,ge.current=e.pointerType===`pen`,!z||!V||G)return;let t=S(e.currentTarget.getRootNode(),e.clientX,e.clientY);ot(t)||st(t)||e.pointerType!==`touch`&&Pe.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&Pe.onPointerMove?.(e)},onPointerUp(e){Ue(e)&&Pe.onPointerUp?.(e)},onPointerCancel(e){Ue(e)&&Pe.onPointerCancel?.(e)},onTouchStart(e){if(he.current===`pen`&&ge.current){ge.current=!1,ze(!1);return}if(!z||!V||G){ze(!1);return}let t=e.touches[0];if(!t)return;if(ht(e)){ze(!1);return}let n=e.currentTarget,r=S(n.getRootNode(),t.clientX,t.clientY),i=A(e.nativeEvent),a=j(i)?i:n;if(!D(n,a)){ze(!0);return}if(be?.onTouchStart(e),ot(r)){ze(!0);return}_e.current=!1;let o=w(a,n,K),s=w(a,n,Y)!=null,c=null;o&&(c=bt(o,K,y)?null:!1),ye.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:o,hasCrossAxisScrollableContent:s,allowSwipe:c,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},Fe.onTouchStart?.(e)},onTouchEnd(e){be?.onTouchEnd(e),Be(),Fe.onTouchEnd?.(e)},onTouchCancel(e){be?.onTouchCancel(),Be(),Fe.onTouchCancel?.(e)},[He]:void 0}),children:(0,q.jsx)(ke.Provider,{value:Re,children:l})})});function at(e,t){e?.toggleAttribute(Ce,t)}function ot(e){return!!e?.closest(C)}function st(e){return!!e?.closest(rt)}function ct(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function lt(e,t){return Math.max(ct(e,t)*.5,Ge)}function ut(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function dt(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function ft(e,t){let n=j(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=j(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||D(t,n)||D(t,r)}function pt(e,t){let n=f(e);if(n&&D(t,n)&&dt(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:ft(r,t)}function mt(e,t){return e.composedPath().some(e=>ut(e,t))}function ht(e){return mt(e.nativeEvent,s(e.currentTarget))}function gt(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function _t(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=tt&&s>o+nt?(e.preserveNativeCrossAxisScroll=!0,!0):o>=tt?(e.drawerAxisAttributed=!0,!1):!0}function vt(e,t){return yt(e,t).max>0}function yt(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function bt(e,t,n){let r=St(n,t),{offset:i,max:a}=yt(e,t);return r?i<=0:i>=a}function xt(e,t,n,r){return(St(n,t)?r>0:r<0)&&bt(e,t,n)}function St(e,t){return t===`vertical`?e===`down`:e===`right`}var Ct=.5,wt=1,Tt=[Ct,wt];function Et(e){return e===`medium`?Ct:wt}function Dt(e){return e==null?null:e===Ct?`medium`:`large`}function Ot(e){let t=(0,W.c)(23),{open:n,onOpenChange:i,label:a,detent:o,onDetentChange:s,activeDetent:l,className:u,children:d}=e,f=o===void 0?`large`:o,p;t[0]===f?p=t[1]:(p=Et(f),t[0]=f,t[1]=p);let m;t[2]===l?m=t[3]:(m=l===void 0?{}:{snapPoint:l===null?null:Et(l)},t[2]=l,t[3]=m);let h;t[4]===s?h=t[5]:(h=e=>s?.(Dt(e)),t[4]=s,t[5]=h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,q.jsx)(fe,{className:c(`app-sheet-backdrop fixed inset-0 z-50 backdrop-blur-sm`,`transition-opacity duration-[var(--app-motion-duration-sheet)] ease-[var(--app-motion-ease)] data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none`),"data-slot":`mobile-sheet-backdrop`}),t[6]=g):g=t[6];let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=c(`pointer-events-auto fixed inset-0 z-50 flex flex-col justify-end pt-12`,`pb-[var(--app-keyboard-inset,0px)]`),t[7]=_):_=t[7];let v;t[8]===u?v=t[9]:(v=c(ie(`sheet`),`pointer-events-auto flex max-h-full min-h-0 w-full min-w-0 flex-col rounded-t-2xl border-t not-dark:bg-clip-padding text-popover-foreground shadow-lg/5`,`pb-safe pl-safe pr-safe`,`translate-y-[calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px))] data-ending-style:translate-y-full data-starting-style:translate-y-full`,`transition-[translate,scale] duration-[var(--app-motion-duration-sheet)] ease-[var(--app-motion-ease)] will-change-transform motion-reduce:transition-none`,`data-nested-drawer-open:scale-96`,u),t[8]=u,t[9]=v);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,q.jsx)(`span`,{"aria-hidden":!0,className:`mx-auto mt-2 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/32`,"data-slot":`mobile-sheet-grabber`}),t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,q.jsx)(pe,{"aria-label":`Close`,className:`absolute end-2 top-2 z-20`,"data-slot":`mobile-sheet-close`,render:(0,q.jsx)(M,{size:`icon`,variant:`ghost`}),children:(0,q.jsx)(r,{})}),t[11]=b):b=t[11];let x;t[12]!==d||t[13]!==a||t[14]!==v?(x=(0,q.jsxs)(Pe,{children:[g,(0,q.jsx)(it,{className:_,"data-slot":`mobile-sheet-viewport`,children:(0,q.jsxs)($,{"aria-label":a,className:v,"data-slot":`sheet-popup`,"data-mobile-sheet":``,onKeyDown:kt,children:[y,d,b]})})]}),t[12]=d,t[13]=a,t[14]=v,t[15]=x):x=t[15];let S;return t[16]!==i||t[17]!==n||t[18]!==x||t[19]!==p||t[20]!==m||t[21]!==h?(S=(0,q.jsx)(Le,{open:n,onOpenChange:i,swipeDirection:`down`,snapPoints:Tt,defaultSnapPoint:p,...m,onSnapPointChange:h,children:x}),t[16]=i,t[17]=n,t[18]=x,t[19]=p,t[20]=m,t[21]=h,t[22]=S):S=t[22],S}function kt(e){e.stopPropagation()}function At(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`flex shrink-0 flex-col gap-1 px-4 pt-2 pe-11 pb-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,"data-slot":`mobile-sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jt(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`truncate font-heading font-semibold text-base leading-tight`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(Be,{className:i,"data-slot":`mobile-sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mt(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(ge,{className:i,"data-slot":`mobile-sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nt(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(he,{className:i,"data-slot":`mobile-sheet-panel`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pt(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`flex shrink-0 flex-col-reverse gap-2 px-4 pt-3 pb-2 sm:flex-row`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,"data-slot":`mobile-sheet-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{Nt as a,K as c,At as i,Mt as n,jt as o,Pt as r,J as s,Ot as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import"./src-BSuAGqhK.js";import{$n as n,Nr as r,Oa as i,Or as a,Vr as o,_l as s,gl as c,ka as l,kr as u,or as d,zr as ee}from"./runtime-Djy96GJd.js";import{lr as f,mr as p}from"./switch-DD1qVLgN.js";import{t as m}from"./compiler-runtime-qmuS0Svy.js";import{i as h,n as g,t as _}from"./tooltip-DXvXxL37.js";import{a as v,c as te,n as ne,o as re,s as ie,t as y}from"./badge-Dg7mXiOh.js";import{Y as ae}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{n as oe,t as se}from"./tokenModePresentation-DV56ekA4.js";import{t as b}from"./download-BA9L9tK9.js";import{t as ce}from"./refresh-cw-DY3_Ph-S.js";import{t as x}from"./toastHelpers-CSQRKo4F.js";import{i as le,n as ue,r as de}from"./settingsLayout-C6SUmJVB.js";var fe=m(),S=e(t(),1),C=s();function w(e){return`${e.pluginId}:${e.targetKind}:${e.providerInstanceId??`global`}`}function pe(e){switch(e.state){case`installed`:return`Installed`;case`not-installed`:return`Not installed`;case`unsupported`:return`Unsupported`;case`error`:return`Error`}}function T(e){switch(e.state){case`installed`:return`success`;case`not-installed`:return`outline`;case`unsupported`:return`warning`;case`error`:return`error`}}function E(e){switch(e.state){case`installed`:return(0,C.jsx)(i,{className:`size-3.5 text-success-foreground`});case`not-installed`:return(0,C.jsx)(p,{className:`size-3.5 text-muted-foreground`});case`unsupported`:case`error`:return(0,C.jsx)(l,{className:`size-3.5 text-warning-foreground`})}}function me(e){return e.targetKind===`global`?`System`:e.providerDisplayName??String(e.providerInstanceId??`Provider`)}function he(e){return e.impact===`tool-output`?`Tool output`:`Assistant output`}function ge(e){return e.scope===`global`?`Global`:`Provider`}function D(e){switch(e){case`rtk`:return 0;case`caveman`:return 1;case`token-optimizer`:return 2;case`token-savior`:return 3;case`lean-ctx`:return 4}}function O(e){return`${e.targetKind===`global`?`0`:`1`}:${me(e).toLowerCase()}`}function _e(e){let t=(0,fe.c)(36),{status:n,isInstalling:r,onInstall:i}=e,a=n.canInstall&&n.state!==`installed`,o;t[0]===n?o=t[1]:(o=E(n),t[0]=n,t[1]=o);let s;t[2]===n?s=t[3]:(s=me(n),t[2]=n,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,C.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:s}),t[4]=s,t[5]=c);let l;t[6]===n?l=t[7]:(l=T(n),t[6]=n,t[7]=l);let u;t[8]===n?u=t[9]:(u=pe(n),t[8]=n,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,C.jsx)(y,{variant:l,size:`sm`,children:u}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n.version?f=t[14]:(f=n.version?(0,C.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:n.version}):null,t[13]=n.version,t[14]=f);let p;t[15]!==o||t[16]!==c||t[17]!==d||t[18]!==f?(p=(0,C.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center gap-2`,children:[o,c,d,f]}),t[15]=o,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m;t[20]===n.detail?m=t[21]:(m=n.detail?(0,C.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:n.detail}):null,t[20]=n.detail,t[21]=m);let h;t[22]===n.manualSteps?h=t[23]:(h=n.manualSteps.length>0?(0,C.jsx)(`div`,{className:`space-y-1 pt-1`,children:n.manualSteps.map(k)}):null,t[22]=n.manualSteps,t[23]=h);let g;t[24]!==h||t[25]!==p||t[26]!==m?(g=(0,C.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[p,m,h]}),t[24]=h,t[25]=p,t[26]=m,t[27]=g):g=t[27];let _;t[28]!==a||t[29]!==r||t[30]!==i||t[31]!==n?(_=a?(0,C.jsxs)(ee,{size:`xs`,variant:`outline`,disabled:r,className:`self-start sm:self-auto`,onClick:()=>i(n),children:[r?(0,C.jsx)(ae,{className:`size-3.5 animate-spin`}):(0,C.jsx)(b,{className:`size-3.5`}),`Install`]}):null,t[28]=a,t[29]=r,t[30]=i,t[31]=n,t[32]=_):_=t[32];let v;return t[33]!==g||t[34]!==_?(v=(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-border/50 px-4 py-3 first:border-t-0 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[g,_]}),t[33]=g,t[34]=_,t[35]=v):v=t[35],v}function k(e){return(0,C.jsx)(`p`,{className:`font-mono text-[11px] leading-relaxed text-muted-foreground`,children:e},e)}function A(){let e=(0,fe.c)(56),t=a(),{updateSettings:i}=u(),s=c(),l=t.defaultAgentTokenMode??`balanced`,p=oe[l],m=p.icon,v;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],e[0]=v):v=e[0];let[b,pe]=(0,S.useState)(v),T;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],e[1]=T):T=e[1];let[E,D]=(0,S.useState)(T),[O,k]=(0,S.useState)(!1),[A,Ce]=(0,S.useState)(null),j=(0,S.useRef)(!1),M;e[2]===s?M=e[3]:(M=()=>{if(j.current)return;j.current=!0,k(!0);let e=s?n(s.environmentId)?.server:d().server;if(!e){k(!1),j.current=!1;return}Promise.all([e.listOpinionatedPlugins(),e.checkOpinionatedPlugins()]).then(e=>{let[t,n]=e;pe(t.plugins.toSorted(Ee)),D(n.statuses)}).catch(Te).finally(()=>{j.current=!1,k(!1)})},e[2]=s,e[3]=M);let N=M,P,F;e[4]===N?(P=e[5],F=e[6]):(P=()=>{N()},F=[N],e[4]=N,e[5]=P,e[6]=F),(0,S.useEffect)(P,F);let I;if(e[7]!==E){let t=new Map;for(let e of E){let n=t.get(e.pluginId)??[];n.push(e),t.set(e.pluginId,n)}I=new Map;for(let[e,n]of t)I.set(e,n.toSorted(we));e[7]=E,e[8]=I}else I=e[8];let L=I,De=Se,R;e[9]!==N||e[10]!==s?(R=e=>{let t=d(),i=s?n(s.environmentId)?.server:t.server;if(!i){r.add(x({type:`error`,title:`Plugin install unavailable`,description:`Node ${s?.nodeLabel??`server`} is not connected.`}));return}let a=me(e);t.dialogs.confirm(`Install ${e.pluginId===`rtk`?`RTK`:`Caveman`} for ${a}?\n\nThis may run networked CLI installation commands on this machine.`).then(t=>{if(!t)return;let n=w(e);return Ce(n),i.installOpinionatedPlugin({pluginId:e.pluginId,...e.providerInstanceId?{providerInstanceId:e.providerInstanceId}:{}}).then(t=>{D(e=>[...e.filter(e=>w(e)!==n),t.status]),r.add({type:`success`,title:`${e.pluginId===`rtk`?`RTK`:`Caveman`} installed`,description:t.commands.length>0?t.commands[t.commands.length-1]:a}),N()}).catch(xe).finally(()=>Ce(null))}).catch(be)},e[9]=N,e[10]=s,e[11]=R):R=e[11];let z=R,B;e[12]===i?B=e[13]:(B=e=>i({defaultAgentTokenMode:e}),e[12]=i,e[13]=B);let V;e[14]===m?V=e[15]:(V=(0,C.jsx)(m,{className:`size-4 shrink-0 text-muted-foreground`}),e[14]=m,e[15]=V);let H;e[16]===p.triggerLabel?H=e[17]:(H=(0,C.jsx)(te,{children:p.triggerLabel}),e[16]=p.triggerLabel,e[17]=H);let U;e[18]!==V||e[19]!==H?(U=(0,C.jsx)(ie,{className:`w-full sm:w-52`,"aria-label":`Default token mode`,children:(0,C.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[V,H]})}),e[18]=V,e[19]=H,e[20]=U):U=e[20];let W;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,C.jsx)(re,{align:`end`,alignItemWithTrigger:!1,className:`w-60`,children:se.map(ye)}),e[21]=W):W=e[21];let G;e[22]!==l||e[23]!==B||e[24]!==U?(G=(0,C.jsx)(le,{title:`Token mode`,children:(0,C.jsx)(de,{title:`Default token mode`,description:`Applied to new threads and draft sessions. Existing threads keep their own mode.`,control:(0,C.jsxs)(ne,{value:l,onValueChange:B,children:[U,W]})})}),e[22]=l,e[23]=B,e[24]=U,e[25]=G):G=e[25];let K;e[26]===N?K=e[27]:(K=()=>N(),e[26]=N,e[27]=K);let q;e[28]===O?q=e[29]:(q=O?(0,C.jsx)(ae,{className:`size-3 animate-spin`}):(0,C.jsx)(ce,{className:`size-3`}),e[28]=O,e[29]=q);let J;e[30]!==O||e[31]!==K||e[32]!==q?(J=(0,C.jsx)(h,{render:(0,C.jsx)(ee,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:O,onClick:K,"aria-label":`Refresh plugin status`,children:q})}),e[30]=O,e[31]=K,e[32]=q,e[33]=J):J=e[33];let Y;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,C.jsx)(g,{side:`top`,children:`Refresh plugin status`}),e[34]=Y):Y=e[34];let X;e[35]===J?X=e[36]:(X=(0,C.jsxs)(_,{children:[J,Y]}),e[35]=J,e[36]=X);let Z;e[37]!==O||e[38]!==b.length?(Z=b.length===0&&O?(0,C.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-4 text-xs text-muted-foreground`,children:[(0,C.jsx)(ae,{className:`size-3.5 animate-spin`}),`Loading plugin status`]}):null,e[37]=O,e[38]=b.length,e[39]=Z):Z=e[39];let Q;if(e[40]!==z||e[41]!==A||e[42]!==b||e[43]!==L){let t;e[45]!==z||e[46]!==A||e[47]!==L?(t=e=>{let t=L.get(e.id)??[],n=t.filter(ve).length;return(0,C.jsx)(de,{title:(0,C.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:e.name}),(0,C.jsx)(y,{variant:n>0?`success`:`outline`,size:`sm`,children:n>0?`${n} installed`:`Available`})]}),description:e.summary,status:(0,C.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,C.jsx)(y,{variant:`info`,size:`sm`,children:he(e)}),(0,C.jsx)(y,{variant:`outline`,size:`sm`,children:ge(e)})]}),control:(0,C.jsxs)(ee,{size:`xs`,variant:`ghost`,onClick:()=>De(e),children:[(0,C.jsx)(f,{className:`size-3.5`}),`Docs`]}),children:(0,C.jsx)(`div`,{className:o(`mt-4 border-t border-border/60`,t.length===0?`px-5 py-4`:``),children:t.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`No compatible provider instances detected.`}):t.map(e=>(0,C.jsx)(_e,{status:e,isInstalling:A===w(e),onInstall:z},w(e)))})},e.id)},e[45]=z,e[46]=A,e[47]=L,e[48]=t):t=e[48],Q=b.map(t),e[40]=z,e[41]=A,e[42]=b,e[43]=L,e[44]=Q}else Q=e[44];let $;e[49]!==X||e[50]!==Z||e[51]!==Q?($=(0,C.jsxs)(le,{title:`Opinionated plugins`,headerAction:X,children:[Z,Q]}),e[49]=X,e[50]=Z,e[51]=Q,e[52]=$):$=e[52];let Oe;return e[53]!==G||e[54]!==$?(Oe=(0,C.jsxs)(ue,{children:[G,$]}),e[53]=G,e[54]=$,e[55]=Oe):Oe=e[55],Oe}function ve(e){return e.state===`installed`}function ye(e){let t=oe[e],n=t.icon;return(0,C.jsx)(v,{hideIndicator:!0,value:e,children:(0,C.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,C.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,C.jsx)(`span`,{className:`text-muted-foreground text-xs leading-4`,children:t.description})]})},e)}function be(e){r.add(x({type:`error`,title:`Install confirmation failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function xe(e){r.add(x({type:`error`,title:`Plugin install failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function Se(e){let t=e.docsUrl??e.homepageUrl;d().shell.openExternal(t).catch(Ce)}function Ce(e){r.add(x({type:`error`,title:`Failed to open plugin docs`,description:e instanceof Error?e.message:`An error occurred.`}))}function we(e,t){return O(e).localeCompare(O(t))}function Te(e){r.add(x({type:`error`,title:`Failed to load plugins`,description:e instanceof Error?e.message:`An error occurred.`}))}function Ee(e,t){return D(e.id)-D(t.id)}export{A as OpinionatedPluginsSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{Bt as n,Ht as r,Rt as i,Vt as a,a as o,zt as s}from"./primary-D_D7eLwT.js";import{C as c,Ct as l,Dn as u,K as d,Na as f,Nn as p,Or as m,Sn as h,V as g,Vr as _,Zr as v,_l as y,ar as ee,bn as b,ir as te,ja as ne,kr as x,wn as re}from"./runtime-Djy96GJd.js";import{Bt as S,Dn as C,Kn as w,Vt as ie,f as ae,ir as T,qn as oe,rr as E,zt as se}from"./switch-DD1qVLgN.js";import{t as D}from"./compiler-runtime-qmuS0Svy.js";import{n as ce}from"./HostedConnectionControls-COUhSe9x.js";import{t as le}from"./chevron-right-CuUjBsQV.js";import{C as ue,S as O,a as de,b as k,c as A,d as fe,f as j,i as pe,l as M,n as me,o as he,r as ge,s as N,t as _e,u as P,x as ve,z as F}from"./sidebarProjectFolders-ygpaKZM6.js";import{o as ye}from"./sidebar-DNnW-a2V.js";import{a as be,i as xe,n as I,o as L,s as R,t as Se}from"./MobileSheet-NTayGHF6.js";import{t as z}from"./GlassSurface-GY6owikG.js";import{t as B}from"./useLongPress-DG1W7YqV.js";import{i as Ce,o as we,r as Te,t as Ee}from"./empty-3NpXLnAM.js";import{n as V,r as H,t as De}from"./usePhoneThreadActions-rekHL1Mi.js";import{Ft as Oe,It as ke,Mt as Ae,Nt as U,ht as je,it as Me,vt as Ne}from"./main-BbtLAX7M.js";var W={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};W.node;var Pe=f(W),G=e(t(),1),Fe=D(),K=y();function Ie(e){let t=(0,Fe.c)(14),{label:n,actions:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=_(`pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center px-3 pb-[var(--app-dock-inset)] pl-safe pr-safe`,a),t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=_(z(`dock`),`pointer-events-auto flex min-w-0 max-w-full flex-col gap-2 rounded-[22px] border border-border/60 p-[var(--app-dock-padding)] text-foreground shadow-lg/10`),t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=r.map(q),t[3]=r,t[4]=c);let l;t[5]!==n||t[6]!==c?(l=(0,K.jsx)(`div`,{role:`group`,"aria-label":n,className:`flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,"data-slot":`mobile-dock-actions`,children:c}),t[5]=n,t[6]=c,t[7]=l):l=t[7];let u;t[8]!==i||t[9]!==l?(u=(0,K.jsxs)(`div`,{className:s,"data-slot":`mobile-dock`,children:[i,l]}),t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==o||t[12]!==u?(d=(0,K.jsx)(`div`,{className:o,"data-slot":`mobile-dock-layer`,children:u}),t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function q(e){return(0,K.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled??!1,className:_(`flex min-h-[var(--app-dock-control-size)] min-w-[var(--app-dock-control-size)] shrink-0 items-center justify-center gap-1 rounded-full px-2 text-[11px] font-medium`,`transition-colors duration-[var(--app-motion-duration-chip)] ease-[var(--app-motion-ease)] motion-reduce:transition-none`,`hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:text-muted-foreground/60`,e.pressed===!0&&`bg-accent`),"data-slot":`mobile-dock-action`,onClick:e.onSelect,children:[e.icon,(0,K.jsx)(`span`,{className:`truncate`,children:e.shortLabel??e.label})]},e.id)}var J=new Map;function Le(){let e=(0,Fe.c)(74),t=p(Oe(b)),n=p(Oe(h)),r=g($e),i=g(Qe),u=g(Ze),f=g(Xe),_=g(Ye),v=m(Je),y=m(qe),x=m(Ke),re=o(),S=te(Ge),C=ee(We),ie=d(Ue),ae=l(He),{handleNewThread:E}=Me(),[se,D]=(0,G.useState)(!1),ue;e[0]!==r||e[1]!==t?(ue=je({items:t,preferredIds:r,getId:c}),e[0]=r,e[1]=t,e[2]=ue):ue=e[2];let O=ue,de;e[3]!==O||e[4]!==x?(de=me({projects:O,settings:x}),e[3]=O,e[4]=x,e[5]=de):de=e[5];let k=de,A;e[6]!==S||e[7]!==C?(A=e=>{let t=C[e],n=S[e];return t?.descriptor?.label??n?.label??null},e[6]=S,e[7]=C,e[8]=A):A=e[8];let fe;e[9]!==O||e[10]!==re||e[11]!==x||e[12]!==A?(fe=ge({projects:O,settings:x,primaryEnvironmentId:re,resolveEnvironmentLabel:A}),e[9]=O,e[10]=re,e[11]=x,e[12]=A,e[13]=fe):fe=e[13];let j=fe,pe;e[14]===j?pe=e[15]:(pe=new Map(j.map(Ve)),e[14]=j,e[15]=pe);let M=pe,he;if(e[16]!==k||e[17]!==M||e[18]!==v||e[19]!==j||e[20]!==n){let t=j.map(Be),r;e[22]===k?r=e[23]:(r=e=>{let t=a(s(e.environmentId,e.projectId));return Object.assign({},e,{projectId:k.get(t)??t})},e[22]=k,e[23]=r);let i=n.filter(ze).map(r),o;e[24]===M?o=e[25]:(o=e=>{let t=M.get(e.id);return t?[t]:[]},e[24]=M,e[25]=o),he=Ae(t,i,v).flatMap(o),e[16]=k,e[17]=M,e[18]=v,e[19]=j,e[20]=n,e[21]=he}else he=e[21];let N=he,P;e[26]!==u||e[27]!==i||e[28]!==f||e[29]!==v||e[30]!==N?(P=_e({projects:N,projectFoldersById:i,projectFolderOrder:u,projectTreeOrder:f,projectSortOrder:v}),e[26]=u,e[27]=i,e[28]=f,e[29]=v,e[30]=N,e[31]=P):P=e[31];let ve=P,F;e[32]!==y||e[33]!==E?(F=e=>{let t=e.memberProjects[0];t&&(D(!1),E(s(t.environmentId,t.id),{envMode:Ne({defaultEnvMode:y})}))},e[32]=y,e[33]=E,e[34]=F):F=e[34];let z=F,B;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsxs)(`header`,{className:`flex items-center gap-1.5 border-b border-border pr-[calc(env(safe-area-inset-right)+0.5rem)] pb-2 pl-[calc(env(safe-area-inset-left)+0.75rem)] pt-[calc(env(safe-area-inset-top)+0.5rem)]`,children:[(0,K.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold`,children:`Threads`}),(0,K.jsx)(ce,{})]}),e[35]=B):B=e[35];let V;e[36]!==ve||e[37]!==_?(V=ve.length===0?(0,K.jsx)(Ee,{className:`flex-1`,children:(0,K.jsxs)(Ce,{children:[(0,K.jsx)(we,{className:`text-base`,children:`No projects yet`}),(0,K.jsx)(Te,{className:`mt-1 text-sm`,children:`Projects opened on this node appear here with their threads.`})]})}):ve.map(e=>e.kind===`project`?(0,K.jsx)(et,{project:e.project},e.itemId):(0,K.jsxs)(`section`,{"aria-label":e.folder.name,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm font-medium text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-expanded":e.folder.expanded,onClick:()=>_(e.folder.id,!e.folder.expanded),children:[e.folder.expanded?(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(T,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.folder.name})]}),e.folder.expanded?e.projects.map(Re):null]},e.itemId)),e[36]=ve,e[37]=_,e[38]=V):V=e[38];let H;e[39]===V?H=e[40]:(H=(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[B,(0,K.jsx)(`div`,{"data-testid":`phone-home-list`,className:`app-dock-scroll-clearance flex min-h-0 flex-1 flex-col overflow-y-auto`,children:V})]}),e[39]=V,e[40]=H);let De;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[41]=De):De=e[41];let U;e[42]===ae?U=e[43]:(U={id:`search`,label:`Search threads`,shortLabel:`Search`,icon:De,onSelect:()=>ae(!0)},e[42]=ae,e[43]=U);let W;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,K.jsx)(ke,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[44]=W):W=e[44];let Pe=N.length===0,q;e[45]!==N[0]||e[46]!==N.length||e[47]!==z?(q=()=>{if(N.length===1&&N[0]){z(N[0]);return}D(!0)},e[45]=N[0],e[46]=N.length,e[47]=z,e[48]=q):q=e[48];let J;e[49]!==Pe||e[50]!==q?(J={id:`new-thread`,label:`New thread`,icon:W,disabled:Pe,onSelect:q},e[49]=Pe,e[50]=q,e[51]=J):J=e[51];let Le;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,K.jsx)(w,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[52]=Le):Le=e[52];let Y;e[53]===ie?Y=e[54]:(Y={id:`settings`,label:`Open settings`,shortLabel:`Settings`,icon:Le,onSelect:()=>ie()},e[53]=ie,e[54]=Y);let X;e[55]!==U||e[56]!==J||e[57]!==Y?(X=(0,K.jsx)(Ie,{label:`Home actions`,actions:[U,J,Y]}),e[55]=U,e[56]=J,e[57]=Y,e[58]=X):X=e[58];let tt;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,K.jsxs)(xe,{children:[(0,K.jsx)(L,{children:`New thread`}),(0,K.jsx)(I,{children:`Choose a project for the new thread.`})]}),e[59]=tt):tt=e[59];let Z;if(e[60]!==N||e[61]!==z){let t;e[63]===z?t=e[64]:(t=e=>(0,K.jsx)(R,{label:e.displayName,onClick:()=>z(e)},e.projectKey),e[63]=z,e[64]=t),Z=N.map(t),e[60]=N,e[61]=z,e[62]=Z}else Z=e[62];let Q;e[65]===Z?Q=e[66]:(Q=(0,K.jsx)(be,{children:(0,K.jsx)(`div`,{role:`group`,"aria-label":`Projects`,className:`space-y-0.5`,children:Z})}),e[65]=Z,e[66]=Q);let $;e[67]!==se||e[68]!==Q?($=(0,K.jsxs)(Se,{open:se,onOpenChange:D,label:`New thread`,children:[tt,Q]}),e[67]=se,e[68]=Q,e[69]=$):$=e[69];let nt;return e[70]!==H||e[71]!==X||e[72]!==$?(nt=(0,K.jsxs)(ye,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:[H,X,$]}),e[70]=H,e[71]=X,e[72]=$,e[73]=nt):nt=e[73],nt}function Re(e){return(0,K.jsx)(et,{project:e,nested:!0},e.projectKey)}function ze(e){return e.archivedAt===null}function Be(e){return Object.assign({},e,{id:e.projectKey})}function Ve(e){return[e.projectKey,e]}function He(e){return e.setOpen}function Ue(e){return e.openSettings}function We(e){return e.byId}function Ge(e){return e.byId}function Ke(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function qe(e){return e.defaultThreadEnvMode}function Je(e){return e.sidebarProjectSortOrder}function Ye(e){return e.setProjectFolderExpanded}function Xe(e){return e.projectTreeOrder}function Ze(e){return e.projectFolderOrder}function Qe(e){return e.projectFoldersById}function $e(e){return e.projectOrder}function et({project:e,nested:t=!1}){let o=p(Oe((0,G.useMemo)(()=>t=>re(t,e.memberProjectRefs),[e.memberProjectRefs]))),c=v((0,G.useMemo)(()=>O(e),[e])),l=m(e=>e.sidebarThreadSortOrder),d=g(e=>e.pinnedThreadKeys),f=g(t=>t.projectExpandedById[e.projectKey]??!0),h=g(e=>e.toggleProject),y=(0,G.useMemo)(()=>new Set(Object.entries(d).flatMap(([e,t])=>t?[e]:[])),[d]),ee=(0,G.useMemo)(()=>ue(o,c).filter(e=>e.archivedAt===null),[c,o]),b=(0,G.useMemo)(()=>U({threads:ee,sortOrder:l,pinnedThreadKeys:y,getThreadKey:e=>r(n(e.environmentId,e.id))}),[y,l,ee]),te=(0,G.useMemo)(()=>new Map(b.map(e=>[r(n(e.environmentId,e.id)),e])),[b]),S=(0,G.useRef)(te);S.current=te;let C=(0,G.useMemo)(()=>new Map(e.memberProjects.map(e=>[a(s(e.environmentId,e.id)),e])),[e.memberProjects]),w=De({sidebarThreadByKeyRef:S,memberProjectByScopedKey:C,projectCwd:e.cwd??null}),[T,oe]=(0,G.useState)(null),E=T?te.get(T)??null:null,se=w.renamingThreadKey?te.get(w.renamingThreadKey)??null:null,D=p(Oe((0,G.useMemo)(()=>t=>u(t,e.memberProjectRefs),[e.memberProjectRefs]))),ce=(0,G.useMemo)(()=>ve({project:e,threads:b,worktrees:D}),[e,b,D]),me=k({projects:[ce.project],threads:ce.threads,worktrees:ce.worktrees}).projects[0]??null,ge=me&&me.isGitRepo&&me.worktrees.length>1?me.worktrees:null,{updateSettings:_e}=x(),F=m(e=>({sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides})),{copyPathToClipboard:ye}=ae(),[be,xe]=(0,G.useState)(!1),I=pe(),L=de(),R=he({projectGroupingSettings:F,updateSettings:_e}),Se=(0,G.useMemo)(()=>{let t=new Map(e.memberProjects.map(e=>[e.physicalProjectKey,0]));for(let e of o){let n=C.get(a(s(e.environmentId,e.projectId)));n&&t.set(n.physicalProjectKey,(t.get(n.physicalProjectKey)??0)+1)}return t},[C,e.memberProjects,o]),{openProjectRemoteLink:z,openProjectJiraLink:Ce,handleRemoveProject:we}=j({memberThreadCountByPhysicalKey:Se,jiraProjectOpenUrlByProjectKey:J}),Te=(0,G.useRef)(!1),Ee=(0,G.useCallback)(()=>{xe(!0)},[]),{openProjectMenu:ke}=fe({project:e,jiraProjectOpenUrlByProjectKey:J,suppressProjectClickForContextMenuRef:Te,onOpenOverview:Ee,openProjectSettingsDialog:I.openProjectSettingsDialog,openProjectRemoteLink:z,openProjectJiraLink:Ce,openProjectRenameDialog:L.openProjectRenameDialog,openProjectGroupingDialog:R.openProjectGroupingDialog,copyPathToClipboard:ye,handleRemoveProject:we}),Ae=B(e=>ke(e)),je=e=>{let t=r(n(e.environmentId,e.id));return(0,K.jsx)(tt,{thread:e,pinned:y.has(t),onOpen:()=>{let t=n(e.environmentId,e.id);if(e.draftId){w.navigateToDraft(e.draftId,t);return}w.navigateToThread(t)},onMenu:()=>oe(t)},t)};return(0,K.jsxs)(`section`,{"aria-label":e.displayName,className:_(t&&`pl-3`),children:[(0,K.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 px-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-accent/40`,"aria-expanded":f,onClick:()=>h(e.projectKey),...Ae,children:[f?(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.displayName}),(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:b.length})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Project actions for ${e.displayName}`,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:e=>ke({x:e.clientX,y:e.clientY}),children:(0,K.jsx)(Pe,{"aria-hidden":!0,className:`size-4`})})]}),f?ge?(0,K.jsx)(`div`,{className:`pl-3`,children:ge.map(e=>(0,K.jsx)(Y,{worktreeNode:e,renderThreadRow:je},e.worktree.worktreeId))}):(0,K.jsx)(`div`,{role:`list`,"aria-label":`Threads in ${e.displayName}`,children:b.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No threads yet.`}):b.map(e=>je(e))}):null,(0,K.jsx)(V,{open:E!==null,onOpenChange:e=>{e||oe(null)},title:E?.title??`Thread`,items:T?w.listThreadMenuActions(T):[],leadingSections:E?(0,K.jsx)(ie,{thread:E}):void 0,onAction:e=>{let t=T?i(T):null;oe(null),t&&w.performThreadMenuAction(t,e)}}),(0,K.jsx)(H,{renamingThreadKey:w.renamingThreadKey,originalTitle:se?.title??``,renamingTitle:w.renamingTitle,setRenamingTitle:w.setRenamingTitle,commitRename:w.commitRename,cancelRename:w.cancelRename}),(0,K.jsx)(P,{open:be,projectName:e.displayName,memberProjects:e.memberProjects,initialTab:`overview`,onOpenChange:xe}),(0,K.jsx)(M,{open:I.projectSettingsOpen,target:I.projectSettingsTarget,title:I.projectSettingsTitle,customAvatarContentHash:I.projectSettingsCustomAvatarContentHash,projectAvatarUploadUnavailableReason:I.projectAvatarUploadUnavailableReason,preferredRemoteName:I.projectSettingsPreferredRemoteName,workspaceRoot:I.projectSettingsWorkspaceRoot,customSystemPrompt:I.projectSettingsCustomSystemPrompt,defaultModelSelection:I.projectSettingsDefaultModelSelection,saving:I.projectSettingsSaving,onClose:I.closeProjectSettingsDialog,onSave:()=>void I.submitProjectSettings(),onTitleChange:I.setProjectSettingsTitle,onWorkspaceRootChange:I.setProjectSettingsWorkspaceRoot,onCustomSystemPromptChange:I.setProjectSettingsCustomSystemPrompt,onDefaultModelSelectionChange:I.setProjectSettingsDefaultModelSelection,onPreferredRemoteChange:I.setProjectSettingsPreferredRemoteName,onPickWorkspaceRoot:()=>void I.pickProjectSettingsWorkspaceRoot(),onOpenRemote:I.openProjectRemoteByName,onUploadAvatar:I.uploadProjectAvatar,onRemoveAvatar:I.removeProjectAvatar}),(0,K.jsx)(N,{target:L.projectRenameTarget,title:L.projectRenameTitle,onTitleChange:L.setProjectRenameTitle,onClose:L.closeProjectRenameDialog,onSubmit:()=>void L.submitProjectRename()}),(0,K.jsx)(A,{target:R.projectGroupingTarget,selection:R.projectGroupingSelection,globalGroupingMode:F.sidebarProjectGroupingMode,onSelectionChange:R.setProjectGroupingSelection,onClose:R.closeProjectGroupingDialog,onSave:R.saveProjectGroupingPreference})]})}function Y(e){let t=(0,Fe.c)(23),{worktreeNode:n,renderThreadRow:r}=e,[i,a]=(0,G.useState)(!0),o=n.worktree.title??n.worktree.branch,s=!i,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(X),l=e=>{if(e.key===`ArrowLeft`){e.preventDefault(),a(!0);return}e.key===`ArrowRight`&&(e.preventDefault(),a(!1))},t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=i?(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[2]=i,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),t[4]=d):d=t[4];let f;t[5]===o?f=t[6]:(f=(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),t[5]=o,t[6]=f);let p;t[7]===n.sessions.length?p=t[8]:(p=(0,K.jsx)(`span`,{className:`shrink-0 text-xs`,children:n.sessions.length}),t[7]=n.sessions.length,t[8]=p);let m;t[9]!==s||t[10]!==u||t[11]!==f||t[12]!==p?(m=(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":s,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:c,onKeyDown:l,children:[u,d,f,p]}),t[9]=s,t[10]=u,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==i||t[15]!==r||t[16]!==o||t[17]!==n.sessions?(h=i?null:(0,K.jsx)(`div`,{role:`list`,"aria-label":`Sessions in ${o}`,children:n.sessions.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No sessions yet.`}):n.sessions.map(e=>r(e))}),t[14]=i,t[15]=r,t[16]=o,t[17]=n.sessions,t[18]=h):h=t[18];let g;return t[19]!==m||t[20]!==h||t[21]!==o?(g=(0,K.jsxs)(`section`,{"aria-label":o,children:[m,h]}),t[19]=m,t[20]=h,t[21]=o,t[22]=g):g=t[22],g}function X(e){return!e}function tt(e){let t=(0,Fe.c)(28),{thread:n,pinned:r,onOpen:i,onMenu:a}=e,o=n.latestTurn?.completedAt??n.latestUserMessageAt??n.createdAt,s;t[0]===a?s=t[1]:(s=()=>a(),t[0]=a,t[1]=s);let c=B(s),l;t[2]===r?l=t[3]:(l=r?(0,K.jsx)(F,{"aria-label":`Pinned`,role:`img`,className:`size-3 shrink-0 text-muted-foreground`}):null,t[2]=r,t[3]=l);let u;t[4]===n.title?u=t[5]:(u=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:n.title}),t[4]=n.title,t[5]=u);let d;t[6]!==l||t[7]!==u?(d=(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[l,u]}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]===n?f=t[10]:(f=(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(se,{thread:n,alwaysShowStatusLabel:!0}),(0,K.jsx)(S,{thread:n})]}),t[9]=n,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===o?m=t[15]:(m=o?(0,K.jsx)(`span`,{className:`shrink-0 pr-1 text-[10px] text-muted-foreground`,children:C(o)}):null,t[14]=o,t[15]=m);let h;t[16]!==c||t[17]!==i||t[18]!==p||t[19]!==m?(h=(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-1 pl-3 text-left hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:i,...c,children:[p,m]}),t[16]=c,t[17]=i,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g=`Thread actions for ${n.title}`,_;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(Pe,{"aria-hidden":!0,className:`size-4`}),t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==g?(v=(0,K.jsx)(`button`,{type:`button`,"aria-label":g,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:a,children:_}),t[22]=a,t[23]=g,t[24]=v):v=t[24];let y;return t[25]!==v||t[26]!==h?(y=(0,K.jsxs)(`div`,{role:`listitem`,className:`flex items-stretch`,children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27],y}export{Le as PhoneHome};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D4CtFNPY.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-DxCd1PgA.js";import{K as r}from"./primary-D_D7eLwT.js";import{$ as i,Ca as a,J as o,K as s,Ma as c,P as l,_l as u,ja as d,zr as f}from"./runtime-Djy96GJd.js";import{rr as p}from"./switch-DD1qVLgN.js";import{t as m}from"./compiler-runtime-qmuS0Svy.js";import{t as h}from"./activity-BMBx2Fu0.js";import{d as g,f as _,l as v,n as y,r as b,t as x,u as S}from"./SettingsPanels-ZxNz9ZfL.js";import{h as C,y as w}from"./RootAppShell-BdQCs2XJ.js";import{t as T}from"./arrow-left-CymyVbCi.js";import{t as E}from"./chart-column-CcRi3pAd.js";import{q as D}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as ee}from"./chevron-right-CuUjBsQV.js";import{t as O}from"./sparkles-isHutYWU.js";import{t as k}from"./palette-D18VboLH.js";import{R as A}from"./sidebarProjectFolders-ygpaKZM6.js";import{t as j}from"./shield-Zq_ygsnJ.js";import{t as te}from"./user-round-DctamWV6.js";import{t as ne}from"./scroll-area-BMnGzd2a.js";import{o as re,t as ie}from"./sheet-DLy4aeVa.js";import{a as M,i as N,n as P,o as F,s as I,t as L}from"./MobileSheet-NTayGHF6.js";import{b as ae,c as oe,f as R,o as z,p as B,r as V,s as H}from"./appearancePreferences-nFx4MHoI.js";import{n as se,t as ce}from"./useAppearancePreference-BteoFdGa.js";var U=m(),W=e(t(),1),G=u(),K=`System reduce transparency is on, showing ${R.find(e=>e.value==="default")?.label??`Solid`}`,q=[{key:`surfaceTransparency`,label:`Material`,description:`How much of the content behind a surface shows through.`,options:oe,scale:R},{key:`fontSizeBase`,label:`Text size`,description:`The base type size for the whole interface.`,options:z,scale:z},{key:`dockDensity`,label:`Dock density`,description:`How much padding the dock capsule carries around its controls.`,options:V,scale:V},{key:`motion`,label:`Motion`,description:`Reduce sheet and stack animation beyond the system setting.`,options:H,scale:H}];function le(e){let t=(0,U.c)(42),{control:n}=e,[r,i]=(0,W.useState)(!1),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={effective:!0},t[0]=a):a=t[0];let o=ce(n.key,a),s=se(),l=n.key===`surfaceTransparency`&&s?K:null,u;t[1]!==n.options||t[2]!==o?(u=n.options.find(e=>e.value===o)??null,t[1]=n.options,t[2]=o,t[3]=u):u=t[3];let d=u,f;t[4]!==n.scale||t[5]!==d||t[6]!==o?(f=d??n.scale.find(e=>e.value===o)??null,t[4]=n.scale,t[5]=d,t[6]=o,t[7]=f):f=t[7];let p=f,m=d!==null,h;t[8]===n.key?h=t[9]:(h=e=>{ae(n.key,e),B(),i(!1)},t[8]=n.key,t[9]=h);let g=h,_=l&&p?`${p.label} · ${l}`:p?.label??null,v,y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground/60`}),y=()=>i(!0),t[10]=v,t[11]=y):(v=t[10],y=t[11]);let b;t[12]!==n.label||t[13]!==_?(b=(0,G.jsx)(I,{label:n.label,secondaryText:_,trailing:v,onClick:y}),t[12]=n.label,t[13]=_,t[14]=b):b=t[14];let x=n.label,S;t[15]===n.label?S=t[16]:(S=(0,G.jsx)(F,{children:n.label}),t[15]=n.label,t[16]=S);let C=!m&&p?` Currently ${p.label}.`:null,w=l?` ${l}.`:null,T;t[17]!==n.description||t[18]!==C||t[19]!==w?(T=(0,G.jsxs)(P,{children:[n.description,C,w]}),t[17]=n.description,t[18]=C,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==S||t[22]!==T?(E=(0,G.jsxs)(N,{children:[S,T]}),t[21]=S,t[22]=T,t[23]=E):E=t[23];let D=n.label,O;if(t[24]!==n.options||t[25]!==g||t[26]!==o){let e;t[28]!==g||t[29]!==o?(e=e=>(0,G.jsx)(I,{label:e.label,secondaryText:e.description,selected:e.value===o,trailing:e.value===o?(0,G.jsx)(c,{"aria-hidden":!0,className:`size-4`}):null,onClick:()=>g(e.value)},e.value),t[28]=g,t[29]=o,t[30]=e):e=t[30],O=n.options.map(e),t[24]=n.options,t[25]=g,t[26]=o,t[27]=O}else O=t[27];let k;t[31]!==n.label||t[32]!==O?(k=(0,G.jsx)(M,{children:(0,G.jsx)(`div`,{role:`group`,"aria-label":D,className:`flex flex-col`,children:O})}),t[31]=n.label,t[32]=O,t[33]=k):k=t[33];let A;t[34]!==n.label||t[35]!==r||t[36]!==E||t[37]!==k?(A=(0,G.jsxs)(L,{open:r,onOpenChange:i,label:x,detent:`medium`,children:[E,k]}),t[34]=n.label,t[35]=r,t[36]=E,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==A||t[40]!==b?(j=(0,G.jsxs)(G.Fragment,{children:[b,A]}),t[39]=A,t[40]=b,t[41]=j):j=t[41],j}function ue(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`div`,{role:`group`,"aria-label":`Phone appearance`,className:`flex flex-col`,children:q.map(de)}),e[0]=t):t=e[0],t}function de(e){return(0,G.jsx)(le,{control:e},e.key)}var fe=[{id:`account`,label:`Account`,icon:te},{id:`general`,label:`General`,icon:A},{id:`inbox`,label:`Inbox`,icon:O},{id:`providers`,label:`Providers`,icon:_},{id:`opinionated-plugins`,label:`Plugins`,icon:v},{id:`mcp-servers`,label:`MCP Servers`,icon:C},{id:`appearance`,label:`Appearance`,icon:k},{id:`keybindings`,label:`Keybindings`,icon:g},{id:`source-control`,label:`Source Control`,icon:p},{id:`connections`,label:`Connections`,icon:S},{id:`security`,label:`Security`,icon:j},{id:`statistics`,label:`Statistics`,icon:E},{id:`archived`,label:`Archive`,icon:w}],pe=[{id:`diagnostics`,label:`Diagnostics`,icon:h}],me=[...fe,...pe];me.map(e=>e.id),fe.map(e=>e.label);var he=new Set([`general`,`providers`,`appearance`]),J=`general`,Y=(0,W.lazy)(()=>n(()=>import(`./AccountSettings-ApnDA1f-.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),ge=(0,W.lazy)(()=>n(()=>import(`./ProvidersSettingsPanel-Ww1ch3xA.js`).then(e=>({default:e.ProvidersSettingsPanel})),__vite__mapDeps([0]))),X=(0,W.lazy)(()=>n(()=>import(`./AiFocusSettings-CNmGHEcA.js`).then(e=>({default:e.AiFocusSettings})),__vite__mapDeps([0]))),_e=(0,W.lazy)(()=>n(()=>import(`./OpinionatedPluginsSettings-D7WuuNWZ.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),__vite__mapDeps([0]))),ve=(0,W.lazy)(()=>n(()=>import(`./McpServersSettings-BWIUud0Z.js`).then(e=>({default:e.McpServersSettings})),__vite__mapDeps([0]))),Z=(0,W.lazy)(()=>n(()=>import(`./AppearanceSettings-BG8W4DP0.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),ye=(0,W.lazy)(()=>n(()=>import(`./KeybindingsSettings-CPtXx-W2.js`).then(e=>({default:e.KeybindingsSettingsPanel})),__vite__mapDeps([0]))),be=(0,W.lazy)(()=>n(()=>import(`./SourceControlSettings-C1F3Brcn.js`).then(e=>({default:e.SourceControlSettingsPanel})),__vite__mapDeps([0]))),xe=(0,W.lazy)(()=>n(()=>import(`./ConnectionsSettings-CPMkuxza.js`).then(e=>({default:e.ConnectionsSettings})),__vite__mapDeps([0]))),Q=(0,W.lazy)(()=>n(()=>import(`./NodeSecuritySettings-BFifrshE.js`).then(e=>({default:e.NodeSecuritySettings})),__vite__mapDeps([0]))),$=(0,W.lazy)(()=>n(()=>import(`./DiagnosticsSettings-DvnNz2AZ.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Se=(0,W.lazy)(()=>n(()=>import(`./StatisticsPanel-CeIjiBm8.js`).then(e=>({default:e.StatisticsPanel})),__vite__mapDeps([0])));function Ce(e){let t=(0,U.c)(44),{section:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`div`,{className:`flex min-h-80 items-center justify-center text-muted-foreground text-sm`,children:`Loading settings...`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n===`account`?(0,G.jsx)(Y,{}):null,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=n===`general`?(0,G.jsx)(y,{}):null,t[3]=n,t[4]=a);let o;t[5]===n?o=t[6]:(o=n===`inbox`?(0,G.jsx)(X,{}):null,t[5]=n,t[6]=o);let s;t[7]===n?s=t[8]:(s=n===`providers`?(0,G.jsx)(ge,{}):null,t[7]=n,t[8]=s);let c;t[9]===n?c=t[10]:(c=n===`opinionated-plugins`?(0,G.jsx)(_e,{}):null,t[9]=n,t[10]=c);let l;t[11]===n?l=t[12]:(l=n===`mcp-servers`?(0,G.jsx)(ve,{}):null,t[11]=n,t[12]=l);let u;t[13]===n?u=t[14]:(u=n===`appearance`?(0,G.jsx)(Z,{}):null,t[13]=n,t[14]=u);let d;t[15]===n?d=t[16]:(d=n===`keybindings`?(0,G.jsx)(ye,{}):null,t[15]=n,t[16]=d);let f;t[17]===n?f=t[18]:(f=n===`source-control`?(0,G.jsx)(be,{}):null,t[17]=n,t[18]=f);let p;t[19]===n?p=t[20]:(p=n===`connections`?(0,G.jsx)(xe,{}):null,t[19]=n,t[20]=p);let m;t[21]===n?m=t[22]:(m=n===`security`?(0,G.jsx)(Q,{}):null,t[21]=n,t[22]=m);let h;t[23]===n?h=t[24]:(h=n===`diagnostics`?(0,G.jsx)($,{presentation:`phone-legacy`}):null,t[23]=n,t[24]=h);let g;t[25]===n?g=t[26]:(g=n===`statistics`?(0,G.jsx)(Se,{}):null,t[25]=n,t[26]=g);let _;t[27]===n?_=t[28]:(_=n===`archived`?(0,G.jsx)(x,{}):null,t[27]=n,t[28]=_);let v;return t[29]!==f||t[30]!==p||t[31]!==m||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==i||t[36]!==a||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==l||t[41]!==u||t[42]!==d?(v=(0,G.jsxs)(W.Suspense,{fallback:r,children:[i,a,o,s,c,l,u,d,f,p,m,h,g,_]}),t[29]=f,t[30]=p,t[31]=m,t[32]=h,t[33]=g,t[34]=_,t[35]=i,t[36]=a,t[37]=o,t[38]=s,t[39]=c,t[40]=l,t[41]=u,t[42]=d,t[43]=v):v=t[43],v}function we(e){let t=(0,U.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=b(n),a=r.length===0,o;t[0]===i?o=t[1]:(o=()=>void i(),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(D,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,G.jsxs)(f,{size:`sm`,variant:`outline`,className:`min-h-11 shrink-0`,disabled:a,onClick:o,children:[s,`Restore defaults`]}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}var Te=`w-full min-w-0 max-w-none border-s-0 p-0 pt-safe pl-safe pr-safe pb-[max(env(safe-area-inset-bottom),var(--app-keyboard-inset,0px))] wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]`;function Ee(){let e=(0,U.c)(39),t=s(Fe),n=s(Pe),c=s(Ne),u=s(Me),p=l(je),m=l(Ae),h=l(ke),g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=r(),e[0]=g):g=e[0];let _=g,v;e[1]!==m||e[2]!==p||e[3]!==h?(v=o(p,m,h),e[1]=m,e[2]=p,e[3]=h,e[4]=v):v=e[4];let y=v,b;e[5]===y?b=e[6]:(b=e=>i(e,{hosted:_,role:y}),e[5]=y,e[6]=b);let x=b,S;e[7]===x?S=e[8]:(S=e=>x(e.id),e[7]=x,e[8]=S);let C=fe.filter(S),w;e[9]===x?w=e[10]:(w=e=>x(e.id),e[9]=x,e[10]=w);let E=pe.filter(w),[D,O]=(0,W.useState)(null),[k,A]=(0,W.useState)(!1),[j,te]=(0,W.useState)(!1);t!==j&&(te(t),t&&(O(n===J?null:n),A(!1)));let M=(0,W.useRef)(n),N,P;e[11]!==t||e[12]!==n?(N=()=>{let e=M.current;M.current=n,t&&n!==e&&O(n)},P=[t,n],e[11]=t,e[12]=n,e[13]=N,e[14]=P):(N=e[13],P=e[14]),(0,W.useEffect)(N,P);let F,I;e[15]!==t||e[16]!==u?(F=()=>{t||s.getState().section!==J&&(u(J),M.current=J)},I=[t,u],e[15]=t,e[16]=u,e[17]=F,e[18]=I):(F=e[17],I=e[18]),(0,W.useEffect)(F,I);let L=(0,W.useRef)(null),ae=(0,W.useRef)(new Map),oe=(0,W.useRef)(null),R=(0,W.useRef)(null),z;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{R.current!==null&&window.cancelAnimationFrame(R.current);let t=0,n=0,r=()=>{R.current=null;let i=e();if(i&&i.isConnected){if(document.activeElement===i){if(n+=1,n>=2)return}else if(n=0,i.focus(),t+=1,t>=6)return;R.current=window.requestAnimationFrame(r)}};R.current=window.requestAnimationFrame(r)},e[19]=z):z=e[19];let B=z,V,H;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>()=>{R.current!==null&&window.cancelAnimationFrame(R.current)},H=[],e[20]=V,e[21]=H):(V=e[20],H=e[21]),(0,W.useEffect)(V,H);let se=e=>{u(e),O(e),B(()=>L.current)},ce=()=>{let e=oe.current;O(null),M.current=J,u(J),B(()=>e?ae.current.get(e)??null:null)},K;e[22]===D?K=e[23]:(K=[D],e[22]=D,e[23]=K),(0,W.useEffect)(()=>{D!==null&&(oe.current=D)},K);let q;e[24]!==t||e[25]!==D?(q=[t,D,B],e[24]=t,e[25]=D,e[26]=q):q=e[26],(0,W.useEffect)(()=>{t&&D!==null&&B(()=>L.current)},q);let[le,de]=(0,W.useState)(0),Y;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>{de(Oe)},e[27]=Y):Y=e[27];let ge=Y,X=D!==null&&x(D)?me.find(e=>e.id===D)??null:null,_e=e=>{let t=e.icon;return(0,G.jsxs)(`button`,{type:`button`,ref:t=>{t?ae.current.set(e.id,t):ae.current.delete(e.id)},className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>se(e.id),children:[(0,G.jsx)(t,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground/60`})]},e.id)},ve=ie,Z;e[28]===c?Z=e[29]:(Z=e=>{e||c()},e[28]=c,e[29]=Z);let ye=re,be=Te,xe=X?(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(f,{size:`icon`,variant:`ghost`,"aria-label":`Back to settings`,className:`shrink-0`,onClick:ce,children:(0,G.jsx)(T,{})}),(0,G.jsx)(`h1`,{ref:L,tabIndex:-1,className:`min-w-0 flex-1 truncate text-sm font-medium outline-none`,children:X.label}),he.has(X.id)?(0,G.jsx)(we,{onRestored:ge}):null]}),(0,G.jsx)(ne,{className:`min-h-0 min-w-0 flex-1`,children:(0,G.jsx)(`div`,{className:`flex flex-col`,children:(0,G.jsx)(Ce,{section:X.id})},le)})]}):(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(`h1`,{className:`min-w-0 flex-1 truncate px-2 text-base font-semibold`,children:`Settings`}),(0,G.jsx)(f,{size:`icon`,variant:`ghost`,"aria-label":`Close settings`,className:`shrink-0`,onClick:c,children:(0,G.jsx)(a,{})})]}),(0,G.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:[(0,G.jsx)(`div`,{role:`group`,"aria-label":`Settings sections`,className:`space-y-0.5`,children:C.map(e=>_e(e))}),E.length>0?(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":k,className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm font-medium text-muted-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>A(De),children:[k?(0,G.jsx)(d,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Advanced`})]}),k?(0,G.jsx)(`div`,{role:`group`,"aria-label":`Advanced sections`,className:`space-y-0.5`,children:E.map(e=>_e(e))}):null]}):null,(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsx)(`h2`,{className:`px-2 py-1 font-medium text-muted-foreground text-xs`,children:`Phone appearance`}),(0,G.jsx)(ue,{})]})]})]}),Q;e[30]!==ye||e[31]!==be||e[32]!==xe?(Q=(0,G.jsx)(ye,{side:`right`,showCloseButton:!1,"aria-label":`Settings`,"data-testid":`phone-settings-surface`,className:be,children:xe}),e[30]=ye,e[31]=be,e[32]=xe,e[33]=Q):Q=e[33];let $;return e[34]!==ve||e[35]!==t||e[36]!==Z||e[37]!==Q?($=(0,G.jsx)(ve,{open:t,onOpenChange:Z,children:Q}),e[34]=ve,e[35]=t,e[36]=Z,e[37]=Q,e[38]=$):$=e[38],$}function De(e){return!e}function Oe(e){return e+1}function ke(e){return e.transportStatus}function Ae(e){return e.directoryStatus}function je(e){return e.effectiveRole}function Me(e){return e.setSection}function Ne(e){return e.closeSettings}function Pe(e){return e.section}function Fe(e){return e.open}export{Ee as PhoneSettingsSurface};
|