ryco-cli 0.1.24 → 0.1.25

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 (200) hide show
  1. package/dist/{AcpNativeLogging-COepku4a.cjs → AcpNativeLogging-CA6XYzIS.cjs} +1 -1
  2. package/dist/{AcpNativeLogging-D7e1dn7s.mjs → AcpNativeLogging-D4-VoHrq.mjs} +1 -1
  3. package/dist/{AzureDevOpsSourceControlProvider-BNGEg1R8.mjs → AzureDevOpsSourceControlProvider-B_E0XXfD.mjs} +2 -2
  4. package/dist/{AzureDevOpsSourceControlProvider-CrvgKNf2.cjs → AzureDevOpsSourceControlProvider-COmd21c-.cjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-BzhsQwH-.cjs → BitbucketSourceControlProvider-CD8IvXQK.cjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-Bt21jw68.mjs → BitbucketSourceControlProvider-pUKsNXcg.mjs} +2 -2
  7. package/dist/{ClaudeDriver-C4yu7Jit.mjs → ClaudeDriver-CGifBixr.mjs} +2 -2
  8. package/dist/{ClaudeDriver-B7mbf51W.cjs → ClaudeDriver-Dry5uJfX.cjs} +2 -2
  9. package/dist/{CodexDriver-CR0S17Lb.cjs → CodexDriver-BzR8gA8w.cjs} +3 -3
  10. package/dist/{CodexDriver-DnnqkGoY.mjs → CodexDriver-V4CL9APE.mjs} +3 -3
  11. package/dist/{CodexTextGeneration-tlfe1S5W.cjs → CodexTextGeneration-DTrSzY-I.cjs} +1 -1
  12. package/dist/{CodexTextGeneration-Cw-FZbSS.mjs → CodexTextGeneration-DoCidwvI.mjs} +1 -1
  13. package/dist/{CopilotDriver-GxKLX5pL.mjs → CopilotDriver-Dt13X60f.mjs} +3 -3
  14. package/dist/{CopilotDriver-IBd27Ji2.cjs → CopilotDriver-rLcA8PSN.cjs} +3 -3
  15. package/dist/{CursorDriver-C4Enoe9N.cjs → CursorDriver-C3s-8s9F.cjs} +3 -3
  16. package/dist/{CursorDriver-CNo9Uzo8.mjs → CursorDriver-HIPUs7cz.mjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-BGXysSX6.mjs → ForgejoSourceControlProvider-CmvOAzEG.mjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-Dh6DOoc8.cjs → ForgejoSourceControlProvider-JgiyrMqp.cjs} +2 -2
  19. package/dist/{GitHubSourceControlProvider-CPCYV8Xo.mjs → GitHubSourceControlProvider-BYuvbcBf.mjs} +2 -2
  20. package/dist/{GitHubSourceControlProvider-8hsv_kCE.cjs → GitHubSourceControlProvider-CItCpOcC.cjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-B0ZbF9Zx.cjs → GitLabSourceControlProvider-CMce22nU.cjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-Bvknpaon.mjs → GitLabSourceControlProvider-DZzEaVSi.mjs} +2 -2
  23. package/dist/{GrokDriver-DSPEmiwq.mjs → GrokDriver-CduUwiOH.mjs} +3 -3
  24. package/dist/{GrokDriver-RyyFeh_q.cjs → GrokDriver-D0jraOC_.cjs} +3 -3
  25. package/dist/{OpenCodeDriver-0q44rSQX.mjs → OpenCodeDriver-Bz_uJdMA.mjs} +2 -2
  26. package/dist/{OpenCodeDriver-CDcvPT9v.cjs → OpenCodeDriver-DxGpgtDS.cjs} +2 -2
  27. package/dist/{SourceControlProviderDiscoveryCatalog-DreaAH1H.cjs → SourceControlProviderDiscoveryCatalog-Dm_lhrhv.cjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-B37RHe2u.mjs → SourceControlProviderDiscoveryCatalog-ZtwPWoxE.mjs} +1 -1
  29. package/dist/bin.cjs +291 -176
  30. package/dist/bin.mjs +291 -176
  31. package/dist/client/assets/AccountSettings-Bv57-JYy.js +1 -0
  32. package/dist/client/assets/{AiFocusSettings-CNmGHEcA.js → AiFocusSettings-DCPHmJpA.js} +1 -1
  33. package/dist/client/assets/{AnimatedHeight-i0YhvlGD.js → AnimatedHeight-DPqb09B0.js} +1 -1
  34. package/dist/client/assets/{AppearanceSettings-BG8W4DP0.js → AppearanceSettings-EmTrtb_U.js} +1 -1
  35. package/dist/client/assets/{BranchToolbar.logic-AgPy06Mx.js → BranchToolbar.logic-CHRK3hDt.js} +1 -1
  36. package/dist/client/assets/{BrowserPanel-BWztlNuL.js → BrowserPanel-2Xu08il5.js} +1 -1
  37. package/dist/client/assets/ChatRightPanel-C1VD6GCV.js +194 -0
  38. package/dist/client/assets/{ChatThreadRouteView-CWoBLzR_.js → ChatThreadRouteView-CNww3i2J.js} +1 -1
  39. package/dist/client/assets/CommandPaletteDialog-B_f3fKp7.js +1 -0
  40. package/dist/client/assets/{CompositeRoot-C1G-Ejus.js → CompositeRoot-B40iitmH.js} +1 -1
  41. package/dist/client/assets/ComputerUseSettings-BJs7jqR0.js +1 -0
  42. package/dist/client/assets/ConnectionsSettings-B9nfvgLG.js +7 -0
  43. package/dist/client/assets/ContextHandoffEndpointLabel-BSQOArMR.js +4 -0
  44. package/dist/client/assets/{DiagnosticsSettings-DvnNz2AZ.js → DiagnosticsSettings-BmrqOKMe.js} +1 -1
  45. package/dist/client/assets/{DialogHandle-8o3kfoiI.js → DialogHandle-pelzaaiH.js} +1 -1
  46. package/dist/client/assets/{DialogPopup-CLw6NCkW.js → DialogPopup-BLM0vN4N.js} +1 -1
  47. package/dist/client/assets/DialogRoot-CY6ZzEUS.js +1 -0
  48. package/dist/client/assets/{DialogTitle-DCHX74Tz.js → DialogTitle-BvIjMtMm.js} +1 -1
  49. package/dist/client/assets/{DialogTrigger-Bl_fcIV2.js → DialogTrigger-CIeVAA-a.js} +1 -1
  50. package/dist/client/assets/{DialogViewport-DVDl03yd.js → DialogViewport-Cz0OadGI.js} +1 -1
  51. package/dist/client/assets/{DraftChatThreadRouteView-CEDYjbKq.js → DraftChatThreadRouteView-DMIGMESb.js} +1 -1
  52. package/dist/client/assets/{ExternalIdentityWeb.logic-arHvT6AX.js → ExternalIdentityWeb.logic-3rlDV7lT.js} +1 -1
  53. package/dist/client/assets/{GlassSurface-GY6owikG.js → GlassSurface-CEVIdyfP.js} +1 -1
  54. package/dist/client/assets/{HostedConnectionControls-COUhSe9x.js → HostedConnectionControls-r9cyZPyF.js} +1 -1
  55. package/dist/client/assets/HostedHubRoot-BkfafJ5x.js +2 -0
  56. package/dist/client/assets/{HostedNativeAuthorizationRoute-DZhYxv--.js → HostedNativeAuthorizationRoute-CqHuW853.js} +2 -2
  57. package/dist/client/assets/HostedNodeRenameDialog-C7m-nvTj.js +1 -0
  58. package/dist/client/assets/{HostedRelayTrustNotice-Bl6On0Yi.js → HostedRelayTrustNotice-DNZQyAX0.js} +1 -1
  59. package/dist/client/assets/IntegrationsSettingsPanel-hul3ysgL.js +2 -0
  60. package/dist/client/assets/{KeybindingsSettings-CPtXx-W2.js → KeybindingsSettings-Cme6omBM.js} +1 -1
  61. package/dist/client/assets/{LazyBrowserPanel-SUIBB7B4.js → LazyBrowserPanel-COJFwNK7.js} +2 -2
  62. package/dist/client/assets/{McpServersSettings-BWIUud0Z.js → McpServersSettings-CPeNF8_u.js} +4 -4
  63. package/dist/client/assets/{MobileSheet-NTayGHF6.js → MobileSheet-BZo-RAfm.js} +1 -1
  64. package/dist/client/assets/{NodeSecuritySettings-BFifrshE.js → NodeSecuritySettings-CwT5nEW9.js} +1 -1
  65. package/dist/client/assets/{OpinionatedPluginsSettings-D7WuuNWZ.js → OpinionatedPluginsSettings-D8A1CbMG.js} +1 -1
  66. package/dist/client/assets/{PhoneGetAppInterstitial-R0cqI17q.js → PhoneGetAppInterstitial-BBnGXVkR.js} +1 -1
  67. package/dist/client/assets/PhoneHome-BTKOPVjw.js +1 -0
  68. package/dist/client/assets/PhoneSettingsSurface-DdVCndyt.js +2 -0
  69. package/dist/client/assets/{ProviderModelPicker-dwWhl7Uf.js → ProviderModelPicker-DoYEUZrn.js} +1 -1
  70. package/dist/client/assets/ProvidersSettingsPanel-ldDCPVIY.js +1 -0
  71. package/dist/client/assets/{QuitShortcutFeedback-CklL3jMd.js → QuitShortcutFeedback-mF7X0WMD.js} +1 -1
  72. package/dist/client/assets/{RedactedSensitiveText-CLPBtvH1.js → RedactedSensitiveText-DovqFcmM.js} +1 -1
  73. package/dist/client/assets/RootAppShell-CzmEWO9w.js +7 -0
  74. package/dist/client/assets/{Separator-CpYBhf-I.js → Separator-BhAVTIOc.js} +1 -1
  75. package/dist/client/assets/SettingsDialog-ByXgBN0U.js +2 -0
  76. package/dist/client/assets/SettingsPanels-Bgf4vkrJ.js +3 -0
  77. package/dist/client/assets/{SettingsPanels.editor-9pSZP875.js → SettingsPanels.editor-d-rVlbeN.js} +1 -1
  78. package/dist/client/assets/SourceControlSettings-dKw0FaN1.js +1 -0
  79. package/dist/client/assets/{StatisticsPage-C7v-6CTr.js → StatisticsPage-C2RuqDIK.js} +1 -1
  80. package/dist/client/assets/{StatisticsPanel-CeIjiBm8.js → StatisticsPanel-DqoXnrhQ.js} +1 -1
  81. package/dist/client/assets/{StatisticsSettingsLink-5s_violW.js → StatisticsSettingsLink-C_f31sb4.js} +1 -1
  82. package/dist/client/assets/{ThreadTerminalDrawer-CHZ60lPI.js → ThreadTerminalDrawer-DaLrSTn9.js} +11 -11
  83. package/dist/client/assets/{ThreadWorkspacePanel-Ct5kMcuY.js → ThreadWorkspacePanel-BvRZIxZQ.js} +17 -17
  84. package/dist/client/assets/{activity-BMBx2Fu0.js → activity-bn_fBQGf.js} +1 -1
  85. package/dist/client/assets/{alert-CXnC_RJc.js → alert-BmLJh6DH.js} +1 -1
  86. package/dist/client/assets/{appChrome-BzM66lXM.js → appChrome-Dy57Ve9N.js} +1 -1
  87. package/dist/client/assets/{arrow-left-CymyVbCi.js → arrow-left-pzj1cbX3.js} +1 -1
  88. package/dist/client/assets/{arrow-right-9wyq4YVq.js → arrow-right-BW5jU-vo.js} +1 -1
  89. package/dist/client/assets/{arrow-up-right-mfU38K6p.js → arrow-up-right-AfC5AaSO.js} +1 -1
  90. package/dist/client/assets/authorization-7xVVtCBu.js +1 -0
  91. package/dist/client/assets/{badge-Dg7mXiOh.js → badge-DnBuGHGL.js} +1 -1
  92. package/dist/client/assets/{bot-BR3RyOWP.js → bot-CsKkSRlb.js} +1 -1
  93. package/dist/client/assets/{capabilities-C8sxDbKT.js → capabilities-DskyVNd2.js} +1 -1
  94. package/dist/client/assets/{chart-column-CcRi3pAd.js → chart-column-DhvWXIiH.js} +1 -1
  95. package/dist/client/assets/chevron-right-CITtTwME.js +1 -0
  96. package/dist/client/assets/{clipboard-copy-ezz8rnaT.js → clipboard-copy-fJnfdl4H.js} +1 -1
  97. package/dist/client/assets/{data-list-ZLhzdlED.js → data-list-_E-Al1sf.js} +1 -1
  98. package/dist/client/assets/{desktopWorkspace-P28r2lN2.js → desktopWorkspace-DycXKuMm.js} +1 -1
  99. package/dist/client/assets/{download-BA9L9tK9.js → download-CLQzE1di.js} +1 -1
  100. package/dist/client/assets/{editorPreferences-DeKdSV3s.js → editorPreferences-Bg624RVT.js} +1 -1
  101. package/dist/client/assets/{empty-3NpXLnAM.js → empty-YXFtCUDN.js} +1 -1
  102. package/dist/client/assets/{group-D5qBdsaB.js → group-DOCkUmuY.js} +1 -1
  103. package/dist/client/assets/{hostedConnectionCoordinator-CLV-JD1S.js → hostedConnectionCoordinator-JZ1dLx4v.js} +1 -1
  104. package/dist/client/assets/{hubRoutes-EWJ3Gdod.js → hubRoutes-C2S5of9_.js} +1 -1
  105. package/dist/client/assets/{index-DxCd1PgA.js → index-CvRFRkBK.js} +2 -2
  106. package/dist/client/assets/{input-DrOL1KPS.js → input-C2xv8mMt.js} +1 -1
  107. package/dist/client/assets/{kbd-rWDjJnWX.js → kbd-4-4mGdIa.js} +1 -1
  108. package/dist/client/assets/{key-round-D2DtQ7aS.js → key-round-CYcb9lAa.js} +1 -1
  109. package/dist/client/assets/{layers-DtSJWmwy.js → layers-CGlOWYxu.js} +1 -1
  110. package/dist/client/assets/{log-out-YAp9fsOg.js → log-out-CZW2EpNJ.js} +1 -1
  111. package/dist/client/assets/{logging-BuUPX1SP.js → logging-BpmZOfmu.js} +1 -1
  112. package/dist/client/assets/main-CC-U8LrA.css +2 -0
  113. package/dist/client/assets/main-CzDOnLFw.js +9 -0
  114. package/dist/client/assets/{palette-D18VboLH.js → palette-CQOuNfSO.js} +1 -1
  115. package/dist/client/assets/{play-d3KUi4G6.js → play-CPVy9wwV.js} +1 -1
  116. package/dist/client/assets/primary-CjhRI8fe.js +2 -0
  117. package/dist/client/assets/providerDriverMeta-BVHpFupf.js +1 -0
  118. package/dist/client/assets/providerModels-BsybzP4P.js +1 -0
  119. package/dist/client/assets/{qr-code-Bk1kdf_k.js → qr-code-BPqDlVMn.js} +1 -1
  120. package/dist/client/assets/{qr-code-MAZkoKtL.js → qr-code-C6BVTc4V.js} +1 -1
  121. package/dist/client/assets/{radio-group-D-VCGinX.js → radio-group-C8qudOQH.js} +2 -2
  122. package/dist/client/assets/{refresh-cw-DY3_Ph-S.js → refresh-cw-B5Cz1z3e.js} +1 -1
  123. package/dist/client/assets/runtime-Bxg7k81u.js +17 -0
  124. package/dist/client/assets/{save-ugJXuJRM.js → save-C7zM6ey6.js} +1 -1
  125. package/dist/client/assets/{scroll-area-BMnGzd2a.js → scroll-area-5OU_pvTW.js} +1 -1
  126. package/dist/client/assets/{scrollEdges-QLSFwGSQ.js → scrollEdges-qnEXfIOg.js} +1 -1
  127. package/dist/client/assets/{separator-BwUYkCkX.js → separator-B5HfRiaO.js} +1 -1
  128. package/dist/client/assets/{settingsLayout-C6SUmJVB.js → settingsLayout-CfKq88KD.js} +1 -1
  129. package/dist/client/assets/{sheet-DLy4aeVa.js → sheet-B9gQDy_I.js} +1 -1
  130. package/dist/client/assets/{shield-alert-DfUhTI4-.js → shield-alert-7yBlEyOs.js} +1 -1
  131. package/dist/client/assets/{shield-check-CO4SMhAs.js → shield-check-CnKgVJ0F.js} +1 -1
  132. package/dist/client/assets/{shield-Zq_ygsnJ.js → shield-rdjnBE2Q.js} +1 -1
  133. package/dist/client/assets/{sidebar-DNnW-a2V.js → sidebar-BdvL1Pbj.js} +1 -1
  134. package/dist/client/assets/sidebarProjectFolders-BH8XBqNe.js +4 -0
  135. package/dist/client/assets/{sidebarStatusText-CawrXnx0.js → sidebarStatusText-CZKsUFBD.js} +1 -1
  136. package/dist/client/assets/{skeleton-DRm4_OvB.js → skeleton-CoyLqyaB.js} +1 -1
  137. package/dist/client/assets/{smartphone-O2VACDhU.js → smartphone-CBgpMHXR.js} +1 -1
  138. package/dist/client/assets/{sparkles-isHutYWU.js → sparkles-w-UZXQx1.js} +1 -1
  139. package/dist/client/assets/src-Bi-5Nw9C.js +14 -0
  140. package/dist/client/assets/{star-7UHEnC3x.js → star-BZ-RtSFD.js} +1 -1
  141. package/dist/client/assets/switch-CEJEmLe7.js +48 -0
  142. package/dist/client/assets/{toggle-CaKBNe6W.js → toggle-DVGrNHjq.js} +1 -1
  143. package/dist/client/assets/{toggle-group-UeFeTI3u.js → toggle-group-CNDOfNhH.js} +1 -1
  144. package/dist/client/assets/{tokenModePresentation-DV56ekA4.js → tokenModePresentation-CQNdC9CW.js} +1 -1
  145. package/dist/client/assets/{tooltip-DXvXxL37.js → tooltip-B7Z4qomY.js} +1 -1
  146. package/dist/client/assets/{unplug-DisTpujT.js → unplug-CRUwFNFw.js} +1 -1
  147. package/dist/client/assets/useAppSidebarCollapsed-wq6czkNJ.js +1 -0
  148. package/dist/client/assets/useBaseUiId-OYaGjnkh.js +1 -0
  149. package/dist/client/assets/{useLabelableId-BsDFG9Oj.js → useLabelableId-VMc-yITe.js} +1 -1
  150. package/dist/client/assets/{useNavigate-cLfxn_9L.js → useNavigate-DVi0rBlf.js} +1 -1
  151. package/dist/client/assets/{usePhoneThreadActions-rekHL1Mi.js → usePhoneThreadActions-CwwHikjB.js} +1 -1
  152. package/dist/client/assets/{usePopupViewport-kXU31P6l.js → usePopupViewport-BcSIK_ph.js} +1 -1
  153. package/dist/client/assets/{useScrollLock-DjMxrUJe.js → useScrollLock-BQf9VYJT.js} +1 -1
  154. package/dist/client/assets/{useStatistics-BYP-9CmW.js → useStatistics-DczKdEfy.js} +1 -1
  155. package/dist/client/assets/{useTriggerFocusGuards-DuAm2B8C.js → useTriggerFocusGuards-DjP-D0_a.js} +1 -1
  156. package/dist/client/assets/{useValueChanged-DreFjrMK.js → useValueChanged-CRwCkFdy.js} +1 -1
  157. package/dist/client/assets/{user-round-DctamWV6.js → user-round-DStbWN3z.js} +1 -1
  158. package/dist/client/assets/{vscode-icons-Dw-LGJAv.js → vscode-icons-BihBo3tb.js} +1 -1
  159. package/dist/client/assets/{workspaceMetadataProjection-BL4sEIL2.js → workspaceMetadataProjection-j3BGlVOB.js} +1 -1
  160. package/dist/client/assets/{wrench-Ds8eZerZ.js → wrench-BBIgGxy9.js} +1 -1
  161. package/dist/client/index.html +1 -1
  162. package/dist/{collectUint8StreamText-C_VNyArd.mjs → collectUint8StreamText-CE1Re5Ij.mjs} +41 -3
  163. package/dist/{collectUint8StreamText-DStwNTTK.cjs → collectUint8StreamText-whblCEfg.cjs} +52 -2
  164. package/dist/{makeManagedServerProvider-GZcpSLrW.mjs → makeManagedServerProvider-CwYhl_P-.mjs} +1 -1
  165. package/dist/{makeManagedServerProvider-VzxWN-04.cjs → makeManagedServerProvider-Dy2Ny9tk.cjs} +1 -1
  166. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  167. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  168. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  169. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  170. package/package.json +1 -1
  171. package/dist/client/assets/AccountSettings-ApnDA1f-.js +0 -1
  172. package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +0 -194
  173. package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +0 -1
  174. package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +0 -1
  175. package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +0 -7
  176. package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +0 -4
  177. package/dist/client/assets/DialogRoot-SKkIuQHA.js +0 -1
  178. package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +0 -2
  179. package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +0 -2
  180. package/dist/client/assets/PhoneHome-FqWvnJP_.js +0 -1
  181. package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +0 -2
  182. package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +0 -1
  183. package/dist/client/assets/RootAppShell-BdQCs2XJ.js +0 -7
  184. package/dist/client/assets/SettingsDialog-DeMzEeCP.js +0 -2
  185. package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +0 -3
  186. package/dist/client/assets/SourceControlSettings-C1F3Brcn.js +0 -1
  187. package/dist/client/assets/authorization-CjOFkg7b.js +0 -1
  188. package/dist/client/assets/chevron-right-CuUjBsQV.js +0 -1
  189. package/dist/client/assets/main-BbtLAX7M.js +0 -9
  190. package/dist/client/assets/main-D4CtFNPY.css +0 -2
  191. package/dist/client/assets/monitor-OyD484tI.js +0 -1
  192. package/dist/client/assets/primary-D_D7eLwT.js +0 -2
  193. package/dist/client/assets/providerDriverMeta-DNTocCcU.js +0 -1
  194. package/dist/client/assets/providerModels-bFbEIfL9.js +0 -1
  195. package/dist/client/assets/runtime-Djy96GJd.js +0 -17
  196. package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +0 -4
  197. package/dist/client/assets/src-BSuAGqhK.js +0 -14
  198. package/dist/client/assets/switch-DD1qVLgN.js +0 -48
  199. package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +0 -1
  200. package/dist/client/assets/useBaseUiId-CJN4MvrU.js +0 -1
