@p4code/cli 0.8.22 → 0.8.23

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 (372) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CfXLOppT.mjs → binCli-DzKk3bdm.mjs} +747 -492
  3. package/dist/client/.vite/manifest.json +2255 -2213
  4. package/dist/client/assets/AlertDialogRoot-Cc8kVCUa.js +2 -0
  5. package/dist/client/assets/{AnimatedHeight-DcrvwWWb.js → AnimatedHeight-wZzihILs.js} +2 -2
  6. package/dist/client/assets/{AuthSurfaceShell-CFBHG1UK.js → AuthSurfaceShell-DJcUG_EN.js} +2 -2
  7. package/dist/client/assets/{CSPContext-BP4s0CJv.js → CSPContext-BjqtxKhA.js} +2 -2
  8. package/dist/client/assets/ChatGptUsageButton-BDCO7XMy.js +2 -0
  9. package/dist/client/assets/{ChatMarkdown-C6I8N1IH.js → ChatMarkdown-CDno8Ayh.js} +12 -12
  10. package/dist/client/assets/CheckboxIndicator-CuZi7Ixm.js +2 -0
  11. package/dist/client/assets/ClippedText-DPgP0ObI.js +2 -0
  12. package/dist/client/assets/CodexSetupSection.logic-BB9JxUR1.js +2 -0
  13. package/dist/client/assets/ComboboxClear-zheEdyAa.js +2 -0
  14. package/dist/client/assets/ComboboxGroupLabel-BxCdL7I3.js +2 -0
  15. package/dist/client/assets/{CommandBlock-B5S9so33.js → CommandBlock-DQi0VdAG.js} +2 -2
  16. package/dist/client/assets/{ComposerPromptEditor-C7ZRV_6P.js → ComposerPromptEditor-DCjk2_nI.js} +44 -44
  17. package/dist/client/assets/CompositeRoot-Bg5KGYGp.js +2 -0
  18. package/dist/client/assets/{ConnectionStatusDot-Bz5Ps6Bm.js → ConnectionStatusDot-Bx8Imvqc.js} +2 -2
  19. package/dist/client/assets/DesignPageTile-ClF5Va3g.js +2 -0
  20. package/dist/client/assets/DevicePanel-D192Fic3.js +2 -0
  21. package/dist/client/assets/{DeviceSetup-Br_kHy6n.js → DeviceSetup-D9F7F9pV.js} +2 -2
  22. package/dist/client/assets/DialogTitle-CVP748Gv.js +2 -0
  23. package/dist/client/assets/{DiffCommentAnnotation-FcSG-wBG.js → DiffCommentAnnotation-mA-RZ8Su.js} +3 -3
  24. package/dist/client/assets/{DiffFileTree-IIdU6CqP.js → DiffFileTree-CaPQB8J4.js} +2 -2
  25. package/dist/client/assets/DiffPanel-3G1enpU9.js +2 -0
  26. package/dist/client/assets/{DiffWorkerPoolProvider-C_VbNhAr.js → DiffWorkerPoolProvider-BOInEqDW.js} +3 -3
  27. package/dist/client/assets/EmbeddedDesign-D97sS_-D.js +19 -0
  28. package/dist/client/assets/EmbeddedDesign-DYfQOv0y.css +1 -0
  29. package/dist/client/assets/{EnvironmentMachineIcon-b_kKEeAf.js → EnvironmentMachineIcon-B2v_GWgB.js} +2 -2
  30. package/dist/client/assets/{ExpandableText-anFaXhXF.js → ExpandableText-fJVIbCvG.js} +3 -3
  31. package/dist/client/assets/{FieldControl-w2_zp1DT.js → FieldControl-mq4xNgmP.js} +2 -2
  32. package/dist/client/assets/{FileDiff-B-9keGlb.js → FileDiff-DLYKd8S8.js} +2 -2
  33. package/dist/client/assets/{FilePreviewPanel-C1f_ibuL.js → FilePreviewPanel-BCtCBzc7.js} +10 -10
  34. package/dist/client/assets/{FoldedSettingsSection-gN3w1sSZ.js → FoldedSettingsSection-BIr-uvTu.js} +2 -2
  35. package/dist/client/assets/{FormContext-BWWAKTFF.js → FormContext-Vtmj_mkP.js} +2 -2
  36. package/dist/client/assets/{Icons-DzTpHpn1.js → Icons-C0Zjws-3.js} +2 -2
  37. package/dist/client/assets/Input-B0ah2lnC.js +2 -0
  38. package/dist/client/assets/{KeybindingsSettings.logic-D8LAdmvB.js → KeybindingsSettings.logic-D-GClV-c.js} +2 -2
  39. package/dist/client/assets/{NoProjectsHero-CtzChQ7p.js → NoProjectsHero-Dj3URl4e.js} +2 -2
  40. package/dist/client/assets/{P4ConnectAccountPages-B3SBsg6B.js → P4ConnectAccountPages-CFPHk3YU.js} +2 -2
  41. package/dist/client/assets/{P4ConnectSidebarSignIn-DKcaDv93.js → P4ConnectSidebarSignIn-BMrzp8XI.js} +2 -2
  42. package/dist/client/assets/PanelLayoutControls-C1Bf67DQ.js +216 -0
  43. package/dist/client/assets/{PierreEntryIcon-CjZ8gyJq.js → PierreEntryIcon--dw21QmY.js} +2 -2
  44. package/dist/client/assets/PopoverHandle-BT83XTq9.js +2 -0
  45. package/dist/client/assets/PreviewPanel-DCqFsoQM.js +2 -0
  46. package/dist/client/assets/ProjectDefaultsSettings-B4srG1Zj.js +2 -0
  47. package/dist/client/assets/{ProjectFavicon-va5UQPLo.js → ProjectFavicon--HkFaTb7.js} +3 -3
  48. package/dist/client/assets/{ProjectIconPickerDialog-CN2gK_o7.js → ProjectIconPickerDialog-Bl6Uid40.js} +2 -2
  49. package/dist/client/assets/{ProjectMonogram-B3Dkc8yq.js → ProjectMonogram-BUy_N1of.js} +2 -2
  50. package/dist/client/assets/{ProviderAuthTerminal-BSIgib7h.js → ProviderAuthTerminal-njw98kWo.js} +2 -2
  51. package/dist/client/assets/ProviderModelPicker-DBjdgQjr.js +2 -0
  52. package/dist/client/assets/{ProviderSettingsForm-D6zHGIeN.js → ProviderSettingsForm-_kCwzsZ5.js} +2 -2
  53. package/dist/client/assets/PullRequestCodeTab-2OTuKeLP.js +6 -0
  54. package/dist/client/assets/{ReadOnlySourcePreview-BSCVTdYH.js → ReadOnlySourcePreview-BfF8Dhuk.js} +2 -2
  55. package/dist/client/assets/RenderErrorBoundary-CReszKsZ.js +2 -0
  56. package/dist/client/assets/ScheduledTasksSettings-BJ6fD98R.js +4 -0
  57. package/dist/client/assets/{ScopedSwitch-D3fAHI1-.js → ScopedSwitch-QH2iiv6j.js} +2 -2
  58. package/dist/client/assets/{ScrollAreaCorner-CNzfnpwK.js → ScrollAreaCorner-3gSiyg8H.js} +2 -2
  59. package/dist/client/assets/{SecretInput-D7hYUoFA.js → SecretInput-itt3KL-b.js} +2 -2
  60. package/dist/client/assets/SelectScrollUpArrow-D_o_f6Fh.js +2 -0
  61. package/dist/client/assets/{SettingsPanels-6SOZMWhg.js → SettingsPanels-BRQsxDAj.js} +7 -7
  62. package/dist/client/assets/{SettingsPanels.logic-CMErdEeV.js → SettingsPanels.logic-DADnLbJa.js} +2 -2
  63. package/dist/client/assets/{SettingsScopeNotice-CyzbYUPJ.js → SettingsScopeNotice-D8WXgfaz.js} +2 -2
  64. package/dist/client/assets/{ThemeEditorPanel-vZ4MSCBx.js → ThemeEditorPanel-UEzfMVAc.js} +3 -3
  65. package/dist/client/assets/ThreadTerminalDrawer-Do19kCZu.js +5 -0
  66. package/dist/client/assets/TooltipViewport-DJ2VRKCt.js +2 -0
  67. package/dist/client/assets/{Virtualizer-CoK0zXAG.js → Virtualizer-BSpDafyf.js} +2 -2
  68. package/dist/client/assets/{WorkspaceBreadcrumb-qAYKTgm8.js → WorkspaceBreadcrumb-B5ZV6VNj.js} +2 -2
  69. package/dist/client/assets/{WorkspacePageContainer-D6i--Hwz.js → WorkspacePageContainer-BTN44jG6.js} +2 -2
  70. package/dist/client/assets/{WorkspacePageHeader-covOFYhv.js → WorkspacePageHeader-BaCxaW-R.js} +2 -2
  71. package/dist/client/assets/_chat-D4YotsBW.js +45 -0
  72. package/dist/client/assets/_chat.design-BPvdgNpo.js +2 -0
  73. package/dist/client/assets/{_chat.index-C3PnT6ae.js → _chat.index-Z_VqAv7I.js} +2 -2
  74. package/dist/client/assets/{_chat.new-CxErZ7CC.js → _chat.new-DOi-AUHb.js} +3 -3
  75. package/dist/client/assets/_chat.pull-requests-6QyjmUBZ.js +2 -0
  76. package/dist/client/assets/{abnfDiagram-VCTEODGH-CWxKS58m.js → abnfDiagram-VCTEODGH--jeYDB6y.js} +2 -2
  77. package/dist/client/assets/{alert-DsgAHDNi.js → alert-CdZT7d18.js} +2 -2
  78. package/dist/client/assets/architecture-7GRP2DOG-5FKzTtFB.js +1 -0
  79. package/dist/client/assets/{architectureDiagram-5GKGNRK7-kc6KNP-H.js → architectureDiagram-5GKGNRK7-CZT297Q4.js} +2 -2
  80. package/dist/client/assets/assets-CJFG5Oow.js +2 -0
  81. package/dist/client/assets/{blockDiagram-I7D4REHJ-CFJYOAbd.js → blockDiagram-I7D4REHJ-EkNtHyvf.js} +2 -2
  82. package/dist/client/assets/{browserHistoryStore-DjDw15jq.js → browserHistoryStore-DO5WuJ8O.js} +2 -2
  83. package/dist/client/assets/{browserLinkTarget-Br8BmA6w.js → browserLinkTarget-CJGymzWC.js} +2 -2
  84. package/dist/client/assets/{c4Diagram-7LVT6UL2-Sxaodxxv.js → c4Diagram-7LVT6UL2-CWpB4Da8.js} +2 -2
  85. package/dist/client/assets/channel-mtMr1s7n.js +2 -0
  86. package/dist/client/assets/{checkbox-D33R1soh.js → checkbox-Q0bv8RvC.js} +2 -2
  87. package/dist/client/assets/{chunk-4HAMMTFA-CxocYFD0.js → chunk-4HAMMTFA-DmxkShmg.js} +2 -2
  88. package/dist/client/assets/{chunk-75Z2AOVW-CBCO5Noa.js → chunk-75Z2AOVW-DR0PpYOm.js} +2 -2
  89. package/dist/client/assets/{chunk-DU6HZSFF-CEaklbmE.js → chunk-DU6HZSFF-BO8x-KoS.js} +2 -2
  90. package/dist/client/assets/{chunk-F27PBJKO-Iw-0qjF9.js → chunk-F27PBJKO-Bj6z3Mgi.js} +2 -2
  91. package/dist/client/assets/{chunk-GMAD6QVW-CbDVrypn.js → chunk-GMAD6QVW-DDPfmhbi.js} +2 -2
  92. package/dist/client/assets/{chunk-GVQU2GXP-BEqmpgLD.js → chunk-GVQU2GXP-Dt2y3Ljq.js} +2 -2
  93. package/dist/client/assets/{chunk-IMKFNOWR-bgZmQWS5.js → chunk-IMKFNOWR-ulVnFkwU.js} +2 -2
  94. package/dist/client/assets/{chunk-L3NEJ4N5-LW_IXl13.js → chunk-L3NEJ4N5-Bq_d7JXK.js} +2 -2
  95. package/dist/client/assets/{chunk-OSK3NFVY-DvGdSD7J.js → chunk-OSK3NFVY-D3zjZoqS.js} +2 -2
  96. package/dist/client/assets/{chunk-P2QGCYS3-BAXEcEik.js → chunk-P2QGCYS3-BO8zGK2Q.js} +2 -2
  97. package/dist/client/assets/{chunk-POPQ4Y6H-yM2kH99r.js → chunk-POPQ4Y6H-gzBrIuwg.js} +2 -2
  98. package/dist/client/assets/{chunk-PWAF6VOD-B19ZyrVH.js → chunk-PWAF6VOD-D5kNvXnl.js} +2 -2
  99. package/dist/client/assets/{chunk-SHT3W25Y-BhcwXJOc.js → chunk-SHT3W25Y-BUoRhLSC.js} +2 -2
  100. package/dist/client/assets/{chunk-SVP7TREG-B9xbRF9R.js → chunk-SVP7TREG-Bjv2VnZc.js} +2 -2
  101. package/dist/client/assets/{chunk-TICWLB2K-D_VEGQbw.js → chunk-TICWLB2K-DAdtg5Kx.js} +2 -2
  102. package/dist/client/assets/classDiagram-ZZMXUADV-B1oFCLrU.js +2 -0
  103. package/dist/client/assets/classDiagram-v2-VYDZK3BY-B1oFCLrU.js +2 -0
  104. package/dist/client/assets/{color-picker-D3b0sEoy.js → color-picker-BWZhsiZJ.js} +2 -2
  105. package/dist/client/assets/{combobox-DzFRsaks.js → combobox-BdGKdc6i.js} +2 -2
  106. package/dist/client/assets/{command-IDMJ6pXc.js → command-CIj8Rufv.js} +2 -2
  107. package/dist/client/assets/composer-logic-LXlav2Vb.js +6 -0
  108. package/dist/client/assets/{composerDraftUploads-Qq0xOGEc.js → composerDraftUploads-ykQlcbPE.js} +2 -2
  109. package/dist/client/assets/{connect-BTIPE2au.js → connect-BtrTxy8-.js} +2 -2
  110. package/dist/client/assets/{connect-agent-hbkOBaFx.js → connect-agent-CVmArWh1.js} +2 -2
  111. package/dist/client/assets/{cynefin-OW5HDTMX-CWOcHmwk.js → cynefin-OW5HDTMX-DOViMxbO.js} +1 -1
  112. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-ksIfZeWS.js → cynefinDiagram-5FMLGOSQ-BWRCt23-.js} +2 -2
  113. package/dist/client/assets/{dagre-GXQ25YYZ-D7qz-Azr.js → dagre-GXQ25YYZ-DgnOAR1P.js} +2 -2
  114. package/dist/client/assets/design-D2FoGDbP.js +2 -0
  115. package/dist/client/assets/device-CdLsoK0D.js +2 -0
  116. package/dist/client/assets/{diagram-S7CK7UJ4-IBhHReDK.js → diagram-S7CK7UJ4-C-BUdvbR.js} +2 -2
  117. package/dist/client/assets/{diagram-UQ7AKVKN-EX7tFJEV.js → diagram-UQ7AKVKN-CYox921O.js} +2 -2
  118. package/dist/client/assets/{diagram-VSXAHHWV-BEHOoBER.js → diagram-VSXAHHWV-CCHV1RQz.js} +2 -2
  119. package/dist/client/assets/{diagram-VX7I27RA-Df_ThjhC.js → diagram-VX7I27RA-B4SkxxZx.js} +2 -2
  120. package/dist/client/assets/{diagram-Z3DM3KII-DudywHX4.js → diagram-Z3DM3KII-D80OJGVQ.js} +2 -2
  121. package/dist/client/assets/{dialog-YpQOq7Ug.js → dialog-Cgb4jap2.js} +2 -2
  122. package/dist/client/assets/{diffRendering-CgLbOp0J.js → diffRendering-CdquEtfn.js} +2 -2
  123. package/dist/client/assets/{discovery-list-CnlrZrDo.js → discovery-list-DXkskf2A.js} +2 -2
  124. package/dist/client/assets/{dist-usNgCtd_.js → dist-DWlOCBGN.js} +5 -5
  125. package/dist/client/assets/{draft-input-DW6EgVbF.js → draft-input-DQxVE9YJ.js} +2 -2
  126. package/dist/client/assets/{duoViewer-CgVOZcYe.js → duoViewer-Cig0lw70.js} +2 -2
  127. package/dist/client/assets/{dynamic-C1qIL2Wy.js → dynamic-DUhOBcsP.js} +3 -3
  128. package/dist/client/assets/{ebnfDiagram-PWID7BFC-DPJg2C3n.js → ebnfDiagram-PWID7BFC-AJpsDjYU.js} +2 -2
  129. package/dist/client/assets/{embeddedScripts-CAZM4r8Y.js → embeddedScripts-DVwzRCwI.js} +2 -2
  130. package/dist/client/assets/{empty-QSN6WiRO.js → empty-DHl8_LXy.js} +2 -2
  131. package/dist/client/assets/entities-BBhhC0Ry.js +2 -0
  132. package/dist/client/assets/{erDiagram-RLTQ6QDP-BySDEjHG.js → erDiagram-RLTQ6QDP-qU4wtJw2.js} +2 -2
  133. package/dist/client/assets/eventmodeling-NTZA5JFV-CIzOZUSe.js +1 -0
  134. package/dist/client/assets/{fileLinks-ShhGM_AF.js → fileLinks-16LrhkMX.js} +2 -2
  135. package/dist/client/assets/{fileTreeExpansion-DZnEBuaB.js → fileTreeExpansion-BwModZ8t.js} +2 -2
  136. package/dist/client/assets/flowDiagram-HODETNUW-G6NoS3v2.js +1 -0
  137. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CJAhE7we.js → ganttDiagram-EL5Y4UJY-CMa5sD7U.js} +2 -2
  138. package/dist/client/assets/{getDiffFileInput-BxuEGdnM.js → getDiffFileInput-CMp2lO2J.js} +2 -2
  139. package/dist/client/assets/git-compare-CCnx9obs.js +2 -0
  140. package/dist/client/assets/{gitGraph-4MIJSDKK-BqKoI8Rd.js → gitGraph-4MIJSDKK-d8ivfU97.js} +1 -1
  141. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BPFwoaRw.js → gitGraphDiagram-WWUBYQGX-dltGGWCt.js} +2 -2
  142. package/dist/client/assets/{guideRunStore-CYD68wqk.js → guideRunStore-CKZDf9-2.js} +2 -2
  143. package/dist/client/assets/{htmlRender-p6atQGoW.js → htmlRender-BUb_wWp9.js} +2 -2
  144. package/dist/client/assets/{index-CnQWjeBY.js → index-oiPu1asR.js} +3 -3
  145. package/dist/client/assets/{info-A6RAGUB7-R8j64K2s.js → info-A6RAGUB7-B_ozJ3Df.js} +1 -1
  146. package/dist/client/assets/{infoDiagram-27XIBGKW-DFqL9n-v.js → infoDiagram-27XIBGKW-BiB0fE5_.js} +2 -2
  147. package/dist/client/assets/{input-Df_UyHLk.js → input-D_jxqXLR.js} +2 -2
  148. package/dist/client/assets/{input-group-CpRPTpIU.js → input-group-BM_USnbh.js} +2 -2
  149. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-C-786VMl.js → ishikawaDiagram-5VMMS53U-DhfuI9PX.js} +2 -2
  150. package/dist/client/assets/{journeyDiagram-3NMN7TZE-lzAoDD4e.js → journeyDiagram-3NMN7TZE-8alknR0e.js} +2 -2
  151. package/dist/client/assets/{kanban-definition-UXKFOSKX-CJDCWAxz.js → kanban-definition-UXKFOSKX-IrCQ1z1D.js} +2 -2
  152. package/dist/client/assets/{kbd-BWmfbdyt.js → kbd-B2uytHus.js} +2 -2
  153. package/dist/client/assets/{keybindings-Cwx4RZou.js → keybindings-CqjUKNRx.js} +2 -2
  154. package/dist/client/assets/{lazyRouteComponent-AWcDof8d.js → lazyRouteComponent-CByGrW41.js} +2 -2
  155. package/dist/client/assets/{line-BV7EkscB.js → line-wwHo_z2p.js} +2 -2
  156. package/dist/client/assets/{link-ymnjoepm.js → link-BjP3qTK9.js} +2 -2
  157. package/dist/client/assets/{linkedPrompt-D1v0zLjD.js → linkedPrompt-P6UqYCja.js} +2 -2
  158. package/dist/client/assets/main-COMts6-0.js +28 -0
  159. package/dist/client/assets/main-Dwir4BoC.css +2 -0
  160. package/dist/client/assets/{mediaReference-DjHCSaNZ.js → mediaReference-C10FT-nO.js} +2 -2
  161. package/dist/client/assets/mediaSource-tGWQYhPt.js +2 -0
  162. package/dist/client/assets/{mermaid-parser.core-dhHCExtt.js → mermaid-parser.core-YE1Gxotj.js} +4 -4
  163. package/dist/client/assets/{mermaid.core-DixI3w-9.js → mermaid.core-DE9uOpTH.js} +5 -5
  164. package/dist/client/assets/{mindmap-definition-YA3MSWOX-BHehI_9I.js → mindmap-definition-YA3MSWOX-CLa2hbBW.js} +2 -2
  165. package/dist/client/assets/number-field-Dj0uYTJQ.js +2 -0
  166. package/dist/client/assets/{observeResize-uogErzin.js → observeResize-jHx61cGA.js} +2 -2
  167. package/dist/client/assets/onboarding-DCwprQF7.js +2 -0
  168. package/dist/client/assets/openFileInPreview-Dj9ZUFfJ.js +2 -0
  169. package/dist/client/assets/{p4ProjectFile-B9fwmcbM.js → p4ProjectFile-DfE23uqD.js} +2 -2
  170. package/dist/client/assets/{packet-AYTQ26CC-DhFsyjVR.js → packet-AYTQ26CC-Be9nXFns.js} +1 -1
  171. package/dist/client/assets/{pair-DJbA4cVs.js → pair-CZDxH6ja.js} +2 -2
  172. package/dist/client/assets/{pegDiagram-XKGWAZYB-DBKpIU8U.js → pegDiagram-XKGWAZYB-C230ixTv.js} +2 -2
  173. package/dist/client/assets/pendingSendStore-CaGsppQi.js +2 -0
  174. package/dist/client/assets/{phoneViewer-CywOkDco.js → phoneViewer-CdFM4t6r.js} +2 -2
  175. package/dist/client/assets/{pie-WAS4IAKB-cW3as8Lm.js → pie-WAS4IAKB-DdxLVm9y.js} +1 -1
  176. package/dist/client/assets/{pieDiagram-E7YTZNPT-CuM-4V4_.js → pieDiagram-E7YTZNPT-AK3e5d1A.js} +2 -2
  177. package/dist/client/assets/{pierre-icons-Bhwlc2rO.js → pierre-icons-BodtO6xC.js} +2 -2
  178. package/dist/client/assets/{popover-2GkuSL2i.js → popover-2XJd3KEJ.js} +2 -2
  179. package/dist/client/assets/{preview-BnLuRquy.js → preview-8bBtJM5H.js} +2 -2
  180. package/dist/client/assets/{preview-DWVmLubs.js → preview-x-GNJPih.js} +2 -2
  181. package/dist/client/assets/{previewMiniPlayerStore-B2cko9-z.js → previewMiniPlayerStore-DMd0mA7a.js} +2 -2
  182. package/dist/client/assets/primary-BDy4SXjC.js +2 -0
  183. package/dist/client/assets/primaryCloudLinkState--Kh80aBj.js +2 -0
  184. package/dist/client/assets/projectFilesQueryState-Bb-3twEo.js +2 -0
  185. package/dist/client/assets/projectScriptEditor-CAk1a7Bv.js +2 -0
  186. package/dist/client/assets/{providerSkills-OICI2srI.js → providerSkills-9AaADmXt.js} +2 -2
  187. package/dist/client/assets/{pullRequestDetail.logic-DT8Qo5OA.js → pullRequestDetail.logic-Fv7ouL_B.js} +4 -4
  188. package/dist/client/assets/{pullRequestIcons-BBzWaymE.js → pullRequestIcons-e8EZW8_y.js} +2 -2
  189. package/dist/client/assets/{pullRequestReviewStore-DKeU327h.js → pullRequestReviewStore-DJx8EOVl.js} +2 -2
  190. package/dist/client/assets/pullRequests-I9yJXxf5.js +2 -0
  191. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DSJ5VFnE.js → quadrantDiagram-AXDQQJYC-CcagVHbG.js} +2 -2
  192. package/dist/client/assets/queries-DY5q7KFy.js +2 -0
  193. package/dist/client/assets/query-BFP47tsD.js +2 -0
  194. package/dist/client/assets/{radar-RG4KPBEZ-CfIGvIx_.js → radar-RG4KPBEZ-YiDR7Sp-.js} +1 -1
  195. package/dist/client/assets/radio-group-BNV16qlg.js +2 -0
  196. package/dist/client/assets/{railroad-74A4TZTK-DB4Av5dd.js → railroad-74A4TZTK-Cg9vU93U.js} +1 -1
  197. package/dist/client/assets/railroad-abnf-HS5TGJTU-CFQBiMqT.js +1 -0
  198. package/dist/client/assets/railroad-ebnf-LZEXJU2U-KvUMMzpJ.js +1 -0
  199. package/dist/client/assets/railroad-peg-WCYAUIDC-ps7Jjity.js +1 -0
  200. package/dist/client/assets/{railroadDiagram-O6MQD6OU-cpv2Uyk5.js → railroadDiagram-O6MQD6OU-DKJFQoet.js} +2 -2
  201. package/dist/client/assets/{renderScheduler-h5pQXGNH.js → renderScheduler-skv2ZK84.js} +2 -2
  202. package/dist/client/assets/{requirementDiagram-BXWQKSXE-DYwMIoLP.js → requirementDiagram-BXWQKSXE-CsnTqOO2.js} +2 -2
  203. package/dist/client/assets/rightPanelStore-XfAJpUIA.js +2 -0
  204. package/dist/client/assets/runtime-BSS7jQw6.js +2 -0
  205. package/dist/client/assets/runtime-D-mOwjrE.js +6 -0
  206. package/dist/client/assets/runtimeModeConfig-sQBlbgY3.js +2 -0
  207. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BqmXJBYG.js → sankeyDiagram-P5KCCOFB-DkydPO4_.js} +2 -2
  208. package/dist/client/assets/{scheduledTasksSettings.logic-Cg8SF9mr.js → scheduledTasksSettings.logic-C-rCAoCn.js} +3 -3
  209. package/dist/client/assets/{scroll-area-0-l4q4Pk.js → scroll-area-DORwTFtw.js} +2 -2
  210. package/dist/client/assets/{select-Dhapqr3j.js → select-Bsag72zE.js} +2 -2
  211. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-h3AJox3t.js → sequenceDiagram-WJ2MYXX4-Df0N4Qqb.js} +2 -2
  212. package/dist/client/assets/server-WufAYYa2.js +2 -0
  213. package/dist/client/assets/session-logic-VyTvpA5f.js +26 -0
  214. package/dist/client/assets/session-pjgqVscl.js +2 -0
  215. package/dist/client/assets/{settings-CGf9Ad5Y.js → settings-CsOciX79.js} +2 -2
  216. package/dist/client/assets/settings.appearance-BTa_DZJP.js +2 -0
  217. package/dist/client/assets/settings.archived-5E_Gxvpz.js +2 -0
  218. package/dist/client/assets/{settings.computer-use-C3SE4DHj.js → settings.computer-use-0aB9RoDX.js} +2 -2
  219. package/dist/client/assets/settings.connections-DUkG_06v.js +2 -0
  220. package/dist/client/assets/{settings.data-controls-DjgZVIMy.js → settings.data-controls-Cn2MWFbv.js} +2 -2
  221. package/dist/client/assets/{settings.decisions-z3RVOG7-.js → settings.decisions-nRlfWokn.js} +2 -2
  222. package/dist/client/assets/settings.designs-CYIwYmP5.js +2 -0
  223. package/dist/client/assets/settings.diagnostics-pCb9rEgL.js +2 -0
  224. package/dist/client/assets/settings.general-DPkJcwHC.js +2 -0
  225. package/dist/client/assets/settings.integrations-DVMeSb1K.js +2 -0
  226. package/dist/client/assets/{settings.keybindings-D78CWKIy.js → settings.keybindings-PZlDKFMi.js} +2 -2
  227. package/dist/client/assets/{settings.open-source-licenses-BhpBR1nY.js → settings.open-source-licenses-CoY0kkph.js} +2 -2
  228. package/dist/client/assets/{settings.plugins-d9-jrUr-.js → settings.plugins-DCo7nzjN.js} +4 -4
  229. package/dist/client/assets/settings.projects-iA51Y3aj.js +4 -0
  230. package/dist/client/assets/settings.providers-BkUKaZF-.js +3 -0
  231. package/dist/client/assets/settings.scheduled-tasks-C0FpV34l.js +2 -0
  232. package/dist/client/assets/settings.snap-shot-C29-fDJw.js +2 -0
  233. package/dist/client/assets/settings.source-control-CqLszsPJ.js +2 -0
  234. package/dist/client/assets/{settings.storage-D6vDu4vG.js → settings.storage-JCo0X6p0.js} +2 -2
  235. package/dist/client/assets/settingsLayout-DkRcMtAs.js +3 -0
  236. package/dist/client/assets/{sidebar-DTT0HQ9J.js → sidebar-CV_a9dPF.js} +2 -2
  237. package/dist/client/assets/{sidebarProjectGrouping-JqsedUb6.js → sidebarProjectGrouping-C94BzdFc.js} +2 -2
  238. package/dist/client/assets/{skeleton-D-FcvmF0.js → skeleton-Bq50sEah.js} +2 -2
  239. package/dist/client/assets/{sourceControl-CrjTZJC-.js → sourceControl-BvubWC9K.js} +2 -2
  240. package/dist/client/assets/{sourceControlClients-DYQ3gMZ2.js → sourceControlClients-DKVeNHGN.js} +2 -2
  241. package/dist/client/assets/{spinner-AJeHmaWN.js → spinner-Bzrp5oww.js} +2 -2
  242. package/dist/client/assets/{standalone-page-Df29sgRU.js → standalone-page-BGqmgLmI.js} +2 -2
  243. package/dist/client/assets/{stateDiagram-D77RDMKH-C0KiABVq.js → stateDiagram-D77RDMKH-Ctp0qVPg.js} +2 -2
  244. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DTjnbS5I.js +2 -0
  245. package/dist/client/assets/{swimlanes-42K2YHIH-BdAWIkuy.js → swimlanes-42K2YHIH-_LIKBAWu.js} +2 -2
  246. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BEo2_7TC.js +9 -0
  247. package/dist/client/assets/{terminal-links-BjKL3dH7.js → terminal-links-DHw7nXFF.js} +2 -2
  248. package/dist/client/assets/{terminalSessions-dkFe-6qM.js → terminalSessions-WR45SySR.js} +2 -2
  249. package/dist/client/assets/{textarea-CqADnND1.js → textarea-wDfYVvpo.js} +2 -2
  250. package/dist/client/assets/{themePalette-Co4xeJnW.js → themePalette-CLR_iiPi.js} +3 -3
  251. package/dist/client/assets/{timeline-definition-24CTP7MA-CkYp2QT_.js → timeline-definition-24CTP7MA--fH4g9Xi.js} +2 -2
  252. package/dist/client/assets/toast-x69BFrW5.js +2 -0
  253. package/dist/client/assets/{toggle-BM8lnQ29.js → toggle-ExdxBJoI.js} +2 -2
  254. package/dist/client/assets/{toggle-group-DaqkIApY.js → toggle-group-Clz6KDtW.js} +2 -2
  255. package/dist/client/assets/{tooltip-ngKqo-lA.js → tooltip-D-SzZpgJ.js} +2 -2
  256. package/dist/client/assets/{treeView-Q6P3EWNA-YWYRI1IG.js → treeView-Q6P3EWNA-BYF4NjYA.js} +1 -1
  257. package/dist/client/assets/{treemap-WGGIJYW6-DOqHNCbg.js → treemap-WGGIJYW6-DTEnfmuA.js} +1 -1
  258. package/dist/client/assets/{uiStateStore-Ddhpg65j.js → uiStateStore-CP4WDmc8.js} +3 -3
  259. package/dist/client/assets/usage-C8NW06hk.js +2 -0
  260. package/dist/client/assets/{usageAccess-AcIxVQqJ.js → usageAccess-ZgmQIiWk.js} +2 -2
  261. package/dist/client/assets/{usageFormat-BXW38hCK.js → usageFormat-C54RJiV9.js} +2 -2
  262. package/dist/client/assets/{usageShortcuts-Qkdifm3k.js → usageShortcuts-B3af64g0.js} +2 -2
  263. package/dist/client/assets/{use-atom-command-BJxdfyHC.js → use-atom-command-rhVarDA8.js} +2 -2
  264. package/dist/client/assets/{useAriaLabelledBy-C0a8QEEb.js → useAriaLabelledBy-BG5RCb1o.js} +2 -2
  265. package/dist/client/assets/useHandleNewThread-Bhl1v82B.js +2 -0
  266. package/dist/client/assets/{useLocation-BQDC59xg.js → useLocation-7uJHNdPS.js} +2 -2
  267. package/dist/client/assets/useNavigate-DCj963r2.js +2 -0
  268. package/dist/client/assets/{useNavigateBack-BH5As9D1.js → useNavigateBack-DpCLZais.js} +2 -2
  269. package/dist/client/assets/{useP4ConnectAuthPrompt-DHu7R38-.js → useP4ConnectAuthPrompt-ubtmHQ6f.js} +2 -2
  270. package/dist/client/assets/{useParams-BMa26XZG.js → useParams-Br7l7qPU.js} +2 -2
  271. package/dist/client/assets/{usePermissionStatus-CUViQRYY.js → usePermissionStatus-SyBwmFSK.js} +2 -2
  272. package/dist/client/assets/{usePullRequestActions-DGkavykA.js → usePullRequestActions-Djf1UHJs.js} +3 -3
  273. package/dist/client/assets/{useRegisterFieldControl-CosvijuC.js → useRegisterFieldControl-qXOWsCr5.js} +2 -2
  274. package/dist/client/assets/{useScopedModelAvailability-DOJzIjns.js → useScopedModelAvailability-BAzgc0gB.js} +2 -2
  275. package/dist/client/assets/useSettings-BNs1IeKk.js +3 -0
  276. package/dist/client/assets/utils-hgbJ2TVM.js +37 -0
  277. package/dist/client/assets/vcsRefInvalidation-DmqB0sWy.js +2 -0
  278. package/dist/client/assets/{vennDiagram-4TSXK5OY-DvpVodA1.js → vennDiagram-4TSXK5OY-BzIqk05W.js} +2 -2
  279. package/dist/client/assets/{wardley-WFR3VGLG-CW8u1RAF.js → wardley-WFR3VGLG-CWuiB19I.js} +1 -1
  280. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-B34GmEPm.js → wardleyDiagram-VM6X3IG4-C3KRakQk.js} +2 -2
  281. package/dist/client/assets/welcome-BFUhADQd.js +2 -0
  282. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-Ds5Ioly5.js → xychartDiagram-S5SC5T6Z-cK0SAbmi.js} +2 -2
  283. package/dist/client/index.html +1 -1
  284. package/dist/{renderer-ClrN4p2R.mjs → renderer-U6GevbYv.mjs} +2 -2
  285. package/dist/{runtime-BQydA64s.mjs → runtime-Cui_uQWU.mjs} +88 -5
  286. package/package.json +1 -1
  287. package/dist/client/assets/AlertDialogRoot-DCfR_LaK.js +0 -2
  288. package/dist/client/assets/ChatGptUsageButton-CoiZRjaS.js +0 -2
  289. package/dist/client/assets/CheckboxIndicator-DcH9EpvK.js +0 -2
  290. package/dist/client/assets/CodexSetupSection.logic-sXohw-MK.js +0 -2
  291. package/dist/client/assets/CollapsiblePanel-FknKvWoA.js +0 -2
  292. package/dist/client/assets/ComboboxClear-RsGmZUJN.js +0 -2
  293. package/dist/client/assets/ComboboxGroupLabel-DO1lnPnr.js +0 -2
  294. package/dist/client/assets/CompositeRoot-DDZcK2m0.js +0 -2
  295. package/dist/client/assets/DevicePanel-DmfTFNuU.js +0 -2
  296. package/dist/client/assets/DialogTitle-Dr-LJLpq.js +0 -2
  297. package/dist/client/assets/DiffPanel-CEx8f_mo.js +0 -2
  298. package/dist/client/assets/EmbeddedDesign-DmybFtYo.css +0 -1
  299. package/dist/client/assets/EmbeddedDesign-Hba9k7LF.js +0 -19
  300. package/dist/client/assets/Input-DCMTYdrA.js +0 -2
  301. package/dist/client/assets/PanelLayoutControls-CCYVBazN.js +0 -216
  302. package/dist/client/assets/PopoverHandle-1bqR8KHF.js +0 -2
  303. package/dist/client/assets/PreviewPanel-Kq4mVufQ.js +0 -2
  304. package/dist/client/assets/ProjectDefaultsSettings-DUCUj4oc.js +0 -2
  305. package/dist/client/assets/ProviderModelPicker-BrEkNDPF.js +0 -2
  306. package/dist/client/assets/PullRequestCodeTab-DA-5pWeg.js +0 -6
  307. package/dist/client/assets/RenderErrorBoundary-yWjbnzsc.js +0 -2
  308. package/dist/client/assets/ScheduledTasksSettings-B1bSNXTP.js +0 -4
  309. package/dist/client/assets/SelectScrollUpArrow-kQBsA9rk.js +0 -2
  310. package/dist/client/assets/ThreadTerminalDrawer-BU_DR6wu.js +0 -5
  311. package/dist/client/assets/TooltipViewport-CG7gtflQ.js +0 -2
  312. package/dist/client/assets/_chat-DMXSEEst.js +0 -45
  313. package/dist/client/assets/_chat.pull-requests-w2FCKIZ8.js +0 -2
  314. package/dist/client/assets/architecture-7GRP2DOG-BVExhwPq.js +0 -1
  315. package/dist/client/assets/assets-DW8sK93I.js +0 -2
  316. package/dist/client/assets/channel-BLnKdGtk.js +0 -2
  317. package/dist/client/assets/classDiagram-ZZMXUADV-B839piSM.js +0 -2
  318. package/dist/client/assets/classDiagram-v2-VYDZK3BY-B839piSM.js +0 -2
  319. package/dist/client/assets/composer-logic-CEsP6SV6.js +0 -6
  320. package/dist/client/assets/design-B7V20I1i.js +0 -2
  321. package/dist/client/assets/device-DX-G6J1j.js +0 -2
  322. package/dist/client/assets/entities-Bj5ceyfn.js +0 -2
  323. package/dist/client/assets/eventmodeling-NTZA5JFV-CrSSBuUT.js +0 -1
  324. package/dist/client/assets/flowDiagram-HODETNUW-GdATwCAd.js +0 -1
  325. package/dist/client/assets/git-compare-DW_c6fci.js +0 -2
  326. package/dist/client/assets/main-Byysx0nX.css +0 -2
  327. package/dist/client/assets/main-D8FWUaO_.js +0 -26
  328. package/dist/client/assets/mediaSource-DrVcMaQl.js +0 -2
  329. package/dist/client/assets/number-field-BHWzsgFF.js +0 -2
  330. package/dist/client/assets/onboarding-BkSIwdaJ.js +0 -2
  331. package/dist/client/assets/openFileInPreview-3vlmqdKv.js +0 -2
  332. package/dist/client/assets/primary-CKEI970r.js +0 -2
  333. package/dist/client/assets/primaryCloudLinkState-CwxbxrZn.js +0 -2
  334. package/dist/client/assets/projectFilesQueryState-45r9sIZp.js +0 -2
  335. package/dist/client/assets/projectScriptEditor-CI1LZs9V.js +0 -2
  336. package/dist/client/assets/pullRequests-DLPX2CY-.js +0 -2
  337. package/dist/client/assets/queries-lVyDrFzk.js +0 -2
  338. package/dist/client/assets/query-tgXMuDtS.js +0 -2
  339. package/dist/client/assets/radio-group-CJu78gKo.js +0 -2
  340. package/dist/client/assets/railroad-abnf-HS5TGJTU-Ce_EhWE2.js +0 -1
  341. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BWrImE-J.js +0 -1
  342. package/dist/client/assets/railroad-peg-WCYAUIDC-BydBUlqT.js +0 -1
  343. package/dist/client/assets/rightPanelStore-Csibei0O.js +0 -2
  344. package/dist/client/assets/runtime-DATbE5vH.js +0 -6
  345. package/dist/client/assets/runtime-Dks8Wo5P.js +0 -2
  346. package/dist/client/assets/runtimeModeConfig-n1vq0Zzd.js +0 -2
  347. package/dist/client/assets/server-rxH1493J.js +0 -2
  348. package/dist/client/assets/session-Bgs0dTwK.js +0 -2
  349. package/dist/client/assets/session-logic-BuYRdtPc.js +0 -26
  350. package/dist/client/assets/settings.appearance-DV608fbL.js +0 -2
  351. package/dist/client/assets/settings.archived-Cav4CAd_.js +0 -2
  352. package/dist/client/assets/settings.connections-C9Kh1b2k.js +0 -2
  353. package/dist/client/assets/settings.designs-DgLVIZOE.js +0 -2
  354. package/dist/client/assets/settings.diagnostics-CaXx9YEU.js +0 -2
  355. package/dist/client/assets/settings.general-BOpvFj1F.js +0 -2
  356. package/dist/client/assets/settings.integrations-MHjX-SLC.js +0 -2
  357. package/dist/client/assets/settings.projects-BiDMtruF.js +0 -4
  358. package/dist/client/assets/settings.providers-BarMZxaG.js +0 -3
  359. package/dist/client/assets/settings.scheduled-tasks-BA_O1-Fn.js +0 -2
  360. package/dist/client/assets/settings.snap-shot-Crh49RtQ.js +0 -2
  361. package/dist/client/assets/settings.source-control-DIrrX9Dt.js +0 -2
  362. package/dist/client/assets/settingsLayout-BQsOdImg.js +0 -3
  363. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DlcRyn96.js +0 -2
  364. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-lbxQDJ07.js +0 -9
  365. package/dist/client/assets/toast-gFAddE-Q.js +0 -2
  366. package/dist/client/assets/usage-B3PzCXST.js +0 -2
  367. package/dist/client/assets/useHandleNewThread-BUYzfgdc.js +0 -2
  368. package/dist/client/assets/useNavigate-BziZQ-Vx.js +0 -2
  369. package/dist/client/assets/useSettings-B_WzhJqU.js +0 -3
  370. package/dist/client/assets/utils-BctiQ4Ue.js +0 -37
  371. package/dist/client/assets/vcsRefInvalidation-cn2N4Xey.js +0 -2
  372. package/dist/client/assets/welcome-DEFnpzjQ.js +0 -2
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Aw as n,Df as r,ET as i,FT as a,Hd as o,MT as s,Mf as c,NE as l,NT as u,Ub as d,Ud as f,Vu as p,Yo as m,Zf as h,__ as g,cr as _,ed as v,f_ as y,lE as b,pf as x,sr as S,t as C,u_ as w,uf as ee,zT as T,zd as te,zu as E}from"./utils-BctiQ4Ue.js";import{R as ne,W as re}from"./runtime-DATbE5vH.js";import{f as D,l as O,p as k}from"./TooltipViewport-CG7gtflQ.js";import{i as A,p as j}from"./toast-gFAddE-Q.js";import{D as M,q as ie}from"./useSettings-B_WzhJqU.js";import{f as N}from"./server-rxH1493J.js";import{i as ae,n as oe,t as se}from"./session-Bgs0dTwK.js";import{n as ce}from"./query-tgXMuDtS.js";import{t as le}from"./use-atom-command-BJxdfyHC.js";import{a as P,o as F,u as ue}from"./timestampFormat-wac2e_Jz.js";import{a as I,n as L,t as R}from"./tooltip-ngKqo-lA.js";import{n as de,t as fe}from"./toggle-group-DaqkIApY.js";import{t as pe}from"./input-Df_UyHLk.js";import{t as z}from"./scroll-area-0-l4q4Pk.js";import{B as me,P as he,i as ge,s as B,u as V}from"./settingsLayout-BQsOdImg.js";import{t as _e}from"./ConnectionStatusDot-Bz5Ps6Bm.js";import{fa as ve,la as ye,ni as be}from"./main-D8FWUaO_.js";import{t as xe}from"./usageAccess-AcIxVQqJ.js";import{t as H}from"./ExpandableText-anFaXhXF.js";import{t as U}from"./formatBytes-D8LhsSVR.js";import{t as W}from"./SettingsScopeNotice-CyzbYUPJ.js";var G=l(),K=e(b(),1);function q(e){let t=(0,G.c)(19),{disabled:n,onSignal:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`SIGINT`),t[0]=r,t[1]=i);let a;t[2]!==n||t[3]!==i?(a=(0,K.jsx)(I,{render:(0,K.jsx)(_,{disabled:n,"aria-label":`Send SIGINT`,tone:`muted`,onClick:i,children:`INT`})}),t[2]=n,t[3]=i,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(L,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,K.jsxs)(R,{children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===r?c=t[9]:(c=()=>r(`SIGKILL`),t[8]=r,t[9]=c);let l;t[10]!==n||t[11]!==c?(l=(0,K.jsx)(I,{render:(0,K.jsx)(_,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:c,children:`KILL`})}),t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(L,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,K.jsxs)(R,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var J=e(t(),1);function Se(e){let t=(0,G.c)(10),r=M(),i=e===void 0?r?.environmentId??null:e,a=ae(i,w),o;t[0]!==a||t[1]!==i?(o=i===null||!a?null:N.resourceTelemetry({environmentId:i,input:{}}),t[0]=a,t[1]=i,t[2]=o):o=t[2];let s=ce(o),c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[3]=c):c=t[3];let l=le(N.retryResourceTelemetry,c),u;t[4]!==i||t[5]!==l?(u=async()=>{if(i===null)throw Error(`No environment is selected.`);if(!oe(i,`environment:maintain`)||!oe(i,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await l({environmentId:i,input:{}});if(e._tag===`Failure`)throw n(e.cause);return e.value.snapshot},t[4]=i,t[5]=l,t[6]=u):u=t[6];let d=u,f;return t[7]!==s||t[8]!==d?(f={...s,retry:d},t[7]=s,t[8]=d,t[9]=f):f=t[9],f}function Ce(e,t){let n=(0,G.c)(4),r=M(),i=t===void 0?r?.environmentId??null:t,a=ae(i,w),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:N.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],ce(o)}function Y(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function we(e,t){let n=new Map;for(let t of e){let e=n.get(t.ppid)??[];e.push(t),n.set(t.ppid,e)}let r=new Set,i=e=>{for(let t of n.get(e)??[]){let e=Y(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(Y(n))&&i(n.identity.pid);return e.filter(e=>!r.has(Y(e)))}function Te(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function X(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function Ee(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var De=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function Oe(e){return`${U(e)}/s`}function ke(e){let t=e/1e3;if(t<60)return`${t.toFixed(t>=10?1:2)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function Ae(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} s`}function je(e){if(e<1e3)return`${Math.max(0,Math.round(e))} ms`;let t=e/1e3;return`${t.toLocaleString(void 0,{maximumFractionDigits:1})} ${t===1?`second`:`seconds`}`}function Me(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Ne(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Pe(e){if(e.name.trim())return e.name;let t=(e.command.trim().split(/\s+/)[0]??e.command).replace(/^['"]|['"]$/g,``);return t.split(/[\\/]/).findLast(e=>e.length>0)??t}function Fe(e){switch(e){case`server`:return`Server`;case`server-child`:return`Backend child`;case`provider-root`:return`Provider`;case`terminal-root`:return`Terminal`;case`electron-main`:return`Electron main`;case`electron-renderer`:return`Renderer`;case`electron-gpu`:return`GPU`;case`electron-utility`:return`Electron utility`;case`resource-monitor`:return`Monitor`;case`unknown-p4`:return`P4 process`}}function Ie(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function Le(e){switch(e){case`storage`:return`Storage bytes`;case`logical`:return`Logical bytes`;case`all-io`:return`All I/O bytes`;case`unavailable`:return`Unavailable`}}function Re(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function ze(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function Be(e){let t=(0,G.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??ze(r),t[0]=i?.tone,t[1]=r,t[2]=a):a=t[2];let o=a,s=o===`neutral`&&`border-border/70 bg-muted/45 text-muted-foreground`,c=o==="default"&&`border-success/25 bg-success/10 text-success-foreground`,l=o===`warning`&&`border-warning/30 bg-warning/10 text-warning-foreground`,u=o===`danger`&&`border-destructive/30 bg-destructive/10 text-destructive`,d;t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==u?(d=C(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-3xs font-semibold uppercase tracking-widest`,s,c,l,u),t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=o===`neutral`&&`bg-muted-foreground/55`,p=o==="default"&&`bg-success`,m=o===`warning`&&`bg-warning`,h=o===`danger`&&`bg-destructive`,g;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(g=C(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=g):g=t[12];let _;t[13]===g?_=t[14]:(_=(0,K.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,K.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function Ve(e){let t=(0,G.c)(9),{sampledAt:n}=e;if(V(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=P(d(n)),t[1]=n,t[2]=r);let i=r;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[3]=e):e=t[3],e}let a;t[4]===i.value?a=t[5]:(a=(0,K.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),t[4]=i.value,t[5]=a);let o=i.suffix?` ${i.suffix}`:``,s;return t[6]!==a||t[7]!==o?(s=(0,K.jsxs)(`span`,{className:`text-2xs text-muted-foreground/60`,children:[`Updated `,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function He(e){let t=(0,G.c)(19),{icon:n,label:r,value:i,detail:a,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,K.jsx)(`span`,{className:`text-muted-foreground/55 transition-colors group-hover:text-foreground/65`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,K.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[7]!==d||t[8]!==f?(p=C(`mt-2.5 truncate font-mono text-2xl font-semibold tracking-tighter tabular-nums text-foreground`,d,f),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==p||t[11]!==i?(m=(0,K.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let h;t[13]===a?h=t[14]:(h=a?(0,K.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let g;return t[15]!==u||t[16]!==m||t[17]!==h?(g=(0,K.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,h]}),t[15]=u,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function Ue(e){let t=(0,G.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=C(`absolute inset-x-5 top-0 h-0.5 rounded-full opacity-75`,r),t[0]=r,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,K.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,K.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/75`,children:n}),t[4]=n,t[5]=s);let c=i.processCount===1?`process`:`processes`,l;t[6]!==i.processCount||t[7]!==c?(l=(0,K.jsxs)(`div`,{className:`rounded-md bg-muted/55 px-1.5 py-0.5 font-mono text-3xs tabular-nums text-muted-foreground/70`,children:[i.processCount,` `,c]}),t[6]=i.processCount,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==s||t[10]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i.currentCpuPercent?d=t[13]:(d=i.currentCpuPercent.toFixed(1),t[12]=i.currentCpuPercent,t[13]=d);let f=`${d}%`,p;t[14]===f?p=t[15]:(p=(0,K.jsx)(We,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=U(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(We,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let g;t[20]===i.ioReadBytesPerSecond?g=t[21]:(g=Oe(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=g);let _;t[22]===g?_=t[23]:(_=(0,K.jsx)(We,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=Oe(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,K.jsx)(We,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,K.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,K.jsxs)(`div`,{className:`relative overflow-hidden border-t border-border/60 px-4 py-4 first:border-t-0 md:border-t-0 md:border-l md:first:border-l-0 sm:px-5`,children:[o,u,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function We(e){let t=(0,G.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,K.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/45`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,K.jsx)(`div`,{className:`truncate font-mono text-xs font-medium tabular-nums text-foreground/90`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ge(e){let t=(0,G.c)(21),{label:n,health:r}=e,a;t[0]!==r.lastError||t[1]!==r.status?(a=r.status===`unavailable`&&i(r.lastError,Je),t[0]=r.lastError,t[1]=r.status,t[2]=a):a=t[2];let o=a,s;t[3]===n?s=t[4]:(s=(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=s);let c;t[5]!==o||t[6]!==r.lastError?(c=o?`Available when this page runs inside the desktop app.`:T(r.lastError,{onNone:qe,onSome:Ke}),t[5]=o,t[6]=r.lastError,t[7]=c):c=t[7];let l;t[8]===c?l=t[9]:(l=(0,K.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:c}),t[8]=c,t[9]=l);let u;t[10]!==s||t[11]!==l?(u=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[s,l]}),t[10]=s,t[11]=l,t[12]=u):u=t[12];let d;t[13]===o?d=t[14]:(d=o?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=o,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,K.jsx)(Be,{label:``,status:r.status,presentation:d}),t[15]=r.status,t[16]=d,t[17]=f):f=t[17];let p;return t[18]!==u||t[19]!==f?(p=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function Ke(e){return e}function qe(){return`No reported errors`}function Je(e){return e.includes(`'web' mode`)}function Ye(e){let t=(0,G.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/75`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=C(`min-w-0 truncate text-right font-mono text-2xs tabular-nums text-foreground/85`,i),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,K.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border/50 py-2.5 first:border-t-0`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Xe(e){let t=(0,G.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=De.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=De.map(Ze),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,K.jsx)(de,{"aria-label":`Resource history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ze(e){return(0,K.jsx)(fe,{value:String(e.windowMs),children:e.label},e.windowMs)}function Qe(e){let t=(0,G.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=Ee(n),s=Math.max(1,...n.map($e));a=`border-t border-border/60 px-4 py-4 sm:px-5`;let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=l):l=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,l,(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-warning/80`}),` I/O writes`]})]}),t[7]=o):o=t[7],r=`flex h-32 items-end gap-1 overflow-hidden rounded-lg border border-border/40 bg-muted/8 px-2 pt-3 pb-2`,i=n.map(t=>{let n=X({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=X({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=X({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,K.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,K.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,K.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,K.jsx)(L,{side:`top`,className:`text-left`,children:(0,K.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,K.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`div`,{children:[`Read `,U(t.ioReadBytes)]}),(0,K.jsxs)(`div`,{children:[`Write `,U(t.ioWriteBytes)]})]})})]},d(t.startedAt))}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[8]!==r||t[9]!==i?(s=(0,K.jsx)(`div`,{className:r,children:i}),t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==o||t[13]!==s?(c=(0,K.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function $e(e){return e.ioReadBytes+e.ioWriteBytes}function et(e){let t=(0,G.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Pe(n),t[0]=n,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,7)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==r||t[5]!==s||t[6]!==o||t[7]!==i||t[8]!==n?(u=s?(0,K.jsx)(S,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,K.jsx)(O,{className:`size-3.5`,icon:r?k:D})}):(0,K.jsx)(`span`,{className:`size-5`,"aria-hidden":!0}),t[4]=r,t[5]=s,t[6]=o,t[7]=i,t[8]=n,t[9]=u):u=t[9];let d;t[10]===n.category?d=t[11]:(d=C(`size-1.5 rounded-full`,Ie(n.category)),t[10]=n.category,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,K.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=p);let m=n.command||n.name,h;t[16]===m?h=t[17]:(h=(0,K.jsx)(L,{side:`top`,variant:`code`,children:m}),t[16]=m,t[17]=h);let g;t[18]!==p||t[19]!==h?(g=(0,K.jsxs)(R,{children:[p,h]}),t[18]=p,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==g||t[22]!==l||t[23]!==u||t[24]!==f?(_=(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,f,g]}),t[21]=g,t[22]=l,t[23]=u,t[24]=f,t[25]=_):_=t[25],_}function tt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function nt(e){let t=(0,G.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!tt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-3xs text-muted-foreground/35`,children:`—`}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==i?(o=i.has(Me(n)),t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=!r||o,c;t[4]!==a||t[5]!==n?(c=e=>a(n,e),t[4]=a,t[5]=n,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,K.jsx)(q,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function rt(e){let t=(0,G.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,J.useState)(it),c;t[0]!==o||t[1]!==n?(c=we(n,o),t[0]=o,t[1]=n,t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=Me(e);s(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[20%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[7%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[6%]`}),(0,K.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,K.jsx)(`th`,{className:`px-2 py-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=p):p=t[5];let m;t[6]===l.length?m=t[7]:(m=l.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:11,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`Waiting for the native process monitor.`})}):null,t[6]=l.length,t[7]=m);let h;if(t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==i||t[12]!==l){let e;t[14]!==r||t[15]!==o||t[16]!==a||t[17]!==i?(e=e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,K.jsx)(et,{process:e,collapsed:o.has(Me(e)),onToggle:d})}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Fe(e.category)}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:ke(e.cpuTimeMs)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:U(e.residentBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:Oe(e.ioReadBytesPerSecond)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:Oe(e.ioWriteBytesPerSecond)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:U(e.ioReadBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{children:U(e.ioWriteBytes)})}),(0,K.jsx)(L,{side:`top`,children:Le(e.ioSemantics)})]})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,K.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,K.jsx)(nt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Me(e)),t[14]=r,t[15]=o,t[16]=a,t[17]=i,t[18]=e):e=t[18],h=l.map(e),t[8]=r,t[9]=o,t[10]=a,t[11]=i,t[12]=l,t[13]=h}else h=t[13];let g;return t[19]!==m||t[20]!==h?(g=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(z,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[m,h]})]})})}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function it(){return new Set}function at(e){let t=(0,G.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[7%]`}),(0,K.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:9,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No retained process samples in this window.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(ot),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(z,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function ot(e){return(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,K.jsx)(L,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Fe(e.category)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:ke(e.cpuTimeMs)}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:U(e.peakRssBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:U(e.ioReadBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:U(e.ioWriteBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Ne(e))}function st(e){let t=(0,G.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[22%]`}),(0,K.jsx)(`col`,{className:`w-[28%]`}),(0,K.jsx)(`col`,{className:`w-[14%]`}),(0,K.jsx)(`col`,{className:`w-[14%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`Time`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:6,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No instrumented application I/O has been recorded yet.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(ct),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,K.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function ct(e){return(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:U(e.logicalReadBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:U(e.logicalWriteBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:[(e.durationMs/1e3).toFixed(2),`s`]})]},`${e.component}:${e.operation}`)}function lt(e){let t=(0,G.c)(207),{environmentId:n}=e,[i,a]=(0,J.useState)(9e5),c;t[0]===i?c=t[1]:(c=De.find(e=>e.windowMs===i)??De[1],t[0]=i,t[1]=c);let l=c,d=ae(n,y),m=Se(n),g=m.retry,_;t[2]!==l.bucketMs||t[3]!==l.windowMs?(_={windowMs:l.windowMs,bucketMs:l.bucketMs},t[2]=l.bucketMs,t[3]=l.windowMs,t[4]=_):_=t[4];let b=Ce(_,n),C;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(C={reportFailure:!1},t[5]=C):C=t[5];let w=le(N.signalProcess,C),[ee,te]=(0,J.useState)(mt),D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=new Set,t[6]=D):D=t[6];let O=(0,J.useRef)(D),k=(0,J.useRef)(n),j,M;t[7]===n?(j=t[8],M=t[9]):(j=()=>(k.current=n,()=>{k.current=null}),M=[n],t[7]=n,t[8]=j,t[9]=M),(0,J.useEffect)(j,M);let[se,ce]=(0,J.useState)(!1),P=m.data,F=P?.groups.allP4,ue;t[10]===w?ue=t[11]:(ue=async(e,t)=>{let n=k.current;if(n===null||!oe(n,`environment:maintain`))return;let r=Me(e);if(O.current.has(r))return;let i=new Set(O.current).add(r);O.current=i,te(i);let a=()=>{let e=new Set(O.current);e.delete(r),O.current=e,te(e)};if(t===`SIGKILL`){let n;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;a(),A.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){a();return}}if(k.current!==n||!oe(n,`environment:maintain`)){a();return}w({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ne(n))return;throw re(n)}n.value.signaled||A.add({type:`error`,title:`Could not send ${t}`,description:s(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},t[10]=w,t[11]=ue);let de=ue,fe;t[12]===g?fe=t[13]:(fe=()=>{let e=k.current;e!==null&&oe(e,`environment:maintain`)&&(ce(!0),g().catch(pt).finally(()=>{ce(!1)}))},t[12]=g,t[13]=fe);let pe=fe,z,me,he,ge,V,_e,ye,be,xe,H,W,q,Y,we,X,Ee,Ne,Pe,Fe;if(t[14]!==F||t[15]!==P||t[16]!==m.error||t[17]!==m.isPending||t[18]!==m.refresh){V=P?u(P.speedLimitPercent):null;let e=P?.health.native.status??null,n;t[38]!==e||t[39]!==m.error?(n=Te({nativeStatus:e,error:m.error}),t[38]=e,t[39]=m.error,t[40]=n):n=t[40],he=n,ge=P!==null&&(P.power.onBattery!==`unknown`||P.power.lowPowerMode!==`unknown`||P.power.idle!==`unknown`||P.power.locked!==`unknown`||P.power.thermalState!==`unknown`),me=B,Ee=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,K.jsx)(E,{className:`size-4 text-muted-foreground`}),t[41]=Ne):Ne=t[41];let i;t[42]===P?i=t[43]:(i=P?(0,K.jsx)(Be,{label:`Native`,status:P.health.native.status}):null,t[42]=P,t[43]=i);let a=P?.readAt??null,s;t[44]===a?s=t[45]:(s=(0,K.jsx)(Ve,{sampledAt:a}),t[44]=a,t[45]=s);let c;t[46]===m.isPending?c=t[47]:(c=(0,K.jsx)(ve,{size:`xs`,refreshing:m.isPending}),t[46]=m.isPending,t[47]=c);let l;t[48]!==c||t[49]!==m.isPending||t[50]!==m.refresh?(l=(0,K.jsx)(I,{render:(0,K.jsx)(S,{size:`icon-micro`,variant:`ghost`,disabled:m.isPending,onClick:m.refresh,"aria-label":`Refresh resource telemetry`,children:c})}),t[48]=c,t[49]=m.isPending,t[50]=m.refresh,t[51]=l):l=t[51];let d;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(L,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=d):d=t[52];let p;t[53]===l?p=t[54]:(p=(0,K.jsxs)(R,{children:[l,d]}),t[53]=l,t[54]=p),t[55]!==i||t[56]!==s||t[57]!==p?(Pe=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,s,p]}),t[55]=i,t[56]=s,t[57]=p,t[58]=Pe):Pe=t[58],we=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let g;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-xl text-xs leading-relaxed text-muted-foreground`,children:`Live native counters for the server, providers, terminals, desktop processes, and the monitor itself.`})]}),t[59]=g):g=t[59];let _;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=_):_=t[60];let v;t[61]===P?v=t[62]:(v=P?je(P.sampleIntervalMs):`...`,t[61]=P,t[62]=v),t[63]===v?X=t[64]:(X=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border/60 bg-linear-to-r from-muted/45 via-muted/20 to-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[g,(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[_,`Sampling every `,v]})]}),t[63]=v,t[64]=X),be=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let y;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,K.jsx)(o,{className:`size-3.5`}),t[65]=y):y=t[65];let b;t[66]===F?b=t[67]:(b=F?`${F.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=F,t[67]=b);let C;t[68]===F?C=t[69]:(C=F?`${ke(F.cpuTimeMs)} observed CPU time`:void 0,t[68]=F,t[69]=C),t[70]!==b||t[71]!==C?(xe=(0,K.jsx)(He,{icon:y,label:`Current CPU`,value:b,detail:C}),t[70]=b,t[71]=C,t[72]=xe):xe=t[72];let w;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(h,{className:`size-3.5`}),t[73]=w):w=t[73];let ee;t[74]===F?ee=t[75]:(ee=F?U(F.currentRssBytes):`...`,t[74]=F,t[75]=ee);let T;t[76]===F?T=t[77]:(T=F?`${U(F.peakRssBytes)} combined process peaks`:void 0,t[76]=F,t[77]=T),t[78]!==ee||t[79]!==T?(H=(0,K.jsx)(He,{icon:w,label:`Resident memory`,value:ee,detail:T}),t[78]=ee,t[79]=T,t[80]=H):H=t[80];let te;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,K.jsx)(E,{className:`size-3.5`}),t[81]=te):te=t[81];let ne=F?String(F.processCount):`...`,re=F?`${F.processStarts} starts · ${F.processExits} exits`:void 0;t[82]!==ne||t[83]!==re?(W=(0,K.jsx)(He,{icon:te,label:`Process count`,value:ne,detail:re}),t[82]=ne,t[83]=re,t[84]=W):W=t[84];let D;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,K.jsx)(r,{className:`size-3.5`}),t[85]=D):D=t[85];let O;t[86]===F?O=t[87]:(O=F?Oe(F.ioReadBytesPerSecond):`...`,t[86]=F,t[87]=O);let k;t[88]===F?k=t[89]:(k=F?`${U(F.ioReadBytes)} observed`:void 0,t[88]=F,t[89]=k),t[90]!==O||t[91]!==k?(q=(0,K.jsx)(He,{icon:D,label:`Read throughput`,value:O,detail:k}),t[90]=O,t[91]=k,t[92]=q):q=t[92];let A;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(f,{className:`size-3.5`}),t[93]=A):A=t[93];let j;t[94]===F?j=t[95]:(j=F?Oe(F.ioWriteBytesPerSecond):`...`,t[94]=F,t[95]=j);let M;t[96]===F?M=t[97]:(M=F?`${U(F.ioWriteBytes)} observed`:void 0,t[96]=F,t[97]=M);let ie=F&&F.ioWriteBytesPerSecond>=10485760?`danger`:F&&F.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==j||t[99]!==M||t[100]!==ie?(Y=(0,K.jsx)(He,{icon:A,label:`Write throughput`,value:j,detail:M,tone:ie}),t[98]=j,t[99]=M,t[100]=ie,t[101]=Y):Y=t[101],z=He,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,K.jsx)(x,{className:`size-3.5`}),t[102]=Fe):Fe=t[102],_e=`CPU speed limit`,ye=P?V===null?`Unknown`:`${V.toFixed(0)}%`:`...`,t[14]=F,t[15]=P,t[16]=m.error,t[17]=m.isPending,t[18]=m.refresh,t[19]=z,t[20]=me,t[21]=he,t[22]=ge,t[23]=V,t[24]=_e,t[25]=ye,t[26]=be,t[27]=xe,t[28]=H,t[29]=W,t[30]=q,t[31]=Y,t[32]=we,t[33]=X,t[34]=Ee,t[35]=Ne,t[36]=Pe,t[37]=Fe}else z=t[19],me=t[20],he=t[21],ge=t[22],V=t[23],_e=t[24],ye=t[25],be=t[26],xe=t[27],H=t[28],W=t[29],q=t[30],Y=t[31],we=t[32],X=t[33],Ee=t[34],Ne=t[35],Pe=t[36],Fe=t[37];let Ie=P?`${P.power.thermalState} thermal state`:void 0,Le=V!==null&&V<80?`warning`:`default`,ze;t[103]!==z||t[104]!==_e||t[105]!==ye||t[106]!==Ie||t[107]!==Le||t[108]!==Fe?(ze=(0,K.jsx)(z,{icon:Fe,label:_e,value:ye,detail:Ie,tone:Le}),t[103]=z,t[104]=_e,t[105]=ye,t[106]=Ie,t[107]=Le,t[108]=Fe,t[109]=ze):ze=t[109];let We;t[110]!==be||t[111]!==xe||t[112]!==H||t[113]!==W||t[114]!==q||t[115]!==Y||t[116]!==ze?(We=(0,K.jsxs)(`div`,{className:be,children:[xe,H,W,q,Y,ze]}),t[110]=be,t[111]=xe,t[112]=H,t[113]=W,t[114]=q,t[115]=Y,t[116]=ze,t[117]=We):We=t[117];let Ke;t[118]===m.error?Ke=t[119]:(Ke=m.error?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:m.error})]}):null,t[118]=m.error,t[119]=Ke);let qe;t[120]===P?qe=t[121]:(qe=P?(0,K.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,K.jsx)(Ue,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:P.groups.backend}),(0,K.jsx)(Ue,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:P.groups.electron}),(0,K.jsx)(Ue,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:P.groups.monitor})]}):null,t[120]=P,t[121]=qe);let Je;t[122]!==we||t[123]!==X||t[124]!==We||t[125]!==Ke||t[126]!==qe?(Je=(0,K.jsxs)(`div`,{className:we,children:[X,We,Ke,qe]}),t[122]=we,t[123]=X,t[124]=We,t[125]=Ke,t[126]=qe,t[127]=Je):Je=t[127];let Ze;t[128]!==me||t[129]!==Ee||t[130]!==Ne||t[131]!==Pe||t[132]!==Je?(Ze=(0,K.jsx)(me,{title:Ee,icon:Ne,headerAction:Pe,children:Je}),t[128]=me,t[129]=Ee,t[130]=Ne,t[131]=Pe,t[132]=Je,t[133]=Ze):Ze=t[133];let $e;t[134]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,K.jsx)(x,{className:`size-4 text-muted-foreground`}),t[134]=$e):$e=t[134];let et;t[135]!==he||t[136]!==se||t[137]!==pe?(et=he?(0,K.jsxs)(S,{size:`xs`,variant:`outline`,disabled:se,onClick:pe,children:[(0,K.jsx)(ve,{size:`xs`,refreshing:se}),`Retry monitor`]}):null,t[135]=he,t[136]=se,t[137]=pe,t[138]=et):et=t[138];let tt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,K.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,K.jsx)(v,{className:`size-3.5`})}),`Host state`]}),t[139]=tt):tt=t[139];let nt;t[140]!==ge||t[141]!==P?(nt=(0,K.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[tt,ge&&P?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ye,{label:`Power source`,value:Re(P.power.onBattery,{true:`Battery`,false:`External power`})}),(0,K.jsx)(Ye,{label:`Low power mode`,value:Re(P.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,K.jsx)(Ye,{label:`Idle`,value:`${Re(P.power.idle,{true:`Idle`,false:`Active`})}${P.power.idleSeconds===null?``:` · ${Math.round(P.power.idleSeconds)}s`}`}),(0,K.jsx)(Ye,{label:`Session`,value:P.power.suspended?`Suspended`:Re(P.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,K.jsx)(Ye,{label:`Thermal`,value:P.power.thermalState,valueClassName:P.power.thermalState===`serious`||P.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,K.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,K.jsx)(`p`,{className:`mt-1.5 max-w-sm text-2xs leading-relaxed text-muted-foreground/70`,children:`Power, idle, lock, and thermal state are supplied by the desktop host. Process telemetry remains fully active in this browser session.`})]})]}),t[140]=ge,t[141]=P,t[142]=nt):nt=t[142];let it;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,K.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,K.jsx)(x,{className:`size-3.5`})}),`Collection health`]}),t[143]=it):it=t[143];let ot;t[144]===P?ot=t[145]:(ot=(0,K.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[it,P?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ge,{label:`Native process monitor`,health:P.health.native}),(0,K.jsx)(Ge,{label:`Electron main process`,health:P.health.desktop}),(0,K.jsx)(Ye,{label:`Collection time`,value:Ae(P.health.collectionDurationMicros)}),(0,K.jsx)(Ye,{label:`Process scan`,value:`${P.health.retainedProcessCount}/${P.health.scannedProcessCount} retained`}),(0,K.jsx)(Ye,{label:`Inaccessible`,value:String(P.health.inaccessibleProcessCount),valueClassName:P.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,K.jsx)(Ye,{label:`Sidecar`,value:T(P.health.sidecarVersion,{onNone:ft,onSome:e=>`${e}${T(P.health.sidecarPid,{onNone:dt,onSome:ut})}`})}),(0,K.jsx)(Ye,{label:`Restarts`,value:String(P.health.restartCount)})]}):(0,K.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=P,t[145]=ot);let ct;t[146]!==nt||t[147]!==ot?(ct=(0,K.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[nt,ot]}),t[146]=nt,t[147]=ot,t[148]=ct):ct=t[148];let lt;t[149]!==et||t[150]!==ct?(lt=(0,K.jsx)(B,{title:`Host & collection`,icon:$e,headerAction:et,children:ct}),t[149]=et,t[150]=ct,t[151]=lt):lt=t[151];let ht;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,K.jsx)(r,{className:`size-4 text-muted-foreground`}),t[152]=ht):ht=t[152];let gt;t[153]===i?gt=t[154]:(gt=(0,K.jsx)(Xe,{selectedWindowMs:i,onSelect:a}),t[153]=i,t[154]=gt);let _t;t[155]===b.isPending?_t=t[156]:(_t=(0,K.jsx)(ve,{size:`xs`,refreshing:b.isPending}),t[155]=b.isPending,t[156]=_t);let vt;t[157]!==b.isPending||t[158]!==b.refresh||t[159]!==_t?(vt=(0,K.jsx)(S,{size:`icon-micro`,variant:`ghost`,disabled:b.isPending,onClick:b.refresh,"aria-label":`Refresh resource history`,children:_t}),t[157]=b.isPending,t[158]=b.refresh,t[159]=_t,t[160]=vt):vt=t[160];let yt;t[161]!==gt||t[162]!==vt?(yt=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[gt,vt]}),t[161]=gt,t[162]=vt,t[163]=yt):yt=t[163];let bt;t[164]===b.error?bt=t[165]:(bt=b.error?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:b.error})]}):null,t[164]=b.error,t[165]=bt);let Z;t[166]===b.data?.buckets?Z=t[167]:(Z=b.data?.buckets??[],t[166]=b.data?.buckets,t[167]=Z);let Q;t[168]===Z?Q=t[169]:(Q=(0,K.jsx)(Qe,{buckets:Z}),t[168]=Z,t[169]=Q);let xt;t[170]===b.data?.topProcesses?xt=t[171]:(xt=b.data?.topProcesses??[],t[170]=b.data?.topProcesses,t[171]=xt);let St;t[172]===xt?St=t[173]:(St=(0,K.jsx)(at,{processes:xt}),t[172]=xt,t[173]=St);let Ct;t[174]!==bt||t[175]!==Q||t[176]!==St?(Ct=(0,K.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[bt,Q,St]}),t[174]=bt,t[175]=Q,t[176]=St,t[177]=Ct):Ct=t[177];let wt;t[178]!==yt||t[179]!==Ct?(wt=(0,K.jsx)(B,{title:`Resource timeline`,icon:ht,headerAction:yt,children:Ct}),t[178]=yt,t[179]=Ct,t[180]=wt):wt=t[180];let Tt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,K.jsx)(o,{className:`size-4 text-muted-foreground`}),t[181]=Tt):Tt=t[181];let $;t[182]===P?$=t[183]:($=P?(0,K.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,K.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=P,t[183]=$);let Et;t[184]===P?.processes?Et=t[185]:(Et=P?.processes??[],t[184]=P?.processes,t[185]=Et);let Dt;t[186]!==d||t[187]!==de||t[188]!==ee||t[189]!==Et?(Dt=(0,K.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,K.jsx)(rt,{processes:Et,canMaintainEnvironment:d,signalingKeys:ee,onSignal:de})}),t[186]=d,t[187]=de,t[188]=ee,t[189]=Et,t[190]=Dt):Dt=t[190];let Ot;t[191]!==$||t[192]!==Dt?(Ot=(0,K.jsx)(B,{title:`Live process tree`,icon:Tt,headerAction:$,children:Dt}),t[191]=$,t[192]=Dt,t[193]=Ot):Ot=t[193];let kt,At;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,K.jsx)(f,{className:`size-4 text-muted-foreground`}),At=(0,K.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),t[194]=kt,t[195]=At):(kt=t[194],At=t[195]);let jt;t[196]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,K.jsx)(`div`,{className:`bg-muted/15 px-4 py-3 text-2xs leading-relaxed text-muted-foreground sm:px-5`,children:`Native counters identify which process is reading or writing. These application-level counters identify known P4 Code operations so process spikes can be correlated with specific persistence and logging paths.`}),t[196]=jt):jt=t[196];let Mt;t[197]===P?.attribution.entries?Mt=t[198]:(Mt=P?.attribution.entries??[],t[197]=P?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,K.jsx)(B,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,K.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,K.jsx)(st,{entries:Mt})]})}),t[199]=Mt,t[200]=Nt);let Pt;return t[201]!==Ze||t[202]!==lt||t[203]!==wt||t[204]!==Ot||t[205]!==Nt?(Pt=(0,K.jsxs)(K.Fragment,{children:[Ze,lt,wt,Ot,Nt]}),t[201]=Ze,t[202]=lt,t[203]=wt,t[204]=Ot,t[205]=Nt,t[206]=Pt):Pt=t[206],Pt}function ut(e){return` · PID ${e}`}function dt(){return``}function ft(){return`Unavailable`}function pt(e){A.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}function mt(){return new Set}var ht=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],gt=e=>/^https?:\/\/./i.test(e);function _t(e,t){if(e===``)return{label:`Off`,dot:`bg-muted-foreground/40`};if(t?.url!==e)return{label:`Not checked`,dot:`bg-muted-foreground/40`};let{result:n}=t;if(n===null)return{label:`Checking…`,dot:`bg-warning`};switch(n._tag){case`Accepted`:return{label:`Connected · ${Math.round(n.latencyMs)} ms`,dot:`bg-success`};case`Rejected`:return{label:`Rejected · HTTP ${n.status}`,dot:`bg-destructive`};case`Unreachable`:return{label:n.timedOut?`Timed out`:`Unreachable`,dot:`bg-destructive`}}}function vt(){let e=(0,G.c)(3),{environment:t,scope:n}=me();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsx)(B,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,K.jsx)(W,{target:`environment`,children:`Choose one environment to configure its telemetry exports.`})}),e[0]=t):t=e[0],t}let r;return e[1]===t.environmentId?r=e[2]:(r=(0,K.jsx)(yt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function yt(){let{environment:e}=me(),t=he(e=>e.observability),[n,r]=(0,J.useState)({}),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),c=e?.environmentId,l=m(N.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,f]=(0,J.useState)(()=>Object.fromEntries(ht.filter(({key:e})=>gt(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),p=le(N.updateSettings,{reportFailure:!0}),h=le(N.checkOtlpEndpoint),g={...t,...n},_=ht.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await h({environmentId:c,input:{signal:t,url:n}});f(t=>{if(t[e]?.url!==n||t[e].result!==null)return t;let i={...t};return r._tag===`Success`?i[e]={url:n,result:r.value}:delete i[e],i})},x=(e,t,n)=>{gt(n)&&(f(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},C=(0,J.useEffectEvent)(()=>{for(let{key:e,signal:t}of ht){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,J.useEffect)(()=>{u&&C()},[u]),(0,K.jsx)(B,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,K.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await p({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Send traces, metrics, and logs to an OTLP HTTP receiver. Restart the server to apply. Environment variables override these settings.`}),!l&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),ht.map(({key:e,label:n,signal:a})=>{let o=g[e].trim(),c=u?_t(o,d[e]):null;return(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,K.jsx)(_e,{dotClassName:c.dot}),(0,K.jsxs)(be,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(pe,{id:e,size:`sm`,type:`url`,pattern:`[Hh][Tt][Tt][Pp][Ss]?://.*`,title:`Enter an HTTP or HTTPS endpoint, or leave empty to disable export.`,placeholder:`http://localhost:4318/v1/${a}`,value:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,K.jsx)(S,{type:`button`,size:`sm`,variant:`outline`,disabled:!gt(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,K.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,K.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,K.jsx)(S,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of ht)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,K.jsx)(S,{type:`submit`,size:`xs`,disabled:!v||i||!l,children:i?`Saving…`:`Save`})]})]})]})})}var bt=new Intl.NumberFormat;function Z(e){return bt.format(e)}function Q(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2)} s`}function xt(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function St(e){return e?F(d(e)):`No trace records`}function Ct(e){return St(e).replaceAll(` `,`\xA0`)}function wt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function Tt(e){return e?.includes(`not a live descendant`)??!1}function $(e){let t=(0,G.c)(17),{label:n,value:r,tooltip:i,tone:a}=e,o=a===void 0?`default`:a,s;t[0]===n?s=t[1]:(s=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=s);let l;t[2]!==n||t[3]!==i?(l=i?(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(`button`,{type:`button`,className:`cursor-pointer inline-flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground/60 hover:text-foreground`,"aria-label":`${n} details`,children:(0,K.jsx)(c,{className:`size-3`})})}),(0,K.jsx)(L,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=l):l=t[4];let u;t[5]!==s||t[6]!==l?(u=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[s,l]}),t[5]=s,t[6]=l,t[7]=u):u=t[7];let d=o===`warning`&&`text-warning-foreground`,f=o===`danger`&&`text-destructive`,p;t[8]!==d||t[9]!==f?(p=C(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,d,f),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]!==p||t[12]!==r?(m=(0,K.jsx)(`div`,{className:p,children:r}),t[11]=p,t[12]=r,t[13]=m):m=t[13];let h;return t[14]!==u||t[15]!==m?(h=(0,K.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[u,m]}),t[14]=u,t[15]=m,t[16]=h):h=t[16],h}function Et(e){let t=(0,G.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px bg-border/60 sm:hidden`,"aria-hidden":!0}),a=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),o=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-3/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,K.jsxs)(`div`,{className:`relative grid grid-cols-2 sm:grid-cols-4`,children:[r,i,a,o,n]}),t[4]=n,t[5]=s),s}function Dt(e){let t=(0,G.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(`div`,{className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:n}),t[0]=n,t[1]=r),r}function Ot(e){let t=(0,G.c)(21),{headers:n,children:r,minTableWidth:i,columnWidths:a}=e,o=i===void 0?`min-w-[640px]`:i,s=a&&`table-fixed`,c;t[0]!==o||t[1]!==s?(c=C(`w-full text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==n?(l=a?(0,K.jsx)(`colgroup`,{children:n.map((e,t)=>(0,K.jsx)(`col`,{className:a[t]},e))}):null,t[3]=a,t[4]=n,t[5]=l):l=t[5];let u;if(t[6]!==a||t[7]!==n){let e;t[9]!==a||t[10]!==n.length?(e=(e,t)=>(0,K.jsx)(`th`,{className:C(`whitespace-nowrap px-4 py-2.5 font-semibold first:sm:pl-5 last:sm:pr-5`,!a&&t===n.length-1&&`w-px`),children:e.replaceAll(` `,`\xA0`)},e),t[9]=a,t[10]=n.length,t[11]=e):e=t[11],u=n.map(e),t[6]=a,t[7]=n,t[8]=u}else u=t[8];let d;t[12]===u?d=t[13]:(d=(0,K.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,K.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let p;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=(0,K.jsx)(z,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function kt(e){let t=(0,G.c)(25),{traceId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`trace ID`,timeout:1200},t[0]=r):r=t[0];let{copyToClipboard:i,isCopied:a}=j(r),o;t[1]===n?o=t[2]:(o=wt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:o})}),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,K.jsx)(L,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,K.jsxs)(R,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=a?`Copied trace ID`:`Copy trace ID`,d;t[10]!==i||t[11]!==n?(d=()=>i(n),t[10]=i,t[11]=n,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(te,{className:`size-3`}),t[13]=f):f=t[13];let p;t[14]!==u||t[15]!==d?(p=(0,K.jsx)(I,{render:(0,K.jsx)(S,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":u,onClick:d,children:f})}),t[14]=u,t[15]=d,t[16]=p):p=t[16];let m=a?`Copied`:`Copy full trace ID`,h;t[17]===m?h=t[18]:(h=(0,K.jsx)(L,{side:`top`,children:m}),t[17]=m,t[18]=h);let g;t[19]!==h||t[20]!==p?(g=(0,K.jsxs)(R,{children:[p,h]}),t[19]=h,t[20]=p,t[21]=g):g=t[21];let _;return t[22]!==g||t[23]!==l?(_=(0,K.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,g]}),t[22]=g,t[23]=l,t[24]=_):_=t[24],_}function At(e){let t=e.trim().split(/\s+/)[0];if(!t)return e;let n=t.replace(/^['"]|['"]$/g,``);return n.split(/[\\/]/).filter(Boolean).at(-1)??n}function jt(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Mt(e){let t=(0,G.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=At(n.command),t[0]=n.command,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,6)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==i||t[8]!==n.pid?(u=s?(0,K.jsx)(S,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,K.jsx)(O,{className:`size-3.5`,icon:r?D:k})}):(0,K.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=s,t[5]=r,t[6]=o,t[7]=i,t[8]=n.pid,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=f);let p;t[13]===n.command?p=t[14]:(p=(0,K.jsx)(L,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let m;t[15]!==f||t[16]!==p?(m=(0,K.jsxs)(R,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=m):m=t[17];let h;return t[18]!==l||t[19]!==u||t[20]!==m?(h=(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,d,m]}),t[18]=l,t[19]=u,t[20]=m,t[21]=h):h=t[21],h}function Nt(e){let t=(0,G.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,J.useState)(Pt),l;if(t[0]!==s||t[1]!==n){l=[];let e=null;for(let t of n){if(e!==null){if(t.depth>e)continue;e=null}l.push(t),s.has(t.pid)&&(e=t.depth)}t[0]=s,t[1]=n,t[2]=l}else l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=d):d=t[3];let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[33%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,K.jsx)(`th`,{className:`p-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=m):m=t[5];let h;t[6]!==o||t[7]!==u.length?(h=u.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:7,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:o??`No live descendant processes found.`})}):null,t[6]=o,t[7]=u.length,t[8]=h):h=t[8];let g;t[9]!==r||t[10]!==s||t[11]!==a||t[12]!==i||t[13]!==u?(g=u.map(e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,K.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:xt(e.rssBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,K.jsx)(L,{side:`top`,variant:`code`,children:e.command})]})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,K.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,K.jsx)(q,{disabled:!r||i===e.pid,onSignal:t=>a(e.pid,t)})})]},e.pid)),t[9]=r,t[10]=s,t[11]=a,t[12]=i,t[13]=u,t[14]=g):g=t[14];let _;return t[15]!==h||t[16]!==g?(_=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(z,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function Pt(){return new Set}var Ft=[{label:`5m`,windowMs:3e5,bucketMs:3e4},{label:`15m`,windowMs:9e5,bucketMs:6e4},{label:`30m`,windowMs:18e5,bucketMs:12e4},{label:`1h`,windowMs:36e5,bucketMs:3e5}];function It(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Lt(e){let t=At(e);return t.length>42?`${t.slice(0,39)}...`:t}function Rt(e){let t=(0,G.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Lt(n.command),t[0]=n.command,t[1]=i);let a=i,o=`${Math.min(r,6)*10}px`,s;t[2]===o?s=t[3]:(s={paddingLeft:o},t[2]=o,t[3]=s);let c=`${n.isServerRoot?`Root`:`Child`} process ${a}`,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=l):l=t[4];let u=n.isServerRoot?`bg-warning/90`:`bg-success/80`,d;t[5]===u?d=t[6]:(d=C(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,K.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=p);let m;t[11]===n.command?m=t[12]:(m=(0,K.jsx)(L,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,K.jsxs)(R,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(g=(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:s,"aria-label":c,children:[l,f,h]}),t[16]=h,t[17]=s,t[18]=c,t[19]=f,t[20]=g):g=t[20],g}function zt(e){let t=(0,G.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Bt)),t[0]=n,t[1]=r);let i=r,a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=Math.max(2,e.maxCpuPercent/i*100),n=Math.max(2,e.avgCpuPercent/i*100);return(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,K.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,K.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,K.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,K.jsxs)(L,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},d(e.startedAt))},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,K.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,K.jsx)(`div`,{className:`flex h-28 items-end gap-1 overflow-hidden rounded-sm bg-muted/10 p-2`,children:a})}),t[7]=a,t[8]=o),o}function Bt(e){return e.maxCpuPercent}function Vt(e){let t=(0,G.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Ft.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Ft.map(Ht),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,K.jsx)(de,{"aria-label":`Process history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ht(e){return(0,K.jsx)(fe,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,G.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[16%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=o):o=t[1];let s;t[2]!==r||t[3]!==n.length?(s=n.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:8,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:r})}):null,t[2]=r,t[3]=n.length,t[4]=s):s=t[4];let c;if(t[5]!==n||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,K.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:xt(e.maxRssBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,K.jsx)(L,{side:`top`,variant:`code`,children:e.command})]})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.pid})]},e.processKey),t[8]=i,t[9]=e),c=n.map(e),t[5]=n,t[6]=i,t[7]=c}else c=t[7];let l;return t[10]!==s||t[11]!==c?(l=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(z,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[s,c]})]})})}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Wt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Gt(e){let t=(0,G.c)(7),{checkedAt:n}=e;V();let r;t[0]===n?r=t[1]:(r=ue(n?d(n):null),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checking`}),t[2]=e):e=t[2],e}if(i.status===`invalid`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checked unavailable`}),t[3]=e):e=t[3],e}let a;return t[4]!==i.suffix||t[5]!==i.value?(a=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,K.jsxs)(K.Fragment,{children:[`Checked `,(0,K.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,K.jsxs)(K.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Kt(e){let t=(0,G.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.jsx)(ve,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,K.jsx)(I,{render:(0,K.jsx)(S,{size:`icon-xs`,variant:`ghost-muted`,disabled:n,onClick:i,"aria-label":r,children:a})}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===r?s=t[8]:(s=(0,K.jsx)(L,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,K.jsxs)(R,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=me(),t=e?.environmentId??null,n=ae(t,y),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,o=ae(t,g),c=ce(t===null?null:se.sessionStateAtom(t)),l=xe({connectionPhase:e?.connection.phase??`available`,session:c.data,hasSessionError:c.error!==null}),f=l.canReadDiagnostics,m=le(N.signalProcess,{reportFailure:!1}),h=ye(t,i??[]),[_,v]=(0,J.useState)(9e5),b=Ft.find(e=>e.windowMs===_)??Ft[1],{data:x,error:w,isPending:T,refresh:te}=ce(t===null||!f?null:N.traceDiagnostics({environmentId:t,input:{}})),{data:E,error:D,isPending:O,refresh:k}=ce(t===null||!f?null:N.processDiagnostics({environmentId:t,input:{}})),{data:j,error:M,isPending:P,refresh:F}=ce(t===null||!f?null:N.processResourceHistory({environmentId:t,input:{windowMs:b.windowMs,bucketMs:b.bucketMs}})),[ue,de]=(0,J.useState)(!1),[fe,pe]=(0,J.useState)(null),[he,V]=(0,J.useState)(null),_e=(0,J.useRef)(null),ve=(0,J.useRef)(t),be=(0,J.useRef)(E);(0,J.useEffect)(()=>{be.current=E},[E]),(0,J.useEffect)(()=>(ve.current=t,()=>{ve.current=null}),[t]);let U=(0,J.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&oe(t,`orchestration:operate`)&&(de(!0),pe(null),(async()=>{let t=await h(e);if(de(!1),t._tag===`Failure`&&!ne(t)){let e=re(t);pe(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,h]),W=T&&x===null,G=O&&E===null,q=P&&j===null,[Se,Ce]=(0,J.useState)(null);Se!==t&&f&&!W&&!G&&!q&&Ce(t);let Y=(0,J.useCallback)(async(e,t)=>{let n=ve.current,r=be.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!oe(n,`environment:maintain`)||_e.current!==null)return;_e.current=e,V(e);let i=()=>{_e.current=null,V(null)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),A.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){i();return}}let o=ve.current;if(o===null||o!==n||!oe(o,`environment:maintain`)){i();return}if(be.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await m({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ne(i)){let e=re(i);A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!i.value.signaled){let e=a(i.value.message);if(k(),Tt(e)){A.add({type:`info`,title:`Process already exited`,description:`The process is not a child of the P4 Code server. It might already have exited.`});return}A.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}k()}finally{i()}},[k,m]),we=E?u(E.error):null,Te=j?u(j.error):null,X=x?u(x.error):null,Ee=x?s(x.partialFailure,()=>!1):!1;return f?(0,K.jsxs)(ge,{width:`expanded`,className:`gap-10`,children:[(0,K.jsx)(lt,{environmentId:t}),(0,K.jsxs)(B,{title:`Live Processes`,headerAction:(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Gt,{checkedAt:E?.readAt??null}),(0,K.jsx)(Kt,{isPending:O,label:`Refresh process diagnostics`,onClick:k})]}),children:[(0,K.jsxs)(Et,{children:[(0,K.jsx)($,{label:`Child Processes`,value:E?Z(E.processCount):`...`}),(0,K.jsx)($,{label:`CPU`,value:E?`${E.totalCpuPercent.toFixed(1)}%`:`...`,tooltip:`Total CPU across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,K.jsx)($,{label:`Memory`,value:E?xt(E.totalRssBytes):`...`,tooltip:`Total resident memory across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,K.jsx)($,{label:`Server PID`,value:E?String(E.serverPid):`...`})]}),we||D?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[we?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:we.message})]}):null,D?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:D})]}):null]}):null,(0,K.jsx)(Nt,{processes:E?.processes??[],canMaintainEnvironment:n,signalingPid:he,onSignal:Y,emptyLabel:G?`Loading live processes...`:`No live descendant processes found.`})]}),(0,K.jsxs)(B,{title:`Resource History`,headerAction:(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Vt,{selectedWindowMs:_,onSelect:v}),(0,K.jsx)(Gt,{checkedAt:j?.readAt??null}),(0,K.jsx)(Kt,{isPending:P,label:`Refresh resource history`,onClick:F})]}),children:[(0,K.jsxs)(Et,{children:[(0,K.jsx)($,{label:`CPU Time`,value:j?It(j.totalCpuSecondsApprox):`...`,tooltip:`Approximate active CPU time for the P4 Code server root process and its descendants during the selected window. It grows only while sampled processes use CPU and older samples leave as the window moves.`}),(0,K.jsx)($,{label:`Samples`,value:j?Z(j.retainedSampleCount):`...`,tooltip:`In-memory process samples retained by the server. The server samples only while diagnostics is open, and this resets when the server restarts.`}),(0,K.jsx)($,{label:`Interval`,value:j?j.sampleIntervalMs===0?`On demand`:Q(j.sampleIntervalMs):`...`}),(0,K.jsx)($,{label:`Processes`,value:j?Z(j.topProcesses.length):`...`})]}),Te||M?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Te?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:Te.message})]}):null,M?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:M})]}):null]}):null,(0,K.jsx)(zt,{buckets:j?.buckets??[]}),(0,K.jsx)(Ut,{processes:j?.topProcesses??[],emptyLabel:q?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,K.jsxs)(B,{title:`Trace Diagnostics`,headerAction:(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Gt,{checkedAt:x?.readAt??null}),(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{render:(0,K.jsx)(S,{size:`icon-xs`,variant:`ghost-muted`,disabled:!o||!r?.logsDirectoryPath||ue,onClick:U,"aria-label":`Open logs folder`,children:(0,K.jsx)(ee,{})})}),(0,K.jsx)(L,{side:`top`,children:`Open logs folder`})]}),(0,K.jsx)(Kt,{isPending:T,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,K.jsxs)(Et,{children:[(0,K.jsx)($,{label:`Spans`,value:x?Z(x.recordCount):`...`}),(0,K.jsx)($,{label:`Failures`,value:x?Z(x.failureCount):`...`,tone:x&&x.failureCount>0?`danger`:`default`}),(0,K.jsx)($,{label:`Slow Spans`,value:x?Z(x.slowSpanCount):`...`,tooltip:x?`Spans with a duration of ${Q(x.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:x&&x.slowSpanCount>0?`warning`:`default`}),(0,K.jsx)($,{label:`Parse Errors`,value:x?Z(x.parseErrorCount):`...`,tone:x&&x.parseErrorCount>0?`warning`:`default`})]}),fe||X||w?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[fe?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:fe})]}):null,X?(0,K.jsxs)(`div`,{className:C(`flex items-start gap-2`,Ee?`text-warning-foreground`:`text-destructive`),children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:Ee?`Some trace files could not be read, so diagnostics may be incomplete. ${X.message}`:X.message})]}):null,w?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(p,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:w})]}):null]}):null]}),(0,K.jsx)(B,{title:`Latest Failures`,children:x&&x.latestFailures.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:x.latestFailures.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,K.jsx)(H,{text:e.cause})}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:Ct(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,K.jsx)(Dt,{label:W?`Loading failures...`:`No failed spans found.`})}),(0,K.jsx)(B,{title:`Most Common Failures`,children:x&&x.commonFailures.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:x.commonFailures.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,K.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,K.jsx)(H,{text:e.cause})}),(0,K.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:Ct(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,K.jsx)(Dt,{label:W?`Loading failure groups...`:`No repeated failures found.`})}),(0,K.jsx)(B,{title:`Slowest Spans`,children:x&&x.slowestSpans.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:x.slowestSpans.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,K.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:Ct(e.endedAt)}),(0,K.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,K.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,K.jsx)(Dt,{label:W?`Loading slow spans...`:`No spans found.`})}),(0,K.jsx)(B,{title:`Span Logs`,children:x&&x.latestWarningAndErrorLogs.length>0?(0,K.jsx)(z,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[26%]`}),(0,K.jsx)(`col`,{className:`w-[30%]`})]}),(0,K.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,K.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:x.latestWarningAndErrorLogs.map(e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:Ct(e.seenAt)}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,K.jsx)(`span`,{className:`inline-flex rounded bg-muted px-1.5 py-0.5 font-mono text-2xs font-medium uppercase text-foreground/80`,children:e.level})}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,K.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,K.jsx)(H,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,K.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,K.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${d(e.seenAt)}:${e.message}`))})]})}):(0,K.jsx)(Dt,{label:W?`Loading recent logs...`:`No warnings or errors found.`})}),(0,K.jsx)(B,{title:`Top Span Names`,children:x&&x.topSpansByCount.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:x.topSpansByCount.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.failureCount)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.averageDurationMs)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Q(e.maxDurationMs)})]},e.name))}):(0,K.jsx)(Dt,{label:W?`Loading span names...`:`No spans found.`})}),Se===t&&(0,K.jsx)(vt,{})]}):(0,K.jsx)(ge,{children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:l.isPending?`Checking diagnostics access…`:l.error})})}var Jt=qt;export{Jt as component};
2
- //# sourceMappingURL=settings.diagnostics-CaXx9YEU.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{NE as t,lE as n}from"./utils-BctiQ4Ue.js";import{n as r}from"./SettingsPanels-6SOZMWhg.js";var i=t(),a=e(n());function o(){let e=(0,i.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(r,{}),e[0]=t):t=e[0],t}export{o as component};
2
- //# sourceMappingURL=settings.general-BOpvFj1F.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$y as n,C_ as r,Df as i,Dw as a,Gn as o,Jn as s,LT as c,NE as l,N_ as u,Pp as d,Qc as f,Qm as p,Um as m,Wn as h,Wu as g,Yn as _,Zc as v,Zn as y,bg as b,cg as x,cp as S,cr as C,dp as w,fg as T,gg as E,hd as D,l as O,lE as k,mg as A,oh as j,or as M,qn as N,qu as P,sg as F,sh as I,sp as L,sr as R,t as z,tr as ee,vg as te,yg as ne}from"./utils-BctiQ4Ue.js";import{W as re}from"./runtime-DATbE5vH.js";import{w as ie}from"./entities-Bj5ceyfn.js";import{a as ae,r as B,t as V}from"./number-field-BHWzsgFF.js";import{a as H,c as oe,i as se,o as ce,r as le,s as ue,t as U}from"./select-Dhapqr3j.js";import{t as de}from"./spinner-AJeHmaWN.js";import{i as W}from"./toast-gFAddE-Q.js";import{D as fe,E as pe,J as me,c as he,o as ge,r as G,s as K,x as q}from"./useSettings-B_WzhJqU.js";import{f as _e}from"./server-rxH1493J.js";import{i as J,n as ve}from"./session-Bgs0dTwK.js";import{t as ye}from"./use-atom-command-BJxdfyHC.js";import{t as be}from"./env-wK1YYxA8.js";import{a as xe,n as Se,t as Ce}from"./tooltip-ngKqo-lA.js";import{t as we}from"./input-Df_UyHLk.js";import{a as Te,c as Ee,i as De,n as Oe,o as ke,r as Ae,s as je,t as Me}from"./dialog-YpQOq7Ug.js";import{i as Ne,t as Pe}from"./device-DX-G6J1j.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,s as Be,t as Ve}from"./DeviceSetup-Br_kHy6n.js";import{t as He}from"./AnimatedHeight-DcrvwWWb.js";import{i as Ue,n as We}from"./Icons-DzTpHpn1.js";import{t as Ge}from"./preview-DWVmLubs.js";import{a as Ke,i as qe,o as Je,t as Ye}from"./popover-2GkuSL2i.js";import{B as Xe,C as Ze,L as Qe,P as $e,a as Y,c as et,i as tt,r as nt,s as rt}from"./settingsLayout-BQsOdImg.js";import{Ci as it,Sr as at,Wn as X,_r as ot,br as st,gr as ct,ji as lt,na as ut,vr as dt,wi as ft,xr as pt,yr as mt}from"./main-D8FWUaO_.js";import{t as ht}from"./ProjectDefaultsSettings-DUCUj4oc.js";import{t as gt}from"./draft-input-DW6EgVbF.js";import{t as _t}from"./ScopedSwitch-D3fAHI1-.js";import{n as vt,r as yt,t as bt}from"./usePermissionStatus-CUViQRYY.js";var Z=l(),Q=e(k(),1);function xt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(St).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(C,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(Je,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(Ke,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(qe,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let w;return t[24]!==S||t[25]!==m?(w=(0,Q.jsxs)(Ye,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=w):w=t[26],w}function St(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function Ct(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function wt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Tt(e){return(0,Q.jsxs)(Ce,{children:[(0,Q.jsxs)(xe,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(D,{className:`size-3`}):(0,Q.jsx)(L,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(Se,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var Et=n(u);function Dt(e){let{identityFile:t,...n}=e;return Et({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Ot(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function kt(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function At(e){let t=ye(Pe.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let o=Ot(n);if(i.current.has(o))return;i.current.add(o),r(e=>({...e,[o]:{}}));let s={};try{return await kt(e,n,async(e,n)=>{if(!ve(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(a(r.cause));return r.value},(e,t)=>{s[e]=t,r(n=>({...n,[o]:{...n[o],[e]:t}}))}),s}finally{i.current.delete(o)}}}}function jt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[l,u]=(0,$.useState)(n),{checks:d,testConnection:f}=At(i),p=d[Ot(l)],h=Object.values(p??{}).some(Nt),g,_;t[0]===l?(g=t[1],_=t[2]):(g=Dt({...l,label:l.label.trim()||l.target}),_=c(g),t[0]=l,t[1]=g,t[2]=_);let v=_,y;t[3]===p?y=t[4]:(y=Object.values(p??{}).filter(Mt),t[3]=p,t[4]=y);let b=y.length,x;t[5]!==a||t[6]!==s?(x=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=x):x=t[7];let C=!a,w;t[8]!==a||t[9]!==h||t[10]!==l.label||t[11]!==g||t[12]!==o?(w=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),c(g)&&l.label.trim()&&!a&&!h&&o(g.value)}}),t[8]=a,t[9]=h,t[10]=l.label,t[11]=g,t[12]=o,t[13]=w):w=t[13];let T=r?`Add device host`:`Edit device host`,E;t[14]===T?E=t[15]:(E=(0,Q.jsx)(Ee,{children:T}),t[14]=T,t[15]=E);let O=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,k;t[16]===O?k=t[17]:(k=(0,Q.jsxs)(Ae,{children:[O,` `,`Hosts on the same machine are skipped.`]}),t[16]=O,t[17]=k);let A;t[18]!==E||t[19]!==k?(A=(0,Q.jsxs)(Te,{children:[E,k]}),t[18]=E,t[19]=k,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=j):j=t[21];let M;t[22]===l?M=t[23]:(M=e=>u({...l,label:e.target.value}),t[22]=l,t[23]=M);let N;t[24]!==a||t[25]!==l.label||t[26]!==M?(N=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[j,(0,Q.jsx)(we,{autoFocus:!0,required:!0,value:l.label,disabled:a,onChange:M,placeholder:`Mac mini`})]}),t[24]=a,t[25]=l.label,t[26]=M,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=P):P=t[28];let F;t[29]===l?F=t[30]:(F=e=>u({...l,target:e.target.value}),t[29]=l,t[30]=F);let I;t[31]!==a||t[32]!==l.target||t[33]!==F?(I=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[P,(0,Q.jsx)(we,{required:!0,value:l.target,disabled:a,onChange:F,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=l.target,t[33]=F,t[34]=I):I=t[34];let L=n.port!==void 0||n.identityFile!==void 0||void 0,z;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=z):z=t[35];let ee;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=ee):ee=t[36];let te=l.identityFile??``,ne;t[37]===l?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=l;u(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=l,t[38]=ne);let re;t[39]!==a||t[40]!==te||t[41]!==ne?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ee,(0,Q.jsx)(we,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=l.port??``,B;t[44]===l?B=t[45]:(B=e=>{let{port:t,...n}=l;u(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=l,t[45]=B);let V;t[46]!==a||t[47]!==ae||t[48]!==B?(V=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(we,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=V):V=t[49];let H;t[50]!==re||t[51]!==V?(H=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[re,V]}),t[50]=re,t[51]=V,t[52]=H):H=t[52];let oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=oe):oe=t[53];let se;t[54]!==L||t[55]!==H?(se=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[z,H,oe]}),t[54]=L,t[55]=H,t[56]=se):se=t[56];let ce=h?`Checking environments…`:p?b?`${b} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,le;t[57]===ce?le=t[58]:(le=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce}),t[57]=ce,t[58]=le);let ue=a||h||!v,U;t[59]!==g||t[60]!==f?(U=()=>{c(g)&&f(g.value)},t[59]=g,t[60]=f,t[61]=U):U=t[61];let W;t[62]===h?W=t[63]:(W=h?(0,Q.jsx)(de,{size:`xs`}):null,t[62]=h,t[63]=W);let fe;t[64]!==ue||t[65]!==U||t[66]!==W?(fe=(0,Q.jsxs)(R,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:U,children:[W,` Test connection`]}),t[64]=ue,t[65]=U,t[66]=W,t[67]=fe):fe=t[67];let pe;t[68]!==le||t[69]!==fe?(pe=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[le,fe]}),t[68]=le,t[69]=fe,t[70]=pe):pe=t[70];let me;t[71]!==p||t[72]!==i?(me=p?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=p[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(de,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(m,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(wt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=p,t[72]=i,t[73]=me):me=t[73];let he;t[74]!==pe||t[75]!==me?(he=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[pe,me]}),t[74]=pe,t[75]=me,t[76]=he):he=t[76];let ge;t[77]!==N||t[78]!==I||t[79]!==se||t[80]!==he?(ge=(0,Q.jsxs)(ke,{children:[N,I,se,he]}),t[77]=N,t[78]=I,t[79]=se,t[80]=he,t[81]=ge):ge=t[81];let G;t[82]!==a||t[83]!==s?(G=(0,Q.jsx)(R,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=G):G=t[84];let K;t[85]!==a||t[86]!==h||t[87]!==l.label||t[88]!==v?(K=a||h||!v||!l.label.trim(),t[85]=a,t[86]=h,t[87]=l.label,t[88]=v,t[89]=K):K=t[89];let q;t[90]===a?q=t[91]:(q=a?(0,Q.jsx)(de,{size:`xs`}):null,t[90]=a,t[91]=q);let _e;t[92]!==K||t[93]!==q?(_e=(0,Q.jsxs)(R,{type:`submit`,disabled:K,children:[q,` Save host`]}),t[92]=K,t[93]=q,t[94]=_e):_e=t[94];let J;t[95]!==G||t[96]!==_e?(J=(0,Q.jsxs)(De,{children:[G,_e]}),t[95]=G,t[96]=_e,t[97]=J):J=t[97];let ve;t[98]!==A||t[99]!==ge||t[100]!==C||t[101]!==J||t[102]!==w?(ve=(0,Q.jsxs)(je,{showCloseButton:C,render:w,children:[A,ge,J]}),t[98]=A,t[99]=ge,t[100]=C,t[101]=J,t[102]=w,t[103]=ve):ve=t[103];let ye;return t[104]!==x||t[105]!==ve?(ye=(0,Q.jsx)(Me,{open:!0,onOpenChange:x,children:ve}),t[104]=x,t[105]=ve,t[106]=ye):ye=t[106],ye}function Mt(e){return e.status===`failed`}function Nt(e){return e.status===`pending`}function Pt(e){let{scope:t,environments:n,connectedEnvironments:i}=Xe(),a=J(e.environmentId,r),o=t.kind===`project`||t.kind===`checkout`,s=ye(_e.updateSettings,{reportFailure:!1}),[c,l]=(0,$.useState)(null),[u,f]=(0,$.useState)(null),[p,m]=(0,$.useState)(!1),h=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:g,testConnection:_}=At(h),v=async(t,r=!1,i=t)=>{if(e.environmentId&&!o){m(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ve(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return s({environmentId:e.environmentId,input:{patch:{deviceHosts:Ct(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?l(null):W.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{m(!1)}}};return(0,Q.jsx)(Y,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(R,{size:`sm`,variant:`outline`,disabled:!a||o||p||!e.environmentId||c!==null,onClick:()=>{f(null),l({id:O(),label:``,target:``})},children:[(0,Q.jsx)(d,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[i.map(e=>(0,Q.jsxs)(`div`,{children:[i.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Ft,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!a||o||p,checks:g,testConnection:async e=>{let t=await _(e);if(!t)return;let n=h.filter(e=>t[e.environmentId]?.status===`failed`);return W.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${h.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{f(e),l(e)},onRemove:e=>void v(e,!0)})]},e.environmentId)),c?(0,Q.jsx)(jt,{host:c,isNew:u===null,targets:h,busy:p,onSave:e=>void v(e,!1,u??e),onClose:()=>l(null)},c.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Ft(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:s,onRemove:c,checks:l,testConnection:u}=e,{state:d}=Ne(r),f=ye(Pe.list),[p,m]=(0,$.useState)(null),h;t[0]===i.length?h=t[1]:(h=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=h);let g;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==s||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Ot(e)]?.[r],h=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],g=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,v=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),h.filter(Lt).map(It)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(xt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,v?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:v})]})}):null]}),g?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(de,{size:`xs`}),g]}):null,(0,Q.jsxs)(o,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{onClick:()=>{s(e)},children:`Edit`}),(0,Q.jsx)(_,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:a||g!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=s,t[19]=c,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],g=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=s,t[8]=c,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=g}else g=t[13];let v;return t[25]!==h||t[26]!==g?(v=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[25]=h,t[26]=g,t[27]=v):v=t[27],v}function It(e){return(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(xe,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Ue,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(We,{className:`size-3.5`})}),(0,Q.jsx)(Se,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Lt(e){return e.available}function Rt(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function zt(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function Bt(e){return e.step!==`importing`}function Vt(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function Ht(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function Ut(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:Vt(e)}function Wt(e){let t=Ut(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function Gt(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function Kt(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function qt(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Jt(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>Vt(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>Rt(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,C]=(0,$.useState)(),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=O(),t[7]=w):w=t[7];let T=(0,$.useRef)(`profile-${w}`),E=(0,$.useRef)(!1),D;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(D=()=>{if(E.current)return;let e=zt(b,T.current,i);if(e===void 0){C(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}C(void 0),E.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(Ht(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{E.current=!1})},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=D):D=t[12];let k=D,A;t[13]===s?A=t[14]:(A=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>Gt(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=A);let j=A,M;t[15]===j?M=t[16]:(M=()=>j(`browser`,Ut),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,Wt),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!Bt(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=I):I=t[21];let L;t[22]===m?L=t[23]:(L=Bt(m),t[22]=m,t[23]=L);let R;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==N||t[31]!==F||t[32]!==k||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(R=m.step===`quit`?(0,Q.jsx)(Yt,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Qt,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?k:F,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(tn,{}):m.step===`checking`?(0,Q.jsx)(nn,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(rn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(an,{source:d,reason:m.reason,onClose:u,onRetry:Kt(m.reason)?k:void 0}):(0,Q.jsx)($t,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),C(void 0)},targetError:S,onCancel:u,onImport:k}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=N,t[31]=F,t[32]=k,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=R):R=t[39];let z;t[40]!==L||t[41]!==R?(z=(0,Q.jsx)(je,{className:`max-w-lg`,showCloseButton:L,children:R}),t[40]=L,t[41]=R,t[42]=z):z=t[42];let ee;return t[43]!==z||t[44]!==I?(ee=(0,Q.jsx)(Me,{open:!0,onOpenChange:I,children:z}),t[43]=z,t[44]=I,t[45]=ee):ee=t[45],ee}function Yt(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Ae,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(R,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(R,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(De,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Xt(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Zt(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Qt(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:a,onGranted:o,stillRequired:s,onCheck:c}=e,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===c?p=t[1]:(p=async()=>({fullDiskAccess:await c()}),t[0]=c,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=bt(p,m),g;t[3]!==a||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(a).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=a,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Ae,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(i,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==h.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:h.status.fullDiskAccess,onAllow:x}],t[11]=h.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==l||t[16]!==S?(C=(0,Q.jsx)(vt,{busy:l,permissions:S}),t[15]=l,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==d||t[19]!==h.error?(w=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=w):w=t[20];let T;t[21]!==h||t[22]!==s?(T=h.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:s?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=h,t[22]=s,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(ke,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(R,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===h?O=t[31]:(O=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=O);let k;t[32]!==o||t[33]!==l||t[34]!==O?(k=(0,Q.jsx)(yt,{ready:O,busy:l,onClick:o,children:`Continue`}),t[32]=o,t[33]=l,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(De,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,t[42]=j):j=t[42],j}function $t(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,_=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),v;t[4]===n.name?v=t[5]:(v=(0,Q.jsxs)(Ee,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=v);let y;t[6]===r?y=t[7]:(y=(0,Q.jsxs)(Ae,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=y);let b;t[8]!==v||t[9]!==y?(b=(0,Q.jsxs)(Te,{children:[v,y]}),t[8]=v,t[9]=y,t[10]=b):b=t[10];let x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=x):x=t[11];let S;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(en,{selected:o===e.directory,title:e.name,subtitle:Xt(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],S=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=S}else S=t[15];let C;t[19]===S?C=t[20]:(C=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[x,S]}),t[19]=S,t[20]=C);let w;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(g,{className:`size-4 sm:hidden`}),(0,Q.jsx)(P,{className:`hidden size-4 sm:block`})]}),t[21]=w):w=t[21];let T;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=T):T=t[22];let E;t[23]!==a||t[24]!==u||t[25]!==c.kind?(E=a?(0,Q.jsx)(en,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=E):E=t[26];let D;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(en,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],D=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=D}else D=t[31];let O;t[36]!==E||t[37]!==D?(O=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[T,E,D]}),t[36]=E,t[37]=D,t[38]=O):O=t[38];let k;t[39]!==O||t[40]!==C?(k=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[C,w,O]}),t[39]=O,t[40]=C,t[41]=k):k=t[41];let A;t[42]===_?A=t[43]:(A=_?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:_}):null,t[42]=_,t[43]=A);let j;t[44]!==k||t[45]!==A?(j=(0,Q.jsxs)(ke,{children:[k,A]}),t[44]=k,t[45]=A,t[46]=j):j=t[46];let M;t[47]===d?M=t[48]:(M=(0,Q.jsx)(R,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=M);let N=o===``||m||h,F;t[49]!==f||t[50]!==N?(F=(0,Q.jsx)(R,{disabled:N,onClick:f,children:`Import`}),t[49]=f,t[50]=N,t[51]=F):F=t[51];let I;t[52]!==M||t[53]!==F?(I=(0,Q.jsxs)(De,{children:[M,F]}),t[52]=M,t[53]=F,t[54]=I):I=t[54];let L;return t[55]!==j||t[56]!==I||t[57]!==b?(L=(0,Q.jsxs)(Q.Fragment,{children:[b,j,I]}),t[55]=j,t[56]=I,t[57]=b,t[58]=L):L=t[58],L}function en(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=z(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d=n?`border-primary bg-primary text-primary-foreground`:`border-input`,f;t[9]===d?f=t[10]:(f=z(`grid size-4 shrink-0 place-items-center rounded-full border`,d),t[9]=d,t[10]=f);let p;t[11]===n?p=t[12]:(p=n?(0,Q.jsx)(D,{className:`size-2.5`}):null,t[11]=n,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Q.jsx)(`span`,{className:f,children:p}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(h=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[u,m]}),t[16]=a,t[17]=n,t[18]=s,t[19]=u,t[20]=m,t[21]=h):h=t[21],h}function tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ee,{children:`Importing cookies`}),(0,Q.jsx)(Ae,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(de,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function nn(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Ee,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Ae,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Te,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(de,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function rn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${Zt(n)}`:r>0?`Skipped ${Zt(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(Ee,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${Zt(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(Ae,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Te,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(ke,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:qt(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(R,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(De,{children:(0,Q.jsx)(Oe,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function an(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(Ee,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=v[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Ae,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Te,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(R,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(R,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(De,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var on=`fill`,sn=`responsive`;async function cn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function ln(e,t,n,r=0){return(e||r>0)&&t&&n>0}var un={width:1280,height:800},dn={useGrouping:!1},fn={system:`System`,light:`Light`,dark:`Dark`},pn=e=>`${Math.round(e*100)}%`,mn=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},hn=e=>{let t=String(e?.message??``);return f.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},gn=e=>e._tag===`fill`?on:e._tag===`preset`&&ft.some(t=>t.id===e.presetId)?e.presetId:sn,_n=e=>{let t=gn(e);return t===on?`Fill panel`:t===sn?`Responsive`:ft.find(e=>e.id===t)?.label??`Responsive`},vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,yn=e=>({...e,width:e.height,height:e.width});function bn(e){let t=(0,Z.c)(42),{disabled:n}=e,r=K(Sn),i=q(),a=r._tag===`fill`?null:r,o=a?.width??un.width,s=a?.height??un.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===on){i({browserDefaultViewport:x});return}if(e===sn){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??un.width,height:a?.height??un.height}});return}let t=ft.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let d=u,f;t[7]!==l||t[8]!==a||t[9]!==i?(f=(e,t)=>{if(t===null||!vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=f):f=t[10];let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=X(`browser-default-viewport`),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i||t[14]!==r._tag?(h=!n&&r._tag!==I._tag?(0,Q.jsx)(nt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:I})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=h):h=t[15];let g;t[16]===r?g=t[17]:(g=gn(r),t[16]=r,t[17]=g);let _;t[18]===r?_=t[19]:(_=_n(r),t[18]=r,t[19]=_);let v;t[20]===_?v=t[21]:(v=(0,Q.jsx)(ue,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(oe,{children:_})}),t[20]=_,t[21]=v);let y,b;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(H,{value:on,children:`Fill panel`}),b=(0,Q.jsx)(H,{value:sn,children:`Responsive`}),t[22]=y,t[23]=b):(y=t[22],b=t[23]);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(ce,{align:`end`,alignItemWithTrigger:!1,children:[y,b,(0,Q.jsxs)(le,{children:[(0,Q.jsx)(se,{children:`Standard`}),ft.map(xn)]})]}),t[24]=S):S=t[24];let C;t[25]!==n||t[26]!==d||t[27]!==v||t[28]!==g?(C=(0,Q.jsxs)(U,{value:g,onValueChange:d,disabled:n,children:[v,S]}),t[25]=n,t[26]=d,t[27]=v,t[28]=g,t[29]=C):C=t[29];let w;t[30]!==p||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(w=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(V,{value:l.width,min:240,max:T,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`width`,e),children:(0,Q.jsx)(B,{children:(0,Q.jsx)(ae,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(V,{value:l.height,min:240,max:T,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`height`,e),children:(0,Q.jsx)(B,{children:(0,Q.jsx)(ae,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(xe,{render:(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:yn(a)}),children:(0,Q.jsx)(it,{})})}),(0,Q.jsx)(Se,{side:`top`,children:`Rotate`})]})]}):null,t[30]=p,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=w):w=t[35];let E;t[36]!==C||t[37]!==w?(E=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[C,w]}),t[36]=C,t[37]=w,t[38]=E):E=t[38];let D;return t[39]!==E||t[40]!==h?(D=(0,Q.jsx)(Y,{...m,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:h,control:E}),t[39]=E,t[40]=h,t[41]=D):D=t[41],D}function xn(e){return(0,Q.jsx)(H,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Sn(e){return e.browserDefaultViewport}function Cn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=K(Tn),i=q(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)(nt,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=A.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=pn(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(ue,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(oe,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(ce,{align:`end`,alignItemWithTrigger:!1,children:A.map(wn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(U,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function wn(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:String(e),children:pn(e)},e)}function Tn(e){return e.browserDefaultZoomFactor}function En(e){let t=(0,Z.c)(18),{disabled:n}=e,r=K(On),i=q(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:F})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(ue,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(oe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(ce,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(fn).map(Dn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(U,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Dn(e){let[t,n]=e;return(0,Q.jsx)(H,{hideIndicator:!0,value:t,children:n},t)}function On(e){return e.browserDefaultAppearance}function kn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=K(jn),i=K(An),a=q(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(Y,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(ut,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=X(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(Y,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(ut,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function An(e){return e.browserRecordingShowMousePresses}function jn(e){return e.browserRecordingShowKeyPresses}function Mn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=K(Pn),i=q(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)(nt,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=p.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(ue,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(oe,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(ce,{align:`end`,alignItemWithTrigger:!1,children:p.map(Nn)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(U,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Nn(e){return(0,Q.jsxs)(H,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function Pn(e){return e.browserRecordingFrameRate}var Fn={system:`Your default browser`,app:`P4 Code`};function In(e){let t=(0,Z.c)(19),{disabled:n}=e,r=K(Rn),i=q(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`link target`,onClick:()=>i({browserLinkTarget:j})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=Fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(ue,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(oe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(Fn),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(ce,{align:`end`,alignItemWithTrigger:!1,children:u.map(Ln)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(U,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=f):f=t[15];let p;return t[16]!==o||t[17]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:o,control:f}),t[16]=o,t[17]=f,t[18]=p):p=t[18],p}function Ln(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:e,children:Fn[e]},e)}function Rn(e){return e.browserLinkTarget}function zn(){let e=(0,Z.c)(7),{search:t,environment:n}=Xe(),r=$e(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(rt,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(Bn,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function Bn({environmentId:e,enabled:t,agentAccessEnabled:n}){let i=J(e,r),{state:a,loaded:o}=Ne(e),{scope:s,environments:c,connectedEnvironments:l}=Xe(),u=Qe(),d=s.kind===`project`||s.kind===`checkout`,f=l.some(e=>e.serverConfig?.settings.enableDeviceSupport),p=ye(Pe.configure,{reportFailure:!1}),m=ye(Pe.list,{reportFailure:!1}),[h,g]=(0,$.useState)(null),_=a.hostStatus===`installing`||a.hostStatus===`starting`,v=a.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[y,b]=(0,$.useState)(!1);y&&!t&&b(!1),t&&!y&&(a.hostStatus===`ready`||v)&&h!==`hub`&&b(!0);let x=async(t,n)=>{if(e&&ve(e,`settings:write`)){g(t);try{let e=await Promise.allSettled(c.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ve(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return p({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=c.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&W.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{g(null)}}},[S,C]=(0,$.useState)(null),w=a.hosts.find(e=>e.kind===`local`)?.tools,T=t=>{let n=w?.[t],r=n&&!n.installedVersions.includes(n.requiredVersion);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[a.supportsToolUpdate&&r?(0,Q.jsx)(R,{size:`sm`,disabled:!e||h!==null||_,onClick:()=>{e&&(C(null),g(`update-${t}`),m({environmentId:e,input:{updateTool:t}}).then(e=>{e._tag===`Failure`&&C({tool:t,message:`Update failed. Check this host's network connection and try again.`})}).finally(()=>g(null)))},children:h===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,a.supportsToolInspection?(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:!e||h!==null||_,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{inspectOnly:!0}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Check versions`}):null]}),S?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:S.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:ze,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`hub`),kind:`hub`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`hub`?(0,Q.jsx)(Re,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!i||d||!o||!e||_||h!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(He,{children:y?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:l.length>1?`Status for ${l.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Le,{compact:!0,platform:`iOS`,status:Be(a,`ios`)}),(0,Q.jsx)(Le,{compact:!0,platform:`Android`,status:Be(a,`android`)})]}),control:(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:!e||!t||_||h!==null,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Fe,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`agent`),kind:`agent`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`agent`?(0,Q.jsx)(Ve,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!i||l.length===0||!d&&(!o||!f||_)||h!==null,"aria-label":`Agent device access`,onCheckedChange:e=>d?u({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ie,{state:{...a,hosts:a.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(Pt,{environmentId:e})]})}function Vn(e){let t=(0,Z.c)(14),{disabled:n}=e,r=K(Hn),i=q(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)(nt,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(ut,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(Y,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Hn(e){return e.browserAutoShowFloatingPreview}function Un({disabled:e}){let t=K(e=>e.browserProfiles),n=K(e=>e.browserDefaultProfileId),r=he(),i=q(),{environments:a,isReady:c}=pe(),l=fe(),[u,f]=(0,$.useState)(null),[p,m]=(0,$.useState)(null),[g,v]=(0,$.useState)(null),[x,S]=(0,$.useState)(null),[C,T]=(0,$.useState)(null),[D,k]=(0,$.useState)(!1),A=ie(),j=ye(Ge.clearProfile,{reportFailure:!1}),P={environmentIds:a.map(e=>e.environmentId).filter(e=>A.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await j({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw re(n)}},F=ln(lt!==null,c,a.length,P.environmentIds.length),I=(0,$.useRef)(!1),[L,ae]=(0,$.useState)(!1),B=e||!r,V=b(t).filter(e=>e.kind!==`incognito`),H=te(V,n)?.id??`default`,oe=e=>{if(!r||I.current)return;let t=G().browserProfiles;if(t.length>=24)return;let n=b(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${O()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},se=(e,t)=>{if(!r||I.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=G().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},ce=(e,t)=>{if(r&&!I.current){if(!F){W.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}cn(lt,a.map(e=>e.environmentId),e,P).then(()=>{W.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{W.add({type:`error`,title:`Could not clear ${t}'s data`})})}},le=async e=>{if(!r||I.current)return;if(!F){T(`Connect to an environment before removing this profile.`);return}T(null),k(!0);try{await cn(lt,c?a.map(e=>e.environmentId):[],e,P)}catch{T(`Profile data could not be deleted. Try again.`),k(!1);return}let t=G();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:E}:{}}),k(!1),v(null)},ue=(u??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),U=(0,$.useCallback)(()=>{lt&&lt.listBrowserImportSources().then(f).catch(()=>f(e=>e??[]))},[]),de=async(e,t,n)=>{if(!lt||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!b(G().browserProfiles).some(e=>e.id===n.target.profileId)||I.current)return{kind:`blocked`,reason:`readFailed`};I.current=!0,ae(!0);try{let r=await lt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!b(G().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await ge(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new mn;let r=new Set(b(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await cn(lt,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof mn?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:hn(e)}}finally{I.current=!1,ae(!1)}},_e=async e=>{if(lt)try{let t=await lt.listBrowserImportSources();return f(t),t.find(t=>t.id===e)}catch{return}},J=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(o,{onOpenChange:e=>e&&U(),children:[(0,Q.jsxs)(M,{render:(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:B||L}),children:[(0,Q.jsx)(d,{}),`Add profile`]}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{disabled:!r||J,onClick:()=>oe(`New profile`),children:`Blank profile`}),J?(0,Q.jsx)(_,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(ee,{}),(0,Q.jsxs)(N,{children:[(0,Q.jsx)(s,{children:`Import from`}),u===null?(0,Q.jsx)(_,{disabled:!0,children:`Looking for browsers…`}):ue.length===0?(0,Q.jsx)(_,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[ue.map(e=>(0,Q.jsx)(_,{disabled:!r||l==null,onClick:()=>{r&&l!=null&&m({source:e,environmentId:l.environmentId,environmentName:Ze({isPrimary:!0,environmentId:l.environmentId,runtimeLabel:l.label})})},children:e.name},e.id)),l==null?(0,Q.jsx)(_,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:V.map((e,t)=>{let n=ne(e.id),a=e.id===H;return(0,Q.jsxs)(`div`,{className:z(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:z(`truncate text-sm text-foreground`,B&&`opacity-64`),children:e.name}):(0,Q.jsx)(gt,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:B||L,maxLength:48,value:e.name,onCommit:t=>se(e.id,t)}),a?(0,Q.jsx)(`span`,{className:z(`flex`,B&&`opacity-64`),children:(0,Q.jsx)(h,{children:`Default`})}):null]}),(0,Q.jsxs)(o,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(R,{size:`icon-xs`,variant:`ghost-muted`,disabled:B||L,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(_,{disabled:!r||!F,onClick:()=>{P.environmentIds.length>0?S(e):ce(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(_,{variant:`destructive`,disabled:!r||!F,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{}),(0,Q.jsx)(_,{disabled:!0,children:c?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ct,{open:g!==null,onOpenChange:e=>{!e&&!D&&(v(null),T(null))},children:(0,Q.jsxs)(pt,{children:[(0,Q.jsxs)(st,{children:[(0,Q.jsxs)(at,{children:[`Remove “`,g?.name,`”?`]}),(0,Q.jsx)(dt,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),C?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:C}):null,F?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(mt,{children:[(0,Q.jsx)(ot,{disabled:D,render:(0,Q.jsx)(R,{variant:`outline`,disabled:D}),children:`Cancel`}),(0,Q.jsx)(R,{variant:`destructive`,disabled:D||!r||!F,onClick:()=>{g&&r&&F&&le(g.id)},children:D?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ct,{open:x!==null,onOpenChange:e=>{e||S(null)},children:(0,Q.jsxs)(pt,{children:[(0,Q.jsxs)(st,{children:[(0,Q.jsxs)(at,{children:[`Clear “`,x?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(dt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(mt,{children:[(0,Q.jsx)(ot,{render:(0,Q.jsx)(R,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(R,{variant:`destructive`,onClick:()=>{x&&ce(x.id,x.name),S(null)},children:`Clear data`})]})]})}),p?(0,Q.jsx)(Jt,{source:p.source,destinationEnvironmentName:p.environmentName,targetProfiles:V.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!J,onImport:e=>de(p.source,p.environmentId,e),onRefreshSource:()=>_e(p.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await me()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{W.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>m(null)}):null]})}function Wn(){let e=(0,Z.c)(3),t=!be,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(bn,{disabled:t}),(0,Q.jsx)(Cn,{disabled:t}),(0,Q.jsx)(En,{disabled:t}),(0,Q.jsx)(Mn,{disabled:t}),(0,Q.jsx)(kn,{disabled:t}),(0,Q.jsx)(In,{disabled:t}),(0,Q.jsx)(Vn,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(ht,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(tt,{children:[i,(0,Q.jsx)(rt,{id:`browser`,title:`Browser`,children:t?(0,Q.jsx)(et,{message:`Only available in the desktop app.`,children:r}):r}),(0,Q.jsx)(zn,{})]}),e[2]=a):a=e[2],a}var Gn=Wn;export{Gn as component};
2
- //# sourceMappingURL=settings.integrations-MHjX-SLC.js.map
@@ -1,4 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-CN2gK_o7.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-BctiQ4Ue.js","assets/activity-C1Y3O_v1.js","assets/createLucideIcon-CacG5mZC.js","assets/alarm-clock-Pw90g7hE.js","assets/app-window-D2LBv8RE.js","assets/archive-0Qz6rgBl.js","assets/arrow-down-up-B46gw0xW.js","assets/arrow-down-DvRecXuy.js","assets/arrow-left-BLE461db.js","assets/arrow-right-left-BqjFeAD_.js","assets/arrow-right-CoV5ameY.js","assets/arrow-up-down-ibtVnemT.js","assets/arrow-up-left-BMvgV_8i.js","assets/arrow-up-right-C6IM-WPd.js","assets/arrow-up-3Yp3lsoe.js","assets/battery-Bjbw2yxu.js","assets/bell-CLuvLMth.js","assets/blocks-B-VfW07Q.js","assets/book-open-HEEW8eqT.js","assets/bookmark-HM-xwl47.js","assets/bot-DpQzHyXo.js","assets/box-CKWcQvdq.js","assets/bug-Dtc5BRVF.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-clock-DTUOomkO.js","assets/calendar-c_JH_1V1.js","assets/camera-V1Ufc9sC.js","assets/chart-no-axes-column-DKbSsm0y.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-left-DrNh6cTh.js","assets/chevron-right-NbahR9_s.js","assets/chevron-up-C-w52bD6.js","assets/chevrons-left-right-ellipsis-D2Qu5H2y.js","assets/chevrons-up-down-BMPucOK_.js","assets/chromium-BusoCgri.js","assets/circle-alert-B83jEPoh.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/circle-check-Y1T60J9X.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-slash-Ceo-2WKq.js","assets/circle-x-C-GXnJRB.js","assets/circle-4zZlZno3.js","assets/clock-3-SBiWJYHb.js","assets/clock-bc9N_wA2.js","assets/cloud-download-BE7c7r3I.js","assets/cloud-upload-noux3Cbp.js","assets/cloud-DyVMWy7X.js","assets/code-xml-CbuCFrkh.js","assets/code-DuFehkNQ.js","assets/columns-2-D1kdFD9w.js","assets/copy-CoM62e83.js","assets/corner-left-up-BCqW4dF8.js","assets/corner-up-right--t3OPVhh.js","assets/cpu-mffhvvYB.js","assets/database-DipbOz0U.js","assets/download-BAp4p4A-.js","assets/earth-CTY23Bx1.js","assets/ellipsis-vertical-fYTS1grT.js","assets/ellipsis-6x3R4_IB.js","assets/external-link-NWS0I_zo.js","assets/eye-off-BJFC-Vn7.js","assets/eye-Dh5UEUs_.js","assets/file-braces-CcggTVd0.js","assets/file-code-corner-Dt6PpZnb.js","assets/file-diff-BE4sroJp.js","assets/file-search-DotMSEoS.js","assets/file-spreadsheet-Boc78Vjm.js","assets/file-text-xj3y_Xbg.js","assets/file-1cutE11R.js","assets/files-CQwG7JjF.js","assets/film-CYJIuMHb.js","assets/flask-conical-WkWFg73e.js","assets/folder-closed-zBKiY8_q.js","assets/folder-cog-BMK_9DOi.js","assets/folder-git-2-BxqGR5ht.js","assets/folder-git-CoMYGJp_.js","assets/folder-open-BqgCWh1y.js","assets/folder-plus-BHa3aD6W.js","assets/folder-tree-CIpeR87A.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/git-branch-plus-BQ_ISFgF.js","assets/git-branch-CAP5iwh8.js","assets/git-commit-horizontal-6IR7R88i.js","assets/git-fork-BEEZa2l_.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/globe-BygqUCSx.js","assets/grip-vertical-B8ERFH5y.js","assets/hammer-BRTj-Vot.js","assets/hard-drive-CVWUL95f.js","assets/history-B22_6xEN.js","assets/house-D_gjXlRt.js","assets/image-xUrgiZ2i.js","assets/inbox-48iST-IJ.js","assets/info-BHB-83EA.js","assets/keyboard-9HUE6Zs7.js","assets/laptop-05PEAB3d.js","assets/layers-BqgDAlx3.js","assets/lightbulb-CEqRo_1f.js","assets/link-2-B_p2EG7Q.js","assets/link-zAXVcUwk.js","assets/list-checks-CQu2FTgJ.js","assets/list-filter-BOx8tW9q.js","assets/list-ordered-f2n8ZhGo.js","assets/list-todo-D7F9k-PE.js","assets/list-BAEaXVbr.js","assets/loader-circle-B3Ce8JIQ.js","assets/lock-open-Bt3QlIE2.js","assets/lock-Cc3mNdEd.js","assets/log-in-BpPtfyCd.js","assets/mail-J8kfrAC7.js","assets/maximize-2-CHT2IkVy.js","assets/maximize-CoWtPryT.js","assets/memory-stick-C7kBEkBW.js","assets/message-circle-question-mark-Blboafqi.js","assets/message-circle-CwQpPAbq.js","assets/message-square-dashed-DrEYZ6F3.js","assets/message-square-off-BstjdZP9.js","assets/message-square-text-CJTpB0rs.js","assets/message-square-warning-I95tWaoN.js","assets/message-square-DLzUyuIE.js","assets/messages-square-BNeF2306.js","assets/minimize-2-DOhpJbnX.js","assets/minus-C7W28oE7.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/mouse-pointer-2-DbBU41il.js","assets/mouse-pointer-click-DsDE4K7M.js","assets/octagon-alert-BKVCgU--.js","assets/package-plus-Cl7EzKuY.js","assets/package-CeeyHFJU.js","assets/paintbrush-D1BKpWrm.js","assets/palette-Xj4s0pmv.js","assets/panel-bottom-BzpRd9wr.js","assets/panel-left-DzXd97so.js","assets/panel-right-C3EFo10c.js","assets/paperclip-BCpF_jt0.js","assets/panels-top-left-C5lf6BGD.js","assets/pen-line-BeMREvYs.js","assets/pencil-ruler-CU_Sl28D.js","assets/pencil-CnxrJI7X.js","assets/picture-in-picture-2-g5nsWFVw.js","assets/pilcrow-DMiXqMTk.js","assets/pin-DfMqpQHz.js","assets/play-Bvcnzkvl.js","assets/plug-2-DkrvJqyh.js","assets/plus-Cr075-cy.js","assets/plug-Cdxb0djR.js","assets/power-BZu57mPF.js","assets/presentation-DvMc9hxG.js","assets/puzzle-Bv9mngwk.js","assets/qr-code-D3ZNC-wH.js","assets/quote-zNyOHYG3.js","assets/radio-tower-CT5Np78y.js","assets/redo-2-DRHZshO-.js","assets/refresh-cw-PY_ECjtI.js","assets/rotate-ccw-Dr4MwDMq.js","assets/rotate-cw-10CQA0Ej.js","assets/route-CQ6wZzks.js","assets/rows-3-Bhc8vjss.js","assets/scale-V7dmr96y.js","assets/search-Cr9eaeTj.js","assets/send-CMOvB09P.js","assets/server-Le_hLOlf.js","assets/settings-2-XzWAl_8P.js","assets/settings-CTjEqsg3.js","assets/shield-check-k2SY7zjx.js","assets/shield-question-mark-pgYZYoSI.js","assets/shield-veV1FXDO.js","assets/sliders-horizontal-lg5XUMZM.js","assets/smartphone-zkhAIn1Q.js","assets/smile-plus-20kjE9KX.js","assets/sparkles-cStmYKbH.js","assets/square-arrow-out-up-right-DRKYZdVU.js","assets/square-pen-DIW48FdK.js","assets/square-plus-CeFmBUPF.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/star-DJ6Ycqv6.js","assets/sun-C8irSiA-.js","assets/tag-DhRIoqTo.js","assets/target-DziMQLku.js","assets/terminal-6kKaKv-Q.js","assets/text-align-start-C-EHiBr4.js","assets/text-search-BsqmpFYh.js","assets/text-wrap-C8SwAUbc.js","assets/ticket-LnwYlhC1.js","assets/trash-2-CiyAV2xI.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/triangle-alert-BiHUyRl3.js","assets/type-ChjbxAhu.js","assets/undo-2-ZlIXiNdF.js","assets/unlink-2-DKAoaBiV.js","assets/unplug-Dg15iaHA.js","assets/upload-D9-Kv89Z.js","assets/user-check-BtCtF_-l.js","assets/user-lock-BWt0Um72.js","assets/user-plus-DbG1t95t.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/users-LmqvhHnq.js","assets/wifi-off-DtJhRDhE.js","assets/workflow-Za5zYpKH.js","assets/wrench-CSZxFJCP.js","assets/x-CSwbgjBe.js","assets/zap-CrtYfJ8v.js","assets/toggle-group-DaqkIApY.js","assets/CompositeRoot-DDZcK2m0.js","assets/toggle-BM8lnQ29.js","assets/input-Df_UyHLk.js","assets/Input-DCMTYdrA.js","assets/FieldControl-w2_zp1DT.js","assets/useRegisterFieldControl-CosvijuC.js","assets/scroll-area-0-l4q4Pk.js","assets/ScrollAreaCorner-CNzfnpwK.js","assets/CSPContext-BP4s0CJv.js","assets/dialog-YpQOq7Ug.js","assets/DialogTitle-Dr-LJLpq.js","assets/ProjectMonogram-B3Dkc8yq.js","assets/dynamic-C1qIL2Wy.js","assets/index-CnQWjeBY.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CnQWjeBY.js";import{r as n}from"./Icon-l19w4AjM.js";import{C_ as r,Cm as i,D as a,Gn as o,Gs as s,Jn as c,Ks as l,Mf as u,NE as d,Pp as f,Qp as p,Tc as m,Yn as h,Yo as g,Zn as _,__ as v,fw as y,gd as b,in as x,k_ as S,lE as C,ms as w,n as T,or as E,qn as D,r as O,sr as k,tr as ee,uy as te,xs as A}from"./utils-BctiQ4Ue.js";import{R as ne,U as j,W as re,z as M}from"./runtime-DATbE5vH.js";import{C as N,P as ie,W as P,k as F}from"./entities-Bj5ceyfn.js";import{yn as I}from"./runtime-Dks8Wo5P.js";import{t as L}from"./useNavigate-BziZQ-Vx.js";import{t as R}from"./useLocation-BQDC59xg.js";import{i as z}from"./toast-gFAddE-Q.js";import{E as ae,J as B,K as V,O as oe}from"./useSettings-B_WzhJqU.js";import{f as H,s as U}from"./server-rxH1493J.js";import{n as W,o as G}from"./session-Bgs0dTwK.js";import{t as K}from"./use-atom-command-BJxdfyHC.js";import{n as q}from"./toastHelpers-Dsph6LwL.js";import{t as J}from"./input-Df_UyHLk.js";import{D as Y,E as X,O as se,j as ce,y as le}from"./keybindings-Cwx4RZou.js";import{t as ue}from"./PierreEntryIcon-CjZ8gyJq.js";import{t as de}from"./ProjectFavicon-va5UQPLo.js";import{d as fe}from"./projectFilesQueryState-45r9sIZp.js";import{n as pe}from"./p4ProjectFile-B9fwmcbM.js";import{h as me,n as he}from"./composerDraftUploads-Qq0xOGEc.js";import{r as ge,t as _e}from"./alert-DsgAHDNi.js";import{B as ve,H as ye,I as be,a as Z,i as xe,r as Se,s as Ce}from"./settingsLayout-BQsOdImg.js";import{i as we,o as Te,r as Ee}from"./command-IDMJ6pXc.js";import{$t as De,cn as Oe,on as ke}from"./main-D8FWUaO_.js";import{c as Ae,f as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./projectScriptEditor-CI1LZs9V.js";import{t as Re}from"./ProjectDefaultsSettings-DUCUj4oc.js";import{t as ze}from"./SettingsScopeNotice-CyzbYUPJ.js";var Be=d(),Q=e(n(),1),$=e(C(),1);function Ve(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function He(e,t){return!O(t)||I(e)}function Ue(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=fe(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=g(U),u=e.onPickExternal,d=T(typeof navigator>`u`?``:navigator.platform),f=(0,Q.useMemo)(()=>De(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(ue,{pathValue:t.path,kind:`file`,theme:c}),run:async()=>e.onSelect(t.path)})),[e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(Ee,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(we,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(Oe,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(Te,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(ke,{groups:f.length>0?[{value:`project-favicon-files`,label:e.projectName,items:f}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ve(t,s.error,s.isPending)})})}):null})}function We(e){let t=(0,Be.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=le(r,Y(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Fe,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.runOnSettle?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`on settle`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(k,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(p,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ge(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Ke(e){let t=N(),[n,i]=(0,Q.useState)(!1),a=(0,Q.useRef)(!1),o=K(H.updateSettings,`project actions update`),s=K(H.upsertKeybinding,`action shortcut update`),c=K(H.removeKeybinding,`action shortcut removal`);async function l(n,l,u){if(a.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),w(y(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ge(w(y(new S({requiredScope:r,message:`This connection cannot change environment settings.`}))));a.current=!0,i(!0);try{for(let{environmentId:r,settings:i,keybindings:a,project:d}of e){let e=d?je(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await o({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?pe(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ge(m);let h=l?[l]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=Y(e),o=Ae(a,n),l=o?Ie({keybinding:o,command:n}):null,p=Ie({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?je(i,t):t.scripts).some(t=>t.id===e))),h=p?await s({environmentId:r,input:l&&l.key!==p.key?{...p,replace:l}:p}):l&&!m?await c({environmentId:r,input:l}):null;if(h?._tag===`Failure`)return Ge(h)}}return A(void 0)}finally{a.current=!1,i(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??se(r.name,i),o=X(a,r);return l(e=>{let t=e.map(e=>e.id===a?o:ce(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:l,submit:u}}function qe(){let e=(0,Be.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:i}=ae(),a=t.kind===`project`||t.kind===`checkout`,s;e[0]!==i||e[1]!==r?(s=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=s):s=e[2];let l=s,u;e[3]===r?.settings.defaultProjectScripts?u=e[4]:(u=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=u);let d=u,p=l?.keybindings??m,g;if(e[5]!==d||e[6]!==n){let t;e[8]===d?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(d),e[8]=d,e[9]=t),g=n.some(t),e[5]=d,e[6]=n,e[7]=g}else g=e[7];let v=g,y=be(),[x,S]=(0,Q.useState)(null),C,w,T;e[10]!==i||e[11]!==a||e[12]!==t.members||e[13]!==n?(C=new Map(a?t.members.map(Ye):[]),w=Ke,T=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?C.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=a,e[12]=t.members,e[13]=n,e[14]=C,e[15]=w,e[16]=T):(C=e[14],w=e[15],T=e[16]);let{saving:O,persist:A,submit:j}=w(T),M;e[17]!==C||e[18]!==r?(M=r?.projectId?C.get(r.projectId):void 0,e[17]=C,e[18]=r,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??te.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Pe(ie,N?.workspaceRoot??null),F;if(e[22]!==P.scripts||e[23]!==d){let t;e[25]===d?t=e[26]:(t=e=>!d.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=d,e[26]=t),F=P.scripts.filter(t),e[22]=P.scripts,e[23]=d,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);S({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===A?B=e[31]:(B=()=>void A(Je),e[30]=A,e[31]=B);let V;e[32]!==y||e[33]!==R||e[34]!==I||e[35]!==O?(V=I.length>0?(0,$.jsxs)(o,{children:[(0,$.jsxs)(E,{render:(0,$.jsx)(k,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:O||!y,type:`button`}),children:[`Import scripts`,(0,$.jsx)(b,{className:`size-3.5`})]}),(0,$.jsxs)(_,{align:`end`,children:[(0,$.jsxs)(D,{children:[(0,$.jsx)(c,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(ee,{}),I.map(e=>(0,$.jsxs)(h,{onClick:()=>void R(e),children:[(0,$.jsx)(Fe,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=y,e[33]=R,e[34]=I,e[35]=O,e[36]=V):V=e[36];let oe=O||!y||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>S({scriptId:null,initial:Le}),U=(0,$.jsx)(f,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(k,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==v||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:v,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=v,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==y||e[49]!==p||e[50]!==v||e[51]!==O||e[52]!==d?(q=v?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(We,{scripts:d,keybindings:p,disabled:O||!y,onEdit:e=>S(Me(e,p))}),e[48]=y,e[49]=p,e[50]=v,e[51]=O,e[52]=d,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==A||e[57]!==x||e[58]!==d||e[59]!==j||e[60]!==r?(Y=r&&(0,$.jsx)(Ne,{environmentId:r.environmentId,editScope:`settings:write`,request:x,scripts:d,onSubmit:j,onDelete:e=>void A(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>S(null)}),e[56]=A,e[57]=x,e[58]=d,e[59]=j,e[60]=r,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(Ce,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Je(){return null}function Ye(e){return[e.id,e]}function Xe(e,t,n){return n&&e.some(e=>e!==t)}var Ze=(0,Q.lazy)(()=>t(()=>import(`./ProjectIconPickerDialog-CN2gK_o7.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232])));function Qe(e){return`${e.environmentId}:${e.id}`}function $e(e){let t=(0,Be.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:tt},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(et)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(nt,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function et(e){return e.physicalProjectKey}function tt(e){return e.pathname}function nt({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=oe(),{environments:o}=ae(),c=(0,Q.useMemo)(()=>new Map(o.map(e=>[e.environmentId,e])),[o]),d=G(e.memberProjects,v),f=e.memberProjects.every(e=>d.has(e.environmentId)),p=e.memberProjects.find(e=>c.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],m=F(),h=me(P.update,{reportFailure:!1}),g=me(P.delete,{reportFailure:!1}),_=(0,Q.useRef)(!1),b=p.faviconPath??null,S=p.projectIcon??null,C=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&He(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,T=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),E=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,v));if(!n)return null;let r=w(y(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return T(t,r),r},[T]),D=(0,Q.useCallback)(async(t,n)=>{let r=E(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=c.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=w(y(e));return T(n,t),t}for(let r of e.memberProjects){let i=E([r],n);if(i)return i;let a=M(await h({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return T(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return A(void 0)},[E,c,e.memberProjects,T,h]),O=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();if(!r){z.add({type:`warning`,title:`Project title cannot be empty`});return}Xe(e.memberProjects.map(e=>e.title),r,n)&&await D({title:r},`Failed to rename project`)},[e.memberProjects,D]),[ee,te]=x(!f),[N,I]=x(!f),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await D(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[D]),K=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(E(r,`Failed to remove project`))return;let i=B();if(!i)return;let o=new Set(r.map(Qe)),c=m.filter(e=>o.has(`${e.environmentId}:${e.projectId}`)),u=r.length===e.memberProjects.length,d=t||!u?`checkout`:`project`,f=r.length===1?r[0]:null,p=f?.title??e.displayName,h=await j(()=>i.dialogs.confirm([c.length>0?`Remove ${d} "${p}" and delete its ${c.length} thread${c.length===1?``:`s`}?`:`Remove ${d} "${p}"?`,...f?[`Path: ${f.workspaceRoot}`,...f.environmentLabel?[`Environment: ${f.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...c.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],u&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
3
- `),{variant:`destructive`}));if(h._tag===`Failure`||!h.value||E(r,`Failed to remove project`))return;let _=a.getState();for(let e of r){if(E([e],`Failed to remove project`))return;let t=c.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=M(await g({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){T(`Failed to remove "${e.title}"`,n);return}let r=s(e.environmentId,e.id);await ie(r),he(r,t.map(e=>l(e.environmentId,e.id)));let i=_.getDraftThreadByProjectRef(r);i&&_.clearDraftThread(i.draftId),_.clearProjectDraftThreadId(r)}u&&!t&&n({to:`/`,replace:!0})},[E,g,e.displayName,e.memberProjects.length,t,n,T,m]),X=(0,$.jsx)(Ce,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(k,{size:`sm`,variant:`outline`,disabled:!d.has(e.environmentId),onClick:()=>void Y([e]),"aria-label":`Remove checkout ${e.workspaceRoot}`,children:`Remove`})},e.physicalProjectKey))});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(xe,{className:`gap-6`,children:[(0,$.jsxs)(_e,{variant:`info`,children:[(0,$.jsx)(u,{"aria-hidden":!0}),(0,$.jsx)(ge,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(Ce,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[f?null:(0,$.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground sm:px-4`,children:e.memberProjects.length>1?`Shared settings require permission to change every checkout in this group.`:`This connection cannot change this project.`}),(0,$.jsx)(Z,{title:`Name`,description:`The shared name for this project group in the sidebar and thread lists.`,control:(0,$.jsx)(J,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!f,defaultValue:e.displayName,onChange:()=>{_.current=!0},onBlur:e=>{let t=_.current;_.current=!1,O(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:S?.kind===`lucide`?`${S.name} · ${S.color}`:S?.kind===`monogram`?`${S.text} · ${S.color}`:S?.kind===`emoji`?S.emoji:b??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(Se,{label:`project icon`,disabled:R||!f,onClick:()=>void U({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(de,{project:p,className:`size-6`}),(0,$.jsx)(k,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:R||!f,onClick:()=>I(!0),children:`Choose icon`}),(0,$.jsx)(k,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:R||!f,onClick:()=>te(!0),children:`Choose file`})]})})]}),(0,$.jsx)(Re,{category:`project`}),(0,$.jsx)(qe,{}),K?X:null,(0,$.jsx)(Ce,{title:`Danger`,children:(0,$.jsx)(Z,{title:t?`Remove checkout`:e.memberProjects.length>1?`Remove this project everywhere`:`Remove project`,description:t?`Deletes the selected machine's checkout entries and their threads. Other machines and files on disk are not touched.`:e.memberProjects.length>1?`Deletes all ${e.memberProjects.length} checkout entries and their threads on every machine. Files on disk are not touched.`:`Deletes the project entry and its threads. Files on disk are not touched.`,control:(0,$.jsxs)(k,{size:`sm`,variant:`destructive-outline`,disabled:!f,onClick:()=>void Y(e.memberProjects),children:[(0,$.jsx)(i,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(Ue,{cwd:p.workspaceRoot,environmentId:p.environmentId,onOpenChange:te,...C?{onPickExternal:()=>C(p.workspaceRoot)}:{},onSelect:e=>void U({faviconPath:e,projectIcon:null}),open:ee&&f,projectName:e.displayName},`${p.environmentId}:${p.workspaceRoot}:${ee}`),N&&f?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Ze,{current:S,projectName:p.title,open:!0,onOpenChange:I,onSelect:e=>void U({faviconPath:null,projectIcon:e})})}):null]})}function rt(){let e=(0,Be.c)(7),{search:t,scope:n}=ve(),r=n.kind===`project`||n.kind===`checkout`||n.kind===`unavailable`&&(n.reason===`project-missing`||n.reason===`checkout-missing`),i;return e[0]!==r||e[1]!==n.kind||e[2]!==n.message||e[3]!==t.checkout||e[4]!==t.machine||e[5]!==t.project?(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t.project&&r?(0,$.jsx)($e,{projectKey:t.project,environmentId:t.machine?te.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(xe,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(ze,{target:`project`,children:`Choose a project to manage its name, icon, checkouts and actions.`})}),e[0]=r,e[1]=n.kind,e[2]=n.message,e[3]=t.checkout,e[4]=t.machine,e[5]=t.project,e[6]=i):i=e[6],i}var it=rt;export{it as component};
4
- //# sourceMappingURL=settings.projects-BiDMtruF.js.map