ryco-cli 0.1.9 → 0.1.10

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.
Files changed (207) hide show
  1. package/dist/{AcpNativeLogging-CwXNgeCl.mjs → AcpNativeLogging-Ba9Nn9Re.mjs} +1 -1
  2. package/dist/{AcpNativeLogging-BBLrglnY.cjs → AcpNativeLogging-Be1KGJfF.cjs} +1 -1
  3. package/dist/{AzureDevOpsSourceControlProvider-lRTMr9X9.mjs → AzureDevOpsSourceControlProvider-CGlK6M0b.mjs} +2 -2
  4. package/dist/{AzureDevOpsSourceControlProvider-BMQxxk2n.cjs → AzureDevOpsSourceControlProvider-CVj-F-pW.cjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-F1J_75c0.mjs → BitbucketSourceControlProvider-BV6iRDi7.mjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-BXDk4GzL.cjs → BitbucketSourceControlProvider-CEZEd4PX.cjs} +2 -2
  7. package/dist/{ClaudeDriver-B_pvBuh5.cjs → ClaudeDriver-lBU7EyUX.cjs} +2 -2
  8. package/dist/{ClaudeDriver-BpYiEftb.mjs → ClaudeDriver-rooMNrJz.mjs} +2 -2
  9. package/dist/{CodexDriver-Bcju44ZM.cjs → CodexDriver-CZCIJSLV.cjs} +4 -4
  10. package/dist/{CodexDriver-6IRQy37T.mjs → CodexDriver-DBz2rPXb.mjs} +4 -4
  11. package/dist/{CodexTextGeneration-CCvcMT6Y.mjs → CodexTextGeneration-BeG7ymPC.mjs} +1 -1
  12. package/dist/{CodexTextGeneration-yaU53Kmz.cjs → CodexTextGeneration-BvIcyD1P.cjs} +1 -1
  13. package/dist/{CopilotDriver-CTxl0KmP.cjs → CopilotDriver-CX5zhEdZ.cjs} +3 -3
  14. package/dist/{CopilotDriver-BCe5V1Ll.mjs → CopilotDriver-D36vbGbn.mjs} +3 -3
  15. package/dist/{CursorDriver-D1Agqrbj.cjs → CursorDriver-CPBVeesr.cjs} +3 -3
  16. package/dist/{CursorDriver-C4V25d1y.mjs → CursorDriver-DWuuOSkJ.mjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-C-NI9vaC.mjs → ForgejoSourceControlProvider-CeN7Snfr.mjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-CV1lljGK.cjs → ForgejoSourceControlProvider-CzmmcAZO.cjs} +2 -2
  19. package/dist/{GitHubSourceControlProvider-B_7J1jOl.cjs → GitHubSourceControlProvider-DfFR9O2o.cjs} +2 -2
  20. package/dist/{GitHubSourceControlProvider-BeCMPF92.mjs → GitHubSourceControlProvider-Dmz1LJct.mjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-0BeWchVS.mjs → GitLabSourceControlProvider-C21lwphV.mjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-U0xcv577.cjs → GitLabSourceControlProvider-DGoelNmL.cjs} +2 -2
  23. package/dist/{GrokDriver-mkLP3IZl.cjs → GrokDriver-CIXj_4ry.cjs} +3 -3
  24. package/dist/{GrokDriver-DFw7DOdK.mjs → GrokDriver-qKX1a63G.mjs} +3 -3
  25. package/dist/{OpenCodeDriver-ChWHrFi7.mjs → OpenCodeDriver-CbdswhqU.mjs} +2 -2
  26. package/dist/{OpenCodeDriver-C_KFYA-P.cjs → OpenCodeDriver-DDEuwtXl.cjs} +2 -2
  27. package/dist/{SourceControlProviderDiscoveryCatalog-BTJDoEx1.mjs → SourceControlProviderDiscoveryCatalog-4_4yahsa.mjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-Bwu_JBJN.cjs → SourceControlProviderDiscoveryCatalog-DJWDCoup.cjs} +1 -1
  29. package/dist/bin.cjs +46 -20
  30. package/dist/bin.mjs +46 -20
  31. package/dist/client/assets/AccountSettings-CxbiGHT-.js +1 -0
  32. package/dist/client/assets/{AiFocusSettings-DGHWPxgZ.js → AiFocusSettings-Cx2vpGdu.js} +1 -1
  33. package/dist/client/assets/{AnimatedHeight-BwF3D1vB.js → AnimatedHeight-D5lUTPRn.js} +1 -1
  34. package/dist/client/assets/AppearanceSettings-eWri4YVm.js +1 -0
  35. package/dist/client/assets/{BranchToolbar.logic-CvclFpSW.js → BranchToolbar.logic-C1Dh4xQW.js} +1 -1
  36. package/dist/client/assets/{ChatRightPanel-CL4qBTZb.js → ChatRightPanel-DAVHrLN_.js} +9 -9
  37. package/dist/client/assets/{ChatThreadRouteView-BuOmyy7a.js → ChatThreadRouteView-D11uiGPL.js} +1 -1
  38. package/dist/client/assets/{CommandPaletteDialog-lCv8qmpm.js → CommandPaletteDialog-DDXuLFyX.js} +1 -1
  39. package/dist/client/assets/{CompositeItem-e0rusLTG.js → CompositeItem-D-K93PI3.js} +1 -1
  40. package/dist/client/assets/{CompositeRoot-vnNIb6NL.js → CompositeRoot-Cee5L4T9.js} +1 -1
  41. package/dist/client/assets/ConnectionsSettings-Cf1RRkcn.js +7 -0
  42. package/dist/client/assets/{DiagnosticsSettings-CxT6modq.js → DiagnosticsSettings-R00QjM1b.js} +2 -2
  43. package/dist/client/assets/{DialogHandle-DZVZpjWD.js → DialogHandle-pL0RAsXa.js} +1 -1
  44. package/dist/client/assets/{DialogPopup-BIJxt62s.js → DialogPopup-DqvvwMxX.js} +1 -1
  45. package/dist/client/assets/DialogRoot-BZCu6XdB.js +1 -0
  46. package/dist/client/assets/{DialogTitle-CtpwXIBL.js → DialogTitle-BamZsRNz.js} +1 -1
  47. package/dist/client/assets/{DialogTrigger-CdeFWE8i.js → DialogTrigger-DR3vtVpa.js} +1 -1
  48. package/dist/client/assets/{DialogViewport-C2oKvkDR.js → DialogViewport-CuRGvCfw.js} +1 -1
  49. package/dist/client/assets/{DraftChatThreadRouteView-FriWZLgB.js → DraftChatThreadRouteView-CGMtPPGt.js} +1 -1
  50. package/dist/client/assets/{ExternalIdentityWeb.logic-DsqwSlwL.js → ExternalIdentityWeb.logic-D64j70NH.js} +1 -1
  51. package/dist/client/assets/{GlassSurface-EZnNd1mF.js → GlassSurface-DTmaROoR.js} +1 -1
  52. package/dist/client/assets/HostedConnectionControls-CXiER4OL.js +1 -0
  53. package/dist/client/assets/HostedHubRoot-MbaWk1RQ.js +1 -0
  54. package/dist/client/assets/{HostedNativeAuthorizationRoute-B-F2I7S_.js → HostedNativeAuthorizationRoute-DQ71L_yc.js} +1 -1
  55. package/dist/client/assets/{HostedRelayTrustNotice-CB0O5OAN.js → HostedRelayTrustNotice-Cv7T3mW5.js} +1 -1
  56. package/dist/client/assets/{Icons-Cme5LL0k.js → Icons-DjUJVKIP.js} +1 -1
  57. package/dist/client/assets/{IntegrationsSettingsPanel-CS9vrmPw.js → IntegrationsSettingsPanel-BUDT_BAr.js} +1 -1
  58. package/dist/client/assets/{KeybindingsSettings-CQi3dbgG.js → KeybindingsSettings-DpU1kPiV.js} +1 -1
  59. package/dist/client/assets/{McpServersSettings-BMV56xhW.js → McpServersSettings-DQqM_vIq.js} +1 -1
  60. package/dist/client/assets/{MobileSheet-C8OrQzw0.js → MobileSheet-PksVmYO6.js} +1 -1
  61. package/dist/client/assets/{NewWorktreeDialog-DnxmXlh2.js → NewWorktreeDialog-CAe3UUk5.js} +1 -1
  62. package/dist/client/assets/{NoActiveThreadState-BWs9JspL.js → NoActiveThreadState-B020r2KX.js} +1 -1
  63. package/dist/client/assets/NodeSecuritySettings-DlVOOlej.js +1 -0
  64. package/dist/client/assets/{OpinionatedPluginsSettings-BcGJ1f7b.js → OpinionatedPluginsSettings-DMshW6cD.js} +1 -1
  65. package/dist/client/assets/{PhoneGetAppInterstitial-BJGf9FwA.js → PhoneGetAppInterstitial-BCO-RNVk.js} +1 -1
  66. package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-KgY3ydJF.js → PhoneGetAppInterstitialBackdrop-CkHNzjRm.js} +1 -1
  67. package/dist/client/assets/{PhoneHome-kBrFqF5K.js → PhoneHome-DY2ItxYl.js} +1 -1
  68. package/dist/client/assets/{PhoneSettingsSurface-CBI6Gl8b.js → PhoneSettingsSurface-DTP9FXLL.js} +1 -1
  69. package/dist/client/assets/{ProjectFavicon-D0HVbYDF.js → ProjectFavicon-Dopa4Rxy.js} +1 -1
  70. package/dist/client/assets/{ProviderModelPicker-DZTCKskK.js → ProviderModelPicker-ChoxerzY.js} +1 -1
  71. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BkoRegCn.js +1 -0
  72. package/dist/client/assets/ProvidersSettingsPanel-Ubea3yAA.js +1 -0
  73. package/dist/client/assets/{RedactedSensitiveText-CRGSSHz3.js → RedactedSensitiveText-CdVeknPX.js} +1 -1
  74. package/dist/client/assets/RootAppShell-BkUPk443.js +6 -0
  75. package/dist/client/assets/{RycoLetterMark-E82lj57c.js → RycoLetterMark-GW-n9UxM.js} +1 -1
  76. package/dist/client/assets/SettingsDialog-DMPrhOeR.js +1 -0
  77. package/dist/client/assets/SettingsPanels-ChP1z6Bu.js +3 -0
  78. package/dist/client/assets/{SettingsPanels.editor-DTAK4nlM.js → SettingsPanels.editor-CiyAxlms.js} +1 -1
  79. package/dist/client/assets/{SourceControlSettings-CpnAAcyj.js → SourceControlSettings-8w3XlkuZ.js} +1 -1
  80. package/dist/client/assets/{StatisticsPage-DwU3oJRO.js → StatisticsPage-D4lU63rD.js} +1 -1
  81. package/dist/client/assets/{StatisticsPanel-8OSQWA79.js → StatisticsPanel-C2yBieuM.js} +1 -1
  82. package/dist/client/assets/{StatisticsSettingsLink-Bb86VtRL.js → StatisticsSettingsLink-DZwvRI-Y.js} +1 -1
  83. package/dist/client/assets/{ThreadStatusIndicators-wgiSGtn6.js → ThreadStatusIndicators-B43wkv-s.js} +0 -0
  84. package/dist/client/assets/{ThreadTerminalDrawer-Dju6roQA.js → ThreadTerminalDrawer-BYQ6EMgr.js} +1 -1
  85. package/dist/client/assets/{ThreadWorkspacePanel-hfIocZRN.js → ThreadWorkspacePanel-DuaQ9DMj.js} +1 -1
  86. package/dist/client/assets/{ToolbarRootContext-CgV898DN.js → ToolbarRootContext-Cp1bgmpz.js} +1 -1
  87. package/dist/client/assets/{WorkItemsTab-DYgsIthY.js → WorkItemsTab-BDfun24H.js} +6 -6
  88. package/dist/client/assets/{alert-DFo8_l6D.js → alert-DdU9OGtC.js} +1 -1
  89. package/dist/client/assets/{alert-dialog-Cmodiuqg.js → alert-dialog-zAmnOpaF.js} +1 -1
  90. package/dist/client/assets/{authorization-CFcCWeGd.js → authorization-mIJKV2yp.js} +1 -1
  91. package/dist/client/assets/{badge-BbJiUmhG.js → badge-CNPL77i3.js} +1 -1
  92. package/dist/client/assets/{branding-CG1VEma6.js → branding-yW_ACj9l.js} +1 -1
  93. package/dist/client/assets/{button-BT6cGe5S.js → button-CXfaxtRp.js} +1 -1
  94. package/dist/client/assets/{capabilities-CK9Wa-Au.js → capabilities-j43xmCXg.js} +1 -1
  95. package/dist/client/assets/{chatThreadActions-Ooky34bb.js → chatThreadActions-DQ8aOQ1g.js} +1 -1
  96. package/dist/client/assets/{collapsible-BIEfHdzc.js → collapsible-oJfDmFRs.js} +1 -1
  97. package/dist/client/assets/{command-BjXuIvYa.js → command-DK1D8p4-.js} +1 -1
  98. package/dist/client/assets/{composerDraftStore-_Xy-iY4b.js → composerDraftStore-BaAeiPHc.js} +1 -1
  99. package/dist/client/assets/copy-UQjKGt7t.js +1 -0
  100. package/dist/client/assets/{data-list-iVYHRfWS.js → data-list-BpzwKa1z.js} +1 -1
  101. package/dist/client/assets/{desktopUpdateAtoms-C9VOpM6h.js → desktopUpdateAtoms-Cy06xm8M.js} +1 -1
  102. package/dist/client/assets/{desktopWorkspace-BOWgdyPs.js → desktopWorkspace-Cw4Fu0Dd.js} +1 -1
  103. package/dist/client/assets/{device-CLd1blIe.js → device-hx7RX9fI.js} +1 -1
  104. package/dist/client/assets/{dialog-BUIS3TXH.js → dialog-JVv-MNDj.js} +1 -1
  105. package/dist/client/assets/{draft-input-CUkU2EAu.js → draft-input-CxoGkZxM.js} +1 -1
  106. package/dist/client/assets/{editorPreferences-C79SevBP.js → editorPreferences-C3i2Nkh2.js} +1 -1
  107. package/dist/client/assets/{empty-BNn5X77p.js → empty-DhkXzm1N.js} +1 -1
  108. package/dist/client/assets/{env-CBdFekj3.js → env-B4arEvJg.js} +1 -1
  109. package/dist/client/assets/{getPseudoElementBounds-CWoLtsYr.js → getPseudoElementBounds-NLvUMZyQ.js} +1 -1
  110. package/dist/client/assets/{group-a6GUMeTh.js → group-CafmSbGU.js} +1 -1
  111. package/dist/client/assets/{index-Bbc24tew.js → index-COc-h_V9.js} +2 -2
  112. package/dist/client/assets/{input-zjUwoDs3.js → input-Bz9pd_f3.js} +1 -1
  113. package/dist/client/assets/{kbd-BGOWI5KX.js → kbd-qh5s29Yp.js} +1 -1
  114. package/dist/client/assets/{keybindings-n2U57Td0.js → keybindings-BCns_TPr.js} +1 -1
  115. package/dist/client/assets/{label-DWGvDLsD.js → label-Ct6uH6qL.js} +1 -1
  116. package/dist/client/assets/{lib-DoLGGVrW.js → lib-BBbQoz14.js} +1 -1
  117. package/dist/client/assets/{logging-FtLrPmK_.js → logging-M8H3z7rQ.js} +1 -1
  118. package/dist/client/assets/{main-C2i8ecSj.js → main-9Wu8G64Y.js} +2 -2
  119. package/dist/client/assets/main-DaYHZt-J.css +2 -0
  120. package/dist/client/assets/{menu-CwPZHq2g.js → menu-DL-18Hfn.js} +1 -1
  121. package/dist/client/assets/{popover-j6ZF-s94.js → popover-C9y_0-ZN.js} +1 -1
  122. package/dist/client/assets/{primary-0ymoUGkq.js → primary-OskAInOO.js} +1 -1
  123. package/dist/client/assets/{projectPaths-CHDYD_Gc.js → projectPaths-DSRhOXwD.js} +1 -1
  124. package/dist/client/assets/{providerDriverMeta-lsEf84Mz.js → providerDriverMeta-DcAmgw5o.js} +1 -1
  125. package/dist/client/assets/{providerIconUtils-_WuNo2Ek.js → providerIconUtils-DSXSWHwg.js} +1 -1
  126. package/dist/client/assets/providerInstances-D5NRn-MS.js +1 -0
  127. package/dist/client/assets/providerModels-D5NRn-MS.js +1 -0
  128. package/dist/client/assets/{qr-code-DbscZ6Qz.js → qr-code-DsN9sWfN.js} +1 -1
  129. package/dist/client/assets/{radio-group-BTtFIcDI.js → radio-group-DGUZYMAN.js} +1 -1
  130. package/dist/client/assets/{resolveAriaLabelledBy-CxOsaNI8.js → resolveAriaLabelledBy-l3Wj7Mso.js} +1 -1
  131. package/dist/client/assets/{rightPanelRouteSearch-DkhE1otz.js → rightPanelRouteSearch-DE_7uWlN.js} +1 -1
  132. package/dist/client/assets/runtime-CqhG6EOG.js +1 -0
  133. package/dist/client/assets/{scroll-area-B-bu3v0j.js → scroll-area-gtur6NxN.js} +1 -1
  134. package/dist/client/assets/{scrollEdges-CDEU4fOg.js → scrollEdges-Ccq9Jqpk.js} +1 -1
  135. package/dist/client/assets/{select-rPdFVPfm.js → select-BB7zCkpA.js} +1 -1
  136. package/dist/client/assets/{separator-CaVw81t6.js → separator-DOGIr29S.js} +1 -1
  137. package/dist/client/assets/{session-logic-B0shVXpN.js → session-logic-DOQPF0oN.js} +1 -1
  138. package/dist/client/assets/{settingsDialogStore-CPtQPrek.js → settingsDialogStore-DM98Sea0.js} +1 -1
  139. package/dist/client/assets/settingsLayout-CS7P71tz.js +1 -0
  140. package/dist/client/assets/settingsSections.logic-F8RXVmAq.js +1 -0
  141. package/dist/client/assets/{sheet-DQBndeJT.js → sheet-DVALF6mw.js} +1 -1
  142. package/dist/client/assets/{sidebar-H-CSxQVD.js → sidebar-Dft4bIEi.js} +1 -1
  143. package/dist/client/assets/{sidebarProjectFolders-CsZlmaJg.js → sidebarProjectFolders-BOfJCYjK.js} +1 -1
  144. package/dist/client/assets/{sidebarStatusText-DjLAEM1H.js → sidebarStatusText-DaNVnBiR.js} +1 -1
  145. package/dist/client/assets/{skeleton-CCuGgPK1.js → skeleton-CBHDWLDX.js} +1 -1
  146. package/dist/client/assets/{spinner-CgrOdIjl.js → spinner-JhkVC8d7.js} +1 -1
  147. package/dist/client/assets/src-Vf4LVnMX.js +14 -0
  148. package/dist/client/assets/storeSelectors-CP3vrsGY.js +1 -0
  149. package/dist/client/assets/{switch-cMx5Wv_R.js → switch-vkC1QGDn.js} +1 -1
  150. package/dist/client/assets/{terminal-links-DERnXf-G.js → terminal-links-BaX-ICJT.js} +1 -1
  151. package/dist/client/assets/{textarea-DIqqrD8A.js → textarea-Cz_x76EQ.js} +1 -1
  152. package/dist/client/assets/{threadPriorityRefreshRuntime-D2XRdn_X.js → threadPriorityRefreshRuntime-DqqfcbZE.js} +1 -1
  153. package/dist/client/assets/toast-Bnfw8LOb.js +1 -0
  154. package/dist/client/assets/{toggle-BIs83JSj.js → toggle-DNtHlm45.js} +1 -1
  155. package/dist/client/assets/{toggle-group-0LgplGMc.js → toggle-group-BNtjyirT.js} +1 -1
  156. package/dist/client/assets/{tooltip-BaJgdXlL.js → tooltip-lYatfjuN.js} +1 -1
  157. package/dist/client/assets/types-CP3vrsGY.js +1 -0
  158. package/dist/client/assets/{uiStateStore-hgy2ilHo.js → uiStateStore-VVodpTkG.js} +1 -1
  159. package/dist/client/assets/{useAtlassian-1BSXt3BO.js → useAtlassian-DzQhYzCz.js} +0 -0
  160. package/dist/client/assets/{useButton-_xmxdcVX.js → useButton-CQaIys_r.js} +1 -1
  161. package/dist/client/assets/{useCompositeListItem-dLIU4XjY.js → useCompositeListItem-D_u_nlWz.js} +1 -1
  162. package/dist/client/assets/useCopyToClipboard-BTpWxumf.js +1 -0
  163. package/dist/client/assets/{useDebouncedValue-DU7gLY9w.js → useDebouncedValue-Dl2JtWSe.js} +1 -1
  164. package/dist/client/assets/{useFloatingRootContext-CSPbIu1q.js → useFloatingRootContext-DKAeq7FI.js} +1 -1
  165. package/dist/client/assets/useHandleNewThread-CzfIpG9Y.js +1 -0
  166. package/dist/client/assets/{useLabelableId-COmfNFnd.js → useLabelableId-C7EOshps.js} +1 -1
  167. package/dist/client/assets/{useLocation-DsqdpYA5.js → useLocation-CvhfNIUj.js} +1 -1
  168. package/dist/client/assets/{useOpenInteractionType-JaQBnIly.js → useOpenInteractionType-D9ngong8.js} +1 -1
  169. package/dist/client/assets/{usePhoneThreadActions-RjcSVspy.js → usePhoneThreadActions-CiFBnOHD.js} +1 -1
  170. package/dist/client/assets/{usePopupViewport-wXfO6SZE.js → usePopupViewport-CQTeg5Y-.js} +1 -1
  171. package/dist/client/assets/{useScrollLock-Dr_P7FLZ.js → useScrollLock-TdF-Iq8H.js} +1 -1
  172. package/dist/client/assets/{useStatistics-B2NNfOqV.js → useStatistics-CP8uxvx6.js} +1 -1
  173. package/dist/client/assets/{useSwipeDismiss-B8Fo31QE.js → useSwipeDismiss-DESLmDpT.js} +1 -1
  174. package/dist/client/assets/{useThreadActions-B9kmG6FU.js → useThreadActions-fOb3ApmL.js} +1 -1
  175. package/dist/client/assets/{useTriggerFocusGuards-O2ZE3JtI.js → useTriggerFocusGuards-DkAmJBLw.js} +1 -1
  176. package/dist/client/assets/{useValueChanged-Dj0YXujm.js → useValueChanged-CSGMZCwN.js} +1 -1
  177. package/dist/client/assets/{utils-c6dglOTK.js → utils-BPUctpTG.js} +1 -1
  178. package/dist/client/index.html +1 -1
  179. package/dist/{collectUint8StreamText-Dn-L1KcR.cjs → collectUint8StreamText-Bb52hlpd.cjs} +36 -6
  180. package/dist/{collectUint8StreamText-DNY4x71l.mjs → collectUint8StreamText-EDg4F0TU.mjs} +31 -7
  181. package/dist/{makeManagedServerProvider-D3T5X-B4.mjs → makeManagedServerProvider-Cf8bNWwc.mjs} +1 -1
  182. package/dist/{makeManagedServerProvider-DNnEIuhW.cjs → makeManagedServerProvider-itynW7xv.cjs} +1 -1
  183. package/package.json +1 -1
  184. package/dist/client/assets/AccountSettings-ckhtafp7.js +0 -1
  185. package/dist/client/assets/AppearanceSettings-CDvljGDS.js +0 -1
  186. package/dist/client/assets/ConnectionsSettings-BJJrdASq.js +0 -7
  187. package/dist/client/assets/DialogRoot-8xRqqTn8.js +0 -1
  188. package/dist/client/assets/HostedConnectionControls-BYS30u9D.js +0 -1
  189. package/dist/client/assets/HostedHubRoot-Bi0LEQCK.js +0 -1
  190. package/dist/client/assets/NodeSecuritySettings-iTvQFged.js +0 -1
  191. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-CtfZzmYI.js +0 -1
  192. package/dist/client/assets/ProvidersSettingsPanel-DAz8hMXw.js +0 -1
  193. package/dist/client/assets/RootAppShell-BWtqIOLh.js +0 -6
  194. package/dist/client/assets/SettingsDialog-RrFirXQp.js +0 -1
  195. package/dist/client/assets/SettingsPanels-bLK5JAV2.js +0 -3
  196. package/dist/client/assets/main-an0sD0U2.css +0 -2
  197. package/dist/client/assets/providerInstances-DEQekDE8.js +0 -1
  198. package/dist/client/assets/providerModels-DEQekDE8.js +0 -1
  199. package/dist/client/assets/runtime-BkRtSwRY.js +0 -1
  200. package/dist/client/assets/settingsLayout-B8os-EWr.js +0 -1
  201. package/dist/client/assets/settingsSections.logic-Be8uaymC.js +0 -1
  202. package/dist/client/assets/src-b7-hpIff.js +0 -14
  203. package/dist/client/assets/storeSelectors-BLHJVLCP.js +0 -1
  204. package/dist/client/assets/toast-DonYDy-6.js +0 -1
  205. package/dist/client/assets/types-BLHJVLCP.js +0 -1
  206. package/dist/client/assets/useCopyToClipboard-qG2nhvjQ.js +0 -1
  207. package/dist/client/assets/useHandleNewThread-COAg-4eT.js +0 -1