@@ -1,2 +1,2 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{G as n,K as r}from"./primary-D_D7eLwT.js";import{t as i}from"./src-BSuAGqhK.js";import{$n as a,K as o,Na as s,Nr as c,P as l,Pn as u,Rr as d,Vr as f,_l as p,ar as m,gl as h,hl as g,il as _,ir as v,ll as y,or as b,p as x,ul as S,vr as C,wa as w,xr as T,yr as E,zr as D}from"./runtime-Djy96GJd.js";import{t as O}from"./compiler-runtime-qmuS0Svy.js";import{a as k,c as A,n as j,o as M,s as N,t as P}from"./badge-Dg7mXiOh.js";import{s as F}from"./hostedConnectionCoordinator-CLV-JD1S.js";import{t as ee}from"./clipboard-copy-ezz8rnaT.js";import{n as I,t as L}from"./play-d3KUi4G6.js";import{t as te}from"./refresh-cw-DY3_Ph-S.js";import{r as ne}from"./editorPreferences-DeKdSV3s.js";import{t as R}from"./toastHelpers-CSQRKo4F.js";import{t as z}from"./authorization-CjOFkg7b.js";import"./usePresentationTier-B_SCFvN7.js";import{i as B,r as re,t as V}from"./alert-CXnC_RJc.js";import{i as H,n as U,r as W}from"./settingsLayout-C6SUmJVB.js";var G={name:`clipboard-check`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]};G.node;var ie=s(G),K=e(t(),1),q=O();function ae(e){return!e.connected||e.role===`client`?!1:e.primary||e.role===`owner`}function oe(e){let t=(0,q.c)(16),n=h(),i=l(se),a=F(),o;t[0]===n?o=t[1]:(o=e=>n?e.byId[n.environmentId]:void 0,t[0]=n,t[1]=o);let s=m(o),c,u;if(t[2]!==e||t[3]!==i.browserStatus||t[4]!==i.directoryStatus||t[5]!==i.effectiveRole||t[6]!==i.sessionStatus||t[7]!==i.transportStatus||t[8]!==n||t[9]!==a.machines){let o;t[12]===n?.environmentId?o=t[13]:(o=e=>e.environmentId===n?.environmentId,t[12]=n?.environmentId,t[13]=o);let s=a.machines.find(o);c=r(),u=z({hosted:c,role:s?s.effectiveRole:n&&!n.primary?null:i.effectiveRole,fresh:i.directoryStatus===`ready`&&(s?s.connectionState===`connected`&&s.canMutate&&s.cacheDisposition===`available`&&s.presence.online:i.transportStatus===`online`),browserCurrent:i.browserStatus===`current`,sessionReady:i.sessionStatus===`ready`,method:e}),t[2]=e,t[3]=i.browserStatus,t[4]=i.directoryStatus,t[5]=i.effectiveRole,t[6]=i.sessionStatus,t[7]=i.transportStatus,t[8]=n,t[9]=a.machines,t[10]=c,t[11]=u}else c=t[10],u=t[11];let d=u;if(!c&&n&&!ae({primary:n.primary,connected:n.connected&&(!s||s.connectionState===`connected`),role:s?.role})){let e;return t[14]===c?e=t[15]:(e={hosted:c,allowed:!1,reason:`Diagnostics require a connected owner session.`},t[14]=c,t[15]=e),e}return d}function se(e){return e}function ce(e){let t=!1,n=!1;return{async refresh(){if(!(t||n)){n=!0,e.onLoading(!0);try{let n=await e.fetch();t||e.onSuccess(n)}catch(n){t||e.onError(n)}finally{n=!1,t||e.onLoading(!1)}}},dispose(){t=!0}}}function le(e,t){let n=new Map(e.map(e=>[e.identity.pid,e]));return e.filter(e=>{let r=new Set([e.identity.pid]),i=n.get(e.ppid);for(;i&&!r.has(i.identity.pid);){if(t.has(`${i.identity.pid}:${i.identity.startTimeMs}`))return!1;r.add(i.identity.pid),i=n.get(i.ppid)}return!0})}function ue(e){return e===`failure`||e===`error`}function J(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function Y(e){return!Number.isFinite(e)||e<=0?`0 ms`:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(+(e<1e4))} s`:`${(e/6e4).toFixed(1)} min`}function X(e){return e===void 0||!Number.isFinite(e)?`n/a`:`${Math.max(0,e).toFixed(1)}%`}function Z(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return e;let r=Math.max(0,t-n);return r<1e3?`just now`:r<6e4?`${Math.floor(r/1e3)}s ago`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function de(e){return e.map(e=>({label:e.sampledAt,value:e.memory.rssBytes}))}function fe(e){return e.map(e=>({label:e.sampledAt,value:e.cpu.utilizationPercent??0}))}function pe(e){return e.map(e=>({label:e.label,value:e.count}))}function me(e){return e.slice(0,8).map(e=>({label:e.name,value:e.count}))}function he(e){let t=e.failures.latest[0];return t?t.message:`No failures`}var Q=p(),ge=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function _e({telemetry:e,paused:t,refresh:n}){let r=h()?.environmentId,[o,s]=(0,K.useState)(0),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(!1),[m,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!0),[y,x]=(0,K.useState)(new Set),S=(0,K.useRef)(null),C=(0,K.useRef)(t);C.current=t;let w=oe(i.serverRetryResourceTelemetry),T=oe(i.serverGetResourceTelemetryHistory),E=ge[o]??ge[0],O=(0,K.useRef)(0);(0,K.useEffect)(()=>(O.current+=1,g(!1),()=>{O.current+=1}),[r]),(0,K.useEffect)(()=>{if(l(null),d(null),!T.allowed){p(!1);return}let e=ce({fetch:async()=>{let e=r?a(r)?.server:b().server;if(!e?.getResourceTelemetryHistory)throw Error(`Resource history is unavailable on this server.`);return e.getResourceTelemetryHistory({windowMs:E.windowMs,bucketMs:E.bucketMs})},onSuccess:e=>{l(e),d(null)},onError:e=>d(e instanceof Error?e.message:`Resource history could not be refreshed.`),onLoading:p});S.current=e.refresh;let t=()=>{!C.current&&document.visibilityState===`visible`&&e.refresh()};t();let n=window.setInterval(t,5e3);return document.addEventListener(`visibilitychange`,t),()=>{e.dispose(),S.current=null,window.clearInterval(n),document.removeEventListener(`visibilitychange`,t)}},[r,E,T.allowed,T.reason]);async function k(){if(m||!w.allowed)return;let e=O.current;g(!0);try{let t=r?a(r)?.server:b().server;if(!t?.retryResourceTelemetry)throw Error(`Resource monitor retry is unavailable on this server.`);if(await t.retryResourceTelemetry(),e!==O.current)return;await n(),await S.current?.()}catch(t){e===O.current&&d(t instanceof Error?t.message:`Could not retry resource monitor.`)}finally{e===O.current&&g(!1)}}let A=e?.health,j=le(e?.processes??[],y).filter(e=>_||e.cpuPercent>0||e.ioReadBytesPerSecond>0||e.ioWriteBytesPerSecond>0||e.category===`server`),M=c?.buckets??[],N=Math.max(1,...M.map(e=>e.maxCpuPercent)),P=Math.max(1,...M.map(e=>Math.max(e.ioReadBytes,e.ioWriteBytes))),F=Math.max(1,...M.map(e=>e.maxRssBytes));return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(H,{title:`Resource monitor`,headerAction:(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:m||!w.allowed,onClick:()=>void k(),children:m?`Retrying…`:`Retry monitor`}),children:[(0,Q.jsxs)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:[e?`Sampled ${Z(e.readAt)} · interval ${Y(e.sampleIntervalMs)}`:`Waiting for resource telemetry.`,` `,`CPU may exceed 100% across cores. I/O availability depends on the platform.`]}),(0,Q.jsx)(`dl`,{className:`grid grid-cols-2 divide-x divide-y border-t lg:grid-cols-3`,children:[[`Current CPU`,e?X(e.groups.allRyco.currentCpuPercent):`Loading…`],[`Resident memory`,e?J(e.groups.allRyco.currentRssBytes):`Loading…`],[`Process count`,e?String(e.groups.allRyco.processCount):`Loading…`],[`Read throughput`,e?`${J(e.groups.allRyco.ioReadBytesPerSecond)}/s`:`Loading…`],[`Write throughput`,e?`${J(e.groups.allRyco.ioWriteBytesPerSecond)}/s`:`Loading…`],[`CPU speed limit`,e?.speedLimitPercent==null?`Unknown`:`${e.speedLimitPercent}%`]].map(([e,t])=>(0,Q.jsxs)(`div`,{className:`px-4 py-4`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`mt-2 text-2xl font-semibold tabular-nums`,children:t})]},e))}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[850px] text-left text-xs [&_td]:px-4 [&_td]:py-3`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Group`,`Processes`,`CPU / time`,`RSS / peak`,`Read / write rate`,`Read / write total`,`Starts / exits`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:e?Object.entries(e.groups).map(([e,t])=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{children:{allRyco:`All Ryco`,backend:`Backend + agents`,electron:`Desktop`,monitor:`Monitor overhead`}[e]??e}),(0,Q.jsx)(`td`,{children:t.processCount}),(0,Q.jsxs)(`td`,{children:[X(t.currentCpuPercent),(0,Q.jsx)(`div`,{children:Y(t.cpuTimeMs)})]}),(0,Q.jsxs)(`td`,{children:[J(t.currentRssBytes),(0,Q.jsx)(`div`,{children:J(t.peakRssBytes)})]}),(0,Q.jsxs)(`td`,{children:[J(t.ioReadBytesPerSecond),`/s`,(0,Q.jsxs)(`div`,{children:[J(t.ioWriteBytesPerSecond),`/s`]})]}),(0,Q.jsxs)(`td`,{children:[J(t.ioReadBytes),(0,Q.jsx)(`div`,{children:J(t.ioWriteBytes)})]}),(0,Q.jsxs)(`td`,{children:[t.processStarts,` / `,t.processExits]})]},e)):null})]})})]}),(0,Q.jsxs)(H,{title:`Host & collection`,children:[A?(0,Q.jsxs)(`div`,{className:`grid gap-3 border-t px-4 py-3 text-xs sm:grid-cols-2`,children:[[`native`,`desktop`].map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`strong`,{className:`capitalize`,children:[e,`: `,A[e].status]}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:A[e].lastSampleAt?`Last sample ${Z(A[e].lastSampleAt)}`:`No sample`}),A[e].lastError?(0,Q.jsx)(`p`,{className:`mt-1 text-warning`,children:A[e].lastError}):null]},e)),(0,Q.jsxs)(`p`,{children:[`Monitor `,A.sidecarVersion??`version unavailable`,` · PID`,` `,A.sidecarPid??`unavailable`,` · `,A.restartCount,` restarts`]}),(0,Q.jsxs)(`p`,{children:[(A.collectionDurationMicros/1e3).toFixed(2),` ms collection ·`,` `,A.scannedProcessCount,` scanned · `,A.retainedProcessCount,` retained ·`,` `,A.inaccessibleProcessCount,` inaccessible`]})]}):null,(0,Q.jsxs)(`div`,{className:`border-t px-4 py-3 text-xs`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-medium`,children:`Power and background state`}),e?.power?(0,Q.jsx)(`dl`,{className:`mt-3 grid grid-cols-2 gap-3`,children:Object.entries(e.power).map(([e,t])=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:{idleState:`Idle state`,idleSeconds:`Idle seconds`,onBattery:`On battery`,thermalState:`Thermal state`,speedLimitPercent:`CPU speed limit (%)`,suspended:`Suspended`,lowPowerMode:`Low power mode`,locked:`Screen locked`,updatedAt:`Updated`,stale:`Stale`}[e]??e}),(0,Q.jsx)(`dd`,{children:t===null?`Unknown`:typeof t==`boolean`?t?`Yes`:`No`:String(t)})]},e))}):(0,Q.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`Desktop power state is unavailable on this connection.`}),(0,Q.jsxs)(`p`,{className:`mt-2`,children:[`CPU speed limit:`,` `,e?.speedLimitPercent==null?`Unknown`:`${e.speedLimitPercent}%`]})]})]}),(0,Q.jsxs)(H,{title:`Resource timeline`,headerAction:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`div`,{role:`group`,"aria-label":`Resource history period`,className:`flex gap-1`,children:ge.map((e,t)=>(0,Q.jsx)(D,{size:`xs`,variant:o===t?`secondary`:`outline`,"aria-pressed":o===t,onClick:()=>s(t),children:e.label},e.label))}),(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:f,onClick:()=>void S.current?.(),children:`Refresh`})]}),children:[u?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-3 text-xs text-destructive`,children:u}):null,(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:c?`${c.totalCpuTimeMs===void 0?`Unavailable`:Y(c.totalCpuTimeMs)} total CPU time · ${c.retainedSampleCount} retained samples · ${Y(c.sampleIntervalMs)} sampling interval · checked ${Z(c.readAt)}`:`Collecting resource history…`}),(0,Q.jsx)(`div`,{className:`grid gap-4 px-4 pb-4 sm:grid-cols-2`,children:[`cpu`,`memory`,`read`,`write`].map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs font-medium`,children:e===`cpu`?`CPU average / peak`:e===`memory`?`Peak RSS`:e===`read`?`I/O reads`:`I/O writes`}),(0,Q.jsx)(`svg`,{viewBox:`0 0 400 100`,role:`img`,"aria-label":e===`cpu`?`CPU history`:e===`memory`?`Memory history`:e===`read`?`I/O read history`:`I/O write history`,className:`h-24 w-full text-info`,children:M.map((t,n)=>{let r=e===`cpu`?t.maxCpuPercent/N:e===`memory`?t.maxRssBytes/F:(e===`read`?t.ioReadBytes:t.ioWriteBytes)/P,i=t.avgCpuPercent/N;return(0,Q.jsxs)(`g`,{children:[(0,Q.jsxs)(`title`,{children:[new Date(t.startedAt).toLocaleTimeString(),`: average`,` `,X(t.avgCpuPercent),`, peak`,` `,X(t.maxCpuPercent),`, RSS `,J(t.maxRssBytes),`, read `,J(t.ioReadBytes),`, write`,` `,J(t.ioWriteBytes),`, `,t.maxProcessCount,` processes`]}),(0,Q.jsx)(`rect`,{x:n*400/Math.max(1,M.length),y:100-r*100,width:Math.max(1,400/Math.max(1,M.length)-2),height:r*100,fill:`currentColor`,opacity:e===`cpu`?.3:1}),e===`cpu`?(0,Q.jsx)(`rect`,{x:n*400/Math.max(1,M.length),y:100-i*100,width:Math.max(1,400/Math.max(1,M.length)-2),height:i*100,fill:`currentColor`}):null]},t.startedAt)})}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Scale:`,` `,e===`cpu`?X(N):J(e===`memory`?F:P)]})]},e))}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[850px] text-left text-xs [&_td]:px-4 [&_td]:py-3`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Process`,`CPU avg / peak`,`CPU time`,`RSS / peak`,`I/O read / write`,`Samples / last seen`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:c?.topProcesses.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer`,children:[e.name,` (`,e.identity.pid,`)`]}),(0,Q.jsx)(`p`,{className:`max-w-72 break-all font-mono`,children:e.command})]}),(0,Q.jsx)(`div`,{className:`text-muted-foreground`,children:e.category})]}),(0,Q.jsxs)(`td`,{children:[X(e.avgCpuPercent),` / `,X(e.maxCpuPercent)]}),(0,Q.jsx)(`td`,{children:Y(e.cpuTimeMs)}),(0,Q.jsxs)(`td`,{children:[J(e.currentRssBytes),` / `,J(e.peakRssBytes)]}),(0,Q.jsx)(`td`,{children:e.ioSemantics===`unavailable`?`Unavailable`:`${J(e.ioReadBytes)} / ${J(e.ioWriteBytes)}`}),(0,Q.jsxs)(`td`,{children:[e.sampleCount,` · `,Z(e.lastSeenAt)]})]},`${e.identity.pid}:${e.identity.startTimeMs}`))})]})})]}),(0,Q.jsxs)(H,{title:`Live process tree`,headerAction:(0,Q.jsx)(D,{size:`xs`,variant:`outline`,"aria-pressed":_,onClick:()=>v(e=>!e),children:_?`Hide idle processes`:`Show idle processes`}),children:[(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[1000px] text-left text-xs [&_td]:px-4 [&_td]:py-3 [&_td]:align-top`,children:[(0,Q.jsx)(`thead`,{className:`border-b text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Process / category`,`PID / parent`,`CPU / time`,`RSS / peak / virtual`,`I/O rate / semantics`,`Wakeups / uptime`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:j.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{className:`max-w-80`,children:[(0,Q.jsxs)(`div`,{style:{paddingLeft:Math.min(e.depth,8)*10},children:[e.childPids.length>0?(0,Q.jsx)(D,{size:`xs`,variant:`ghost`,"aria-label":`${y.has(`${e.identity.pid}:${e.identity.startTimeMs}`)?`Expand`:`Collapse`} ${e.name} children`,"aria-expanded":!y.has(`${e.identity.pid}:${e.identity.startTimeMs}`),onClick:()=>x(t=>{let n=new Set(t),r=`${e.identity.pid}:${e.identity.startTimeMs}`;return n.has(r)?n.delete(r):n.add(r),n}),children:y.has(`${e.identity.pid}:${e.identity.startTimeMs}`)?`+`:`−`}):null,(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer break-all`,children:e.name}),(0,Q.jsx)(`p`,{className:`mt-2 break-all font-mono`,children:e.command}),(0,Q.jsxs)(`p`,{children:[`First seen `,Z(e.firstSeenAt),` · last seen`,` `,Z(e.lastSeenAt)]})]})]}),(0,Q.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.category,` `,e.electronType,` `,e.electronServiceName,` ·`,` `,e.status]})]}),(0,Q.jsxs)(`td`,{children:[e.identity.pid,` / `,e.ppid]}),(0,Q.jsxs)(`td`,{children:[X(e.cpuPercent),(0,Q.jsx)(`div`,{children:Y(e.cpuTimeMs)})]}),(0,Q.jsxs)(`td`,{children:[J(e.residentBytes),(0,Q.jsx)(`div`,{children:J(e.peakResidentBytes)}),(0,Q.jsx)(`div`,{children:J(e.virtualBytes)})]}),(0,Q.jsxs)(`td`,{children:[e.ioSemantics===`unavailable`?`Unavailable`:(0,Q.jsxs)(Q.Fragment,{children:[J(e.ioReadBytesPerSecond),`/s read`,(0,Q.jsxs)(`div`,{children:[J(e.ioWriteBytesPerSecond),`/s write`]}),(0,Q.jsxs)(`div`,{children:[J(e.ioReadBytes),` / `,J(e.ioWriteBytes),` `,`total`]})]}),(0,Q.jsx)(`div`,{className:`text-muted-foreground`,children:e.ioSemantics})]}),(0,Q.jsxs)(`td`,{children:[e.idleWakeupsPerSecond==null?`Unavailable`:`${e.idleWakeupsPerSecond.toFixed(1)}/s`,(0,Q.jsx)(`div`,{children:Y(e.runTimeMs)})]})]},`${e.identity.pid}:${e.identity.startTimeMs}`))})]})}),j.length===0?(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No active processes in this sample. Show idle processes to include retained idle entries.`}):null]}),(0,Q.jsxs)(H,{title:`Instrumented application I/O`,children:[(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`Application read/write counters describe logical work and are separate from operating-system storage bytes.`}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[650px] text-left text-xs [&_td]:px-4 [&_td]:py-3`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Component / operation`,`Read`,`Write`,`Count`,`Duration`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:e?.attribution.entries.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[e.component,` / `,e.operation]}),(0,Q.jsx)(`td`,{children:J(e.logicalReadBytes)}),(0,Q.jsx)(`td`,{children:J(e.logicalWriteBytes)}),(0,Q.jsx)(`td`,{children:e.count}),(0,Q.jsx)(`td`,{children:Y(e.durationMs)})]},`${e.component}:${e.operation}`))})]})}),e?.attribution.entries.length?null:(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No logical I/O attribution captured.`})]})]})}function ve({snapshot:e,refresh:t}){let n=h(),r=oe(i.serverSignalDiagnosticProcess),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),u=(0,K.useRef)({target:n,snapshot:e,allowed:!1}),d=(0,K.useRef)(!1),f=(0,K.useRef)(!0),p=r.allowed;u.current={target:n,snapshot:e,allowed:p},(0,K.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);async function m(e,n){if(d.current||!u.current.allowed)return;let r=u.current.target?.environmentId;d.current=!0,s(e.pid),l(null);try{if(!await b().dialogs.confirm(`${n===`SIGKILL`?`Force kill`:`Interrupt`} process ${e.pid} (${e.command})? ${n===`SIGKILL`?`Unsaved work may be lost.`:`This may stop an active agent or terminal task.`}`)||!f.current||!u.current.allowed||u.current.target?.environmentId!==r)return;if(!u.current.snapshot?.processTree?.processes.find(t=>t.pid===e.pid&&t.startTimeMs===e.startTimeMs)){l(`Process already exited or changed. Refresh diagnostics.`);return}let i=r?a(r)?.server:b().server;if(!i?.signalDiagnosticProcess)throw Error(`Process controls are unavailable on this server.`);let o=await i.signalDiagnosticProcess({pid:e.pid,startTimeMs:e.startTimeMs,signal:n});if(!f.current||u.current.target?.environmentId!==r)return;l(o.signaled?`${n} sent to process ${e.pid}.`:o.message??`Process already exited or is no longer a server child.`),await t()}catch(e){f.current&&u.current.target?.environmentId===r&&l(e instanceof Error?e.message:`Could not signal process.`)}finally{d.current=!1,f.current&&s(null)}}let g=e?.processTree;return(0,Q.jsxs)(H,{title:`Live descendant processes`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 px-4 py-4 text-xs lg:grid-cols-4`,children:[(0,Q.jsxs)(`div`,{children:[`Child processes`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:g?.processes.length??`Unavailable`})]}),(0,Q.jsxs)(`div`,{children:[`Child CPU`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:X(g?.totalCpuPercent)})]}),(0,Q.jsxs)(`div`,{children:[`Child RSS`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:g?J(g.totalRssBytes):`Unavailable`})]}),(0,Q.jsxs)(`div`,{children:[`Server PID`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:g?.serverPid??e?.liveProcesses.server.pid??`Unavailable`})]})]}),(0,Q.jsxs)(`p`,{className:`px-4 pb-3 text-xs text-muted-foreground`,children:[`Live children of the selected server. The server and desktop shell are excluded.`,` `,g?`Checked ${Z(g.readAt)}.`:`This server has not supplied process diagnostics.`]}),g?.error?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 pb-3 text-xs text-destructive`,children:g.error}):null,c?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 pb-3 text-xs`,children:c}):null,p?null:(0,Q.jsx)(`p`,{className:`px-4 pb-3 text-xs text-muted-foreground`,children:r.reason??`Process controls require a connected owner session.`}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[760px] text-left text-xs [&_td]:px-4 [&_td]:py-3 [&_td]:align-top`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Process`,`PID / Parent`,`CPU`,`RSS`,`Status / Age`,`Actions`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:g?.processes.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`max-w-96`,children:(0,Q.jsxs)(`details`,{style:{marginLeft:Math.min(e.depth,8)*10},children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer break-all`,children:e.command.split(/[\\/]/).at(-1)||`Process`}),(0,Q.jsx)(`div`,{className:`mt-2 break-all font-mono`,children:e.command}),(0,Q.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.childPids.length,` children · Started`,` `,new Date(e.startTimeMs).toLocaleString()]})]})}),(0,Q.jsxs)(`td`,{className:`font-mono`,children:[e.pid,` / `,e.ppid]}),(0,Q.jsx)(`td`,{children:X(e.cpuPercent)}),(0,Q.jsx)(`td`,{children:J(e.rssBytes)}),(0,Q.jsxs)(`td`,{children:[e.status,(0,Q.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:e.elapsed})]}),(0,Q.jsx)(`td`,{children:(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:!p||o!==null,onClick:()=>void m(e,`SIGINT`),children:`Interrupt`}),(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:!p||o!==null,onClick:()=>void m(e,`SIGKILL`),children:`Force kill`})]})})]},`${e.pid}:${e.startTimeMs}`))})]})}),g?.processes.length===0?(0,Q.jsx)(`p`,{className:`px-4 py-4 text-sm text-muted-foreground`,children:`No live descendant processes.`}):null]})}function ye(e){let t=(0,q.c)(11),{value:n}=e,{copyToClipboard:r,isCopied:i}=d(),a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`code`,{className:`break-all text-[11px]`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==r||t[3]!==n?(o=()=>r(n,void 0),t[2]=r,t[3]=n,t[4]=o):o=t[4];let s=i?`Copied`:`Copy`,c;t[5]!==o||t[6]!==s?(c=(0,Q.jsx)(D,{size:`xs`,variant:`ghost`,"aria-label":`Copy trace ID`,onClick:o,children:s}),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==a||t[9]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[a,c]}),t[8]=a,t[9]=c,t[10]=l):l=t[10],l}function be(e){let t=(0,q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=n.length>180?(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer break-words`,children:[n.slice(0,180),`…`]}),(0,Q.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words font-sans`,children:n})]}):(0,Q.jsx)(`span`,{className:`break-words`,children:n}),t[0]=n,t[1]=r),r}function xe(e){let t=(0,q.c)(10),{headers:n,children:r,empty:i}=e;if(i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-4 py-4 text-sm text-muted-foreground`,children:`No retained records.`}),t[0]=e):e=t[0],e}let a;t[1]===n?a=t[2]:(a=n.map(Se),t[1]=n,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Q.jsx)(`thead`,{className:`border-b text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:a})}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,Q.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[680px] text-left text-xs [&_td]:px-4 [&_td]:py-3 [&_td]:align-top`,children:[o,s]})}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Se(e){return(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e)}function Ce(e){let t=(0,q.c)(84),{snapshot:n,nowMs:r}=e,i=n?.tracing.summary,a;t[0]===n?.tracing.topSpanNames?a=t[1]:(a=n?.tracing.topSpanNames??[],t[0]=n?.tracing.topSpanNames,t[1]=a);let o=a,s;t[2]===n?.failures.common?s=t[3]:(s=n?.failures.common??[],t[2]=n?.failures.common,t[3]=s);let c=s,l;t[4]===i?.latestWarningAndErrorLogs?l=t[5]:(l=i?.latestWarningAndErrorLogs??[],t[4]=i?.latestWarningAndErrorLogs,t[5]=l);let u=l,d=n?.tracing.retainedSpanCount,f;t[6]===d?f=t[7]:(f=[`Retained spans`,d],t[6]=d,t[7]=f);let p=i?.failureCount,m;t[8]===p?m=t[9]:(m=[`Failures`,p],t[8]=p,t[9]=m);let h=i?.interruptionCount,g;t[10]===h?g=t[11]:(g=[`Interrupted spans`,h],t[10]=h,t[11]=g);let _=i?.slowSpanCount,v;t[12]===_?v=t[13]:(v=[`Slow spans`,_],t[12]=_,t[13]=v);let y=i?.parseErrorCount,b;t[14]===y?b=t[15]:(b=[`Parse errors`,y],t[14]=y,t[15]=b);let x;t[16]===i?x=t[17]:(x=i?Y(i.slowSpanThresholdMs):void 0,t[16]=i,t[17]=x);let S;t[18]===x?S=t[19]:(S=[`Slow threshold`,x],t[18]=x,t[19]=S);let C;t[20]!==r||t[21]!==i?(C=i?.firstSpanAt?Z(i.firstSpanAt,r):void 0,t[20]=r,t[21]=i,t[22]=C):C=t[22];let w;t[23]===C?w=t[24]:(w=[`First span`,C],t[23]=C,t[24]=w);let T;t[25]!==r||t[26]!==i?(T=i?.lastSpanAt?Z(i.lastSpanAt,r):void 0,t[25]=r,t[26]=i,t[27]=T):T=t[27];let E;t[28]===T?E=t[29]:(E=[`Last span`,T],t[28]=T,t[29]=E);let D;t[30]!==v||t[31]!==b||t[32]!==S||t[33]!==w||t[34]!==E||t[35]!==f||t[36]!==m||t[37]!==g?(D=(0,Q.jsx)(`dl`,{className:`grid grid-cols-2 gap-4 px-4 py-4 text-xs lg:grid-cols-4`,children:[f,m,g,v,b,S,w,E].map(De)}),t[30]=v,t[31]=b,t[32]=S,t[33]=w,t[34]=E,t[35]=f,t[36]=m,t[37]=g,t[38]=D):D=t[38];let O;t[39]===i?.partialFailure?O=t[40]:(O=i?.partialFailure?(0,Q.jsx)(`p`,{className:`px-4 pb-3 text-xs text-warning`,children:`Some trace files could not be read. These results are incomplete.`}):null,t[39]=i?.partialFailure,t[40]=O);let k;t[41]===i?k=t[42]:(k=i?(0,Q.jsxs)(`details`,{className:`border-t px-4 py-3 text-xs`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Collection details`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,Q.jsxs)(`p`,{children:[`Log levels:`,` `,Object.entries(i.logLevelCounts).map(Ee).join(` · `)||`None`]}),i.scannedFilePaths.map(Te)]})]}):null,t[41]=i,t[42]=k);let A;t[43]!==D||t[44]!==O||t[45]!==k?(A=(0,Q.jsxs)(H,{title:`Trace diagnostics`,children:[D,O,k]}),t[43]=D,t[44]=O,t[45]=k,t[46]=A):A=t[46];let j;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(j=[`Source / category`,`Count`,`Cause`,`Last seen`],t[47]=j):j=t[47];let M=c.length===0,N;if(t[48]!==c||t[49]!==r){let e;t[51]===r?e=t[52]:(e=e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[e.source,(0,Q.jsx)(`div`,{className:`text-muted-foreground`,children:e.category})]}),(0,Q.jsx)(`td`,{className:`font-mono`,children:e.count}),(0,Q.jsx)(`td`,{className:`max-w-96`,children:(0,Q.jsx)(be,{children:e.sampleMessage})}),(0,Q.jsx)(`td`,{className:`whitespace-nowrap`,children:Z(e.latestAt,r)})]},`${e.source}:${e.signature}`),t[51]=r,t[52]=e),N=c.map(e),t[48]=c,t[49]=r,t[50]=N}else N=t[50];let P;t[53]!==M||t[54]!==N?(P=(0,Q.jsx)(H,{title:`Most common failures`,children:(0,Q.jsx)(xe,{headers:j,empty:M,children:N})}),t[53]=M,t[54]=N,t[55]=P):P=t[55];let F;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=[`Time`,`Level`,`Span`,`Message`,`Trace`],t[56]=F):F=t[56];let ee=u.length===0,I;if(t[57]!==u||t[58]!==r){let e;t[60]===r?e=t[61]:(e=e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`whitespace-nowrap`,children:Z(e.seenAt,r)}),(0,Q.jsx)(`td`,{children:e.level}),(0,Q.jsx)(`td`,{children:e.spanName}),(0,Q.jsx)(`td`,{className:`max-w-96`,children:(0,Q.jsx)(be,{children:e.message})}),(0,Q.jsx)(`td`,{children:(0,Q.jsx)(ye,{value:e.traceId})})]},`${e.traceId}:${e.spanId}:${e.seenAt}:${e.level}:${e.message}`),t[60]=r,t[61]=e),I=u.map(e),t[57]=u,t[58]=r,t[59]=I}else I=t[59];let L;t[62]!==ee||t[63]!==I?(L=(0,Q.jsx)(H,{title:`Span warning and error logs`,children:(0,Q.jsx)(xe,{headers:F,empty:ee,children:I})}),t[62]=ee,t[63]=I,t[64]=L):L=t[64];let te;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(te=[`Span`,`Count`,`Failures`,`Average`,`Maximum`,`Total`],t[65]=te):te=t[65];let ne=o.length===0,R;t[66]===o?R=t[67]:(R=o.map(we),t[66]=o,t[67]=R);let z;t[68]!==ne||t[69]!==R?(z=(0,Q.jsx)(H,{title:`Top span names`,children:(0,Q.jsx)(xe,{headers:te,empty:ne,children:R})}),t[68]=ne,t[69]=R,t[70]=z):z=t[70];let B;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(B=[`Span`,`Status`,`Duration`,`Ended`,`Trace`],t[71]=B):B=t[71];let re=!n?.tracing.recentSpans.length,V;t[72]!==r||t[73]!==n?.tracing.recentSpans?(V=n?.tracing.recentSpans.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[e.name,e.failureMessage?(0,Q.jsx)(`div`,{className:`mt-1 text-destructive`,children:(0,Q.jsx)(be,{children:e.failureMessage})}):null]}),(0,Q.jsx)(`td`,{children:e.status}),(0,Q.jsx)(`td`,{children:Y(e.durationMs)}),(0,Q.jsx)(`td`,{className:`whitespace-nowrap`,children:Z(e.endTime,r)}),(0,Q.jsx)(`td`,{children:(0,Q.jsx)(ye,{value:e.traceId})})]},e.id)),t[72]=r,t[73]=n?.tracing.recentSpans,t[74]=V):V=t[74];let U;t[75]!==re||t[76]!==V?(U=(0,Q.jsx)(H,{title:`Recent spans`,children:(0,Q.jsx)(xe,{headers:B,empty:re,children:V})}),t[75]=re,t[76]=V,t[77]=U):U=t[77];let W;return t[78]!==A||t[79]!==P||t[80]!==L||t[81]!==z||t[82]!==U?(W=(0,Q.jsxs)(Q.Fragment,{children:[A,P,L,z,U]}),t[78]=A,t[79]=P,t[80]=L,t[81]=z,t[82]=U,t[83]=W):W=t[83],W}function we(e){return(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{children:e.name}),(0,Q.jsx)(`td`,{children:e.count}),(0,Q.jsx)(`td`,{children:e.failureCount}),(0,Q.jsx)(`td`,{children:Y(e.averageDurationMs)}),(0,Q.jsx)(`td`,{children:Y(e.maxDurationMs)}),(0,Q.jsx)(`td`,{children:Y(e.totalDurationMs)})]},e.name)}function Te(e){return(0,Q.jsx)(`p`,{className:`break-all font-mono`,children:e},e)}function Ee(e){let[t,n]=e;return`${t}: ${n}`}function De(e){let[t,n]=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:t}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono`,children:n??`Unavailable`})]},t)}var Oe=/token|secret|password|passwd|credential|authorization|bearer|api[-_]?key|cookie|session|private[-_]?key|pairing[-_]?code|access[-_]?key|signature|email|proof|ticket/iu;function ke(e){return e.replace(/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?(?:-----END [^-]*PRIVATE KEY-----|$)/gu,`[redacted]`).replace(/\bBearer\s+[^\s,;"']+/giu,`Bearer [redacted]`).replace(/\b(?:sk-[A-Za-z0-9_-]{8,}|gh[pousr]_[A-Za-z0-9_]{8,}|github_pat_[A-Za-z0-9_]+)\b/gu,`[redacted]`).replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/gu,`[redacted]`).replace(/\b((?:access[-_]?token|refresh[-_]?token|token|secret|password|passwd|credential|authorization|api[-_]?key|cookie|pairing[-_]?code|proof|ticket)\s*[=:]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/giu,`$1[redacted]`).replace(/https?:\/\/[^\s<>"']+/giu,e=>{try{let t=new URL(e);t.username=``,t.password=``,t.hash=``;for(let e of t.searchParams.keys())/token|secret|password|credential|authorization|key|cookie|proof|ticket|signature|code/iu.test(e)&&t.searchParams.set(e,`[redacted]`);return t.toString()}catch{return`[redacted URL]`}})}var Ae=`[redacted]`,je=Oe;function Me(e){let t;try{t=new URL(e)}catch{return e}(t.username||t.password)&&(t.username=``,t.password=``);for(let e of t.searchParams.keys())je.test(e)&&t.searchParams.set(e,Ae);return t.toString()}function Ne(e){return Pe(e,!1)}function Pe(e,t){if(t)return e==null?e:Ae;if(typeof e==`string`)return ke(Me(e));if(Array.isArray(e))return e.map(e=>Pe(e,!1));if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=Pe(r,je.test(n));return t}return e}function Fe(e){return Ne({generatedAt:e.generatedAt,app:e.app,environments:e.environments.map(e=>({environmentId:e.environmentId,label:e.record?.label??null,connectionState:e.runtime?.connectionState??null,authState:e.runtime?.authState??null,role:e.runtime?.role??null,lastError:e.runtime?.lastError??null,lastErrorAt:e.runtime?.lastErrorAt??null,connectedAt:e.runtime?.connectedAt??null,disconnectedAt:e.runtime?.disconnectedAt??null,pushSequence:e.pushSequence})),providers:e.providers.map(e=>({instanceId:e.instanceId,driver:e.driver,enabled:e.enabled,installed:e.installed,version:e.version,status:e.status,availability:e.availability??`available`,authStatus:e.auth.status,authType:e.auth.type??null,message:e.message??null,unavailableReason:e.unavailableReason??null,checkedAt:e.checkedAt})),observability:e.observability?{logsDirectoryConfigured:e.observability.logsDirectoryPath.length>0,localTracingEnabled:e.observability.localTracingEnabled,otlpTracesEnabled:e.observability.otlpTracesEnabled,otlpMetricsEnabled:e.observability.otlpMetricsEnabled,localMetrics:e.observability.localMetrics?{turnQuiescenceAvgMs:e.observability.localMetrics.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.observability.localMetrics.checkpointDurationP95Ms,wsReconnectCount:e.observability.localMetrics.wsReconnectCount,capturedAt:e.observability.localMetrics.capturedAt}:null}:null,performance:e.performance?{local:{turnQuiescenceAvgMs:e.performance.local.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.performance.local.checkpointDurationP95Ms,latestThreadSnapshotDurationMs:e.performance.local.latestThreadSnapshotDurationMs,threadSnapshotDurationP95Ms:e.performance.local.threadSnapshotDurationP95Ms,wsReconnectCount:e.performance.local.wsReconnectCount,windowSampleCounts:{...e.performance.local.windowSampleCounts},capturedAt:e.performance.local.capturedAt},queues:{...e.performance.queues},traceSink:e.performance.traceSink?{...e.performance.traceSink}:null,snapshotCollectionDurationMs:e.performance.snapshotCollectionDurationMs}:null})}function Ie(e){return JSON.stringify(e,null,2)}function Le(e){return(e?.gapCount??0)>0}var Re={connected:`bg-success`,connecting:`bg-warning`,error:`bg-destructive`,disconnected:`bg-muted-foreground/40`},ze={ready:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,disabled:`bg-muted-foreground/40`};function Be(e){let t=(0,q.c)(4),{className:n}=e,r;t[0]===n?r=t[1]:(r=f(`inline-block size-2 shrink-0 rounded-full`,n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`span`,{className:r,"aria-hidden":!0}),t[2]=r,t[3]=i),i}function Ve(e){if(!e)return`No push events observed yet.`;let t=[`last #${e.highestSequence??`—`}`,`${e.eventCount} events`,`${e.snapshotCount} snapshots`];return e.gapCount>0?t.push(`${e.gapCount} gap${e.gapCount===1?``:`s`}`):t.push(`no gaps`),t.join(` · `)}function He(e){let t=(0,q.c)(25),{environmentId:n,record:r,runtime:i,pushSequence:a}=e,o=i?.connectionState??`disconnected`,s=r?.label??n,c=Le(a),l=Re[o]??`bg-muted-foreground/40`,u;t[0]===l?u=t[1]:(u=(0,Q.jsx)(Be,{className:l}),t[0]=l,t[1]=u);let d;t[2]!==s||t[3]!==u?(d=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[u,s]}),t[2]=s,t[3]=u,t[4]=d):d=t[4];let p=i?.authState?` · auth ${i.authState}`:``,m=i?.role?` · ${i.role}`:``,h;t[5]!==o||t[6]!==p||t[7]!==m?(h=(0,Q.jsxs)(`span`,{className:`block`,children:[`WS `,o,p,m]}),t[5]=o,t[6]=p,t[7]=m,t[8]=h):h=t[8];let g=c?`text-warning`:`text-muted-foreground/70`,_;t[9]===g?_=t[10]:(_=f(`block`,g),t[9]=g,t[10]=_);let v;t[11]===a?v=t[12]:(v=Ve(a),t[11]=a,t[12]=v);let y;t[13]!==_||t[14]!==v?(y=(0,Q.jsx)(`span`,{className:_,children:v}),t[13]=_,t[14]=v,t[15]=y):y=t[15];let b;t[16]===i?b=t[17]:(b=i?.lastError?(0,Q.jsx)(`span`,{className:`block break-all text-destructive`,children:i.lastError}):null,t[16]=i,t[17]=b);let x;t[18]!==y||t[19]!==b||t[20]!==h?(x=(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[h,y,b]}),t[18]=y,t[19]=b,t[20]=h,t[21]=x):x=t[21];let S;return t[22]!==x||t[23]!==d?(S=(0,Q.jsx)(W,{title:d,description:x}),t[22]=x,t[23]=d,t[24]=S):S=t[24],S}function Ue(e){let t=(0,q.c)(59),{snapshot:r}=e,i=v(Xe),a=m(Ye),o=u(Je),s=h(),l=S(),f=y(),p=_(),g;t[0]!==l||t[1]!==s?(g=s?s.serverConfig?.providers??[]:l,t[0]=l,t[1]=s,t[2]=g):g=t[2];let w=g,T=r?.observability??(s?s.serverConfig?.observability??null:f),O;t[3]!==p||t[4]!==s?(O=s?s.serverConfig?.availableEditors??[]:p,t[3]=p,t[4]=s,t[5]=O):O=t[5];let k=O,A=r?.performance?.local??null,[j,M]=(0,K.useState)(!1),N;t[6]!==A||t[7]!==T?(N=T?{...T,...A?{localMetrics:A}:{}}:null,t[6]=A,t[7]=T,t[8]=N):N=t[8];let P=N,F;t[9]!==o||t[10]!==i||t[11]!==a?(F=[...new Set([...Object.keys(i),...Object.keys(a),...Object.keys(o)])].toSorted(),t[9]=o,t[10]=i,t[11]=a,t[12]=F):F=t[12];let I=F,L;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(L={onCopy:qe,onError:Ke},t[13]=L):L=t[13];let{copyToClipboard:te,isCopied:z}=d(L),B;t[14]!==te||t[15]!==I||t[16]!==P||t[17]!==w||t[18]!==o||t[19]!==i||t[20]!==a||t[21]!==r?.performance?(B=()=>{let e=Fe({generatedAt:new Date().toISOString(),app:{version:E,stage:C,isElectron:n,userAgent:typeof navigator>`u`?null:navigator.userAgent},environments:I.map(e=>({environmentId:e,record:i[e]??null,runtime:a[e]??null,pushSequence:o[e]??null})),providers:w,observability:P,performance:r?.performance??null});te(Ie(e),void 0)},t[14]=te,t[15]=I,t[16]=P,t[17]=w,t[18]=o,t[19]=i,t[20]=a,t[21]=r?.performance,t[22]=B):B=t[22],r?.performance;let re=B,V=T?.logsDirectoryPath??null,U;t[23]!==k||t[24]!==V||t[25]!==s?(U=()=>{if(!V)return;M(!0);let e=ne(k??[]);if(!e){M(!1),c.add(R({type:`error`,title:`Could not open logs folder`,description:`No available editors found.`}));return}(s?x(s.environmentId)?.client.shell.openInEditor({cwd:V,editor:e})??Promise.reject(Error(`Selected environment is disconnected.`)):b().shell.openInEditor(V,e)).catch(Ge).finally(()=>{M(!1)})},t[23]=k,t[24]=V,t[25]=s,t[26]=U):U=t[26];let G=U,ae;t[27]===z?ae=t[28]:(ae=z?(0,Q.jsx)(ie,{className:`size-3.5`}):(0,Q.jsx)(ee,{className:`size-3.5`}),t[27]=z,t[28]=ae);let oe=z?`Copied`:`Copy debug bundle`,se;t[29]!==re||t[30]!==ae||t[31]!==oe?(se=(0,Q.jsxs)(D,{size:`xs`,variant:`outline`,onClick:re,children:[ae,oe]}),t[29]=re,t[30]=ae,t[31]=oe,t[32]=se):se=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(W,{title:`Application`,description:`Version ${E} · ${C}${n?` · Desktop`:` · Browser`}`}),t[33]=ce):ce=t[33];let le=V??`Resolving logs directory…`,ue=!V||j,J=j?`Opening…`:`Open logs folder`,Y;t[34]!==G||t[35]!==ue||t[36]!==J?(Y=(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:ue,onClick:G,children:J}),t[34]=G,t[35]=ue,t[36]=J,t[37]=Y):Y=t[37];let X;t[38]!==le||t[39]!==Y?(X=(0,Q.jsx)(W,{title:`Logs`,description:le,control:Y}),t[38]=le,t[39]=Y,t[40]=X):X=t[40];let Z;t[41]!==se||t[42]!==X?(Z=(0,Q.jsxs)(H,{title:`Diagnostics`,headerAction:se,children:[ce,X]}),t[41]=se,t[42]=X,t[43]=Z):Z=t[43];let de;t[44]!==I||t[45]!==o||t[46]!==i||t[47]!==a?(de=I.length===0?(0,Q.jsx)(W,{title:`No environments`,description:`No environment connections are tracked yet.`}):I.map(e=>(0,Q.jsx)(He,{environmentId:e,record:i[e]??null,runtime:a[e]??null,pushSequence:o[e]??null},e)),t[44]=I,t[45]=o,t[46]=i,t[47]=a,t[48]=de):de=t[48];let fe;t[49]===de?fe=t[50]:(fe=(0,Q.jsx)(H,{title:`Environments`,children:de}),t[49]=de,t[50]=fe);let pe;t[51]===w?pe=t[52]:(pe=w.length===0?(0,Q.jsx)(W,{title:`No providers`,description:`No provider instances are configured.`}):w.map(We),t[51]=w,t[52]=pe);let me;t[53]===pe?me=t[54]:(me=(0,Q.jsx)(H,{title:`Providers`,children:pe}),t[53]=pe,t[54]=me);let he;return t[55]!==Z||t[56]!==fe||t[57]!==me?(he=(0,Q.jsxs)(Q.Fragment,{children:[Z,fe,me]}),t[55]=Z,t[56]=fe,t[57]=me,t[58]=he):he=t[58],he}function We(e){let t=e.unavailableReason??e.message??null;return(0,Q.jsx)(W,{title:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(Be,{className:ze[e.status]??`bg-muted-foreground/40`}),e.displayName??e.instanceId]}),description:(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[(0,Q.jsxs)(`span`,{className:`block`,children:[e.status,` · auth `,e.auth.status,e.version?` · v${e.version}`:``]}),t?(0,Q.jsx)(`span`,{className:`block break-all text-muted-foreground/70`,children:t}):null]})},e.instanceId)}function Ge(e){c.add(R({type:`error`,title:`Could not open logs folder`,description:e instanceof Error?e.message:`Failed to open logs folder.`}))}function Ke(e){c.add(R({type:`error`,title:`Could not copy debug bundle`,description:e.message}))}function qe(){c.add({type:`success`,title:`Debug bundle copied`,description:`Secrets are redacted before export.`})}function Je(e){return e.byEnvironment}function Ye(e){return e.byId}function Xe(e){return e.byId}var Ze=[{method:`thread/snapshot`,requestId:`req_9f2c81d4a6`,startedAt:`12s ago`},{method:`git/status`,requestId:`req_c07b3e51fd`,startedAt:`9s ago`}];function Qe(e){c.update(e,{type:`loading`,title:`Updating Claude Code`,description:`Running provider update command.`,timeout:0,actionProps:void 0,data:{hideCopyButton:!0}}),window.setTimeout(()=>{c.update(e,{type:`success`,title:`Provider updated`,description:`New sessions will use the updated provider.`,timeout:0,data:{hideCopyButton:!0,dismissAfterVisibleMs:3e3}})},1800)}var $e=[{value:`provider-update`,label:`Provider update available`,fire:()=>{let e=c.add(R({type:`warning`,title:`Update Available: Claude Code v2.1.4`,description:`Install the update now or review provider settings.`,timeout:0,actionProps:{children:`Update`,onClick:()=>Qe(e)},actionVariant:`default`,data:{hideCopyButton:!0,secondaryActionProps:{children:`Settings`,onClick:()=>o.getState().openSettings(`providers`)},secondaryActionVariant:`outline`}}))}},{value:`pr-checks-passed`,label:`PR checks passed`,fire:()=>{c.add({type:`success`,title:`Checks passed for PR #316`,description:`Redesign the notification toasts · 3273af68e412`,timeout:6e3,actionProps:{children:`Open PR`,onClick:()=>void 0},data:{actionVariant:`outline`}})}},{value:`git-push`,label:`Git push with follow-up action`,fire:()=>{c.add(R({type:`success`,title:`Pushed`,description:`3 commits pushed to origin/feat/notifications-toasts.`,timeout:0,actionProps:{children:`Open PR`,onClick:()=>void 0},actionVariant:`outline`,data:{dismissAfterVisibleMs:1e4}}))}},{value:`git-failed`,label:`Git action failed`,fire:()=>{c.add(R({type:`error`,title:`Action failed`,description:`remote: Permission to sak0a/ryco.git denied to deploy-bot.
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{G as n,K as r}from"./primary-CjhRI8fe.js";import{t as i}from"./src-Bi-5Nw9C.js";import{$n as a,K as o,Na as s,Nr as c,P as l,Pn as u,Rr as d,Vr as f,_l as p,ar as m,gl as h,hl as g,il as _,ir as v,ll as y,or as b,p as x,ul as S,vr as C,wa as w,xr as T,yr as E,zr as D}from"./runtime-Bxg7k81u.js";import{t as O}from"./compiler-runtime-qmuS0Svy.js";import{a as k,c as A,n as j,o as M,s as N,t as P}from"./badge-DnBuGHGL.js";import{s as F}from"./hostedConnectionCoordinator-JZ1dLx4v.js";import{t as ee}from"./clipboard-copy-fJnfdl4H.js";import{n as I,t as L}from"./play-CPVy9wwV.js";import{t as te}from"./refresh-cw-B5Cz1z3e.js";import{r as ne}from"./editorPreferences-Bg624RVT.js";import{t as R}from"./toastHelpers-CSQRKo4F.js";import{t as z}from"./authorization-7xVVtCBu.js";import"./usePresentationTier-B_SCFvN7.js";import{i as B,r as re,t as V}from"./alert-BmLJh6DH.js";import{i as H,n as U,r as W}from"./settingsLayout-CfKq88KD.js";var G={name:`clipboard-check`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]};G.node;var ie=s(G),K=e(t(),1),q=O();function ae(e){return!e.connected||e.role===`client`?!1:e.primary||e.role===`owner`}function oe(e){let t=(0,q.c)(16),n=h(),i=l(se),a=F(),o;t[0]===n?o=t[1]:(o=e=>n?e.byId[n.environmentId]:void 0,t[0]=n,t[1]=o);let s=m(o),c,u;if(t[2]!==e||t[3]!==i.browserStatus||t[4]!==i.directoryStatus||t[5]!==i.effectiveRole||t[6]!==i.sessionStatus||t[7]!==i.transportStatus||t[8]!==n||t[9]!==a.machines){let o;t[12]===n?.environmentId?o=t[13]:(o=e=>e.environmentId===n?.environmentId,t[12]=n?.environmentId,t[13]=o);let s=a.machines.find(o);c=r(),u=z({hosted:c,role:s?s.effectiveRole:n&&!n.primary?null:i.effectiveRole,fresh:i.directoryStatus===`ready`&&(s?s.connectionState===`connected`&&s.canMutate&&s.cacheDisposition===`available`&&s.presence.online:i.transportStatus===`online`),browserCurrent:i.browserStatus===`current`,sessionReady:i.sessionStatus===`ready`,method:e}),t[2]=e,t[3]=i.browserStatus,t[4]=i.directoryStatus,t[5]=i.effectiveRole,t[6]=i.sessionStatus,t[7]=i.transportStatus,t[8]=n,t[9]=a.machines,t[10]=c,t[11]=u}else c=t[10],u=t[11];let d=u;if(!c&&n&&!ae({primary:n.primary,connected:n.connected&&(!s||s.connectionState===`connected`),role:s?.role})){let e;return t[14]===c?e=t[15]:(e={hosted:c,allowed:!1,reason:`Diagnostics require a connected owner session.`},t[14]=c,t[15]=e),e}return d}function se(e){return e}function ce(e){let t=!1,n=!1;return{async refresh(){if(!(t||n)){n=!0,e.onLoading(!0);try{let n=await e.fetch();t||e.onSuccess(n)}catch(n){t||e.onError(n)}finally{n=!1,t||e.onLoading(!1)}}},dispose(){t=!0}}}function le(e,t){let n=new Map(e.map(e=>[e.identity.pid,e]));return e.filter(e=>{let r=new Set([e.identity.pid]),i=n.get(e.ppid);for(;i&&!r.has(i.identity.pid);){if(t.has(`${i.identity.pid}:${i.identity.startTimeMs}`))return!1;r.add(i.identity.pid),i=n.get(i.ppid)}return!0})}function ue(e){return e===`failure`||e===`error`}function J(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function Y(e){return!Number.isFinite(e)||e<=0?`0 ms`:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(+(e<1e4))} s`:`${(e/6e4).toFixed(1)} min`}function X(e){return e===void 0||!Number.isFinite(e)?`n/a`:`${Math.max(0,e).toFixed(1)}%`}function Z(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return e;let r=Math.max(0,t-n);return r<1e3?`just now`:r<6e4?`${Math.floor(r/1e3)}s ago`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function de(e){return e.map(e=>({label:e.sampledAt,value:e.memory.rssBytes}))}function fe(e){return e.map(e=>({label:e.sampledAt,value:e.cpu.utilizationPercent??0}))}function pe(e){return e.map(e=>({label:e.label,value:e.count}))}function me(e){return e.slice(0,8).map(e=>({label:e.name,value:e.count}))}function he(e){let t=e.failures.latest[0];return t?t.message:`No failures`}var Q=p(),ge=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function _e({telemetry:e,paused:t,refresh:n}){let r=h()?.environmentId,[o,s]=(0,K.useState)(0),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(!1),[m,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!0),[y,x]=(0,K.useState)(new Set),S=(0,K.useRef)(null),C=(0,K.useRef)(t);C.current=t;let w=oe(i.serverRetryResourceTelemetry),T=oe(i.serverGetResourceTelemetryHistory),E=ge[o]??ge[0],O=(0,K.useRef)(0);(0,K.useEffect)(()=>(O.current+=1,g(!1),()=>{O.current+=1}),[r]),(0,K.useEffect)(()=>{if(l(null),d(null),!T.allowed){p(!1);return}let e=ce({fetch:async()=>{let e=r?a(r)?.server:b().server;if(!e?.getResourceTelemetryHistory)throw Error(`Resource history is unavailable on this server.`);return e.getResourceTelemetryHistory({windowMs:E.windowMs,bucketMs:E.bucketMs})},onSuccess:e=>{l(e),d(null)},onError:e=>d(e instanceof Error?e.message:`Resource history could not be refreshed.`),onLoading:p});S.current=e.refresh;let t=()=>{!C.current&&document.visibilityState===`visible`&&e.refresh()};t();let n=window.setInterval(t,5e3);return document.addEventListener(`visibilitychange`,t),()=>{e.dispose(),S.current=null,window.clearInterval(n),document.removeEventListener(`visibilitychange`,t)}},[r,E,T.allowed,T.reason]);async function k(){if(m||!w.allowed)return;let e=O.current;g(!0);try{let t=r?a(r)?.server:b().server;if(!t?.retryResourceTelemetry)throw Error(`Resource monitor retry is unavailable on this server.`);if(await t.retryResourceTelemetry(),e!==O.current)return;await n(),await S.current?.()}catch(t){e===O.current&&d(t instanceof Error?t.message:`Could not retry resource monitor.`)}finally{e===O.current&&g(!1)}}let A=e?.health,j=le(e?.processes??[],y).filter(e=>_||e.cpuPercent>0||e.ioReadBytesPerSecond>0||e.ioWriteBytesPerSecond>0||e.category===`server`),M=c?.buckets??[],N=Math.max(1,...M.map(e=>e.maxCpuPercent)),P=Math.max(1,...M.map(e=>Math.max(e.ioReadBytes,e.ioWriteBytes))),F=Math.max(1,...M.map(e=>e.maxRssBytes));return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(H,{title:`Resource monitor`,headerAction:(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:m||!w.allowed,onClick:()=>void k(),children:m?`Retrying…`:`Retry monitor`}),children:[(0,Q.jsxs)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:[e?`Sampled ${Z(e.readAt)} · interval ${Y(e.sampleIntervalMs)}`:`Waiting for resource telemetry.`,` `,`CPU may exceed 100% across cores. I/O availability depends on the platform.`]}),(0,Q.jsx)(`dl`,{className:`grid grid-cols-2 divide-x divide-y border-t lg:grid-cols-3`,children:[[`Current CPU`,e?X(e.groups.allRyco.currentCpuPercent):`Loading…`],[`Resident memory`,e?J(e.groups.allRyco.currentRssBytes):`Loading…`],[`Process count`,e?String(e.groups.allRyco.processCount):`Loading…`],[`Read throughput`,e?`${J(e.groups.allRyco.ioReadBytesPerSecond)}/s`:`Loading…`],[`Write throughput`,e?`${J(e.groups.allRyco.ioWriteBytesPerSecond)}/s`:`Loading…`],[`CPU speed limit`,e?.speedLimitPercent==null?`Unknown`:`${e.speedLimitPercent}%`]].map(([e,t])=>(0,Q.jsxs)(`div`,{className:`px-4 py-4`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`mt-2 text-2xl font-semibold tabular-nums`,children:t})]},e))}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[850px] text-left text-xs [&_td]:px-4 [&_td]:py-3`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Group`,`Processes`,`CPU / time`,`RSS / peak`,`Read / write rate`,`Read / write total`,`Starts / exits`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:e?Object.entries(e.groups).map(([e,t])=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{children:{allRyco:`All Ryco`,backend:`Backend + agents`,electron:`Desktop`,monitor:`Monitor overhead`}[e]??e}),(0,Q.jsx)(`td`,{children:t.processCount}),(0,Q.jsxs)(`td`,{children:[X(t.currentCpuPercent),(0,Q.jsx)(`div`,{children:Y(t.cpuTimeMs)})]}),(0,Q.jsxs)(`td`,{children:[J(t.currentRssBytes),(0,Q.jsx)(`div`,{children:J(t.peakRssBytes)})]}),(0,Q.jsxs)(`td`,{children:[J(t.ioReadBytesPerSecond),`/s`,(0,Q.jsxs)(`div`,{children:[J(t.ioWriteBytesPerSecond),`/s`]})]}),(0,Q.jsxs)(`td`,{children:[J(t.ioReadBytes),(0,Q.jsx)(`div`,{children:J(t.ioWriteBytes)})]}),(0,Q.jsxs)(`td`,{children:[t.processStarts,` / `,t.processExits]})]},e)):null})]})})]}),(0,Q.jsxs)(H,{title:`Host & collection`,children:[A?(0,Q.jsxs)(`div`,{className:`grid gap-3 border-t px-4 py-3 text-xs sm:grid-cols-2`,children:[[`native`,`desktop`].map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`strong`,{className:`capitalize`,children:[e,`: `,A[e].status]}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:A[e].lastSampleAt?`Last sample ${Z(A[e].lastSampleAt)}`:`No sample`}),A[e].lastError?(0,Q.jsx)(`p`,{className:`mt-1 text-warning`,children:A[e].lastError}):null]},e)),(0,Q.jsxs)(`p`,{children:[`Monitor `,A.sidecarVersion??`version unavailable`,` · PID`,` `,A.sidecarPid??`unavailable`,` · `,A.restartCount,` restarts`]}),(0,Q.jsxs)(`p`,{children:[(A.collectionDurationMicros/1e3).toFixed(2),` ms collection ·`,` `,A.scannedProcessCount,` scanned · `,A.retainedProcessCount,` retained ·`,` `,A.inaccessibleProcessCount,` inaccessible`]})]}):null,(0,Q.jsxs)(`div`,{className:`border-t px-4 py-3 text-xs`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-medium`,children:`Power and background state`}),e?.power?(0,Q.jsx)(`dl`,{className:`mt-3 grid grid-cols-2 gap-3`,children:Object.entries(e.power).map(([e,t])=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:{idleState:`Idle state`,idleSeconds:`Idle seconds`,onBattery:`On battery`,thermalState:`Thermal state`,speedLimitPercent:`CPU speed limit (%)`,suspended:`Suspended`,lowPowerMode:`Low power mode`,locked:`Screen locked`,updatedAt:`Updated`,stale:`Stale`}[e]??e}),(0,Q.jsx)(`dd`,{children:t===null?`Unknown`:typeof t==`boolean`?t?`Yes`:`No`:String(t)})]},e))}):(0,Q.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`Desktop power state is unavailable on this connection.`}),(0,Q.jsxs)(`p`,{className:`mt-2`,children:[`CPU speed limit:`,` `,e?.speedLimitPercent==null?`Unknown`:`${e.speedLimitPercent}%`]})]})]}),(0,Q.jsxs)(H,{title:`Resource timeline`,headerAction:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`div`,{role:`group`,"aria-label":`Resource history period`,className:`flex gap-1`,children:ge.map((e,t)=>(0,Q.jsx)(D,{size:`xs`,variant:o===t?`secondary`:`outline`,"aria-pressed":o===t,onClick:()=>s(t),children:e.label},e.label))}),(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:f,onClick:()=>void S.current?.(),children:`Refresh`})]}),children:[u?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-3 text-xs text-destructive`,children:u}):null,(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:c?`${c.totalCpuTimeMs===void 0?`Unavailable`:Y(c.totalCpuTimeMs)} total CPU time · ${c.retainedSampleCount} retained samples · ${Y(c.sampleIntervalMs)} sampling interval · checked ${Z(c.readAt)}`:`Collecting resource history…`}),(0,Q.jsx)(`div`,{className:`grid gap-4 px-4 pb-4 sm:grid-cols-2`,children:[`cpu`,`memory`,`read`,`write`].map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs font-medium`,children:e===`cpu`?`CPU average / peak`:e===`memory`?`Peak RSS`:e===`read`?`I/O reads`:`I/O writes`}),(0,Q.jsx)(`svg`,{viewBox:`0 0 400 100`,role:`img`,"aria-label":e===`cpu`?`CPU history`:e===`memory`?`Memory history`:e===`read`?`I/O read history`:`I/O write history`,className:`h-24 w-full text-info`,children:M.map((t,n)=>{let r=e===`cpu`?t.maxCpuPercent/N:e===`memory`?t.maxRssBytes/F:(e===`read`?t.ioReadBytes:t.ioWriteBytes)/P,i=t.avgCpuPercent/N;return(0,Q.jsxs)(`g`,{children:[(0,Q.jsxs)(`title`,{children:[new Date(t.startedAt).toLocaleTimeString(),`: average`,` `,X(t.avgCpuPercent),`, peak`,` `,X(t.maxCpuPercent),`, RSS `,J(t.maxRssBytes),`, read `,J(t.ioReadBytes),`, write`,` `,J(t.ioWriteBytes),`, `,t.maxProcessCount,` processes`]}),(0,Q.jsx)(`rect`,{x:n*400/Math.max(1,M.length),y:100-r*100,width:Math.max(1,400/Math.max(1,M.length)-2),height:r*100,fill:`currentColor`,opacity:e===`cpu`?.3:1}),e===`cpu`?(0,Q.jsx)(`rect`,{x:n*400/Math.max(1,M.length),y:100-i*100,width:Math.max(1,400/Math.max(1,M.length)-2),height:i*100,fill:`currentColor`}):null]},t.startedAt)})}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Scale:`,` `,e===`cpu`?X(N):J(e===`memory`?F:P)]})]},e))}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[850px] text-left text-xs [&_td]:px-4 [&_td]:py-3`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Process`,`CPU avg / peak`,`CPU time`,`RSS / peak`,`I/O read / write`,`Samples / last seen`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:c?.topProcesses.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer`,children:[e.name,` (`,e.identity.pid,`)`]}),(0,Q.jsx)(`p`,{className:`max-w-72 break-all font-mono`,children:e.command})]}),(0,Q.jsx)(`div`,{className:`text-muted-foreground`,children:e.category})]}),(0,Q.jsxs)(`td`,{children:[X(e.avgCpuPercent),` / `,X(e.maxCpuPercent)]}),(0,Q.jsx)(`td`,{children:Y(e.cpuTimeMs)}),(0,Q.jsxs)(`td`,{children:[J(e.currentRssBytes),` / `,J(e.peakRssBytes)]}),(0,Q.jsx)(`td`,{children:e.ioSemantics===`unavailable`?`Unavailable`:`${J(e.ioReadBytes)} / ${J(e.ioWriteBytes)}`}),(0,Q.jsxs)(`td`,{children:[e.sampleCount,` · `,Z(e.lastSeenAt)]})]},`${e.identity.pid}:${e.identity.startTimeMs}`))})]})})]}),(0,Q.jsxs)(H,{title:`Live process tree`,headerAction:(0,Q.jsx)(D,{size:`xs`,variant:`outline`,"aria-pressed":_,onClick:()=>v(e=>!e),children:_?`Hide idle processes`:`Show idle processes`}),children:[(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[1000px] text-left text-xs [&_td]:px-4 [&_td]:py-3 [&_td]:align-top`,children:[(0,Q.jsx)(`thead`,{className:`border-b text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Process / category`,`PID / parent`,`CPU / time`,`RSS / peak / virtual`,`I/O rate / semantics`,`Wakeups / uptime`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:j.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{className:`max-w-80`,children:[(0,Q.jsxs)(`div`,{style:{paddingLeft:Math.min(e.depth,8)*10},children:[e.childPids.length>0?(0,Q.jsx)(D,{size:`xs`,variant:`ghost`,"aria-label":`${y.has(`${e.identity.pid}:${e.identity.startTimeMs}`)?`Expand`:`Collapse`} ${e.name} children`,"aria-expanded":!y.has(`${e.identity.pid}:${e.identity.startTimeMs}`),onClick:()=>x(t=>{let n=new Set(t),r=`${e.identity.pid}:${e.identity.startTimeMs}`;return n.has(r)?n.delete(r):n.add(r),n}),children:y.has(`${e.identity.pid}:${e.identity.startTimeMs}`)?`+`:`−`}):null,(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer break-all`,children:e.name}),(0,Q.jsx)(`p`,{className:`mt-2 break-all font-mono`,children:e.command}),(0,Q.jsxs)(`p`,{children:[`First seen `,Z(e.firstSeenAt),` · last seen`,` `,Z(e.lastSeenAt)]})]})]}),(0,Q.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.category,` `,e.electronType,` `,e.electronServiceName,` ·`,` `,e.status]})]}),(0,Q.jsxs)(`td`,{children:[e.identity.pid,` / `,e.ppid]}),(0,Q.jsxs)(`td`,{children:[X(e.cpuPercent),(0,Q.jsx)(`div`,{children:Y(e.cpuTimeMs)})]}),(0,Q.jsxs)(`td`,{children:[J(e.residentBytes),(0,Q.jsx)(`div`,{children:J(e.peakResidentBytes)}),(0,Q.jsx)(`div`,{children:J(e.virtualBytes)})]}),(0,Q.jsxs)(`td`,{children:[e.ioSemantics===`unavailable`?`Unavailable`:(0,Q.jsxs)(Q.Fragment,{children:[J(e.ioReadBytesPerSecond),`/s read`,(0,Q.jsxs)(`div`,{children:[J(e.ioWriteBytesPerSecond),`/s write`]}),(0,Q.jsxs)(`div`,{children:[J(e.ioReadBytes),` / `,J(e.ioWriteBytes),` `,`total`]})]}),(0,Q.jsx)(`div`,{className:`text-muted-foreground`,children:e.ioSemantics})]}),(0,Q.jsxs)(`td`,{children:[e.idleWakeupsPerSecond==null?`Unavailable`:`${e.idleWakeupsPerSecond.toFixed(1)}/s`,(0,Q.jsx)(`div`,{children:Y(e.runTimeMs)})]})]},`${e.identity.pid}:${e.identity.startTimeMs}`))})]})}),j.length===0?(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No active processes in this sample. Show idle processes to include retained idle entries.`}):null]}),(0,Q.jsxs)(H,{title:`Instrumented application I/O`,children:[(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`Application read/write counters describe logical work and are separate from operating-system storage bytes.`}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[650px] text-left text-xs [&_td]:px-4 [&_td]:py-3`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Component / operation`,`Read`,`Write`,`Count`,`Duration`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y`,children:e?.attribution.entries.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[e.component,` / `,e.operation]}),(0,Q.jsx)(`td`,{children:J(e.logicalReadBytes)}),(0,Q.jsx)(`td`,{children:J(e.logicalWriteBytes)}),(0,Q.jsx)(`td`,{children:e.count}),(0,Q.jsx)(`td`,{children:Y(e.durationMs)})]},`${e.component}:${e.operation}`))})]})}),e?.attribution.entries.length?null:(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No logical I/O attribution captured.`})]})]})}function ve({snapshot:e,refresh:t}){let n=h(),r=oe(i.serverSignalDiagnosticProcess),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),u=(0,K.useRef)({target:n,snapshot:e,allowed:!1}),d=(0,K.useRef)(!1),f=(0,K.useRef)(!0),p=r.allowed;u.current={target:n,snapshot:e,allowed:p},(0,K.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);async function m(e,n){if(d.current||!u.current.allowed)return;let r=u.current.target?.environmentId;d.current=!0,s(e.pid),l(null);try{if(!await b().dialogs.confirm(`${n===`SIGKILL`?`Force kill`:`Interrupt`} process ${e.pid} (${e.command})? ${n===`SIGKILL`?`Unsaved work may be lost.`:`This may stop an active agent or terminal task.`}`)||!f.current||!u.current.allowed||u.current.target?.environmentId!==r)return;if(!u.current.snapshot?.processTree?.processes.find(t=>t.pid===e.pid&&t.startTimeMs===e.startTimeMs)){l(`Process already exited or changed. Refresh diagnostics.`);return}let i=r?a(r)?.server:b().server;if(!i?.signalDiagnosticProcess)throw Error(`Process controls are unavailable on this server.`);let o=await i.signalDiagnosticProcess({pid:e.pid,startTimeMs:e.startTimeMs,signal:n});if(!f.current||u.current.target?.environmentId!==r)return;l(o.signaled?`${n} sent to process ${e.pid}.`:o.message??`Process already exited or is no longer a server child.`),await t()}catch(e){f.current&&u.current.target?.environmentId===r&&l(e instanceof Error?e.message:`Could not signal process.`)}finally{d.current=!1,f.current&&s(null)}}let g=e?.processTree;return(0,Q.jsxs)(H,{title:`Live descendant processes`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 px-4 py-4 text-xs lg:grid-cols-4`,children:[(0,Q.jsxs)(`div`,{children:[`Child processes`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:g?.processes.length??`Unavailable`})]}),(0,Q.jsxs)(`div`,{children:[`Child CPU`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:X(g?.totalCpuPercent)})]}),(0,Q.jsxs)(`div`,{children:[`Child RSS`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:g?J(g.totalRssBytes):`Unavailable`})]}),(0,Q.jsxs)(`div`,{children:[`Server PID`,(0,Q.jsx)(`div`,{className:`mt-1 font-mono`,children:g?.serverPid??e?.liveProcesses.server.pid??`Unavailable`})]})]}),(0,Q.jsxs)(`p`,{className:`px-4 pb-3 text-xs text-muted-foreground`,children:[`Live children of the selected server. The server and desktop shell are excluded.`,` `,g?`Checked ${Z(g.readAt)}.`:`This server has not supplied process diagnostics.`]}),g?.error?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 pb-3 text-xs text-destructive`,children:g.error}):null,c?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 pb-3 text-xs`,children:c}):null,p?null:(0,Q.jsx)(`p`,{className:`px-4 pb-3 text-xs text-muted-foreground`,children:r.reason??`Process controls require a connected owner session.`}),(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[760px] text-left text-xs [&_td]:px-4 [&_td]:py-3 [&_td]:align-top`,children:[(0,Q.jsx)(`thead`,{className:`border-y text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:[`Process`,`PID / Parent`,`CPU`,`RSS`,`Status / Age`,`Actions`].map(e=>(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e))})}),(0,Q.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:g?.processes.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`max-w-96`,children:(0,Q.jsxs)(`details`,{style:{marginLeft:Math.min(e.depth,8)*10},children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer break-all`,children:e.command.split(/[\\/]/).at(-1)||`Process`}),(0,Q.jsx)(`div`,{className:`mt-2 break-all font-mono`,children:e.command}),(0,Q.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.childPids.length,` children · Started`,` `,new Date(e.startTimeMs).toLocaleString()]})]})}),(0,Q.jsxs)(`td`,{className:`font-mono`,children:[e.pid,` / `,e.ppid]}),(0,Q.jsx)(`td`,{children:X(e.cpuPercent)}),(0,Q.jsx)(`td`,{children:J(e.rssBytes)}),(0,Q.jsxs)(`td`,{children:[e.status,(0,Q.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:e.elapsed})]}),(0,Q.jsx)(`td`,{children:(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:!p||o!==null,onClick:()=>void m(e,`SIGINT`),children:`Interrupt`}),(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:!p||o!==null,onClick:()=>void m(e,`SIGKILL`),children:`Force kill`})]})})]},`${e.pid}:${e.startTimeMs}`))})]})}),g?.processes.length===0?(0,Q.jsx)(`p`,{className:`px-4 py-4 text-sm text-muted-foreground`,children:`No live descendant processes.`}):null]})}function ye(e){let t=(0,q.c)(11),{value:n}=e,{copyToClipboard:r,isCopied:i}=d(),a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`code`,{className:`break-all text-[11px]`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==r||t[3]!==n?(o=()=>r(n,void 0),t[2]=r,t[3]=n,t[4]=o):o=t[4];let s=i?`Copied`:`Copy`,c;t[5]!==o||t[6]!==s?(c=(0,Q.jsx)(D,{size:`xs`,variant:`ghost`,"aria-label":`Copy trace ID`,onClick:o,children:s}),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==a||t[9]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[a,c]}),t[8]=a,t[9]=c,t[10]=l):l=t[10],l}function be(e){let t=(0,q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=n.length>180?(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer break-words`,children:[n.slice(0,180),`…`]}),(0,Q.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words font-sans`,children:n})]}):(0,Q.jsx)(`span`,{className:`break-words`,children:n}),t[0]=n,t[1]=r),r}function xe(e){let t=(0,q.c)(10),{headers:n,children:r,empty:i}=e;if(i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-4 py-4 text-sm text-muted-foreground`,children:`No retained records.`}),t[0]=e):e=t[0],e}let a;t[1]===n?a=t[2]:(a=n.map(Se),t[1]=n,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Q.jsx)(`thead`,{className:`border-b text-muted-foreground`,children:(0,Q.jsx)(`tr`,{children:a})}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,Q.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-[680px] text-left text-xs [&_td]:px-4 [&_td]:py-3 [&_td]:align-top`,children:[o,s]})}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Se(e){return(0,Q.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:e},e)}function Ce(e){let t=(0,q.c)(84),{snapshot:n,nowMs:r}=e,i=n?.tracing.summary,a;t[0]===n?.tracing.topSpanNames?a=t[1]:(a=n?.tracing.topSpanNames??[],t[0]=n?.tracing.topSpanNames,t[1]=a);let o=a,s;t[2]===n?.failures.common?s=t[3]:(s=n?.failures.common??[],t[2]=n?.failures.common,t[3]=s);let c=s,l;t[4]===i?.latestWarningAndErrorLogs?l=t[5]:(l=i?.latestWarningAndErrorLogs??[],t[4]=i?.latestWarningAndErrorLogs,t[5]=l);let u=l,d=n?.tracing.retainedSpanCount,f;t[6]===d?f=t[7]:(f=[`Retained spans`,d],t[6]=d,t[7]=f);let p=i?.failureCount,m;t[8]===p?m=t[9]:(m=[`Failures`,p],t[8]=p,t[9]=m);let h=i?.interruptionCount,g;t[10]===h?g=t[11]:(g=[`Interrupted spans`,h],t[10]=h,t[11]=g);let _=i?.slowSpanCount,v;t[12]===_?v=t[13]:(v=[`Slow spans`,_],t[12]=_,t[13]=v);let y=i?.parseErrorCount,b;t[14]===y?b=t[15]:(b=[`Parse errors`,y],t[14]=y,t[15]=b);let x;t[16]===i?x=t[17]:(x=i?Y(i.slowSpanThresholdMs):void 0,t[16]=i,t[17]=x);let S;t[18]===x?S=t[19]:(S=[`Slow threshold`,x],t[18]=x,t[19]=S);let C;t[20]!==r||t[21]!==i?(C=i?.firstSpanAt?Z(i.firstSpanAt,r):void 0,t[20]=r,t[21]=i,t[22]=C):C=t[22];let w;t[23]===C?w=t[24]:(w=[`First span`,C],t[23]=C,t[24]=w);let T;t[25]!==r||t[26]!==i?(T=i?.lastSpanAt?Z(i.lastSpanAt,r):void 0,t[25]=r,t[26]=i,t[27]=T):T=t[27];let E;t[28]===T?E=t[29]:(E=[`Last span`,T],t[28]=T,t[29]=E);let D;t[30]!==v||t[31]!==b||t[32]!==S||t[33]!==w||t[34]!==E||t[35]!==f||t[36]!==m||t[37]!==g?(D=(0,Q.jsx)(`dl`,{className:`grid grid-cols-2 gap-4 px-4 py-4 text-xs lg:grid-cols-4`,children:[f,m,g,v,b,S,w,E].map(De)}),t[30]=v,t[31]=b,t[32]=S,t[33]=w,t[34]=E,t[35]=f,t[36]=m,t[37]=g,t[38]=D):D=t[38];let O;t[39]===i?.partialFailure?O=t[40]:(O=i?.partialFailure?(0,Q.jsx)(`p`,{className:`px-4 pb-3 text-xs text-warning`,children:`Some trace files could not be read. These results are incomplete.`}):null,t[39]=i?.partialFailure,t[40]=O);let k;t[41]===i?k=t[42]:(k=i?(0,Q.jsxs)(`details`,{className:`border-t px-4 py-3 text-xs`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Collection details`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,Q.jsxs)(`p`,{children:[`Log levels:`,` `,Object.entries(i.logLevelCounts).map(Ee).join(` · `)||`None`]}),i.scannedFilePaths.map(Te)]})]}):null,t[41]=i,t[42]=k);let A;t[43]!==D||t[44]!==O||t[45]!==k?(A=(0,Q.jsxs)(H,{title:`Trace diagnostics`,children:[D,O,k]}),t[43]=D,t[44]=O,t[45]=k,t[46]=A):A=t[46];let j;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(j=[`Source / category`,`Count`,`Cause`,`Last seen`],t[47]=j):j=t[47];let M=c.length===0,N;if(t[48]!==c||t[49]!==r){let e;t[51]===r?e=t[52]:(e=e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[e.source,(0,Q.jsx)(`div`,{className:`text-muted-foreground`,children:e.category})]}),(0,Q.jsx)(`td`,{className:`font-mono`,children:e.count}),(0,Q.jsx)(`td`,{className:`max-w-96`,children:(0,Q.jsx)(be,{children:e.sampleMessage})}),(0,Q.jsx)(`td`,{className:`whitespace-nowrap`,children:Z(e.latestAt,r)})]},`${e.source}:${e.signature}`),t[51]=r,t[52]=e),N=c.map(e),t[48]=c,t[49]=r,t[50]=N}else N=t[50];let P;t[53]!==M||t[54]!==N?(P=(0,Q.jsx)(H,{title:`Most common failures`,children:(0,Q.jsx)(xe,{headers:j,empty:M,children:N})}),t[53]=M,t[54]=N,t[55]=P):P=t[55];let F;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=[`Time`,`Level`,`Span`,`Message`,`Trace`],t[56]=F):F=t[56];let ee=u.length===0,I;if(t[57]!==u||t[58]!==r){let e;t[60]===r?e=t[61]:(e=e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`whitespace-nowrap`,children:Z(e.seenAt,r)}),(0,Q.jsx)(`td`,{children:e.level}),(0,Q.jsx)(`td`,{children:e.spanName}),(0,Q.jsx)(`td`,{className:`max-w-96`,children:(0,Q.jsx)(be,{children:e.message})}),(0,Q.jsx)(`td`,{children:(0,Q.jsx)(ye,{value:e.traceId})})]},`${e.traceId}:${e.spanId}:${e.seenAt}:${e.level}:${e.message}`),t[60]=r,t[61]=e),I=u.map(e),t[57]=u,t[58]=r,t[59]=I}else I=t[59];let L;t[62]!==ee||t[63]!==I?(L=(0,Q.jsx)(H,{title:`Span warning and error logs`,children:(0,Q.jsx)(xe,{headers:F,empty:ee,children:I})}),t[62]=ee,t[63]=I,t[64]=L):L=t[64];let te;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(te=[`Span`,`Count`,`Failures`,`Average`,`Maximum`,`Total`],t[65]=te):te=t[65];let ne=o.length===0,R;t[66]===o?R=t[67]:(R=o.map(we),t[66]=o,t[67]=R);let z;t[68]!==ne||t[69]!==R?(z=(0,Q.jsx)(H,{title:`Top span names`,children:(0,Q.jsx)(xe,{headers:te,empty:ne,children:R})}),t[68]=ne,t[69]=R,t[70]=z):z=t[70];let B;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(B=[`Span`,`Status`,`Duration`,`Ended`,`Trace`],t[71]=B):B=t[71];let re=!n?.tracing.recentSpans.length,V;t[72]!==r||t[73]!==n?.tracing.recentSpans?(V=n?.tracing.recentSpans.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsxs)(`td`,{children:[e.name,e.failureMessage?(0,Q.jsx)(`div`,{className:`mt-1 text-destructive`,children:(0,Q.jsx)(be,{children:e.failureMessage})}):null]}),(0,Q.jsx)(`td`,{children:e.status}),(0,Q.jsx)(`td`,{children:Y(e.durationMs)}),(0,Q.jsx)(`td`,{className:`whitespace-nowrap`,children:Z(e.endTime,r)}),(0,Q.jsx)(`td`,{children:(0,Q.jsx)(ye,{value:e.traceId})})]},e.id)),t[72]=r,t[73]=n?.tracing.recentSpans,t[74]=V):V=t[74];let U;t[75]!==re||t[76]!==V?(U=(0,Q.jsx)(H,{title:`Recent spans`,children:(0,Q.jsx)(xe,{headers:B,empty:re,children:V})}),t[75]=re,t[76]=V,t[77]=U):U=t[77];let W;return t[78]!==A||t[79]!==P||t[80]!==L||t[81]!==z||t[82]!==U?(W=(0,Q.jsxs)(Q.Fragment,{children:[A,P,L,z,U]}),t[78]=A,t[79]=P,t[80]=L,t[81]=z,t[82]=U,t[83]=W):W=t[83],W}function we(e){return(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{children:e.name}),(0,Q.jsx)(`td`,{children:e.count}),(0,Q.jsx)(`td`,{children:e.failureCount}),(0,Q.jsx)(`td`,{children:Y(e.averageDurationMs)}),(0,Q.jsx)(`td`,{children:Y(e.maxDurationMs)}),(0,Q.jsx)(`td`,{children:Y(e.totalDurationMs)})]},e.name)}function Te(e){return(0,Q.jsx)(`p`,{className:`break-all font-mono`,children:e},e)}function Ee(e){let[t,n]=e;return`${t}: ${n}`}function De(e){let[t,n]=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:t}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono`,children:n??`Unavailable`})]},t)}var Oe=/token|secret|password|passwd|credential|authorization|bearer|api[-_]?key|cookie|session|private[-_]?key|pairing[-_]?code|access[-_]?key|signature|email|proof|ticket/iu;function ke(e){return e.replace(/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?(?:-----END [^-]*PRIVATE KEY-----|$)/gu,`[redacted]`).replace(/\bBearer\s+[^\s,;"']+/giu,`Bearer [redacted]`).replace(/\b(?:sk-[A-Za-z0-9_-]{8,}|gh[pousr]_[A-Za-z0-9_]{8,}|github_pat_[A-Za-z0-9_]+)\b/gu,`[redacted]`).replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/gu,`[redacted]`).replace(/\b((?:access[-_]?token|refresh[-_]?token|token|secret|password|passwd|credential|authorization|api[-_]?key|cookie|pairing[-_]?code|proof|ticket)\s*[=:]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/giu,`$1[redacted]`).replace(/https?:\/\/[^\s<>"']+/giu,e=>{try{let t=new URL(e);t.username=``,t.password=``,t.hash=``;for(let e of t.searchParams.keys())/token|secret|password|credential|authorization|key|cookie|proof|ticket|signature|code/iu.test(e)&&t.searchParams.set(e,`[redacted]`);return t.toString()}catch{return`[redacted URL]`}})}var Ae=`[redacted]`,je=Oe;function Me(e){let t;try{t=new URL(e)}catch{return e}(t.username||t.password)&&(t.username=``,t.password=``);for(let e of t.searchParams.keys())je.test(e)&&t.searchParams.set(e,Ae);return t.toString()}function Ne(e){return Pe(e,!1)}function Pe(e,t){if(t)return e==null?e:Ae;if(typeof e==`string`)return ke(Me(e));if(Array.isArray(e))return e.map(e=>Pe(e,!1));if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=Pe(r,je.test(n));return t}return e}function Fe(e){return Ne({generatedAt:e.generatedAt,app:e.app,environments:e.environments.map(e=>({environmentId:e.environmentId,label:e.record?.label??null,connectionState:e.runtime?.connectionState??null,authState:e.runtime?.authState??null,role:e.runtime?.role??null,lastError:e.runtime?.lastError??null,lastErrorAt:e.runtime?.lastErrorAt??null,connectedAt:e.runtime?.connectedAt??null,disconnectedAt:e.runtime?.disconnectedAt??null,pushSequence:e.pushSequence})),providers:e.providers.map(e=>({instanceId:e.instanceId,driver:e.driver,enabled:e.enabled,installed:e.installed,version:e.version,status:e.status,availability:e.availability??`available`,authStatus:e.auth.status,authType:e.auth.type??null,message:e.message??null,unavailableReason:e.unavailableReason??null,checkedAt:e.checkedAt})),observability:e.observability?{logsDirectoryConfigured:e.observability.logsDirectoryPath.length>0,localTracingEnabled:e.observability.localTracingEnabled,otlpTracesEnabled:e.observability.otlpTracesEnabled,otlpMetricsEnabled:e.observability.otlpMetricsEnabled,localMetrics:e.observability.localMetrics?{turnQuiescenceAvgMs:e.observability.localMetrics.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.observability.localMetrics.checkpointDurationP95Ms,wsReconnectCount:e.observability.localMetrics.wsReconnectCount,capturedAt:e.observability.localMetrics.capturedAt}:null}:null,performance:e.performance?{local:{turnQuiescenceAvgMs:e.performance.local.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.performance.local.checkpointDurationP95Ms,latestThreadSnapshotDurationMs:e.performance.local.latestThreadSnapshotDurationMs,threadSnapshotDurationP95Ms:e.performance.local.threadSnapshotDurationP95Ms,wsReconnectCount:e.performance.local.wsReconnectCount,windowSampleCounts:{...e.performance.local.windowSampleCounts},capturedAt:e.performance.local.capturedAt},queues:{...e.performance.queues},traceSink:e.performance.traceSink?{...e.performance.traceSink}:null,snapshotCollectionDurationMs:e.performance.snapshotCollectionDurationMs}:null})}function Ie(e){return JSON.stringify(e,null,2)}function Le(e){return(e?.gapCount??0)>0}var Re={connected:`bg-success`,connecting:`bg-warning`,error:`bg-destructive`,disconnected:`bg-muted-foreground/40`},ze={ready:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,disabled:`bg-muted-foreground/40`};function Be(e){let t=(0,q.c)(4),{className:n}=e,r;t[0]===n?r=t[1]:(r=f(`inline-block size-2 shrink-0 rounded-full`,n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`span`,{className:r,"aria-hidden":!0}),t[2]=r,t[3]=i),i}function Ve(e){if(!e)return`No push events observed yet.`;let t=[`last #${e.highestSequence??`—`}`,`${e.eventCount} events`,`${e.snapshotCount} snapshots`];return e.gapCount>0?t.push(`${e.gapCount} gap${e.gapCount===1?``:`s`}`):t.push(`no gaps`),t.join(` · `)}function He(e){let t=(0,q.c)(25),{environmentId:n,record:r,runtime:i,pushSequence:a}=e,o=i?.connectionState??`disconnected`,s=r?.label??n,c=Le(a),l=Re[o]??`bg-muted-foreground/40`,u;t[0]===l?u=t[1]:(u=(0,Q.jsx)(Be,{className:l}),t[0]=l,t[1]=u);let d;t[2]!==s||t[3]!==u?(d=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[u,s]}),t[2]=s,t[3]=u,t[4]=d):d=t[4];let p=i?.authState?` · auth ${i.authState}`:``,m=i?.role?` · ${i.role}`:``,h;t[5]!==o||t[6]!==p||t[7]!==m?(h=(0,Q.jsxs)(`span`,{className:`block`,children:[`WS `,o,p,m]}),t[5]=o,t[6]=p,t[7]=m,t[8]=h):h=t[8];let g=c?`text-warning`:`text-muted-foreground/70`,_;t[9]===g?_=t[10]:(_=f(`block`,g),t[9]=g,t[10]=_);let v;t[11]===a?v=t[12]:(v=Ve(a),t[11]=a,t[12]=v);let y;t[13]!==_||t[14]!==v?(y=(0,Q.jsx)(`span`,{className:_,children:v}),t[13]=_,t[14]=v,t[15]=y):y=t[15];let b;t[16]===i?b=t[17]:(b=i?.lastError?(0,Q.jsx)(`span`,{className:`block break-all text-destructive`,children:i.lastError}):null,t[16]=i,t[17]=b);let x;t[18]!==y||t[19]!==b||t[20]!==h?(x=(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[h,y,b]}),t[18]=y,t[19]=b,t[20]=h,t[21]=x):x=t[21];let S;return t[22]!==x||t[23]!==d?(S=(0,Q.jsx)(W,{title:d,description:x}),t[22]=x,t[23]=d,t[24]=S):S=t[24],S}function Ue(e){let t=(0,q.c)(59),{snapshot:r}=e,i=v(Xe),a=m(Ye),o=u(Je),s=h(),l=S(),f=y(),p=_(),g;t[0]!==l||t[1]!==s?(g=s?s.serverConfig?.providers??[]:l,t[0]=l,t[1]=s,t[2]=g):g=t[2];let w=g,T=r?.observability??(s?s.serverConfig?.observability??null:f),O;t[3]!==p||t[4]!==s?(O=s?s.serverConfig?.availableEditors??[]:p,t[3]=p,t[4]=s,t[5]=O):O=t[5];let k=O,A=r?.performance?.local??null,[j,M]=(0,K.useState)(!1),N;t[6]!==A||t[7]!==T?(N=T?{...T,...A?{localMetrics:A}:{}}:null,t[6]=A,t[7]=T,t[8]=N):N=t[8];let P=N,F;t[9]!==o||t[10]!==i||t[11]!==a?(F=[...new Set([...Object.keys(i),...Object.keys(a),...Object.keys(o)])].toSorted(),t[9]=o,t[10]=i,t[11]=a,t[12]=F):F=t[12];let I=F,L;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(L={onCopy:qe,onError:Ke},t[13]=L):L=t[13];let{copyToClipboard:te,isCopied:z}=d(L),B;t[14]!==te||t[15]!==I||t[16]!==P||t[17]!==w||t[18]!==o||t[19]!==i||t[20]!==a||t[21]!==r?.performance?(B=()=>{let e=Fe({generatedAt:new Date().toISOString(),app:{version:E,stage:C,isElectron:n,userAgent:typeof navigator>`u`?null:navigator.userAgent},environments:I.map(e=>({environmentId:e,record:i[e]??null,runtime:a[e]??null,pushSequence:o[e]??null})),providers:w,observability:P,performance:r?.performance??null});te(Ie(e),void 0)},t[14]=te,t[15]=I,t[16]=P,t[17]=w,t[18]=o,t[19]=i,t[20]=a,t[21]=r?.performance,t[22]=B):B=t[22],r?.performance;let re=B,V=T?.logsDirectoryPath??null,U;t[23]!==k||t[24]!==V||t[25]!==s?(U=()=>{if(!V)return;M(!0);let e=ne(k??[]);if(!e){M(!1),c.add(R({type:`error`,title:`Could not open logs folder`,description:`No available editors found.`}));return}(s?x(s.environmentId)?.client.shell.openInEditor({cwd:V,editor:e})??Promise.reject(Error(`Selected environment is disconnected.`)):b().shell.openInEditor(V,e)).catch(Ge).finally(()=>{M(!1)})},t[23]=k,t[24]=V,t[25]=s,t[26]=U):U=t[26];let G=U,ae;t[27]===z?ae=t[28]:(ae=z?(0,Q.jsx)(ie,{className:`size-3.5`}):(0,Q.jsx)(ee,{className:`size-3.5`}),t[27]=z,t[28]=ae);let oe=z?`Copied`:`Copy debug bundle`,se;t[29]!==re||t[30]!==ae||t[31]!==oe?(se=(0,Q.jsxs)(D,{size:`xs`,variant:`outline`,onClick:re,children:[ae,oe]}),t[29]=re,t[30]=ae,t[31]=oe,t[32]=se):se=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(W,{title:`Application`,description:`Version ${E} · ${C}${n?` · Desktop`:` · Browser`}`}),t[33]=ce):ce=t[33];let le=V??`Resolving logs directory…`,ue=!V||j,J=j?`Opening…`:`Open logs folder`,Y;t[34]!==G||t[35]!==ue||t[36]!==J?(Y=(0,Q.jsx)(D,{size:`xs`,variant:`outline`,disabled:ue,onClick:G,children:J}),t[34]=G,t[35]=ue,t[36]=J,t[37]=Y):Y=t[37];let X;t[38]!==le||t[39]!==Y?(X=(0,Q.jsx)(W,{title:`Logs`,description:le,control:Y}),t[38]=le,t[39]=Y,t[40]=X):X=t[40];let Z;t[41]!==se||t[42]!==X?(Z=(0,Q.jsxs)(H,{title:`Diagnostics`,headerAction:se,children:[ce,X]}),t[41]=se,t[42]=X,t[43]=Z):Z=t[43];let de;t[44]!==I||t[45]!==o||t[46]!==i||t[47]!==a?(de=I.length===0?(0,Q.jsx)(W,{title:`No environments`,description:`No environment connections are tracked yet.`}):I.map(e=>(0,Q.jsx)(He,{environmentId:e,record:i[e]??null,runtime:a[e]??null,pushSequence:o[e]??null},e)),t[44]=I,t[45]=o,t[46]=i,t[47]=a,t[48]=de):de=t[48];let fe;t[49]===de?fe=t[50]:(fe=(0,Q.jsx)(H,{title:`Environments`,children:de}),t[49]=de,t[50]=fe);let pe;t[51]===w?pe=t[52]:(pe=w.length===0?(0,Q.jsx)(W,{title:`No providers`,description:`No provider instances are configured.`}):w.map(We),t[51]=w,t[52]=pe);let me;t[53]===pe?me=t[54]:(me=(0,Q.jsx)(H,{title:`Providers`,children:pe}),t[53]=pe,t[54]=me);let he;return t[55]!==Z||t[56]!==fe||t[57]!==me?(he=(0,Q.jsxs)(Q.Fragment,{children:[Z,fe,me]}),t[55]=Z,t[56]=fe,t[57]=me,t[58]=he):he=t[58],he}function We(e){let t=e.unavailableReason??e.message??null;return(0,Q.jsx)(W,{title:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(Be,{className:ze[e.status]??`bg-muted-foreground/40`}),e.displayName??e.instanceId]}),description:(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[(0,Q.jsxs)(`span`,{className:`block`,children:[e.status,` · auth `,e.auth.status,e.version?` · v${e.version}`:``]}),t?(0,Q.jsx)(`span`,{className:`block break-all text-muted-foreground/70`,children:t}):null]})},e.instanceId)}function Ge(e){c.add(R({type:`error`,title:`Could not open logs folder`,description:e instanceof Error?e.message:`Failed to open logs folder.`}))}function Ke(e){c.add(R({type:`error`,title:`Could not copy debug bundle`,description:e.message}))}function qe(){c.add({type:`success`,title:`Debug bundle copied`,description:`Secrets are redacted before export.`})}function Je(e){return e.byEnvironment}function Ye(e){return e.byId}function Xe(e){return e.byId}var Ze=[{method:`thread/snapshot`,requestId:`req_9f2c81d4a6`,startedAt:`12s ago`},{method:`git/status`,requestId:`req_c07b3e51fd`,startedAt:`9s ago`}];function Qe(e){c.update(e,{type:`loading`,title:`Updating Claude Code`,description:`Running provider update command.`,timeout:0,actionProps:void 0,data:{hideCopyButton:!0}}),window.setTimeout(()=>{c.update(e,{type:`success`,title:`Provider updated`,description:`New sessions will use the updated provider.`,timeout:0,data:{hideCopyButton:!0,dismissAfterVisibleMs:3e3}})},1800)}var $e=[{value:`provider-update`,label:`Provider update available`,fire:()=>{let e=c.add(R({type:`warning`,title:`Update Available: Claude Code v2.1.4`,description:`Install the update now or review provider settings.`,timeout:0,actionProps:{children:`Update`,onClick:()=>Qe(e)},actionVariant:`default`,data:{hideCopyButton:!0,secondaryActionProps:{children:`Settings`,onClick:()=>o.getState().openSettings(`providers`)},secondaryActionVariant:`outline`}}))}},{value:`pr-checks-passed`,label:`PR checks passed`,fire:()=>{c.add({type:`success`,title:`Checks passed for PR #316`,description:`Redesign the notification toasts · 3273af68e412`,timeout:6e3,actionProps:{children:`Open PR`,onClick:()=>void 0},data:{actionVariant:`outline`}})}},{value:`git-push`,label:`Git push with follow-up action`,fire:()=>{c.add(R({type:`success`,title:`Pushed`,description:`3 commits pushed to origin/feat/notifications-toasts.`,timeout:0,actionProps:{children:`Open PR`,onClick:()=>void 0},actionVariant:`outline`,data:{dismissAfterVisibleMs:1e4}}))}},{value:`git-failed`,label:`Git action failed`,fire:()=>{c.add(R({type:`error`,title:`Action failed`,description:`remote: Permission to sak0a/ryco.git denied to deploy-bot.
2
2
  fatal: unable to access 'https://github.com/sak0a/ryco.git/': The requested URL returned error: 403`,timeout:0}))}},{value:`git-pull`,label:`Git pull (loading → result)`,fire:()=>{c.promise(new Promise(e=>{window.setTimeout(e,2400)}),{loading:{title:`Pulling...`},success:{title:`Pulled`,description:`Updated main from origin/main.`},error:{title:`Pull failed`,description:`Could not fast-forward.`}})}},{value:`slow-requests`,label:`Slow requests (expandable)`,fire:()=>{c.add({type:`warning`,title:`Some requests are slow`,description:`2 requests waiting longer than 5s.`,timeout:0,data:{expandableDescriptionTrigger:!0,expandableLabels:{expand:`Show requests`,collapse:`Hide requests`},expandableContent:(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:Ze.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1 py-0.5 font-mono text-[10px]`,children:e.method}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground`,children:e.requestId}),(0,Q.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground`,children:e.startedAt})]},e.requestId))})}})}},{value:`reconnected`,label:`Connection restored`,fire:()=>{c.add({type:`success`,title:`Reconnected to Ryco Server`,description:`Connection restored at ${new Date().toLocaleTimeString()}.`,timeout:0,data:{dismissAfterVisibleMs:8e3,hideCopyButton:!0}})}},{value:`long-error`,label:`Error with long details`,fire:()=>{c.add({type:`error`,title:`Provider session crashed`,description:`The provider session exited unexpectedly with code 137 while processing the turn. Last stderr output: FATAL ERROR: Reached heap limit — allocation failed, JavaScript heap out of memory. Restart the session or reduce the attached context, then try again.`,timeout:0})}}],et=[`pr-checks-passed`,`provider-update`,`git-failed`];function tt(){et.forEach((e,t)=>{let n=$e.find(t=>t.value===e);n&&window.setTimeout(()=>n.fire(),t*350)})}function nt(){let e=(0,q.c)(17),[t,n]=(0,K.useState)($e[0]?.value??``),r;e[0]===t?r=e[1]:(r=$e.find(e=>e.value===t)??$e[0],e[0]=t,e[1]=r);let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{typeof e==`string`&&n(e)},e[2]=a):a=e[2];let o=i?.label,s;e[3]===o?s=e[4]:(s=(0,Q.jsx)(N,{className:`w-full sm:w-56`,"aria-label":`Notification sample`,children:(0,Q.jsx)(A,{children:o})}),e[3]=o,e[4]=s);let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(M,{align:`end`,alignItemWithTrigger:!1,children:$e.map(rt)}),e[5]=c):c=e[5];let l;e[6]!==t||e[7]!==s?(l=(0,Q.jsxs)(j,{value:t,onValueChange:a,children:[s,c]}),e[6]=t,e[7]=s,e[8]=l):l=e[8];let u;e[9]===i?u=e[10]:(u=(0,Q.jsx)(D,{"aria-label":`Show test notification`,size:`xs`,onClick:()=>i?.fire(),children:`Show`}),e[9]=i,e[10]=u);let d;e[11]!==l||e[12]!==u?(d=(0,Q.jsx)(W,{title:`Test notification`,description:`Preview the notification design with realistic samples. Nothing is sent or changed.`,control:(0,Q.jsxs)(`div`,{className:`flex w-full items-center gap-2 sm:w-auto`,children:[l,u]})}),e[11]=l,e[12]=u,e[13]=d):d=e[13];let f;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(W,{title:`Notification stack`,description:`Fire a short burst to preview stacking, peeking, and hover expansion.`,control:(0,Q.jsx)(D,{size:`xs`,variant:`outline`,onClick:tt,children:`Show stack`})}),e[14]=f):f=e[14];let p;return e[15]===d?p=e[16]:(p=(0,Q.jsxs)(H,{title:`Notifications`,children:[d,f]}),e[15]=d,e[16]=p),p}function rt(e){return(0,Q.jsx)(k,{hideIndicator:!0,value:e.value,children:e.label},e.value)}var it=5e3;function at(e){let t=(0,q.c)(33),{points:n,formatValue:r}=e,i;bb0:{if(n.length===0){i=``;break bb0}let e;t[0]===n?e=t[1]:(e=Math.max(...n.map(ot),1),t[0]=n,t[1]=e);let r=e,a;if(t[2]!==r||t[3]!==n){let e;t[5]!==r||t[6]!==n.length?(e=(e,t)=>{let i=n.length===1?320:t/(n.length-1)*320,a=96-e.value/r*84-6;return`${t===0?`M`:`L`}${i.toFixed(2)},${a.toFixed(2)}`},t[5]=r,t[6]=n.length,t[7]=e):e=t[7],a=n.map(e).join(` `),t[2]=r,t[3]=n,t[4]=a}else a=t[4];i=a}let a=i,o,s,c,l,u;if(t[8]!==r||t[9]!==n){let e=n.at(-1)?.value??0;u=`min-w-0`,c=`mb-2 flex items-baseline justify-between gap-3`,t[15]===n.length?l=t[16]:(l=(0,Q.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:[n.length,` samples`]}),t[15]=n.length,t[16]=l),o=`font-mono text-xs text-foreground`,s=r(e),t[8]=r,t[9]=n,t[10]=o,t[11]=s,t[12]=c,t[13]=l,t[14]=u}else o=t[10],s=t[11],c=t[12],l=t[13],u=t[14];let d;t[17]!==o||t[18]!==s?(d=(0,Q.jsx)(`span`,{className:o,children:s}),t[17]=o,t[18]=s,t[19]=d):d=t[19];let f;t[20]!==c||t[21]!==l||t[22]!==d?(f=(0,Q.jsxs)(`div`,{className:c,children:[l,d]}),t[20]=c,t[21]=l,t[22]=d,t[23]=f):f=t[23];let p;t[24]===a?p=t[25]:(p=(0,Q.jsx)(`path`,{d:a,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,vectorEffect:`non-scaling-stroke`}),t[24]=a,t[25]=p);let m;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(`line`,{x1:`0`,y1:95,x2:320,y2:95,className:`stroke-border`}),t[26]=m):m=t[26];let h;t[27]===p?h=t[28]:(h=(0,Q.jsxs)(`svg`,{viewBox:`0 0 320 96`,className:`h-24 w-full overflow-visible text-info`,role:`img`,"aria-label":`Diagnostics history chart`,children:[p,m]}),t[27]=p,t[28]=h);let g;return t[29]!==h||t[30]!==u||t[31]!==f?(g=(0,Q.jsxs)(`div`,{className:u,children:[f,h]}),t[29]=h,t[30]=u,t[31]=f,t[32]=g):g=t[32],g}function ot(e){return e.value}function st(e){let t=(0,q.c)(12),{points:n,formatValue:r}=e,i=r===void 0?String:r,a;t[0]===n?a=t[1]:(a=Math.max(...n.map(ct),1),t[0]=n,t[1]=a);let o=a;if(n.length===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No data yet.`}),t[2]=e):e=t[2],e}let s;if(t[3]!==i||t[4]!==o||t[5]!==n){let e;t[7]!==i||t[8]!==o?(e=e=>(0,Q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_5rem] items-center gap-3 px-4 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`mb-1 truncate text-[12px] font-medium`,children:e.label}),(0,Q.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-info`,style:{width:`${Math.max(4,e.value/o*100)}%`}})})]}),(0,Q.jsx)(`div`,{className:`text-right font-mono text-[11px] text-muted-foreground`,children:i(e.value)})]},e.label),t[7]=i,t[8]=o,t[9]=e):e=t[9],s=n.map(e),t[3]=i,t[4]=o,t[5]=n,t[6]=s}else s=t[6];let c;return t[10]===s?c=t[11]:(c=(0,Q.jsx)(`div`,{className:`divide-y divide-border/60`,children:s}),t[10]=s,t[11]=c),c}function ct(e){return e.value}function $(e){let t=(0,q.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`div`,{className:`truncate text-[11px] font-medium text-muted-foreground uppercase tracking-[0.08em]`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-[15px] font-semibold text-foreground`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,Q.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,Q.jsxs)(`div`,{className:`min-w-0 border-border/60 border-t px-4 py-3 first:border-t-0 sm:px-5`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function lt(e){let t=(0,q.c)(12),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`div`,{className:`text-[12px] font-medium text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(`div`,{className:`font-mono text-[12px] text-foreground`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:i}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(`div`,{className:`grid gap-1 border-border/60 border-t px-4 py-3 first:border-t-0 sm:grid-cols-[11rem_minmax(0,1fr)] sm:px-5`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function ut(e){let t=(0,q.c)(5),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`summary`,{className:`cursor-pointer select-none text-[11px] text-muted-foreground hover:text-foreground`,children:`raw`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=JSON.stringify(n,null,2),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,Q.jsxs)(`details`,{className:`group`,children:[r,(0,Q.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto rounded-md bg-muted/60 p-3 text-[11px] leading-relaxed`,children:i})]}),t[3]=i,t[4]=a),a}function dt(e){let t=(0,q.c)(8),{spans:n,showTraceId:r}=e,i=r!==void 0&&r;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No spans retained yet.`}),t[0]=e):e=t[0],e}let a;if(t[1]!==i||t[2]!==n){let e;t[4]===i?e=t[5]:(e=e=>(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-3 sm:grid-cols-[minmax(0,1fr)_6rem_5rem] sm:items-start`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.name}),(0,Q.jsx)(P,{size:`sm`,variant:ue(e.status)?`error`:`outline`,children:e.status})]}),(0,Q.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:[e.source,` / `,e.kind,` / `,e.spanId]}),i?(0,Q.jsx)(ye,{value:e.traceId}):null,e.failureMessage&&ue(e.status)?(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-[11px] text-destructive`,children:e.failureMessage}):null,(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ut,{value:e})})]}),(0,Q.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground sm:text-right`,children:Y(e.durationMs)}),(0,Q.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground sm:text-right`,children:Z(e.endTime)})]},e.id),t[4]=i,t[5]=e),a=n.slice(0,10).map(e),t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[6]===a?o=t[7]:(o=(0,Q.jsx)(`div`,{className:`divide-y divide-border/60`,children:a}),t[6]=a,t[7]=o),o}function ft(e){let t=(0,q.c)(9),{memorySeries:n,cpuSeries:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`div`,{className:`mb-1 text-[12px] font-semibold`,children:`RSS memory`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Q.jsxs)(`div`,{className:`min-w-0 p-4`,children:[i,(0,Q.jsx)(at,{points:n,formatValue:J})]}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`div`,{className:`mb-1 text-[12px] font-semibold`,children:`CPU utilization`}),t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,Q.jsxs)(`div`,{className:`min-w-0 p-4`,children:[o,(0,Q.jsx)(at,{points:r,formatValue:pt})]}),t[4]=r,t[5]=s);let c;return t[6]!==a||t[7]!==s?(c=(0,Q.jsx)(H,{title:`Resource history`,children:(0,Q.jsxs)(`div`,{className:`grid gap-0 divide-y divide-border/60 lg:grid-cols-2 lg:divide-x lg:divide-y-0`,children:[a,s]})}),t[6]=a,t[7]=s,t[8]=c):c=t[8],c}function pt(e){return`${e.toFixed(1)}%`}function mt(e){let t=(0,q.c)(26),{snapshot:n,showTraceId:r}=e,i=r!==void 0&&r,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Top span names`}),t[0]=a):a=t[0];let o;t[1]===n?.tracing.topSpanNames?o=t[2]:(o=n?.tracing.topSpanNames??[],t[1]=n?.tracing.topSpanNames,t[2]=o);let s;t[3]===o?s=t[4]:(s=me(o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,Q.jsx)(st,{points:s})]}),t[5]=s,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Duration buckets`}),t[7]=l):l=t[7];let u;t[8]===n?.tracing.durationBuckets?u=t[9]:(u=n?.tracing.durationBuckets??[],t[8]=n?.tracing.durationBuckets,t[9]=u);let d;t[10]===u?d=t[11]:(d=pe(u),t[10]=u,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[l,(0,Q.jsx)(st,{points:d})]}),t[12]=d,t[13]=f);let p;t[14]!==c||t[15]!==f?(p=(0,Q.jsxs)(`div`,{className:`grid gap-0 divide-y divide-border/60 lg:grid-cols-2 lg:divide-x lg:divide-y-0`,children:[c,f]}),t[14]=c,t[15]=f,t[16]=p):p=t[16];let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Slowest spans`}),t[17]=m):m=t[17];let h;t[18]===n?.tracing.slowestSpans?h=t[19]:(h=n?.tracing.slowestSpans??[],t[18]=n?.tracing.slowestSpans,t[19]=h);let g;t[20]!==i||t[21]!==h?(g=(0,Q.jsxs)(`div`,{className:`border-border/60 border-t`,children:[m,(0,Q.jsx)(dt,{spans:h,showTraceId:i})]}),t[20]=i,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==p||t[24]!==g?(_=(0,Q.jsxs)(H,{title:`Tracing diagnostics`,children:[p,g]}),t[23]=p,t[24]=g,t[25]=_):_=t[25],_}function ht(e){let t=(0,q.c)(10),{snapshot:n,nowMs:r}=e,i;if(t[0]!==r||t[1]!==n?.failures.latest){let e;t[3]===r?e=t[4]:(e=e=>(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-3 sm:grid-cols-[minmax(0,1fr)_6rem]`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(P,{size:`sm`,variant:`error`,children:e.category}),(0,Q.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.message})]}),(0,Q.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:[e.source,` / `,e.signature]}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ut,{value:e.raw??e})})]}),(0,Q.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground sm:text-right`,children:Z(e.occurredAt,r)})]},e.id),t[3]=r,t[4]=e),i=(n?.failures.latest??[]).slice(0,8).map(e),t[0]=r,t[1]=n?.failures.latest,t[2]=i}else i=t[2];let a;t[5]===n?a=t[6]:(a=n&&n.failures.latest.length===0?(0,Q.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No failures retained.`}):null,t[5]=n,t[6]=a);let o;return t[7]!==i||t[8]!==a?(o=(0,Q.jsx)(H,{title:`Failures`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-border/60`,children:[i,a]})}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function gt(e){let t=(0,q.c)(27),{snapshot:n,slowRpcAcks:r,nowMs:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Providers`}),t[0]=a):a=t[0];let o;t[1]===n?.liveProcesses.providers?o=t[2]:(o=n?.liveProcesses.providers??[],t[1]=n?.liveProcesses.providers,t[2]=o);let s;t[3]===o?s=t[4]:(s=o.map(vt),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,Q.jsx)(`div`,{className:`divide-y divide-border/60`,children:s})]}),t[5]=s,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Terminals and slow RPCs`}),t[7]=l):l=t[7];let u;t[8]===n?.liveProcesses.terminals?u=t[9]:(u=n?.liveProcesses.terminals??[],t[8]=n?.liveProcesses.terminals,t[9]=u);let d;t[10]===u?d=t[11]:(d=u.map(_t),t[10]=u,t[11]=d);let f;if(t[12]!==i||t[13]!==r){let e;t[15]===i?e=t[16]:(e=e=>(0,Q.jsxs)(`div`,{className:`px-4 py-2.5`,children:[(0,Q.jsx)(`div`,{className:`truncate text-[13px] font-medium`,children:e.tag}),(0,Q.jsxs)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:[`slow ack / `,Z(e.startedAt,i)]})]},e.requestId),t[15]=i,t[16]=e),f=r.map(e),t[12]=i,t[13]=r,t[14]=f}else f=t[14];let p;t[17]!==r.length||t[18]!==n?.liveProcesses.terminals.length?(p=(n?.liveProcesses.terminals.length??0)===0&&r.length===0?(0,Q.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No live terminal or slow RPC activity.`}):null,t[17]=r.length,t[18]=n?.liveProcesses.terminals.length,t[19]=p):p=t[19];let m;t[20]!==d||t[21]!==f||t[22]!==p?(m=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[l,(0,Q.jsxs)(`div`,{className:`divide-y divide-border/60`,children:[d,f,p]})]}),t[20]=d,t[21]=f,t[22]=p,t[23]=m):m=t[23];let h;return t[24]!==m||t[25]!==c?(h=(0,Q.jsx)(H,{title:`Live activity`,children:(0,Q.jsxs)(`div`,{className:`grid gap-0 divide-y divide-border/60 lg:grid-cols-2 lg:divide-x lg:divide-y-0`,children:[c,m]})}),t[24]=m,t[25]=c,t[26]=h):h=t[26],h}function _t(e){return(0,Q.jsxs)(`div`,{className:`px-4 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.terminalId}),(0,Q.jsx)(P,{size:`sm`,variant:e.status===`error`?`error`:`outline`,children:e.status})]}),(0,Q.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:[`pid `,e.pid??`n/a`,` / subprocess`,` `,e.hasRunningSubprocess?`yes`:`no`]})]},`${e.threadId}:${e.terminalId}`)}function vt(e){return(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 px-4 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate text-[13px] font-medium`,children:e.displayName??e.instanceId}),(0,Q.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.driver})]}),(0,Q.jsx)(P,{size:`sm`,variant:e.status===`error`?`error`:e.status===`warning`?`warning`:`outline`,children:e.status})]},e.instanceId)}function yt(e){let t=(0,q.c)(57),{snapshot:n,memorySeries:r,cpuSeries:i,slowRpcAcks:a,latestFailure:o,nowMs:s}=e,c;t[0]===n?c=t[1]:(c=n?Y(n.uptimeMs):`n/a`,t[0]=n,t[1]=c);let l;t[2]!==s||t[3]!==n?(l=n?`Started ${Z(n.serverStartedAt,s)}`:void 0,t[2]=s,t[3]=n,t[4]=l):l=t[4];let u;t[5]!==c||t[6]!==l?(u=(0,Q.jsx)($,{label:`Uptime`,value:c,detail:l}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===n?d=t[9]:(d=n?J(n.resources.current.memory.rssBytes):`n/a`,t[8]=n,t[9]=d);let f;t[10]===n?f=t[11]:(f=n?`${J(n.resources.current.memory.heapUsedBytes)} heap used`:void 0,t[10]=n,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,Q.jsx)($,{label:`Memory`,value:d,detail:f}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]===n?m=t[16]:(m=n?X(n.resources.current.cpu.utilizationPercent):`n/a`,t[15]=n,t[16]=m);let h;t[17]===n?h=t[18]:(h=n?.resources.current.eventLoopDelayMs===void 0?void 0:`${Y(n.resources.current.eventLoopDelayMs)} event loop delay`,t[17]=n,t[18]=h);let g;t[19]!==m||t[20]!==h?(g=(0,Q.jsx)($,{label:`CPU`,value:m,detail:h}),t[19]=m,t[20]=h,t[21]=g):g=t[21];let _;t[22]===n?.liveProcesses.providers?_=t[23]:(_=n?.liveProcesses.providers.filter(bt).length??0,t[22]=n?.liveProcesses.providers,t[23]=_);let v=`${_} providers`,y=`${n?.liveProcesses.terminals.length??0} terminal sessions`,b;t[24]!==v||t[25]!==y?(b=(0,Q.jsx)($,{label:`Activity`,value:v,detail:y}),t[24]=v,t[25]=y,t[26]=b):b=t[26];let x=`${n?.tracing.retainedSpanCount??0} spans`,S=n?`${n.limits.fileTailBytes/1024} KB file tail`:void 0,C;t[27]!==x||t[28]!==S?(C=(0,Q.jsx)($,{label:`Tracing`,value:x,detail:S}),t[27]=x,t[28]=S,t[29]=C):C=t[29];let w;t[30]===o?w=t[31]:(w=(0,Q.jsx)($,{label:`Latest failure`,value:o}),t[30]=o,t[31]=w);let T;t[32]!==b||t[33]!==C||t[34]!==w||t[35]!==u||t[36]!==p||t[37]!==g?(T=(0,Q.jsx)(H,{title:`Overview`,children:(0,Q.jsxs)(`div`,{className:`grid sm:grid-cols-2 lg:grid-cols-3`,children:[u,p,g,b,C,w]})}),t[32]=b,t[33]=C,t[34]=w,t[35]=u,t[36]=p,t[37]=g,t[38]=T):T=t[38];let E;t[39]!==i||t[40]!==r?(E=(0,Q.jsx)(ft,{memorySeries:r,cpuSeries:i}),t[39]=i,t[40]=r,t[41]=E):E=t[41];let D;t[42]===n?D=t[43]:(D=(0,Q.jsx)(mt,{snapshot:n}),t[42]=n,t[43]=D);let O;t[44]!==s||t[45]!==n?(O=(0,Q.jsx)(ht,{snapshot:n,nowMs:s}),t[44]=s,t[45]=n,t[46]=O):O=t[46];let k;t[47]!==s||t[48]!==a||t[49]!==n?(k=(0,Q.jsx)(gt,{snapshot:n,slowRpcAcks:a,nowMs:s}),t[47]=s,t[48]=a,t[49]=n,t[50]=k):k=t[50];let A;return t[51]!==T||t[52]!==E||t[53]!==D||t[54]!==O||t[55]!==k?(A=(0,Q.jsxs)(Q.Fragment,{children:[T,E,D,O,k]}),t[51]=T,t[52]=E,t[53]=D,t[54]=O,t[55]=k,t[56]=A):A=t[56],A}function bt(e){return e.enabled}function xt(e){let t=(0,q.c)(14),{snapshot:n,error:r}=e;if(!r&&(!n||n.warnings.length===0))return null;let i=r?`error`:`warning`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(w,{}),t[0]=a):a=t[0];let o=r?`Diagnostics refresh failed`:`Diagnostics warnings`,s;t[1]===o?s=t[2]:(s=(0,Q.jsx)(B,{children:o}),t[1]=o,t[2]=s);let c;t[3]===r?c=t[4]:(c=r?(0,Q.jsx)(`span`,{children:r}):null,t[3]=r,t[4]=c);let l;t[5]===n?.warnings?l=t[6]:(l=n?.warnings.slice(0,4).map(St),t[5]=n?.warnings,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,Q.jsxs)(re,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==i||t[11]!==s||t[12]!==u?(d=(0,Q.jsxs)(V,{variant:i,children:[a,s,u]}),t[10]=i,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function St(e){return(0,Q.jsxs)(`span`,{children:[e.message,e.count?` (${e.count})`:``]},`${e.code}:${e.source??``}`)}function Ct(e){let t=(0,q.c)(4),{presentation:n}=e,r=n===void 0?`performance`:n,i=h();if(g()===`client`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(U,{children:[(0,Q.jsx)(nt,{}),null]}),t[0]=e):e=t[0],e}let a=i?.environmentId??`local`,o;return t[1]!==r||t[2]!==a?(o=(0,Q.jsx)(wt,{presentation:r},a),t[1]=r,t[2]=a,t[3]=o):o=t[3],o}function wt({presentation:e}){let t=h(),n=g(),[r,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!0),[d,p]=(0,K.useState)(!1),_=(0,K.useRef)(null),v=(0,K.useRef)(d);v.current=d;let y=T(),x=m(e=>e.byId),S=Date.now(),C=oe(i.serverGetDiagnosticsSnapshot),w=t?.environmentId,E=t?.nodeLabel,O=(0,K.useCallback)(async(e=!1)=>{await _.current?.()},[]);(0,K.useEffect)(()=>{if(o(null),c(null),u(!0),!C.allowed){c(C.reason),u(!1);return}let e=ce({fetch:async()=>{let e=w?a(w)?.server:b().server;if(!e)throw Error(`Diagnostics are unavailable on ${E??`this environment`}.`);return e.getDiagnosticsSnapshot()},onSuccess:e=>{o(e),c(null)},onError:e=>c(e instanceof Error?e.message:`Unable to refresh diagnostics.`),onLoading:u});_.current=e.refresh;let t=()=>{!v.current&&document.visibilityState===`visible`&&e.refresh()};t();let n=window.setInterval(t,it);return document.addEventListener(`visibilitychange`,t),()=>{e.dispose(),_.current=null,window.clearInterval(n),document.removeEventListener(`visibilitychange`,t)}},[w,E,C.allowed,C.reason]),(0,K.useEffect)(()=>{!d&&document.visibilityState===`visible`&&O()},[d,O]);let k=(0,K.useMemo)(()=>de(r?.resources.history??[]),[r]),A=(0,K.useMemo)(()=>fe(r?.resources.history??[]),[r]),j=r?he(r):`No snapshot`,M=r?.liveProcesses.providers.filter(e=>e.enabled).length??0,N=r?.liveProcesses.terminals.filter(e=>e.status===`starting`||e.status===`running`).length??0,P=Object.values(x),F=P.filter(e=>e.connectionState===`connected`).length,ee=P.filter(e=>e.connectionState===`connecting`).length,ne=P.length===0?`No tracked clients`:`${F} connected${ee>0?` · ${ee} connecting`:``}`,R=r?.tracing.slowestSpans.find(e=>e.source===`server`)??null,z=y[0]??null,B=r?.performance??null,re=B?.local.turnQuiescenceAvgMs??null,V=B?.local.checkpointDurationP95Ms??null,W=B?.local.latestThreadSnapshotDurationMs??null,G=B?.local.threadSnapshotDurationP95Ms??null;return(0,Q.jsxs)(U,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Diagnostics`}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:r?`Updated ${Z(r.generatedAt,S)}`:`Waiting for snapshot`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(D,{size:`xs`,variant:`outline`,onClick:()=>p(e=>!e),children:[d?(0,Q.jsx)(L,{className:`size-3.5`}):(0,Q.jsx)(I,{className:`size-3.5`}),d?`Resume`:`Pause`]}),(0,Q.jsxs)(D,{size:`xs`,variant:`outline`,onClick:()=>void O(!0),disabled:l,children:[(0,Q.jsx)(te,{className:f(`size-3.5`,l&&`animate-spin`)}),`Refresh`]})]})]}),(0,Q.jsx)(xt,{snapshot:r,error:s}),null,e===`phone-legacy`?(0,Q.jsx)(yt,{snapshot:r,memorySeries:k,cpuSeries:A,slowRpcAcks:y,latestFailure:j,nowMs:S}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_e,{telemetry:r?.telemetry,paused:d,refresh:O},`telemetry:${w??`local`}`),(0,Q.jsx)(ve,{snapshot:r,refresh:O},w??`local`),(0,Q.jsx)(Ce,{snapshot:r,nowMs:S}),(0,Q.jsx)(mt,{snapshot:r,showTraceId:!0}),(0,Q.jsx)(ht,{snapshot:r,nowMs:S}),(0,Q.jsx)(gt,{snapshot:r,slowRpcAcks:y,nowMs:S}),(0,Q.jsx)(H,{title:`Performance now`,children:(0,Q.jsxs)(`div`,{className:`grid sm:grid-cols-2 lg:grid-cols-3`,children:[(0,Q.jsx)($,{label:`Backend CPU`,value:r?X(r.resources.current.cpu.utilizationPercent):`n/a`,detail:r?`Process uptime ${Y(r.uptimeMs)}`:void 0}),(0,Q.jsx)($,{label:`RSS / heap`,value:r?J(r.resources.current.memory.rssBytes):`n/a`,detail:r?`${J(r.resources.current.memory.heapUsedBytes)} heap used`:void 0}),(0,Q.jsx)($,{label:`Event-loop delay`,value:r?.resources.current.eventLoopDelayMs===void 0?`n/a`:Y(r.resources.current.eventLoopDelayMs),detail:`Measured once for this requested snapshot`}),(0,Q.jsx)($,{label:`Providers / terminals`,value:`${M} enabled providers`,detail:`${N} active terminals`}),(0,Q.jsx)($,{label:`Turn quiescence`,value:re===null?`No samples`:Y(re),detail:`Rolling average`}),(0,Q.jsx)($,{label:`Checkpoint duration`,value:V===null?`No samples`:Y(V),detail:`Rolling p95`}),(0,Q.jsx)($,{label:`WebSocket state`,value:ne,detail:`${B?.local.wsReconnectCount??0} reconnects in this server process`}),(0,Q.jsx)($,{label:`Thread snapshot`,value:W===null?`No samples`:Y(W),detail:G===null?`Latest successful subscription snapshot`:`${Y(G)} rolling p95`}),(0,Q.jsx)($,{label:`Latest failure`,value:j})]})}),(0,Q.jsxs)(H,{title:`Why was this slow?`,children:[(0,Q.jsx)(lt,{label:`Thread snapshot`,value:W===null?`No thread snapshot timing yet`:`${Y(W)} latest`,detail:G===null?`Replay duration and payload bytes are not collected because the current transport has no zero-copy attribution hook.`:`${Y(G)} rolling p95. Replay duration and payload bytes are not collected because the current transport has no zero-copy attribution hook.`}),(0,Q.jsx)(lt,{label:`Queue pressure`,value:B?`${B.queues.runtimeDepthTotal+B.queues.liveBufferDepthTotal} queued now`:`No snapshot`,detail:B?`Largest runtime high-water ${B.queues.runtimeHighWaterMax}; live-buffer high-water ${B.queues.liveBufferHighWaterMax}; ${B.queues.liveBufferOverflowCount} overflows; replay depth ${B.queues.replayDepthMax}; replay lag ${B.queues.replayLagMax}; ${B.queues.providerLogDroppedRecords} provider log records dropped.`:`Runtime and replay queue evidence will appear after the first snapshot.`}),(0,Q.jsx)(lt,{label:`Slowest server stage`,value:R?`${R.name} · ${Y(R.durationMs)}`:`No retained spans`,detail:R?`Server span completed ${Z(R.endTime,S)}.`:`Tracing has not retained a server stage yet.`}),(0,Q.jsx)(lt,{label:`Current slow client RPC`,value:z?.tag??`No slow RPC acknowledgement in progress`,detail:z?`Exceeded its ${Y(z.thresholdMs)} acknowledgement threshold; started ${Z(z.startedAt,S)}.`:`Only RPCs that cross the existing client acknowledgement threshold appear here.`}),(0,Q.jsx)(lt,{label:`Reconnect / resume`,value:ne,detail:`${B?.local.wsReconnectCount??0} server-side reconnects. Per-environment push gaps and recovery state are in the Environments section.`}),(0,Q.jsx)(lt,{label:`Recent failure`,value:r?.failures.latest[0]?.message??`No retained failures`,detail:r?.failures.latest[0]?`${r.failures.latest[0].source} · ${Z(r.failures.latest[0].occurredAt,S)}`:`No failure evidence is available for the current server process.`}),(0,Q.jsx)(lt,{label:`Trace persistence`,value:B?.traceSink?`${J(B.traceSink.bufferedBytes)} buffered`:`Health unavailable`,detail:B?.traceSink?`${J(B.traceSink.maxBufferedBytes)} cap; ${B.traceSink.droppedRecords} dropped records; ${B.traceSink.writeFailures} write failures; retry delay ${Y(B.traceSink.retryDelayMs)}.`:`This diagnostics service is not attached to the local trace-file sink.`})]}),(0,Q.jsx)(ft,{memorySeries:k,cpuSeries:A}),(0,Q.jsx)(Ue,{snapshot:r}),n===`all`&&(0,Q.jsx)(nt,{}),null]})]})}export{Ct as DiagnosticsSettings};
@@ -1 +1 @@
1
- import{No as e,wo as t}from"./runtime-Djy96GJd.js";import{D as n}from"./usePopupViewport-kXU31P6l.js";import{r}from"./DialogViewport-DVDl03yd.js";var i=class extends n{constructor(){super(r(),`Dialog`,!1)}open(e){this.openByTrigger(e)}openWithPayload(n){let r=this.attachedStore;r!==null&&(r.set(`payload`,n),r.setOpen(!0,t(e)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function a(){return new i}export{a as n,i as t};
1
+ import{No as e,wo as t}from"./runtime-Bxg7k81u.js";import{D as n}from"./usePopupViewport-BcSIK_ph.js";import{r}from"./DialogViewport-Cz0OadGI.js";var i=class extends n{constructor(){super(r(),`Dialog`,!1)}open(e){this.openByTrigger(e)}openWithPayload(n){let r=this.attachedStore;r!==null&&(r.set(`payload`,n),r.setOpen(!0,t(e)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function a(){return new i}export{a as n,i as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{_l as n,ec as r,ms as i,us as a}from"./runtime-Djy96GJd.js";import{f as o,g as s}from"./usePopupViewport-kXU31P6l.js";import{p as c,s as l}from"./useScrollLock-DjMxrUJe.js";import{a as u,o as d,s as f}from"./DialogViewport-DVDl03yd.js";var p=e(t(),1),m=p.forwardRef(function(e,t){let{render:n,className:a,style:o,forceRender:s=!1,...c}=e,l=f(),u=l.useState(`open`),d=l.useState(`nested`),p=l.useState(`mounted`),m={open:u,transitionStatus:l.useState(`transitionStatus`)};return i(`div`,e,{state:m,ref:[l.context.backdropRef,t],stateAttributesMapping:r,props:[{role:`presentation`,hidden:!p,style:{userSelect:`none`,WebkitUserSelect:`none`}},c],enabled:s||!d})}),h=`--nested-dialogs`,g=n(),_=p.forwardRef(function(e,t){let{render:n,className:r,style:p,finalFocus:m,initialFocus:_,...v}=e,y=f(),b=y.useState(`descriptionElementId`),x=y.useState(`disablePointerDismissal`),S=y.useState(`floatingRootContext`),C=y.useState(`popupProps`),w=y.useState(`modal`),T=y.useState(`mounted`),E=y.useState(`nested`),D=y.useState(`nestedOpenDialogCount`),O=y.useState(`open`),k=y.useState(`openMethod`),A=y.useState(`titleElementId`),j=y.useState(`transitionStatus`),M=y.useState(`role`),N=S.useState(`floatingId`);d(),a({open:O,ref:y.context.popupRef,onComplete(){O&&y.context.onOpenChangeComplete?.(!0)}});let P=_===void 0?s(y.context.popupRef):_,F=D>0,I=y.useStateSetter(`popupElement`),L=i(`div`,e,{state:{open:O,nested:E,transitionStatus:j,nestedDialogOpen:F},props:[C,{id:N,"aria-labelledby":A,"aria-describedby":b,role:M,...o,hidden:!T,onKeyDown(e){l.has(e.key)&&e.stopPropagation()},style:{[h]:D}},v],ref:[t,y.context.popupRef,I],stateAttributesMapping:u});return(0,g.jsx)(c,{context:S,openInteractionType:k,disabled:!T,closeOnFocusOut:!x,initialFocus:P,returnFocus:m,modal:w!==!1,restoreFocus:`popup`,children:L})});export{m as n,_ as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{_l as n,ec as r,ms as i,us as a}from"./runtime-Bxg7k81u.js";import{f as o,g as s}from"./usePopupViewport-BcSIK_ph.js";import{p as c,s as l}from"./useScrollLock-BQf9VYJT.js";import{a as u,o as d,s as f}from"./DialogViewport-Cz0OadGI.js";var p=e(t(),1),m=p.forwardRef(function(e,t){let{render:n,className:a,style:o,forceRender:s=!1,...c}=e,l=f(),u=l.useState(`open`),d=l.useState(`nested`),p=l.useState(`mounted`),m={open:u,transitionStatus:l.useState(`transitionStatus`)};return i(`div`,e,{state:m,ref:[l.context.backdropRef,t],stateAttributesMapping:r,props:[{role:`presentation`,hidden:!p,style:{userSelect:`none`,WebkitUserSelect:`none`}},c],enabled:s||!d})}),h=`--nested-dialogs`,g=n(),_=p.forwardRef(function(e,t){let{render:n,className:r,style:p,finalFocus:m,initialFocus:_,...v}=e,y=f(),b=y.useState(`descriptionElementId`),x=y.useState(`disablePointerDismissal`),S=y.useState(`floatingRootContext`),C=y.useState(`popupProps`),w=y.useState(`modal`),T=y.useState(`mounted`),E=y.useState(`nested`),D=y.useState(`nestedOpenDialogCount`),O=y.useState(`open`),k=y.useState(`openMethod`),A=y.useState(`titleElementId`),j=y.useState(`transitionStatus`),M=y.useState(`role`),N=S.useState(`floatingId`);d(),a({open:O,ref:y.context.popupRef,onComplete(){O&&y.context.onOpenChangeComplete?.(!0)}});let P=_===void 0?s(y.context.popupRef):_,F=D>0,I=y.useStateSetter(`popupElement`),L=i(`div`,e,{state:{open:O,nested:E,transitionStatus:j,nestedDialogOpen:F},props:[C,{id:N,"aria-labelledby":A,"aria-describedby":b,role:M,...o,hidden:!T,onKeyDown(e){l.has(e.key)&&e.stopPropagation()},style:{[h]:D}},v],ref:[t,y.context.popupRef,I],stateAttributesMapping:u});return(0,g.jsx)(c,{context:S,openInteractionType:k,disabled:!T,closeOnFocusOut:!x,initialFocus:P,returnFocus:m,modal:w!==!1,restoreFocus:`popup`,children:L})});export{m as n,_ as t};
@@ -0,0 +1 @@
1
+ import{qc as e}from"./runtime-Bxg7k81u.js";import{n as t}from"./DialogViewport-Cz0OadGI.js";var n=e(function(e){return t(`dialog`,e)});export{n as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Oo as n,Yo as r,ms as i,wo as a}from"./runtime-Djy96GJd.js";import{s as o}from"./DialogViewport-DVDl03yd.js";import{t as s}from"./useBaseUiId-CJN4MvrU.js";var c=e(t(),1),l=c.forwardRef(function(e,t){let{render:s,className:c,style:l,disabled:u=!1,nativeButton:d=!0,...f}=e,p=o(),m=p.useState(`open`),{getButtonProps:h,buttonRef:g}=r({disabled:u,native:d}),_={disabled:u};function v(e){m&&p.setOpen(!1,a(n,e.nativeEvent))}return i(`button`,e,{state:_,ref:[t,g],props:[{onClick:v},f,h]})}),u=c.forwardRef(function(e,t){let{render:n,className:r,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`descriptionElementId`,d),i(`p`,e,{ref:t,props:[{id:d},l]})}),d=c.forwardRef(function(e,t){let{render:n,className:r,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`titleElementId`,d),i(`h2`,e,{ref:t,props:[{id:d},l]})});export{u as n,l as r,d as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Oo as n,Yo as r,ms as i,wo as a}from"./runtime-Bxg7k81u.js";import{s as o}from"./DialogViewport-Cz0OadGI.js";import{t as s}from"./useBaseUiId-OYaGjnkh.js";var c=e(t(),1),l=c.forwardRef(function(e,t){let{render:s,className:c,style:l,disabled:u=!1,nativeButton:d=!0,...f}=e,p=o(),m=p.useState(`open`),{getButtonProps:h,buttonRef:g}=r({disabled:u,native:d}),_={disabled:u};function v(e){m&&p.setOpen(!1,a(n,e.nativeEvent))}return i(`button`,e,{state:_,ref:[t,g],props:[{onClick:v},f,h]})}),u=c.forwardRef(function(e,t){let{render:n,className:r,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`descriptionElementId`,d),i(`p`,e,{ref:t,props:[{id:d},l]})}),d=c.forwardRef(function(e,t){let{render:n,className:r,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`titleElementId`,d),i(`h2`,e,{ref:t,props:[{id:d},l]})});export{u as n,l as r,d as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Jc as n,Yo as r,Zc as i,ms as a,nc as o,ss as s}from"./runtime-Djy96GJd.js";import{C as c,l}from"./usePopupViewport-kXU31P6l.js";import{F as u,M as d}from"./badge-Dg7mXiOh.js";import{s as f}from"./DialogViewport-DVDl03yd.js";import{t as p}from"./useBaseUiId-CJN4MvrU.js";var m=e(t(),1),h=n(function(e,t){let{render:n,className:h,style:g,disabled:_=!1,nativeButton:v=!0,id:y,payload:b,handle:x,...S}=e,C=f(!0),w=l(x)??C;if(!w)throw Error(i(79));let T=p(y),E=w.useState(`floatingRootContext`),D=w.useState(`isOpenedByTrigger`,T),O=w.useState(`triggerPopupId`,T),k=m.useRef(null),{registerTrigger:A,isMountedByThisTrigger:j}=c(T,k,w,{payload:b}),{getButtonProps:M,buttonRef:N}=r({disabled:_,native:v}),P=u(E),F=d(()=>w.select(`open`),e=>{w.set(`openMethod`,e)}),I={disabled:_,open:D},L=w.useState(`triggerProps`,j);return a(`button`,e,{state:I,ref:[N,t,A,k],props:[P.reference,L,F,{[s]:``,id:T,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":O},S,M],stateAttributesMapping:o})});export{h as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Jc as n,Yo as r,Zc as i,ms as a,nc as o,ss as s}from"./runtime-Bxg7k81u.js";import{C as c,l}from"./usePopupViewport-BcSIK_ph.js";import{F as u,M as d}from"./badge-DnBuGHGL.js";import{s as f}from"./DialogViewport-Cz0OadGI.js";import{t as p}from"./useBaseUiId-OYaGjnkh.js";var m=e(t(),1),h=n(function(e,t){let{render:n,className:h,style:g,disabled:_=!1,nativeButton:v=!0,id:y,payload:b,handle:x,...S}=e,C=f(!0),w=l(x)??C;if(!w)throw Error(i(79));let T=p(y),E=w.useState(`floatingRootContext`),D=w.useState(`isOpenedByTrigger`,T),O=w.useState(`triggerPopupId`,T),k=m.useRef(null),{registerTrigger:A,isMountedByThisTrigger:j}=c(T,k,w,{payload:b}),{getButtonProps:M,buttonRef:N}=r({disabled:_,native:v}),P=u(E),F=d(()=>w.select(`open`),e=>{w.set(`openMethod`,e)}),I={disabled:_,open:D},L=w.useState(`triggerProps`,j);return a(`button`,e,{state:I,ref:[N,t,A,k],props:[P.reference,L,F,{[s]:``,id:T,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":O},S,M],stateAttributesMapping:o})});export{h as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{$s as n,Gc as r,No as i,Qc as a,Zc as o,_l as s,lc as c,ms as l,ps as u,uo as d,vc as f,wo as p,xo as m,yc as h}from"./runtime-Djy96GJd.js";import{O as g,S as _,_ as v,b as y,d as b,i as x,p as S,u as C,v as w,x as T,y as E}from"./usePopupViewport-kXU31P6l.js";import{n as D,t as O}from"./useScrollLock-DjMxrUJe.js";var k=e(t(),1),A=k.createContext(void 0);function j(e){let t=k.useContext(A);if(!e&&t===void 0)throw Error(o(27));return t}var M=k.createContext(void 0);function N(){let e=k.useContext(M);if(e===void 0)throw Error(o(26));return e}var P=s(),F=`data-nested-dialog-open`,I={...n,...c,nestedDialogOpen(e){return e?{[F]:``}:null}},L=k.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=j(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,P.jsx)(M.Provider,{value:n,children:(0,P.jsxs)(m,{ref:t,...r,children:[a&&o===!0&&(0,P.jsx)(D,{ref:i.context.internalBackdropRef,inert:u(!s)}),e.children]})}):null});function R({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=k.useState(0),[d,p]=k.useState(0),m=l===0,_=g(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=h(t);if(m&&!i){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||f(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return O(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{u(e),p(t)}),a(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,d+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),y(e,{activeTriggerProps:_.reference,inactiveTriggerProps:_.trigger,popupProps:_.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var z={...b,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},B=class extends r{constructor(e,t,n){let r=new d,i=H(e,r,t,n);super(i,U(r),z)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(v(this.state,e,t.trigger)))}};function V(){let e=new d;return new x(Object.freeze(H(void 0,e)),Object.freeze(U(e)),z)}function H(e,t,n,r=!1){return{...C(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function U(e){return{popupRef:k.createRef(),backdropRef:k.createRef(),internalBackdropRef:k.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function W(e,t){let{children:n,open:r,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:m=null}=t,h=e===`drawer`,g=e===`alert-dialog`,v=g?!0:l,y=g||c,b=g?`alertdialog`:`dialog`,x=j(!0),C={modal:v,disablePointerDismissal:y,nested:x!=null,role:b},D=T((e,t)=>new B({open:a,openProp:r,activeTriggerId:m,triggerIdProp:f,...C},e,t),!0);D.useControlledProp(`openProp`,r),D.useControlledProp(`triggerIdProp`,f),D.useSyncedValues(C),D.useContextCallback(`onOpenChange`,o),D.useContextCallback(`onOpenChangeComplete`,s);let O=D.useState(`open`),M=D.useState(`mounted`),N=D.useState(`payload`);_(D,O),w(D);let{forceUnmount:F}=E(O,D);k.useImperativeHandle(u,()=>({unmount:F,close:()=>D.setOpen(!1,p(i))}),[F,D]);let I=O||M;return(0,P.jsxs)(A.Provider,{value:D,children:[d&&(0,P.jsx)(S,{handle:d,store:D}),I&&(0,P.jsx)(R,{store:D,parentContext:x?.context,isDrawer:h}),typeof n==`function`?n({payload:N}):n]})}var G=k.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=N(),c=j(),u=c.useState(`open`),d=c.useState(`nested`),f=c.useState(`transitionStatus`),p=c.useState(`nestedOpenDialogCount`),m=c.useState(`mounted`),h=c.useStateSetter(`viewportElement`);return l(`div`,e,{enabled:s||m,state:{open:u,nested:d,transitionStatus:f,nestedDialogOpen:p>0},ref:[t,h],stateAttributesMapping:I,props:[{role:`presentation`,hidden:!m,style:{pointerEvents:u?void 0:`none`},children:a},o]})});export{I as a,L as i,W as n,N as o,V as r,j as s,G as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{$s as n,Gc as r,No as i,Qc as a,Zc as o,_l as s,lc as c,ms as l,ps as u,uo as d,vc as f,wo as p,xo as m,yc as h}from"./runtime-Bxg7k81u.js";import{O as g,S as _,_ as v,b as y,d as b,i as x,p as S,u as C,v as w,x as T,y as E}from"./usePopupViewport-BcSIK_ph.js";import{n as D,t as O}from"./useScrollLock-BQf9VYJT.js";var k=e(t(),1),A=k.createContext(void 0);function j(e){let t=k.useContext(A);if(!e&&t===void 0)throw Error(o(27));return t}var M=k.createContext(void 0);function N(){let e=k.useContext(M);if(e===void 0)throw Error(o(26));return e}var P=s(),F=`data-nested-dialog-open`,I={...n,...c,nestedDialogOpen(e){return e?{[F]:``}:null}},L=k.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=j(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,P.jsx)(M.Provider,{value:n,children:(0,P.jsxs)(m,{ref:t,...r,children:[a&&o===!0&&(0,P.jsx)(D,{ref:i.context.internalBackdropRef,inert:u(!s)}),e.children]})}):null});function R({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=k.useState(0),[d,p]=k.useState(0),m=l===0,_=g(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=h(t);if(m&&!i){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||f(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return O(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{u(e),p(t)}),a(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,d+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),y(e,{activeTriggerProps:_.reference,inactiveTriggerProps:_.trigger,popupProps:_.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var z={...b,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},B=class extends r{constructor(e,t,n){let r=new d,i=H(e,r,t,n);super(i,U(r),z)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(v(this.state,e,t.trigger)))}};function V(){let e=new d;return new x(Object.freeze(H(void 0,e)),Object.freeze(U(e)),z)}function H(e,t,n,r=!1){return{...C(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function U(e){return{popupRef:k.createRef(),backdropRef:k.createRef(),internalBackdropRef:k.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function W(e,t){let{children:n,open:r,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:m=null}=t,h=e===`drawer`,g=e===`alert-dialog`,v=g?!0:l,y=g||c,b=g?`alertdialog`:`dialog`,x=j(!0),C={modal:v,disablePointerDismissal:y,nested:x!=null,role:b},D=T((e,t)=>new B({open:a,openProp:r,activeTriggerId:m,triggerIdProp:f,...C},e,t),!0);D.useControlledProp(`openProp`,r),D.useControlledProp(`triggerIdProp`,f),D.useSyncedValues(C),D.useContextCallback(`onOpenChange`,o),D.useContextCallback(`onOpenChangeComplete`,s);let O=D.useState(`open`),M=D.useState(`mounted`),N=D.useState(`payload`);_(D,O),w(D);let{forceUnmount:F}=E(O,D);k.useImperativeHandle(u,()=>({unmount:F,close:()=>D.setOpen(!1,p(i))}),[F,D]);let I=O||M;return(0,P.jsxs)(A.Provider,{value:D,children:[d&&(0,P.jsx)(S,{handle:d,store:D}),I&&(0,P.jsx)(R,{store:D,parentContext:x?.context,isDrawer:h}),typeof n==`function`?n({payload:N}):n]})}var G=k.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=N(),c=j(),u=c.useState(`open`),d=c.useState(`nested`),f=c.useState(`transitionStatus`),p=c.useState(`nestedOpenDialogCount`),m=c.useState(`mounted`),h=c.useStateSetter(`viewportElement`);return l(`div`,e,{enabled:s||m,state:{open:u,nested:d,transitionStatus:f,nestedDialogOpen:p>0},ref:[t,h],stateAttributesMapping:I,props:[{role:`presentation`,hidden:!m,style:{pointerEvents:u?void 0:`none`},children:a},o]})});export{I as a,L as i,W as n,N as o,V as r,j as s,G as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./primary-D_D7eLwT.js";import{Fr as r,Li as i,Nn as a,Vr as o,_l as s,fn as ee}from"./runtime-Djy96GJd.js";import{t as te}from"./useNavigate-cLfxn_9L.js";import{a as ne,d as re,f as ie,i as c,l as ae,m as oe,n as se,o as ce,p as le,r as ue,t as l,u as de}from"./ChatRightPanel-a6UOHNMm.js";import{k as fe}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as pe}from"./usePresentationTier-B_SCFvN7.js";import{o as u}from"./sidebar-DNnW-a2V.js";import{t as me}from"./useAppSidebarCollapsed-CaAsLi1q.js";import{_ as d,c as he,d as f,f as p,g as m,h,l as ge,m as g,p as _,v}from"./main-BbtLAX7M.js";var y=e(t(),1),b=s();function x({rawDraftId:e,search:t}){let s=te(),x=i.make(e),S=`draft:${x}`,_e=(0,y.useCallback)(e=>{s({to:`/draft/$draftId`,params:{draftId:x},replace:!0,search:e})},[x,s]),C=re({threadKey:S,search:t,replaceSearch:_e}),w=oe(x),T=a((0,y.useMemo)(()=>ee(w?.threadId??null),[w?.threadId])),ve=ae(T),E=(0,y.useMemo)(()=>w?.promotedTo?ve?w.promotedTo:null:T?{environmentId:T.environmentId,threadId:T.id}:null,[w?.promotedTo,T,ve]),D=C.diff===`1`,O=C.preview===`1`,k=he(C),A=ge(C),j=C.workspaceTab===`agent`&&C.workspaceAgentKey?C.workspaceAgentKey:null,ye=fe(de),M=pe(),N=E?`${E.environmentId}:${E.threadId}`:null,P=n(e=>N?e.pendingOpenByThreadKey[N]:void 0),F=n(e=>e.consumeOpenRequest),be=me(),{maximized:I,toggleMaximized:xe}=le({threadKey:x,open:A,canMaximize:!ye&&M!==`phone`}),[L,R]=(0,y.useState)(()=>({draftId:x,hasOpenedDiff:D,hasOpenedPreview:O,hasOpenedTerminal:k===`terminal`,hasOpenedSimulator:k===`simulator`,hasOpenedBrowser:k===`browser`,hasOpenedAgents:k===`agents`,openedAgentKeys:j?[j]:[]}));(0,y.useEffect)(()=>{E&&P&&M!==`phone`&&(F(E.environmentId,E.threadId),s({to:`/draft/$draftId`,params:{draftId:x},search:e=>m(e)}))},[E,F,x,s,P,M]);let z=L.draftId===x?L.hasOpenedDiff:D,B=L.draftId===x?L.hasOpenedPreview:O,V=L.draftId===x?L.hasOpenedTerminal:k===`terminal`,H=L.draftId===x?L.hasOpenedSimulator:k===`simulator`,U=L.draftId===x?L.hasOpenedBrowser:k===`browser`,W=L.draftId===x?L.hasOpenedAgents:k===`agents`,G=(0,y.useMemo)(()=>{let e=L.draftId===x?L.openedAgentKeys:j?[j]:[];return j&&!e.includes(j)?[...e,j]:e},[j,x,L]),[K,Se]=(0,y.useState)(()=>k??`files`),q=(0,y.useMemo)(()=>{let e=[];return(B||k===`files`)&&e.push(`files`),(z||k===`review`)&&e.push(`review`),(V||k===`terminal`)&&e.push(`terminal`),(H||k===`simulator`)&&e.push(`simulator`),(U||k===`browser`)&&e.push(`browser`),(W||k===`agents`)&&e.push(`agents`),e},[W,z,B,H,U,V,k]),J=(0,y.useCallback)(e=>{Se(e),R(t=>{let n={draftId:x,hasOpenedDiff:(t.draftId===x?t.hasOpenedDiff:D)||e===`review`,hasOpenedPreview:(t.draftId===x?t.hasOpenedPreview:O)||e===`files`,hasOpenedTerminal:(t.draftId===x?t.hasOpenedTerminal:k===`terminal`)||e===`terminal`,hasOpenedSimulator:(t.draftId===x?t.hasOpenedSimulator:k===`simulator`)||e===`simulator`,hasOpenedBrowser:(t.draftId===x?t.hasOpenedBrowser:k===`browser`)||e===`browser`,hasOpenedAgents:(t.draftId===x?t.hasOpenedAgents:k===`agents`)||e===`agents`,openedAgentKeys:t.draftId===x?t.openedAgentKeys:G};return t.draftId===n.draftId&&t.hasOpenedDiff===n.hasOpenedDiff&&t.hasOpenedPreview===n.hasOpenedPreview&&t.hasOpenedTerminal===n.hasOpenedTerminal&&t.hasOpenedSimulator===n.hasOpenedSimulator&&t.hasOpenedBrowser===n.hasOpenedBrowser&&t.hasOpenedAgents===n.hasOpenedAgents&&t.openedAgentKeys===n.openedAgentKeys?t:n})},[D,x,G,O,k]),Y=(0,y.useCallback)(()=>{s({to:`/draft/$draftId`,params:{draftId:x},search:e=>ue(e)})},[x,s]),X=(0,y.useCallback)(()=>{s({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let t=G[G.length-1];return K===`agent`&&t?f(e,t):K===`files`&&B?g(e):K===`review`&&z?h(e):K===`terminal`&&V?d(e):K===`simulator`&&H?m(e):K===`browser`&&U?_(e):K===`agents`&&W?p(e):B?g(e):z?h(e):V?d(e):H?m(e):U?_(e):W?p(e):t?f(e,t):v(e)}})},[x,W,z,B,H,U,V,K,s,G]),Z=(0,y.useCallback)(()=>{if(A){Y();return}X()},[Y,X,A]),Q=(0,y.useCallback)(e=>{if(e.mode===`agent`){let t=G.filter(t=>t!==e.agentKey);R(e=>({draftId:x,hasOpenedDiff:e.draftId===x?e.hasOpenedDiff:z,hasOpenedPreview:e.draftId===x?e.hasOpenedPreview:B,hasOpenedTerminal:e.draftId===x?e.hasOpenedTerminal:V,hasOpenedSimulator:e.draftId===x?e.hasOpenedSimulator:H,hasOpenedBrowser:e.draftId===x?e.hasOpenedBrowser:U,hasOpenedAgents:e.draftId===x?e.hasOpenedAgents:W,openedAgentKeys:t})),k===`agent`&&j===e.agentKey&&s({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let n=t[t.length-1];return n?f(e,n):B?g(e):z?h(e):V?d(e):H?m(e):U?_(e):W?p(e):v(e)}});return}let t=e.mode===`review`?!1:z||k===`review`,n=e.mode===`files`?!1:B||k===`files`,r=e.mode===`terminal`?!1:V||k===`terminal`,i=e.mode===`simulator`?!1:H||k===`simulator`,a=e.mode===`browser`?!1:U||k===`browser`,o=e.mode===`agents`?!1:W||k===`agents`;R(e=>{let s={draftId:x,hasOpenedDiff:t,hasOpenedPreview:n,hasOpenedTerminal:r,hasOpenedSimulator:i,hasOpenedBrowser:a,hasOpenedAgents:o,openedAgentKeys:e.draftId===x?e.openedAgentKeys:G};return e.draftId===s.draftId&&e.hasOpenedDiff===s.hasOpenedDiff&&e.hasOpenedPreview===s.hasOpenedPreview&&e.hasOpenedTerminal===s.hasOpenedTerminal&&e.hasOpenedSimulator===s.hasOpenedSimulator&&e.hasOpenedBrowser===s.hasOpenedBrowser&&e.hasOpenedAgents===s.hasOpenedAgents&&e.openedAgentKeys===s.openedAgentKeys?e:s}),k===e.mode&&s({to:`/draft/$draftId`,params:{draftId:x},search:s=>e.mode!==`files`&&n?g(s):e.mode!==`review`&&t?h(s):e.mode!==`terminal`&&r?d(s):e.mode!==`simulator`&&i?m(s):e.mode!==`browser`&&a?_(s):e.mode!==`agents`&&o?p(s):v(s)})},[j,x,W,z,B,H,U,V,s,G,k]);if((0,y.useEffect)(()=>{k!==null&&(Se(k),J(k))},[J,k]),(0,y.useEffect)(()=>{j&&R(e=>{let t=e.draftId===x?e.openedAgentKeys:[];return t.includes(j)?e.draftId===x?e:{draftId:x,hasOpenedDiff:z,hasOpenedPreview:B,hasOpenedTerminal:V,hasOpenedSimulator:H,hasOpenedBrowser:U,hasOpenedAgents:W,openedAgentKeys:t}:{draftId:x,hasOpenedDiff:e.draftId===x?e.hasOpenedDiff:D,hasOpenedPreview:e.draftId===x?e.hasOpenedPreview:O,hasOpenedTerminal:e.draftId===x?e.hasOpenedTerminal:k===`terminal`,hasOpenedSimulator:e.draftId===x?e.hasOpenedSimulator:k===`simulator`,hasOpenedBrowser:e.draftId===x?e.hasOpenedBrowser:k===`browser`,hasOpenedAgents:e.draftId===x?e.hasOpenedAgents:k===`agents`,openedAgentKeys:[...t,j]}})},[j,D,x,W,z,B,H,U,V,O,k]),(0,y.useEffect)(()=>{E&&(ie(S,`${E.environmentId}:${E.threadId}`),s({to:`/$environmentId/$threadId`,params:r(E),replace:!0}))},[E,s,S]),(0,y.useEffect)(()=>{w||E||s({to:`/`,replace:!0})},[E,w,s]),E)return(0,b.jsx)(u,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,b.jsx)(c,{environmentId:E.environmentId,threadId:E.threadId,routeKind:`server`})});if(!w)return null;let Ce=A||k===`review`||z||k===`files`||B||k===`terminal`||V||k===`simulator`||H||k===`browser`||U||k===`agents`||W||k===`agent`||G.length>0,we=A||k===`review`||z||k===`files`||B||k===`terminal`||V||k===`agent`||G.length>0,$=A?k:K;return M===`phone`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,b.jsx)(c,{draftId:x,environmentId:w.environmentId,threadId:w.threadId,onDiffPanelOpen:()=>J(`review`),onPreviewPanelOpen:()=>J(`files`),onTerminalPanelOpen:()=>J(`terminal`),onAgentPanelOpen:()=>J(`agent`),workspacePanelOpen:A,onToggleWorkspacePanel:Z,routeKind:`draft`})}),(0,b.jsx)(ce,{label:`Workspace`,open:A,onClose:Y,children:we?(0,b.jsx)(l,{mode:`phone`,panelMode:$,openedPanelModes:q,openedAgentKeys:G,onClosePanelTab:Q}):null})]}):ye?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,b.jsx)(c,{draftId:x,environmentId:w.environmentId,threadId:w.threadId,onDiffPanelOpen:()=>J(`review`),onPreviewPanelOpen:()=>J(`files`),onTerminalPanelOpen:()=>J(`terminal`),onAgentPanelOpen:()=>J(`agent`),workspacePanelOpen:A,onToggleWorkspacePanel:Z,routeKind:`draft`})}),(0,b.jsx)(ne,{open:A,onClose:Y,children:Ce?(0,b.jsx)(l,{mode:`sheet`,panelMode:$,openedPanelModes:q,openedAgentKeys:G,onClosePanelTab:Q}):null})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{className:o(`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,I&&`w-0 flex-none`),inert:I?!0:void 0,children:(0,b.jsx)(c,{draftId:x,environmentId:w.environmentId,threadId:w.threadId,onDiffPanelOpen:()=>J(`review`),onPreviewPanelOpen:()=>J(`files`),onTerminalPanelOpen:()=>J(`terminal`),onAgentPanelOpen:()=>J(`agent`),workspacePanelOpen:A,onToggleWorkspacePanel:Z,routeKind:`draft`})}),(0,b.jsx)(se,{open:A,panelMode:$,openedPanelModes:q,openedAgentKeys:G,onClosePanelTab:Q,onClose:Y,onOpen:X,renderContent:Ce,maximized:I,onToggleMaximized:xe,reserveChromeInset:I&&be})]})}export{x as DraftChatThreadRouteView};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./primary-CjhRI8fe.js";import{Fr as r,Li as i,Nn as a,Vr as o,_l as s,fn as ee}from"./runtime-Bxg7k81u.js";import{t as te}from"./useNavigate-DVi0rBlf.js";import{a as ne,d as re,f as ie,i as c,l as ae,m as oe,n as se,o as ce,p as le,r as ue,t as l,u as de}from"./ChatRightPanel-C1VD6GCV.js";import{D as fe}from"./ContextHandoffEndpointLabel-BSQOArMR.js";import{t as pe}from"./usePresentationTier-B_SCFvN7.js";import{o as u}from"./sidebar-BdvL1Pbj.js";import{t as me}from"./useAppSidebarCollapsed-wq6czkNJ.js";import{_ as d,c as he,d as f,f as p,g as m,h,l as ge,m as g,p as _,v}from"./main-CzDOnLFw.js";var y=e(t(),1),b=s();function x({rawDraftId:e,search:t}){let s=te(),x=i.make(e),S=`draft:${x}`,_e=(0,y.useCallback)(e=>{s({to:`/draft/$draftId`,params:{draftId:x},replace:!0,search:e})},[x,s]),C=re({threadKey:S,search:t,replaceSearch:_e}),w=oe(x),T=a((0,y.useMemo)(()=>ee(w?.threadId??null),[w?.threadId])),ve=ae(T),E=(0,y.useMemo)(()=>w?.promotedTo?ve?w.promotedTo:null:T?{environmentId:T.environmentId,threadId:T.id}:null,[w?.promotedTo,T,ve]),D=C.diff===`1`,O=C.preview===`1`,k=he(C),A=ge(C),j=C.workspaceTab===`agent`&&C.workspaceAgentKey?C.workspaceAgentKey:null,ye=fe(de),M=pe(),N=E?`${E.environmentId}:${E.threadId}`:null,P=n(e=>N?e.pendingOpenByThreadKey[N]:void 0),F=n(e=>e.consumeOpenRequest),be=me(),{maximized:I,toggleMaximized:xe}=le({threadKey:x,open:A,canMaximize:!ye&&M!==`phone`}),[L,R]=(0,y.useState)(()=>({draftId:x,hasOpenedDiff:D,hasOpenedPreview:O,hasOpenedTerminal:k===`terminal`,hasOpenedSimulator:k===`simulator`,hasOpenedBrowser:k===`browser`,hasOpenedAgents:k===`agents`,openedAgentKeys:j?[j]:[]}));(0,y.useEffect)(()=>{E&&P&&M!==`phone`&&(F(E.environmentId,E.threadId),s({to:`/draft/$draftId`,params:{draftId:x},search:e=>m(e)}))},[E,F,x,s,P,M]);let z=L.draftId===x?L.hasOpenedDiff:D,B=L.draftId===x?L.hasOpenedPreview:O,V=L.draftId===x?L.hasOpenedTerminal:k===`terminal`,H=L.draftId===x?L.hasOpenedSimulator:k===`simulator`,U=L.draftId===x?L.hasOpenedBrowser:k===`browser`,W=L.draftId===x?L.hasOpenedAgents:k===`agents`,G=(0,y.useMemo)(()=>{let e=L.draftId===x?L.openedAgentKeys:j?[j]:[];return j&&!e.includes(j)?[...e,j]:e},[j,x,L]),[K,Se]=(0,y.useState)(()=>k??`files`),q=(0,y.useMemo)(()=>{let e=[];return(B||k===`files`)&&e.push(`files`),(z||k===`review`)&&e.push(`review`),(V||k===`terminal`)&&e.push(`terminal`),(H||k===`simulator`)&&e.push(`simulator`),(U||k===`browser`)&&e.push(`browser`),(W||k===`agents`)&&e.push(`agents`),e},[W,z,B,H,U,V,k]),J=(0,y.useCallback)(e=>{Se(e),R(t=>{let n={draftId:x,hasOpenedDiff:(t.draftId===x?t.hasOpenedDiff:D)||e===`review`,hasOpenedPreview:(t.draftId===x?t.hasOpenedPreview:O)||e===`files`,hasOpenedTerminal:(t.draftId===x?t.hasOpenedTerminal:k===`terminal`)||e===`terminal`,hasOpenedSimulator:(t.draftId===x?t.hasOpenedSimulator:k===`simulator`)||e===`simulator`,hasOpenedBrowser:(t.draftId===x?t.hasOpenedBrowser:k===`browser`)||e===`browser`,hasOpenedAgents:(t.draftId===x?t.hasOpenedAgents:k===`agents`)||e===`agents`,openedAgentKeys:t.draftId===x?t.openedAgentKeys:G};return t.draftId===n.draftId&&t.hasOpenedDiff===n.hasOpenedDiff&&t.hasOpenedPreview===n.hasOpenedPreview&&t.hasOpenedTerminal===n.hasOpenedTerminal&&t.hasOpenedSimulator===n.hasOpenedSimulator&&t.hasOpenedBrowser===n.hasOpenedBrowser&&t.hasOpenedAgents===n.hasOpenedAgents&&t.openedAgentKeys===n.openedAgentKeys?t:n})},[D,x,G,O,k]),Y=(0,y.useCallback)(()=>{s({to:`/draft/$draftId`,params:{draftId:x},search:e=>ue(e)})},[x,s]),X=(0,y.useCallback)(()=>{s({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let t=G[G.length-1];return K===`agent`&&t?f(e,t):K===`files`&&B?g(e):K===`review`&&z?h(e):K===`terminal`&&V?d(e):K===`simulator`&&H?m(e):K===`browser`&&U?_(e):K===`agents`&&W?p(e):B?g(e):z?h(e):V?d(e):H?m(e):U?_(e):W?p(e):t?f(e,t):v(e)}})},[x,W,z,B,H,U,V,K,s,G]),Z=(0,y.useCallback)(()=>{if(A){Y();return}X()},[Y,X,A]),Q=(0,y.useCallback)(e=>{if(e.mode===`agent`){let t=G.filter(t=>t!==e.agentKey);R(e=>({draftId:x,hasOpenedDiff:e.draftId===x?e.hasOpenedDiff:z,hasOpenedPreview:e.draftId===x?e.hasOpenedPreview:B,hasOpenedTerminal:e.draftId===x?e.hasOpenedTerminal:V,hasOpenedSimulator:e.draftId===x?e.hasOpenedSimulator:H,hasOpenedBrowser:e.draftId===x?e.hasOpenedBrowser:U,hasOpenedAgents:e.draftId===x?e.hasOpenedAgents:W,openedAgentKeys:t})),k===`agent`&&j===e.agentKey&&s({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let n=t[t.length-1];return n?f(e,n):B?g(e):z?h(e):V?d(e):H?m(e):U?_(e):W?p(e):v(e)}});return}let t=e.mode===`review`?!1:z||k===`review`,n=e.mode===`files`?!1:B||k===`files`,r=e.mode===`terminal`?!1:V||k===`terminal`,i=e.mode===`simulator`?!1:H||k===`simulator`,a=e.mode===`browser`?!1:U||k===`browser`,o=e.mode===`agents`?!1:W||k===`agents`;R(e=>{let s={draftId:x,hasOpenedDiff:t,hasOpenedPreview:n,hasOpenedTerminal:r,hasOpenedSimulator:i,hasOpenedBrowser:a,hasOpenedAgents:o,openedAgentKeys:e.draftId===x?e.openedAgentKeys:G};return e.draftId===s.draftId&&e.hasOpenedDiff===s.hasOpenedDiff&&e.hasOpenedPreview===s.hasOpenedPreview&&e.hasOpenedTerminal===s.hasOpenedTerminal&&e.hasOpenedSimulator===s.hasOpenedSimulator&&e.hasOpenedBrowser===s.hasOpenedBrowser&&e.hasOpenedAgents===s.hasOpenedAgents&&e.openedAgentKeys===s.openedAgentKeys?e:s}),k===e.mode&&s({to:`/draft/$draftId`,params:{draftId:x},search:s=>e.mode!==`files`&&n?g(s):e.mode!==`review`&&t?h(s):e.mode!==`terminal`&&r?d(s):e.mode!==`simulator`&&i?m(s):e.mode!==`browser`&&a?_(s):e.mode!==`agents`&&o?p(s):v(s)})},[j,x,W,z,B,H,U,V,s,G,k]);if((0,y.useEffect)(()=>{k!==null&&(Se(k),J(k))},[J,k]),(0,y.useEffect)(()=>{j&&R(e=>{let t=e.draftId===x?e.openedAgentKeys:[];return t.includes(j)?e.draftId===x?e:{draftId:x,hasOpenedDiff:z,hasOpenedPreview:B,hasOpenedTerminal:V,hasOpenedSimulator:H,hasOpenedBrowser:U,hasOpenedAgents:W,openedAgentKeys:t}:{draftId:x,hasOpenedDiff:e.draftId===x?e.hasOpenedDiff:D,hasOpenedPreview:e.draftId===x?e.hasOpenedPreview:O,hasOpenedTerminal:e.draftId===x?e.hasOpenedTerminal:k===`terminal`,hasOpenedSimulator:e.draftId===x?e.hasOpenedSimulator:k===`simulator`,hasOpenedBrowser:e.draftId===x?e.hasOpenedBrowser:k===`browser`,hasOpenedAgents:e.draftId===x?e.hasOpenedAgents:k===`agents`,openedAgentKeys:[...t,j]}})},[j,D,x,W,z,B,H,U,V,O,k]),(0,y.useEffect)(()=>{E&&(ie(S,`${E.environmentId}:${E.threadId}`),s({to:`/$environmentId/$threadId`,params:r(E),replace:!0}))},[E,s,S]),(0,y.useEffect)(()=>{w||E||s({to:`/`,replace:!0})},[E,w,s]),E)return(0,b.jsx)(u,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,b.jsx)(c,{environmentId:E.environmentId,threadId:E.threadId,routeKind:`server`})});if(!w)return null;let Ce=A||k===`review`||z||k===`files`||B||k===`terminal`||V||k===`simulator`||H||k===`browser`||U||k===`agents`||W||k===`agent`||G.length>0,we=A||k===`review`||z||k===`files`||B||k===`terminal`||V||k===`agent`||G.length>0,$=A?k:K;return M===`phone`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,b.jsx)(c,{draftId:x,environmentId:w.environmentId,threadId:w.threadId,onDiffPanelOpen:()=>J(`review`),onPreviewPanelOpen:()=>J(`files`),onTerminalPanelOpen:()=>J(`terminal`),onAgentPanelOpen:()=>J(`agent`),workspacePanelOpen:A,onToggleWorkspacePanel:Z,routeKind:`draft`})}),(0,b.jsx)(ce,{label:`Workspace`,open:A,onClose:Y,children:we?(0,b.jsx)(l,{mode:`phone`,panelMode:$,openedPanelModes:q,openedAgentKeys:G,onClosePanelTab:Q}):null})]}):ye?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,b.jsx)(c,{draftId:x,environmentId:w.environmentId,threadId:w.threadId,onDiffPanelOpen:()=>J(`review`),onPreviewPanelOpen:()=>J(`files`),onTerminalPanelOpen:()=>J(`terminal`),onAgentPanelOpen:()=>J(`agent`),workspacePanelOpen:A,onToggleWorkspacePanel:Z,routeKind:`draft`})}),(0,b.jsx)(ne,{open:A,onClose:Y,children:Ce?(0,b.jsx)(l,{mode:`sheet`,panelMode:$,openedPanelModes:q,openedAgentKeys:G,onClosePanelTab:Q}):null})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{className:o(`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,I&&`w-0 flex-none`),inert:I?!0:void 0,children:(0,b.jsx)(c,{draftId:x,environmentId:w.environmentId,threadId:w.threadId,onDiffPanelOpen:()=>J(`review`),onPreviewPanelOpen:()=>J(`files`),onTerminalPanelOpen:()=>J(`terminal`),onAgentPanelOpen:()=>J(`agent`),workspacePanelOpen:A,onToggleWorkspacePanel:Z,routeKind:`draft`})}),(0,b.jsx)(se,{open:A,panelMode:$,openedPanelModes:q,openedAgentKeys:G,onClosePanelTab:Q,onClose:Y,onOpen:X,renderContent:Ce,maximized:I,onToggleMaximized:xe,reserveChromeInset:I&&be})]})}export{x as DraftChatThreadRouteView};
@@ -1,2 +1,2 @@
1
- import{v as e}from"./authorization-CjOFkg7b.js";function t(e){return e.status===`refused`&&e.errorCode===`step_up_required`}function n(t){return t===e}function r(e,t){return!e.inferredErrorCode||t<3}var i=`The Hub refused this change every time. It answers a missing authenticator code and other refusals identically, so if the codes you entered were current then something else is blocking this — sign in again with a passkey, or try again later.`;function a(e,t,n){return!e||n&&t===`step_up_required`?null:e}function o(e){return e.revokedAt!==null}function s(e){return e.filter(e=>!o(e))}function c(e){return e.toSorted((e,t)=>+!!o(e)-!!o(t))}function l(e){return s(e).filter(e=>e.backupState===!0).length}function u(e,t){if(t!==`ready`)return null;let n=s(e).length;return n===0?{variant:`error`,title:`No usable passkey on this account`,description:`Without one you can only get back in through a fallback credential. Adding a passkey is the only action on this page that makes the account stronger.`,actionLabel:`Add your first passkey`}:n===1?{variant:`warning`,title:`One passkey on this account`,description:`If you lose this device you fall back to a password or a recovery code. Add a second passkey on another device.`,actionLabel:`Add another passkey`}:null}function d(e){return e.label?.trim()||`Unnamed passkey (${e.id.slice(0,12)}…)`}function f(e){return e.backupState===!0?`Synced to your password manager`:e.backupEligible===!0?`Can be synced, not yet backed up`:e.backupEligible===!1?`Tied to this device only`:null}function p(e){let t=e.trim();return t.length===0?null:t}function m(e){return e.replace(/\D/gu,``).slice(0,16)}function h(e){return m(e).length>=6}function g(e,t){return e.length===0?`Enter a password.`:e.length>256?`Use 256 characters or fewer.`:t.length===0?`Re-enter the password to confirm it.`:e===t?null:`The two passwords do not match.`}function _(e){let t=e.trim();return t.length===0?`Enter an email address.`:t.length>254?`Use 254 characters or fewer.`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(t)?null:`Enter a valid email address.`}function v(e){return e.join(`
1
+ import{v as e}from"./authorization-7xVVtCBu.js";function t(e){return e.status===`refused`&&e.errorCode===`step_up_required`}function n(t){return t===e}function r(e,t){return!e.inferredErrorCode||t<3}var i=`The Hub refused this change every time. It answers a missing authenticator code and other refusals identically, so if the codes you entered were current then something else is blocking this — sign in again with a passkey, or try again later.`;function a(e,t,n){return!e||n&&t===`step_up_required`?null:e}function o(e){return e.revokedAt!==null}function s(e){return e.filter(e=>!o(e))}function c(e){return e.toSorted((e,t)=>+!!o(e)-!!o(t))}function l(e){return s(e).filter(e=>e.backupState===!0).length}function u(e,t){if(t!==`ready`)return null;let n=s(e).length;return n===0?{variant:`error`,title:`No usable passkey on this account`,description:`Without one you can only get back in through a fallback credential. Adding a passkey is the only action on this page that makes the account stronger.`,actionLabel:`Add your first passkey`}:n===1?{variant:`warning`,title:`One passkey on this account`,description:`If you lose this device you fall back to a password or a recovery code. Add a second passkey on another device.`,actionLabel:`Add another passkey`}:null}function d(e){return e.label?.trim()||`Unnamed passkey (${e.id.slice(0,12)}…)`}function f(e){return e.backupState===!0?`Synced to your password manager`:e.backupEligible===!0?`Can be synced, not yet backed up`:e.backupEligible===!1?`Tied to this device only`:null}function p(e){let t=e.trim();return t.length===0?null:t}function m(e){return e.replace(/\D/gu,``).slice(0,16)}function h(e){return m(e).length>=6}function g(e,t){return e.length===0?`Enter a password.`:e.length>256?`Use 256 characters or fewer.`:t.length===0?`Re-enter the password to confirm it.`:e===t?null:`The two passwords do not match.`}function _(e){let t=e.trim();return t.length===0?`Enter an email address.`:t.length>254?`Use 254 characters or fewer.`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(t)?null:`Enter a valid email address.`}function v(e){return e.join(`
2
2
  `)}var y={"set-password":`Confirm the password change`,"remove-password":`Confirm removing the password`,"revoke-totp":`Confirm removing two-factor authentication`,"request-email-verification":`Confirm the email change`,"add-passkey":`Confirm adding a passkey`,"regenerate-recovery-codes":`Confirm new recovery codes`,"connect-github":`Confirm connecting GitHub`,"disconnect-github":`Confirm disconnecting GitHub`};function b(e){return y[e]}function x(e,t){return e===0?t?`The Hub refused this change without saying why. The usual reason is that it wants a code from your authenticator app.`:`The Hub asked for a code from your authenticator app before making this change.`:t?`That did not work. The Hub answers a wrong code and other refusals identically, so this may not be about the code at all. You can try the code showing now.`:`That code was not accepted. Codes change every 30 seconds — enter the one showing now.`}function S(e){return e?.providers.find(e=>e.provider===`github`)??null}var C={external_provider_unavailable:`GitHub sign-in is temporarily unavailable. Try again later.`,external_authorization_cancelled:`GitHub authorization was cancelled.`,external_authorization_expired:`GitHub authorization expired. Start again.`,external_authorization_rejected:`GitHub could not authorize this request. Try again.`,external_identity_email_conflict:`An account already uses that verified email. Sign in another way, then connect GitHub from account settings.`,external_identity_verified_email_required:`GitHub needs a verified primary email before it can create a Ryco account.`,signup_disabled:`New account signup is closed. Linked GitHub accounts can still sign in.`,username_unavailable:`That username is unavailable. Choose another one and try again.`};function w(e){return C[e]}async function T(e){let t=await e.start({provider:`github`,intent:e.intent,returnTo:e.returnTo});e.navigate(t.authorizationUrl)}export{l as C,b as S,f as _,u as a,r as b,v as c,n as d,t as f,c as g,m as h,i,a as l,p as m,w as n,s as o,h as p,S as r,_ as s,T as t,o as u,d as v,x,g as y};
@@ -1 +1 @@
1
- import{Vr as e}from"./runtime-Djy96GJd.js";import"./appearancePreferences-nFx4MHoI.js";var t={sheet:`app-glass-surface-sheet`,chip:`app-glass-surface-chip`,dock:`app-glass-surface-dock`};function n(n){return e(`app-glass-surface`,t[n])}export{n as t};
1
+ import{Vr as e}from"./runtime-Bxg7k81u.js";import"./appearancePreferences-nFx4MHoI.js";var t={sheet:`app-glass-surface-sheet`,chip:`app-glass-surface-chip`,dock:`app-glass-surface-dock`};function n(n){return e(`app-glass-surface`,t[n])}export{n as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{K as n}from"./primary-D_D7eLwT.js";import{$r as r,ni as i}from"./src-BSuAGqhK.js";import{$ as a,Ca as o,Da as s,J as c,Na as l,P as u,Vr as d,_l as f,ja as p,zr as m}from"./runtime-Djy96GJd.js";import{t as h}from"./compiler-runtime-qmuS0Svy.js";import{f as g,g as _,h as v,m as y,p as b,t as x,u as S,v as C,y as w}from"./hostedConnectionCoordinator-CLV-JD1S.js";import{t as T}from"./useNavigate-cLfxn_9L.js";import{t as E}from"./download-BA9L9tK9.js";import{t as ee}from"./log-out-YAp9fsOg.js";import{t as te}from"./refresh-cw-DY3_Ph-S.js";import{t as D}from"./shield-check-CO4SMhAs.js";import{t as O}from"./shield-Zq_ygsnJ.js";import{t as k}from"./smartphone-O2VACDhU.js";import{t as ne}from"./user-round-DctamWV6.js";import{o as A}from"./authorization-CjOFkg7b.js";import{t as j}from"./usePresentationTier-B_SCFvN7.js";import{a as re,i as M,n as N,o as P,s as F,t as ie}from"./MobileSheet-NTayGHF6.js";import{t as I}from"./GlassSurface-GY6owikG.js";import{i as ae,t as L}from"./hubRoutes-EWJ3Gdod.js";import{a as oe,c as se,i as R,n as z,o as B,r as ce,s as le,t as ue}from"./HostedRelayTrustNotice-Bl6On0Yi.js";var V={name:`badge-check`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`verified`]};V.node;var de=l(V),H={name:`layout-grid`,size:24,node:[[`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`}]]};H.node;var fe=l(H),U={name:`shield-off`,size:24,node:[[`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`}]]};U.node;var W=l(U),G={name:`wifi-off`,size:24,node:[[`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`}]]};G.node;var pe=l(G),me={name:`wifi`,size:24,node:[[`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`}]]};me.node;var he=l(me),K=f(),q=h(),J=e(t(),1),ge={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.`},_e=null,ve=new Set;function Y(e){if(_e!==e){_e=e;for(let e of Array.from(ve))e()}}function ye(e){return ve.add(e),()=>{ve.delete(e)}}function be(){return _e===null?null:ge[_e]}function xe(){return(0,J.useSyncExternalStore)(ye,be)}function Se(){return(0,J.useSyncExternalStore)(w,_)}var Ce=new Set([`node`,`draft`,`pair`,`diagnostics`,...L]);function we(e){let t=/^\/([^/]+)\/([^/]+)\/?$/.exec(e);if(!t)return null;let n=t[1]??``;if(Ce.has(n))return null;try{return decodeURIComponent(n)}catch{return n}}function Te(e){let t=/^\/([^/]+)\/([^/]+)\/?$/u.exec(e);if(!t||Ce.has(t[1]??``))return null;try{return{environmentId:r.make(decodeURIComponent(t[1]??``)),threadId:i.make(decodeURIComponent(t[2]??``))}}catch{return null}}function Ee(e){return e.startsWith(`/draft/`)}var X=null,Z=null,Q=null,De=!1,Oe=null,ke=0,Ae=!1,je=null,Me=null;function $(e){let t=e?JSON.stringify([e.environmentId,e.threadId]):null;t!==je&&(Me?.(),Me=null,je=t,e&&(Me=S(e.environmentId,e.threadId)))}function Ne(e){return e?JSON.stringify([e.environmentId,e.threadId]):null}function Pe(){Ae||(Ae=!0,queueMicrotask(()=>{Ae=!1,ke!==0&&Le()}))}function Fe(e){De=!0;try{e()}finally{De=!1}Pe()}function Ie(e,t){X=null,Z=null,Q=null,(e===`none`||e===`online`||e===`offline`)&&Y(t),b()}function Le(){if(De||!v())return;let e=_(),t=u.getState();if(e.malformed){Y(`invalid-link`),$(null),b();return}if(t.accountStatus!==`authenticated`){$(null),Oe===`authenticated`&&Y(null),Oe=t.accountStatus;return}Oe=t.accountStatus;let n=e.nodeId;if(n===null){if(Q=null,$(null),X=null,Z=null,t.selectedNode&&!x()){let e=t.selectionStatus===`revoked`||t.selectionStatus===`authorization-removed`||t.selectionStatus===`incompatible`;A.returnToDirectory(e?{preserveTerminalSelection:!0}:void 0);return}Re(e.logicalPathname,t);return}let r=Te(e.logicalPathname);Ne(r)!==je&&$(null);let i=t.nodes.find(e=>e.id===n)??null;if(i&&(i.capabilities?.nativeClientRequired===!0||r&&i.environmentId!==r.environmentId)){$(null),Ie(t.selectionStatus,`unavailable`);return}if(t.selectedNode?.id===n){if($(r),X=null,Q=null,t.sessionEstablished){Z=null,Y(null);return}if(Z===n&&t.transportStatus===`terminal-failure`&&(t.selectionStatus===`revoked`||t.selectionStatus===`authorization-removed`||t.selectionStatus===`incompatible`)){Z=null,Fe(()=>{b(),A.returnToDirectory({preserveTerminalSelection:!0})});return}Z===n&&t.transportStatus===`terminal-failure`&&t.selectionStatus===`offline`&&t.errorMessage===`Ryco state could not be synchronized.`&&Fe(()=>{Ie(t.selectionStatus,`offline`),A.returnToDirectory()});return}if(t.directoryStatus===`stale`){Ie(t.selectionStatus,`unavailable`);return}if(t.directoryStatus!==`ready`||t.browserStatus!==`current`)return;let a=t.nodes.find(e=>e.id===n);if(!a){Ie(t.selectionStatus,`unavailable`);return}if(a.revokedAt!==null){Ie(t.selectionStatus,`revoked`);return}let o=Q===n;$(r);let s=r!==null&&!a.presence.online&&!o;r&&x()&&!s||X!==n&&(X=n,Z=o?null:n,Q=null,Y(null),A.selectNode(a.id).finally(()=>{X===n&&(X=null)}))}function Re(e,t){if(Ee(e)){b();return}let n=we(e);if(n===null)return;if(t.directoryStatus===`stale`){Y(`unavailable`),b();return}if(t.directoryStatus!==`ready`)return;let r=t.nodes.find(e=>e.environmentId===n&&e.revokedAt===null);if(!r){Y(`unavailable`),b();return}g(r.id)}function ze(e){return v()?(Q=e,Y(null),y(e)):!1}function Be(){if(!v())return!1;Q=null,Y(null);let e=_();return e.nodeId===null&&e.logicalPathname===`/nodes`||C()}function Ve(){ke+=1;let e=w(Pe),t=u.subscribe(Pe),n=v()?.subscribe(()=>Pe());Pe();let r=!1;return()=>{r||(r=!0,--ke,e(),t(),n?.())}}function He(){let e=(0,q.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,J.useEffect)(Ue,t)}function Ue(){return Ve()}function We(e){let t=(0,q.c)(11),{label:n,status:r,icon:i,onClick:a,testId:o,className:s}=e,c;t[0]===s?c=t[1]:(c=d(I(`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]=c);let l;t[2]===r?l=t[3]:(l=(0,K.jsx)(`span`,{"data-slot":`mobile-status-chip-status`,className:`min-w-0 truncate`,children:r}),t[2]=r,t[3]=l);let u;return t[4]!==i||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==o?(u=(0,K.jsxs)(`button`,{type:`button`,"aria-label":n,"data-slot":`mobile-status-chip`,"data-testid":o,className:c,onClick:a,children:[i,l]}),t[4]=i,t[5]=n,t[6]=a,t[7]=c,t[8]=l,t[9]=o,t[10]=u):u=t[10],u}var Ge={legacy:{glyph:`legacy`,iconClassName:`text-amber-500`},web:{glyph:`browser-encrypted`,iconClassName:`text-sky-500`},account:{glyph:`account-trusted`,iconClassName:`text-indigo-500`},e2ee:{glyph:`native-verified`,iconClassName:`text-emerald-500`}};function Ke(e){return e.guarantee===`none`?e.connected?{glyph:`connected`,iconClassName:`text-emerald-500`}:{glyph:`disconnected`,iconClassName:`text-amber-500`}:Ge[e.guarantee]}function qe(){let e=(0,q.c)(19),t=oe(),r=B(),i=u(Xe),o=u(Ye),l=u(Je);if(t!==`web-unsigned`)return null;let d,f;e[0]!==r||e[1]!==o||e[2]!==i||e[3]!==l?(d=ce(a(`security`,{hosted:n(),role:c(i,o,l)})),f=R(r,d),e[0]=r,e[1]=o,e[2]=i,e[3]=l,e[4]=d,e[5]=f):(d=e[4],f=e[5]);let p=f;if(!p){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{"aria-label":`Session code`,"data-testid":`hosted-e2ee-verification`,"data-code":`absent`,className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Session code`}),(0,K.jsx)(`p`,{"data-testid":`hosted-e2ee-verification-unavailable`,className:`text-[11px] leading-relaxed text-muted-foreground`,children:z})]}),e[6]=t):t=e[6],t}let m;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Session code`}),e[7]=m):m=e[7];let h;e[8]===p.display?h=e[9]:(h=(0,K.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:p.display}),e[8]=p.display,e[9]=h);let g;e[10]===p.display?g=e[11]:(g=()=>void navigator.clipboard.writeText(p.display),e[10]=p.display,e[11]=g);let _;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}),e[12]=_):_=e[12];let v;e[13]===g?v=e[14]:(v=(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,onClick:g,children:[_,` Copy`]}),e[13]=g,e[14]=v);let y;return e[15]!==d||e[16]!==h||e[17]!==v?(y=(0,K.jsxs)(`section`,{"aria-label":`Session code`,"data-testid":`hosted-e2ee-verification`,"data-code":`present`,"data-form":d,className:`space-y-2`,children:[m,h,v]}),e[15]=d,e[16]=h,e[17]=v,e[18]=y):y=e[18],y}function Je(e){return e.transportStatus}function Ye(e){return e.directoryStatus}function Xe(e){return e.effectiveRole}var Ze=`ryco:pwa:activate:v1`,Qe=`Installation is temporarily unavailable.`,$e={errorMessage:null,installState:`hidden`,platform:`other`,registrationState:`disabled`,updateState:`idle`};function et(e){return e===``||e===`./`?`./`:e.endsWith(`/`)?e:`${e}/`}function tt(e){let t=e.navigator.userAgent;return/iPad|iPhone|iPod/.test(t)||/Macintosh/.test(t)&&e.navigator.maxTouchPoints>1}function nt(e){let t=e;return typeof t.prompt==`function`&&t.userChoice instanceof Promise}function rt(e){let t=$e,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=>{nt(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:Qe});return}u({registrationState:`registering`,errorMessage:null});try{let n=et(e.baseUrl);_(await t.register(`${n}service-worker.js`,{scope:n})),u({registrationState:`ready`,errorMessage:null})}catch{u({registrationState:`unavailable`,errorMessage:Qe})}};return{activateUpdate(){let e=i?.waiting;e&&t.updateState===`ready`&&(s=!0,u({updateState:`activating`}),e.postMessage({type:Ze}))},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:tt(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=$e,c.forEach(e=>e()))},subscribe(e){return c.add(e),()=>c.delete(e)}}}function it(){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 at=typeof window>`u`?null:rt(it());function ot(e){let t=(0,q.c)(3),{compact:n,lifecycle:r}=e,i=n!==void 0&&n,a=r===void 0?at:r,o;return t[0]!==i||t[1]!==a?(o=a?(0,K.jsx)(st,{compact:i,lifecycle:a}):null,t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function st(e){let t=(0,q.c)(27),{compact:n,lifecycle:r}=e,i=(0,J.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getSnapshot),[a,o]=(0,J.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,K.jsxs)(m,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,onClick:()=>void r.promptInstall(),children:[(0,K.jsx)(E,{"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,K.jsxs)(m,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,"aria-expanded":a,onClick:()=>o(ct),children:[(0,K.jsx)(k,{"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,K.jsxs)(m,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,disabled:i.updateState===`activating`,onClick:()=>r.activateUpdate(),children:[(0,K.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,K.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,K.jsx)(lt,{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,K.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 h;return t[22]!==s||t[23]!==d||t[24]!==f||t[25]!==p?(h=(0,K.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]=h):h=t[26],h}function ct(e){return!e}function lt(e){let t=(0,q.c)(13),{snapshot:n,onClose:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.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,K.jsxs)(`div`,{children:[i,n.platform===`ios`?(0,K.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,K.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 s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(o,{"aria-hidden":!0}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(`span`,{className:`sr-only`,children:`Close install instructions`}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=(0,K.jsxs)(m,{className:`size-11 shrink-0`,size:`icon`,variant:`ghost`,onClick:r,children:[s,` `,c]}),t[5]=r,t[6]=l);let u;t[7]!==a||t[8]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[a,l]}),t[7]=a,t[8]=l,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:(0,K.jsx)(ue,{compact:!0})}),t[10]=d):d=t[10];let f;return t[11]===u?f=t[12]:(f=(0,K.jsxs)(`div`,{role:`region`,"aria-label":`Install Ryco instructions`,className:`rounded-lg border border-border bg-background p-3 text-sm`,children:[u,d]}),t[11]=u,t[12]=f),f}var ut={connected:he,disconnected:pe,legacy:W,"browser-encrypted":O,"account-trusted":de,"native-verified":D};function dt(e){let t=(0,q.c)(9),{indicator:n,className:r,testId:i}=e,a;t[0]===n?a=t[1]:(a=Ke(n),t[0]=n,t[1]=a);let{glyph:o,iconClassName:s}=a,c=ut[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,K.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 ft(e){let t=(0,q.c)(3),{node:n}=e;if(n.revokedAt){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.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,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400`,children:[(0,K.jsx)(he,{"aria-hidden":!0,className:`size-3.5`}),` Online`]}):(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,K.jsx)(pe,{"aria-hidden":!0,className:`size-3.5`}),` Offline`]}),t[1]=n.presence.online,t[2]=r),r}function pt(){let e=(0,q.c)(7),t=T(),n;e[0]===t?n=e[1]:(n=async e=>{ze(e.id)||(await t({to:`/`,replace:!0}),await A.selectNode(e.id))},e[0]=t,e[1]=n);let r=n,i;e[2]===t?i=e[3]:(i=async()=>{Be()||(await t({to:`/`,replace:!0}),await A.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 mt(){let e=(0,q.c)(5),t=u(_t),n=u(gt);if(t!==`delivery-unknown`)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.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.`,o=n?`Acknowledge`:`Synchronizing…`,s;return e[1]!==i||e[2]!==a||e[3]!==o?(s=(0,K.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,K.jsx)(m,{className:`mt-2`,size:`sm`,variant:`outline`,disabled:i,title:a,onClick:ht,children:o})]}),e[1]=i,e[2]=a,e[3]=o,e[4]=s):s=e[4],s}function ht(){return A.acknowledgeDeliveryUnknown()}function gt(e){return e.sessionRecoveredAfterUnknown}function _t(e){return e.sessionStatus}function vt(){let e=(0,q.c)(62),t=u(kt),n=u(Ot),r=u(Dt),i=u(Et),a=u(Tt),o=u(wt),s=u(Ct),c=u(St),l=u(xt),d=oe(),{switchNode:f,returnToAllNodes:h}=pt(),g=(0,J.useRef)(null);if(!t)return null;let _,v;if(e[0]!==l||e[1]!==d||e[2]!==a||e[3]!==i||e[4]!==r){let t={browserStatus:l,sessionStatus:i,selectionStatus:a,transportStatus:r,e2eeStatus:d};_=se(t),v=le(t),e[0]=l,e[1]=d,e[2]=a,e[3]=i,e[4]=r,e[5]=_,e[6]=v}else _=e[5],v=e[6];let y=v,b;e[7]===y?b=e[8]:(b=(0,K.jsx)(dt,{indicator:y,className:`size-4`}),e[7]=y,e[8]=b);let x;e[9]===t.label?x=e[10]:(x=(0,K.jsx)(`span`,{className:`max-w-32 truncate font-medium`,children:t.label}),e[9]=t.label,e[10]=x);let S;e[11]===_?S=e[12]:(S=(0,K.jsx)(`span`,{className:`max-w-24 truncate text-xs text-muted-foreground`,children:_}),e[11]=_,e[12]=S);let C;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(p,{"aria-hidden":!0,className:`size-3.5 transition-transform group-open:rotate-180`}),e[13]=C):C=e[13];let w;e[14]!==b||e[15]!==x||e[16]!==S?(w=(0,K.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:[b,x,S,C]}),e[14]=b,e[15]=x,e[16]=S,e[17]=w):w=e[17];let T;e[18]===t.label?T=e[19]:(T=(0,K.jsx)(`p`,{className:`font-medium`,children:t.label}),e[18]=t.label,e[19]=T);let E=s??`Role unavailable`,D;e[20]!==_||e[21]!==E?(D=(0,K.jsxs)(`p`,{className:`mt-0.5 text-xs capitalize text-muted-foreground`,children:[E,` · `,_]}),e[20]=_,e[21]=E,e[22]=D):D=e[22];let O;e[23]!==t.label||e[24]!==_?(O=(0,K.jsxs)(`p`,{className:`sr-only`,"aria-live":`polite`,children:[`Node `,t.label,`: `,_,`.`]}),e[23]=t.label,e[24]=_,e[25]=O):O=e[25];let k;e[26]===c?k=e[27]:(k=c?(0,K.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:c}):null,e[26]=c,e[27]=k);let A;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(mt,{}),e[28]=A):A=e[28];let j;e[29]===h?j=e[30]:(j=()=>void h(),e[29]=h,e[30]=j);let re;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,K.jsx)(fe,{"aria-hidden":!0,className:`size-4`}),e[31]=re):re=e[31];let M;e[32]===j?M=e[33]:(M=(0,K.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]!==l||e[35]!==o||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]!==l||e[43]!==o||e[44]!==f?(i=e=>(0,K.jsxs)(`button`,{type:`button`,disabled:o!==`ready`||l!==`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,K.jsx)(`span`,{className:`truncate`,children:e.label}),(0,K.jsx)(ft,{node:e})]},e.id),e[42]=l,e[43]=o,e[44]=f,e[45]=i):i=e[45],N=n.filter(r).map(i),e[34]=l,e[35]=o,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,K.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,K.jsxs)(m,{size:`sm`,variant:`outline`,onClick:bt,children:[(0,K.jsx)(te,{"aria-hidden":!0}),` Refresh`]}),e[49]=F):F=e[49];let ie;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,K.jsxs)(m,{size:`sm`,variant:`ghost`,onClick:yt,children:[(0,K.jsx)(ee,{"aria-hidden":!0}),` Sign out`]}),e[50]=ie):ie=e[50];let I;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 border-t border-border pt-3`,children:[F,ie,(0,K.jsxs)(m,{size:`sm`,variant:`ghost`,onClick:()=>{g.current&&(g.current.open=!1),ae({kind:`account`,section:`security`})},children:[(0,K.jsx)(ne,{"aria-hidden":!0}),` Security details`]})]}),e[51]=I):I=e[51];let L;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 border-t border-border pt-3`,children:[(0,K.jsx)(qe,{}),(0,K.jsx)(ot,{compact:!0})]}),e[52]=L):L=e[52];let R;e[53]!==k||e[54]!==P||e[55]!==T||e[56]!==D||e[57]!==O?(R=(0,K.jsxs)(`div`,{className:`absolute right-0 z-50 mt-2 w-72 rounded-xl border border-border bg-popover p-3 shadow-xl`,children:[T,D,O,k,A,P,I,L]}),e[53]=k,e[54]=P,e[55]=T,e[56]=D,e[57]=O,e[58]=R):R=e[58];let z;return e[59]!==R||e[60]!==w?(z=(0,K.jsx)(`div`,{className:`relative max-w-full`,children:(0,K.jsxs)(`details`,{ref:g,className:`group relative`,children:[w,R]})}),e[59]=R,e[60]=w,e[61]=z):z=e[61],z}function yt(){A.signOut()}function bt(){A.refreshDirectory()}function xt(e){return e.browserStatus}function St(e){return e.errorMessage}function Ct(e){return e.effectiveRole}function wt(e){return e.directoryStatus}function Tt(e){return e.selectionStatus}function Et(e){return e.sessionStatus}function Dt(e){return e.transportStatus}function Ot(e){return e.nodes}function kt(e){return e.selectedNode}function At(e){let t=(0,q.c)(66),{open:n,onOpenChange:r}=e,i=u(Vt),a=u(Bt),o=u(zt),s=u(Rt),c=u(Lt),l=u(It),d=u(Ft),f=u(Pt),p=u(Nt),h=oe(),{switchNode:g,returnToAllNodes:_}=pt();if(!i)return null;let v,y;if(t[0]!==p||t[1]!==h||t[2]!==c||t[3]!==s||t[4]!==o){let e={browserStatus:p,sessionStatus:s,selectionStatus:c,transportStatus:o,e2eeStatus:h};v=se(e),y=le(e),t[0]=p,t[1]=h,t[2]=c,t[3]=s,t[4]=o,t[5]=v,t[6]=y}else v=t[5],y=t[6];let b=y,x=l!==`ready`||p!==`current`,S;t[7]===b?S=t[8]:(S=(0,K.jsx)(dt,{indicator:b,className:`size-4`}),t[7]=b,t[8]=S);let C;t[9]===i.label?C=t[10]:(C=(0,K.jsx)(`span`,{className:`truncate`,children:i.label}),t[9]=i.label,t[10]=C);let w;t[11]!==S||t[12]!==C?(w=(0,K.jsxs)(P,{className:`flex items-center gap-2`,children:[S,C]}),t[11]=S,t[12]=C,t[13]=w):w=t[13];let T=d??`Role unavailable`,E;t[14]!==v||t[15]!==T?(E=(0,K.jsxs)(N,{className:`capitalize`,children:[T,` · `,v]}),t[14]=v,t[15]=T,t[16]=E):E=t[16];let D;t[17]!==i.label||t[18]!==v?(D=(0,K.jsxs)(`p`,{className:`sr-only`,"aria-live":`polite`,children:[`Node `,i.label,`: `,v,`.`]}),t[17]=i.label,t[18]=v,t[19]=D):D=t[19];let O;t[20]!==w||t[21]!==E||t[22]!==D?(O=(0,K.jsxs)(M,{children:[w,E,D]}),t[20]=w,t[21]=E,t[22]=D,t[23]=O):O=t[23];let k;t[24]===f?k=t[25]:(k=f?(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:f}):null,t[24]=f,t[25]=k);let A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(mt,{}),t[26]=A):A=t[26];let j;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[27]=j):j=t[27];let I;t[28]===r?I=t[29]:(I=(0,K.jsx)(F,{label:`Security details`,icon:j,onClick:()=>{r(!1),ae({kind:`account`,section:`security`})}}),t[28]=r,t[29]=I);let L;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,K.jsx)(fe,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[30]=L):L=t[30];let R;t[31]!==r||t[32]!==_?(R=(0,K.jsx)(F,{label:`All nodes`,icon:L,onClick:()=>{r(!1),_()}}),t[31]=r,t[32]=_,t[33]=R):R=t[33];let z;if(t[34]!==i.id||t[35]!==a||t[36]!==r||t[37]!==g||t[38]!==x){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]!==g||t[44]!==x?(n=e=>(0,K.jsx)(F,{label:e.label,disabled:x||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,K.jsx)(ft,{node:e}),onClick:()=>{r(!1),g(e)}},e.id),t[42]=r,t[43]=g,t[44]=x,t[45]=n):n=t[45],z=a.filter(e).map(n),t[34]=i.id,t[35]=a,t[36]=r,t[37]=g,t[38]=x,t[39]=z}else z=t[39];let B;t[46]!==I||t[47]!==R||t[48]!==z?(B=(0,K.jsxs)(`div`,{className:`mt-3 space-y-1 border-t border-border pt-3`,children:[I,R,z]}),t[46]=I,t[47]=R,t[48]=z,t[49]=B):B=t[49];let ce=l===`loading`,ue;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,K.jsx)(te,{"aria-hidden":!0}),t[50]=ue):ue=t[50];let V;t[51]===ce?V=t[52]:(V=(0,K.jsxs)(m,{size:`sm`,variant:`outline`,className:`min-h-11`,disabled:ce,onClick:Mt,children:[ue,` Refresh nodes`]}),t[51]=ce,t[52]=V);let de;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,K.jsxs)(m,{size:`sm`,variant:`ghost`,className:`min-h-11`,onClick:jt,children:[(0,K.jsx)(ee,{"aria-hidden":!0}),` Sign out`]}),t[53]=de):de=t[53];let H;t[54]===V?H=t[55]:(H=(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 border-t border-border pt-3`,children:[V,de]}),t[54]=V,t[55]=H);let U;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,K.jsx)(`div`,{className:`mt-3 space-y-3 border-t border-border pt-3`,children:(0,K.jsx)(ot,{compact:!0})}),t[56]=U):U=t[56];let W;t[57]!==B||t[58]!==H||t[59]!==k?(W=(0,K.jsxs)(re,{children:[k,A,B,H,U]}),t[57]=B,t[58]=H,t[59]=k,t[60]=W):W=t[60];let G;return t[61]!==r||t[62]!==n||t[63]!==W||t[64]!==O?(G=(0,K.jsxs)(ie,{open:n,onOpenChange:r,label:`Connection`,children:[O,W]}),t[61]=r,t[62]=n,t[63]=W,t[64]=O,t[65]=G):G=t[65],G}function jt(){A.signOut()}function Mt(){A.refreshDirectory()}function Nt(e){return e.browserStatus}function Pt(e){return e.errorMessage}function Ft(e){return e.effectiveRole}function It(e){return e.directoryStatus}function Lt(e){return e.selectionStatus}function Rt(e){return e.sessionStatus}function zt(e){return e.transportStatus}function Bt(e){return e.nodes}function Vt(e){return e.selectedNode}function Ht(){let e=(0,q.c)(25),t=u(qt),n=u(Kt),r=u(Gt),i=u(Wt),a=u(Ut),o=oe(),[s,c]=(0,J.useState)(!1);if(!t)return null;let l,d;if(e[0]!==a||e[1]!==o||e[2]!==i||e[3]!==r||e[4]!==n){let t={browserStatus:a,sessionStatus:r,selectionStatus:i,transportStatus:n,e2eeStatus:o};l=se(t),d=le(t),e[0]=a,e[1]=o,e[2]=i,e[3]=r,e[4]=n,e[5]=l,e[6]=d}else l=e[5],d=e[6];let f=d,p;e[7]!==t.label||e[8]!==s||e[9]!==r||e[10]!==l?(p=s?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`hosted-connection-status-announcer`,className:`sr-only`,children:[`Node `,t.label,`: `,l,`.`]}),r===`delivery-unknown`?(0,K.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]=s,e[9]=r,e[10]=l,e[11]=p):p=e[11];let m=`Connection: ${t.label}, ${l}`,h;e[12]===f?h=e[13]:(h=(0,K.jsx)(dt,{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=()=>c(!0),e[14]=g):g=e[14];let _;e[15]!==f.shortLabel||e[16]!==m||e[17]!==h?(_=(0,K.jsx)(We,{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]===s?v=e[20]:(v=(0,K.jsx)(At,{open:s,onOpenChange:c}),e[19]=s,e[20]=v);let y;return e[21]!==p||e[22]!==_||e[23]!==v?(y=(0,K.jsxs)(K.Fragment,{children:[p,_,v]}),e[21]=p,e[22]=_,e[23]=v,e[24]=y):y=e[24],y}function Ut(e){return e.browserStatus}function Wt(e){return e.selectionStatus}function Gt(e){return e.sessionStatus}function Kt(e){return e.transportStatus}function qt(e){return e.selectedNode}function Jt(){let e=(0,q.c)(2),t=j(),n;return e[0]===t?n=e[1]:(n=t===`phone`?(0,K.jsx)(Ht,{}):(0,K.jsx)(vt,{}),e[0]=t,e[1]=n),n}export{pt as a,Te as c,He as d,Se as f,ft as i,ze as l,Ht as n,ot as o,pe as p,vt as r,at as s,Jt as t,xe as u};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{K as n}from"./primary-CjhRI8fe.js";import{ei as r,ri as i}from"./src-Bi-5Nw9C.js";import{$ as a,Ca as o,Da as s,J as c,Na as l,P as u,Vr as d,_l as f,ja as p,zr as m}from"./runtime-Bxg7k81u.js";import{t as h}from"./compiler-runtime-qmuS0Svy.js";import{f as g,g as _,h as v,m as y,p as b,t as x,u as S,v as C,y as w}from"./hostedConnectionCoordinator-JZ1dLx4v.js";import{t as T}from"./useNavigate-DVi0rBlf.js";import{t as E}from"./download-CLQzE1di.js";import{t as ee}from"./log-out-CZW2EpNJ.js";import{t as te}from"./refresh-cw-B5Cz1z3e.js";import{t as D}from"./shield-check-CnKgVJ0F.js";import{t as O}from"./shield-rdjnBE2Q.js";import{t as k}from"./smartphone-CBgpMHXR.js";import{t as ne}from"./user-round-DStbWN3z.js";import{o as A}from"./authorization-7xVVtCBu.js";import{t as j}from"./usePresentationTier-B_SCFvN7.js";import{a as re,i as M,n as N,o as P,s as F,t as ie}from"./MobileSheet-BZo-RAfm.js";import{t as I}from"./GlassSurface-CEVIdyfP.js";import{i as ae,t as L}from"./hubRoutes-C2S5of9_.js";import{a as oe,c as se,i as R,n as z,o as B,r as ce,s as le,t as ue}from"./HostedRelayTrustNotice-DNZQyAX0.js";var V={name:`badge-check`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`verified`]};V.node;var de=l(V),H={name:`layout-grid`,size:24,node:[[`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`}]]};H.node;var fe=l(H),U={name:`shield-off`,size:24,node:[[`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`}]]};U.node;var W=l(U),G={name:`wifi-off`,size:24,node:[[`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`}]]};G.node;var pe=l(G),me={name:`wifi`,size:24,node:[[`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`}]]};me.node;var he=l(me),K=f(),q=h(),J=e(t(),1),ge={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.`},_e=null,ve=new Set;function Y(e){if(_e!==e){_e=e;for(let e of Array.from(ve))e()}}function ye(e){return ve.add(e),()=>{ve.delete(e)}}function be(){return _e===null?null:ge[_e]}function xe(){return(0,J.useSyncExternalStore)(ye,be)}function Se(){return(0,J.useSyncExternalStore)(w,_)}var Ce=new Set([`node`,`draft`,`pair`,`diagnostics`,...L]);function we(e){let t=/^\/([^/]+)\/([^/]+)\/?$/.exec(e);if(!t)return null;let n=t[1]??``;if(Ce.has(n))return null;try{return decodeURIComponent(n)}catch{return n}}function Te(e){let t=/^\/([^/]+)\/([^/]+)\/?$/u.exec(e);if(!t||Ce.has(t[1]??``))return null;try{return{environmentId:r.make(decodeURIComponent(t[1]??``)),threadId:i.make(decodeURIComponent(t[2]??``))}}catch{return null}}function Ee(e){return e.startsWith(`/draft/`)}var X=null,Z=null,Q=null,De=!1,Oe=null,ke=0,Ae=!1,je=null,Me=null;function $(e){let t=e?JSON.stringify([e.environmentId,e.threadId]):null;t!==je&&(Me?.(),Me=null,je=t,e&&(Me=S(e.environmentId,e.threadId)))}function Ne(e){return e?JSON.stringify([e.environmentId,e.threadId]):null}function Pe(){Ae||(Ae=!0,queueMicrotask(()=>{Ae=!1,ke!==0&&Le()}))}function Fe(e){De=!0;try{e()}finally{De=!1}Pe()}function Ie(e,t){X=null,Z=null,Q=null,(e===`none`||e===`online`||e===`offline`)&&Y(t),b()}function Le(){if(De||!v())return;let e=_(),t=u.getState();if(e.malformed){Y(`invalid-link`),$(null),b();return}if(t.accountStatus!==`authenticated`){$(null),Oe===`authenticated`&&Y(null),Oe=t.accountStatus;return}Oe=t.accountStatus;let n=e.nodeId;if(n===null){if(Q=null,$(null),X=null,Z=null,t.selectedNode&&!x()){let e=t.selectionStatus===`revoked`||t.selectionStatus===`authorization-removed`||t.selectionStatus===`incompatible`;A.returnToDirectory(e?{preserveTerminalSelection:!0}:void 0);return}Re(e.logicalPathname,t);return}let r=Te(e.logicalPathname);Ne(r)!==je&&$(null);let i=t.nodes.find(e=>e.id===n)??null;if(i&&(i.capabilities?.nativeClientRequired===!0||r&&i.environmentId!==r.environmentId)){$(null),Ie(t.selectionStatus,`unavailable`);return}if(t.selectedNode?.id===n){if($(r),X=null,Q=null,t.sessionEstablished){Z=null,Y(null);return}if(Z===n&&t.transportStatus===`terminal-failure`&&(t.selectionStatus===`revoked`||t.selectionStatus===`authorization-removed`||t.selectionStatus===`incompatible`)){Z=null,Fe(()=>{b(),A.returnToDirectory({preserveTerminalSelection:!0})});return}Z===n&&t.transportStatus===`terminal-failure`&&t.selectionStatus===`offline`&&t.errorMessage===`Ryco state could not be synchronized.`&&Fe(()=>{Ie(t.selectionStatus,`offline`),A.returnToDirectory()});return}if(t.directoryStatus===`stale`){Ie(t.selectionStatus,`unavailable`);return}if(t.directoryStatus!==`ready`||t.browserStatus!==`current`)return;let a=t.nodes.find(e=>e.id===n);if(!a){Ie(t.selectionStatus,`unavailable`);return}if(a.revokedAt!==null){Ie(t.selectionStatus,`revoked`);return}let o=Q===n;$(r);let s=r!==null&&!a.presence.online&&!o;r&&x()&&!s||X!==n&&(X=n,Z=o?null:n,Q=null,Y(null),A.selectNode(a.id).finally(()=>{X===n&&(X=null)}))}function Re(e,t){if(Ee(e)){b();return}let n=we(e);if(n===null)return;if(t.directoryStatus===`stale`){Y(`unavailable`),b();return}if(t.directoryStatus!==`ready`)return;let r=t.nodes.find(e=>e.environmentId===n&&e.revokedAt===null);if(!r){Y(`unavailable`),b();return}g(r.id)}function ze(e){return v()?(Q=e,Y(null),y(e)):!1}function Be(){if(!v())return!1;Q=null,Y(null);let e=_();return e.nodeId===null&&e.logicalPathname===`/nodes`||C()}function Ve(){ke+=1;let e=w(Pe),t=u.subscribe(Pe),n=v()?.subscribe(()=>Pe());Pe();let r=!1;return()=>{r||(r=!0,--ke,e(),t(),n?.())}}function He(){let e=(0,q.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,J.useEffect)(Ue,t)}function Ue(){return Ve()}function We(e){let t=(0,q.c)(11),{label:n,status:r,icon:i,onClick:a,testId:o,className:s}=e,c;t[0]===s?c=t[1]:(c=d(I(`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]=c);let l;t[2]===r?l=t[3]:(l=(0,K.jsx)(`span`,{"data-slot":`mobile-status-chip-status`,className:`min-w-0 truncate`,children:r}),t[2]=r,t[3]=l);let u;return t[4]!==i||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==o?(u=(0,K.jsxs)(`button`,{type:`button`,"aria-label":n,"data-slot":`mobile-status-chip`,"data-testid":o,className:c,onClick:a,children:[i,l]}),t[4]=i,t[5]=n,t[6]=a,t[7]=c,t[8]=l,t[9]=o,t[10]=u):u=t[10],u}var Ge={legacy:{glyph:`legacy`,iconClassName:`text-amber-500`},web:{glyph:`browser-encrypted`,iconClassName:`text-sky-500`},account:{glyph:`account-trusted`,iconClassName:`text-indigo-500`},e2ee:{glyph:`native-verified`,iconClassName:`text-emerald-500`}};function Ke(e){return e.guarantee===`none`?e.connected?{glyph:`connected`,iconClassName:`text-emerald-500`}:{glyph:`disconnected`,iconClassName:`text-amber-500`}:Ge[e.guarantee]}function qe(){let e=(0,q.c)(19),t=oe(),r=B(),i=u(Xe),o=u(Ye),l=u(Je);if(t!==`web-unsigned`)return null;let d,f;e[0]!==r||e[1]!==o||e[2]!==i||e[3]!==l?(d=ce(a(`security`,{hosted:n(),role:c(i,o,l)})),f=R(r,d),e[0]=r,e[1]=o,e[2]=i,e[3]=l,e[4]=d,e[5]=f):(d=e[4],f=e[5]);let p=f;if(!p){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{"aria-label":`Session code`,"data-testid":`hosted-e2ee-verification`,"data-code":`absent`,className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Session code`}),(0,K.jsx)(`p`,{"data-testid":`hosted-e2ee-verification-unavailable`,className:`text-[11px] leading-relaxed text-muted-foreground`,children:z})]}),e[6]=t):t=e[6],t}let m;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Session code`}),e[7]=m):m=e[7];let h;e[8]===p.display?h=e[9]:(h=(0,K.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:p.display}),e[8]=p.display,e[9]=h);let g;e[10]===p.display?g=e[11]:(g=()=>void navigator.clipboard.writeText(p.display),e[10]=p.display,e[11]=g);let _;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}),e[12]=_):_=e[12];let v;e[13]===g?v=e[14]:(v=(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,onClick:g,children:[_,` Copy`]}),e[13]=g,e[14]=v);let y;return e[15]!==d||e[16]!==h||e[17]!==v?(y=(0,K.jsxs)(`section`,{"aria-label":`Session code`,"data-testid":`hosted-e2ee-verification`,"data-code":`present`,"data-form":d,className:`space-y-2`,children:[m,h,v]}),e[15]=d,e[16]=h,e[17]=v,e[18]=y):y=e[18],y}function Je(e){return e.transportStatus}function Ye(e){return e.directoryStatus}function Xe(e){return e.effectiveRole}var Ze=`ryco:pwa:activate:v1`,Qe=`Installation is temporarily unavailable.`,$e={errorMessage:null,installState:`hidden`,platform:`other`,registrationState:`disabled`,updateState:`idle`};function et(e){return e===``||e===`./`?`./`:e.endsWith(`/`)?e:`${e}/`}function tt(e){let t=e.navigator.userAgent;return/iPad|iPhone|iPod/.test(t)||/Macintosh/.test(t)&&e.navigator.maxTouchPoints>1}function nt(e){let t=e;return typeof t.prompt==`function`&&t.userChoice instanceof Promise}function rt(e){let t=$e,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=>{nt(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:Qe});return}u({registrationState:`registering`,errorMessage:null});try{let n=et(e.baseUrl);_(await t.register(`${n}service-worker.js`,{scope:n})),u({registrationState:`ready`,errorMessage:null})}catch{u({registrationState:`unavailable`,errorMessage:Qe})}};return{activateUpdate(){let e=i?.waiting;e&&t.updateState===`ready`&&(s=!0,u({updateState:`activating`}),e.postMessage({type:Ze}))},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:tt(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=$e,c.forEach(e=>e()))},subscribe(e){return c.add(e),()=>c.delete(e)}}}function it(){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 at=typeof window>`u`?null:rt(it());function ot(e){let t=(0,q.c)(3),{compact:n,lifecycle:r}=e,i=n!==void 0&&n,a=r===void 0?at:r,o;return t[0]!==i||t[1]!==a?(o=a?(0,K.jsx)(st,{compact:i,lifecycle:a}):null,t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function st(e){let t=(0,q.c)(27),{compact:n,lifecycle:r}=e,i=(0,J.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getSnapshot),[a,o]=(0,J.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,K.jsxs)(m,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,onClick:()=>void r.promptInstall(),children:[(0,K.jsx)(E,{"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,K.jsxs)(m,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,"aria-expanded":a,onClick:()=>o(ct),children:[(0,K.jsx)(k,{"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,K.jsxs)(m,{className:`min-h-11`,size:n?`sm`:`default`,variant:`outline`,disabled:i.updateState===`activating`,onClick:()=>r.activateUpdate(),children:[(0,K.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,K.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,K.jsx)(lt,{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,K.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 h;return t[22]!==s||t[23]!==d||t[24]!==f||t[25]!==p?(h=(0,K.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]=h):h=t[26],h}function ct(e){return!e}function lt(e){let t=(0,q.c)(13),{snapshot:n,onClose:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.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,K.jsxs)(`div`,{children:[i,n.platform===`ios`?(0,K.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,K.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 s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(o,{"aria-hidden":!0}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(`span`,{className:`sr-only`,children:`Close install instructions`}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=(0,K.jsxs)(m,{className:`size-11 shrink-0`,size:`icon`,variant:`ghost`,onClick:r,children:[s,` `,c]}),t[5]=r,t[6]=l);let u;t[7]!==a||t[8]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[a,l]}),t[7]=a,t[8]=l,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:(0,K.jsx)(ue,{compact:!0})}),t[10]=d):d=t[10];let f;return t[11]===u?f=t[12]:(f=(0,K.jsxs)(`div`,{role:`region`,"aria-label":`Install Ryco instructions`,className:`rounded-lg border border-border bg-background p-3 text-sm`,children:[u,d]}),t[11]=u,t[12]=f),f}var ut={connected:he,disconnected:pe,legacy:W,"browser-encrypted":O,"account-trusted":de,"native-verified":D};function dt(e){let t=(0,q.c)(9),{indicator:n,className:r,testId:i}=e,a;t[0]===n?a=t[1]:(a=Ke(n),t[0]=n,t[1]=a);let{glyph:o,iconClassName:s}=a,c=ut[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,K.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 ft(e){let t=(0,q.c)(3),{node:n}=e;if(n.revokedAt){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.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,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400`,children:[(0,K.jsx)(he,{"aria-hidden":!0,className:`size-3.5`}),` Online`]}):(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,K.jsx)(pe,{"aria-hidden":!0,className:`size-3.5`}),` Offline`]}),t[1]=n.presence.online,t[2]=r),r}function pt(){let e=(0,q.c)(7),t=T(),n;e[0]===t?n=e[1]:(n=async e=>{ze(e.id)||(await t({to:`/`,replace:!0}),await A.selectNode(e.id))},e[0]=t,e[1]=n);let r=n,i;e[2]===t?i=e[3]:(i=async()=>{Be()||(await t({to:`/`,replace:!0}),await A.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 mt(){let e=(0,q.c)(5),t=u(_t),n=u(gt);if(t!==`delivery-unknown`)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.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.`,o=n?`Acknowledge`:`Synchronizing…`,s;return e[1]!==i||e[2]!==a||e[3]!==o?(s=(0,K.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,K.jsx)(m,{className:`mt-2`,size:`sm`,variant:`outline`,disabled:i,title:a,onClick:ht,children:o})]}),e[1]=i,e[2]=a,e[3]=o,e[4]=s):s=e[4],s}function ht(){return A.acknowledgeDeliveryUnknown()}function gt(e){return e.sessionRecoveredAfterUnknown}function _t(e){return e.sessionStatus}function vt(){let e=(0,q.c)(62),t=u(kt),n=u(Ot),r=u(Dt),i=u(Et),a=u(Tt),o=u(wt),s=u(Ct),c=u(St),l=u(xt),d=oe(),{switchNode:f,returnToAllNodes:h}=pt(),g=(0,J.useRef)(null);if(!t)return null;let _,v;if(e[0]!==l||e[1]!==d||e[2]!==a||e[3]!==i||e[4]!==r){let t={browserStatus:l,sessionStatus:i,selectionStatus:a,transportStatus:r,e2eeStatus:d};_=se(t),v=le(t),e[0]=l,e[1]=d,e[2]=a,e[3]=i,e[4]=r,e[5]=_,e[6]=v}else _=e[5],v=e[6];let y=v,b;e[7]===y?b=e[8]:(b=(0,K.jsx)(dt,{indicator:y,className:`size-4`}),e[7]=y,e[8]=b);let x;e[9]===t.label?x=e[10]:(x=(0,K.jsx)(`span`,{className:`max-w-32 truncate font-medium`,children:t.label}),e[9]=t.label,e[10]=x);let S;e[11]===_?S=e[12]:(S=(0,K.jsx)(`span`,{className:`max-w-24 truncate text-xs text-muted-foreground`,children:_}),e[11]=_,e[12]=S);let C;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(p,{"aria-hidden":!0,className:`size-3.5 transition-transform group-open:rotate-180`}),e[13]=C):C=e[13];let w;e[14]!==b||e[15]!==x||e[16]!==S?(w=(0,K.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:[b,x,S,C]}),e[14]=b,e[15]=x,e[16]=S,e[17]=w):w=e[17];let T;e[18]===t.label?T=e[19]:(T=(0,K.jsx)(`p`,{className:`font-medium`,children:t.label}),e[18]=t.label,e[19]=T);let E=s??`Role unavailable`,D;e[20]!==_||e[21]!==E?(D=(0,K.jsxs)(`p`,{className:`mt-0.5 text-xs capitalize text-muted-foreground`,children:[E,` · `,_]}),e[20]=_,e[21]=E,e[22]=D):D=e[22];let O;e[23]!==t.label||e[24]!==_?(O=(0,K.jsxs)(`p`,{className:`sr-only`,"aria-live":`polite`,children:[`Node `,t.label,`: `,_,`.`]}),e[23]=t.label,e[24]=_,e[25]=O):O=e[25];let k;e[26]===c?k=e[27]:(k=c?(0,K.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:c}):null,e[26]=c,e[27]=k);let A;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(mt,{}),e[28]=A):A=e[28];let j;e[29]===h?j=e[30]:(j=()=>void h(),e[29]=h,e[30]=j);let re;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,K.jsx)(fe,{"aria-hidden":!0,className:`size-4`}),e[31]=re):re=e[31];let M;e[32]===j?M=e[33]:(M=(0,K.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]!==l||e[35]!==o||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]!==l||e[43]!==o||e[44]!==f?(i=e=>(0,K.jsxs)(`button`,{type:`button`,disabled:o!==`ready`||l!==`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,K.jsx)(`span`,{className:`truncate`,children:e.label}),(0,K.jsx)(ft,{node:e})]},e.id),e[42]=l,e[43]=o,e[44]=f,e[45]=i):i=e[45],N=n.filter(r).map(i),e[34]=l,e[35]=o,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,K.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,K.jsxs)(m,{size:`sm`,variant:`outline`,onClick:bt,children:[(0,K.jsx)(te,{"aria-hidden":!0}),` Refresh`]}),e[49]=F):F=e[49];let ie;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,K.jsxs)(m,{size:`sm`,variant:`ghost`,onClick:yt,children:[(0,K.jsx)(ee,{"aria-hidden":!0}),` Sign out`]}),e[50]=ie):ie=e[50];let I;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 border-t border-border pt-3`,children:[F,ie,(0,K.jsxs)(m,{size:`sm`,variant:`ghost`,onClick:()=>{g.current&&(g.current.open=!1),ae({kind:`account`,section:`security`})},children:[(0,K.jsx)(ne,{"aria-hidden":!0}),` Security details`]})]}),e[51]=I):I=e[51];let L;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 border-t border-border pt-3`,children:[(0,K.jsx)(qe,{}),(0,K.jsx)(ot,{compact:!0})]}),e[52]=L):L=e[52];let R;e[53]!==k||e[54]!==P||e[55]!==T||e[56]!==D||e[57]!==O?(R=(0,K.jsxs)(`div`,{className:`absolute right-0 z-50 mt-2 w-72 rounded-xl border border-border bg-popover p-3 shadow-xl`,children:[T,D,O,k,A,P,I,L]}),e[53]=k,e[54]=P,e[55]=T,e[56]=D,e[57]=O,e[58]=R):R=e[58];let z;return e[59]!==R||e[60]!==w?(z=(0,K.jsx)(`div`,{className:`relative max-w-full`,children:(0,K.jsxs)(`details`,{ref:g,className:`group relative`,children:[w,R]})}),e[59]=R,e[60]=w,e[61]=z):z=e[61],z}function yt(){A.signOut()}function bt(){A.refreshDirectory()}function xt(e){return e.browserStatus}function St(e){return e.errorMessage}function Ct(e){return e.effectiveRole}function wt(e){return e.directoryStatus}function Tt(e){return e.selectionStatus}function Et(e){return e.sessionStatus}function Dt(e){return e.transportStatus}function Ot(e){return e.nodes}function kt(e){return e.selectedNode}function At(e){let t=(0,q.c)(66),{open:n,onOpenChange:r}=e,i=u(Vt),a=u(Bt),o=u(zt),s=u(Rt),c=u(Lt),l=u(It),d=u(Ft),f=u(Pt),p=u(Nt),h=oe(),{switchNode:g,returnToAllNodes:_}=pt();if(!i)return null;let v,y;if(t[0]!==p||t[1]!==h||t[2]!==c||t[3]!==s||t[4]!==o){let e={browserStatus:p,sessionStatus:s,selectionStatus:c,transportStatus:o,e2eeStatus:h};v=se(e),y=le(e),t[0]=p,t[1]=h,t[2]=c,t[3]=s,t[4]=o,t[5]=v,t[6]=y}else v=t[5],y=t[6];let b=y,x=l!==`ready`||p!==`current`,S;t[7]===b?S=t[8]:(S=(0,K.jsx)(dt,{indicator:b,className:`size-4`}),t[7]=b,t[8]=S);let C;t[9]===i.label?C=t[10]:(C=(0,K.jsx)(`span`,{className:`truncate`,children:i.label}),t[9]=i.label,t[10]=C);let w;t[11]!==S||t[12]!==C?(w=(0,K.jsxs)(P,{className:`flex items-center gap-2`,children:[S,C]}),t[11]=S,t[12]=C,t[13]=w):w=t[13];let T=d??`Role unavailable`,E;t[14]!==v||t[15]!==T?(E=(0,K.jsxs)(N,{className:`capitalize`,children:[T,` · `,v]}),t[14]=v,t[15]=T,t[16]=E):E=t[16];let D;t[17]!==i.label||t[18]!==v?(D=(0,K.jsxs)(`p`,{className:`sr-only`,"aria-live":`polite`,children:[`Node `,i.label,`: `,v,`.`]}),t[17]=i.label,t[18]=v,t[19]=D):D=t[19];let O;t[20]!==w||t[21]!==E||t[22]!==D?(O=(0,K.jsxs)(M,{children:[w,E,D]}),t[20]=w,t[21]=E,t[22]=D,t[23]=O):O=t[23];let k;t[24]===f?k=t[25]:(k=f?(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:f}):null,t[24]=f,t[25]=k);let A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(mt,{}),t[26]=A):A=t[26];let j;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[27]=j):j=t[27];let I;t[28]===r?I=t[29]:(I=(0,K.jsx)(F,{label:`Security details`,icon:j,onClick:()=>{r(!1),ae({kind:`account`,section:`security`})}}),t[28]=r,t[29]=I);let L;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,K.jsx)(fe,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[30]=L):L=t[30];let R;t[31]!==r||t[32]!==_?(R=(0,K.jsx)(F,{label:`All nodes`,icon:L,onClick:()=>{r(!1),_()}}),t[31]=r,t[32]=_,t[33]=R):R=t[33];let z;if(t[34]!==i.id||t[35]!==a||t[36]!==r||t[37]!==g||t[38]!==x){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]!==g||t[44]!==x?(n=e=>(0,K.jsx)(F,{label:e.label,disabled:x||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,K.jsx)(ft,{node:e}),onClick:()=>{r(!1),g(e)}},e.id),t[42]=r,t[43]=g,t[44]=x,t[45]=n):n=t[45],z=a.filter(e).map(n),t[34]=i.id,t[35]=a,t[36]=r,t[37]=g,t[38]=x,t[39]=z}else z=t[39];let B;t[46]!==I||t[47]!==R||t[48]!==z?(B=(0,K.jsxs)(`div`,{className:`mt-3 space-y-1 border-t border-border pt-3`,children:[I,R,z]}),t[46]=I,t[47]=R,t[48]=z,t[49]=B):B=t[49];let ce=l===`loading`,ue;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,K.jsx)(te,{"aria-hidden":!0}),t[50]=ue):ue=t[50];let V;t[51]===ce?V=t[52]:(V=(0,K.jsxs)(m,{size:`sm`,variant:`outline`,className:`min-h-11`,disabled:ce,onClick:Mt,children:[ue,` Refresh nodes`]}),t[51]=ce,t[52]=V);let de;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,K.jsxs)(m,{size:`sm`,variant:`ghost`,className:`min-h-11`,onClick:jt,children:[(0,K.jsx)(ee,{"aria-hidden":!0}),` Sign out`]}),t[53]=de):de=t[53];let H;t[54]===V?H=t[55]:(H=(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 border-t border-border pt-3`,children:[V,de]}),t[54]=V,t[55]=H);let U;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,K.jsx)(`div`,{className:`mt-3 space-y-3 border-t border-border pt-3`,children:(0,K.jsx)(ot,{compact:!0})}),t[56]=U):U=t[56];let W;t[57]!==B||t[58]!==H||t[59]!==k?(W=(0,K.jsxs)(re,{children:[k,A,B,H,U]}),t[57]=B,t[58]=H,t[59]=k,t[60]=W):W=t[60];let G;return t[61]!==r||t[62]!==n||t[63]!==W||t[64]!==O?(G=(0,K.jsxs)(ie,{open:n,onOpenChange:r,label:`Connection`,children:[O,W]}),t[61]=r,t[62]=n,t[63]=W,t[64]=O,t[65]=G):G=t[65],G}function jt(){A.signOut()}function Mt(){A.refreshDirectory()}function Nt(e){return e.browserStatus}function Pt(e){return e.errorMessage}function Ft(e){return e.effectiveRole}function It(e){return e.directoryStatus}function Lt(e){return e.selectionStatus}function Rt(e){return e.sessionStatus}function zt(e){return e.transportStatus}function Bt(e){return e.nodes}function Vt(e){return e.selectedNode}function Ht(){let e=(0,q.c)(25),t=u(qt),n=u(Kt),r=u(Gt),i=u(Wt),a=u(Ut),o=oe(),[s,c]=(0,J.useState)(!1);if(!t)return null;let l,d;if(e[0]!==a||e[1]!==o||e[2]!==i||e[3]!==r||e[4]!==n){let t={browserStatus:a,sessionStatus:r,selectionStatus:i,transportStatus:n,e2eeStatus:o};l=se(t),d=le(t),e[0]=a,e[1]=o,e[2]=i,e[3]=r,e[4]=n,e[5]=l,e[6]=d}else l=e[5],d=e[6];let f=d,p;e[7]!==t.label||e[8]!==s||e[9]!==r||e[10]!==l?(p=s?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`hosted-connection-status-announcer`,className:`sr-only`,children:[`Node `,t.label,`: `,l,`.`]}),r===`delivery-unknown`?(0,K.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]=s,e[9]=r,e[10]=l,e[11]=p):p=e[11];let m=`Connection: ${t.label}, ${l}`,h;e[12]===f?h=e[13]:(h=(0,K.jsx)(dt,{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=()=>c(!0),e[14]=g):g=e[14];let _;e[15]!==f.shortLabel||e[16]!==m||e[17]!==h?(_=(0,K.jsx)(We,{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]===s?v=e[20]:(v=(0,K.jsx)(At,{open:s,onOpenChange:c}),e[19]=s,e[20]=v);let y;return e[21]!==p||e[22]!==_||e[23]!==v?(y=(0,K.jsxs)(K.Fragment,{children:[p,_,v]}),e[21]=p,e[22]=_,e[23]=v,e[24]=y):y=e[24],y}function Ut(e){return e.browserStatus}function Wt(e){return e.selectionStatus}function Gt(e){return e.sessionStatus}function Kt(e){return e.transportStatus}function qt(e){return e.selectedNode}function Jt(){let e=(0,q.c)(2),t=j(),n;return e[0]===t?n=e[1]:(n=t===`phone`?(0,K.jsx)(Ht,{}):(0,K.jsx)(vt,{}),e[0]=t,e[1]=n),n}export{pt as a,Te as c,He as d,Se as f,ft as i,ze as l,Ht as n,ot as o,pe as p,vt as r,at as s,Jt as t,xe as u};