ryco-cli 0.1.29 → 0.1.30

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 (278) hide show
  1. package/README.md +37 -0
  2. package/dist/{AcpAdapter-CG1wRWcf.mjs → AcpAdapter-CKWzfB3Q.mjs} +4 -4
  3. package/dist/{AcpAdapter-8CSe4HK7.cjs → AcpAdapter-DjP0IHpH.cjs} +6 -6
  4. package/dist/{AcpNativeLogging-DbjnRnTf.cjs → AcpNativeLogging-5gTPK9Fq.cjs} +1 -1
  5. package/dist/{AcpNativeLogging-B6TtnnKL.mjs → AcpNativeLogging-Do0LktDb.mjs} +1 -1
  6. package/dist/{AcpRegistryDriver-16ZTxUs3.cjs → AcpRegistryDriver-BblCFfev.cjs} +3 -3
  7. package/dist/{AcpRegistryDriver-DZFasKaz.mjs → AcpRegistryDriver-BzohT-PC.mjs} +3 -3
  8. package/dist/{AzureDevOpsSourceControlProvider-DmJD1-WL.cjs → AzureDevOpsSourceControlProvider-CKSvfuDS.cjs} +1 -1
  9. package/dist/{AzureDevOpsSourceControlProvider-d5Ogsspk.mjs → AzureDevOpsSourceControlProvider-DRWSXTml.mjs} +1 -1
  10. package/dist/{BitbucketSourceControlProvider-B-ZwKj72.cjs → BitbucketSourceControlProvider-Bvl_q1o2.cjs} +1 -1
  11. package/dist/{BitbucketSourceControlProvider-DplKc8Wo.mjs → BitbucketSourceControlProvider-D5UVAc9z.mjs} +1 -1
  12. package/dist/{ClaudeDriver-0gGVop27.mjs → ClaudeDriver-BuQ_azDw.mjs} +7 -7
  13. package/dist/{ClaudeDriver-r0lJ9vmE.cjs → ClaudeDriver-DZkz0QPr.cjs} +8 -8
  14. package/dist/{CodexDriver-bJAbhSwY.cjs → CodexDriver-6Ph2cjAW.cjs} +5 -5
  15. package/dist/{CodexDriver-baT02xVb.mjs → CodexDriver-Bi49RIL4.mjs} +4 -4
  16. package/dist/{CodexTextGeneration-Dwp6X3dq.mjs → CodexTextGeneration-C5TIspJA.mjs} +4 -4
  17. package/dist/{CodexTextGeneration-DFZ5y4gj.cjs → CodexTextGeneration-sXPR9eld.cjs} +4 -4
  18. package/dist/{CopilotDriver-C0OhnSB1.mjs → CopilotDriver-Bcdpz6U_.mjs} +5 -5
  19. package/dist/{CopilotDriver-B_jEqfYQ.cjs → CopilotDriver-D6P0xgRX.cjs} +5 -5
  20. package/dist/{CursorDriver-DinXkGP9.mjs → CursorDriver-CRnDGwEv.mjs} +6 -6
  21. package/dist/{CursorDriver-BBFEW7ZI.cjs → CursorDriver-DMJ7sGSx.cjs} +7 -7
  22. package/dist/{ForgejoSourceControlProvider-iG9o7aZB.cjs → ForgejoSourceControlProvider-D4jGdaJX.cjs} +1 -1
  23. package/dist/{ForgejoSourceControlProvider-Dr0fxfud.mjs → ForgejoSourceControlProvider-Dl_Fk3RY.mjs} +1 -1
  24. package/dist/{GitHubSourceControlProvider-CnIu0n2Y.mjs → GitHubSourceControlProvider-DnwKf0ap.mjs} +1 -1
  25. package/dist/{GitHubSourceControlProvider-L1yFpep4.cjs → GitHubSourceControlProvider-QMe-zymI.cjs} +1 -1
  26. package/dist/{GitLabSourceControlProvider-BZdwXdJl.mjs → GitLabSourceControlProvider-Cj07OTBD.mjs} +1 -1
  27. package/dist/{GitLabSourceControlProvider-CrcBR6KQ.cjs → GitLabSourceControlProvider-CvvN5pHt.cjs} +1 -1
  28. package/dist/{GrokDriver-pX-N6HGS.mjs → GrokDriver-Bvq1jP3S.mjs} +7 -7
  29. package/dist/{GrokDriver-D_Ylzh5z.cjs → GrokDriver-jy8JIvYY.cjs} +10 -10
  30. package/dist/{Metrics-Bf96NJ4j.cjs → Metrics-C0LSU8s7.cjs} +979 -976
  31. package/dist/{Metrics-BjqGlIP4.mjs → Metrics-CnmjpbWk.mjs} +979 -976
  32. package/dist/{NodeSqliteClient-BGg70C7Q.cjs → NodeSqliteClient-D8bzGgPN.cjs} +1 -1
  33. package/dist/{OpenCodeDriver-BFEw5t09.cjs → OpenCodeDriver-Bu5D19tl.cjs} +6 -6
  34. package/dist/{OpenCodeDriver-Byu1pf_i.mjs → OpenCodeDriver-DhyVaBMT.mjs} +5 -5
  35. package/dist/{SideQuestionIsolation-81IoAuoi.mjs → SideQuestionIsolation-B-aE6aBz.mjs} +1 -1
  36. package/dist/{SideQuestionIsolation-CMPkCUP0.cjs → SideQuestionIsolation-CtJ4wX83.cjs} +1 -1
  37. package/dist/bin.cjs +8564 -302
  38. package/dist/bin.mjs +8544 -265
  39. package/dist/client/assets/{AccountSettings-FN7pwqYA.js → AccountSettings-v6-r6gYl.js} +1 -1
  40. package/dist/client/assets/{AiFocusSettings-xcDAMaqH.js → AiFocusSettings-BVdLON0q.js} +1 -1
  41. package/dist/client/assets/{AnimatedHeight-BNg7wnTK.js → AnimatedHeight-UXn4-nUd.js} +1 -1
  42. package/dist/client/assets/{AppearanceSettings-BvsvAOsG.js → AppearanceSettings-DRChsQnN.js} +1 -1
  43. package/dist/client/assets/{BranchToolbar.logic-DFsXV3Qs.js → BranchToolbar.logic-YN3KjVr9.js} +1 -1
  44. package/dist/client/assets/{BrowserPanel-D-g_xDZs.js → BrowserPanel-Dxw3stFP.js} +1 -1
  45. package/dist/client/assets/{ChatRightPanel-Bm906qNi.js → ChatRightPanel-CygpcJiF.js} +5 -5
  46. package/dist/client/assets/{ChatThreadRouteView-CATwakjI.js → ChatThreadRouteView-DYLZFHu0.js} +1 -1
  47. package/dist/client/assets/{CommandPaletteDialog-Obv1bvxj.js → CommandPaletteDialog-BRvBzP1R.js} +1 -1
  48. package/dist/client/assets/{CompositeRoot-CfkIdky8.js → CompositeRoot-BeEGGWwn.js} +1 -1
  49. package/dist/client/assets/{ComputerUseSettings-ljYmTHea.js → ComputerUseSettings-Cq8Pi0ZU.js} +1 -1
  50. package/dist/client/assets/{ConnectionsSettings-CIXs7x_E.js → ConnectionsSettings-RSYtexxd.js} +2 -2
  51. package/dist/client/assets/{ContextHandoffEndpointLabel-BzI4Wi1i.js → ContextHandoffEndpointLabel-CeGDLNA4.js} +1 -1
  52. package/dist/client/assets/{DiagnosticsSettings-DGX_2T2M.js → DiagnosticsSettings-CDa6MVx4.js} +1 -1
  53. package/dist/client/assets/{DialogHandle-CTtSYpsC.js → DialogHandle-BE7egDQQ.js} +1 -1
  54. package/dist/client/assets/{DialogPopup-DdZlhHuQ.js → DialogPopup-NfwDyR5c.js} +1 -1
  55. package/dist/client/assets/DialogRoot-C4mtzigX.js +1 -0
  56. package/dist/client/assets/{DialogTitle-Du7CAbaO.js → DialogTitle-B_Q4DykI.js} +1 -1
  57. package/dist/client/assets/{DialogTrigger-VpFh8Xza.js → DialogTrigger-BSqd4Crj.js} +1 -1
  58. package/dist/client/assets/{DialogViewport-BwuqbGLY.js → DialogViewport-B6w_ROOE.js} +1 -1
  59. package/dist/client/assets/{DraftChatThreadRouteView-Cmc5HpWf.js → DraftChatThreadRouteView-JW_bXVrM.js} +1 -1
  60. package/dist/client/assets/{ExternalIdentityWeb.logic-DsTJQkg-.js → ExternalIdentityWeb.logic-BlKX8J9h.js} +1 -1
  61. package/dist/client/assets/{GlassSurface-BlWIlQ0s.js → GlassSurface-DDG4eTlj.js} +1 -1
  62. package/dist/client/assets/{HostedConnectionControls-ySHqwr4K.js → HostedConnectionControls-CscV6hm1.js} +1 -1
  63. package/dist/client/assets/{HostedHubRoot-Caz8PElK.js → HostedHubRoot-gp7-ClBP.js} +1 -1
  64. package/dist/client/assets/{HostedNativeAuthorizationRoute-BSq_AlY2.js → HostedNativeAuthorizationRoute-j7oSlakZ.js} +1 -1
  65. package/dist/client/assets/{HostedNodeRenameDialog-ChxJdr-Z.js → HostedNodeRenameDialog-D1DSiTpx.js} +1 -1
  66. package/dist/client/assets/{HostedRelayTrustNotice-DPVrIfj_.js → HostedRelayTrustNotice-B9jp4SRh.js} +1 -1
  67. package/dist/client/assets/{IntegrationsSettingsPanel-eAq5h-D5.js → IntegrationsSettingsPanel-DH7SfWtV.js} +1 -1
  68. package/dist/client/assets/{KeybindingsSettings-D1XaEVGH.js → KeybindingsSettings-DkgYYSHS.js} +1 -1
  69. package/dist/client/assets/{LazyBrowserPanel-B6POLJh3.js → LazyBrowserPanel-D4e76vc_.js} +1 -1
  70. package/dist/client/assets/{McpServersSettings-DqLA6n5v.js → McpServersSettings-Dc1kPa-X.js} +1 -1
  71. package/dist/client/assets/{MobileSheet-CtQIYRlY.js → MobileSheet-lT--mLEz.js} +1 -1
  72. package/dist/client/assets/{NodeSecuritySettings-Skm7GQDl.js → NodeSecuritySettings-DcfSx4KT.js} +1 -1
  73. package/dist/client/assets/{NullStore-b8PhjwPZ.js → NullStore-8d2s-Re3.js} +1 -1
  74. package/dist/client/assets/{OnboardingDialog-8-fKvY5H.js → OnboardingDialog-CnLjwM6Z.js} +1 -1
  75. package/dist/client/assets/{OpinionatedPluginsSettings-BIJfJ34L.js → OpinionatedPluginsSettings-BTJyS3rN.js} +1 -1
  76. package/dist/client/assets/{PdfAttachmentPreview-CTo1AyZs.js → PdfAttachmentPreview-C8-hT8KQ.js} +1 -1
  77. package/dist/client/assets/{PhoneGetAppInterstitial-DwopOWnQ.js → PhoneGetAppInterstitial-Zh0zpBgT.js} +1 -1
  78. package/dist/client/assets/{PhoneHome-CUzxhhR4.js → PhoneHome-CIMkuDJF.js} +1 -1
  79. package/dist/client/assets/{PhoneSettingsSurface-BK2RHmYJ.js → PhoneSettingsSurface-CfZQxJNI.js} +1 -1
  80. package/dist/client/assets/{ProvidersSettingsPanel-DPxL7AsR.js → ProvidersSettingsPanel-DAVSiwE1.js} +1 -1
  81. package/dist/client/assets/{QuitShortcutFeedback-eCvP_MNj.js → QuitShortcutFeedback-Qs9XsuZ4.js} +1 -1
  82. package/dist/client/assets/{RedactedSensitiveText-DH4mWpB6.js → RedactedSensitiveText-BHGbQJwB.js} +1 -1
  83. package/dist/client/assets/{RootAppShell-DwiWD4Cy.js → RootAppShell-T056pByH.js} +2 -2
  84. package/dist/client/assets/{Separator-BiINUUQl.js → Separator-B6Esv57Y.js} +1 -1
  85. package/dist/client/assets/{SettingsDialog-CE8qy0qL.js → SettingsDialog-BERU2Qg7.js} +1 -1
  86. package/dist/client/assets/{SettingsPanels-BYknk6GO.js → SettingsPanels-De_XZOQF.js} +1 -1
  87. package/dist/client/assets/{SettingsPanels.editor-64bM0lhg.js → SettingsPanels.editor-Dkva9gX_.js} +1 -1
  88. package/dist/client/assets/{SourceControlSettings-BbveiAj3.js → SourceControlSettings-B4HS17cB.js} +1 -1
  89. package/dist/client/assets/{StatisticsPage-CAO_tCeC.js → StatisticsPage-Bj2ftFdH.js} +1 -1
  90. package/dist/client/assets/{StatisticsPanel-SNlgMv2o.js → StatisticsPanel-Dw7GBBmd.js} +1 -1
  91. package/dist/client/assets/{StatisticsSettingsLink-BpkNubL2.js → StatisticsSettingsLink-_XL3ABoI.js} +1 -1
  92. package/dist/client/assets/{ThreadTerminalDrawer-9x_kqQPy.js → ThreadTerminalDrawer-CPPzQSXN.js} +1 -1
  93. package/dist/client/assets/{ThreadWorkspacePanel-BXE17C4x.js → ThreadWorkspacePanel-DWKU7Omm.js} +1 -1
  94. package/dist/client/assets/{abnfDiagram-N423BO3Z-DAmGykdr.js → abnfDiagram-N423BO3Z-ByEe3mC0.js} +1 -1
  95. package/dist/client/assets/{activity-DRZlu-MC.js → activity-CwTUF6lv.js} +1 -1
  96. package/dist/client/assets/{alert-CwrDisFU.js → alert-DQEkrtUJ.js} +1 -1
  97. package/dist/client/assets/{appChrome-B_VWWDFj.js → appChrome-TkWLAGxk.js} +1 -1
  98. package/dist/client/assets/architecture-7GRP2DOG-HS59zfrk.js +1 -0
  99. package/dist/client/assets/{architectureDiagram-T3A2C74G-DypU2ERW.js → architectureDiagram-T3A2C74G-Bd-yxaTr.js} +1 -1
  100. package/dist/client/assets/{arrow-left-XhcJWpRy.js → arrow-left-DUOpzEbP.js} +1 -1
  101. package/dist/client/assets/{arrow-right-BBs6iTUL.js → arrow-right-HOYJnPKw.js} +1 -1
  102. package/dist/client/assets/{arrow-up-right-CJ9Vq7nK.js → arrow-up-right-DHnMKuVA.js} +1 -1
  103. package/dist/client/assets/{authorization-BugIGt5e.js → authorization-D8dOcEYq.js} +1 -1
  104. package/dist/client/assets/{badge-BswOCwph.js → badge-2AZ3HfVS.js} +1 -1
  105. package/dist/client/assets/{blockDiagram-VBNYF7ZC-B9MhR9hY.js → blockDiagram-VBNYF7ZC-CPDBonMC.js} +1 -1
  106. package/dist/client/assets/{bot-D5wgL7pu.js → bot-DxjPA7Bw.js} +1 -1
  107. package/dist/client/assets/{c4Diagram-5PPSVZJV-C22FWSoE.js → c4Diagram-5PPSVZJV-BM6pAiqT.js} +1 -1
  108. package/dist/client/assets/{capabilities-Bj_X9FZ-.js → capabilities-CsHjxjab.js} +1 -1
  109. package/dist/client/assets/channel-Dn3_cOkm.js +1 -0
  110. package/dist/client/assets/{chart-column-D6Lnkklk.js → chart-column-Cg7d41tb.js} +1 -1
  111. package/dist/client/assets/chevron-right-Dsw16yGn.js +1 -0
  112. package/dist/client/assets/{chunk-2GRJ4B5K-D1tZuCzA.js → chunk-2GRJ4B5K-DVKozJ41.js} +1 -1
  113. package/dist/client/assets/{chunk-4I5QYGJK-Clf86zK0.js → chunk-4I5QYGJK-BRoMwPkW.js} +1 -1
  114. package/dist/client/assets/{chunk-5RXB4S5H-B36N5RYZ.js → chunk-5RXB4S5H-DFMKyoqP.js} +1 -1
  115. package/dist/client/assets/{chunk-6Q2QTUOP-IAxdzsQJ.js → chunk-6Q2QTUOP-Ba6UENe9.js} +1 -1
  116. package/dist/client/assets/{chunk-7Z6QIM7H-Ctqebv_4.js → chunk-7Z6QIM7H-B87gYLWH.js} +1 -1
  117. package/dist/client/assets/{chunk-GF5L2VYU-CAfciJae.js → chunk-GF5L2VYU-DZ840GRQ.js} +1 -1
  118. package/dist/client/assets/{chunk-I66GZJ75-BZ7XtZf4.js → chunk-I66GZJ75-BO6p4Aqg.js} +1 -1
  119. package/dist/client/assets/{chunk-JQJVKLGR-DVuZCWnv.js → chunk-JQJVKLGR-5dTfVinz.js} +1 -1
  120. package/dist/client/assets/{chunk-KBJHAD2P-DtWbzsRm.js → chunk-KBJHAD2P-BeWfBZdP.js} +1 -1
  121. package/dist/client/assets/{chunk-NSK5VX7P-BVMz_Hc4.js → chunk-NSK5VX7P-DuRkdn5k.js} +1 -1
  122. package/dist/client/assets/{chunk-QR6OTTB3-DWitTCy-.js → chunk-QR6OTTB3-Duz4Y_uE.js} +1 -1
  123. package/dist/client/assets/{chunk-UBXNYLIW-BuxXXP2s.js → chunk-UBXNYLIW-D-z8URgN.js} +1 -1
  124. package/dist/client/assets/{chunk-W5SLKNZC-Bnf3sQl4.js → chunk-W5SLKNZC-AGjFjjoJ.js} +1 -1
  125. package/dist/client/assets/{chunk-WRU74C26-xu-KDOon.js → chunk-WRU74C26-BgY3UiXB.js} +1 -1
  126. package/dist/client/assets/classDiagram-JCYQIIEL-ZQvrS8No.js +1 -0
  127. package/dist/client/assets/classDiagram-v2-OCEON4UE-ZQvrS8No.js +1 -0
  128. package/dist/client/assets/{clipboard-copy-oDSkUUg4.js → clipboard-copy-BWf3JuTE.js} +1 -1
  129. package/dist/client/assets/{cynefin-OW5HDTMX-DGNyiNSf.js → cynefin-OW5HDTMX-BuOAGqlK.js} +1 -1
  130. package/dist/client/assets/{cynefinDiagram-MW4NZA55-_ctibv4i.js → cynefinDiagram-MW4NZA55-DqV0Aokp.js} +1 -1
  131. package/dist/client/assets/{dagre-VZM6K2ZE-Bo-bS1Y0.js → dagre-VZM6K2ZE-D_GFquDW.js} +1 -1
  132. package/dist/client/assets/{data-list-DLsM39Hp.js → data-list-BJCq3CVP.js} +1 -1
  133. package/dist/client/assets/{desktopWorkspace-Ocqt625W.js → desktopWorkspace-_iM6B9Kf.js} +1 -1
  134. package/dist/client/assets/{deviceName-z0ZWSq0z.js → deviceName-C2N8ZRX3.js} +1 -1
  135. package/dist/client/assets/{diagram-7IWD3JNH-DSjtw1SY.js → diagram-7IWD3JNH-B1wlsNg2.js} +1 -1
  136. package/dist/client/assets/{diagram-B4RE2ZJO-B7fWEvIa.js → diagram-B4RE2ZJO-D-CYoym7.js} +1 -1
  137. package/dist/client/assets/{diagram-LBJQPF4R-trRYCE5d.js → diagram-LBJQPF4R-DqJ9NCqt.js} +1 -1
  138. package/dist/client/assets/{diagram-Q27KOJAE-_DYcRggk.js → diagram-Q27KOJAE-3yp1D2u4.js} +1 -1
  139. package/dist/client/assets/{diagram-UB23O5K3-BkMzOHX8.js → diagram-UB23O5K3-Byp25nGC.js} +1 -1
  140. package/dist/client/assets/{download-CHdS3R_v.js → download-DsYNYJeu.js} +1 -1
  141. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-DubiOMCG.js → ebnfDiagram-BXEA7PRR-B_IM1l6o.js} +1 -1
  142. package/dist/client/assets/{editorPreferences-DVhg0CXd.js → editorPreferences-D8q1ItMW.js} +1 -1
  143. package/dist/client/assets/{empty-BlBl_Vvw.js → empty-BbJHvskr.js} +1 -1
  144. package/dist/client/assets/{erDiagram-JOGREHBK-CFDiNfSJ.js → erDiagram-JOGREHBK--OtcrCRJ.js} +1 -1
  145. package/dist/client/assets/eventmodeling-NTZA5JFV-Dj71kuPV.js +1 -0
  146. package/dist/client/assets/flowDiagram-UKHOOZJN-BaAiwuvL.js +1 -0
  147. package/dist/client/assets/{ganttDiagram-PKOTCBZU-DT2XhE-m.js → ganttDiagram-PKOTCBZU-w0seBi3Q.js} +1 -1
  148. package/dist/client/assets/{gitGraph-4MIJSDKK-BI5UGiqb.js → gitGraph-4MIJSDKK-BOJ0lcSW.js} +1 -1
  149. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-CzAB97Rd.js → gitGraphDiagram-DS77QQ5N-BMfOCCYn.js} +1 -1
  150. package/dist/client/assets/{group-DZJuSiJL.js → group-tVMKGp7Q.js} +1 -1
  151. package/dist/client/assets/{hostedConnectionCoordinator-BztHfGNt.js → hostedConnectionCoordinator-BuRWCvUG.js} +1 -1
  152. package/dist/client/assets/hostedPairing-5n5srRC9.js +1 -0
  153. package/dist/client/assets/{hubRoutes-DExWSvVE.js → hubRoutes-jcMPIFy3.js} +1 -1
  154. package/dist/client/assets/{index-BAJdq3TK.js → index-BqZvnGNr.js} +1 -1
  155. package/dist/client/assets/{info-A6RAGUB7-DdGYYgLX.js → info-A6RAGUB7-acjBTQ5o.js} +1 -1
  156. package/dist/client/assets/{infoDiagram-6WML65LV-zhUpER6a.js → infoDiagram-6WML65LV-DB01Nc2m.js} +1 -1
  157. package/dist/client/assets/{input-CzU08wbL.js → input-BDWSVClC.js} +1 -1
  158. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-BQLkqykE.js → ishikawaDiagram-WSZJBQD7-KhZTvm-J.js} +1 -1
  159. package/dist/client/assets/{journeyDiagram-NVQOT4AX-DBgsbKOF.js → journeyDiagram-NVQOT4AX-C3JCYk-2.js} +1 -1
  160. package/dist/client/assets/{kanban-definition-27J2QSJJ-DF-Rr-xs.js → kanban-definition-27J2QSJJ-Dbo0C1s6.js} +1 -1
  161. package/dist/client/assets/{kbd-DKuvGqFP.js → kbd-Dxm5Elqj.js} +1 -1
  162. package/dist/client/assets/{key-round-CvyrSjb2.js → key-round-CETZqe3h.js} +1 -1
  163. package/dist/client/assets/{layers-CwP65mnC.js → layers-Dqez1Uq8.js} +1 -1
  164. package/dist/client/assets/{log-out-D3rICSt5.js → log-out-D5-aSBAz.js} +1 -1
  165. package/dist/client/assets/{logging-C6tXZlGQ.js → logging-B_qXVrk6.js} +1 -1
  166. package/dist/client/assets/{main-RFllWEko.js → main-DAbEANjY.js} +2 -2
  167. package/dist/client/assets/{mermaid-parser.core-BiGKtilP.js → mermaid-parser.core-B6Q-3x_q.js} +2 -2
  168. package/dist/client/assets/{mermaidEngine-Cjfgf3Bg.js → mermaidEngine-DksLcesB.js} +3 -3
  169. package/dist/client/assets/{mindmap-definition-FAOFIHXS-SiU9JwWJ.js → mindmap-definition-FAOFIHXS-LaMzRxqw.js} +1 -1
  170. package/dist/client/assets/{motion-C9rN_t9p.js → motion-BdscFixQ.js} +1 -1
  171. package/dist/client/assets/{packet-AYTQ26CC-F-HuW5Dr.js → packet-AYTQ26CC-BHhg59Si.js} +1 -1
  172. package/dist/client/assets/{pairingUrl-rQM9kSGT.js → pairingUrl-Dn1e2CVw.js} +1 -1
  173. package/dist/client/assets/{palette-gaqgtube.js → palette-92ylWqeC.js} +1 -1
  174. package/dist/client/assets/{pegDiagram-VL7TDLO6-cC-QUd7I.js → pegDiagram-VL7TDLO6-s7l7UD9d.js} +1 -1
  175. package/dist/client/assets/{pie-WAS4IAKB-BI3XUcLN.js → pie-WAS4IAKB-DygX31Z9.js} +1 -1
  176. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-BP4gJ4ZK.js → pieDiagram-7S7Q4E2Y-bb6I9TtZ.js} +1 -1
  177. package/dist/client/assets/{play-BJZrOx6T.js → play-DUvOxTpL.js} +1 -1
  178. package/dist/client/assets/{primary-CQh_KHGG.js → primary-DZjgHvyf.js} +3 -3
  179. package/dist/client/assets/{providerDriverMeta-LJ2vJxm-.js → providerDriverMeta-T2YbXzuS.js} +1 -1
  180. package/dist/client/assets/{qr-code-Cmfz5JKf.js → qr-code-D4CtBq2F.js} +1 -1
  181. package/dist/client/assets/{qr-code-BFO8lV1M.js → qr-code-dbkTo07n.js} +1 -1
  182. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-DO-N1m-q.js → quadrantDiagram-CIZ2JOQS-Cj1Y68ZF.js} +1 -1
  183. package/dist/client/assets/{radar-RG4KPBEZ-CfayXQ5F.js → radar-RG4KPBEZ-FHM3ftPp.js} +1 -1
  184. package/dist/client/assets/{radio-group-BueX1AVO.js → radio-group-CRnHYWa8.js} +1 -1
  185. package/dist/client/assets/{railroad-74A4TZTK-CT6f-etT.js → railroad-74A4TZTK-CPMn18Cm.js} +1 -1
  186. package/dist/client/assets/railroad-abnf-HS5TGJTU-DxU7Mt1k.js +1 -0
  187. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BYAPVjRd.js +1 -0
  188. package/dist/client/assets/railroad-peg-WCYAUIDC-BOqgR_X7.js +1 -0
  189. package/dist/client/assets/{railroadDiagram-AXF67PYL-DC8egbob.js → railroadDiagram-AXF67PYL-DyV3SuDj.js} +1 -1
  190. package/dist/client/assets/{refresh-cw-K_hU8_ld.js → refresh-cw-CgDa2Ok_.js} +1 -1
  191. package/dist/client/assets/{requirementDiagram-LRYGKXZP-DJMzcLk_.js → requirementDiagram-LRYGKXZP-_xEAGWaH.js} +1 -1
  192. package/dist/client/assets/runtime-BwHA1GUS.js +18 -0
  193. package/dist/client/assets/{sankeyDiagram-W5VNT64P-YR6aIYLj.js → sankeyDiagram-W5VNT64P-Clf6oTLi.js} +1 -1
  194. package/dist/client/assets/{save-Mh-PA_2P.js → save-C8h0AMdl.js} +1 -1
  195. package/dist/client/assets/{scroll-area-BC-LB_zE.js → scroll-area-7n2X_RLQ.js} +1 -1
  196. package/dist/client/assets/{scrollEdges-Zcpuz3un.js → scrollEdges-BXYnwntN.js} +1 -1
  197. package/dist/client/assets/{separator-yx1r9ZDw.js → separator-CL1qjMqJ.js} +1 -1
  198. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-BVeSqWDA.js → sequenceDiagram-SI44F4Z6-CcYtQLSe.js} +1 -1
  199. package/dist/client/assets/{settingsLayout-BbjDM-p0.js → settingsLayout-DxsFwhF0.js} +1 -1
  200. package/dist/client/assets/{sheet-CpEwjOWn.js → sheet-CGiaw8-i.js} +1 -1
  201. package/dist/client/assets/{shield-i098Bm_B.js → shield-DPC4oHTi.js} +1 -1
  202. package/dist/client/assets/{shield-alert-CXmR7fM9.js → shield-alert-CwH36qZb.js} +1 -1
  203. package/dist/client/assets/{shield-check-CdFhWT_o.js → shield-check-CGD7sEeF.js} +1 -1
  204. package/dist/client/assets/{sidebar-DayQTDZp.js → sidebar-Cc6ANbOP.js} +1 -1
  205. package/dist/client/assets/{sidebarProjectFolders-DXqx3OlZ.js → sidebarProjectFolders-DO2Uv84F.js} +1 -1
  206. package/dist/client/assets/{sidebarStatusText-kdA6QMZS.js → sidebarStatusText-B4AtFXZo.js} +1 -1
  207. package/dist/client/assets/{sidebarUndo-BHFfJj0k.js → sidebarUndo-gdSrfa4O.js} +1 -1
  208. package/dist/client/assets/{skeleton-BwFgUtuE.js → skeleton-rS3IgBob.js} +1 -1
  209. package/dist/client/assets/{smartphone-DGfizz51.js → smartphone-DgVJfbv3.js} +1 -1
  210. package/dist/client/assets/square-Cr9X8U6y.js +1 -0
  211. package/dist/client/assets/{src-DHNjfMxR.js → src-C3Y_imaX.js} +1 -1
  212. package/dist/client/assets/{star-J3x3fktG.js → star-Cqay-Cae.js} +1 -1
  213. package/dist/client/assets/{stateDiagram-OKZ733FA-DoIZN669.js → stateDiagram-OKZ733FA-DEKURpRP.js} +1 -1
  214. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CWtHILqh.js +1 -0
  215. package/dist/client/assets/storeSelectors-CTDWheMy.js +1 -0
  216. package/dist/client/assets/{swimlanes-SLNWSIFB-BoFLigyK.js → swimlanes-SLNWSIFB-DrR6sbi6.js} +1 -1
  217. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DuaPce9O.js +8 -0
  218. package/dist/client/assets/{switch-D9inWKdd.js → switch-DnpJB2xv.js} +1 -1
  219. package/dist/client/assets/{timeline-definition-Z64GVDOM-D65EmNWc.js → timeline-definition-Z64GVDOM-bQJvmJx5.js} +1 -1
  220. package/dist/client/assets/{toggle-wMq3LLn1.js → toggle-D10FsFoE.js} +1 -1
  221. package/dist/client/assets/{toggle-group-YNqzWsK0.js → toggle-group-BhzbQPEQ.js} +1 -1
  222. package/dist/client/assets/{tokenModePresentation-C0-NgmX5.js → tokenModePresentation-BkS-mry_.js} +1 -1
  223. package/dist/client/assets/{tooltip-mwOCSCXF.js → tooltip-BlweKBxc.js} +1 -1
  224. package/dist/client/assets/{treeView-Q6P3EWNA-C2S-OPgI.js → treeView-Q6P3EWNA-D4Ex5QTp.js} +1 -1
  225. package/dist/client/assets/{treemap-WGGIJYW6-6Ovsu9iH.js → treemap-WGGIJYW6-C4B6Y6qM.js} +1 -1
  226. package/dist/client/assets/{unplug-BEfcl9Ht.js → unplug-B1dczi-t.js} +1 -1
  227. package/dist/client/assets/{usage-DF8oQrsy.js → usage-BBwaxMif.js} +1 -1
  228. package/dist/client/assets/useAppSidebarCollapsed-CFy476E3.js +1 -0
  229. package/dist/client/assets/useBaseUiId-DKOjzmu3.js +1 -0
  230. package/dist/client/assets/{useLabelableId-C8bc9a0F.js → useLabelableId-DQbY2GG1.js} +1 -1
  231. package/dist/client/assets/{useNavigate-01O5dMQe.js → useNavigate-B8oXtF30.js} +1 -1
  232. package/dist/client/assets/{usePhoneThreadActions-BIdh81kF.js → usePhoneThreadActions-6DCLiyJ5.js} +1 -1
  233. package/dist/client/assets/{usePopupViewport-DYYZwfTW.js → usePopupViewport-CNWcP7Od.js} +1 -1
  234. package/dist/client/assets/{useScrollLock-BO185DkJ.js → useScrollLock-BbKeKZdj.js} +1 -1
  235. package/dist/client/assets/{useStatistics-D55-xLMz.js → useStatistics-B76_r68I.js} +1 -1
  236. package/dist/client/assets/{useTriggerFocusGuards-CMLVr18J.js → useTriggerFocusGuards-BC4Wb3GI.js} +1 -1
  237. package/dist/client/assets/{useValueChanged-DSyRHPje.js → useValueChanged-BkTbyZdO.js} +1 -1
  238. package/dist/client/assets/{user-round-C-U7TZKG.js → user-round-CLy1Qy1Y.js} +1 -1
  239. package/dist/client/assets/{vennDiagram-T6HMQDX7-fZAexcYr.js → vennDiagram-T6HMQDX7-8iiroXim.js} +1 -1
  240. package/dist/client/assets/{vscode-icons-BYX6fBsM.js → vscode-icons-CJBVQtq5.js} +1 -1
  241. package/dist/client/assets/{wardley-WFR3VGLG-gdYWSMxK.js → wardley-WFR3VGLG-DpyNUbTc.js} +1 -1
  242. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-iDJxQb70.js → wardleyDiagram-T6FBY63Y-CI7is3QO.js} +1 -1
  243. package/dist/client/assets/{workspaceMetadataProjection-So9-wSEZ.js → workspaceMetadataProjection-aqZEXDrQ.js} +1 -1
  244. package/dist/client/assets/{wrench-D79uBUSl.js → wrench-7pbbxqrZ.js} +1 -1
  245. package/dist/client/assets/{xychartDiagram-ELKLHX3M-B4cfMwpJ.js → xychartDiagram-ELKLHX3M-BTEX3m2y.js} +1 -1
  246. package/dist/client/index.html +1 -1
  247. package/dist/{deviceHostWorker-CYnrwfrv.cjs → deviceHostWorker-D4HauWIV.cjs} +1 -1
  248. package/dist/{git-BKwGfw8A.mjs → git-9xWsJYIH.mjs} +1 -1
  249. package/dist/{git-Dn5wrgFY.cjs → git-xIkXFy_l.cjs} +2 -2
  250. package/dist/{makeManagedServerProvider-B_lPFNpL.mjs → makeManagedServerProvider-B90UKjnv.mjs} +1 -1
  251. package/dist/{makeManagedServerProvider-CUwxc0Pn.cjs → makeManagedServerProvider-CF776SAO.cjs} +2 -2
  252. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  253. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  254. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  255. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  256. package/dist/{rolldown-runtime-LGfotAqq.cjs → rolldown-runtime-HbSU0i7K.cjs} +7 -0
  257. package/dist/{src-BzVJd3Me.cjs → src-CARHuYkT.cjs} +1059 -178
  258. package/dist/{src-7E1M4gTQ.mjs → src-CtsgPPhb.mjs} +198 -97
  259. package/package.json +1 -1
  260. package/dist/client/assets/DialogRoot-k2_0SNKA.js +0 -1
  261. package/dist/client/assets/architecture-7GRP2DOG-CQNNG5gU.js +0 -1
  262. package/dist/client/assets/channel-BtX-w3CK.js +0 -1
  263. package/dist/client/assets/chevron-right-Ddq5gL-L.js +0 -1
  264. package/dist/client/assets/classDiagram-JCYQIIEL-BgDa3HFl.js +0 -1
  265. package/dist/client/assets/classDiagram-v2-OCEON4UE-BgDa3HFl.js +0 -1
  266. package/dist/client/assets/eventmodeling-NTZA5JFV-DpzGHjmu.js +0 -1
  267. package/dist/client/assets/flowDiagram-UKHOOZJN-CaDVMm72.js +0 -1
  268. package/dist/client/assets/hostedPairing-CqhLPQqG.js +0 -1
  269. package/dist/client/assets/railroad-abnf-HS5TGJTU-B890iayj.js +0 -1
  270. package/dist/client/assets/railroad-ebnf-LZEXJU2U-C079Tzw6.js +0 -1
  271. package/dist/client/assets/railroad-peg-WCYAUIDC-DxvOX5Rh.js +0 -1
  272. package/dist/client/assets/runtime-OM-uAtaj.js +0 -18
  273. package/dist/client/assets/square-Cd2WS1gv.js +0 -1
  274. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-BnzsGHaN.js +0 -1
  275. package/dist/client/assets/storeSelectors-D60AAN01.js +0 -1
  276. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-BnA-oDvU.js +0 -8
  277. package/dist/client/assets/useAppSidebarCollapsed-C0jpPtER.js +0 -1
  278. package/dist/client/assets/useBaseUiId-Bz8dcyjd.js +0 -1
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,q as n}from"./primary-CQh_KHGG.js";import{t as r}from"./src-DHNjfMxR.js";import{$l as i,Bl as a,Gl as o,Hn as s,K as c,Kl as l,Kr as u,Mr as d,Or as f,P as p,Ql as m,Qr as h,Zl as g,Zr as _,ei as v,ho as y,hr as b,kr as x,mr as S,oo as C,p as w,pr as T,sr as E}from"./runtime-OM-uAtaj.js";import{t as D}from"./react-CwJFpaho.js";import{t as O}from"./compiler-runtime-C4g8XhC5.js";import{a as k,c as A,n as j,o as M,s as N,t as P}from"./badge-BswOCwph.js";import{c as F}from"./hostedConnectionCoordinator-BztHfGNt.js";import{t as ee}from"./clipboard-copy-oDSkUUg4.js";import{n as I,t as L}from"./play-BJZrOx6T.js";import{t as te}from"./refresh-cw-K_hU8_ld.js";import{r as ne}from"./editorPreferences-DVhg0CXd.js";import{t as R}from"./toastHelpers-CSQRKo4F.js";import{t as z}from"./authorization-BugIGt5e.js";import"./usePresentationTier-hxB7Yv_Q.js";import{i as B,r as re,t as V}from"./alert-CwrDisFU.js";import{i as H,n as U,r as W}from"./settingsLayout-BbjDM-p0.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=y(G),K=e(D(),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),r=m(),i=p(se),a=F(),o;t[0]===r?o=t[1]:(o=e=>r?e.byId[r.environmentId]:void 0,t[0]=r,t[1]=o);let s=S(o),c,l;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]!==r||t[9]!==a.machines){let o;t[12]===r?.environmentId?o=t[13]:(o=e=>e.environmentId===r?.environmentId,t[12]=r?.environmentId,t[13]=o);let s=a.machines.find(o);c=n(),l=z({hosted:c,role:s?s.effectiveRole:r&&!r.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]=r,t[9]=a.machines,t[10]=c,t[11]=l}else c=t[10],l=t[11];let u=l;if(!c&&r&&!ae({primary:r.primary,connected:r.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 u}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=i(),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 i=m()?.environmentId,[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(!1),[p,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(r.serverRetryResourceTelemetry),T=oe(r.serverGetResourceTelemetryHistory),D=ge[a]??ge[0],O=(0,K.useRef)(0);(0,K.useEffect)(()=>(O.current+=1,g(!1),()=>{O.current+=1}),[i]),(0,K.useEffect)(()=>{if(c(null),u(null),!T.allowed){f(!1);return}let e=ce({fetch:async()=>{let e=i?E(i)?.server:b().server;if(!e?.getResourceTelemetryHistory)throw Error(`Resource history is unavailable on this server.`);return e.getResourceTelemetryHistory({windowMs:D.windowMs,bucketMs:D.bucketMs})},onSuccess:e=>{c(e),u(null)},onError:e=>u(e instanceof Error?e.message:`Resource history could not be refreshed.`),onLoading:f});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)}},[i,D,T.allowed,T.reason]);async function k(){if(p||!w.allowed)return;let e=O.current;g(!0);try{let t=i?E(i)?.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&&u(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=s?.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)(h,{size:`xs`,variant:`outline`,disabled:p||!w.allowed,onClick:()=>void k(),children:p?`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)(h,{size:`xs`,variant:a===t?`secondary`:`outline`,"aria-pressed":a===t,onClick:()=>o(t),children:e.label},e.label))}),(0,Q.jsx)(h,{size:`xs`,variant:`outline`,disabled:d,onClick:()=>void S.current?.(),children:`Refresh`})]}),children:[l?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-3 text-xs text-destructive`,children:l}):null,(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:s?`${s.totalCpuTimeMs===void 0?`Unavailable`:Y(s.totalCpuTimeMs)} total CPU time · ${s.retainedSampleCount} retained samples · ${Y(s.sampleIntervalMs)} sampling interval · checked ${Z(s.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:s?.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)(h,{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)(h,{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=m(),i=oe(r.serverSignalDiagnosticProcess),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),l=(0,K.useRef)({target:n,snapshot:e,allowed:!1}),u=(0,K.useRef)(!1),d=(0,K.useRef)(!0),f=i.allowed;l.current={target:n,snapshot:e,allowed:f},(0,K.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);async function p(e,n){if(u.current||!l.current.allowed)return;let r=l.current.target?.environmentId;u.current=!0,o(e.pid),c(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.`}`)||!d.current||!l.current.allowed||l.current.target?.environmentId!==r)return;if(!l.current.snapshot?.processTree?.processes.find(t=>t.pid===e.pid&&t.startTimeMs===e.startTimeMs)){c(`Process already exited or changed. Refresh diagnostics.`);return}let i=r?E(r)?.server:b().server;if(!i?.signalDiagnosticProcess)throw Error(`Process controls are unavailable on this server.`);let a=await i.signalDiagnosticProcess({pid:e.pid,startTimeMs:e.startTimeMs,signal:n});if(!d.current||l.current.target?.environmentId!==r)return;c(a.signaled?`${n} sent to process ${e.pid}.`:a.message??`Process already exited or is no longer a server child.`),await t()}catch(e){d.current&&l.current.target?.environmentId===r&&c(e instanceof Error?e.message:`Could not signal process.`)}finally{u.current=!1,d.current&&o(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,s?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 pb-3 text-xs`,children:s}):null,f?null:(0,Q.jsx)(`p`,{className:`px-4 pb-3 text-xs text-muted-foreground`,children:i.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)(h,{size:`xs`,variant:`outline`,disabled:!f||a!==null,onClick:()=>void p(e,`SIGINT`),children:`Interrupt`}),(0,Q.jsx)(h,{size:`xs`,variant:`outline`,disabled:!f||a!==null,onClick:()=>void p(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}=_(),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)(h,{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=v(`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 f=i?.authState?` · auth ${i.authState}`:``,p=i?.role?` · ${i.role}`:``,m;t[5]!==o||t[6]!==f||t[7]!==p?(m=(0,Q.jsxs)(`span`,{className:`block`,children:[`WS `,o,f,p]}),t[5]=o,t[6]=f,t[7]=p,t[8]=m):m=t[8];let h=c?`text-warning`:`text-muted-foreground/70`,g;t[9]===h?g=t[10]:(g=v(`block`,h),t[9]=h,t[10]=g);let _;t[11]===a?_=t[12]:(_=Ve(a),t[11]=a,t[12]=_);let y;t[13]!==g||t[14]!==_?(y=(0,Q.jsx)(`span`,{className:g,children:_}),t[13]=g,t[14]=_,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]!==m?(x=(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[m,y,b]}),t[18]=y,t[19]=b,t[20]=m,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 n=(0,q.c)(59),{snapshot:r}=e,i=T(Xe),c=S(Ye),d=s(Je),p=m(),g=l(),v=o(),y=a(),C;n[0]!==g||n[1]!==p?(C=p?p.serverConfig?.providers??[]:g,n[0]=g,n[1]=p,n[2]=C):C=n[2];let E=C,D=r?.observability??(p?p.serverConfig?.observability??null:v),O;n[3]!==y||n[4]!==p?(O=p?p.serverConfig?.availableEditors??[]:y,n[3]=y,n[4]=p,n[5]=O):O=n[5];let k=O,A=r?.performance?.local??null,[j,M]=(0,K.useState)(!1),N;n[6]!==A||n[7]!==D?(N=D?{...D,...A?{localMetrics:A}:{}}:null,n[6]=A,n[7]=D,n[8]=N):N=n[8];let P=N,F;n[9]!==d||n[10]!==i||n[11]!==c?(F=[...new Set([...Object.keys(i),...Object.keys(c),...Object.keys(d)])].toSorted(),n[9]=d,n[10]=i,n[11]=c,n[12]=F):F=n[12];let I=F,L;n[13]===Symbol.for(`react.memo_cache_sentinel`)?(L={onCopy:qe,onError:Ke},n[13]=L):L=n[13];let{copyToClipboard:te,isCopied:z}=_(L),B;n[14]!==te||n[15]!==I||n[16]!==P||n[17]!==E||n[18]!==d||n[19]!==i||n[20]!==c||n[21]!==r?.performance?(B=()=>{let e=Fe({generatedAt:new Date().toISOString(),app:{version:x,stage:f,isElectron:t,userAgent:typeof navigator>`u`?null:navigator.userAgent},environments:I.map(e=>({environmentId:e,record:i[e]??null,runtime:c[e]??null,pushSequence:d[e]??null})),providers:E,observability:P,performance:r?.performance??null});te(Ie(e),void 0)},n[14]=te,n[15]=I,n[16]=P,n[17]=E,n[18]=d,n[19]=i,n[20]=c,n[21]=r?.performance,n[22]=B):B=n[22],r?.performance;let re=B,V=D?.logsDirectoryPath??null,U;n[23]!==k||n[24]!==V||n[25]!==p?(U=()=>{if(!V)return;M(!0);let e=ne(k??[]);if(!e){M(!1),u.add(R({type:`error`,title:`Could not open logs folder`,description:`No available editors found.`}));return}(p?w(p.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)})},n[23]=k,n[24]=V,n[25]=p,n[26]=U):U=n[26];let G=U,ae;n[27]===z?ae=n[28]:(ae=z?(0,Q.jsx)(ie,{className:`size-3.5`}):(0,Q.jsx)(ee,{className:`size-3.5`}),n[27]=z,n[28]=ae);let oe=z?`Copied`:`Copy debug bundle`,se;n[29]!==re||n[30]!==ae||n[31]!==oe?(se=(0,Q.jsxs)(h,{size:`xs`,variant:`outline`,onClick:re,children:[ae,oe]}),n[29]=re,n[30]=ae,n[31]=oe,n[32]=se):se=n[32];let ce;n[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(W,{title:`Application`,description:`Version ${x} · ${f}${t?` · Desktop`:` · Browser`}`}),n[33]=ce):ce=n[33];let le=V??`Resolving logs directory…`,ue=!V||j,J=j?`Opening…`:`Open logs folder`,Y;n[34]!==G||n[35]!==ue||n[36]!==J?(Y=(0,Q.jsx)(h,{size:`xs`,variant:`outline`,disabled:ue,onClick:G,children:J}),n[34]=G,n[35]=ue,n[36]=J,n[37]=Y):Y=n[37];let X;n[38]!==le||n[39]!==Y?(X=(0,Q.jsx)(W,{title:`Logs`,description:le,control:Y}),n[38]=le,n[39]=Y,n[40]=X):X=n[40];let Z;n[41]!==se||n[42]!==X?(Z=(0,Q.jsxs)(H,{title:`Diagnostics`,headerAction:se,children:[ce,X]}),n[41]=se,n[42]=X,n[43]=Z):Z=n[43];let de;n[44]!==I||n[45]!==d||n[46]!==i||n[47]!==c?(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:c[e]??null,pushSequence:d[e]??null},e)),n[44]=I,n[45]=d,n[46]=i,n[47]=c,n[48]=de):de=n[48];let fe;n[49]===de?fe=n[50]:(fe=(0,Q.jsx)(H,{title:`Environments`,children:de}),n[49]=de,n[50]=fe);let pe;n[51]===E?pe=n[52]:(pe=E.length===0?(0,Q.jsx)(W,{title:`No providers`,description:`No provider instances are configured.`}):E.map(We),n[51]=E,n[52]=pe);let me;n[53]===pe?me=n[54]:(me=(0,Q.jsx)(H,{title:`Providers`,children:pe}),n[53]=pe,n[54]=me);let he;return n[55]!==Z||n[56]!==fe||n[57]!==me?(he=(0,Q.jsxs)(Q.Fragment,{children:[Z,fe,me]}),n[55]=Z,n[56]=fe,n[57]=me,n[58]=he):he=n[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){u.add(R({type:`error`,title:`Could not open logs folder`,description:e instanceof Error?e.message:`Failed to open logs folder.`}))}function Ke(e){u.add(R({type:`error`,title:`Could not copy debug bundle`,description:e.message}))}function qe(){u.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){u.update(e,{type:`loading`,title:`Updating Claude Code`,description:`Running provider update command.`,timeout:0,actionProps:void 0,data:{hideCopyButton:!0}}),window.setTimeout(()=>{u.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=u.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:()=>c.getState().openSettings(`providers`)},secondaryActionVariant:`outline`}}))}},{value:`pr-checks-passed`,label:`PR checks passed`,fire:()=>{u.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:()=>{u.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:()=>{u.add(R({type:`error`,title:`Action failed`,description:`remote: Permission to sak0a/ryco.git denied to deploy-bot.
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,q as n}from"./primary-DZjgHvyf.js";import{t as r}from"./src-C3Y_imaX.js";import{$l as i,Bl as a,Gl as o,Hn as s,K as c,Kl as l,Kr as u,Mr as d,Or as f,P as p,Ql as m,Qr as h,Zl as g,Zr as _,ei as v,ho as y,hr as b,kr as x,mr as S,oo as C,p as w,pr as T,sr as E}from"./runtime-BwHA1GUS.js";import{t as D}from"./react-CwJFpaho.js";import{t as O}from"./compiler-runtime-C4g8XhC5.js";import{a as k,c as A,n as j,o as M,s as N,t as P}from"./badge-2AZ3HfVS.js";import{c as F}from"./hostedConnectionCoordinator-BuRWCvUG.js";import{t as ee}from"./clipboard-copy-BWf3JuTE.js";import{n as I,t as L}from"./play-DUvOxTpL.js";import{t as te}from"./refresh-cw-CgDa2Ok_.js";import{r as ne}from"./editorPreferences-D8q1ItMW.js";import{t as R}from"./toastHelpers-CSQRKo4F.js";import{t as z}from"./authorization-D8dOcEYq.js";import"./usePresentationTier-hxB7Yv_Q.js";import{i as B,r as re,t as V}from"./alert-DQEkrtUJ.js";import{i as H,n as U,r as W}from"./settingsLayout-DxsFwhF0.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=y(G),K=e(D(),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),r=m(),i=p(se),a=F(),o;t[0]===r?o=t[1]:(o=e=>r?e.byId[r.environmentId]:void 0,t[0]=r,t[1]=o);let s=S(o),c,l;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]!==r||t[9]!==a.machines){let o;t[12]===r?.environmentId?o=t[13]:(o=e=>e.environmentId===r?.environmentId,t[12]=r?.environmentId,t[13]=o);let s=a.machines.find(o);c=n(),l=z({hosted:c,role:s?s.effectiveRole:r&&!r.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]=r,t[9]=a.machines,t[10]=c,t[11]=l}else c=t[10],l=t[11];let u=l;if(!c&&r&&!ae({primary:r.primary,connected:r.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 u}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=i(),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 i=m()?.environmentId,[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(!1),[p,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(r.serverRetryResourceTelemetry),T=oe(r.serverGetResourceTelemetryHistory),D=ge[a]??ge[0],O=(0,K.useRef)(0);(0,K.useEffect)(()=>(O.current+=1,g(!1),()=>{O.current+=1}),[i]),(0,K.useEffect)(()=>{if(c(null),u(null),!T.allowed){f(!1);return}let e=ce({fetch:async()=>{let e=i?E(i)?.server:b().server;if(!e?.getResourceTelemetryHistory)throw Error(`Resource history is unavailable on this server.`);return e.getResourceTelemetryHistory({windowMs:D.windowMs,bucketMs:D.bucketMs})},onSuccess:e=>{c(e),u(null)},onError:e=>u(e instanceof Error?e.message:`Resource history could not be refreshed.`),onLoading:f});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)}},[i,D,T.allowed,T.reason]);async function k(){if(p||!w.allowed)return;let e=O.current;g(!0);try{let t=i?E(i)?.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&&u(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=s?.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)(h,{size:`xs`,variant:`outline`,disabled:p||!w.allowed,onClick:()=>void k(),children:p?`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)(h,{size:`xs`,variant:a===t?`secondary`:`outline`,"aria-pressed":a===t,onClick:()=>o(t),children:e.label},e.label))}),(0,Q.jsx)(h,{size:`xs`,variant:`outline`,disabled:d,onClick:()=>void S.current?.(),children:`Refresh`})]}),children:[l?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-3 text-xs text-destructive`,children:l}):null,(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:s?`${s.totalCpuTimeMs===void 0?`Unavailable`:Y(s.totalCpuTimeMs)} total CPU time · ${s.retainedSampleCount} retained samples · ${Y(s.sampleIntervalMs)} sampling interval · checked ${Z(s.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:s?.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)(h,{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)(h,{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=m(),i=oe(r.serverSignalDiagnosticProcess),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),l=(0,K.useRef)({target:n,snapshot:e,allowed:!1}),u=(0,K.useRef)(!1),d=(0,K.useRef)(!0),f=i.allowed;l.current={target:n,snapshot:e,allowed:f},(0,K.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);async function p(e,n){if(u.current||!l.current.allowed)return;let r=l.current.target?.environmentId;u.current=!0,o(e.pid),c(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.`}`)||!d.current||!l.current.allowed||l.current.target?.environmentId!==r)return;if(!l.current.snapshot?.processTree?.processes.find(t=>t.pid===e.pid&&t.startTimeMs===e.startTimeMs)){c(`Process already exited or changed. Refresh diagnostics.`);return}let i=r?E(r)?.server:b().server;if(!i?.signalDiagnosticProcess)throw Error(`Process controls are unavailable on this server.`);let a=await i.signalDiagnosticProcess({pid:e.pid,startTimeMs:e.startTimeMs,signal:n});if(!d.current||l.current.target?.environmentId!==r)return;c(a.signaled?`${n} sent to process ${e.pid}.`:a.message??`Process already exited or is no longer a server child.`),await t()}catch(e){d.current&&l.current.target?.environmentId===r&&c(e instanceof Error?e.message:`Could not signal process.`)}finally{u.current=!1,d.current&&o(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,s?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 pb-3 text-xs`,children:s}):null,f?null:(0,Q.jsx)(`p`,{className:`px-4 pb-3 text-xs text-muted-foreground`,children:i.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)(h,{size:`xs`,variant:`outline`,disabled:!f||a!==null,onClick:()=>void p(e,`SIGINT`),children:`Interrupt`}),(0,Q.jsx)(h,{size:`xs`,variant:`outline`,disabled:!f||a!==null,onClick:()=>void p(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}=_(),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)(h,{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=v(`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 f=i?.authState?` · auth ${i.authState}`:``,p=i?.role?` · ${i.role}`:``,m;t[5]!==o||t[6]!==f||t[7]!==p?(m=(0,Q.jsxs)(`span`,{className:`block`,children:[`WS `,o,f,p]}),t[5]=o,t[6]=f,t[7]=p,t[8]=m):m=t[8];let h=c?`text-warning`:`text-muted-foreground/70`,g;t[9]===h?g=t[10]:(g=v(`block`,h),t[9]=h,t[10]=g);let _;t[11]===a?_=t[12]:(_=Ve(a),t[11]=a,t[12]=_);let y;t[13]!==g||t[14]!==_?(y=(0,Q.jsx)(`span`,{className:g,children:_}),t[13]=g,t[14]=_,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]!==m?(x=(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[m,y,b]}),t[18]=y,t[19]=b,t[20]=m,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 n=(0,q.c)(59),{snapshot:r}=e,i=T(Xe),c=S(Ye),d=s(Je),p=m(),g=l(),v=o(),y=a(),C;n[0]!==g||n[1]!==p?(C=p?p.serverConfig?.providers??[]:g,n[0]=g,n[1]=p,n[2]=C):C=n[2];let E=C,D=r?.observability??(p?p.serverConfig?.observability??null:v),O;n[3]!==y||n[4]!==p?(O=p?p.serverConfig?.availableEditors??[]:y,n[3]=y,n[4]=p,n[5]=O):O=n[5];let k=O,A=r?.performance?.local??null,[j,M]=(0,K.useState)(!1),N;n[6]!==A||n[7]!==D?(N=D?{...D,...A?{localMetrics:A}:{}}:null,n[6]=A,n[7]=D,n[8]=N):N=n[8];let P=N,F;n[9]!==d||n[10]!==i||n[11]!==c?(F=[...new Set([...Object.keys(i),...Object.keys(c),...Object.keys(d)])].toSorted(),n[9]=d,n[10]=i,n[11]=c,n[12]=F):F=n[12];let I=F,L;n[13]===Symbol.for(`react.memo_cache_sentinel`)?(L={onCopy:qe,onError:Ke},n[13]=L):L=n[13];let{copyToClipboard:te,isCopied:z}=_(L),B;n[14]!==te||n[15]!==I||n[16]!==P||n[17]!==E||n[18]!==d||n[19]!==i||n[20]!==c||n[21]!==r?.performance?(B=()=>{let e=Fe({generatedAt:new Date().toISOString(),app:{version:x,stage:f,isElectron:t,userAgent:typeof navigator>`u`?null:navigator.userAgent},environments:I.map(e=>({environmentId:e,record:i[e]??null,runtime:c[e]??null,pushSequence:d[e]??null})),providers:E,observability:P,performance:r?.performance??null});te(Ie(e),void 0)},n[14]=te,n[15]=I,n[16]=P,n[17]=E,n[18]=d,n[19]=i,n[20]=c,n[21]=r?.performance,n[22]=B):B=n[22],r?.performance;let re=B,V=D?.logsDirectoryPath??null,U;n[23]!==k||n[24]!==V||n[25]!==p?(U=()=>{if(!V)return;M(!0);let e=ne(k??[]);if(!e){M(!1),u.add(R({type:`error`,title:`Could not open logs folder`,description:`No available editors found.`}));return}(p?w(p.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)})},n[23]=k,n[24]=V,n[25]=p,n[26]=U):U=n[26];let G=U,ae;n[27]===z?ae=n[28]:(ae=z?(0,Q.jsx)(ie,{className:`size-3.5`}):(0,Q.jsx)(ee,{className:`size-3.5`}),n[27]=z,n[28]=ae);let oe=z?`Copied`:`Copy debug bundle`,se;n[29]!==re||n[30]!==ae||n[31]!==oe?(se=(0,Q.jsxs)(h,{size:`xs`,variant:`outline`,onClick:re,children:[ae,oe]}),n[29]=re,n[30]=ae,n[31]=oe,n[32]=se):se=n[32];let ce;n[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(W,{title:`Application`,description:`Version ${x} · ${f}${t?` · Desktop`:` · Browser`}`}),n[33]=ce):ce=n[33];let le=V??`Resolving logs directory…`,ue=!V||j,J=j?`Opening…`:`Open logs folder`,Y;n[34]!==G||n[35]!==ue||n[36]!==J?(Y=(0,Q.jsx)(h,{size:`xs`,variant:`outline`,disabled:ue,onClick:G,children:J}),n[34]=G,n[35]=ue,n[36]=J,n[37]=Y):Y=n[37];let X;n[38]!==le||n[39]!==Y?(X=(0,Q.jsx)(W,{title:`Logs`,description:le,control:Y}),n[38]=le,n[39]=Y,n[40]=X):X=n[40];let Z;n[41]!==se||n[42]!==X?(Z=(0,Q.jsxs)(H,{title:`Diagnostics`,headerAction:se,children:[ce,X]}),n[41]=se,n[42]=X,n[43]=Z):Z=n[43];let de;n[44]!==I||n[45]!==d||n[46]!==i||n[47]!==c?(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:c[e]??null,pushSequence:d[e]??null},e)),n[44]=I,n[45]=d,n[46]=i,n[47]=c,n[48]=de):de=n[48];let fe;n[49]===de?fe=n[50]:(fe=(0,Q.jsx)(H,{title:`Environments`,children:de}),n[49]=de,n[50]=fe);let pe;n[51]===E?pe=n[52]:(pe=E.length===0?(0,Q.jsx)(W,{title:`No providers`,description:`No provider instances are configured.`}):E.map(We),n[51]=E,n[52]=pe);let me;n[53]===pe?me=n[54]:(me=(0,Q.jsx)(H,{title:`Providers`,children:pe}),n[53]=pe,n[54]=me);let he;return n[55]!==Z||n[56]!==fe||n[57]!==me?(he=(0,Q.jsxs)(Q.Fragment,{children:[Z,fe,me]}),n[55]=Z,n[56]=fe,n[57]=me,n[58]=he):he=n[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){u.add(R({type:`error`,title:`Could not open logs folder`,description:e instanceof Error?e.message:`Failed to open logs folder.`}))}function Ke(e){u.add(R({type:`error`,title:`Could not copy debug bundle`,description:e.message}))}function qe(){u.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){u.update(e,{type:`loading`,title:`Updating Claude Code`,description:`Running provider update command.`,timeout:0,actionProps:void 0,data:{hideCopyButton:!0}}),window.setTimeout(()=>{u.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=u.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:()=>c.getState().openSettings(`providers`)},secondaryActionVariant:`outline`}}))}},{value:`pr-checks-passed`,label:`PR checks passed`,fire:()=>{u.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:()=>{u.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:()=>{u.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:()=>{u.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:()=>{u.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:()=>{u.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:()=>{u.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)(h,{"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)(h,{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)(C,{}),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=m();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=m(),n=g(),[i,a]=(0,K.useState)(null),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!0),[u,f]=(0,K.useState)(!1),p=(0,K.useRef)(null),_=(0,K.useRef)(u);_.current=u;let y=d(),x=S(e=>e.byId),C=Date.now(),w=oe(r.serverGetDiagnosticsSnapshot),T=t?.environmentId,D=t?.nodeLabel,O=(0,K.useCallback)(async(e=!1)=>{await p.current?.()},[]);(0,K.useEffect)(()=>{if(a(null),s(null),l(!0),!w.allowed){s(w.reason),l(!1);return}let e=ce({fetch:async()=>{let e=T?E(T)?.server:b().server;if(!e)throw Error(`Diagnostics are unavailable on ${D??`this environment`}.`);return e.getDiagnosticsSnapshot()},onSuccess:e=>{a(e),s(null)},onError:e=>s(e instanceof Error?e.message:`Unable to refresh diagnostics.`),onLoading:l});p.current=e.refresh;let t=()=>{!_.current&&document.visibilityState===`visible`&&e.refresh()};t();let n=window.setInterval(t,it);return document.addEventListener(`visibilitychange`,t),()=>{e.dispose(),p.current=null,window.clearInterval(n),document.removeEventListener(`visibilitychange`,t)}},[T,D,w.allowed,w.reason]),(0,K.useEffect)(()=>{!u&&document.visibilityState===`visible`&&O()},[u,O]);let k=(0,K.useMemo)(()=>de(i?.resources.history??[]),[i]),A=(0,K.useMemo)(()=>fe(i?.resources.history??[]),[i]),j=i?he(i):`No snapshot`,M=i?.liveProcesses.providers.filter(e=>e.enabled).length??0,N=i?.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=i?.tracing.slowestSpans.find(e=>e.source===`server`)??null,z=y[0]??null,B=i?.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:i?`Updated ${Z(i.generatedAt,C)}`:`Waiting for snapshot`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(h,{size:`xs`,variant:`outline`,onClick:()=>f(e=>!e),children:[u?(0,Q.jsx)(L,{className:`size-3.5`}):(0,Q.jsx)(I,{className:`size-3.5`}),u?`Resume`:`Pause`]}),(0,Q.jsxs)(h,{size:`xs`,variant:`outline`,onClick:()=>void O(!0),disabled:c,children:[(0,Q.jsx)(te,{className:v(`size-3.5`,c&&`animate-spin`)}),`Refresh`]})]})]}),(0,Q.jsx)(xt,{snapshot:i,error:o}),null,e===`phone-legacy`?(0,Q.jsx)(yt,{snapshot:i,memorySeries:k,cpuSeries:A,slowRpcAcks:y,latestFailure:j,nowMs:C}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_e,{telemetry:i?.telemetry,paused:u,refresh:O},`telemetry:${T??`local`}`),(0,Q.jsx)(ve,{snapshot:i,refresh:O},T??`local`),(0,Q.jsx)(Ce,{snapshot:i,nowMs:C}),(0,Q.jsx)(mt,{snapshot:i,showTraceId:!0}),(0,Q.jsx)(ht,{snapshot:i,nowMs:C}),(0,Q.jsx)(gt,{snapshot:i,slowRpcAcks:y,nowMs:C}),(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:i?X(i.resources.current.cpu.utilizationPercent):`n/a`,detail:i?`Process uptime ${Y(i.uptimeMs)}`:void 0}),(0,Q.jsx)($,{label:`RSS / heap`,value:i?J(i.resources.current.memory.rssBytes):`n/a`,detail:i?`${J(i.resources.current.memory.heapUsedBytes)} heap used`:void 0}),(0,Q.jsx)($,{label:`Event-loop delay`,value:i?.resources.current.eventLoopDelayMs===void 0?`n/a`:Y(i.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,C)}.`:`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,C)}.`:`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:i?.failures.latest[0]?.message??`No retained failures`,detail:i?.failures.latest[0]?`${i.failures.latest[0].source} · ${Z(i.failures.latest[0].occurredAt,C)}`:`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:i}),n===`all`&&(0,Q.jsx)(nt,{}),null]})]})}export{Ct as DiagnosticsSettings};
@@ -1 +1 @@
1
- import{hs as e,os as t}from"./runtime-OM-uAtaj.js";import{b as n}from"./NullStore-b8PhjwPZ.js";import{r}from"./DialogViewport-BwuqbGLY.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{hs as e,os as t}from"./runtime-BwHA1GUS.js";import{b as n}from"./NullStore-8d2s-Re3.js";import{r}from"./DialogViewport-B6w_ROOE.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{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Ic as n,Ks as r,Xs as i}from"./runtime-OM-uAtaj.js";import{t as a}from"./react-CwJFpaho.js";import{a as o,l as s}from"./NullStore-b8PhjwPZ.js";import{p as c,s as l}from"./useScrollLock-BO185DkJ.js";import{a as u,o as d,s as f}from"./DialogViewport-BwuqbGLY.js";var p=e(a(),1),m=p.forwardRef(function(e,t){let{render:r,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:n,props:[{role:`presentation`,hidden:!p,style:{userSelect:`none`,WebkitUserSelect:`none`}},c],enabled:s||!d})}),h=`--nested-dialogs`,g=t(),_=p.forwardRef(function(e,t){let{render:n,className:a,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(),r({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{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Ic as n,Ks as r,Xs as i}from"./runtime-BwHA1GUS.js";import{t as a}from"./react-CwJFpaho.js";import{a as o,l as s}from"./NullStore-8d2s-Re3.js";import{p as c,s as l}from"./useScrollLock-BbKeKZdj.js";import{a as u,o as d,s as f}from"./DialogViewport-B6w_ROOE.js";var p=e(a(),1),m=p.forwardRef(function(e,t){let{render:r,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:n,props:[{role:`presentation`,hidden:!p,style:{userSelect:`none`,WebkitUserSelect:`none`}},c],enabled:s||!d})}),h=`--nested-dialogs`,g=t(),_=p.forwardRef(function(e,t){let{render:n,className:a,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(),r({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{kl as e}from"./runtime-BwHA1GUS.js";import{n as t}from"./DialogViewport-B6w_ROOE.js";var n=e(function(e){return t(`dialog`,e)});export{n as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Xs as t,js as n,os as r,us as i}from"./runtime-OM-uAtaj.js";import{t as a}from"./react-CwJFpaho.js";import{s as o}from"./DialogViewport-BwuqbGLY.js";import{t as s}from"./useBaseUiId-Bz8dcyjd.js";var c=e(a(),1),l=c.forwardRef(function(e,a){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}=n({disabled:u,native:d}),_={disabled:u};function v(e){m&&p.setOpen(!1,r(i,e.nativeEvent))}return t(`button`,e,{state:_,ref:[a,g],props:[{onClick:v},f,h]})}),u=c.forwardRef(function(e,n){let{render:r,className:i,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`descriptionElementId`,d),t(`p`,e,{ref:n,props:[{id:d},l]})}),d=c.forwardRef(function(e,n){let{render:r,className:i,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`titleElementId`,d),t(`h2`,e,{ref:n,props:[{id:d},l]})});export{u as n,l as r,d as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Xs as t,js as n,os as r,us as i}from"./runtime-BwHA1GUS.js";import{t as a}from"./react-CwJFpaho.js";import{s as o}from"./DialogViewport-B6w_ROOE.js";import{t as s}from"./useBaseUiId-DKOjzmu3.js";var c=e(a(),1),l=c.forwardRef(function(e,a){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}=n({disabled:u,native:d}),_={disabled:u};function v(e){m&&p.setOpen(!1,r(i,e.nativeEvent))}return t(`button`,e,{state:_,ref:[a,g],props:[{onClick:v},f,h]})}),u=c.forwardRef(function(e,n){let{render:r,className:i,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`descriptionElementId`,d),t(`p`,e,{ref:n,props:[{id:d},l]})}),d=c.forwardRef(function(e,n){let{render:r,className:i,style:a,id:c,...l}=e,u=o(),d=s(c);return u.useSyncedValueWithCleanup(`titleElementId`,d),t(`h2`,e,{ref:n,props:[{id:d},l]})});export{u as n,l as r,d as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Al as t,Nl as n,Rc as r,Us as i,Xs as a,js as o}from"./runtime-OM-uAtaj.js";import{t as s}from"./react-CwJFpaho.js";import{g as c,n as l}from"./NullStore-b8PhjwPZ.js";import{F as u,M as d}from"./badge-BswOCwph.js";import{s as f}from"./DialogViewport-BwuqbGLY.js";import{t as p}from"./useBaseUiId-Bz8dcyjd.js";var m=e(s(),1),h=t(function(e,t){let{render:s,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(n(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}=o({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,{[i]:``,id:T,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":O},S,M],stateAttributesMapping:r})});export{h as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Al as t,Nl as n,Rc as r,Us as i,Xs as a,js as o}from"./runtime-BwHA1GUS.js";import{t as s}from"./react-CwJFpaho.js";import{g as c,n as l}from"./NullStore-8d2s-Re3.js";import{F as u,M as d}from"./badge-2AZ3HfVS.js";import{s as f}from"./DialogViewport-B6w_ROOE.js";import{t as p}from"./useBaseUiId-DKOjzmu3.js";var m=e(s(),1),h=t(function(e,t){let{render:s,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(n(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}=o({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,{[i]:``,id:T,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":O},S,M],stateAttributesMapping:r})});export{h as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Dl as n,Fc as r,Gc as i,Ko as a,Nl as o,Pl as s,Xs as c,Ys as l,el as u,hs as d,os as f,rs as p,tl as m}from"./runtime-OM-uAtaj.js";import{t as h}from"./react-CwJFpaho.js";import{d as g,f as _,h as v,i as y,m as b,o as x,p as S,r as C,t as w,u as T,x as E}from"./NullStore-b8PhjwPZ.js";import{n as D,t as O}from"./useScrollLock-BO185DkJ.js";var k=e(h(),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=t(),F=`data-nested-dialog-open`,I={...r,...i,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)(p,{ref:t,...r,children:[a&&o===!0&&(0,P.jsx)(D,{ref:i.context.internalBackdropRef,inert:l(!s)}),e.children]})}):null});function R({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,d]=k.useState(0),[f,p]=k.useState(0),h=l===0,g=E(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`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=m(t);if(h&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||u(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:h});return O(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{d(e),p(t)}),s(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,f+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,f,t]),S(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:f}),null}var z={...y,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 n{constructor(e,t,n){let r=new a,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(T(this.state,e,t.trigger)))}};function V(){let e=new a;return new w(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:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:p,defaultTriggerId:m=null}=t,h=e===`drawer`,y=e===`alert-dialog`,S=y?!0:c,C=y||s,w=y?`alertdialog`:`dialog`,T=j(!0),E={modal:S,disablePointerDismissal:C,nested:T!=null,role:w},D=b((e,t)=>new B({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,...E},e,t),!0);D.useControlledProp(`openProp`,r),D.useControlledProp(`triggerIdProp`,p),D.useSyncedValues(E),D.useContextCallback(`onOpenChange`,a),D.useContextCallback(`onOpenChangeComplete`,o);let O=D.useState(`open`),M=D.useState(`mounted`),N=D.useState(`payload`);v(D,O),g(D);let{forceUnmount:F}=_(O,D);k.useImperativeHandle(l,()=>({unmount:F,close:()=>D.setOpen(!1,f(d))}),[F,D]);let I=O||M;return(0,P.jsxs)(A.Provider,{value:D,children:[u&&(0,P.jsx)(x,{handle:u,store:D}),I&&(0,P.jsx)(R,{store:D,parentContext:T?.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(),l=j(),u=l.useState(`open`),d=l.useState(`nested`),f=l.useState(`transitionStatus`),p=l.useState(`nestedOpenDialogCount`),m=l.useState(`mounted`),h=l.useStateSetter(`viewportElement`);return c(`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{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Dl as n,Fc as r,Gc as i,Ko as a,Nl as o,Pl as s,Xs as c,Ys as l,el as u,hs as d,os as f,rs as p,tl as m}from"./runtime-BwHA1GUS.js";import{t as h}from"./react-CwJFpaho.js";import{d as g,f as _,h as v,i as y,m as b,o as x,p as S,r as C,t as w,u as T,x as E}from"./NullStore-8d2s-Re3.js";import{n as D,t as O}from"./useScrollLock-BbKeKZdj.js";var k=e(h(),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=t(),F=`data-nested-dialog-open`,I={...r,...i,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)(p,{ref:t,...r,children:[a&&o===!0&&(0,P.jsx)(D,{ref:i.context.internalBackdropRef,inert:l(!s)}),e.children]})}):null});function R({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,d]=k.useState(0),[f,p]=k.useState(0),h=l===0,g=E(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`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=m(t);if(h&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||u(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:h});return O(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{d(e),p(t)}),s(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,f+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,f,t]),S(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:f}),null}var z={...y,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 n{constructor(e,t,n){let r=new a,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(T(this.state,e,t.trigger)))}};function V(){let e=new a;return new w(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:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:p,defaultTriggerId:m=null}=t,h=e===`drawer`,y=e===`alert-dialog`,S=y?!0:c,C=y||s,w=y?`alertdialog`:`dialog`,T=j(!0),E={modal:S,disablePointerDismissal:C,nested:T!=null,role:w},D=b((e,t)=>new B({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,...E},e,t),!0);D.useControlledProp(`openProp`,r),D.useControlledProp(`triggerIdProp`,p),D.useSyncedValues(E),D.useContextCallback(`onOpenChange`,a),D.useContextCallback(`onOpenChangeComplete`,o);let O=D.useState(`open`),M=D.useState(`mounted`),N=D.useState(`payload`);v(D,O),g(D);let{forceUnmount:F}=_(O,D);k.useImperativeHandle(l,()=>({unmount:F,close:()=>D.setOpen(!1,f(d))}),[F,D]);let I=O||M;return(0,P.jsxs)(A.Provider,{value:D,children:[u&&(0,P.jsx)(x,{handle:u,store:D}),I&&(0,P.jsx)(R,{store:D,parentContext:T?.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(),l=j(),u=l.useState(`open`),d=l.useState(`nested`),f=l.useState(`transitionStatus`),p=l.useState(`nestedOpenDialogCount`),m=l.useState(`mounted`),h=l.useStateSetter(`viewportElement`);return c(`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{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ut as t}from"./primary-CQh_KHGG.js";import{$l as n,Bn as r,Jr as i,_a as a,ei as o,yn as s}from"./runtime-OM-uAtaj.js";import{t as c}from"./react-CwJFpaho.js";import{t as ee}from"./useNavigate-01O5dMQe.js";import{a as te,d as ne,f as re,i as l,l as ie,m as ae,n as oe,o as se,p as ce,r as le,t as ue,u as de}from"./ChatRightPanel-Bm906qNi.js";import{O as fe}from"./ContextHandoffEndpointLabel-BzI4Wi1i.js";import{t as pe}from"./usePresentationTier-hxB7Yv_Q.js";import"./storeSelectors-D60AAN01.js";import{o as u}from"./sidebar-DayQTDZp.js";import{t as me}from"./useAppSidebarCollapsed-C0jpPtER.js";import{C as d,D as f,E as p,O as m,S as h,T as g,b as he,k as _,w as v,y as ge}from"./main-RFllWEko.js";var y=e(c(),1),b=n();function x({rawDraftId:e,search:n}){let c=ee(),x=a.make(e),S=`draft:${x}`,_e=(0,y.useCallback)(e=>{c({to:`/draft/$draftId`,params:{draftId:x},replace:!0,search:e})},[x,c]),C=ne({threadKey:S,search:n,replaceSearch:_e}),w=ae(x),T=r((0,y.useMemo)(()=>s(w?.threadId??null),[w?.threadId])),ve=ie(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=ge(C),A=he(C),j=C.workspaceTab===`agent`&&C.workspaceAgentKey?C.workspaceAgentKey:null,ye=fe(de),M=pe(),N=E?`${E.environmentId}:${E.threadId}`:null,P=t(e=>N?e.pendingOpenByThreadKey[N]:void 0),F=t(e=>e.consumeOpenRequest),be=me(),{maximized:I,toggleMaximized:xe}=ce({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),c({to:`/draft/$draftId`,params:{draftId:x},search:e=>f(e)}))},[E,F,x,c,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)(()=>{c({to:`/draft/$draftId`,params:{draftId:x},search:e=>le(e)})},[x,c]),X=(0,y.useCallback)(()=>{c({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let t=G[G.length-1];return K===`agent`&&t?h(e,t):K===`files`&&B?g(e):K===`review`&&z?p(e):K===`terminal`&&V?m(e):K===`simulator`&&H?f(e):K===`browser`&&U?v(e):K===`agents`&&W?d(e):B?g(e):z?p(e):V?m(e):H?f(e):U?v(e):W?d(e):t?h(e,t):_(e)}})},[x,W,z,B,H,U,V,K,c,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&&c({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let n=t[t.length-1];return n?h(e,n):B?g(e):z?p(e):V?m(e):H?f(e):U?v(e):W?d(e):_(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&&c({to:`/draft/$draftId`,params:{draftId:x},search:s=>e.mode!==`files`&&n?g(s):e.mode!==`review`&&t?p(s):e.mode!==`terminal`&&r?m(s):e.mode!==`simulator`&&i?f(s):e.mode!==`browser`&&a?v(s):e.mode!==`agents`&&o?d(s):_(s)})},[j,x,W,z,B,H,U,V,c,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&&(re(S,`${E.environmentId}:${E.threadId}`),c({to:`/$environmentId/$threadId`,params:i(E),replace:!0}))},[E,c,S]),(0,y.useEffect)(()=>{w||E||c({to:`/`,replace:!0})},[E,w,c]),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)(l,{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)(l,{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,{label:`Workspace`,open:A,onClose:Y,children:we?(0,b.jsx)(ue,{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)(l,{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)(te,{open:A,onClose:Y,children:Ce?(0,b.jsx)(ue,{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)(l,{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)(oe,{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{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ut as t}from"./primary-DZjgHvyf.js";import{$l as n,Bn as r,Jr as i,_a as a,ei as o,yn as s}from"./runtime-BwHA1GUS.js";import{t as c}from"./react-CwJFpaho.js";import{t as ee}from"./useNavigate-B8oXtF30.js";import{a as te,d as ne,f as re,i as l,l as ie,m as ae,n as oe,o as se,p as ce,r as le,t as ue,u as de}from"./ChatRightPanel-CygpcJiF.js";import{O as fe}from"./ContextHandoffEndpointLabel-CeGDLNA4.js";import{t as pe}from"./usePresentationTier-hxB7Yv_Q.js";import"./storeSelectors-CTDWheMy.js";import{o as u}from"./sidebar-Cc6ANbOP.js";import{t as me}from"./useAppSidebarCollapsed-CFy476E3.js";import{C as d,D as f,E as p,O as m,S as h,T as g,b as he,k as _,w as v,y as ge}from"./main-DAbEANjY.js";var y=e(c(),1),b=n();function x({rawDraftId:e,search:n}){let c=ee(),x=a.make(e),S=`draft:${x}`,_e=(0,y.useCallback)(e=>{c({to:`/draft/$draftId`,params:{draftId:x},replace:!0,search:e})},[x,c]),C=ne({threadKey:S,search:n,replaceSearch:_e}),w=ae(x),T=r((0,y.useMemo)(()=>s(w?.threadId??null),[w?.threadId])),ve=ie(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=ge(C),A=he(C),j=C.workspaceTab===`agent`&&C.workspaceAgentKey?C.workspaceAgentKey:null,ye=fe(de),M=pe(),N=E?`${E.environmentId}:${E.threadId}`:null,P=t(e=>N?e.pendingOpenByThreadKey[N]:void 0),F=t(e=>e.consumeOpenRequest),be=me(),{maximized:I,toggleMaximized:xe}=ce({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),c({to:`/draft/$draftId`,params:{draftId:x},search:e=>f(e)}))},[E,F,x,c,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)(()=>{c({to:`/draft/$draftId`,params:{draftId:x},search:e=>le(e)})},[x,c]),X=(0,y.useCallback)(()=>{c({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let t=G[G.length-1];return K===`agent`&&t?h(e,t):K===`files`&&B?g(e):K===`review`&&z?p(e):K===`terminal`&&V?m(e):K===`simulator`&&H?f(e):K===`browser`&&U?v(e):K===`agents`&&W?d(e):B?g(e):z?p(e):V?m(e):H?f(e):U?v(e):W?d(e):t?h(e,t):_(e)}})},[x,W,z,B,H,U,V,K,c,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&&c({to:`/draft/$draftId`,params:{draftId:x},search:e=>{let n=t[t.length-1];return n?h(e,n):B?g(e):z?p(e):V?m(e):H?f(e):U?v(e):W?d(e):_(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&&c({to:`/draft/$draftId`,params:{draftId:x},search:s=>e.mode!==`files`&&n?g(s):e.mode!==`review`&&t?p(s):e.mode!==`terminal`&&r?m(s):e.mode!==`simulator`&&i?f(s):e.mode!==`browser`&&a?v(s):e.mode!==`agents`&&o?d(s):_(s)})},[j,x,W,z,B,H,U,V,c,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&&(re(S,`${E.environmentId}:${E.threadId}`),c({to:`/$environmentId/$threadId`,params:i(E),replace:!0}))},[E,c,S]),(0,y.useEffect)(()=>{w||E||c({to:`/`,replace:!0})},[E,w,c]),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)(l,{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)(l,{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,{label:`Workspace`,open:A,onClose:Y,children:we?(0,b.jsx)(ue,{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)(l,{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)(te,{open:A,onClose:Y,children:Ce?(0,b.jsx)(ue,{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)(l,{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)(oe,{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-BugIGt5e.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-D8dOcEYq.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{ei as e}from"./runtime-OM-uAtaj.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{ei as e}from"./runtime-BwHA1GUS.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{r as e}from"./rolldown-runtime-hePW80VL.js";import{q as t}from"./primary-CQh_KHGG.js";import{Si as n,_i as r}from"./src-DHNjfMxR.js";import{$ as i,$l as a,J as o,P as s,Qr as c,ao as l,ei as u,ho as d,lo as f,po as p}from"./runtime-OM-uAtaj.js";import{t as m}from"./react-CwJFpaho.js";import{t as h}from"./compiler-runtime-C4g8XhC5.js";import{_ as g,b as _,d as v,g as y,h as b,m as x,p as S,t as C,y as w}from"./hostedConnectionCoordinator-BztHfGNt.js";import{t as T}from"./useNavigate-01O5dMQe.js";import{t as E}from"./download-CHdS3R_v.js";import{t as ee}from"./log-out-D3rICSt5.js";import{t as te}from"./refresh-cw-K_hU8_ld.js";import{t as D}from"./shield-check-CdFhWT_o.js";import{t as O}from"./shield-i098Bm_B.js";import{t as k}from"./smartphone-DGfizz51.js";import{t as ne}from"./user-round-C-U7TZKG.js";import{o as A}from"./authorization-BugIGt5e.js";import{t as j}from"./usePresentationTier-hxB7Yv_Q.js";import{a as re,i as M,n as N,o as P,s as F,t as ie}from"./MobileSheet-CtQIYRlY.js";import{t as I}from"./GlassSurface-BlWIlQ0s.js";import{i as ae,t as L}from"./hubRoutes-DExWSvVE.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-DPVrIfj_.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=d(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=d(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=d(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=d(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=d(me),K=a(),q=h(),J=e(m(),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)(_,g)}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:n.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=v(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),x()}function Le(){if(De||!y())return;let e=g(),t=s.getState();if(e.malformed){Y(`invalid-link`),$(null),x();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&&!C()){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(()=>{x(),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 c=r!==null&&!a.presence.online&&!o;r&&C()&&!c||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)){x();return}let n=we(e);if(n===null)return;if(t.directoryStatus===`stale`){Y(`unavailable`),x();return}if(t.directoryStatus!==`ready`)return;let r=t.nodes.find(e=>e.environmentId===n&&e.revokedAt===null);if(!r){Y(`unavailable`),x();return}S(r.id)}function ze(e){return y()?(Q=e,Y(null),b(e)):!1}function Be(){if(!y())return!1;Q=null,Y(null);let e=g();return e.nodeId===null&&e.logicalPathname===`/nodes`||w()}function Ve(){ke+=1;let e=_(Pe),t=s.subscribe(Pe),n=y()?.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=u(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 d;return t[4]!==i||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==o?(d=(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]=d):d=t[10],d}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),n=oe(),r=B(),a=s(Xe),c=s(Ye),l=s(Je);if(n!==`web-unsigned`)return null;let u,d;e[0]!==r||e[1]!==c||e[2]!==a||e[3]!==l?(u=ce(i(`security`,{hosted:t(),role:o(a,c,l)})),d=R(r,u),e[0]=r,e[1]=c,e[2]=a,e[3]=l,e[4]=u,e[5]=d):(u=e[4],d=e[5]);let p=d;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)(f,{"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]!==u||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":u,className:`space-y-2`,children:[m,h,v]}),e[15]=u,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`,l;t[0]!==n||t[1]!==r||t[2]!==i.installState?(l=i.installState===`native-available`?(0,K.jsxs)(c,{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]=l):l=t[3];let u;t[4]!==n||t[5]!==a||t[6]!==i.installState?(u=i.installState===`manual-available`?(0,K.jsxs)(c,{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]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i.updateState?(d=i.updateState===`idle`?null:(0,K.jsxs)(c,{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]=d):d=t[11];let f;t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[l,u,d]}),t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;t[16]!==a||t[17]!==i?(p=a?(0,K.jsx)(lt,{snapshot:i,onClose:()=>o(!1)}):null,t[16]=a,t[17]=i,t[18]=p):p=t[18];let m;t[19]!==i.errorMessage||t[20]!==i.registrationState?(m=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]=m):m=t[21];let h;return t[22]!==s||t[23]!==f||t[24]!==p||t[25]!==m?(h=(0,K.jsxs)(`section`,{className:s,"aria-label":`Ryco app installation`,children:[f,p,m]}),t[22]=s,t[23]=f,t[24]=p,t[25]=m,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 o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(l,{"aria-hidden":!0}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(`span`,{className:`sr-only`,children:`Close install instructions`}),t[4]=s):s=t[4];let u;t[5]===r?u=t[6]:(u=(0,K.jsxs)(c,{className:`size-11 shrink-0`,size:`icon`,variant:`ghost`,onClick:r,children:[o,` `,s]}),t[5]=r,t[6]=u);let d;t[7]!==a||t[8]!==u?(d=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[a,u]}),t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:(0,K.jsx)(ue,{compact:!0})}),t[10]=f):f=t[10];let p;return t[11]===d?p=t[12]:(p=(0,K.jsxs)(`div`,{role:`region`,"aria-label":`Install Ryco instructions`,className:`rounded-lg border border-border bg-background p-3 text-sm`,children:[d,f]}),t[11]=d,t[12]=p),p}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=s(_t),n=s(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…`,l;return e[1]!==i||e[2]!==a||e[3]!==o?(l=(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)(c,{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]=l):l=e[4],l}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=s(kt),n=s(Ot),r=s(Dt),i=s(Et),a=s(Tt),o=s(wt),l=s(Ct),u=s(St),d=s(xt),f=oe(),{switchNode:m,returnToAllNodes:h}=pt(),g=(0,J.useRef)(null);if(!t)return null;let _,v;if(e[0]!==d||e[1]!==f||e[2]!==a||e[3]!==i||e[4]!==r){let t={browserStatus:d,sessionStatus:i,selectionStatus:a,transportStatus:r,e2eeStatus:f};_=se(t),v=le(t),e[0]=d,e[1]=f,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=l??`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]===u?k=e[27]:(k=u?(0,K.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:u}):null,e[26]=u,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]!==d||e[35]!==o||e[36]!==t.id||e[37]!==n||e[38]!==m){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]!==d||e[43]!==o||e[44]!==m?(i=e=>(0,K.jsxs)(`button`,{type:`button`,disabled:o!==`ready`||d!==`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 m(e),children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.label}),(0,K.jsx)(ft,{node:e})]},e.id),e[42]=d,e[43]=o,e[44]=m,e[45]=i):i=e[45],N=n.filter(r).map(i),e[34]=d,e[35]=o,e[36]=t.id,e[37]=n,e[38]=m,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)(c,{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)(c,{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)(c,{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=s(Vt),a=s(Bt),o=s(zt),l=s(Rt),u=s(Lt),d=s(It),f=s(Ft),p=s(Pt),m=s(Nt),h=oe(),{switchNode:g,returnToAllNodes:_}=pt();if(!i)return null;let v,y;if(t[0]!==m||t[1]!==h||t[2]!==u||t[3]!==l||t[4]!==o){let e={browserStatus:m,sessionStatus:l,selectionStatus:u,transportStatus:o,e2eeStatus:h};v=se(e),y=le(e),t[0]=m,t[1]=h,t[2]=u,t[3]=l,t[4]=o,t[5]=v,t[6]=y}else v=t[5],y=t[6];let b=y,x=d!==`ready`||m!==`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=f??`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]===p?k=t[25]:(k=p?(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:p}):null,t[24]=p,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=d===`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)(c,{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)(c,{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=s(qt),n=s(Kt),r=s(Gt),i=s(Wt),a=s(Ut),o=oe(),[c,l]=(0,J.useState)(!1);if(!t)return null;let u,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};u=se(t),d=le(t),e[0]=a,e[1]=o,e[2]=i,e[3]=r,e[4]=n,e[5]=u,e[6]=d}else u=e[5],d=e[6];let f=d,p;e[7]!==t.label||e[8]!==c||e[9]!==r||e[10]!==u?(p=c?null:(0,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,`: `,u,`.`]}),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]=c,e[9]=r,e[10]=u,e[11]=p):p=e[11];let m=`Connection: ${t.label}, ${u}`,h;e[12]===f?h=e[13]:(h=(0,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=()=>l(!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]===c?v=e[20]:(v=(0,K.jsx)(At,{open:c,onOpenChange:l}),e[19]=c,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{r as e}from"./rolldown-runtime-hePW80VL.js";import{q as t}from"./primary-DZjgHvyf.js";import{Si as n,_i as r}from"./src-C3Y_imaX.js";import{$ as i,$l as a,J as o,P as s,Qr as c,ao as l,ei as u,ho as d,lo as f,po as p}from"./runtime-BwHA1GUS.js";import{t as m}from"./react-CwJFpaho.js";import{t as h}from"./compiler-runtime-C4g8XhC5.js";import{_ as g,b as _,d as v,g as y,h as b,m as x,p as S,t as C,y as w}from"./hostedConnectionCoordinator-BuRWCvUG.js";import{t as T}from"./useNavigate-B8oXtF30.js";import{t as E}from"./download-DsYNYJeu.js";import{t as ee}from"./log-out-D5-aSBAz.js";import{t as te}from"./refresh-cw-CgDa2Ok_.js";import{t as D}from"./shield-check-CGD7sEeF.js";import{t as O}from"./shield-DPC4oHTi.js";import{t as k}from"./smartphone-DgVJfbv3.js";import{t as ne}from"./user-round-CLy1Qy1Y.js";import{o as A}from"./authorization-D8dOcEYq.js";import{t as j}from"./usePresentationTier-hxB7Yv_Q.js";import{a as re,i as M,n as N,o as P,s as F,t as ie}from"./MobileSheet-lT--mLEz.js";import{t as I}from"./GlassSurface-DDG4eTlj.js";import{i as ae,t as L}from"./hubRoutes-jcMPIFy3.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-B9jp4SRh.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=d(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=d(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=d(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=d(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=d(me),K=a(),q=h(),J=e(m(),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)(_,g)}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:n.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=v(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),x()}function Le(){if(De||!y())return;let e=g(),t=s.getState();if(e.malformed){Y(`invalid-link`),$(null),x();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&&!C()){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(()=>{x(),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 c=r!==null&&!a.presence.online&&!o;r&&C()&&!c||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)){x();return}let n=we(e);if(n===null)return;if(t.directoryStatus===`stale`){Y(`unavailable`),x();return}if(t.directoryStatus!==`ready`)return;let r=t.nodes.find(e=>e.environmentId===n&&e.revokedAt===null);if(!r){Y(`unavailable`),x();return}S(r.id)}function ze(e){return y()?(Q=e,Y(null),b(e)):!1}function Be(){if(!y())return!1;Q=null,Y(null);let e=g();return e.nodeId===null&&e.logicalPathname===`/nodes`||w()}function Ve(){ke+=1;let e=_(Pe),t=s.subscribe(Pe),n=y()?.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=u(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 d;return t[4]!==i||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==o?(d=(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]=d):d=t[10],d}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),n=oe(),r=B(),a=s(Xe),c=s(Ye),l=s(Je);if(n!==`web-unsigned`)return null;let u,d;e[0]!==r||e[1]!==c||e[2]!==a||e[3]!==l?(u=ce(i(`security`,{hosted:t(),role:o(a,c,l)})),d=R(r,u),e[0]=r,e[1]=c,e[2]=a,e[3]=l,e[4]=u,e[5]=d):(u=e[4],d=e[5]);let p=d;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)(f,{"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]!==u||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":u,className:`space-y-2`,children:[m,h,v]}),e[15]=u,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`,l;t[0]!==n||t[1]!==r||t[2]!==i.installState?(l=i.installState===`native-available`?(0,K.jsxs)(c,{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]=l):l=t[3];let u;t[4]!==n||t[5]!==a||t[6]!==i.installState?(u=i.installState===`manual-available`?(0,K.jsxs)(c,{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]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i.updateState?(d=i.updateState===`idle`?null:(0,K.jsxs)(c,{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]=d):d=t[11];let f;t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[l,u,d]}),t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;t[16]!==a||t[17]!==i?(p=a?(0,K.jsx)(lt,{snapshot:i,onClose:()=>o(!1)}):null,t[16]=a,t[17]=i,t[18]=p):p=t[18];let m;t[19]!==i.errorMessage||t[20]!==i.registrationState?(m=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]=m):m=t[21];let h;return t[22]!==s||t[23]!==f||t[24]!==p||t[25]!==m?(h=(0,K.jsxs)(`section`,{className:s,"aria-label":`Ryco app installation`,children:[f,p,m]}),t[22]=s,t[23]=f,t[24]=p,t[25]=m,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 o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(l,{"aria-hidden":!0}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(`span`,{className:`sr-only`,children:`Close install instructions`}),t[4]=s):s=t[4];let u;t[5]===r?u=t[6]:(u=(0,K.jsxs)(c,{className:`size-11 shrink-0`,size:`icon`,variant:`ghost`,onClick:r,children:[o,` `,s]}),t[5]=r,t[6]=u);let d;t[7]!==a||t[8]!==u?(d=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[a,u]}),t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:(0,K.jsx)(ue,{compact:!0})}),t[10]=f):f=t[10];let p;return t[11]===d?p=t[12]:(p=(0,K.jsxs)(`div`,{role:`region`,"aria-label":`Install Ryco instructions`,className:`rounded-lg border border-border bg-background p-3 text-sm`,children:[d,f]}),t[11]=d,t[12]=p),p}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=s(_t),n=s(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…`,l;return e[1]!==i||e[2]!==a||e[3]!==o?(l=(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)(c,{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]=l):l=e[4],l}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=s(kt),n=s(Ot),r=s(Dt),i=s(Et),a=s(Tt),o=s(wt),l=s(Ct),u=s(St),d=s(xt),f=oe(),{switchNode:m,returnToAllNodes:h}=pt(),g=(0,J.useRef)(null);if(!t)return null;let _,v;if(e[0]!==d||e[1]!==f||e[2]!==a||e[3]!==i||e[4]!==r){let t={browserStatus:d,sessionStatus:i,selectionStatus:a,transportStatus:r,e2eeStatus:f};_=se(t),v=le(t),e[0]=d,e[1]=f,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=l??`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]===u?k=e[27]:(k=u?(0,K.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:u}):null,e[26]=u,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]!==d||e[35]!==o||e[36]!==t.id||e[37]!==n||e[38]!==m){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]!==d||e[43]!==o||e[44]!==m?(i=e=>(0,K.jsxs)(`button`,{type:`button`,disabled:o!==`ready`||d!==`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 m(e),children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.label}),(0,K.jsx)(ft,{node:e})]},e.id),e[42]=d,e[43]=o,e[44]=m,e[45]=i):i=e[45],N=n.filter(r).map(i),e[34]=d,e[35]=o,e[36]=t.id,e[37]=n,e[38]=m,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)(c,{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)(c,{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)(c,{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=s(Vt),a=s(Bt),o=s(zt),l=s(Rt),u=s(Lt),d=s(It),f=s(Ft),p=s(Pt),m=s(Nt),h=oe(),{switchNode:g,returnToAllNodes:_}=pt();if(!i)return null;let v,y;if(t[0]!==m||t[1]!==h||t[2]!==u||t[3]!==l||t[4]!==o){let e={browserStatus:m,sessionStatus:l,selectionStatus:u,transportStatus:o,e2eeStatus:h};v=se(e),y=le(e),t[0]=m,t[1]=h,t[2]=u,t[3]=l,t[4]=o,t[5]=v,t[6]=y}else v=t[5],y=t[6];let b=y,x=d!==`ready`||m!==`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=f??`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]===p?k=t[25]:(k=p?(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:p}):null,t[24]=p,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=d===`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)(c,{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)(c,{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=s(qt),n=s(Kt),r=s(Gt),i=s(Wt),a=s(Ut),o=oe(),[c,l]=(0,J.useState)(!1);if(!t)return null;let u,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};u=se(t),d=le(t),e[0]=a,e[1]=o,e[2]=i,e[3]=r,e[4]=n,e[5]=u,e[6]=d}else u=e[5],d=e[6];let f=d,p;e[7]!==t.label||e[8]!==c||e[9]!==r||e[10]!==u?(p=c?null:(0,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,`: `,u,`.`]}),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]=c,e[9]=r,e[10]=u,e[11]=p):p=e[11];let m=`Connection: ${t.label}, ${u}`,h;e[12]===f?h=e[13]:(h=(0,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=()=>l(!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]===c?v=e[20]:(v=(0,K.jsx)(At,{open:c,onOpenChange:l}),e[19]=c,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};