@@ -1,7 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{Nr as r,xa as i}from"./src-b7-hpIff.js";import{Vn as a,bn as o,c as s,m as c,n as l,o as u,p as d,r as f,xt as p,yn as m}from"./runtime-BkRtSwRY.js";import{A as h,C as g,F as _,M as v,T as y,U as b,g as x,h as S,j as C,k as w,m as T,p as E,u as D}from"./primary-0ymoUGkq.js";import{f as O,t as k}from"./utils-c6dglOTK.js";import{n as A,t as j}from"./pairingUrl-rQM9kSGT.js";import{n as M,t as N}from"./visibilityPolling-BwzZdaSN.js";import{r as P,t as F}from"./hostedPairing-PogXRAb7.js";import{i as I}from"./uiStateStore-hgy2ilHo.js";import{a as ee,t as te}from"./desktopWorkspace-BOWgdyPs.js";import{f as L}from"./useRenderElement-DchFnsR8.js";import{t as R}from"./arrow-up-right-DGeet8e6.js";import{t as z}from"./chevron-down-B7C6FKzM.js";import{i as B}from"./toast-DonYDy-6.js";import{t as ne}from"./useCopyToClipboard-qG2nhvjQ.js";import{t as re}from"./plus-B2h-VEqh.js";import{t as ie}from"./qr-code-ScYULAuR.js";import{t as ae}from"./refresh-cw-DopCMrtR.js";import{t as oe}from"./terminal-C_CyIsDD.js";import{t as se}from"./triangle-alert-RL_T3KLo.js";import{n as V,t as H}from"./timestampFormat-8uPXS812.js";import{i as ce,n as le,t as ue}from"./tooltip-BaJgdXlL.js";import{t as de}from"./switch-cMx5Wv_R.js";import{t as U}from"./input-zjUwoDs3.js";import{t as W}from"./scroll-area-B-bu3v0j.js";import{t as G}from"./button-BT6cGe5S.js";import{t as fe}from"./toastHelpers-CSQRKo4F.js";import{a as pe,c as me,i as he,l as ge,n as _e,o as ve,r as ye,s as be,t as K}from"./dialog-BUIS3TXH.js";import{a as xe,c as Se,d as Ce,i as we,o as Te,p as Ee,s as De}from"./menu-CwPZHq2g.js";import{t as Oe}from"./spinner-CgrOdIjl.js";import{t as ke}from"./textarea-DIqqrD8A.js";import{a as Ae,i as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./alert-dialog-Cmodiuqg.js";import{n as Le,r as Re,t as ze}from"./popover-j6ZF-s94.js";import{a as Be,i as Ve,n as He,r as q}from"./settingsLayout-B8os-EWr.js";import{n as J,t as Ue}from"./data-list-iVYHRfWS.js";import{t as We}from"./AnimatedHeight-BwF3D1vB.js";import{n as Ge,t as Ke}from"./group-a6GUMeTh.js";import{t as qe}from"./qr-code-DbscZ6Qz.js";import{n as Je,r as Ye,t as Y}from"./collapsible-BIEfHdzc.js";var Xe=L(`chevrons-left-right-ellipsis`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`m17 7 5 5-5 5`,key:`1xlxn0`}],[`path`,{d:`m7 7-5 5 5 5`,key:`19njba`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]),X=e(t(),1),Ze=n();function Qe(e,t){let n=new URL(e);return n.pathname=`/pair`,A(n,t).toString()}function $e(e,t){return new URL(e).protocol===`https:`?F({host:e,token:t}):null}var Z=`/assets/relay-architecture-YeimmXuP.html`,Q=O();function $(e,t){return e===null||t===null||!e.fileSecretStoreFallbackSupported?!1:t.enrolled===`none`||t.enrolled===`unknown`&&!e.allowFileSecretStore}function et(e,t){return e===null||t===null?`Loading local launch configuration and identity state.`:e.fileSecretStoreFallbackSupported?t.enrolled===`active`||t.enrolled===`pending`?`Locked while this machine holds Hub identity material. Leave the Hub before changing it.`:t.enrolled===`unknown`?e.allowFileSecretStore?`Identity custody is unreadable, so an enabled fallback cannot be turned off.`:`Enable this only as a recovery action when an existing file-backed identity cannot be read.`:`Ryco still prefers the system credential store. This only permits the hardened POSIX file fallback when that store is unavailable.`:`Unavailable on Windows. Ryco requires the system credential store on this host.`}function tt(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KiB`}function nt(e,t){if(e===null)return[{label:`Protocol`,value:`Loading`},{label:`Channels`,value:`Loading`},{label:`Relay queue`,value:`Loading`},{label:`Reconnect`,value:`Loading`}];let n=e.state===`online`&&e.protocolMajor!==void 0&&e.protocolMinor!==void 0?`${e.protocolMajor}.${e.protocolMinor}`:`Not negotiated`,r=e.nextRetryAt===void 0?e.reconnectAttempt===void 0?`Not scheduled`:`Attempt ${e.reconnectAttempt}`:`Attempt ${e.reconnectAttempt??0}, ${Math.max(0,Math.ceil((Date.parse(e.nextRetryAt)-t)/1e3))}s`;return[{label:`Protocol`,value:n},{label:`Channels`,value:String(e.activeChannels)},{label:`Relay queue`,value:tt(e.queuedBytes)},{label:`Reconnect`,value:r}]}function rt(e){let t=(0,Ze.c)(84),{config:n,identity:r,status:i,nowMs:a,savingFileFallback:o,configError:s,onFileFallbackChange:c,onOpenGuide:l}=e,[u,d]=(0,X.useState)(!1),f;t[0]!==n||t[1]!==r?(f=$(n,r),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p=f,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k;if(t[3]!==p||t[4]!==n||t[5]!==s||t[6]!==r||t[7]!==a||t[8]!==c||t[9]!==l||t[10]!==u||t[11]!==o||t[12]!==i){let e=nt(i,a);g=Y,y=u,b=d;let f=u?`Hide advanced options`:`Show advanced options`,A;t[29]===f?A=t[30]:(A=(0,Q.jsx)(`span`,{className:`block text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:f}),t[29]=f,t[30]=A);let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground/80`,children:`Key custody, startup ownership, CLI flags, and bounded relay diagnostics.`}),t[31]=j):j=t[31];let M;t[32]===s?M=t[33]:(M=s?(0,Q.jsx)(`span`,{className:`mt-1 block text-[11px] text-destructive`,children:s}):null,t[32]=s,t[33]=M);let N;t[34]!==A||t[35]!==M?(N=(0,Q.jsxs)(`span`,{children:[A,j,M]}),t[34]=A,t[35]=M,t[36]=N):N=t[36];let P=`size-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${u?`rotate-180`:``}`,F;t[37]===P?F=t[38]:(F=(0,Q.jsx)(z,{className:P,"aria-hidden":!0}),t[37]=P,t[38]=F),t[39]!==N||t[40]!==F?(x=(0,Q.jsxs)(Ye,{className:`group flex w-full items-center justify-between gap-4 border-t border-border/60 px-4 py-3.5 text-left transition-colors hover:bg-muted/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:px-5`,children:[N,F]}),t[39]=N,t[40]=F,t[41]=x):x=t[41],h=Je,v=`motion-reduce:transition-none`,D=`border-t border-border/60 bg-muted/10`;let I;t[42]!==n||t[43]!==r?(I=et(n,r),t[42]=n,t[43]=r,t[44]=I):I=t[44];let ee=n?.allowFileSecretStore??!1,te=!p||o,L;t[45]===c?L=t[46]:(L=e=>c(!!e),t[45]=c,t[46]=L);let B;t[47]!==ee||t[48]!==te||t[49]!==L?(B=(0,Q.jsx)(de,{checked:ee,disabled:te,onCheckedChange:L,"aria-label":`Allow permissioned-file Hub key storage`}),t[47]=ee,t[48]=te,t[49]=L,t[50]=B):B=t[50],t[51]!==I||t[52]!==B?(O=(0,Q.jsx)(q,{title:`Protected key fallback`,description:I,status:`Changing this launch setting restarts Ryco. It never moves or exports an existing key.`,control:B}),t[51]=I,t[52]=B,t[53]=O):O=t[53],t[54]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(q,{title:`Who owns startup`,description:`The desktop app owns Hub launch values for its bundled server and restarts that server to apply them. Exported Hub environment variables do not override this panel.`,status:`The Hub address stays outside ordinary server settings, diagnostics, and support output.`}),t[54]=k):k=t[54],t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(q,{title:`CLI equivalents`,description:`Use these flags for a headless Ryco node. Explicit flags override matching environment variables.`,status:`Use RYCO_HUB_NODE_NAME instead of --hub-node-name when environment configuration is preferable. Boolean flags also support canonical --no-... forms.`,children:(0,Q.jsx)(`div`,{className:`pb-3.5 pt-3`,children:(0,Q.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border border-border/60 bg-background/70 px-3 py-2.5 font-mono text-[11px] leading-5 text-foreground`,children:(0,Q.jsx)(`code`,{children:`ryco serve \\
2
- --hub-connector-enabled \\
3
- --hub-origin https://app.ryco.space \\
4
- --hub-node-name "Build node"
5
-
6
- # Optional on supported POSIX hosts
7
- ryco serve --hub-allow-file-secret-store`})})})}),t[55]=_):_=t[55],m=q,w=`Relay diagnostics`,T=`Bounded local counters only. No Hub address, key, ticket, project, path, or payload is exposed here.`;let ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(R,{className:`size-3`}),t[56]=ne):ne=t[56],t[57]===l?E=t[58]:(E=(0,Q.jsxs)(G,{size:`xs`,variant:`outline`,onClick:l,children:[`Open relay guide`,ne]}),t[57]=l,t[58]=E),S=`grid grid-cols-2 gap-x-6 gap-y-3 pb-3.5 pt-3 sm:grid-cols-4`,C=e.map(it),t[3]=p,t[4]=n,t[5]=s,t[6]=r,t[7]=a,t[8]=c,t[9]=l,t[10]=u,t[11]=o,t[12]=i,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],C=t[22],w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28];let A;t[59]!==S||t[60]!==C?(A=(0,Q.jsx)(`dl`,{className:S,children:C}),t[59]=S,t[60]=C,t[61]=A):A=t[61];let j;t[62]!==m||t[63]!==A||t[64]!==w||t[65]!==T||t[66]!==E?(j=(0,Q.jsx)(m,{title:w,description:T,control:E,children:A}),t[62]=m,t[63]=A,t[64]=w,t[65]=T,t[66]=E,t[67]=j):j=t[67];let M;t[68]!==_||t[69]!==j||t[70]!==D||t[71]!==O||t[72]!==k?(M=(0,Q.jsxs)(`div`,{className:D,children:[O,k,_,j]}),t[68]=_,t[69]=j,t[70]=D,t[71]=O,t[72]=k,t[73]=M):M=t[73];let N;t[74]!==h||t[75]!==v||t[76]!==M?(N=(0,Q.jsx)(h,{className:v,children:M}),t[74]=h,t[75]=v,t[76]=M,t[77]=N):N=t[77];let P;return t[78]!==g||t[79]!==y||t[80]!==b||t[81]!==x||t[82]!==N?(P=(0,Q.jsxs)(g,{open:y,onOpenChange:b,children:[x,N]}),t[78]=g,t[79]=y,t[80]=b,t[81]=x,t[82]=N,t[83]=P):P=t[83],P}function it(e){return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`dt`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground/65`,children:e.label}),(0,Q.jsx)(`dd`,{className:`mt-1 truncate font-mono text-[11px] text-foreground`,children:e.value})]},e.label)}var at={configuration_invalid:{headline:`Hub configuration is invalid`,detail:`The address this backend started with was rejected. Check it and restart.`,action:`none`},identity_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The system keychain is locked or unavailable. Unlock it, then try again.`,action:`retry`},identity_store_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The keychain was unavailable when Ryco started. Restart Ryco to try again.`,action:`restart`},identity_origin_mismatch:{headline:`Enrolled with a different Hub`,detail:`This machine's key belongs to another Hub. Leave that Hub to enrol here.`,action:`leave`},enrollment_unavailable:{headline:`Enrollment was denied`,detail:`Someone declined this request on the Hub. Check with them before trying again.`,action:`enroll`},enrollment_expired:{headline:`Enrollment expired`,detail:`The request timed out before it was approved.`,action:`enroll`},authentication_failed:{headline:`The Hub rejected this machine's key`,detail:`Check this node's status on the Hub. Leaving lets you enrol again from scratch.`,action:`open-hub`},connection_replaced:{headline:`Another process connected as this machine`,detail:`Two copies of Ryco can't share one Hub identity. Stop the other one, then retry.`,action:`retry`},protocol_invalid:{headline:`The Hub connection kept failing`,detail:`Ryco stopped retrying after repeated protocol errors. Update Ryco and the Hub.`,action:`retry`},network_unavailable:{headline:`Can't reach the Hub`,detail:null,action:`none`},tls_unavailable:{headline:`Can't reach the Hub securely`,detail:null,action:`none`},authentication_timeout:{headline:`The Hub didn't respond`,detail:null,action:`none`},server_draining:{headline:`The Hub is restarting`,detail:null,action:`none`},rate_limited:{headline:`The Hub is rate limiting`,detail:null,action:`none`},heartbeat_timeout:{headline:`The Hub stopped responding`,detail:null,action:`none`},slow_consumer:{headline:`The connection fell behind`,detail:null,action:`none`},internal_error:{headline:`The Hub connection failed`,detail:null,action:`none`}},ot=(e,t)=>{let n=new Date(e).getTime()-t;if(Number.isNaN(n))return null;if(n<=0)return`now`;let r=Math.ceil(n/1e3);return r<60?`${r}s`:`${Math.ceil(r/60)}m`};function st(e,t,n){switch(e.state){case`disabled`:return t.enrolled===`none`?{dot:`idle`,ping:!1,headline:`Not connected`,detail:null,action:`enable`,secondaryAction:`none`,retrying:!1}:{dot:`idle`,ping:!1,headline:`Turned off`,detail:`This machine stays enrolled.`,action:`enable`,secondaryAction:`leave`,retrying:!1};case`enrolling`:return{dot:`warning`,ping:!1,headline:`Ready to enrol`,detail:`Start enrollment, then approve this machine on your Hub.`,action:`enroll`,secondaryAction:`disable`,retrying:!1};case`awaiting_approval`:return{dot:`warning`,ping:!0,headline:`Waiting for approval on the Hub`,detail:`Compare every field below before approving.`,action:`open-hub`,secondaryAction:`cancel-enrollment`,retrying:!1};case`connecting`:return{dot:`warning`,ping:!0,headline:`Connecting`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`authenticating`:return{dot:`warning`,ping:!0,headline:`Authenticating`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`online`:return{dot:`success`,ping:!0,headline:`Connected`,detail:e.activeChannels===1?`1 active session`:`${e.activeChannels} active sessions`,action:`disable`,secondaryAction:`none`,retrying:!1};case`degraded`:{if(e.degradedMode===`backing_off`){let t=e.nextRetryAt===void 0?null:ot(e.nextRetryAt,n),r=e.reconnectAttempt;return{dot:`warning`,ping:!0,headline:`Reconnecting`,detail:[t===null?null:t===`now`?`Retrying now`:`Next attempt in ${t}`,r===void 0||r===0?null:`attempt ${r}`].filter(e=>e!==null).join(` · `),action:`none`,secondaryAction:`none`,retrying:!0}}let t=at[e.failure??`internal_error`];return{dot:`destructive`,ping:!1,headline:t.headline,detail:t.detail,action:t.action,secondaryAction:t.action===`leave`?`none`:`leave`,retrying:!1}}case`revoked`:return{dot:`destructive`,ping:!1,headline:`Revoked at the Hub`,detail:`This will not retry. Leaving erases this machine's key so you can enrol again.`,action:`leave`,secondaryAction:`open-hub`,retrying:!1};case`version_incompatible`:return{dot:`destructive`,ping:!1,headline:`Incompatible Hub version`,detail:`This will not retry. Update Ryco, or the Hub, so both speak the same protocol.`,action:`none`,secondaryAction:`none`,retrying:!1};case`stopping`:return{dot:`idle`,ping:!1,headline:`Shutting down`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1}}}function ct(e){return e.enrolled===`none`}var lt=5e3,ut=15e3,dt={enable:`Enable`,disable:`Turn off`,enroll:`Start enrollment`,"cancel-enrollment":`Cancel`,"open-hub":`Open Hub`,retry:`Retry now`,leave:`Leave this Hub`,restart:`Restart Ryco`},ft=1e4;function pt({desktopBridge:e}){let t=Be(1e3),n=ee(),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(``),[g,v]=(0,X.useState)(null),[b,C]=(0,X.useState)(null),[E,O]=(0,X.useState)(``),[k,A]=(0,X.useState)(null),[j,P]=(0,X.useState)(!1),[F,I]=(0,X.useState)(null),[L,R]=(0,X.useState)(null),[z,B]=(0,X.useState)(null),[re,ie]=(0,X.useState)(!1),[ae,oe]=(0,X.useState)(!1),[V,H]=(0,X.useState)(null),[ce,le]=(0,X.useState)(!1),[ue,de]=(0,X.useState)(null),[W,fe]=(0,X.useState)(!1),[pe,me]=(0,X.useState)(null),[he,ge]=(0,X.useState)(!1),[_e,ve]=(0,X.useState)(null),[ye,be]=(0,X.useState)(``),K=(0,X.useRef)(!0),xe=(0,X.useRef)(null),{copyToClipboard:Se}=ne(),Ce=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;(0,X.useEffect)(()=>(K.current=!0,()=>{K.current=!1}),[]);let we=(0,X.useCallback)(async()=>{try{let[e,t]=await Promise.all([x(),S()]),n=e.state===`awaiting_approval`?await T():null;if(!K.current)return;a({status:e,identity:t,enrollment:n,readAt:Date.now()}),I(null)}catch(e){if(!K.current)return;I(e instanceof Error?e.message:`Unable to read Hub status.`)}},[]);(0,X.useEffect)(()=>{let e=N({lifecycle:M,run:we,resolveDelayMs:()=>lt,jitterRatio:.1});return xe.current=e,()=>{xe.current===e&&(xe.current=null),e.stop()}},[we]);let Te=(0,X.useCallback)(()=>xe.current?.refresh()??we(),[we]);(0,X.useEffect)(()=>{e&&e.getHubLaunchConfig().then(e=>{K.current&&(p(e),h(e.origin??``),O(e.nodeName??``),R(null))}).catch(e=>{K.current&&R(e instanceof Error?e.message:`Unable to read Hub launch configuration.`)})},[e]),(0,X.useEffect)(()=>{e?.getHostedIdentityState&&e.getHostedIdentityState().then(e=>{K.current&&(H(e),de(null))}).catch(()=>{K.current&&(H({status:`unavailable`}),de(`Unable to read the native account setup state.`))})},[e]);let Ee=(0,X.useCallback)(async t=>{let n=t===`connect`?e?.connectHostedIdentity:e?.disconnectHostedIdentity;if(n){le(!0),de(null);try{let e=await n();if(!K.current)return;H(e)}catch{if(!K.current)return;H({status:`unavailable`}),de(t===`connect`?`Automatic secure setup did not finish. Retry when the Hub is reachable.`:`Unable to clear the native account session.`)}finally{K.current&&le(!1)}}},[e]),De=(0,X.useCallback)(async()=>{if(e?.refreshDesktopWorkspaceCatalog){s(null);try{await e.refreshDesktopWorkspaceCatalog()}catch{s(`Unable to refresh this account's machine directory.`)}}},[e]),Oe=(0,X.useCallback)(async()=>{if(!(!e?.verifyDesktopWorkspaceApproval||!c)){s(null);try{await e.verifyDesktopWorkspaceApproval({nodeId:c.nodeId,environmentId:r.make(c.environmentId),payload:u.trim()});let t=te(r.make(c.environmentId));globalThis.setTimeout(t,ft),await e.cancelDesktopWorkspaceVerification?.(c.handle).catch(()=>void 0),l(null),d(``)}catch{s(`That approval code does not match this Desktop client, machine, account, or current node security state.`)}}},[e,u,c]),ke=(0,X.useCallback)(async t=>{if(e?.beginDesktopWorkspaceVerification){s(null);try{c&&await e.cancelDesktopWorkspaceVerification?.(c.handle).catch(()=>void 0);let n=await e.beginDesktopWorkspaceVerification({nodeId:t.nodeId,environmentId:r.make(t.environmentId)});l({...t,handle:n.handle}),d(``)}catch{s(`Unable to introduce this Desktop client to that machine. Confirm it is online and retry.`)}}},[e,c]),Le=(0,X.useCallback)(async(t,n)=>{let r=t===`connect`?e?.connectHostedGitHub:e?.disconnectHostedGitHub;if(r){fe(!0),me(null);try{let e=await r(n?{totpCode:n}:void 0);if(!K.current)return;H(e.state),e.outcome===`step-up-required`?(ve(t),be(``)):(ve(null),be(``),ge(!1),e.outcome===`last-primary-credential`?me(`Add another primary sign-in method before disconnecting GitHub.`):e.outcome===`unavailable`&&me(`GitHub account access is temporarily unavailable.`))}catch{K.current&&me(`GitHub account access is temporarily unavailable.`)}finally{K.current&&fe(!1)}}},[e]),Re=(0,X.useCallback)(async t=>{B(t),I(null);try{switch(t){case`enroll`:await _();break;case`cancel-enrollment`:await D();break;case`retry`:await w();break;case`leave`:await y();break;case`enable`:case`disable`:await e?.setHubLaunchConfig({enabled:t===`enable`});return;case`restart`:if(!e?.restartApp)throw Error(`Desktop restart is unavailable.`);await e.restartApp();return;case`open-hub`:{let e=f?.origin;e&&window.open(e,`_blank`,`noopener,noreferrer`);return}default:return}await Te()}catch(e){if(!K.current)return;I(e instanceof Error?e.message:`That didn't work.`)}finally{K.current&&B(null)}},[f,e,Te]),ze=(0,X.useCallback)(async()=>{if(!e||m.trim()===``){v(null),C(null);return}let t=await e.validateHubOrigin(m);if(K.current){if(t.ok){h(t.origin),v(null),C(null);return}C(t.suggestion??null),v({empty:`Enter a Hub address.`,too_long:`That address is too long.`,not_a_url:`That doesn't look like an address.`,insecure_scheme:`A Hub address must use https.`,has_credentials:`Remove the username and password from the address.`,has_path:`Use the Hub's address only, without a path.`,invalid:`That address can't be used.`}[t.reason])}},[e,m]),He=(0,X.useCallback)(async t=>{if(e){B(`enable`);try{await e.setHubLaunchConfig({origin:t})}catch(e){if(!K.current)return;I(e instanceof Error?e.message:`Unable to save the Hub address.`),B(null)}}},[e]),Ge=(0,X.useCallback)(e=>{O(e),A(e.trim().length>100?`Use 100 characters or fewer.`:null)},[]),Ke=(0,X.useCallback)(async()=>{if(!e)return;let t=E.trim();if(t.length>100){A(`Use 100 characters or fewer.`);return}P(!0),A(null);try{await e.setHubLaunchConfig({nodeName:t===``?null:t})}catch(e){if(!K.current)return;A(e instanceof Error?e.message:`Unable to save the Hub node name.`),P(!1)}},[e,E]),qe=(0,X.useCallback)(async t=>{if(e&&!(!await e.confirm(t?`Allow permissioned-file storage when the system credential store is unavailable? Ryco will restart. Existing keys are not moved.`:`Stop allowing permissioned-file Hub key storage? Ryco will restart.`)||!K.current)){ie(!0),R(null);try{await e.setHubLaunchConfig({allowFileSecretStore:t})}catch(e){if(!K.current)return;R(e instanceof Error?e.message:`Unable to save the key storage setting.`),ie(!1)}}},[e]),Je=(0,X.useCallback)(async()=>{if(e)try{let t=new URL(Z,window.location.href).toString();if(!await e.openExternal(t))throw Error(`The relay guide could not be opened.`);R(null)}catch(e){if(!K.current)return;R(e instanceof Error?e.message:`Unable to open the relay guide.`)}},[e]);if(!e)return null;let Ye=i!==null&&t-i.readAt>ut,Y=i===null?null:st(i.status,i.identity,t),Xe=i!==null&&ct(i.identity),Ze=m.trim()!==(f?.origin??``),Qe=E.trim()!==(f?.nodeName??``),$e=f!==null&&f.origin!==null&&e.getHostedIdentityState!==void 0&&e.connectHostedIdentity!==void 0&&i?.identity.enrolled===`none`&&(Y?.action===`enable`||Y?.action===`enroll`),$=(e,t)=>e===`none`?null:(0,Q.jsx)(G,{size:`xs`,variant:t,disabled:z!==null,onClick:()=>{if(e===`leave`){oe(!0);return}Re(e)},children:z===e?`Working…`:dt[e]});return(0,Q.jsxs)(Ve,{title:`Hub`,children:[(0,Q.jsx)(q,{title:`Connection`,description:$e?`Connect your Ryco account below. Ryco will register this Mac with this Hub automatically.`:Y===null?`Loading…`:Y.detail===null?`Reach this Mac from anywhere, including behind NAT or CGNAT, without opening a port.`:Y.detail,status:(0,Q.jsxs)(Q.Fragment,{children:[Y===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${Ye?`bg-muted-foreground/40`:Y.dot===`success`?`bg-success`:Y.dot===`warning`?`bg-warning`:Y.dot===`destructive`?`bg-destructive`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),Ye?`${Y.headline} · last checked ${Math.round((t-i.readAt)/1e3)}s ago`:$e?`Ready for account setup`:Y.headline]}),F?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:F}):null]}),control:Y===null?null:(0,Q.jsxs)(Q.Fragment,{children:[$($e?`none`:Y.action,Y.action===`leave`?`destructive-outline`:`outline`),$($e?`none`:Y.secondaryAction,Y.secondaryAction===`leave`?`destructive-outline`:`outline`)]}),children:(0,Q.jsx)(We,{children:i?.enrollment?(0,Q.jsxs)(`div`,{className:`pb-3.5`,children:[(0,Q.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground/80`,children:`Compare every field with the Hub's approval screen before approving.`}),(0,Q.jsxs)(Ue,{className:`rounded-xl border border-border/60 bg-muted/20 p-3`,children:[(0,Q.jsx)(J,{term:`Label`,children:i.enrollment.label}),(0,Q.jsx)(J,{term:`Platform`,children:`${i.enrollment.platformOs} · ${i.enrollment.platformArch}`}),(0,Q.jsx)(J,{term:`Version`,mono:!0,children:i.enrollment.clientVersion}),(0,Q.jsx)(J,{term:`Algorithm`,children:i.enrollment.algorithm}),(0,Q.jsx)(J,{term:`Fingerprint`,mono:!0,children:i.enrollment.fingerprint}),(0,Q.jsx)(J,{term:`Expires`,children:new Date(i.enrollment.expiresAt).toLocaleString()}),(0,Q.jsx)(J,{term:`Device code`,mono:!0,action:Ce?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>Se(i.enrollment.deviceCode),children:`Copy`}):null,children:i.enrollment.deviceCode})]}),(0,Q.jsx)(`p`,{className:`pt-2 text-[11px] text-muted-foreground/70`,children:`The device code only routes the request. It does not prove which machine you are approving.`}),(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 pt-2 text-xs text-warning`,children:[(0,Q.jsx)(se,{className:`size-3.5 shrink-0`}),`If the fingerprint on the Hub differs by even one character, deny it there and cancel here.`]})]}):null})}),f!==null&&f.origin!==null&&e.getHostedIdentityState!==void 0?(0,Q.jsx)(q,{title:`Ryco account`,description:V===null?`Checking this Mac's native account setup…`:$e&&V.status===`ready`?`You are signed in. Finish setup to register this Mac with the Hub and verify local trust automatically.`:V.status===`ready`?`Your native account session and this Mac's automatic node claim are ready. Local trust introduction is verified.`:V.status===`signed-out`?`Sign in in your browser. Ryco will claim this Mac's node and verify its local trust automatically.`:`Automatic secure setup did not finish. Existing node and trust state are preserved while you retry.`,status:(0,Q.jsxs)(Q.Fragment,{children:[V===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${$e&&V.status===`ready`?`bg-warning`:V.status===`ready`?`bg-success`:V.status===`unavailable`?`bg-warning`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),V.status===`ready`?$e?`Signed in · Node setup needed`:`Secure setup complete`:V.status===`unavailable`?`Setup needs attention`:`Not signed in`]}),ue?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:ue}):null]}),control:V===null?null:$e&&V.status===`ready`?(0,Q.jsx)(G,{size:`xs`,disabled:ce||!e.connectHostedIdentity,onClick:()=>void Ee(`connect`),children:ce?`Finishing setup…`:`Finish setup`}):V.status===`ready`?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:ce||!e.disconnectHostedIdentity,onClick:()=>void Ee(`disconnect`),children:ce?`Working…`:`Sign out`}):(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:ce||!e.connectHostedIdentity,onClick:()=>void Ee(`connect`),children:ce?`Opening browser…`:V.status===`unavailable`?`Retry secure setup`:`Connect account`})}):null,V?.status===`ready`&&e?.getDesktopWorkspaceState?(0,Q.jsxs)(q,{title:`Workspace machines`,description:`The Desktop client keeps each machine scoped independently. Cached lists do not open connections.`,status:o??`${n.machines.filter(e=>e.online).length} online · ${n.activeConnectionCount} connected`,control:(0,Q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>void De(),children:`Refresh`}),children:[(0,Q.jsx)(Ue,{children:n.machines.map(e=>(0,Q.jsx)(J,{term:e.label,action:e.nodeId&&e.online&&(e.nativeTrust===`unverified`||e.nativeTrust===`unknown`)?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>{ke({nodeId:e.nodeId,environmentId:e.environmentId})},children:`Verify this machine`}):null,children:e.nativeTrust===`verified`?e.online?`Verified · Online`:`Verified · Offline`:e.nativeTrust===`identity-conflict`?`Identity changed · Locked`:e.online?`Needs verification`:`Needs verification · Offline`},`${e.nodeId??`unknown`}:${e.environmentId}`))}),c?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 border-t border-border/60 py-3 sm:flex-row`,children:[(0,Q.jsx)(U,{value:u,onChange:e=>d(e.target.value),placeholder:`Paste the approval code shown by this exact node`,"aria-label":`Machine approval code`}),(0,Q.jsx)(G,{size:`sm`,disabled:u.trim().length===0,onClick:()=>void Oe(),children:`Verify`}),(0,Q.jsx)(G,{size:`sm`,variant:`ghost`,onClick:()=>{e.cancelDesktopWorkspaceVerification?.(c.handle).catch(()=>void 0),l(null),d(``)},children:`Cancel`})]}):null]}):null,V?.status===`ready`&&V.github!==void 0?(0,Q.jsx)(q,{title:V.github.identity?`GitHub · @${V.github.identity.login}`:`GitHub`,description:V.github.identity?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,status:pe?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:pe}):V.github.identity?.displayName?V.github.identity.displayName:null,control:V.github.linkAvailable?V.github.identity?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:W||!e?.disconnectHostedGitHub,onClick:()=>ge(!0),children:W?`Working…`:`Disconnect`}):(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:W||!e?.connectHostedGitHub,onClick:()=>void Le(`connect`),children:W?`Opening browser…`:`Connect GitHub`}):null}):null,(0,Q.jsx)(q,{title:`Hub address`,description:Xe?`The address of the Hub you or your team operate.`:`Locked while this machine is enrolled. Leave this Hub to change it.`,status:g?(0,Q.jsxs)(`span`,{className:`block text-destructive`,children:[g,b?(0,Q.jsxs)(`button`,{type:`button`,className:`ml-1 underline underline-offset-2`,onClick:()=>{h(b),v(null),C(null)},children:[`Use `,b]}):null]}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U,{value:m,disabled:!Xe||z!==null,placeholder:`https://…`,className:`w-64 font-mono text-xs`,onChange:e=>h(e.currentTarget.value),onBlur:()=>void ze()}),Xe&&Ze&&g===null&&m.trim()!==``?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:z!==null,onClick:()=>void He(m.trim()),children:`Save and restart`}):null]})}),(0,Q.jsx)(q,{title:`Node name`,description:Xe?`Choose the name proposed on the Hub approval screen. Leave it blank for a stable automatic name.`:i?.identity.enrolled===`pending`?`Locked while enrollment is pending. Cancel enrollment to change the proposed name.`:`Managed on the Hub after enrollment. An owner can rename this node from its Hub details.`,status:k?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:k}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U,{value:E,disabled:!Xe||z!==null||j,placeholder:`Automatic: machine name · node code`,"aria-label":`Hub node name`,className:`w-64 text-xs`,onChange:e=>Ge(e.currentTarget.value)}),Xe&&Qe&&k===null?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:z!==null||j,onClick:()=>void Ke(),children:j?`Saving…`:`Save and restart`}):null]})}),i!==null&&i.status.state===`online`?(0,Q.jsx)(q,{title:`Who can connect`,description:`Managed on the Hub, not here. Sessions arriving through the Hub carry a role: viewer reads, operator edits files and runs terminals, owner also changes credentials and server policy.`}):null,(0,Q.jsx)(rt,{config:f,identity:i?.identity??null,status:i?.status??null,nowMs:t,savingFileFallback:re||z!==null,configError:L,onFileFallbackChange:e=>void qe(e),onOpenGuide:()=>void Je()}),(0,Q.jsx)(Ie,{open:ae,onOpenChange:oe,children:(0,Q.jsxs)(Ne,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Fe,{children:`Leave this Hub?`}),(0,Q.jsxs)(Pe,{children:[`This erases this machine's Hub key. You can enrol again afterwards, but it will join as a new machine and needs a new approval.`,(0,Q.jsx)(`br`,{}),(0,Q.jsx)(`br`,{}),`It does `,(0,Q.jsx)(`strong`,{children:`not`}),` revoke anything on the Hub. The old entry stays there until an owner removes it.`]})]}),(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Me,{children:`Keep it`}),(0,Q.jsx)(G,{variant:`destructive`,disabled:z!==null,onClick:()=>{oe(!1),Re(`leave`)},children:`Erase this machine's key`})]})]})}),(0,Q.jsx)(Ie,{open:he,onOpenChange:ge,children:(0,Q.jsxs)(Ne,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Fe,{children:`Disconnect GitHub?`}),(0,Q.jsx)(Pe,{children:`GitHub stops working as a Ryco sign-in method. Ryco refuses this change when it is your only primary sign-in method. Repository access is separate.`})]}),(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Me,{children:`Cancel`}),(0,Q.jsx)(G,{variant:`destructive`,disabled:W,onClick:()=>void Le(`disconnect`),children:`Disconnect GitHub`})]})]})}),(0,Q.jsx)(Ie,{open:_e!==null,onOpenChange:t=>{!t&&!W&&(_e===`connect`&&e?.cancelHostedGitHubConnection?.(),ve(null),be(``))},children:(0,Q.jsxs)(Ne,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Fe,{children:`Confirm this account change`}),(0,Q.jsx)(Pe,{children:`Enter a current code from your authenticator app. The pending GitHub authorization is reused; Ryco does not reopen the browser.`})]}),(0,Q.jsx)(U,{"aria-label":`Authenticator code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,value:ye,onChange:e=>be(e.currentTarget.value.replace(/\D/gu,``))}),(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Me,{children:`Cancel`}),(0,Q.jsx)(G,{disabled:W||ye.length<6,onClick:()=>{_e!==null&&Le(_e,ye)},children:`Confirm`})]})]})})]})}var mt=443,ht=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function gt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:ht.format(t)}function _t(e){let t=(0,Ze.c)(21),{tooltipText:n,dotClassName:r,pingClassName:i}=e,a;t[0]===i?a=t[1]:(a=i?(0,Q.jsx)(`span`,{className:k(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,i)}):null,t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=k(`relative inline-flex size-2 rounded-full`,r),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,Q.jsx)(`span`,{className:o}),t[4]=o,t[5]=s);let c;t[6]!==a||t[7]!==s?(c=(0,Q.jsxs)(Q.Fragment,{children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8];let l=c;if(!n){let e;return t[9]===l?e=t[10]:(e=(0,Q.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:l}),t[9]=l,t[10]=e),e}let u;t[11]!==l||t[12]!==n?(u=(0,Q.jsx)(`button`,{type:`button`,title:n,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:l}),t[11]=l,t[12]=n,t[13]=u):u=t[13];let d=u,f;t[14]===d?f=t[15]:(f=(0,Q.jsx)(ce,{render:d}),t[14]=d,t[15]=f);let p;t[16]===n?p=t[17]:(p=(0,Q.jsx)(le,{side:`top`,className:`max-w-80 whitespace-pre-wrap leading-tight`,children:n}),t[16]=n,t[17]=p);let m;return t[18]!==f||t[19]!==p?(m=(0,Q.jsxs)(ue,{children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function vt(e,t,n){let r=e?.connectionState??`disconnected`;if(r===`connected`){let r=e?.connectedAt??t.lastConnectedAt;return r?`Connected for ${H(r,n)}`:null}return r===`connecting`?null:r===`error`?e?.lastError??`An unknown connection error occurred.`:t.lastConnectedAt?`Last connected at ${gt(t.lastConnectedAt)}`:`Not connected yet.`}function yt(e){let t=e.username?`${e.username}@${e.hostname}`:e.hostname;return e.port?`${t}:${e.port}`:t}function bt(e){let t=e.host.trim();if(t.length===0)throw Error(`SSH host or alias is required.`);let n=t,r=e.username.trim()||null,i=null,a=n.lastIndexOf(`@`);if(a>0){let e=n.slice(0,a).trim();n=n.slice(a+1).trim(),!r&&e.length>0&&(r=e)}let o=/^\[([^\]]+)\](?::(\d+))?$/u.exec(n);if(o)n=o[1].trim(),o[2]&&(i=Number.parseInt(o[2],10));else{let e=n.split(`:`);e.length===2&&/^\d+$/u.test(e[1]??``)&&(n=e[0].trim(),i=Number.parseInt(e[1],10))}let s=e.port.trim();if(s.length>0&&(i=Number.parseInt(s,10)),n.length===0)throw Error(`SSH host or alias is required.`);if(i!==null&&(!Number.isInteger(i)||i<=0||i>65535))throw Error(`SSH port must be between 1 and 65535.`);return{alias:n,hostname:n,username:r,port:i}}function xt(e){let t=e.trim();if(!t)return null;try{let e=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//u.test(t)||t.startsWith(`//`)?t:`https://${t}`,n=new URL(e,window.location.origin),r=P(n);if(r)return{host:r.host,pairingCode:r.token};let i=j(n);return i?{host:n.origin,pairingCode:i}:null}catch{return null}}function St(e){let t=xt(e.host);if(t)return t;let n=e.host.trim(),r=e.pairingCode.trim();if(!n)throw Error(`Enter a backend host.`);if(!r)throw Error(`Enter a pairing code.`);return{host:n,pairingCode:r}}function Ct(e){let t=`Failed to connect SSH host.`;return(e instanceof Error?e.message:t).replace(/^Error invoking remote method 'desktop:ensure-ssh-environment':\s*/u,``).replace(/^Ssh[A-Za-z]+Error:\s*/u,``).trim()||t}var wt=`border-t border-border/60 px-4 py-4 first:border-t-0 sm:px-5`,Tt=`border-t border-border/60 px-4 py-2.5 first:border-t-0 sm:px-5`,Et=`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`;function Dt(e){return wt}function Ot(e,t){return e===`endpoint-rail`?k(`relative border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,!t&&`bg-muted/20`):k(Tt,!t&&`bg-muted/24`)}function kt(e){return[...e].toSorted((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function At(e){return[...e].toSorted((e,t)=>e.current===t.current?e.connected===t.connected?new Date(t.issuedAt).getTime()-new Date(e.issuedAt).getTime():e.connected?-1:1:e.current?-1:1)}function jt(e){return{...e,createdAt:i(e.createdAt),expiresAt:i(e.expiresAt)}}function Mt(e){return{...e,issuedAt:i(e.issuedAt),expiresAt:i(e.expiresAt),lastConnectedAt:e.lastConnectedAt===null?null:i(e.lastConnectedAt)}}function Nt(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return kt([...e,t]);let r=[...e];return r[n]=t,kt(r)}function Pt(e,t){return e.filter(e=>e.id!==t)}function Ft(e,t){let n=e.findIndex(e=>e.sessionId===t.sessionId);if(n===-1)return At([...e,t]);let r=[...e];return r[n]=t,At(r)}function It(e,t){return e.filter(e=>e.sessionId!==t)}function Lt(e,t){let n=e.filter(e=>e.status!==`unavailable`);if(t){let e=n.find(e=>zt(e)===t);if(e)return e}return n.find(e=>e.isDefault)??n.find(e=>e.reachability!==`loopback`)??n.find(e=>e.compatibility.hostedHttpsApp===`compatible`)??null}function Rt(e){return e.id.startsWith(`tailscale-magicdns:`)}function zt(e){if(e.id.startsWith(`desktop-loopback:`)||e.id.startsWith(`server-loopback:`))return`desktop-core:loopback:http`;if(e.id.startsWith(`desktop-lan:`)||e.id.startsWith(`server-network:`))return`desktop-core:lan:http`;if(e.id.startsWith(`tailscale-ip:`))return`tailscale:ip:http`;if(Rt(e))return`tailscale:magicdns:https`;let t=`unknown`;try{t=new URL(e.httpBaseUrl).protocol.replace(/:$/u,``)}catch{}return`${e.provider.id}:${e.reachability}:${t}:${e.label}`}function Bt(e){switch(e){case`mixed-content-blocked`:return`Hosted app blocked`;case`requires-configuration`:return`Setup required for hosted app`;default:return null}}function Vt(e){switch(e){case`mixed-content-blocked`:return`The hosted HTTPS app cannot connect to HTTP endpoints because browsers block mixed content.`;case`requires-configuration`:return`Configure HTTPS access before using this endpoint from the hosted app.`;default:return null}}function Ht(e,t){return e.compatibility.hostedHttpsApp===`compatible`?$e(e.httpBaseUrl,t)??Qe(e.httpBaseUrl,t):Qe(e.httpBaseUrl,t)}function Ut(e){let t=new URL(`/pair`,window.location.href);return A(t,e).toString()}function Wt(e){try{let t=new URL(e);return t.pathname===`/pair`&&t.searchParams.has(`host`)}catch{return!1}}var Gt=(0,X.memo)(function(e){let t=(0,Ze.c)(146),{pairingLink:n,endpointUrl:r,endpoints:i,defaultEndpointKey:a,presentation:o,revokingPairingLinkId:s,onRevoke:c}=e,l=o===void 0?`current`:o,u=Be(1e3),d;t[0]===n.expiresAt?d=t[1]:(d=new Date(n.expiresAt).getTime(),t[0]=n.expiresAt,t[1]=d);let f=d,[p,m]=(0,X.useState)(!1),h;t[2]===n.credential?h=t[3]:(h=Ut(n.credential),t[2]=n.credential,t[3]=h);let g=h,_;t[4]!==r||t[5]!==n.credential?(_=r!=null&&r!==``?$e(r,n.credential):null,t[4]=r,t[5]=n.credential,t[6]=_):_=t[6];let v=_,y;if(t[7]!==a||t[8]!==i||t[9]!==n.credential){let e=Lt(i,a);y=e?Ht(e,n.credential):null,t[7]=a,t[8]=i,t[9]=n.credential,t[10]=y}else y=t[10];let x=y,S;if(t[11]!==i||t[12]!==n.credential){let e;t[14]===n.credential?e=t[15]:(e=e=>{let t=Ht(e,n.credential);return{key:zt(e),label:e.label,url:t,detail:Wt(t)?`Hosted app link`:`Backend pairing URL`}},t[14]=n.credential,t[15]=e),S=i.filter(tn).map(e),t[11]=i,t[12]=n.credential,t[13]=S}else S=t[13];let C=S,w;t[16]!==g||t[17]!==x||t[18]!==r||t[19]!==v||t[20]!==n.credential?(w=x??(r!=null&&r!==``?v??Qe(r,n.credential):b(window.location.hostname)?null:g),t[16]=g,t[17]=x,t[18]=r,t[19]=v,t[20]=n.credential,t[21]=w):w=t[21];let T=w,E=T??n.credential,D=T!==null&&Wt(T),O=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null,k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(k={onCopy:nn,onError:(e,t)=>{m(!0),B.add(fe({type:`error`,title:O?t===`hosted-link`?`Could not copy hosted app link`:t===`link`?`Could not copy pairing URL`:`Could not copy pairing code`:`Clipboard copy unavailable`,description:O?e.message:`Showing the full value instead.`}))}},t[22]=k):k=t[22];let{copyToClipboard:A}=ne(k),j;t[23]===A?j=t[24]:(j=(e,t)=>{A(e,t)},t[23]=A,t[24]=j);let M=j,N=rn,P;t[25]!==M||t[26]!==n.credential?(P=()=>{M(n.credential,`code`)},t[25]=M,t[26]=n.credential,t[27]=P):P=t[27];let F=P,I;t[28]!==M||t[29]!==T?(I=()=>{T&&M(T,N(T))},t[28]=M,t[29]=T,t[30]=I):I=t[30];let ee=I,te;t[31]===n.expiresAt?te=t[32]:(te=gt(n.expiresAt),t[31]=n.expiresAt,t[32]=te);let L=te,R=n.role===`owner`?`Owner`:`Client`,re=n.label??`${R} link`,ae;t[33]!==a||t[34]!==C?(ae=C.find(e=>e.key===a)??C[0]??null,t[33]=a,t[34]=C,t[35]=ae):ae=t[35];let oe=ae?.label??`URL`,se,H,ce,le,ue,de,U,W,_e;if(t[36]!==M||t[37]!==oe||t[38]!==C||t[39]!==L||t[40]!==f||t[41]!==F||t[42]!==ee||t[43]!==p||t[44]!==u||t[45]!==n.createdAt||t[46]!==n.expiresAt||t[47]!==l||t[48]!==re||t[49]!==R||t[50]!==T){_e=Symbol.for(`react.early_return_sentinel`);bb0:{let e=C.filter(an),r=C.filter(on),i;t[60]!==M||t[61]!==C?(i=(e,t)=>{let n=e===void 0?C:e,r=t===void 0||t;return n.map(e=>(0,Q.jsx)(De,{onClick:()=>M(e.url,N(e.url)),children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:e.label}),r?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.detail}):null]})},e.key))},t[60]=M,t[61]=C,t[62]=i):i=t[62];let a=i,o;t[63]===F?o=t[64]:(o=e=>(0,Q.jsx)(De,{onClick:F,children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:`Copy code`}),e===void 0||e?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:`Token only`}):null]})}),t[63]=F,t[64]=o);let s=o,c;t[65]===a?c=t[66]:(c=(e,t,n)=>t.length>0?(0,Q.jsxs)(Q.Fragment,{children:[n?(0,Q.jsx)(Ce,{}):null,(0,Q.jsxs)(xe,{children:[(0,Q.jsx)(Te,{children:e}),a(t,!1)]})]}):null,t[65]=a,t[66]=c);let d=c,h=t=>(0,Q.jsxs)(Q.Fragment,{children:[t?.codeFirst?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(xe,{children:[(0,Q.jsx)(Te,{children:`Pairing code`}),s(!1)]}),C.length>0?(0,Q.jsx)(Ce,{}):null]}):null,d(`Pairing URLs`,e,!1),d(`Hosted app link`,r,e.length>0),t?.codeFirst?null:(0,Q.jsxs)(Q.Fragment,{children:[C.length>0?(0,Q.jsx)(Ce,{}):null,(0,Q.jsxs)(xe,{children:[(0,Q.jsx)(Te,{children:`Pairing code`}),s(!1)]})]})]});if(f<=u){_e=null;break bb0}t[67]===l?W=t[68]:(W=Dt(l),t[67]=l,t[68]=W),de=Et;let g;t[69]===n.createdAt?g=t[70]:(g=gt(n.createdAt),t[69]=n.createdAt,t[70]=g);let _=`Link created at ${g}`,v;t[71]===_?v=t[72]:(v=(0,Q.jsx)(_t,{tooltipText:_,dotClassName:`bg-amber-400`}),t[71]=_,t[72]=v);let y;t[73]===re?y=t[74]:(y=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:re}),t[73]=re,t[74]=y);let b;t[75]===T?b=t[76]:(b=T?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Re,{openOnHover:!0,delay:250,closeDelay:100,render:(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground/50 outline-none hover:text-foreground`,"aria-label":`Show QR code`}),children:(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-3`})}),(0,Q.jsx)(Le,{side:`top`,align:`start`,tooltipStyle:!0,className:`w-max`,children:(0,Q.jsx)(qe,{value:T,size:88,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})})]}):null,t[75]=T,t[76]=b);let x;t[77]===b?x=t[78]:(x=(0,Q.jsx)(ze,{children:b}),t[77]=b,t[78]=x);let S;t[79]!==v||t[80]!==y||t[81]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[v,y,x]}),t[79]=v,t[80]=y,t[81]=x,t[82]=S):S=t[82];let w;t[83]!==u||t[84]!==n.expiresAt?(w=V(n.expiresAt,u),t[83]=u,t[84]=n.expiresAt,t[85]=w):w=t[85];let E;t[86]!==R||t[87]!==w?(E=[R,w],t[86]=R,t[87]=w,t[88]=E):E=t[88];let D=E.join(` · `),k;t[89]!==L||t[90]!==D?(k=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,title:L,children:D}),t[89]=L,t[90]=D,t[91]=k):k=t[91];let A;t[92]===T?A=t[93]:(A=T===null?(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Copy the token and pair from another client using this backend's reachable host.`}):null,t[92]=T,t[93]=A),t[94]!==S||t[95]!==k||t[96]!==A?(U=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[S,k,A]}),t[94]=S,t[95]=k,t[96]=A,t[97]=U):U=t[97],ue=`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,se=K,H=p,ce=m,le=O?(0,Q.jsx)(Q.Fragment,{children:T?(0,Q.jsxs)(Ke,{"aria-label":`Copy selected endpoint`,children:[(0,Q.jsx)(G,{size:`xs`,variant:`outline`,className:`max-w-56`,title:`Copy pairing URL for: ${oe}`,onClick:ee,children:(0,Q.jsxs)(`span`,{className:`truncate`,children:[`Copy pairing URL for: `,oe]})}),(0,Q.jsx)(Ge,{}),(0,Q.jsxs)(we,{children:[(0,Q.jsx)(Ee,{render:(0,Q.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Choose endpoint to copy`}),children:(0,Q.jsx)(z,{className:`size-3.5`})}),(0,Q.jsx)(Se,{align:`end`,className:`min-w-60`,children:h()})]})]}):(0,Q.jsx)(G,{size:`xs`,variant:`outline`,onClick:F,children:`Copy code`})}):(0,Q.jsx)(ge,{render:(0,Q.jsx)(G,{size:`xs`,variant:`outline`}),children:T?`Show link`:`Show code`})}t[36]=M,t[37]=oe,t[38]=C,t[39]=L,t[40]=f,t[41]=F,t[42]=ee,t[43]=p,t[44]=u,t[45]=n.createdAt,t[46]=n.expiresAt,t[47]=l,t[48]=re,t[49]=R,t[50]=T,t[51]=se,t[52]=H,t[53]=ce,t[54]=le,t[55]=ue,t[56]=de,t[57]=U,t[58]=W,t[59]=_e}else se=t[51],H=t[52],ce=t[53],le=t[54],ue=t[55],de=t[56],U=t[57],W=t[58],_e=t[59];if(_e!==Symbol.for(`react.early_return_sentinel`))return _e;let Oe=T?D?`Hosted app pairing link`:`Pairing link`:`Pairing code`,Ae;t[98]===Oe?Ae=t[99]:(Ae=(0,Q.jsx)(me,{children:Oe}),t[98]=Oe,t[99]=Ae);let je=T?D?`Clipboard copy is unavailable here. Open or manually copy this hosted app link on the device you want to connect.`:`Clipboard copy is unavailable here. Open or manually copy this full pairing URL on the device you want to connect.`:`Clipboard copy is unavailable here. Manually copy this code into another client.`,Me;t[100]===je?Me=t[101]:(Me=(0,Q.jsx)(ye,{children:je}),t[100]=je,t[101]=Me);let Ne;t[102]!==Ae||t[103]!==Me?(Ne=(0,Q.jsxs)(pe,{children:[Ae,Me]}),t[102]=Ae,t[103]=Me,t[104]=Ne):Ne=t[104];let Pe=T?4:3,Fe;t[105]!==E||t[106]!==Pe?(Fe=(0,Q.jsx)(ke,{readOnly:!0,value:E,rows:Pe,className:`text-xs leading-relaxed`,onFocus:sn,onClick:cn}),t[105]=E,t[106]=Pe,t[107]=Fe):Fe=t[107];let Ie;t[108]===T?Ie=t[109]:(Ie=T?(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border/60 bg-muted/30 p-4`,children:(0,Q.jsx)(qe,{value:T,size:132,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})}):null,t[108]=T,t[109]=Ie);let Ve;t[110]!==Fe||t[111]!==Ie?(Ve=(0,Q.jsxs)(ve,{className:`space-y-4`,children:[Fe,Ie]}),t[110]=Fe,t[111]=Ie,t[112]=Ve):Ve=t[112];let He;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,Q.jsx)(G,{variant:`outline`,onClick:()=>m(!1),children:`Done`}),t[113]=He):He=t[113];let q;t[114]===F?q=t[115]:(q=O?(0,Q.jsx)(G,{variant:`outline`,size:`xs`,onClick:F,children:`Copy code`}):null,t[114]=F,t[115]=q);let J;t[116]===q?J=t[117]:(J=(0,Q.jsxs)(he,{variant:`bare`,children:[He,q]}),t[116]=q,t[117]=J);let Ue;t[118]!==Ne||t[119]!==Ve||t[120]!==J?(Ue=(0,Q.jsxs)(be,{className:`max-w-md`,children:[Ne,Ve,J]}),t[118]=Ne,t[119]=Ve,t[120]=J,t[121]=Ue):Ue=t[121];let We;t[122]!==se||t[123]!==H||t[124]!==ce||t[125]!==le||t[126]!==Ue?(We=(0,Q.jsxs)(se,{open:H,onOpenChange:ce,children:[le,Ue]}),t[122]=se,t[123]=H,t[124]=ce,t[125]=le,t[126]=Ue,t[127]=We):We=t[127];let Je=s===n.id,Ye;t[128]!==c||t[129]!==n.id?(Ye=()=>void c(n.id),t[128]=c,t[129]=n.id,t[130]=Ye):Ye=t[130];let Y=s===n.id?`Revoking…`:`Revoke`,Xe;t[131]!==Je||t[132]!==Ye||t[133]!==Y?(Xe=(0,Q.jsx)(G,{size:`xs`,variant:`destructive-outline`,disabled:Je,onClick:Ye,children:Y}),t[131]=Je,t[132]=Ye,t[133]=Y,t[134]=Xe):Xe=t[134];let Z;t[135]!==ue||t[136]!==We||t[137]!==Xe?(Z=(0,Q.jsxs)(`div`,{className:ue,children:[We,Xe]}),t[135]=ue,t[136]=We,t[137]=Xe,t[138]=Z):Z=t[138];let $;t[139]!==de||t[140]!==U||t[141]!==Z?($=(0,Q.jsxs)(`div`,{className:de,children:[U,Z]}),t[139]=de,t[140]=U,t[141]=Z,t[142]=$):$=t[142];let et;return t[143]!==W||t[144]!==$?(et=(0,Q.jsx)(`div`,{className:W,children:$}),t[143]=W,t[144]=$,t[145]=et):et=t[145],et}),Kt=(0,X.memo)(function(e){let t=(0,Ze.c)(50),{clientSession:n,presentation:r,revokingClientSessionId:i,onRevokeSession:a}=e,o=r===void 0?`current`:r,s=Be(1e3),c=n.current||n.connected,l=n.lastConnectedAt,u;t[0]!==c||t[1]!==l||t[2]!==s?(u=c?l?`Connected for ${H(l,s)}`:`Connected`:l?`Last connected at ${gt(l)}`:`Not connected yet.`,t[0]=c,t[1]=l,t[2]=s,t[3]=u):u=t[3];let d=u,f=n.role===`owner`?`Owner`:`Client`,p;t[4]===n.client.deviceType?p=t[5]:(p=n.client.deviceType===`unknown`?null:n.client.deviceType[0]?.toUpperCase()+n.client.deviceType.slice(1),t[4]=n.client.deviceType,t[5]=p);let m=n.client.os??null,h=n.client.browser??null,g=n.client.ipAddress??null,_;t[6]!==p||t[7]!==m||t[8]!==h||t[9]!==g?(_=[p,m,h,g].filter(ln),t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=_,y;t[11]!==n.client.browser||t[12]!==n.client.label||t[13]!==n.client.os||t[14]!==n.subject?(y=n.client.label??([n.client.os,n.client.browser].filter(Boolean).join(` · `)||n.subject),t[11]=n.client.browser,t[12]=n.client.label,t[13]=n.client.os,t[14]=n.subject,t[15]=y):y=t[15];let b=y,x;t[16]===o?x=t[17]:(x=Dt(o),t[16]=o,t[17]=x);let S=c?`bg-success`:`bg-muted-foreground/30`,C;t[18]!==d||t[19]!==S?(C=(0,Q.jsx)(_t,{tooltipText:d,dotClassName:S,pingClassName:null}),t[18]=d,t[19]=S,t[20]=C):C=t[20];let w;t[21]===b?w=t[22]:(w=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:b}),t[21]=b,t[22]=w);let T;t[23]===n.current?T=t[24]:(T=n.current?(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 rounded-md border border-border/50 bg-muted/50 px-1 py-0.5`,children:`This device`}):null,t[23]=n.current,t[24]=T);let E;t[25]!==C||t[26]!==w||t[27]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[C,w,T]}),t[25]=C,t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==v||t[30]!==f?(D=[f,...v],t[29]=v,t[30]=f,t[31]=D):D=t[31];let O=D.join(` · `),k;t[32]===O?k=t[33]:(k=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:O}),t[32]=O,t[33]=k);let A;t[34]!==E||t[35]!==k?(A=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,k]}),t[34]=E,t[35]=k,t[36]=A):A=t[36];let j;t[37]!==n.current||t[38]!==n.sessionId||t[39]!==a||t[40]!==i?(j=n.current?null:(0,Q.jsx)(G,{size:`xs`,variant:`destructive-outline`,disabled:i===n.sessionId,onClick:()=>void a(n.sessionId),children:i===n.sessionId?`Revoking…`:`Revoke`}),t[37]=n.current,t[38]=n.sessionId,t[39]=a,t[40]=i,t[41]=j):j=t[41];let M;t[42]===j?M=t[43]:(M=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:j}),t[42]=j,t[43]=M);let N;t[44]!==A||t[45]!==M?(N=(0,Q.jsxs)(`div`,{className:Et,children:[A,M]}),t[44]=A,t[45]=M,t[46]=N):N=t[46];let P;return t[47]!==N||t[48]!==x?(P=(0,Q.jsx)(`div`,{className:x,children:N}),t[47]=N,t[48]=x,t[49]=P):P=t[49],P}),qt=(0,X.memo)(function({clientSessions:e,isRevokingOtherClients:t,onRevokeOtherClients:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),[s,c]=(0,X.useState)(!1),l=(0,X.useCallback)(async()=>{c(!0);try{await E(a),o(``),i(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to create pairing URL.`;B.add(fe({type:`error`,title:`Could not create pairing URL`,description:t}))}finally{c(!1)}},[a]);return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(G,{size:`xs`,variant:`destructive-outline`,disabled:t||e.every(e=>e.current),onClick:()=>void n(),children:t?`Revoking…`:`Revoke others`}),(0,Q.jsxs)(K,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Q.jsx)(ge,{render:(0,Q.jsxs)(G,{size:`xs`,variant:`default`,children:[(0,Q.jsx)(re,{className:`size-3`}),`Create link`]})}),(0,Q.jsxs)(be,{className:`max-w-sm`,children:[(0,Q.jsxs)(pe,{children:[(0,Q.jsx)(me,{children:`Create pairing link`}),(0,Q.jsx)(ye,{children:`Generate a one-time link that another device can use to pair with this backend as an authorized client.`})]}),(0,Q.jsx)(ve,{children:(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Client label (optional)`}),(0,Q.jsx)(U,{value:a,onChange:e=>o(e.target.value),placeholder:`e.g. Living room iPad`,disabled:s,autoFocus:!0})]})}),(0,Q.jsxs)(he,{variant:`bare`,children:[(0,Q.jsx)(G,{variant:`outline`,disabled:s,onClick:()=>i(!1),children:`Cancel`}),(0,Q.jsx)(G,{disabled:s,onClick:()=>void l(),children:s?`Creating…`:`Create link`})]})]})]})]})}),Jt=(0,X.memo)(function(e){let t=(0,Ze.c)(33),{endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:a,isLoading:o,pairingLinks:s,clientSessions:c,revokingPairingLinkId:l,revokingClientSessionId:u,onRevokePairingLink:d,onRevokeClientSession:f}=e,p=a===void 0?`current`:a,m;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==d||t[4]!==s||t[5]!==p||t[6]!==l){let e;t[8]!==i||t[9]!==n||t[10]!==r||t[11]!==d||t[12]!==p||t[13]!==l?(e=e=>(0,Q.jsx)(Gt,{pairingLink:e,endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:p,revokingPairingLinkId:l,onRevoke:d},e.id),t[8]=i,t[9]=n,t[10]=r,t[11]=d,t[12]=p,t[13]=l,t[14]=e):e=t[14],m=s.map(e),t[0]=i,t[1]=n,t[2]=r,t[3]=d,t[4]=s,t[5]=p,t[6]=l,t[7]=m}else m=t[7];let h;if(t[15]!==c||t[16]!==f||t[17]!==p||t[18]!==u){let e;t[20]!==f||t[21]!==p||t[22]!==u?(e=e=>(0,Q.jsx)(Kt,{clientSession:e,presentation:p,revokingClientSessionId:u,onRevokeSession:f},e.sessionId),t[20]=f,t[21]=p,t[22]=u,t[23]=e):e=t[23],h=c.map(e),t[15]=c,t[16]=f,t[17]=p,t[18]=u,t[19]=h}else h=t[19];let g;t[24]!==c.length||t[25]!==o||t[26]!==s.length||t[27]!==p?(g=s.length===0&&c.length===0&&!o?(0,Q.jsx)(`div`,{className:Dt(p),children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:`No pairing links or client sessions.`})}):null,t[24]=c.length,t[25]=o,t[26]=s.length,t[27]=p,t[28]=g):g=t[28];let _;return t[29]!==m||t[30]!==h||t[31]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[m,h,g]}),t[29]=m,t[30]=h,t[31]=g,t[32]=_):_=t[32],_}),Yt=(0,X.memo)(function(e){let t=(0,Ze.c)(58),{endpoint:n,isDefault:r,presentation:i,onSetDefault:a,onSetupTailscaleServe:o,onDisableTailscaleServe:s,isUpdatingTailscaleServe:c}=e,l=i===void 0?`current`:i,u=n.status===`available`,d;t[0]===n?d=t[1]:(d=Rt(n)&&n.status!==`available`,t[0]=n,t[1]=d);let f=d,p;t[2]===n.compatibility.hostedHttpsApp?p=t[3]:(p=Bt(n.compatibility.hostedHttpsApp),t[2]=n.compatibility.hostedHttpsApp,t[3]=p);let m=p,h;t[4]===n.compatibility.hostedHttpsApp?h=t[5]:(h=Vt(n.compatibility.hostedHttpsApp),t[4]=n.compatibility.hostedHttpsApp,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=Rt(n)&&n.status===`available`,t[6]=n,t[7]=_);let v=_,y=!f,b=l===`endpoint-rail`,x;t[8]!==u||t[9]!==l?(x=Ot(l,u),t[8]=u,t[9]=l,t[10]=x):x=t[10];let S;t[11]!==r||t[12]!==b?(S=b&&r?(0,Q.jsx)(`span`,{className:`absolute inset-y-2 left-0 w-1 rounded-r-full bg-primary`,"aria-hidden":!0}):null,t[11]=r,t[12]=b,t[13]=S):S=t[13];let C;t[14]===n.label?C=t[15]:(C=(0,Q.jsx)(`h3`,{className:`shrink-0 text-sm leading-5 font-medium text-foreground`,children:n.label}),t[14]=n.label,t[15]=C);let w;t[16]!==n.httpBaseUrl||t[17]!==y?(w=y?(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs leading-5 text-muted-foreground`,title:n.httpBaseUrl,children:n.httpBaseUrl}):null,t[16]=n.httpBaseUrl,t[17]=y,t[18]=w):w=t[18];let T;t[19]===u?T=t[20]:(T=u?null:(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1 py-0.5 text-[10px] text-muted-foreground`,children:`Setup required`}),t[19]=u,t[20]=T);let E;t[21]!==g||t[22]!==m?(E=m?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 px-1 py-0.5 text-[10px] text-amber-700 dark:text-amber-300`,title:g??void 0,children:[(0,Q.jsx)(se,{"aria-hidden":!0,className:`size-3`}),m]}):null,t[21]=g,t[22]=m,t[23]=E):E=t[23];let D;t[24]!==T||t[25]!==E||t[26]!==C||t[27]!==w?(D=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[C,w,T,E]}),t[24]=T,t[25]=E,t[26]=C,t[27]=w,t[28]=D):D=t[28];let O;t[29]===r?O=t[30]:(O=r?(0,Q.jsx)(`span`,{className:`rounded-md border border-primary/30 bg-primary/10 px-1 py-0.5 text-[10px] text-primary`,children:`Default`}):null,t[29]=r,t[30]=O);let k;t[31]!==n||t[32]!==c||t[33]!==f||t[34]!==o?(k=f?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>o(n),disabled:c,children:c?`Restarting…`:`Setup`}):null,t[31]=n,t[32]=c,t[33]=f,t[34]=o,t[35]=k):k=t[35];let A;t[36]!==v||t[37]!==n||t[38]!==c||t[39]!==s?(A=v?(0,Q.jsx)(G,{size:`xs`,variant:`destructive-outline`,onClick:()=>s(n),disabled:c,children:c?`Restarting…`:`Disable`}):null,t[36]=v,t[37]=n,t[38]=c,t[39]=s,t[40]=A):A=t[40];let j;t[41]!==n||t[42]!==r||t[43]!==f||t[44]!==a?(j=!f&&!r?(0,Q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>a(n),children:`Set as default`}):null,t[41]=n,t[42]=r,t[43]=f,t[44]=a,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==k||t[48]!==A||t[49]!==j?(M=(0,Q.jsxs)(`div`,{className:`ml-auto flex min-h-6 shrink-0 items-center justify-end gap-2`,children:[O,k,A,j]}),t[46]=O,t[47]=k,t[48]=A,t[49]=j,t[50]=M):M=t[50];let N;t[51]!==D||t[52]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex min-h-6 min-w-0 flex-col gap-2 sm:-my-0.5 sm:flex-row sm:items-center`,children:[D,M]}),t[51]=D,t[52]=M,t[53]=N):N=t[53];let P;return t[54]!==N||t[55]!==x||t[56]!==S?(P=(0,Q.jsxs)(`div`,{className:x,children:[S,N]}),t[54]=N,t[55]=x,t[56]=S,t[57]=P):P=t[57],P});function Xt(e){let t=(0,Ze.c)(17),{endpoint:n,hiddenEndpointCount:r,expanded:i,onToggleExpanded:a,fallback:o}=e;if(!n)return o;let s;t[0]===n.httpBaseUrl?s=t[1]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:n.httpBaseUrl}),t[0]=n.httpBaseUrl,t[1]=s);let c;t[2]===n.compatibility.hostedHttpsApp?c=t[3]:(c=Bt(n.compatibility.hostedHttpsApp)?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[11px] text-amber-700 dark:text-amber-300`,title:Vt(n.compatibility.hostedHttpsApp)??void 0,children:[(0,Q.jsx)(se,{"aria-hidden":!0,className:`size-3`}),Bt(n.compatibility.hostedHttpsApp)]}):null,t[2]=n.compatibility.hostedHttpsApp,t[3]=c);let l;t[4]!==i||t[5]!==r?(l=r>0?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs font-medium`,children:i?`Hide`:`+${r}`}):null,t[4]=i,t[5]=r,t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d=u,f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Reachable at`}),t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==d?(p=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-1`,children:[f,r>0?(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-baseline gap-2 border-b border-dotted border-muted-foreground/60 text-left text-muted-foreground underline-offset-4 hover:border-foreground hover:text-foreground`,onClick:a,"aria-expanded":i,children:d}):(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-2`,children:d})]}),t[12]=i,t[13]=r,t[14]=a,t[15]=d,t[16]=p):p=t[16],p}function Zt(e){let t=(0,Ze.c)(57),{environmentId:n,reconnectingEnvironmentId:r,disconnectingEnvironmentId:i,removingEnvironmentId:a,onConnect:s,onDisconnect:c,onRemove:l}=e,u=Be(1e3),d;t[0]===n?d=t[1]:(d=e=>e.byId[n]??null,t[0]=n,t[1]=d);let f=m(d),h;t[2]===n?h=t[3]:(h=e=>e.byId[n]??null,t[2]=n,t[3]=h);let g=o(h);if(!f)return null;let _=g?.connectionState??`disconnected`,v=_===`connected`,y=_===`connecting`||r===n,b=i===n,x=_===`connected`?`bg-success`:_===`connecting`?`bg-warning`:_===`error`?`bg-destructive`:`bg-muted-foreground/40`,S=g?.role?g.role===`owner`?`Owner`:`Client`:null,C=g?.descriptor?.label??null??f.label,w;t[4]!==u||t[5]!==f||t[6]!==g?(w=vt(g,f,u),t[4]=u,t[5]=f,t[6]=g,t[7]=w):w=t[7];let T=w,E=g?.serverConfig,D;t[8]===E?D=t[9]:(D=p(E),t[8]=E,t[9]=D);let O=D,k;t[10]===f.desktopSsh?k=t[11]:(k=f.desktopSsh?`SSH ${yt(f.desktopSsh)}`:null,t[10]=f.desktopSsh,t[11]=k);let A;t[12]===f.lastConnectedAt?A=t[13]:(A=f.lastConnectedAt?`Last connected ${gt(f.lastConnectedAt)}`:null,t[12]=f.lastConnectedAt,t[13]=A);let j;t[14]!==S||t[15]!==k||t[16]!==A?(j=[k,S,A].filter(Qt),t[14]=S,t[15]=k,t[16]=A,t[17]=j):j=t[17];let M=j,N=_===`connecting`?`bg-warning/60 duration-2000`:null,P;t[18]!==x||t[19]!==T||t[20]!==N?(P=(0,Q.jsx)(_t,{tooltipText:T,dotClassName:x,pingClassName:N}),t[18]=x,t[19]=T,t[20]=N,t[21]=P):P=t[21];let F;t[22]===C?F=t[23]:(F=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:C}),t[22]=C,t[23]=F);let I;t[24]!==P||t[25]!==F?(I=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[P,F]}),t[24]=P,t[25]=F,t[26]=I):I=t[26];let ee;t[27]===M?ee=t[28]:(ee=M.length>0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M.join(` · `)}):null,t[27]=M,t[28]=ee);let te;t[29]===O?te=t[30]:(te=O?(0,Q.jsxs)(`p`,{className:`flex items-center gap-1 text-warning text-xs`,children:[(0,Q.jsx)(se,{className:`size-3.5 shrink-0`}),`Version drift: client `,O.clientVersion,`, server`,` `,O.serverVersion,`.`]}):null,t[29]=O,t[30]=te);let L;t[31]!==I||t[32]!==ee||t[33]!==te?(L=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[I,ee,te]}),t[31]=I,t[32]=ee,t[33]=te,t[34]=L):L=t[34];let R=v?b:y,z;t[35]!==n||t[36]!==v||t[37]!==s||t[38]!==c?(z=()=>void(v?c(n):s(n)),t[35]=n,t[36]=v,t[37]=s,t[38]=c,t[39]=z):z=t[39];let B=v?b?`Disconnecting…`:`Disconnect`:y?`Connecting…`:`Connect`,ne;t[40]!==R||t[41]!==z||t[42]!==B?(ne=(0,Q.jsx)(G,{size:`xs`,variant:`outline`,disabled:R,onClick:z,children:B}),t[40]=R,t[41]=z,t[42]=B,t[43]=ne):ne=t[43];let re=a===n,ie;t[44]!==n||t[45]!==l?(ie=()=>void l(n),t[44]=n,t[45]=l,t[46]=ie):ie=t[46];let ae=a===n?`Removing…`:`Remove`,oe;t[47]!==re||t[48]!==ie||t[49]!==ae?(oe=(0,Q.jsx)(G,{size:`xs`,variant:`destructive-outline`,disabled:re,onClick:ie,children:ae}),t[47]=re,t[48]=ie,t[49]=ae,t[50]=oe):oe=t[50];let V;t[51]!==ne||t[52]!==oe?(V=(0,Q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[ne,oe]}),t[51]=ne,t[52]=oe,t[53]=V):V=t[53];let H;return t[54]!==L||t[55]!==V?(H=(0,Q.jsx)(`div`,{className:wt,children:(0,Q.jsxs)(`div`,{className:Et,children:[L,V]})}),t[54]=L,t[55]=V,t[56]=H):H=t[56],H}function Qt(e){return e!==null}var $t=(0,X.memo)(function(e){let t=(0,Ze.c)(24),{target:n,connectingHostAlias:r,onConnect:i}=e,a;t[0]===n?a=t[1]:(a=yt(n),t[0]=n,t[1]=a);let o=a,s=o!==n.alias,c=r===n.alias?`Adding…`:`Add environment`,l;t[2]===n.alias?l=t[3]:(l=(0,Q.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:n.alias}),t[2]=n.alias,t[3]=l);let u;t[4]!==o||t[5]!==s?(u=s?(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:o}):null,t[4]=o,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=r===n.alias,p;t[10]!==i||t[11]!==n?(p=()=>i(n),t[10]=i,t[11]=n,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==n.alias?(m=r===n.alias?(0,Q.jsx)(ae,{className:`size-3 animate-spin`}):null,t[13]=r,t[14]=n.alias,t[15]=m):m=t[15];let h;t[16]!==c||t[17]!==f||t[18]!==p||t[19]!==m?(h=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:(0,Q.jsxs)(G,{size:`xs`,variant:`outline`,disabled:f,onClick:p,children:[m,c]})}),t[16]=c,t[17]=f,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==d||t[22]!==h?(g=(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:Et,children:[d,h]})}),t[21]=d,t[22]=h,t[23]=g):g=t[23],g});function en(){let e=window.desktopBridge,[t,n]=(0,X.useState)(e?`owner`:null),[r,i]=(0,X.useState)(null),o=m(e=>e.byId),_=(0,X.useMemo)(()=>Object.values(o).toSorted((e,t)=>e.label.localeCompare(t.label)).map(e=>e.environmentId),[o]),y=(0,X.useMemo)(()=>Object.values(o).reduce((e,t)=>(t.desktopSsh?.alias&&(e[t.desktopSsh.alias]=t),e),{}),[o]),b=(0,X.useMemo)(()=>{let e=new Set;for(let t of Object.values(o)){let n=t.desktopSsh;n&&(e.add(n.alias),e.add(yt(n)))}return e},[o]),[x,S]=(0,X.useState)([]),[w,T]=(0,X.useState)(!1),[E,D]=(0,X.useState)(!1),[O,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(null),[N,P]=(0,X.useState)(null),[F,ee]=(0,X.useState)([]),[te,L]=(0,X.useState)(null),[R,z]=(0,X.useState)([]),[ne,ie]=(0,X.useState)([]),[V,H]=(0,X.useState)(null),[xe,Se]=(0,X.useState)(!1),[Ce,we]=(0,X.useState)(null),[Te,Ee]=(0,X.useState)(null),[De,ke]=(0,X.useState)(!1),[Le,Re]=(0,X.useState)(!1),[ze,Be]=(0,X.useState)(`remote`),[J,Ue]=(0,X.useState)(``),[Ge,Ke]=(0,X.useState)(``),[qe,Je]=(0,X.useState)(``),[Ye,Y]=(0,X.useState)(``),[Ze,Qe]=(0,X.useState)(``),[$e,Z]=(0,X.useState)(null),[$,et]=(0,X.useState)(!1),tt=(0,X.useMemo)(()=>x.filter(e=>{let t=yt(e);return!b.has(e.alias)&&!b.has(t)}),[x,b]),[nt,rt]=(0,X.useState)(null),[it,at]=(0,X.useState)(null),[ot,st]=(0,X.useState)(null),[ct,lt]=(0,X.useState)(!1),[ut,dt]=(0,X.useState)(!1),[ft,ht]=(0,X.useState)(!1),[gt,_t]=(0,X.useState)(null),[vt,Tt]=(0,X.useState)(!1),[Et,Ot]=(0,X.useState)(String(mt)),[Bt,Vt]=(0,X.useState)(null),Ht=a(),Ut=p(Ht),[Wt,Gt]=(0,X.useState)(!1),Kt=I(e=>e.defaultAdvertisedEndpointKey),Qt=I(e=>e.setDefaultAdvertisedEndpointKey),en=t===`owner`,tn=e?N?.mode===`network-accessible`:r===`remote-reachable`,nn=Et.trim(),rn=Number(nn),an=/^\d+$/u.test(nn)&&Number.isInteger(rn)&&rn>=1&&rn<=65535,on=(0,X.useMemo)(()=>{if(!gt)return null;if(!an||rn===mt)return gt.httpBaseUrl;try{let e=new URL(gt.httpBaseUrl);return e.port=String(rn),e.toString().replace(/\/$/u,``)}catch{return gt.httpBaseUrl}},[an,rn,gt]),sn=(0,X.useCallback)(async t=>{if(e){lt(!0),L(null);try{let n=await e.setServerExposureMode(t?`network-accessible`:`local-only`);P(n),dt(!1),lt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to update network exposure.`;dt(!1),L(t),B.add(fe({type:`error`,title:`Could not update network access`,description:t})),lt(!1)}}},[e]),cn=(0,X.useCallback)(()=>{Bt!==null&&sn(Bt===`network-accessible`)},[sn,Bt]),ln=(0,X.useCallback)(async()=>{if(e&&an){ht(!0),L(null);try{let t=await e.setTailscaleServeEnabled({enabled:!0,port:rn});P(t),_t(null)}catch(e){let t=e instanceof Error?e.message:`Failed to configure Tailscale HTTPS.`;L(t),B.add(fe({type:`error`,title:`Could not set up Tailscale HTTPS`,description:t}))}finally{ht(!1)}}},[e,an,rn]),un=(0,X.useCallback)(e=>{Ot(String(N?.tailscaleServePort??mt)),_t(e)},[N?.tailscaleServePort]),dn=(0,X.useCallback)(async()=>{if(e){ht(!0),L(null);try{let t=await e.setTailscaleServeEnabled({enabled:!1,port:N?.tailscaleServePort??mt});P(t),Tt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to disable Tailscale HTTPS.`;L(t),B.add(fe({type:`error`,title:`Could not disable Tailscale HTTPS`,description:t}))}finally{ht(!1)}}},[e,N?.tailscaleServePort]),fn=(0,X.useCallback)(e=>{Tt(!0)},[]),pn=(0,X.useCallback)(async e=>{we(e),H(null);try{await v(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke pairing link.`;H(t),B.add(fe({type:`error`,title:`Could not revoke pairing link`,description:t}))}finally{we(null)}},[]),mn=(0,X.useCallback)(async e=>{Ee(e),H(null);try{await C(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke client access.`;H(t),B.add(fe({type:`error`,title:`Could not revoke client access`,description:t}))}finally{Ee(null)}},[]),hn=(0,X.useCallback)(async()=>{ke(!0),H(null);try{let e=await h();B.add({type:`success`,title:e===1?`Revoked 1 other client`:`Revoked ${e} clients`,description:`Other paired clients will need a new pairing link before reconnecting.`})}catch(e){let t=e instanceof Error?e.message:`Failed to revoke other clients.`;H(t),B.add(fe({type:`error`,title:`Could not revoke other clients`,description:t}))}finally{ke(!1)}},[]),gn=(0,X.useCallback)(async()=>{if(ze===`ssh`){et(!0),Z(null);try{let e=bt({host:qe,username:Ye,port:Ze}),t=await f(e,{label:``});Ue(``),Ke(``),Je(``),Y(``),Qe(``),Re(!1),B.add({type:`success`,title:`Environment connected`,description:`${t.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Ct(e);Z(t)}finally{et(!1)}return}et(!0),Z(null);try{let e=St({host:J,pairingCode:Ge}),t=await l({label:``,...e});Ue(``),Ke(``),Je(``),Y(``),Qe(``),Re(!1),B.add({type:`success`,title:`Backend added`,description:`${t.label} is now saved and will reconnect on app startup.`})}catch(e){let t=e instanceof Error?e.message:`Failed to add backend.`;Z(t),B.add(fe({type:`error`,title:`Could not add backend`,description:t}))}finally{et(!1)}},[J,ze,Ge,qe,Ze,Ye]),_n=(0,X.useCallback)(async e=>{rt(e),Z(null);try{await d(e)}catch(e){let t=e instanceof Error?e.message:`Failed to connect backend.`;Z(t),B.add(fe({type:`error`,title:`Could not connect backend`,description:t}))}finally{rt(null)}},[]),vn=(0,X.useCallback)(async e=>{at(e),Z(null);try{await u(e)}catch(e){let t=e instanceof Error?e.message:`Failed to disconnect backend.`;Z(t),B.add(fe({type:`error`,title:`Could not disconnect backend`,description:t}))}finally{at(null)}},[]),yn=(0,X.useCallback)(async e=>{st(e),Z(null);try{await c(e)}catch(e){let t=e instanceof Error?e.message:`Failed to remove backend.`;Z(t),B.add(fe({type:`error`,title:`Could not remove backend`,description:t}))}finally{st(null)}},[]),bn=(0,X.useCallback)(async()=>{if(!e){S([]),T(!1),A(null);return}D(!0),A(null);try{let t=await e.discoverSshHosts();S(t),T(!0)}catch(e){let t=e instanceof Error?e.message:`Failed to discover SSH hosts.`;A(t),T(!0)}finally{D(!1)}},[e]),xn=(0,X.useCallback)(async(e,t)=>{M(e.alias),ze===`ssh`?Z(null):A(null);try{let n=await f(e,t===void 0?void 0:{label:t});Je(``),Y(``),Qe(``),Re(!1),B.add({type:`success`,title:y[e.alias]?`Environment reconnected`:`Environment connected`,description:`${n.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Ct(e);ze===`ssh`?Z(t):A(t)}finally{M(null)}},[ze,y]);(0,X.useEffect)(()=>{!e||!Le||ze!==`ssh`||w||E||bn()},[Le,e,w,E,bn,ze]),(0,X.useEffect)(()=>{if(e){n(`owner`);return}let t=!1;return g().then(e=>{t||(n(e.authenticated?e.role??null:null),i(e.auth.policy))}).catch(()=>{t||(n(null),i(null))}),()=>{t=!0}},[e]),(0,X.useEffect)(()=>{if(!en)return;let t=!1;Se(!0);let n=s().client.server.subscribeAuthAccess(e=>{if(!t){switch(e.type){case`snapshot`:z(kt(e.payload.pairingLinks.map(e=>jt(e)))),ie(At(e.payload.clientSessions.map(e=>Mt(e))));break;case`pairingLinkUpserted`:z(t=>Nt(t,jt(e.payload)));break;case`pairingLinkRemoved`:z(t=>Pt(t,e.payload.id));break;case`clientUpserted`:ie(t=>Ft(t,Mt(e.payload)));break;case`clientRemoved`:ie(t=>It(t,e.payload.sessionId))}H(null),Se(!1)}},{onResubscribe:()=>{t||Se(!0)}});return e?(e.getServerExposureState().then(e=>{t||P(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load network exposure state.`;L(n)}),e.getAdvertisedEndpoints().then(e=>{t||ee(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;L(n)})):(P(null),s().client.server.getAdvertisedEndpoints().then(e=>{t||ee(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;L(n)})),()=>{t=!0,n()}},[en,e]),(0,X.useEffect)(()=>{en||(Se(!1),z([]),ie([]),H(null),P(null),ee([]),L(null))},[en]);let Sn=(0,X.useMemo)(()=>R.filter(e=>e.role===`client`),[R]),Cn=(0,X.useMemo)(()=>F.find(Rt)??null,[F]),wn=(0,X.useMemo)(()=>tn?F.filter(e=>!Rt(e)):[],[F,tn]),Tn=(0,X.useMemo)(()=>Cn?[...wn,Cn]:wn,[Cn,wn]),En=tn||Cn?.status===`available`,Dn=(0,X.useMemo)(()=>Lt(wn,Kt),[Kt,wn]),On=(0,X.useMemo)(()=>Dn??Lt(Cn?[Cn]:[],Kt),[Kt,Dn,Cn]),kn=On?zt(On):null,An=(0,X.useCallback)(e=>{Qt(zt(e))},[Qt]),jn=(0,X.useCallback)(e=>{let t=xt(e);if(t){Ue(t.host),Ke(t.pairingCode);return}Ue(e)},[]),Mn=e=>{let t=ze===e.mode;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:k(`group flex min-h-24 items-start gap-3 rounded-lg border p-4 text-left`,t?`border-primary/50 bg-primary/5`:`border-border/60 hover:bg-muted/40`),disabled:$,onClick:()=>{Be(e.mode)},children:[e.icon?(0,Q.jsx)(`span`,{className:k(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border`,t?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-background text-muted-foreground group-hover:text-foreground`),children:e.icon}):null,(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})};return(0,Q.jsxs)(He,{children:[en?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Ve,{title:`Manage local backend`,children:[Ut?(0,Q.jsx)(q,{title:`Version drift`,description:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,Q.jsx)(se,{className:`size-3.5 shrink-0`}),`Client `,Ut.clientVersion,`, server`,` `,Ut.serverVersion,`. Sync them if RPC calls or reconnects fail.`]})}):null,e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{title:`Network access`,description:tn?(0,Q.jsx)(Xt,{endpoint:Dn,hiddenEndpointCount:Math.max(wn.length-1,0),expanded:Wt,onToggleExpanded:()=>Gt(e=>!e),fallback:N?.endpointUrl?`Reachable at ${N.endpointUrl}`:N?.advertisedHost?`Exposed on all interfaces. Pairing links use ${N.advertisedHost}.`:`Exposed on all interfaces.`}):N?`Limited to this machine.`:`Loading…`,status:te?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:te}):null,control:(0,Q.jsx)(de,{checked:N?.mode===`network-accessible`,disabled:!N||ct,onCheckedChange:e=>{Vt(e?`network-accessible`:`local-only`),dt(!0)},"aria-label":`Enable network access`})}),(e=>Wt?wn.map(t=>{let n=zt(t);return(0,Q.jsx)(Yt,{endpoint:t,isDefault:n===kn,presentation:e,onSetDefault:An,onSetupTailscaleServe:un,onDisableTailscaleServe:fn,isUpdatingTailscaleServe:ft},t.id)}):null)(`endpoint-rail`),(0,Q.jsx)(q,{title:`Tailscale HTTPS`,description:Cn?Cn.status===`available`?Cn.httpBaseUrl:`Use Tailscale Serve to expose this backend through a MagicDNS HTTPS URL.`:`Start Tailscale to set up HTTPS access through MagicDNS.`,control:Cn?(0,Q.jsx)(de,{checked:Cn.status===`available`,disabled:ft,onCheckedChange:e=>{if(e){un(Cn);return}fn(Cn)},"aria-label":`Enable Tailscale HTTPS`}):null})]}):(0,Q.jsx)(q,{title:`Network access`,description:r===`remote-reachable`?`This backend is already configured for remote access. Network exposure changes must be made where the server is launched.`:`This backend is only reachable on this machine. Restart it with a non-loopback host to enable remote pairing.`,control:(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(ce,{render:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(de,{checked:tn,disabled:!0,"aria-label":`Enable network access`})})}),(0,Q.jsx)(le,{side:`top`,children:`Network exposure changes restart the backend and must be controlled where the server process is launched.`})]})})]}),En?(0,Q.jsx)(Ve,{title:`Authorized clients`,headerAction:(0,Q.jsx)(qt,{clientSessions:ne,isRevokingOtherClients:De,onRevokeOtherClients:hn}),children:(e=>(0,Q.jsxs)(Q.Fragment,{children:[V?(0,Q.jsx)(`div`,{className:Dt(e),children:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:V})}):null,(0,Q.jsx)(Jt,{endpointUrl:N?.endpointUrl,endpoints:Tn,defaultEndpointKey:kn,presentation:e,isLoading:xe,pairingLinks:Sn,clientSessions:ne,revokingPairingLinkId:Ce,revokingClientSessionId:Te,onRevokePairingLink:pn,onRevokeClientSession:mn})]}))(`current`)}):null,(0,Q.jsx)(Ie,{open:ut,onOpenChange:e=>{ct||dt(e)},onOpenChangeComplete:e=>{e||Vt(null)},children:(0,Q.jsxs)(Ne,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Fe,{children:Bt===`network-accessible`?`Enable network access?`:`Disable network access?`}),(0,Q.jsx)(Pe,{children:Bt===`network-accessible`?`Ryco will restart to expose this environment over the network.`:`Ryco will restart and limit this environment back to this machine.`})]}),(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Me,{disabled:ct,render:(0,Q.jsx)(G,{variant:`outline`,disabled:ct}),children:`Cancel`}),(0,Q.jsx)(G,{variant:Bt===`local-only`?`destructive`:`default`,onClick:cn,disabled:Bt===null||ct,children:ct?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),`Restarting…`]}):Bt===`network-accessible`?`Restart and enable`:`Restart and disable`})]})]})}),(0,Q.jsx)(Ie,{open:vt,onOpenChange:e=>{ft||Tt(e)},children:(0,Q.jsxs)(Ne,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Fe,{children:`Disable Tailscale HTTPS?`}),(0,Q.jsx)(Pe,{children:`Ryco will restart the local backend without Tailscale Serve.`})]}),(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Me,{disabled:ft,render:(0,Q.jsx)(G,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,Q.jsx)(G,{variant:`destructive`,onClick:()=>void dn(),disabled:ft,children:ft?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),`Restarting…`]}):`Restart and disable`})]})]})}),(0,Q.jsx)(K,{open:gt!==null,onOpenChange:e=>{ft||e||_t(null)},children:(0,Q.jsxs)(be,{className:`max-w-md`,children:[(0,Q.jsxs)(pe,{children:[(0,Q.jsx)(me,{children:`Set up Tailscale HTTPS?`}),(0,Q.jsx)(ye,{children:`Ryco will restart the local backend with Tailscale Serve enabled and ask Tailscale to proxy HTTPS traffic to this backend.`})]}),(0,Q.jsxs)(ve,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`HTTPS port`}),(0,Q.jsx)(U,{className:`mt-2`,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:Et,onChange:e=>Ot(e.target.value),disabled:ft})]}),an?null:(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:`Enter a port from 1 to 65535.`}),(0,Q.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-muted/20 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`HTTPS endpoint`}),(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm text-foreground`,title:on??void 0,children:on??`Pending MagicDNS endpoint`})]})]}),(0,Q.jsxs)(he,{children:[(0,Q.jsx)(_e,{disabled:ft,render:(0,Q.jsx)(G,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,Q.jsx)(G,{onClick:()=>void ln(),disabled:ft||!an,children:ft?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),`Restarting…`]}):`Enable`})]})]})})]}):(0,Q.jsx)(Ve,{title:`Local backend access`,children:(0,Q.jsx)(q,{title:`Owner tools`,description:`Pairing links and client-session management are only available to owner sessions for this backend.`})}),e?(0,Q.jsx)(pt,{desktopBridge:e}):null,(0,Q.jsxs)(Ve,{title:`Remote environments`,headerAction:(0,Q.jsxs)(K,{open:Le,onOpenChange:e=>{Re(e),e||Z(null)},children:[(0,Q.jsx)(ge,{render:(0,Q.jsxs)(G,{size:`xs`,variant:`outline`,children:[(0,Q.jsx)(re,{className:`size-3`}),`Add environment`]})}),(0,Q.jsxs)(be,{className:`max-h-[80dvh] sm:max-w-3xl`,children:[(0,Q.jsxs)(pe,{children:[(0,Q.jsx)(me,{children:`Add Environment`}),(0,Q.jsx)(ye,{children:`Pair another environment to this client.`})]}),(0,Q.jsx)(ve,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Mn({mode:`remote`,title:`Remote link`,description:`Enter a backend host and pairing code.`,icon:(0,Q.jsx)(Xe,{"aria-hidden":!0,className:`size-4`})}),e?Mn({mode:`ssh`,title:`SSH`,description:`Use local SSH config, agent, and tunnels for the backend.`,icon:(0,Q.jsx)(oe,{"aria-hidden":!0,className:`size-4`})}):null]}),(0,Q.jsx)(We,{children:ze===`ssh`?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`SSH host or alias`}),(0,Q.jsx)(U,{value:qe,onChange:e=>Je(e.target.value),placeholder:`Search hosts or type devbox`,disabled:$,spellCheck:!1})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_7rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Username`}),(0,Q.jsx)(U,{value:Ye,onChange:e=>Y(e.target.value),placeholder:`root`,disabled:$,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Port`}),(0,Q.jsx)(U,{value:Ze,onChange:e=>Qe(e.target.value),placeholder:`22`,inputMode:`numeric`,disabled:$,spellCheck:!1})]})]}),$e||O?(0,Q.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:$e??O}):null,(0,Q.jsxs)(G,{variant:`outline`,className:`w-full`,disabled:$,onClick:()=>void gn(),children:[(0,Q.jsx)(re,{className:`size-3.5`}),$?`Adding…`:`Add environment`]})]}),(0,Q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border/60`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/60 bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Suggested hosts`}),(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`From SSH config and known hosts`})]}),(0,Q.jsxs)(G,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void bn(),children:[E?(0,Q.jsx)(ae,{className:`size-3 animate-spin`}):(0,Q.jsx)(ae,{className:`size-3`}),`Refresh`]})]}),(0,Q.jsx)(W,{scrollFade:!0,className:`max-h-56`,children:(0,Q.jsxs)(`div`,{children:[tt.map(e=>(0,Q.jsx)($t,{target:e,connectingHostAlias:j,onConnect:e=>void xn(e)},`${e.alias}:${e.hostname}:${e.port??``}`)),w&&!E&&tt.length===0?(0,Q.jsx)(`div`,{className:wt,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No new SSH hosts were discovered.`})}):null]})})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Host`}),(0,Q.jsx)(U,{value:J,onChange:e=>jn(e.target.value),placeholder:`backend.example.com`,disabled:$,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Pairing code`}),(0,Q.jsx)(U,{value:Ge,onChange:e=>Ke(e.target.value),placeholder:`PAIRCODE`,disabled:$,spellCheck:!1})]})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:`Paste a full pairing URL here to fill both fields automatically. The pairing code is not kept; the browser stores a bearer token for 7 days.`})})]}),$e?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:$e}):null,(0,Q.jsxs)(G,{variant:`outline`,className:`w-full`,disabled:$,onClick:()=>void gn(),children:[(0,Q.jsx)(re,{className:`size-3.5`}),$?`Adding…`:`Add environment`]})]})})]})})]})]}),children:[_.map(e=>(0,Q.jsx)(Zt,{environmentId:e,reconnectingEnvironmentId:nt,disconnectingEnvironmentId:it,removingEnvironmentId:ot,onConnect:_n,onDisconnect:vn,onRemove:yn},e)),_.length===0?(0,Q.jsx)(`div`,{className:wt,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No remote environments yet. Click “Add environment” to pair another environment.`})}):null]})]})}function tn(e){return e.status!==`unavailable`}function nn(e){B.add({type:`success`,title:e===`hosted-link`?`Hosted app link copied`:e===`link`?`Pairing URL copied`:`Pairing code copied`,description:e===`hosted-link`?`Open it in the browser on the device you want to connect.`:e===`link`?`Open it in the client you want to pair to this environment.`:`Paste it into another client to finish pairing.`})}function rn(e){return Wt(e)?`hosted-link`:`link`}function an(e){return!Wt(e.url)}function on(e){return Wt(e.url)}function sn(e){return e.currentTarget.select()}function cn(e){return e.currentTarget.select()}function ln(e){return e!==null}export{en as ConnectionsSettings};
@@ -1 +0,0 @@
1
- import{n as e}from"./DialogViewport-C2oKvkDR.js";function t(t){return e(`dialog`,t)}export{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-CBdFekj3.js";import{Ir as i,Nr as a}from"./src-b7-hpIff.js";import{N as o}from"./runtime-BkRtSwRY.js";import{f as s,t as c}from"./utils-c6dglOTK.js";import{_ as l,d as u,f as d,h as f,l as p,m,p as h,r as g,v as _}from"./useHandleNewThread-COAg-4eT.js";import{t as v}from"./useNavigate-2tVq4iZ2.js";import{o as y}from"./authorization-CFcCWeGd.js";import{f as b}from"./useRenderElement-DchFnsR8.js";import{t as x}from"./chevron-down-B7C6FKzM.js";import{t as S}from"./download-CQZ-m4zW.js";import{t as ee}from"./log-out-tMJm0Gk6.js";import{t as te}from"./refresh-cw-DopCMrtR.js";import{t as C}from"./shield-check-dQ-4cMKk.js";import{t as w}from"./shield-IZEIJ8r7.js";import{t as T}from"./smartphone-gNe1ynB8.js";import{t as ne}from"./user-round-Cpzx8pSw.js";import{t as E}from"./x-C1Cemsov.js";import{t as D}from"./button-BT6cGe5S.js";import{t as O}from"./usePresentationTier-B_SCFvN7.js";import{a as k,i as A,n as j,o as re,s as M,t as N}from"./MobileSheet-C8OrQzw0.js";import{t as P}from"./GlassSurface-EZnNd1mF.js";import{a as ie,c as ae,i as F,n as I,o as L,r as R,s as oe,t as se}from"./HostedRelayTrustNotice-CB0O5OAN.js";import{a as z,n as B}from"./settingsSections.logic-Be8uaymC.js";var ce=b(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),V=b(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),H=b(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),U=b(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),W=n(),G=e(t(),1),le=Object.freeze({"":`overview`,security:`security`,appearance:`appearance`}),K=Object.freeze({"sign-in":`/sign-in`,"sign-in-password":`/sign-in/password`,"sign-in-recovery-code":`/sign-in/recovery-code`,"sign-up":`/sign-up`,"sign-up-verify":`/public-signup/verify`,"reset-password":`/password-reset`,invitation:`/invitation`,setup:`/setup`,"email-verification":`/email-verification`,nodes:`/nodes`,"nodes-enroll":`/nodes/enroll`}),ue=Object.freeze([`sign-in`,`sign-up`,`public-signup`,`password-reset`,`invitation`,`setup`,`email-verification`,`nodes`,`account`]);function q(e){return e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e===``?`/`:e}function de(e){let t=q(e);if(t.startsWith(`/account`))return{kind:`account`,section:le[t.slice(8).replace(/^\//,``)]??`overview`};for(let[e,n]of Object.entries(K))if(t===n)return{kind:e};return null}function fe(e){return e.kind===`account`?e.section===`overview`?`/account`:`/account/${e.section}`:K[e.kind]}function pe(e){switch(e.kind){case`sign-in`:return`Sign in`;case`sign-in-password`:return`Sign in with a password`;case`sign-in-recovery-code`:return`Use a recovery code`;case`sign-up`:return`Create your account`;case`sign-up-verify`:return`Verify your email`;case`reset-password`:return`Reset your password`;case`invitation`:return`Redeem your invitation`;case`setup`:return`Claim this Hub`;case`email-verification`:return`Email verification`;case`nodes`:return`Your nodes`;case`nodes-enroll`:return`Enroll a node`;case`account`:return e.section===`overview`?`Account`:e.section===`security`?`Security`:`Appearance`}}var me=typeof window>`u`?`/`:q(window.location.pathname),he=new Set;function ge(){for(let e of Array.from(he))e()}function _e(e){let t=q(e);t!==me&&(me=t,ge())}var ve=!1;function ye(){ve||(ve=!0,_(()=>{_e(f().logicalPathname)}))}function be(){return m()===null?typeof window>`u`?me:q(window.location.pathname):me}var xe=!1;function Se(){xe||typeof window>`u`||(xe=!0,window.addEventListener(`popstate`,()=>{m()===null&&ge()}))}function Ce(e){return ye(),Se(),he.add(e),()=>{he.delete(e)}}function we(e,t){Te(fe(e),t)}function Te(e,t){let n=q(e),r=m();if(r){t?.replace===!0?r.replace(n):r.push(n),_e(n);return}typeof window<`u`&&(t?.replace===!0?window.history.replaceState(window.history.state,``,n):window.history.pushState(window.history.state,``,n)),me=n,ge()}function Ee(){let e=(0,W.c)(2),t=(0,G.useSyncExternalStore)(Ce,be),n;return e[0]===t?n=e[1]:(n=de(t),e[0]=t,e[1]=n),n}var J=s(),De={unavailable:`The node from this link is not in your authorized node directory. Choose a node to continue.`,revoked:`Access to the node from this link was revoked. Choose a node to continue.`,offline:`The node from this link is offline. Choose a node to continue.`,"invalid-link":`This node link is not valid. Choose a node to continue.`},Oe=null,ke=new Set;function Y(e){if(Oe!==e){Oe=e;for(let e of Array.from(ke))e()}}function Ae(e){return ke.add(e),()=>{ke.delete(e)}}function je(){return Oe===null?null:De[Oe]}function Me(){return(0,G.useSyncExternalStore)(Ae,je)}function Ne(){return(0,G.useSyncExternalStore)(_,f)}var Pe=new Set([`node`,`draft`,`pair`,`diagnostics`,...ue]);function Fe(e){let t=/^\/([^/]+)\/([^/]+)\/?$/.exec(e);if(!t)return null;let n=t[1]??``;if(Pe.has(n))return null;try{return decodeURIComponent(n)}catch{return n}}function Ie(e){let t=/^\/([^/]+)\/([^/]+)\/?$/u.exec(e);if(!t||Pe.has(t[1]??``))return null;try{return{environmentId:a.make(decodeURIComponent(t[1]??``)),threadId:i.make(decodeURIComponent(t[2]??``))}}catch{return null}}function Le(e){return e.startsWith(`/draft/`)}var X=null,Z=null,Q=null,Re=!1,ze=null,Be=0,Ve=!1,He=null,Ue=null;function $(e){let t=e?JSON.stringify([e.environmentId,e.threadId]):null;t!==He&&(Ue?.(),Ue=null,He=t,e&&(Ue=p(e.environmentId,e.threadId)))}function We(e){return e?JSON.stringify([e.environmentId,e.threadId]):null}function Ge(){Ve||(Ve=!0,queueMicrotask(()=>{Ve=!1,Be!==0&&Je()}))}function Ke(e){Re=!0;try{e()}finally{Re=!1}Ge()}function qe(e,t){X=null,Z=null,Q=null,(e===`none`||e===`online`||e===`offline`)&&Y(t),d()}function Je(){if(Re||!m())return;let e=f(),t=o.getState();if(e.malformed){Y(`invalid-link`),$(null),d();return}if(t.accountStatus!==`authenticated`){$(null),ze===`authenticated`&&Y(null),ze=t.accountStatus;return}ze=t.accountStatus;let n=e.nodeId;if(n===null){if(Q=null,$(null),X=null,Z=null,t.selectedNode&&!g()){let e=t.selectionStatus===`revoked`||t.selectionStatus===`authorization-removed`||t.selectionStatus===`incompatible`;y.returnToDirectory(e?{preserveTerminalSelection:!0}:void 0);return}Ye(e.logicalPathname,t);return}let r=Ie(e.logicalPathname);We(r)!==He&&$(null);let i=t.nodes.find(e=>e.id===n)??null;if(i&&(i.capabilities?.nativeClientRequired===!0||r&&i.environmentId!==r.environmentId)){$(null),qe(t.selectionStatus,`unavailable`);return}if(t.selectedNode?.id===n){if($(r),X=null,Q=null,t.sessionEstablished){Z=null,Y(null);return}Z===n&&t.transportStatus===`terminal-failure`&&(t.selectionStatus===`revoked`||t.selectionStatus===`authorization-removed`||t.selectionStatus===`incompatible`)&&(Z=null,Ke(()=>{d(),y.returnToDirectory({preserveTerminalSelection:!0})}));return}if(t.directoryStatus===`stale`){qe(t.selectionStatus,`unavailable`);return}if(t.directoryStatus!==`ready`||t.browserStatus!==`current`)return;let a=t.nodes.find(e=>e.id===n);if(!a){qe(t.selectionStatus,`unavailable`);return}if(a.revokedAt!==null){qe(t.selectionStatus,`revoked`);return}let s=Q===n;if(!a.presence.online&&!s){qe(t.selectionStatus,`offline`);return}$(r),!(r&&g())&&X!==n&&(X=n,Z=s?null:n,Q=null,Y(null),y.selectNode(a.id).finally(()=>{X===n&&(X=null)}))}function Ye(e,t){if(Le(e)){d();return}let n=Fe(e);if(n===null)return;if(t.directoryStatus===`stale`){Y(`unavailable`),d();return}if(t.directoryStatus!==`ready`)return;let r=t.nodes.find(e=>e.environmentId===n&&e.revokedAt===null);if(!r){Y(`unavailable`),d();return}u(r.id)}function Xe(e){return m()?(Q=e,Y(null),h(e)):!1}function Ze(){if(!m())return!1;Q=null,Y(null);let e=f();return e.nodeId===null&&e.logicalPathname===`/nodes`||l()}function Qe(){Be+=1;let e=_(Ge),t=o.subscribe(Ge),n=m()?.subscribe(()=>Ge());Ge();let r=!1;return()=>{r||(r=!0,--Be,e(),t(),n?.())}}function $e(){let e=(0,W.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,G.useEffect)(et,t)}function et(){return Qe()}function tt(e){let t=(0,W.c)(11),{label:n,status:r,icon:i,onClick:a,testId:o,className:s}=e,l;t[0]===s?l=t[1]:(l=c(P(`chip`),`flex min-h-11 min-w-11 max-w-[136px] shrink items-center justify-center gap-1.5 rounded-full border border-border px-2.5 text-xs font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring`,s),t[0]=s,t[1]=l);let u;t[2]===r?u=t[3]:(u=(0,J.jsx)(`span`,{"data-slot":`mobile-status-chip-status`,className:`min-w-0 truncate`,children:r}),t[2]=r,t[3]=u);let d;return t[4]!==i||t[5]!==n||t[6]!==a||t[7]!==l||t[8]!==u||t[9]!==o?(d=(0,J.jsxs)(`button`,{type:`button`,"aria-label":n,"data-slot":`mobile-status-chip`,"data-testid":o,className:l,onClick:a,children:[i,u]}),t[4]=i,t[5]=n,t[6]=a,t[7]=l,t[8]=u,t[9]=o,t[10]=d):d=t[10],d}var nt={legacy:{glyph:`legacy`,iconClassName:`text-amber-500`},web:{glyph:`browser-encrypted`,iconClassName:`text-sky-500`},e2ee:{glyph:`native-verified`,iconClassName:`text-emerald-500`}};function rt(e){return e.guarantee===`none`?e.connected?{glyph:`connected`,iconClassName:`text-emerald-500`}:{glyph:`disconnected`,iconClassName:`text-amber-500`}:nt[e.guarantee]}function it(){let e=(0,W.c)(19),t=ie(),n=L(),i=o(st),a=o(ot),s=o(at);if(t!==`web-unsigned`)return null;let c,l;e[0]!==n||e[1]!==a||e[2]!==i||e[3]!==s?(c=R(z(`security`,{hosted:r(),role:B(i,a,s)})),l=F(n,c),e[0]=n,e[1]=a,e[2]=i,e[3]=s,e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u=l;if(!u){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsxs)(`section`,{"aria-label":`Session code`,"data-testid":`hosted-e2ee-verification`,"data-code":`absent`,className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium`,children:`Session code`}),(0,J.jsx)(`p`,{"data-testid":`hosted-e2ee-verification-unavailable`,className:`text-[11px] leading-relaxed text-muted-foreground`,children:I})]}),e[6]=t):t=e[6],t}let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(`p`,{className:`text-xs font-medium`,children:`Session code`}),e[7]=d):d=e[7];let f;e[8]===u.display?f=e[9]:(f=(0,J.jsx)(`p`,{"data-testid":`hosted-e2ee-verification-code`,className:`font-mono text-base leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:u.display}),e[8]=u.display,e[9]=f);let p;e[10]===u.advisory?p=e[11]:(p=(0,J.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:u.advisory}),e[10]=u.advisory,e[11]=p);let m;e[12]===u.more?m=e[13]:(m=(0,J.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:u.more}),e[12]=u.more,e[13]=m);let h;return e[14]!==c||e[15]!==f||e[16]!==p||e[17]!==m?(h=(0,J.jsxs)(`section`,{"aria-label":`Session code`,"data-testid":`hosted-e2ee-verification`,"data-code":`present`,"data-form":c,className:`space-y-2`,children:[d,f,p,m]}),e[14]=c,e[15]=f,e[16]=p,e[17]=m,e[18]=h):h=e[18],h}function at(e){return e.transportStatus}function ot(e){return e.directoryStatus}function st(e){return e.effectiveRole}var ct=`ryco:pwa:activate:v1`,lt=`Installation is temporarily unavailable.`,ut={errorMessage:null,installState:`hidden`,platform:`other`,registrationState:`disabled`,updateState:`idle`};function dt(e){return e===``||e===`./`?`./`:e.endsWith(`/`)?e:`${e}/`}function ft(e){let t=e.navigator.userAgent;return/iPad|iPhone|iPod/.test(t)||/Macintosh/.test(t)&&e.navigator.maxTouchPoints>1}function pt(e){let t=e;return typeof t.prompt==`function`&&t.userChoice instanceof Promise}function mt(e){let t=ut,n=!1,r=null,i=null,a=!!e.navigator.serviceWorker?.controller,o=!1,s=!1,c=new Set,l=e.window.matchMedia(`(display-mode: standalone)`),u=e=>{let n={...t,...e};Object.entries(n).every(([e,n])=>t[e]===n)||(t=n,c.forEach(e=>e()))},d=()=>l.matches||e.navigator.standalone===!0,f=()=>d()?`installed`:`manual-available`,p=e=>{!pt(e)||d()||(e.preventDefault(),r=e,u({installState:`native-available`}))},m=()=>{r=null,u({installState:`installed`})},h=()=>{d()?(r=null,u({installState:`installed`})):u({installState:r?`native-available`:`manual-available`})},g=()=>{let t=a;a=!!e.navigator.serviceWorker?.controller,!(o||!s&&!t)&&(s=!1,o=!0,e.window.reload())},_=t=>{i=t,t.waiting&&u({updateState:`ready`}),t.addEventListener(`updatefound`,()=>{let n=t.installing;n&&n.addEventListener(`statechange`,()=>{n.state===`installed`&&e.navigator.serviceWorker?.controller&&u({updateState:`ready`})})})},v=async()=>{let t=e.navigator.serviceWorker;if(!t){u({registrationState:`unavailable`,errorMessage:lt});return}u({registrationState:`registering`,errorMessage:null});try{let n=dt(e.baseUrl);_(await t.register(`${n}service-worker.js`,{scope:n})),u({registrationState:`ready`,errorMessage:null})}catch{u({registrationState:`unavailable`,errorMessage:lt})}};return{activateUpdate(){let e=i?.waiting;!e||t.updateState!==`ready`||(s=!0,u({updateState:`activating`}),e.postMessage({type:ct}))},dismissInstall(){r=null,u({installState:d()?`installed`:`hidden`})},getSnapshot(){return t},async promptInstall(){let e=r;e&&(r=null,u({installState:`hidden`}),await e.prompt(),(await e.userChoice).outcome===`dismissed`&&!d()&&u({installState:`manual-available`}))},async start(t){n||(n=!0,t.enabled&&(a=!!e.navigator.serviceWorker?.controller,o=!1,u({installState:f(),platform:ft(e)?`ios`:`other`}),e.window.addEventListener(`beforeinstallprompt`,p),e.window.addEventListener(`appinstalled`,m),l.addEventListener(`change`,h),e.navigator.serviceWorker?.addEventListener(`controllerchange`,g),e.document.readyState===`complete`?await v():e.window.addEventListener(`load`,()=>void v(),{once:!0})))},stop(){n&&(n=!1,r=null,i=null,a=!1,o=!1,s=!1,e.window.removeEventListener(`beforeinstallprompt`,p),e.window.removeEventListener(`appinstalled`,m),l.removeEventListener(`change`,h),e.navigator.serviceWorker?.removeEventListener(`controllerchange`,g),t=ut,c.forEach(e=>e()))},subscribe(e){return c.add(e),()=>c.delete(e)}}}function ht(){let e=navigator;return{baseUrl:`/`,document,navigator:{maxTouchPoints:e.maxTouchPoints,userAgent:e.userAgent,...e.serviceWorker?{serviceWorker:e.serviceWorker}:{},...typeof e.standalone==`boolean`?{standalone:e.standalone}:{}},window:{addEventListener:window.addEventListener.bind(window),removeEventListener:window.removeEventListener.bind(window),matchMedia:window.matchMedia.bind(window),reload:()=>window.location.reload()}}}var gt=typeof window>`u`?null:mt(ht());function _t(e){let t=(0,W.c)(3),{compact:n,lifecycle:r}=e,i=n!==void 0&&n,a=r===void 0?gt:r,o;return t[0]!==i||t[1]!==a?(o=a?(0,J.jsx)(vt,{compact:i,lifecycle:a}):null,t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function vt(e){let t=(0,W.c)(27),{compact:n,lifecycle:r}=e,i=(0,G.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getSnapshot),[a,o]=(0,G.useState)(!1);if(i.installState!==`native-available`&&i.installState!==`manual-available`&&i.updateState===`idle`&&i.registrationState!==`unavailable`)return null;let s=n?`space-y-2`:`mt-4 space-y-3`,c;t[0]!==n||t[1]!==r||t[2]!==i.installState?(c=i.installState===`native-available`?(0,J.jsxs)(D,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,onClick:()=>void r.promptInstall(),children:[(0,J.jsx)(S,{"aria-hidden":!0}),` Install Ryco`]}):null,t[0]=n,t[1]=r,t[2]=i.installState,t[3]=c):c=t[3];let l;t[4]!==n||t[5]!==a||t[6]!==i.installState?(l=i.installState===`manual-available`?(0,J.jsxs)(D,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,"aria-expanded":a,onClick:()=>o(yt),children:[(0,J.jsx)(T,{"aria-hidden":!0}),` How to install`]}):null,t[4]=n,t[5]=a,t[6]=i.installState,t[7]=l):l=t[7];let u;t[8]!==n||t[9]!==r||t[10]!==i.updateState?(u=i.updateState===`idle`?null:(0,J.jsxs)(D,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,disabled:i.updateState===`activating`,onClick:()=>r.activateUpdate(),children:[(0,J.jsx)(te,{"aria-hidden":!0}),i.updateState===`activating`?`Updating…`:`Update ready`]}),t[8]=n,t[9]=r,t[10]=i.updateState,t[11]=u):u=t[11];let d;t[12]!==c||t[13]!==l||t[14]!==u?(d=(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c,l,u]}),t[12]=c,t[13]=l,t[14]=u,t[15]=d):d=t[15];let f;t[16]!==a||t[17]!==i?(f=a?(0,J.jsx)(bt,{snapshot:i,onClose:()=>o(!1)}):null,t[16]=a,t[17]=i,t[18]=f):f=t[18];let p;t[19]!==i.errorMessage||t[20]!==i.registrationState?(p=i.registrationState===`unavailable`&&i.errorMessage?(0,J.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:i.errorMessage}):null,t[19]=i.errorMessage,t[20]=i.registrationState,t[21]=p):p=t[21];let m;return t[22]!==s||t[23]!==d||t[24]!==f||t[25]!==p?(m=(0,J.jsxs)(`section`,{className:s,"aria-label":`Ryco app installation`,children:[d,f,p]}),t[22]=s,t[23]=d,t[24]=f,t[25]=p,t[26]=m):m=t[26],m}function yt(e){return!e}function bt(e){let t=(0,W.c)(13),{snapshot:n,onClose:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,J.jsx)(`p`,{className:`font-medium`,children:`Install Ryco on this device`}),t[0]=i):i=t[0];let a;t[1]===n.platform?a=t[2]:(a=(0,J.jsxs)(`div`,{children:[i,n.platform===`ios`?(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`In Safari, open the Share or browser menu, choose Add to Home Screen, enable Open as Web App when offered, then tap Add.`}):(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`Open the browser menu, choose Add to home screen or Install app, then confirm Install.`})]}),t[1]=n.platform,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(E,{"aria-hidden":!0}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(`span`,{className:`sr-only`,children:`Close install instructions`}),t[4]=s):s=t[4];let c;t[5]===r?c=t[6]:(c=(0,J.jsxs)(D,{className:`size-11 shrink-0`,size:`icon`,variant:`ghost`,onClick:r,children:[o,` `,s]}),t[5]=r,t[6]=c);let l;t[7]!==a||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[a,c]}),t[7]=a,t[8]=c,t[9]=l):l=t[9];let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:(0,J.jsx)(se,{compact:!0})}),t[10]=u):u=t[10];let d;return t[11]===l?d=t[12]:(d=(0,J.jsxs)(`div`,{role:`region`,"aria-label":`Install Ryco instructions`,className:`rounded-lg border border-border bg-background p-3 text-sm`,children:[l,u]}),t[11]=l,t[12]=d),d}var xt={connected:U,disconnected:H,legacy:V,"browser-encrypted":w,"native-verified":C};function St(e){let t=(0,W.c)(9),{indicator:n,className:r,testId:i}=e,a;t[0]===n?a=t[1]:(a=rt(n),t[0]=n,t[1]=a);let{glyph:o,iconClassName:s}=a,c=xt[o],l=String(n.connected),u=`${r} ${s}`,d;return t[2]!==c||t[3]!==o||t[4]!==n.guarantee||t[5]!==l||t[6]!==u||t[7]!==i?(d=(0,J.jsx)(c,{"aria-hidden":!0,"data-testid":i,"data-connected":l,"data-guarantee":n.guarantee,"data-glyph":o,className:u}),t[2]=c,t[3]=o,t[4]=n.guarantee,t[5]=l,t[6]=u,t[7]=i,t[8]=d):d=t[8],d}function Ct(e){let t=(0,W.c)(3),{node:n}=e;if(n.revokedAt){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Revoked`}),t[0]=e):e=t[0],e}let r;return t[1]===n.presence.online?r=t[2]:(r=n.presence.online?(0,J.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400`,children:[(0,J.jsx)(U,{"aria-hidden":!0,className:`size-3.5`}),` Online`]}):(0,J.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(H,{"aria-hidden":!0,className:`size-3.5`}),` Offline`]}),t[1]=n.presence.online,t[2]=r),r}function wt(){let e=(0,W.c)(7),t=v(),n;e[0]===t?n=e[1]:(n=async e=>{Xe(e.id)||(await t({to:`/`,replace:!0}),await y.selectNode(e.id))},e[0]=t,e[1]=n);let r=n,i;e[2]===t?i=e[3]:(i=async()=>{Ze()||(await t({to:`/`,replace:!0}),await y.returnToDirectory())},e[2]=t,e[3]=i);let a=i,o;return e[4]!==a||e[5]!==r?(o={switchNode:r,returnToAllNodes:a},e[4]=a,e[5]=r,e[6]=o):o=e[6],o}function Tt(){let e=(0,W.c)(5),t=o(Ot),n=o(Dt);if(t!==`delivery-unknown`)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(`p`,{children:`A request may or may not have reached the node. Ryco did not resend it automatically.`}),e[0]=r):r=e[0];let i=!n,a=n?void 0:`Wait for session replay to finish before acknowledging this warning.`,s=n?`Acknowledge`:`Synchronizing…`,c;return e[1]!==i||e[2]!==a||e[3]!==s?(c=(0,J.jsxs)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-amber-500/30 bg-amber-500/5 p-2 text-xs`,children:[r,(0,J.jsx)(D,{className:`mt-2`,size:`sm`,variant:`outline`,disabled:i,title:a,onClick:Et,children:s})]}),e[1]=i,e[2]=a,e[3]=s,e[4]=c):c=e[4],c}function Et(){return y.acknowledgeDeliveryUnknown()}function Dt(e){return e.sessionRecoveredAfterUnknown}function Ot(e){return e.sessionStatus}function kt(){let e=(0,W.c)(62),t=o(Bt),n=o(zt),r=o(Rt),i=o(Lt),a=o(It),s=o(Ft),c=o(Pt),l=o(Nt),u=o(Mt),d=ie(),{switchNode:f,returnToAllNodes:p}=wt(),m=(0,G.useRef)(null);if(!t)return null;let h,g;if(e[0]!==u||e[1]!==d||e[2]!==a||e[3]!==i||e[4]!==r){let t={browserStatus:u,sessionStatus:i,selectionStatus:a,transportStatus:r,e2eeStatus:d};h=ae(t),g=oe(t),e[0]=u,e[1]=d,e[2]=a,e[3]=i,e[4]=r,e[5]=h,e[6]=g}else h=e[5],g=e[6];let _=g,v;e[7]===_?v=e[8]:(v=(0,J.jsx)(St,{indicator:_,className:`size-4`}),e[7]=_,e[8]=v);let y;e[9]===t.label?y=e[10]:(y=(0,J.jsx)(`span`,{className:`max-w-32 truncate font-medium`,children:t.label}),e[9]=t.label,e[10]=y);let b;e[11]===h?b=e[12]:(b=(0,J.jsx)(`span`,{className:`max-w-24 truncate text-xs text-muted-foreground`,children:h}),e[11]=h,e[12]=b);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,J.jsx)(x,{"aria-hidden":!0,className:`size-3.5 transition-transform group-open:rotate-180`}),e[13]=S):S=e[13];let C;e[14]!==v||e[15]!==y||e[16]!==b?(C=(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-lg border border-border bg-card/95 px-3 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[v,y,b,S]}),e[14]=v,e[15]=y,e[16]=b,e[17]=C):C=e[17];let w;e[18]===t.label?w=e[19]:(w=(0,J.jsx)(`p`,{className:`font-medium`,children:t.label}),e[18]=t.label,e[19]=w);let T=c??`Role unavailable`,E;e[20]!==h||e[21]!==T?(E=(0,J.jsxs)(`p`,{className:`mt-0.5 text-xs capitalize text-muted-foreground`,children:[T,` · `,h]}),e[20]=h,e[21]=T,e[22]=E):E=e[22];let O;e[23]!==t.label||e[24]!==h?(O=(0,J.jsxs)(`p`,{className:`sr-only`,"aria-live":`polite`,children:[`Node `,t.label,`: `,h,`.`]}),e[23]=t.label,e[24]=h,e[25]=O):O=e[25];let k;e[26]===l?k=e[27]:(k=l?(0,J.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:l}):null,e[26]=l,e[27]=k);let A;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,J.jsx)(Tt,{}),e[28]=A):A=e[28];let j;e[29]===p?j=e[30]:(j=()=>void p(),e[29]=p,e[30]=j);let re;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,J.jsx)(ce,{"aria-hidden":!0,className:`size-4`}),e[31]=re):re=e[31];let M;e[32]===j?M=e[33]:(M=(0,J.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:j,children:[re,` All nodes`]}),e[32]=j,e[33]=M);let N;if(e[34]!==u||e[35]!==s||e[36]!==t.id||e[37]!==n||e[38]!==f){let r;e[40]===t.id?r=e[41]:(r=e=>e.id!==t.id,e[40]=t.id,e[41]=r);let i;e[42]!==u||e[43]!==s||e[44]!==f?(i=e=>(0,J.jsxs)(`button`,{type:`button`,disabled:s!==`ready`||u!==`current`||e.revokedAt!==null||e.capabilities?.nativeClientRequired===!0,title:e.capabilities?.nativeClientRequired===!0?`Open in Desktop/Mobile`:void 0,className:`flex w-full items-center justify-between rounded-md px-2 py-2 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,onClick:()=>void f(e),children:[(0,J.jsx)(`span`,{className:`truncate`,children:e.label}),(0,J.jsx)(Ct,{node:e})]},e.id),e[42]=u,e[43]=s,e[44]=f,e[45]=i):i=e[45],N=n.filter(r).map(i),e[34]=u,e[35]=s,e[36]=t.id,e[37]=n,e[38]=f,e[39]=N}else N=e[39];let P;e[46]!==M||e[47]!==N?(P=(0,J.jsxs)(`div`,{className:`mt-3 max-h-48 space-y-1 overflow-auto border-t border-border pt-3`,children:[M,N]}),e[46]=M,e[47]=N,e[48]=P):P=e[48];let F;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,J.jsxs)(D,{size:`sm`,variant:`outline`,onClick:jt,children:[(0,J.jsx)(te,{"aria-hidden":!0}),` Refresh`]}),e[49]=F):F=e[49];let I;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,J.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:At,children:[(0,J.jsx)(ee,{"aria-hidden":!0}),` Sign out`]}),e[50]=I):I=e[50];let L;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,J.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 border-t border-border pt-3`,children:[F,I,(0,J.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:()=>{m.current&&(m.current.open=!1),we({kind:`account`,section:`security`})},children:[(0,J.jsx)(ne,{"aria-hidden":!0}),` Account`]})]}),e[51]=L):L=e[51];let R;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,J.jsxs)(`div`,{className:`mt-3 space-y-3 border-t border-border pt-3`,children:[(0,J.jsx)(it,{}),(0,J.jsx)(se,{compact:!0}),(0,J.jsx)(_t,{compact:!0})]}),e[52]=R):R=e[52];let z;e[53]!==k||e[54]!==P||e[55]!==w||e[56]!==E||e[57]!==O?(z=(0,J.jsxs)(`div`,{className:`absolute right-0 z-50 mt-2 w-72 rounded-xl border border-border bg-popover p-3 shadow-xl`,children:[w,E,O,k,A,P,L,R]}),e[53]=k,e[54]=P,e[55]=w,e[56]=E,e[57]=O,e[58]=z):z=e[58];let B;return e[59]!==z||e[60]!==C?(B=(0,J.jsx)(`div`,{className:`relative max-w-full`,children:(0,J.jsxs)(`details`,{ref:m,className:`group relative`,children:[C,z]})}),e[59]=z,e[60]=C,e[61]=B):B=e[61],B}function At(){y.signOut()}function jt(){y.refreshDirectory()}function Mt(e){return e.browserStatus}function Nt(e){return e.errorMessage}function Pt(e){return e.effectiveRole}function Ft(e){return e.directoryStatus}function It(e){return e.selectionStatus}function Lt(e){return e.sessionStatus}function Rt(e){return e.transportStatus}function zt(e){return e.nodes}function Bt(e){return e.selectedNode}function Vt(e){let t=(0,W.c)(66),{open:n,onOpenChange:r}=e,i=o(Qt),a=o(Zt),s=o(Xt),c=o(Yt),l=o(Jt),u=o(qt),d=o(Kt),f=o(Gt),p=o(Wt),m=ie(),{switchNode:h,returnToAllNodes:g}=wt();if(!i)return null;let _,v;if(t[0]!==p||t[1]!==m||t[2]!==l||t[3]!==c||t[4]!==s){let e={browserStatus:p,sessionStatus:c,selectionStatus:l,transportStatus:s,e2eeStatus:m};_=ae(e),v=oe(e),t[0]=p,t[1]=m,t[2]=l,t[3]=c,t[4]=s,t[5]=_,t[6]=v}else _=t[5],v=t[6];let y=v,b=u!==`ready`||p!==`current`,x;t[7]===y?x=t[8]:(x=(0,J.jsx)(St,{indicator:y,className:`size-4`}),t[7]=y,t[8]=x);let S;t[9]===i.label?S=t[10]:(S=(0,J.jsx)(`span`,{className:`truncate`,children:i.label}),t[9]=i.label,t[10]=S);let C;t[11]!==x||t[12]!==S?(C=(0,J.jsxs)(re,{className:`flex items-center gap-2`,children:[x,S]}),t[11]=x,t[12]=S,t[13]=C):C=t[13];let w=d??`Role unavailable`,T;t[14]!==_||t[15]!==w?(T=(0,J.jsxs)(j,{className:`capitalize`,children:[w,` · `,_]}),t[14]=_,t[15]=w,t[16]=T):T=t[16];let E;t[17]!==i.label||t[18]!==_?(E=(0,J.jsxs)(`p`,{className:`sr-only`,"aria-live":`polite`,children:[`Node `,i.label,`: `,_,`.`]}),t[17]=i.label,t[18]=_,t[19]=E):E=t[19];let O;t[20]!==C||t[21]!==T||t[22]!==E?(O=(0,J.jsxs)(A,{children:[C,T,E]}),t[20]=C,t[21]=T,t[22]=E,t[23]=O):O=t[23];let P;t[24]===f?P=t[25]:(P=f?(0,J.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:f}):null,t[24]=f,t[25]=P);let F;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,J.jsx)(Tt,{}),t[26]=F):F=t[26];let I;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,J.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[27]=I):I=t[27];let L;t[28]===r?L=t[29]:(L=(0,J.jsx)(M,{label:`Account`,icon:I,onClick:()=>{r(!1),we({kind:`account`,section:`security`})}}),t[28]=r,t[29]=L);let R;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,J.jsx)(ce,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[30]=R):R=t[30];let z;t[31]!==r||t[32]!==g?(z=(0,J.jsx)(M,{label:`All nodes`,icon:R,onClick:()=>{r(!1),g()}}),t[31]=r,t[32]=g,t[33]=z):z=t[33];let B;if(t[34]!==i.id||t[35]!==a||t[36]!==r||t[37]!==h||t[38]!==b){let e;t[40]===i.id?e=t[41]:(e=e=>e.id!==i.id,t[40]=i.id,t[41]=e);let n;t[42]!==r||t[43]!==h||t[44]!==b?(n=e=>(0,J.jsx)(M,{label:e.label,disabled:b||e.revokedAt!==null||e.capabilities?.nativeClientRequired===!0,disabledReason:e.capabilities?.nativeClientRequired===!0?`Open in Desktop/Mobile`:e.revokedAt===null?`Node switching is unavailable until the directory and this browser are current.`:`Access to this node was revoked.`,trailing:(0,J.jsx)(Ct,{node:e}),onClick:()=>{r(!1),h(e)}},e.id),t[42]=r,t[43]=h,t[44]=b,t[45]=n):n=t[45],B=a.filter(e).map(n),t[34]=i.id,t[35]=a,t[36]=r,t[37]=h,t[38]=b,t[39]=B}else B=t[39];let V;t[46]!==L||t[47]!==z||t[48]!==B?(V=(0,J.jsxs)(`div`,{className:`mt-3 space-y-1 border-t border-border pt-3`,children:[L,z,B]}),t[46]=L,t[47]=z,t[48]=B,t[49]=V):V=t[49];let H=u===`loading`,U;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,J.jsx)(te,{"aria-hidden":!0}),t[50]=U):U=t[50];let G;t[51]===H?G=t[52]:(G=(0,J.jsxs)(D,{size:`sm`,variant:`outline`,className:`min-h-11`,disabled:H,onClick:Ut,children:[U,` Refresh nodes`]}),t[51]=H,t[52]=G);let le;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,J.jsxs)(D,{size:`sm`,variant:`ghost`,className:`min-h-11`,onClick:Ht,children:[(0,J.jsx)(ee,{"aria-hidden":!0}),` Sign out`]}),t[53]=le):le=t[53];let K;t[54]===G?K=t[55]:(K=(0,J.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 border-t border-border pt-3`,children:[G,le]}),t[54]=G,t[55]=K);let ue;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,J.jsxs)(`div`,{className:`mt-3 space-y-3 border-t border-border pt-3`,children:[(0,J.jsx)(se,{compact:!0}),(0,J.jsx)(_t,{compact:!0})]}),t[56]=ue):ue=t[56];let q;t[57]!==V||t[58]!==K||t[59]!==P?(q=(0,J.jsxs)(k,{children:[P,F,V,K,ue]}),t[57]=V,t[58]=K,t[59]=P,t[60]=q):q=t[60];let de;return t[61]!==r||t[62]!==n||t[63]!==q||t[64]!==O?(de=(0,J.jsxs)(N,{open:n,onOpenChange:r,label:`Connection`,children:[O,q]}),t[61]=r,t[62]=n,t[63]=q,t[64]=O,t[65]=de):de=t[65],de}function Ht(){y.signOut()}function Ut(){y.refreshDirectory()}function Wt(e){return e.browserStatus}function Gt(e){return e.errorMessage}function Kt(e){return e.effectiveRole}function qt(e){return e.directoryStatus}function Jt(e){return e.selectionStatus}function Yt(e){return e.sessionStatus}function Xt(e){return e.transportStatus}function Zt(e){return e.nodes}function Qt(e){return e.selectedNode}function $t(){let e=(0,W.c)(25),t=o(an),n=o(rn),r=o(nn),i=o(tn),a=o(en),s=ie(),[c,l]=(0,G.useState)(!1);if(!t)return null;let u,d;if(e[0]!==a||e[1]!==s||e[2]!==i||e[3]!==r||e[4]!==n){let t={browserStatus:a,sessionStatus:r,selectionStatus:i,transportStatus:n,e2eeStatus:s};u=ae(t),d=oe(t),e[0]=a,e[1]=s,e[2]=i,e[3]=r,e[4]=n,e[5]=u,e[6]=d}else u=e[5],d=e[6];let f=d,p;e[7]!==t.label||e[8]!==c||e[9]!==r||e[10]!==u?(p=c?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`hosted-connection-status-announcer`,className:`sr-only`,children:[`Node `,t.label,`: `,u,`.`]}),r===`delivery-unknown`?(0,J.jsx)(`span`,{role:`alert`,className:`sr-only`,children:`Delivery unknown: a request may or may not have reached the node. Open the connection controls to acknowledge.`}):null]}),e[7]=t.label,e[8]=c,e[9]=r,e[10]=u,e[11]=p):p=e[11];let m=`Connection: ${t.label}, ${u}`,h;e[12]===f?h=e[13]:(h=(0,J.jsx)(St,{indicator:f,testId:`hosted-connection-icon`,className:`size-3.5 shrink-0`}),e[12]=f,e[13]=h);let g;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>l(!0),e[14]=g):g=e[14];let _;e[15]!==f.shortLabel||e[16]!==m||e[17]!==h?(_=(0,J.jsx)(tt,{testId:`hosted-connection-pill`,label:m,status:f.shortLabel,icon:h,onClick:g}),e[15]=f.shortLabel,e[16]=m,e[17]=h,e[18]=_):_=e[18];let v;e[19]===c?v=e[20]:(v=(0,J.jsx)(Vt,{open:c,onOpenChange:l}),e[19]=c,e[20]=v);let y;return e[21]!==p||e[22]!==_||e[23]!==v?(y=(0,J.jsxs)(J.Fragment,{children:[p,_,v]}),e[21]=p,e[22]=_,e[23]=v,e[24]=y):y=e[24],y}function en(e){return e.browserStatus}function tn(e){return e.selectionStatus}function nn(e){return e.sessionStatus}function rn(e){return e.transportStatus}function an(e){return e.selectedNode}function on(){let e=(0,W.c)(2),t=O(),n;return e[0]===t?n=e[1]:(n=t===`phone`?(0,J.jsx)($t,{}):(0,J.jsx)(kt,{}),e[0]=t,e[1]=n),n}export{Ee as _,wt as a,Ie as c,$e as d,Ne as f,Te as g,we as h,Ct as i,Xe as l,pe as m,$t as n,_t as o,fe as p,kt as r,gt as s,on as t,Me as u,H as v};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-Bbc24tew.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import"./src-b7-hpIff.js";import{F as i,Jt as a,M as o,N as s,P as c,Wt as l}from"./runtime-BkRtSwRY.js";import{f as u,t as d}from"./utils-c6dglOTK.js";import{a as f,i as p,o as m}from"./useHandleNewThread-COAg-4eT.js";import{t as h}from"./useNavigate-2tVq4iZ2.js";import{Gt as g,_,o as v}from"./authorization-CFcCWeGd.js";import{t as y}from"./RootAppShell-BWtqIOLh.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-DonYDy-6.js";import{n as k,t as A}from"./useCopyToClipboard-qG2nhvjQ.js";import{t as j}from"./key-round-CacMputS.js";import{_ as M,a as N,c as P,d as F,f as I,g as L,h as R,i as z,l as B,m as V,o as ee,p as te,t as H,u as ne}from"./HostedConnectionControls-BYS30u9D.js";import{t as re}from"./log-out-tMJm0Gk6.js";import{t as ie}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 U}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{n as W,t as G}from"./input-zjUwoDs3.js";import{u as K}from"./Icons-Cme5LL0k.js";import{t as q}from"./button-BT6cGe5S.js";import{a as le,i as J,n as ue,o as de,r as fe,s as pe,t as me}from"./sheet-DQBndeJT.js";import{t as he}from"./skeleton-CCuGgPK1.js";import{t as ge}from"./usePresentationTier-B_SCFvN7.js";import{i as _e,r as ve,t as ye}from"./alert-DFo8_l6D.js";import{a as be,c as xe,i as Se,o as Ce,r as we,s as Te,t as Ee}from"./dialog-BUIS3TXH.js";import{t as Y}from"./label-DWGvDLsD.js";import{t as De}from"./RycoLetterMark-E82lj57c.js";import{a as Oe,i as ke,n as Ae,o as je,r as Me,t as Ne}from"./MobileSheet-C8OrQzw0.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./empty-BNn5X77p.js";import{c as Be,n as Ve,r as He,t as Ue}from"./ExternalIdentityWeb.logic-DsqwSlwL.js";import{a as We}from"./settingsLayout-B8os-EWr.js";import{n as Ge,r as Ke,t as qe}from"./phoneAnchoredActions-CtpkI3yG.js";import{t as Je}from"./HostedRelayTrustNotice-CB0O5OAN.js";import{n as X,t as Ye}from"./data-list-iVYHRfWS.js";var Xe=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`}]]),Ze=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(),Qe=/^[A-Za-z0-9_-]{43}$/u,$e=/^signup_[A-Za-z0-9_-]{22,43}$/u;function et(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&&$e.test(n)&&r!==null&&Qe.test(r)&&i!==null&&Qe.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&&Qe.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&&Qe.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function tt(e){let t=new URL(e.href),n=et(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function nt(){let e=(0,Q.c)(3),t=s(ot),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=it,n=()=>{document.visibilityState===`hidden`?(f(!0),v.suspendBrowser(`hidden`)):e()},r=rt,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 rt(){f(!0),v.suspendBrowser(`offline`)}function it(){document.visibilityState===`visible`&&navigator.onLine&&v.resumeBrowser().then(at)}function at(){return f(!1)}function ot(e){return e.accountStatus}var $=u(),st=100;function ct(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>st?`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)(be,{children:[(0,$.jsx)(xe,{children:`Rename node`}),(0,$.jsx)(we,{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)(Ce,{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)(q,{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)(q,{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)(Se,{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)(Te,{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)(Ee,{open:r,onOpenChange:i,children:L}),t[48]=i,t[49]=r,t[50]=L,t[51]=R):R=t[51],R}var lt=`owner_revoked`,ut=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.`})]),dt=`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 ft(e){return{title:`Revoke ${e.label}?`,consequences:ut,subjectPrompt:dt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var pt=`Revoke`;function mt(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function ht(e){return e===null||e.outcome===`unchanged`}var gt=e=>Object.freeze(e),_t=Object.freeze([gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})})]),vt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function yt(e){let t=bt(e),n=xt(e);for(let e of _t)if(e.selects(t,n))return e.failure;return vt}function bt(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function xt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var St=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Ct(e){return e===null||!Number.isFinite(e)?null:St.format(new Date(e))}function wt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Tt(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Et(e){return Tt(e)}function Dt(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return Ct(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`:Ct(e)??`unknown`}function Ot(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${Dt(e.lastAuthenticatedAt,t)}`:`Last seen ${Dt(e.presence.lastHeartbeatAt,t)}`}function kt(e){let t=`${wt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${Et(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function At(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 jt(e){return e.filter(e=>e.revokedAt===null).length}function Mt(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function Nt(e){let t=jt(e),n=Mt(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 Pt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Ft(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 It({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=ft(e),l=ht(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(yt(e)),a(!1)}}};return(0,$.jsx)(Ee,{open:t,onOpenChange:e=>{!e&&i||n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:c.title}),(0,$.jsx)(we,{children:c.subjectPrompt})]}),(0,$.jsxs)(Ce,{className:`space-y-4`,children:[(0,$.jsxs)(Ye,{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:`${wt(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)(Se,{children:[(0,$.jsx)(q,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(q,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Lt(e){let t=(0,Q.c)(57),{node:n}=e,r=We(6e4),{copyToClipboard:i,isCopied:a}=A(),o;t[0]===n.createdAt?o=t[1]:(o=Ct(n.createdAt),t[0]=n.createdAt,t[1]=o);let s=o,c;t[2]===n.lastAuthenticatedAt?c=t[3]:(c=Ct(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=c);let l=c,u;t[4]===n.revokedAt?u=t[5]:(u=Ct(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)(z,{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:Ct(n.presence.lastHeartbeatAt)??void 0,children:Dt(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=wt(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=Et(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:[Et(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 j=a?`Copied`:`Copy node ID`,M;t[34]!==i||t[35]!==n.id?(M=()=>i(n.id,void 0),t[34]=i,t[35]=n.id,t[36]=M):M=t[36];let N;t[37]===a?N=t[38]:(N=a?(0,$.jsx)(S,{"aria-hidden":!0}):(0,$.jsx)(k,{"aria-hidden":!0}),t[37]=a,t[38]=N);let P;t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,$.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":j,onClick:M,children:N}),t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;t[43]!==n.id||t[44]!==P?(F=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:P,children:n.id}),t[43]=n.id,t[44]=P,t[45]=F):F=t[45];let I;return t[46]!==b||t[47]!==x||t[48]!==w||t[49]!==T||t[50]!==D||t[51]!==O||t[52]!==F||t[53]!==p||t[54]!==h||t[55]!==_?(I=(0,$.jsxs)(Ye,{children:[p,h,_,b,x,w,T,D,O,F]}),t[46]=b,t[47]=x,t[48]=w,t[49]=T,t[50]=D,t[51]=O,t[52]=F,t[53]=p,t[54]=h,t[55]=_,t[56]=I):I=t[56],I}function Rt(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=ge()===`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?(_=Pt({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=Ft({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)(je,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=kt(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Ae,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(ke,{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)(Lt,{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)(Oe,{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)(Me,{children:(0,$.jsx)(q,{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)(Ne,{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)(pe,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=E);let D;t[44]===n?D=t[45]:(D=kt(n),t[44]=n,t[45]=D);let O;t[46]===D?O=t[47]:(O=(0,$.jsx)(ue,{children:D}),t[46]=D,t[47]=O);let k;t[48]!==E||t[49]!==O?(k=(0,$.jsxs)(J,{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)(Lt,{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)(le,{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)(q,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:pt}):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)(q,{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)(q,{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)(fe,{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)(de,{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)(me,{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)(ct,{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)(It,{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 V;return t[89]!==R||t[90]!==z||t[91]!==B?(V=(0,$.jsxs)($.Fragment,{children:[R,z,B]}),t[89]=R,t[90]=z,t[91]=B,t[92]=V):V=t[92],V}function zt(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 Bt(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=d(`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 Vt(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=d(`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)(De,{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,Ge]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Ht=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Ut=`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))]`,Wt=`flex min-h-full flex-col`,Gt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function Kt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=d(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=d(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Gt.page),o=(0,$.jsx)(Vt,{}),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 qt(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=ge()===`phone`,l;t[0]!==c||t[1]!==r||t[2]!==i?(l=c?null:(0,$.jsx)(Kt,{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`,f=Gt[s],p;t[4]!==u||t[5]!==f?(p=d(`mx-auto flex w-full flex-col`,u,Ut,f),t[4]=u,t[5]=f,t[6]=p):p=t[6];let m;t[7]!==n||t[8]!==p?(m=(0,$.jsx)(`section`,{className:p,children:n}),t[7]=n,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==a||t[11]!==m?(h=(0,$.jsx)(`main`,{ref:a,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:m}),t[10]=a,t[11]=m,t[12]=h):h=t[12];let g;return t[13]!==l||t[14]!==h?(g=(0,$.jsx)(E,{children:(0,$.jsx)(O,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[l,h]})})}),t[13]=l,t[14]=h,t[15]=g):g=t[15],g}var Jt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-ckhtafp7.js`).then(e=>({default:e.AccountSettingsPanel})),[])),Yt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-CDvljGDS.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),Xt=[{id:`overview`,label:`Overview`,icon:ce},{id:`security`,label:`Security`,icon:U},{id:`appearance`,label:`Appearance`,icon:ie}];function Zt(e){let t=(0,Q.c)(15),{section:n}=e,r=s($t),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(q,{variant:`ghost`,onClick:Qt,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=Xt.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(q,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>R({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[3]=n,t[4]=o);let c;t[5]===o?c=t[6]:(c=(0,$.jsx)(`nav`,{"aria-label":`Account`,className:`shrink-0 sm:w-48`,children:(0,$.jsx)(`ul`,{className:`flex gap-1 overflow-x-auto sm:flex-col sm:overflow-visible`,children:o})}),t[5]=o,t[6]=c);let l;t[7]===n?l=t[8]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(en,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Jt,{}):(0,$.jsx)(Yt,{surface:`hub`})})}),t[7]=n,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==u?(d=(0,$.jsx)(qt,{measure:`page`,trailing:i,children:(0,$.jsx)(zt,{title:`Account`,description:a,children:u})}),t[12]=a,t[13]=u,t[14]=d):d=t[14],d}function Qt(){return R({kind:`nodes`})}function $t(e){return e.account}function en(){let e=(0,Q.c)(11),t=s(tn),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 c;e[6]===o?c=e[7]:(c=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=c);let l;return e[8]!==i||e[9]!==c?(l=(0,$.jsx)(Bt,{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,c]})}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}function tn(e){return e.account}function nn(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(rn)}),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 rn(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 an(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,f,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=d(Ht,`hub-ambient`),p=d(Wt,Ut,`py-10`),t[0]=f,t[1]=p):(f=t[0],p=t[1]);let m=Gt[u],h;t[2]===m?h=t[3]:(h=d(`my-auto w-full self-center phone:my-0 phone:flex phone:max-w-none phone:flex-1 phone:flex-col`,m),t[2]=m,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Vt,{size:`lg`})}),t[4]=g):g=t[4];let _;t[5]!==r||t[6]!==c?(_=(0,$.jsx)(`h1`,{ref:c,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[5]=r,t[6]=c,t[7]=_):_=t[7];let v;t[8]===i?v=t[9]:(v=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=v);let y;t[10]===n?y=t[11]:(y=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=y);let b;t[12]!==a||t[13]!==_||t[14]!==v||t[15]!==y||t[16]!==o?(b=(0,$.jsxs)(`section`,{className:`hub-gateway-panel app-surface relative rounded-2xl border p-6 not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] sm:p-8 phone:flex phone:flex-1 phone:flex-col phone:rounded-none phone:border-0 phone:p-0 phone:shadow-none phone:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:[_,v,y,a,o]}),t[12]=a,t[13]=_,t[14]=v,t[15]=y,t[16]=o,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(nn,{}),t[18]=x):x=t[18];let S;t[19]!==b||t[20]!==h?(S=(0,$.jsx)(`div`,{className:p,children:(0,$.jsxs)(`div`,{className:h,children:[g,b,x]})}),t[19]=b,t[20]=h,t[21]=S):S=t[21];let C;return t[22]!==s||t[23]!==S?(C=(0,$.jsx)(`main`,{ref:s,className:f,children:S}),t[22]=s,t[23]=S,t[24]=C):C=t[24],C}function on({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(null),[o,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))},g=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof _&&e.status===401){f.current=``,n(``),a(null),await v.expireSession();return}d(t??(e instanceof _?e.message:`Hub is temporarily unavailable.`))}},y=async e=>{e.preventDefault();let r=t.trim();n(``),f.current=``;let o=m();try{let e=await i.lookupNodeEnrollment(r,o.signal);if(o.signal.aborted)return;f.current=r,a(e),s(`review`)}catch(e){await g(e)}finally{h(o)}},b=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`approved`),await v.refreshDirectory()}catch(e){f.current=``,a(null),s(`input`),await g(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 i.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`denied`)}catch(e){await g(e)}finally{h(t)}},S=()=>{p.current?.abort(),f.current=``,n(``),a(null),e()};return o===`approved`||o===`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:o===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:o===`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)(q,{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)(Ye,{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,o===`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)(q,{variant:`destructive`,disabled:c,onClick:()=>void x(),children:`Confirm denial`}),(0,$.jsx)(q,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(q,{disabled:c,onClick:()=>void b(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(q,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(q,{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)(q,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(q,{type:`button`,variant:`outline`,onClick:S,children:`Cancel`})]})]})]})}function sn(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 cn=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,ln=null;function un(){return window.turnstile?Promise.resolve(window.turnstile):ln||(ln=new Promise((e,t)=>{let n=document.querySelector(`script[src="${cn}"]`),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=cn,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw ln=null,e}),ln)}function dn(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),un().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 fn(e,t){return e instanceof _?e.message:t}function pn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),g(e)}function mn(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,a]=(0,Z.useState)(!0),o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=new AbortController;return i.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||a(!1)}),()=>e.abort()},s=[],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,Z.useEffect)(o,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 hn(e){return e!==null&&`activationSecret`in e}function gn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[a,o]=(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.`),o(`details`));return}let e=new AbortController;return x(!0),i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,o(`credential`)}).catch(e=>w(fn(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 i.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,o(`check-email`)}catch(e){w(fn(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 i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});f(``),T.current=e,o(`credential`)}catch(e){w(fn(e,`That email code could not be verified.`))}finally{x(!1)}}},k=async e=>{let t=T.current;if(b||!hn(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 i.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:pn()}):await i.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:pn()});T.current=null,await v.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(fn(e,`Account creation did not complete.`))}finally{x(!1)}},A=a===`details`?1:a===`check-email`||a===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(sn,{step:A,total:3,label:A===1?`Your details`:A===2?`Verify your email`:`Choose how you sign in`}),a===`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)(dn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(xn,{value:S}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Send verification email`,submitDisabled:e===null})]}):a===`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)(Ze,{"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)(xn,{value:S}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Verify email`})]}):a===`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)(xn,{value:S}),(0,$.jsx)(Sn,{onCancel:()=>o(`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)(U,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:a===`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)(xn,{value:S}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${qe}`,children:[(0,$.jsxs)(q,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>void k(`passkey`),children:[b?(0,$.jsx)(C,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(j,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(q,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>o(`password`),children:`Use a password instead`}),(0,$.jsx)(q,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function _n({pendingSignup:e,config:t,onCancel:n}){let[r,a]=(0,Z.useState)(e.suggestedUsername??``),[o,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`:o??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await i.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:pn()});await v.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(fn(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)(sn,{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)(U,{"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=>a(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)(dn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(xn,{value:u}),(0,$.jsx)(Sn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function vn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,a]=(0,Z.useState)(``),[o,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 i.startPasswordLogin({identifier:r.trim().toLowerCase(),password:o});s(``),d(e)}else{let e=await i.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await v.adoptPublicBrowserIdentity(e)}}catch(e){h(fn(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=>a(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:o,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)(xn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Sn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function yn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,a]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[o,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 i.verifyPasswordReset({token:e},t);b.current=n,l(``),a(`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.`),a(`request`));return}let n=new AbortController;return _(!0),S(e.token,n.signal).catch(e=>y(fn(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 i.requestPasswordReset({identifier:o.trim().toLowerCase()}),a(`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 i.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:m.trim()}:{kind:`none`}}),h(``),b.current=null,a(`complete`)}}catch(e){y(fn(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)(sn,{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:o,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)(Ze,{"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)(U,{"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)(xn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsx)(q,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Sn,{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 bn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=async e=>{if(e.preventDefault(),r)return;a(!0),s(null);let o=t;n(``);try{await i.signInWithRecoveryCode(o),await v.bootstrap()}catch(e){s(fn(e,`That recovery code could not be used.`))}finally{a(!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)(xn,{value:o}),(0,$.jsx)(Sn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function xn(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 Sn(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)(q,{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)(q,{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 ${qe}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var Cn;function wn(){if(window.location.pathname!==`/email-verification`)return null;if(Cn!==void 0)return Cn;let e=tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return Cn=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,Cn}function Tn(){let e=(0,Q.c)(3),t=M(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=Ke(t===null?void 0:V(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function En(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(wn),r=s(Pn),i=s(Nn),o=s(Mn),u=s(jn),d=s(An),f=s(kn),p=c(On),m=I(),h;e[0]===m.logicalPathname?h=e[1]:(h=P(m.logicalPathname),e[0]=m.logicalPathname,e[1]=h);let g=h,_;e[2]===g?_=e[3]:(_=e=>l(e,g),e[2]=g,e[3]=_);let v=a(_),b=ne();F();let x;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],e[4]=x):x=e[4],(0,Z.useEffect)(Dn,x),nt(),Tn();let S=M(),C;e[5]!==r||e[6]!==S?.kind?(C=()=>{r===`authenticated`&&S?.kind===`sign-up`&&L(`/`,{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)(Fn,{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)(Gn,{}),e[14]=t):t=e[14],t}if(o.length>0&&!p){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jn,{}),e[15]=t):t=e[15],t}if(S?.kind===`account`){let t;return e[16]===S.section?t=e[17]:(t=(0,$.jsx)(Zt,{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)($n,{}),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)($n,{}),e[19]=t):t=e[19],t}if(i&&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(!i||i.id!==m.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Vn,{}),e[22]=t):t=e[22],t}if(u===`terminal-failure`){let t;return e[23]!==f||e[24]!==i?(t=(0,$.jsx)(Rn,{node:i,message:f}),e[23]=f,e[24]=i,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]===i?t=e[28]:(t=(0,$.jsx)(Hn,{node:i}),e[27]=i,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 Dn(){return m()}function On(e){return e.leased}function kn(e){return e.errorMessage}function An(e){return e.sessionEstablished}function jn(e){return e.transportStatus}function Mn(e){return e.recoveryCodes}function Nn(e){return e.selectedNode}function Pn(e){return e.accountStatus}function Fn(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[a,o]=(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 i.confirmEmailVerification(n.token,e.signal).then(()=>o(`verified`)).catch(()=>{e.signal.aborted||o(`invalid`)}).finally(In),()=>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=a===`verifying`?`Verifying your email`:a===`verified`?`Email verified`:`This verification link is unavailable`,u=a===`verifying`?`This will only take a moment.`:a===`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]!==a?(d=a===`verifying`?void 0:(0,$.jsx)(q,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=a,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=a===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Confirming the link…`]}):null,t[8]=a,t[9]=f);let p;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsx)(an,{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 In(){Cn=void 0}function Ln(){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 Rn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(H,{}),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)(q,{className:`mt-5`,onClick:zn,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)(qt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Bn,{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 zn(){v.retrySelectedNode()}function Bn(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 Vn(){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)(qt,{measure:`content`,children:(0,$.jsx)(Bn,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Hn(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=N(),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)(Ln,{}),`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)(q,{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)(qt,{measure:`content`,children:(0,$.jsxs)(Bn,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Un(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(Wn),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)(q,{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 Wn(e){return!e}function Gn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=s(e=>e.accountStatus),r=s(e=>e.errorMessage),a=s(e=>e.bootstrapAvailable),[c,l]=(0,Z.useState)(()=>tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),u=(0,Z.useCallback)(()=>l(null),[]),{config:d}=mn(),f=o(e=>e.externalIdentityConfiguration),p=He(f),[m,h]=(0,Z.useState)(!1),[g,y]=(0,Z.useState)(null),b=(0,Z.useRef)(!1),[x,S]=(0,Z.useState)(void 0),w=M(),T=w?.kind===`sign-up`||w?.kind===`sign-up-verify`?`public`:w?.kind===`invitation`?`invitation`:w?.kind===`setup`?`bootstrap`:null,E=w?.kind===`sign-in-password`?`password`:w?.kind===`sign-in-recovery-code`?`recovery-code`:w?.kind===`reset-password`?`password-reset`:null,D=e=>{R(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},O=e=>{R(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},k=(0,Z.useRef)(null),A=(0,Z.useRef)(null),N=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{v.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(T!==`public`&&e!==`native-authorization`){S(void 0);return}let t=new AbortController;return S(void 0),i.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||S(e)}).catch(()=>{t.signal.aborted||S({status:`none`})}),()=>t.abort()},[e,T]);let P=(0,Z.useCallback)(async()=>{if(!m){h(!0),y(null);try{await Ue({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:te({kind:`sign-up`}),start:e=>i.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){y(e instanceof _?e.message:`GitHub sign-in is temporarily unavailable.`),h(!1)}}},[e,m]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||p?.login!==!0||x?.status!==`none`||b.current||(b.current=!0,P())},[t,e,x?.status,p?.login,P,n]),(0,Z.useEffect)(()=>{T===`invitation`||T===`bootstrap`?A.current?.focus({preventScroll:!0}):k.current?.focus({preventScroll:!0})},[E,T]),(0,Z.useEffect)(()=>{N.current?.scrollTo({top:0,left:0})},[E,T]);let F=T===`invitation`||T===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${qe}`,children:[(0,$.jsx)(q,{type:`submit`,form:Kn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:T===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(q,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>v.cancelAuthentication():()=>D(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,I=T||E?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[p?.login?(0,$.jsxs)(q,{size:`lg`,className:`phone:min-h-11`,disabled:m||n===`authenticating`||n===`signing-out`,onClick:()=>void P(),children:[m?(0,$.jsx)(C,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(K,{"aria-hidden":!0}),m?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(q,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void v.signIn(),children:[(0,$.jsx)(j,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(q,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>v.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[d?.status===`enabled`?(0,$.jsx)(q,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`public`),children:`Create account`}):null,(0,$.jsx)(q,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(q,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`bootstrap`),children:`Set up first owner`}):null]})]})}),L=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(q,{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.`:``})]}),z=g??r,B=z?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`error`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`Sign-in did not complete`}),(0,$.jsx)(ve,{children:z})]})}):null,V=x?.status===`signup`?x:null,H=x?.status===`error`?x:null,ne=e===`native-authorization`&&T!==`public`;if(T===`public`||ne&&(V!==null||H!==null)){let e=()=>{ne?S({status:`none`}):D(null)};return(0,$.jsxs)(an,{title:`Create your account`,description:ne?`Choose your Ryco username, then return to approving this device.`:`Pick a username and confirm your email. You choose a passkey or a password at the end.`,trailing:L,scrollRef:N,titleRef:k,children:[B,x===void 0?(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}):V?(0,$.jsx)(_n,{pendingSignup:V,config:d?.status===`enabled`?d:null,onCancel:e}):H?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(ye,{variant:`warning`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`GitHub signup did not continue`}),(0,$.jsx)(ve,{children:Ve(H.code)})]}),(0,$.jsx)(q,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(gn,{config:d?.status===`enabled`?d:null,initialLink:c,onConsumeLink:u,onCancel:()=>{u(),D(null)}})]})}if(T===`invitation`||T===`bootstrap`)return(0,$.jsxs)(an,{title:T===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:T===`invitation`?`Enter the invitation code an owner sent you. Your browser creates a passkey at the same time.`:`No owner exists yet. The bootstrap credential from whoever deployed this Hub makes you its first owner.`,actions:F,trailing:L,scrollRef:N,titleRef:k,children:[B,(0,$.jsx)(qn,{mode:T,credentialRef:A})]});if(E!==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.`}}[E];return(0,$.jsxs)(an,{title:e.title,description:e.description,trailing:L,scrollRef:N,titleRef:k,children:[B,E===`password`?(0,$.jsx)(vn,{onCancel:()=>O(null),onUseRecoveryCode:()=>O(`recovery-code`),onResetPassword:()=>O(`password-reset`)}):E===`recovery-code`?(0,$.jsx)(bn,{onCancel:()=>O(null)}):(0,$.jsx)(yn,{initialLink:c,onConsumeLink:u,onCancel:()=>{u(),O(null)}})]})}return(0,$.jsxs)(an,{title:e===`native-authorization`?`Sign in to continue on your device`:n===`session-expired`?`Your session expired`:`Connect to your Ryco nodes`,description:e===`native-authorization`?`Authenticate in this browser first. Ryco will ask again before it authorizes the mobile app.`:`Ryco Hub reaches the developer machines an owner has authorized for your account. Your session lives in an HttpOnly cookie — nothing about it is readable by this page.`,actions:I,trailing:L,scrollRef:N,titleRef:k,children:[(0,$.jsx)(Je,{}),(0,$.jsx)(Un,{bootstrapAvailable:a,publicSignupEnabled:d?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(q,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>O(`password`),children:[(0,$.jsx)(Xe,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(ee,{}),B]})}var Kn=`hub-registration-form`;function qn(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:Kn,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 Jn(){let e=(0,Q.c)(20),t=s(Zn),{copyToClipboard:n,isCopied:r}=A(),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(Be(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 c=r?`Copied`:`Copy codes`,l;e[5]!==a||e[6]!==o||e[7]!==c?(l=(0,$.jsxs)(q,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:a,children:[o,c]}),e[5]=a,e[6]=o,e[7]=c,e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(q,{size:`cta`,className:`mt-3 w-full`,onClick:Xn,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 ${qe}`,children:[l,u]}),e[10]=l,e[11]=d);let f;e[12]===t?f=e[13]:(f=t.map(Yn),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)(an,{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 Yn(e){return(0,$.jsx)(`li`,{children:e},e)}function Xn(){return v.dismissRecoveryCodes()}function Zn(e){return e.recoveryCodes}function Qn(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=Ot(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=p(n),t[3]=n,t[4]=l);let u=l,d=i||u,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(oe,{"aria-hidden":!0,className:`size-4`})}),t[5]=f):f=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=kt(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)(z,{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:[f,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 $n(){let e=(0,Q.c)(110),t=s(pr),n=s(fr),r=s(dr),a=s(ur),o=s(lr),c=s(cr),l=ne(),u=h(),d=ge()===`phone`,f=M()?.kind===`nodes-enroll`,p=sr,[m,g]=(0,Z.useState)(null),[_,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=We(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=>{B(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)(qt,{measure:`content`,children:(0,$.jsx)(on,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,A,j,N,P,F,I,L,R,z,V,te,H,ie,U,W;if(e[5]!==o||e[6]!==r||e[7]!==m||e[8]!==a||e[9]!==d||e[10]!==t||e[11]!==x||e[12]!==_||e[13]!==l||e[14]!==E||e[15]!==c||e[16]!==n){let i=At(t),s;e[35]!==m||e[36]!==t?(s=m===null?null:t.find(e=>e.id===m)??null,e[35]=m,e[36]=t,e[37]=s):s=e[37],A=s,P=o?.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)(q,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:or,children:[(0,$.jsx)(ce,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let h;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsxs)(q,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:ar,children:[(0,$.jsx)(re,{"aria-hidden":!0}),` Sign out`]}),e[39]=h):h=e[39],I=h;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)(q,{className:v,onClick:y,children:[S,` Enroll node`]}),e[42]=v,e[43]=w),j=w;let T=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,M=n===`loading`,B;e[44]===n?B=e[45]:(B=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]=B);let ee;e[46]!==T||e[47]!==M||e[48]!==B?(ee=(0,$.jsxs)(q,{className:T,variant:`outline`,disabled:M,onClick:ir,children:[B,`Refresh nodes`]}),e[46]=T,e[47]=M,e[48]=B,e[49]=ee):ee=e[49],F=ee,O=qt;let ne;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(q,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:rr,children:(0,$.jsx)(ce,{"aria-hidden":!0})}),e[50]=ne):ne=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsxs)($.Fragment,{children:[ne,(0,$.jsx)(q,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:nr,children:(0,$.jsx)(re,{"aria-hidden":!0})})]}),e[51]=R):R=e[51],D=zt,z=b,V=t.length===1?`Your node`:`Your nodes`;let G=o?.displayName??`Hub account`,K;e[52]===o?K=e[53]:(K=o?` · ${o.role.charAt(0).toUpperCase()}${o.role.slice(1)}`:``,e[52]=o,e[53]=K);let le;e[54]!==G||e[55]!==K?(le=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,G,K]}),e[54]=G,e[55]=K,e[56]=le):le=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:Nt(t)}):null,e[57]=t,e[58]=J),e[59]!==le||e[60]!==J?(te=(0,$.jsxs)($.Fragment,{children:[le,J]}),e[59]=le,e[60]=J,e[61]=te):te=e[61],e[62]!==j||e[63]!==N||e[64]!==d||e[65]!==F?(H=d?void 0:(0,$.jsxs)($.Fragment,{children:[F,N?j:null]}),e[62]=j,e[63]=N,e[64]=d,e[65]=F,e[66]=H):H=e[66],e[67]===n?ie=e[68]:(ie=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=ie),e[69]===_?U=e[70]:(U=_?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(se,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:_})]})}):null,e[69]=_,e[70]=U);let ue=n===`stale`?null:a;e[71]!==l||e[72]!==c||e[73]!==ue?(W=(0,$.jsx)(mr,{selection:c,routeNotice:l,error:ue}),e[71]=l,e[72]=c,e[73]=ue,e[74]=W):W=e[74],L=u?(0,$.jsx)(hr,{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:[i.map(e=>(0,$.jsx)(Qn,{node:e,nowMs:x,disabled:Pt({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(tr)}):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]=o,e[6]=r,e[7]=m,e[8]=a,e[9]=d,e[10]=t,e[11]=x,e[12]=_,e[13]=l,e[14]=E,e[15]=c,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=A,e[21]=j,e[22]=N,e[23]=P,e[24]=F,e[25]=I,e[26]=L,e[27]=R,e[28]=z,e[29]=V,e[30]=te,e[31]=H,e[32]=ie,e[33]=U,e[34]=W}else D=e[17],O=e[18],k=e[19],A=e[20],j=e[21],N=e[22],P=e[23],F=e[24],I=e[25],L=e[26],R=e[27],z=e[28],V=e[29],te=e[30],H=e[31],ie=e[32],U=e[33],W=e[34];let G,K;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Je,{})}),K=(0,$.jsx)(ee,{}),e[75]=G,e[76]=K):(G=e[75],K=e[76]);let le;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e||g(null)},e[77]=le):le=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 i.revokeNode(e.id,lt),y(mt(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)(Rt,{node:A,directoryStatus:n,browserStatus:r,canRename:P,canRevoke:P,onOpenChange:le,onConnect:J,onRename:er,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]!==z||e[91]!==V||e[92]!==te||e[93]!==H||e[94]!==ie||e[95]!==U||e[96]!==W?(fe=(0,$.jsxs)(D,{titleRef:z,title:V,description:te,actions:H,children:[ie,U,W,L,G,K,de]}),e[87]=D,e[88]=L,e[89]=de,e[90]=z,e[91]=V,e[92]=te,e[93]=H,e[94]=ie,e[95]=U,e[96]=W,e[97]=fe):fe=e[97];let pe;e[98]!==k||e[99]!==j||e[100]!==N||e[101]!==d||e[102]!==F||e[103]!==I?(pe=d?(0,$.jsxs)(`div`,{className:`mt-auto ${qe}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,I]}),N?j:null,F]}):null,e[98]=k,e[99]=j,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 er(e,t){await i.renameNode(e.id,t),await v.refreshDirectory()}function tr(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(he,{className:`h-16 w-full rounded-xl`})},e)}function nr(){v.signOut()}function rr(){R({kind:`account`,section:`security`})}function ir(){v.refreshDirectory()}function ar(){v.signOut()}function or(){R({kind:`account`,section:`security`})}function sr(e){return R(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function cr(e){return e.selectionStatus}function lr(e){return e.account}function ur(e){return e.errorMessage}function dr(e){return e.browserStatus}function fr(e){return e.directoryStatus}function pr(e){return e.nodes}function mr(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)(ye,{variant:`error`,children:[o,(0,$.jsx)(ve,{children:a})]})}),t[1]=a,t[2]=s),s}function hr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Pe,{variant:`icon`,children:n?(0,$.jsx)(oe,{"aria-hidden":!0}):(0,$.jsx)(U,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Le,{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)(Re,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Fe,{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)(Ie,{children:(0,$.jsxs)(q,{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)(ze,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Gn as HostedAuthenticationSurface,En as HostedHubRoot};