ryco-cli 0.1.20 → 0.1.21
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/{AcpNativeLogging-CLM3p9JD.mjs → AcpNativeLogging-Ch-s9nA8.mjs} +182 -2
- package/dist/{AcpNativeLogging-Bh7MX3rC.cjs → AcpNativeLogging-D54V5cIY.cjs} +187 -1
- package/dist/{AzureDevOpsSourceControlProvider-D9QXGi1h.cjs → AzureDevOpsSourceControlProvider-BzB5-N9m.cjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-jQm1WPMS.mjs → AzureDevOpsSourceControlProvider-DTOlXGyd.mjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-C3VDp9qR.cjs → BitbucketSourceControlProvider-D-8PWXO3.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-j95Cro_2.mjs → BitbucketSourceControlProvider-DGd4IPx5.mjs} +2 -2
- package/dist/{ClaudeDriver-CT89QDP8.mjs → ClaudeDriver-DxowtK6I.mjs} +2 -2
- package/dist/{ClaudeDriver-DiRhQM2K.cjs → ClaudeDriver-HEbUzW34.cjs} +2 -2
- package/dist/{CodexDriver-CBYfPl_X.mjs → CodexDriver-CccSWoP3.mjs} +3 -3
- package/dist/{CodexDriver-BmKoU7w_.cjs → CodexDriver-YG4IwzLm.cjs} +3 -3
- package/dist/{CodexTextGeneration-B7GPyLo2.mjs → CodexTextGeneration-BfGt7ZUe.mjs} +1 -1
- package/dist/{CodexTextGeneration-CuXvtfAi.cjs → CodexTextGeneration-CBJHkgOz.cjs} +1 -1
- package/dist/{CopilotDriver-XX5zmGVK.cjs → CopilotDriver-Bm4OZMkm.cjs} +3 -3
- package/dist/{CopilotDriver-BJ1P_bHz.mjs → CopilotDriver-DZAW-7yV.mjs} +3 -3
- package/dist/{CursorDriver-BH6yAijk.mjs → CursorDriver-B4jb4rWd.mjs} +14 -3
- package/dist/{CursorDriver-CYMXQKec.cjs → CursorDriver-CYcKAkUY.cjs} +14 -3
- package/dist/{ForgejoSourceControlProvider-Dzg-BJY_.cjs → ForgejoSourceControlProvider-CXUevO6C.cjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-ZfU3SBzW.mjs → ForgejoSourceControlProvider-Dfi8KH7I.mjs} +2 -2
- package/dist/{GitHubSourceControlProvider-Bx5_H3zb.mjs → GitHubSourceControlProvider-BH97aNa0.mjs} +2 -2
- package/dist/{GitHubSourceControlProvider-BpyIi23Q.cjs → GitHubSourceControlProvider-DOs1ouvp.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-QccSsOnx.cjs → GitLabSourceControlProvider-CfbE6GYD.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-DjvGD1WZ.mjs → GitLabSourceControlProvider-nIzcy9AJ.mjs} +2 -2
- package/dist/{GrokDriver-jE4az7JZ.cjs → GrokDriver-C35gWEiw.cjs} +14 -3
- package/dist/{GrokDriver-BPIUrqkN.mjs → GrokDriver-CENrrqQc.mjs} +14 -3
- package/dist/{OpenCodeDriver-_hUfFwH4.mjs → OpenCodeDriver-BIxSPI9J.mjs} +105 -23
- package/dist/{OpenCodeDriver-IbZqAzYW.cjs → OpenCodeDriver-CHuQ6Xhc.cjs} +105 -23
- package/dist/{SourceControlProviderDiscoveryCatalog-CnkV-oKD.cjs → SourceControlProviderDiscoveryCatalog-DCmYsPEa.cjs} +1 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-CHxCP6Ng.mjs → SourceControlProviderDiscoveryCatalog-DaRgCE5d.mjs} +1 -1
- package/dist/bin.cjs +6158 -5042
- package/dist/bin.mjs +6148 -5032
- package/dist/client/assets/AccountSettings--RGb4Xyh.js +1 -0
- package/dist/client/assets/{AiFocusSettings-CYIp0JOV.js → AiFocusSettings-BnGcbAMj.js} +1 -1
- package/dist/client/assets/{AnimatedHeight-CM_Eh6tz.js → AnimatedHeight-xBldRJT_.js} +1 -1
- package/dist/client/assets/{AppearanceSettings-BwUAv5oz.js → AppearanceSettings-BZRfC5N0.js} +1 -1
- package/dist/client/assets/{BranchToolbar.logic-CKKpnCfs.js → BranchToolbar.logic-CGpYXkLE.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-DYXZNh1m.js → ChatRightPanel-BlooofmF.js} +9 -9
- package/dist/client/assets/{ChatThreadRouteView-B0kj0wFr.js → ChatThreadRouteView-B28bv4Zt.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-hNEraTe2.js +1 -0
- package/dist/client/assets/{CompositeItem-B4ITmHni.js → CompositeItem-CKY4wPzb.js} +1 -1
- package/dist/client/assets/{CompositeRoot-C5I2Yh5e.js → CompositeRoot-Ds7U4w5S.js} +1 -1
- package/dist/client/assets/ConnectionsSettings-C4VqR67L.js +7 -0
- package/dist/client/assets/{DiagnosticsSettings-B6IUUiYM.js → DiagnosticsSettings-ByZ42-mW.js} +1 -1
- package/dist/client/assets/{DialogHandle-Bs7TUuxl.js → DialogHandle-BdmgCiER.js} +1 -1
- package/dist/client/assets/{DialogPopup-BAK5J3da.js → DialogPopup-D6m8w7-0.js} +1 -1
- package/dist/client/assets/DialogRoot-BnE2_J9j.js +1 -0
- package/dist/client/assets/{DialogTitle-B1m3rLO-.js → DialogTitle-DFkPQ5wa.js} +1 -1
- package/dist/client/assets/{DialogTrigger-VXV8wYO4.js → DialogTrigger-CTCt2xVs.js} +1 -1
- package/dist/client/assets/{DialogViewport-yUeHNu43.js → DialogViewport-OqbNjTEg.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-C39ZNgWr.js → DraftChatThreadRouteView-B_4VVh8J.js} +1 -1
- package/dist/client/assets/{ExternalIdentityWeb.logic-TlJdh82R.js → ExternalIdentityWeb.logic-TXvkTDG8.js} +1 -1
- package/dist/client/assets/{GlassSurface-BWk2twKc.js → GlassSurface-k7VAG7Dp.js} +1 -1
- package/dist/client/assets/HostedConnectionControls-D0YyFVVm.js +1 -0
- package/dist/client/assets/HostedHubRoot-gr9o6h-w.js +1 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-C1VRYU0-.js → HostedNativeAuthorizationRoute-DQy7gPHg.js} +1 -1
- package/dist/client/assets/HostedRelayTrustNotice-DtiCe1oF.js +1 -0
- package/dist/client/assets/{Icons-uMh1k5C0.js → Icons-BHigZ6eO.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-Mx-1xSUL.js → IntegrationsSettingsPanel-RgmTIo_4.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-Bv3H18VO.js → KeybindingsSettings-2J94301x.js} +1 -1
- package/dist/client/assets/{McpServersSettings-Cbq-uHU3.js → McpServersSettings-Cpzyop0g.js} +1 -1
- package/dist/client/assets/{MobileSheet-DS7_soKu.js → MobileSheet-5RNq1fWV.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-CLm1JR27.js → NewWorktreeDialog-BE_53fbt.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-CFxNrhs_.js → NoActiveThreadState-Cpar0wiW.js} +1 -1
- package/dist/client/assets/NodeSecuritySettings-BpZYwf5z.js +1 -0
- package/dist/client/assets/{OpinionatedPluginsSettings-B7gZOBCs.js → OpinionatedPluginsSettings-CLbbw_K_.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-DQdUrqs1.js → PhoneGetAppInterstitial-G1mx30Rm.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-DbRPU11Z.js → PhoneGetAppInterstitialBackdrop-nfP93au3.js} +1 -1
- package/dist/client/assets/PhoneHome-D24dskaK.js +1 -0
- package/dist/client/assets/{PhoneSettingsSurface-BJ8jDucY.js → PhoneSettingsSurface-DU6QcRMa.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-DHnstN4J.js → ProjectFavicon-DiAvCEOv.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-Ch69G0-0.js → ProviderModelPicker-KKoDIb0I.js} +1 -1
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-D3qYdp40.js → ProviderUpdateLaunchNotification.logic-BWOy8LJG.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-Dz-1od7X.js → ProvidersSettingsPanel-Cotp9jkx.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-BORE69Ig.js → RedactedSensitiveText-Bijn-7t0.js} +1 -1
- package/dist/client/assets/{RootAppShell-DnesFYfo.js → RootAppShell-BPFAVRor.js} +3 -3
- package/dist/client/assets/{RycoLetterMark-DDx_gBX-.js → RycoLetterMark-DDqdXSCR.js} +1 -1
- package/dist/client/assets/{SettingsDialog-CWK_H1sI.js → SettingsDialog-C1pQqIpt.js} +1 -1
- package/dist/client/assets/{SettingsPanels-DxMEuovz.js → SettingsPanels-_z4Xw8vV.js} +1 -1
- package/dist/client/assets/{SettingsPanels.editor-D2gxvDPy.js → SettingsPanels.editor-CFrJ6eJl.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-CB2SdaRk.js → SourceControlSettings-aZXtdyQJ.js} +1 -1
- package/dist/client/assets/{StatisticsPage-MhMDuSSQ.js → StatisticsPage-DLxnsLkl.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-D3d0bJgk.js → StatisticsPanel-CZng52aF.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-DlnQpfyr.js → StatisticsSettingsLink-BswiD6v1.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-CPpIFcAC.js → ThreadStatusIndicators-Dg7ByO0t.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-DvadlVXV.js → ThreadTerminalDrawer-ro03rSMk.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-Ct9EINsa.js → ThreadWorkspacePanel-j_muuK0U.js} +1 -1
- package/dist/client/assets/{ToolbarRootContext-DtUqN8i6.js → ToolbarRootContext-gBA5VTsh.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-CI6hTQ_k.js → WorkItemsTab-CBbr_lPX.js} +4 -4
- package/dist/client/assets/{alert-DQjuri3D.js → alert-DM55UBFJ.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cb2TnXzy.js → alert-dialog-t0tth9lg.js} +1 -1
- package/dist/client/assets/authorization-jiPI8hG1.js +1 -0
- package/dist/client/assets/{badge-Cil0isYQ.js → badge-DUe5V2Mj.js} +1 -1
- package/dist/client/assets/{branding-BEx1jrAA.js → branding-31Bj-8ZC.js} +1 -1
- package/dist/client/assets/{button-CBqaO2Ub.js → button-BdUaa4U1.js} +1 -1
- package/dist/client/assets/{capabilities-Cj8jXZOW.js → capabilities-DQDkV1US.js} +1 -1
- package/dist/client/assets/{chatThreadActions-kwD_yAEt.js → chatThreadActions-3VwZmcuQ.js} +1 -1
- package/dist/client/assets/{collapsible-DBPd--L7.js → collapsible-BmAgbTeN.js} +1 -1
- package/dist/client/assets/{command-DuPvkUAz.js → command-8YtR6jmS.js} +1 -1
- package/dist/client/assets/composerDraftStore-Bz5WIZBE.js +11 -0
- package/dist/client/assets/{data-list-BNy2Nwkd.js → data-list-D7UF_rKC.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-Dz4zQu-C.js → desktopUpdateAtoms-D_GMRE2r.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-wrPRMcOi.js → desktopWorkspace-Dg6EeBlb.js} +1 -1
- package/dist/client/assets/{device-DbMaLmeM.js → device-DlExHdp_.js} +1 -1
- package/dist/client/assets/{dialog-Csp7hsmq.js → dialog-B0sUgnpe.js} +1 -1
- package/dist/client/assets/{draft-input-COB-ymgx.js → draft-input-CljKajxE.js} +1 -1
- package/dist/client/assets/{editorPreferences-lQ3Fm4yA.js → editorPreferences-B3qgjPa6.js} +1 -1
- package/dist/client/assets/{empty-BcTA7vWq.js → empty-D5W-VFFg.js} +1 -1
- package/dist/client/assets/{env-BZZxbmon.js → env-3rzMJf1D.js} +1 -1
- package/dist/client/assets/{getPseudoElementBounds-BaLrkv_J.js → getPseudoElementBounds-BAmGtfzA.js} +1 -1
- package/dist/client/assets/{group-CCjhaP2K.js → group-BQB2fHcw.js} +1 -1
- package/dist/client/assets/{index-QY6vcnCY.js → index-CQJvt69U.js} +2 -2
- package/dist/client/assets/{input-pu0UXdN_.js → input-5Gxk32uP.js} +1 -1
- package/dist/client/assets/{kbd-xUvRCeUS.js → kbd-B4HCyWpi.js} +1 -1
- package/dist/client/assets/{keybindings-Bj6xWIbQ.js → keybindings-DCgzArdM.js} +1 -1
- package/dist/client/assets/{label-BzDE8wjR.js → label-CaZNWVUA.js} +1 -1
- package/dist/client/assets/{lib-B6XyeqaU.js → lib-B7pkMeOn.js} +1 -1
- package/dist/client/assets/{logging-1BfRrhxL.js → logging-B1VrUJXw.js} +1 -1
- package/dist/client/assets/{main-stppnsiU.js → main-BPfnkW0F.js} +2 -2
- package/dist/client/assets/main-DspUYA0Y.css +2 -0
- package/dist/client/assets/{menu-g3Hcm2JF.js → menu-C9Z3D_7l.js} +1 -1
- package/dist/client/assets/{popover-z5hURYff.js → popover-CCz2VJor.js} +1 -1
- package/dist/client/assets/primary-BMsRfh2b.js +2 -0
- package/dist/client/assets/{projectPaths-BFTUsvWs.js → projectPaths-C7IGaRXO.js} +1 -1
- package/dist/client/assets/{providerDriverMeta-C9M8tUrj.js → providerDriverMeta-CgWTJ9AV.js} +1 -1
- package/dist/client/assets/{providerIconUtils-BXecnJ0v.js → providerIconUtils-DKIWQBl_.js} +1 -1
- package/dist/client/assets/providerInstances-DTwJD7w4.js +1 -0
- package/dist/client/assets/providerModels-DTwJD7w4.js +1 -0
- package/dist/client/assets/{qr-code-B6lBPRxy.js → qr-code-BPTdK_Fr.js} +1 -1
- package/dist/client/assets/{radio-group-DQahlnSi.js → radio-group-2REtGBUc.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-CUqcBhyS.js → resolveAriaLabelledBy-CPzaFh9Q.js} +1 -1
- package/dist/client/assets/{rightPanelRouteSearch-uEySicf2.js → rightPanelRouteSearch-Cv7sQjf8.js} +1 -1
- package/dist/client/assets/runtime-DAfYpzw4.js +1 -0
- package/dist/client/assets/{scroll-area-CzUrMo2h.js → scroll-area-BsYcpnWD.js} +1 -1
- package/dist/client/assets/{scrollEdges-C5VxoJIp.js → scrollEdges-CUJFIJBP.js} +1 -1
- package/dist/client/assets/{select-_C7bRT7k.js → select-zInJ5G5C.js} +1 -1
- package/dist/client/assets/{separator-CFUmZFfK.js → separator-CsdeZPxC.js} +1 -1
- package/dist/client/assets/{session-logic-C5moG_sv.js → session-logic-CjEpVbpM.js} +4 -2
- package/dist/client/assets/{settingsDialogStore-DnU14tMG.js → settingsDialogStore-B7yUTgbo.js} +1 -1
- package/dist/client/assets/{settingsLayout-zwP6p5aD.js → settingsLayout-7JR7nC6x.js} +1 -1
- package/dist/client/assets/{sheet-BoROLwxR.js → sheet-CLd8wqAA.js} +1 -1
- package/dist/client/assets/{sidebar-5T3qKIfp.js → sidebar-BliCAaUG.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-Bzdw3xc6.js → sidebarProjectFolders-ScxWbdTn.js} +1 -1
- package/dist/client/assets/{sidebarStatusText-q88Acn3r.js → sidebarStatusText-WiaEF1ae.js} +1 -1
- package/dist/client/assets/{skeleton-C2GDOvXd.js → skeleton-B_qDqbso.js} +1 -1
- package/dist/client/assets/{spinner-Dlyh0j_K.js → spinner-BlCG_0jN.js} +1 -1
- package/dist/client/assets/src-Chx4ffXH.js +14 -0
- package/dist/client/assets/storeSelectors-Of4FM0vM.js +1 -0
- package/dist/client/assets/{switch-CIMwetO3.js → switch-DUT5lUyk.js} +1 -1
- package/dist/client/assets/{terminal-links-BJzH2Ipe.js → terminal-links-Bxew8m4Q.js} +1 -1
- package/dist/client/assets/{textarea-C0_BLJbT.js → textarea-C5eyaBI3.js} +1 -1
- package/dist/client/assets/{threadPinning-DQrBoIxu.js → threadPinning-B8un4fjx.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-D-OkS27H.js → threadPriorityRefreshRuntime-Cgjn5Y-7.js} +1 -1
- package/dist/client/assets/{toast-D7IDKuLa.js → toast-X_O6OBAx.js} +1 -1
- package/dist/client/assets/{toggle-DjmkdNns.js → toggle-P-wZyQFO.js} +1 -1
- package/dist/client/assets/{toggle-group-q7LGJy7u.js → toggle-group-Du7zfd4_.js} +1 -1
- package/dist/client/assets/{tooltip-c9oahm_e.js → tooltip-D_i-87PL.js} +1 -1
- package/dist/client/assets/types-Of4FM0vM.js +1 -0
- package/dist/client/assets/{uiStateStore-C48VlkZ2.js → uiStateStore-UUXKrPLz.js} +1 -1
- package/dist/client/assets/{useAtlassian-Bpvpm41l.js → useAtlassian-BPNtoDXL.js} +0 -0
- package/dist/client/assets/{useButton-CbjUY1n3.js → useButton-D8BjCVb-.js} +1 -1
- package/dist/client/assets/{useCompositeListItem-Mh9CnfjW.js → useCompositeListItem-BHuxHR8U.js} +1 -1
- package/dist/client/assets/{useDebouncedValue-fMFxXx4-.js → useDebouncedValue-D2-9M4Tq.js} +1 -1
- package/dist/client/assets/{useFloatingRootContext-P6J9bP_1.js → useFloatingRootContext-CTdmlYcf.js} +1 -1
- package/dist/client/assets/useHandleNewThread-YGjWitl4.js +1 -0
- package/dist/client/assets/{useLabelableId-ve_G1Djw.js → useLabelableId-LInf_Egz.js} +1 -1
- package/dist/client/assets/{useLocation-LUorHj6V.js → useLocation-3zGT25DO.js} +1 -1
- package/dist/client/assets/{useOpenInteractionType-BcwkVFGu.js → useOpenInteractionType-BPthQeg6.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions--SRv1Gdm.js → usePhoneThreadActions-D_Z29f6p.js} +1 -1
- package/dist/client/assets/{usePopupViewport-DyXMbxzY.js → usePopupViewport-BErrsN0k.js} +1 -1
- package/dist/client/assets/{useScrollLock-DvPB4gyu.js → useScrollLock-CLyJPg7p.js} +1 -1
- package/dist/client/assets/{useStatistics-B4vW9Enx.js → useStatistics-BQkcb-1_.js} +1 -1
- package/dist/client/assets/{useSwipeDismiss-8zZC4ynu.js → useSwipeDismiss-DjMT1XiU.js} +1 -1
- package/dist/client/assets/{useThreadActions-wbcN8Mp3.js → useThreadActions-ISbVGkmx.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-DI2oAYh0.js → useTriggerFocusGuards-DwOHWbrB.js} +1 -1
- package/dist/client/assets/{useValueChanged-DeYQvzxH.js → useValueChanged-Bq39JB8D.js} +1 -1
- package/dist/client/assets/{utils-Dz7wQZDk.js → utils-BFbDkTQq.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-CDu-bszH.cjs → collectUint8StreamText-C5fop6Zf.cjs} +443 -142
- package/dist/{collectUint8StreamText-B3klZuIF.mjs → collectUint8StreamText-D8TBiBWk.mjs} +414 -143
- package/dist/{makeManagedServerProvider-DeEmDbiq.cjs → makeManagedServerProvider-BytnBN6b.cjs} +1 -1
- package/dist/{makeManagedServerProvider-CsaYHU8T.mjs → makeManagedServerProvider-DRlNwlhe.mjs} +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AccountSettings-CvD49Uja.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-CJKvYVxh.js +0 -1
- package/dist/client/assets/ConnectionsSettings-4l-DXYo6.js +0 -7
- package/dist/client/assets/DialogRoot-DMnQO_iQ.js +0 -1
- package/dist/client/assets/HostedConnectionControls-DO5uPfav.js +0 -1
- package/dist/client/assets/HostedHubRoot-DkHX6TkK.js +0 -1
- package/dist/client/assets/HostedRelayTrustNotice-Cl7lRwRJ.js +0 -1
- package/dist/client/assets/NodeSecuritySettings-B3uURyma.js +0 -1
- package/dist/client/assets/PhoneHome-BbZKBYb8.js +0 -1
- package/dist/client/assets/authorization-BrGZruGo.js +0 -1
- package/dist/client/assets/composerDraftStore-czbuHgbM.js +0 -11
- package/dist/client/assets/main-CZzCxtM-.css +0 -2
- package/dist/client/assets/primary-AnB-Zuft.js +0 -2
- package/dist/client/assets/providerInstances-CMy-5cGE.js +0 -1
- package/dist/client/assets/providerModels-CMy-5cGE.js +0 -1
- package/dist/client/assets/runtime-DRPzstwF.js +0 -1
- package/dist/client/assets/src-Blzsn4sO.js +0 -14
- package/dist/client/assets/storeSelectors-BJw1h5Ih.js +0 -1
- package/dist/client/assets/types-BJw1h5Ih.js +0 -1
- package/dist/client/assets/useHandleNewThread-C1VSk4Ji.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-QY6vcnCY.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import"./src-Blzsn4sO.js";import{F as i,Gt as a,I as o,N as s,P as c,Yt as l}from"./runtime-DRPzstwF.js";import{It as u}from"./composerDraftStore-czbuHgbM.js";import{a as d,i as f,o as p}from"./useHandleNewThread-C1VSk4Ji.js";import{t as m}from"./useNavigate-2tVq4iZ2.js";import{Kt as h,_ as g,b as _,o as v}from"./authorization-BrGZruGo.js";import{t as y}from"./RootAppShell-DnesFYfo.js";import{f as b}from"./useRenderElement-DchFnsR8.js";import{t as x}from"./arrow-left-Dtj9PfsA.js";import{n as S,t as C}from"./loader-circle-CrtHFAvM.js";import{t as w}from"./chevron-down-B7C6FKzM.js";import{t as T}from"./chevron-right-BWYGybX9.js";import{n as E,o as D,t as O}from"./toast-D7IDKuLa.js";import{t as k}from"./copy-UQjKGt7t.js";import{t as A}from"./key-round-CacMputS.js";import{_ as j,a as M,c as N,d as P,f as F,g as I,h as L,i as R,l as z,m as B,o as ee,p as te,t as ne,u as re}from"./HostedConnectionControls-DO5uPfav.js";import{t as ie}from"./log-out-tMJm0Gk6.js";import{t as V}from"./palette-BSD_aJZg.js";import{t as ae}from"./refresh-cw-DopCMrtR.js";import{t as oe}from"./server-JApJpgLa.js";import{t as H}from"./shield-check-dQ-4cMKk.js";import{t as se}from"./triangle-alert-RL_T3KLo.js";import{t as ce}from"./user-round-Cpzx8pSw.js";import{t as U}from"./utils-Dz7wQZDk.js";import{n as W,t as G}from"./input-pu0UXdN_.js";import{u as le}from"./Icons-uMh1k5C0.js";import{t as K}from"./button-CBqaO2Ub.js";import{t as q}from"./useCopyToClipboard-BTpWxumf.js";import{a as J,i as ue,n as de,o as fe,r as pe,s as me,t as he}from"./sheet-BoROLwxR.js";import{t as ge}from"./skeleton-C2GDOvXd.js";import{t as _e}from"./usePresentationTier-B_SCFvN7.js";import{i as ve,r as ye,t as be}from"./alert-DQjuri3D.js";import{a as xe,c as Se,i as Ce,o as we,r as Te,s as Ee,t as De}from"./dialog-Csp7hsmq.js";import{t as Y}from"./label-BzDE8wjR.js";import{t as Oe}from"./RycoLetterMark-DDx_gBX-.js";import{a as ke,i as Ae,n as je,o as Me,r as Ne,t as Pe}from"./MobileSheet-DS7_soKu.js";import{a as Fe,i as Ie,n as Le,o as Re,r as ze,t as Be}from"./empty-BcTA7vWq.js";import{c as Ve,n as He,r as Ue,t as We}from"./ExternalIdentityWeb.logic-TlJdh82R.js";import{a as Ge}from"./settingsLayout-zwP6p5aD.js";import{n as Ke,r as qe,t as Je}from"./phoneAnchoredActions-CtpkI3yG.js";import{t as Ye}from"./HostedRelayTrustNotice-Cl7lRwRJ.js";import{n as X,t as Xe}from"./data-list-BNy2Nwkd.js";var Ze=b(`life-buoy`,[[`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`}]]),Qe=b(`mail`,[[`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`}]]),Z=e(t(),1),Q=r(),$e=/^[A-Za-z0-9_-]{43}$/u,et=/^signup_[A-Za-z0-9_-]{22,43}$/u;function tt(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&&et.test(n)&&r!==null&&$e.test(r)&&i!==null&&$e.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&&$e.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&&$e.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function nt(e){let t=new URL(e.href),n=tt(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function rt(){let e=(0,Q.c)(3),t=c(st),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=at,n=()=>{document.visibilityState===`hidden`?(d(!0),v.suspendBrowser(`hidden`)):e()},r=it,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 it(){d(!0),v.suspendBrowser(`offline`)}function at(){document.visibilityState===`visible`&&navigator.onLine&&v.resumeBrowser().then(ot)}function ot(){return d(!1)}function st(e){return e.accountStatus}var $=u(),ct=100;function lt(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>ct?`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,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(xe,{children:[(0,$.jsx)(Se,{children:`Rename node`}),(0,$.jsx)(Te,{children:`This is the canonical name shown to everyone authorized to use this node.`})]}),t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Node name`}),t[12]=S):S=t[12];let C=g!==null||u!==null,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{s(e.currentTarget.value),d(null)},t[13]=w):w=t[13];let T;t[14]!==_||t[15]!==y?(T=e=>{e.key===`Enter`&&_&&y()},t[14]=_,t[15]=y,t[16]=T):T=t[16];let E;t[17]!==o||t[18]!==c||t[19]!==T||t[20]!==C?(E=(0,$.jsx)(G,{id:`hosted-node-name`,value:o,autoFocus:!0,disabled:c,"aria-invalid":C,onChange:w,onKeyDown:T}),t[17]=o,t[18]=c,t[19]=T,t[20]=C,t[21]=E):E=t[21];let D;t[22]===g?D=t[23]:(D=g?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:g}):null,t[22]=g,t[23]=D);let O;t[24]===u?O=t[25]:(O=u?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u}):null,t[24]=u,t[25]=O);let k;t[26]!==E||t[27]!==D||t[28]!==O?(k=(0,$.jsxs)(we,{className:`space-y-2`,children:[S,E,D,O]}),t[26]=E,t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;t[30]===i?A=t[31]:(A=()=>i(!1),t[30]=i,t[31]=A);let j;t[32]!==c||t[33]!==A?(j=(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:A,children:`Cancel`}),t[32]=c,t[33]=A,t[34]=j):j=t[34];let M=!_,N;t[35]===y?N=t[36]:(N=()=>void y(),t[35]=y,t[36]=N);let P=c?`Saving…`:`Save`,F;t[37]!==M||t[38]!==N||t[39]!==P?(F=(0,$.jsx)(K,{disabled:M,onClick:N,children:P}),t[37]=M,t[38]=N,t[39]=P,t[40]=F):F=t[40];let I;t[41]!==j||t[42]!==F?(I=(0,$.jsxs)(Ce,{children:[j,F]}),t[41]=j,t[42]=F,t[43]=I):I=t[43];let L;t[44]!==k||t[45]!==I||t[46]!==b?(L=(0,$.jsxs)(Ee,{className:`max-w-md`,showCloseButton:b,children:[x,k,I]}),t[44]=k,t[45]=I,t[46]=b,t[47]=L):L=t[47];let R;return t[48]!==i||t[49]!==r||t[50]!==L?(R=(0,$.jsx)(De,{open:r,onOpenChange:i,children:L}),t[48]=i,t[49]=r,t[50]=L,t[51]=R):R=t[51],R}var ut=`owner_revoked`,dt=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.`})]),ft=`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 pt(e){return{title:`Revoke ${e.label}?`,consequences:dt,subjectPrompt:ft,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var mt=`Revoke`;function ht(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function gt(e){return e===null||e.outcome===`unchanged`}var _t=e=>Object.freeze(e),vt=Object.freeze([_t({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`})}),_t({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`})}),_t({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`})}),_t({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`})}),_t({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`})}),_t({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`})}),_t({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`})}),_t({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`})}),_t({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`})})]),yt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function bt(e){let t=xt(e),n=St(e);for(let e of vt)if(e.selects(t,n))return e.failure;return yt}function xt(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function St(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var Ct=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function wt(e){return e===null||!Number.isFinite(e)?null:Ct.format(new Date(e))}function Tt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Et(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Dt(e){return Et(e)}function Ot(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return wt(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`:wt(e)??`unknown`}function kt(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${Ot(e.lastAuthenticatedAt,t)}`:`Last seen ${Ot(e.presence.lastHeartbeatAt,t)}`}function At(e){let t=`${Tt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${Dt(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function jt(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 Mt(e){return e.filter(e=>e.revokedAt===null).length}function Nt(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function Pt(e){let t=Mt(e),n=Nt(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 Ft(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function It(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 Lt({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=pt(e),l=gt(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(bt(e)),a(!1)}}};return(0,$.jsx)(De,{open:t,onOpenChange:e=>{!e&&i||n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(Ee,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(xe,{children:[(0,$.jsx)(Se,{children:c.title}),(0,$.jsx)(Te,{children:c.subjectPrompt})]}),(0,$.jsxs)(we,{className:`space-y-4`,children:[(0,$.jsxs)(Xe,{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:`${Tt(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)(se,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(Ce,{children:[(0,$.jsx)(K,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(K,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Rt(e){let t=(0,Q.c)(57),{node:n}=e,r=Ge(6e4),{copyToClipboard:i,isCopied:a}=q(),o;t[0]===n.createdAt?o=t[1]:(o=wt(n.createdAt),t[0]=n.createdAt,t[1]=o);let s=o,c;t[2]===n.lastAuthenticatedAt?c=t[3]:(c=wt(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=c);let l=c,u;t[4]===n.revokedAt?u=t[5]:(u=wt(n.revokedAt),t[4]=n.revokedAt,t[5]=u);let d=u,f=n.grant.role!==n.effectiveRole,p;t[6]===n?p=t[7]:(p=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(R,{node:n})}),t[6]=n,t[7]=p);let m;t[8]!==n.presence.lastHeartbeatAt||t[9]!==r?(m=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:wt(n.presence.lastHeartbeatAt)??void 0,children:Ot(n.presence.lastHeartbeatAt,r)}),t[8]=n.presence.lastHeartbeatAt,t[9]=r,t[10]=m):m=t[10];let h;t[11]===m?h=t[12]:(h=(0,$.jsx)(X,{term:`Last heartbeat`,children:m}),t[11]=m,t[12]=h);let g=l??`Never`,_;t[13]===g?_=t[14]:(_=(0,$.jsx)(X,{term:`Last connected`,children:g}),t[13]=g,t[14]=_);let v;t[15]===n.platformOs?v=t[16]:(v=Tt(n.platformOs),t[15]=n.platformOs,t[16]=v);let y=`${v} · ${n.platformArch}`,b;t[17]===y?b=t[18]:(b=(0,$.jsx)(X,{term:`Platform`,children:y}),t[17]=y,t[18]=b);let x;t[19]===n.clientVersion?x=t[20]:(x=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=x);let C;t[21]===n.effectiveRole?C=t[22]:(C=Dt(n.effectiveRole),t[21]=n.effectiveRole,t[22]=C);let w;t[23]===C?w=t[24]:(w=(0,$.jsx)(X,{term:`Your role`,children:C}),t[23]=C,t[24]=w);let T;t[25]!==f||t[26]!==n.grant.role?(T=f?(0,$.jsxs)(X,{term:`Granted role`,children:[Dt(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]=f,t[26]=n.grant.role,t[27]=T):T=t[27];let E=s??`Not reported`,D;t[28]===E?D=t[29]:(D=(0,$.jsx)(X,{term:`Enrolled`,children:E}),t[28]=E,t[29]=D);let O;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==d?(O=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${d??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=d,t[33]=O):O=t[33];let A=a?`Copied`:`Copy node ID`,j;t[34]!==i||t[35]!==n.id?(j=()=>i(n.id,void 0),t[34]=i,t[35]=n.id,t[36]=j):j=t[36];let M;t[37]===a?M=t[38]:(M=a?(0,$.jsx)(S,{"aria-hidden":!0}):(0,$.jsx)(k,{"aria-hidden":!0}),t[37]=a,t[38]=M);let N;t[39]!==A||t[40]!==j||t[41]!==M?(N=(0,$.jsx)(K,{size:`icon-xs`,variant:`ghost`,"aria-label":A,onClick:j,children:M}),t[39]=A,t[40]=j,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==n.id||t[44]!==N?(P=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:N,children:n.id}),t[43]=n.id,t[44]=N,t[45]=P):P=t[45];let F;return t[46]!==b||t[47]!==x||t[48]!==w||t[49]!==T||t[50]!==D||t[51]!==O||t[52]!==P||t[53]!==p||t[54]!==h||t[55]!==_?(F=(0,$.jsxs)(Xe,{children:[p,h,_,b,x,w,T,D,O,P]}),t[46]=b,t[47]=x,t[48]=w,t[49]=T,t[50]=D,t[51]=O,t[52]=P,t[53]=p,t[54]=h,t[55]=_,t[56]=F):F=t[56],F}function zt(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=_e()===`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?(_=Ft({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=It({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=y):y=t[7];let b=y,x;t[8]!==n||t[9]!==c||t[10]!==s?(x=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=x):x=t[11];let S=x,C=v&&b?b:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(Me,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=At(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(je,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(Ae,{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)(Rt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===C?l=t[24]:(l=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[23]=C,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(ke,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==v||t[29]!==S?(d=(0,$.jsx)(Ne,{children:(0,$.jsx)(K,{className:`min-h-11`,disabled:v,onClick:S,children:`Connect`})}),t[28]=v,t[29]=S,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)(Pe,{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 w=o&&n.revokedAt===null,T;t[38]!==s||t[39]!==f||t[40]!==m?(T=e=>{!e&&(m!==null||f!==null)||(e||(p(null),h(null)),s(e))},t[38]=s,t[39]=f,t[40]=m,t[41]=T):T=t[41];let E;t[42]===n.label?E=t[43]:(E=(0,$.jsx)(me,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=E);let D;t[44]===n?D=t[45]:(D=At(n),t[44]=n,t[45]=D);let O;t[46]===D?O=t[47]:(O=(0,$.jsx)(de,{children:D}),t[46]=D,t[47]=O);let k;t[48]!==E||t[49]!==O?(k=(0,$.jsxs)(ue,{children:[E,O]}),t[48]=E,t[49]=O,t[50]=k):k=t[50];let A;t[51]===n?A=t[52]:(A=(0,$.jsx)(Rt,{node:n}),t[51]=n,t[52]=A);let j;t[53]===C?j=t[54]:(j=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[53]=C,t[54]=j);let M;t[55]!==j||t[56]!==A?(M=(0,$.jsxs)(J,{children:[A,j]}),t[55]=j,t[56]=A,t[57]=M):M=t[57];let N;t[58]!==n.id||t[59]!==w?(N=w?(0,$.jsx)(K,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:mt}):null,t[58]=n.id,t[59]=w,t[60]=N):N=t[60];let P;t[61]!==a||t[62]!==n.id?(P=a?(0,$.jsx)(K,{variant:`outline`,onClick:()=>p(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=P):P=t[63];let F;t[64]!==v||t[65]!==S?(F=(0,$.jsx)(K,{disabled:v,onClick:S,children:`Connect`}),t[64]=v,t[65]=S,t[66]=F):F=t[66];let I;t[67]!==N||t[68]!==P||t[69]!==F?(I=(0,$.jsxs)(pe,{children:[N,P,F]}),t[67]=N,t[68]=P,t[69]=F,t[70]=I):I=t[70];let L;t[71]!==M||t[72]!==I||t[73]!==k?(L=(0,$.jsxs)(fe,{side:`right`,className:`w-full sm:max-w-md`,children:[k,M,I]}),t[71]=M,t[72]=I,t[73]=k,t[74]=L):L=t[74];let R;t[75]!==g||t[76]!==L||t[77]!==T?(R=(0,$.jsx)(he,{open:g,onOpenChange:T,children:L}),t[75]=g,t[76]=L,t[77]=T,t[78]=R):R=t[78];let z;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==f?(z=a?(0,$.jsx)(lt,{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]=z):z=t[83];let B;t[84]!==n||t[85]!==u||t[86]!==w||t[87]!==m?(B=w?(0,$.jsx)(Lt,{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]=w,t[87]=m,t[88]=B):B=t[88];let ee;return t[89]!==R||t[90]!==z||t[91]!==B?(ee=(0,$.jsxs)($.Fragment,{children:[R,z,B]}),t[89]=R,t[90]=z,t[91]=B,t[92]=ee):ee=t[92],ee}function Bt(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 Vt(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=U(`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 Ht(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=U(`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)(Oe,{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,Ke]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Ut=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Wt=`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))]`,Gt=`flex min-h-full flex-col`,Kt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function qt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=U(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=U(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Kt.page),o=(0,$.jsx)(Ht,{}),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 Jt(e){let t=(0,Q.c)(16),{children:n,nav:r,trailing:i,scrollRef:a,measure:o}=e,s=o===void 0?`page`:o,c=_e()===`phone`,l;t[0]!==c||t[1]!==r||t[2]!==i?(l=c?null:(0,$.jsx)(qt,{nav:r,trailing:i}),t[0]=c,t[1]=r,t[2]=i,t[3]=l):l=t[3];let u=c?`min-h-full py-10`:`pt-8 pb-16`,d=Kt[s],f;t[4]!==u||t[5]!==d?(f=U(`mx-auto flex w-full flex-col`,u,Wt,d),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==f?(p=(0,$.jsx)(`section`,{className:f,children:n}),t[7]=n,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==a||t[11]!==p?(m=(0,$.jsx)(`main`,{ref:a,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:p}),t[10]=a,t[11]=p,t[12]=m):m=t[12];let h;return t[13]!==l||t[14]!==m?(h=(0,$.jsx)(E,{children:(0,$.jsx)(O,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[l,m]})})}),t[13]=l,t[14]=m,t[15]=h):h=t[15],h}var Yt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-CvD49Uja.js`).then(e=>({default:e.AccountSettingsPanel})),[])),Xt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-BwUAv5oz.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),Zt=[{id:`overview`,label:`Overview`,icon:ce},{id:`security`,label:`Security`,icon:H},{id:`appearance`,label:`Appearance`,icon:V}];function Qt(e){let t=(0,Q.c)(15),{section:n}=e,r=c(en),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(K,{variant:`ghost`,onClick:$t,children:[(0,$.jsx)(x,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=a);let o;t[3]===n?o=t[4]:(o=Zt.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(K,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>L({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[3]=n,t[4]=o);let s;t[5]===o?s=t[6]:(s=(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:o})}),t[5]=o,t[6]=s);let l;t[7]===n?l=t[8]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(tn,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(ge,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Yt,{}):(0,$.jsx)(Xt,{surface:`hub`})})}),t[7]=n,t[8]=l);let u;t[9]!==s||t[10]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==u?(d=(0,$.jsx)(Jt,{measure:`page`,trailing:i,children:(0,$.jsx)(Bt,{title:`Account`,description:a,children:u})}),t[12]=a,t[13]=u,t[14]=d):d=t[14],d}function $t(){return L({kind:`nodes`})}function en(e){return e.account}function tn(){let e=(0,Q.c)(11),t=c(nn),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 l;return e[8]!==i||e[9]!==s?(l=(0,$.jsx)(Vt,{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]=l):l=e[10],l}function nn(e){return e.account}function rn(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(an)}),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 an(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 on(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=U(Ut,`hub-ambient`),f=U(Gt,Wt,`py-10`),t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p=Kt[u],m;t[2]===p?m=t[3]:(m=U(`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 h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Ht,{size:`lg`})}),t[4]=h):h=t[4];let g;t[5]!==r||t[6]!==c?(g=(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]=g):g=t[7];let _;t[8]===i?_=t[9]:(_=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=_);let v;t[10]===n?v=t[11]:(v=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=v);let y;t[12]!==a||t[13]!==g||t[14]!==_||t[15]!==v||t[16]!==o?(y=(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:[g,_,v,a,o]}),t[12]=a,t[13]=g,t[14]=_,t[15]=v,t[16]=o,t[17]=y):y=t[17];let b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(rn,{}),t[18]=b):b=t[18];let x;t[19]!==y||t[20]!==m?(x=(0,$.jsx)(`div`,{className:f,children:(0,$.jsxs)(`div`,{className:m,children:[h,y,b]})}),t[19]=y,t[20]=m,t[21]=x):x=t[21];let S;return t[22]!==s||t[23]!==x?(S=(0,$.jsx)(`main`,{ref:s,className:d,children:x}),t[22]=s,t[23]=x,t[24]=S):S=t[24],S}function sn({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,d]=(0,Z.useState)(null),f=(0,Z.useRef)(``),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{p.current?.abort(),p.current=null,f.current=``},[]);let m=()=>{p.current?.abort();let e=new AbortController;return p.current=e,l(!0),d(null),e},h=e=>{p.current===e&&(p.current=null,l(!1))},_=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof g&&e.status===401){f.current=``,n(``),i(null),await v.expireSession();return}d(t??(e instanceof g?e.message:`Hub is temporarily unavailable.`))}},y=async e=>{e.preventDefault();let r=t.trim();n(``),f.current=``;let a=m();try{let e=await o.lookupNodeEnrollment(r,a.signal);if(a.signal.aborted)return;f.current=r,i(e),s(`review`)}catch(e){await _(e)}finally{h(a)}},b=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await o.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,i(null),s(`approved`),await v.refreshDirectory()}catch(e){f.current=``,i(null),s(`input`),await _(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{h(t)}},x=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await o.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,i(null),s(`denied`)}catch(e){await _(e)}finally{h(t)}},S=()=>{p.current?.abort(),f.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)(K,{className:`mt-5`,onClick:S,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(oe,{"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)(Xe,{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)(se,{"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)(K,{variant:`destructive`,disabled:c,onClick:()=>void x(),children:`Confirm denial`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{disabled:c,onClick:()=>void b(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(K,{variant:`ghost`,disabled:c,onClick:S,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(oe,{"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 y(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-node-device-code`,children:`Device code`}),(0,$.jsx)(G,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${W}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,onClick:S,children:`Cancel`})]})]})]})}function cn(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 ln=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,un=null;function dn(){return window.turnstile?Promise.resolve(window.turnstile):un||(un=new Promise((e,t)=>{let n=document.querySelector(`script[src="${ln}"]`),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=ln,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw un=null,e}),un)}function fn(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),dn().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 pn(e,t){return e instanceof g?e.message:t}function mn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),h(e)}function hn(){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 gn(e){return e!==null&&`activationSecret`in e}function _n({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,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),[_,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(!1),[S,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 x(!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(pn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||x(!1)}),()=>e.abort()},[t,n]);let D=async t=>{if(t.preventDefault(),b||e===null)return;let n=e.antiBot.provider===`bypass`?`development`:_??``;if(!n){w(`Complete the anti-bot check before continuing.`);return}x(!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(pn(e,`Account creation is temporarily unavailable.`))}finally{x(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!(b||t===null||!(`attemptSecret`in t))){x(!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(pn(e,`That email code could not be verified.`))}finally{x(!1)}}},k=async e=>{let t=T.current;if(b||!gn(t))return;if(e===`password`&&p!==h){w(`The passwords do not match.`);return}x(!0),w(null);let n=p;m(``),g(``);try{let r=e===`passkey`?await o.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:mn()}):await o.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:mn()});T.current=null,await v.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(pn(e,`Account creation did not complete.`))}finally{x(!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)(cn,{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)(Y,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:W,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)(Y,{htmlFor:`hub-signup-email`,children:`Email`}),(0,$.jsx)(G,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:W,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(fn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(Sn,{value:S}),(0,$.jsx)(Cn,{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)(Qe,{"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)(Y,{htmlFor:`hub-signup-code`,children:`Verification code`}),(0,$.jsx)(G,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:W,onChange:e=>f(e.currentTarget.value)})]}),(0,$.jsx)(Sn,{value:S}),(0,$.jsx)(Cn,{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)(Y,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:W,onChange:e=>m(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:h,className:W,onChange:e=>g(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)(Sn,{value:S}),(0,$.jsx)(Cn,{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)(H,{"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)(Sn,{value:S}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${Je}`,children:[(0,$.jsxs)(K,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||i===`verifying`,onClick:()=>void k(`passkey`),children:[b?(0,$.jsx)(C,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(A,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||i===`verifying`,onClick:()=>a(`password`),children:`Use a password instead`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function vn({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:mn()});await v.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(pn(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)(cn,{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)(H,{"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)(Y,{htmlFor:`hub-external-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:W,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)(fn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(Sn,{value:u}),(0,$.jsx)(Cn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function yn({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 v.adoptPublicBrowserIdentity(e)}}catch(e){h(pn(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)(Y,{htmlFor:`hub-login-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:W,onChange:e=>i(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:a,className:W,onChange:e=>s(e.currentTarget.value)})]})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-second-factor`,children:u.factor===`totp`?`Authenticator code`:`Email code`}),(0,$.jsx)(G,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:W,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)(Sn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Cn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function bn({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),x=(0,Z.useRef)(!1),S=async(e,t)=>{let n=await o.verifyPasswordReset({token:e},t);b.current=n,l(``),i(`password`)};(0,Z.useEffect)(()=>{if(x.current||e===null)return;if(x.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),S(e.token,n.signal).catch(e=>y(pn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||_(!1)}),()=>n.abort()},[e,t]);let C=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 S(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(pn(e,`Password reset did not complete.`))}finally{_(!1)}}},w=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 C(e),children:[r===`complete`?null:(0,$.jsx)(cn,{step:w,total:3,label:w===1?`Find your account`:w===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:a,className:W,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)(Qe,{"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)(Y,{htmlFor:`hub-reset-token`,children:`Reset token`}),(0,$.jsx)(G,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:W,onChange:e=>l(e.currentTarget.value)})]})]}):r===`password`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password`,children:`New password`}),(0,$.jsx)(G,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:W,onChange:e=>d(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:f,className:W,onChange:e=>p(e.currentTarget.value)})]}),b.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(G,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:m,className:W,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)(H,{"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)(Sn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${Je}`,children:(0,$.jsx)(K,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Cn,{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 xn({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 v.bootstrap()}catch(e){s(pn(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)(Y,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(G,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:W,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(Sn,{value:a}),(0,$.jsx)(Cn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function Sn(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 Cn(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)(C,{"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)(K,{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)(K,{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 wn;function Tn(){if(window.location.pathname!==`/email-verification`)return null;if(wn!==void 0)return wn;let e=nt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return wn=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,wn}function En(){let e=(0,Q.c)(3),t=j(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=qe(t===null?void 0:B(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function Dn(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(Tn),r=c(Fn),o=c(Pn),s=c(Nn),u=c(Mn),d=c(jn),f=c(An),p=i(kn),m=F(),h;e[0]===m.logicalPathname?h=e[1]:(h=N(m.logicalPathname),e[0]=m.logicalPathname,e[1]=h);let g=h,_;e[2]===g?_=e[3]:(_=e=>a(e,g),e[2]=g,e[3]=_);let v=l(_),b=re();P();let x;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],e[4]=x):x=e[4],(0,Z.useEffect)(On,x),rt(),En();let S=j(),C;e[5]!==r||e[6]!==S?.kind?(C=()=>{r===`authenticated`&&S?.kind===`sign-up`&&I(`/`,{replace:!0})},e[5]=r,e[6]=S?.kind,e[7]=C):C=e[7];let w;if(e[8]!==r||e[9]!==S?(w=[r,S],e[8]=r,e[9]=S,e[10]=w):w=e[10],(0,Z.useEffect)(C,w),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)(In,{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)(Kn,{}),e[14]=t):t=e[14],t}if(s.length>0&&!p){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Yn,{}),e[15]=t):t=e[15],t}if(S?.kind===`account`){let t;return e[16]===S.section?t=e[17]:(t=(0,$.jsx)(Qt,{section:S.section}),e[16]=S.section,e[17]=t),t}if(S?.kind===`nodes`||S?.kind===`nodes-enroll`){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(er,{}),e[18]=t):t=e[18],t}if(m.nodeId===null){if(b||m.malformed){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(er,{}),e[19]=t):t=e[19],t}if(o&&d){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(y,{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)(y,{authGateState:{status:`hosted-cached`}}),e[21]=t):t=e[21],t}if(!o||o.id!==m.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Hn,{}),e[22]=t):t=e[22],t}if(u===`terminal-failure`){let t;return e[23]!==f||e[24]!==o?(t=(0,$.jsx)(zn,{node:o,message:f}),e[23]=f,e[24]=o,e[25]=t):t=e[25],t}if(!d){if(v){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(y,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]===o?t=e[28]:(t=(0,$.jsx)(Un,{node:o}),e[27]=o,e[28]=t),t}let T;return e[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(y,{authGateState:{status:`hosted-hub`}}),e[29]=T):T=e[29],T}function On(){return p()}function kn(e){return e.leased}function An(e){return e.errorMessage}function jn(e){return e.sessionEstablished}function Mn(e){return e.transportStatus}function Nn(e){return e.recoveryCodes}function Pn(e){return e.selectedNode}function Fn(e){return e.accountStatus}function In(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(Ln),()=>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)(K,{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)(Rn,{}),`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)(on,{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 Ln(){wn=void 0}function Rn(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(C,{"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 zn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ne,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(se,{"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)(K,{className:`mt-5`,onClick:Bn,children:[(0,$.jsx)(ae,{"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)(Jt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Vn,{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 Bn(){v.retrySelectedNode()}function Vn(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 Hn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(oe,{"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)(Jt,{measure:`content`,children:(0,$.jsx)(Vn,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Rn,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Un(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=M(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(oe,{"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)(Rn,{}),`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)(K,{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)(Jt,{measure:`content`,children:(0,$.jsxs)(Vn,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Wn(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(Gn),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,l;t[1]===c?l=t[2]:(l=(0,$.jsx)(w,{"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)(K,{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 Gn(e){return!e}function Kn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=c(e=>e.accountStatus),r=c(e=>e.errorMessage),i=c(e=>e.errorReason??null),a=c(e=>e.bootstrapAvailable),[l,u]=(0,Z.useState)(()=>nt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),d=(0,Z.useCallback)(()=>u(null),[]),{config:f}=hn(),p=s(e=>e.externalIdentityConfiguration),m=Ue(p),[h,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),[w,T]=(0,Z.useState)(void 0),E=j(),D=E?.kind===`sign-up`||E?.kind===`sign-up-verify`?`public`:E?.kind===`invitation`?`invitation`:E?.kind===`setup`?`bootstrap`:null,O=E?.kind===`sign-in-password`?`password`:E?.kind===`sign-in-recovery-code`?`recovery-code`:E?.kind===`reset-password`?`password-reset`:null,k=e=>{L(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},M=e=>{L(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},N=(0,Z.useRef)(null),P=(0,Z.useRef)(null),F=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{v.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(D!==`public`&&e!==`native-authorization`){T(void 0);return}let t=new AbortController;return T(void 0),o.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||T(e)}).catch(()=>{t.signal.aborted||T({status:`none`})}),()=>t.abort()},[e,D]);let I=(0,Z.useCallback)(async()=>{if(!h){y(!0),x(null);try{await We({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:te({kind:`sign-up`}),start:e=>o.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){x(e instanceof g?e.message:`GitHub sign-in is temporarily unavailable.`),y(!1)}}},[e,h]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||m?.login!==!0||w?.status!==`none`||S.current||(S.current=!0,I())},[t,e,w?.status,m?.login,I,n]),(0,Z.useEffect)(()=>{D===`invitation`||D===`bootstrap`?P.current?.focus({preventScroll:!0}):N.current?.focus({preventScroll:!0})},[O,D]),(0,Z.useEffect)(()=>{F.current?.scrollTo({top:0,left:0})},[O,D]);let R=D===`invitation`||D===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${Je}`,children:[(0,$.jsx)(K,{type:`submit`,form:qn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:D===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>v.cancelAuthentication():()=>k(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,z=D||O?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${Je}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[m?.login?(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:h||n===`authenticating`||n===`signing-out`,onClick:()=>void I(),children:[h?(0,$.jsx)(C,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(le,{"aria-hidden":!0}),h?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void v.signIn(),children:[(0,$.jsx)(A,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>v.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[f?.status===`enabled`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`public`),children:`Create account`}):null,(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`bootstrap`),children:`Set up first owner`}):null]})]})}),B=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(K,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void v.bootstrap(),children:[(0,$.jsx)(ae,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),ne=i?_(i):null,re=b??r??ne?.message,ie=b===null&&ne!==null?ne.title:`Sign-in did not complete`,V=re?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(be,{variant:`error`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:ie}),(0,$.jsx)(ye,{children:re})]})}):null,oe=w?.status===`signup`?w:null,H=w?.status===`error`?w:null,ce=e===`native-authorization`&&D!==`public`;if(D===`public`||ce&&(oe!==null||H!==null)){let e=()=>{ce?T({status:`none`}):k(null)};return(0,$.jsxs)(on,{title:`Create your account`,description:ce?`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:B,scrollRef:F,titleRef:N,children:[V,w===void 0?(0,$.jsx)(ge,{className:`h-64 w-full rounded-2xl`}):oe?(0,$.jsx)(vn,{pendingSignup:oe,config:f?.status===`enabled`?f:null,onCancel:e}):H?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(be,{variant:`warning`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:`GitHub signup did not continue`}),(0,$.jsx)(ye,{children:He(H.code)})]}),(0,$.jsx)(K,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(_n,{config:f?.status===`enabled`?f:null,initialLink:l,onConsumeLink:d,onCancel:()=>{d(),k(null)}})]})}if(D===`invitation`||D===`bootstrap`)return(0,$.jsxs)(on,{title:D===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:D===`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:R,trailing:B,scrollRef:F,titleRef:N,children:[V,(0,$.jsx)(Jn,{mode:D,credentialRef:P})]});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)(on,{title:e.title,description:e.description,trailing:B,scrollRef:F,titleRef:N,children:[V,O===`password`?(0,$.jsx)(yn,{onCancel:()=>M(null),onUseRecoveryCode:()=>M(`recovery-code`),onResetPassword:()=>M(`password-reset`)}):O===`recovery-code`?(0,$.jsx)(xn,{onCancel:()=>M(null)}):(0,$.jsx)(bn,{initialLink:l,onConsumeLink:d,onCancel:()=>{d(),M(null)}})]})}return(0,$.jsxs)(on,{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:z,trailing:B,scrollRef:F,titleRef:N,children:[(0,$.jsx)(Ye,{}),(0,$.jsx)(Wn,{bootstrapAvailable:a,publicSignupEnabled:f?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>M(`password`),children:[(0,$.jsx)(Ze,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(ee,{}),V]})}var qn=`hub-registration-form`;function Jn(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 v.redeemInvitation({secret:t,...r}):await v.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)(Y,{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)(G,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:W,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 y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Y,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=y):y=t[16];let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>s(e.currentTarget.value),t[17]=b):b=t[17];let x;t[18]===o?x=t[19]:(x=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[y,(0,$.jsx)(G,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:W,onChange:b})]}),t[18]=o,t[19]=x);let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsxs)(Y,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>l(e.currentTarget.value),t[21]=C):C=t[21];let w;t[22]===c?w=t[23]:(w=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[S,(0,$.jsx)(G,{id:`hub-passkey-label`,maxLength:100,value:c,className:W,onChange:C})]}),t[22]=c,t[23]=w);let T;return t[24]!==x||t[25]!==w||t[26]!==f||t[27]!==_?(T=(0,$.jsxs)(`form`,{id:qn,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[_,x,w]}),t[24]=x,t[25]=w,t[26]=f,t[27]=_,t[28]=T):T=t[28],T}function Yn(){let e=(0,Q.c)(20),t=c(Qn),{copyToClipboard:n,isCopied:r}=q(),i=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,a;e[0]!==n||e[1]!==t?(a=()=>n(Ve(t),void 0),e[0]=n,e[1]=t,e[2]=a):a=e[2];let o;e[3]===r?o=e[4]:(o=r?(0,$.jsx)(S,{"aria-hidden":!0}):(0,$.jsx)(k,{"aria-hidden":!0}),e[3]=r,e[4]=o);let s=r?`Copied`:`Copy codes`,l;e[5]!==a||e[6]!==o||e[7]!==s?(l=(0,$.jsxs)(K,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:a,children:[o,s]}),e[5]=a,e[6]=o,e[7]=s,e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(K,{size:`cta`,className:`mt-3 w-full`,onClick:Zn,children:`I saved the codes`}),e[9]=u):u=e[9];let d;e[10]===l?d=e[11]:(d=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${Je}`,children:[l,u]}),e[10]=l,e[11]=d);let f;e[12]===t?f=e[13]:(f=t.map(Xn),e[12]=t,e[13]=f);let p;e[14]===f?p=e[15]:(p=(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:f}),e[14]=f,e[15]=p);let m;return e[16]!==i||e[17]!==d||e[18]!==p?(m=(0,$.jsx)(on,{title:`Save your recovery codes`,description:i,actions:d,children:p}),e[16]=i,e[17]=d,e[18]=p,e[19]=m):m=e[19],m}function Xn(e){return(0,$.jsx)(`li`,{children:e},e)}function Zn(){return v.dismissRecoveryCodes()}function Qn(e){return e.recoveryCodes}function $n(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=kt(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=f(n),t[3]=n,t[4]=l);let u=l,d=i||u,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(oe,{"aria-hidden":!0,className:`size-4`})}),t[5]=p):p=t[5];let m;t[6]===n.label?m=t[7]:(m=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[6]=n.label,t[7]=m);let h;t[8]===n?h=t[9]:(h=At(n),t[8]=n,t[9]=h);let g;t[10]===h?g=t[11]:(g=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:h}),t[10]=h,t[11]=g);let _;t[12]===u?_=t[13]:(_=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]=_);let v;t[14]!==m||t[15]!==g||t[16]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[m,g,_]}),t[14]=m,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]===n?y=t[19]:(y=(0,$.jsx)(R,{node:n}),t[18]=n,t[19]=y);let b;t[20]===c?b=t[21]:(b=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]=b);let x;t[22]!==y||t[23]!==b?(x=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[y,b]}),t[22]=y,t[23]=b,t[24]=x):x=t[24];let S;t[25]!==a||t[26]!==x||t[27]!==d||t[28]!==v?(S=(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:[p,v,x]}),t[25]=a,t[26]=x,t[27]=d,t[28]=v,t[29]=S):S=t[29];let C;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[30]=C):C=t[30];let w=`Node details: ${n.label}`,E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(T,{"aria-hidden":!0,className:`size-4`}),t[31]=E):E=t[31];let D;t[32]!==o||t[33]!==w?(D=(0,$.jsx)(`button`,{type:`button`,"aria-label":w,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:E}),t[32]=o,t[33]=w,t[34]=D):D=t[34];let O;return t[35]!==S||t[36]!==D?(O=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[S,C,D]}),t[35]=S,t[36]=D,t[37]=O):O=t[37],O}function er(){let e=(0,Q.c)(110),t=c(mr),n=c(pr),r=c(fr),i=c(dr),a=c(ur),s=c(lr),l=re(),u=m(),d=_e()===`phone`,f=j()?.kind===`nodes-enroll`,p=cr,[h,g]=(0,Z.useState)(null),[_,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=Ge(6e4),S,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{b.current?.focus({preventScroll:!0})},w=[],e[0]=S,e[1]=w):(S=e[0],w=e[1]),(0,Z.useEffect)(S,w);let T;e[2]===u?T=e[3]:(T=async e=>{z(e.id)||(await u({to:`/`,replace:!0}),await v.selectNode(e.id))},e[2]=u,e[3]=T);let E=T;if(f){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jt,{measure:`content`,children:(0,$.jsx)(sn,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,A,M,N,P,F,I,L,R,B,te,ne,V,H,U,W;if(e[5]!==a||e[6]!==r||e[7]!==h||e[8]!==i||e[9]!==d||e[10]!==t||e[11]!==x||e[12]!==_||e[13]!==l||e[14]!==E||e[15]!==s||e[16]!==n){let o=jt(t),c;e[35]!==h||e[36]!==t?(c=h===null?null:t.find(e=>e.id===h)??null,e[35]=h,e[36]=t,e[37]=c):c=e[37],A=c,P=a?.role===`owner`;let u=n===`ready`&&t.length===0;N=P&&!u;let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:sr,children:[(0,$.jsx)(ce,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let m;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:or,children:[(0,$.jsx)(ie,{"aria-hidden":!0}),` Sign out`]}),e[39]=m):m=e[39],I=m;let v=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,y,S;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>p(!0),S=(0,$.jsx)(oe,{"aria-hidden":!0}),e[40]=y,e[41]=S):(y=e[40],S=e[41]);let w;e[42]===v?w=e[43]:(w=(0,$.jsxs)(K,{className:v,onClick:y,children:[S,` Enroll node`]}),e[42]=v,e[43]=w),M=w;let T=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,j=n===`loading`,z;e[44]===n?z=e[45]:(z=n===`loading`?(0,$.jsx)(C,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(ae,{"aria-hidden":!0}),e[44]=n,e[45]=z);let ee;e[46]!==T||e[47]!==j||e[48]!==z?(ee=(0,$.jsxs)(K,{className:T,variant:`outline`,disabled:j,onClick:ar,children:[z,`Refresh nodes`]}),e[46]=T,e[47]=j,e[48]=z,e[49]=ee):ee=e[49],F=ee,O=Jt;let re;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:ir,children:(0,$.jsx)(ce,{"aria-hidden":!0})}),e[50]=re):re=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsxs)($.Fragment,{children:[re,(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:rr,children:(0,$.jsx)(ie,{"aria-hidden":!0})})]}),e[51]=R):R=e[51],D=Bt,B=b,te=t.length===1?`Your node`:`Your nodes`;let G=a?.displayName??`Hub account`,le;e[52]===a?le=e[53]:(le=a?` · ${a.role.charAt(0).toUpperCase()}${a.role.slice(1)}`:``,e[52]=a,e[53]=le);let q;e[54]!==G||e[55]!==le?(q=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,G,le]}),e[54]=G,e[55]=le,e[56]=q):q=e[56];let J;e[57]===t?J=e[58]:(J=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:Pt(t)}):null,e[57]=t,e[58]=J),e[59]!==q||e[60]!==J?(ne=(0,$.jsxs)($.Fragment,{children:[q,J]}),e[59]=q,e[60]=J,e[61]=ne):ne=e[61],e[62]!==M||e[63]!==N||e[64]!==d||e[65]!==F?(V=d?void 0:(0,$.jsxs)($.Fragment,{children:[F,N?M:null]}),e[62]=M,e[63]=N,e[64]=d,e[65]=F,e[66]=V):V=e[66],e[67]===n?H=e[68]:(H=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(be,{variant:`warning`,role:`status`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(ye,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=H),e[69]===_?U=e[70]:(U=_?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(be,{variant:`warning`,role:`status`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(ye,{children:_})]})}):null,e[69]=_,e[70]=U);let ue=n===`stale`?null:i;e[71]!==l||e[72]!==s||e[73]!==ue?(W=(0,$.jsx)(hr,{selection:s,routeNotice:l,error:ue}),e[71]=l,e[72]=s,e[73]=ue,e[74]=W):W=e[74],L=u?(0,$.jsx)(gr,{isOwner:P,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)($n,{node:e,nowMs:x,disabled:Ft({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(nr)}):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]=d,e[10]=t,e[11]=x,e[12]=_,e[13]=l,e[14]=E,e[15]=s,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=A,e[21]=M,e[22]=N,e[23]=P,e[24]=F,e[25]=I,e[26]=L,e[27]=R,e[28]=B,e[29]=te,e[30]=ne,e[31]=V,e[32]=H,e[33]=U,e[34]=W}else D=e[17],O=e[18],k=e[19],A=e[20],M=e[21],N=e[22],P=e[23],F=e[24],I=e[25],L=e[26],R=e[27],B=e[28],te=e[29],ne=e[30],V=e[31],H=e[32],U=e[33],W=e[34];let G,le;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Ye,{})}),le=(0,$.jsx)(ee,{}),e[75]=G,e[76]=le):(G=e[75],le=e[76]);let q;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(q=e=>{e||g(null)},e[77]=q):q=e[77];let J;e[78]===E?J=e[79]:(J=e=>void E(e),e[78]=E,e[79]=J);let ue;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(ue=async e=>{await o.revokeNode(e.id,ut),y(ht(e.label)),await v.refreshDirectory(),g(null)},e[80]=ue):ue=e[80];let de;e[81]!==r||e[82]!==A||e[83]!==P||e[84]!==n||e[85]!==J?(de=(0,$.jsx)(zt,{node:A,directoryStatus:n,browserStatus:r,canRename:P,canRevoke:P,onOpenChange:q,onConnect:J,onRename:tr,onRevoke:ue}),e[81]=r,e[82]=A,e[83]=P,e[84]=n,e[85]=J,e[86]=de):de=e[86];let fe;e[87]!==D||e[88]!==L||e[89]!==de||e[90]!==B||e[91]!==te||e[92]!==ne||e[93]!==V||e[94]!==H||e[95]!==U||e[96]!==W?(fe=(0,$.jsxs)(D,{titleRef:B,title:te,description:ne,actions:V,children:[H,U,W,L,G,le,de]}),e[87]=D,e[88]=L,e[89]=de,e[90]=B,e[91]=te,e[92]=ne,e[93]=V,e[94]=H,e[95]=U,e[96]=W,e[97]=fe):fe=e[97];let pe;e[98]!==k||e[99]!==M||e[100]!==N||e[101]!==d||e[102]!==F||e[103]!==I?(pe=d?(0,$.jsxs)(`div`,{className:`mt-auto ${Je}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,I]}),N?M:null,F]}):null,e[98]=k,e[99]=M,e[100]=N,e[101]=d,e[102]=F,e[103]=I,e[104]=pe):pe=e[104];let me;return e[105]!==O||e[106]!==R||e[107]!==fe||e[108]!==pe?(me=(0,$.jsxs)(O,{trailing:R,children:[fe,pe]}),e[105]=O,e[106]=R,e[107]=fe,e[108]=pe,e[109]=me):me=e[109],me}async function tr(e,t){await o.renameNode(e.id,t),await v.refreshDirectory()}function nr(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(ge,{className:`h-16 w-full rounded-xl`})},e)}function rr(){v.signOut()}function ir(){L({kind:`account`,section:`security`})}function ar(){v.refreshDirectory()}function or(){v.signOut()}function sr(){L({kind:`account`,section:`security`})}function cr(e){return L(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function lr(e){return e.selectionStatus}function ur(e){return e.account}function dr(e){return e.errorMessage}function fr(e){return e.browserStatus}function pr(e){return e.directoryStatus}function mr(e){return e.nodes}function hr(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)(se,{"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)(be,{variant:`error`,children:[o,(0,$.jsx)(ye,{children:a})]})}),t[1]=a,t[2]=s),s}function gr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Fe,{variant:`icon`,children:n?(0,$.jsx)(oe,{"aria-hidden":!0}):(0,$.jsx)(H,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Re,{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)(ze,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Ie,{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)(Le,{children:(0,$.jsxs)(K,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(oe,{"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)(Be,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Kn as HostedAuthenticationSurface,Dn as HostedHubRoot};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{dt as r,ft as i}from"./runtime-DRPzstwF.js";import{It as a}from"./composerDraftStore-czbuHgbM.js";import{Mt as o,Tt as s,n as c,r as l}from"./authorization-BrGZruGo.js";import{t as u}from"./shield-alert-DY9uVP5G.js";import{t as d}from"./shield-IZEIJ8r7.js";function f(e){return l(e)}function p(e){return c(e)}var m=n(),h=e(t(),1),g=()=>i().status;function _(){return(0,h.useSyncExternalStore)(r,g,g)}var v=()=>i().verificationCode;function y(){return(0,h.useSyncExternalStore)(r,v,v)}function b(e){let t=e.split(o.separator);if(t.length!==o.groups)return[];for(let e of t){if(e.length!==o.charsPerGroup)return[];for(let t of e)if(!`0123456789ABCDEFGHJKMNPQRSTVWXYZ`.includes(t))return[]}return t}o.chars*Math.log2(s.length);var x=`Compare this code with the one your node's CLI shows for this session. A match catches accidental wrong-node routing and some network interposition while the loaded code is honest; it cannot protect against the Hub operator, who serves this page, and it does not rule out someone sitting in the middle.`,S=`Settings → Security explains what else this tab cannot check.`,C=`Compare this code with the one your node's CLI shows for this session. A match catches accidental wrong-node routing and some network interposition while the loaded code is honest. This tab pins no node identity, so that comparison is the only thing that speaks to whether the far end is your machine or the Hub standing in for it — and it cannot protect against the Hub operator, who serves this page and could serve code that completes the same handshake and displays this same code anyway. A match does not rule out someone sitting in the middle.`,w="Run `ryco e2ee sessions` on the machine running the node to read its end of the comparison.",T=`No session code is available for this channel, so there is nothing here to compare against your node's CLI.`;function E(e){return e?`inline`:`settings`}var D={inline:{advisory:x,more:S},settings:{advisory:C,more:w}};Object.keys(D);function O(e,t){if(e===null)return null;let n=b(e);if(n.length===0)return null;let{advisory:r,more:i}=D[t];return{groups:n,display:n.join(o.separator),advisory:r,more:i}}var k={unavailable:{tone:`caution`,body:`Hosted connections reach your nodes through the Ryco Hub over WSS. No node channel is open in this tab, so the Hub still forwards what you send in a form it can read, and it is expected not to log or keep it.`},negotiating:{tone:`caution`,body:`This tab is still agreeing a channel with your node and has released nothing to it yet. Until that settles, treat this connection as one the Hub can read.`},"web-unsigned":{tone:`advisory`,body:`This tab and the node it was routed to agreed a browser channel, so while the code this page is running is honest the Hub relays ciphertext instead of readable payload. It is weaker than the channel the Ryco mobile app gets, in two ways this tab cannot close. This tab pins no node identity, so it cannot tell whether the far end of that channel is your machine or the Hub standing in for it. And it cannot protect against the Hub operator, who serves every byte of this page's JavaScript and could serve code that completes the same handshake and copies your data anyway. Its downgrade check is held in memory only — empty again in every new tab and after every reload, and worth nothing against that operator. Only your node can close the plaintext path for browsers.`},legacy:{tone:`caution`,body:`This channel fell back to legacy plaintext. This tab cannot tell whether your node offered no encrypted channel or something on the path removed the offer, so treat everything sent over it as readable by the Hub, which is expected not to log or keep it. Only your node can refuse plaintext for browsers.`}};function A(e){return k[e]}Object.keys(k);var j=a();function M(e){let t=(0,m.c)(13),{compact:n}=e,r=n!==void 0&&n,i=_(),a;t[0]===i?a=t[1]:(a=A(i),t[0]=i,t[1]=a);let{tone:o,body:s}=a,c=o===`advisory`?d:u,l=o===`advisory`?`text-sky-600`:`text-amber-600`,f=r?`flex gap-2 text-xs leading-relaxed text-muted-foreground`:`flex gap-2 rounded-lg border px-3 py-2.5 text-xs leading-relaxed text-muted-foreground ${o===`advisory`?`border-sky-500/25 bg-sky-500/5`:`border-amber-500/25 bg-amber-500/5`}`,p=`mt-0.5 size-4 shrink-0 ${l}`,h;t[2]!==c||t[3]!==p?(h=(0,j.jsx)(c,{"aria-hidden":!0,className:p}),t[2]=c,t[3]=p,t[4]=h):h=t[4];let g;t[5]===s?g=t[6]:(g=(0,j.jsx)(`p`,{children:s}),t[5]=s,t[6]=g);let v;return t[7]!==i||t[8]!==f||t[9]!==h||t[10]!==g||t[11]!==o?(v=(0,j.jsxs)(`div`,{className:f,"data-hosted-relay-trust-notice":`true`,"data-e2ee-status":i,"data-tone":o,children:[h,g]}),t[7]=i,t[8]=f,t[9]=h,t[10]=g,t[11]=o,t[12]=v):v=t[12],v}export{_ as a,f as c,O as i,T as n,y as o,E as r,p as s,M as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{n as r}from"./env-BZZxbmon.js";import{P as i,Zn as a}from"./runtime-DRPzstwF.js";import{D as o,E as s,N as c,O as l,P as u,S as d,_ as f,b as p,c as m,d as h,f as g,l as _,m as v,s as y,v as b,x,y as S}from"./primary-AnB-Zuft.js";import{It as C}from"./composerDraftStore-czbuHgbM.js";import{n as ee,t as te}from"./visibilityPolling-BwzZdaSN.js";import{jt as w}from"./authorization-BrGZruGo.js";import{t as ne}from"./copy-UQjKGt7t.js";import{t as T}from"./qr-code-ScYULAuR.js";import{t as re}from"./refresh-cw-DopCMrtR.js";import{t as ie}from"./triangle-alert-RL_T3KLo.js";import{t as ae}from"./switch-CIMwetO3.js";import{t as oe}from"./input-pu0UXdN_.js";import{t as E}from"./button-CBqaO2Ub.js";import{t as se}from"./useCopyToClipboard-BTpWxumf.js";import{i as ce,r as le,t as ue}from"./alert-DQjuri3D.js";import{a as de,c as fe,i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./dialog-Csp7hsmq.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./alert-dialog-Cb2TnXzy.js";import{t as D}from"./badge-Cil0isYQ.js";import{i as O,n as Ee,r as k}from"./settingsLayout-zwP6p5aD.js";import{a as A,i as j,n as M,o as N,s as P,t as F}from"./HostedRelayTrustNotice-Cl7lRwRJ.js";import{t as De}from"./qr-code-B6lBPRxy.js";var I=e(t(),1),L=n();function Oe(e){return e?`hosted`:`local`}function ke(e,t){return e===`local`?{headline:`Direct to a node on this machine`,body:`This window talks to a Ryco node running here, on this machine. No Ryco Hub sits between them and nothing you send leaves this machine on its way to the node.`}:{headline:t===null?`Through the Ryco Hub`:t.shortLabel,body:`This browser reaches a node through the Ryco Hub relay. What that channel is worth is stated with the channel itself, below.`}}function Ae(e){return e===`local`?{available:!0,unavailableBody:``}:{available:!1,unavailableBody:"Your node's client list, live sessions, admission policy, prekey and fallback counters are held on the node and read over its own local interface, which the relay does not carry. Open Ryco on that machine to see them, or run `ryco e2ee` there."}}function je(e){return e===`local`?{kind:`available`}:{kind:`blocked`,reason:"This one can only be changed from the node itself. It admits approved native client keys and closes browser and legacy access — including this browser, which is how you are reading this — so turning it on from here would end this session and leave no way back in through it. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node, where you can still reach it if the result is not what you wanted."}}var Me="This build cannot change whether the node admits only approved native client keys. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node.";function Ne(e,t){if(e===`hosted`&&t.requireApprovedClientE2EE!==void 0){let t=je(e);return{allowed:!1,refusal:t.kind===`blocked`?t.reason:Me}}return{allowed:!0,proposal:t}}function R(e){let t=e.split(w.separator);if(t.length!==w.groups)return[];for(let e of t){if(e.length!==w.digitsPerGroup)return[];for(let t of e)if(t<`0`||t>`9`)return[]}return t}var z=`${w.digits} digits, in ${w.groups} groups of ${w.digitsPerGroup}. The length and the grouping are the only check there is, so read all ${w.digits} in order.`,B=`Compare this with the number the device itself shows, on the device, before approving it. They match only for this key pair under this Hub account — the same device under a different account reads differently. Approve nothing whose number you have not read off the other screen yourself.`;function Pe(e){let t=R(e);return t.length===0?null:{groups:t,display:t.join(w.separator),caption:z,advisory:B}}var V=`No comparison number is readable for this record, so there is nothing here to check against the device.`;function Fe(e){return e===null?{available:!1,fingerprint:null,caption:"This node's identity fingerprint is shown here only while an enrollment is waiting for approval. At other times, read it from the node with `ryco hub status` on the machine running it."}:{available:!0,fingerprint:e,caption:`This node's identity fingerprint, from the enrollment now waiting for approval. Compare it character for character wherever you are asked to confirm this machine.`}}var H=`unknown`;function U(e){if(e===void 0)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?H:t.toLocaleString()}function Ie(e){return e===null?[{label:`Agreement prekey`,value:H}]:e.present?[{label:`Prekey`,value:e.prekeyId??H,mono:!0},{label:`Fingerprint`,value:e.fingerprint??H,mono:!0},{label:`Validity`,value:e.validity??H},{label:`Created`,value:U(e.createdAt)},{label:`Expires`,value:U(e.expiresAt)}]:[{label:`Agreement prekey`,value:`none held`}]}function Le(e){return e===null?null:e.present?e.remedy??null:`This node holds no agreement prekey for its Hub origin. It re-signs one at startup; rotate to issue one now.`}function Re(e){return e===null?[{label:`Continuity`,value:H}]:e.status===`unavailable`?[{label:`Continuity`,value:`unresolvable`},{label:`Reason`,value:e.reason??H}]:[{label:`Continuity`,value:`advertisable`},{label:`Lineage`,value:e.continuityId??H,mono:!0},{label:`Rotation generation`,value:String(e.generation??0)},{label:`Retained chain length`,value:String(e.chainLength??0)},...e.repair===void 0?[]:[{label:`Startup repair`,value:e.repair}],...e.lastBreakReason===void 0?[]:[{label:`Last break`,value:`${e.lastBreakReason} at ${U(e.lastBreakAt)}`}]]}function ze(e){return e?.remedy??null}function W(e){switch(e){case`pending`:return`warning`;case`approved`:return`success`;case`revoked`:return`error`}}function G(e){let t=e.displayLabel?.trim()??``;return t===``?`Client key …${e.fingerprint.slice(-8)}`:t}function K(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Hub origin`,value:e.hubOrigin},{label:`Account`,value:e.accountId},{label:`Maximum role`,value:e.maxRole===``?`none granted`:e.maxRole},{label:`Capabilities`,value:e.capabilitySet.length===0?`none`:e.capabilitySet.join(`, `)},{label:`Created`,value:U(e.createdAt)},...e.approvedAt===void 0?[]:[{label:`Approved`,value:U(e.approvedAt)}],...e.revokedAt===void 0?[]:[{label:`Revoked`,value:U(e.revokedAt)}],{label:`Last seen`,value:U(e.lastSeenAt)},...e.pairingReserved?[{label:`Pairing reservation`,value:`held`}]:[]]}function Be(e){if(e===null)return[];let t=[];return(e.pendingGlobalSaturated||e.saturatedAccounts.length>0)&&t.push(`Pending pairing is saturated, so a new device may not be able to introduce itself. Purge a pending record, or read the fingerprint off the device and open a pairing window naming it.`),e.refusedPairingAttempts>0&&t.push(`${e.refusedPairingAttempts} pairing attempt(s) were refused because the pending list was full. Clear the count once you have dealt with them, or later readings will be dominated by history.`),t}function Ve(e){if(e===null)return[{label:`Pairing window`,value:H}];let t=e.pairingWindow;return t===void 0?[{label:`Pairing window`,value:`closed`}]:[{label:`Pairing window`,value:`open`},{label:`Only this fingerprint`,value:t.fingerprint,mono:!0},{label:`Expires`,value:U(t.expiresAt)},{label:`Reservation`,value:t.spent?`spent`:`unspent`}]}function He(e){return e===null?`How many pairing attempts this node refused because the pending list was full has not been read here.`:`${e.refusedPairingAttempts} attempt(s) refused because the pending list was full.`}var Ue=`A window lets exactly one device introduce itself, and only the one whose fingerprint you name.`;function We(e){return[{label:`Tier`,value:e.tier===`native`?`native (IK)`:`browser (NX)`},{label:`Suite`,value:String(e.suite)},{label:`Established`,value:U(e.establishedAt)}]}var Ge=`Native sessions have no per-session code. Compare this device's long-term number on its record above instead.`,Ke=`Compare this code with the one that browser is showing for this session, on that screen. A match catches accidental wrong-node routing and some network interposition — anyone standing in for this node who is not also serving that browser its page — while the code that browser loaded is honest; it cannot protect against whoever served that page, and a match does not rule out someone sitting in the middle.`,qe=`No session code reached this listing for that channel, so there is nothing here to compare against the browser holding it.`;function Je(e){let t=j(e,`inline`);return t===null?null:{groups:t.groups,display:t.display,advisory:Ke,more:null}}var Ye=`A browser channel this node has open. Its per-session code is below.`;function Xe(e){return e===null?[{label:`Admission policy`,value:H}]:[{label:`requireE2EE`,value:String(e.requireE2EE),mono:!0},{label:`requireApprovedClientE2EE`,value:String(e.requireApprovedClientE2EE),mono:!0},{label:`Effective requireE2EE`,value:String(e.effectiveRequireE2EE),mono:!0},{label:`Admitted patterns`,value:e.admittedPatterns.join(`, `)||`none`},{label:`Suite registry`,value:e.suiteRegistry.join(`, `)||`none`},{label:`Policy generation`,value:String(e.generation)}]}function Ze(e,t,n){let r=[];t.requireApprovedClientE2EE===!0&&r.push(`requireApprovedClientE2EE closes browser and legacy access entirely. Only approved native client keys reach application payload after this, and losing every approved key strands remote access to this node until someone recovers it at the machine — which never relaxes admission policy.`);for(let e of Qe(t,n))r.push(e);return e.withdrawal&&r.push(`This narrows what the node admits, so it closes live channels. Roughly matching now: ${e.counts.legacy} legacy, ${e.counts.nxE2ee} browser, ${e.counts.suiteWithdrawn} on a withdrawn suite, and ${e.counts.abortedHandshakes} handshake(s) in flight. These move while you read them.`),e.changed||r.push(`This changes nothing: the node already admits exactly this.`),r.length===0&&r.push(q),r}function Qe(e,t){let n=[];return e.requireE2EE===!1&&t?.requireE2EE!==!1&&n.push(`Turning this off re-admits plaintext. The node goes back to accepting relay payload it has not encrypted, for browsers and for legacy clients, and the Hub carries that in a form it can read. It closes nothing now — what changes is what the node accepts next.`),e.requireApprovedClientE2EE===!1&&t?.requireApprovedClientE2EE!==!1&&n.push(`Clearing this re-admits the browser and legacy tiers. Client keys this node has not approved reach it again on their next connection, under whatever the remaining policy allows.`),n}var q=`The node reports that this closes no channel it has open now. That is a statement about the live channels and not about what the node will admit afterwards.`;function $e(e,t,n){return e.withdrawal||Qe(t,n).length>0}function et(e){return[e.changed?`Policy committed.`:`Policy unchanged.`,`Closed ${e.counts.legacy} legacy channel(s), ${e.counts.nxE2ee} browser channel(s), ${e.counts.suiteWithdrawn} suite-withdrawn channel(s); aborted ${e.counts.abortedHandshakes} handshake(s) in flight.`].join(` `)}var J=`This advances the policy generation past every value this node may already have advertised, and the jump is deliberate. Clients accept only a higher generation than the one they remember, so nothing below the new value can be advertised again. If a restore rolled the record back, recovery does not restore the old values: it commits the fail-closed policy, which admits only approved native client keys and so closes browser and legacy access entirely, including every remote browser session open now. There is no way to tell from here which of the two this will be. Widening it back is a separate, explicit policy change, and if this node's only remaining access was a browser it has to be made at the machine.`;function tt(e){if(e===null)return null;let t=e.peerLegacy.ringOverflows>0||e.advertisementUnavailable.ringOverflows>0;return{windowStarted:U(e.windowStartedAt),classes:[{label:`Peer spoke legacy`,meaning:`The other end did not take the encrypted channel, so this one carried readable payload.`,occurrences:e.peerLegacy.occurrences,lastOccurrence:U(e.peerLegacy.lastOccurrenceAt),ringOverflows:e.peerLegacy.ringOverflows},{label:`No advertisement`,meaning:`This node could not offer an encrypted channel, or the offer did not survive the path. It cannot tell which.`,occurrences:e.advertisementUnavailable.occurrences,lastOccurrence:U(e.advertisementUnavailable.lastOccurrenceAt),ringOverflows:e.advertisementUnavailable.ringOverflows}],entries:[...e.ring].toSorted((e,t)=>e.occurredAt-t.occurredAt).map((e,t)=>({ordinal:t,at:U(e.occurredAt),reason:e.reason})),overflowNotice:t?`The retained list overflowed, so it is an incomplete account of this window. The shape of what is left is not evidence in either direction.`:null,undersizedNotice:e.undersizedConnection===void 0?null:`This connection asserts a maximum chunk of ${e.undersizedConnection.assertedMaxDataChunkBytes} bytes, below the ${e.undersizedConnection.advertisementMinChunkBytes} bytes an offer needs. Nothing that fits can carry one, so this node offers nothing on this connection.`,quiet:e.peerLegacy.occurrences===0&&e.advertisementUnavailable.occurrences===0&&e.ring.length===0}}var nt=`Nothing has fallen back in this window. This counts what happened, not what could — a quiet window is not a statement about the next one.`,Y={approve:{title:`Approve this client key?`,body:`The device holding this key may then reach this node, up to the role and capabilities you grant here. Compare its number against the device first. It takes effect on its next connection, not on anything open now.`,confirmLabel:`Approve key`,destructive:!1},narrow:{title:`Reduce what this client may do?`,body:`Anything this device has open under the wider authority closes immediately — the node will not confirm the change until those channels are shut. The device reconnects with the smaller role ceiling. Its capability grant is left exactly as it is; only the ceiling drops, and changing the capabilities is a separate command on the node.`,confirmLabel:`Reduce authority`,destructive:!0},revoke:{title:`Revoke this client key?`,body:`The device loses access now: every channel it has open closes before this is confirmed, and it cannot reconnect until you approve it again. The record stays, so you can see it was revoked.`,confirmLabel:`Revoke key`,destructive:!0},purge:{title:`Delete this client record?`,body:`The same immediate disconnection as revoking, and the record goes with it — there will be nothing left showing this device was ever here. If it connects again it arrives as a stranger and pairs from scratch.`,confirmLabel:`Delete record`,destructive:!0},"open-window":{title:`Open a pairing window for this fingerprint?`,body:`For a short time this node will accept one introduction, and only from the key whose fingerprint you name. Read that fingerprint off the device itself — a window naming the wrong one lets the wrong device in.`,confirmLabel:`Open window`,destructive:!1},"close-window":{title:`Close the pairing window?`,body:`No new device can introduce itself until you open another. Anything already introduced keeps its record.`,confirmLabel:`Close window`,destructive:!1},"clear-refusals":{title:`Clear the refused-attempt count?`,body:`The count goes back to zero. Do this once you have dealt with what caused it, so the next reading is about the next thing rather than about history.`,confirmLabel:`Clear count`,destructive:!1},"rotate-prekey":{title:`Issue a new agreement prekey?`,body:`The node makes a fresh key pair and certificate immediately. Clients pick the new one up on their next connection; nothing already open is disturbed.`,confirmLabel:`Rotate prekey`,destructive:!1},"recover-policy":{title:`Advance the policy generation?`,body:J,confirmLabel:`Advance generation`,destructive:!0},"reset-fallback":{title:`Reset the fallback counters?`,body:`Both counts and the retained list go back to empty and a new observation window starts. What was recorded is gone; nothing else changes.`,confirmLabel:`Reset counters`,destructive:!1},"remint-continuity":{title:`Break continuity and mint a fresh lineage?`,body:`Every device that has paired with this node has to go through the whole pairing ceremony again, in person, before it can reconnect. Do this when you believe the lineage is wrong, not to tidy it up.`,confirmLabel:`Mint fresh lineage`,destructive:!0},"break-continuity":{title:`Break the continuity chain?`,body:`The lineage keeps its name, but every device that pinned this node has to go through the pairing ceremony again before it can reconnect.`,confirmLabel:`Break chain`,destructive:!0}};function rt(e){return Y[e]}var it=`It applies to the key below and to no other. Check the fingerprint against the device you meant: two devices paired under one account are told apart by nothing else here.`;function X(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Account`,value:e.accountId},{label:`Hub origin`,value:e.hubOrigin}]}function at(e,t){let n=Y[e];return{...n,body:`${n.body} ${it}`,facts:X(t)}}function ot(e){let t=Y[`open-window`];return{...t,body:`${t.body} Read the value below off the device now, before confirming.`,facts:[{label:`Only this fingerprint`,value:e,mono:!0}]}}var Z=[`viewer`,`operator`,`owner`],st={viewer:`read what is there`,operator:`edit files and run terminals`,owner:`also change credentials and server policy`},ct=[`ryco.rpc`];function lt(e,t){let n=Y.approve,r=ct.join(`, `);return{title:`Approve this client key as ${e}?`,body:`${n.body} At most it will be able to ${st[e]}. It is granted the one capability a relay channel carries, ${r} — a key approved with none is admitted by nothing and could not connect at all. `+`${t===void 0?``:it}`.trimEnd(),confirmLabel:`Approve as ${e}`,destructive:!1,...t===void 0?{}:{facts:X(t)}}}Object.keys(Y);var ut=`What this node will admit, and which client keys it has on file.`,dt=`Require an encrypted channel`,ft=`Refuse plaintext, including for browsers.`,pt=`Only approved native client keys`,mt=`Closes browser and legacy access entirely. Only approved native client keys reach application payload.`,ht=`Recover a generation that a restore rolled back.`,gt=`Its current value on the node has not been read here, so nothing on this row states what it is.`,_t=`No device has introduced itself to this node yet.`,vt=`Nothing is connected right now.`,Q=C(),yt=5e3,bt=6e4,xt={clients:null,sessions:null,policy:null,prekey:null,continuity:null,fallback:null,enrollmentFingerprint:null};function $(e){let t=(0,L.c)(4),{rows:n}=e,r;t[0]===n?r=t[1]:(r=n.map(St),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1.5 sm:grid-cols-[12rem_minmax(0,1fr)]`,children:r}),t[2]=r,t[3]=i),i}function St(e){return(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:e.mono?`min-w-0 font-mono text-[12px] break-all text-foreground`:`min-w-0 text-[12px] text-foreground`,children:e.value})]},e.label)}function Ct(e){let t=(0,L.c)(14),{value:n}=e,r;t[0]===n?r=t[1]:(r=Pe(n),t[0]=n,t[1]=r);let i=r;if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number`,"data-value":`absent`,className:`text-[11px] text-muted-foreground`,children:V}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Comparison number`}),t[3]=a):a=t[3];let o;t[4]===i.display?o=t[5]:(o=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number-value`,className:`font-mono text-[13px] leading-relaxed font-semibold tracking-[0.08em] select-all`,children:i.display}),t[4]=i.display,t[5]=o);let s;t[6]===i.caption?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.caption}),t[6]=i.caption,t[7]=s);let c;t[8]===i.advisory?c=t[9]:(c=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.advisory}),t[8]=i.advisory,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Q.jsxs)(`div`,{"data-testid":`node-safety-number`,"data-value":`present`,className:`space-y-1.5`,children:[a,o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function wt(e){let t=(0,L.c)(15),{view:n,unavailable:r,testId:i}=e;if(!n){let e;return t[0]!==i||t[1]!==r?(e=(0,Q.jsx)(`p`,{"data-testid":i,"data-code":`absent`,className:`text-[11px] text-muted-foreground`,children:r}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let a=`${i}-value`,o;t[3]!==a||t[4]!==n.display?(o=(0,Q.jsx)(`p`,{"data-testid":a,className:`font-mono text-sm leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:n.display}),t[3]=a,t[4]=n.display,t[5]=o):o=t[5];let s;t[6]===n.advisory?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.advisory}),t[6]=n.advisory,t[7]=s);let c;t[8]===n.more?c=t[9]:(c=n.more===null?null:(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.more}),t[8]=n.more,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==i?(l=(0,Q.jsxs)(`div`,{"data-testid":i,"data-code":`present`,className:`space-y-1.5`,children:[o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=i,t[14]=l):l=t[14],l}function Tt(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=j(n,`settings`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(wt,{view:r,unavailable:M,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Et(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=Je(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(wt,{view:r,unavailable:qe,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Dt(){let e=(0,L.c)(21),t=A(),n=N(),r=i(jt),a=i(At),o=i(kt),s=i(Ot),c,l;e[0]!==r||e[1]!==t||e[2]!==o||e[3]!==a||e[4]!==s?(c=P({browserStatus:r,sessionStatus:a,selectionStatus:o,transportStatus:s,e2eeStatus:t}),l=ke(`hosted`,c),e[0]=r,e[1]=t,e[2]=o,e[3]=a,e[4]=s,e[5]=c,e[6]=l):(c=e[5],l=e[6]);let u=l,d=c.guarantee===`e2ee`?`success`:c.guarantee===`web`?`info`:c.guarantee===`legacy`?`warning`:`outline`,f;e[7]!==c.shortLabel||e[8]!==d?(f=(0,Q.jsx)(D,{size:`sm`,variant:d,"data-testid":`node-connection-claim`,children:c.shortLabel}),e[7]=c.shortLabel,e[8]=d,e[9]=f):f=e[9];let p;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(F,{}),e[10]=p):p=e[10];let m;e[11]!==t||e[12]!==n?(m=t===`web-unsigned`?(0,Q.jsx)(Tt,{code:n}):null,e[11]=t,e[12]=n,e[13]=m):m=e[13];let h;e[14]===m?h=e[15]:(h=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[p,m]}),e[14]=m,e[15]=h);let g;return e[16]!==u.body||e[17]!==u.headline||e[18]!==f||e[19]!==h?(g=(0,Q.jsx)(O,{title:`This connection`,children:(0,Q.jsx)(k,{title:u.headline,description:u.body,status:f,children:h})}),e[16]=u.body,e[17]=u.headline,e[18]=f,e[19]=h,e[20]=g):g=e[20],g}function Ot(e){return e.transportStatus}function kt(e){return e.selectionStatus}function At(e){return e.sessionStatus}function jt(e){return e.browserStatus}function Mt(){let e=Oe(r()),t=Ae(e),n=je(e),[i,a]=(0,I.useState)(xt),[l,C]=(0,I.useState)(null),[w,T]=(0,I.useState)(!1),[ae,D]=(0,I.useState)(null),[A,j]=(0,I.useState)(null),[M,N]=(0,I.useState)(null),[P,F]=(0,I.useState)(null),[L,Me]=(0,I.useState)(``),R=(0,I.useRef)(!0),z=(0,I.useRef)(0),B=(0,I.useRef)(null),{copyToClipboard:Pe}=se();(0,I.useEffect)(()=>(R.current=!0,()=>{R.current=!1}),[]);let V=(0,I.useCallback)(async()=>{if(t.available)try{let[e,t,n,r,i,o]=await Promise.all([f(),d(),p(),x(),b(),S()]),s=await v().catch(()=>null);if(!R.current)return;z.current=0,a({clients:e,sessions:t,policy:n,prekey:r,continuity:i,fallback:o,enrollmentFingerprint:s?.fingerprint??null}),C(null)}catch(e){if(!R.current)return;z.current+=1,C(e instanceof Error?e.message:`Unable to read the node's security state.`)}},[t.available]);(0,I.useEffect)(()=>{if(!t.available)return;let e=te({lifecycle:ee,run:V,resolveDelayMs:()=>Math.min(yt*2**Math.max(0,z.current-1),bt),jitterRatio:.1});return B.current=e,()=>{B.current===e&&(B.current=null),e.stop()}},[t.available,V]);let H=(0,I.useCallback)(()=>B.current?.refresh()??V(),[V]),U=(0,I.useCallback)(async(e,t)=>{T(!0),C(null),D(null);try{let n=await e();R.current&&D(typeof n==`string`?n:t),await H()}catch(e){if(!R.current)return;C(e instanceof Error?e.message:`That didn't work.`)}finally{R.current&&T(!1)}},[H]),W=(0,I.useCallback)((e,t,n)=>{N({copy:rt(e),run:()=>U(t,n)})},[U]),G=(0,I.useCallback)((e,t,n)=>{N({copy:e,run:()=>U(t,n)})},[U]),K=(0,I.useCallback)(async t=>{let n=Ne(e,t);if(!n.allowed){C(n.refusal);return}T(!0),C(null),D(null);try{let e=await s(n.proposal);if(!R.current)return;j({proposal:n.proposal,warnings:Ze(e,n.proposal,i.policy),destructive:$e(e,n.proposal,i.policy)})}catch(e){if(!R.current)return;C(e instanceof Error?e.message:`Unable to preview that change.`)}finally{R.current&&T(!1)}},[e,i.policy]),Ke=(0,I.useCallback)(async()=>{if(A===null)return;let t=Ne(e,A.proposal);if(!t.allowed){C(t.refusal),j(null);return}let n=t.proposal;j(null),await U(async()=>et(await _(n)),`Policy applied.`)},[e,A,U]),qe=(0,I.useCallback)((e,t,n)=>{let r={fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin};G(at(t,r),()=>y(e),n)},[G]),Je=(0,I.useCallback)((e,t)=>{N({copy:lt(t,{fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin}),run:()=>U(async()=>{await y(e);try{let n=await g({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});return R.current&&F({approval:n,label:e.fingerprint}),`Client approved as ${t}. Scan the code on the new device.`}catch{return`Client approved as ${t}. The QR code was not created; use Show phone QR to retry.`}},`Client approved as ${t}.`)})},[U]),Qe=(0,I.useCallback)(async e=>{T(!0),C(null);try{let t=await g({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});R.current&&F({approval:t,label:e.displayLabel??e.fingerprint})}catch(e){R.current&&C(e instanceof Error?e.message:`Unable to create the phone QR code.`)}finally{R.current&&T(!1)}},[]),q=Fe(i.enrollmentFingerprint),J=(0,I.useMemo)(()=>tt(i.fallback),[i.fallback]),Y=Be(i.clients),it=Le(i.prekey),X=ze(i.continuity),Z=M?.copy??null,st=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;return(0,Q.jsxs)(Ee,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Security`}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:ut})]}),t.available?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:w,onClick:()=>void H(),children:[(0,Q.jsx)(re,{className:`size-3.5`}),`Refresh`]}):null]}),l===null?null:(0,Q.jsxs)(ue,{variant:`error`,children:[(0,Q.jsx)(ie,{}),(0,Q.jsx)(ce,{children:`That didn't work`}),(0,Q.jsx)(le,{children:l})]}),ae?(0,Q.jsxs)(ue,{variant:`info`,children:[(0,Q.jsx)(ce,{children:`Done`}),(0,Q.jsx)(le,{children:ae})]}):null,e===`hosted`?(0,Q.jsx)(Dt,{}):null,t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(O,{title:`This node's identity`,children:[(0,Q.jsx)(k,{title:`Enrollment fingerprint`,description:q.caption,control:q.fingerprint!==null&&st?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,onClick:()=>Pe(q.fingerprint),children:[(0,Q.jsx)(ne,{className:`size-3.5`}),`Copy`]}):null,children:q.fingerprint===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-enrollment-fingerprint`,className:`pb-3.5 font-mono text-[13px] break-all select-all`,children:q.fingerprint})}),(0,Q.jsx)(k,{title:`Agreement prekey`,description:it??`The key this node offers for new channels.`,control:(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w,onClick:()=>W(`rotate-prekey`,c,`Prekey rotated.`),children:`Rotate`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Ie(i.prekey)})})}),(0,Q.jsx)(k,{title:`Continuity`,description:X??`The lineage paired clients remember this node by.`,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`break-continuity`,()=>m({action:`break`}),`Continuity chain broken.`),children:`Break chain`}),(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`remint-continuity`,()=>m({action:`remint`}),`Fresh lineage minted.`),children:`Mint fresh`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Re(i.continuity)})})})]}),(0,Q.jsxs)(O,{title:`Authorized clients`,children:[Y.map(e=>(0,Q.jsx)(k,{title:`Pairing`,description:e},e)),(0,Q.jsx)(k,{title:`Pairing window`,description:Ue,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(oe,{value:L,disabled:w,placeholder:`SHA256:…`,"aria-label":`Pairing window fingerprint`,className:`w-56 font-mono text-xs`,onChange:e=>Me(e.currentTarget.value)}),(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||L.trim()===``,onClick:()=>G(ot(L.trim()),()=>u({action:`open`,fingerprint:L.trim()}),`Pairing window opened.`),children:`Open`}),(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||i.clients?.pairingWindow===void 0,onClick:()=>W(`close-window`,()=>u({action:`close`}),`Pairing window closed.`),children:`Close`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Ve(i.clients)})})}),(0,Q.jsx)(k,{title:`Refused attempts`,description:He(i.clients),control:(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||(i.clients?.refusedPairingAttempts??0)===0,onClick:()=>W(`clear-refusals`,h,`Refusal count cleared.`),children:`Clear`})}),(i.clients?.records??[]).map(e=>(0,Q.jsx)(Lt,{record:e,busy:w,onAuthorize:qe,onApprove:Je,onShowApprovalQr:Qe},`${e.hubOrigin}\u0000${e.accountId}\u0000${e.fingerprint}`)),i.clients!==null&&i.clients.records.length===0?(0,Q.jsx)(k,{title:`No client keys on file`,description:_t}):null]}),(0,Q.jsxs)(O,{title:`Live sessions`,children:[(i.sessions?.sessions??[]).map(e=>(0,Q.jsx)(k,{title:`Session ${e.sessionIndex}`,description:e.tier===`native`?Ge:Ye,children:(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[(0,Q.jsx)($,{rows:We(e)}),e.tier===`web`?(0,Q.jsx)(Et,{code:e.verificationCode??null}):null]})},e.sessionIndex)),i.sessions!==null&&i.sessions.sessions.length===0?(0,Q.jsx)(k,{title:`No sessions`,description:vt}):null]}),(0,Q.jsxs)(O,{title:`Admission policy`,children:[(0,Q.jsx)(Ft,{title:dt,description:ft,checked:i.policy===null?null:i.policy.requireE2EE,busy:w,ariaLabel:`Require E2EE`,testId:`require-e2ee`,onChange:e=>void K({requireE2EE:e})}),(0,Q.jsx)(Pt,{disposition:n,checked:i.policy===null?null:i.policy.requireApprovedClientE2EE,busy:w,onChange:e=>void K({requireApprovedClientE2EE:e})}),(0,Q.jsx)(k,{title:`Policy generation`,description:ht,control:(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`recover-policy`,o,`Policy generation advanced.`),children:`Advance`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Xe(i.policy)})})})]}),(0,Q.jsx)(O,{title:`Fallback`,children:J===null?(0,Q.jsx)(k,{title:`Fallback`,description:`Waiting for the node.`}):J.quiet?(0,Q.jsx)(k,{title:`Nothing has fallen back`,description:nt,control:(0,Q.jsx)(It,{busy:w,onConfirm:W})}):(0,Q.jsxs)(Q.Fragment,{children:[J.classes.map(e=>(0,Q.jsx)(k,{title:e.label,description:e.meaning,status:`Last ${e.lastOccurrence}${e.ringOverflows>0?` · ${e.ringOverflows} overflow(s)`:``}`,control:(0,Q.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.occurrences})},e.label)),(0,Q.jsx)(k,{title:`Retained occurrences`,description:J.overflowNotice??`Observation window started ${J.windowStarted}.`,control:(0,Q.jsx)(It,{busy:w,onConfirm:W}),children:(0,Q.jsx)(`ul`,{className:`space-y-1 pb-3.5`,children:J.entries.map(e=>(0,Q.jsxs)(`li`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.at,` · `,e.reason]},e.ordinal))})}),J.undersizedNotice?(0,Q.jsx)(k,{title:`Undersized connection`,description:J.undersizedNotice}):null]})})]}):(0,Q.jsxs)(O,{title:`This node`,children:[(0,Q.jsx)(k,{title:ke(e,null).headline,description:t.unavailableBody}),(0,Q.jsx)(Pt,{disposition:n,checked:null,busy:w,onChange:e=>void K({requireApprovedClientE2EE:e})})]}),(0,Q.jsx)(Te,{open:A!==null,onOpenChange:e=>!e&&j(null),children:(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(we,{children:`Apply this policy change?`}),(0,Q.jsx)(Ce,{children:A?.warnings.map(e=>(0,Q.jsx)(`span`,{className:`block pb-2`,children:e},e))})]}),(0,Q.jsxs)(be,{children:[(0,Q.jsx)(xe,{children:`Leave it`}),(0,Q.jsx)(E,{variant:A?.destructive?`destructive`:`default`,"data-testid":`policy-apply`,disabled:w,onClick:()=>void Ke(),children:`Apply`})]})]})}),(0,Q.jsx)(Te,{open:M!==null,onOpenChange:e=>!e&&N(null),children:(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(we,{children:Z?.title}),(0,Q.jsx)(Ce,{children:Z?.body})]}),Z?.facts?(0,Q.jsx)(`div`,{"data-testid":`node-confirmation-facts`,className:`pb-1`,children:(0,Q.jsx)($,{rows:Z.facts})}):null,(0,Q.jsxs)(be,{children:[(0,Q.jsx)(xe,{children:`Cancel`}),(0,Q.jsx)(E,{variant:Z?.destructive?`destructive`:`default`,"data-testid":`node-confirmation-confirm`,disabled:w,onClick:()=>{let e=M;N(null),e&&e.run()},children:Z?.confirmLabel})]})]})}),(0,Q.jsx)(ve,{open:P!==null,onOpenChange:e=>!e&&F(null),children:(0,Q.jsxs)(_e,{className:`max-w-sm`,children:[(0,Q.jsxs)(de,{children:[(0,Q.jsx)(fe,{children:`Verify this phone`}),(0,Q.jsx)(ge,{children:`On the new phone, open node verification and scan this code. It is bound to that phone's key and expires after five minutes.`})]}),(0,Q.jsxs)(he,{className:`space-y-4`,children:[P?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`rounded-2xl bg-white p-3`,children:(0,Q.jsx)(De,{value:P.approval.payload,size:240,level:`M`,marginSize:2,title:`Node approval — scan with Ryco on the new phone`})}),(0,Q.jsx)(`p`,{className:`max-w-full break-all text-center font-mono text-[11px] text-muted-foreground`,children:P.label})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`The code contains no secret and grants no access by itself. Ryco will reconnect and prove both device keys after the scan.`})]}),(0,Q.jsx)(pe,{variant:`bare`,children:(0,Q.jsx)(me,{render:(0,Q.jsx)(E,{variant:`outline`}),children:`Done`})})]})})]})}function Nt(){let e=(0,L.c)(7),t=a();if(t&&!t.primary){let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(ie,{}),e[0]=n):n=e[0];let r;e[1]===t.nodeLabel?r=e[2]:(r=(0,Q.jsxs)(ce,{children:[`Open Security on `,t.nodeLabel]}),e[1]=t.nodeLabel,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(le,{children:`Security administration requires that node's direct local operator channel. Ryco has disabled these controls here so an action can never be applied to this Mac by mistake.`}),e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a=(0,Q.jsx)(Ee,{children:(0,Q.jsxs)(ue,{variant:`warning`,children:[n,r,i]})}),e[4]=r,e[5]=a),a}let n;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Mt,{}),e[6]=n):n=e[6],n}function Pt(e){let t=(0,L.c)(6),{disposition:n,checked:r,busy:i,onChange:a}=e,o=n.kind===`blocked`,s=n.kind===`blocked`?n.reason:mt,c;return t[0]!==o||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==s?(c=(0,Q.jsx)(Ft,{title:pt,description:s,checked:r,busy:i,blocked:o,ariaLabel:`Require approved client E2EE`,testId:`require-approved-client-e2ee`,onChange:a}),t[0]=o,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c):c=t[5],c}function Ft(e){let t=(0,L.c)(11),{title:n,description:r,checked:i,busy:a,blocked:o,ariaLabel:s,testId:c,onChange:l}=e,u=o!==void 0&&o,d=i===null?`${r} ${gt}`:r,f;t[0]!==s||t[1]!==u||t[2]!==a||t[3]!==i||t[4]!==l||t[5]!==c?(f=i===null?(0,Q.jsx)(`span`,{"data-testid":c,"data-policy":`unknown`,"data-blocked":u?`hosted`:void 0,className:`text-[11px] text-muted-foreground`,children:`unknown`}):(0,Q.jsx)(ae,{checked:i,disabled:u||a,"aria-label":s,"data-testid":c,"data-policy":String(i),"data-blocked":u?`hosted`:void 0,onCheckedChange:l}),t[0]=s,t[1]=u,t[2]=a,t[3]=i,t[4]=l,t[5]=c,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,Q.jsx)(k,{title:n,description:d,control:f}),t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10],p}function It(e){let t=(0,L.c)(5),{busy:n,onConfirm:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`reset-fallback`,l,`Fallback counters reset.`),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:n,onClick:i,children:`Reset`}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function Lt(e){let t=(0,L.c)(60),{record:n,busy:r,onAuthorize:i,onApprove:a,onShowApprovalQr:o}=e,s,c,l,u,d;if(t[0]!==r||t[1]!==a||t[2]!==n){c={hubOrigin:n.hubOrigin,accountId:n.accountId,fingerprint:n.fingerprint};let e;t[8]===n.status?e=t[9]:(e=W(n.status),t[8]=n.status,t[9]=e);let i=e;s=k;let o;t[10]===n?o=t[11]:(o=G(n),t[10]=n,t[11]=o);let f=i===`success`?`success`:i,p;t[12]!==n.status||t[13]!==f?(p=(0,Q.jsx)(D,{size:`sm`,variant:f,children:n.status}),t[12]=n.status,t[13]=f,t[14]=p):p=t[14],t[15]!==o||t[16]!==p?(u=(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o,p]}),t[15]=o,t[16]=p,t[17]=u):u=t[17],d=`${n.accountId} at ${n.hubOrigin}`,l=n.status===`approved`?null:Z.map(e=>(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>a({...c,action:`approve`,maxRole:e,capabilitySet:ct},e),children:[`Approve as `,e]},e)),t[0]=r,t[1]=a,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7];let f;t[18]!==r||t[19]!==c||t[20]!==i||t[21]!==n.maxRole||t[22]!==n.status?(f=n.status===`approved`&&n.maxRole!==`viewer`?(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`narrow`,maxRole:`viewer`},`narrow`,`Authority reduced.`),children:`Reduce to viewer`}):null,t[18]=r,t[19]=c,t[20]=i,t[21]=n.maxRole,t[22]=n.status,t[23]=f):f=t[23];let p;t[24]!==r||t[25]!==o||t[26]!==n?(p=n.status===`approved`?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(n),children:[(0,Q.jsx)(T,{className:`size-3.5`}),`Show phone QR`]}):null,t[24]=r,t[25]=o,t[26]=n,t[27]=p):p=t[27];let m;t[28]!==r||t[29]!==c||t[30]!==i||t[31]!==n.status?(m=n.status===`revoked`?null:(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`revoke`},`revoke`,`Client revoked.`),children:`Revoke`}),t[28]=r,t[29]=c,t[30]=i,t[31]=n.status,t[32]=m):m=t[32];let h;t[33]!==c||t[34]!==i?(h=()=>i({...c,action:`purge`},`purge`,`Record deleted.`),t[33]=c,t[34]=i,t[35]=h):h=t[35];let g;t[36]!==r||t[37]!==h?(g=(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:h,children:`Delete`}),t[36]=r,t[37]=h,t[38]=g):g=t[38];let _;t[39]!==l||t[40]!==f||t[41]!==p||t[42]!==m||t[43]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[l,f,p,m,g]}),t[39]=l,t[40]=f,t[41]=p,t[42]=m,t[43]=g,t[44]=_):_=t[44];let v;t[45]===n?v=t[46]:(v=K(n),t[45]=n,t[46]=v);let y;t[47]===v?y=t[48]:(y=(0,Q.jsx)($,{rows:v}),t[47]=v,t[48]=y);let b;t[49]===n.safetyNumber?b=t[50]:(b=(0,Q.jsx)(Ct,{value:n.safetyNumber}),t[49]=n.safetyNumber,t[50]=b);let x;t[51]!==y||t[52]!==b?(x=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[y,b]}),t[51]=y,t[52]=b,t[53]=x):x=t[53];let S;return t[54]!==s||t[55]!==x||t[56]!==u||t[57]!==d||t[58]!==_?(S=(0,Q.jsx)(s,{title:u,description:d,control:_,children:x}),t[54]=s,t[55]=x,t[56]=u,t[57]=d,t[58]=_,t[59]=S):S=t[59],S}export{Nt as NodeSecuritySettings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,h as a,v as o,y as s}from"./env-BZZxbmon.js";import{Bn as c,Bt as l,C as u,It as d,Rt as f,Ut as p,Yt as m,bn as h,ut as g,xn as _,zn as v}from"./runtime-DRPzstwF.js";import{a as y}from"./primary-AnB-Zuft.js";import{It as b,i as x}from"./composerDraftStore-czbuHgbM.js";import{G as ee,K as te,N as ne,k as re,n as S}from"./useHandleNewThread-C1VSk4Ji.js";import{m as C,n as w,r as ie,t as T}from"./ThreadStatusIndicators-CPpIFcAC.js";import{t as ae}from"./settingsDialogStore-DnU14tMG.js";import{i as E}from"./uiStateStore-C48VlkZ2.js";import{f as D}from"./useRenderElement-DchFnsR8.js";import{t as oe}from"./chevron-down-B7C6FKzM.js";import{t as se}from"./chevron-right-BWYGybX9.js";import{l as ce}from"./WorkItemsTab-CI6hTQ_k.js";import{t as le}from"./folder-DtsQoI9_.js";import{t as O}from"./git-branch-BKr-Ij4u.js";import{n as ue}from"./HostedConnectionControls-DO5uPfav.js";import{g as de}from"./projectPaths-BFTUsvWs.js";import{t as fe}from"./plus-B2h-VEqh.js";import{t as pe}from"./search-BGQsenCM.js";import{S as me,a as k,b as he,c as A,d as j,f as M,i as N,l as ge,n as _e,o as P,r as ve,s as ye,t as F,u as I,x as be,y as xe}from"./sidebarProjectFolders-Bzdw3xc6.js";import{t as Se}from"./shallow-DWZCFNun.js";import{t as L}from"./utils-Dz7wQZDk.js";import{i as R}from"./timestampFormat-8uPXS812.js";import{o as z}from"./sidebar-5T3qKIfp.js";import{a as Ce,i as we,n as Te,o as Ee,s as De,t as Oe}from"./MobileSheet-DS7_soKu.js";import{t as B}from"./GlassSurface-BWk2twKc.js";import{t as V}from"./useLongPress-OGlhYKlH.js";import{i as ke,o as Ae,r as je,t as Me}from"./empty-BcTA7vWq.js";import{n as H,r as Ne,t as U}from"./usePhoneThreadActions--SRv1Gdm.js";var W=D(`ellipsis-vertical`,[[`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`}]]),G=e(t(),1),Pe=n(),K=b();function Fe(e){let t=(0,Pe.c)(14),{label:n,actions:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=L(`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=L(B(`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(Ie),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 Ie(e){return(0,K.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled??!1,className:L(`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 q=new Map;function J(){let e=(0,Pe.c)(74),t=m(Se(d)),n=m(Se(f)),r=E(Qe),a=E(Ze),s=E(Xe),c=E(Ye),l=E(Je),p=v(qe),b=v(Ke),x=v(Ge),te=y(),w=h(We),ie=_(Ue),T=ae(He),D=g(Ve),{handleNewThread:ce}=S(),[O,de]=(0,G.useState)(!1),me;e[0]!==r||e[1]!==t?(me=re({items:t,preferredIds:r,getId:u}),e[0]=r,e[1]=t,e[2]=me):me=e[2];let k=me,he;e[3]!==k||e[4]!==x?(he=_e({projects:k,settings:x}),e[3]=k,e[4]=x,e[5]=he):he=e[5];let A=he,j;e[6]!==w||e[7]!==ie?(j=e=>{let t=ie[e],n=w[e];return t?.descriptor?.label??n?.label??null},e[6]=w,e[7]=ie,e[8]=j):j=e[8];let M;e[9]!==k||e[10]!==te||e[11]!==x||e[12]!==j?(M=ve({projects:k,settings:x,primaryEnvironmentId:te,resolveEnvironmentLabel:j}),e[9]=k,e[10]=te,e[11]=x,e[12]=j,e[13]=M):M=e[13];let N=M,ge;e[14]===N?ge=e[15]:(ge=new Map(N.map(Be)),e[14]=N,e[15]=ge);let P=ge,ye;if(e[16]!==A||e[17]!==P||e[18]!==p||e[19]!==N||e[20]!==n){let t=N.map(ze),r;e[22]===A?r=e[23]:(r=e=>{let t=o(i(e.environmentId,e.projectId));return Object.assign({},e,{projectId:A.get(t)??t})},e[22]=A,e[23]=r);let a=n.filter(Re).map(r),s;e[24]===P?s=e[25]:(s=e=>{let t=P.get(e.id);return t?[t]:[]},e[24]=P,e[25]=s),ye=ee(t,a,p).flatMap(s),e[16]=A,e[17]=P,e[18]=p,e[19]=N,e[20]=n,e[21]=ye}else ye=e[21];let I=ye,be;e[26]!==s||e[27]!==a||e[28]!==c||e[29]!==p||e[30]!==I?(be=F({projects:I,projectFoldersById:a,projectFolderOrder:s,projectTreeOrder:c,projectSortOrder:p}),e[26]=s,e[27]=a,e[28]=c,e[29]=p,e[30]=I,e[31]=be):be=e[31];let xe=be,L;e[32]!==b||e[33]!==ce?(L=e=>{let t=e.memberProjects[0];t&&(de(!1),ce(i(t.environmentId,t.id),{envMode:ne({defaultEnvMode:b})}))},e[32]=b,e[33]=ce,e[34]=L):L=e[34];let R=L,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)(ue,{})]}),e[35]=B):B=e[35];let V;e[36]!==xe||e[37]!==l?(V=xe.length===0?(0,K.jsx)(Me,{className:`flex-1`,children:(0,K.jsxs)(ke,{children:[(0,K.jsx)(Ae,{className:`text-base`,children:`No projects yet`}),(0,K.jsx)(je,{className:`mt-1 text-sm`,children:`Projects opened on this node appear here with their threads.`})]})}):xe.map(e=>e.kind===`project`?(0,K.jsx)($e,{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:()=>l(e.folder.id,!e.folder.expanded),children:[e.folder.expanded?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(le,{"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(Le):null]},e.itemId)),e[36]=xe,e[37]=l,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 Ne;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,K.jsx)(pe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[41]=Ne):Ne=e[41];let U;e[42]===D?U=e[43]:(U={id:`search`,label:`Search threads`,shortLabel:`Search`,icon:Ne,onSelect:()=>D(!0)},e[42]=D,e[43]=U);let W;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,K.jsx)(fe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[44]=W):W=e[44];let Ie=I.length===0,q;e[45]!==I[0]||e[46]!==I.length||e[47]!==R?(q=()=>{if(I.length===1&&I[0]){R(I[0]);return}de(!0)},e[45]=I[0],e[46]=I.length,e[47]=R,e[48]=q):q=e[48];let J;e[49]!==Ie||e[50]!==q?(J={id:`new-thread`,label:`New thread`,icon:W,disabled:Ie,onSelect:q},e[49]=Ie,e[50]=q,e[51]=J):J=e[51];let et;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,K.jsx)(C,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[52]=et):et=e[52];let Y;e[53]===T?Y=e[54]:(Y={id:`settings`,label:`Open settings`,shortLabel:`Settings`,icon:et,onSelect:()=>T()},e[53]=T,e[54]=Y);let X;e[55]!==U||e[56]!==J||e[57]!==Y?(X=(0,K.jsx)(Fe,{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)(we,{children:[(0,K.jsx)(Ee,{children:`New thread`}),(0,K.jsx)(Te,{children:`Choose a project for the new thread.`})]}),e[59]=tt):tt=e[59];let Z;if(e[60]!==I||e[61]!==R){let t;e[63]===R?t=e[64]:(t=e=>(0,K.jsx)(De,{label:e.displayName,onClick:()=>R(e)},e.projectKey),e[63]=R,e[64]=t),Z=I.map(t),e[60]=I,e[61]=R,e[62]=Z}else Z=e[62];let Q;e[65]===Z?Q=e[66]:(Q=(0,K.jsx)(Ce,{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]!==O||e[68]!==Q?($=(0,K.jsxs)(Oe,{open:O,onOpenChange:de,label:`New thread`,children:[tt,Q]}),e[67]=O,e[68]=Q,e[69]=$):$=e[69];let nt;return e[70]!==H||e[71]!==X||e[72]!==$?(nt=(0,K.jsxs)(z,{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 Le(e){return(0,K.jsx)($e,{project:e,nested:!0},e.projectKey)}function Re(e){return e.archivedAt===null}function ze(e){return Object.assign({},e,{id:e.projectKey})}function Be(e){return[e.projectKey,e]}function Ve(e){return e.setOpen}function He(e){return e.openSettings}function Ue(e){return e.byId}function We(e){return e.byId}function Ge(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function Ke(e){return e.defaultThreadEnvMode}function qe(e){return e.sidebarProjectSortOrder}function Je(e){return e.setProjectFolderExpanded}function Ye(e){return e.projectTreeOrder}function Xe(e){return e.projectFolderOrder}function Ze(e){return e.projectFoldersById}function Qe(e){return e.projectOrder}function $e({project:e,nested:t=!1}){let n=m(Se((0,G.useMemo)(()=>t=>l(t,e.memberProjectRefs),[e.memberProjectRefs]))),u=x((0,G.useMemo)(()=>be(e),[e])),d=v(e=>e.sidebarThreadSortOrder),f=E(e=>e.pinnedThreadKeys),h=E(t=>t.projectExpandedById[e.projectKey]??!0),g=E(e=>e.toggleProject),_=(0,G.useMemo)(()=>new Set(Object.entries(f).flatMap(([e,t])=>t?[e]:[])),[f]),y=(0,G.useMemo)(()=>me(n,u).filter(e=>e.archivedAt===null),[u,n]),b=(0,G.useMemo)(()=>te({threads:y,sortOrder:d,pinnedThreadKeys:_,getThreadKey:e=>s(r(e.environmentId,e.id))}),[_,d,y]),ee=(0,G.useMemo)(()=>new Map(b.map(e=>[s(r(e.environmentId,e.id)),e])),[b]),ne=(0,G.useRef)(ee);ne.current=ee;let re=(0,G.useMemo)(()=>new Map(e.memberProjects.map(e=>[o(i(e.environmentId,e.id)),e])),[e.memberProjects]),S=U({sidebarThreadByKeyRef:ne,memberProjectByScopedKey:re,projectCwd:e.cwd??null}),[C,w]=(0,G.useState)(null),T=C?ee.get(C)??null:null,ae=S.renamingThreadKey?ee.get(S.renamingThreadKey)??null:null,D=m(Se((0,G.useMemo)(()=>t=>p(t,e.memberProjectRefs),[e.memberProjectRefs]))),le=(0,G.useMemo)(()=>he({project:e,threads:b,worktrees:D}),[e,b,D]),O=xe({projects:[le.project],threads:le.threads,worktrees:le.worktrees}).projects[0]??null,ue=O&&O.isGitRepo&&O.worktrees.length>1?O.worktrees:null,{updateSettings:de}=c(),fe=v(e=>({sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides})),{copyPathToClipboard:pe}=ce(),[_e,ve]=(0,G.useState)(!1),F=N(),R=k(),z=P({projectGroupingSettings:fe,updateSettings:de}),Ce=(0,G.useMemo)(()=>{let t=new Map(e.memberProjects.map(e=>[e.physicalProjectKey,0]));for(let e of n){let n=re.get(o(i(e.environmentId,e.projectId)));n&&t.set(n.physicalProjectKey,(t.get(n.physicalProjectKey)??0)+1)}return t},[re,e.memberProjects,n]),{openProjectRemoteLink:we,openProjectJiraLink:Te,handleRemoveProject:Ee}=M({memberThreadCountByPhysicalKey:Ce,jiraProjectOpenUrlByProjectKey:q}),De=(0,G.useRef)(!1),Oe=(0,G.useCallback)(()=>{ve(!0)},[]),{openProjectMenu:B}=j({project:e,jiraProjectOpenUrlByProjectKey:q,suppressProjectClickForContextMenuRef:De,onOpenOverview:Oe,openProjectSettingsDialog:F.openProjectSettingsDialog,openProjectRemoteLink:we,openProjectJiraLink:Te,openProjectRenameDialog:R.openProjectRenameDialog,openProjectGroupingDialog:z.openProjectGroupingDialog,copyPathToClipboard:pe,handleRemoveProject:Ee}),ke=V(e=>B(e)),Ae=e=>{let t=s(r(e.environmentId,e.id));return(0,K.jsx)(X,{thread:e,pinned:_.has(t),onOpen:()=>{let t=r(e.environmentId,e.id);if(e.draftId){S.navigateToDraft(e.draftId,t);return}S.navigateToThread(t)},onMenu:()=>w(t)},t)};return(0,K.jsxs)(`section`,{"aria-label":e.displayName,className:L(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":h,onClick:()=>g(e.projectKey),...ke,children:[h?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(se,{"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=>B({x:e.clientX,y:e.clientY}),children:(0,K.jsx)(W,{"aria-hidden":!0,className:`size-4`})})]}),h?ue?(0,K.jsx)(`div`,{className:`pl-3`,children:ue.map(e=>(0,K.jsx)(et,{worktreeNode:e,renderThreadRow:Ae},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=>Ae(e))}):null,(0,K.jsx)(H,{open:T!==null,onOpenChange:e=>{e||w(null)},title:T?.title??`Thread`,items:C?S.listThreadMenuActions(C):[],leadingSections:T?(0,K.jsx)(ie,{thread:T}):void 0,onAction:e=>{let t=C?a(C):null;w(null),t&&S.performThreadMenuAction(t,e)}}),(0,K.jsx)(Ne,{renamingThreadKey:S.renamingThreadKey,originalTitle:ae?.title??``,renamingTitle:S.renamingTitle,setRenamingTitle:S.setRenamingTitle,commitRename:S.commitRename,cancelRename:S.cancelRename}),(0,K.jsx)(I,{open:_e,projectName:e.displayName,memberProjects:e.memberProjects,initialTab:`overview`,onOpenChange:ve}),(0,K.jsx)(ge,{open:F.projectSettingsOpen,target:F.projectSettingsTarget,title:F.projectSettingsTitle,customAvatarContentHash:F.projectSettingsCustomAvatarContentHash,projectAvatarUploadUnavailableReason:F.projectAvatarUploadUnavailableReason,preferredRemoteName:F.projectSettingsPreferredRemoteName,workspaceRoot:F.projectSettingsWorkspaceRoot,customSystemPrompt:F.projectSettingsCustomSystemPrompt,defaultModelSelection:F.projectSettingsDefaultModelSelection,saving:F.projectSettingsSaving,onClose:F.closeProjectSettingsDialog,onSave:()=>void F.submitProjectSettings(),onTitleChange:F.setProjectSettingsTitle,onWorkspaceRootChange:F.setProjectSettingsWorkspaceRoot,onCustomSystemPromptChange:F.setProjectSettingsCustomSystemPrompt,onDefaultModelSelectionChange:F.setProjectSettingsDefaultModelSelection,onPreferredRemoteChange:F.setProjectSettingsPreferredRemoteName,onPickWorkspaceRoot:()=>void F.pickProjectSettingsWorkspaceRoot(),onOpenRemote:F.openProjectRemoteByName,onUploadAvatar:F.uploadProjectAvatar,onRemoveAvatar:F.removeProjectAvatar}),(0,K.jsx)(ye,{target:R.projectRenameTarget,title:R.projectRenameTitle,onTitleChange:R.setProjectRenameTitle,onClose:R.closeProjectRenameDialog,onSubmit:()=>void R.submitProjectRename()}),(0,K.jsx)(A,{target:z.projectGroupingTarget,selection:z.projectGroupingSelection,globalGroupingMode:fe.sidebarProjectGroupingMode,onSelectionChange:z.setProjectGroupingSelection,onClose:z.closeProjectGroupingDialog,onSave:z.saveProjectGroupingPreference})]})}function et(e){let t=(0,Pe.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(Y),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)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(oe,{"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)(O,{"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 Y(e){return!e}function X(e){let t=(0,Pe.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=V(s),l;t[2]===r?l=t[3]:(l=r?(0,K.jsx)(de,{"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)(T,{thread:n,alwaysShowStatusLabel:!0}),(0,K.jsx)(w,{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:R(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)(W,{"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{J as PhoneHome};
|