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 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,D as n,E as r,N as i,O as a,P as o,S as s,_ as c,b as l,c as u,d,f,l as p,m,q as h,s as g,v as _,x as v,y}from"./primary-CQh_KHGG.js";import{$l as b,Lt as x,P as S,Ql as C,Qr as w,Zr as ee,jr as te,lo as ne,oo as re}from"./runtime-OM-uAtaj.js";import{t as ie}from"./react-CwJFpaho.js";import{Gt as ae,J as oe,Jt as se,K as ce,Kt as le,Q as ue,Qt as de,X as fe,Xt as pe,Y as me,Yt as he,Z as ge,Zt as _e,q as ve,qt as ye,t as T}from"./switch-D9inWKdd.js";import{t as be}from"./compiler-runtime-C4g8XhC5.js";import{t as xe}from"./badge-BswOCwph.js";import{t as E}from"./qr-code-Cmfz5JKf.js";import{t as Se}from"./refresh-cw-K_hU8_ld.js";import{et as D}from"./authorization-BugIGt5e.js";import{t as Ce}from"./input-CzU08wbL.js";import{i as we,r as Te,t as Ee}from"./alert-CwrDisFU.js";import{i as O,n as De,r as k}from"./settingsLayout-BbjDM-p0.js";import{a as A,i as j,n as M,o as N,s as P,t as F}from"./HostedRelayTrustNotice-DPVrIfj_.js";import{t as Oe}from"./qr-code-BFO8lV1M.js";var I=e(ie(),1),L=be();function ke(e){return e?`hosted`:`local`}function Ae(e,t){return e===`local`?{headline:`Direct to a node on this machine`,body:`This window talks to a Ryco node running here, on this machine. No Ryco Hub sits between them and nothing you send leaves this machine on its way to the node.`}:{headline:t===null?`Through the Ryco Hub`:t.shortLabel,body:`This browser reaches a node through the Ryco Hub relay. What that channel is worth is stated with the channel itself, below.`}}function je(e,t=`owner`){return e===`local`?t===`owner`?{available:!0,unavailableBody:``}:t===`checking`?{available:!1,unavailableBody:`Checking whether this session can administer the node's security state.`}:t===`client`?{available:!1,unavailableBody:"This browser is paired as a client. Node security administration is owner-only; open Ryco Desktop on this machine or run `ryco e2ee` on the node. This direct client connection remains available."}:{available:!1,unavailableBody:"Ryco could not verify that this session may administer the node's security state. Reconnect from Ryco Desktop on this machine or run `ryco e2ee` on the node."}:{available:!1,unavailableBody:"Your node's client list, live sessions, admission policy, prekey and fallback counters are held on the node and read over its own local interface, which the relay does not carry. Open Ryco on that machine to see them, or run `ryco e2ee` there."}}function Me(e){return e===`local`?{kind:`available`}:{kind:`blocked`,reason:"This one can only be changed from the node itself. It admits approved native client keys and closes browser and legacy access — including this browser, which is how you are reading this — so turning it on from here would end this session and leave no way back in through it. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node, where you can still reach it if the result is not what you wanted."}}var R="This build cannot change whether the node admits only approved native client keys. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node.";function Ne(e,t){if(e===`hosted`&&t.requireApprovedClientE2EE!==void 0){let t=Me(e);return{allowed:!1,refusal:t.kind===`blocked`?t.reason:R}}return{allowed:!0,proposal:t}}function z(e){let t=e.split(D.separator);if(t.length!==D.groups)return[];for(let e of t){if(e.length!==D.digitsPerGroup)return[];for(let t of e)if(t<`0`||t>`9`)return[]}return t}var B=`${D.digits} digits, in ${D.groups} groups of ${D.digitsPerGroup}. The length and the grouping are the only check there is, so read all ${D.digits} in order.`,Pe=`Compare this with the number the device itself shows, on the device, before approving it. They match only for this key pair under this Hub account — the same device under a different account reads differently. Approve nothing whose number you have not read off the other screen yourself.`;function V(e){let t=z(e);return t.length===0?null:{groups:t,display:t.join(D.separator),caption:B,advisory:Pe}}var Fe=`No comparison number is readable for this record, so there is nothing here to check against the device.`;function Ie(e){return e===null?{available:!1,fingerprint:null,caption:"This node's identity fingerprint is shown here only while an enrollment is waiting for approval. At other times, read it from the node with `ryco hub status` on the machine running it."}:{available:!0,fingerprint:e,caption:`This node's identity fingerprint, from the enrollment now waiting for approval. Compare it character for character wherever you are asked to confirm this machine.`}}var H=`unknown`;function U(e){if(e===void 0)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?H:t.toLocaleString()}function Le(e){return e===null?[{label:`Agreement prekey`,value:H}]:e.present?[{label:`Prekey`,value:e.prekeyId??H,mono:!0},{label:`Fingerprint`,value:e.fingerprint??H,mono:!0},{label:`Validity`,value:e.validity??H},{label:`Created`,value:U(e.createdAt)},{label:`Expires`,value:U(e.expiresAt)}]:[{label:`Agreement prekey`,value:`none held`}]}function Re(e){return e===null?null:e.present?e.remedy??null:`This node holds no agreement prekey for its Hub origin. It re-signs one at startup; rotate to issue one now.`}function ze(e){return e===null?[{label:`Continuity`,value:H}]:e.status===`unavailable`?[{label:`Continuity`,value:`unresolvable`},{label:`Reason`,value:e.reason??H}]:[{label:`Continuity`,value:`advertisable`},{label:`Lineage`,value:e.continuityId??H,mono:!0},{label:`Rotation generation`,value:String(e.generation??0)},{label:`Retained chain length`,value:String(e.chainLength??0)},...e.repair===void 0?[]:[{label:`Startup repair`,value:e.repair}],...e.lastBreakReason===void 0?[]:[{label:`Last break`,value:`${e.lastBreakReason} at ${U(e.lastBreakAt)}`}]]}function Be(e){return e?.remedy??null}function W(e){switch(e){case`pending`:return`warning`;case`approved`:return`success`;case`revoked`:return`error`}}function G(e){let t=e.displayLabel?.trim()??``;return t===``?`Client key …${e.fingerprint.slice(-8)}`:t}function K(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Hub origin`,value:e.hubOrigin},{label:`Account`,value:e.accountId},{label:`Maximum role`,value:e.maxRole===``?`none granted`:e.maxRole},{label:`Capabilities`,value:e.capabilitySet.length===0?`none`:e.capabilitySet.join(`, `)},{label:`Created`,value:U(e.createdAt)},...e.approvedAt===void 0?[]:[{label:`Approved`,value:U(e.approvedAt)}],...e.revokedAt===void 0?[]:[{label:`Revoked`,value:U(e.revokedAt)}],{label:`Last seen`,value:U(e.lastSeenAt)},...e.pairingReserved?[{label:`Pairing reservation`,value:`held`}]:[]]}function Ve(e){if(e===null)return[];let t=[];return(e.pendingGlobalSaturated||e.saturatedAccounts.length>0)&&t.push(`Pending pairing is saturated, so a new device may not be able to introduce itself. Purge a pending record, or read the fingerprint off the device and open a pairing window naming it.`),e.refusedPairingAttempts>0&&t.push(`${e.refusedPairingAttempts} pairing attempt(s) were refused because the pending list was full. Clear the count once you have dealt with them, or later readings will be dominated by history.`),t}function He(e){if(e===null)return[{label:`Pairing window`,value:H}];let t=e.pairingWindow;return t===void 0?[{label:`Pairing window`,value:`closed`}]:[{label:`Pairing window`,value:`open`},{label:`Only this fingerprint`,value:t.fingerprint,mono:!0},{label:`Expires`,value:U(t.expiresAt)},{label:`Reservation`,value:t.spent?`spent`:`unspent`}]}function Ue(e){return e===null?`How many pairing attempts this node refused because the pending list was full has not been read here.`:`${e.refusedPairingAttempts} attempt(s) refused because the pending list was full.`}var We=`A window lets exactly one device introduce itself, and only the one whose fingerprint you name.`;function Ge(e){return[{label:`Tier`,value:e.tier===`native`?`native (IK)`:`browser (NX)`},{label:`Suite`,value:String(e.suite)},{label:`Established`,value:U(e.establishedAt)}]}var Ke=`Native sessions have no per-session code. Compare this device's long-term number on its record above instead.`,q=`Compare this code with the one that browser is showing for this session, on that screen. A match catches accidental wrong-node routing and some network interposition — anyone standing in for this node who is not also serving that browser its page — while the code that browser loaded is honest; it cannot protect against whoever served that page, and a match does not rule out someone sitting in the middle.`,qe=`No session code reached this listing for that channel, so there is nothing here to compare against the browser holding it.`;function Je(e){let t=j(e,`inline`);return t===null?null:{groups:t.groups,display:t.display,advisory:q,more:null}}var Ye=`A browser channel this node has open. Its per-session code is below.`;function Xe(e){return e===null?[{label:`Admission policy`,value:H}]:[{label:`requireE2EE`,value:String(e.requireE2EE),mono:!0},{label:`requireApprovedClientE2EE`,value:String(e.requireApprovedClientE2EE),mono:!0},{label:`Effective requireE2EE`,value:String(e.effectiveRequireE2EE),mono:!0},{label:`Admitted patterns`,value:e.admittedPatterns.join(`, `)||`none`},{label:`Suite registry`,value:e.suiteRegistry.join(`, `)||`none`},{label:`Policy generation`,value:String(e.generation)}]}function Ze(e,t,n){let r=[];t.requireApprovedClientE2EE===!0&&r.push(`requireApprovedClientE2EE closes browser and legacy access entirely. Only approved native client keys reach application payload after this, and losing every approved key strands remote access to this node until someone recovers it at the machine — which never relaxes admission policy.`);for(let e of Qe(t,n))r.push(e);return e.withdrawal&&r.push(`This narrows what the node admits, so it closes live channels. Roughly matching now: ${e.counts.legacy} legacy, ${e.counts.nxE2ee} browser, ${e.counts.suiteWithdrawn} on a withdrawn suite, and ${e.counts.abortedHandshakes} handshake(s) in flight. These move while you read them.`),e.changed||r.push(`This changes nothing: the node already admits exactly this.`),r.length===0&&r.push($e),r}function Qe(e,t){let n=[];return e.requireE2EE===!1&&t?.requireE2EE!==!1&&n.push(`Turning this off re-admits plaintext. The node goes back to accepting relay payload it has not encrypted, for browsers and for legacy clients, and the Hub carries that in a form it can read. It closes nothing now — what changes is what the node accepts next.`),e.requireApprovedClientE2EE===!1&&t?.requireApprovedClientE2EE!==!1&&n.push(`Clearing this re-admits the browser and legacy tiers. Client keys this node has not approved reach it again on their next connection, under whatever the remaining policy allows.`),n}var $e=`The node reports that this closes no channel it has open now. That is a statement about the live channels and not about what the node will admit afterwards.`;function et(e,t,n){return e.withdrawal||Qe(t,n).length>0}function tt(e){return[e.changed?`Policy committed.`:`Policy unchanged.`,`Closed ${e.counts.legacy} legacy channel(s), ${e.counts.nxE2ee} browser channel(s), ${e.counts.suiteWithdrawn} suite-withdrawn channel(s); aborted ${e.counts.abortedHandshakes} handshake(s) in flight.`].join(` `)}var nt=`This advances the policy generation past every value this node may already have advertised, and the jump is deliberate. Clients accept only a higher generation than the one they remember, so nothing below the new value can be advertised again. If a restore rolled the record back, recovery does not restore the old values: it commits the fail-closed policy, which admits only approved native client keys and so closes browser and legacy access entirely, including every remote browser session open now. There is no way to tell from here which of the two this will be. Widening it back is a separate, explicit policy change, and if this node's only remaining access was a browser it has to be made at the machine.`;function rt(e){if(e===null)return null;let t=e.peerLegacy.ringOverflows>0||e.advertisementUnavailable.ringOverflows>0;return{windowStarted:U(e.windowStartedAt),classes:[{label:`Peer spoke legacy`,meaning:`The other end did not take the encrypted channel, so this one carried readable payload.`,occurrences:e.peerLegacy.occurrences,lastOccurrence:U(e.peerLegacy.lastOccurrenceAt),ringOverflows:e.peerLegacy.ringOverflows},{label:`No advertisement`,meaning:`This node could not offer an encrypted channel, or the offer did not survive the path. It cannot tell which.`,occurrences:e.advertisementUnavailable.occurrences,lastOccurrence:U(e.advertisementUnavailable.lastOccurrenceAt),ringOverflows:e.advertisementUnavailable.ringOverflows}],entries:[...e.ring].toSorted((e,t)=>e.occurredAt-t.occurredAt).map((e,t)=>({ordinal:t,at:U(e.occurredAt),reason:e.reason})),overflowNotice:t?`The retained list overflowed, so it is an incomplete account of this window. The shape of what is left is not evidence in either direction.`:null,undersizedNotice:e.undersizedConnection===void 0?null:`This connection asserts a maximum chunk of ${e.undersizedConnection.assertedMaxDataChunkBytes} bytes, below the ${e.undersizedConnection.advertisementMinChunkBytes} bytes an offer needs. Nothing that fits can carry one, so this node offers nothing on this connection.`,quiet:e.peerLegacy.occurrences===0&&e.advertisementUnavailable.occurrences===0&&e.ring.length===0}}var it=`Nothing has fallen back in this window. This counts what happened, not what could — a quiet window is not a statement about the next one.`,J={approve:{title:`Approve this client key?`,body:`The device holding this key may then reach this node, up to the role and capabilities you grant here. Compare its number against the device first. It takes effect on its next connection, not on anything open now.`,confirmLabel:`Approve key`,destructive:!1},narrow:{title:`Reduce what this client may do?`,body:`Anything this device has open under the wider authority closes immediately — the node will not confirm the change until those channels are shut. The device reconnects with the smaller role ceiling. Its capability grant is left exactly as it is; only the ceiling drops, and changing the capabilities is a separate command on the node.`,confirmLabel:`Reduce authority`,destructive:!0},revoke:{title:`Revoke this client key?`,body:`The device loses access now: every channel it has open closes before this is confirmed, and it cannot reconnect until you approve it again. The record stays, so you can see it was revoked.`,confirmLabel:`Revoke key`,destructive:!0},purge:{title:`Delete this client record?`,body:`The same immediate disconnection as revoking, and the record goes with it — there will be nothing left showing this device was ever here. If it connects again it arrives as a stranger and pairs from scratch.`,confirmLabel:`Delete record`,destructive:!0},"open-window":{title:`Open a pairing window for this fingerprint?`,body:`For a short time this node will accept one introduction, and only from the key whose fingerprint you name. Read that fingerprint off the device itself — a window naming the wrong one lets the wrong device in.`,confirmLabel:`Open window`,destructive:!1},"close-window":{title:`Close the pairing window?`,body:`No new device can introduce itself until you open another. Anything already introduced keeps its record.`,confirmLabel:`Close window`,destructive:!1},"clear-refusals":{title:`Clear the refused-attempt count?`,body:`The count goes back to zero. Do this once you have dealt with what caused it, so the next reading is about the next thing rather than about history.`,confirmLabel:`Clear count`,destructive:!1},"rotate-prekey":{title:`Issue a new agreement prekey?`,body:`The node makes a fresh key pair and certificate immediately. Clients pick the new one up on their next connection; nothing already open is disturbed.`,confirmLabel:`Rotate prekey`,destructive:!1},"recover-policy":{title:`Advance the policy generation?`,body:nt,confirmLabel:`Advance generation`,destructive:!0},"reset-fallback":{title:`Reset the fallback counters?`,body:`Both counts and the retained list go back to empty and a new observation window starts. What was recorded is gone; nothing else changes.`,confirmLabel:`Reset counters`,destructive:!1},"remint-continuity":{title:`Break continuity and mint a fresh lineage?`,body:`Every device that has paired with this node has to go through the whole pairing ceremony again, in person, before it can reconnect. Do this when you believe the lineage is wrong, not to tidy it up.`,confirmLabel:`Mint fresh lineage`,destructive:!0},"break-continuity":{title:`Break the continuity chain?`,body:`The lineage keeps its name, but every device that pinned this node has to go through the pairing ceremony again before it can reconnect.`,confirmLabel:`Break chain`,destructive:!0}};function at(e){return J[e]}var Y=`It applies to the key below and to no other. Check the fingerprint against the device you meant: two devices paired under one account are told apart by nothing else here.`;function X(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Account`,value:e.accountId},{label:`Hub origin`,value:e.hubOrigin}]}function ot(e,t){let n=J[e];return{...n,body:`${n.body} ${Y}`,facts:X(t)}}function st(e){let t=J[`open-window`];return{...t,body:`${t.body} Read the value below off the device now, before confirming.`,facts:[{label:`Only this fingerprint`,value:e,mono:!0}]}}var ct=[`viewer`,`operator`,`owner`],lt={viewer:`read what is there`,operator:`edit files and run terminals`,owner:`also change credentials and server policy`},ut=[`ryco.rpc`];function dt(e,t){let n=J.approve,r=ut.join(`, `);return{title:`Approve this client key as ${e}?`,body:`${n.body} At most it will be able to ${lt[e]}. It is granted the one capability a relay channel carries, ${r} — a key approved with none is admitted by nothing and could not connect at all. `+`${t===void 0?``:Y}`.trimEnd(),confirmLabel:`Approve as ${e}`,destructive:!1,...t===void 0?{}:{facts:X(t)}}}Object.keys(J);var ft=`What this node will admit, and which client keys it has on file.`,pt=`Require an encrypted channel`,mt=`Refuse plaintext, including for browsers.`,Z=`Only approved native client keys`,ht=`Closes browser and legacy access entirely. Only approved native client keys reach application payload.`,gt=`Recover a generation that a restore rolled back.`,_t=`Its current value on the node has not been read here, so nothing on this row states what it is.`,vt=`No device has introduced itself to this node yet.`,yt=`Nothing is connected right now.`,Q=b(),bt=5e3,xt=6e4,St={clients:null,sessions:null,policy:null,prekey:null,continuity:null,fallback:null,enrollmentFingerprint:null};function $(e){let t=(0,L.c)(4),{rows:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Ct),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1.5 sm:grid-cols-[12rem_minmax(0,1fr)]`,children:r}),t[2]=r,t[3]=i),i}function Ct(e){return(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:e.mono?`min-w-0 font-mono text-[12px] break-all text-foreground`:`min-w-0 text-[12px] text-foreground`,children:e.value})]},e.label)}function wt(e){let t=(0,L.c)(14),{value:n}=e,r;t[0]===n?r=t[1]:(r=V(n),t[0]=n,t[1]=r);let i=r;if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number`,"data-value":`absent`,className:`text-[11px] text-muted-foreground`,children:Fe}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Comparison number`}),t[3]=a):a=t[3];let o;t[4]===i.display?o=t[5]:(o=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number-value`,className:`font-mono text-[13px] leading-relaxed font-semibold tracking-[0.08em] select-all`,children:i.display}),t[4]=i.display,t[5]=o);let s;t[6]===i.caption?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.caption}),t[6]=i.caption,t[7]=s);let c;t[8]===i.advisory?c=t[9]:(c=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.advisory}),t[8]=i.advisory,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Q.jsxs)(`div`,{"data-testid":`node-safety-number`,"data-value":`present`,className:`space-y-1.5`,children:[a,o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Tt(e){let t=(0,L.c)(15),{view:n,unavailable:r,testId:i}=e;if(!n){let e;return t[0]!==i||t[1]!==r?(e=(0,Q.jsx)(`p`,{"data-testid":i,"data-code":`absent`,className:`text-[11px] text-muted-foreground`,children:r}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let a=`${i}-value`,o;t[3]!==a||t[4]!==n.display?(o=(0,Q.jsx)(`p`,{"data-testid":a,className:`font-mono text-sm leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:n.display}),t[3]=a,t[4]=n.display,t[5]=o):o=t[5];let s;t[6]===n.advisory?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.advisory}),t[6]=n.advisory,t[7]=s);let c;t[8]===n.more?c=t[9]:(c=n.more===null?null:(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.more}),t[8]=n.more,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==i?(l=(0,Q.jsxs)(`div`,{"data-testid":i,"data-code":`present`,className:`space-y-1.5`,children:[o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=i,t[14]=l):l=t[14],l}function Et(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=j(n,`settings`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Tt,{view:r,unavailable:M,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Dt(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=Je(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Tt,{view:r,unavailable:qe,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Ot(){let e=(0,L.c)(21),t=A(),n=N(),r=S(Mt),i=S(jt),a=S(At),o=S(kt),s,c;e[0]!==r||e[1]!==t||e[2]!==a||e[3]!==i||e[4]!==o?(s=P({browserStatus:r,sessionStatus:i,selectionStatus:a,transportStatus:o,e2eeStatus:t}),c=Ae(`hosted`,s),e[0]=r,e[1]=t,e[2]=a,e[3]=i,e[4]=o,e[5]=s,e[6]=c):(s=e[5],c=e[6]);let l=c,u=s.guarantee===`e2ee`?`success`:s.guarantee===`web`?`info`:s.guarantee===`legacy`?`warning`:`outline`,d;e[7]!==s.shortLabel||e[8]!==u?(d=(0,Q.jsx)(xe,{size:`sm`,variant:u,"data-testid":`node-connection-claim`,children:s.shortLabel}),e[7]=s.shortLabel,e[8]=u,e[9]=d):d=e[9];let f;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(F,{}),e[10]=f):f=e[10];let p;e[11]!==t||e[12]!==n?(p=t===`web-unsigned`?(0,Q.jsx)(Et,{code:n}):null,e[11]=t,e[12]=n,e[13]=p):p=e[13];let m;e[14]===p?m=e[15]:(m=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[f,p]}),e[14]=p,e[15]=m);let h;return e[16]!==l.body||e[17]!==l.headline||e[18]!==d||e[19]!==m?(h=(0,Q.jsx)(O,{title:`This connection`,children:(0,Q.jsx)(k,{title:l.headline,description:l.body,status:d,children:m})}),e[16]=l.body,e[17]=l.headline,e[18]=d,e[19]=m,e[20]=h):h=e[20],h}function kt(e){return e.transportStatus}function At(e){return e.selectionStatus}function jt(e){return e.sessionStatus}function Mt(e){return e.browserStatus}function Nt(){let e=ke(h()),a=typeof window<`u`&&window.desktopBridge!=null,[b,S]=(0,I.useState)(()=>a?`owner`:`checking`),C=je(e,b),ie=Me(e),[T,be]=(0,I.useState)(St),[xe,E]=(0,I.useState)(null),[D,A]=(0,I.useState)(!1),[j,M]=(0,I.useState)(null),[N,P]=(0,I.useState)(null),[F,L]=(0,I.useState)(null),[R,z]=(0,I.useState)(null),[B,Pe]=(0,I.useState)(``),V=(0,I.useRef)(!0),Fe=(0,I.useRef)(0),H=(0,I.useRef)(null),{copyToClipboard:U}=ee();(0,I.useEffect)(()=>(V.current=!0,()=>{V.current=!1}),[]),(0,I.useEffect)(()=>{if(e!==`local`||a)return;let n=!1;return t().then(e=>{n||S(e.authenticated&&e.role===`owner`?`owner`:`client`)}).catch(()=>{n||S(`unavailable`)}),()=>{n=!0}},[a,e]);let W=(0,I.useCallback)(async()=>{if(C.available)try{let[e,t,n,r,i,a]=await Promise.all([c(),s(),l(),v(),_(),y()]),o=await m().catch(()=>null);if(!V.current)return;Fe.current=0,be({clients:e,sessions:t,policy:n,prekey:r,continuity:i,fallback:a,enrollmentFingerprint:o?.fingerprint??null}),E(null)}catch(e){if(!V.current)return;Fe.current+=1,E(e instanceof Error?e.message:`Unable to read the node's security state.`)}},[C.available]);(0,I.useEffect)(()=>{if(!C.available)return;let e=x({lifecycle:te,run:W,resolveDelayMs:()=>Math.min(bt*2**Math.max(0,Fe.current-1),xt),jitterRatio:.1});return H.current=e,()=>{H.current===e&&(H.current=null),e.stop()}},[C.available,W]);let G=(0,I.useCallback)(()=>H.current?.refresh()??W(),[W]),K=(0,I.useCallback)(async(e,t)=>{A(!0),E(null),M(null);try{let n=await e();V.current&&M(typeof n==`string`?n:t),await G()}catch(e){if(!V.current)return;E(e instanceof Error?e.message:`That didn't work.`)}finally{V.current&&A(!1)}},[G]),q=(0,I.useCallback)((e,t,n)=>{L({copy:at(e),run:()=>K(t,n)})},[K]),qe=(0,I.useCallback)((e,t,n)=>{L({copy:e,run:()=>K(t,n)})},[K]),Je=(0,I.useCallback)(async t=>{let n=Ne(e,t);if(!n.allowed){E(n.refusal);return}A(!0),E(null),M(null);try{let e=await r(n.proposal);if(!V.current)return;P({proposal:n.proposal,warnings:Ze(e,n.proposal,T.policy),destructive:et(e,n.proposal,T.policy)})}catch(e){if(!V.current)return;E(e instanceof Error?e.message:`Unable to preview that change.`)}finally{V.current&&A(!1)}},[e,T.policy]),Qe=(0,I.useCallback)(async()=>{if(N===null)return;let t=Ne(e,N.proposal);if(!t.allowed){E(t.refusal),P(null);return}let n=t.proposal;P(null),await K(async()=>tt(await p(n)),`Policy applied.`)},[e,N,K]),$e=(0,I.useCallback)((e,t,n)=>{let r={fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin};qe(ot(t,r),()=>g(e),n)},[qe]),nt=(0,I.useCallback)((e,t)=>{L({copy:dt(t,{fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin}),run:()=>K(async()=>{await g(e);try{let n=await f({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});return V.current&&z({approval:n,label:e.fingerprint}),`Client approved as ${t}. Scan the code on the new device.`}catch{return`Client approved as ${t}. The QR code was not created; use Show phone QR to retry.`}},`Client approved as ${t}.`)})},[K]),J=(0,I.useCallback)(async e=>{A(!0),E(null);try{let t=await f({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});V.current&&z({approval:t,label:e.displayLabel??e.fingerprint})}catch(e){V.current&&E(e instanceof Error?e.message:`Unable to create the phone QR code.`)}finally{V.current&&A(!1)}},[]),Y=Ie(T.enrollmentFingerprint),X=(0,I.useMemo)(()=>rt(T.fallback),[T.fallback]),ct=Ve(T.clients),lt=Re(T.prekey),ut=Be(T.continuity),Z=F?.copy??null,ht=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;return(0,Q.jsxs)(De,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Security`}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:ft})]}),C.available?(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,disabled:D,onClick:()=>void G(),children:[(0,Q.jsx)(Se,{className:`size-3.5`}),`Refresh`]}):null]}),xe===null?null:(0,Q.jsxs)(Ee,{variant:`error`,children:[(0,Q.jsx)(re,{}),(0,Q.jsx)(we,{children:`That didn't work`}),(0,Q.jsx)(Te,{children:xe})]}),j?(0,Q.jsxs)(Ee,{variant:`info`,children:[(0,Q.jsx)(we,{children:`Done`}),(0,Q.jsx)(Te,{children:j})]}):null,e===`hosted`?(0,Q.jsx)(Ot,{}):null,C.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(O,{title:`This node's identity`,children:[(0,Q.jsx)(k,{title:`Enrollment fingerprint`,description:Y.caption,control:Y.fingerprint!==null&&ht?(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,onClick:()=>U(Y.fingerprint),children:[(0,Q.jsx)(ne,{className:`size-3.5`}),`Copy`]}):null,children:Y.fingerprint===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-enrollment-fingerprint`,className:`pb-3.5 font-mono text-[13px] break-all select-all`,children:Y.fingerprint})}),(0,Q.jsx)(k,{title:`Agreement prekey`,description:lt??`The key this node offers for new channels.`,control:(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D,onClick:()=>q(`rotate-prekey`,i,`Prekey rotated.`),children:`Rotate`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Le(T.prekey)})})}),(0,Q.jsx)(k,{title:`Continuity`,description:ut??`The lineage paired clients remember this node by.`,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:D,onClick:()=>q(`break-continuity`,()=>u({action:`break`}),`Continuity chain broken.`),children:`Break chain`}),(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:D,onClick:()=>q(`remint-continuity`,()=>u({action:`remint`}),`Fresh lineage minted.`),children:`Mint fresh`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:ze(T.continuity)})})})]}),(0,Q.jsxs)(O,{title:`Authorized clients`,children:[ct.map(e=>(0,Q.jsx)(k,{title:`Pairing`,description:e},e)),(0,Q.jsx)(k,{title:`Pairing window`,description:We,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ce,{value:B,disabled:D,placeholder:`SHA256:…`,"aria-label":`Pairing window fingerprint`,className:`w-56 font-mono text-xs`,onChange:e=>Pe(e.currentTarget.value)}),(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D||B.trim()===``,onClick:()=>qe(st(B.trim()),()=>o({action:`open`,fingerprint:B.trim()}),`Pairing window opened.`),children:`Open`}),(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D||T.clients?.pairingWindow===void 0,onClick:()=>q(`close-window`,()=>o({action:`close`}),`Pairing window closed.`),children:`Close`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:He(T.clients)})})}),(0,Q.jsx)(k,{title:`Refused attempts`,description:Ue(T.clients),control:(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D||(T.clients?.refusedPairingAttempts??0)===0,onClick:()=>q(`clear-refusals`,d,`Refusal count cleared.`),children:`Clear`})}),(T.clients?.records??[]).map(e=>(0,Q.jsx)(Rt,{record:e,busy:D,onAuthorize:$e,onApprove:nt,onShowApprovalQr:J},`${e.hubOrigin}\u0000${e.accountId}\u0000${e.fingerprint}`)),T.clients!==null&&T.clients.records.length===0?(0,Q.jsx)(k,{title:`No client keys on file`,description:vt}):null]}),(0,Q.jsxs)(O,{title:`Live sessions`,children:[(T.sessions?.sessions??[]).map(e=>(0,Q.jsx)(k,{title:`Session ${e.sessionIndex}`,description:e.tier===`native`?Ke:Ye,children:(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[(0,Q.jsx)($,{rows:Ge(e)}),e.tier===`web`?(0,Q.jsx)(Dt,{code:e.verificationCode??null}):null]})},e.sessionIndex)),T.sessions!==null&&T.sessions.sessions.length===0?(0,Q.jsx)(k,{title:`No sessions`,description:yt}):null]}),(0,Q.jsxs)(O,{title:`Admission policy`,children:[(0,Q.jsx)(It,{title:pt,description:mt,checked:T.policy===null?null:T.policy.requireE2EE,busy:D,ariaLabel:`Require E2EE`,testId:`require-e2ee`,onChange:e=>void Je({requireE2EE:e})}),(0,Q.jsx)(Ft,{disposition:ie,checked:T.policy===null?null:T.policy.requireApprovedClientE2EE,busy:D,onChange:e=>void Je({requireApprovedClientE2EE:e})}),(0,Q.jsx)(k,{title:`Policy generation`,description:gt,control:(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:D,onClick:()=>q(`recover-policy`,n,`Policy generation advanced.`),children:`Advance`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Xe(T.policy)})})})]}),(0,Q.jsx)(O,{title:`Fallback`,children:X===null?(0,Q.jsx)(k,{title:`Fallback`,description:`Waiting for the node.`}):X.quiet?(0,Q.jsx)(k,{title:`Nothing has fallen back`,description:it,control:(0,Q.jsx)(Lt,{busy:D,onConfirm:q})}):(0,Q.jsxs)(Q.Fragment,{children:[X.classes.map(e=>(0,Q.jsx)(k,{title:e.label,description:e.meaning,status:`Last ${e.lastOccurrence}${e.ringOverflows>0?` · ${e.ringOverflows} overflow(s)`:``}`,control:(0,Q.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.occurrences})},e.label)),(0,Q.jsx)(k,{title:`Retained occurrences`,description:X.overflowNotice??`Observation window started ${X.windowStarted}.`,control:(0,Q.jsx)(Lt,{busy:D,onConfirm:q}),children:(0,Q.jsx)(`ul`,{className:`space-y-1 pb-3.5`,children:X.entries.map(e=>(0,Q.jsxs)(`li`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.at,` · `,e.reason]},e.ordinal))})}),X.undersizedNotice?(0,Q.jsx)(k,{title:`Undersized connection`,description:X.undersizedNotice}):null]})})]}):(0,Q.jsxs)(O,{title:e===`hosted`?`This node`:`This session`,children:[(0,Q.jsx)(k,{title:Ae(e,null).headline,description:C.unavailableBody}),e===`hosted`?(0,Q.jsx)(Ft,{disposition:ie,checked:null,busy:D,onChange:e=>void Je({requireApprovedClientE2EE:e})}):null]}),(0,Q.jsx)(ce,{open:N!==null,onOpenChange:e=>!e&&P(null),children:(0,Q.jsxs)(ge,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(ue,{children:`Apply this policy change?`}),(0,Q.jsx)(oe,{children:N?.warnings.map(e=>(0,Q.jsx)(`span`,{className:`block pb-2`,children:e},e))})]}),(0,Q.jsxs)(me,{children:[(0,Q.jsx)(ve,{children:`Leave it`}),(0,Q.jsx)(w,{variant:N?.destructive?`destructive`:`default`,"data-testid":`policy-apply`,disabled:D,onClick:()=>void Qe(),children:`Apply`})]})]})}),(0,Q.jsx)(ce,{open:F!==null,onOpenChange:e=>!e&&L(null),children:(0,Q.jsxs)(ge,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(ue,{children:Z?.title}),(0,Q.jsx)(oe,{children:Z?.body})]}),Z?.facts?(0,Q.jsx)(`div`,{"data-testid":`node-confirmation-facts`,className:`pb-1`,children:(0,Q.jsx)($,{rows:Z.facts})}):null,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(ve,{children:`Cancel`}),(0,Q.jsx)(w,{variant:Z?.destructive?`destructive`:`default`,"data-testid":`node-confirmation-confirm`,disabled:D,onClick:()=>{let e=F;L(null),e&&e.run()},children:Z?.confirmLabel})]})]})}),(0,Q.jsx)(ae,{open:R!==null,onOpenChange:e=>!e&&z(null),children:(0,Q.jsxs)(_e,{className:`max-w-sm`,children:[(0,Q.jsxs)(he,{children:[(0,Q.jsx)(de,{children:`Verify this phone`}),(0,Q.jsx)(ye,{children:`On the new phone, open node verification and scan this code. It is bound to that phone's key and expires after five minutes.`})]}),(0,Q.jsxs)(pe,{className:`space-y-4`,children:[R?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`rounded-2xl bg-white p-3`,children:(0,Q.jsx)(Oe,{value:R.approval.payload,size:240,level:`M`,marginSize:2,title:`Node approval — scan with Ryco on the new phone`})}),(0,Q.jsx)(`p`,{className:`max-w-full break-all text-center font-mono text-[11px] text-muted-foreground`,children:R.label})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`The code contains no secret and grants no access by itself. Ryco will reconnect and prove both device keys after the scan.`})]}),(0,Q.jsx)(se,{variant:`bare`,children:(0,Q.jsx)(le,{render:(0,Q.jsx)(w,{variant:`outline`}),children:`Done`})})]})})]})}function Pt(){let e=(0,L.c)(7),t=C();if(t&&!t.primary){let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(re,{}),e[0]=n):n=e[0];let r;e[1]===t.nodeLabel?r=e[2]:(r=(0,Q.jsxs)(we,{children:[`Open Security on `,t.nodeLabel]}),e[1]=t.nodeLabel,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Te,{children:`Security administration requires that node's direct local operator channel. Ryco has disabled these controls here so an action can never be applied to this Mac by mistake.`}),e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a=(0,Q.jsx)(De,{children:(0,Q.jsxs)(Ee,{variant:`warning`,children:[n,r,i]})}),e[4]=r,e[5]=a),a}let n;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Nt,{}),e[6]=n):n=e[6],n}function Ft(e){let t=(0,L.c)(6),{disposition:n,checked:r,busy:i,onChange:a}=e,o=n.kind===`blocked`,s=n.kind===`blocked`?n.reason:ht,c;return t[0]!==o||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==s?(c=(0,Q.jsx)(It,{title:Z,description:s,checked:r,busy:i,blocked:o,ariaLabel:`Require approved client E2EE`,testId:`require-approved-client-e2ee`,onChange:a}),t[0]=o,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c):c=t[5],c}function It(e){let t=(0,L.c)(11),{title:n,description:r,checked:i,busy:a,blocked:o,ariaLabel:s,testId:c,onChange:l}=e,u=o!==void 0&&o,d=i===null?`${r} ${_t}`:r,f;t[0]!==s||t[1]!==u||t[2]!==a||t[3]!==i||t[4]!==l||t[5]!==c?(f=i===null?(0,Q.jsx)(`span`,{"data-testid":c,"data-policy":`unknown`,"data-blocked":u?`hosted`:void 0,className:`text-[11px] text-muted-foreground`,children:`unknown`}):(0,Q.jsx)(T,{checked:i,disabled:u||a,"aria-label":s,"data-testid":c,"data-policy":String(i),"data-blocked":u?`hosted`:void 0,onCheckedChange:l}),t[0]=s,t[1]=u,t[2]=a,t[3]=i,t[4]=l,t[5]=c,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,Q.jsx)(k,{title:n,description:d,control:f}),t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10],p}function Lt(e){let t=(0,L.c)(5),{busy:n,onConfirm:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`reset-fallback`,a,`Fallback counters reset.`),t[0]=r,t[1]=i);let o;return t[2]!==n||t[3]!==i?(o=(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:n,onClick:i,children:`Reset`}),t[2]=n,t[3]=i,t[4]=o):o=t[4],o}function Rt(e){let t=(0,L.c)(60),{record:n,busy:r,onAuthorize:i,onApprove:a,onShowApprovalQr:o}=e,s,c,l,u,d;if(t[0]!==r||t[1]!==a||t[2]!==n){c={hubOrigin:n.hubOrigin,accountId:n.accountId,fingerprint:n.fingerprint};let e;t[8]===n.status?e=t[9]:(e=W(n.status),t[8]=n.status,t[9]=e);let i=e;s=k;let o;t[10]===n?o=t[11]:(o=G(n),t[10]=n,t[11]=o);let f=i===`success`?`success`:i,p;t[12]!==n.status||t[13]!==f?(p=(0,Q.jsx)(xe,{size:`sm`,variant:f,children:n.status}),t[12]=n.status,t[13]=f,t[14]=p):p=t[14],t[15]!==o||t[16]!==p?(u=(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o,p]}),t[15]=o,t[16]=p,t[17]=u):u=t[17],d=`${n.accountId} at ${n.hubOrigin}`,l=n.status===`approved`?null:ct.map(e=>(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>a({...c,action:`approve`,maxRole:e,capabilitySet:ut},e),children:[`Approve as `,e]},e)),t[0]=r,t[1]=a,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7];let f;t[18]!==r||t[19]!==c||t[20]!==i||t[21]!==n.maxRole||t[22]!==n.status?(f=n.status===`approved`&&n.maxRole!==`viewer`?(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`narrow`,maxRole:`viewer`},`narrow`,`Authority reduced.`),children:`Reduce to viewer`}):null,t[18]=r,t[19]=c,t[20]=i,t[21]=n.maxRole,t[22]=n.status,t[23]=f):f=t[23];let p;t[24]!==r||t[25]!==o||t[26]!==n?(p=n.status===`approved`?(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(n),children:[(0,Q.jsx)(E,{className:`size-3.5`}),`Show phone QR`]}):null,t[24]=r,t[25]=o,t[26]=n,t[27]=p):p=t[27];let m;t[28]!==r||t[29]!==c||t[30]!==i||t[31]!==n.status?(m=n.status===`revoked`?null:(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`revoke`},`revoke`,`Client revoked.`),children:`Revoke`}),t[28]=r,t[29]=c,t[30]=i,t[31]=n.status,t[32]=m):m=t[32];let h;t[33]!==c||t[34]!==i?(h=()=>i({...c,action:`purge`},`purge`,`Record deleted.`),t[33]=c,t[34]=i,t[35]=h):h=t[35];let g;t[36]!==r||t[37]!==h?(g=(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:h,children:`Delete`}),t[36]=r,t[37]=h,t[38]=g):g=t[38];let _;t[39]!==l||t[40]!==f||t[41]!==p||t[42]!==m||t[43]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[l,f,p,m,g]}),t[39]=l,t[40]=f,t[41]=p,t[42]=m,t[43]=g,t[44]=_):_=t[44];let v;t[45]===n?v=t[46]:(v=K(n),t[45]=n,t[46]=v);let y;t[47]===v?y=t[48]:(y=(0,Q.jsx)($,{rows:v}),t[47]=v,t[48]=y);let b;t[49]===n.safetyNumber?b=t[50]:(b=(0,Q.jsx)(wt,{value:n.safetyNumber}),t[49]=n.safetyNumber,t[50]=b);let x;t[51]!==y||t[52]!==b?(x=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[y,b]}),t[51]=y,t[52]=b,t[53]=x):x=t[53];let S;return t[54]!==s||t[55]!==x||t[56]!==u||t[57]!==d||t[58]!==_?(S=(0,Q.jsx)(s,{title:u,description:d,control:_,children:x}),t[54]=s,t[55]=x,t[56]=u,t[57]=d,t[58]=_,t[59]=S):S=t[59],S}export{Pt as NodeSecuritySettings};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,D as n,E as r,N as i,O as a,P as o,S as s,_ as c,b as l,c as u,d,f,l as p,m,q as h,s as g,v as _,x as v,y}from"./primary-DZjgHvyf.js";import{$l as b,Lt as x,P as S,Ql as C,Qr as w,Zr as ee,jr as te,lo as ne,oo as re}from"./runtime-BwHA1GUS.js";import{t as ie}from"./react-CwJFpaho.js";import{Gt as ae,J as oe,Jt as se,K as ce,Kt as le,Q as ue,Qt as de,X as fe,Xt as pe,Y as me,Yt as he,Z as ge,Zt as _e,q as ve,qt as ye,t as T}from"./switch-DnpJB2xv.js";import{t as be}from"./compiler-runtime-C4g8XhC5.js";import{t as xe}from"./badge-2AZ3HfVS.js";import{t as E}from"./qr-code-D4CtBq2F.js";import{t as Se}from"./refresh-cw-CgDa2Ok_.js";import{et as D}from"./authorization-D8dOcEYq.js";import{t as Ce}from"./input-BDWSVClC.js";import{i as we,r as Te,t as Ee}from"./alert-DQEkrtUJ.js";import{i as O,n as De,r as k}from"./settingsLayout-DxsFwhF0.js";import{a as A,i as j,n as M,o as N,s as P,t as F}from"./HostedRelayTrustNotice-B9jp4SRh.js";import{t as Oe}from"./qr-code-dbkTo07n.js";var I=e(ie(),1),L=be();function ke(e){return e?`hosted`:`local`}function Ae(e,t){return e===`local`?{headline:`Direct to a node on this machine`,body:`This window talks to a Ryco node running here, on this machine. No Ryco Hub sits between them and nothing you send leaves this machine on its way to the node.`}:{headline:t===null?`Through the Ryco Hub`:t.shortLabel,body:`This browser reaches a node through the Ryco Hub relay. What that channel is worth is stated with the channel itself, below.`}}function je(e,t=`owner`){return e===`local`?t===`owner`?{available:!0,unavailableBody:``}:t===`checking`?{available:!1,unavailableBody:`Checking whether this session can administer the node's security state.`}:t===`client`?{available:!1,unavailableBody:"This browser is paired as a client. Node security administration is owner-only; open Ryco Desktop on this machine or run `ryco e2ee` on the node. This direct client connection remains available."}:{available:!1,unavailableBody:"Ryco could not verify that this session may administer the node's security state. Reconnect from Ryco Desktop on this machine or run `ryco e2ee` on the node."}:{available:!1,unavailableBody:"Your node's client list, live sessions, admission policy, prekey and fallback counters are held on the node and read over its own local interface, which the relay does not carry. Open Ryco on that machine to see them, or run `ryco e2ee` there."}}function Me(e){return e===`local`?{kind:`available`}:{kind:`blocked`,reason:"This one can only be changed from the node itself. It admits approved native client keys and closes browser and legacy access — including this browser, which is how you are reading this — so turning it on from here would end this session and leave no way back in through it. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node, where you can still reach it if the result is not what you wanted."}}var R="This build cannot change whether the node admits only approved native client keys. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node.";function Ne(e,t){if(e===`hosted`&&t.requireApprovedClientE2EE!==void 0){let t=Me(e);return{allowed:!1,refusal:t.kind===`blocked`?t.reason:R}}return{allowed:!0,proposal:t}}function z(e){let t=e.split(D.separator);if(t.length!==D.groups)return[];for(let e of t){if(e.length!==D.digitsPerGroup)return[];for(let t of e)if(t<`0`||t>`9`)return[]}return t}var B=`${D.digits} digits, in ${D.groups} groups of ${D.digitsPerGroup}. The length and the grouping are the only check there is, so read all ${D.digits} in order.`,Pe=`Compare this with the number the device itself shows, on the device, before approving it. They match only for this key pair under this Hub account — the same device under a different account reads differently. Approve nothing whose number you have not read off the other screen yourself.`;function V(e){let t=z(e);return t.length===0?null:{groups:t,display:t.join(D.separator),caption:B,advisory:Pe}}var Fe=`No comparison number is readable for this record, so there is nothing here to check against the device.`;function Ie(e){return e===null?{available:!1,fingerprint:null,caption:"This node's identity fingerprint is shown here only while an enrollment is waiting for approval. At other times, read it from the node with `ryco hub status` on the machine running it."}:{available:!0,fingerprint:e,caption:`This node's identity fingerprint, from the enrollment now waiting for approval. Compare it character for character wherever you are asked to confirm this machine.`}}var H=`unknown`;function U(e){if(e===void 0)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?H:t.toLocaleString()}function Le(e){return e===null?[{label:`Agreement prekey`,value:H}]:e.present?[{label:`Prekey`,value:e.prekeyId??H,mono:!0},{label:`Fingerprint`,value:e.fingerprint??H,mono:!0},{label:`Validity`,value:e.validity??H},{label:`Created`,value:U(e.createdAt)},{label:`Expires`,value:U(e.expiresAt)}]:[{label:`Agreement prekey`,value:`none held`}]}function Re(e){return e===null?null:e.present?e.remedy??null:`This node holds no agreement prekey for its Hub origin. It re-signs one at startup; rotate to issue one now.`}function ze(e){return e===null?[{label:`Continuity`,value:H}]:e.status===`unavailable`?[{label:`Continuity`,value:`unresolvable`},{label:`Reason`,value:e.reason??H}]:[{label:`Continuity`,value:`advertisable`},{label:`Lineage`,value:e.continuityId??H,mono:!0},{label:`Rotation generation`,value:String(e.generation??0)},{label:`Retained chain length`,value:String(e.chainLength??0)},...e.repair===void 0?[]:[{label:`Startup repair`,value:e.repair}],...e.lastBreakReason===void 0?[]:[{label:`Last break`,value:`${e.lastBreakReason} at ${U(e.lastBreakAt)}`}]]}function Be(e){return e?.remedy??null}function W(e){switch(e){case`pending`:return`warning`;case`approved`:return`success`;case`revoked`:return`error`}}function G(e){let t=e.displayLabel?.trim()??``;return t===``?`Client key …${e.fingerprint.slice(-8)}`:t}function K(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Hub origin`,value:e.hubOrigin},{label:`Account`,value:e.accountId},{label:`Maximum role`,value:e.maxRole===``?`none granted`:e.maxRole},{label:`Capabilities`,value:e.capabilitySet.length===0?`none`:e.capabilitySet.join(`, `)},{label:`Created`,value:U(e.createdAt)},...e.approvedAt===void 0?[]:[{label:`Approved`,value:U(e.approvedAt)}],...e.revokedAt===void 0?[]:[{label:`Revoked`,value:U(e.revokedAt)}],{label:`Last seen`,value:U(e.lastSeenAt)},...e.pairingReserved?[{label:`Pairing reservation`,value:`held`}]:[]]}function Ve(e){if(e===null)return[];let t=[];return(e.pendingGlobalSaturated||e.saturatedAccounts.length>0)&&t.push(`Pending pairing is saturated, so a new device may not be able to introduce itself. Purge a pending record, or read the fingerprint off the device and open a pairing window naming it.`),e.refusedPairingAttempts>0&&t.push(`${e.refusedPairingAttempts} pairing attempt(s) were refused because the pending list was full. Clear the count once you have dealt with them, or later readings will be dominated by history.`),t}function He(e){if(e===null)return[{label:`Pairing window`,value:H}];let t=e.pairingWindow;return t===void 0?[{label:`Pairing window`,value:`closed`}]:[{label:`Pairing window`,value:`open`},{label:`Only this fingerprint`,value:t.fingerprint,mono:!0},{label:`Expires`,value:U(t.expiresAt)},{label:`Reservation`,value:t.spent?`spent`:`unspent`}]}function Ue(e){return e===null?`How many pairing attempts this node refused because the pending list was full has not been read here.`:`${e.refusedPairingAttempts} attempt(s) refused because the pending list was full.`}var We=`A window lets exactly one device introduce itself, and only the one whose fingerprint you name.`;function Ge(e){return[{label:`Tier`,value:e.tier===`native`?`native (IK)`:`browser (NX)`},{label:`Suite`,value:String(e.suite)},{label:`Established`,value:U(e.establishedAt)}]}var Ke=`Native sessions have no per-session code. Compare this device's long-term number on its record above instead.`,q=`Compare this code with the one that browser is showing for this session, on that screen. A match catches accidental wrong-node routing and some network interposition — anyone standing in for this node who is not also serving that browser its page — while the code that browser loaded is honest; it cannot protect against whoever served that page, and a match does not rule out someone sitting in the middle.`,qe=`No session code reached this listing for that channel, so there is nothing here to compare against the browser holding it.`;function Je(e){let t=j(e,`inline`);return t===null?null:{groups:t.groups,display:t.display,advisory:q,more:null}}var Ye=`A browser channel this node has open. Its per-session code is below.`;function Xe(e){return e===null?[{label:`Admission policy`,value:H}]:[{label:`requireE2EE`,value:String(e.requireE2EE),mono:!0},{label:`requireApprovedClientE2EE`,value:String(e.requireApprovedClientE2EE),mono:!0},{label:`Effective requireE2EE`,value:String(e.effectiveRequireE2EE),mono:!0},{label:`Admitted patterns`,value:e.admittedPatterns.join(`, `)||`none`},{label:`Suite registry`,value:e.suiteRegistry.join(`, `)||`none`},{label:`Policy generation`,value:String(e.generation)}]}function Ze(e,t,n){let r=[];t.requireApprovedClientE2EE===!0&&r.push(`requireApprovedClientE2EE closes browser and legacy access entirely. Only approved native client keys reach application payload after this, and losing every approved key strands remote access to this node until someone recovers it at the machine — which never relaxes admission policy.`);for(let e of Qe(t,n))r.push(e);return e.withdrawal&&r.push(`This narrows what the node admits, so it closes live channels. Roughly matching now: ${e.counts.legacy} legacy, ${e.counts.nxE2ee} browser, ${e.counts.suiteWithdrawn} on a withdrawn suite, and ${e.counts.abortedHandshakes} handshake(s) in flight. These move while you read them.`),e.changed||r.push(`This changes nothing: the node already admits exactly this.`),r.length===0&&r.push($e),r}function Qe(e,t){let n=[];return e.requireE2EE===!1&&t?.requireE2EE!==!1&&n.push(`Turning this off re-admits plaintext. The node goes back to accepting relay payload it has not encrypted, for browsers and for legacy clients, and the Hub carries that in a form it can read. It closes nothing now — what changes is what the node accepts next.`),e.requireApprovedClientE2EE===!1&&t?.requireApprovedClientE2EE!==!1&&n.push(`Clearing this re-admits the browser and legacy tiers. Client keys this node has not approved reach it again on their next connection, under whatever the remaining policy allows.`),n}var $e=`The node reports that this closes no channel it has open now. That is a statement about the live channels and not about what the node will admit afterwards.`;function et(e,t,n){return e.withdrawal||Qe(t,n).length>0}function tt(e){return[e.changed?`Policy committed.`:`Policy unchanged.`,`Closed ${e.counts.legacy} legacy channel(s), ${e.counts.nxE2ee} browser channel(s), ${e.counts.suiteWithdrawn} suite-withdrawn channel(s); aborted ${e.counts.abortedHandshakes} handshake(s) in flight.`].join(` `)}var nt=`This advances the policy generation past every value this node may already have advertised, and the jump is deliberate. Clients accept only a higher generation than the one they remember, so nothing below the new value can be advertised again. If a restore rolled the record back, recovery does not restore the old values: it commits the fail-closed policy, which admits only approved native client keys and so closes browser and legacy access entirely, including every remote browser session open now. There is no way to tell from here which of the two this will be. Widening it back is a separate, explicit policy change, and if this node's only remaining access was a browser it has to be made at the machine.`;function rt(e){if(e===null)return null;let t=e.peerLegacy.ringOverflows>0||e.advertisementUnavailable.ringOverflows>0;return{windowStarted:U(e.windowStartedAt),classes:[{label:`Peer spoke legacy`,meaning:`The other end did not take the encrypted channel, so this one carried readable payload.`,occurrences:e.peerLegacy.occurrences,lastOccurrence:U(e.peerLegacy.lastOccurrenceAt),ringOverflows:e.peerLegacy.ringOverflows},{label:`No advertisement`,meaning:`This node could not offer an encrypted channel, or the offer did not survive the path. It cannot tell which.`,occurrences:e.advertisementUnavailable.occurrences,lastOccurrence:U(e.advertisementUnavailable.lastOccurrenceAt),ringOverflows:e.advertisementUnavailable.ringOverflows}],entries:[...e.ring].toSorted((e,t)=>e.occurredAt-t.occurredAt).map((e,t)=>({ordinal:t,at:U(e.occurredAt),reason:e.reason})),overflowNotice:t?`The retained list overflowed, so it is an incomplete account of this window. The shape of what is left is not evidence in either direction.`:null,undersizedNotice:e.undersizedConnection===void 0?null:`This connection asserts a maximum chunk of ${e.undersizedConnection.assertedMaxDataChunkBytes} bytes, below the ${e.undersizedConnection.advertisementMinChunkBytes} bytes an offer needs. Nothing that fits can carry one, so this node offers nothing on this connection.`,quiet:e.peerLegacy.occurrences===0&&e.advertisementUnavailable.occurrences===0&&e.ring.length===0}}var it=`Nothing has fallen back in this window. This counts what happened, not what could — a quiet window is not a statement about the next one.`,J={approve:{title:`Approve this client key?`,body:`The device holding this key may then reach this node, up to the role and capabilities you grant here. Compare its number against the device first. It takes effect on its next connection, not on anything open now.`,confirmLabel:`Approve key`,destructive:!1},narrow:{title:`Reduce what this client may do?`,body:`Anything this device has open under the wider authority closes immediately — the node will not confirm the change until those channels are shut. The device reconnects with the smaller role ceiling. Its capability grant is left exactly as it is; only the ceiling drops, and changing the capabilities is a separate command on the node.`,confirmLabel:`Reduce authority`,destructive:!0},revoke:{title:`Revoke this client key?`,body:`The device loses access now: every channel it has open closes before this is confirmed, and it cannot reconnect until you approve it again. The record stays, so you can see it was revoked.`,confirmLabel:`Revoke key`,destructive:!0},purge:{title:`Delete this client record?`,body:`The same immediate disconnection as revoking, and the record goes with it — there will be nothing left showing this device was ever here. If it connects again it arrives as a stranger and pairs from scratch.`,confirmLabel:`Delete record`,destructive:!0},"open-window":{title:`Open a pairing window for this fingerprint?`,body:`For a short time this node will accept one introduction, and only from the key whose fingerprint you name. Read that fingerprint off the device itself — a window naming the wrong one lets the wrong device in.`,confirmLabel:`Open window`,destructive:!1},"close-window":{title:`Close the pairing window?`,body:`No new device can introduce itself until you open another. Anything already introduced keeps its record.`,confirmLabel:`Close window`,destructive:!1},"clear-refusals":{title:`Clear the refused-attempt count?`,body:`The count goes back to zero. Do this once you have dealt with what caused it, so the next reading is about the next thing rather than about history.`,confirmLabel:`Clear count`,destructive:!1},"rotate-prekey":{title:`Issue a new agreement prekey?`,body:`The node makes a fresh key pair and certificate immediately. Clients pick the new one up on their next connection; nothing already open is disturbed.`,confirmLabel:`Rotate prekey`,destructive:!1},"recover-policy":{title:`Advance the policy generation?`,body:nt,confirmLabel:`Advance generation`,destructive:!0},"reset-fallback":{title:`Reset the fallback counters?`,body:`Both counts and the retained list go back to empty and a new observation window starts. What was recorded is gone; nothing else changes.`,confirmLabel:`Reset counters`,destructive:!1},"remint-continuity":{title:`Break continuity and mint a fresh lineage?`,body:`Every device that has paired with this node has to go through the whole pairing ceremony again, in person, before it can reconnect. Do this when you believe the lineage is wrong, not to tidy it up.`,confirmLabel:`Mint fresh lineage`,destructive:!0},"break-continuity":{title:`Break the continuity chain?`,body:`The lineage keeps its name, but every device that pinned this node has to go through the pairing ceremony again before it can reconnect.`,confirmLabel:`Break chain`,destructive:!0}};function at(e){return J[e]}var Y=`It applies to the key below and to no other. Check the fingerprint against the device you meant: two devices paired under one account are told apart by nothing else here.`;function X(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Account`,value:e.accountId},{label:`Hub origin`,value:e.hubOrigin}]}function ot(e,t){let n=J[e];return{...n,body:`${n.body} ${Y}`,facts:X(t)}}function st(e){let t=J[`open-window`];return{...t,body:`${t.body} Read the value below off the device now, before confirming.`,facts:[{label:`Only this fingerprint`,value:e,mono:!0}]}}var ct=[`viewer`,`operator`,`owner`],lt={viewer:`read what is there`,operator:`edit files and run terminals`,owner:`also change credentials and server policy`},ut=[`ryco.rpc`];function dt(e,t){let n=J.approve,r=ut.join(`, `);return{title:`Approve this client key as ${e}?`,body:`${n.body} At most it will be able to ${lt[e]}. It is granted the one capability a relay channel carries, ${r} — a key approved with none is admitted by nothing and could not connect at all. `+`${t===void 0?``:Y}`.trimEnd(),confirmLabel:`Approve as ${e}`,destructive:!1,...t===void 0?{}:{facts:X(t)}}}Object.keys(J);var ft=`What this node will admit, and which client keys it has on file.`,pt=`Require an encrypted channel`,mt=`Refuse plaintext, including for browsers.`,Z=`Only approved native client keys`,ht=`Closes browser and legacy access entirely. Only approved native client keys reach application payload.`,gt=`Recover a generation that a restore rolled back.`,_t=`Its current value on the node has not been read here, so nothing on this row states what it is.`,vt=`No device has introduced itself to this node yet.`,yt=`Nothing is connected right now.`,Q=b(),bt=5e3,xt=6e4,St={clients:null,sessions:null,policy:null,prekey:null,continuity:null,fallback:null,enrollmentFingerprint:null};function $(e){let t=(0,L.c)(4),{rows:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Ct),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1.5 sm:grid-cols-[12rem_minmax(0,1fr)]`,children:r}),t[2]=r,t[3]=i),i}function Ct(e){return(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:e.mono?`min-w-0 font-mono text-[12px] break-all text-foreground`:`min-w-0 text-[12px] text-foreground`,children:e.value})]},e.label)}function wt(e){let t=(0,L.c)(14),{value:n}=e,r;t[0]===n?r=t[1]:(r=V(n),t[0]=n,t[1]=r);let i=r;if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number`,"data-value":`absent`,className:`text-[11px] text-muted-foreground`,children:Fe}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Comparison number`}),t[3]=a):a=t[3];let o;t[4]===i.display?o=t[5]:(o=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number-value`,className:`font-mono text-[13px] leading-relaxed font-semibold tracking-[0.08em] select-all`,children:i.display}),t[4]=i.display,t[5]=o);let s;t[6]===i.caption?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.caption}),t[6]=i.caption,t[7]=s);let c;t[8]===i.advisory?c=t[9]:(c=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.advisory}),t[8]=i.advisory,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Q.jsxs)(`div`,{"data-testid":`node-safety-number`,"data-value":`present`,className:`space-y-1.5`,children:[a,o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Tt(e){let t=(0,L.c)(15),{view:n,unavailable:r,testId:i}=e;if(!n){let e;return t[0]!==i||t[1]!==r?(e=(0,Q.jsx)(`p`,{"data-testid":i,"data-code":`absent`,className:`text-[11px] text-muted-foreground`,children:r}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let a=`${i}-value`,o;t[3]!==a||t[4]!==n.display?(o=(0,Q.jsx)(`p`,{"data-testid":a,className:`font-mono text-sm leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:n.display}),t[3]=a,t[4]=n.display,t[5]=o):o=t[5];let s;t[6]===n.advisory?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.advisory}),t[6]=n.advisory,t[7]=s);let c;t[8]===n.more?c=t[9]:(c=n.more===null?null:(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.more}),t[8]=n.more,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==i?(l=(0,Q.jsxs)(`div`,{"data-testid":i,"data-code":`present`,className:`space-y-1.5`,children:[o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=i,t[14]=l):l=t[14],l}function Et(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=j(n,`settings`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Tt,{view:r,unavailable:M,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Dt(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=Je(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Tt,{view:r,unavailable:qe,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Ot(){let e=(0,L.c)(21),t=A(),n=N(),r=S(Mt),i=S(jt),a=S(At),o=S(kt),s,c;e[0]!==r||e[1]!==t||e[2]!==a||e[3]!==i||e[4]!==o?(s=P({browserStatus:r,sessionStatus:i,selectionStatus:a,transportStatus:o,e2eeStatus:t}),c=Ae(`hosted`,s),e[0]=r,e[1]=t,e[2]=a,e[3]=i,e[4]=o,e[5]=s,e[6]=c):(s=e[5],c=e[6]);let l=c,u=s.guarantee===`e2ee`?`success`:s.guarantee===`web`?`info`:s.guarantee===`legacy`?`warning`:`outline`,d;e[7]!==s.shortLabel||e[8]!==u?(d=(0,Q.jsx)(xe,{size:`sm`,variant:u,"data-testid":`node-connection-claim`,children:s.shortLabel}),e[7]=s.shortLabel,e[8]=u,e[9]=d):d=e[9];let f;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(F,{}),e[10]=f):f=e[10];let p;e[11]!==t||e[12]!==n?(p=t===`web-unsigned`?(0,Q.jsx)(Et,{code:n}):null,e[11]=t,e[12]=n,e[13]=p):p=e[13];let m;e[14]===p?m=e[15]:(m=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[f,p]}),e[14]=p,e[15]=m);let h;return e[16]!==l.body||e[17]!==l.headline||e[18]!==d||e[19]!==m?(h=(0,Q.jsx)(O,{title:`This connection`,children:(0,Q.jsx)(k,{title:l.headline,description:l.body,status:d,children:m})}),e[16]=l.body,e[17]=l.headline,e[18]=d,e[19]=m,e[20]=h):h=e[20],h}function kt(e){return e.transportStatus}function At(e){return e.selectionStatus}function jt(e){return e.sessionStatus}function Mt(e){return e.browserStatus}function Nt(){let e=ke(h()),a=typeof window<`u`&&window.desktopBridge!=null,[b,S]=(0,I.useState)(()=>a?`owner`:`checking`),C=je(e,b),ie=Me(e),[T,be]=(0,I.useState)(St),[xe,E]=(0,I.useState)(null),[D,A]=(0,I.useState)(!1),[j,M]=(0,I.useState)(null),[N,P]=(0,I.useState)(null),[F,L]=(0,I.useState)(null),[R,z]=(0,I.useState)(null),[B,Pe]=(0,I.useState)(``),V=(0,I.useRef)(!0),Fe=(0,I.useRef)(0),H=(0,I.useRef)(null),{copyToClipboard:U}=ee();(0,I.useEffect)(()=>(V.current=!0,()=>{V.current=!1}),[]),(0,I.useEffect)(()=>{if(e!==`local`||a)return;let n=!1;return t().then(e=>{n||S(e.authenticated&&e.role===`owner`?`owner`:`client`)}).catch(()=>{n||S(`unavailable`)}),()=>{n=!0}},[a,e]);let W=(0,I.useCallback)(async()=>{if(C.available)try{let[e,t,n,r,i,a]=await Promise.all([c(),s(),l(),v(),_(),y()]),o=await m().catch(()=>null);if(!V.current)return;Fe.current=0,be({clients:e,sessions:t,policy:n,prekey:r,continuity:i,fallback:a,enrollmentFingerprint:o?.fingerprint??null}),E(null)}catch(e){if(!V.current)return;Fe.current+=1,E(e instanceof Error?e.message:`Unable to read the node's security state.`)}},[C.available]);(0,I.useEffect)(()=>{if(!C.available)return;let e=x({lifecycle:te,run:W,resolveDelayMs:()=>Math.min(bt*2**Math.max(0,Fe.current-1),xt),jitterRatio:.1});return H.current=e,()=>{H.current===e&&(H.current=null),e.stop()}},[C.available,W]);let G=(0,I.useCallback)(()=>H.current?.refresh()??W(),[W]),K=(0,I.useCallback)(async(e,t)=>{A(!0),E(null),M(null);try{let n=await e();V.current&&M(typeof n==`string`?n:t),await G()}catch(e){if(!V.current)return;E(e instanceof Error?e.message:`That didn't work.`)}finally{V.current&&A(!1)}},[G]),q=(0,I.useCallback)((e,t,n)=>{L({copy:at(e),run:()=>K(t,n)})},[K]),qe=(0,I.useCallback)((e,t,n)=>{L({copy:e,run:()=>K(t,n)})},[K]),Je=(0,I.useCallback)(async t=>{let n=Ne(e,t);if(!n.allowed){E(n.refusal);return}A(!0),E(null),M(null);try{let e=await r(n.proposal);if(!V.current)return;P({proposal:n.proposal,warnings:Ze(e,n.proposal,T.policy),destructive:et(e,n.proposal,T.policy)})}catch(e){if(!V.current)return;E(e instanceof Error?e.message:`Unable to preview that change.`)}finally{V.current&&A(!1)}},[e,T.policy]),Qe=(0,I.useCallback)(async()=>{if(N===null)return;let t=Ne(e,N.proposal);if(!t.allowed){E(t.refusal),P(null);return}let n=t.proposal;P(null),await K(async()=>tt(await p(n)),`Policy applied.`)},[e,N,K]),$e=(0,I.useCallback)((e,t,n)=>{let r={fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin};qe(ot(t,r),()=>g(e),n)},[qe]),nt=(0,I.useCallback)((e,t)=>{L({copy:dt(t,{fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin}),run:()=>K(async()=>{await g(e);try{let n=await f({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});return V.current&&z({approval:n,label:e.fingerprint}),`Client approved as ${t}. Scan the code on the new device.`}catch{return`Client approved as ${t}. The QR code was not created; use Show phone QR to retry.`}},`Client approved as ${t}.`)})},[K]),J=(0,I.useCallback)(async e=>{A(!0),E(null);try{let t=await f({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});V.current&&z({approval:t,label:e.displayLabel??e.fingerprint})}catch(e){V.current&&E(e instanceof Error?e.message:`Unable to create the phone QR code.`)}finally{V.current&&A(!1)}},[]),Y=Ie(T.enrollmentFingerprint),X=(0,I.useMemo)(()=>rt(T.fallback),[T.fallback]),ct=Ve(T.clients),lt=Re(T.prekey),ut=Be(T.continuity),Z=F?.copy??null,ht=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;return(0,Q.jsxs)(De,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Security`}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:ft})]}),C.available?(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,disabled:D,onClick:()=>void G(),children:[(0,Q.jsx)(Se,{className:`size-3.5`}),`Refresh`]}):null]}),xe===null?null:(0,Q.jsxs)(Ee,{variant:`error`,children:[(0,Q.jsx)(re,{}),(0,Q.jsx)(we,{children:`That didn't work`}),(0,Q.jsx)(Te,{children:xe})]}),j?(0,Q.jsxs)(Ee,{variant:`info`,children:[(0,Q.jsx)(we,{children:`Done`}),(0,Q.jsx)(Te,{children:j})]}):null,e===`hosted`?(0,Q.jsx)(Ot,{}):null,C.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(O,{title:`This node's identity`,children:[(0,Q.jsx)(k,{title:`Enrollment fingerprint`,description:Y.caption,control:Y.fingerprint!==null&&ht?(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,onClick:()=>U(Y.fingerprint),children:[(0,Q.jsx)(ne,{className:`size-3.5`}),`Copy`]}):null,children:Y.fingerprint===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-enrollment-fingerprint`,className:`pb-3.5 font-mono text-[13px] break-all select-all`,children:Y.fingerprint})}),(0,Q.jsx)(k,{title:`Agreement prekey`,description:lt??`The key this node offers for new channels.`,control:(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D,onClick:()=>q(`rotate-prekey`,i,`Prekey rotated.`),children:`Rotate`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Le(T.prekey)})})}),(0,Q.jsx)(k,{title:`Continuity`,description:ut??`The lineage paired clients remember this node by.`,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:D,onClick:()=>q(`break-continuity`,()=>u({action:`break`}),`Continuity chain broken.`),children:`Break chain`}),(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:D,onClick:()=>q(`remint-continuity`,()=>u({action:`remint`}),`Fresh lineage minted.`),children:`Mint fresh`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:ze(T.continuity)})})})]}),(0,Q.jsxs)(O,{title:`Authorized clients`,children:[ct.map(e=>(0,Q.jsx)(k,{title:`Pairing`,description:e},e)),(0,Q.jsx)(k,{title:`Pairing window`,description:We,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ce,{value:B,disabled:D,placeholder:`SHA256:…`,"aria-label":`Pairing window fingerprint`,className:`w-56 font-mono text-xs`,onChange:e=>Pe(e.currentTarget.value)}),(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D||B.trim()===``,onClick:()=>qe(st(B.trim()),()=>o({action:`open`,fingerprint:B.trim()}),`Pairing window opened.`),children:`Open`}),(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D||T.clients?.pairingWindow===void 0,onClick:()=>q(`close-window`,()=>o({action:`close`}),`Pairing window closed.`),children:`Close`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:He(T.clients)})})}),(0,Q.jsx)(k,{title:`Refused attempts`,description:Ue(T.clients),control:(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:D||(T.clients?.refusedPairingAttempts??0)===0,onClick:()=>q(`clear-refusals`,d,`Refusal count cleared.`),children:`Clear`})}),(T.clients?.records??[]).map(e=>(0,Q.jsx)(Rt,{record:e,busy:D,onAuthorize:$e,onApprove:nt,onShowApprovalQr:J},`${e.hubOrigin}\u0000${e.accountId}\u0000${e.fingerprint}`)),T.clients!==null&&T.clients.records.length===0?(0,Q.jsx)(k,{title:`No client keys on file`,description:vt}):null]}),(0,Q.jsxs)(O,{title:`Live sessions`,children:[(T.sessions?.sessions??[]).map(e=>(0,Q.jsx)(k,{title:`Session ${e.sessionIndex}`,description:e.tier===`native`?Ke:Ye,children:(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[(0,Q.jsx)($,{rows:Ge(e)}),e.tier===`web`?(0,Q.jsx)(Dt,{code:e.verificationCode??null}):null]})},e.sessionIndex)),T.sessions!==null&&T.sessions.sessions.length===0?(0,Q.jsx)(k,{title:`No sessions`,description:yt}):null]}),(0,Q.jsxs)(O,{title:`Admission policy`,children:[(0,Q.jsx)(It,{title:pt,description:mt,checked:T.policy===null?null:T.policy.requireE2EE,busy:D,ariaLabel:`Require E2EE`,testId:`require-e2ee`,onChange:e=>void Je({requireE2EE:e})}),(0,Q.jsx)(Ft,{disposition:ie,checked:T.policy===null?null:T.policy.requireApprovedClientE2EE,busy:D,onChange:e=>void Je({requireApprovedClientE2EE:e})}),(0,Q.jsx)(k,{title:`Policy generation`,description:gt,control:(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:D,onClick:()=>q(`recover-policy`,n,`Policy generation advanced.`),children:`Advance`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Xe(T.policy)})})})]}),(0,Q.jsx)(O,{title:`Fallback`,children:X===null?(0,Q.jsx)(k,{title:`Fallback`,description:`Waiting for the node.`}):X.quiet?(0,Q.jsx)(k,{title:`Nothing has fallen back`,description:it,control:(0,Q.jsx)(Lt,{busy:D,onConfirm:q})}):(0,Q.jsxs)(Q.Fragment,{children:[X.classes.map(e=>(0,Q.jsx)(k,{title:e.label,description:e.meaning,status:`Last ${e.lastOccurrence}${e.ringOverflows>0?` · ${e.ringOverflows} overflow(s)`:``}`,control:(0,Q.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.occurrences})},e.label)),(0,Q.jsx)(k,{title:`Retained occurrences`,description:X.overflowNotice??`Observation window started ${X.windowStarted}.`,control:(0,Q.jsx)(Lt,{busy:D,onConfirm:q}),children:(0,Q.jsx)(`ul`,{className:`space-y-1 pb-3.5`,children:X.entries.map(e=>(0,Q.jsxs)(`li`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.at,` · `,e.reason]},e.ordinal))})}),X.undersizedNotice?(0,Q.jsx)(k,{title:`Undersized connection`,description:X.undersizedNotice}):null]})})]}):(0,Q.jsxs)(O,{title:e===`hosted`?`This node`:`This session`,children:[(0,Q.jsx)(k,{title:Ae(e,null).headline,description:C.unavailableBody}),e===`hosted`?(0,Q.jsx)(Ft,{disposition:ie,checked:null,busy:D,onChange:e=>void Je({requireApprovedClientE2EE:e})}):null]}),(0,Q.jsx)(ce,{open:N!==null,onOpenChange:e=>!e&&P(null),children:(0,Q.jsxs)(ge,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(ue,{children:`Apply this policy change?`}),(0,Q.jsx)(oe,{children:N?.warnings.map(e=>(0,Q.jsx)(`span`,{className:`block pb-2`,children:e},e))})]}),(0,Q.jsxs)(me,{children:[(0,Q.jsx)(ve,{children:`Leave it`}),(0,Q.jsx)(w,{variant:N?.destructive?`destructive`:`default`,"data-testid":`policy-apply`,disabled:D,onClick:()=>void Qe(),children:`Apply`})]})]})}),(0,Q.jsx)(ce,{open:F!==null,onOpenChange:e=>!e&&L(null),children:(0,Q.jsxs)(ge,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(ue,{children:Z?.title}),(0,Q.jsx)(oe,{children:Z?.body})]}),Z?.facts?(0,Q.jsx)(`div`,{"data-testid":`node-confirmation-facts`,className:`pb-1`,children:(0,Q.jsx)($,{rows:Z.facts})}):null,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(ve,{children:`Cancel`}),(0,Q.jsx)(w,{variant:Z?.destructive?`destructive`:`default`,"data-testid":`node-confirmation-confirm`,disabled:D,onClick:()=>{let e=F;L(null),e&&e.run()},children:Z?.confirmLabel})]})]})}),(0,Q.jsx)(ae,{open:R!==null,onOpenChange:e=>!e&&z(null),children:(0,Q.jsxs)(_e,{className:`max-w-sm`,children:[(0,Q.jsxs)(he,{children:[(0,Q.jsx)(de,{children:`Verify this phone`}),(0,Q.jsx)(ye,{children:`On the new phone, open node verification and scan this code. It is bound to that phone's key and expires after five minutes.`})]}),(0,Q.jsxs)(pe,{className:`space-y-4`,children:[R?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`rounded-2xl bg-white p-3`,children:(0,Q.jsx)(Oe,{value:R.approval.payload,size:240,level:`M`,marginSize:2,title:`Node approval — scan with Ryco on the new phone`})}),(0,Q.jsx)(`p`,{className:`max-w-full break-all text-center font-mono text-[11px] text-muted-foreground`,children:R.label})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`The code contains no secret and grants no access by itself. Ryco will reconnect and prove both device keys after the scan.`})]}),(0,Q.jsx)(se,{variant:`bare`,children:(0,Q.jsx)(le,{render:(0,Q.jsx)(w,{variant:`outline`}),children:`Done`})})]})})]})}function Pt(){let e=(0,L.c)(7),t=C();if(t&&!t.primary){let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(re,{}),e[0]=n):n=e[0];let r;e[1]===t.nodeLabel?r=e[2]:(r=(0,Q.jsxs)(we,{children:[`Open Security on `,t.nodeLabel]}),e[1]=t.nodeLabel,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Te,{children:`Security administration requires that node's direct local operator channel. Ryco has disabled these controls here so an action can never be applied to this Mac by mistake.`}),e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a=(0,Q.jsx)(De,{children:(0,Q.jsxs)(Ee,{variant:`warning`,children:[n,r,i]})}),e[4]=r,e[5]=a),a}let n;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Nt,{}),e[6]=n):n=e[6],n}function Ft(e){let t=(0,L.c)(6),{disposition:n,checked:r,busy:i,onChange:a}=e,o=n.kind===`blocked`,s=n.kind===`blocked`?n.reason:ht,c;return t[0]!==o||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==s?(c=(0,Q.jsx)(It,{title:Z,description:s,checked:r,busy:i,blocked:o,ariaLabel:`Require approved client E2EE`,testId:`require-approved-client-e2ee`,onChange:a}),t[0]=o,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c):c=t[5],c}function It(e){let t=(0,L.c)(11),{title:n,description:r,checked:i,busy:a,blocked:o,ariaLabel:s,testId:c,onChange:l}=e,u=o!==void 0&&o,d=i===null?`${r} ${_t}`:r,f;t[0]!==s||t[1]!==u||t[2]!==a||t[3]!==i||t[4]!==l||t[5]!==c?(f=i===null?(0,Q.jsx)(`span`,{"data-testid":c,"data-policy":`unknown`,"data-blocked":u?`hosted`:void 0,className:`text-[11px] text-muted-foreground`,children:`unknown`}):(0,Q.jsx)(T,{checked:i,disabled:u||a,"aria-label":s,"data-testid":c,"data-policy":String(i),"data-blocked":u?`hosted`:void 0,onCheckedChange:l}),t[0]=s,t[1]=u,t[2]=a,t[3]=i,t[4]=l,t[5]=c,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,Q.jsx)(k,{title:n,description:d,control:f}),t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10],p}function Lt(e){let t=(0,L.c)(5),{busy:n,onConfirm:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`reset-fallback`,a,`Fallback counters reset.`),t[0]=r,t[1]=i);let o;return t[2]!==n||t[3]!==i?(o=(0,Q.jsx)(w,{size:`xs`,variant:`outline`,disabled:n,onClick:i,children:`Reset`}),t[2]=n,t[3]=i,t[4]=o):o=t[4],o}function Rt(e){let t=(0,L.c)(60),{record:n,busy:r,onAuthorize:i,onApprove:a,onShowApprovalQr:o}=e,s,c,l,u,d;if(t[0]!==r||t[1]!==a||t[2]!==n){c={hubOrigin:n.hubOrigin,accountId:n.accountId,fingerprint:n.fingerprint};let e;t[8]===n.status?e=t[9]:(e=W(n.status),t[8]=n.status,t[9]=e);let i=e;s=k;let o;t[10]===n?o=t[11]:(o=G(n),t[10]=n,t[11]=o);let f=i===`success`?`success`:i,p;t[12]!==n.status||t[13]!==f?(p=(0,Q.jsx)(xe,{size:`sm`,variant:f,children:n.status}),t[12]=n.status,t[13]=f,t[14]=p):p=t[14],t[15]!==o||t[16]!==p?(u=(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o,p]}),t[15]=o,t[16]=p,t[17]=u):u=t[17],d=`${n.accountId} at ${n.hubOrigin}`,l=n.status===`approved`?null:ct.map(e=>(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>a({...c,action:`approve`,maxRole:e,capabilitySet:ut},e),children:[`Approve as `,e]},e)),t[0]=r,t[1]=a,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7];let f;t[18]!==r||t[19]!==c||t[20]!==i||t[21]!==n.maxRole||t[22]!==n.status?(f=n.status===`approved`&&n.maxRole!==`viewer`?(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`narrow`,maxRole:`viewer`},`narrow`,`Authority reduced.`),children:`Reduce to viewer`}):null,t[18]=r,t[19]=c,t[20]=i,t[21]=n.maxRole,t[22]=n.status,t[23]=f):f=t[23];let p;t[24]!==r||t[25]!==o||t[26]!==n?(p=n.status===`approved`?(0,Q.jsxs)(w,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(n),children:[(0,Q.jsx)(E,{className:`size-3.5`}),`Show phone QR`]}):null,t[24]=r,t[25]=o,t[26]=n,t[27]=p):p=t[27];let m;t[28]!==r||t[29]!==c||t[30]!==i||t[31]!==n.status?(m=n.status===`revoked`?null:(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`revoke`},`revoke`,`Client revoked.`),children:`Revoke`}),t[28]=r,t[29]=c,t[30]=i,t[31]=n.status,t[32]=m):m=t[32];let h;t[33]!==c||t[34]!==i?(h=()=>i({...c,action:`purge`},`purge`,`Record deleted.`),t[33]=c,t[34]=i,t[35]=h):h=t[35];let g;t[36]!==r||t[37]!==h?(g=(0,Q.jsx)(w,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:h,children:`Delete`}),t[36]=r,t[37]=h,t[38]=g):g=t[38];let _;t[39]!==l||t[40]!==f||t[41]!==p||t[42]!==m||t[43]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[l,f,p,m,g]}),t[39]=l,t[40]=f,t[41]=p,t[42]=m,t[43]=g,t[44]=_):_=t[44];let v;t[45]===n?v=t[46]:(v=K(n),t[45]=n,t[46]=v);let y;t[47]===v?y=t[48]:(y=(0,Q.jsx)($,{rows:v}),t[47]=v,t[48]=y);let b;t[49]===n.safetyNumber?b=t[50]:(b=(0,Q.jsx)(wt,{value:n.safetyNumber}),t[49]=n.safetyNumber,t[50]=b);let x;t[51]!==y||t[52]!==b?(x=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[y,b]}),t[51]=y,t[52]=b,t[53]=x):x=t[53];let S;return t[54]!==s||t[55]!==x||t[56]!==u||t[57]!==d||t[58]!==_?(S=(0,Q.jsx)(s,{title:u,description:d,control:_,children:x}),t[54]=s,t[55]=x,t[56]=u,t[57]=d,t[58]=_,t[59]=S):S=t[59],S}export{Pt as NodeSecuritySettings};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$o as t,Cc as n,Cl as r,Cs as i,Dc as a,Dl as o,El as s,Fl as c,Fs as l,Ks as u,Ml as d,Nl as f,Ol as p,Os as m,Pl as h,Qc as g,Qo as ee,Rl as _,Sc as v,Sl as te,Ss as y,Tl as ne,al as re,as as ie,dl as b,el as x,gl as ae,hl as oe,hs as S,kc as se,ks as ce,ll as le,ml as ue,os as C,pl as w,ps as T,qo as E,tl as de,ul as D,xl as O,yl as fe,zl as k}from"./runtime-OM-uAtaj.js";import{t as pe}from"./react-CwJFpaho.js";var A=e(pe(),1);function j(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...j(e,t.id,n)])}function M(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function N(){return!1}function me(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function he(e,o={}){let{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u=`sloppy`,referencePress:d=N,bubbles:f,externalTree:m}=o,h=`rootStore`in e?e.rootStore:e,g=h.useState(`open`),ee=h.useState(`floatingElement`),{dataRef:_,events:y}=h.context,b=t(m),S=p(typeof l==`function`?l:()=>!1),E=typeof l==`function`?S:l,k=E!==!1,pe=p(()=>u),{escapeKey:M,outsidePress:he}=me(f),P=A.useRef(!1),F=A.useRef(!1),I=A.useRef(!1),L=A.useRef(!1),R=A.useRef(!1),z=A.useRef(``),B=A.useRef(null),V=D(),H=D(),U=p(()=>{H.clear(),_.current.insideReactTree=!1}),W=p(e=>{let t=_.current.floatingContext?.nodeId;return(b?j(b.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),G=p(e=>a(e,h.select(`floatingElement`))||a(e,h.select(`domReferenceElement`))),K=p(e=>{d()&&h.setOpen(!1,C(ce,e.nativeEvent))}),q=p(e=>{if(!g||!s||!c||e.key!==`Escape`||R.current||!M&&W(`__escapeKeyBubbles`))return;let t=v(e)?e.nativeEvent:e,n=C(T,t);h.setOpen(!1,n),n.isCanceled||e.preventDefault(),!M&&!n.isPropagationAllowed&&e.stopPropagation()}),J=p(()=>{_.current.insideReactTree=!0,H.start(0,U)}),Y=p(e=>{if(!g||!s||e.button!==0)return;let t=de(e.nativeEvent);x(h.select(`floatingElement`),t)&&(P.current||(P.current=!0,F.current=!1))}),X=p(e=>{g&&s&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&P.current&&(F.current=!0)});A.useEffect(()=>{function e(e){e.open||(L.current=!1)}return y.on(`openchange`,e),()=>{y.off(`openchange`,e)}},[y]),A.useEffect(()=>{if(!g||!s)return g||(L.current=!1),U;_.current.__escapeKeyBubbles=M,_.current.__outsidePressBubbles=he;let e=new le,t=new le,o=ue(ee);function l(){e.clear(),R.current=!0}function u(){e.start(re?5:0,()=>{R.current=!1})}function d(){I.current=!0,t.start(0,()=>{I.current=!1})}function f(){P.current=!1,F.current=!1}function p(){let e=z.current,t=e===`pen`||!e?`mouse`:e,n=pe(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=_.current.floatingContext?.nodeId,n=b&&j(b.nodesRef.current,t).some(t=>a(e,t.context?.elements.floating));return G(e)||n}function y(e){if(m(e)){e.type!==`click`&&!G(e)&&(t.clear(),I.current=!1),U();return}if(_.current.insideReactTree){U();return}let a=de(e),o=`[${ie(`inert`)}]`,s=O(a)?a.getRootNode():null,c=Array.from((ne(s)?s:ue(h.select(`floatingElement`))).querySelectorAll(o)),l=h.context.triggerElements;if(a&&(l.hasElement(a)||l.hasMatchingElement(e=>x(e,a))))return;let u=O(a)?a:null;for(;u&&!r(u);){let e=fe(u);if(r(e)||!O(e))break;u=e}if(!(c.length&&O(a)&&!se(a)&&!x(a,h.select(`floatingElement`))&&c.every(e=>!x(u,e)))){if(te(a)&&!(`touches`in e)){let t=r(a),n=ae(a),i=/auto|scroll/,o=t||i.test(n.overflowX),s=t||i.test(n.overflowY),c=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=s&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,u=n.direction===`rtl`,d=l&&(u?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),f=c&&e.offsetY>a.clientHeight;if(d||f)return}if(!v(e)){if(p()===`intentional`){if(e.detail!==0&&!n(e)&&!L.current)return;if(I.current){t.clear(),I.current=!1;return}}(typeof E!=`function`||E(e))&&(W(`__outsidePressBubbles`)||(h.setOpen(!1,C(i,e)),U()))}}}function S(e){p()===`sloppy`&&e.pointerType!==`touch`&&h.select(`open`)&&s&&!G(e)&&y(e)}function ce(e){if(p()!==`sloppy`||!h.select(`open`)||!s||G(e))return;let t=e.touches[0];t&&(B.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},V.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function T(e,t){let n=de(e);if(!n)return;let r=w(n,e.type,()=>{t(e),r()})}function D(e){z.current=`touch`,T(e,ce)}function A(e){V.clear(),e.type===`pointerdown`&&(e.button===0&&(L.current=!0),z.current=e.pointerType),(e.type!==`mousedown`||!B.current||B.current.dismissOnMouseDown)&&T(e,e=>{e.type===`pointerdown`?S(e):y(e)})}function N(e){if(e.type===`pointercancel`&&(L.current=!1),!P.current)return;let n=F.current;if(f(),p()===`intentional`){if(e.type===`pointercancel`){n&&d();return}if(!v(e)){if(n){d();return}(typeof E!=`function`||E(e))&&(t.clear(),I.current=!0,U())}}}function me(e){if(p()!==`sloppy`||!B.current||G(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-B.current.startX),r=Math.abs(t.clientY-B.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(B.current.dismissOnTouchEnd=!0),i>10&&(y(e),V.clear(),B.current=null)}function H(e){T(e,me)}function K(e){p()===`sloppy`&&B.current&&!G(e)&&(B.current.dismissOnTouchEnd&&y(e),V.clear(),B.current=null)}function J(e){T(e,K)}let Y=oe(c&&oe(w(o,`keydown`,q),w(o,`compositionstart`,l),w(o,`compositionend`,u)),k&&oe(w(o,`click`,A,!0),w(o,`pointerdown`,A,!0),w(o,`pointerup`,N,!0),w(o,`pointercancel`,N,!0),w(o,`mousedown`,A,!0),w(o,`mouseup`,N,!0),w(o,`touchstart`,D,{capture:!0,passive:!0}),w(o,`touchmove`,H,{capture:!0,passive:!0}),w(o,`touchend`,J,{capture:!0,passive:!0})));return()=>{Y(),e.clear(),t.clear(),f(),I.current=!1,U()}},[_,ee,c,k,E,g,s,M,he,q,U,pe,W,G,b,h,V]);let Z=A.useMemo(()=>({onKeyDown:q,onPointerDown:K,onClick:K}),[q,K]),Q=A.useMemo(()=>({onKeyDown:q,onPointerDown:X,onMouseDown:X,onClickCapture:J,onMouseDownCapture(e){J(),Y(e)},onPointerDownCapture(e){J(),Y(e)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[q,J,Y,X]);return A.useMemo(()=>s?{reference:Z,floating:Q,trigger:Z}:{},[s,Z,Q])}var P=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(f(99,this.componentName,e,this.componentName));t.setOpen(!0,C(S,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,C(S))}},F=e(s(),1);function I(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=A.useRef(null);r===void 0&&f.current===null&&(f.current=new E({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),h(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};O(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function L(e,t=!1,n=!1,r=!1){let[i,a]=A.useState(e&&t?`idle`:void 0),[o,s]=A.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),h(()=>{if(!e&&o&&i!==`ending`&&n){let e=b.request(()=>{a(`ending`)});return()=>{b.cancel(e)}}},[e,o,i,n]),h(()=>{if(!e||t)return;let n=b.request(()=>{a(void 0)});return()=>{b.cancel(n)}},[t,e]),h(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=b.request(()=>{a(`idle`)});return()=>{b.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var R={tabIndex:-1,[g]:``};function z(e){return t=>t!==`touch`||e.current}function B(e,t=!1){let n=l(),r=ee()!=null,i=c(()=>e(n,r)).current;return I({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function V({handle:e,store:t}){return h(()=>e.attachStore(t),[e,t]),null}function H(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function U(e,t){let n=A.useRef(null);return p(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),H(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),H(t))})}function W(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function G(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function K(e,t,n,r={}){let i=n.reason,a=i===m,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=G(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=W(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?F.flushSync(l):l()}function q(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=U(e,n),o=p(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=p(e=>{a(e),e&&o(e)});return h(()=>(s(t.current),()=>s(null)),[s,t,n,e]),h(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function J(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=A.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);h(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=C(y);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Y(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=L(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=p(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return u({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function X(e,t){e.useSyncedValues(t),h(()=>()=>{e.update({activeTriggerProps:_,inactiveTriggerProps:_,popupProps:_})},[e])}function Z(e,t){h(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),h(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}function Q(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new E({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_,inactiveTriggerProps:_,popupProps:_}}var $=e=>e.triggerIdProp??e.activeTriggerId,ge=e=>e.openProp??e.open,_e=e=>(e.popupElement?.id??e.floatingId)||void 0;function ve(e,t){return t!==void 0&&ge(e)&&$(e)===t}function ye(e,t){return ve(e,t)?!0:t!==void 0&&ge(e)&&$(e)==null&&e.triggerCount===1}var be={open:ge,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:$,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:_e,isTriggerActive:(e,t)=>t!==void 0&&$(e)===t,isOpenedByTrigger:(e,t)=>ve(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&$(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ye(e,t)?_e(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},xe=d();function Se(e){let t=A.useCallback(t=>e===void 0?k:e.subscribeStore(t),[e]),n=A.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,xe.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Ce=class extends o{setState(e){}update(e){}set(e,t){}notifyAll(){}};export{j as C,M as S,U as _,R as a,P as b,G as c,J as d,Y as f,q as g,Z as h,be as i,z as l,B as m,Se as n,V as o,X as p,Q as r,K as s,Ce as t,W as u,L as v,he as x,I as y};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$o as t,Cc as n,Cl as r,Cs as i,Dc as a,Dl as o,El as s,Fl as c,Fs as l,Ks as u,Ml as d,Nl as f,Ol as p,Os as m,Pl as h,Qc as g,Qo as ee,Rl as _,Sc as v,Sl as te,Ss as y,Tl as ne,al as re,as as ie,dl as b,el as x,gl as ae,hl as oe,hs as S,kc as se,ks as ce,ll as le,ml as ue,os as C,pl as w,ps as T,qo as E,tl as de,ul as D,xl as O,yl as fe,zl as k}from"./runtime-BwHA1GUS.js";import{t as pe}from"./react-CwJFpaho.js";var A=e(pe(),1);function j(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...j(e,t.id,n)])}function M(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function N(){return!1}function me(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function he(e,o={}){let{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u=`sloppy`,referencePress:d=N,bubbles:f,externalTree:m}=o,h=`rootStore`in e?e.rootStore:e,g=h.useState(`open`),ee=h.useState(`floatingElement`),{dataRef:_,events:y}=h.context,b=t(m),S=p(typeof l==`function`?l:()=>!1),E=typeof l==`function`?S:l,k=E!==!1,pe=p(()=>u),{escapeKey:M,outsidePress:he}=me(f),P=A.useRef(!1),F=A.useRef(!1),I=A.useRef(!1),L=A.useRef(!1),R=A.useRef(!1),z=A.useRef(``),B=A.useRef(null),V=D(),H=D(),U=p(()=>{H.clear(),_.current.insideReactTree=!1}),W=p(e=>{let t=_.current.floatingContext?.nodeId;return(b?j(b.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),G=p(e=>a(e,h.select(`floatingElement`))||a(e,h.select(`domReferenceElement`))),K=p(e=>{d()&&h.setOpen(!1,C(ce,e.nativeEvent))}),q=p(e=>{if(!g||!s||!c||e.key!==`Escape`||R.current||!M&&W(`__escapeKeyBubbles`))return;let t=v(e)?e.nativeEvent:e,n=C(T,t);h.setOpen(!1,n),n.isCanceled||e.preventDefault(),!M&&!n.isPropagationAllowed&&e.stopPropagation()}),J=p(()=>{_.current.insideReactTree=!0,H.start(0,U)}),Y=p(e=>{if(!g||!s||e.button!==0)return;let t=de(e.nativeEvent);x(h.select(`floatingElement`),t)&&(P.current||(P.current=!0,F.current=!1))}),X=p(e=>{g&&s&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&P.current&&(F.current=!0)});A.useEffect(()=>{function e(e){e.open||(L.current=!1)}return y.on(`openchange`,e),()=>{y.off(`openchange`,e)}},[y]),A.useEffect(()=>{if(!g||!s)return g||(L.current=!1),U;_.current.__escapeKeyBubbles=M,_.current.__outsidePressBubbles=he;let e=new le,t=new le,o=ue(ee);function l(){e.clear(),R.current=!0}function u(){e.start(re?5:0,()=>{R.current=!1})}function d(){I.current=!0,t.start(0,()=>{I.current=!1})}function f(){P.current=!1,F.current=!1}function p(){let e=z.current,t=e===`pen`||!e?`mouse`:e,n=pe(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=_.current.floatingContext?.nodeId,n=b&&j(b.nodesRef.current,t).some(t=>a(e,t.context?.elements.floating));return G(e)||n}function y(e){if(m(e)){e.type!==`click`&&!G(e)&&(t.clear(),I.current=!1),U();return}if(_.current.insideReactTree){U();return}let a=de(e),o=`[${ie(`inert`)}]`,s=O(a)?a.getRootNode():null,c=Array.from((ne(s)?s:ue(h.select(`floatingElement`))).querySelectorAll(o)),l=h.context.triggerElements;if(a&&(l.hasElement(a)||l.hasMatchingElement(e=>x(e,a))))return;let u=O(a)?a:null;for(;u&&!r(u);){let e=fe(u);if(r(e)||!O(e))break;u=e}if(!(c.length&&O(a)&&!se(a)&&!x(a,h.select(`floatingElement`))&&c.every(e=>!x(u,e)))){if(te(a)&&!(`touches`in e)){let t=r(a),n=ae(a),i=/auto|scroll/,o=t||i.test(n.overflowX),s=t||i.test(n.overflowY),c=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=s&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,u=n.direction===`rtl`,d=l&&(u?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),f=c&&e.offsetY>a.clientHeight;if(d||f)return}if(!v(e)){if(p()===`intentional`){if(e.detail!==0&&!n(e)&&!L.current)return;if(I.current){t.clear(),I.current=!1;return}}(typeof E!=`function`||E(e))&&(W(`__outsidePressBubbles`)||(h.setOpen(!1,C(i,e)),U()))}}}function S(e){p()===`sloppy`&&e.pointerType!==`touch`&&h.select(`open`)&&s&&!G(e)&&y(e)}function ce(e){if(p()!==`sloppy`||!h.select(`open`)||!s||G(e))return;let t=e.touches[0];t&&(B.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},V.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function T(e,t){let n=de(e);if(!n)return;let r=w(n,e.type,()=>{t(e),r()})}function D(e){z.current=`touch`,T(e,ce)}function A(e){V.clear(),e.type===`pointerdown`&&(e.button===0&&(L.current=!0),z.current=e.pointerType),(e.type!==`mousedown`||!B.current||B.current.dismissOnMouseDown)&&T(e,e=>{e.type===`pointerdown`?S(e):y(e)})}function N(e){if(e.type===`pointercancel`&&(L.current=!1),!P.current)return;let n=F.current;if(f(),p()===`intentional`){if(e.type===`pointercancel`){n&&d();return}if(!v(e)){if(n){d();return}(typeof E!=`function`||E(e))&&(t.clear(),I.current=!0,U())}}}function me(e){if(p()!==`sloppy`||!B.current||G(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-B.current.startX),r=Math.abs(t.clientY-B.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(B.current.dismissOnTouchEnd=!0),i>10&&(y(e),V.clear(),B.current=null)}function H(e){T(e,me)}function K(e){p()===`sloppy`&&B.current&&!G(e)&&(B.current.dismissOnTouchEnd&&y(e),V.clear(),B.current=null)}function J(e){T(e,K)}let Y=oe(c&&oe(w(o,`keydown`,q),w(o,`compositionstart`,l),w(o,`compositionend`,u)),k&&oe(w(o,`click`,A,!0),w(o,`pointerdown`,A,!0),w(o,`pointerup`,N,!0),w(o,`pointercancel`,N,!0),w(o,`mousedown`,A,!0),w(o,`mouseup`,N,!0),w(o,`touchstart`,D,{capture:!0,passive:!0}),w(o,`touchmove`,H,{capture:!0,passive:!0}),w(o,`touchend`,J,{capture:!0,passive:!0})));return()=>{Y(),e.clear(),t.clear(),f(),I.current=!1,U()}},[_,ee,c,k,E,g,s,M,he,q,U,pe,W,G,b,h,V]);let Z=A.useMemo(()=>({onKeyDown:q,onPointerDown:K,onClick:K}),[q,K]),Q=A.useMemo(()=>({onKeyDown:q,onPointerDown:X,onMouseDown:X,onClickCapture:J,onMouseDownCapture(e){J(),Y(e)},onPointerDownCapture(e){J(),Y(e)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[q,J,Y,X]);return A.useMemo(()=>s?{reference:Z,floating:Q,trigger:Z}:{},[s,Z,Q])}var P=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(f(99,this.componentName,e,this.componentName));t.setOpen(!0,C(S,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,C(S))}},F=e(s(),1);function I(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=A.useRef(null);r===void 0&&f.current===null&&(f.current=new E({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),h(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};O(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function L(e,t=!1,n=!1,r=!1){let[i,a]=A.useState(e&&t?`idle`:void 0),[o,s]=A.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),h(()=>{if(!e&&o&&i!==`ending`&&n){let e=b.request(()=>{a(`ending`)});return()=>{b.cancel(e)}}},[e,o,i,n]),h(()=>{if(!e||t)return;let n=b.request(()=>{a(void 0)});return()=>{b.cancel(n)}},[t,e]),h(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=b.request(()=>{a(`idle`)});return()=>{b.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var R={tabIndex:-1,[g]:``};function z(e){return t=>t!==`touch`||e.current}function B(e,t=!1){let n=l(),r=ee()!=null,i=c(()=>e(n,r)).current;return I({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function V({handle:e,store:t}){return h(()=>e.attachStore(t),[e,t]),null}function H(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function U(e,t){let n=A.useRef(null);return p(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),H(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),H(t))})}function W(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function G(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function K(e,t,n,r={}){let i=n.reason,a=i===m,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=G(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=W(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?F.flushSync(l):l()}function q(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=U(e,n),o=p(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=p(e=>{a(e),e&&o(e)});return h(()=>(s(t.current),()=>s(null)),[s,t,n,e]),h(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function J(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=A.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);h(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=C(y);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Y(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=L(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=p(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return u({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function X(e,t){e.useSyncedValues(t),h(()=>()=>{e.update({activeTriggerProps:_,inactiveTriggerProps:_,popupProps:_})},[e])}function Z(e,t){h(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),h(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}function Q(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new E({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_,inactiveTriggerProps:_,popupProps:_}}var $=e=>e.triggerIdProp??e.activeTriggerId,ge=e=>e.openProp??e.open,_e=e=>(e.popupElement?.id??e.floatingId)||void 0;function ve(e,t){return t!==void 0&&ge(e)&&$(e)===t}function ye(e,t){return ve(e,t)?!0:t!==void 0&&ge(e)&&$(e)==null&&e.triggerCount===1}var be={open:ge,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:$,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:_e,isTriggerActive:(e,t)=>t!==void 0&&$(e)===t,isOpenedByTrigger:(e,t)=>ve(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&$(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ye(e,t)?_e(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},xe=d();function Se(e){let t=A.useCallback(t=>e===void 0?k:e.subscribeStore(t),[e]),n=A.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,xe.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Ce=class extends o{setState(e){}update(e){}set(e,t){}notifyAll(){}};export{j as C,M as S,U as _,R as a,P as b,G as c,J as d,Y as f,q as g,Z as h,be as i,z as l,B as m,Se as n,V as o,X as p,Q as r,K as s,Ce as t,W as u,L as v,he as x,I as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$t as t,ut as n}from"./primary-CQh_KHGG.js";import{t as r}from"./src-DHNjfMxR.js";import{$l as i,K as a,Qr as o,mo as s,sr as c,wt as l}from"./runtime-OM-uAtaj.js";import{t as u}from"./react-CwJFpaho.js";import{Cr as d,Gt as f,Jt as p,Qt as m,Xt as h,Yt as g,Zt as _,fr as v,qt as y,vr as b}from"./switch-D9inWKdd.js";import{m as x}from"./RootAppShell-DwiWD4Cy.js";import{t as S}from"./capabilities-Bj_X9FZ-.js";import{n as C}from"./LazyBrowserPanel-B6POLJh3.js";import{n as w}from"./providerStatus-DBGvvkyF.js";import{r as T}from"./providerDriverMeta-LJ2vJxm-.js";var E=e(u(),1),D=i(),O={providers:`Providers`,project:`Project`,tour:`Quick tour`},k={codex:`https://github.com/saka-gg/ryco/blob/main/docs/providers/codex.md`,claudeAgent:`https://github.com/saka-gg/ryco/blob/main/docs/providers/claude.md`};function A({environmentId:e,providers:i,projectCount:u,ready:A,connectionGeneration:j,open:M,onComplete:N}){let[P,F]=(0,E.useState)(`providers`),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(null),B=(0,E.useRef)(!1),V=(0,E.useRef)(0),H=S(r.serverRefreshProviders),U=S(r.serverUpdateSettings),W=S(r.projectsAdd),G=x.indexOf(P);(0,E.useEffect)(()=>(V.current+=1,B.current=!1,L(!1),z(null),()=>{V.current+=1}),[j,e,A]);let K=async()=>{if(!A||!H.allowed||B.current)return;let r=c(e);if(!r?.server){z(`This machine is unavailable. Wait for it to reconnect, then refresh.`);return}let i=V.current,a=()=>{let n=t(e);return i===V.current&&n.phase===`connected`&&n.connectedAt===j};B.current=!0,L(!0),z(null);try{let e=await r.server.refreshProviders();a()&&n(e)}catch{a()&&z(`Provider discovery failed. Try refreshing again or open Provider settings.`)}finally{i===V.current&&(B.current=!1,L(!1))}};return(0,D.jsx)(f,{open:M,onOpenChange:e=>{e||N(`skipped`)},children:(0,D.jsxs)(_,{className:`max-w-2xl`,bottomStickOnMobile:!1,children:[(0,D.jsxs)(g,{children:[(0,D.jsxs)(`p`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:[`WELCOME TO RYCO · `,G+1,` OF 3`]}),(0,D.jsx)(m,{children:P===`providers`?`Bring your coding agent`:P===`project`?`Choose a place to work`:`Your first task, in three moves`}),(0,D.jsx)(y,{children:P===`providers`?`Ryco uses the providers on this machine. Set one up now or come back later.`:P===`project`?`Add an existing folder or use the project picker to create or clone a project.`:`You’re ready to start. These essentials are always within reach.`}),(0,D.jsx)(`ol`,{"aria-label":`Setup progress`,className:`mt-2 flex gap-5 text-xs text-muted-foreground`,children:x.map((e,t)=>(0,D.jsxs)(`li`,{"aria-current":P===e?`step`:void 0,className:P===e?`font-semibold text-foreground`:``,children:[t+1,`. `,O[e]]},e))})]}),(0,D.jsxs)(h,{className:`space-y-4`,children:[!A&&(0,D.jsx)(`p`,{role:`status`,className:`rounded-lg border p-3 text-sm text-muted-foreground`,children:`Reconnecting to this machine. Setup actions will be available when its current workspace is ready.`}),P===`providers`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`ul`,{"aria-label":`Detected providers`,className:`divide-y rounded-xl border px-4`,children:[i.map(e=>{let t=e.availability===`unavailable`?{headline:`Driver unavailable`}:w(e),n=T.find(t=>t.value===e.driver),r=e.displayName??n?.label??e.driver,i=k[e.driver];return(0,D.jsxs)(`li`,{className:`flex items-start justify-between gap-4 py-3`,children:[(0,D.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,D.jsx)(`p`,{className:`text-sm font-medium`,children:r}),(0,D.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t.headline,e.enabled&&e.installed&&e.auth.status===`unknown`?` · Authentication not verified`:``]})]}),i&&(0,D.jsxs)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-xs underline underline-offset-4`,children:[`Setup guide`,(0,D.jsxs)(`span`,{className:`sr-only`,children:[` for `,r]})]})]},e.instanceId)}),i.length===0&&(0,D.jsx)(`li`,{className:`py-4 text-sm text-muted-foreground`,children:`No provider status yet. Refresh discovery or add an instance in Provider settings.`})]}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Install and sign in with your provider’s own CLI on this machine, then refresh. Use Provider settings for custom binary paths, separate accounts, or API keys.`}),(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,D.jsx)(o,{variant:`outline`,disabled:!A||I||!H.allowed,onClick:()=>void K(),children:I?`Checking providers…`:`Refresh discovery`}),(0,D.jsx)(o,{variant:`ghost`,disabled:!A||!U.allowed,onClick:()=>a.getState().openSettings(`providers`,e),children:`Provider settings`})]}),R&&(0,D.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:R})]}),P===`project`&&(0,D.jsxs)(`div`,{className:`space-y-5 py-5`,children:[(0,D.jsx)(C,{className:`size-9 text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The project picker handles folders, Git repositories, and existing projects. Close it to return here; your setup progress stays in place.`}),u>0&&(0,D.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm`,children:[(0,D.jsx)(s,{"aria-hidden":!0,className:`size-4`}),u===1?`Your project is ready.`:`${u} projects are ready.`]}),(0,D.jsx)(o,{disabled:!A||!W.allowed,onClick:()=>l.getState().openAddProject(),children:`Add project`}),(0,D.jsx)(o,{variant:`outline`,disabled:!A,onClick:()=>a.getState().openSettings(`general`,e),children:`Import Codex or Claude conversations`})]}),P===`tour`&&(0,D.jsx)(`ol`,{className:`divide-y`,children:[{icon:b,title:`Start a task`,text:`Choose a project, open a new task, and pick your provider and model before sending a request.`},{icon:d,title:`Review the work`,text:`Follow the conversation, answer approval requests, and inspect changes in the workspace panel.`},{icon:v,title:`Make it yours`,text:`Use Settings for providers and preferences. Replay this tour from This app or This browser → General.`}].map(({icon:e,title:t,text:n})=>(0,D.jsxs)(`li`,{className:`flex gap-4 py-5`,children:[(0,D.jsx)(e,{"aria-hidden":!0,className:`mt-0.5 size-5 shrink-0 text-muted-foreground`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]},t))})]}),(0,D.jsxs)(p,{children:[(0,D.jsx)(o,{variant:`ghost`,className:`sm:mr-auto`,onClick:()=>N(`skipped`),children:`Skip setup`}),G>0&&(0,D.jsx)(o,{variant:`outline`,onClick:()=>F(x[G-1]),children:`Back`}),(0,D.jsx)(o,{onClick:()=>P===`tour`?N(`completed`):F(x[G+1]),children:P===`tour`?`Finish setup`:`Continue`})]})]})})}export{A as OnboardingDialog};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$t as t,ut as n}from"./primary-DZjgHvyf.js";import{t as r}from"./src-C3Y_imaX.js";import{$l as i,K as a,Qr as o,mo as s,sr as c,wt as l}from"./runtime-BwHA1GUS.js";import{t as u}from"./react-CwJFpaho.js";import{Cr as d,Gt as f,Jt as p,Qt as m,Xt as h,Yt as g,Zt as _,fr as v,qt as y,vr as b}from"./switch-DnpJB2xv.js";import{m as x}from"./RootAppShell-T056pByH.js";import{t as S}from"./capabilities-CsHjxjab.js";import{n as C}from"./LazyBrowserPanel-D4e76vc_.js";import{n as w}from"./providerStatus-DBGvvkyF.js";import{r as T}from"./providerDriverMeta-T2YbXzuS.js";var E=e(u(),1),D=i(),O={providers:`Providers`,project:`Project`,tour:`Quick tour`},k={codex:`https://github.com/saka-gg/ryco/blob/main/docs/providers/codex.md`,claudeAgent:`https://github.com/saka-gg/ryco/blob/main/docs/providers/claude.md`};function A({environmentId:e,providers:i,projectCount:u,ready:A,connectionGeneration:j,open:M,onComplete:N}){let[P,F]=(0,E.useState)(`providers`),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(null),B=(0,E.useRef)(!1),V=(0,E.useRef)(0),H=S(r.serverRefreshProviders),U=S(r.serverUpdateSettings),W=S(r.projectsAdd),G=x.indexOf(P);(0,E.useEffect)(()=>(V.current+=1,B.current=!1,L(!1),z(null),()=>{V.current+=1}),[j,e,A]);let K=async()=>{if(!A||!H.allowed||B.current)return;let r=c(e);if(!r?.server){z(`This machine is unavailable. Wait for it to reconnect, then refresh.`);return}let i=V.current,a=()=>{let n=t(e);return i===V.current&&n.phase===`connected`&&n.connectedAt===j};B.current=!0,L(!0),z(null);try{let e=await r.server.refreshProviders();a()&&n(e)}catch{a()&&z(`Provider discovery failed. Try refreshing again or open Provider settings.`)}finally{i===V.current&&(B.current=!1,L(!1))}};return(0,D.jsx)(f,{open:M,onOpenChange:e=>{e||N(`skipped`)},children:(0,D.jsxs)(_,{className:`max-w-2xl`,bottomStickOnMobile:!1,children:[(0,D.jsxs)(g,{children:[(0,D.jsxs)(`p`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:[`WELCOME TO RYCO · `,G+1,` OF 3`]}),(0,D.jsx)(m,{children:P===`providers`?`Bring your coding agent`:P===`project`?`Choose a place to work`:`Your first task, in three moves`}),(0,D.jsx)(y,{children:P===`providers`?`Ryco uses the providers on this machine. Set one up now or come back later.`:P===`project`?`Add an existing folder or use the project picker to create or clone a project.`:`You’re ready to start. These essentials are always within reach.`}),(0,D.jsx)(`ol`,{"aria-label":`Setup progress`,className:`mt-2 flex gap-5 text-xs text-muted-foreground`,children:x.map((e,t)=>(0,D.jsxs)(`li`,{"aria-current":P===e?`step`:void 0,className:P===e?`font-semibold text-foreground`:``,children:[t+1,`. `,O[e]]},e))})]}),(0,D.jsxs)(h,{className:`space-y-4`,children:[!A&&(0,D.jsx)(`p`,{role:`status`,className:`rounded-lg border p-3 text-sm text-muted-foreground`,children:`Reconnecting to this machine. Setup actions will be available when its current workspace is ready.`}),P===`providers`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`ul`,{"aria-label":`Detected providers`,className:`divide-y rounded-xl border px-4`,children:[i.map(e=>{let t=e.availability===`unavailable`?{headline:`Driver unavailable`}:w(e),n=T.find(t=>t.value===e.driver),r=e.displayName??n?.label??e.driver,i=k[e.driver];return(0,D.jsxs)(`li`,{className:`flex items-start justify-between gap-4 py-3`,children:[(0,D.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,D.jsx)(`p`,{className:`text-sm font-medium`,children:r}),(0,D.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t.headline,e.enabled&&e.installed&&e.auth.status===`unknown`?` · Authentication not verified`:``]})]}),i&&(0,D.jsxs)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-xs underline underline-offset-4`,children:[`Setup guide`,(0,D.jsxs)(`span`,{className:`sr-only`,children:[` for `,r]})]})]},e.instanceId)}),i.length===0&&(0,D.jsx)(`li`,{className:`py-4 text-sm text-muted-foreground`,children:`No provider status yet. Refresh discovery or add an instance in Provider settings.`})]}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Install and sign in with your provider’s own CLI on this machine, then refresh. Use Provider settings for custom binary paths, separate accounts, or API keys.`}),(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,D.jsx)(o,{variant:`outline`,disabled:!A||I||!H.allowed,onClick:()=>void K(),children:I?`Checking providers…`:`Refresh discovery`}),(0,D.jsx)(o,{variant:`ghost`,disabled:!A||!U.allowed,onClick:()=>a.getState().openSettings(`providers`,e),children:`Provider settings`})]}),R&&(0,D.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:R})]}),P===`project`&&(0,D.jsxs)(`div`,{className:`space-y-5 py-5`,children:[(0,D.jsx)(C,{className:`size-9 text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The project picker handles folders, Git repositories, and existing projects. Close it to return here; your setup progress stays in place.`}),u>0&&(0,D.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm`,children:[(0,D.jsx)(s,{"aria-hidden":!0,className:`size-4`}),u===1?`Your project is ready.`:`${u} projects are ready.`]}),(0,D.jsx)(o,{disabled:!A||!W.allowed,onClick:()=>l.getState().openAddProject(),children:`Add project`}),(0,D.jsx)(o,{variant:`outline`,disabled:!A,onClick:()=>a.getState().openSettings(`general`,e),children:`Import Codex or Claude conversations`})]}),P===`tour`&&(0,D.jsx)(`ol`,{className:`divide-y`,children:[{icon:b,title:`Start a task`,text:`Choose a project, open a new task, and pick your provider and model before sending a request.`},{icon:d,title:`Review the work`,text:`Follow the conversation, answer approval requests, and inspect changes in the workspace panel.`},{icon:v,title:`Make it yours`,text:`Use Settings for providers and preferences. Replay this tour from This app or This browser → General.`}].map(({icon:e,title:t,text:n})=>(0,D.jsxs)(`li`,{className:`flex gap-4 py-5`,children:[(0,D.jsx)(e,{"aria-hidden":!0,className:`mt-0.5 size-5 shrink-0 text-muted-foreground`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]},t))})]}),(0,D.jsxs)(p,{children:[(0,D.jsx)(o,{variant:`ghost`,className:`sm:mr-auto`,onClick:()=>N(`skipped`),children:`Skip setup`}),G>0&&(0,D.jsx)(o,{variant:`outline`,onClick:()=>F(x[G-1]),children:`Back`}),(0,D.jsx)(o,{onClick:()=>P===`tour`?N(`completed`):F(x[G+1]),children:P===`tour`?`Finish setup`:`Continue`})]})]})})}export{A as OnboardingDialog};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import"./src-DHNjfMxR.js";import{$l as t,Hr as n,Kr as r,Ql as i,Qr as a,Vr as o,do as s,ei as c,hr as l,sr as u,uo as d}from"./runtime-OM-uAtaj.js";import{t as f}from"./react-CwJFpaho.js";import{Pr as p,kr as m}from"./switch-D9inWKdd.js";import{t as h}from"./compiler-runtime-C4g8XhC5.js";import{i as g,n as _,t as v}from"./tooltip-mwOCSCXF.js";import{a as y,c as ee,n as te,o as ne,s as re,t as b}from"./badge-BswOCwph.js";import{Z as ie}from"./ContextHandoffEndpointLabel-BzI4Wi1i.js";import{n as ae,t as oe}from"./tokenModePresentation-C0-NgmX5.js";import{t as x}from"./download-CHdS3R_v.js";import{t as se}from"./refresh-cw-K_hU8_ld.js";import{t as S}from"./toastHelpers-CSQRKo4F.js";import{i as ce,n as le,r as ue}from"./settingsLayout-BbjDM-p0.js";var de=h(),C=e(f(),1),w=t();function T(e){return`${e.pluginId}:${e.targetKind}:${e.providerInstanceId??`global`}`}function fe(e){switch(e.state){case`installed`:return`Installed`;case`not-installed`:return`Not installed`;case`unsupported`:return`Unsupported`;case`error`:return`Error`}}function E(e){switch(e.state){case`installed`:return`success`;case`not-installed`:return`outline`;case`unsupported`:return`warning`;case`error`:return`error`}}function D(e){switch(e.state){case`installed`:return(0,w.jsx)(d,{className:`size-3.5 text-success-foreground`});case`not-installed`:return(0,w.jsx)(p,{className:`size-3.5 text-muted-foreground`});case`unsupported`:case`error`:return(0,w.jsx)(s,{className:`size-3.5 text-warning-foreground`})}}function pe(e){return e.targetKind===`global`?`System`:e.providerDisplayName??String(e.providerInstanceId??`Provider`)}function me(e){return e.impact===`tool-output`?`Tool output`:`Assistant output`}function he(e){return e.scope===`global`?`Global`:`Provider`}function O(e){switch(e){case`rtk`:return 0;case`caveman`:return 1;case`token-optimizer`:return 2;case`token-savior`:return 3;case`lean-ctx`:return 4}}function k(e){return`${e.targetKind===`global`?`0`:`1`}:${pe(e).toLowerCase()}`}function ge(e){let t=(0,de.c)(36),{status:n,isInstalling:r,onInstall:i}=e,o=n.canInstall&&n.state!==`installed`,s;t[0]===n?s=t[1]:(s=D(n),t[0]=n,t[1]=s);let c;t[2]===n?c=t[3]:(c=pe(n),t[2]=n,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,w.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:c}),t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=E(n),t[6]=n,t[7]=u);let d;t[8]===n?d=t[9]:(d=fe(n),t[8]=n,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,w.jsx)(b,{variant:u,size:`sm`,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===n.version?p=t[14]:(p=n.version?(0,w.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:n.version}):null,t[13]=n.version,t[14]=p);let m;t[15]!==s||t[16]!==l||t[17]!==f||t[18]!==p?(m=(0,w.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center gap-2`,children:[s,l,f,p]}),t[15]=s,t[16]=l,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;t[20]===n.detail?h=t[21]:(h=n.detail?(0,w.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:n.detail}):null,t[20]=n.detail,t[21]=h);let g;t[22]===n.manualSteps?g=t[23]:(g=n.manualSteps.length>0?(0,w.jsx)(`div`,{className:`space-y-1 pt-1`,children:n.manualSteps.map(_e)}):null,t[22]=n.manualSteps,t[23]=g);let _;t[24]!==g||t[25]!==m||t[26]!==h?(_=(0,w.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[m,h,g]}),t[24]=g,t[25]=m,t[26]=h,t[27]=_):_=t[27];let v;t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==n?(v=o?(0,w.jsxs)(a,{size:`xs`,variant:`outline`,disabled:r,className:`self-start sm:self-auto`,onClick:()=>i(n),children:[r?(0,w.jsx)(ie,{className:`size-3.5 animate-spin`}):(0,w.jsx)(x,{className:`size-3.5`}),`Install`]}):null,t[28]=o,t[29]=r,t[30]=i,t[31]=n,t[32]=v):v=t[32];let y;return t[33]!==_||t[34]!==v?(y=(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-border/50 px-4 py-3 first:border-t-0 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[_,v]}),t[33]=_,t[34]=v,t[35]=y):y=t[35],y}function _e(e){return(0,w.jsx)(`p`,{className:`font-mono text-[11px] leading-relaxed text-muted-foreground`,children:e},e)}function A(){let e=(0,de.c)(56),t=o(),{updateSettings:s}=n(),d=i(),f=t.defaultAgentTokenMode??`off`,p=ae[f],h=p.icon,y;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=[],e[0]=y):y=e[0];let[x,fe]=(0,C.useState)(y),E;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],e[1]=E):E=e[1];let[D,O]=(0,C.useState)(E),[k,_e]=(0,C.useState)(!1),[A,Ce]=(0,C.useState)(null),De=(0,C.useRef)(!1),j;e[2]===d?j=e[3]:(j=()=>{if(De.current)return;De.current=!0,_e(!0);let e=d?u(d.environmentId)?.server:l().server;if(!e){_e(!1),De.current=!1;return}Promise.all([e.listOpinionatedPlugins(),e.checkOpinionatedPlugins()]).then(e=>{let[t,n]=e;fe(t.plugins.toSorted(Ee)),O(n.statuses)}).catch(Te).finally(()=>{De.current=!1,_e(!1)})},e[2]=d,e[3]=j);let M=j,N,P;e[4]===M?(N=e[5],P=e[6]):(N=()=>{M()},P=[M],e[4]=M,e[5]=N,e[6]=P),(0,C.useEffect)(N,P);let F;if(e[7]!==D){let t=new Map;for(let e of D){let n=t.get(e.pluginId)??[];n.push(e),t.set(e.pluginId,n)}F=new Map;for(let[e,n]of t)F.set(e,n.toSorted(we));e[7]=D,e[8]=F}else F=e[8];let I=F,Oe=Se,L;e[9]!==M||e[10]!==d?(L=e=>{let t=l(),n=d?u(d.environmentId)?.server:t.server;if(!n){r.add(S({type:`error`,title:`Plugin install unavailable`,description:`Node ${d?.nodeLabel??`server`} is not connected.`}));return}let i=pe(e);t.dialogs.confirm(`Install ${e.pluginId===`rtk`?`RTK`:`Caveman`} for ${i}?\n\nThis may run networked CLI installation commands on this machine.`).then(t=>{if(!t)return;let a=T(e);return Ce(a),n.installOpinionatedPlugin({pluginId:e.pluginId,...e.providerInstanceId?{providerInstanceId:e.providerInstanceId}:{}}).then(t=>{O(e=>[...e.filter(e=>T(e)!==a),t.status]),r.add({type:`success`,title:`${e.pluginId===`rtk`?`RTK`:`Caveman`} installed`,description:t.commands.length>0?t.commands[t.commands.length-1]:i}),M()}).catch(xe).finally(()=>Ce(null))}).catch(be)},e[9]=M,e[10]=d,e[11]=L):L=e[11];let R=L,z;e[12]===s?z=e[13]:(z=e=>s({defaultAgentTokenMode:e}),e[12]=s,e[13]=z);let B;e[14]===h?B=e[15]:(B=(0,w.jsx)(h,{className:`size-4 shrink-0 text-muted-foreground`}),e[14]=h,e[15]=B);let V;e[16]===p.triggerLabel?V=e[17]:(V=(0,w.jsx)(ee,{children:p.triggerLabel}),e[16]=p.triggerLabel,e[17]=V);let H;e[18]!==B||e[19]!==V?(H=(0,w.jsx)(re,{className:`w-full sm:w-52`,"aria-label":`Default token mode`,children:(0,w.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[B,V]})}),e[18]=B,e[19]=V,e[20]=H):H=e[20];let U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,w.jsx)(ne,{align:`end`,alignItemWithTrigger:!1,className:`w-60`,children:oe.map(ye)}),e[21]=U):U=e[21];let W;e[22]!==f||e[23]!==z||e[24]!==H?(W=(0,w.jsx)(ce,{title:`Token mode`,children:(0,w.jsx)(ue,{title:`Default token mode`,description:`Applied to new threads and draft sessions. Existing threads keep their own mode.`,control:(0,w.jsxs)(te,{value:f,onValueChange:z,children:[H,U]})})}),e[22]=f,e[23]=z,e[24]=H,e[25]=W):W=e[25];let G;e[26]===M?G=e[27]:(G=()=>M(),e[26]=M,e[27]=G);let K;e[28]===k?K=e[29]:(K=k?(0,w.jsx)(ie,{className:`size-3 animate-spin`}):(0,w.jsx)(se,{className:`size-3`}),e[28]=k,e[29]=K);let q;e[30]!==k||e[31]!==G||e[32]!==K?(q=(0,w.jsx)(g,{render:(0,w.jsx)(a,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:k,onClick:G,"aria-label":`Refresh plugin status`,children:K})}),e[30]=k,e[31]=G,e[32]=K,e[33]=q):q=e[33];let J;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,w.jsx)(_,{side:`top`,children:`Refresh plugin status`}),e[34]=J):J=e[34];let Y;e[35]===q?Y=e[36]:(Y=(0,w.jsxs)(v,{children:[q,J]}),e[35]=q,e[36]=Y);let X;e[37]!==k||e[38]!==x.length?(X=x.length===0&&k?(0,w.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-4 text-xs text-muted-foreground`,children:[(0,w.jsx)(ie,{className:`size-3.5 animate-spin`}),`Loading plugin status`]}):null,e[37]=k,e[38]=x.length,e[39]=X):X=e[39];let Z;if(e[40]!==R||e[41]!==A||e[42]!==x||e[43]!==I){let t;e[45]!==R||e[46]!==A||e[47]!==I?(t=e=>{let t=I.get(e.id)??[],n=t.filter(ve).length;return(0,w.jsx)(ue,{title:(0,w.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:e.name}),(0,w.jsx)(b,{variant:n>0?`success`:`outline`,size:`sm`,children:n>0?`${n} installed`:`Available`})]}),description:e.summary,status:(0,w.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,w.jsx)(b,{variant:`info`,size:`sm`,children:me(e)}),(0,w.jsx)(b,{variant:`outline`,size:`sm`,children:he(e)})]}),control:(0,w.jsxs)(a,{size:`xs`,variant:`ghost`,onClick:()=>Oe(e),children:[(0,w.jsx)(m,{className:`size-3.5`}),`Docs`]}),children:(0,w.jsx)(`div`,{className:c(`mt-4 border-t border-border/60`,t.length===0?`px-5 py-4`:``),children:t.length===0?(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`No compatible provider instances detected.`}):t.map(e=>(0,w.jsx)(ge,{status:e,isInstalling:A===T(e),onInstall:R},T(e)))})},e.id)},e[45]=R,e[46]=A,e[47]=I,e[48]=t):t=e[48],Z=x.map(t),e[40]=R,e[41]=A,e[42]=x,e[43]=I,e[44]=Z}else Z=e[44];let Q;e[49]!==Y||e[50]!==X||e[51]!==Z?(Q=(0,w.jsxs)(ce,{title:`Opinionated plugins`,headerAction:Y,children:[X,Z]}),e[49]=Y,e[50]=X,e[51]=Z,e[52]=Q):Q=e[52];let $;return e[53]!==W||e[54]!==Q?($=(0,w.jsxs)(le,{children:[W,Q]}),e[53]=W,e[54]=Q,e[55]=$):$=e[55],$}function ve(e){return e.state===`installed`}function ye(e){let t=ae[e],n=t.icon;return(0,w.jsx)(y,{hideIndicator:!0,value:e,children:(0,w.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,w.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,w.jsx)(`span`,{className:`text-muted-foreground text-xs leading-4`,children:t.description})]})},e)}function be(e){r.add(S({type:`error`,title:`Install confirmation failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function xe(e){r.add(S({type:`error`,title:`Plugin install failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function Se(e){let t=e.docsUrl??e.homepageUrl;l().shell.openExternal(t).catch(Ce)}function Ce(e){r.add(S({type:`error`,title:`Failed to open plugin docs`,description:e instanceof Error?e.message:`An error occurred.`}))}function we(e,t){return k(e).localeCompare(k(t))}function Te(e){r.add(S({type:`error`,title:`Failed to load plugins`,description:e instanceof Error?e.message:`An error occurred.`}))}function Ee(e,t){return O(e.id)-O(t.id)}export{A as OpinionatedPluginsSettingsPanel};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import"./src-C3Y_imaX.js";import{$l as t,Hr as n,Kr as r,Ql as i,Qr as a,Vr as o,do as s,ei as c,hr as l,sr as u,uo as d}from"./runtime-BwHA1GUS.js";import{t as f}from"./react-CwJFpaho.js";import{Pr as p,kr as m}from"./switch-DnpJB2xv.js";import{t as h}from"./compiler-runtime-C4g8XhC5.js";import{i as g,n as _,t as v}from"./tooltip-BlweKBxc.js";import{a as y,c as ee,n as te,o as ne,s as re,t as b}from"./badge-2AZ3HfVS.js";import{Z as ie}from"./ContextHandoffEndpointLabel-CeGDLNA4.js";import{n as ae,t as oe}from"./tokenModePresentation-BkS-mry_.js";import{t as x}from"./download-DsYNYJeu.js";import{t as se}from"./refresh-cw-CgDa2Ok_.js";import{t as S}from"./toastHelpers-CSQRKo4F.js";import{i as ce,n as le,r as ue}from"./settingsLayout-DxsFwhF0.js";var de=h(),C=e(f(),1),w=t();function T(e){return`${e.pluginId}:${e.targetKind}:${e.providerInstanceId??`global`}`}function fe(e){switch(e.state){case`installed`:return`Installed`;case`not-installed`:return`Not installed`;case`unsupported`:return`Unsupported`;case`error`:return`Error`}}function E(e){switch(e.state){case`installed`:return`success`;case`not-installed`:return`outline`;case`unsupported`:return`warning`;case`error`:return`error`}}function D(e){switch(e.state){case`installed`:return(0,w.jsx)(d,{className:`size-3.5 text-success-foreground`});case`not-installed`:return(0,w.jsx)(p,{className:`size-3.5 text-muted-foreground`});case`unsupported`:case`error`:return(0,w.jsx)(s,{className:`size-3.5 text-warning-foreground`})}}function pe(e){return e.targetKind===`global`?`System`:e.providerDisplayName??String(e.providerInstanceId??`Provider`)}function me(e){return e.impact===`tool-output`?`Tool output`:`Assistant output`}function he(e){return e.scope===`global`?`Global`:`Provider`}function O(e){switch(e){case`rtk`:return 0;case`caveman`:return 1;case`token-optimizer`:return 2;case`token-savior`:return 3;case`lean-ctx`:return 4}}function k(e){return`${e.targetKind===`global`?`0`:`1`}:${pe(e).toLowerCase()}`}function ge(e){let t=(0,de.c)(36),{status:n,isInstalling:r,onInstall:i}=e,o=n.canInstall&&n.state!==`installed`,s;t[0]===n?s=t[1]:(s=D(n),t[0]=n,t[1]=s);let c;t[2]===n?c=t[3]:(c=pe(n),t[2]=n,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,w.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:c}),t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=E(n),t[6]=n,t[7]=u);let d;t[8]===n?d=t[9]:(d=fe(n),t[8]=n,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,w.jsx)(b,{variant:u,size:`sm`,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===n.version?p=t[14]:(p=n.version?(0,w.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:n.version}):null,t[13]=n.version,t[14]=p);let m;t[15]!==s||t[16]!==l||t[17]!==f||t[18]!==p?(m=(0,w.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center gap-2`,children:[s,l,f,p]}),t[15]=s,t[16]=l,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;t[20]===n.detail?h=t[21]:(h=n.detail?(0,w.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:n.detail}):null,t[20]=n.detail,t[21]=h);let g;t[22]===n.manualSteps?g=t[23]:(g=n.manualSteps.length>0?(0,w.jsx)(`div`,{className:`space-y-1 pt-1`,children:n.manualSteps.map(_e)}):null,t[22]=n.manualSteps,t[23]=g);let _;t[24]!==g||t[25]!==m||t[26]!==h?(_=(0,w.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[m,h,g]}),t[24]=g,t[25]=m,t[26]=h,t[27]=_):_=t[27];let v;t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==n?(v=o?(0,w.jsxs)(a,{size:`xs`,variant:`outline`,disabled:r,className:`self-start sm:self-auto`,onClick:()=>i(n),children:[r?(0,w.jsx)(ie,{className:`size-3.5 animate-spin`}):(0,w.jsx)(x,{className:`size-3.5`}),`Install`]}):null,t[28]=o,t[29]=r,t[30]=i,t[31]=n,t[32]=v):v=t[32];let y;return t[33]!==_||t[34]!==v?(y=(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-border/50 px-4 py-3 first:border-t-0 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[_,v]}),t[33]=_,t[34]=v,t[35]=y):y=t[35],y}function _e(e){return(0,w.jsx)(`p`,{className:`font-mono text-[11px] leading-relaxed text-muted-foreground`,children:e},e)}function A(){let e=(0,de.c)(56),t=o(),{updateSettings:s}=n(),d=i(),f=t.defaultAgentTokenMode??`off`,p=ae[f],h=p.icon,y;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=[],e[0]=y):y=e[0];let[x,fe]=(0,C.useState)(y),E;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],e[1]=E):E=e[1];let[D,O]=(0,C.useState)(E),[k,_e]=(0,C.useState)(!1),[A,Ce]=(0,C.useState)(null),De=(0,C.useRef)(!1),j;e[2]===d?j=e[3]:(j=()=>{if(De.current)return;De.current=!0,_e(!0);let e=d?u(d.environmentId)?.server:l().server;if(!e){_e(!1),De.current=!1;return}Promise.all([e.listOpinionatedPlugins(),e.checkOpinionatedPlugins()]).then(e=>{let[t,n]=e;fe(t.plugins.toSorted(Ee)),O(n.statuses)}).catch(Te).finally(()=>{De.current=!1,_e(!1)})},e[2]=d,e[3]=j);let M=j,N,P;e[4]===M?(N=e[5],P=e[6]):(N=()=>{M()},P=[M],e[4]=M,e[5]=N,e[6]=P),(0,C.useEffect)(N,P);let F;if(e[7]!==D){let t=new Map;for(let e of D){let n=t.get(e.pluginId)??[];n.push(e),t.set(e.pluginId,n)}F=new Map;for(let[e,n]of t)F.set(e,n.toSorted(we));e[7]=D,e[8]=F}else F=e[8];let I=F,Oe=Se,L;e[9]!==M||e[10]!==d?(L=e=>{let t=l(),n=d?u(d.environmentId)?.server:t.server;if(!n){r.add(S({type:`error`,title:`Plugin install unavailable`,description:`Node ${d?.nodeLabel??`server`} is not connected.`}));return}let i=pe(e);t.dialogs.confirm(`Install ${e.pluginId===`rtk`?`RTK`:`Caveman`} for ${i}?\n\nThis may run networked CLI installation commands on this machine.`).then(t=>{if(!t)return;let a=T(e);return Ce(a),n.installOpinionatedPlugin({pluginId:e.pluginId,...e.providerInstanceId?{providerInstanceId:e.providerInstanceId}:{}}).then(t=>{O(e=>[...e.filter(e=>T(e)!==a),t.status]),r.add({type:`success`,title:`${e.pluginId===`rtk`?`RTK`:`Caveman`} installed`,description:t.commands.length>0?t.commands[t.commands.length-1]:i}),M()}).catch(xe).finally(()=>Ce(null))}).catch(be)},e[9]=M,e[10]=d,e[11]=L):L=e[11];let R=L,z;e[12]===s?z=e[13]:(z=e=>s({defaultAgentTokenMode:e}),e[12]=s,e[13]=z);let B;e[14]===h?B=e[15]:(B=(0,w.jsx)(h,{className:`size-4 shrink-0 text-muted-foreground`}),e[14]=h,e[15]=B);let V;e[16]===p.triggerLabel?V=e[17]:(V=(0,w.jsx)(ee,{children:p.triggerLabel}),e[16]=p.triggerLabel,e[17]=V);let H;e[18]!==B||e[19]!==V?(H=(0,w.jsx)(re,{className:`w-full sm:w-52`,"aria-label":`Default token mode`,children:(0,w.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[B,V]})}),e[18]=B,e[19]=V,e[20]=H):H=e[20];let U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,w.jsx)(ne,{align:`end`,alignItemWithTrigger:!1,className:`w-60`,children:oe.map(ye)}),e[21]=U):U=e[21];let W;e[22]!==f||e[23]!==z||e[24]!==H?(W=(0,w.jsx)(ce,{title:`Token mode`,children:(0,w.jsx)(ue,{title:`Default token mode`,description:`Applied to new threads and draft sessions. Existing threads keep their own mode.`,control:(0,w.jsxs)(te,{value:f,onValueChange:z,children:[H,U]})})}),e[22]=f,e[23]=z,e[24]=H,e[25]=W):W=e[25];let G;e[26]===M?G=e[27]:(G=()=>M(),e[26]=M,e[27]=G);let K;e[28]===k?K=e[29]:(K=k?(0,w.jsx)(ie,{className:`size-3 animate-spin`}):(0,w.jsx)(se,{className:`size-3`}),e[28]=k,e[29]=K);let q;e[30]!==k||e[31]!==G||e[32]!==K?(q=(0,w.jsx)(g,{render:(0,w.jsx)(a,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:k,onClick:G,"aria-label":`Refresh plugin status`,children:K})}),e[30]=k,e[31]=G,e[32]=K,e[33]=q):q=e[33];let J;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,w.jsx)(_,{side:`top`,children:`Refresh plugin status`}),e[34]=J):J=e[34];let Y;e[35]===q?Y=e[36]:(Y=(0,w.jsxs)(v,{children:[q,J]}),e[35]=q,e[36]=Y);let X;e[37]!==k||e[38]!==x.length?(X=x.length===0&&k?(0,w.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-4 text-xs text-muted-foreground`,children:[(0,w.jsx)(ie,{className:`size-3.5 animate-spin`}),`Loading plugin status`]}):null,e[37]=k,e[38]=x.length,e[39]=X):X=e[39];let Z;if(e[40]!==R||e[41]!==A||e[42]!==x||e[43]!==I){let t;e[45]!==R||e[46]!==A||e[47]!==I?(t=e=>{let t=I.get(e.id)??[],n=t.filter(ve).length;return(0,w.jsx)(ue,{title:(0,w.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:e.name}),(0,w.jsx)(b,{variant:n>0?`success`:`outline`,size:`sm`,children:n>0?`${n} installed`:`Available`})]}),description:e.summary,status:(0,w.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,w.jsx)(b,{variant:`info`,size:`sm`,children:me(e)}),(0,w.jsx)(b,{variant:`outline`,size:`sm`,children:he(e)})]}),control:(0,w.jsxs)(a,{size:`xs`,variant:`ghost`,onClick:()=>Oe(e),children:[(0,w.jsx)(m,{className:`size-3.5`}),`Docs`]}),children:(0,w.jsx)(`div`,{className:c(`mt-4 border-t border-border/60`,t.length===0?`px-5 py-4`:``),children:t.length===0?(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`No compatible provider instances detected.`}):t.map(e=>(0,w.jsx)(ge,{status:e,isInstalling:A===T(e),onInstall:R},T(e)))})},e.id)},e[45]=R,e[46]=A,e[47]=I,e[48]=t):t=e[48],Z=x.map(t),e[40]=R,e[41]=A,e[42]=x,e[43]=I,e[44]=Z}else Z=e[44];let Q;e[49]!==Y||e[50]!==X||e[51]!==Z?(Q=(0,w.jsxs)(ce,{title:`Opinionated plugins`,headerAction:Y,children:[X,Z]}),e[49]=Y,e[50]=X,e[51]=Z,e[52]=Q):Q=e[52];let $;return e[53]!==W||e[54]!==Q?($=(0,w.jsxs)(le,{children:[W,Q]}),e[53]=W,e[54]=Q,e[55]=$):$=e[55],$}function ve(e){return e.state===`installed`}function ye(e){let t=ae[e],n=t.icon;return(0,w.jsx)(y,{hideIndicator:!0,value:e,children:(0,w.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,w.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,w.jsx)(`span`,{className:`text-muted-foreground text-xs leading-4`,children:t.description})]})},e)}function be(e){r.add(S({type:`error`,title:`Install confirmation failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function xe(e){r.add(S({type:`error`,title:`Plugin install failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function Se(e){let t=e.docsUrl??e.homepageUrl;l().shell.openExternal(t).catch(Ce)}function Ce(e){r.add(S({type:`error`,title:`Failed to open plugin docs`,description:e instanceof Error?e.message:`An error occurred.`}))}function we(e,t){return k(e).localeCompare(k(t))}function Te(e){r.add(S({type:`error`,title:`Failed to load plugins`,description:e instanceof Error?e.message:`An error occurred.`}))}function Ee(e,t){return O(e.id)-O(t.id)}export{A as OpinionatedPluginsSettingsPanel};