yepanywhere 0.10.2 → 0.11.0

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 (394) hide show
  1. package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +6 -0
  2. package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -1
  3. package/bundled/@yep-anywhere/shared/dist/capability-ids.js +6 -0
  4. package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -1
  5. package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -4
  6. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
  7. package/bundled/@yep-anywhere/shared/dist/index.js +3 -3
  8. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
  9. package/bundled/@yep-anywhere/shared/dist/issues.d.ts +16 -0
  10. package/bundled/@yep-anywhere/shared/dist/issues.d.ts.map +1 -1
  11. package/bundled/@yep-anywhere/shared/dist/issues.js +27 -0
  12. package/bundled/@yep-anywhere/shared/dist/issues.js.map +1 -1
  13. package/bundled/@yep-anywhere/shared/dist/project-service.d.ts +12 -0
  14. package/bundled/@yep-anywhere/shared/dist/project-service.d.ts.map +1 -1
  15. package/bundled/@yep-anywhere/shared/dist/project-service.js +56 -0
  16. package/bundled/@yep-anywhere/shared/dist/project-service.js.map +1 -1
  17. package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +50 -50
  18. package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
  19. package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +48 -50
  20. package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
  21. package/bundled/@yep-anywhere/shared/dist/types.d.ts +6 -0
  22. package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
  23. package/bundled/@yep-anywhere/shared/dist/types.js +5 -0
  24. package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
  25. package/bundled/@yep-anywhere/shared/package.json +1 -1
  26. package/client-dist/assets/{AboutSettings-DnDy6BEd.js → AboutSettings-Ck7P-jDQ.js} +1 -1
  27. package/client-dist/assets/{ActivityPage-MFWjNC-D.js → ActivityPage-lGdcdJ-e.js} +1 -1
  28. package/client-dist/assets/{AgentContextSettings-D8g4_T92.js → AgentContextSettings-UprX6zdD.js} +1 -1
  29. package/client-dist/assets/{AgentsPage-CXHC9oBL.js → AgentsPage-BNPVqFjZ.js} +1 -1
  30. package/client-dist/assets/App-3o8SyXXM.js +2 -0
  31. package/client-dist/assets/AppearanceSettings-DMW7A_Rf.js +2 -0
  32. package/client-dist/assets/{AppsSettings-BPk1YKiU.js → AppsSettings-D9Fdhvnq.js} +1 -1
  33. package/client-dist/assets/{AttachmentChip-BRmKgPA9.js → AttachmentChip-qYXy0CtC.js} +1 -1
  34. package/client-dist/assets/{AuthContext-BPHX3zIQ.js → AuthContext-IbT77aGw.js} +1 -1
  35. package/client-dist/assets/{BangCommandDisplayObject-DpwVa9Ll.js → BangCommandDisplayObject-BOag7vGT.js} +1 -1
  36. package/client-dist/assets/{BangCommandsPage-B8zpyOBf.js → BangCommandsPage--PeiFzRy.js} +1 -1
  37. package/client-dist/assets/{BlameBrowser-BLuAT9qK.js → BlameBrowser-DrfV_lH3.js} +1 -1
  38. package/client-dist/assets/{BrowserDebugToolbarButton-BXfPrxyA.js → BrowserDebugToolbarButton-DhIc8BpN.js} +1 -1
  39. package/client-dist/assets/{BrowserExtensionSettings-CZ0s6ASb.js → BrowserExtensionSettings-DAMeZFOL.js} +1 -1
  40. package/client-dist/assets/{CacheMissBillingSettings-ue0Jahu3.js → CacheMissBillingSettings-BW6Nf5ut.js} +1 -1
  41. package/client-dist/assets/{CodexUpdatePrompt-DXdrlvWV.js → CodexUpdatePrompt-H0-B1yB-.js} +1 -1
  42. package/client-dist/assets/{CommittedRangeInput-CLkpNnP_.js → CommittedRangeInput-C6In6Q8s.js} +1 -1
  43. package/client-dist/assets/{CommittedRangeNumberInput-Co1Mkg_Y.js → CommittedRangeNumberInput-DF-kPNGu.js} +1 -1
  44. package/client-dist/assets/{ConversationPreviewPage-B4Ph-QV7.js → ConversationPreviewPage-CTu-ffV7.js} +1 -1
  45. package/client-dist/assets/{CopyTextButton-Bpeo8K_-.js → CopyTextButton-oYhSruA8.js} +1 -1
  46. package/client-dist/assets/{DevelopmentSettings-B3XBUEkp.js → DevelopmentSettings-DGtUr0Qz.js} +1 -1
  47. package/client-dist/assets/{DevicesSettings-D_iWcxbb.js → DevicesSettings-XMDAT-N4.js} +1 -1
  48. package/client-dist/assets/{EmulatorPage-B1cu6Lq_.js → EmulatorPage-De0YMKUL.js} +1 -1
  49. package/client-dist/assets/{EmulatorSettings-nvQEL90Z.js → EmulatorSettings-C5TOwBvn.js} +1 -1
  50. package/client-dist/assets/{EnvironmentSettings-Ba6izhQj.js → EnvironmentSettings-B1gePTdK.js} +1 -1
  51. package/client-dist/assets/{FilePage-9Ss6nJ-y.js → FilePage-zx4PfIbF.js} +1 -1
  52. package/client-dist/assets/FileViewer-D8IcGVo-.js +63 -0
  53. package/client-dist/assets/{FilterDropdown-D-CDFjqG.js → FilterDropdown-BJ5npFAA.js} +1 -1
  54. package/client-dist/assets/FloatingActionButton-Dm0404b2.js +1 -0
  55. package/client-dist/assets/{GitStatusPage-CH31Bai2.js → GitStatusPage-D-4o8YmB.js} +6 -6
  56. package/client-dist/assets/{GlobalSessionsPage-CgxvBzzy.js → GlobalSessionsPage-DD6UMomT.js} +2 -2
  57. package/client-dist/assets/{GlossaryContext-PMCo1K6f.js → GlossaryContext-BA5X62Ck.js} +1 -1
  58. package/client-dist/assets/{HeartbeatTextArea-bCQAiAc-.js → HeartbeatTextArea-ywZAleeh.js} +1 -1
  59. package/client-dist/assets/{HostIdentityContext-B3FgYv0w.js → HostIdentityContext-_GKYzEQ6.js} +1 -1
  60. package/client-dist/assets/{HostsPage-BG_bgfeL.js → HostsPage-OGegHtTp.js} +1 -1
  61. package/client-dist/assets/{InboxContext-BnIIp9cf.js → InboxContext-CZTibzZl.js} +1 -1
  62. package/client-dist/assets/{InboxPage-D1M26n9s.js → InboxPage-DuvRGWdd.js} +1 -1
  63. package/client-dist/assets/IssueSettings-BE0SFhgx.js +1 -0
  64. package/client-dist/assets/IssueSettings-CPOZbMa8.css +1 -0
  65. package/client-dist/assets/IssuesPage-CA4k5N50.css +1 -0
  66. package/client-dist/assets/IssuesPage-CWd-GCCG.js +1 -0
  67. package/client-dist/assets/{LifecycleWebhooksSettings-CaNL4aDT.js → LifecycleWebhooksSettings-bzUj5dsE.js} +1 -1
  68. package/client-dist/assets/{LocalAccessSettings-7EI7L-wA.js → LocalAccessSettings-DSezlzqb.js} +1 -1
  69. package/client-dist/assets/LocalMediaModal-DMrKaM1a.js +14 -0
  70. package/client-dist/assets/LocalSourcePage-Cttx4S9P.js +1 -0
  71. package/client-dist/assets/{LoginPage-C4023DZw.js → LoginPage-DVf285Ok.js} +1 -1
  72. package/client-dist/assets/{MarkdownPreview-ClsW_S6S.js → MarkdownPreview-TXbYZwdp.js} +2 -2
  73. package/client-dist/assets/{MessageAge-B2tHxpYx.js → MessageAge-7FVIZWEv.js} +1 -1
  74. package/client-dist/assets/MessageDeliverySettings-iykyxRVS.js +4 -0
  75. package/client-dist/assets/MessageInput-D1epbc4v.js +7 -0
  76. package/client-dist/assets/{MessageInputToolbar-C79z9qW6.js → MessageInputToolbar-CgXvBkeG.js} +8 -8
  77. package/client-dist/assets/MessageList-Ce3MvdtI.js +4 -0
  78. package/client-dist/assets/{MicrophoneIcon-BLs10fC3.js → MicrophoneIcon-Dhu4NCe6.js} +1 -1
  79. package/client-dist/assets/{Modal-iT2_XPlO.js → Modal-CHNqXAgW.js} +9 -9
  80. package/client-dist/assets/{ModelSettings-B4fCDCIJ.js → ModelSettings-DBQKdWCg.js} +1 -1
  81. package/client-dist/assets/{NavigationLayout-BpvrdPoS.js → NavigationLayout-UkQvkodY.js} +1 -1
  82. package/client-dist/assets/NewSessionForm-Ds5dM9lx.js +9 -0
  83. package/client-dist/assets/NewSessionPage-BERKMRdN.js +2 -0
  84. package/client-dist/assets/{NotificationsSettings-I2SS2U9N.js → NotificationsSettings-1RBQorDi.js} +1 -1
  85. package/client-dist/assets/{PageHeader-Dbb8BZq2.js → PageHeader-DYCnk788.js} +1 -1
  86. package/client-dist/assets/{PerformanceSettings-Ci8oh2Js.js → PerformanceSettings-CGz5ct-T.js} +1 -1
  87. package/client-dist/assets/ProjectAppPage-EfNtdwLY.js +1 -0
  88. package/client-dist/assets/ProjectAppViewer-CRnJGIt-.css +1 -0
  89. package/client-dist/assets/ProjectAppViewer-slr3FXj4.js +1 -0
  90. package/client-dist/assets/{ProjectSessionDefaultsModal-D33bQF-Q.js → ProjectSessionDefaultsModal-5yjuvV8S.js} +1 -1
  91. package/client-dist/assets/{ProjectTemplatesSettings-D8Sr5dDj.js → ProjectTemplatesSettings-DWZfH0JJ.js} +1 -1
  92. package/client-dist/assets/{ProjectsPage-CIHRcMpx.js → ProjectsPage-BJV93FM-.js} +1 -1
  93. package/client-dist/assets/{ProviderBadge-DmhZSMRX.js → ProviderBadge-C-UpobLD.js} +1 -1
  94. package/client-dist/assets/{ProviderChildSessionDetail-D3xbfVZT.js → ProviderChildSessionDetail-CmyTKIwt.js} +3 -3
  95. package/client-dist/assets/ProviderChildSessionPage-Clp1hlBo.js +1 -0
  96. package/client-dist/assets/{ProviderSignIn-DRgPyX8J.js → ProviderSignIn-d13WuHAR.js} +1 -1
  97. package/client-dist/assets/{ProviderSignInPage-ByQPPIRT.js → ProviderSignInPage-CkeyyeWl.js} +1 -1
  98. package/client-dist/assets/{ProvidersSettings-nHJSxVfC.js → ProvidersSettings-Ddj2J4N2.js} +1 -1
  99. package/client-dist/assets/{RecapAfterSecondsControl-BsBxbSpd.js → RecapAfterSecondsControl-D_AiWfq1.js} +1 -1
  100. package/client-dist/assets/{RemoteAccessSettings-Cq_gn76d.js → RemoteAccessSettings-CaE3iqqj.js} +1 -1
  101. package/client-dist/assets/{RemoteExecutorsSettings-CTRjrID3.js → RemoteExecutorsSettings-snCnHbRp.js} +1 -1
  102. package/client-dist/assets/{RenderModeContext-CZwSZkSZ.js → RenderModeContext-CuIMXqQV.js} +1 -1
  103. package/client-dist/assets/{RenderModeGlyph-dL8kAPff.js → RenderModeGlyph-ldDSjj9f.js} +1 -1
  104. package/client-dist/assets/{RouterPoolSelector-Pmu8xrjx.js → RouterPoolSelector-H3X29mOM.js} +2 -2
  105. package/client-dist/assets/{SchemaValidationContext-DqOi1YmB.js → SchemaValidationContext-CPr8V317.js} +1 -1
  106. package/client-dist/assets/{SearchPreview-DIbIaW_4.js → SearchPreview-DvMlCBIp.js} +1 -1
  107. package/client-dist/assets/{SecureConnection-DwcGBdlV.js → SecureConnection-DeVWJw06.js} +2 -2
  108. package/client-dist/assets/{SessionHeader.module-Co1boPaC.js → SessionHeader.module-DfkDdP3M.js} +1 -1
  109. package/client-dist/assets/{SessionMetadataContext-Bfs4TAAj.js → SessionMetadataContext-D0F_4Wp0.js} +1 -1
  110. package/client-dist/assets/SessionPage-xeog2S54.js +50 -0
  111. package/client-dist/assets/{SettingsItem-C7eQXUQf.js → SettingsItem-BgyAjvy6.js} +1 -1
  112. package/client-dist/assets/{SourceControlSettings-D58qSFZm.js → SourceControlSettings-B9T3f2Et.js} +1 -1
  113. package/client-dist/assets/{SourceFileHeaderActions-DNRytjPK.js → SourceFileHeaderActions-ByzC_I1c.js} +1 -1
  114. package/client-dist/assets/{SpeechControlMenu-BA2W-shI.js → SpeechControlMenu-Dhkd9fo9.js} +1 -1
  115. package/client-dist/assets/SpeechSettings-DEZsiCyG.js +2 -0
  116. package/client-dist/assets/{SpeechSmartTurnControls-DgT6bhA4.js → SpeechSmartTurnControls-BdmFc3C9.js} +1 -1
  117. package/client-dist/assets/{StorageSettings-DsvbVixL.js → StorageSettings-CiuHgnzi.js} +1 -1
  118. package/client-dist/assets/{ThinkingControls-Bi0PcWyP.js → ThinkingControls-Bf_4_n66.js} +1 -1
  119. package/client-dist/assets/ToolbarSettings-DupwvB70.js +1 -0
  120. package/client-dist/assets/{TrackerStatusBadge-CYRbIvfC.js → TrackerStatusBadge-nbexFcyV.js} +1 -1
  121. package/client-dist/assets/{UsersSettings-BjSX_kKq.js → UsersSettings-CrGxlDav.js} +1 -1
  122. package/client-dist/assets/{ViewerModePage-BlsOYFrz.js → ViewerModePage-DCVHfUMc.js} +1 -1
  123. package/client-dist/assets/ViewerWindowActions-DV5bxAAy.js +1 -0
  124. package/client-dist/assets/VoiceInputButton-4SbrfhMk.js +1 -0
  125. package/client-dist/assets/{WorkstreamsPage-B10INHZx.js → WorkstreamsPage-CUsI5c-n.js} +1 -1
  126. package/client-dist/assets/YaServerProvider-Dt9IBXDZ.js +31 -0
  127. package/client-dist/assets/{YepAnywhereLogo-CIpZ5dke.js → YepAnywhereLogo-ccRUdgT-.js} +1 -1
  128. package/client-dist/assets/{abnfDiagram-VCTEODGH-sCU1nPAM.js → abnfDiagram-VCTEODGH-Dysqh90e.js} +1 -1
  129. package/client-dist/assets/{arc-DjiGPMMi.js → arc-BfmRVkD-.js} +1 -1
  130. package/client-dist/assets/{architectureDiagram-5GKGNRK7-3RzD-zEy.js → architectureDiagram-5GKGNRK7-Bp1GI0XP.js} +1 -1
  131. package/client-dist/assets/{attachmentFileNames-clPM_F1w.js → attachmentFileNames-CGZzPAjE.js} +1 -1
  132. package/client-dist/assets/{blockDiagram-I7D4REHJ-BU6A9-4i.js → blockDiagram-I7D4REHJ-9vaOU_YP.js} +1 -1
  133. package/client-dist/assets/{browserTab-BXElY_d5.js → browserTab-CLF9iteD.js} +1 -1
  134. package/client-dist/assets/{c4Diagram-7LVT6UL2-CxusgaWH.js → c4Diagram-7LVT6UL2-Cj9qrKnL.js} +1 -1
  135. package/client-dist/assets/channel-Bx4xMN3u.js +1 -0
  136. package/client-dist/assets/{chunk-2Q5K7J3B-CBi0JNQU.js → chunk-2Q5K7J3B-DD_50QMk.js} +1 -1
  137. package/client-dist/assets/{chunk-5VM5RSS4-CskSgDiX.js → chunk-5VM5RSS4-Ba0GJEZb.js} +1 -1
  138. package/client-dist/assets/{chunk-F27PBJKO-Dl65caQS.js → chunk-F27PBJKO-D3_CXW_b.js} +1 -1
  139. package/client-dist/assets/{chunk-IMKFNOWR-BHAs2B4i.js → chunk-IMKFNOWR-Bx7Jus4R.js} +1 -1
  140. package/client-dist/assets/{chunk-JWPE2WC7-CRWKI8Z7.js → chunk-JWPE2WC7-1B1j7YcM.js} +1 -1
  141. package/client-dist/assets/{chunk-POPQ4Y6H-CzdOCWYO.js → chunk-POPQ4Y6H-CgMmmF_H.js} +1 -1
  142. package/client-dist/assets/{chunk-SVP7TREG-DxoiR2Mk.js → chunk-SVP7TREG-DDSE5Wq6.js} +1 -1
  143. package/client-dist/assets/{chunk-TICWLB2K-cve5023y.js → chunk-TICWLB2K-DUZGu3ce.js} +1 -1
  144. package/client-dist/assets/{chunk-XXDRQBXY-mSd5ZgMm.js → chunk-XXDRQBXY-oJdOaI50.js} +1 -1
  145. package/client-dist/assets/classDiagram-ZZMXUADV-CTAikA-f.js +1 -0
  146. package/client-dist/assets/classDiagram-v2-VYDZK3BY-CTAikA-f.js +1 -0
  147. package/client-dist/assets/{clientSummaryStore-Cr4yWo-Y.js → clientSummaryStore-Dsgo1zWK.js} +1 -1
  148. package/client-dist/assets/{compactSettingsControls-BI6RhVII.js → compactSettingsControls-CgeiII5J.js} +1 -1
  149. package/client-dist/assets/{cose-bilkent-JH36ORCC-CoI7dvL-.js → cose-bilkent-JH36ORCC-CQKgCYKk.js} +1 -1
  150. package/client-dist/assets/{cynefin-OW5HDTMX-B6We6WUI.js → cynefin-OW5HDTMX-S85H965d.js} +1 -1
  151. package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BUzaWybE.js → cynefinDiagram-5FMLGOSQ-B4ri3nX3.js} +1 -1
  152. package/client-dist/assets/{dagre-GXQ25YYZ-BYhpPlP3.js → dagre-GXQ25YYZ-DoQhim_k.js} +1 -1
  153. package/client-dist/assets/{diagram-S7CK7UJ4-FkUIxzy0.js → diagram-S7CK7UJ4-DYy2x0Ta.js} +1 -1
  154. package/client-dist/assets/{diagram-UQ7AKVKN-B0_3U7US.js → diagram-UQ7AKVKN-DxCcDSWg.js} +1 -1
  155. package/client-dist/assets/{diagram-VSXAHHWV-DNF_DVVi.js → diagram-VSXAHHWV-tDbIkKUf.js} +1 -1
  156. package/client-dist/assets/{diagram-VX7I27RA-DgeEEgTw.js → diagram-VX7I27RA-Qdg9iySG.js} +1 -1
  157. package/client-dist/assets/{diagram-Z3DM3KII-S5soWFl_.js → diagram-Z3DM3KII-BTpWBWAH.js} +1 -1
  158. package/client-dist/assets/{ebnfDiagram-PWID7BFC-kfLCEtAi.js → ebnfDiagram-PWID7BFC-DBHufTpw.js} +1 -1
  159. package/client-dist/assets/{erDiagram-RLTQ6QDP-xI7CqDO3.js → erDiagram-RLTQ6QDP-DGkKs4b_.js} +1 -1
  160. package/client-dist/assets/{flowDiagram-HODETNUW-CVSTa2nO.js → flowDiagram-HODETNUW-DVKc1wL6.js} +1 -1
  161. package/client-dist/assets/{frontendReload-54GeNGj9.js → frontendReload-B4jfUIeG.js} +1 -1
  162. package/client-dist/assets/{ganttDiagram-EL5Y4UJY-CI03o3Me.js → ganttDiagram-EL5Y4UJY-lIq_NgbX.js} +1 -1
  163. package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-BlnPaeW9.js → gitGraphDiagram-WWUBYQGX-BjX5H3_l.js} +1 -1
  164. package/client-dist/assets/index-BSMD-gHP.js +1 -0
  165. package/client-dist/assets/index-BhTv6hAY.js +64 -0
  166. package/client-dist/assets/{index-DrKoeozX.js → index-CdtGIhcy.js} +1 -1
  167. package/client-dist/assets/{index-1dMuvv06.js → index-DjQ2chjT.js} +1 -1
  168. package/client-dist/assets/{index-DvjdkG8Q.js → index-DnFlh5Zf.js} +2 -2
  169. package/client-dist/assets/{infoDiagram-27XIBGKW-C7GxDcfT.js → infoDiagram-27XIBGKW-BRxpTbKN.js} +1 -1
  170. package/client-dist/assets/{ishikawaDiagram-5VMMS53U-DBZVNUMP.js → ishikawaDiagram-5VMMS53U-BXr5zlby.js} +1 -1
  171. package/client-dist/assets/{journeyDiagram-3NMN7TZE-CT3nDRx4.js → journeyDiagram-3NMN7TZE-BO5vc5JN.js} +1 -1
  172. package/client-dist/assets/{kanban-definition-UXKFOSKX-Dgns21Ky.js → kanban-definition-UXKFOSKX-FJ2uF-MR.js} +1 -1
  173. package/client-dist/assets/{layout-CCGb-lVs.js → layout-BQ-_ERR1.js} +1 -1
  174. package/client-dist/assets/{limitedUserBrowserDefaults-C6cuD-wF.js → limitedUserBrowserDefaults-CwcMxPe5.js} +1 -1
  175. package/client-dist/assets/{limitedUserDefaultsClient-BPifr9h5.js → limitedUserDefaultsClient-CLg4zzsz.js} +1 -1
  176. package/client-dist/assets/{linear-BO4yAkdf.js → linear-BwwPzSrY.js} +1 -1
  177. package/client-dist/assets/{long-context-effort-warning-By1TxT0F.js → long-context-effort-warning-ims8_Hv4.js} +1 -1
  178. package/client-dist/assets/main-BX4yZXDF.js +43 -0
  179. package/client-dist/assets/mermaid.core-D26C4xkK.js +312 -0
  180. package/client-dist/assets/micTitleActivity-yQ5HgRnF.js +1 -0
  181. package/client-dist/assets/{mindmap-definition-YA3MSWOX-W-bMySj1.js → mindmap-definition-YA3MSWOX-Bv_gNy8_.js} +1 -1
  182. package/client-dist/assets/{newSessionPrefill-CHZfBHqQ.js → newSessionPrefill-BC5a8IpP.js} +1 -1
  183. package/client-dist/assets/{pegDiagram-XKGWAZYB-BMSL3Swk.js → pegDiagram-XKGWAZYB-CBB23R00.js} +1 -1
  184. package/client-dist/assets/{permissionModes-DJvRe3vP.js → permissionModes-C5_i_UDc.js} +1 -1
  185. package/client-dist/assets/{pieDiagram-E7YTZNPT-fzcyJjCG.js → pieDiagram-E7YTZNPT-C0uC29fl.js} +1 -1
  186. package/client-dist/assets/{quadrantDiagram-AXDQQJYC-EQecMBLb.js → quadrantDiagram-AXDQQJYC-BYcINwOa.js} +1 -1
  187. package/client-dist/assets/{railroadDiagram-O6MQD6OU-DvY2buxp.js → railroadDiagram-O6MQD6OU-DwLq6WlM.js} +1 -1
  188. package/client-dist/assets/{recentProjectPathLinks-Km2YzBV7.js → recentProjectPathLinks-Bp8ZFFVQ.js} +1 -1
  189. package/client-dist/assets/{registerServiceWorker-DvFS41on.js → registerServiceWorker-BEwfu1re.js} +1 -1
  190. package/client-dist/assets/{remoteRoutePaths-Crh_32jX.js → remoteRoutePaths-DpabBbC6.js} +1 -1
  191. package/client-dist/assets/{requirementDiagram-BXWQKSXE-CIdu0GYt.js → requirementDiagram-BXWQKSXE-H7ltzzju.js} +1 -1
  192. package/client-dist/assets/{sankeyDiagram-P5KCCOFB-BzupSIep.js → sankeyDiagram-P5KCCOFB-DQ_BH-ec.js} +1 -1
  193. package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-BCz8DLSg.js → sequenceDiagram-WJ2MYXX4-CE5cJN0V.js} +1 -1
  194. package/client-dist/assets/{sessionNavigationState-pHYi3UxP.js → sessionNavigationState-nTMUDlwU.js} +1 -1
  195. package/client-dist/assets/sessionVhostApps-DbEDY32Q.js +1 -0
  196. package/client-dist/assets/{sessionViewerController-BKTu5sj-.js → sessionViewerController-BGKUu-Zg.js} +1 -1
  197. package/client-dist/assets/{sessionViewerPlacement-D4lCtx-b.js → sessionViewerPlacement-cjpznhMG.js} +1 -1
  198. package/client-dist/assets/{sizeCapture-INFHLROL-nGK4qjL2.js → sizeCapture-INFHLROL-DTs5ZL4J.js} +1 -1
  199. package/client-dist/assets/{sourceControlNavigationState-B1jkV2pd.js → sourceControlNavigationState-D8WJCFc_.js} +1 -1
  200. package/client-dist/assets/{sourceTransportPaths-COX454wy.js → sourceTransportPaths-BTR7eFi5.js} +1 -1
  201. package/client-dist/assets/{speechDraftTransaction-cFbNnQHh.js → speechDraftTransaction-Bn7ppW5b.js} +1 -1
  202. package/client-dist/assets/{stateDiagram-D77RDMKH-CFix9P5-.js → stateDiagram-D77RDMKH-CGP-PcgJ.js} +1 -1
  203. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-BeSd02wx.js +1 -0
  204. package/client-dist/assets/{swimlanes-42K2YHIH-3cL-IerY.js → swimlanes-42K2YHIH-BUyuyk1Q.js} +1 -1
  205. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-DJ-GHCq1.js +8 -0
  206. package/client-dist/assets/{timeline-definition-24CTP7MA-Cc4302bU.js → timeline-definition-24CTP7MA-CbhEbRKF.js} +1 -1
  207. package/client-dist/assets/{uiTrace-DGW4HhGn.js → uiTrace-CvAgW12D.js} +1 -1
  208. package/client-dist/assets/{useAcliCommentarySetting-Br7kBvtE.js → useAcliCommentarySetting-B9uDJlBW.js} +1 -1
  209. package/client-dist/assets/{useActivityBusState-CzYhbKlD.js → useActivityBusState-CJk1MiYW.js} +1 -1
  210. package/client-dist/assets/{useAttachmentUploadQuality-B_kWKCMo.js → useAttachmentUploadQuality-Bx88B-aj.js} +1 -1
  211. package/client-dist/assets/{useBackgroundRevalidation-BpXlX3fs.js → useBackgroundRevalidation-SUxysljm.js} +1 -1
  212. package/client-dist/assets/{useCodexUpdateStatus-w-5NajaG.js → useCodexUpdateStatus-CihSrx5C.js} +1 -1
  213. package/client-dist/assets/{useComposerPromptRail-DL5r3CAD.js → useComposerPromptRail-DcRpLRmu.js} +1 -1
  214. package/client-dist/assets/{useConnectedDevices-BJILFKIz.js → useConnectedDevices-Ciuv3J4o.js} +1 -1
  215. package/client-dist/assets/useDocumentTitle-wGc9OsUg.js +1 -0
  216. package/client-dist/assets/{useEmulators-cGrsK5mh.js → useEmulators-CQCzysEZ.js} +1 -1
  217. package/client-dist/assets/{useFileActivity-Y1m-dClR.js → useFileActivity-CpuLfNl9.js} +1 -1
  218. package/client-dist/assets/{useFloatingActionButtonEnabled-CgWMCFmO.js → useFloatingActionButtonEnabled-BKJ8RfOu.js} +1 -1
  219. package/client-dist/assets/{useForkSummaryAutoOpen-qfV9Dgsp.js → useForkSummaryAutoOpen-DRGGsQgo.js} +1 -1
  220. package/client-dist/assets/useGeneratedTitleLength-R5Q60VSi.js +1 -0
  221. package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-DXTp5fUz.js → useKeepMobileKeyboardOpenAfterDelivery-DXMbsQWe.js} +1 -1
  222. package/client-dist/assets/{useLiveToolOutputEnabled-rQskgO0g.js → useLiveToolOutputEnabled-Qb_QFuzk.js} +1 -1
  223. package/client-dist/assets/{useModelSettings-DMjdRGMd.js → useModelSettings-BSbgwkL8.js} +1 -1
  224. package/client-dist/assets/{useNotifyInApp-BBmQnbh7.js → useNotifyInApp-BucZAqVF.js} +1 -1
  225. package/client-dist/assets/{useOnboarding-CF1WDG2d.js → useOnboarding-BzoWTXrR.js} +1 -1
  226. package/client-dist/assets/{usePanelSlideAnimations-C5qJWoVe.js → usePanelSlideAnimations-XdQhGgr-.js} +1 -1
  227. package/client-dist/assets/{useProjectAppComposing-C8gaOUg9.js → useProjectAppComposing-DBPyVUba.js} +1 -1
  228. package/client-dist/assets/{useProjectTemplateChoices-C0Uxthrq.js → useProjectTemplateChoices-niJIV5HQ.js} +1 -1
  229. package/client-dist/assets/{useProviders-B7fACEDA.js → useProviders-B54BXYv3.js} +1 -1
  230. package/client-dist/assets/{useQuestionAsideSetting-CR1M9_u6.js → useQuestionAsideSetting-CILJe25J.js} +1 -1
  231. package/client-dist/assets/{useRecentSessions-DBXvckSG.js → useRecentSessions-CQJcnOeU.js} +1 -1
  232. package/client-dist/assets/{useRelativeNow-B7XFLfKm.js → useRelativeNow-C2ME3OxV.js} +1 -1
  233. package/client-dist/assets/{useReloadNotifications-D2NJM_v_.js → useReloadNotifications-PKjb8H55.js} +1 -1
  234. package/client-dist/assets/{useRemoteExecutors-j1cpFGnw.js → useRemoteExecutors-CMd01rZ7.js} +1 -1
  235. package/client-dist/assets/{useSearchConcurrency-DlrPqVlr.js → useSearchConcurrency-BIVnIche.js} +1 -1
  236. package/client-dist/assets/useSessionRightPaneSetting-C5YgsyBy.js +1 -0
  237. package/client-dist/assets/{useSidebarWidth-DnB-wKom.js → useSidebarWidth-op0qbgd4.js} +1 -1
  238. package/client-dist/assets/{useSourceControlCleanLanding-ByQI1cWZ.js → useSourceControlCleanLanding-BE8h6VMD.js} +1 -1
  239. package/client-dist/assets/{useStableToolPreviewRendering-DtPpSoyX.js → useStableToolPreviewRendering-Bdiaz4I5.js} +1 -1
  240. package/client-dist/assets/{useTabTitleActivityPreference-DH0VanNM.js → useTabTitleActivityPreference-ZJ19N5_Q.js} +1 -1
  241. package/client-dist/assets/{useVhostAccess-D6l6YouM.js → useVhostAccess-CttxSyIC.js} +1 -1
  242. package/client-dist/assets/{useWorkflowTags-5i3ohGrH.js → useWorkflowTags-CsPhaG2p.js} +1 -1
  243. package/client-dist/assets/{vennDiagram-4TSXK5OY-BJaUYJ8y.js → vennDiagram-4TSXK5OY-DkXe2h8B.js} +1 -1
  244. package/client-dist/assets/{wardleyDiagram-VM6X3IG4-DEgI0m1V.js → wardleyDiagram-VM6X3IG4-BnBGhOBQ.js} +1 -1
  245. package/client-dist/assets/{xychartDiagram-S5SC5T6Z-BuAw5_xn.js → xychartDiagram-S5SC5T6Z-Bxkl9DZJ.js} +1 -1
  246. package/client-dist/index.html +3 -3
  247. package/client-dist/sw.js +2 -1
  248. package/dist/app.d.ts.map +1 -1
  249. package/dist/app.js +10 -2
  250. package/dist/app.js.map +1 -1
  251. package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
  252. package/dist/artifacts/ArtifactServer.js +3 -20
  253. package/dist/artifacts/ArtifactServer.js.map +1 -1
  254. package/dist/artifacts/ProjectAppDelivery.d.ts.map +1 -1
  255. package/dist/artifacts/ProjectAppDelivery.js +31 -1
  256. package/dist/artifacts/ProjectAppDelivery.js.map +1 -1
  257. package/dist/artifacts/pdfInFrame.d.ts +17 -0
  258. package/dist/artifacts/pdfInFrame.d.ts.map +1 -0
  259. package/dist/artifacts/pdfInFrame.js +30 -0
  260. package/dist/artifacts/pdfInFrame.js.map +1 -0
  261. package/dist/projects/ProjectAppStore.d.ts +0 -1
  262. package/dist/projects/ProjectAppStore.d.ts.map +1 -1
  263. package/dist/projects/ProjectServiceManager.d.ts +88 -0
  264. package/dist/projects/ProjectServiceManager.d.ts.map +1 -1
  265. package/dist/projects/ProjectServiceManager.js +4 -2
  266. package/dist/projects/ProjectServiceManager.js.map +1 -1
  267. package/dist/projects/template-runtime.d.ts +5 -0
  268. package/dist/projects/template-runtime.d.ts.map +1 -1
  269. package/dist/projects/template-runtime.js +3 -1
  270. package/dist/projects/template-runtime.js.map +1 -1
  271. package/dist/routes/issue-content.d.ts +6 -0
  272. package/dist/routes/issue-content.d.ts.map +1 -0
  273. package/dist/routes/issue-content.js +25 -0
  274. package/dist/routes/issue-content.js.map +1 -0
  275. package/dist/routes/issues.d.ts +2 -1
  276. package/dist/routes/issues.d.ts.map +1 -1
  277. package/dist/routes/issues.js +34 -4
  278. package/dist/routes/issues.js.map +1 -1
  279. package/dist/routes/project-app.d.ts.map +1 -1
  280. package/dist/routes/project-app.js +27 -2
  281. package/dist/routes/project-app.js.map +1 -1
  282. package/dist/routes/project-creation.d.ts +7 -0
  283. package/dist/routes/project-creation.d.ts.map +1 -1
  284. package/dist/routes/project-creation.js +12 -0
  285. package/dist/routes/project-creation.js.map +1 -1
  286. package/dist/routes/projects.d.ts.map +1 -1
  287. package/dist/routes/projects.js +33 -11
  288. package/dist/routes/projects.js.map +1 -1
  289. package/dist/routes/sessions.d.ts.map +1 -1
  290. package/dist/routes/sessions.js +2 -0
  291. package/dist/routes/sessions.js.map +1 -1
  292. package/dist/routes/speech.d.ts.map +1 -1
  293. package/dist/routes/speech.js +3 -1
  294. package/dist/routes/speech.js.map +1 -1
  295. package/dist/routes/version.d.ts.map +1 -1
  296. package/dist/routes/version.js +1 -0
  297. package/dist/routes/version.js.map +1 -1
  298. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts +12 -0
  299. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts.map +1 -0
  300. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js +3 -0
  301. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js.map +1 -0
  302. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts +10 -2
  303. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts.map +1 -1
  304. package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts +4 -0
  305. package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts.map +1 -1
  306. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +7 -2
  307. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -1
  308. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +8 -0
  309. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
  310. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts +8 -0
  311. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts.map +1 -1
  312. package/dist/sdk/providers/codex.d.ts +10 -0
  313. package/dist/sdk/providers/codex.d.ts.map +1 -1
  314. package/dist/sdk/providers/codex.js +33 -3
  315. package/dist/sdk/providers/codex.js.map +1 -1
  316. package/dist/services/RendezWatchService.d.ts +3 -0
  317. package/dist/services/RendezWatchService.d.ts.map +1 -1
  318. package/dist/services/RendezWatchService.js +6 -0
  319. package/dist/services/RendezWatchService.js.map +1 -1
  320. package/dist/services/issues/IssueStore.d.ts +24 -0
  321. package/dist/services/issues/IssueStore.d.ts.map +1 -1
  322. package/dist/services/issues/IssueStore.js +67 -11
  323. package/dist/services/issues/IssueStore.js.map +1 -1
  324. package/dist/services/issues/confirm.d.ts.map +1 -1
  325. package/dist/services/issues/confirm.js +37 -3
  326. package/dist/services/issues/confirm.js.map +1 -1
  327. package/dist/services/issues/content.d.ts +36 -0
  328. package/dist/services/issues/content.d.ts.map +1 -0
  329. package/dist/services/issues/content.js +328 -0
  330. package/dist/services/issues/content.js.map +1 -0
  331. package/dist/services/issues/status.d.ts.map +1 -1
  332. package/dist/services/issues/status.js +12 -4
  333. package/dist/services/issues/status.js.map +1 -1
  334. package/dist/services/rendezSessions.d.ts +2 -1
  335. package/dist/services/rendezSessions.d.ts.map +1 -1
  336. package/dist/services/rendezSessions.js +17 -3
  337. package/dist/services/rendezSessions.js.map +1 -1
  338. package/dist/sessions/codex-reader.d.ts.map +1 -1
  339. package/dist/sessions/codex-reader.js +9 -2
  340. package/dist/sessions/codex-reader.js.map +1 -1
  341. package/dist/sessions/codex-rollout-window.d.ts +2 -0
  342. package/dist/sessions/codex-rollout-window.d.ts.map +1 -1
  343. package/dist/sessions/codex-rollout-window.js +1 -0
  344. package/dist/sessions/codex-rollout-window.js.map +1 -1
  345. package/dist/storage/discovery-sqlite.d.ts.map +1 -1
  346. package/dist/storage/discovery-sqlite.js +2 -0
  347. package/dist/storage/discovery-sqlite.js.map +1 -1
  348. package/dist/storage/migrations/012-issue-content.d.ts +3 -0
  349. package/dist/storage/migrations/012-issue-content.d.ts.map +1 -0
  350. package/dist/storage/migrations/012-issue-content.js +14 -0
  351. package/dist/storage/migrations/012-issue-content.js.map +1 -0
  352. package/dist/supervisor/Process.d.ts +10 -1
  353. package/dist/supervisor/Process.d.ts.map +1 -1
  354. package/dist/supervisor/Process.js +22 -0
  355. package/dist/supervisor/Process.js.map +1 -1
  356. package/package.json +5 -5
  357. package/client-dist/assets/App-BIHEvA6Q.js +0 -2
  358. package/client-dist/assets/AppearanceSettings-CDplyLIJ.js +0 -2
  359. package/client-dist/assets/FileViewer-Crw6E_2M.js +0 -63
  360. package/client-dist/assets/FloatingActionButton-BMjNa4vb.js +0 -1
  361. package/client-dist/assets/IssueSettings-BLIuCNxO.css +0 -1
  362. package/client-dist/assets/IssueSettings-Dr6JKfQf.js +0 -1
  363. package/client-dist/assets/IssuesPage-DOfq79D-.css +0 -1
  364. package/client-dist/assets/IssuesPage-QmPw-DCB.js +0 -1
  365. package/client-dist/assets/LocalMediaModal-5au-Ku3n.js +0 -14
  366. package/client-dist/assets/LocalSourcePage-YurHSY4M.js +0 -1
  367. package/client-dist/assets/MessageDeliverySettings-D2fzmys9.js +0 -4
  368. package/client-dist/assets/MessageInput-BUZmOeKI.js +0 -7
  369. package/client-dist/assets/MessageList-CJgDrWOy.js +0 -4
  370. package/client-dist/assets/NewSessionForm-4104gBMd.js +0 -9
  371. package/client-dist/assets/NewSessionPage-AzsvU8Mk.js +0 -2
  372. package/client-dist/assets/ProjectAppPage-CoxqMJ-6.js +0 -1
  373. package/client-dist/assets/ProjectAppViewer-D5Juq0Mx.css +0 -1
  374. package/client-dist/assets/ProjectAppViewer-D_8Lq6Oy.js +0 -1
  375. package/client-dist/assets/ProviderChildSessionPage-CrSrF2ST.js +0 -1
  376. package/client-dist/assets/SessionPage-DjR-n2cx.js +0 -50
  377. package/client-dist/assets/SpeechSettings-CObFsnUu.js +0 -2
  378. package/client-dist/assets/ToolbarSettings-CyhCBLrg.js +0 -1
  379. package/client-dist/assets/ViewerWindowActions-DM1Jwlo9.js +0 -1
  380. package/client-dist/assets/VoiceInputButton-jq6m-rwS.js +0 -1
  381. package/client-dist/assets/YaServerProvider-fGtUHCJb.js +0 -1
  382. package/client-dist/assets/channel-BMLLCpix.js +0 -1
  383. package/client-dist/assets/classDiagram-ZZMXUADV-CriLRYaG.js +0 -1
  384. package/client-dist/assets/classDiagram-v2-VYDZK3BY-CriLRYaG.js +0 -1
  385. package/client-dist/assets/index-C-4wHkcA.js +0 -46
  386. package/client-dist/assets/index-D73NQkRu.js +0 -1
  387. package/client-dist/assets/main-BpQ_EIjC.js +0 -43
  388. package/client-dist/assets/mermaid.core-CnOzO4__.js +0 -312
  389. package/client-dist/assets/sessionVhostApps-DJY4ZLda.js +0 -1
  390. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-D-_jRHCc.js +0 -1
  391. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-CMY1RzMZ.js +0 -8
  392. package/client-dist/assets/useDocumentTitle-CeauK1Xu.js +0 -1
  393. package/client-dist/assets/useGeneratedTitleLength-0cRz1f9b.js +0 -1
  394. package/client-dist/assets/useSessionRightPaneSetting-BOgcH2kB.js +0 -1
@@ -1 +1 @@
1
- var se=Object.defineProperty;var te=(i,e,s)=>e in i?se(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s;var h=(i,e,s)=>te(i,typeof e!="symbol"?e+"":e,s);import{Q as ie,d as re,r as C,j as n}from"./clientSummaryStore-Cr4yWo-Y.js";import{aV as G,aW as T,aX as ne,aY as oe,aZ as ae,a_ as H,a$ as ce,b0 as le,b1 as ue,b as X,aC as de,u as Q,L as S}from"./main-BpQ_EIjC.js";import{m as he,D as pe}from"./remoteRoutePaths-Crh_32jX.js";import{s as z,S as K,al as me}from"./index-C-4wHkcA.js";import{S as F,o as Z}from"./SecureConnection-DwcGBdlV.js";import{r as fe}from"./relayEndpoints-CLXUImOr.js";import"./react-runtime-D-UPQ57m.js";import"./relay-url-j3kYm5KO.js";const ye="client-mux-v1",P=1,U=6,B=1;class N extends Error{constructor(e,s){super(e),this.circuitId=s,this.name="RelayMuxFrameError"}}function R(i){return typeof i=="number"&&Number.isSafeInteger(i)&&i>0&&i<=4294967295}function $(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_ready"&&e.protocolVersion===P&&typeof e.maxCircuits=="number"&&Number.isSafeInteger(e.maxCircuits)&&e.maxCircuits>0&&typeof e.maxFrameBytes=="number"&&Number.isSafeInteger(e.maxFrameBytes)&&e.maxFrameBytes>0}function we(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_opened"&&R(e.circuitId)}function ve(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_error"&&R(e.circuitId)&&(e.reason==="unknown_username"||e.reason==="server_offline"||e.reason==="circuit_limit"||e.reason==="rate_limited"||e.reason==="invalid_request")}function ge(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_closed"&&R(e.circuitId)&&(e.reason==="client_closed"||e.reason==="server_closed"||e.reason==="relay_closed")}function be(i,e,s){if(!R(i))throw new N("Invalid relay mux circuit id");const t=new Uint8Array(U+e.byteLength);return t[0]=P,t[1]=s?B:0,new DataView(t.buffer).setUint32(2,i,!1),t.set(e,U),t}function xe(i){const e=i instanceof Uint8Array?i:new Uint8Array(i);if(e.byteLength<U)throw new N("Relay mux data frame is too short");const t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2,!1);if(e[0]!==P)throw new N("Unsupported relay mux frame version",t||void 0);const r=e[1]??0;if((r&~B)!==0)throw new N("Invalid relay mux frame flags",t||void 0);if(!R(t))throw new N("Invalid relay mux circuit id");return{circuitId:t,isBinary:(r&B)!==0,payload:e.subarray(U)}}function W(i,e){const s=e?`/projects/${encodeURIComponent(e.projectId)}/sessions/${encodeURIComponent(e.id)}`:"";if(i.mode==="local")return s||"/projects";if(i.mode==="relay")return i.relayUsername?`${he(i.relayUsername)}${s}`:null;if(!i.wsUrl)return null;try{const t=new URL(i.wsUrl);return!["ws:","wss:"].includes(t.protocol)||t.username||t.password||!/\/api\/ws\/?$/.test(t.pathname)?null:(t.protocol=t.protocol==="wss:"?"https:":"http:",t.pathname=`${t.pathname.replace(/\/api\/ws\/?$/,"")}${s||"/"}`,t.search="",t.hash="",t.toString())}catch{return null}}function _e(i){return!z(i,K.experimentalConversation)||typeof i.experimentalSimpleClientApiRevision!="string"?"update-required":i.experimentalSimpleClientApiRevision===G?"available":"revision-mismatch"}class Ce{constructor(e,s,t){h(this,"sequence",-1);h(this,"closed",!1);if(this.sourceId=e,this.subscriptionId=s,this.sessionId=t,T.parse(s),T.parse(t),!e)throw new Error("Conversation requires a source binding")}close(){this.closed=!0}accept(e,s){if(this.closed||e!==this.sourceId)return null;const t=ne(s);if(t.subscriptionId!==this.subscriptionId||t.sequence<=this.sequence)return null;if(t.view.kind==="conversation"&&t.view.sessionId!==this.sessionId)throw new Error("Conversation session mismatch");return this.sequence=t.sequence,t}}function Se(i,e){oe.parse(i),T.parse(e);const s=new URLSearchParams({apiRevision:G,subscriptionId:e,sessionId:i.sessionId,maxMessages:String(i.maxMessages)});return i.anchorMessageId!==null&&s.set("anchorMessageId",i.anchorMessageId),`/api/experimental/conversation?${s}`}class M extends Error{constructor(e){super(e),this.name="MultiHostSignInRequiredError"}}function Y(i){if(i instanceof M)return!0;const e=ie(i);if(e)return e.kind==="rejected"||e.kind==="incompatible";const t=(i instanceof Error?i.message:String(i)).toLowerCase();return t.includes("authentication")||t.includes("invalid_identity")||t.includes("resume_incompatible")||t.includes("session invalid")||t.includes("session resume")||t.includes("unauthorized")}const je={begin:(i,e)=>H(()=>le(ue(i),e)),isCurrent:ae,commit:(i,e,s)=>H(()=>{ce(i,e,s)})};async function Ie(i,e,s,t,r=je){e.throwIfAborted();const o=i.session;if(!o)throw new M("A saved session is required");e.throwIfAborted();const a=await r.begin(i,o);e.throwIfAborted();const c={onDisconnect:t,isAttemptCurrent:()=>!e.aborted&&r.isCurrent(a),onSessionEstablished:async(d,y)=>{e.aborted||await r.commit(a,d,y)}};if(i.mode==="direct"){if(!i.wsUrl)throw new M("The saved direct host has no WebSocket URL");const d=F.forResumeOnly(o,c),y=()=>d.close();e.addEventListener("abort",y,{once:!0});try{return await d.fetch("/auth/status"),e.throwIfAborted(),d}catch(v){throw d.close(),v}finally{e.removeEventListener("abort",y)}}if(!i.relayUrl||!i.relayUsername)throw new M("The saved relay host is incomplete");const f=await(s??Z)({relayUrl:i.relayUrl,relayUsername:i.relayUsername,signal:e});e.aborted&&(f.close(),e.throwIfAborted());const m=()=>f.close();e.addEventListener("abort",m,{once:!0});try{const d=await F.forResumeOnlyWithSocket(f,o,c,{relayUrl:i.relayUrl,relayUsername:i.relayUsername,openSocket:s});return await d.fetch("/auth/status"),e.throwIfAborted(),d}catch(d){throw f.close(),d}finally{e.removeEventListener("abort",m)}}const Ee=async(i,e)=>{if(i.mode!=="local")throw new Error("Expected a local preview source");e.throwIfAborted();const s=new AbortController,t=new Set,r=()=>{s.abort();for(const o of t)o.close();t.clear(),e.removeEventListener("abort",r)};return e.addEventListener("abort",r,{once:!0}),{close:r,async fetch(o,a){try{return await me(o,{...a,signal:a!=null&&a.signal?AbortSignal.any([s.signal,a.signal]):s.signal},{onLoginRequired:()=>{}})}catch(c){throw(c==null?void 0:c.status)===401?new M("Authentication required"):c}},subscribeConversation(o,a,c){s.signal.throwIfAborted();const p=Se(a,o).replace("/conversation?","/conversation/subscribe?"),f=new EventSource(p);t.add(f);let m=!1;const d=()=>{m=!0,f.close(),t.delete(f)};return f.onopen=()=>{var y;!m&&!s.signal.aborted&&((y=c.onOpen)==null||y.call(c))},f.addEventListener("snapshot",y=>{var v;if(!(m||s.signal.aborted))try{c.onEvent("snapshot",void 0,JSON.parse(y.data))}catch(x){d(),(v=c.onError)==null||v.call(c,x instanceof Error?x:new Error("Invalid snapshot"))}}),f.onerror=()=>{var y;m||s.signal.aborted||(d(),(y=c.onError)==null||y.call(c,new Error("Conversation stream disconnected")))},{close:d}}}},Ne=2e3,Me=5e3,Oe=3e4,Re=2*1024*1024,ke=8*1024*1024,Ae=1024*1024,Le=10,Ue=5,J=0,L=1,V=2,A=3;class q extends Error{constructor(e){super(e),this.reason=e,this.name="RelayMuxCircuitOpenError"}}function O(){return new DOMException("Relay connection aborted","AbortError")}function Te(i){return typeof i=="string"?{bytes:new TextEncoder().encode(i),isBinary:!1}:i instanceof ArrayBuffer?{bytes:new Uint8Array(i),isBinary:!0}:{bytes:new Uint8Array(i.buffer,i.byteOffset,i.byteLength),isBinary:!0}}class Be{constructor(e,s){h(this,"binaryType","arraybuffer");h(this,"onclose",null);h(this,"onerror",null);h(this,"onmessage",null);h(this,"state",J);this.physical=e,this.circuitId=s}get bufferedAmount(){return this.physical.bufferedAmount}get readyState(){return this.state}markOpen(){this.state===J&&(this.state=L)}receive(e,s){var r;if(this.state!==L)return;const t=s?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):new TextDecoder().decode(e);(r=this.onmessage)==null||r.call(this,new MessageEvent("message",{data:t}))}remoteClose(e,s){var t;this.state!==A&&(this.state=A,(t=this.onclose)==null||t.call(this,new CloseEvent("close",{code:e,reason:s,wasClean:e===1e3})))}fail(e){var s;this.state!==A&&((s=this.onerror)==null||s.call(this,new Event("error")),this.physical.closeCircuit(this.circuitId,e))}send(e){if(this.state!==L)throw new DOMException("WebSocket is not open","InvalidStateError");const s=Te(e);this.physical.sendCircuitData(this.circuitId,s.bytes,s.isBinary)}close(e=1e3,s=""){this.state===V||this.state===A||(this.state=V,this.physical.requestCircuitClose(this.circuitId,e,s))}}class D{constructor(e,s){h(this,"circuits",new Map);h(this,"pending",new Map);h(this,"queues",new Map);h(this,"queuedBytesByCircuit",new Map);h(this,"queuedBytes",0);h(this,"circuitOrder",[]);h(this,"drainCursor",0);h(this,"drainScheduled",!1);h(this,"drainTimer",null);h(this,"nextCircuitId",1);h(this,"maxFrameBytes",0);h(this,"maxCircuits",0);h(this,"closed",!1);this.ws=e,this.onPhysicalClose=s}static connect(e,s,t){return new Promise((r,o)=>{const a=s(e);a.binaryType="arraybuffer";const c=new D(a,t);let p=!1;const f=setTimeout(()=>{p||(p=!0,a.close(),o(new Error("Relay mux ready timeout")))},Me);a.onmessage=m=>{if(!p&&typeof m.data=="string")try{const d=JSON.parse(m.data);if($(d)){p=!0,clearTimeout(f),c.maxCircuits=d.maxCircuits,c.maxFrameBytes=d.maxFrameBytes,r(c);return}}catch{}c.handleMessage(m)},a.onerror=()=>{p||(p=!0,clearTimeout(f),o(new Error("Failed to connect to relay mux")))},a.onclose=m=>{clearTimeout(f),c.handleClose(m),p||(p=!0,o(new Error("Relay mux closed before ready")))}})}get bufferedAmount(){return this.ws.bufferedAmount}get isOpen(){return!this.closed&&this.ws.readyState===L}async openCircuit(e,s,t){if(!this.isOpen)throw new Error("Relay mux is not connected");if(this.circuits.size+this.pending.size>=this.maxCircuits)throw new q("circuit_limit");const r=this.allocateCircuitId(),o=new Be(this,r);return new Promise((a,c)=>{const p=()=>{this.pending.delete(r),clearTimeout(f),this.sendControl({type:"mux_close",circuitId:r}),o.remoteClose(1e3,"Relay connection aborted"),c(O())},f=setTimeout(()=>{this.pending.delete(r),t==null||t.removeEventListener("abort",p),this.sendControl({type:"mux_close",circuitId:r}),o.remoteClose(1006,"Waiting for relay circuit timed out"),c(new Error("Waiting for relay circuit timed out"))},Oe),m={socket:o,timeout:f,resolve:d=>{t==null||t.removeEventListener("abort",p),a(d)},reject:d=>{t==null||t.removeEventListener("abort",p),c(d)}};if(this.pending.set(r,m),t!=null&&t.aborted){p();return}t==null||t.addEventListener("abort",p,{once:!0}),this.sendControl({type:"mux_open",circuitId:r,username:e,channel:s})})}sendCircuitData(e,s,t){const r=this.circuits.get(e);if(!r||!this.isOpen)throw new DOMException("WebSocket is not open","InvalidStateError");if(s.byteLength>this.maxFrameBytes)throw r.fail("Relay mux frame is too large"),new DOMException("Relay mux frame is too large","QuotaExceededError");const o=be(e,s,t),a=this.queuedBytesByCircuit.get(e)??0;if(a+o.byteLength>Re||this.queuedBytes+o.byteLength>ke)throw r.fail("Relay mux queue overflow"),new DOMException("Relay mux queue overflow","QuotaExceededError");let c=this.queues.get(e);c||(c=[],this.queues.set(e,c),this.circuitOrder.push(e)),c.push({bytes:o,circuitId:e}),this.queuedBytesByCircuit.set(e,a+o.byteLength),this.queuedBytes+=o.byteLength,this.scheduleDrain(!1)}requestCircuitClose(e,s,t){if(this.circuits.has(e)){if(!this.isOpen){this.removeCircuit(e,1006,"Relay mux disconnected");return}this.sendControl({type:"mux_close",circuitId:e})}}closeCircuit(e,s){this.circuits.has(e)&&(this.isOpen&&this.sendControl({type:"mux_close",circuitId:e}),this.removeCircuit(e,1008,s))}close(){this.closed||this.ws.close(1e3,"Mux pool disposed")}handleMessage(e){var s;if(typeof e.data=="string"){let t;try{t=JSON.parse(e.data)}catch{this.ws.close(1008,"Invalid relay mux control");return}if(we(t)){const r=this.pending.get(t.circuitId);if(!r){this.sendControl({type:"mux_close",circuitId:t.circuitId});return}this.pending.delete(t.circuitId),clearTimeout(r.timeout),r.socket.markOpen(),this.circuits.set(t.circuitId,r.socket),r.resolve(r.socket);return}if(ve(t)){const r=this.pending.get(t.circuitId);if(!r)return;this.pending.delete(t.circuitId),clearTimeout(r.timeout),r.socket.remoteClose(1008,t.reason),r.reject(new q(t.reason));return}if(ge(t)){this.removeCircuit(t.circuitId,1e3,t.reason);return}if($(t))return;this.ws.close(1008,"Unexpected relay mux control");return}if(!(e.data instanceof ArrayBuffer)){this.ws.close(1008,"Invalid relay mux data");return}try{const t=xe(e.data);if(t.payload.byteLength>this.maxFrameBytes){this.closeCircuit(t.circuitId,"Relay mux frame is too large");return}(s=this.circuits.get(t.circuitId))==null||s.receive(t.payload,t.isBinary)}catch{this.ws.close(1008,"Invalid relay mux data")}}handleClose(e){if(!this.closed){this.closed=!0,this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null);for(const s of this.pending.values())clearTimeout(s.timeout),s.socket.remoteClose(e.code,e.reason),s.reject(new Error(e.reason||"Relay mux disconnected"));this.pending.clear();for(const s of this.circuits.keys())this.removeCircuit(s,e.code||1006,e.reason||"Relay mux disconnected");this.onPhysicalClose()}}removeCircuit(e,s,t){const r=this.circuits.get(e);if(!r)return;this.circuits.delete(e);const o=this.queuedBytesByCircuit.get(e)??0;this.queuedBytes-=o,this.queuedBytesByCircuit.delete(e),this.queues.delete(e),this.circuitOrder=this.circuitOrder.filter(a=>a!==e),r.remoteClose(s,t)}sendControl(e){if(!this.isOpen)throw new Error("Relay mux is not connected");this.ws.send(JSON.stringify(e))}allocateCircuitId(){for(let e=0;e<4294967295;e+=1){const s=this.nextCircuitId;if(this.nextCircuitId=this.nextCircuitId===4294967295?1:this.nextCircuitId+1,!this.pending.has(s)&&!this.circuits.has(s))return s}throw new Error("Relay mux circuit ids exhausted")}scheduleDrain(e){if(!(this.closed||this.drainScheduled||this.drainTimer)){if(e){this.drainTimer=setTimeout(()=>{this.drainTimer=null,this.drain()},Le);return}this.drainScheduled=!0,queueMicrotask(()=>{this.drainScheduled=!1,this.drain()})}}drain(){if(this.isOpen){for(;this.queuedBytes>0&&this.ws.bufferedAmount<=Ae;){const e=this.nextQueuedFrame();if(!e)break;this.ws.send(e.bytes)}this.queuedBytes>0&&this.scheduleDrain(!0)}}nextQueuedFrame(){if(this.circuitOrder.length===0)return null;for(let e=0;e<this.circuitOrder.length;e+=1){const s=(this.drainCursor+e)%this.circuitOrder.length,t=this.circuitOrder[s];if(t===void 0)continue;const r=this.queues.get(t);if(!r)continue;const o=r.shift();if(!o)continue;this.drainCursor=(s+1)%this.circuitOrder.length;const a=(this.queuedBytesByCircuit.get(t)??o.bytes.byteLength)-o.bytes.byteLength;return this.queuedBytesByCircuit.set(t,a),this.queuedBytes-=o.bytes.byteLength,r.length===0&&(this.queues.delete(t),this.circuitOrder=this.circuitOrder.filter(c=>c!==t)),o}return null}}class qe{constructor(e,s){h(this,"discovery",null);h(this,"physical",null);h(this,"physicalOpening",null);h(this,"degraded",!1);h(this,"disposed",!1);h(this,"lifetime",new AbortController);this.endpoints=e,this.options=s}async open(e){if(this.disposed)throw O();const s=this.degraded?!1:await this.discover();if(this.disposed)throw O();if(this.degraded||!s)return this.options.openLegacySocket(e);let t;try{t=await this.ensurePhysical()}catch(r){if(this.disposed||r instanceof DOMException&&r.name==="AbortError")throw r;return this.degraded=!0,this.options.openLegacySocket(e)}try{return await t.openCircuit(e.relayUsername,e.channel??pe,e.signal)}catch(r){if(r instanceof q||r instanceof DOMException&&r.name==="AbortError")throw r;return this.degraded=!0,this.options.openLegacySocket(e)}}dispose(){var e;this.disposed||(this.disposed=!0,this.lifetime.abort(),(e=this.physical)==null||e.close(),this.physical=null)}discover(){return this.discovery?this.discovery:(this.discovery=this.runDiscovery(),this.discovery)}async runDiscovery(){const e=new AbortController,s=setTimeout(()=>e.abort(),Ne),t=()=>e.abort();this.lifetime.signal.addEventListener("abort",t,{once:!0});try{const r=await this.options.fetch(this.endpoints.healthUrl,{signal:e.signal});if(!r.ok)return!1;const o=await r.json();return Array.isArray(o.relayCapabilities)&&o.relayCapabilities.includes(ye)}catch{return!1}finally{clearTimeout(s),this.lifetime.signal.removeEventListener("abort",t)}}ensurePhysical(){var r;if((r=this.physical)!=null&&r.isOpen)return Promise.resolve(this.physical);if(this.physicalOpening)return this.physicalOpening;let e=null;const t=D.connect(this.endpoints.muxUrl,this.options.createWebSocket,()=>{this.physical===e&&(this.physical=null)}).then(o=>{if(e=o,this.disposed)throw o.close(),O();return this.physical=o,o}).finally(()=>{this.physicalOpening===t&&(this.physicalOpening=null)});return this.physicalOpening=t,t}}class Pe{constructor(e,s={}){h(this,"eligibleHostIds",new Set);h(this,"groups",new Map);h(this,"endpointsByHostId",new Map);h(this,"options");h(this,"disposed",!1);var o;const t=s.fetch??fetch;this.options={createWebSocket:s.createWebSocket??(a=>new WebSocket(a)),fetch:(a,c)=>t(a,c),openLegacySocket:s.openLegacySocket??Z};const r=new Map;for(const a of e){if(a.mode!=="relay"||!a.session||!a.relayUrl||!a.relayUsername)continue;const c=fe(a.relayUrl);if(!c)continue;let p=r.get(c.key);p||(p=[],r.set(c.key,p)),p.push({endpoints:c,host:a})}for(const[a,c]of r){if(c.length<2)continue;const p=c.slice(0,Ue),f=(o=p[0])==null?void 0:o.endpoints;if(f){this.groups.set(a,new qe(f,this.options));for(const{host:m,endpoints:d}of p)this.eligibleHostIds.add(m.id),this.endpointsByHostId.set(m.id,d)}}}createSocketFactory(e){return s=>this.open(e,s)}dispose(){if(!this.disposed){this.disposed=!0;for(const e of this.groups.values())e.dispose();this.groups.clear()}}open(e,s){if(this.disposed)return Promise.reject(O());if(!this.eligibleHostIds.has(e.id))return this.options.openLegacySocket(s);const t=this.endpointsByHostId.get(e.id),r=t?this.groups.get(t.key):void 0;return(r==null?void 0:r.open(s))??this.options.openLegacySocket(s)}}class De{constructor(e,s,t=null){h(this,"state");h(this,"listeners",new Set);h(this,"owners",new Map);h(this,"stream");h(this,"binding");h(this,"disposed",!1);h(this,"pool");h(this,"connect");h(this,"getSnapshot",()=>this.state);h(this,"subscribe",e=>(this.listeners.add(e),()=>this.listeners.delete(e)));this.state={sources:e.map(r=>({host:r,status:"excluded",sessions:[],hasMore:!1,updatedAt:null,issueCoverage:"unsupported"})),selection:t,view:null,conversationStatus:"empty",maxMessages:20,anchorMessageId:null},s||(this.pool=new Pe(e.filter(r=>r.mode!=="local"))),this.connect=s??((r,o,a)=>{var c;if(r.mode==="local")throw new Error("Local source requires a local connector");return Ie(r,o,r.mode==="relay"?(c=this.pool)==null?void 0:c.createSocketFactory(r):void 0,a)})}publish(e={}){if(!this.disposed){this.state={...this.state,...e};for(const s of this.listeners)s()}}source(e,s){this.publish({sources:this.state.sources.map(t=>t.host.id===e?{...t,...s}:t)})}closeStream(){var s;(s=this.binding)==null||s.close(),this.binding=void 0;const e=this.stream;this.stream=void 0,e==null||e.close()}stopSource(e){var t,r;const s=this.owners.get(e);this.owners.delete(e),s==null||s.abort.abort(),(t=s==null?void 0:s.connection)==null||t.close(),((r=this.state.selection)==null?void 0:r.sourceId)===e&&this.closeStream()}include(e,s){var c,p;if(this.disposed)return;if(this.stopSource(e),!s){this.source(e,{status:"excluded",sessions:[],updatedAt:null}),((c=this.state.selection)==null?void 0:c.sourceId)===e&&this.publish({selection:null,view:null,conversationStatus:"empty"});return}const t=this.state.sources.find(f=>f.host.id===e);if(!t)return;const r={abort:new AbortController};this.owners.set(e,r);const o=()=>!this.disposed&&this.owners.get(e)===r&&!r.abort.signal.aborted,a=f=>{var m;o()&&(this.stopSource(e),this.source(e,{status:Y(f)?"sign-in-required":"offline"}),((m=this.state.selection)==null?void 0:m.sourceId)===e&&this.publish({conversationStatus:"offline"}))};this.source(e,{status:"connecting",issueCoverage:"unsupported"}),((p=this.state.selection)==null?void 0:p.sourceId)===e&&this.publish({conversationStatus:"loading"}),(async()=>{var f,m,d;try{const y=await this.connect(t.host,r.abort.signal,a);if(!o()){y.close();return}r.connection=y;const v=await y.fetch("/version");if(!o())return;const x=_e(v);if(x!=="available"){this.stopSource(e),this.source(e,{status:x}),((f=this.state.selection)==null?void 0:f.sourceId)===e&&this.publish({conversationStatus:"offline"});return}const j=await y.fetch("/sessions?limit=50");if(!o())return;const I=j.sessions.slice(0,50).map(b=>({id:b.id,title:b.customTitle||b.title||b.fullTitle||b.id,projectId:b.projectId,projectName:b.projectName,updatedAt:b.updatedAt,issues:[]}));if(this.source(e,{status:"ready",sessions:I,hasMore:j.hasMore,updatedAt:Date.now()}),((m=this.state.selection)==null?void 0:m.sourceId)===e&&this.openConversation(),z(v,K.issueSessionAssociations))try{const b=await y.fetch("/issues/settings");if(!o())return;if(!b.settings.enabled){this.source(e,{issueCoverage:"disabled"});return}this.source(e,{issueCoverage:"partial"});let k=0,E=!1;const l=new Map;await Promise.all(Array.from({length:3},async()=>{for(;o()&&!E;){const w=I[k++];if(!w)return;const g=await y.fetch(`/issues?sessionId=${encodeURIComponent(w.id)}&limit=10`).catch(_=>{throw E=!0,_});if(!o())return;l.set(w.id,g.items.map(_=>({id:_.id,key:_.key})))}})),o()&&this.source(e,{sessions:I.map(w=>({...w,issues:l.get(w.id)??[]}))})}catch{o()&&this.source(e,{issueCoverage:"unavailable"})}}catch(y){if(!o())return;this.stopSource(e),this.source(e,{status:Y(y)?"sign-in-required":"offline"}),((d=this.state.selection)==null?void 0:d.sourceId)===e&&this.publish({conversationStatus:"offline"})}})()}select(e,s){this.closeStream(),this.publish({selection:{sourceId:e,sessionId:s},view:null,maxMessages:20,anchorMessageId:null}),this.openConversation()}more(){var s;const e=this.state.view;this.publish({maxMessages:Math.min(100,this.state.maxMessages+20),anchorMessageId:(e==null?void 0:e.kind)==="conversation"?((s=e.messages.at(-1))==null?void 0:s.id)??null:null}),this.openConversation()}latest(){this.publish({anchorMessageId:null}),this.openConversation()}openConversation(){var f;this.closeStream();const e=this.state.selection;if(!e)return;const s=(f=this.owners.get(e.sourceId))==null?void 0:f.connection,t=this.state.sources.find(m=>m.host.id===e.sourceId);if(!s||(t==null?void 0:t.status)!=="ready"){this.publish({conversationStatus:"offline"});return}const r=new Ce(e.sourceId,re(),e.sessionId);this.binding=r;const o=()=>this.binding===r&&!this.disposed;this.publish({conversationStatus:"loading"});const a={sessionId:e.sessionId,maxMessages:this.state.maxMessages,anchorMessageId:this.state.anchorMessageId},c=()=>{o()&&(this.closeStream(),this.publish({conversationStatus:"offline"}))},p={onEvent:(m,d,y)=>{if(o()){if(m==="closed"){c();return}if(m==="snapshot")try{const v=r.accept(e.sourceId,JSON.stringify(y));v&&this.publish({view:v.view,conversationStatus:"ready"})}catch{this.closeStream(),this.publish({conversationStatus:"invalid"})}}},onClose:c,onError:c};try{const m=s.subscribeConversation(r.subscriptionId,a,p);o()?this.stream=m:m.close()}catch{c()}}dispose(){var e;if(!this.disposed){this.disposed=!0,this.closeStream();for(const s of[...this.owners.keys()])this.stopSource(s);(e=this.pool)==null||e.dispose(),this.listeners.clear()}}}function He(i,e){if(e==="none"){const t=i.filter(o=>o.status!=="excluded").flatMap(o=>o.sessions.map(a=>({source:o,session:a}))),r=o=>{const a=Date.parse(o.session.updatedAt);return Number.isFinite(a)?a:Number.NEGATIVE_INFINITY};return t.sort((o,a)=>r(a)-r(o)||0),t.length?[{id:"none",label:null,sourceName:null,rows:t}]:[]}const s=new Map;for(const t of i)if(t.status!=="excluded")for(const r of t.sessions){const o=e==="issue"&&r.issues.length>0?r.issues.map(a=>({id:JSON.stringify(["issue",a.id]),label:a.key,sourceName:null})):[{id:JSON.stringify([e,t.host.id,e==="project"?r.projectId:null]),label:e==="machine"?t.host.displayName:e==="project"?r.projectName:null,sourceName:e==="machine"?null:t.host.displayName}];for(const a of o){const c=s.get(a.id)??{...a,rows:[]};c.rows.push({source:t,session:r}),s.set(a.id,c)}}return[...s.values()]}const Fe="_page_moj47_1",$e="_topbar_moj47_20",We="_muted_moj47_32",Ye="_control_moj47_37",Je="_workspace_moj47_58",Ve="_sidebar_moj47_64",Ge="_sources_moj47_70",Xe="_sectionHeading_moj47_74",Qe="_source_moj47_70",ze="_sourceDetail_moj47_105",Ke="_localSource_moj47_122",Ze="_groupControl_moj47_131",es="_groups_moj47_149",ss="_session_moj47_166",ts="_main_moj47_202",is="_empty_moj47_208",rs="_conversationHeader_moj47_221",ns="_actions_moj47_235",os="_badge_moj47_246",as="_transcript_moj47_251",cs="_history_moj47_258",ls="_message_moj47_270",us="_prose_moj47_286",ds="_activity_moj47_290",hs="_failure_moj47_300",ps="_notice_moj47_308",ms="_mobileToggle_moj47_319",u={page:Fe,topbar:$e,muted:We,control:Ye,workspace:Je,sidebar:Ve,sources:Ge,sectionHeading:Xe,source:Qe,sourceDetail:ze,localSource:Ke,groupControl:Ze,groups:es,session:ss,main:ts,empty:is,conversationHeader:rs,actions:ns,badge:os,transcript:as,history:cs,message:ls,prose:us,activity:ds,failure:hs,notice:ps,mobileToggle:ms},fs={excluded:"preview.status.excluded",connecting:"preview.status.connecting",ready:"preview.status.ready",offline:"preview.status.offline","sign-in-required":"preview.status.signIn","update-required":"preview.status.update","revision-mismatch":"preview.status.revision"},ee="yep-experimental-preview-sources";function ys({content:i}){const{t:e}=Q();switch(i.kind){case"text":return n.jsx("div",{className:u.prose,children:i.text});case"activity":return n.jsxs("div",{className:u.activity,children:[n.jsx("p",{children:i.summary}),n.jsx("small",{children:e(i.toolCount===1?"preview.toolOne":"preview.tools",{count:i.toolCount,failed:i.failedToolCount})})]});case"failure":return n.jsxs("div",{className:u.failure,children:[n.jsx("strong",{children:i.toolName}),n.jsx("p",{children:i.message})]});case"media":return n.jsx("div",{className:u.activity,children:e("preview.media",{description:i.description||e("preview.attachment")})});default:return n.jsx("p",{className:u.notice,children:e("preview.unknown")})}}function ws({controller:i,local:e}){var b,k,E;const{t:s}=Q(),t=C.useSyncExternalStore(i.subscribe,i.getSnapshot),[r,o]=X(),[a,c]=C.useState(e?"none":"machine"),[p,f]=C.useState(!t.selection),m=C.useMemo(()=>He(t.sources,a),[t.sources,a]),d=t.sources.find(l=>{var w;return l.host.id===((w=t.selection)==null?void 0:w.sourceId)}),y=d==null?void 0:d.sessions.find(l=>{var w;return l.id===((w=t.selection)==null?void 0:w.sessionId)}),v=((b=t.view)==null?void 0:b.kind)==="conversation"?t.view:null,x=t.conversationStatus==="loading",j=d?W(d.host,y):null;function I(l,w){i.include(l,w);try{localStorage.setItem(ee,JSON.stringify(i.getSnapshot().sources.filter(g=>g.status!=="excluded").map(g=>g.host.id)))}catch{}i.getSnapshot().selection||o({},{replace:!0})}return n.jsxs("div",{className:u.page,children:[n.jsxs("header",{className:u.topbar,children:[n.jsxs("div",{children:[n.jsx("h1",{children:s("preview.title")}),n.jsx("span",{className:u.muted,children:s("preview.subtitle")})]}),n.jsx(S,{className:u.control,to:e?"/projects":"/login",children:s("preview.fullApp")})]}),n.jsx("button",{type:"button",className:`${u.control} ${u.mobileToggle}`,"aria-expanded":p,"aria-controls":"preview-sidebar",onClick:()=>f(!p),children:s(p?"preview.hideSessions":e?"preview.sessions":"preview.showSessions")}),n.jsxs("div",{className:u.workspace,children:[n.jsxs("aside",{id:"preview-sidebar",className:u.sidebar,"data-open":p,"aria-label":s("preview.sessions"),children:[n.jsxs("section",{className:u.sources,children:[n.jsxs("div",{className:u.sectionHeading,children:[n.jsx("h2",{children:s(e?"preview.localServer":"preview.machines")}),!e&&n.jsx(S,{to:"/login",children:s("preview.addMachine")})]}),t.sources.length===0&&n.jsx("p",{className:u.muted,children:s("preview.noMachines")}),t.sources.map(l=>n.jsxs("div",{className:`${u.source} ${e?u.localSource:""}`,"data-testid":"preview-source","data-source-name":l.host.displayName,"data-source-status":l.status,children:[e?n.jsx("strong",{children:l.host.displayName}):n.jsxs("label",{children:[n.jsx("input",{type:"checkbox",checked:l.status!=="excluded",onChange:w=>I(l.host.id,w.target.checked)}),n.jsx("span",{children:l.host.displayName})]}),n.jsxs("div",{className:u.sourceDetail,children:[n.jsx("span",{children:s(fs[l.status])}),l.status!=="excluded"&&l.status!=="connecting"&&n.jsx("button",{type:"button",className:u.control,onClick:()=>i.include(l.host.id,!0),children:s("preview.refresh")})]}),l.status==="sign-in-required"&&n.jsx(S,{to:l.host.mode==="local"?"/login":l.host.mode==="relay"?`/login/relay?u=${encodeURIComponent(l.host.relayUsername??"")}&r=${encodeURIComponent(l.host.relayUrl??"")}`:"/login/direct",state:e?{from:`/-/preview${r.size?`?${r}`:""}`}:void 0,children:s("preview.signIn")}),["offline","update-required","revision-mismatch"].includes(l.status)&&n.jsx(S,{className:u.control,to:W(l.host)??(l.host.mode==="relay"?"/login/relay":"/login/direct"),children:s("preview.fullApp")}),a==="issue"&&l.status==="ready"&&n.jsx("p",{className:u.muted,children:s(`preview.issues.${l.issueCoverage}`)}),l.hasMore&&l.status==="ready"&&n.jsx("small",{className:u.muted,children:s("preview.catalogLimit")})]},l.host.id))]}),n.jsxs("label",{className:u.groupControl,children:[s("preview.groupBy"),n.jsxs("select",{value:a,onChange:l=>c(l.target.value),children:[n.jsx("option",{value:"none",children:s("preview.byNone")}),!e&&n.jsx("option",{value:"machine",children:s("preview.byMachine")}),n.jsx("option",{value:"project",children:s("preview.byProject")}),n.jsx("option",{value:"issue",children:s("preview.byIssue")})]})]}),n.jsxs("nav",{"aria-label":s("preview.sessions"),className:u.groups,children:[m.length===0&&n.jsx("p",{className:u.muted,children:s("preview.noSessions")}),m.map(l=>n.jsxs("section",{children:[a!=="none"&&n.jsxs("h3",{children:[l.label??s("preview.noIssueLinks"),n.jsx("small",{children:l.sourceName})]}),l.rows.map(({source:w,session:g})=>{var _;return n.jsxs("button",{type:"button",className:u.session,"aria-current":((_=t.selection)==null?void 0:_.sourceId)===w.host.id&&t.selection.sessionId===g.id?"true":void 0,onClick:()=>{i.select(w.host.id,g.id),o({source:w.host.id,session:g.id},{replace:!0}),f(!1)},children:[n.jsx("span",{children:g.title}),n.jsx("small",{children:e||a==="machine"?g.projectName:w.host.displayName})]},JSON.stringify([w.host.id,g.id]))})]},l.id))]})]}),n.jsx("main",{className:u.main,children:t.selection?n.jsxs(n.Fragment,{children:[n.jsxs("header",{className:u.conversationHeader,children:[n.jsxs("small",{className:u.muted,children:[d==null?void 0:d.host.displayName," · ",y==null?void 0:y.projectName]}),n.jsx("h2",{children:(y==null?void 0:y.title)??t.selection.sessionId}),n.jsxs("div",{className:u.actions,children:[n.jsx("span",{className:u.badge,children:s("preview.readOnlyBadge")}),v&&n.jsx("span",{children:s(`preview.activity.${v.activity}`)}),j?n.jsx(S,{className:u.control,to:j,children:s("preview.openFull")}):n.jsx(S,{className:u.control,to:"/login/direct",children:s("preview.fullApp")})]})]}),n.jsxs("div",{className:u.transcript,"data-testid":"preview-conversation",children:[x&&n.jsx("p",{role:"status",className:u.notice,children:s("preview.loading")}),t.conversationStatus==="offline"&&n.jsxs("div",{role:"status",className:u.notice,children:[n.jsx("p",{children:s("preview.disconnected")}),d&&n.jsx("button",{className:u.control,type:"button",onClick:()=>i.include(d.host.id,!0),children:s("preview.reconnect")})]}),t.conversationStatus==="invalid"&&n.jsx("p",{role:"alert",className:u.notice,children:s("preview.invalid")}),((k=t.view)==null?void 0:k.kind)==="error"&&n.jsx("p",{role:"status",className:u.notice,children:s(`preview.error.${t.view.code}`)}),t.view&&t.view.kind!=="conversation"&&t.view.kind!=="error"&&n.jsx("p",{className:u.notice,children:s("preview.unknown")}),v&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:u.history,children:[n.jsx("span",{children:s(v.coverage.returnedMessages===1?"preview.messageCountOne":"preview.messageCount",{count:v.coverage.returnedMessages})}),n.jsx("button",{type:"button",className:u.control,disabled:x||t.maxMessages>=100||!v.coverage.earlierInScope||(d==null?void 0:d.status)!=="ready",onClick:()=>i.more(),children:s("preview.more")}),n.jsx("button",{type:"button",className:u.control,disabled:x||(d==null?void 0:d.status)!=="ready",onClick:()=>i.latest(),children:s("preview.latest")})]}),t.anchorMessageId&&n.jsx("p",{className:u.muted,children:s("preview.anchored")}),(!v.coverage.completeForRequest||v.coverage.earlierOutsideScope!=="no"||t.maxMessages>=100&&v.coverage.earlierInScope)&&n.jsx("p",{className:u.notice,children:s("preview.coverage")}),v.messages.length===0&&n.jsx("p",{className:u.muted,children:s("preview.emptyConversation")}),v.messages.map(l=>n.jsxs("article",{className:u.message,"data-role":l.role,children:[n.jsxs("header",{children:[n.jsx("strong",{children:s(l.role==="user"?"preview.you":"preview.agent")}),l.state!=="complete"&&n.jsx("small",{children:s(`preview.message.${l.state}`)})]}),l.content.map((w,g)=>n.jsx(ys,{content:w},`${l.id}:${g}`)),l.truncated&&n.jsx("small",{className:u.muted,children:s("preview.truncated")})]},l.id)),v.pendingRequests.map((l,w)=>n.jsxs("section",{className:u.notice,children:[n.jsx("strong",{children:s("preview.needsAttention")}),n.jsx("p",{children:l.kind==="question"?l.prompt:s("preview.unknown")}),n.jsx("small",{children:s("preview.answerInFull")})]},l.kind==="question"?l.id:`unknown:${w}`))]}),((E=t.view)==null?void 0:E.kind)==="error"&&(d==null?void 0:d.status)==="ready"&&n.jsx("button",{type:"button",className:u.control,onClick:()=>i.latest(),children:s("preview.latest")})]})]}):n.jsxs("div",{className:u.empty,children:[n.jsx("h2",{children:s("preview.welcome")}),n.jsx("p",{children:s("preview.chooseSession")}),n.jsx("p",{className:u.muted,children:s("preview.readOnly")})]})})]})]})}function Es({local:i=!1}){const[e,s]=C.useState(null),[t]=X(),[r]=C.useState(()=>(i||t.get("source"))&&t.get("session")?{sourceId:i?"local":t.get("source"),sessionId:t.get("session")}:null);return C.useEffect(()=>{const o=new De(i?[{id:"local",mode:"local",displayName:window.location.host}]:de().hosts,i?Ee:void 0,r);if(s(o),i)return o.include("local",!0),()=>o.dispose();let a=[];try{const c=JSON.parse(localStorage.getItem(ee)??"[]");Array.isArray(c)&&(a=c.filter(p=>typeof p=="string"))}catch{}r&&a.push(r.sourceId);for(const c of new Set(a))o.include(c,!0);return()=>o.dispose()},[r,i]),e?n.jsx(ws,{controller:e,local:i}):null}export{Es as ConversationPreviewPage,ys as PreviewContent};
1
+ var se=Object.defineProperty;var te=(i,e,s)=>e in i?se(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s;var h=(i,e,s)=>te(i,typeof e!="symbol"?e+"":e,s);import{Q as ie,d as re,r as C,j as n}from"./clientSummaryStore-Dsgo1zWK.js";import{aW as V,aX as T,aY as ne,aZ as oe,a_ as ae,a$ as H,b0 as ce,b1 as le,b2 as ue,b as X,aC as de,u as Q,L as S}from"./main-BX4yZXDF.js";import{m as he,D as pe}from"./remoteRoutePaths-DpabBbC6.js";import{s as z,S as K,at as me}from"./index-BhTv6hAY.js";import{S as F,o as Z}from"./SecureConnection-DeVWJw06.js";import{r as fe}from"./relayEndpoints-CLXUImOr.js";import"./react-runtime-D-UPQ57m.js";import"./relay-url-j3kYm5KO.js";const ye="client-mux-v1",P=1,U=6,B=1;class N extends Error{constructor(e,s){super(e),this.circuitId=s,this.name="RelayMuxFrameError"}}function R(i){return typeof i=="number"&&Number.isSafeInteger(i)&&i>0&&i<=4294967295}function $(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_ready"&&e.protocolVersion===P&&typeof e.maxCircuits=="number"&&Number.isSafeInteger(e.maxCircuits)&&e.maxCircuits>0&&typeof e.maxFrameBytes=="number"&&Number.isSafeInteger(e.maxFrameBytes)&&e.maxFrameBytes>0}function we(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_opened"&&R(e.circuitId)}function ve(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_error"&&R(e.circuitId)&&(e.reason==="unknown_username"||e.reason==="server_offline"||e.reason==="circuit_limit"||e.reason==="rate_limited"||e.reason==="invalid_request")}function ge(i){const e=i;return typeof i=="object"&&i!==null&&e.type==="mux_closed"&&R(e.circuitId)&&(e.reason==="client_closed"||e.reason==="server_closed"||e.reason==="relay_closed")}function be(i,e,s){if(!R(i))throw new N("Invalid relay mux circuit id");const t=new Uint8Array(U+e.byteLength);return t[0]=P,t[1]=s?B:0,new DataView(t.buffer).setUint32(2,i,!1),t.set(e,U),t}function xe(i){const e=i instanceof Uint8Array?i:new Uint8Array(i);if(e.byteLength<U)throw new N("Relay mux data frame is too short");const t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2,!1);if(e[0]!==P)throw new N("Unsupported relay mux frame version",t||void 0);const r=e[1]??0;if((r&~B)!==0)throw new N("Invalid relay mux frame flags",t||void 0);if(!R(t))throw new N("Invalid relay mux circuit id");return{circuitId:t,isBinary:(r&B)!==0,payload:e.subarray(U)}}function W(i,e){const s=e?`/projects/${encodeURIComponent(e.projectId)}/sessions/${encodeURIComponent(e.id)}`:"";if(i.mode==="local")return s||"/projects";if(i.mode==="relay")return i.relayUsername?`${he(i.relayUsername)}${s}`:null;if(!i.wsUrl)return null;try{const t=new URL(i.wsUrl);return!["ws:","wss:"].includes(t.protocol)||t.username||t.password||!/\/api\/ws\/?$/.test(t.pathname)?null:(t.protocol=t.protocol==="wss:"?"https:":"http:",t.pathname=`${t.pathname.replace(/\/api\/ws\/?$/,"")}${s||"/"}`,t.search="",t.hash="",t.toString())}catch{return null}}function _e(i){return!z(i,K.experimentalConversation)||typeof i.experimentalSimpleClientApiRevision!="string"?"update-required":i.experimentalSimpleClientApiRevision===V?"available":"revision-mismatch"}class Ce{constructor(e,s,t){h(this,"sequence",-1);h(this,"closed",!1);if(this.sourceId=e,this.subscriptionId=s,this.sessionId=t,T.parse(s),T.parse(t),!e)throw new Error("Conversation requires a source binding")}close(){this.closed=!0}accept(e,s){if(this.closed||e!==this.sourceId)return null;const t=ne(s);if(t.subscriptionId!==this.subscriptionId||t.sequence<=this.sequence)return null;if(t.view.kind==="conversation"&&t.view.sessionId!==this.sessionId)throw new Error("Conversation session mismatch");return this.sequence=t.sequence,t}}function Se(i,e){oe.parse(i),T.parse(e);const s=new URLSearchParams({apiRevision:V,subscriptionId:e,sessionId:i.sessionId,maxMessages:String(i.maxMessages)});return i.anchorMessageId!==null&&s.set("anchorMessageId",i.anchorMessageId),`/api/experimental/conversation?${s}`}class M extends Error{constructor(e){super(e),this.name="MultiHostSignInRequiredError"}}function Y(i){if(i instanceof M)return!0;const e=ie(i);if(e)return e.kind==="rejected"||e.kind==="incompatible";const t=(i instanceof Error?i.message:String(i)).toLowerCase();return t.includes("authentication")||t.includes("invalid_identity")||t.includes("resume_incompatible")||t.includes("session invalid")||t.includes("session resume")||t.includes("unauthorized")}const je={begin:(i,e)=>H(()=>le(ue(i),e)),isCurrent:ae,commit:(i,e,s)=>H(()=>{ce(i,e,s)})};async function Ie(i,e,s,t,r=je){e.throwIfAborted();const o=i.session;if(!o)throw new M("A saved session is required");e.throwIfAborted();const a=await r.begin(i,o);e.throwIfAborted();const c={onDisconnect:t,isAttemptCurrent:()=>!e.aborted&&r.isCurrent(a),onSessionEstablished:async(d,y)=>{e.aborted||await r.commit(a,d,y)}};if(i.mode==="direct"){if(!i.wsUrl)throw new M("The saved direct host has no WebSocket URL");const d=F.forResumeOnly(o,c),y=()=>d.close();e.addEventListener("abort",y,{once:!0});try{return await d.fetch("/auth/status"),e.throwIfAborted(),d}catch(v){throw d.close(),v}finally{e.removeEventListener("abort",y)}}if(!i.relayUrl||!i.relayUsername)throw new M("The saved relay host is incomplete");const f=await(s??Z)({relayUrl:i.relayUrl,relayUsername:i.relayUsername,signal:e});e.aborted&&(f.close(),e.throwIfAborted());const m=()=>f.close();e.addEventListener("abort",m,{once:!0});try{const d=await F.forResumeOnlyWithSocket(f,o,c,{relayUrl:i.relayUrl,relayUsername:i.relayUsername,openSocket:s});return await d.fetch("/auth/status"),e.throwIfAborted(),d}catch(d){throw f.close(),d}finally{e.removeEventListener("abort",m)}}const Ee=async(i,e)=>{if(i.mode!=="local")throw new Error("Expected a local preview source");e.throwIfAborted();const s=new AbortController,t=new Set,r=()=>{s.abort();for(const o of t)o.close();t.clear(),e.removeEventListener("abort",r)};return e.addEventListener("abort",r,{once:!0}),{close:r,async fetch(o,a){try{return await me(o,{...a,signal:a!=null&&a.signal?AbortSignal.any([s.signal,a.signal]):s.signal},{onLoginRequired:()=>{}})}catch(c){throw(c==null?void 0:c.status)===401?new M("Authentication required"):c}},subscribeConversation(o,a,c){s.signal.throwIfAborted();const p=Se(a,o).replace("/conversation?","/conversation/subscribe?"),f=new EventSource(p);t.add(f);let m=!1;const d=()=>{m=!0,f.close(),t.delete(f)};return f.onopen=()=>{var y;!m&&!s.signal.aborted&&((y=c.onOpen)==null||y.call(c))},f.addEventListener("snapshot",y=>{var v;if(!(m||s.signal.aborted))try{c.onEvent("snapshot",void 0,JSON.parse(y.data))}catch(x){d(),(v=c.onError)==null||v.call(c,x instanceof Error?x:new Error("Invalid snapshot"))}}),f.onerror=()=>{var y;m||s.signal.aborted||(d(),(y=c.onError)==null||y.call(c,new Error("Conversation stream disconnected")))},{close:d}}}},Ne=2e3,Me=5e3,Oe=3e4,Re=2*1024*1024,ke=8*1024*1024,Ae=1024*1024,Le=10,Ue=5,J=0,L=1,G=2,A=3;class q extends Error{constructor(e){super(e),this.reason=e,this.name="RelayMuxCircuitOpenError"}}function O(){return new DOMException("Relay connection aborted","AbortError")}function Te(i){return typeof i=="string"?{bytes:new TextEncoder().encode(i),isBinary:!1}:i instanceof ArrayBuffer?{bytes:new Uint8Array(i),isBinary:!0}:{bytes:new Uint8Array(i.buffer,i.byteOffset,i.byteLength),isBinary:!0}}class Be{constructor(e,s){h(this,"binaryType","arraybuffer");h(this,"onclose",null);h(this,"onerror",null);h(this,"onmessage",null);h(this,"state",J);this.physical=e,this.circuitId=s}get bufferedAmount(){return this.physical.bufferedAmount}get readyState(){return this.state}markOpen(){this.state===J&&(this.state=L)}receive(e,s){var r;if(this.state!==L)return;const t=s?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):new TextDecoder().decode(e);(r=this.onmessage)==null||r.call(this,new MessageEvent("message",{data:t}))}remoteClose(e,s){var t;this.state!==A&&(this.state=A,(t=this.onclose)==null||t.call(this,new CloseEvent("close",{code:e,reason:s,wasClean:e===1e3})))}fail(e){var s;this.state!==A&&((s=this.onerror)==null||s.call(this,new Event("error")),this.physical.closeCircuit(this.circuitId,e))}send(e){if(this.state!==L)throw new DOMException("WebSocket is not open","InvalidStateError");const s=Te(e);this.physical.sendCircuitData(this.circuitId,s.bytes,s.isBinary)}close(e=1e3,s=""){this.state===G||this.state===A||(this.state=G,this.physical.requestCircuitClose(this.circuitId,e,s))}}class D{constructor(e,s){h(this,"circuits",new Map);h(this,"pending",new Map);h(this,"queues",new Map);h(this,"queuedBytesByCircuit",new Map);h(this,"queuedBytes",0);h(this,"circuitOrder",[]);h(this,"drainCursor",0);h(this,"drainScheduled",!1);h(this,"drainTimer",null);h(this,"nextCircuitId",1);h(this,"maxFrameBytes",0);h(this,"maxCircuits",0);h(this,"closed",!1);this.ws=e,this.onPhysicalClose=s}static connect(e,s,t){return new Promise((r,o)=>{const a=s(e);a.binaryType="arraybuffer";const c=new D(a,t);let p=!1;const f=setTimeout(()=>{p||(p=!0,a.close(),o(new Error("Relay mux ready timeout")))},Me);a.onmessage=m=>{if(!p&&typeof m.data=="string")try{const d=JSON.parse(m.data);if($(d)){p=!0,clearTimeout(f),c.maxCircuits=d.maxCircuits,c.maxFrameBytes=d.maxFrameBytes,r(c);return}}catch{}c.handleMessage(m)},a.onerror=()=>{p||(p=!0,clearTimeout(f),o(new Error("Failed to connect to relay mux")))},a.onclose=m=>{clearTimeout(f),c.handleClose(m),p||(p=!0,o(new Error("Relay mux closed before ready")))}})}get bufferedAmount(){return this.ws.bufferedAmount}get isOpen(){return!this.closed&&this.ws.readyState===L}async openCircuit(e,s,t){if(!this.isOpen)throw new Error("Relay mux is not connected");if(this.circuits.size+this.pending.size>=this.maxCircuits)throw new q("circuit_limit");const r=this.allocateCircuitId(),o=new Be(this,r);return new Promise((a,c)=>{const p=()=>{this.pending.delete(r),clearTimeout(f),this.sendControl({type:"mux_close",circuitId:r}),o.remoteClose(1e3,"Relay connection aborted"),c(O())},f=setTimeout(()=>{this.pending.delete(r),t==null||t.removeEventListener("abort",p),this.sendControl({type:"mux_close",circuitId:r}),o.remoteClose(1006,"Waiting for relay circuit timed out"),c(new Error("Waiting for relay circuit timed out"))},Oe),m={socket:o,timeout:f,resolve:d=>{t==null||t.removeEventListener("abort",p),a(d)},reject:d=>{t==null||t.removeEventListener("abort",p),c(d)}};if(this.pending.set(r,m),t!=null&&t.aborted){p();return}t==null||t.addEventListener("abort",p,{once:!0}),this.sendControl({type:"mux_open",circuitId:r,username:e,channel:s})})}sendCircuitData(e,s,t){const r=this.circuits.get(e);if(!r||!this.isOpen)throw new DOMException("WebSocket is not open","InvalidStateError");if(s.byteLength>this.maxFrameBytes)throw r.fail("Relay mux frame is too large"),new DOMException("Relay mux frame is too large","QuotaExceededError");const o=be(e,s,t),a=this.queuedBytesByCircuit.get(e)??0;if(a+o.byteLength>Re||this.queuedBytes+o.byteLength>ke)throw r.fail("Relay mux queue overflow"),new DOMException("Relay mux queue overflow","QuotaExceededError");let c=this.queues.get(e);c||(c=[],this.queues.set(e,c),this.circuitOrder.push(e)),c.push({bytes:o,circuitId:e}),this.queuedBytesByCircuit.set(e,a+o.byteLength),this.queuedBytes+=o.byteLength,this.scheduleDrain(!1)}requestCircuitClose(e,s,t){if(this.circuits.has(e)){if(!this.isOpen){this.removeCircuit(e,1006,"Relay mux disconnected");return}this.sendControl({type:"mux_close",circuitId:e})}}closeCircuit(e,s){this.circuits.has(e)&&(this.isOpen&&this.sendControl({type:"mux_close",circuitId:e}),this.removeCircuit(e,1008,s))}close(){this.closed||this.ws.close(1e3,"Mux pool disposed")}handleMessage(e){var s;if(typeof e.data=="string"){let t;try{t=JSON.parse(e.data)}catch{this.ws.close(1008,"Invalid relay mux control");return}if(we(t)){const r=this.pending.get(t.circuitId);if(!r){this.sendControl({type:"mux_close",circuitId:t.circuitId});return}this.pending.delete(t.circuitId),clearTimeout(r.timeout),r.socket.markOpen(),this.circuits.set(t.circuitId,r.socket),r.resolve(r.socket);return}if(ve(t)){const r=this.pending.get(t.circuitId);if(!r)return;this.pending.delete(t.circuitId),clearTimeout(r.timeout),r.socket.remoteClose(1008,t.reason),r.reject(new q(t.reason));return}if(ge(t)){this.removeCircuit(t.circuitId,1e3,t.reason);return}if($(t))return;this.ws.close(1008,"Unexpected relay mux control");return}if(!(e.data instanceof ArrayBuffer)){this.ws.close(1008,"Invalid relay mux data");return}try{const t=xe(e.data);if(t.payload.byteLength>this.maxFrameBytes){this.closeCircuit(t.circuitId,"Relay mux frame is too large");return}(s=this.circuits.get(t.circuitId))==null||s.receive(t.payload,t.isBinary)}catch{this.ws.close(1008,"Invalid relay mux data")}}handleClose(e){if(!this.closed){this.closed=!0,this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null);for(const s of this.pending.values())clearTimeout(s.timeout),s.socket.remoteClose(e.code,e.reason),s.reject(new Error(e.reason||"Relay mux disconnected"));this.pending.clear();for(const s of this.circuits.keys())this.removeCircuit(s,e.code||1006,e.reason||"Relay mux disconnected");this.onPhysicalClose()}}removeCircuit(e,s,t){const r=this.circuits.get(e);if(!r)return;this.circuits.delete(e);const o=this.queuedBytesByCircuit.get(e)??0;this.queuedBytes-=o,this.queuedBytesByCircuit.delete(e),this.queues.delete(e),this.circuitOrder=this.circuitOrder.filter(a=>a!==e),r.remoteClose(s,t)}sendControl(e){if(!this.isOpen)throw new Error("Relay mux is not connected");this.ws.send(JSON.stringify(e))}allocateCircuitId(){for(let e=0;e<4294967295;e+=1){const s=this.nextCircuitId;if(this.nextCircuitId=this.nextCircuitId===4294967295?1:this.nextCircuitId+1,!this.pending.has(s)&&!this.circuits.has(s))return s}throw new Error("Relay mux circuit ids exhausted")}scheduleDrain(e){if(!(this.closed||this.drainScheduled||this.drainTimer)){if(e){this.drainTimer=setTimeout(()=>{this.drainTimer=null,this.drain()},Le);return}this.drainScheduled=!0,queueMicrotask(()=>{this.drainScheduled=!1,this.drain()})}}drain(){if(this.isOpen){for(;this.queuedBytes>0&&this.ws.bufferedAmount<=Ae;){const e=this.nextQueuedFrame();if(!e)break;this.ws.send(e.bytes)}this.queuedBytes>0&&this.scheduleDrain(!0)}}nextQueuedFrame(){if(this.circuitOrder.length===0)return null;for(let e=0;e<this.circuitOrder.length;e+=1){const s=(this.drainCursor+e)%this.circuitOrder.length,t=this.circuitOrder[s];if(t===void 0)continue;const r=this.queues.get(t);if(!r)continue;const o=r.shift();if(!o)continue;this.drainCursor=(s+1)%this.circuitOrder.length;const a=(this.queuedBytesByCircuit.get(t)??o.bytes.byteLength)-o.bytes.byteLength;return this.queuedBytesByCircuit.set(t,a),this.queuedBytes-=o.bytes.byteLength,r.length===0&&(this.queues.delete(t),this.circuitOrder=this.circuitOrder.filter(c=>c!==t)),o}return null}}class qe{constructor(e,s){h(this,"discovery",null);h(this,"physical",null);h(this,"physicalOpening",null);h(this,"degraded",!1);h(this,"disposed",!1);h(this,"lifetime",new AbortController);this.endpoints=e,this.options=s}async open(e){if(this.disposed)throw O();const s=this.degraded?!1:await this.discover();if(this.disposed)throw O();if(this.degraded||!s)return this.options.openLegacySocket(e);let t;try{t=await this.ensurePhysical()}catch(r){if(this.disposed||r instanceof DOMException&&r.name==="AbortError")throw r;return this.degraded=!0,this.options.openLegacySocket(e)}try{return await t.openCircuit(e.relayUsername,e.channel??pe,e.signal)}catch(r){if(r instanceof q||r instanceof DOMException&&r.name==="AbortError")throw r;return this.degraded=!0,this.options.openLegacySocket(e)}}dispose(){var e;this.disposed||(this.disposed=!0,this.lifetime.abort(),(e=this.physical)==null||e.close(),this.physical=null)}discover(){return this.discovery?this.discovery:(this.discovery=this.runDiscovery(),this.discovery)}async runDiscovery(){const e=new AbortController,s=setTimeout(()=>e.abort(),Ne),t=()=>e.abort();this.lifetime.signal.addEventListener("abort",t,{once:!0});try{const r=await this.options.fetch(this.endpoints.healthUrl,{signal:e.signal});if(!r.ok)return!1;const o=await r.json();return Array.isArray(o.relayCapabilities)&&o.relayCapabilities.includes(ye)}catch{return!1}finally{clearTimeout(s),this.lifetime.signal.removeEventListener("abort",t)}}ensurePhysical(){var r;if((r=this.physical)!=null&&r.isOpen)return Promise.resolve(this.physical);if(this.physicalOpening)return this.physicalOpening;let e=null;const t=D.connect(this.endpoints.muxUrl,this.options.createWebSocket,()=>{this.physical===e&&(this.physical=null)}).then(o=>{if(e=o,this.disposed)throw o.close(),O();return this.physical=o,o}).finally(()=>{this.physicalOpening===t&&(this.physicalOpening=null)});return this.physicalOpening=t,t}}class Pe{constructor(e,s={}){h(this,"eligibleHostIds",new Set);h(this,"groups",new Map);h(this,"endpointsByHostId",new Map);h(this,"options");h(this,"disposed",!1);var o;const t=s.fetch??fetch;this.options={createWebSocket:s.createWebSocket??(a=>new WebSocket(a)),fetch:(a,c)=>t(a,c),openLegacySocket:s.openLegacySocket??Z};const r=new Map;for(const a of e){if(a.mode!=="relay"||!a.session||!a.relayUrl||!a.relayUsername)continue;const c=fe(a.relayUrl);if(!c)continue;let p=r.get(c.key);p||(p=[],r.set(c.key,p)),p.push({endpoints:c,host:a})}for(const[a,c]of r){if(c.length<2)continue;const p=c.slice(0,Ue),f=(o=p[0])==null?void 0:o.endpoints;if(f){this.groups.set(a,new qe(f,this.options));for(const{host:m,endpoints:d}of p)this.eligibleHostIds.add(m.id),this.endpointsByHostId.set(m.id,d)}}}createSocketFactory(e){return s=>this.open(e,s)}dispose(){if(!this.disposed){this.disposed=!0;for(const e of this.groups.values())e.dispose();this.groups.clear()}}open(e,s){if(this.disposed)return Promise.reject(O());if(!this.eligibleHostIds.has(e.id))return this.options.openLegacySocket(s);const t=this.endpointsByHostId.get(e.id),r=t?this.groups.get(t.key):void 0;return(r==null?void 0:r.open(s))??this.options.openLegacySocket(s)}}class De{constructor(e,s,t=null){h(this,"state");h(this,"listeners",new Set);h(this,"owners",new Map);h(this,"stream");h(this,"binding");h(this,"disposed",!1);h(this,"pool");h(this,"connect");h(this,"getSnapshot",()=>this.state);h(this,"subscribe",e=>(this.listeners.add(e),()=>this.listeners.delete(e)));this.state={sources:e.map(r=>({host:r,status:"excluded",sessions:[],hasMore:!1,updatedAt:null,issueCoverage:"unsupported"})),selection:t,view:null,conversationStatus:"empty",maxMessages:20,anchorMessageId:null},s||(this.pool=new Pe(e.filter(r=>r.mode!=="local"))),this.connect=s??((r,o,a)=>{var c;if(r.mode==="local")throw new Error("Local source requires a local connector");return Ie(r,o,r.mode==="relay"?(c=this.pool)==null?void 0:c.createSocketFactory(r):void 0,a)})}publish(e={}){if(!this.disposed){this.state={...this.state,...e};for(const s of this.listeners)s()}}source(e,s){this.publish({sources:this.state.sources.map(t=>t.host.id===e?{...t,...s}:t)})}closeStream(){var s;(s=this.binding)==null||s.close(),this.binding=void 0;const e=this.stream;this.stream=void 0,e==null||e.close()}stopSource(e){var t,r;const s=this.owners.get(e);this.owners.delete(e),s==null||s.abort.abort(),(t=s==null?void 0:s.connection)==null||t.close(),((r=this.state.selection)==null?void 0:r.sourceId)===e&&this.closeStream()}include(e,s){var c,p;if(this.disposed)return;if(this.stopSource(e),!s){this.source(e,{status:"excluded",sessions:[],updatedAt:null}),((c=this.state.selection)==null?void 0:c.sourceId)===e&&this.publish({selection:null,view:null,conversationStatus:"empty"});return}const t=this.state.sources.find(f=>f.host.id===e);if(!t)return;const r={abort:new AbortController};this.owners.set(e,r);const o=()=>!this.disposed&&this.owners.get(e)===r&&!r.abort.signal.aborted,a=f=>{var m;o()&&(this.stopSource(e),this.source(e,{status:Y(f)?"sign-in-required":"offline"}),((m=this.state.selection)==null?void 0:m.sourceId)===e&&this.publish({conversationStatus:"offline"}))};this.source(e,{status:"connecting",issueCoverage:"unsupported"}),((p=this.state.selection)==null?void 0:p.sourceId)===e&&this.publish({conversationStatus:"loading"}),(async()=>{var f,m,d;try{const y=await this.connect(t.host,r.abort.signal,a);if(!o()){y.close();return}r.connection=y;const v=await y.fetch("/version");if(!o())return;const x=_e(v);if(x!=="available"){this.stopSource(e),this.source(e,{status:x}),((f=this.state.selection)==null?void 0:f.sourceId)===e&&this.publish({conversationStatus:"offline"});return}const j=await y.fetch("/sessions?limit=50");if(!o())return;const I=j.sessions.slice(0,50).map(b=>({id:b.id,title:b.customTitle||b.title||b.fullTitle||b.id,projectId:b.projectId,projectName:b.projectName,updatedAt:b.updatedAt,issues:[]}));if(this.source(e,{status:"ready",sessions:I,hasMore:j.hasMore,updatedAt:Date.now()}),((m=this.state.selection)==null?void 0:m.sourceId)===e&&this.openConversation(),z(v,K.issueSessionAssociations))try{const b=await y.fetch("/issues/settings");if(!o())return;if(!b.settings.enabled){this.source(e,{issueCoverage:"disabled"});return}this.source(e,{issueCoverage:"partial"});let k=0,E=!1;const l=new Map;await Promise.all(Array.from({length:3},async()=>{for(;o()&&!E;){const w=I[k++];if(!w)return;const g=await y.fetch(`/issues?sessionId=${encodeURIComponent(w.id)}&limit=10`).catch(_=>{throw E=!0,_});if(!o())return;l.set(w.id,g.items.map(_=>({id:_.id,key:_.key})))}})),o()&&this.source(e,{sessions:I.map(w=>({...w,issues:l.get(w.id)??[]}))})}catch{o()&&this.source(e,{issueCoverage:"unavailable"})}}catch(y){if(!o())return;this.stopSource(e),this.source(e,{status:Y(y)?"sign-in-required":"offline"}),((d=this.state.selection)==null?void 0:d.sourceId)===e&&this.publish({conversationStatus:"offline"})}})()}select(e,s){this.closeStream(),this.publish({selection:{sourceId:e,sessionId:s},view:null,maxMessages:20,anchorMessageId:null}),this.openConversation()}more(){var s;const e=this.state.view;this.publish({maxMessages:Math.min(100,this.state.maxMessages+20),anchorMessageId:(e==null?void 0:e.kind)==="conversation"?((s=e.messages.at(-1))==null?void 0:s.id)??null:null}),this.openConversation()}latest(){this.publish({anchorMessageId:null}),this.openConversation()}openConversation(){var f;this.closeStream();const e=this.state.selection;if(!e)return;const s=(f=this.owners.get(e.sourceId))==null?void 0:f.connection,t=this.state.sources.find(m=>m.host.id===e.sourceId);if(!s||(t==null?void 0:t.status)!=="ready"){this.publish({conversationStatus:"offline"});return}const r=new Ce(e.sourceId,re(),e.sessionId);this.binding=r;const o=()=>this.binding===r&&!this.disposed;this.publish({conversationStatus:"loading"});const a={sessionId:e.sessionId,maxMessages:this.state.maxMessages,anchorMessageId:this.state.anchorMessageId},c=()=>{o()&&(this.closeStream(),this.publish({conversationStatus:"offline"}))},p={onEvent:(m,d,y)=>{if(o()){if(m==="closed"){c();return}if(m==="snapshot")try{const v=r.accept(e.sourceId,JSON.stringify(y));v&&this.publish({view:v.view,conversationStatus:"ready"})}catch{this.closeStream(),this.publish({conversationStatus:"invalid"})}}},onClose:c,onError:c};try{const m=s.subscribeConversation(r.subscriptionId,a,p);o()?this.stream=m:m.close()}catch{c()}}dispose(){var e;if(!this.disposed){this.disposed=!0,this.closeStream();for(const s of[...this.owners.keys()])this.stopSource(s);(e=this.pool)==null||e.dispose(),this.listeners.clear()}}}function He(i,e){if(e==="none"){const t=i.filter(o=>o.status!=="excluded").flatMap(o=>o.sessions.map(a=>({source:o,session:a}))),r=o=>{const a=Date.parse(o.session.updatedAt);return Number.isFinite(a)?a:Number.NEGATIVE_INFINITY};return t.sort((o,a)=>r(a)-r(o)||0),t.length?[{id:"none",label:null,sourceName:null,rows:t}]:[]}const s=new Map;for(const t of i)if(t.status!=="excluded")for(const r of t.sessions){const o=e==="issue"&&r.issues.length>0?r.issues.map(a=>({id:JSON.stringify(["issue",a.id]),label:a.key,sourceName:null})):[{id:JSON.stringify([e,t.host.id,e==="project"?r.projectId:null]),label:e==="machine"?t.host.displayName:e==="project"?r.projectName:null,sourceName:e==="machine"?null:t.host.displayName}];for(const a of o){const c=s.get(a.id)??{...a,rows:[]};c.rows.push({source:t,session:r}),s.set(a.id,c)}}return[...s.values()]}const Fe="_page_moj47_1",$e="_topbar_moj47_20",We="_muted_moj47_32",Ye="_control_moj47_37",Je="_workspace_moj47_58",Ge="_sidebar_moj47_64",Ve="_sources_moj47_70",Xe="_sectionHeading_moj47_74",Qe="_source_moj47_70",ze="_sourceDetail_moj47_105",Ke="_localSource_moj47_122",Ze="_groupControl_moj47_131",es="_groups_moj47_149",ss="_session_moj47_166",ts="_main_moj47_202",is="_empty_moj47_208",rs="_conversationHeader_moj47_221",ns="_actions_moj47_235",os="_badge_moj47_246",as="_transcript_moj47_251",cs="_history_moj47_258",ls="_message_moj47_270",us="_prose_moj47_286",ds="_activity_moj47_290",hs="_failure_moj47_300",ps="_notice_moj47_308",ms="_mobileToggle_moj47_319",u={page:Fe,topbar:$e,muted:We,control:Ye,workspace:Je,sidebar:Ge,sources:Ve,sectionHeading:Xe,source:Qe,sourceDetail:ze,localSource:Ke,groupControl:Ze,groups:es,session:ss,main:ts,empty:is,conversationHeader:rs,actions:ns,badge:os,transcript:as,history:cs,message:ls,prose:us,activity:ds,failure:hs,notice:ps,mobileToggle:ms},fs={excluded:"preview.status.excluded",connecting:"preview.status.connecting",ready:"preview.status.ready",offline:"preview.status.offline","sign-in-required":"preview.status.signIn","update-required":"preview.status.update","revision-mismatch":"preview.status.revision"},ee="yep-experimental-preview-sources";function ys({content:i}){const{t:e}=Q();switch(i.kind){case"text":return n.jsx("div",{className:u.prose,children:i.text});case"activity":return n.jsxs("div",{className:u.activity,children:[n.jsx("p",{children:i.summary}),n.jsx("small",{children:e(i.toolCount===1?"preview.toolOne":"preview.tools",{count:i.toolCount,failed:i.failedToolCount})})]});case"failure":return n.jsxs("div",{className:u.failure,children:[n.jsx("strong",{children:i.toolName}),n.jsx("p",{children:i.message})]});case"media":return n.jsx("div",{className:u.activity,children:e("preview.media",{description:i.description||e("preview.attachment")})});default:return n.jsx("p",{className:u.notice,children:e("preview.unknown")})}}function ws({controller:i,local:e}){var b,k,E;const{t:s}=Q(),t=C.useSyncExternalStore(i.subscribe,i.getSnapshot),[r,o]=X(),[a,c]=C.useState(e?"none":"machine"),[p,f]=C.useState(!t.selection),m=C.useMemo(()=>He(t.sources,a),[t.sources,a]),d=t.sources.find(l=>{var w;return l.host.id===((w=t.selection)==null?void 0:w.sourceId)}),y=d==null?void 0:d.sessions.find(l=>{var w;return l.id===((w=t.selection)==null?void 0:w.sessionId)}),v=((b=t.view)==null?void 0:b.kind)==="conversation"?t.view:null,x=t.conversationStatus==="loading",j=d?W(d.host,y):null;function I(l,w){i.include(l,w);try{localStorage.setItem(ee,JSON.stringify(i.getSnapshot().sources.filter(g=>g.status!=="excluded").map(g=>g.host.id)))}catch{}i.getSnapshot().selection||o({},{replace:!0})}return n.jsxs("div",{className:u.page,children:[n.jsxs("header",{className:u.topbar,children:[n.jsxs("div",{children:[n.jsx("h1",{children:s("preview.title")}),n.jsx("span",{className:u.muted,children:s("preview.subtitle")})]}),n.jsx(S,{className:u.control,to:e?"/projects":"/login",children:s("preview.fullApp")})]}),n.jsx("button",{type:"button",className:`${u.control} ${u.mobileToggle}`,"aria-expanded":p,"aria-controls":"preview-sidebar",onClick:()=>f(!p),children:s(p?"preview.hideSessions":e?"preview.sessions":"preview.showSessions")}),n.jsxs("div",{className:u.workspace,children:[n.jsxs("aside",{id:"preview-sidebar",className:u.sidebar,"data-open":p,"aria-label":s("preview.sessions"),children:[n.jsxs("section",{className:u.sources,children:[n.jsxs("div",{className:u.sectionHeading,children:[n.jsx("h2",{children:s(e?"preview.localServer":"preview.machines")}),!e&&n.jsx(S,{to:"/login",children:s("preview.addMachine")})]}),t.sources.length===0&&n.jsx("p",{className:u.muted,children:s("preview.noMachines")}),t.sources.map(l=>n.jsxs("div",{className:`${u.source} ${e?u.localSource:""}`,"data-testid":"preview-source","data-source-name":l.host.displayName,"data-source-status":l.status,children:[e?n.jsx("strong",{children:l.host.displayName}):n.jsxs("label",{children:[n.jsx("input",{type:"checkbox",checked:l.status!=="excluded",onChange:w=>I(l.host.id,w.target.checked)}),n.jsx("span",{children:l.host.displayName})]}),n.jsxs("div",{className:u.sourceDetail,children:[n.jsx("span",{children:s(fs[l.status])}),l.status!=="excluded"&&l.status!=="connecting"&&n.jsx("button",{type:"button",className:u.control,onClick:()=>i.include(l.host.id,!0),children:s("preview.refresh")})]}),l.status==="sign-in-required"&&n.jsx(S,{to:l.host.mode==="local"?"/login":l.host.mode==="relay"?`/login/relay?u=${encodeURIComponent(l.host.relayUsername??"")}&r=${encodeURIComponent(l.host.relayUrl??"")}`:"/login/direct",state:e?{from:`/-/preview${r.size?`?${r}`:""}`}:void 0,children:s("preview.signIn")}),["offline","update-required","revision-mismatch"].includes(l.status)&&n.jsx(S,{className:u.control,to:W(l.host)??(l.host.mode==="relay"?"/login/relay":"/login/direct"),children:s("preview.fullApp")}),a==="issue"&&l.status==="ready"&&n.jsx("p",{className:u.muted,children:s(`preview.issues.${l.issueCoverage}`)}),l.hasMore&&l.status==="ready"&&n.jsx("small",{className:u.muted,children:s("preview.catalogLimit")})]},l.host.id))]}),n.jsxs("label",{className:u.groupControl,children:[s("preview.groupBy"),n.jsxs("select",{value:a,onChange:l=>c(l.target.value),children:[n.jsx("option",{value:"none",children:s("preview.byNone")}),!e&&n.jsx("option",{value:"machine",children:s("preview.byMachine")}),n.jsx("option",{value:"project",children:s("preview.byProject")}),n.jsx("option",{value:"issue",children:s("preview.byIssue")})]})]}),n.jsxs("nav",{"aria-label":s("preview.sessions"),className:u.groups,children:[m.length===0&&n.jsx("p",{className:u.muted,children:s("preview.noSessions")}),m.map(l=>n.jsxs("section",{children:[a!=="none"&&n.jsxs("h3",{children:[l.label??s("preview.noIssueLinks"),n.jsx("small",{children:l.sourceName})]}),l.rows.map(({source:w,session:g})=>{var _;return n.jsxs("button",{type:"button",className:u.session,"aria-current":((_=t.selection)==null?void 0:_.sourceId)===w.host.id&&t.selection.sessionId===g.id?"true":void 0,onClick:()=>{i.select(w.host.id,g.id),o({source:w.host.id,session:g.id},{replace:!0}),f(!1)},children:[n.jsx("span",{children:g.title}),n.jsx("small",{children:e||a==="machine"?g.projectName:w.host.displayName})]},JSON.stringify([w.host.id,g.id]))})]},l.id))]})]}),n.jsx("main",{className:u.main,children:t.selection?n.jsxs(n.Fragment,{children:[n.jsxs("header",{className:u.conversationHeader,children:[n.jsxs("small",{className:u.muted,children:[d==null?void 0:d.host.displayName," · ",y==null?void 0:y.projectName]}),n.jsx("h2",{children:(y==null?void 0:y.title)??t.selection.sessionId}),n.jsxs("div",{className:u.actions,children:[n.jsx("span",{className:u.badge,children:s("preview.readOnlyBadge")}),v&&n.jsx("span",{children:s(`preview.activity.${v.activity}`)}),j?n.jsx(S,{className:u.control,to:j,children:s("preview.openFull")}):n.jsx(S,{className:u.control,to:"/login/direct",children:s("preview.fullApp")})]})]}),n.jsxs("div",{className:u.transcript,"data-testid":"preview-conversation",children:[x&&n.jsx("p",{role:"status",className:u.notice,children:s("preview.loading")}),t.conversationStatus==="offline"&&n.jsxs("div",{role:"status",className:u.notice,children:[n.jsx("p",{children:s("preview.disconnected")}),d&&n.jsx("button",{className:u.control,type:"button",onClick:()=>i.include(d.host.id,!0),children:s("preview.reconnect")})]}),t.conversationStatus==="invalid"&&n.jsx("p",{role:"alert",className:u.notice,children:s("preview.invalid")}),((k=t.view)==null?void 0:k.kind)==="error"&&n.jsx("p",{role:"status",className:u.notice,children:s(`preview.error.${t.view.code}`)}),t.view&&t.view.kind!=="conversation"&&t.view.kind!=="error"&&n.jsx("p",{className:u.notice,children:s("preview.unknown")}),v&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:u.history,children:[n.jsx("span",{children:s(v.coverage.returnedMessages===1?"preview.messageCountOne":"preview.messageCount",{count:v.coverage.returnedMessages})}),n.jsx("button",{type:"button",className:u.control,disabled:x||t.maxMessages>=100||!v.coverage.earlierInScope||(d==null?void 0:d.status)!=="ready",onClick:()=>i.more(),children:s("preview.more")}),n.jsx("button",{type:"button",className:u.control,disabled:x||(d==null?void 0:d.status)!=="ready",onClick:()=>i.latest(),children:s("preview.latest")})]}),t.anchorMessageId&&n.jsx("p",{className:u.muted,children:s("preview.anchored")}),(!v.coverage.completeForRequest||v.coverage.earlierOutsideScope!=="no"||t.maxMessages>=100&&v.coverage.earlierInScope)&&n.jsx("p",{className:u.notice,children:s("preview.coverage")}),v.messages.length===0&&n.jsx("p",{className:u.muted,children:s("preview.emptyConversation")}),v.messages.map(l=>n.jsxs("article",{className:u.message,"data-role":l.role,children:[n.jsxs("header",{children:[n.jsx("strong",{children:s(l.role==="user"?"preview.you":"preview.agent")}),l.state!=="complete"&&n.jsx("small",{children:s(`preview.message.${l.state}`)})]}),l.content.map((w,g)=>n.jsx(ys,{content:w},`${l.id}:${g}`)),l.truncated&&n.jsx("small",{className:u.muted,children:s("preview.truncated")})]},l.id)),v.pendingRequests.map((l,w)=>n.jsxs("section",{className:u.notice,children:[n.jsx("strong",{children:s("preview.needsAttention")}),n.jsx("p",{children:l.kind==="question"?l.prompt:s("preview.unknown")}),n.jsx("small",{children:s("preview.answerInFull")})]},l.kind==="question"?l.id:`unknown:${w}`))]}),((E=t.view)==null?void 0:E.kind)==="error"&&(d==null?void 0:d.status)==="ready"&&n.jsx("button",{type:"button",className:u.control,onClick:()=>i.latest(),children:s("preview.latest")})]})]}):n.jsxs("div",{className:u.empty,children:[n.jsx("h2",{children:s("preview.welcome")}),n.jsx("p",{children:s("preview.chooseSession")}),n.jsx("p",{className:u.muted,children:s("preview.readOnly")})]})})]})]})}function Es({local:i=!1}){const[e,s]=C.useState(null),[t]=X(),[r]=C.useState(()=>(i||t.get("source"))&&t.get("session")?{sourceId:i?"local":t.get("source"),sessionId:t.get("session")}:null);return C.useEffect(()=>{const o=new De(i?[{id:"local",mode:"local",displayName:window.location.host}]:de().hosts,i?Ee:void 0,r);if(s(o),i)return o.include("local",!0),()=>o.dispose();let a=[];try{const c=JSON.parse(localStorage.getItem(ee)??"[]");Array.isArray(c)&&(a=c.filter(p=>typeof p=="string"))}catch{}r&&a.push(r.sourceId);for(const c of new Set(a))o.include(c,!0);return()=>o.dispose()},[r,i]),e?n.jsx(ws,{controller:e,local:i}):null}export{Es as ConversationPreviewPage,ys as PreviewContent};
@@ -1 +1 @@
1
- import{r as o,j as e}from"./clientSummaryStore-Cr4yWo-Y.js";import{w as x}from"./main-BpQ_EIjC.js";const f="_label_1adwr_1",m={label:f},k=o.memo(function({text:i,label:s,className:a,copiedClassName:l="copied",copiedLabel:c="Copied message text",showTextLabel:d=!1,onClick:n}){const[r,u]=o.useState(!1),t=o.useRef(null);o.useEffect(()=>()=>{t.current!==null&&clearTimeout(t.current)},[]);const p=o.useCallback(async h=>{if(n==null||n(h),!await x(i)){console.error(`Failed to copy text for ${s}`);return}t.current!==null&&clearTimeout(t.current),u(!0),t.current=setTimeout(()=>{t.current=null,u(!1)},1800)},[s,n,i]);return e.jsxs("button",{type:"button",className:`${a}${r?` ${l}`:""}`,onClick:p,"aria-label":r?c:s,title:r?c:s,children:[r?e.jsx(y,{}):e.jsx(j,{}),d&&e.jsx("span",{className:m.label,children:r?"Copied":"Copy"})]})});function j(){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),e.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}function y(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M13.5 4.5 6.5 11.5 2.5 7.5"})})}export{k as C};
1
+ import{r as o,j as e}from"./clientSummaryStore-Dsgo1zWK.js";import{w as x}from"./main-BX4yZXDF.js";const f="_label_1adwr_1",m={label:f},k=o.memo(function({text:i,label:s,className:a,copiedClassName:l="copied",copiedLabel:c="Copied message text",showTextLabel:d=!1,onClick:n}){const[r,u]=o.useState(!1),t=o.useRef(null);o.useEffect(()=>()=>{t.current!==null&&clearTimeout(t.current)},[]);const p=o.useCallback(async h=>{if(n==null||n(h),!await x(i)){console.error(`Failed to copy text for ${s}`);return}t.current!==null&&clearTimeout(t.current),u(!0),t.current=setTimeout(()=>{t.current=null,u(!1)},1800)},[s,n,i]);return e.jsxs("button",{type:"button",className:`${a}${r?` ${l}`:""}`,onClick:p,"aria-label":r?c:s,title:r?c:s,children:[r?e.jsx(y,{}):e.jsx(j,{}),d&&e.jsx("span",{className:m.label,children:r?"Copied":"Copy"})]})});function j(){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),e.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}function y(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M13.5 4.5 6.5 11.5 2.5 7.5"})})}export{k as C};
@@ -1 +1 @@
1
- import{r as g,j as e}from"./clientSummaryStore-Cr4yWo-Y.js";import{u as q,a as F}from"./SchemaValidationContext-DqOi1YmB.js";import{u as K,a as Q,e as $}from"./Modal-iT2_XPlO.js";import{u as z,m as G,n as J,o as X,L as Y}from"./main-BpQ_EIjC.js";import{u as Z}from"./useReloadNotifications-D2NJM_v_.js";import{b as ee,f as D}from"./NavigationLayout-BpvrdPoS.js";import{r as se}from"./relayEndpoints-CLXUImOr.js";import{S as o}from"./SettingsItem-C7eQXUQf.js";import{u as te,a as oe,S as ne}from"./index-DvjdkG8Q.js";import"./react-runtime-D-UPQ57m.js";import"./index-C-4wHkcA.js";import"./remoteRoutePaths-Crh_32jX.js";import"./appHref-ByaEnJGJ.js";import"./frontendReload-54GeNGj9.js";import"./useSidebarWidth-DnB-wKom.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./useFileActivity-Y1m-dClR.js";import"./GlossaryContext-PMCo1K6f.js";import"./ProviderBadge-DmhZSMRX.js";import"./YepAnywhereLogo-CIpZ5dke.js";import"./relay-url-j3kYm5KO.js";import"./PageHeader-Dbb8BZq2.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./index-D73NQkRu.js";import"./limitedUserBrowserDefaults-C6cuD-wF.js";const W={"live-tail":"developmentSessionScrollMemoryModeLiveTailDescription","remember-place":"developmentSessionScrollMemoryModeRememberPlaceDescription","no-memory":"developmentSessionScrollMemoryModeNoMemoryDescription"},u={"live-tail":"developmentSessionScrollMemoryModeLiveTail","remember-place":"developmentSessionScrollMemoryModeRememberPlace","no-memory":"developmentSessionScrollMemoryModeNoMemory"};function Ie(){var I;const{t:s}=z(),H=K(),l=Q(),c=l!=null&&l.connection?l.currentRelayUsername?G(l.currentRelayUsername):l.currentHostId?J(l.currentHostId):void 0:void 0,N=(c==null?void 0:c.mode)==="relay"?c.relayUrl:void 0,E=N?(I=se(N))==null?void 0:I.statsUrl:void 0;te(s("developmentSectionTitle"));const{isManualReloadMode:L,pendingReloads:B,connected:T,reloadBackend:U,unsafeToRestart:v,interruptibleSessionCount:r,queuedSessionMessageCount:i}=Z(),{settings:h,setEnabled:b}=q(),{crossHostDelegationEnabled:d,setCrossHostDelegationEnabled:x,relayDebugEnabled:S,setRelayDebugEnabled:j,retainRejectedSrpSessions:y,setRetainRejectedSrpSessions:k,remoteLogCollectionEnabled:R,setRemoteLogCollectionEnabled:M}=X(),{sessionScrollBehaviorMode:m,setSessionScrollBehaviorMode:f}=ee(),{ignoredTools:C,clearIgnoredTools:P}=F(),{settings:n,updateSetting:a}=$(),O=g.useMemo(()=>n?{validationEnabled:h.enabled,crossHostDelegationEnabled:d,relayDebugEnabled:S,retainRejectedSrpSessions:y,remoteLogCollectionEnabled:R,sessionScrollBehaviorMode:m,serviceWorkerEnabled:n.serviceWorkerEnabled??!0,workstreamsEnabled:n.workstreamsEnabled??!1}:null,[h.enabled,d,S,y,R,n,m]),A=g.useCallback(t=>{b(t.validationEnabled),x(t.crossHostDelegationEnabled),j(t.relayDebugEnabled),k(t.retainRejectedSrpSessions),M(t.remoteLogCollectionEnabled),f(t.sessionScrollBehaviorMode),a("serviceWorkerEnabled",t.serviceWorkerEnabled),a("workstreamsEnabled",t.workstreamsEnabled)},[b,x,j,k,M,f,a]);oe(O,A);const[p,w]=g.useState(!1);g.useEffect(()=>{p&&T&&w(!1)},[p,T]);const V=async()=>{w(!0),await U()},_=r>0&&i>0?s("developmentInterruptedWarningActiveAndQueued",{activeCount:r,activeSuffix:r!==1?"s":"",queuedCount:i,queuedSuffix:i!==1?"s":""}):i>0?s("developmentInterruptedWarningQueued",{count:i,suffix:i!==1?"s":""}):s("developmentInterruptedWarning",{count:r,suffix:r!==1?"s ":" "});return e.jsxs(ne,{children:[e.jsxs("div",{className:"settings-group",children:[e.jsx(o,{label:s("developmentSchemaTitle"),description:s("developmentSchemaDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:h.enabled,onChange:t=>b(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),C.length>0&&e.jsx(o,{label:s("developmentIgnoredToolsTitle"),description:s("developmentIgnoredToolsDescription"),info:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("developmentIgnoredToolsTitle")}),e.jsx("p",{children:s("developmentIgnoredToolsDescription")}),e.jsx("div",{className:"ignored-tools-list",children:C.map(t=>e.jsx("span",{className:"ignored-tool-badge",children:t},t))})]}),children:e.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:P,children:s("developmentClearIgnored")})}),e.jsx(o,{label:s("developmentCrossHostDelegationTitle"),description:s("developmentCrossHostDelegationDescription"),className:"settings-item--wide-control",children:e.jsxs("div",{className:"settings-item-actions",children:[d&&e.jsx(Y,{className:"settings-button settings-button-secondary",to:`${H}/-/hosts`,children:s("developmentHostsPreviewOpen")}),e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox","aria-label":s("developmentCrossHostDelegationTitle"),checked:d,onChange:t=>x(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})]})}),E&&e.jsx(o,{label:s("developmentRelayMonitorTitle"),description:s("developmentRelayMonitorDescription"),children:e.jsx("a",{className:"settings-button settings-button-secondary",href:E,target:"_blank",rel:"noreferrer",children:s("developmentRelayMonitorOpen")})}),e.jsx(o,{label:s("developmentRelayDebugTitle"),description:s("developmentRelayDebugDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox","aria-label":s("developmentRelayDebugTitle"),checked:S,onChange:t=>j(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentDiagnosticsTitle"),description:s("developmentDiagnosticsDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:R,onChange:t=>M(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentRetainRejectedSrpTitle"),description:s("developmentRetainRejectedSrpDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox","aria-label":s("developmentRetainRejectedSrpTitle"),checked:y,onChange:t=>k(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentServiceWorkerTitle"),description:s("developmentServiceWorkerDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:(n==null?void 0:n.serviceWorkerEnabled)??!0,onChange:t=>a("serviceWorkerEnabled",t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentWorkstreamsTitle"),description:s("developmentWorkstreamsDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:(n==null?void 0:n.workstreamsEnabled)??!1,onChange:t=>a("workstreamsEnabled",t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})})]}),e.jsx("div",{className:"settings-group",children:e.jsx(o,{label:s("developmentSessionScrollMemoryTitle"),description:s("developmentSessionScrollMemoryDescription"),keywords:[s("developmentSessionScrollMemoryControlTitle"),s("developmentSessionScrollMemoryKeywords"),...D.flatMap(t=>[s(u[t]),s(W[t])])],valueText:s(u[m]),className:"settings-item--wide-control",info:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("developmentSessionScrollMemoryTitle")}),e.jsx("p",{children:s("developmentSessionScrollMemoryDescription")}),e.jsx("ul",{className:"settings-option-description-list",children:D.map(t=>e.jsxs("li",{children:[e.jsx("strong",{children:s(u[t])}),e.jsx("span",{children:s(W[t])})]},t))})]}),children:e.jsx("div",{className:"settings-item-actions",children:e.jsx("select",{className:"settings-select",value:m,onChange:t=>f(t.target.value),"aria-label":s("developmentSessionScrollMemoryControlTitle"),children:D.map(t=>e.jsx("option",{value:t,children:s(u[t])},t))})})})}),L&&e.jsx("div",{className:"settings-group",children:e.jsx(o,{label:s("developmentRestartTitle"),description:s("developmentRestartDescription"),info:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("developmentRestartTitle")}),e.jsxs("p",{children:[s("developmentRestartDescription"),B.backend&&e.jsxs("span",{className:"settings-pending",children:[" ",s("developmentChangesPending")]})]}),v&&e.jsx("p",{className:"settings-warning",children:_})]}),children:e.jsx("button",{type:"button",className:`settings-button ${v?"settings-button-danger":""}`,onClick:V,disabled:p,children:s(p?"developmentRestarting":v?"developmentRestartAnyway":"developmentRestart")})})})]})}export{Ie as DevelopmentSettings};
1
+ import{r as g,j as e}from"./clientSummaryStore-Dsgo1zWK.js";import{u as q,a as F}from"./SchemaValidationContext-CPr8V317.js";import{u as K,a as Q,e as $}from"./Modal-CHNqXAgW.js";import{u as z,m as G,n as J,o as X,L as Y}from"./main-BX4yZXDF.js";import{u as Z}from"./useReloadNotifications-PKjb8H55.js";import{b as ee,f as D}from"./NavigationLayout-UkQvkodY.js";import{r as se}from"./relayEndpoints-CLXUImOr.js";import{S as o}from"./SettingsItem-BgyAjvy6.js";import{u as te,a as oe,S as ne}from"./index-DnFlh5Zf.js";import"./react-runtime-D-UPQ57m.js";import"./index-BhTv6hAY.js";import"./remoteRoutePaths-DpabBbC6.js";import"./appHref-ByaEnJGJ.js";import"./frontendReload-B4jfUIeG.js";import"./useSidebarWidth-op0qbgd4.js";import"./usePanelSlideAnimations-XdQhGgr-.js";import"./useFileActivity-CpuLfNl9.js";import"./GlossaryContext-BA5X62Ck.js";import"./ProviderBadge-C-UpobLD.js";import"./YepAnywhereLogo-ccRUdgT-.js";import"./relay-url-j3kYm5KO.js";import"./PageHeader-DYCnk788.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-DfkDdP3M.js";import"./HostIdentityContext-_GKYzEQ6.js";import"./index-BSMD-gHP.js";import"./limitedUserBrowserDefaults-CwcMxPe5.js";const W={"live-tail":"developmentSessionScrollMemoryModeLiveTailDescription","remember-place":"developmentSessionScrollMemoryModeRememberPlaceDescription","no-memory":"developmentSessionScrollMemoryModeNoMemoryDescription"},u={"live-tail":"developmentSessionScrollMemoryModeLiveTail","remember-place":"developmentSessionScrollMemoryModeRememberPlace","no-memory":"developmentSessionScrollMemoryModeNoMemory"};function Ie(){var I;const{t:s}=z(),H=K(),l=Q(),c=l!=null&&l.connection?l.currentRelayUsername?G(l.currentRelayUsername):l.currentHostId?J(l.currentHostId):void 0:void 0,N=(c==null?void 0:c.mode)==="relay"?c.relayUrl:void 0,E=N?(I=se(N))==null?void 0:I.statsUrl:void 0;te(s("developmentSectionTitle"));const{isManualReloadMode:L,pendingReloads:B,connected:T,reloadBackend:U,unsafeToRestart:v,interruptibleSessionCount:r,queuedSessionMessageCount:i}=Z(),{settings:h,setEnabled:b}=q(),{crossHostDelegationEnabled:d,setCrossHostDelegationEnabled:x,relayDebugEnabled:S,setRelayDebugEnabled:j,retainRejectedSrpSessions:y,setRetainRejectedSrpSessions:k,remoteLogCollectionEnabled:R,setRemoteLogCollectionEnabled:M}=X(),{sessionScrollBehaviorMode:m,setSessionScrollBehaviorMode:f}=ee(),{ignoredTools:C,clearIgnoredTools:P}=F(),{settings:n,updateSetting:a}=$(),O=g.useMemo(()=>n?{validationEnabled:h.enabled,crossHostDelegationEnabled:d,relayDebugEnabled:S,retainRejectedSrpSessions:y,remoteLogCollectionEnabled:R,sessionScrollBehaviorMode:m,serviceWorkerEnabled:n.serviceWorkerEnabled??!0,workstreamsEnabled:n.workstreamsEnabled??!1}:null,[h.enabled,d,S,y,R,n,m]),A=g.useCallback(t=>{b(t.validationEnabled),x(t.crossHostDelegationEnabled),j(t.relayDebugEnabled),k(t.retainRejectedSrpSessions),M(t.remoteLogCollectionEnabled),f(t.sessionScrollBehaviorMode),a("serviceWorkerEnabled",t.serviceWorkerEnabled),a("workstreamsEnabled",t.workstreamsEnabled)},[b,x,j,k,M,f,a]);oe(O,A);const[p,w]=g.useState(!1);g.useEffect(()=>{p&&T&&w(!1)},[p,T]);const V=async()=>{w(!0),await U()},_=r>0&&i>0?s("developmentInterruptedWarningActiveAndQueued",{activeCount:r,activeSuffix:r!==1?"s":"",queuedCount:i,queuedSuffix:i!==1?"s":""}):i>0?s("developmentInterruptedWarningQueued",{count:i,suffix:i!==1?"s":""}):s("developmentInterruptedWarning",{count:r,suffix:r!==1?"s ":" "});return e.jsxs(ne,{children:[e.jsxs("div",{className:"settings-group",children:[e.jsx(o,{label:s("developmentSchemaTitle"),description:s("developmentSchemaDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:h.enabled,onChange:t=>b(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),C.length>0&&e.jsx(o,{label:s("developmentIgnoredToolsTitle"),description:s("developmentIgnoredToolsDescription"),info:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("developmentIgnoredToolsTitle")}),e.jsx("p",{children:s("developmentIgnoredToolsDescription")}),e.jsx("div",{className:"ignored-tools-list",children:C.map(t=>e.jsx("span",{className:"ignored-tool-badge",children:t},t))})]}),children:e.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:P,children:s("developmentClearIgnored")})}),e.jsx(o,{label:s("developmentCrossHostDelegationTitle"),description:s("developmentCrossHostDelegationDescription"),className:"settings-item--wide-control",children:e.jsxs("div",{className:"settings-item-actions",children:[d&&e.jsx(Y,{className:"settings-button settings-button-secondary",to:`${H}/-/hosts`,children:s("developmentHostsPreviewOpen")}),e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox","aria-label":s("developmentCrossHostDelegationTitle"),checked:d,onChange:t=>x(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})]})}),E&&e.jsx(o,{label:s("developmentRelayMonitorTitle"),description:s("developmentRelayMonitorDescription"),children:e.jsx("a",{className:"settings-button settings-button-secondary",href:E,target:"_blank",rel:"noreferrer",children:s("developmentRelayMonitorOpen")})}),e.jsx(o,{label:s("developmentRelayDebugTitle"),description:s("developmentRelayDebugDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox","aria-label":s("developmentRelayDebugTitle"),checked:S,onChange:t=>j(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentDiagnosticsTitle"),description:s("developmentDiagnosticsDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:R,onChange:t=>M(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentRetainRejectedSrpTitle"),description:s("developmentRetainRejectedSrpDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox","aria-label":s("developmentRetainRejectedSrpTitle"),checked:y,onChange:t=>k(t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentServiceWorkerTitle"),description:s("developmentServiceWorkerDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:(n==null?void 0:n.serviceWorkerEnabled)??!0,onChange:t=>a("serviceWorkerEnabled",t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})}),e.jsx(o,{label:s("developmentWorkstreamsTitle"),description:s("developmentWorkstreamsDescription"),children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:(n==null?void 0:n.workstreamsEnabled)??!1,onChange:t=>a("workstreamsEnabled",t.target.checked)}),e.jsx("span",{className:"toggle-slider"})]})})]}),e.jsx("div",{className:"settings-group",children:e.jsx(o,{label:s("developmentSessionScrollMemoryTitle"),description:s("developmentSessionScrollMemoryDescription"),keywords:[s("developmentSessionScrollMemoryControlTitle"),s("developmentSessionScrollMemoryKeywords"),...D.flatMap(t=>[s(u[t]),s(W[t])])],valueText:s(u[m]),className:"settings-item--wide-control",info:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("developmentSessionScrollMemoryTitle")}),e.jsx("p",{children:s("developmentSessionScrollMemoryDescription")}),e.jsx("ul",{className:"settings-option-description-list",children:D.map(t=>e.jsxs("li",{children:[e.jsx("strong",{children:s(u[t])}),e.jsx("span",{children:s(W[t])})]},t))})]}),children:e.jsx("div",{className:"settings-item-actions",children:e.jsx("select",{className:"settings-select",value:m,onChange:t=>f(t.target.value),"aria-label":s("developmentSessionScrollMemoryControlTitle"),children:D.map(t=>e.jsx("option",{value:t,children:s(u[t])},t))})})})}),L&&e.jsx("div",{className:"settings-group",children:e.jsx(o,{label:s("developmentRestartTitle"),description:s("developmentRestartDescription"),info:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("developmentRestartTitle")}),e.jsxs("p",{children:[s("developmentRestartDescription"),B.backend&&e.jsxs("span",{className:"settings-pending",children:[" ",s("developmentChangesPending")]})]}),v&&e.jsx("p",{className:"settings-warning",children:_})]}),children:e.jsx("button",{type:"button",className:`settings-button ${v?"settings-button-danger":""}`,onClick:V,disabled:p,children:s(p?"developmentRestarting":v?"developmentRestartAnyway":"developmentRestart")})})})]})}export{Ie as DevelopmentSettings};
@@ -1 +1 @@
1
- import{r as d,j as s}from"./clientSummaryStore-Cr4yWo-Y.js";import{c as f,u as x}from"./main-BpQ_EIjC.js";import{u as w}from"./useBackgroundRevalidation-BpXlX3fs.js";import{u as j,a as P}from"./useConnectedDevices-BJILFKIz.js";import{u as N,S as b,H as S}from"./index-DvjdkG8Q.js";import{p as D}from"./deviceDetection-BVPclkty.js";import"./react-runtime-D-UPQ57m.js";import"./index-C-4wHkcA.js";import"./appHref-ByaEnJGJ.js";import"./browserTab-BXElY_d5.js";import"./PageHeader-Dbb8BZq2.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./Modal-iT2_XPlO.js";import"./remoteRoutePaths-Crh_32jX.js";import"./NavigationLayout-BpvrdPoS.js";import"./useSidebarWidth-DnB-wKom.js";import"./frontendReload-54GeNGj9.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./useFileActivity-Y1m-dClR.js";import"./GlossaryContext-PMCo1K6f.js";import"./ProviderBadge-DmhZSMRX.js";import"./YepAnywhereLogo-CIpZ5dke.js";import"./index-D73NQkRu.js";import"./limitedUserBrowserDefaults-C6cuD-wF.js";function y(){const[r,t]=d.useState({profiles:[],isLoading:!0,error:null}),n=d.useCallback(async()=>{t(e=>({...e,isLoading:!0,error:null}));try{const{profiles:e}=await f.getBrowserProfiles();t({profiles:e,isLoading:!1,error:null})}catch(e){console.error("[useBrowserProfiles] Failed to fetch:",e),t(i=>({...i,isLoading:!1,error:e instanceof Error?e.message:"Failed to load profiles"}))}},[]);d.useEffect(()=>{n()},[n]),w({fetcher:()=>f.getBrowserProfiles().then(e=>e.profiles),current:r.profiles,apply:e=>t(i=>({...i,profiles:e,error:null}))});const a=d.useCallback(async e=>{t(i=>({...i,isLoading:!0,error:null}));try{await f.deleteBrowserProfile(e),await n()}catch(i){console.error("[useBrowserProfiles] Failed to delete:",i),t(c=>({...c,isLoading:!1,error:i instanceof Error?i.message:"Failed to delete profile"}))}},[n]);return{...r,deleteProfile:a,refetch:n}}function m(r,t){const n=new Date(r),e=new Date().getTime()-n.getTime(),i=Math.floor(e/(1e3*60)),c=Math.floor(e/(1e3*60*60)),o=Math.floor(e/(1e3*60*60*24));return i<1?t("devicesJustNow"):i<60?t("devicesMinutesAgo",{count:i,suffix:i===1?"":"s"}):c<24?t("devicesHoursAgo",{count:c,suffix:c===1?"":"s"}):o===1?t("devicesYesterday"):o<7?`${o} days ago`:n.toLocaleDateString()}function _(){const{t:r}=x();N(r("devicesProfilesTitle"));const{profiles:t,isLoading:n,error:a,deleteProfile:e}=y(),{browserProfileId:i}=j(),{connections:c}=P();return s.jsx(b,{description:r("devicesProfilesDescription"),children:s.jsxs(S,{children:[a&&s.jsx("p",{className:"form-error",children:a}),s.jsx("div",{className:"settings-group",children:n?s.jsx("p",{className:"settings-hint",children:r("devicesLoadingProfiles")}):t.length===0?s.jsx("p",{className:"settings-hint",children:r("devicesEmpty")}):s.jsx("div",{className:"device-list",children:t.map(o=>{const p=o.browserProfileId===i,u=c.has(o.browserProfileId),g=o.deviceName||`${o.browserProfileId.slice(0,8)}...`;return s.jsxs("div",{className:"device-list-item device-profile-item",children:[s.jsxs("div",{className:"device-list-info",children:[s.jsxs("strong",{children:[s.jsx("span",{className:`device-status ${u?"device-status-online":"device-status-offline"}`,title:r(u?"devicesConnected":"devicesDisconnected")}),g,p&&s.jsx("span",{className:"device-current-badge",children:r("devicesThisDevice")})]}),s.jsx("div",{className:"device-origins",children:o.origins.map(l=>{const{browser:v,os:h}=D(l.userAgent);return s.jsxs("div",{className:"device-origin",children:[s.jsx("code",{className:"device-origin-url",children:l.origin}),s.jsxs("span",{className:"device-origin-details",children:[v," · ",h]}),s.jsx("span",{className:"device-origin-time",children:r("devicesLastSeen",{date:m(l.lastSeen,r)})})]},l.origin)})}),s.jsx("p",{className:"device-profile-meta",children:r("devicesFirstSeen",{date:m(o.createdAt,r)})})]}),s.jsx("button",{type:"button",className:"settings-button settings-button-danger-subtle",onClick:()=>e(o.browserProfileId),title:r("devicesForgetThisDevice"),children:r("devicesForget")})]},o.browserProfileId)})})})]})})}export{_ as DevicesSettings};
1
+ import{r as d,j as s}from"./clientSummaryStore-Dsgo1zWK.js";import{c as f,u as x}from"./main-BX4yZXDF.js";import{u as w}from"./useBackgroundRevalidation-SUxysljm.js";import{u as j,a as P}from"./useConnectedDevices-Ciuv3J4o.js";import{u as N,S as b,H as S}from"./index-DnFlh5Zf.js";import{p as D}from"./deviceDetection-BVPclkty.js";import"./react-runtime-D-UPQ57m.js";import"./index-BhTv6hAY.js";import"./appHref-ByaEnJGJ.js";import"./browserTab-CLF9iteD.js";import"./PageHeader-DYCnk788.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-DfkDdP3M.js";import"./HostIdentityContext-_GKYzEQ6.js";import"./Modal-CHNqXAgW.js";import"./remoteRoutePaths-DpabBbC6.js";import"./NavigationLayout-UkQvkodY.js";import"./useSidebarWidth-op0qbgd4.js";import"./frontendReload-B4jfUIeG.js";import"./usePanelSlideAnimations-XdQhGgr-.js";import"./useFileActivity-CpuLfNl9.js";import"./GlossaryContext-BA5X62Ck.js";import"./ProviderBadge-C-UpobLD.js";import"./YepAnywhereLogo-ccRUdgT-.js";import"./index-BSMD-gHP.js";import"./limitedUserBrowserDefaults-CwcMxPe5.js";function y(){const[r,t]=d.useState({profiles:[],isLoading:!0,error:null}),n=d.useCallback(async()=>{t(e=>({...e,isLoading:!0,error:null}));try{const{profiles:e}=await f.getBrowserProfiles();t({profiles:e,isLoading:!1,error:null})}catch(e){console.error("[useBrowserProfiles] Failed to fetch:",e),t(i=>({...i,isLoading:!1,error:e instanceof Error?e.message:"Failed to load profiles"}))}},[]);d.useEffect(()=>{n()},[n]),w({fetcher:()=>f.getBrowserProfiles().then(e=>e.profiles),current:r.profiles,apply:e=>t(i=>({...i,profiles:e,error:null}))});const a=d.useCallback(async e=>{t(i=>({...i,isLoading:!0,error:null}));try{await f.deleteBrowserProfile(e),await n()}catch(i){console.error("[useBrowserProfiles] Failed to delete:",i),t(c=>({...c,isLoading:!1,error:i instanceof Error?i.message:"Failed to delete profile"}))}},[n]);return{...r,deleteProfile:a,refetch:n}}function m(r,t){const n=new Date(r),e=new Date().getTime()-n.getTime(),i=Math.floor(e/(1e3*60)),c=Math.floor(e/(1e3*60*60)),o=Math.floor(e/(1e3*60*60*24));return i<1?t("devicesJustNow"):i<60?t("devicesMinutesAgo",{count:i,suffix:i===1?"":"s"}):c<24?t("devicesHoursAgo",{count:c,suffix:c===1?"":"s"}):o===1?t("devicesYesterday"):o<7?`${o} days ago`:n.toLocaleDateString()}function _(){const{t:r}=x();N(r("devicesProfilesTitle"));const{profiles:t,isLoading:n,error:a,deleteProfile:e}=y(),{browserProfileId:i}=j(),{connections:c}=P();return s.jsx(b,{description:r("devicesProfilesDescription"),children:s.jsxs(S,{children:[a&&s.jsx("p",{className:"form-error",children:a}),s.jsx("div",{className:"settings-group",children:n?s.jsx("p",{className:"settings-hint",children:r("devicesLoadingProfiles")}):t.length===0?s.jsx("p",{className:"settings-hint",children:r("devicesEmpty")}):s.jsx("div",{className:"device-list",children:t.map(o=>{const p=o.browserProfileId===i,u=c.has(o.browserProfileId),g=o.deviceName||`${o.browserProfileId.slice(0,8)}...`;return s.jsxs("div",{className:"device-list-item device-profile-item",children:[s.jsxs("div",{className:"device-list-info",children:[s.jsxs("strong",{children:[s.jsx("span",{className:`device-status ${u?"device-status-online":"device-status-offline"}`,title:r(u?"devicesConnected":"devicesDisconnected")}),g,p&&s.jsx("span",{className:"device-current-badge",children:r("devicesThisDevice")})]}),s.jsx("div",{className:"device-origins",children:o.origins.map(l=>{const{browser:v,os:h}=D(l.userAgent);return s.jsxs("div",{className:"device-origin",children:[s.jsx("code",{className:"device-origin-url",children:l.origin}),s.jsxs("span",{className:"device-origin-details",children:[v," · ",h]}),s.jsx("span",{className:"device-origin-time",children:r("devicesLastSeen",{date:m(l.lastSeen,r)})})]},l.origin)})}),s.jsx("p",{className:"device-profile-meta",children:r("devicesFirstSeen",{date:m(o.createdAt,r)})})]}),s.jsx("button",{type:"button",className:"settings-button settings-button-danger-subtle",onClick:()=>e(o.browserProfileId),title:r("devicesForgetThisDevice"),children:r("devicesForget")})]},o.browserProfileId)})})})]})})}export{_ as DevicesSettings};
@@ -1 +1 @@
1
- import{j as o,r as d,d as J}from"./clientSummaryStore-Cr4yWo-Y.js";import{u as M,c as Q}from"./main-BpQ_EIjC.js";import{A as B,c as H,d as V,e as z,f as Z,Q as ee,u as te,a as ne}from"./useEmulators-cGrsK5mh.js";import{P as re}from"./PageHeader-Dbb8BZq2.js";import{b as oe,d as se}from"./Modal-iT2_XPlO.js";import{MainContent as F}from"./index-D73NQkRu.js";import{u as ie}from"./NavigationLayout-BpvrdPoS.js";import{s as U,a0 as ae,a1 as ce}from"./index-C-4wHkcA.js";import"./react-runtime-D-UPQ57m.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./remoteRoutePaths-Crh_32jX.js";import"./useSidebarWidth-DnB-wKom.js";import"./frontendReload-54GeNGj9.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./useFileActivity-Y1m-dClR.js";import"./GlossaryContext-PMCo1K6f.js";import"./ProviderBadge-DmhZSMRX.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-CIpZ5dke.js";const le="_root_1sqe4_1",de="_button_1sqe4_10",L={root:le,button:de};function ue({dataChannel:e,deviceType:t}){const{t:a}=M(),i=t==="emulator"||t==="android";if(!i&&!(t==="ios-simulator"))return null;const _=c=>{(e==null?void 0:e.readyState)==="open"&&e.send(JSON.stringify({type:"key",key:c}))},E=(e==null?void 0:e.readyState)!=="open";return o.jsxs("div",{className:L.root,role:"group","aria-label":a("emulatorDeviceNavigation"),children:[i&&o.jsx("button",{type:"button",className:L.button,onClick:()=>_("GoBack"),disabled:E,title:"Back","aria-label":"Back",children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("polyline",{points:"15 18 9 12 15 6"})})}),o.jsx("button",{type:"button",className:L.button,onClick:()=>_("GoHome"),disabled:E,title:"Home","aria-label":"Home",children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})})}),i&&o.jsx("button",{type:"button",className:L.button,onClick:()=>_("AppSwitch"),disabled:E,title:"Recents","aria-label":"Recents",children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})})]})}function me(e){const t=e.getBoundingClientRect(),a=e.videoWidth,i=e.videoHeight;if(!a||!i)return t;const b=Math.min(t.width/a,t.height/i),_=a*b,E=i*b;return new DOMRect(t.left+(t.width-_)/2,t.top+(t.height-E)/2,_,E)}function j(e){return Math.max(0,Math.min(1,e))}function fe(e,t,a){if(a.width<=0||a.height<=0)return null;const i=(e-a.left)/a.width,b=(t-a.top)/a.height;return i<0||i>1||b<0||b>1?null:{x:j(i),y:j(b)}}function Ee(e,t,a){if(a.width<=0||a.height<=0)return null;const i=(e-a.left)/a.width,b=(t-a.top)/a.height;return{x:j(i),y:j(b)}}const pe={Backspace:"KEYCODE_DEL",Delete:"KEYCODE_FORWARD_DEL",Enter:"KEYCODE_ENTER",Tab:"KEYCODE_TAB",Escape:"KEYCODE_ESCAPE"," ":"KEYCODE_SPACE",ArrowLeft:"KEYCODE_DPAD_LEFT",ArrowRight:"KEYCODE_DPAD_RIGHT",ArrowUp:"KEYCODE_DPAD_UP",ArrowDown:"KEYCODE_DPAD_DOWN",Home:"KEYCODE_MOVE_HOME",End:"KEYCODE_MOVE_END",PageUp:"KEYCODE_PAGE_UP",PageDown:"KEYCODE_PAGE_DOWN",Insert:"KEYCODE_INSERT",".":"KEYCODE_PERIOD",",":"KEYCODE_COMMA","/":"KEYCODE_SLASH","\\":"KEYCODE_BACKSLASH","-":"KEYCODE_MINUS","=":"KEYCODE_EQUALS",";":"KEYCODE_SEMICOLON","'":"KEYCODE_APOSTROPHE","[":"KEYCODE_LEFT_BRACKET","]":"KEYCODE_RIGHT_BRACKET","`":"KEYCODE_GRAVE"},_e={Space:"KEYCODE_SPACE",Enter:"KEYCODE_ENTER",Tab:"KEYCODE_TAB",Escape:"KEYCODE_ESCAPE",Backspace:"KEYCODE_DEL",Delete:"KEYCODE_FORWARD_DEL",ArrowLeft:"KEYCODE_DPAD_LEFT",ArrowRight:"KEYCODE_DPAD_RIGHT",ArrowUp:"KEYCODE_DPAD_UP",ArrowDown:"KEYCODE_DPAD_DOWN",Home:"KEYCODE_MOVE_HOME",End:"KEYCODE_MOVE_END",PageUp:"KEYCODE_PAGE_UP",PageDown:"KEYCODE_PAGE_DOWN",Insert:"KEYCODE_INSERT",Period:"KEYCODE_PERIOD",Comma:"KEYCODE_COMMA",Slash:"KEYCODE_SLASH",Backslash:"KEYCODE_BACKSLASH",Minus:"KEYCODE_MINUS",Equal:"KEYCODE_EQUALS",Semicolon:"KEYCODE_SEMICOLON",Quote:"KEYCODE_APOSTROPHE",BracketLeft:"KEYCODE_LEFT_BRACKET",BracketRight:"KEYCODE_RIGHT_BRACKET",Backquote:"KEYCODE_GRAVE"};function he(e){return e==="emulator"||e==="android"||e==="ios-simulator"}function De(e){if(e.isComposing||e.ctrlKey||e.metaKey||e.altKey)return null;if(e.key.length===1)return e.key;const t=pe[e.key];return t||(e.code.startsWith("Key")&&e.code.length===4?`KEYCODE_${e.code.slice(3).toUpperCase()}`:e.code.startsWith("Digit")&&e.code.length===6?`KEYCODE_${e.code.slice(5)}`:_e[e.code]??null)}const ge=new Set(["Backspace","Delete","Enter","Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Insert"]);function ye(e){if(e.isComposing||e.ctrlKey||e.metaKey||e.altKey)return null;let t=e.key;return t==="Esc"&&(t="Escape"),t==="Spacebar"&&(t=" "),t===""||t==="Dead"||t==="Unidentified"||t==="Shift"||t==="Control"||t==="Alt"||t==="Meta"?null:t.length===1||ge.has(t)||/^F\d{1,2}$/.test(t)?t:null}function Se(e,t){return t==="emulator"||t==="ios-simulator"?ye(e):De(e)}function ve(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function be({stream:e,dataChannel:t,deviceType:a,peerConnection:i,adaptiveFps:b=!1,configuredFps:_=30}){const E=d.useRef(null);d.useEffect(()=>{const s=E.current;if(!s||(s.srcObject=e,!e))return;const $=e.getVideoTracks();console.log(`[DeviceStream] attached stream: ${$.length} video track(s), active=${e.active}`);for(const f of $)console.log(`[DeviceStream] track ${f.id}: readyState=${f.readyState} enabled=${f.enabled} muted=${f.muted}`);let D=-1,S=0,y=0,p=0;const m=setInterval(async()=>{const f=s.currentTime;if(D>=0&&f===D&&!s.paused){S++;let K="";if(i&&i.connectionState!=="closed")try{const u=await i.getStats();for(const n of u.values())if(n.type==="inbound-rtp"&&n.kind==="video"){const r=n.packetsReceived??0,A=n.bytesReceived??0,Y=n.packetsLost??0,G=r-y,q=A-p;y=r,p=A,K=` rtp: +${G}pkts/+${q}bytes (total=${r}, lost=${Y})`}}catch{}if(S===1)console.warn(`[DeviceStream] video stale: currentTime=${f.toFixed(3)} not advancing${K}`);else if(S%6===0){const u=e.getVideoTracks()[0];console.warn(`[DeviceStream] video still stale (${S*5}s): currentTime=${f.toFixed(3)}, track=${(u==null?void 0:u.readyState)??"none"}, streamActive=${e.active}${K}`)}else console.warn(`[DeviceStream] video stale (${S*5}s)${K}`)}else if(S>0&&console.log(`[DeviceStream] video resumed after ${S*5}s stale`),S=0,i&&i.connectionState!=="closed")try{const K=await i.getStats();for(const u of K.values())u.type==="inbound-rtp"&&u.kind==="video"&&(y=u.packetsReceived??0,p=u.bytesReceived??0)}catch{}D=f},5e3),T=f=>{console.warn(`[DeviceStream] stream removetrack: ${f.track.kind} ${f.track.id}`)},h=()=>{console.warn("[DeviceStream] stream became inactive")};return e.addEventListener("removetrack",T),e.addEventListener("inactive",h),()=>{clearInterval(m),e.removeEventListener("removetrack",T),e.removeEventListener("inactive",h)}},[e,i]),d.useEffect(()=>{if(!b||!i||!t)return;let s=0,$=0,D=null;const S=setInterval(async()=>{if(i.connectionState==="closed"||t.readyState!=="open")return;let y=0,p=0;try{const h=await i.getStats();for(const f of h.values())if(f.type==="inbound-rtp"&&f.kind==="video"){const K=f.packetsReceived??0,u=f.packetsLost??0;y=K-s,p=Math.max(0,u-$),s=K,$=u}}catch{return}const m=y+p,T=m>0?p/m:0;T>B?D?D=Date.now():(D=Date.now(),t.send(JSON.stringify({type:"fps_hint",fps:H})),console.warn(`[DeviceStream] adaptive: loss rate ${(T*100).toFixed(1)}% > ${B*100}%, dropping to ${H}fps`)):D!==null&&Date.now()-D>=V*1e3&&(D=null,t.send(JSON.stringify({type:"fps_hint",fps:_})),console.log(`[DeviceStream] adaptive: loss-free for ${V}s, restoring to ${_}fps`))},z);return()=>clearInterval(S)},[b,i,t,_]);const c=d.useCallback(()=>t&&t.readyState==="open",[t]),k=d.useCallback(s=>{!c()||!t||t.send(JSON.stringify({type:"key",key:s}))},[c,t]);d.useEffect(()=>{if(!he(a))return;const s=$=>{if(!c()||!t||ve($.target))return;const D=Se($,a);D&&($.preventDefault(),k(D))};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[c,t,a,k]);const g=d.useCallback((s,$)=>{if(!c()||!t)return;const D=me($),S=s.map(y=>{const p=y.pressure<=0?Ee(y.clientX,y.clientY,D):fe(y.clientX,y.clientY,D);return p?{x:p.x,y:p.y,pressure:y.pressure,id:y.id}:null}).filter(y=>y!==null);S.length!==0&&t.send(JSON.stringify({type:"touch",touches:S}))},[c,t]);d.useEffect(()=>{const s=E.current;if(!s)return;const $=p=>{p.preventDefault(),g(Array.from(p.touches).map(m=>({clientX:m.clientX,clientY:m.clientY,id:m.identifier,pressure:m.force||.5})),s)},D=p=>{p.preventDefault(),g(Array.from(p.touches).map(m=>({clientX:m.clientX,clientY:m.clientY,id:m.identifier,pressure:m.force||.5})),s)},S=p=>{p.preventDefault(),g(Array.from(p.changedTouches).map(m=>({clientX:m.clientX,clientY:m.clientY,id:m.identifier,pressure:0})),s)},y={passive:!1};return s.addEventListener("touchstart",$,y),s.addEventListener("touchmove",D,y),s.addEventListener("touchend",S,y),s.addEventListener("touchcancel",S,y),()=>{s.removeEventListener("touchstart",$),s.removeEventListener("touchmove",D),s.removeEventListener("touchend",S),s.removeEventListener("touchcancel",S)}},[g]);const w=d.useRef(!1),R=d.useCallback(s=>{s.preventDefault(),w.current=!0,g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:.5}],s.currentTarget)},[g]),x=d.useCallback(s=>{w.current&&(s.preventDefault(),g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:.5}],s.currentTarget))},[g]),C=d.useCallback(s=>{w.current&&(w.current=!1,s.preventDefault(),g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:0}],s.currentTarget))},[g]),O=d.useCallback(s=>{w.current&&(w.current=!1,g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:0}],s.currentTarget))},[g]);return o.jsx("video",{ref:E,className:"emulator-video",autoPlay:!0,playsInline:!0,muted:!0,tabIndex:0,"aria-label":"Device stream",onMouseDown:R,onMouseMove:x,onMouseUp:C,onMouseLeave:O})}const v="[DeviceStream]",$e=8;function we(){typeof window>"u"||(window.__YEP_DEVICE_STREAM_PROFILE_EVENTS__=[])}function ke(e){if(typeof window>"u")return;const t=window,a=t.__YEP_DEVICE_STREAM_PROFILE_EVENTS__??[];a.push(e),t.__YEP_DEVICE_STREAM_PROFILE_EVENTS__=a,window.dispatchEvent(new CustomEvent("yep:device_stream_profile_event",{detail:e}))}function P(e,t){try{return Promise.resolve(e.send(t))}catch(a){return Promise.reject(a)}}function Ce(){const e=oe().transport,t=e.capabilities.device,[a,i]=d.useState(null),[b,_]=d.useState(null),[E,c]=d.useState("idle"),[k,g]=d.useState(null),[w,R]=d.useState(null),[x,C]=d.useState([]),O=d.useRef(null),s=d.useRef(null),$=d.useRef(null),D=d.useRef(null),S=d.useCallback(()=>{const p=s.current;if(console.log(`${v} disconnect() called, session=${p}`),p){const m=$.current;m&&P(m,{type:"device_stream_stop",sessionId:p}).catch(()=>{})}if(O.current){const m=O.current;console.log(`${v} closing RTCPeerConnection (state=${m.connectionState}, ice=${m.iceConnectionState})`),m.close(),O.current=null}D.current&&(D.current(),D.current=null),s.current=null,$.current=null,i(null),_(null),c("idle"),g(null),R(null),C([])},[]),y=d.useCallback(p=>{S();const m=t;if(!m){c("failed"),g("Device streaming is not available for this source");return}const T=J();s.current=T,$.current=m;const h=T.slice(0,8);console.log(`${v} connect(deviceId=${p.id}, type=${p.type??"unknown"}, session=${h})`),c("connecting"),g(null),R(null),C([]),we();const f=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});O.current=f,f.ontrack=n=>{const r=n.track;console.log(`${v} [${h}] ontrack: kind=${r.kind} id=${r.id} readyState=${r.readyState} muted=${r.muted}`),n.streams[0]&&i(n.streams[0]),r.onmute=()=>console.warn(`${v} [${h}] track MUTED: ${r.id}`),r.onunmute=()=>console.log(`${v} [${h}] track unmuted: ${r.id}`),r.onended=()=>console.warn(`${v} [${h}] track ENDED: ${r.id}`)},f.ondatachannel=n=>{const r=n.channel;console.log(`${v} [${h}] ondatachannel: label=${r.label} id=${r.id}`),r.onopen=()=>{console.log(`${v} [${h}] DataChannel "${r.label}" opened`),_(r)},r.onclose=()=>{console.warn(`${v} [${h}] DataChannel "${r.label}" closed`),_(null)},r.onerror=A=>{console.error(`${v} [${h}] DataChannel "${r.label}" error:`,A)}},f.onconnectionstatechange=()=>{switch(console.log(`${v} [${h}] connectionState: ${f.connectionState}`),f.connectionState){case"connected":c("connected");break;case"disconnected":c("disconnected");break;case"failed":c("failed"),g("WebRTC connection failed");break;case"closed":c("disconnected");break}},f.oniceconnectionstatechange=()=>{console.log(`${v} [${h}] iceConnectionState: ${f.iceConnectionState}`)},f.onicegatheringstatechange=()=>{console.log(`${v} [${h}] iceGatheringState: ${f.iceGatheringState}`)},f.onsignalingstatechange=()=>{console.log(`${v} [${h}] signalingState: ${f.signalingState}`)},f.onicecandidate=n=>{n.candidate?console.log(`${v} [${h}] sending ICE candidate: ${n.candidate.candidate.slice(0,60)}...`):console.log(`${v} [${h}] ICE gathering complete (null candidate)`),P(m,{type:"device_ice_candidate",sessionId:T,candidate:n.candidate?{candidate:n.candidate.candidate,sdpMid:n.candidate.sdpMid,sdpMLineIndex:n.candidate.sdpMLineIndex,usernameFragment:n.candidate.usernameFragment}:null}).catch(r=>{c("failed"),g(`Connection failed: ${r instanceof Error?r.message:String(r)}`)})};const K=m.onMessage(async n=>{if(n.sessionId===T)switch(n.type){case"device_webrtc_offer":{console.log(`${v} [${h}] received SDP offer (${n.sdp.length} bytes)`);try{await f.setRemoteDescription({type:"offer",sdp:n.sdp});const r=await f.createAnswer();await f.setLocalDescription(r),console.log(`${v} [${h}] sent SDP answer (${(r.sdp??"").length} bytes)`),await P(m,{type:"device_webrtc_answer",sessionId:T,sdp:r.sdp??""})}catch(r){console.error(`${v} [${h}] SDP negotiation failed:`,r),c("failed"),g(`WebRTC negotiation failed: ${r instanceof Error?r.message:String(r)}`)}break}case"device_ice_candidate_event":{if(n.candidate){console.log(`${v} [${h}] received remote ICE candidate`);try{await f.addIceCandidate(n.candidate)}catch(r){console.warn(`${v} [${h}] failed to add ICE candidate:`,r)}}else console.log(`${v} [${h}] remote ICE gathering complete`);break}case"device_session_state":{console.log(`${v} [${h}] server session state: ${n.state}${n.error?` error=${n.error}`:""}`),(n.state==="failed"||n.state==="disconnected")&&(c(n.state),n.error&&g(n.error));break}case"device_stream_profile_event":{console.log(`${v} [${h}] stream profile event: ${n.direction} tier=${n.tier}/${n.totalTiers} ${n.width}x${n.height}@${n.fps} bitrate=${n.bitrate}`);const r={...n,receivedAt:Date.now()};R(n),C(A=>[r,...A].slice(0,$e)),ke(n);break}}});D.current=K;const u=async()=>{const{maxFps:n,maxWidth:r,quality:A}=Z(),Y=ee[A];console.log(`${v} [${h}] sending device_stream_start fps=${n} width=${r} quality=${A}(crf=${Y})`),await P(m,{type:"device_stream_start",sessionId:T,deviceId:p.id,deviceType:p.type,options:{maxFps:n,maxWidth:r,quality:Y}})};Promise.resolve().then(async()=>{e.status.getSnapshot().state!=="ready"&&await e.reconnect(),await u()}).catch(n=>{console.error(`${v} [${h}] device signaling failed:`,n),c("failed"),g(`Connection failed: ${n instanceof Error?n.message:String(n)}`)})},[t,S,e]);return d.useEffect(()=>{const p=$.current;p&&p!==t&&S()},[t,S]),d.useEffect(()=>()=>{if(O.current&&(O.current.close(),O.current=null),D.current&&(D.current(),D.current=null),s.current){const p=$.current;p&&P(p,{type:"device_stream_stop",sessionId:s.current}).catch(()=>{})}},[]),{remoteStream:a,dataChannel:b,peerConnection:O.current,connectionState:E,error:k,latestProfileEvent:w,profileEventHistory:x,connect:y,disconnect:S}}const Oe="_list_122d7_2",Te="_group_122d7_8",Ae="_groupTitle_122d7_14",Ke="_item_122d7_23",xe="_itemInfo_122d7_33",Re="_itemName_122d7_39",Ye="_itemStatus_122d7_44",Ne="_running_122d7_49",Pe="_stopped_122d7_53",Ie="_itemActions_122d7_57",Le="_btn_122d7_63",je="_btnPrimary_122d7_72",Me="_btnSecondary_122d7_81",Be="_streamView_122d7_91",He="_streamHeader_122d7_98",Ve="_connectionState_122d7_107",Fe="_streamHeaderActions_122d7_114",Ue="_keyboardState_122d7_119",We="_profileState_122d7_127",Xe="_profileTimeline_122d7_135",Ge="_profileTimelineItem_122d7_144",qe="_latest_122d7_154",Je="_profileTimelineTime_122d7_158",Qe="_profileTimelineDetail_122d7_163",ze="_streamContainer_122d7_169",Ze="_loading_122d7_180",et="_empty_122d7_181",tt="_error_122d7_187",nt="_connecting_122d7_196",rt="_downloadPrompt_122d7_203",l={list:Oe,group:Te,groupTitle:Ae,item:Ke,itemInfo:xe,itemName:Re,itemStatus:Ye,running:Ne,stopped:Pe,itemActions:Ie,btn:Le,btnPrimary:je,btnSecondary:Me,streamView:Be,streamHeader:He,connectionState:Ve,streamHeaderActions:Fe,keyboardState:Ue,profileState:We,profileTimeline:Xe,profileTimelineItem:Ge,latest:qe,profileTimelineTime:Je,profileTimelineDetail:Qe,streamContainer:ze,loading:Ze,empty:et,error:tt,connecting:nt,downloadPrompt:rt},W=["emulator","android","chromeos","ios-simulator"];function X(e){return e.label||e.avd||e.id}function ot(e){switch(e){case"emulator":return"Android Emulators";case"android":return"Android Devices";case"chromeos":return"ChromeOS Devices";case"ios-simulator":return"iOS Simulators";default:return"Devices"}}function I(e,t){var a;return(a=e.actions)!=null&&a.length?e.actions.includes(t):t==="stream"?e.state!=="stopped":t==="start"?e.type==="emulator"&&e.state==="stopped":t==="stop"?e.type==="emulator"&&e.state!=="stopped":!1}function N(){return navigator.keyboard}function st({device:e,onConnect:t,onStart:a,onStop:i}){const b=I(e,"stream"),_=I(e,"start"),E=I(e,"stop");return o.jsxs("div",{className:l.item,"data-testid":"device-row",children:[o.jsxs("div",{className:l.itemInfo,children:[o.jsx("span",{className:l.itemName,children:X(e)}),o.jsx("span",{className:`${l.itemStatus} ${e.state==="stopped"?l.stopped:l.running}`,children:e.state})]}),o.jsxs("div",{className:l.itemActions,children:[b&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnPrimary}`,onClick:()=>t(e),children:"Connect"}),E&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:()=>i(e.id),children:"Stop"}),!E&&_&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:()=>a(e.id),children:"Start"}),!b&&!E&&!_&&o.jsx("span",{className:l.itemStatus,children:"No actions"})]})]})}function it({devices:e,onConnect:t,onStart:a,onStop:i}){const b=d.useMemo(()=>{const _=new Map;for(const E of W)_.set(E,[]);for(const E of e){const c=_.get(E.type);c?c.push(E):_.set(E.type,[E])}return _},[e]);return o.jsx("div",{className:l.list,children:Array.from(b.entries()).map(([_,E])=>E.length===0?null:o.jsxs("section",{className:l.group,"data-testid":"device-group",children:[o.jsx("h3",{className:l.groupTitle,"data-testid":"device-group-title",children:ot(_)}),E.map(c=>o.jsx(st,{device:c,onConnect:t,onStart:a,onStop:i},c.id))]},_))})}function at(e){for(const t of W){const a=e.find(i=>i.type===t&&I(i,"stream"));if(a)return a}return e.find(t=>I(t,"stream"))}function ct({device:e,onBack:t}){var K;const{remoteStream:a,dataChannel:i,peerConnection:b,connectionState:_,error:E,latestProfileEvent:c,profileEventHistory:k,connect:g,disconnect:w}=Ce(),{adaptiveFps:R,maxFps:x}=ne(),C=d.useRef(null),[O,s]=d.useState(!1),[$,D]=d.useState(!1),[S,y]=d.useState(null),m=(e.type==="emulator"||e.type==="android")&&document.fullscreenEnabled&&typeof((K=N())==null?void 0:K.lock)=="function";d.useEffect(()=>(g({id:e.id,type:e.type}),()=>w()),[e.id,e.type,g,w]),d.useEffect(()=>{const u=()=>{var r,A;const n=document.fullscreenElement===C.current;s(n),n||(A=(r=N())==null?void 0:r.unlock)==null||A.call(r)};return document.addEventListener("fullscreenchange",u),()=>{var n,r;document.removeEventListener("fullscreenchange",u),(r=(n=N())==null?void 0:n.unlock)==null||r.call(n)}},[]);const T=d.useCallback(async()=>{var u,n;D(!0),y(null);try{(n=(u=N())==null?void 0:u.unlock)==null||n.call(u),document.fullscreenElement===C.current&&await document.exitFullscreen(),s(!1)}catch(r){y(`Failed to exit immersive keyboard: ${r instanceof Error?r.message:String(r)}`)}finally{D(!1)}},[]),h=d.useCallback(async()=>{var u,n,r,A;if(!(!m||!C.current)){D(!0),y(null);try{document.fullscreenElement!==C.current&&await C.current.requestFullscreen(),await((n=(u=N())==null?void 0:u.lock)==null?void 0:n.call(u)),s(!0)}catch(Y){(A=(r=N())==null?void 0:r.unlock)==null||A.call(r),s(!1),y(`Immersive keyboard failed: ${Y instanceof Error?Y.message:String(Y)}`)}finally{D(!1)}}},[m]),f=()=>{T(),w(),t()};return o.jsxs("div",{className:l.streamView,ref:C,children:[o.jsxs("div",{className:l.streamHeader,children:[o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:f,children:"Back"}),o.jsxs("span",{className:l.connectionState,"data-testid":"device-connection-state",children:[X(e)," - ",_]}),o.jsx("div",{className:l.streamHeaderActions,children:m&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:()=>{O?T():h()},disabled:$,title:"Request fullscreen and keyboard lock",children:$?"Working...":O?"Exit Immersive Keyboard":"Immersive Keyboard"})})]}),m&&o.jsxs("div",{className:l.keyboardState,children:["Keyboard mode:"," ",O?"immersive (fullscreen)":"standard"]}),S&&o.jsx("div",{className:l.error,children:S}),c&&o.jsxs("div",{className:l.profileState,children:["Profile ",c.direction,": tier ",c.tier,"/",c.totalTiers," (",c.width,"x",c.height,"@",c.fps,"fps,"," ",Math.round(c.bitrate/1e3)," kbps)"]}),k.length>0&&o.jsx("div",{className:l.profileTimeline,"data-testid":"profile-timeline",children:k.map((u,n)=>o.jsxs("div",{className:`${l.profileTimelineItem} ${n===0?l.latest:""}`,children:[o.jsx("span",{className:l.profileTimelineTime,children:new Date(u.receivedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),o.jsxs("span",{className:l.profileTimelineDetail,children:[u.direction," tier ",u.tier,"/",u.totalTiers," (",u.width,"x",u.height,"@",u.fps,")"]})]},`${u.receivedAt}-${u.direction}-${u.tier}-${n}`))}),E&&o.jsx("div",{className:l.error,children:E}),_==="connecting"&&o.jsx("div",{className:l.connecting,children:"Connecting..."}),o.jsx("div",{className:l.streamContainer,children:o.jsx(be,{stream:a,dataChannel:i,deviceType:e.type,peerConnection:b,adaptiveFps:R,configuredFps:x})}),o.jsx(ue,{dataChannel:i,deviceType:e.type})]})}function lt({mode:e,installedVersion:t,latestVersion:a,onDownloaded:i}){const{t:b}=M(),[_,E]=d.useState(!1),[c,k]=d.useState(null),g=async()=>{E(!0),k(null);try{const w=await Q.downloadDeviceBridge();w.ok?i():k(w.error??"Download failed")}catch(w){k(w instanceof Error?w.message:String(w))}finally{E(!1)}};return o.jsxs("div",{className:l.downloadPrompt,children:[o.jsx("p",{children:e==="update"?o.jsxs(o.Fragment,{children:[b("emulatorBridgeUpdateRequired"),t&&a?` Installed: v${t}. Latest: v${a}.`:null]}):b("emulatorBridgeDownloadRequired")}),c&&o.jsx("div",{className:l.error,children:c}),o.jsx("button",{type:"button",className:`${l.btn} ${l.btnPrimary}`,onClick:g,disabled:_,children:_?e==="update"?"Updating...":"Downloading...":e==="update"?"Update Bridge":"Download Bridge"})]})}function Kt(){const{t:e}=M(),{openSidebar:t,isWideScreen:a}=ie(),{version:i,refetch:b}=se(),_=(i==null?void 0:i.deviceBridgeState)==="update-available"?"update":U(i,ae)&&!U(i,ce)?"download":null,E=_!==null,{emulators:c,loading:k,error:g,startEmulator:w,stopEmulator:R}=te({enabled:!E}),[x,C]=d.useState(null);return d.useEffect(()=>{if(x||k||E||!new URLSearchParams(window.location.search).has("auto"))return;const s=at(c);s&&C(s)},[c,k,x,E]),x?o.jsx(F,{isWideScreen:a,children:o.jsx(ct,{device:x,onBack:()=>C(null)})}):o.jsxs(F,{isWideScreen:a,children:[o.jsx(re,{title:"Devices",onOpenSidebar:t,isWideScreen:a}),o.jsx("main",{className:"page-scroll-container",children:o.jsx("div",{className:"page-content-inner",children:_?o.jsx(lt,{mode:_,installedVersion:i==null?void 0:i.deviceBridgeVersion,latestVersion:i==null?void 0:i.latestDeviceBridgeVersion,onDownloaded:b}):o.jsxs(o.Fragment,{children:[k&&o.jsx("div",{className:l.loading,children:"Loading..."}),g&&o.jsx("div",{className:l.error,children:g}),!k&&c.length===0&&o.jsx("div",{className:l.empty,children:e("emulatorPageNoDevices")}),c.length>0&&o.jsx(it,{devices:c,onConnect:C,onStart:w,onStop:R})]})})})]})}export{lt as BridgeRuntimePrompt,Kt as EmulatorPage};
1
+ import{j as o,r as d,d as J}from"./clientSummaryStore-Dsgo1zWK.js";import{u as M,c as Q}from"./main-BX4yZXDF.js";import{A as B,c as H,d as V,e as z,f as Z,Q as ee,u as te,a as ne}from"./useEmulators-CQCzysEZ.js";import{P as re}from"./PageHeader-DYCnk788.js";import{b as oe,d as se}from"./Modal-CHNqXAgW.js";import{MainContent as F}from"./index-BSMD-gHP.js";import{u as ie}from"./NavigationLayout-UkQvkodY.js";import{s as U,a0 as ae,a1 as ce}from"./index-BhTv6hAY.js";import"./react-runtime-D-UPQ57m.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-DfkDdP3M.js";import"./HostIdentityContext-_GKYzEQ6.js";import"./remoteRoutePaths-DpabBbC6.js";import"./useSidebarWidth-op0qbgd4.js";import"./frontendReload-B4jfUIeG.js";import"./usePanelSlideAnimations-XdQhGgr-.js";import"./useFileActivity-CpuLfNl9.js";import"./GlossaryContext-BA5X62Ck.js";import"./ProviderBadge-C-UpobLD.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-ccRUdgT-.js";const le="_root_1sqe4_1",de="_button_1sqe4_10",L={root:le,button:de};function ue({dataChannel:e,deviceType:t}){const{t:a}=M(),i=t==="emulator"||t==="android";if(!i&&!(t==="ios-simulator"))return null;const _=c=>{(e==null?void 0:e.readyState)==="open"&&e.send(JSON.stringify({type:"key",key:c}))},E=(e==null?void 0:e.readyState)!=="open";return o.jsxs("div",{className:L.root,role:"group","aria-label":a("emulatorDeviceNavigation"),children:[i&&o.jsx("button",{type:"button",className:L.button,onClick:()=>_("GoBack"),disabled:E,title:"Back","aria-label":"Back",children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("polyline",{points:"15 18 9 12 15 6"})})}),o.jsx("button",{type:"button",className:L.button,onClick:()=>_("GoHome"),disabled:E,title:"Home","aria-label":"Home",children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})})}),i&&o.jsx("button",{type:"button",className:L.button,onClick:()=>_("AppSwitch"),disabled:E,title:"Recents","aria-label":"Recents",children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})})]})}function me(e){const t=e.getBoundingClientRect(),a=e.videoWidth,i=e.videoHeight;if(!a||!i)return t;const b=Math.min(t.width/a,t.height/i),_=a*b,E=i*b;return new DOMRect(t.left+(t.width-_)/2,t.top+(t.height-E)/2,_,E)}function j(e){return Math.max(0,Math.min(1,e))}function fe(e,t,a){if(a.width<=0||a.height<=0)return null;const i=(e-a.left)/a.width,b=(t-a.top)/a.height;return i<0||i>1||b<0||b>1?null:{x:j(i),y:j(b)}}function Ee(e,t,a){if(a.width<=0||a.height<=0)return null;const i=(e-a.left)/a.width,b=(t-a.top)/a.height;return{x:j(i),y:j(b)}}const pe={Backspace:"KEYCODE_DEL",Delete:"KEYCODE_FORWARD_DEL",Enter:"KEYCODE_ENTER",Tab:"KEYCODE_TAB",Escape:"KEYCODE_ESCAPE"," ":"KEYCODE_SPACE",ArrowLeft:"KEYCODE_DPAD_LEFT",ArrowRight:"KEYCODE_DPAD_RIGHT",ArrowUp:"KEYCODE_DPAD_UP",ArrowDown:"KEYCODE_DPAD_DOWN",Home:"KEYCODE_MOVE_HOME",End:"KEYCODE_MOVE_END",PageUp:"KEYCODE_PAGE_UP",PageDown:"KEYCODE_PAGE_DOWN",Insert:"KEYCODE_INSERT",".":"KEYCODE_PERIOD",",":"KEYCODE_COMMA","/":"KEYCODE_SLASH","\\":"KEYCODE_BACKSLASH","-":"KEYCODE_MINUS","=":"KEYCODE_EQUALS",";":"KEYCODE_SEMICOLON","'":"KEYCODE_APOSTROPHE","[":"KEYCODE_LEFT_BRACKET","]":"KEYCODE_RIGHT_BRACKET","`":"KEYCODE_GRAVE"},_e={Space:"KEYCODE_SPACE",Enter:"KEYCODE_ENTER",Tab:"KEYCODE_TAB",Escape:"KEYCODE_ESCAPE",Backspace:"KEYCODE_DEL",Delete:"KEYCODE_FORWARD_DEL",ArrowLeft:"KEYCODE_DPAD_LEFT",ArrowRight:"KEYCODE_DPAD_RIGHT",ArrowUp:"KEYCODE_DPAD_UP",ArrowDown:"KEYCODE_DPAD_DOWN",Home:"KEYCODE_MOVE_HOME",End:"KEYCODE_MOVE_END",PageUp:"KEYCODE_PAGE_UP",PageDown:"KEYCODE_PAGE_DOWN",Insert:"KEYCODE_INSERT",Period:"KEYCODE_PERIOD",Comma:"KEYCODE_COMMA",Slash:"KEYCODE_SLASH",Backslash:"KEYCODE_BACKSLASH",Minus:"KEYCODE_MINUS",Equal:"KEYCODE_EQUALS",Semicolon:"KEYCODE_SEMICOLON",Quote:"KEYCODE_APOSTROPHE",BracketLeft:"KEYCODE_LEFT_BRACKET",BracketRight:"KEYCODE_RIGHT_BRACKET",Backquote:"KEYCODE_GRAVE"};function he(e){return e==="emulator"||e==="android"||e==="ios-simulator"}function De(e){if(e.isComposing||e.ctrlKey||e.metaKey||e.altKey)return null;if(e.key.length===1)return e.key;const t=pe[e.key];return t||(e.code.startsWith("Key")&&e.code.length===4?`KEYCODE_${e.code.slice(3).toUpperCase()}`:e.code.startsWith("Digit")&&e.code.length===6?`KEYCODE_${e.code.slice(5)}`:_e[e.code]??null)}const ge=new Set(["Backspace","Delete","Enter","Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Insert"]);function ye(e){if(e.isComposing||e.ctrlKey||e.metaKey||e.altKey)return null;let t=e.key;return t==="Esc"&&(t="Escape"),t==="Spacebar"&&(t=" "),t===""||t==="Dead"||t==="Unidentified"||t==="Shift"||t==="Control"||t==="Alt"||t==="Meta"?null:t.length===1||ge.has(t)||/^F\d{1,2}$/.test(t)?t:null}function Se(e,t){return t==="emulator"||t==="ios-simulator"?ye(e):De(e)}function ve(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function be({stream:e,dataChannel:t,deviceType:a,peerConnection:i,adaptiveFps:b=!1,configuredFps:_=30}){const E=d.useRef(null);d.useEffect(()=>{const s=E.current;if(!s||(s.srcObject=e,!e))return;const $=e.getVideoTracks();console.log(`[DeviceStream] attached stream: ${$.length} video track(s), active=${e.active}`);for(const f of $)console.log(`[DeviceStream] track ${f.id}: readyState=${f.readyState} enabled=${f.enabled} muted=${f.muted}`);let D=-1,S=0,y=0,p=0;const m=setInterval(async()=>{const f=s.currentTime;if(D>=0&&f===D&&!s.paused){S++;let K="";if(i&&i.connectionState!=="closed")try{const u=await i.getStats();for(const n of u.values())if(n.type==="inbound-rtp"&&n.kind==="video"){const r=n.packetsReceived??0,A=n.bytesReceived??0,Y=n.packetsLost??0,G=r-y,q=A-p;y=r,p=A,K=` rtp: +${G}pkts/+${q}bytes (total=${r}, lost=${Y})`}}catch{}if(S===1)console.warn(`[DeviceStream] video stale: currentTime=${f.toFixed(3)} not advancing${K}`);else if(S%6===0){const u=e.getVideoTracks()[0];console.warn(`[DeviceStream] video still stale (${S*5}s): currentTime=${f.toFixed(3)}, track=${(u==null?void 0:u.readyState)??"none"}, streamActive=${e.active}${K}`)}else console.warn(`[DeviceStream] video stale (${S*5}s)${K}`)}else if(S>0&&console.log(`[DeviceStream] video resumed after ${S*5}s stale`),S=0,i&&i.connectionState!=="closed")try{const K=await i.getStats();for(const u of K.values())u.type==="inbound-rtp"&&u.kind==="video"&&(y=u.packetsReceived??0,p=u.bytesReceived??0)}catch{}D=f},5e3),T=f=>{console.warn(`[DeviceStream] stream removetrack: ${f.track.kind} ${f.track.id}`)},h=()=>{console.warn("[DeviceStream] stream became inactive")};return e.addEventListener("removetrack",T),e.addEventListener("inactive",h),()=>{clearInterval(m),e.removeEventListener("removetrack",T),e.removeEventListener("inactive",h)}},[e,i]),d.useEffect(()=>{if(!b||!i||!t)return;let s=0,$=0,D=null;const S=setInterval(async()=>{if(i.connectionState==="closed"||t.readyState!=="open")return;let y=0,p=0;try{const h=await i.getStats();for(const f of h.values())if(f.type==="inbound-rtp"&&f.kind==="video"){const K=f.packetsReceived??0,u=f.packetsLost??0;y=K-s,p=Math.max(0,u-$),s=K,$=u}}catch{return}const m=y+p,T=m>0?p/m:0;T>B?D?D=Date.now():(D=Date.now(),t.send(JSON.stringify({type:"fps_hint",fps:H})),console.warn(`[DeviceStream] adaptive: loss rate ${(T*100).toFixed(1)}% > ${B*100}%, dropping to ${H}fps`)):D!==null&&Date.now()-D>=V*1e3&&(D=null,t.send(JSON.stringify({type:"fps_hint",fps:_})),console.log(`[DeviceStream] adaptive: loss-free for ${V}s, restoring to ${_}fps`))},z);return()=>clearInterval(S)},[b,i,t,_]);const c=d.useCallback(()=>t&&t.readyState==="open",[t]),k=d.useCallback(s=>{!c()||!t||t.send(JSON.stringify({type:"key",key:s}))},[c,t]);d.useEffect(()=>{if(!he(a))return;const s=$=>{if(!c()||!t||ve($.target))return;const D=Se($,a);D&&($.preventDefault(),k(D))};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[c,t,a,k]);const g=d.useCallback((s,$)=>{if(!c()||!t)return;const D=me($),S=s.map(y=>{const p=y.pressure<=0?Ee(y.clientX,y.clientY,D):fe(y.clientX,y.clientY,D);return p?{x:p.x,y:p.y,pressure:y.pressure,id:y.id}:null}).filter(y=>y!==null);S.length!==0&&t.send(JSON.stringify({type:"touch",touches:S}))},[c,t]);d.useEffect(()=>{const s=E.current;if(!s)return;const $=p=>{p.preventDefault(),g(Array.from(p.touches).map(m=>({clientX:m.clientX,clientY:m.clientY,id:m.identifier,pressure:m.force||.5})),s)},D=p=>{p.preventDefault(),g(Array.from(p.touches).map(m=>({clientX:m.clientX,clientY:m.clientY,id:m.identifier,pressure:m.force||.5})),s)},S=p=>{p.preventDefault(),g(Array.from(p.changedTouches).map(m=>({clientX:m.clientX,clientY:m.clientY,id:m.identifier,pressure:0})),s)},y={passive:!1};return s.addEventListener("touchstart",$,y),s.addEventListener("touchmove",D,y),s.addEventListener("touchend",S,y),s.addEventListener("touchcancel",S,y),()=>{s.removeEventListener("touchstart",$),s.removeEventListener("touchmove",D),s.removeEventListener("touchend",S),s.removeEventListener("touchcancel",S)}},[g]);const w=d.useRef(!1),R=d.useCallback(s=>{s.preventDefault(),w.current=!0,g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:.5}],s.currentTarget)},[g]),x=d.useCallback(s=>{w.current&&(s.preventDefault(),g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:.5}],s.currentTarget))},[g]),C=d.useCallback(s=>{w.current&&(w.current=!1,s.preventDefault(),g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:0}],s.currentTarget))},[g]),O=d.useCallback(s=>{w.current&&(w.current=!1,g([{clientX:s.clientX,clientY:s.clientY,id:0,pressure:0}],s.currentTarget))},[g]);return o.jsx("video",{ref:E,className:"emulator-video",autoPlay:!0,playsInline:!0,muted:!0,tabIndex:0,"aria-label":"Device stream",onMouseDown:R,onMouseMove:x,onMouseUp:C,onMouseLeave:O})}const v="[DeviceStream]",$e=8;function we(){typeof window>"u"||(window.__YEP_DEVICE_STREAM_PROFILE_EVENTS__=[])}function ke(e){if(typeof window>"u")return;const t=window,a=t.__YEP_DEVICE_STREAM_PROFILE_EVENTS__??[];a.push(e),t.__YEP_DEVICE_STREAM_PROFILE_EVENTS__=a,window.dispatchEvent(new CustomEvent("yep:device_stream_profile_event",{detail:e}))}function P(e,t){try{return Promise.resolve(e.send(t))}catch(a){return Promise.reject(a)}}function Ce(){const e=oe().transport,t=e.capabilities.device,[a,i]=d.useState(null),[b,_]=d.useState(null),[E,c]=d.useState("idle"),[k,g]=d.useState(null),[w,R]=d.useState(null),[x,C]=d.useState([]),O=d.useRef(null),s=d.useRef(null),$=d.useRef(null),D=d.useRef(null),S=d.useCallback(()=>{const p=s.current;if(console.log(`${v} disconnect() called, session=${p}`),p){const m=$.current;m&&P(m,{type:"device_stream_stop",sessionId:p}).catch(()=>{})}if(O.current){const m=O.current;console.log(`${v} closing RTCPeerConnection (state=${m.connectionState}, ice=${m.iceConnectionState})`),m.close(),O.current=null}D.current&&(D.current(),D.current=null),s.current=null,$.current=null,i(null),_(null),c("idle"),g(null),R(null),C([])},[]),y=d.useCallback(p=>{S();const m=t;if(!m){c("failed"),g("Device streaming is not available for this source");return}const T=J();s.current=T,$.current=m;const h=T.slice(0,8);console.log(`${v} connect(deviceId=${p.id}, type=${p.type??"unknown"}, session=${h})`),c("connecting"),g(null),R(null),C([]),we();const f=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});O.current=f,f.ontrack=n=>{const r=n.track;console.log(`${v} [${h}] ontrack: kind=${r.kind} id=${r.id} readyState=${r.readyState} muted=${r.muted}`),n.streams[0]&&i(n.streams[0]),r.onmute=()=>console.warn(`${v} [${h}] track MUTED: ${r.id}`),r.onunmute=()=>console.log(`${v} [${h}] track unmuted: ${r.id}`),r.onended=()=>console.warn(`${v} [${h}] track ENDED: ${r.id}`)},f.ondatachannel=n=>{const r=n.channel;console.log(`${v} [${h}] ondatachannel: label=${r.label} id=${r.id}`),r.onopen=()=>{console.log(`${v} [${h}] DataChannel "${r.label}" opened`),_(r)},r.onclose=()=>{console.warn(`${v} [${h}] DataChannel "${r.label}" closed`),_(null)},r.onerror=A=>{console.error(`${v} [${h}] DataChannel "${r.label}" error:`,A)}},f.onconnectionstatechange=()=>{switch(console.log(`${v} [${h}] connectionState: ${f.connectionState}`),f.connectionState){case"connected":c("connected");break;case"disconnected":c("disconnected");break;case"failed":c("failed"),g("WebRTC connection failed");break;case"closed":c("disconnected");break}},f.oniceconnectionstatechange=()=>{console.log(`${v} [${h}] iceConnectionState: ${f.iceConnectionState}`)},f.onicegatheringstatechange=()=>{console.log(`${v} [${h}] iceGatheringState: ${f.iceGatheringState}`)},f.onsignalingstatechange=()=>{console.log(`${v} [${h}] signalingState: ${f.signalingState}`)},f.onicecandidate=n=>{n.candidate?console.log(`${v} [${h}] sending ICE candidate: ${n.candidate.candidate.slice(0,60)}...`):console.log(`${v} [${h}] ICE gathering complete (null candidate)`),P(m,{type:"device_ice_candidate",sessionId:T,candidate:n.candidate?{candidate:n.candidate.candidate,sdpMid:n.candidate.sdpMid,sdpMLineIndex:n.candidate.sdpMLineIndex,usernameFragment:n.candidate.usernameFragment}:null}).catch(r=>{c("failed"),g(`Connection failed: ${r instanceof Error?r.message:String(r)}`)})};const K=m.onMessage(async n=>{if(n.sessionId===T)switch(n.type){case"device_webrtc_offer":{console.log(`${v} [${h}] received SDP offer (${n.sdp.length} bytes)`);try{await f.setRemoteDescription({type:"offer",sdp:n.sdp});const r=await f.createAnswer();await f.setLocalDescription(r),console.log(`${v} [${h}] sent SDP answer (${(r.sdp??"").length} bytes)`),await P(m,{type:"device_webrtc_answer",sessionId:T,sdp:r.sdp??""})}catch(r){console.error(`${v} [${h}] SDP negotiation failed:`,r),c("failed"),g(`WebRTC negotiation failed: ${r instanceof Error?r.message:String(r)}`)}break}case"device_ice_candidate_event":{if(n.candidate){console.log(`${v} [${h}] received remote ICE candidate`);try{await f.addIceCandidate(n.candidate)}catch(r){console.warn(`${v} [${h}] failed to add ICE candidate:`,r)}}else console.log(`${v} [${h}] remote ICE gathering complete`);break}case"device_session_state":{console.log(`${v} [${h}] server session state: ${n.state}${n.error?` error=${n.error}`:""}`),(n.state==="failed"||n.state==="disconnected")&&(c(n.state),n.error&&g(n.error));break}case"device_stream_profile_event":{console.log(`${v} [${h}] stream profile event: ${n.direction} tier=${n.tier}/${n.totalTiers} ${n.width}x${n.height}@${n.fps} bitrate=${n.bitrate}`);const r={...n,receivedAt:Date.now()};R(n),C(A=>[r,...A].slice(0,$e)),ke(n);break}}});D.current=K;const u=async()=>{const{maxFps:n,maxWidth:r,quality:A}=Z(),Y=ee[A];console.log(`${v} [${h}] sending device_stream_start fps=${n} width=${r} quality=${A}(crf=${Y})`),await P(m,{type:"device_stream_start",sessionId:T,deviceId:p.id,deviceType:p.type,options:{maxFps:n,maxWidth:r,quality:Y}})};Promise.resolve().then(async()=>{e.status.getSnapshot().state!=="ready"&&await e.reconnect(),await u()}).catch(n=>{console.error(`${v} [${h}] device signaling failed:`,n),c("failed"),g(`Connection failed: ${n instanceof Error?n.message:String(n)}`)})},[t,S,e]);return d.useEffect(()=>{const p=$.current;p&&p!==t&&S()},[t,S]),d.useEffect(()=>()=>{if(O.current&&(O.current.close(),O.current=null),D.current&&(D.current(),D.current=null),s.current){const p=$.current;p&&P(p,{type:"device_stream_stop",sessionId:s.current}).catch(()=>{})}},[]),{remoteStream:a,dataChannel:b,peerConnection:O.current,connectionState:E,error:k,latestProfileEvent:w,profileEventHistory:x,connect:y,disconnect:S}}const Oe="_list_122d7_2",Te="_group_122d7_8",Ae="_groupTitle_122d7_14",Ke="_item_122d7_23",xe="_itemInfo_122d7_33",Re="_itemName_122d7_39",Ye="_itemStatus_122d7_44",Ne="_running_122d7_49",Pe="_stopped_122d7_53",Ie="_itemActions_122d7_57",Le="_btn_122d7_63",je="_btnPrimary_122d7_72",Me="_btnSecondary_122d7_81",Be="_streamView_122d7_91",He="_streamHeader_122d7_98",Ve="_connectionState_122d7_107",Fe="_streamHeaderActions_122d7_114",Ue="_keyboardState_122d7_119",We="_profileState_122d7_127",Xe="_profileTimeline_122d7_135",Ge="_profileTimelineItem_122d7_144",qe="_latest_122d7_154",Je="_profileTimelineTime_122d7_158",Qe="_profileTimelineDetail_122d7_163",ze="_streamContainer_122d7_169",Ze="_loading_122d7_180",et="_empty_122d7_181",tt="_error_122d7_187",nt="_connecting_122d7_196",rt="_downloadPrompt_122d7_203",l={list:Oe,group:Te,groupTitle:Ae,item:Ke,itemInfo:xe,itemName:Re,itemStatus:Ye,running:Ne,stopped:Pe,itemActions:Ie,btn:Le,btnPrimary:je,btnSecondary:Me,streamView:Be,streamHeader:He,connectionState:Ve,streamHeaderActions:Fe,keyboardState:Ue,profileState:We,profileTimeline:Xe,profileTimelineItem:Ge,latest:qe,profileTimelineTime:Je,profileTimelineDetail:Qe,streamContainer:ze,loading:Ze,empty:et,error:tt,connecting:nt,downloadPrompt:rt},W=["emulator","android","chromeos","ios-simulator"];function X(e){return e.label||e.avd||e.id}function ot(e){switch(e){case"emulator":return"Android Emulators";case"android":return"Android Devices";case"chromeos":return"ChromeOS Devices";case"ios-simulator":return"iOS Simulators";default:return"Devices"}}function I(e,t){var a;return(a=e.actions)!=null&&a.length?e.actions.includes(t):t==="stream"?e.state!=="stopped":t==="start"?e.type==="emulator"&&e.state==="stopped":t==="stop"?e.type==="emulator"&&e.state!=="stopped":!1}function N(){return navigator.keyboard}function st({device:e,onConnect:t,onStart:a,onStop:i}){const b=I(e,"stream"),_=I(e,"start"),E=I(e,"stop");return o.jsxs("div",{className:l.item,"data-testid":"device-row",children:[o.jsxs("div",{className:l.itemInfo,children:[o.jsx("span",{className:l.itemName,children:X(e)}),o.jsx("span",{className:`${l.itemStatus} ${e.state==="stopped"?l.stopped:l.running}`,children:e.state})]}),o.jsxs("div",{className:l.itemActions,children:[b&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnPrimary}`,onClick:()=>t(e),children:"Connect"}),E&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:()=>i(e.id),children:"Stop"}),!E&&_&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:()=>a(e.id),children:"Start"}),!b&&!E&&!_&&o.jsx("span",{className:l.itemStatus,children:"No actions"})]})]})}function it({devices:e,onConnect:t,onStart:a,onStop:i}){const b=d.useMemo(()=>{const _=new Map;for(const E of W)_.set(E,[]);for(const E of e){const c=_.get(E.type);c?c.push(E):_.set(E.type,[E])}return _},[e]);return o.jsx("div",{className:l.list,children:Array.from(b.entries()).map(([_,E])=>E.length===0?null:o.jsxs("section",{className:l.group,"data-testid":"device-group",children:[o.jsx("h3",{className:l.groupTitle,"data-testid":"device-group-title",children:ot(_)}),E.map(c=>o.jsx(st,{device:c,onConnect:t,onStart:a,onStop:i},c.id))]},_))})}function at(e){for(const t of W){const a=e.find(i=>i.type===t&&I(i,"stream"));if(a)return a}return e.find(t=>I(t,"stream"))}function ct({device:e,onBack:t}){var K;const{remoteStream:a,dataChannel:i,peerConnection:b,connectionState:_,error:E,latestProfileEvent:c,profileEventHistory:k,connect:g,disconnect:w}=Ce(),{adaptiveFps:R,maxFps:x}=ne(),C=d.useRef(null),[O,s]=d.useState(!1),[$,D]=d.useState(!1),[S,y]=d.useState(null),m=(e.type==="emulator"||e.type==="android")&&document.fullscreenEnabled&&typeof((K=N())==null?void 0:K.lock)=="function";d.useEffect(()=>(g({id:e.id,type:e.type}),()=>w()),[e.id,e.type,g,w]),d.useEffect(()=>{const u=()=>{var r,A;const n=document.fullscreenElement===C.current;s(n),n||(A=(r=N())==null?void 0:r.unlock)==null||A.call(r)};return document.addEventListener("fullscreenchange",u),()=>{var n,r;document.removeEventListener("fullscreenchange",u),(r=(n=N())==null?void 0:n.unlock)==null||r.call(n)}},[]);const T=d.useCallback(async()=>{var u,n;D(!0),y(null);try{(n=(u=N())==null?void 0:u.unlock)==null||n.call(u),document.fullscreenElement===C.current&&await document.exitFullscreen(),s(!1)}catch(r){y(`Failed to exit immersive keyboard: ${r instanceof Error?r.message:String(r)}`)}finally{D(!1)}},[]),h=d.useCallback(async()=>{var u,n,r,A;if(!(!m||!C.current)){D(!0),y(null);try{document.fullscreenElement!==C.current&&await C.current.requestFullscreen(),await((n=(u=N())==null?void 0:u.lock)==null?void 0:n.call(u)),s(!0)}catch(Y){(A=(r=N())==null?void 0:r.unlock)==null||A.call(r),s(!1),y(`Immersive keyboard failed: ${Y instanceof Error?Y.message:String(Y)}`)}finally{D(!1)}}},[m]),f=()=>{T(),w(),t()};return o.jsxs("div",{className:l.streamView,ref:C,children:[o.jsxs("div",{className:l.streamHeader,children:[o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:f,children:"Back"}),o.jsxs("span",{className:l.connectionState,"data-testid":"device-connection-state",children:[X(e)," - ",_]}),o.jsx("div",{className:l.streamHeaderActions,children:m&&o.jsx("button",{type:"button",className:`${l.btn} ${l.btnSecondary}`,onClick:()=>{O?T():h()},disabled:$,title:"Request fullscreen and keyboard lock",children:$?"Working...":O?"Exit Immersive Keyboard":"Immersive Keyboard"})})]}),m&&o.jsxs("div",{className:l.keyboardState,children:["Keyboard mode:"," ",O?"immersive (fullscreen)":"standard"]}),S&&o.jsx("div",{className:l.error,children:S}),c&&o.jsxs("div",{className:l.profileState,children:["Profile ",c.direction,": tier ",c.tier,"/",c.totalTiers," (",c.width,"x",c.height,"@",c.fps,"fps,"," ",Math.round(c.bitrate/1e3)," kbps)"]}),k.length>0&&o.jsx("div",{className:l.profileTimeline,"data-testid":"profile-timeline",children:k.map((u,n)=>o.jsxs("div",{className:`${l.profileTimelineItem} ${n===0?l.latest:""}`,children:[o.jsx("span",{className:l.profileTimelineTime,children:new Date(u.receivedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),o.jsxs("span",{className:l.profileTimelineDetail,children:[u.direction," tier ",u.tier,"/",u.totalTiers," (",u.width,"x",u.height,"@",u.fps,")"]})]},`${u.receivedAt}-${u.direction}-${u.tier}-${n}`))}),E&&o.jsx("div",{className:l.error,children:E}),_==="connecting"&&o.jsx("div",{className:l.connecting,children:"Connecting..."}),o.jsx("div",{className:l.streamContainer,children:o.jsx(be,{stream:a,dataChannel:i,deviceType:e.type,peerConnection:b,adaptiveFps:R,configuredFps:x})}),o.jsx(ue,{dataChannel:i,deviceType:e.type})]})}function lt({mode:e,installedVersion:t,latestVersion:a,onDownloaded:i}){const{t:b}=M(),[_,E]=d.useState(!1),[c,k]=d.useState(null),g=async()=>{E(!0),k(null);try{const w=await Q.downloadDeviceBridge();w.ok?i():k(w.error??"Download failed")}catch(w){k(w instanceof Error?w.message:String(w))}finally{E(!1)}};return o.jsxs("div",{className:l.downloadPrompt,children:[o.jsx("p",{children:e==="update"?o.jsxs(o.Fragment,{children:[b("emulatorBridgeUpdateRequired"),t&&a?` Installed: v${t}. Latest: v${a}.`:null]}):b("emulatorBridgeDownloadRequired")}),c&&o.jsx("div",{className:l.error,children:c}),o.jsx("button",{type:"button",className:`${l.btn} ${l.btnPrimary}`,onClick:g,disabled:_,children:_?e==="update"?"Updating...":"Downloading...":e==="update"?"Update Bridge":"Download Bridge"})]})}function Kt(){const{t:e}=M(),{openSidebar:t,isWideScreen:a}=ie(),{version:i,refetch:b}=se(),_=(i==null?void 0:i.deviceBridgeState)==="update-available"?"update":U(i,ae)&&!U(i,ce)?"download":null,E=_!==null,{emulators:c,loading:k,error:g,startEmulator:w,stopEmulator:R}=te({enabled:!E}),[x,C]=d.useState(null);return d.useEffect(()=>{if(x||k||E||!new URLSearchParams(window.location.search).has("auto"))return;const s=at(c);s&&C(s)},[c,k,x,E]),x?o.jsx(F,{isWideScreen:a,children:o.jsx(ct,{device:x,onBack:()=>C(null)})}):o.jsxs(F,{isWideScreen:a,children:[o.jsx(re,{title:"Devices",onOpenSidebar:t,isWideScreen:a}),o.jsx("main",{className:"page-scroll-container",children:o.jsx("div",{className:"page-content-inner",children:_?o.jsx(lt,{mode:_,installedVersion:i==null?void 0:i.deviceBridgeVersion,latestVersion:i==null?void 0:i.latestDeviceBridgeVersion,onDownloaded:b}):o.jsxs(o.Fragment,{children:[k&&o.jsx("div",{className:l.loading,children:"Loading..."}),g&&o.jsx("div",{className:l.error,children:g}),!k&&c.length===0&&o.jsx("div",{className:l.empty,children:e("emulatorPageNoDevices")}),c.length>0&&o.jsx(it,{devices:c,onConnect:C,onStart:w,onStop:R})]})})})]})}export{lt as BridgeRuntimePrompt,Kt as EmulatorPage};
@@ -1 +1 @@
1
- import{r as u,j as t}from"./clientSummaryStore-Cr4yWo-Y.js";import{u as w,a as Q,E as z,b as P,g as T}from"./useEmulators-cGrsK5mh.js";import{e as M}from"./Modal-iT2_XPlO.js";import{u as U}from"./main-BpQ_EIjC.js";import{S as c}from"./SettingsItem-C7eQXUQf.js";import{u as _,a as W,S as $,H as A}from"./index-DvjdkG8Q.js";import"./react-runtime-D-UPQ57m.js";import"./index-C-4wHkcA.js";import"./remoteRoutePaths-Crh_32jX.js";import"./PageHeader-Dbb8BZq2.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./NavigationLayout-BpvrdPoS.js";import"./useSidebarWidth-DnB-wKom.js";import"./frontendReload-54GeNGj9.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./useFileActivity-Y1m-dClR.js";import"./GlossaryContext-PMCo1K6f.js";import"./ProviderBadge-DmhZSMRX.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-CIpZ5dke.js";import"./index-D73NQkRu.js";import"./limitedUserBrowserDefaults-C6cuD-wF.js";const Y=["high","medium","low"];function q(s,l,i){return i!=null&&i.length?i.includes("start"):s==="emulator"&&l==="stopped"}function G(s,l,i){return i!=null&&i.length?i.includes("stop"):s==="emulator"&&l!=="stopped"}function Ne(){const{t:s}=U();_(s("emulatorSectionTitle"));const{emulators:l,loading:i,error:f,startEmulator:F,stopEmulator:k,refresh:H}=w(),{maxFps:p,setMaxFps:h,maxWidth:g,setMaxWidth:x,quality:m,setQuality:j,adaptiveFps:b,setAdaptiveFps:N}=Q(),{settings:r,isLoading:v,error:y,updateSetting:n}=M(),[E,O]=u.useState(""),[C,o]=u.useState(null),d=(r==null?void 0:r.chromeOsHosts)??[],I=u.useMemo(()=>r?{maxFps:p,maxWidth:g,quality:m,adaptiveFps:b,deviceBridgeEnabled:r.deviceBridgeEnabled??!1,chromeOsHosts:r.chromeOsHosts??[]}:null,[r,p,g,m,b]),R=u.useCallback(e=>{h(e.maxFps),x(e.maxWidth),j(e.quality),N(e.adaptiveFps),n("deviceBridgeEnabled",e.deviceBridgeEnabled),n("chromeOsHosts",e.chromeOsHosts),o(null)},[h,x,j,N,n]);W(I,R);const L=async()=>{const e=E.trim();if(!e){o(s("emulatorHostAliasRequired"));return}if(/\s/.test(e)){o(s("emulatorHostAliasNoSpaces"));return}const S=Array.from(new Set([...d,e]));try{await n("chromeOsHosts",S),O(""),o(null),await H()}catch(a){o(a instanceof Error?a.message:s("emulatorHostAliasSaveFailed"))}},B=async e=>{const S=d.filter(a=>a.toLowerCase()!==e.toLowerCase());try{await n("chromeOsHosts",S),o(null),await H()}catch(a){o(a instanceof Error?a.message:s("emulatorHostAliasRemoveFailed"))}},D=(r==null?void 0:r.deviceBridgeEnabled)??!1;return t.jsxs($,{children:[t.jsx("p",{className:"settings-description",children:s("emulatorSectionDescription")}),t.jsx("div",{className:"settings-group",children:t.jsx(c,{label:s("emulatorEnableTitle"),description:s("emulatorEnableDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:D,onChange:e=>{n("deviceBridgeEnabled",e.target.checked)},disabled:v}),t.jsx("span",{className:"toggle-slider"})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:s("emulatorStreamQualityTitle")}),t.jsx("p",{className:"settings-description",children:s("emulatorStreamQualityDescription")}),t.jsx(c,{label:s("emulatorFrameRateTitle"),description:s("emulatorFrameRateDescription"),children:t.jsx("div",{className:"font-size-selector",children:z.map(e=>t.jsxs("button",{type:"button",className:`font-size-option ${p===e?"active":""}`,onClick:()=>h(e),children:[e," fps"]},e))})}),t.jsx(c,{label:s("emulatorResolutionTitle"),description:s("emulatorResolutionDescription"),children:t.jsx("div",{className:"font-size-selector",children:P.map(e=>t.jsxs("button",{type:"button",className:`font-size-option ${g===e?"active":""}`,onClick:()=>x(e),children:[e,"p"]},e))})}),t.jsx(c,{label:s("emulatorQualityTitle"),description:s("emulatorQualityDescription"),valueText:T(m),children:t.jsx("div",{className:"font-size-selector",children:Y.map(e=>t.jsx("button",{type:"button",className:`font-size-option ${m===e?"active":""}`,onClick:()=>j(e),children:T(e)},e))})}),t.jsx(c,{label:s("emulatorAdaptiveFpsTitle"),description:s("emulatorAdaptiveFpsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:b,onChange:e=>N(e.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})]}),t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:s("emulatorChromeOsHostsTitle")}),t.jsxs("p",{className:"settings-description",children:[s("emulatorChromeOsHostsDescription"),t.jsx("code",{children:" chromeroot"}),s("emulatorChromeOsHostsDescriptionSuffix")]}),t.jsx(c,{label:s("emulatorAddHostAliasTitle"),description:s("emulatorAddHostAliasDescription"),children:t.jsxs("form",{className:"settings-item-actions",onSubmit:e=>{e.preventDefault(),L()},children:[t.jsx("input",{type:"text",name:"chromeosHost",placeholder:s("emulatorHostAliasPlaceholder"),className:"settings-select",autoComplete:"off",value:E,onChange:e=>O(e.target.value)}),t.jsx("button",{type:"submit",className:"settings-button",disabled:v,children:s("projectsAddConfirm")})]})}),t.jsxs(A,{children:[C&&t.jsx("p",{className:"settings-error",children:C}),y&&t.jsx("p",{className:"settings-error",children:y}),d.length===0?t.jsx("p",{className:"settings-muted",children:s("emulatorNoChromeOsHosts")}):d.map(e=>t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("span",{className:"settings-item-label",children:e}),t.jsxs("span",{className:"settings-item-description",children:["Device ID: chromeos:",e]})]}),t.jsx("div",{className:"settings-item-action",children:t.jsx("button",{type:"button",className:"settings-button",onClick:()=>{B(e)},disabled:v,children:s("emulatorRemove")})})]},e))]})]}),t.jsx(A,{children:t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:s("emulatorDiscoveredDevicesTitle")}),i&&t.jsx("p",{className:"settings-muted",children:s("projectsLoading")}),f&&t.jsx("p",{className:"settings-error",children:f}),!i&&l.length===0&&t.jsx("p",{className:"settings-muted",children:s("emulatorNoDevicesFound")}),l.map(e=>t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("span",{className:"settings-item-label",children:e.label||e.avd||e.id}),t.jsxs("span",{className:"settings-item-description",children:[e.type," - ",e.id," - ",e.state]})]}),t.jsx("div",{className:"settings-item-action",children:G(e.type,e.state,e.actions)?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>k(e.id),children:s("emulatorStop")}):q(e.type,e.state,e.actions)?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>F(e.id),children:s("emulatorStart")}):null})]},e.id))]})})]}):null]})}export{Ne as EmulatorSettings};
1
+ import{r as u,j as t}from"./clientSummaryStore-Dsgo1zWK.js";import{u as w,a as Q,E as z,b as P,g as T}from"./useEmulators-CQCzysEZ.js";import{e as M}from"./Modal-CHNqXAgW.js";import{u as U}from"./main-BX4yZXDF.js";import{S as c}from"./SettingsItem-BgyAjvy6.js";import{u as _,a as W,S as $,H as A}from"./index-DnFlh5Zf.js";import"./react-runtime-D-UPQ57m.js";import"./index-BhTv6hAY.js";import"./remoteRoutePaths-DpabBbC6.js";import"./PageHeader-DYCnk788.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-DfkDdP3M.js";import"./HostIdentityContext-_GKYzEQ6.js";import"./NavigationLayout-UkQvkodY.js";import"./useSidebarWidth-op0qbgd4.js";import"./frontendReload-B4jfUIeG.js";import"./usePanelSlideAnimations-XdQhGgr-.js";import"./useFileActivity-CpuLfNl9.js";import"./GlossaryContext-BA5X62Ck.js";import"./ProviderBadge-C-UpobLD.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-ccRUdgT-.js";import"./index-BSMD-gHP.js";import"./limitedUserBrowserDefaults-CwcMxPe5.js";const Y=["high","medium","low"];function q(s,l,i){return i!=null&&i.length?i.includes("start"):s==="emulator"&&l==="stopped"}function G(s,l,i){return i!=null&&i.length?i.includes("stop"):s==="emulator"&&l!=="stopped"}function Ne(){const{t:s}=U();_(s("emulatorSectionTitle"));const{emulators:l,loading:i,error:f,startEmulator:F,stopEmulator:k,refresh:H}=w(),{maxFps:p,setMaxFps:h,maxWidth:g,setMaxWidth:x,quality:m,setQuality:j,adaptiveFps:b,setAdaptiveFps:N}=Q(),{settings:r,isLoading:v,error:y,updateSetting:n}=M(),[E,O]=u.useState(""),[C,o]=u.useState(null),d=(r==null?void 0:r.chromeOsHosts)??[],I=u.useMemo(()=>r?{maxFps:p,maxWidth:g,quality:m,adaptiveFps:b,deviceBridgeEnabled:r.deviceBridgeEnabled??!1,chromeOsHosts:r.chromeOsHosts??[]}:null,[r,p,g,m,b]),R=u.useCallback(e=>{h(e.maxFps),x(e.maxWidth),j(e.quality),N(e.adaptiveFps),n("deviceBridgeEnabled",e.deviceBridgeEnabled),n("chromeOsHosts",e.chromeOsHosts),o(null)},[h,x,j,N,n]);W(I,R);const L=async()=>{const e=E.trim();if(!e){o(s("emulatorHostAliasRequired"));return}if(/\s/.test(e)){o(s("emulatorHostAliasNoSpaces"));return}const S=Array.from(new Set([...d,e]));try{await n("chromeOsHosts",S),O(""),o(null),await H()}catch(a){o(a instanceof Error?a.message:s("emulatorHostAliasSaveFailed"))}},B=async e=>{const S=d.filter(a=>a.toLowerCase()!==e.toLowerCase());try{await n("chromeOsHosts",S),o(null),await H()}catch(a){o(a instanceof Error?a.message:s("emulatorHostAliasRemoveFailed"))}},D=(r==null?void 0:r.deviceBridgeEnabled)??!1;return t.jsxs($,{children:[t.jsx("p",{className:"settings-description",children:s("emulatorSectionDescription")}),t.jsx("div",{className:"settings-group",children:t.jsx(c,{label:s("emulatorEnableTitle"),description:s("emulatorEnableDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:D,onChange:e=>{n("deviceBridgeEnabled",e.target.checked)},disabled:v}),t.jsx("span",{className:"toggle-slider"})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:s("emulatorStreamQualityTitle")}),t.jsx("p",{className:"settings-description",children:s("emulatorStreamQualityDescription")}),t.jsx(c,{label:s("emulatorFrameRateTitle"),description:s("emulatorFrameRateDescription"),children:t.jsx("div",{className:"font-size-selector",children:z.map(e=>t.jsxs("button",{type:"button",className:`font-size-option ${p===e?"active":""}`,onClick:()=>h(e),children:[e," fps"]},e))})}),t.jsx(c,{label:s("emulatorResolutionTitle"),description:s("emulatorResolutionDescription"),children:t.jsx("div",{className:"font-size-selector",children:P.map(e=>t.jsxs("button",{type:"button",className:`font-size-option ${g===e?"active":""}`,onClick:()=>x(e),children:[e,"p"]},e))})}),t.jsx(c,{label:s("emulatorQualityTitle"),description:s("emulatorQualityDescription"),valueText:T(m),children:t.jsx("div",{className:"font-size-selector",children:Y.map(e=>t.jsx("button",{type:"button",className:`font-size-option ${m===e?"active":""}`,onClick:()=>j(e),children:T(e)},e))})}),t.jsx(c,{label:s("emulatorAdaptiveFpsTitle"),description:s("emulatorAdaptiveFpsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:b,onChange:e=>N(e.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})]}),t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:s("emulatorChromeOsHostsTitle")}),t.jsxs("p",{className:"settings-description",children:[s("emulatorChromeOsHostsDescription"),t.jsx("code",{children:" chromeroot"}),s("emulatorChromeOsHostsDescriptionSuffix")]}),t.jsx(c,{label:s("emulatorAddHostAliasTitle"),description:s("emulatorAddHostAliasDescription"),children:t.jsxs("form",{className:"settings-item-actions",onSubmit:e=>{e.preventDefault(),L()},children:[t.jsx("input",{type:"text",name:"chromeosHost",placeholder:s("emulatorHostAliasPlaceholder"),className:"settings-select",autoComplete:"off",value:E,onChange:e=>O(e.target.value)}),t.jsx("button",{type:"submit",className:"settings-button",disabled:v,children:s("projectsAddConfirm")})]})}),t.jsxs(A,{children:[C&&t.jsx("p",{className:"settings-error",children:C}),y&&t.jsx("p",{className:"settings-error",children:y}),d.length===0?t.jsx("p",{className:"settings-muted",children:s("emulatorNoChromeOsHosts")}):d.map(e=>t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("span",{className:"settings-item-label",children:e}),t.jsxs("span",{className:"settings-item-description",children:["Device ID: chromeos:",e]})]}),t.jsx("div",{className:"settings-item-action",children:t.jsx("button",{type:"button",className:"settings-button",onClick:()=>{B(e)},disabled:v,children:s("emulatorRemove")})})]},e))]})]}),t.jsx(A,{children:t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:s("emulatorDiscoveredDevicesTitle")}),i&&t.jsx("p",{className:"settings-muted",children:s("projectsLoading")}),f&&t.jsx("p",{className:"settings-error",children:f}),!i&&l.length===0&&t.jsx("p",{className:"settings-muted",children:s("emulatorNoDevicesFound")}),l.map(e=>t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("span",{className:"settings-item-label",children:e.label||e.avd||e.id}),t.jsxs("span",{className:"settings-item-description",children:[e.type," - ",e.id," - ",e.state]})]}),t.jsx("div",{className:"settings-item-action",children:G(e.type,e.state,e.actions)?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>k(e.id),children:s("emulatorStop")}):q(e.type,e.state,e.actions)?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>F(e.id),children:s("emulatorStart")}):null})]},e.id))]})})]}):null]})}export{Ne as EmulatorSettings};
@@ -1 +1 @@
1
- import{r as l,j as t}from"./clientSummaryStore-Cr4yWo-Y.js";import{u as p,c as x}from"./main-BpQ_EIjC.js";import{S as f}from"./SettingsItem-C7eQXUQf.js";import{u as S,k as j,S as N,H as h}from"./index-DvjdkG8Q.js";import"./react-runtime-D-UPQ57m.js";import"./index-C-4wHkcA.js";import"./PageHeader-Dbb8BZq2.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./Modal-iT2_XPlO.js";import"./remoteRoutePaths-Crh_32jX.js";import"./NavigationLayout-BpvrdPoS.js";import"./useSidebarWidth-DnB-wKom.js";import"./frontendReload-54GeNGj9.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./useFileActivity-Y1m-dClR.js";import"./GlossaryContext-PMCo1K6f.js";import"./ProviderBadge-DmhZSMRX.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-CIpZ5dke.js";import"./index-D73NQkRu.js";import"./limitedUserBrowserDefaults-C6cuD-wF.js";const E="_filter_a5a08_3",w="_group_a5a08_17",b="_groupTitle_a5a08_21",T="_row_a5a08_29",B="_unset_a5a08_36",U="_head_a5a08_40",V="_name_a5a08_47",$="_secretBadge_a5a08_54",A="_value_a5a08_64",C="_valueUnset_a5a08_72",I="_description_a5a08_78",L="_note_a5a08_85",n={filter:E,group:w,groupTitle:b,row:T,unset:B,head:U,name:V,secretBadge:$,value:A,valueUnset:C,description:I,note:L};function M(e){const s=[],i=new Map;for(const a of e){let r=i.get(a.group);r||(r={group:a.group,entries:[]},i.set(a.group,r),s.push(r)),r.entries.push(a)}return s}function ie(){const{t:e}=p();S(e("environmentSectionTitle"));const[s,i]=l.useState(null),[a,r]=l.useState(!1),[c,v]=l.useState(!1),m=j();l.useEffect(()=>{let o=!1;return x.getEnvSettings().then(u=>{o||i(u.entries)}).catch(()=>{o||r(!0)}),()=>{o=!0}},[]);const d=l.useMemo(()=>(s==null?void 0:s.filter(o=>m||c||o.set))??[],[s,m,c]),g=l.useMemo(()=>M(d),[d]),_=(s==null?void 0:s.filter(o=>o.set).length)??0;return t.jsxs(N,{description:e("environmentSectionDescription"),children:[t.jsxs(h,{children:[a&&t.jsx("p",{className:"settings-warning",children:e("environmentLoadError")}),!a&&s===null&&t.jsx("p",{children:e("environmentLoading")}),!a&&s&&t.jsxs("label",{className:n.filter,children:[t.jsx("span",{children:e("environmentShowLabel")}),t.jsxs("select",{className:"settings-select",value:c?"all":"set",onChange:o=>v(o.target.value==="all"),children:[t.jsx("option",{value:"set",children:e("environmentShowSet",{count:_})}),t.jsx("option",{value:"all",children:e("environmentShowAll",{count:s.length})})]})]}),!a&&s&&!c&&g.length===0&&t.jsx("p",{className:"settings-empty",children:e("environmentEmptySet")})]}),g.map(o=>t.jsxs("div",{className:`settings-group ${n.group}`,children:[t.jsx(h,{children:t.jsx("h3",{className:n.groupTitle,children:o.group})}),o.entries.map(u=>t.jsx(k,{entry:u},u.name))]},o.group))]})}function k({entry:e}){const{t:s}=p();return t.jsxs(f,{label:e.name,description:e.description,keywords:[e.group,e.note].filter(i=>!!i),layout:"custom",baseClassName:n.row,className:e.set?void 0:n.unset,children:[t.jsxs("div",{className:n.head,children:[t.jsx("code",{className:n.name,children:e.name}),e.secret&&t.jsx("span",{className:n.secretBadge,children:s("environmentSecretBadge")}),t.jsx(H,{entry:e})]}),t.jsx("p",{className:n.description,children:e.description}),e.note&&t.jsx("p",{className:n.note,children:e.note})]})}function H({entry:e}){const{t:s}=p();return e.set?e.value===""?t.jsx("span",{className:`${n.value} ${n.valueUnset}`,children:s("environmentValueEmpty")}):t.jsx("code",{className:n.value,children:e.value}):t.jsx("span",{className:`${n.value} ${n.valueUnset}`,children:s("environmentValueNotSet")})}export{ie as EnvironmentSettings};
1
+ import{r as l,j as t}from"./clientSummaryStore-Dsgo1zWK.js";import{u as p,c as x}from"./main-BX4yZXDF.js";import{S as f}from"./SettingsItem-BgyAjvy6.js";import{u as S,k as j,S as N,H as h}from"./index-DnFlh5Zf.js";import"./react-runtime-D-UPQ57m.js";import"./index-BhTv6hAY.js";import"./PageHeader-DYCnk788.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-DfkDdP3M.js";import"./HostIdentityContext-_GKYzEQ6.js";import"./Modal-CHNqXAgW.js";import"./remoteRoutePaths-DpabBbC6.js";import"./NavigationLayout-UkQvkodY.js";import"./useSidebarWidth-op0qbgd4.js";import"./frontendReload-B4jfUIeG.js";import"./usePanelSlideAnimations-XdQhGgr-.js";import"./useFileActivity-CpuLfNl9.js";import"./GlossaryContext-BA5X62Ck.js";import"./ProviderBadge-C-UpobLD.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-ccRUdgT-.js";import"./index-BSMD-gHP.js";import"./limitedUserBrowserDefaults-CwcMxPe5.js";const E="_filter_a5a08_3",w="_group_a5a08_17",b="_groupTitle_a5a08_21",T="_row_a5a08_29",B="_unset_a5a08_36",U="_head_a5a08_40",V="_name_a5a08_47",$="_secretBadge_a5a08_54",A="_value_a5a08_64",C="_valueUnset_a5a08_72",I="_description_a5a08_78",L="_note_a5a08_85",n={filter:E,group:w,groupTitle:b,row:T,unset:B,head:U,name:V,secretBadge:$,value:A,valueUnset:C,description:I,note:L};function M(e){const s=[],i=new Map;for(const a of e){let r=i.get(a.group);r||(r={group:a.group,entries:[]},i.set(a.group,r),s.push(r)),r.entries.push(a)}return s}function ie(){const{t:e}=p();S(e("environmentSectionTitle"));const[s,i]=l.useState(null),[a,r]=l.useState(!1),[c,v]=l.useState(!1),m=j();l.useEffect(()=>{let o=!1;return x.getEnvSettings().then(u=>{o||i(u.entries)}).catch(()=>{o||r(!0)}),()=>{o=!0}},[]);const d=l.useMemo(()=>(s==null?void 0:s.filter(o=>m||c||o.set))??[],[s,m,c]),g=l.useMemo(()=>M(d),[d]),_=(s==null?void 0:s.filter(o=>o.set).length)??0;return t.jsxs(N,{description:e("environmentSectionDescription"),children:[t.jsxs(h,{children:[a&&t.jsx("p",{className:"settings-warning",children:e("environmentLoadError")}),!a&&s===null&&t.jsx("p",{children:e("environmentLoading")}),!a&&s&&t.jsxs("label",{className:n.filter,children:[t.jsx("span",{children:e("environmentShowLabel")}),t.jsxs("select",{className:"settings-select",value:c?"all":"set",onChange:o=>v(o.target.value==="all"),children:[t.jsx("option",{value:"set",children:e("environmentShowSet",{count:_})}),t.jsx("option",{value:"all",children:e("environmentShowAll",{count:s.length})})]})]}),!a&&s&&!c&&g.length===0&&t.jsx("p",{className:"settings-empty",children:e("environmentEmptySet")})]}),g.map(o=>t.jsxs("div",{className:`settings-group ${n.group}`,children:[t.jsx(h,{children:t.jsx("h3",{className:n.groupTitle,children:o.group})}),o.entries.map(u=>t.jsx(k,{entry:u},u.name))]},o.group))]})}function k({entry:e}){const{t:s}=p();return t.jsxs(f,{label:e.name,description:e.description,keywords:[e.group,e.note].filter(i=>!!i),layout:"custom",baseClassName:n.row,className:e.set?void 0:n.unset,children:[t.jsxs("div",{className:n.head,children:[t.jsx("code",{className:n.name,children:e.name}),e.secret&&t.jsx("span",{className:n.secretBadge,children:s("environmentSecretBadge")}),t.jsx(H,{entry:e})]}),t.jsx("p",{className:n.description,children:e.description}),e.note&&t.jsx("p",{className:n.note,children:e.note})]})}function H({entry:e}){const{t:s}=p();return e.set?e.value===""?t.jsx("span",{className:`${n.value} ${n.valueUnset}`,children:s("environmentValueEmpty")}):t.jsx("code",{className:n.value,children:e.value}):t.jsx("span",{className:`${n.value} ${n.valueUnset}`,children:s("environmentValueNotSet")})}export{ie as EnvironmentSettings};
@@ -1 +1 @@
1
- import{j as e}from"./clientSummaryStore-Cr4yWo-Y.js";import{F as f,B as j}from"./FileViewer-Crw6E_2M.js";import{u as h,S as u}from"./NavigationLayout-BpvrdPoS.js";import{G as g}from"./GlossaryContext-PMCo1K6f.js";import{u as x}from"./Modal-iT2_XPlO.js";import{u as v,a as P,b,L as a}from"./main-BpQ_EIjC.js";import"./react-runtime-D-UPQ57m.js";import"./index-C-4wHkcA.js";import"./sourceTransportPaths-COX454wy.js";import"./text-B4tk85DK.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./SessionMetadataContext-Bfs4TAAj.js";import"./LocalMediaModal-5au-Ku3n.js";import"./ViewerWindowActions-DM1Jwlo9.js";import"./sessionVhostApps-DJY4ZLda.js";import"./appHref-ByaEnJGJ.js";import"./newSessionPrefill-CHZfBHqQ.js";import"./relay-url-j3kYm5KO.js";import"./sessionViewerController-BKTu5sj-.js";import"./sessionViewerPlacement-D4lCtx-b.js";import"./useSessionRightPaneSetting-BOgcH2kB.js";import"./MarkdownPreview-ClsW_S6S.js";import"./RenderModeGlyph-dL8kAPff.js";import"./katex-DLorvT8M.js";import"./RenderModeContext-CZwSZkSZ.js";import"./uiTrace-DGW4HhGn.js";import"./CopyTextButton-Bpeo8K_-.js";import"./useSidebarWidth-DnB-wKom.js";import"./frontendReload-54GeNGj9.js";import"./useFileActivity-Y1m-dClR.js";import"./remoteRoutePaths-Crh_32jX.js";import"./ProviderBadge-DmhZSMRX.js";import"./YepAnywhereLogo-CIpZ5dke.js";function re(){const{t:i}=v(),{openSidebar:r}=h(),s=x(),{projectId:t}=P(),[o]=b(),n=o.get("path"),c=l(o.get("line")),m=l(o.get("lineEnd")),p=N(o.get("diff")),d=o.get("view")==="range"?"range":"full";return t?n?e.jsx(g,{projectId:t,children:e.jsx("div",{className:"file-page",children:e.jsx("div",{className:"file-page-content",children:e.jsx(f,{projectId:t,filePath:n,lineNumber:c,lineEnd:m,viewMode:d,diffMode:p,standalone:!0,headerLeading:e.jsxs(e.Fragment,{children:[e.jsx(u,{label:i("actionOpenSidebar"),newSessionLabel:i("sidebarNewSession"),onActivate:r}),e.jsx(a,{to:`${s}/projects/${t}`,className:"file-viewer-action",title:i("fileBackToProject"),"aria-label":i("fileBackToProject"),children:e.jsx(j,{})})]})})})})}):e.jsx("div",{className:"file-page file-page-error",children:e.jsxs("div",{className:"file-page-error-content",children:[e.jsx("h1",{children:i("fileInvalidUrl")}),e.jsx("p",{children:i("fileMissingPath")}),e.jsx(a,{to:`${s}/projects/${t}`,className:"file-page-back-link",children:i("fileGoToProject")})]})}):e.jsx("div",{className:"file-page file-page-error",children:e.jsxs("div",{className:"file-page-error-content",children:[e.jsx("h1",{children:i("fileInvalidUrl")}),e.jsx("p",{children:i("fileMissingProjectId")}),e.jsx(a,{to:`${s}/projects`,className:"file-page-back-link",children:i("fileGoToProjects")})]})})}function N(i){return i==="worktree"||i==="cumulative"?i:void 0}function l(i){if(!i)return;const r=Number(i);if(!(!Number.isInteger(r)||r<1))return r}export{re as FilePage};
1
+ import{j as e}from"./clientSummaryStore-Dsgo1zWK.js";import{F as f,B as j}from"./FileViewer-D8IcGVo-.js";import{u as h,S as u}from"./NavigationLayout-UkQvkodY.js";import{G as g}from"./GlossaryContext-BA5X62Ck.js";import{u as x}from"./Modal-CHNqXAgW.js";import{u as v,a as P,b,L as a}from"./main-BX4yZXDF.js";import"./react-runtime-D-UPQ57m.js";import"./index-BhTv6hAY.js";import"./sourceTransportPaths-BTR7eFi5.js";import"./text-B4tk85DK.js";import"./usePanelSlideAnimations-XdQhGgr-.js";import"./SessionMetadataContext-D0F_4Wp0.js";import"./LocalMediaModal-DMrKaM1a.js";import"./ViewerWindowActions-DV5bxAAy.js";import"./sessionVhostApps-DbEDY32Q.js";import"./appHref-ByaEnJGJ.js";import"./newSessionPrefill-BC5a8IpP.js";import"./relay-url-j3kYm5KO.js";import"./sessionViewerController-BGKUu-Zg.js";import"./sessionViewerPlacement-cjpznhMG.js";import"./useSessionRightPaneSetting-C5YgsyBy.js";import"./MarkdownPreview-TXbYZwdp.js";import"./RenderModeGlyph-ldDSjj9f.js";import"./katex-DLorvT8M.js";import"./RenderModeContext-CuIMXqQV.js";import"./uiTrace-CvAgW12D.js";import"./CopyTextButton-oYhSruA8.js";import"./useSidebarWidth-op0qbgd4.js";import"./frontendReload-B4jfUIeG.js";import"./useFileActivity-CpuLfNl9.js";import"./remoteRoutePaths-DpabBbC6.js";import"./ProviderBadge-C-UpobLD.js";import"./YepAnywhereLogo-ccRUdgT-.js";function re(){const{t:i}=v(),{openSidebar:r}=h(),s=x(),{projectId:t}=P(),[o]=b(),n=o.get("path"),c=l(o.get("line")),m=l(o.get("lineEnd")),p=N(o.get("diff")),d=o.get("view")==="range"?"range":"full";return t?n?e.jsx(g,{projectId:t,children:e.jsx("div",{className:"file-page",children:e.jsx("div",{className:"file-page-content",children:e.jsx(f,{projectId:t,filePath:n,lineNumber:c,lineEnd:m,viewMode:d,diffMode:p,standalone:!0,headerLeading:e.jsxs(e.Fragment,{children:[e.jsx(u,{label:i("actionOpenSidebar"),newSessionLabel:i("sidebarNewSession"),onActivate:r}),e.jsx(a,{to:`${s}/projects/${t}`,className:"file-viewer-action",title:i("fileBackToProject"),"aria-label":i("fileBackToProject"),children:e.jsx(j,{})})]})})})})}):e.jsx("div",{className:"file-page file-page-error",children:e.jsxs("div",{className:"file-page-error-content",children:[e.jsx("h1",{children:i("fileInvalidUrl")}),e.jsx("p",{children:i("fileMissingPath")}),e.jsx(a,{to:`${s}/projects/${t}`,className:"file-page-back-link",children:i("fileGoToProject")})]})}):e.jsx("div",{className:"file-page file-page-error",children:e.jsxs("div",{className:"file-page-error-content",children:[e.jsx("h1",{children:i("fileInvalidUrl")}),e.jsx("p",{children:i("fileMissingProjectId")}),e.jsx(a,{to:`${s}/projects`,className:"file-page-back-link",children:i("fileGoToProjects")})]})})}function N(i){return i==="worktree"||i==="cumulative"?i:void 0}function l(i){if(!i)return;const r=Number(i);if(!(!Number.isInteger(r)||r<1))return r}export{re as FilePage};