@p4code/cli 0.9.20 → 0.9.21

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 (194) hide show
  1. package/dist/{TraceDiagnostics-BYrlvKdA.mjs → TraceDiagnostics-DEAfnZGb.mjs} +2 -2
  2. package/dist/bin.mjs +1 -1
  3. package/dist/{binCli-DReuiGmk.mjs → binCli-IfUU-uWs.mjs} +5 -5
  4. package/dist/client/.vite/manifest.json +1107 -1107
  5. package/dist/client/assets/{2NI2N5EU-DjM2qwkD.js → 2NI2N5EU-qP3PpVDC.js} +2 -2
  6. package/dist/client/assets/{4UO7MD6I-BJdq41GZ.js → 4UO7MD6I-Da5jHHfF.js} +2 -2
  7. package/dist/client/assets/{5B3SVYGG-D21CBy6j.js → 5B3SVYGG-BGHUtemY.js} +2 -2
  8. package/dist/client/assets/{5GK6JWQ2-DOIdqlC8.js → 5GK6JWQ2-DwbHk3MV.js} +2 -2
  9. package/dist/client/assets/{5N7A7DKN-Bckll9rH.js → 5N7A7DKN-B-2quXAp.js} +2 -2
  10. package/dist/client/assets/{5OC2THR4-skJPz5iO.js → 5OC2THR4-DSQWJ0ZQ.js} +2 -2
  11. package/dist/client/assets/{5S6HY5KT-CRwXaSb1.js → 5S6HY5KT-CAwEcA6I.js} +2 -2
  12. package/dist/client/assets/{6IMQ5BUJ-sJYhkmUL.js → 6IMQ5BUJ-BABYtiev.js} +2 -2
  13. package/dist/client/assets/{6OLKWJ4F-DY2aNKk1.js → 6OLKWJ4F-CwQRt55E.js} +2 -2
  14. package/dist/client/assets/{74OO7NKP-DpZyVE6P.js → 74OO7NKP-DZoL_aBI.js} +2 -2
  15. package/dist/client/assets/{75O6YZUN-8DIThGtQ.js → 75O6YZUN-CoqdPLhF.js} +2 -2
  16. package/dist/client/assets/{77XECAW3-BE-MTjvu.js → 77XECAW3-DM5Itfvk.js} +2 -2
  17. package/dist/client/assets/{ABYRPUBD-DB_eiHX6.js → ABYRPUBD-C2IaQicJ.js} +2 -2
  18. package/dist/client/assets/{AuthSurfaceShell-BM3c1qJe.js → AuthSurfaceShell-Dfcdz_aG.js} +2 -2
  19. package/dist/client/assets/{BB2UYUI2-BhRNS6b8.js → BB2UYUI2-DQkTEBDf.js} +2 -2
  20. package/dist/client/assets/{BUM34MOA-RvYWUXux.js → BUM34MOA-DuY83HEN.js} +2 -2
  21. package/dist/client/assets/{CEQABKGZ-byct14yE.js → CEQABKGZ-CNAynrzB.js} +2 -2
  22. package/dist/client/assets/{CXAC5362-YcQsQFwj.js → CXAC5362-B_mhvA6r.js} +2 -2
  23. package/dist/client/assets/{ChatGptUsageButton-BQOZ260S.js → ChatGptUsageButton-DT3CRIhB.js} +2 -2
  24. package/dist/client/assets/{ChatMarkdown-BdoTEVpd.js → ChatMarkdown-_SLyl8Hk.js} +5 -5
  25. package/dist/client/assets/{CodexSetupSection.logic-CseyxFgK.js → CodexSetupSection.logic-CqdvWoE6.js} +2 -2
  26. package/dist/client/assets/{CommandBlock-Cg8P2GXg.js → CommandBlock-DnTIHX5l.js} +2 -2
  27. package/dist/client/assets/{ConnectAgentSurface-D9MYjA6g.js → ConnectAgentSurface-D-Z7Gl3G.js} +2 -2
  28. package/dist/client/assets/{DRLTVNUE-BZ7eTlHc.js → DRLTVNUE-Bp-Mh_TD.js} +2 -2
  29. package/dist/client/assets/{DYY6UVD2-DIWnFjlV.js → DYY6UVD2-Dwh9ZkXt.js} +2 -2
  30. package/dist/client/assets/{DevicePanel-CpWnw2HZ.js → DevicePanel-MMC7u5qJ.js} +2 -2
  31. package/dist/client/assets/{DeviceSetup-C02U1yvN.js → DeviceSetup-BCrBVLkf.js} +2 -2
  32. package/dist/client/assets/{DiffCommentAnnotation-CHYeyesq.js → DiffCommentAnnotation-D7iLWjnP.js} +2 -2
  33. package/dist/client/assets/{DiffFileTree-zq0G5Jq3.js → DiffFileTree-PCGZGqlB.js} +2 -2
  34. package/dist/client/assets/{DiffPanel-ghqOrQdi.js → DiffPanel-OOedo4tu.js} +2 -2
  35. package/dist/client/assets/{DiffWorkerPoolProvider-QbRiMHeR.js → DiffWorkerPoolProvider-CmorWW2H.js} +2 -2
  36. package/dist/client/assets/{EmbeddedDesign-ExUecHKZ.js → EmbeddedDesign-CeUGLwuZ.js} +4 -4
  37. package/dist/client/assets/{FNOVOB4O-Cch7VyQQ.js → FNOVOB4O-BJscBtWY.js} +2 -2
  38. package/dist/client/assets/{FileDiff-C1_8HZ7T.js → FileDiff-BMtpmo0v.js} +2 -2
  39. package/dist/client/assets/{FilePreviewPanel-DERxofVe.js → FilePreviewPanel-DUqI7pF3.js} +2 -2
  40. package/dist/client/assets/{FoldedSettingsSection-okCu3zVD.js → FoldedSettingsSection-BTMENmDo.js} +2 -2
  41. package/dist/client/assets/{HDGCDEEZ-CJ_9BjZ0.js → HDGCDEEZ-BA3H_tu4.js} +2 -2
  42. package/dist/client/assets/{HSJLKHB7-BvfNYUiJ.js → HSJLKHB7-BojHXJG0.js} +2 -2
  43. package/dist/client/assets/{IntervalSecondsField-S7jLIub2.js → IntervalSecondsField-Cpc7UePr.js} +2 -2
  44. package/dist/client/assets/JZOYTAAL-Bw2-11fa.js +1 -0
  45. package/dist/client/assets/{K3MD6TGW-C513S1_s.js → K3MD6TGW-hwfRTJ3N.js} +2 -2
  46. package/dist/client/assets/{K7RP3OMA-zhgZmSWl.js → K7RP3OMA-4mJh9KrG.js} +2 -2
  47. package/dist/client/assets/{LHDIQX7Q-BmjYN5gQ.js → LHDIQX7Q-LIdvhN0m.js} +2 -2
  48. package/dist/client/assets/{LUXOKEGN-B0Kwi43W.js → LUXOKEGN-B1aHy25-.js} +2 -2
  49. package/dist/client/assets/{LinkMachineSelect-GyKAeGYQ.js → LinkMachineSelect-CM7JZDuM.js} +2 -2
  50. package/dist/client/assets/{MathTypeset-DfU_zRMI.js → MathTypeset-CA2nw_Ej.js} +2 -2
  51. package/dist/client/assets/{ModelLiveLayer-DjtYQpVe.js → ModelLiveLayer-CPk6oSLz.js} +3 -3
  52. package/dist/client/assets/{N3JZAHOW-BXB2c-Us.js → N3JZAHOW-Dz6QAj1L.js} +2 -2
  53. package/dist/client/assets/{NUIALGQ3-BkehuL9A.js → NUIALGQ3-W9kPoZrb.js} +2 -2
  54. package/dist/client/assets/{NoProjectsHero-C-VNr8Ui.js → NoProjectsHero-DrTDAhjM.js} +2 -2
  55. package/dist/client/assets/{O65XPQGZ-CPn-XJue.js → O65XPQGZ-CPx16bPB.js} +2 -2
  56. package/dist/client/assets/{O7XIQ6OM-DAQPVVnq.js → O7XIQ6OM-CAdGDrqF.js} +2 -2
  57. package/dist/client/assets/{OFQON5FD-BKoNBxEK.js → OFQON5FD-DOxYOpsO.js} +2 -2
  58. package/dist/client/assets/{P4ConnectAccountPages-C_7SfUQ2.js → P4ConnectAccountPages-D0qqCxCf.js} +2 -2
  59. package/dist/client/assets/{P4ConnectSidebarSignIn-B6e-wkqI.js → P4ConnectSidebarSignIn-CtO1hqIS.js} +2 -2
  60. package/dist/client/assets/{PJQHF43J-Byb4NdRa.js → PJQHF43J-CEic-zJ0.js} +2 -2
  61. package/dist/client/assets/{PanelLayoutControls-BpjspxNc.js → PanelLayoutControls-CPevLAhG.js} +4 -4
  62. package/dist/client/assets/{PierreEntryIcon-h4qT502J.js → PierreEntryIcon-oOiSTYpG.js} +2 -2
  63. package/dist/client/assets/{PreviewPanel-lT6UT8SC.js → PreviewPanel-BSwObBjW.js} +2 -2
  64. package/dist/client/assets/{ProjectDefaultsSettings-nqWOPUBM.js → ProjectDefaultsSettings-BkxL8Xjx.js} +2 -2
  65. package/dist/client/assets/{ProjectFavicon-wwkvNTYJ.js → ProjectFavicon-DYcNXMDQ.js} +3 -3
  66. package/dist/client/assets/{ProjectIconPickerDialog-CAEx0HQF.js → ProjectIconPickerDialog-CnlPMGQj.js} +2 -2
  67. package/dist/client/assets/{ProviderAuthTerminal-Seln-0IQ.js → ProviderAuthTerminal-B1NeqFZE.js} +2 -2
  68. package/dist/client/assets/{ProviderModelPicker-p5oWTfTD.js → ProviderModelPicker-CLwSFV6Q.js} +2 -2
  69. package/dist/client/assets/{ProviderSettingsForm-DP5cO9tc.js → ProviderSettingsForm-D9GJtzdb.js} +2 -2
  70. package/dist/client/assets/{PullRequestCodeTab-BhWK4Zqq.js → PullRequestCodeTab-CajEWSe5.js} +2 -2
  71. package/dist/client/assets/{RHNBAITX-ZKmIoa8f.js → RHNBAITX-D5lTu0BB.js} +2 -2
  72. package/dist/client/assets/{ReadOnlySourcePreview-C8hhN481.js → ReadOnlySourcePreview-LxG8Br9J.js} +2 -2
  73. package/dist/client/assets/{RenderErrorBoundary-CYWiIuBa.js → RenderErrorBoundary-CcI-4Zo3.js} +2 -2
  74. package/dist/client/assets/{SLD4V6NK-BW_1--rc.js → SLD4V6NK-CG_xQFi-.js} +2 -2
  75. package/dist/client/assets/{ScheduledTasksSettings-D6cHBUhW.js → ScheduledTasksSettings-CSygG_5X.js} +2 -2
  76. package/dist/client/assets/{ScopedSwitch-BzU8Hn6s.js → ScopedSwitch-LzARRHas.js} +2 -2
  77. package/dist/client/assets/{SelfImproveSettingsSection--Dcxxm73.js → SelfImproveSettingsSection-DjuOvf_q.js} +2 -2
  78. package/dist/client/assets/{SettingsPanels-C79826rW.js → SettingsPanels-Ci2h30Aw.js} +2 -2
  79. package/dist/client/assets/{SettingsPanels.logic-DPfiTtgf.js → SettingsPanels.logic-BkjrmwrI.js} +2 -2
  80. package/dist/client/assets/{SettingsScopeNotice-C9OAfACb.js → SettingsScopeNotice-96p-bg8p.js} +2 -2
  81. package/dist/client/assets/{SidebarStageBackdrop-syJ1VaYP.js → SidebarStageBackdrop-B8YG-M-e.js} +2 -2
  82. package/dist/client/assets/{T3PCR2KE-Bc51hYDo.js → T3PCR2KE-DyNYo7Zy.js} +2 -2
  83. package/dist/client/assets/{TKWO2OVW-mV-gJkJw.js → TKWO2OVW-5eCjJCfz.js} +2 -2
  84. package/dist/client/assets/{TSHNXIZL-Bs_azRDw.js → TSHNXIZL-CjI9VTqp.js} +2 -2
  85. package/dist/client/assets/{ThemeEditorPanel-DvlDdC-r.js → ThemeEditorPanel-BdfXdTV6.js} +2 -2
  86. package/dist/client/assets/{ThreadDetailsItemsMenu-DFAwPwtf.js → ThreadDetailsItemsMenu-Cgj2yuzU.js} +4 -4
  87. package/dist/client/assets/{ThreadTerminalDrawer-CBRpijGu.js → ThreadTerminalDrawer-DBG1eHBS.js} +2 -2
  88. package/dist/client/assets/{UQJE5E4I-DL8IPyLr.js → UQJE5E4I-CY9HwTsw.js} +2 -2
  89. package/dist/client/assets/{USNYFO5S-CxX5m2eb.js → USNYFO5S-BW0HcjRg.js} +2 -2
  90. package/dist/client/assets/{Virtualizer-hL0IrPqB.js → Virtualizer-NI9bqlwX.js} +2 -2
  91. package/dist/client/assets/{WEVWDWVA-CCg7BLOe.js → WEVWDWVA-BF8z-yRH.js} +2 -2
  92. package/dist/client/assets/{X5RFHQXM-CoEhAoaG.js → X5RFHQXM-pdor6bX7.js} +2 -2
  93. package/dist/client/assets/{X62E3GBT-v3am3MF5.js → X62E3GBT-C6b2WsLT.js} +2 -2
  94. package/dist/client/assets/{XBNEOJTC-CNH8QiJb.js → XBNEOJTC-BxqaKoJL.js} +2 -2
  95. package/dist/client/assets/{YHV2MVVZ-BAtBSLld.js → YHV2MVVZ-DO-ICZOV.js} +2 -2
  96. package/dist/client/assets/{YURCZMG2-B0qIfRPW.js → YURCZMG2-BxKVNupW.js} +2 -2
  97. package/dist/client/assets/{YVG2LODB-7yKJRNqu.js → YVG2LODB-BwiP1iS0.js} +2 -2
  98. package/dist/client/assets/{_chat-CPyEKO_k.js → _chat-DDScEBKF.js} +5 -5
  99. package/dist/client/assets/{_chat.design-BkPz6B_R.js → _chat.design-360SdjDb.js} +2 -2
  100. package/dist/client/assets/{_chat.index-DGRldHwy.js → _chat.index-DsRV2lh0.js} +2 -2
  101. package/dist/client/assets/{_chat.new-Be-FWv3w.js → _chat.new-B_AL_NJ2.js} +2 -2
  102. package/dist/client/assets/{_chat.pull-requests-Csb_f8e_.js → _chat.pull-requests-DlL4gjh7.js} +2 -2
  103. package/dist/client/assets/{assetUrls-CsEDCYyh.js → assetUrls-gAudvjhV.js} +2 -2
  104. package/dist/client/assets/{assets-CA-ZYmQr.js → assets-DaZ46ybf.js} +2 -2
  105. package/dist/client/assets/{browserHistoryStore-BVGoot2u.js → browserHistoryStore-CIeLvEnV.js} +2 -2
  106. package/dist/client/assets/{browserLinkTarget-zjhG9Lyg.js → browserLinkTarget-MQvtO-01.js} +2 -2
  107. package/dist/client/assets/{connect-BdyG6QZP.js → connect-DkCGs4oR.js} +2 -2
  108. package/dist/client/assets/connect-agent-C4n-OyN3.js +2 -0
  109. package/dist/client/assets/{design-9PZeJvkV.js → design-Djc1_eDF.js} +2 -2
  110. package/dist/client/assets/{device-B_zaE4OU.js → device-P8L_QiVD.js} +2 -2
  111. package/dist/client/assets/{diffRendering-aGA2PUMV.js → diffRendering-Cb9qJUqp.js} +2 -2
  112. package/dist/client/assets/{dist-DQanjDEK.js → dist-BocOAtMa.js} +2 -2
  113. package/dist/client/assets/{duoViewer-WUHHsw83.js → duoViewer-Domn2baW.js} +2 -2
  114. package/dist/client/assets/{dynamic-BrZIqKQ1.js → dynamic-CjS-lEY3.js} +2 -2
  115. package/dist/client/assets/{embeddedScripts-Bjon5VEq.js → embeddedScripts-AO2vzovy.js} +2 -2
  116. package/dist/client/assets/{entities-iVR9hStG.js → entities-s42SFcbu.js} +2 -2
  117. package/dist/client/assets/{fileLinks-ZsyrXe-F.js → fileLinks-BY6FjK66.js} +2 -2
  118. package/dist/client/assets/{fileTreeExpansion-CZA6X0sP.js → fileTreeExpansion-B--IBStv.js} +2 -2
  119. package/dist/client/assets/{getDiffFileInput-C973oCCO.js → getDiffFileInput-B7pCnCeh.js} +2 -2
  120. package/dist/client/assets/{index-ColdECgE.js → index-C5VbGbq-.js} +3 -3
  121. package/dist/client/assets/{lazy-BWBxhQ9c.js → lazy-Bpm7QNt6.js} +4 -4
  122. package/dist/client/assets/{linkedPrompt-CN5vzMKu.js → linkedPrompt-DqEOywCR.js} +2 -2
  123. package/dist/client/assets/{main-xeaL6Ue7.js → main-BYwnnJ9E.js} +7 -7
  124. package/dist/client/assets/{mediaReference-D4xASAKr.js → mediaReference-CW0q8-nM.js} +2 -2
  125. package/dist/client/assets/{mediaSource-DJf0a3Hm.js → mediaSource-BgP2sq1w.js} +2 -2
  126. package/dist/client/assets/{modelScene-Dg2T9WKU.js → modelScene-OONljnCt.js} +2 -2
  127. package/dist/client/assets/{onboarding-7dyWHc7v.js → onboarding-DLaBhCVN.js} +2 -2
  128. package/dist/client/assets/{openFileInPreview-l71la8rp.js → openFileInPreview-Dpge7x7S.js} +2 -2
  129. package/dist/client/assets/{p4ProjectFile-CC8L8IBq.js → p4ProjectFile-Fd0NSHmZ.js} +2 -2
  130. package/dist/client/assets/{pair-CjGF7d0N.js → pair-BUkFlR8l.js} +2 -2
  131. package/dist/client/assets/{phoneViewer-CpRP0Ylg.js → phoneViewer-BJj_96At.js} +2 -2
  132. package/dist/client/assets/{pierre-icons-CX8MNnZC.js → pierre-icons-BptmNFMW.js} +2 -2
  133. package/dist/client/assets/{preview-DX0t2QY_.js → preview-BBssbPEj.js} +2 -2
  134. package/dist/client/assets/{primary-BvBZk3BL.js → primary-TNEEuOuT.js} +2 -2
  135. package/dist/client/assets/{primaryCloudLinkState-CHXPTqr2.js → primaryCloudLinkState-DbUZbjy4.js} +2 -2
  136. package/dist/client/assets/{projectFilesQueryState-D1KYNZXm.js → projectFilesQueryState-CVSEDHhW.js} +2 -2
  137. package/dist/client/assets/{projectScriptEditor-Dy8U6TBl.js → projectScriptEditor-D2C0qPZA.js} +2 -2
  138. package/dist/client/assets/{providerSkills-CpjiWlTj.js → providerSkills-5OBbbZq-.js} +2 -2
  139. package/dist/client/assets/{pullRequestDetail.logic-CHJRE71s.js → pullRequestDetail.logic-D5hhGj8d.js} +2 -2
  140. package/dist/client/assets/{pullRequests-DjzqqdNY.js → pullRequests-R7416J6H.js} +2 -2
  141. package/dist/client/assets/{queries-D2fZuj-t.js → queries-Bp7Rbzrz.js} +2 -2
  142. package/dist/client/assets/{relay-aZlRxOWS.js → relay-V_5ApBIP.js} +2 -2
  143. package/dist/client/assets/{renderScheduler-BLaTctiX.js → renderScheduler-T1-hnpvd.js} +2 -2
  144. package/dist/client/assets/{runtime-D5AfNyNA.js → runtime-B92ivG9b.js} +3 -3
  145. package/dist/client/assets/{scheduledTasksSettings.logic-BjvsiCPJ.js → scheduledTasksSettings.logic-DOegPD4_.js} +2 -2
  146. package/dist/client/assets/{server-B2y_yoz_.js → server-GB5fRm03.js} +2 -2
  147. package/dist/client/assets/{session-Dt_Dt-Og.js → session-CFzb2gMH.js} +2 -2
  148. package/dist/client/assets/{session-logic-CPQJM-gL.js → session-logic-Cx9524Pd.js} +2 -2
  149. package/dist/client/assets/{settings-BIR_Igib.js → settings-DuV3USCX.js} +2 -2
  150. package/dist/client/assets/{settings.appearance-D0uNLG6m.js → settings.appearance-DtON2De5.js} +2 -2
  151. package/dist/client/assets/settings.archived-CxxKM6i3.js +2 -0
  152. package/dist/client/assets/{settings.computer-use-CNVg4Kl5.js → settings.computer-use-BuiCBgaZ.js} +2 -2
  153. package/dist/client/assets/{settings.connections-Bt5upKXR.js → settings.connections-CTuywqD3.js} +2 -2
  154. package/dist/client/assets/{settings.data-controls-Bu-fCPHf.js → settings.data-controls-BTvw7hwA.js} +2 -2
  155. package/dist/client/assets/{settings.decisions-B9lckxtw.js → settings.decisions-DjyXWkGE.js} +2 -2
  156. package/dist/client/assets/{settings.designs-CLLnQttY.js → settings.designs-B7y3Iz_g.js} +2 -2
  157. package/dist/client/assets/{settings.diagnostics-Bl2X85nQ.js → settings.diagnostics-muot_u8V.js} +2 -2
  158. package/dist/client/assets/{settings.general-CJSdSR2k.js → settings.general-CejKrS3r.js} +2 -2
  159. package/dist/client/assets/{settings.integrations-DRpNV9D5.js → settings.integrations-3B64nKur.js} +2 -2
  160. package/dist/client/assets/{settings.keybindings-BPtpYe84.js → settings.keybindings-DhvXS2QI.js} +2 -2
  161. package/dist/client/assets/{settings.open-source-licenses-DYpshDh1.js → settings.open-source-licenses-nDTYUclU.js} +2 -2
  162. package/dist/client/assets/{settings.plugins-C9ZOoiar.js → settings.plugins-DJQxiL8Y.js} +2 -2
  163. package/dist/client/assets/{settings.projects-CMHQJUvG.js → settings.projects-Cf31zLX1.js} +3 -3
  164. package/dist/client/assets/{settings.providers-Bfr9fIiF.js → settings.providers-BenYwp5l.js} +3 -3
  165. package/dist/client/assets/{settings.scheduled-tasks-BEYOe2xs.js → settings.scheduled-tasks-B0BJtx2Y.js} +2 -2
  166. package/dist/client/assets/{settings.secrets-DIyDPOQx.js → settings.secrets-CugtPHky.js} +2 -2
  167. package/dist/client/assets/{settings.snap-shot-DmjWtA3x.js → settings.snap-shot-9uuaPZ8d.js} +2 -2
  168. package/dist/client/assets/{settings.source-control-DvaOZ7kM.js → settings.source-control-DECPD9xY.js} +2 -2
  169. package/dist/client/assets/{settings.storage-B4XbjYVO.js → settings.storage-uPkJDu8D.js} +2 -2
  170. package/dist/client/assets/{settingsLayout-Ds1fJJk7.js → settingsLayout-BoWaVHvV.js} +2 -2
  171. package/dist/client/assets/{sidebarProjectGrouping-RQlsFe56.js → sidebarProjectGrouping-MU2UfzY1.js} +2 -2
  172. package/dist/client/assets/{sourceControl-BhvxhaEx.js → sourceControl-BU6NXFEv.js} +2 -2
  173. package/dist/client/assets/{sourceControlClients-Bs5R87fg.js → sourceControlClients-DBozOkI3.js} +2 -2
  174. package/dist/client/assets/{terminal-links-BohHFDfc.js → terminal-links-B5f_yaZ1.js} +2 -2
  175. package/dist/client/assets/{terminalSessions-Cnj30QDx.js → terminalSessions-Cg0AQjBU.js} +2 -2
  176. package/dist/client/assets/{uiStateStore-BZ4RuLIL.js → uiStateStore-u_PaGpa6.js} +2 -2
  177. package/dist/client/assets/{usage-GID8Ml88.js → usage-BzExgBit.js} +2 -2
  178. package/dist/client/assets/{use-atom-command-QDd_NqJQ.js → use-atom-command-Bd7vZxeH.js} +2 -2
  179. package/dist/client/assets/{useHandleNewThread-ClgC6Lcw.js → useHandleNewThread-CA9pnWuC.js} +2 -2
  180. package/dist/client/assets/{useP4ConnectAuthPrompt-DMl-0U53.js → useP4ConnectAuthPrompt-czmNhUqV.js} +2 -2
  181. package/dist/client/assets/{usePullRequestActions-CJvtylIq.js → usePullRequestActions-BIPl_xE4.js} +2 -2
  182. package/dist/client/assets/{useScopedModelAvailability-DGPFTMHL.js → useScopedModelAvailability-UuZvj6HE.js} +2 -2
  183. package/dist/client/assets/{useSettings-BJR7Rf97.js → useSettings-Dp9RSL-0.js} +2 -2
  184. package/dist/client/assets/{vcsRefInvalidation-Bnup-5J0.js → vcsRefInvalidation-CoBKCEWS.js} +2 -2
  185. package/dist/client/assets/{welcome-CMuTnFAm.js → welcome-CJjj0VVp.js} +2 -2
  186. package/dist/client/index.html +1 -1
  187. package/dist/{preview-DcFC_OYY.mjs → preview-JlPVV2bV.mjs} +2 -2
  188. package/dist/{runtimeLayer-D4LpzNmS.mjs → runtimeLayer-B9K2BVKV.mjs} +4 -4
  189. package/dist/{runtimeLayer-B6H9jZgZ.mjs → runtimeLayer-ZFdf4c6R.mjs} +1 -1
  190. package/dist/{server-4nWc1d6L.mjs → server-BnHhGuOc.mjs} +4 -4
  191. package/package.json +1 -1
  192. package/dist/client/assets/JZOYTAAL-RUIcMwMn.js +0 -1
  193. package/dist/client/assets/connect-agent-BZgF1WVU.js +0 -2
  194. package/dist/client/assets/settings.archived-DHE_0aGh.js +0 -2
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-DkKLB01I.js";import{D as i,i as a}from"./useSettings-BJR7Rf97.js";import{V as o}from"./settingsLayout-Ds1fJJk7.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=n(r(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
- //# sourceMappingURL=useScopedModelAvailability-DGPFTMHL.js.map
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-DkKLB01I.js";import{D as i,i as a}from"./useSettings-Dp9RSL-0.js";import{V as o}from"./settingsLayout-BoWaVHvV.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=n(r(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
+ //# sourceMappingURL=useScopedModelAvailability-UuZvj6HE.js.map
@@ -1,3 +1,3 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Bs as r,Ds as i,Jo as a,Nc as o,Ts as s,Wo as c,Yo as l,Zo as u,es as d,ls as f,ws as p,xs as ee}from"./utils-DkKLB01I.js";import{Bn as te,Cl as ne,Cn as re,Dl as ie,Dn as ae,El as oe,En as se,Ic as ce,Li as le,Ma as ue,Nn as de,Pc as fe,Pn as pe,R as me,Uc as he,V as ge,Va as _e,Vc as ve,Wn as ye,Zc as be,Zn as xe,_m as m,ac as Se,bm as h,ch as Ce,cl as we,da as Te,ec as Ee,fa as De,gc as Oe,hm as g,id as ke,ir as Ae,jn as je,kc as Me,lh as _,ll as Ne,mc as Pe,mh as Fe,pa as Ie,rr as Le,tr as Re,vc as ze,wc as Be,wl as Ve,yl as He,z as Ue,zi as We}from"./src-R7EkrVcv.js";import{$t as Ge,Dr as Ke,Jr as qe,Sr as Je,T as Ye,Ur as v,Yt as Xe,ui as Ze}from"./runtime-D5AfNyNA.js";import{a as y,t as Qe}from"./relay-aZlRxOWS.js";import{f as b,h as x,m as $e,u as et}from"./server-B2y_yoz_.js";import{i as tt,n as nt,s as rt,t as it}from"./session-Dt_Dt-Og.js";import{t as at}from"./use-atom-command-QDd_NqJQ.js";import{B as ot,C as st,F as ct,N as lt,O as ut,P as dt,S as ft,V as pt,_ as mt,b as ht,c as gt,i as S,n as C,o as _t,r as vt,y as yt}from"./themePalette-B_fGWNEh.js";var w=e(t(),1),T=n();function bt(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function xt(e){let t=u(t=>d(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=Ce(p(n(e.stateAtom(t))),()=>Ze);return{entry:r,connection:r.unsupportedReason===void 0?i===Ze&&r.enabled?{phase:`connecting`,error:null,traceId:null}:Ge(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(f(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:d(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return bt(n,i)||(n=i),n}).pipe(f(`environment-presentations`))}}function St(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:Xe(t.entry)??``,isRelayManaged:qe(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Ct(e){let t=d(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=d(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=u(t=>d(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=St(t,r),a=_(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=d(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=_(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(f(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:d(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=_(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:d(n=>{let r=new Map(n(t).map(t=>[t,ge(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&bt(i,r)?i:r}),pullRequestsSupportedAtom:d(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var E=xt({catalogValueAtom:x.catalogValueAtom,stateAtom:x.stateAtom,serverConfigValueAtom:b.configValueAtom}),D=Ct({catalogValueAtom:x.catalogValueAtom,presentationAtom:E.presentationAtom}),wt=d(null).pipe(f(`web-environment-presentation:empty`));function Tt(e){let t=(0,T.c)(5),n=a(x.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?wt:E.presentationAtom(e),t[0]=e,t[1]=r);let i=a(r),o;return t[2]!==n.isReady||t[3]!==i?(o={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=o):o=t[4],o}var Et={status:`idle`},O=Et,k=null,A=[],j=0,Dt=new Set;function M(e){O=e;for(let e of Dt)e()}function Ot(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function kt(){return O}function At(e){return Dt.add(e),()=>{Dt.delete(e)}}function jt(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Ot(!1),M(Et)))}}function Mt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};k||O.status===`closing`?A.push(r):(k=r,M({status:`confirming`,message:e,variant:r.variant}))})}function Nt(){return O.status!==`idle`||k!==null||A.length>0}function Pt(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function Ft(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Et)}var It={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Lt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return o(t)?`${n.map(e=>It[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Rt=`http://www.w3.org/2000/svg`,zt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-plus":[{tag:`path`,attrs:{d:`M12 10v6`}},{tag:`path`,attrs:{d:`M9 13h6`}},{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],"text-search":[{tag:`path`,attrs:{d:`M21 5H3`}},{tag:`path`,attrs:{d:`M10 12H3`}},{tag:`path`,attrs:{d:`M10 19H3`}},{tag:`circle`,attrs:{cx:`17`,cy:`15`,r:`3`}},{tag:`path`,attrs:{d:`m21 19-1.9-1.9`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Bt(e,t){let n=zt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Rt,`svg`);r.setAttribute(`xmlns`,Rt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Rt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Vt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Ht(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Ut(){return N!==null}function Wt(){N?.(),N=null}function Gt(e,t){return new Promise(n=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;let i=r instanceof HTMLElement?r:null,a=[],s=[],c=!1,l=!1,u=()=>d(null),d=e=>{if(c)return;c=!0,N===u&&(N=null),document.removeEventListener(`keydown`,f),document.removeEventListener(`pointerdown`,p,!0),document.removeEventListener(`contextmenu`,ee,!0);let t=Ht(document.activeElement,a);for(let e of a)e.remove();t&&i?.isConnected&&i.focus({preventScroll:!0}),n(e)},f=e=>{e.key===`Escape`&&(e.preventDefault(),d(null))},p=e=>{l&&!Ht(e.target,a)&&d(null)},ee=e=>{l&&!Ht(e.target,a)&&(e.preventDefault(),d(null))},te=e=>{for(;a.length>e;)s.pop()?.setAttribute(`aria-expanded`,`false`),a.pop()?.remove()},ne=(e,t,n,r,i)=>{te(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),i=document.createElement(`button`);i.type=`button`;let s=t.disabled===!0;i.disabled=s;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(i.className=s?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,i.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(i.style.color=`var(--destructive-foreground)`),s&&(i.style.color=`var(--contrast-muted-foreground)`,i.style.opacity=`0.64`,i.style.pointerEvents=`none`),typeof t.checked==`boolean`){i.setAttribute(`role`,`menuitemradio`),i.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Bt(`check`,`neutral`):null;if(e)i.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),i.appendChild(e)}}else if(typeof t.icon==`string`){let e=Bt(t.icon,n?`destructive`:`neutral`);e&&i.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,i.appendChild(f),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Lt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),i.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,o(navigator.platform)?`Meta`:`Control`)),i.appendChild(e)}if(e){i.setAttribute(`aria-haspopup`,`menu`),i.setAttribute(`aria-expanded`,`false`);let e=Bt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,i.appendChild(e))}if(!s){let o=!1,s=!1,c=()=>{let e=o||s;i.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,i.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(i.addEventListener(`mouseenter`,()=>{i.focus({preventScroll:!0}),o=!0,c()}),i.addEventListener(`mouseleave`,()=>{o=!1,c()}),i.addEventListener(`focus`,()=>{s=!0,c()}),i.addEventListener(`blur`,()=>{s=!1,c()}),e){let e=(e=!1)=>{let n=i.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,i),i.setAttribute(`aria-expanded`,`true`);let c=a[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Vt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};i.addEventListener(`mouseenter`,()=>{e()}),i.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else i.addEventListener(`mouseenter`,()=>{te(r+1)}),i.addEventListener(`click`,()=>{l&&d(t.id)})}u.appendChild(i)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{te(r+1)}),document.body.appendChild(c),a[r]=c,s[r]=i,requestAnimationFrame(()=>{Vt(c,t,n)})};document.addEventListener(`keydown`,f),document.addEventListener(`pointerdown`,p,!0),document.addEventListener(`contextmenu`,ee,!0),ne(e,t?.x??0,t?.y??0,0),N&&N(),N=u,requestAnimationFrame(()=>{l=!0})})}var Kt=`p4code:client-settings:v1`;function qt(){return typeof window<`u`}function Jt(){return qt()?s(Kt,re):null}function Yt(e){qt()&&i(Kt,e,re)}var Xt;function Zt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Mt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`)}else window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Gt(e,t),close:async()=>{window.desktopBridge||Wt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Jt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Yt(e)}}}}function Qt(){return Zt()}function $t(){if(typeof window<`u`)return Xt||(Xt=Qt(),Xt)}function en(){let e=$t();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,tn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function nn(){return I()}function rn(){return typeof window>`u`?{}:an()}function I(){if(typeof window>`u`)return null;try{return ut(window.localStorage.getItem(S))}catch{return null}}function an(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function L(e){return`${e?.light??``}|${e?.dark??``}`}var on=`theme-color`,sn=`meta[name="${on}"][data-dynamic-theme-color="true"]`,R=class extends ze()(`ThemeStorageError`,{operation:Se([`read`,`write`]),storageKey:Pe,theme:be(_t),cause:Ee()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},cn=he(R),ln=class extends ze()(`DesktopThemeSyncError`,{theme:_t,cause:Ee()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},un=he(ln),z=[],B=null,dn=!0,fn=null,V=null,H=null;function U(){dn=!0;for(let e of z)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(tn).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(vt);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function hn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(C);if(hn(e))return e}catch{}return mn(e)?`system`:yt(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(C,e)}catch(e){throw new R({operation:`write`,storageKey:C,cause:e})}}function _n(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new R({operation:`read`,storageKey:P,cause:e})}return e!==null&&st(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),H=null}catch(t){throw new R({operation:`write`,storageKey:P,theme:e,cause:t})}}function G(){if(H!==null)return F.theme;try{return _n()}catch(e){let t=cn(e)?e:new R({operation:`read`,storageKey:P,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),F.theme}}function yn(){let e=document.querySelector(sn);return e||(e=document.createElement(`meta`),e.name=on,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function bn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function xn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Sn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?bn(e.getPropertyValue(`--app-chrome-background`)):null,n=bn(getComputedStyle(xn()).backgroundColor),r=bn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${on}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?pn():!1,o=I();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&L(V.themeHalves)===L(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=dt(e,a,i,r,o);gt(ct(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Sn(),wn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Cn(e,t,n,r,i=I()){try{await e.setTheme(lt(t,n,r,i))}catch(e){throw new ln({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=lt(e,t,n,i);r&&typeof r.setTheme==`function`&&fn!==a&&(fn=a,Cn(r,e,t,n,i).catch(t=>{let n=un(t)?t:new ln({theme:e,cause:t});console.error(n.message,{theme:n.theme,...v(n)}),fn===a&&(fn=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function Tn(){if(typeof window>`u`)return F;if(!dn&&B)return B;dn=!1;let e=G(),t=W(e),n=t===`system`,r=n?pn():!1,i=I(),a=dt(e,r,n,t,i);return B&&B.theme===e&&B.resolvedTheme===a&&B.systemDark===r&&B.followSystem===n&&B.appearanceMode===t&&L(B.themeHalves)===L(i)||(B={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),B}function En(){return F}function Dn(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function On(e){e.key===P?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),ft(),V=null,K(G(),{suppressTransitions:!0}),U())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(z.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(tn):null;e?.addEventListener(`change`,Dn),window.addEventListener(`storage`,On),kn=()=>{e?.removeEventListener(`change`,Dn),window.removeEventListener(`storage`,On)}}return()=>{z=z.filter(t=>t!==e),z.length===0&&(kn?.(),kn=null)}}function jn(){let e=(0,w.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(W(G()));let t=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(S,t)}catch{}throw e}}catch(t){let n=cn(t)?t:new R({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...v(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=cn(e)?e:new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,w.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?yt(t)??`light`:n;return i(r)},[i,t]),o=(0,w.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...an()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(S):window.localStorage.setItem(S,JSON.stringify(n))}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,w.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(S)}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,w.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,w.useEffect)(()=>{K(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Mn=Me(ve(Be)),Nn=ie(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\r\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Mn(t).pipe(ke(e=>e.issue))}),Pn=new He(Nn,oe());Ve().pipe(ne(oe({space:2})));var Fn=e=>Pe.pipe(fe(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:m(15),providerHealthRefreshInterval:g(1),hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:g(2),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:se,providerHealthRefreshInterval:de,hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:g(5),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:m(0),providerHealthRefreshInterval:g(15),hostPowerMonitorActiveInterval:g(1),hostPowerMonitorIdleInterval:g(10),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return In[e]}function Ln(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Rn(e){let t=Ln(e),n=In[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return h(e)===h(t)}function zn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Rn(e),n=[Ln(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(zn(t,In[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Ln(e),i=In[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Vn(e){let t={schemaVersion:1,profile:ae,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||h(e.automaticGitFetchInterval)!==h(se)||h(e.providerHealthRefreshInterval)!==h(de);return Rn(n&&i?{schemaVersion:1,profile:h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)&&h(e.providerHealthRefreshInterval)===h(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...h(e.providerHealthRefreshInterval)===h(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Hn(e){let t=Vn(e);return Bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Un=Fn(Oe({observability:ye.fields.observability}));ce(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?xe(t.instanceId):Ae(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>Te.make(e));function Kn(e,t,n){let i=[...Gn.map(e=>[Ie(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[De.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(i===void 0)return null;let[a,o]=i,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&r(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:We[o]??le[o]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Le(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&me(i)&&Ue(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Le(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&me(e)&&Ue(e))return r}return qn(e,t,n)}new Set(Object.keys(te.fields));function Yn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function Xn(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var Zn=new Set([`continueThreadsAfterServerUpdate`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Qn(e){let t={},n={};for(let[r,i]of Object.entries(e))Zn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function $n(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Ne(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Ne(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig!==null}function tr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:Xe(t.entry),relayManaged:qe(t.entry)}}function nr(){let e=(0,T.c)(7),t=a(x.catalogValueAtom),n=a(x.networkStatusValueAtom),r=a(E.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(rr),e[0]=r,e[1]=i);let o=i,s;return e[2]!==t.isReady||e[3]!==o||e[4]!==n||e[5]!==r?(s={isReady:t.isReady,networkStatus:n,environments:o,presentationById:r},e[2]=t.isReady,e[3]=o,e[4]=n,e[5]=r,e[6]=s):s=e[6],s}function rr(e){let[t,n]=e;return tr(t,n)}function ir(){return a($e)}function ar(e){let t=(0,T.c)(3),{presentation:n}=Tt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:tr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function or(){return ar(ir())}function sr(e){let t=(0,T.c)(2),n=rt(e),r;return t[0]===n?r=t[1]:(r=Fe(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function cr(){return a(Qe.stateValueAtom)}function lr(){return a(D.environmentIdsAtom)}function ur(){return a(D.identitiesAtom)}function dr(){return a(D.pullRequestsSupportedAtom)}function fr(){return a(D.machineByIdAtom)}var pr=`[CLIENT_SETTINGS]`,mr=new Set,hr=new Set,gr=je,Y=`pending`,X=null,_r=0,vr=Promise.resolve(),yr=0;function br(){for(let e of mr)e()}function xr(){for(let e of hr)e()}function Z(){return gr}function Sr(e){gr=e,br()}function Cr(e){Y!==e&&(Y=e,xr())}function wr(e){return mr.add(e),Q().catch(()=>void 0),()=>{mr.delete(e)}}function Tr(){return Y===`ready`}function Er(){return Y}function Dr(e){return hr.add(e),Q().catch(()=>void 0),()=>{hr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=_r;Cr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await en().persistence.getClientSettings();if(e!==_r)return;t&&Sr({...je,...t}),Cr(`ready`)}catch(t){throw e===_r&&Cr(`failed`),console.error(`${pr} hydrate failed`,{operation:`hydrate`,...v(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Or=e=>en().persistence.setClientSettings(e);function kr(e){let t=vr.then(e);return vr=t.then(()=>void 0,()=>void 0),t}function Ar(e,t=Or){let n=Y!==`ready`||yr>0;return n?yr+=1:Sr({...Z(),...e}),kr(async()=>{if(n)try{Y!==`ready`&&await Q(),Sr({...Z(),...e})}finally{--yr}await t(Z())}).catch(e=>{console.error(`${pr} persist failed`,{operation:`persist`,...v(e)})})}async function jr(e,t=Or){return kr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Sr(r),r}})}var Mr=new Set(we(ye.fields));function Nr(e){let t={},n={};for(let[r,i]of Object.entries(e))Mr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Pr(){return Z()}function Fr(){return Q()}function Ir(){return(0,w.useSyncExternalStore)(Dr,Tr,Lr)}function Lr(){return!1}function Rr(){return(0,w.useSyncExternalStore)(Dr,Er,zr)}function zr(){return`pending`}function $(){return(0,w.useSyncExternalStore)(wr,Z,Br)}function Br(){return je}function Vr(e,t){return{...t,...e,...Yn(e,t)}}var Hr=new Set;function Ur(e,t){let n=(0,T.c)(8),r=$(),i=Ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=at(b.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Hr.has(e))return;let n=Xn(t,r);n&&(Hr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Hr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,w.useEffect)(s,c)}function Wr(e,t){let n=(0,T.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=Vr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Gr(e){let t=(0,T.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Kr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function qr(){let e=(0,T.c)(7),t=Ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=jn(),o=(0,w.useSyncExternalStore)(ot,ht,Jr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=ct(i,a,r),l=mt(c);s=Kr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??pt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function Jr(){return null}async function Yr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Fr(),{...Xn(e,Pr()),...t}}function Xr(e){let t=(0,T.c)(6),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=at(b.updateSettings,`model preferences update`),o;return t[2]!==e||t[3]!==i||t[4]!==r?(o=async t=>{if(!e||!r)return;let n;try{n=await Yr(r,t)}catch{y.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=o):o=t[5],o}function Zr(e){let t=(0,w.use)(l),n=(0,w.useRef)(new Map),r=Xr(e);return(0,w.useCallback)(async(i,a)=>{if(!e)return;let o=b.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Fr()}catch{y.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=Yn(c,Pr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&ee(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var Qr=d(null);function $r(e){let t=(0,T.c)(5),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=$();Ur(e,r);let o=r??pe,s;return t[2]!==i||t[3]!==o?(s=Yn(o,i),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function ei(e,t){let n=(0,T.c)(2),r;n[0]===e?r=n[1]:(r=b.settingsValueAtom(e),n[0]=e,n[1]=r);let i=a(r);return Ur(e,i),Wr(i??pe,t)}function ti(e){let t=(0,T.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=at(b.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ni(e){let t=or(),n=a(et);return Ur(t?.environmentId??null,t?.serverConfig?.settings??null),Wr(n,e)}var ri=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ii(){let e=(0,T.c)(2),t=or(),n;return e[0]===t?n=e[1]:(n=t!==null||!Ye(),e[0]=t,e[1]=n),n}function ai(e){let t=(0,T.c)(3),n=e!==void 0&&e,{environments:r}=nr(),i;return t[0]!==r||t[1]!==n?(i=d(e=>r.filter(er).flatMap(t=>{let r=e(it.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(p(r));return i!==null&&_e(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],a(i)}function oi(e){let t=(0,T.c)(10);tt(e,ue);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=at(b.updateSettings,n),{environments:i}=nr(),a;t[1]!==i||t[2]!==r?(a=async(e,t)=>{let n=await r(e);if(n._tag===`Failure`&&t?.(),n._tag===`Failure`&&!Je(n)){let t=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ke(n);y.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return n},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ai(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(l=(t,n)=>{let{serverPatch:a,clientPatch:l}=Nr(t),u=e===null||Re(a).every(t=>nt(e,t));if(Object.keys(a).length>0&&!u&&(n?.onFailed?.(),y.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`})),Object.keys(a).length>0&&u){let{sharedPatch:t,localPatch:l}=Qn(a),u=e=>{let t=e===void 0?ri:e;return n?.onFailed?.(),y.add({type:`warning`,title:`Setting not saved`,description:t})};if(Object.keys(l).length>0&&(e?o({environmentId:e,input:{patch:l}},n?.onFailed):u()),Object.keys(t).length>0){let a=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(s);e&&o.add(e);let l=[],d=[];for(let n of o){let r=i.find(e=>e.environmentId===n),o=$n(t,r?.serverConfig?.environment.capabilities,r?.serverConfig?.settings,a,n===e);Object.keys(o).length!==0&&(c.get(it.sessionStateAtom(n))._tag!==`Initial`&&!Re(t).every(e=>nt(n,e))?d.push(r?.label??n):l.push({environmentId:n,input:{patch:o}}))}l.length===0?u(d.length>0?`This connection lacks permission to change settings on ${d.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(l.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(e=>{(d.length>0||e.some(ui))&&n?.onFailed?.();let t=e.flatMap(li);if(t.length===0)return;let r=e.filter(ci).map(si);y.add({type:`error`,title:r.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...r.length>0?[`Saved on ${r.join(`, `)}.`]:[]].join(`
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Bs as r,Ds as i,Jo as a,Nc as o,Ts as s,Wo as c,Yo as l,Zo as u,es as d,ls as f,ws as p,xs as ee}from"./utils-DkKLB01I.js";import{Bn as te,Cl as ne,Cn as re,Dl as ie,Dn as ae,El as oe,En as se,Ic as ce,Li as le,Ma as ue,Nn as de,Pc as fe,Pn as pe,R as me,Uc as he,V as ge,Va as _e,Vc as ve,Wn as ye,Zc as be,Zn as xe,_m as m,ac as Se,bm as h,ch as Ce,cl as we,da as Te,ec as Ee,fa as De,gc as Oe,hm as g,id as ke,ir as Ae,jn as je,kc as Me,lh as _,ll as Ne,mc as Pe,mh as Fe,pa as Ie,rr as Le,tr as Re,vc as ze,wc as Be,wl as Ve,yl as He,z as Ue,zi as We}from"./src-R7EkrVcv.js";import{$t as Ge,Dr as Ke,Jr as qe,Sr as Je,T as Ye,Ur as v,Yt as Xe,ui as Ze}from"./runtime-B92ivG9b.js";import{a as y,t as Qe}from"./relay-V_5ApBIP.js";import{f as b,h as x,m as $e,u as et}from"./server-GB5fRm03.js";import{i as tt,n as nt,s as rt,t as it}from"./session-CFzb2gMH.js";import{t as at}from"./use-atom-command-Bd7vZxeH.js";import{B as ot,C as st,F as ct,N as lt,O as ut,P as dt,S as ft,V as pt,_ as mt,b as ht,c as gt,i as S,n as C,o as _t,r as vt,y as yt}from"./themePalette-B_fGWNEh.js";var w=e(t(),1),T=n();function bt(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function xt(e){let t=u(t=>d(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=Ce(p(n(e.stateAtom(t))),()=>Ze);return{entry:r,connection:r.unsupportedReason===void 0?i===Ze&&r.enabled?{phase:`connecting`,error:null,traceId:null}:Ge(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(f(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:d(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return bt(n,i)||(n=i),n}).pipe(f(`environment-presentations`))}}function St(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:Xe(t.entry)??``,isRelayManaged:qe(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Ct(e){let t=d(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=d(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=u(t=>d(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=St(t,r),a=_(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=d(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=_(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(f(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:d(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=_(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:d(n=>{let r=new Map(n(t).map(t=>[t,ge(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&bt(i,r)?i:r}),pullRequestsSupportedAtom:d(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var E=xt({catalogValueAtom:x.catalogValueAtom,stateAtom:x.stateAtom,serverConfigValueAtom:b.configValueAtom}),D=Ct({catalogValueAtom:x.catalogValueAtom,presentationAtom:E.presentationAtom}),wt=d(null).pipe(f(`web-environment-presentation:empty`));function Tt(e){let t=(0,T.c)(5),n=a(x.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?wt:E.presentationAtom(e),t[0]=e,t[1]=r);let i=a(r),o;return t[2]!==n.isReady||t[3]!==i?(o={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=o):o=t[4],o}var Et={status:`idle`},O=Et,k=null,A=[],j=0,Dt=new Set;function M(e){O=e;for(let e of Dt)e()}function Ot(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function kt(){return O}function At(e){return Dt.add(e),()=>{Dt.delete(e)}}function jt(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Ot(!1),M(Et)))}}function Mt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};k||O.status===`closing`?A.push(r):(k=r,M({status:`confirming`,message:e,variant:r.variant}))})}function Nt(){return O.status!==`idle`||k!==null||A.length>0}function Pt(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function Ft(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Et)}var It={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Lt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return o(t)?`${n.map(e=>It[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Rt=`http://www.w3.org/2000/svg`,zt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-plus":[{tag:`path`,attrs:{d:`M12 10v6`}},{tag:`path`,attrs:{d:`M9 13h6`}},{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],"text-search":[{tag:`path`,attrs:{d:`M21 5H3`}},{tag:`path`,attrs:{d:`M10 12H3`}},{tag:`path`,attrs:{d:`M10 19H3`}},{tag:`circle`,attrs:{cx:`17`,cy:`15`,r:`3`}},{tag:`path`,attrs:{d:`m21 19-1.9-1.9`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Bt(e,t){let n=zt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Rt,`svg`);r.setAttribute(`xmlns`,Rt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Rt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Vt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Ht(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Ut(){return N!==null}function Wt(){N?.(),N=null}function Gt(e,t){return new Promise(n=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;let i=r instanceof HTMLElement?r:null,a=[],s=[],c=!1,l=!1,u=()=>d(null),d=e=>{if(c)return;c=!0,N===u&&(N=null),document.removeEventListener(`keydown`,f),document.removeEventListener(`pointerdown`,p,!0),document.removeEventListener(`contextmenu`,ee,!0);let t=Ht(document.activeElement,a);for(let e of a)e.remove();t&&i?.isConnected&&i.focus({preventScroll:!0}),n(e)},f=e=>{e.key===`Escape`&&(e.preventDefault(),d(null))},p=e=>{l&&!Ht(e.target,a)&&d(null)},ee=e=>{l&&!Ht(e.target,a)&&(e.preventDefault(),d(null))},te=e=>{for(;a.length>e;)s.pop()?.setAttribute(`aria-expanded`,`false`),a.pop()?.remove()},ne=(e,t,n,r,i)=>{te(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),i=document.createElement(`button`);i.type=`button`;let s=t.disabled===!0;i.disabled=s;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(i.className=s?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,i.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(i.style.color=`var(--destructive-foreground)`),s&&(i.style.color=`var(--contrast-muted-foreground)`,i.style.opacity=`0.64`,i.style.pointerEvents=`none`),typeof t.checked==`boolean`){i.setAttribute(`role`,`menuitemradio`),i.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Bt(`check`,`neutral`):null;if(e)i.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),i.appendChild(e)}}else if(typeof t.icon==`string`){let e=Bt(t.icon,n?`destructive`:`neutral`);e&&i.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,i.appendChild(f),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Lt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),i.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,o(navigator.platform)?`Meta`:`Control`)),i.appendChild(e)}if(e){i.setAttribute(`aria-haspopup`,`menu`),i.setAttribute(`aria-expanded`,`false`);let e=Bt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,i.appendChild(e))}if(!s){let o=!1,s=!1,c=()=>{let e=o||s;i.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,i.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(i.addEventListener(`mouseenter`,()=>{i.focus({preventScroll:!0}),o=!0,c()}),i.addEventListener(`mouseleave`,()=>{o=!1,c()}),i.addEventListener(`focus`,()=>{s=!0,c()}),i.addEventListener(`blur`,()=>{s=!1,c()}),e){let e=(e=!1)=>{let n=i.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,i),i.setAttribute(`aria-expanded`,`true`);let c=a[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Vt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};i.addEventListener(`mouseenter`,()=>{e()}),i.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else i.addEventListener(`mouseenter`,()=>{te(r+1)}),i.addEventListener(`click`,()=>{l&&d(t.id)})}u.appendChild(i)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{te(r+1)}),document.body.appendChild(c),a[r]=c,s[r]=i,requestAnimationFrame(()=>{Vt(c,t,n)})};document.addEventListener(`keydown`,f),document.addEventListener(`pointerdown`,p,!0),document.addEventListener(`contextmenu`,ee,!0),ne(e,t?.x??0,t?.y??0,0),N&&N(),N=u,requestAnimationFrame(()=>{l=!0})})}var Kt=`p4code:client-settings:v1`;function qt(){return typeof window<`u`}function Jt(){return qt()?s(Kt,re):null}function Yt(e){qt()&&i(Kt,e,re)}var Xt;function Zt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Mt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`)}else window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Gt(e,t),close:async()=>{window.desktopBridge||Wt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Jt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Yt(e)}}}}function Qt(){return Zt()}function $t(){if(typeof window<`u`)return Xt||(Xt=Qt(),Xt)}function en(){let e=$t();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,tn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function nn(){return I()}function rn(){return typeof window>`u`?{}:an()}function I(){if(typeof window>`u`)return null;try{return ut(window.localStorage.getItem(S))}catch{return null}}function an(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function L(e){return`${e?.light??``}|${e?.dark??``}`}var on=`theme-color`,sn=`meta[name="${on}"][data-dynamic-theme-color="true"]`,R=class extends ze()(`ThemeStorageError`,{operation:Se([`read`,`write`]),storageKey:Pe,theme:be(_t),cause:Ee()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},cn=he(R),ln=class extends ze()(`DesktopThemeSyncError`,{theme:_t,cause:Ee()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},un=he(ln),z=[],B=null,dn=!0,fn=null,V=null,H=null;function U(){dn=!0;for(let e of z)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(tn).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(vt);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function hn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(C);if(hn(e))return e}catch{}return mn(e)?`system`:yt(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(C,e)}catch(e){throw new R({operation:`write`,storageKey:C,cause:e})}}function _n(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new R({operation:`read`,storageKey:P,cause:e})}return e!==null&&st(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),H=null}catch(t){throw new R({operation:`write`,storageKey:P,theme:e,cause:t})}}function G(){if(H!==null)return F.theme;try{return _n()}catch(e){let t=cn(e)?e:new R({operation:`read`,storageKey:P,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),F.theme}}function yn(){let e=document.querySelector(sn);return e||(e=document.createElement(`meta`),e.name=on,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function bn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function xn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Sn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?bn(e.getPropertyValue(`--app-chrome-background`)):null,n=bn(getComputedStyle(xn()).backgroundColor),r=bn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${on}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?pn():!1,o=I();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&L(V.themeHalves)===L(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=dt(e,a,i,r,o);gt(ct(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Sn(),wn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Cn(e,t,n,r,i=I()){try{await e.setTheme(lt(t,n,r,i))}catch(e){throw new ln({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=lt(e,t,n,i);r&&typeof r.setTheme==`function`&&fn!==a&&(fn=a,Cn(r,e,t,n,i).catch(t=>{let n=un(t)?t:new ln({theme:e,cause:t});console.error(n.message,{theme:n.theme,...v(n)}),fn===a&&(fn=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function Tn(){if(typeof window>`u`)return F;if(!dn&&B)return B;dn=!1;let e=G(),t=W(e),n=t===`system`,r=n?pn():!1,i=I(),a=dt(e,r,n,t,i);return B&&B.theme===e&&B.resolvedTheme===a&&B.systemDark===r&&B.followSystem===n&&B.appearanceMode===t&&L(B.themeHalves)===L(i)||(B={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),B}function En(){return F}function Dn(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function On(e){e.key===P?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),ft(),V=null,K(G(),{suppressTransitions:!0}),U())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(z.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(tn):null;e?.addEventListener(`change`,Dn),window.addEventListener(`storage`,On),kn=()=>{e?.removeEventListener(`change`,Dn),window.removeEventListener(`storage`,On)}}return()=>{z=z.filter(t=>t!==e),z.length===0&&(kn?.(),kn=null)}}function jn(){let e=(0,w.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(W(G()));let t=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(S,t)}catch{}throw e}}catch(t){let n=cn(t)?t:new R({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...v(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=cn(e)?e:new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,w.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?yt(t)??`light`:n;return i(r)},[i,t]),o=(0,w.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...an()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(S):window.localStorage.setItem(S,JSON.stringify(n))}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,w.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(S)}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,w.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,w.useEffect)(()=>{K(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Mn=Me(ve(Be)),Nn=ie(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\r\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Mn(t).pipe(ke(e=>e.issue))}),Pn=new He(Nn,oe());Ve().pipe(ne(oe({space:2})));var Fn=e=>Pe.pipe(fe(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:m(15),providerHealthRefreshInterval:g(1),hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:g(2),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:se,providerHealthRefreshInterval:de,hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:g(5),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:m(0),providerHealthRefreshInterval:g(15),hostPowerMonitorActiveInterval:g(1),hostPowerMonitorIdleInterval:g(10),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return In[e]}function Ln(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Rn(e){let t=Ln(e),n=In[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return h(e)===h(t)}function zn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Rn(e),n=[Ln(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(zn(t,In[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Ln(e),i=In[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Vn(e){let t={schemaVersion:1,profile:ae,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||h(e.automaticGitFetchInterval)!==h(se)||h(e.providerHealthRefreshInterval)!==h(de);return Rn(n&&i?{schemaVersion:1,profile:h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)&&h(e.providerHealthRefreshInterval)===h(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...h(e.providerHealthRefreshInterval)===h(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Hn(e){let t=Vn(e);return Bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Un=Fn(Oe({observability:ye.fields.observability}));ce(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?xe(t.instanceId):Ae(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>Te.make(e));function Kn(e,t,n){let i=[...Gn.map(e=>[Ie(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[De.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(i===void 0)return null;let[a,o]=i,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&r(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:We[o]??le[o]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Le(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&me(i)&&Ue(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Le(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&me(e)&&Ue(e))return r}return qn(e,t,n)}new Set(Object.keys(te.fields));function Yn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function Xn(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var Zn=new Set([`continueThreadsAfterServerUpdate`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Qn(e){let t={},n={};for(let[r,i]of Object.entries(e))Zn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function $n(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Ne(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Ne(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig!==null}function tr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:Xe(t.entry),relayManaged:qe(t.entry)}}function nr(){let e=(0,T.c)(7),t=a(x.catalogValueAtom),n=a(x.networkStatusValueAtom),r=a(E.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(rr),e[0]=r,e[1]=i);let o=i,s;return e[2]!==t.isReady||e[3]!==o||e[4]!==n||e[5]!==r?(s={isReady:t.isReady,networkStatus:n,environments:o,presentationById:r},e[2]=t.isReady,e[3]=o,e[4]=n,e[5]=r,e[6]=s):s=e[6],s}function rr(e){let[t,n]=e;return tr(t,n)}function ir(){return a($e)}function ar(e){let t=(0,T.c)(3),{presentation:n}=Tt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:tr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function or(){return ar(ir())}function sr(e){let t=(0,T.c)(2),n=rt(e),r;return t[0]===n?r=t[1]:(r=Fe(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function cr(){return a(Qe.stateValueAtom)}function lr(){return a(D.environmentIdsAtom)}function ur(){return a(D.identitiesAtom)}function dr(){return a(D.pullRequestsSupportedAtom)}function fr(){return a(D.machineByIdAtom)}var pr=`[CLIENT_SETTINGS]`,mr=new Set,hr=new Set,gr=je,Y=`pending`,X=null,_r=0,vr=Promise.resolve(),yr=0;function br(){for(let e of mr)e()}function xr(){for(let e of hr)e()}function Z(){return gr}function Sr(e){gr=e,br()}function Cr(e){Y!==e&&(Y=e,xr())}function wr(e){return mr.add(e),Q().catch(()=>void 0),()=>{mr.delete(e)}}function Tr(){return Y===`ready`}function Er(){return Y}function Dr(e){return hr.add(e),Q().catch(()=>void 0),()=>{hr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=_r;Cr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await en().persistence.getClientSettings();if(e!==_r)return;t&&Sr({...je,...t}),Cr(`ready`)}catch(t){throw e===_r&&Cr(`failed`),console.error(`${pr} hydrate failed`,{operation:`hydrate`,...v(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Or=e=>en().persistence.setClientSettings(e);function kr(e){let t=vr.then(e);return vr=t.then(()=>void 0,()=>void 0),t}function Ar(e,t=Or){let n=Y!==`ready`||yr>0;return n?yr+=1:Sr({...Z(),...e}),kr(async()=>{if(n)try{Y!==`ready`&&await Q(),Sr({...Z(),...e})}finally{--yr}await t(Z())}).catch(e=>{console.error(`${pr} persist failed`,{operation:`persist`,...v(e)})})}async function jr(e,t=Or){return kr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Sr(r),r}})}var Mr=new Set(we(ye.fields));function Nr(e){let t={},n={};for(let[r,i]of Object.entries(e))Mr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Pr(){return Z()}function Fr(){return Q()}function Ir(){return(0,w.useSyncExternalStore)(Dr,Tr,Lr)}function Lr(){return!1}function Rr(){return(0,w.useSyncExternalStore)(Dr,Er,zr)}function zr(){return`pending`}function $(){return(0,w.useSyncExternalStore)(wr,Z,Br)}function Br(){return je}function Vr(e,t){return{...t,...e,...Yn(e,t)}}var Hr=new Set;function Ur(e,t){let n=(0,T.c)(8),r=$(),i=Ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=at(b.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Hr.has(e))return;let n=Xn(t,r);n&&(Hr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Hr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,w.useEffect)(s,c)}function Wr(e,t){let n=(0,T.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=Vr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Gr(e){let t=(0,T.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Kr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function qr(){let e=(0,T.c)(7),t=Ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=jn(),o=(0,w.useSyncExternalStore)(ot,ht,Jr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=ct(i,a,r),l=mt(c);s=Kr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??pt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function Jr(){return null}async function Yr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Fr(),{...Xn(e,Pr()),...t}}function Xr(e){let t=(0,T.c)(6),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=at(b.updateSettings,`model preferences update`),o;return t[2]!==e||t[3]!==i||t[4]!==r?(o=async t=>{if(!e||!r)return;let n;try{n=await Yr(r,t)}catch{y.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=o):o=t[5],o}function Zr(e){let t=(0,w.use)(l),n=(0,w.useRef)(new Map),r=Xr(e);return(0,w.useCallback)(async(i,a)=>{if(!e)return;let o=b.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Fr()}catch{y.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=Yn(c,Pr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&ee(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var Qr=d(null);function $r(e){let t=(0,T.c)(5),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=$();Ur(e,r);let o=r??pe,s;return t[2]!==i||t[3]!==o?(s=Yn(o,i),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function ei(e,t){let n=(0,T.c)(2),r;n[0]===e?r=n[1]:(r=b.settingsValueAtom(e),n[0]=e,n[1]=r);let i=a(r);return Ur(e,i),Wr(i??pe,t)}function ti(e){let t=(0,T.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=at(b.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ni(e){let t=or(),n=a(et);return Ur(t?.environmentId??null,t?.serverConfig?.settings??null),Wr(n,e)}var ri=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ii(){let e=(0,T.c)(2),t=or(),n;return e[0]===t?n=e[1]:(n=t!==null||!Ye(),e[0]=t,e[1]=n),n}function ai(e){let t=(0,T.c)(3),n=e!==void 0&&e,{environments:r}=nr(),i;return t[0]!==r||t[1]!==n?(i=d(e=>r.filter(er).flatMap(t=>{let r=e(it.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(p(r));return i!==null&&_e(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],a(i)}function oi(e){let t=(0,T.c)(10);tt(e,ue);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=at(b.updateSettings,n),{environments:i}=nr(),a;t[1]!==i||t[2]!==r?(a=async(e,t)=>{let n=await r(e);if(n._tag===`Failure`&&t?.(),n._tag===`Failure`&&!Je(n)){let t=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ke(n);y.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return n},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ai(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(l=(t,n)=>{let{serverPatch:a,clientPatch:l}=Nr(t),u=e===null||Re(a).every(t=>nt(e,t));if(Object.keys(a).length>0&&!u&&(n?.onFailed?.(),y.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`})),Object.keys(a).length>0&&u){let{sharedPatch:t,localPatch:l}=Qn(a),u=e=>{let t=e===void 0?ri:e;return n?.onFailed?.(),y.add({type:`warning`,title:`Setting not saved`,description:t})};if(Object.keys(l).length>0&&(e?o({environmentId:e,input:{patch:l}},n?.onFailed):u()),Object.keys(t).length>0){let a=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(s);e&&o.add(e);let l=[],d=[];for(let n of o){let r=i.find(e=>e.environmentId===n),o=$n(t,r?.serverConfig?.environment.capabilities,r?.serverConfig?.settings,a,n===e);Object.keys(o).length!==0&&(c.get(it.sessionStateAtom(n))._tag!==`Initial`&&!Re(t).every(e=>nt(n,e))?d.push(r?.label??n):l.push({environmentId:n,input:{patch:o}}))}l.length===0?u(d.length>0?`This connection lacks permission to change settings on ${d.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(l.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(e=>{(d.length>0||e.some(ui))&&n?.onFailed?.();let t=e.flatMap(li);if(t.length===0)return;let r=e.filter(ci).map(si);y.add({type:`error`,title:r.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...r.length>0?[`Saved on ${r.join(`, `)}.`]:[]].join(`
2
2
  `)})})}}Object.keys(l).length>0&&Ar(l)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=l):l=t[9],l}function si(e){let{label:t}=e;return t}function ci(e){let{result:t}=e;return t._tag===`Success`}function li(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Je(n))return[];let r=Ke(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function ui(e){let{result:t}=e;return t._tag===`Failure`}function di(e){return oi(e)}function fi(){return oi(or()?.environmentId??null)}function pi(){return mi}function mi(e){return Ar(e)}export{jt as $,dr as A,Fn as B,sr as C,nr as D,fr as E,Ln as F,Sn as G,nn as H,q as I,$t as J,jn as K,Bn as L,Kn as M,Jn as N,or as O,qn as P,kt as Q,Hn as R,ar as S,lr as T,rn as U,W as V,_n as W,Ft as X,Ut as Y,Nt as Z,Zr as _,Ar as a,Tt as at,di as b,Ir as c,$r as d,Mt as et,ei as f,ii as g,ni as h,Vr as i,D as it,cr as j,ir as k,Rr as l,ti as m,Fr as n,At as nt,jr as o,Ur as p,en as q,Pr as r,E as rt,Gr as s,ri as t,Pt as tt,qr as u,pi as v,ur as w,fi as x,Xr as y,Vn as z};
3
- //# sourceMappingURL=useSettings-BJR7Rf97.js.map
3
+ //# sourceMappingURL=useSettings-Dp9RSL-0.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{$o as t,Zo as n,es as r,ls as i}from"./utils-DkKLB01I.js";import{Pu as a,Sa as o,Va as s,Wd as c,Wu as l,_f as u,_h as d,au as f,cd as p,cf as m,ch as ee,ed as h,gf as g,gu as _,hf as v,ju as y,mf as te,n as ne,of as b,ou as x,qd as S,qp as C,rf as w,su as T,uu as E,vp as D,wu as O}from"./src-R7EkrVcv.js";import{Ur as k,_r as A,ai as j,pr as M,t as N}from"./runtime-D5AfNyNA.js";import{Z as P,at as F,et as I,nt as L,rt as R,tt as z}from"./entities-iVR9hStG.js";import{at as B}from"./useSettings-BJR7Rf97.js";import{t as re}from"./session-Dt_Dt-Og.js";import{n as V}from"./query-CeIgbVxh.js";var H=e(),U=`~effect/PartitionedSemaphore`,W=e=>{let t=Math.max(0,e.permits);if(!Number.isFinite(t))return{[U]:U,capacity:t,available:c(t),take:()=>b,release:()=>c(t),withPermits:()=>e=>e,withPermit:()=>e=>e,withPermitsIfAvailable:()=>e=>T(e)};let n=t,r=0,i=te(),a=i[Symbol.iterator](),o=!1,s=0,l=e=>{if(e>0&&(s+=e),!o){o=!0;try{for(;s>0&&r>0;){let e=a.next();if(e.done&&(a=i[Symbol.iterator](),e=a.next(),e.done))break;let t=e.value[1].values().next().value;t!==void 0&&(--t.permits,--r,--s,t.permits===0&&t.resume())}}finally{o=!1}}return r===0&&(n=Math.min(t,n+s),s=0),n},f=(e,a)=>a<=0?b:t<a?p:m(t=>n>=a?(n-=a,C(t,e=>{D(e)&&l(a)}),b):E(t=>{if(n>=a){t(f(e,a));return}let o=a-n;n>0&&(n=0),r+=o;let s=ee(v(i,e),()=>{let t=new Set;return u(i,e,t),t}),c={permits:o,resume:()=>{d(),t(b)}},d=()=>{s.delete(c)&&s.size===0&&g(i,e)};return s.add(c),S(()=>{d(),r-=c.permits,l(a-c.permits)})})),h=(e,t)=>n=>{if(t<=0)return n;let r=f(e,t);return w(e=>y(e(r),()=>O(e(n),S(()=>{l(t)}))))},_=e=>e<=0?!0:t<e||n<e?!1:(n-=e,!0);return{[U]:U,capacity:t,available:S(()=>n),take:f,release:e=>S(()=>l(e)),withPermits:h,withPermit:e=>h(e,1),withPermitsIfAvailable:e=>t=>e<=0?T(t):m(n=>_(e)?(C(n,()=>{l(e)}),T(t)):c(d()))}},G=5e3;function K(e){if(e.sessionError!==null)return{canReadFiles:!1,isPending:!1,error:e.sessionError};if(e.session===null){let t=!e.isCatalogReady||e.connection?.phase===`connected`||e.connection?.phase===`connecting`||e.connection?.phase===`reconnecting`;return{canReadFiles:!1,isPending:t,error:t?null:e.connection?.error??`This environment is not connected.`}}return{canReadFiles:s(e.session,o),isPending:!1,error:null}}function q(e,t=``,n=!0){let r=n&&F(e,t),i=r?I(e):``;return{isBrowsing:r,directoryPath:i,filterQuery:r&&!R(e)?z(e):``,parentPath:r?L(i):null,canBrowseUp:r&&P(i)}}function J(e,t){let n=t.toLowerCase(),r=t.startsWith(`.`),i=e.filter(e=>e.name.toLowerCase().startsWith(n)&&(r||!e.name.startsWith(`.`)));return{visibleEntries:i,exactEntry:t.length>0?i.find(e=>e.name===t)??null:null}}function Y(e,t){let[n,...r]=e;if(n===void 0)return null;if(r.length===0)return{name:n.name,isComplete:!0};let i=Array.from(n.name);for(let e of r){let t=Array.from(e.name),n=0;for(;n<i.length&&i[n]?.toLowerCase()===t[n]?.toLowerCase();)n+=1;i=i.slice(0,n)}let a=i.join(``),o=a.toLowerCase();return o.length>t.toLowerCase().length&&e.every(e=>e.name.toLowerCase().startsWith(o))?{name:a,isComplete:!1}:null}function X(){let e=0;return{invalidate:()=>{e+=1},run:async(t,n)=>{let r=++e;return await t(),r===e&&(n(),!0)}}}function ie(e){return e===`connected`}function ae(e){return{browse:A(e,{label:`environment-data:filesystem:browse`,tag:ne.filesystemBrowse,idleTtlMs:G})}}var oe=ae(N);function se(e){let t=(0,H.c)(7),n;t[0]===e?n=t[1]:(n=e===null?null:re.sessionStateAtom(e),t[0]=e,t[1]=n);let r=V(n),i=B(e),a=i.presentation?.connection??null,o;return t[2]!==i.isReady||t[3]!==r.data||t[4]!==r.error||t[5]!==a?(o=K({isCatalogReady:i.isReady,connection:a,session:r.data,sessionError:r.error}),t[2]=i.isReady,t[3]=r.data,t[4]=r.error,t[5]=a,t[6]=o):o=t[6],o}var ce=M(),Z={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd])},le=n(e=>r({revision:0,persistedCacheReadable:!0}).pipe(t,i(`environment-data:vcs:list-refs-state:${e}`))),ue=W({permits:1});function Q(e){return le(e.environmentId)}function de(e,t,n){e.update(Q(t),e=>({revision:e.revision+1,persistedCacheReadable:n??e.persistedCacheReadable}))}function $(e,t){return ue.withPermit(e)(t)}var fe=a(`VcsRefsState.invalidateCached`)(function*(e,t){let n=yield*j;yield*$(t.environmentId,l(function*(){de(e,t,yield*n.clearVcsRefs(t.environmentId).pipe(x(!0),_(e=>h(`Could not remove invalidated cached Git refs.`).pipe(f({environmentId:t.environmentId,cwd:t.cwd,...k(e)}),x(!1)))))}))});export{ce as a,ie as c,q as d,Y as f,Z as i,X as l,Q as n,oe as o,$ as r,se as s,fe as t,J as u};
2
- //# sourceMappingURL=vcsRefInvalidation-Bnup-5J0.js.map
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{$o as t,Zo as n,es as r,ls as i}from"./utils-DkKLB01I.js";import{Pu as a,Sa as o,Va as s,Wd as c,Wu as l,_f as u,_h as d,au as f,cd as p,cf as m,ch as ee,ed as h,gf as g,gu as _,hf as v,ju as y,mf as te,n as ne,of as b,ou as x,qd as S,qp as C,rf as w,su as T,uu as E,vp as D,wu as O}from"./src-R7EkrVcv.js";import{Ur as k,_r as A,ai as j,pr as M,t as N}from"./runtime-B92ivG9b.js";import{Z as P,at as F,et as I,nt as L,rt as R,tt as z}from"./entities-s42SFcbu.js";import{at as B}from"./useSettings-Dp9RSL-0.js";import{t as re}from"./session-CFzb2gMH.js";import{n as V}from"./query-CeIgbVxh.js";var H=e(),U=`~effect/PartitionedSemaphore`,W=e=>{let t=Math.max(0,e.permits);if(!Number.isFinite(t))return{[U]:U,capacity:t,available:c(t),take:()=>b,release:()=>c(t),withPermits:()=>e=>e,withPermit:()=>e=>e,withPermitsIfAvailable:()=>e=>T(e)};let n=t,r=0,i=te(),a=i[Symbol.iterator](),o=!1,s=0,l=e=>{if(e>0&&(s+=e),!o){o=!0;try{for(;s>0&&r>0;){let e=a.next();if(e.done&&(a=i[Symbol.iterator](),e=a.next(),e.done))break;let t=e.value[1].values().next().value;t!==void 0&&(--t.permits,--r,--s,t.permits===0&&t.resume())}}finally{o=!1}}return r===0&&(n=Math.min(t,n+s),s=0),n},f=(e,a)=>a<=0?b:t<a?p:m(t=>n>=a?(n-=a,C(t,e=>{D(e)&&l(a)}),b):E(t=>{if(n>=a){t(f(e,a));return}let o=a-n;n>0&&(n=0),r+=o;let s=ee(v(i,e),()=>{let t=new Set;return u(i,e,t),t}),c={permits:o,resume:()=>{d(),t(b)}},d=()=>{s.delete(c)&&s.size===0&&g(i,e)};return s.add(c),S(()=>{d(),r-=c.permits,l(a-c.permits)})})),h=(e,t)=>n=>{if(t<=0)return n;let r=f(e,t);return w(e=>y(e(r),()=>O(e(n),S(()=>{l(t)}))))},_=e=>e<=0?!0:t<e||n<e?!1:(n-=e,!0);return{[U]:U,capacity:t,available:S(()=>n),take:f,release:e=>S(()=>l(e)),withPermits:h,withPermit:e=>h(e,1),withPermitsIfAvailable:e=>t=>e<=0?T(t):m(n=>_(e)?(C(n,()=>{l(e)}),T(t)):c(d()))}},G=5e3;function K(e){if(e.sessionError!==null)return{canReadFiles:!1,isPending:!1,error:e.sessionError};if(e.session===null){let t=!e.isCatalogReady||e.connection?.phase===`connected`||e.connection?.phase===`connecting`||e.connection?.phase===`reconnecting`;return{canReadFiles:!1,isPending:t,error:t?null:e.connection?.error??`This environment is not connected.`}}return{canReadFiles:s(e.session,o),isPending:!1,error:null}}function q(e,t=``,n=!0){let r=n&&F(e,t),i=r?I(e):``;return{isBrowsing:r,directoryPath:i,filterQuery:r&&!R(e)?z(e):``,parentPath:r?L(i):null,canBrowseUp:r&&P(i)}}function J(e,t){let n=t.toLowerCase(),r=t.startsWith(`.`),i=e.filter(e=>e.name.toLowerCase().startsWith(n)&&(r||!e.name.startsWith(`.`)));return{visibleEntries:i,exactEntry:t.length>0?i.find(e=>e.name===t)??null:null}}function Y(e,t){let[n,...r]=e;if(n===void 0)return null;if(r.length===0)return{name:n.name,isComplete:!0};let i=Array.from(n.name);for(let e of r){let t=Array.from(e.name),n=0;for(;n<i.length&&i[n]?.toLowerCase()===t[n]?.toLowerCase();)n+=1;i=i.slice(0,n)}let a=i.join(``),o=a.toLowerCase();return o.length>t.toLowerCase().length&&e.every(e=>e.name.toLowerCase().startsWith(o))?{name:a,isComplete:!1}:null}function X(){let e=0;return{invalidate:()=>{e+=1},run:async(t,n)=>{let r=++e;return await t(),r===e&&(n(),!0)}}}function ie(e){return e===`connected`}function ae(e){return{browse:A(e,{label:`environment-data:filesystem:browse`,tag:ne.filesystemBrowse,idleTtlMs:G})}}var oe=ae(N);function se(e){let t=(0,H.c)(7),n;t[0]===e?n=t[1]:(n=e===null?null:re.sessionStateAtom(e),t[0]=e,t[1]=n);let r=V(n),i=B(e),a=i.presentation?.connection??null,o;return t[2]!==i.isReady||t[3]!==r.data||t[4]!==r.error||t[5]!==a?(o=K({isCatalogReady:i.isReady,connection:a,session:r.data,sessionError:r.error}),t[2]=i.isReady,t[3]=r.data,t[4]=r.error,t[5]=a,t[6]=o):o=t[6],o}var ce=M(),Z={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd])},le=n(e=>r({revision:0,persistedCacheReadable:!0}).pipe(t,i(`environment-data:vcs:list-refs-state:${e}`))),ue=W({permits:1});function Q(e){return le(e.environmentId)}function de(e,t,n){e.update(Q(t),e=>({revision:e.revision+1,persistedCacheReadable:n??e.persistedCacheReadable}))}function $(e,t){return ue.withPermit(e)(t)}var fe=a(`VcsRefsState.invalidateCached`)(function*(e,t){let n=yield*j;yield*$(t.environmentId,l(function*(){de(e,t,yield*n.clearVcsRefs(t.environmentId).pipe(x(!0),_(e=>h(`Could not remove invalidated cached Git refs.`).pipe(f({environmentId:t.environmentId,cwd:t.cwd,...k(e)}),x(!1)))))}))});export{ce as a,ie as c,q as d,Y as f,Z as i,X as l,Q as n,oe as o,$ as r,se as s,fe as t,J as u};
2
+ //# sourceMappingURL=vcsRefInvalidation-CoBKCEWS.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,Dl as a,Jo as o,Js as s,Mf as c,Os as l,Yo as u,ed as d,es as f,l as p,mr as m,o as h,ol as g,ql as _,qs as v,t as y,wd as b,ws as x}from"./utils-DkKLB01I.js";import{Bs as S,Ea as C,Fa as w,Zs as T,da as E,fh as D,jc as O,lh as k,n as A,pa as j,qs as M,zs as N}from"./src-R7EkrVcv.js";import{Dr as P,Jr as F,Sr as I,W as L,_r as R,gr as z,t as B}from"./runtime-D5AfNyNA.js";import{$ as V,G as H,N as U,u as ee}from"./entities-iVR9hStG.js";import{t as W}from"./spinner-C-qDE4WQ.js";import{t as G}from"./useNavigate-DXSBYc-k.js";import{t as K}from"./useLocation-KvBZAN7v.js";import{a as q}from"./relay-aZlRxOWS.js";import{D as te,O as ne}from"./useSettings-BJR7Rf97.js";import{f as J}from"./server-B2y_yoz_.js";import{i as re,n as Y,o as ie}from"./session-Dt_Dt-Og.js";import{t as ae}from"./query-CeIgbVxh.js";import{t as oe}from"./use-atom-command-QDd_NqJQ.js";import{a as se}from"./timestampFormat-Dq7sHZpd.js";import{a as ce,n as le,t as ue}from"./tooltip-CCYU8XGM.js";import{t as de}from"./input-CiPGmOLv.js";import{t as fe}from"./scroll-area-D2D-AlvC.js";import{r as pe}from"./dist-DQanjDEK.js";import{t as me}from"./dialog-5OaxRXCC.js";import{t as he}from"./useP4ConnectAuthPrompt-DMl-0U53.js";import{t as ge}from"./CommandBlock-Cg8P2GXg.js";import{t as X}from"./checkbox-Cw33xyU7.js";import{t as _e}from"./ThreadTerminalDrawer-CBRpijGu.js";import{i as ve}from"./terminalSessions-Cnj30QDx.js";import{n as ye}from"./useHandleNewThread-ClgC6Lcw.js";import{r as be,t as xe}from"./alert-D6WJ0q4-.js";import{i as Se,n as Ce}from"./ChatGptUsageButton-BQOZ260S.js";import{t as we}from"./onboarding-7dyWHc7v.js";import{Ao as Te,Do as Ee,Eo as De,Oo as Oe,To as ke,_ as Ae,f as je,fi as Me,go as Ne,jo as Pe,ko as Fe,ln as Ie,mn as Le,un as Re}from"./main-xeaL6Ue7.js";import{t as ze}from"./NoProjectsHero-C-VNr8Ui.js";import{t as Be}from"./legalLinks-C4VP5hPh.js";import{r as Ve}from"./SettingsPanels.logic-DPfiTtgf.js";import{d as He,f as Ue,i as We,l as Ge,n as Ke,o as qe,t as Je,u as Ye}from"./CodexSetupSection.logic-CseyxFgK.js";var Z=e(t(),1),Q=n(),Xe=2592e6,Ze=3;function Qe(e,t=Date.now()){let n=t-Xe;return{available:e,recent:e.filter(e=>{if(e.git===null||e.threadCount<Ze||e.lastActiveAt===null)return!1;let r=Date.parse(e.lastActiveAt);return r>=n&&r<=t})}}function $e(e,t){return e===null?t:t===null||e>t?e:t}function et(e){let t=new Map,n=[];for(let r of e){if(r.git===null){n.push(r);continue}let e=r.git??{remoteKey:null,repository:null},i=e.remoteKey===null?`path:${r.path}`:`remote:${e.remoteKey}`,a=t.get(i);a===void 0?t.set(i,{key:i,label:e.repository??r.title,repository:e.repository,candidates:[r],threadCount:r.threadCount,lastActiveAt:r.lastActiveAt}):(a.candidates.push(r),t.set(i,{...a,threadCount:a.threadCount+r.threadCount,lastActiveAt:$e(a.lastActiveAt,r.lastActiveAt)}))}return{repositories:[...t.values()].sort((e,t)=>e.lastActiveAt===t.lastActiveAt?e.label.localeCompare(t.label):e.lastActiveAt===null?1:t.lastActiveAt===null?-1:t.lastActiveAt.localeCompare(e.lastActiveAt)),other:n}}function tt(e,t,n){if(n.projectId!==void 0)return n.projectId;let r=e.filter(e=>e.environmentId===t),i=V(r,n.path);return i===void 0?null:i.id}function nt(e,t,n){for(let n of e){let e=t.get(n);if(e!==void 0)return e}for(let t of e){let e=n.get(t);if(e!==void 0)return e}}function rt(e){if(/^[A-Za-z]:[\\/]+$/.test(e)||/^[\\/]{2}[^\\/]+[\\/][^\\/]+[\\/]*$/.test(e))return{name:e,parent:``};let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.length===0?{name:e,parent:``}:n<0?{name:t,parent:``}:{name:t.slice(n+1),parent:t.slice(0,n+1)}}function it(e,t){return JSON.stringify([e,t])}var at=R(B,{label:`environment-data:agent-sessions:scan`,tag:A.agentSessionsScan,staleTimeMs:3e4,idleTtlMs:3e5}),ot=z(B,{label:`environment-data:agent-sessions:import`,tag:A.agentSessionsImport});function st(e){return F(e.entry)}function ct(e,t){let n=e.filter(e=>t.has(e.environmentId)),r=e=>n.filter(t=>e(t.connection.phase)).map(e=>e.environmentId),i=r(e=>e===`connected`),a=n.some(e=>e.connection.phase===`connecting`);return{ready:i.length>0&&!a,environmentIds:i,skippedIds:r(e=>e!==`connected`&&e!==`connecting`)}}function lt(e){let t=(0,Q.c)(3),n=(0,Z.useContext)(u),r;return t[0]!==e||t[1]!==n?(r=f(t=>e.map(e=>{let r=at({environmentId:e,input:{}}),i=t(r);return{environmentId:e,data:k(x(i)),error:i._tag===`Failure`?ae(i.cause):null,isPending:i.waiting||i._tag===`Initial`,refresh:()=>n.refresh(r)}})),t[0]=e,t[1]=n,t[2]=r):r=t[2],o(r)}var $=e(r(),1),ut=[],dt=M.make(`onboarding-agent-setup`),ft=[`Connect`,`Agents`,`Projects`],pt=`Scan limit reached. Some projects or conversations may be missing.`;function mt({localAvailable:e,onDone:t,resumeEnvironmentId:n}){let r=Le(),[i,a]=(0,Z.useState)(n?`agents`:`connection`),{environments:o}=te(),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(new Set),[u,d]=(0,Z.useState)(n?[n]:[]),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),g=(0,Z.useRef)(null),_=(0,Z.useRef)(null),v=ne();(0,Z.useEffect)(()=>{let e=o.filter(e=>!l.current.has(e.environmentId));if(e.length===0)return;for(let t of e)l.current.add(t.environmentId);let t=e.filter(e=>e.entry.enabled);t.length!==0&&c(e=>new Set([...e??[],...t.map(e=>e.environmentId)]))},[o]);let y=s??new Set(v?[v.environmentId]:[]),b=lt(i===`import`?u:ut),x=i===`import`&&b.every(e=>e.data===null)&&b.some(e=>e.isPending),S=e=>{e.length!==0&&(d(e),a(`agents`))},C=i===`agents`?1:i===`import`?2:0,w=(0,Z.useCallback)((e,n,i=0)=>{if(g.current!==null)return g.current;_.current!==null&&(q.close(_.current),_.current=null);let a=r().then(async()=>(_.current!==null&&(q.close(_.current),_.current=null),await t(e),n?q.add({type:`warning`,title:`Some history was not imported`,description:n,timeout:0}):i>0&&q.add({type:`success`,title:`Imported ${i} ${i===1?`thread`:`threads`}`}),!0)).catch(()=>{let e={type:`error`,title:`Could not finish setup`,description:`Your settings could not be saved. Try again.`};return _.current===null?_.current=q.add(e):q.update(_.current,e),!1}).finally(()=>{g.current===a&&(g.current=null)});return g.current=a,a},[r,t]);return(0,$.jsxs)(me,{open:!0,disablePointerDismissal:!0,onOpenChange:(e,t)=>t.cancel(),children:[(0,$.jsxs)(Ee,{size:`wide`,bottomStickOnMobile:!1,showCloseButton:!1,initialFocus:()=>document.getElementById(`onboarding-pairing-url`)??!0,children:[(0,$.jsx)(ke,{title:`Set up P4 Code`,identity:(0,$.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,role:`img`,"aria-label":`P4 Code`,children:[(0,$.jsx)(Me,{className:`h-4 w-auto shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-2xl font-medium tracking-tight text-muted-foreground`,children:`Code`})]}),children:(0,$.jsx)(Oe,{steps:ft,currentStep:C,isStepDisabled:e=>m||e>=C,onStepChange:e=>{m||e>C||a(e===0?`connection`:`agents`)}})}),(0,$.jsx)(De,{holdHeight:x,children:i===`connection`?(0,$.jsx)(ht,{expandPairingInitially:!e&&!L(),selectedIds:y,autoSelectedComputers:l.current,onSelectionChange:c,onToggleEnvironment:(e,t)=>c(n=>{let r=new Set(n??y);return t?r.add(e):r.delete(e),r}),onContinue:()=>S(ct(o,y).environmentIds),onPaired:e=>{c(new Set([...y,e]))}}):i===`agents`?(0,$.jsx)(xt,{environmentIds:u,onContinue:()=>a(`import`)}):(0,$.jsx)(At,{scans:b,importSelection:f,onImportSelectionChange:p,isImporting:m,setIsImporting:h,onDone:w})})]}),(0,$.jsx)(Ae,{})]})}function ht(e){let t=(0,Q.c)(44),{autoSelectedComputers:n,expandPairingInitially:r,selectedIds:a,onSelectionChange:o,onToggleEnvironment:s,onContinue:c,onPaired:l}=e,{environments:u}=te(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=L(),t[0]=f):f=t[0];let p=f,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>!p||!st(e),t[1]=h):h=t[1];let _=u.filter(h),[v,x]=(0,Z.useState)(r),[S,C]=(0,Z.useState)(!1),{ready:w,skippedIds:T}=ct(u,a),E=u.filter(e=>T.includes(e.environmentId)).map(gt),D=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{w&&(document.activeElement===document.body||document.activeElement?.getAttribute(`role`)===`dialog`)&&D.current?.focus()},[w]);let O,k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Connect your computers`}),k=(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:`Choose one or more computers. We’ll set up agents and projects on each.`}),t[2]=O,t[3]=k):(O=t[2],k=t[3]);let A=_.length>0?(0,$.jsxs)(`fieldset`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(`legend`,{className:`sr-only`,children:`Computers to set up`}),_.map(e=>(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border border-border bg-background px-3 py-3`,children:[(0,$.jsx)(X,{checked:a.has(e.environmentId),onCheckedChange:t=>{let n=new Set(a);t?n.add(e.environmentId):n.delete(e.environmentId),o(n)}}),(0,$.jsx)(b,{className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex items-baseline justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium break-words`,children:e.label}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:!e.entry.enabled&&e.connection.phase!==`unsupported`?`Off`:Re(e.connection).buttonLabel})]}),e.displayUrl?(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs break-all text-muted-foreground`,children:e.displayUrl}):null]})]},e.environmentId))]}):null,j;t[4]!==n||t[5]!==S||t[6]!==s||t[7]!==a?(j=p?(0,$.jsx)(_t,{autoSelectedComputers:n,disabled:S,selectedIds:a,onToggleEnvironment:s}):null,t[4]=n,t[5]=S,t[6]=s,t[7]=a,t[8]=j):j=t[8];let M,N,P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(m,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),N=(0,$.jsx)(d,{className:`size-4 text-muted-foreground`}),P=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`Add a computer`}),t[9]=M,t[10]=N,t[11]=P):(M=t[9],N=t[10],P=t[11]);let F=v&&`rotate-90`,I;t[12]===F?I=t[13]:(I=y(`size-4 text-muted-foreground`,F),t[12]=F,t[13]=I);let R;t[14]===I?R=t[15]:(R=(0,$.jsx)(i,{className:I}),t[14]=I,t[15]=R);let z;t[16]!==S||t[17]!==R?(z=(0,$.jsxs)(Pe,{disabled:S,render:M,children:[N,P,R]}),t[16]=S,t[17]=R,t[18]=z):z=t[18];let B;t[19]===l?B=t[20]:(B=e=>{x(!1),l(e),requestAnimationFrame(()=>D.current?.focus())},t[19]=l,t[20]=B);let V;t[21]!==S||t[22]!==B?(V=(0,$.jsx)(Te,{children:(0,$.jsx)(`div`,{className:`px-3 pb-3`,children:(0,$.jsx)(vt,{isPairing:S,setIsPairing:C,onPaired:B})})}),t[21]=S,t[22]=B,t[23]=V):V=t[23];let H;t[24]!==v||t[25]!==z||t[26]!==V?(H=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Fe,{open:v,onOpenChange:x,children:[z,V]})}),t[24]=v,t[25]=z,t[26]=V,t[27]=H):H=t[27];let U;t[28]!==H||t[29]!==j?(U=(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[j,H]}),t[28]=H,t[29]=j,t[30]=U):U=t[30];let ee=E.length>0?(0,$.jsxs)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:[`Not connected, so setup skips `,E.join(`, `),`. You can set`,` `,E.length===1?`it`:`them`,` up later from Settings.`]}):null,W;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsxs)(`p`,{className:`min-w-0 text-xs leading-relaxed text-muted-foreground`,children:[`P4 Code collects anonymous usage data to help us improve it. To read more about how your data is used and how to opt out, see our`,` `,(0,$.jsx)(`a`,{className:`underline underline-offset-2 hover:text-foreground`,href:Be,target:`_blank`,rel:`noreferrer noopener`,children:`privacy policy`}),`.`]}),t[31]=W):W=t[31];let G=!r,K=!w||S,q;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(g,{className:`size-3.5`}),t[32]=q):q=t[32];let ne;t[33]!==c||t[34]!==G||t[35]!==K?(ne=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col-reverse gap-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[W,(0,$.jsxs)(m,{className:`shrink-0 self-end`,ref:D,autoFocus:G,disabled:K,onClick:c,children:[`Continue`,q]})]}),t[33]=c,t[34]=G,t[35]=K,t[36]=ne):ne=t[36];let J;return t[37]!==U||t[38]!==ee||t[39]!==ne||t[40]!==O||t[41]!==k||t[42]!==A?(J=(0,$.jsxs)($.Fragment,{children:[O,k,A,U,ee,ne]}),t[37]=U,t[38]=ee,t[39]=ne,t[40]=O,t[41]=k,t[42]=A,t[43]=J):J=t[43],J}function gt(e){return e.label}function _t(e){let t=(0,Q.c)(36),{autoSelectedComputers:n,disabled:r,selectedIds:a,onToggleEnvironment:o}=e,{environments:s}=te(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={treatPendingAsSignedOut:!1},t[0]=c):c=t[0];let{isLoaded:l,isSignedIn:u}=pe(c),{openAuthPrompt:d}=he(),[f,p]=(0,Z.useState)(!0),[h,g]=(0,Z.useState)(!1),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>g(!0),t[1]=v):v=t[1];let b=v,x=f&&!!u&&h,S=r||!l,C;t[2]!==u||t[3]!==d?(C=e=>{u||(e.preventDefault(),p(!0),d())},t[2]=u,t[3]=d,t[4]=C):C=t[4];let w,T,E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(m,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),T=(0,$.jsx)(_,{className:`size-4 text-muted-foreground`}),E=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`P4 Connect`}),t[5]=w,t[6]=T,t[7]=E):(w=t[5],T=t[6],E=t[7]);let D=l?u?h?null:`Loading computers…`:`Sign in`:`Loading sign-in…`,O;t[8]===D?O=t[9]:(O=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:D}),t[8]=D,t[9]=O);let k=f&&u&&`rotate-90`,A;t[10]===k?A=t[11]:(A=y(`size-4 text-muted-foreground`,k),t[10]=k,t[11]=A);let j;t[12]===A?j=t[13]:(j=(0,$.jsx)(i,{className:A}),t[12]=A,t[13]=j);let M;t[14]!==O||t[15]!==j||t[16]!==S||t[17]!==C?(M=(0,$.jsxs)(Pe,{disabled:S,onClick:C,render:w,children:[T,E,O,j]}),t[14]=O,t[15]=j,t[16]=S,t[17]=C,t[18]=M):M=t[18];let N;t[19]!==n||t[20]!==s||t[21]!==u||t[22]!==o||t[23]!==a?(N=u?(0,$.jsx)(Ie,{primaryEnvironmentId:null,savedEnvironments:s,showSavedEnvironments:!0,onDiscoveryReady:b,selection:{selectedIds:a,onChange:o,autoSelectedComputers:n},refreshWhileEmpty:!0,empty:(0,$.jsx)(`p`,{className:`py-3 text-sm text-muted-foreground`,children:`No computers linked yet.`})}):null,t[19]=n,t[20]=s,t[21]=u,t[22]=o,t[23]=a,t[24]=N):N=t[24];let P;t[25]===N?P=t[26]:(P=(0,$.jsx)(`div`,{className:`mb-3 space-y-1.5`,children:N}),t[25]=N,t[26]=P);let F,I,L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Run this on each computer you want to connect.`}),I=(0,$.jsx)(ge,{command:`npx @p4code/cli connect`,className:`mt-3`}),L=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Keep P4 Code running. Select the computers you want to set up above.`}),t[27]=F,t[28]=I,t[29]=L):(F=t[27],I=t[28],L=t[29]);let R;t[30]===P?R=t[31]:(R=(0,$.jsx)(Te,{keepMounted:!0,children:(0,$.jsxs)(`div`,{className:`px-3 pb-3`,children:[P,F,I,L]})}),t[30]=P,t[31]=R);let z;return t[32]!==M||t[33]!==R||t[34]!==x?(z=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Fe,{open:x,onOpenChange:p,children:[M,R]})}),t[32]=M,t[33]=R,t[34]=x,t[35]=z):z=t[35],z}function vt(e){let t=(0,Q.c)(37),{isPairing:n,setIsPairing:r,onPaired:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[0]=o):o=t[0];let s=oe(we,o),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),f=(0,Z.useRef)(!0),p,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>(f.current=!0,()=>{f.current=!1}),h=[],t[1]=p,t[2]=h):(p=t[1],h=t[2]),(0,Z.useEffect)(p,h);let g;t[3]!==s||t[4]!==n||t[5]!==a||t[6]!==c||t[7]!==r?(g=async()=>{if(n||c.trim().length===0)return;r(!0),d(``);let e=await s({pairingUrl:c.trim()});if(!f.current)return;if(r(!1),e._tag===`Success`){a(e.value);return}if(I(e))return;let t=P(e);d(t instanceof Error?t.message:`Pairing failed.`)},t[3]=s,t[4]=n,t[5]=a,t[6]=c,t[7]=r,t[8]=g):g=t[8];let _=g,v;t[9]===_?v=t[10]:(v=e=>{e.preventDefault(),_()},t[9]=_,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`label`,{className:`block text-sm text-muted-foreground`,htmlFor:`onboarding-pairing-url`,children:`Pairing link`}),t[11]=y):y=t[11];let b=u.length>0,x=u?`onboarding-pairing-error`:void 0,S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>l(e.currentTarget.value),t[12]=S):S=t[12];let C;t[13]!==n||t[14]!==c||t[15]!==b||t[16]!==x?(C=(0,$.jsxs)(`div`,{children:[y,(0,$.jsx)(de,{id:`onboarding-pairing-url`,autoFocus:!0,"aria-invalid":b,"aria-describedby":x,className:`mt-2`,size:`lg`,autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,nativeInput:!0,readOnly:n,placeholder:`https://your-server:5230/pair#token=…`,value:c,onChange:S,onKeyDown:yt})]}),t[13]=n,t[14]=c,t[15]=b,t[16]=x,t[17]=C):C=t[17];let w;t[18]===u?w=t[19]:(w=u?(0,$.jsx)(xe,{id:`onboarding-pairing-error`,variant:`error`,children:(0,$.jsx)(be,{children:u})}):null,t[18]=u,t[19]=w);let T;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsxs)(Pe,{type:`button`,className:`group flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,$.jsx)(i,{className:`size-3.5 group-data-panel-open:rotate-90`}),`Need a pairing link?`]}),t[20]=T):T=t[20];let E;t[21]!==n||t[22]!==c?(E=n||c.trim().length===0,t[21]=n,t[22]=c,t[23]=E):E=t[23];let D=n?`Pairing...`:`Pair`,O;t[24]!==E||t[25]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[T,(0,$.jsx)(m,{type:`submit`,disabled:E,children:D})]}),t[24]=E,t[25]=D,t[26]=O):O=t[26];let k,A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsxs)(`p`,{className:`pt-3 text-sm text-muted-foreground`,children:[`On the computer with your code, start P4 Code or run`,` `,(0,$.jsx)(`code`,{className:`font-mono`,children:`npx @p4code/cli serve`}),`, then run:`]}),A=(0,$.jsx)(ge,{command:`npx @p4code/cli pair`,className:`mt-2`}),t[27]=k,t[28]=A):(k=t[27],A=t[28]);let j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsxs)(Te,{children:[k,A,(0,$.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`On a tailnet, run `,(0,$.jsx)(`code`,{className:`font-mono`,children:`npx @p4code/cli pair --tailscale`}),` `,`instead.`]})]}),t[29]=j):j=t[29];let M;t[30]===O?M=t[31]:(M=(0,$.jsxs)(Fe,{children:[O,j]}),t[30]=O,t[31]=M);let N;return t[32]!==C||t[33]!==w||t[34]!==M||t[35]!==v?(N=(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`form`,{className:`space-y-3`,onSubmit:v,children:[C,w,M]})}),t[32]=C,t[33]=w,t[34]=M,t[35]=v,t[36]=N):N=t[36],N}function yt(e){e.key===`Enter`&&(e.nativeEvent.isComposing||e.keyCode===229)&&e.preventDefault()}var bt=[`codex`,`claudeAgent`];function xt(e){let t=(0,Q.c)(13),{environmentIds:n,onContinue:r}=e,{environments:i}=te(),a;if(t[0]!==n||t[1]!==i){let e;t[3]===i?e=t[4]:(e=e=>(0,$.jsx)(St,{environmentId:e,machineLabel:i.find(t=>t.environmentId===e)?.label??`Computer`},e),t[3]=i,t[4]=e),a=n.map(e),t[0]=n,t[1]=i,t[2]=a}else a=t[2];let o;t[5]===a?o=t[6]:(o=(0,$.jsx)(fe,{scrollFade:!0,className:`mt-5 h-auto max-h-[min(32rem,55dvh)]`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:a})}),t[5]=a,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(g,{className:`size-3.5`}),t[7]=s):s=t[7];let c;t[8]===r?c=t[9]:(c=(0,$.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,$.jsxs)(m,{autoFocus:!0,onClick:r,children:[`Continue`,s]})}),t[8]=r,t[9]=c);let l;return t[10]!==o||t[11]!==c?(l=(0,$.jsxs)(Yt,{title:`Connect your agents`,description:`Choose an agent to start coding. You can add more later.`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function St(e){let t=(0,Q.c)(57),{environmentId:n,machineLabel:r}=e,i;t[0]===n?i=t[1]:(i=J.providersValueAtom(n),t[0]=n,t[1]=i);let a=o(i),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={reportFailure:!1},t[2]=s):s=t[2];let c=oe(J.refreshProviders,s),l;t[3]===n?l=t[4]:(l=J.configValueAtom(n),t[3]=n,t[4]=l);let u=o(l),[d,f]=(0,Z.useState)(null),[p,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),v=re(n,w),y,b;t[5]!==n||t[6]!==c?(y=()=>{c({environmentId:n,input:{}})},b=[n,c],t[5]=n,t[6]=c,t[7]=y,t[8]=b):(y=t[7],b=t[8]),(0,Z.useEffect)(y,b);let x;t[9]===a?x=t[10]:(x=Ue(a),t[9]=a,t[10]=x);let S=x,C,T,E,D;if(t[11]!==S||t[12]!==v||t[13]!==g||t[14]!==n||t[15]!==r||t[16]!==a||t[17]!==u||t[18]!==d?.driver){let e;t[23]!==S||t[24]!==a?(e=e=>{let t=e===`codex`?a?.filter(t=>t.driver===e):void 0;return t?.length?t.map(t=>({driver:e,provider:t,instanceId:t.instanceId})):[{driver:e,provider:S.get(e),instanceId:S.get(e)?.instanceId}]},t[23]=S,t[24]=a,t[25]=e):e=t[25];let i=bt.flatMap(e);if(g){let e;t[26]===g?e=t[27]:(e=e=>e.instanceId===g.instanceId,t[26]=g,t[27]=e);let n=i.findIndex(e),[r]=n>=0?i.splice(n,1):[];i.unshift(r??{driver:`codex`,provider:void 0,instanceId:g.instanceId})}t[28]===r?D=t[29]:(D=(0,$.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:r}),t[28]=r,t[29]=D),t[30]===v?C=t[31]:(C=v?null:(0,$.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:`This connection cannot control terminals.`}),t[30]=v,t[31]=C),T=`space-y-1.5`;let o;t[32]!==v||t[33]!==g||t[34]!==n||t[35]!==u||t[36]!==d?.driver?(o=e=>{let{driver:t,provider:r,instanceId:i}=e;return t===`codex`&&u!==null?(0,$.jsx)(Tt,{environmentId:n,provider:r,serverConfig:u,createdAccount:i===g?.instanceId?g:null,onAutoStartConsumed:()=>_(wt),terminalOpen:d?.driver===t,onOpenTerminal:()=>{r!==void 0&&Y(n,`terminal:operate`)&&f({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:u.cwd,command:r.installed?He(r,u.settings,u.environment.platform.os):Ye(t,u.environment.platform.os),keybindings:u.keybindings})}},i??t):(0,$.jsx)(Et,{driver:t,provider:r,terminalOpen:d?.driver===t,terminalAvailable:u!==null&&v,onOpenTerminal:()=>{r!==void 0&&u!==null&&Y(n,`terminal:operate`)&&f({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:u.cwd,command:r.installed?He(r,u.settings,u.environment.platform.os):Ye(t,u.environment.platform.os),keybindings:u.keybindings})}},t)},t[32]=v,t[33]=g,t[34]=n,t[35]=u,t[36]=d?.driver,t[37]=o):o=t[37],E=i.map(o),t[11]=S,t[12]=v,t[13]=g,t[14]=n,t[15]=r,t[16]=a,t[17]=u,t[18]=d?.driver,t[19]=C,t[20]=T,t[21]=E,t[22]=D}else C=t[19],T=t[20],E=t[21],D=t[22];let O;t[38]!==T||t[39]!==E?(O=(0,$.jsx)(`div`,{className:T,children:E}),t[38]=T,t[39]=E,t[40]=O):O=t[40];let k;t[41]===a?k=t[42]:(k=a?.some(Ct)?(0,$.jsx)(`div`,{className:`mt-3`,children:(0,$.jsx)(m,{size:`xs`,variant:`ghost-muted`,onClick:()=>h(!0),children:`Connect another ChatGPT account`})}):null,t[41]=a,t[42]=k);let A;t[43]!==p||t[44]!==n?(A=p?(0,$.jsx)(Ke,{environmentId:n,onClose:()=>h(!1),onAccountCreated:(e,t)=>_({instanceId:e,displayName:t,autoStart:!0})}):null,t[43]=p,t[44]=n,t[45]=A):A=t[45];let j;t[46]!==n||t[47]!==c||t[48]!==d?(j=d===null?null:(0,$.jsx)(Dt,{session:d,onClose:()=>{f(null),c({environmentId:n,input:{}})}},`${d.environmentId}:${d.providerInstanceId}:${d.driver}`),t[46]=n,t[47]=c,t[48]=d,t[49]=j):j=t[49];let M;return t[50]!==C||t[51]!==O||t[52]!==k||t[53]!==A||t[54]!==j||t[55]!==D?(M=(0,$.jsxs)(`section`,{children:[D,C,O,k,A,j]}),t[50]=C,t[51]=O,t[52]=k,t[53]=A,t[54]=j,t[55]=D,t[56]=M):M=t[56],M}function Ct(e){return e.driver===`codex`&&Ge(e)===`ready`}function wt(e){return e?{...e,autoStart:!1}:null}function Tt(e){let t=(0,Q.c)(28),{createdAccount:n,onAutoStartConsumed:r,environmentId:i,provider:a,serverConfig:o,terminalOpen:s,onOpenTerminal:c}=e,l=re(i,w),u=oe(J.updateSettings,`Codex setup settings`),d;t[0]!==n?.instanceId||t[1]!==a?.instanceId?(d=n?.instanceId??a?.instanceId??j(E.make(`codex`)),t[0]=n?.instanceId,t[1]=a?.instanceId,t[2]=d):d=t[2];let f=d,p=o.settings,m;t[3]!==n||t[4]!==f||t[5]!==p.providerInstances?(m=p.providerInstances[f]??{driver:E.make(`codex`),config:n?{enabled:!0,setupMode:`managed`}:{}},t[3]=n,t[4]=f,t[5]=p.providerInstances,t[6]=m):m=t[6];let h=m,g;t[7]===h.config?g=t[8]:(g=Je(h.config),t[7]=h.config,t[8]=g);let _=g,v=_===`existing`&&h.config!==null&&typeof h.config==`object`&&`setupMode`in h.config&&h.config.setupMode===`existing`,y;t[9]!==i||t[10]!==h||t[11]!==f||t[12]!==p||t[13]!==u?(y=e=>{u({environmentId:i,input:{patch:Ve({settings:p,instanceId:f,instance:{...h,enabled:!0,config:{...h.config!==null&&typeof h.config==`object`?h.config:{},enabled:!0,setupMode:e}}})}})},t[9]=i,t[10]=h,t[11]=f,t[12]=p,t[13]=u,t[14]=y):y=t[14];let b=y,x;return t[15]!==l||t[16]!==b||t[17]!==n?.autoStart||t[18]!==n?.displayName||t[19]!==i||t[20]!==v||t[21]!==f||t[22]!==_||t[23]!==r||t[24]!==c||t[25]!==a||t[26]!==s?(x=v?(0,$.jsx)(Et,{driver:`codex`,provider:a,terminalOpen:s,terminalAvailable:l,onOpenTerminal:c}):(0,$.jsx)(We,{presentation:`onboarding`,autoStart:n?.autoStart===!0,displayName:n?.displayName,onAutoStartConsumed:r,environmentId:i,instanceId:f,provider:a,mode:_,enabled:a?.enabled??!0,onModeChange:b}),t[15]=l,t[16]=b,t[17]=n?.autoStart,t[18]=n?.displayName,t[19]=i,t[20]=v,t[21]=f,t[22]=_,t[23]=r,t[24]=c,t[25]=a,t[26]=s,t[27]=x):x=t[27],x}function Et(e){let t=(0,Q.c)(29),{driver:n,provider:r,terminalOpen:i,terminalAvailable:o,onOpenTerminal:s}=e,l;t[0]===n?l=t[1]:(l=Se.get(E.make(n)),t[0]=n,t[1]=l);let u=l,d=r?.displayName||(n===`claudeAgent`?`Claude Code`:u?.label??n),f;t[2]===r?f=t[3]:(f=qe(r),t[2]=r,t[3]=f);let p=f,h;t[4]===r?h=t[5]:(h=Ge(r),t[4]=r,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=E.make(n),t[6]=n,t[7]=_);let v;t[8]!==d||t[9]!==_?(v=(0,$.jsx)(Ce,{driverKind:_,displayName:d,iconClassName:`size-5`}),t[8]=d,t[9]=_,t[10]=v):v=t[10];let y;t[11]===d?y=t[12]:(y=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:d}),t[11]=d,t[12]=y);let b=g===`ready`?`Ready to code.`:p.headline,x=g!==`ready`&&p.detail?` · ${p.detail}`:``,S;t[13]!==b||t[14]!==x?(S=(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground`,children:[b,x]}),t[13]=b,t[14]=x,t[15]=S):S=t[15];let C;t[16]!==y||t[17]!==S?(C=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[y,S]}),t[16]=y,t[17]=S,t[18]=C):C=t[18];let w;t[19]!==s||t[20]!==g||t[21]!==p||t[22]!==o||t[23]!==i?(w=(0,$.jsx)(`div`,{className:`shrink-0`,children:g===`ready`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,$.jsx)(a,{className:`size-3.5`}),`Ready`]}):g===`checking`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):g===`disabled`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Disabled`}):g===`attention`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:p.headline}):(0,$.jsxs)(m,{size:`xs`,variant:`ghost`,onClick:s,disabled:i||!o,children:[(0,$.jsx)(c,{className:`size-3.5`}),g===`signIn`?`Sign in`:`Install`]})}),t[19]=s,t[20]=g,t[21]=p,t[22]=o,t[23]=i,t[24]=w):w=t[24];let T;return t[25]!==C||t[26]!==w||t[27]!==v?(T=(0,$.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-4`,children:[v,C,w]}),t[25]=C,t[26]=w,t[27]=v,t[28]=T):T=t[28],T}function Dt(e){let t=(0,Q.c)(60),{session:n,onClose:r}=e,{command:i,cwd:a,driver:o,environmentId:c,keybindings:u,providerInstanceId:d}=n,f=re(c,w),[h]=l(Ne,!1,T),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={reportFailure:!1},t[0]=g):g=t[0];let _=oe(ve.open,g),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v={reportFailure:!1},t[1]=v):v=t[1];let y=oe(ve.write,v),b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},t[2]=b):b=t[2];let x=oe(ve.close,b),S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=Promise.resolve(),t[3]=S):S=t[3];let C=(0,Z.useRef)(S),E=(0,Z.useRef)(0),D=(0,Z.useRef)(null),O;t[4]===o?O=t[5]:(O=()=>`onboarding-${o}-${p()}`,t[4]=o,t[5]=O);let[k]=(0,Z.useState)(O),A;t[6]===c?A=t[7]:(A=s(c,dt),t[6]=c,t[7]=A);let j=A,[M,N]=(0,Z.useState)(0),[P,F]=(0,Z.useState)(`preparing`),I=P===`ready`||P===`writeFailed`,L;t[8]!==x||t[9]!==i||t[10]!==a||t[11]!==c||t[12]!==_||t[13]!==d||t[14]!==k||t[15]!==y?(L=()=>{let e=E.current+1;return E.current=e,D.current=e,F(`preparing`),C.current=C.current.then(async()=>{if(D.current!==e)return;if(!Y(c,`terminal:operate`)){F(`openFailed`);return}if((await _({environmentId:c,input:{threadId:dt,terminalId:k,cwd:a,providerInstanceId:d}}))._tag!==`Success`){D.current===e&&F(`openFailed`);return}if(D.current!==e)return;if(!Y(c,`terminal:operate`)){F(`writeFailed`);return}let t=await y({environmentId:c,input:{threadId:dt,terminalId:k,data:i}});D.current===e&&F(t._tag===`Success`?`ready`:`writeFailed`)}),()=>{D.current===e&&(D.current=null),C.current=C.current.then(async()=>{Y(c,`terminal:operate`)&&await x({environmentId:c,input:{threadId:dt,terminalId:k,deleteHistory:!0}})})}},t[8]=x,t[9]=i,t[10]=a,t[11]=c,t[12]=_,t[13]=d,t[14]=k,t[15]=y,t[16]=L):L=t[16];let R;t[17]!==x||t[18]!==i||t[19]!==a||t[20]!==c||t[21]!==_||t[22]!==d||t[23]!==M||t[24]!==k||t[25]!==y?(R=[x,i,a,c,_,d,M,k,y],t[17]=x,t[18]=i,t[19]=a,t[20]=c,t[21]=_,t[22]=d,t[23]=M,t[24]=k,t[25]=y,t[26]=R):R=t[26],(0,Z.useEffect)(L,R);let z;t[27]!==f||t[28]!==i||t[29]!==P?(z=f?P===`writeFailed`?(0,$.jsxs)($.Fragment,{children:[`Run `,(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:i}),` in this terminal.`]}):P===`ready`?`Review the command, then press Enter to run it.`:P===`openFailed`?`Could not open the setup terminal.`:`Preparing command...`:`This connection cannot control terminals.`,t[27]=f,t[28]=i,t[29]=P,t[30]=z):z=t[30];let B;t[31]===z?B=t[32]:(B=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:z}),t[31]=z,t[32]=B);let V;t[33]!==f||t[34]!==c||t[35]!==P?(V=P===`openFailed`?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:!f,onClick:()=>{Y(c,`terminal:operate`)&&N(Ot)},children:`Retry`}):null,t[33]=f,t[34]=c,t[35]=P,t[36]=V):V=t[36];let H;t[37]===r?H=t[38]:(H=(0,$.jsx)(m,{size:`xs`,variant:`ghost-muted`,onClick:r,children:`Close`}),t[37]=r,t[38]=H);let U;t[39]!==V||t[40]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[V,H]}),t[39]=V,t[40]=H,t[41]=U):U=t[41];let ee;t[42]!==B||t[43]!==U?(ee=(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/60 bg-background/60 px-3 py-1.5`,children:[B,U]}),t[42]=B,t[43]=U,t[44]=ee):ee=t[44];let W;t[45]!==h||t[46]!==a||t[47]!==o||t[48]!==u||t[49]!==r||t[50]!==d||t[51]!==k||t[52]!==I||t[53]!==j?(W=I?(0,$.jsx)(_e,{threadRef:j,threadId:dt,terminalId:k,terminalLabel:`Install ${o}`,cwd:a,providerInstanceId:d,advancedTypography:h,onSessionExited:r,focusRequestId:1,autoFocus:!0,visible:!0,resizeEpoch:0,drawerHeight:256,keybindings:u}):null,t[45]=h,t[46]=a,t[47]=o,t[48]=u,t[49]=r,t[50]=d,t[51]=k,t[52]=I,t[53]=j,t[54]=W):W=t[54];let G;t[55]===W?G=t[56]:(G=(0,$.jsx)(`div`,{className:`h-64`,children:W}),t[55]=W,t[56]=G);let K;return t[57]!==ee||t[58]!==G?(K=(0,$.jsxs)(`div`,{"data-thread-terminal-drawer":!0,className:`mt-4 overflow-hidden rounded-lg border border-border/70 bg-background text-foreground`,children:[ee,G]}),t[57]=ee,t[58]=G,t[59]=K):K=t[59],K}function Ot(e){return e+1}var kt=`This connection cannot import projects or thread history.`;function At(e){let t=(0,Q.c)(85),{scans:n,importSelection:r,onImportSelectionChange:i,isImporting:a,setIsImporting:o,onDone:s}=e,{environments:c}=te(),l=ie(n,C),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[0]=u):u=t[0];let d=oe(H.create,u),f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f={reportFailure:!1},t[1]=f):f=t[1];let p=oe(ot,f),g=(0,Z.useRef)(``),_=(0,Z.useRef)(0),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Map,t[3]=x):x=t[3];let S=(0,Z.useRef)(x),w;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[4]=w):w=t[4];let T=(0,Z.useRef)(w),E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Map,t[5]=E):E=t[5];let D=(0,Z.useRef)(E),O=(0,Z.useRef)(0),k,A;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>(O.current+=1,()=>{O.current+=1}),A=[],t[6]=k,t[7]=A):(k=t[6],A=t[7]),(0,Z.useEffect)(k,A);let j;t[8]===n?j=t[9]:(j=Qe(n.flatMap(Bt)),t[8]=n,t[9]=j);let{available:M,recent:P}=j,F;t[10]===P?F=t[11]:(F=new Set(P.map(zt)),t[10]=P,t[11]=F);let L=F,R;if(t[12]!==M||t[13]!==r||t[14]!==L){let e;t[16]!==r||t[17]!==L?(e=e=>r?.environmentIds.has(e.environmentId)?r.keys.has(e.key):L.has(e.key),t[16]=r,t[17]=L,t[18]=e):e=t[18],R=M.filter(e),t[12]=M,t[13]=r,t[14]=L,t[15]=R}else R=t[15];let z=R,B;t[19]===z?B=t[20]:(B=new Set(z.map(Rt)),t[19]=z,t[20]=B);let V=B,G;t[21]!==i||t[22]!==n?(G=e=>i({environmentIds:new Set(n.flatMap(Lt)),keys:e}),t[21]=i,t[22]=n,t[23]=G):G=t[23];let K=G,q;if(t[24]!==z||t[25]!==l){let e;t[27]===l?e=t[28]:(e=e=>l.has(e.environmentId),t[27]=l,t[28]=e),q=z.every(e),t[24]=z,t[25]=l,t[26]=q}else q=t[26];let ne=q,[J,re]=(0,Z.useState)(``),Y=ne?J===kt?``:J:kt,ae;t[29]!==s||t[30]!==o?(ae=()=>{let e=nt(T.current,S.current,b.current);if(e===void 0){s(void 0,g.current,_.current);return}o(!0);let t=O.current;U(e).then(()=>e,It).then(async e=>{t===O.current&&(await s(e,g.current,_.current)||o(!1))})},t[29]=s,t[30]=o,t[31]=ae):ae=t[31];let se=ae,ce;t[32]!==d||t[33]!==se||t[34]!==p||t[35]!==a||t[36]!==s||t[37]!==n||t[38]!==o?(ce=async e=>{if(a)return;let t=()=>e.every(Ft),r=()=>{o(!1),re(kt)};if(!t()){r();return}if(e.length===0){s();return}o(!0),g.current=``,_.current=0,T.current=e.map(Pt);let i=O.current,c=b.current,l=D.current,u=c.size>0?e.filter(e=>c.has(e.key)).length:0,f=0,m=0,y=new Set;for(let n of e){let{environmentId:e}=n;if(i!==O.current||c!==b.current)return;if(!t()){r();return}if(c.has(n.key))continue;let a=tt(ee(),e,n);if(a===null){let t=l.get(n.key);if(t===void 0){let e=h();t={projectId:e,commandId:N.make(`onboarding:project:create:${e}`)},l.set(n.key,t)}a=t.projectId;let r=await d({environmentId:e,input:{projectId:a,commandId:t.commandId,title:n.title,workspaceRoot:n.path,createWorkspaceRootIfMissing:!1,defaultModelSelection:null}});if(i!==O.current||c!==b.current)return;if(r._tag!==`Success`){I(r)||(l.delete(n.key),y.add(e));continue}}if(!t()){r();return}let o=await p({environmentId:e,input:{projectId:a,expectedWorkspaceRoot:n.path}});if(i!==O.current||c!==b.current)return;o._tag===`Success`?(f+=o.value.importedCount,m+=o.value.skippedCount,o.value.importedCount>0&&S.current.set(n.key,v(e,a)),o.value.skippedCount===0&&(u+=1,c.set(n.key,v(e,a)))):I(o)||(l.delete(n.key),y.add(e))}for(let e of n)y.has(e.environmentId)&&e.refresh();o(!1),_.current=f,u<e.length&&(f>0&&m>0?g.current=`Imported ${f} ${f===1?`thread`:`threads`}. ${m} ${m===1?`thread`:`threads`} could not be imported.`:m>0?g.current=`${m} ${m===1?`thread could`:`threads could`} not be imported.`:f>0?g.current=`Imported ${f} ${f===1?`thread`:`threads`}. Some thread history could not be imported.`:g.current=`Could not import thread history.`),se()},t[32]=d,t[33]=se,t[34]=p,t[35]=a,t[36]=s,t[37]=n,t[38]=o,t[39]=ce):ce=t[39];let le=ce;if(n.every(Nt)&&n.some(Mt)){let e;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Your projects`}),t[40]=e):e=t[40];let n;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-6`,children:[(0,$.jsx)(W,{size:`lg`,tone:`muted`}),(0,$.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:`Looking for projects from Claude Code and Codex…`})]}),t[41]=n):n=t[41];let r;return t[42]===s?r=t[43]:(r=(0,$.jsxs)(`div`,{className:`flex h-full min-h-40 flex-col`,children:[e,n,(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(m,{variant:`ghost-muted`,onClick:()=>void s(),children:`Do not import projects`})})]}),t[42]=s,t[43]=r),r}let ue;t[44]!==M||t[45]!==a||t[46]!==z.length||t[47]!==K?(ue=M.length>0?(0,$.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{role:`status`,children:[z.length,` of `,M.length,` selected`]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(m,{variant:`ghost`,size:`xs`,disabled:a||z.length===M.length,onClick:()=>K(new Set(M.map(jt))),children:`Select all`}),(0,$.jsx)(m,{variant:`ghost`,size:`xs`,disabled:a||z.length===0,onClick:()=>K(new Set),children:`Select none`})]})]}):null,t[44]=M,t[45]=a,t[46]=z.length,t[47]=K,t[48]=ue):ue=t[48];let de;if(t[49]!==M||t[50]!==c||t[51]!==a||t[52]!==n||t[53]!==V||t[54]!==K){let e;t[56]!==M||t[57]!==c||t[58]!==a||t[59]!==n.length||t[60]!==V||t[61]!==K?(e=e=>{let t=M.filter(t=>t.environmentId===e.environmentId),r=c.find(t=>t.environmentId===e.environmentId)?.label??`Computer`;return(0,$.jsxs)(`fieldset`,{className:`min-w-0 space-y-0.5`,disabled:a,children:[n.length>1?(0,$.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:r}):null,e.isPending&&e.data===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(W,{size:`md`}),`Looking for projects…`]}):e.error===null?t.length===0?(0,$.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No existing Claude Code or Codex projects found.`}):null:(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 text-sm text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[`Could not check projects. `,e.error]}),(0,$.jsx)(m,{variant:`ghost`,size:`sm`,onClick:e.refresh,children:`Retry`})]}),e.data?.truncated?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:pt}):null,(0,$.jsx)(Vt,{candidates:t,selectedKeys:V,onSelectionChange:K})]},e.environmentId)},t[56]=M,t[57]=c,t[58]=a,t[59]=n.length,t[60]=V,t[61]=K,t[62]=e):e=t[62],de=n.map(e),t[49]=M,t[50]=c,t[51]=a,t[52]=n,t[53]=V,t[54]=K,t[55]=de}else de=t[55];let pe;t[63]===de?pe=t[64]:(pe=(0,$.jsx)(fe,{scrollFade:!0,className:`mt-2 h-auto max-h-80`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:de})}),t[63]=de,t[64]=pe);let me;t[65]===Y?me=t[66]:(me=Y?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:Y}):null,t[65]=Y,t[66]=me);let he;t[67]!==se||t[68]!==a?(he=(0,$.jsx)(m,{variant:`ghost-muted`,disabled:a,onClick:se,children:`Do not import projects`}),t[67]=se,t[68]=a,t[69]=he):he=t[69];let ge=!ne||a||z.length===0,X;t[70]!==le||t[71]!==z?(X=()=>void le(z),t[70]=le,t[71]=z,t[72]=X):X=t[72];let _e=a?`Importing…`:`Import ${z.length} ${z.length===1?`project`:`projects`}`,ve;t[73]!==ge||t[74]!==X||t[75]!==_e?(ve=(0,$.jsx)(m,{autoFocus:!0,disabled:ge,onClick:X,children:_e}),t[73]=ge,t[74]=X,t[75]=_e,t[76]=ve):ve=t[76];let ye;t[77]!==he||t[78]!==ve?(ye=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-end gap-3`,children:[he,ve]}),t[77]=he,t[78]=ve,t[79]=ye):ye=t[79];let be;return t[80]!==ue||t[81]!==pe||t[82]!==me||t[83]!==ye?(be=(0,$.jsxs)(Yt,{title:`Import your projects`,description:`Import projects and conversations from Claude Code and Codex on your selected computers.`,children:[ue,pe,me,ye]}),t[80]=ue,t[81]=pe,t[82]=me,t[83]=ye,t[84]=be):be=t[84],be}function jt(e){return e.key}function Mt(e){return e.isPending}function Nt(e){return e.data===null}function Pt(e){return e.key}function Ft(e){return Y(e.environmentId,C)}function It(){}function Lt(e){return e.data===null?[]:[e.environmentId]}function Rt(e){return e.key}function zt(e){return e.key}function Bt(e){return(e.data?.candidates??[]).map(t=>({...t,environmentId:e.environmentId,key:it(e.environmentId,t.path)}))}function Vt(e){let t=(0,Q.c)(25),{candidates:n,selectedKeys:r,onSelectionChange:a}=e,o;t[0]===n?o=t[1]:(o=et(n),t[0]=n,t[1]=o);let{repositories:s,other:c}=o,l;t[2]!==a||t[3]!==r?(l=(e,t)=>{let n=new Set(r);for(let r of e)t?n.add(r):n.delete(r);a(n)},t[2]=a,t[3]=r,t[4]=l):l=t[4];let u=l,d;if(t[5]!==c||t[6]!==r){let e;t[8]===r?e=t[9]:(e=e=>r.has(e.key),t[8]=r,t[9]=e),d=c.filter(e),t[5]=c,t[6]=r,t[7]=d}else d=t[7];let f=d.length,p;if(t[10]!==s||t[11]!==r||t[12]!==u){let e;t[14]!==r||t[15]!==u?(e=e=>(0,$.jsx)(Ut,{group:e,selectedKeys:r,onToggle:u},e.key),t[14]=r,t[15]=u,t[16]=e):e=t[16],p=s.map(e),t[10]=s,t[11]=r,t[12]=u,t[13]=p}else p=t[13];let m;t[17]!==c||t[18]!==f||t[19]!==r||t[20]!==u?(m=c.length>0?(0,$.jsxs)(Fe,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[(0,$.jsx)(X,{checked:f===c.length,indeterminate:f>0&&f<c.length,onCheckedChange:e=>u(c.map(Ht),e===!0)}),(0,$.jsxs)(Pe,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[(0,$.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),(0,$.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:`Other folders`}),(0,$.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[c.length,` `,c.length===1?`folder`:`folders`]})]})]}),(0,$.jsx)(Te,{children:c.map(e=>(0,$.jsx)(qt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>u([e.key],t)},e.key))})]}):null,t[17]=c,t[18]=f,t[19]=r,t[20]=u,t[21]=m):m=t[21];let h;return t[22]!==p||t[23]!==m?(h=(0,$.jsxs)($.Fragment,{children:[p,m]}),t[22]=p,t[23]=m,t[24]=h):h=t[24],h}function Ht(e){return e.key}function Ut(e){let t=(0,Q.c)(53),{group:n,selectedKeys:r,onToggle:a}=e,o,s;if(t[0]!==n.candidates||t[1]!==r){o=n.candidates.map(Gt);let e;t[4]===r?e=t[5]:(e=e=>r.has(e),t[4]=r,t[5]=e),s=o.filter(e),t[0]=n.candidates,t[1]=r,t[2]=o,t[3]=s}else o=t[2],s=t[3];let c=s.length,l=n.candidates.length===1,u=n.candidates[0];if(l&&u!==void 0){let e=n.label,i=u.path,o;t[6]!==u.key||t[7]!==r?(o=r.has(u.key),t[6]=u.key,t[7]=r,t[8]=o):o=t[8];let s;t[9]!==a||t[10]!==u.key?(s=e=>a([u.key],e),t[9]=a,t[10]=u.key,t[11]=s):s=t[11];let c;return t[12]!==n.label||t[13]!==u||t[14]!==o||t[15]!==s?(c=(0,$.jsx)(qt,{candidate:u,label:e,path:i,checked:o,onCheckedChange:s}),t[12]=n.label,t[13]=u,t[14]=o,t[15]=s,t[16]=c):c=t[16],c}let d=c===o.length,f=c>0&&c<o.length,p;t[17]!==o||t[18]!==a?(p=e=>a(o,e===!0),t[17]=o,t[18]=a,t[19]=p):p=t[19];let m;t[20]!==d||t[21]!==f||t[22]!==p?(m=(0,$.jsx)(X,{checked:d,indeterminate:f,onCheckedChange:p}),t[20]=d,t[21]=f,t[22]=p,t[23]=m):m=t[23];let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),t[24]=h):h=t[24];let g;t[25]===n.label?g=t[26]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.label}),t[25]=n.label,t[26]=g);let _;t[27]===n.candidates?_=t[28]:(_=new Set(n.candidates.flatMap(Wt)),t[27]=n.candidates,t[28]=_);let v;t[29]===_?v=t[30]:(v=[..._],t[29]=_,t[30]=v);let y;t[31]!==n.lastActiveAt||t[32]!==n.threadCount||t[33]!==v?(y=(0,$.jsx)(Jt,{sources:v,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[31]=n.lastActiveAt,t[32]=n.threadCount,t[33]=v,t[34]=y):y=t[34];let b;t[35]!==y||t[36]!==g?(b=(0,$.jsxs)(Pe,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[h,g,y]}),t[35]=y,t[36]=g,t[37]=b):b=t[37];let x;t[38]!==b||t[39]!==m?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[m,b]}),t[38]=b,t[39]=m,t[40]=x):x=t[40];let S;if(t[41]!==n.candidates||t[42]!==a||t[43]!==r){let e;t[45]!==a||t[46]!==r?(e=e=>(0,$.jsx)(qt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>a([e.key],t)},e.key),t[45]=a,t[46]=r,t[47]=e):e=t[47],S=n.candidates.map(e),t[41]=n.candidates,t[42]=a,t[43]=r,t[44]=S}else S=t[44];let C;t[48]===S?C=t[49]:(C=(0,$.jsx)(Te,{children:S}),t[48]=S,t[49]=C);let w;return t[50]!==x||t[51]!==C?(w=(0,$.jsxs)(Fe,{defaultOpen:!0,children:[x,C]}),t[50]=x,t[51]=C,t[52]=w):w=t[52],w}function Wt(e){return e.sources}function Gt(e){return e.key}function Kt(e){let t=(0,Q.c)(12),{path:n,className:r}=e,i;t[0]===n?i=t[1]:(i=rt(n),t[0]=n,t[1]=i);let{name:a,parent:o}=i,s;t[2]===r?s=t[3]:(s=y(`flex min-w-0 items-baseline font-mono`,r),t[2]=r,t[3]=s);let c;t[4]===o?c=t[5]:(c=o.length>0?(0,$.jsx)(`span`,{className:`truncate`,children:o}):null,t[4]=o,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,$.jsx)(`span`,{className:`max-w-full shrink-0 truncate`,children:a}),t[6]=a,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function qt(e){let t=(0,Q.c)(30),{candidate:n,label:r,path:i,nested:a,checked:o,onCheckedChange:s}=e,c=a!==void 0&&a,l=c&&`pl-8`,u;t[0]===l?u=t[1]:(u=y(`flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40 has-disabled:cursor-default`,l),t[0]=l,t[1]=u);let d;t[2]===s?d=t[3]:(d=e=>s(e===!0),t[2]=s,t[3]=d);let f;t[4]!==o||t[5]!==d?(f=(0,$.jsx)(X,{checked:o,onCheckedChange:d}),t[4]=o,t[5]=d,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2 truncate`}),t[7]=p):p=t[7];let m;t[8]===r?m=t[9]:(m=r===void 0?null:(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r}),t[8]=r,t[9]=m);let h;t[10]!==r||t[11]!==i?(h=i===void 0?null:(0,$.jsx)(Kt,{path:i,className:r===void 0?`text-xs`:`text-2xs text-muted-foreground`}),t[10]=r,t[11]=i,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,$.jsxs)(ce,{render:p,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]===n.path?_=t[17]:(_=(0,$.jsx)(le,{variant:`code`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==_||t[19]!==g?(v=(0,$.jsxs)(ue,{children:[g,_]}),t[18]=_,t[19]=g,t[20]=v):v=t[20];let b=c?null:n.sources,x;t[21]!==n.lastActiveAt||t[22]!==n.threadCount||t[23]!==b?(x=(0,$.jsx)(Jt,{sources:b,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[21]=n.lastActiveAt,t[22]=n.threadCount,t[23]=b,t[24]=x):x=t[24];let S;return t[25]!==v||t[26]!==x||t[27]!==u||t[28]!==f?(S=(0,$.jsxs)(`label`,{className:u,children:[f,v,x]}),t[25]=v,t[26]=x,t[27]=u,t[28]=f,t[29]=S):S=t[29],S}function Jt(e){let t=(0,Q.c)(19),{sources:n,threadCount:r,lastActiveAt:i}=e,a;t[0]===i?a=t[1]:(a=i===null?null:se(i),t[0]=i,t[1]=a);let o=a,s=o===null?``:o.suffix===null?`now`:o.value,c;t[2]===n?c=t[3]:(c=n?.includes(`claudeAgent`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Claude Code`,children:(0,$.jsx)(Ce,{driverKind:E.make(`claudeAgent`),displayName:`Claude Code`,iconClassName:`size-3`})}):null,t[2]=n,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:c}),t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=n?.includes(`codex`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Codex`,children:(0,$.jsx)(Ce,{driverKind:E.make(`codex`),displayName:`Codex`,iconClassName:`size-3`})}):null,t[6]=n,t[7]=u);let d;t[8]===u?d=t[9]:(d=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:u}),t[8]=u,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,$.jsx)(`span`,{className:`text-right`,children:r}),t[10]=r,t[11]=f);let p;t[12]===s?p=t[13]:(p=(0,$.jsx)(`span`,{className:`text-right whitespace-nowrap`,children:s}),t[12]=s,t[13]=p);let m;return t[14]!==l||t[15]!==d||t[16]!==f||t[17]!==p?(m=(0,$.jsxs)(`span`,{className:`ml-auto grid shrink-0 grid-cols-[1rem_1rem_2.5rem_2.25rem] items-center gap-x-1 text-xs text-muted-foreground tabular-nums`,children:[l,d,f,p]}),t[14]=l,t[15]=d,t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function Yt(e){let t=(0,Q.c)(8),{title:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)($.Fragment,{children:[a,o,i]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Xt=O(S);function Zt(){let e=(0,Q.c)(14),{authGateState:t}=je.useRouteContext(),n=G(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={select:$t},e[0]=r):r=e[0];let i=K(r),a;e[1]===i?a=e[2]:(a=i.startsWith(`agents:`)?D(Xt(i.slice(7))):void 0,e[1]=i,e[2]=a);let o=a,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={select:Qt},e[3]=s):s=e[3];let c=K(s),[l,u]=(0,Z.useState)(!1),d=ye(),f=t.status===`authenticated`,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ze,{}),e[4]=p):p=e[4];let m;e[5]!==l||e[6]!==c||e[7]!==f||e[8]!==n||e[9]!==d||e[10]!==o?(m=c&&!l?(0,$.jsx)(mt,{localAvailable:f,resumeEnvironmentId:o,onDone:async e=>{u(!0),e===void 0?await n({to:`/`,replace:!0}):await d(e,{replace:!0}).catch(()=>n({to:`/`,replace:!0}))}}):null,e[5]=l,e[6]=c,e[7]=f,e[8]=n,e[9]=d,e[10]=o,e[11]=m):m=e[11];let h;return e[12]===m?h=e[13]:(h=(0,$.jsxs)($.Fragment,{children:[p,m]}),e[12]=m,e[13]=h),h}function Qt(e){return e.pathname===`/welcome`}function $t(e){return e.hash}export{Zt as component};
2
- //# sourceMappingURL=welcome-CMuTnFAm.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,Dl as a,Jo as o,Js as s,Mf as c,Os as l,Yo as u,ed as d,es as f,l as p,mr as m,o as h,ol as g,ql as _,qs as v,t as y,wd as b,ws as x}from"./utils-DkKLB01I.js";import{Bs as S,Ea as C,Fa as w,Zs as T,da as E,fh as D,jc as O,lh as k,n as A,pa as j,qs as M,zs as N}from"./src-R7EkrVcv.js";import{Dr as P,Jr as F,Sr as I,W as L,_r as R,gr as z,t as B}from"./runtime-B92ivG9b.js";import{$ as V,G as H,N as U,u as ee}from"./entities-s42SFcbu.js";import{t as W}from"./spinner-C-qDE4WQ.js";import{t as G}from"./useNavigate-DXSBYc-k.js";import{t as K}from"./useLocation-KvBZAN7v.js";import{a as q}from"./relay-V_5ApBIP.js";import{D as te,O as ne}from"./useSettings-Dp9RSL-0.js";import{f as J}from"./server-GB5fRm03.js";import{i as re,n as Y,o as ie}from"./session-CFzb2gMH.js";import{t as ae}from"./query-CeIgbVxh.js";import{t as oe}from"./use-atom-command-Bd7vZxeH.js";import{a as se}from"./timestampFormat-Dq7sHZpd.js";import{a as ce,n as le,t as ue}from"./tooltip-CCYU8XGM.js";import{t as de}from"./input-CiPGmOLv.js";import{t as fe}from"./scroll-area-D2D-AlvC.js";import{r as pe}from"./dist-BocOAtMa.js";import{t as me}from"./dialog-5OaxRXCC.js";import{t as he}from"./useP4ConnectAuthPrompt-czmNhUqV.js";import{t as ge}from"./CommandBlock-DnTIHX5l.js";import{t as X}from"./checkbox-Cw33xyU7.js";import{t as _e}from"./ThreadTerminalDrawer-DBG1eHBS.js";import{i as ve}from"./terminalSessions-Cg0AQjBU.js";import{n as ye}from"./useHandleNewThread-CA9pnWuC.js";import{r as be,t as xe}from"./alert-D6WJ0q4-.js";import{i as Se,n as Ce}from"./ChatGptUsageButton-DT3CRIhB.js";import{t as we}from"./onboarding-DLaBhCVN.js";import{Ao as Te,Do as Ee,Eo as De,Oo as Oe,To as ke,_ as Ae,f as je,fi as Me,go as Ne,jo as Pe,ko as Fe,ln as Ie,mn as Le,un as Re}from"./main-BYwnnJ9E.js";import{t as ze}from"./NoProjectsHero-DrTDAhjM.js";import{t as Be}from"./legalLinks-C4VP5hPh.js";import{r as Ve}from"./SettingsPanels.logic-BkjrmwrI.js";import{d as He,f as Ue,i as We,l as Ge,n as Ke,o as qe,t as Je,u as Ye}from"./CodexSetupSection.logic-CqdvWoE6.js";var Z=e(t(),1),Q=n(),Xe=2592e6,Ze=3;function Qe(e,t=Date.now()){let n=t-Xe;return{available:e,recent:e.filter(e=>{if(e.git===null||e.threadCount<Ze||e.lastActiveAt===null)return!1;let r=Date.parse(e.lastActiveAt);return r>=n&&r<=t})}}function $e(e,t){return e===null?t:t===null||e>t?e:t}function et(e){let t=new Map,n=[];for(let r of e){if(r.git===null){n.push(r);continue}let e=r.git??{remoteKey:null,repository:null},i=e.remoteKey===null?`path:${r.path}`:`remote:${e.remoteKey}`,a=t.get(i);a===void 0?t.set(i,{key:i,label:e.repository??r.title,repository:e.repository,candidates:[r],threadCount:r.threadCount,lastActiveAt:r.lastActiveAt}):(a.candidates.push(r),t.set(i,{...a,threadCount:a.threadCount+r.threadCount,lastActiveAt:$e(a.lastActiveAt,r.lastActiveAt)}))}return{repositories:[...t.values()].sort((e,t)=>e.lastActiveAt===t.lastActiveAt?e.label.localeCompare(t.label):e.lastActiveAt===null?1:t.lastActiveAt===null?-1:t.lastActiveAt.localeCompare(e.lastActiveAt)),other:n}}function tt(e,t,n){if(n.projectId!==void 0)return n.projectId;let r=e.filter(e=>e.environmentId===t),i=V(r,n.path);return i===void 0?null:i.id}function nt(e,t,n){for(let n of e){let e=t.get(n);if(e!==void 0)return e}for(let t of e){let e=n.get(t);if(e!==void 0)return e}}function rt(e){if(/^[A-Za-z]:[\\/]+$/.test(e)||/^[\\/]{2}[^\\/]+[\\/][^\\/]+[\\/]*$/.test(e))return{name:e,parent:``};let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.length===0?{name:e,parent:``}:n<0?{name:t,parent:``}:{name:t.slice(n+1),parent:t.slice(0,n+1)}}function it(e,t){return JSON.stringify([e,t])}var at=R(B,{label:`environment-data:agent-sessions:scan`,tag:A.agentSessionsScan,staleTimeMs:3e4,idleTtlMs:3e5}),ot=z(B,{label:`environment-data:agent-sessions:import`,tag:A.agentSessionsImport});function st(e){return F(e.entry)}function ct(e,t){let n=e.filter(e=>t.has(e.environmentId)),r=e=>n.filter(t=>e(t.connection.phase)).map(e=>e.environmentId),i=r(e=>e===`connected`),a=n.some(e=>e.connection.phase===`connecting`);return{ready:i.length>0&&!a,environmentIds:i,skippedIds:r(e=>e!==`connected`&&e!==`connecting`)}}function lt(e){let t=(0,Q.c)(3),n=(0,Z.useContext)(u),r;return t[0]!==e||t[1]!==n?(r=f(t=>e.map(e=>{let r=at({environmentId:e,input:{}}),i=t(r);return{environmentId:e,data:k(x(i)),error:i._tag===`Failure`?ae(i.cause):null,isPending:i.waiting||i._tag===`Initial`,refresh:()=>n.refresh(r)}})),t[0]=e,t[1]=n,t[2]=r):r=t[2],o(r)}var $=e(r(),1),ut=[],dt=M.make(`onboarding-agent-setup`),ft=[`Connect`,`Agents`,`Projects`],pt=`Scan limit reached. Some projects or conversations may be missing.`;function mt({localAvailable:e,onDone:t,resumeEnvironmentId:n}){let r=Le(),[i,a]=(0,Z.useState)(n?`agents`:`connection`),{environments:o}=te(),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(new Set),[u,d]=(0,Z.useState)(n?[n]:[]),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),g=(0,Z.useRef)(null),_=(0,Z.useRef)(null),v=ne();(0,Z.useEffect)(()=>{let e=o.filter(e=>!l.current.has(e.environmentId));if(e.length===0)return;for(let t of e)l.current.add(t.environmentId);let t=e.filter(e=>e.entry.enabled);t.length!==0&&c(e=>new Set([...e??[],...t.map(e=>e.environmentId)]))},[o]);let y=s??new Set(v?[v.environmentId]:[]),b=lt(i===`import`?u:ut),x=i===`import`&&b.every(e=>e.data===null)&&b.some(e=>e.isPending),S=e=>{e.length!==0&&(d(e),a(`agents`))},C=i===`agents`?1:i===`import`?2:0,w=(0,Z.useCallback)((e,n,i=0)=>{if(g.current!==null)return g.current;_.current!==null&&(q.close(_.current),_.current=null);let a=r().then(async()=>(_.current!==null&&(q.close(_.current),_.current=null),await t(e),n?q.add({type:`warning`,title:`Some history was not imported`,description:n,timeout:0}):i>0&&q.add({type:`success`,title:`Imported ${i} ${i===1?`thread`:`threads`}`}),!0)).catch(()=>{let e={type:`error`,title:`Could not finish setup`,description:`Your settings could not be saved. Try again.`};return _.current===null?_.current=q.add(e):q.update(_.current,e),!1}).finally(()=>{g.current===a&&(g.current=null)});return g.current=a,a},[r,t]);return(0,$.jsxs)(me,{open:!0,disablePointerDismissal:!0,onOpenChange:(e,t)=>t.cancel(),children:[(0,$.jsxs)(Ee,{size:`wide`,bottomStickOnMobile:!1,showCloseButton:!1,initialFocus:()=>document.getElementById(`onboarding-pairing-url`)??!0,children:[(0,$.jsx)(ke,{title:`Set up P4 Code`,identity:(0,$.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,role:`img`,"aria-label":`P4 Code`,children:[(0,$.jsx)(Me,{className:`h-4 w-auto shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-2xl font-medium tracking-tight text-muted-foreground`,children:`Code`})]}),children:(0,$.jsx)(Oe,{steps:ft,currentStep:C,isStepDisabled:e=>m||e>=C,onStepChange:e=>{m||e>C||a(e===0?`connection`:`agents`)}})}),(0,$.jsx)(De,{holdHeight:x,children:i===`connection`?(0,$.jsx)(ht,{expandPairingInitially:!e&&!L(),selectedIds:y,autoSelectedComputers:l.current,onSelectionChange:c,onToggleEnvironment:(e,t)=>c(n=>{let r=new Set(n??y);return t?r.add(e):r.delete(e),r}),onContinue:()=>S(ct(o,y).environmentIds),onPaired:e=>{c(new Set([...y,e]))}}):i===`agents`?(0,$.jsx)(xt,{environmentIds:u,onContinue:()=>a(`import`)}):(0,$.jsx)(At,{scans:b,importSelection:f,onImportSelectionChange:p,isImporting:m,setIsImporting:h,onDone:w})})]}),(0,$.jsx)(Ae,{})]})}function ht(e){let t=(0,Q.c)(44),{autoSelectedComputers:n,expandPairingInitially:r,selectedIds:a,onSelectionChange:o,onToggleEnvironment:s,onContinue:c,onPaired:l}=e,{environments:u}=te(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=L(),t[0]=f):f=t[0];let p=f,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>!p||!st(e),t[1]=h):h=t[1];let _=u.filter(h),[v,x]=(0,Z.useState)(r),[S,C]=(0,Z.useState)(!1),{ready:w,skippedIds:T}=ct(u,a),E=u.filter(e=>T.includes(e.environmentId)).map(gt),D=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{w&&(document.activeElement===document.body||document.activeElement?.getAttribute(`role`)===`dialog`)&&D.current?.focus()},[w]);let O,k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Connect your computers`}),k=(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:`Choose one or more computers. We’ll set up agents and projects on each.`}),t[2]=O,t[3]=k):(O=t[2],k=t[3]);let A=_.length>0?(0,$.jsxs)(`fieldset`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(`legend`,{className:`sr-only`,children:`Computers to set up`}),_.map(e=>(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border border-border bg-background px-3 py-3`,children:[(0,$.jsx)(X,{checked:a.has(e.environmentId),onCheckedChange:t=>{let n=new Set(a);t?n.add(e.environmentId):n.delete(e.environmentId),o(n)}}),(0,$.jsx)(b,{className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex items-baseline justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium break-words`,children:e.label}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:!e.entry.enabled&&e.connection.phase!==`unsupported`?`Off`:Re(e.connection).buttonLabel})]}),e.displayUrl?(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs break-all text-muted-foreground`,children:e.displayUrl}):null]})]},e.environmentId))]}):null,j;t[4]!==n||t[5]!==S||t[6]!==s||t[7]!==a?(j=p?(0,$.jsx)(_t,{autoSelectedComputers:n,disabled:S,selectedIds:a,onToggleEnvironment:s}):null,t[4]=n,t[5]=S,t[6]=s,t[7]=a,t[8]=j):j=t[8];let M,N,P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(m,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),N=(0,$.jsx)(d,{className:`size-4 text-muted-foreground`}),P=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`Add a computer`}),t[9]=M,t[10]=N,t[11]=P):(M=t[9],N=t[10],P=t[11]);let F=v&&`rotate-90`,I;t[12]===F?I=t[13]:(I=y(`size-4 text-muted-foreground`,F),t[12]=F,t[13]=I);let R;t[14]===I?R=t[15]:(R=(0,$.jsx)(i,{className:I}),t[14]=I,t[15]=R);let z;t[16]!==S||t[17]!==R?(z=(0,$.jsxs)(Pe,{disabled:S,render:M,children:[N,P,R]}),t[16]=S,t[17]=R,t[18]=z):z=t[18];let B;t[19]===l?B=t[20]:(B=e=>{x(!1),l(e),requestAnimationFrame(()=>D.current?.focus())},t[19]=l,t[20]=B);let V;t[21]!==S||t[22]!==B?(V=(0,$.jsx)(Te,{children:(0,$.jsx)(`div`,{className:`px-3 pb-3`,children:(0,$.jsx)(vt,{isPairing:S,setIsPairing:C,onPaired:B})})}),t[21]=S,t[22]=B,t[23]=V):V=t[23];let H;t[24]!==v||t[25]!==z||t[26]!==V?(H=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Fe,{open:v,onOpenChange:x,children:[z,V]})}),t[24]=v,t[25]=z,t[26]=V,t[27]=H):H=t[27];let U;t[28]!==H||t[29]!==j?(U=(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[j,H]}),t[28]=H,t[29]=j,t[30]=U):U=t[30];let ee=E.length>0?(0,$.jsxs)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:[`Not connected, so setup skips `,E.join(`, `),`. You can set`,` `,E.length===1?`it`:`them`,` up later from Settings.`]}):null,W;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsxs)(`p`,{className:`min-w-0 text-xs leading-relaxed text-muted-foreground`,children:[`P4 Code collects anonymous usage data to help us improve it. To read more about how your data is used and how to opt out, see our`,` `,(0,$.jsx)(`a`,{className:`underline underline-offset-2 hover:text-foreground`,href:Be,target:`_blank`,rel:`noreferrer noopener`,children:`privacy policy`}),`.`]}),t[31]=W):W=t[31];let G=!r,K=!w||S,q;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(g,{className:`size-3.5`}),t[32]=q):q=t[32];let ne;t[33]!==c||t[34]!==G||t[35]!==K?(ne=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col-reverse gap-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[W,(0,$.jsxs)(m,{className:`shrink-0 self-end`,ref:D,autoFocus:G,disabled:K,onClick:c,children:[`Continue`,q]})]}),t[33]=c,t[34]=G,t[35]=K,t[36]=ne):ne=t[36];let J;return t[37]!==U||t[38]!==ee||t[39]!==ne||t[40]!==O||t[41]!==k||t[42]!==A?(J=(0,$.jsxs)($.Fragment,{children:[O,k,A,U,ee,ne]}),t[37]=U,t[38]=ee,t[39]=ne,t[40]=O,t[41]=k,t[42]=A,t[43]=J):J=t[43],J}function gt(e){return e.label}function _t(e){let t=(0,Q.c)(36),{autoSelectedComputers:n,disabled:r,selectedIds:a,onToggleEnvironment:o}=e,{environments:s}=te(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={treatPendingAsSignedOut:!1},t[0]=c):c=t[0];let{isLoaded:l,isSignedIn:u}=pe(c),{openAuthPrompt:d}=he(),[f,p]=(0,Z.useState)(!0),[h,g]=(0,Z.useState)(!1),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>g(!0),t[1]=v):v=t[1];let b=v,x=f&&!!u&&h,S=r||!l,C;t[2]!==u||t[3]!==d?(C=e=>{u||(e.preventDefault(),p(!0),d())},t[2]=u,t[3]=d,t[4]=C):C=t[4];let w,T,E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(m,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),T=(0,$.jsx)(_,{className:`size-4 text-muted-foreground`}),E=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`P4 Connect`}),t[5]=w,t[6]=T,t[7]=E):(w=t[5],T=t[6],E=t[7]);let D=l?u?h?null:`Loading computers…`:`Sign in`:`Loading sign-in…`,O;t[8]===D?O=t[9]:(O=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:D}),t[8]=D,t[9]=O);let k=f&&u&&`rotate-90`,A;t[10]===k?A=t[11]:(A=y(`size-4 text-muted-foreground`,k),t[10]=k,t[11]=A);let j;t[12]===A?j=t[13]:(j=(0,$.jsx)(i,{className:A}),t[12]=A,t[13]=j);let M;t[14]!==O||t[15]!==j||t[16]!==S||t[17]!==C?(M=(0,$.jsxs)(Pe,{disabled:S,onClick:C,render:w,children:[T,E,O,j]}),t[14]=O,t[15]=j,t[16]=S,t[17]=C,t[18]=M):M=t[18];let N;t[19]!==n||t[20]!==s||t[21]!==u||t[22]!==o||t[23]!==a?(N=u?(0,$.jsx)(Ie,{primaryEnvironmentId:null,savedEnvironments:s,showSavedEnvironments:!0,onDiscoveryReady:b,selection:{selectedIds:a,onChange:o,autoSelectedComputers:n},refreshWhileEmpty:!0,empty:(0,$.jsx)(`p`,{className:`py-3 text-sm text-muted-foreground`,children:`No computers linked yet.`})}):null,t[19]=n,t[20]=s,t[21]=u,t[22]=o,t[23]=a,t[24]=N):N=t[24];let P;t[25]===N?P=t[26]:(P=(0,$.jsx)(`div`,{className:`mb-3 space-y-1.5`,children:N}),t[25]=N,t[26]=P);let F,I,L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Run this on each computer you want to connect.`}),I=(0,$.jsx)(ge,{command:`npx @p4code/cli connect`,className:`mt-3`}),L=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Keep P4 Code running. Select the computers you want to set up above.`}),t[27]=F,t[28]=I,t[29]=L):(F=t[27],I=t[28],L=t[29]);let R;t[30]===P?R=t[31]:(R=(0,$.jsx)(Te,{keepMounted:!0,children:(0,$.jsxs)(`div`,{className:`px-3 pb-3`,children:[P,F,I,L]})}),t[30]=P,t[31]=R);let z;return t[32]!==M||t[33]!==R||t[34]!==x?(z=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Fe,{open:x,onOpenChange:p,children:[M,R]})}),t[32]=M,t[33]=R,t[34]=x,t[35]=z):z=t[35],z}function vt(e){let t=(0,Q.c)(37),{isPairing:n,setIsPairing:r,onPaired:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[0]=o):o=t[0];let s=oe(we,o),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),f=(0,Z.useRef)(!0),p,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>(f.current=!0,()=>{f.current=!1}),h=[],t[1]=p,t[2]=h):(p=t[1],h=t[2]),(0,Z.useEffect)(p,h);let g;t[3]!==s||t[4]!==n||t[5]!==a||t[6]!==c||t[7]!==r?(g=async()=>{if(n||c.trim().length===0)return;r(!0),d(``);let e=await s({pairingUrl:c.trim()});if(!f.current)return;if(r(!1),e._tag===`Success`){a(e.value);return}if(I(e))return;let t=P(e);d(t instanceof Error?t.message:`Pairing failed.`)},t[3]=s,t[4]=n,t[5]=a,t[6]=c,t[7]=r,t[8]=g):g=t[8];let _=g,v;t[9]===_?v=t[10]:(v=e=>{e.preventDefault(),_()},t[9]=_,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`label`,{className:`block text-sm text-muted-foreground`,htmlFor:`onboarding-pairing-url`,children:`Pairing link`}),t[11]=y):y=t[11];let b=u.length>0,x=u?`onboarding-pairing-error`:void 0,S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>l(e.currentTarget.value),t[12]=S):S=t[12];let C;t[13]!==n||t[14]!==c||t[15]!==b||t[16]!==x?(C=(0,$.jsxs)(`div`,{children:[y,(0,$.jsx)(de,{id:`onboarding-pairing-url`,autoFocus:!0,"aria-invalid":b,"aria-describedby":x,className:`mt-2`,size:`lg`,autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,nativeInput:!0,readOnly:n,placeholder:`https://your-server:5230/pair#token=…`,value:c,onChange:S,onKeyDown:yt})]}),t[13]=n,t[14]=c,t[15]=b,t[16]=x,t[17]=C):C=t[17];let w;t[18]===u?w=t[19]:(w=u?(0,$.jsx)(xe,{id:`onboarding-pairing-error`,variant:`error`,children:(0,$.jsx)(be,{children:u})}):null,t[18]=u,t[19]=w);let T;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsxs)(Pe,{type:`button`,className:`group flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,$.jsx)(i,{className:`size-3.5 group-data-panel-open:rotate-90`}),`Need a pairing link?`]}),t[20]=T):T=t[20];let E;t[21]!==n||t[22]!==c?(E=n||c.trim().length===0,t[21]=n,t[22]=c,t[23]=E):E=t[23];let D=n?`Pairing...`:`Pair`,O;t[24]!==E||t[25]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[T,(0,$.jsx)(m,{type:`submit`,disabled:E,children:D})]}),t[24]=E,t[25]=D,t[26]=O):O=t[26];let k,A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsxs)(`p`,{className:`pt-3 text-sm text-muted-foreground`,children:[`On the computer with your code, start P4 Code or run`,` `,(0,$.jsx)(`code`,{className:`font-mono`,children:`npx @p4code/cli serve`}),`, then run:`]}),A=(0,$.jsx)(ge,{command:`npx @p4code/cli pair`,className:`mt-2`}),t[27]=k,t[28]=A):(k=t[27],A=t[28]);let j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsxs)(Te,{children:[k,A,(0,$.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`On a tailnet, run `,(0,$.jsx)(`code`,{className:`font-mono`,children:`npx @p4code/cli pair --tailscale`}),` `,`instead.`]})]}),t[29]=j):j=t[29];let M;t[30]===O?M=t[31]:(M=(0,$.jsxs)(Fe,{children:[O,j]}),t[30]=O,t[31]=M);let N;return t[32]!==C||t[33]!==w||t[34]!==M||t[35]!==v?(N=(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`form`,{className:`space-y-3`,onSubmit:v,children:[C,w,M]})}),t[32]=C,t[33]=w,t[34]=M,t[35]=v,t[36]=N):N=t[36],N}function yt(e){e.key===`Enter`&&(e.nativeEvent.isComposing||e.keyCode===229)&&e.preventDefault()}var bt=[`codex`,`claudeAgent`];function xt(e){let t=(0,Q.c)(13),{environmentIds:n,onContinue:r}=e,{environments:i}=te(),a;if(t[0]!==n||t[1]!==i){let e;t[3]===i?e=t[4]:(e=e=>(0,$.jsx)(St,{environmentId:e,machineLabel:i.find(t=>t.environmentId===e)?.label??`Computer`},e),t[3]=i,t[4]=e),a=n.map(e),t[0]=n,t[1]=i,t[2]=a}else a=t[2];let o;t[5]===a?o=t[6]:(o=(0,$.jsx)(fe,{scrollFade:!0,className:`mt-5 h-auto max-h-[min(32rem,55dvh)]`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:a})}),t[5]=a,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(g,{className:`size-3.5`}),t[7]=s):s=t[7];let c;t[8]===r?c=t[9]:(c=(0,$.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,$.jsxs)(m,{autoFocus:!0,onClick:r,children:[`Continue`,s]})}),t[8]=r,t[9]=c);let l;return t[10]!==o||t[11]!==c?(l=(0,$.jsxs)(Yt,{title:`Connect your agents`,description:`Choose an agent to start coding. You can add more later.`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function St(e){let t=(0,Q.c)(57),{environmentId:n,machineLabel:r}=e,i;t[0]===n?i=t[1]:(i=J.providersValueAtom(n),t[0]=n,t[1]=i);let a=o(i),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={reportFailure:!1},t[2]=s):s=t[2];let c=oe(J.refreshProviders,s),l;t[3]===n?l=t[4]:(l=J.configValueAtom(n),t[3]=n,t[4]=l);let u=o(l),[d,f]=(0,Z.useState)(null),[p,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),v=re(n,w),y,b;t[5]!==n||t[6]!==c?(y=()=>{c({environmentId:n,input:{}})},b=[n,c],t[5]=n,t[6]=c,t[7]=y,t[8]=b):(y=t[7],b=t[8]),(0,Z.useEffect)(y,b);let x;t[9]===a?x=t[10]:(x=Ue(a),t[9]=a,t[10]=x);let S=x,C,T,E,D;if(t[11]!==S||t[12]!==v||t[13]!==g||t[14]!==n||t[15]!==r||t[16]!==a||t[17]!==u||t[18]!==d?.driver){let e;t[23]!==S||t[24]!==a?(e=e=>{let t=e===`codex`?a?.filter(t=>t.driver===e):void 0;return t?.length?t.map(t=>({driver:e,provider:t,instanceId:t.instanceId})):[{driver:e,provider:S.get(e),instanceId:S.get(e)?.instanceId}]},t[23]=S,t[24]=a,t[25]=e):e=t[25];let i=bt.flatMap(e);if(g){let e;t[26]===g?e=t[27]:(e=e=>e.instanceId===g.instanceId,t[26]=g,t[27]=e);let n=i.findIndex(e),[r]=n>=0?i.splice(n,1):[];i.unshift(r??{driver:`codex`,provider:void 0,instanceId:g.instanceId})}t[28]===r?D=t[29]:(D=(0,$.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:r}),t[28]=r,t[29]=D),t[30]===v?C=t[31]:(C=v?null:(0,$.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:`This connection cannot control terminals.`}),t[30]=v,t[31]=C),T=`space-y-1.5`;let o;t[32]!==v||t[33]!==g||t[34]!==n||t[35]!==u||t[36]!==d?.driver?(o=e=>{let{driver:t,provider:r,instanceId:i}=e;return t===`codex`&&u!==null?(0,$.jsx)(Tt,{environmentId:n,provider:r,serverConfig:u,createdAccount:i===g?.instanceId?g:null,onAutoStartConsumed:()=>_(wt),terminalOpen:d?.driver===t,onOpenTerminal:()=>{r!==void 0&&Y(n,`terminal:operate`)&&f({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:u.cwd,command:r.installed?He(r,u.settings,u.environment.platform.os):Ye(t,u.environment.platform.os),keybindings:u.keybindings})}},i??t):(0,$.jsx)(Et,{driver:t,provider:r,terminalOpen:d?.driver===t,terminalAvailable:u!==null&&v,onOpenTerminal:()=>{r!==void 0&&u!==null&&Y(n,`terminal:operate`)&&f({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:u.cwd,command:r.installed?He(r,u.settings,u.environment.platform.os):Ye(t,u.environment.platform.os),keybindings:u.keybindings})}},t)},t[32]=v,t[33]=g,t[34]=n,t[35]=u,t[36]=d?.driver,t[37]=o):o=t[37],E=i.map(o),t[11]=S,t[12]=v,t[13]=g,t[14]=n,t[15]=r,t[16]=a,t[17]=u,t[18]=d?.driver,t[19]=C,t[20]=T,t[21]=E,t[22]=D}else C=t[19],T=t[20],E=t[21],D=t[22];let O;t[38]!==T||t[39]!==E?(O=(0,$.jsx)(`div`,{className:T,children:E}),t[38]=T,t[39]=E,t[40]=O):O=t[40];let k;t[41]===a?k=t[42]:(k=a?.some(Ct)?(0,$.jsx)(`div`,{className:`mt-3`,children:(0,$.jsx)(m,{size:`xs`,variant:`ghost-muted`,onClick:()=>h(!0),children:`Connect another ChatGPT account`})}):null,t[41]=a,t[42]=k);let A;t[43]!==p||t[44]!==n?(A=p?(0,$.jsx)(Ke,{environmentId:n,onClose:()=>h(!1),onAccountCreated:(e,t)=>_({instanceId:e,displayName:t,autoStart:!0})}):null,t[43]=p,t[44]=n,t[45]=A):A=t[45];let j;t[46]!==n||t[47]!==c||t[48]!==d?(j=d===null?null:(0,$.jsx)(Dt,{session:d,onClose:()=>{f(null),c({environmentId:n,input:{}})}},`${d.environmentId}:${d.providerInstanceId}:${d.driver}`),t[46]=n,t[47]=c,t[48]=d,t[49]=j):j=t[49];let M;return t[50]!==C||t[51]!==O||t[52]!==k||t[53]!==A||t[54]!==j||t[55]!==D?(M=(0,$.jsxs)(`section`,{children:[D,C,O,k,A,j]}),t[50]=C,t[51]=O,t[52]=k,t[53]=A,t[54]=j,t[55]=D,t[56]=M):M=t[56],M}function Ct(e){return e.driver===`codex`&&Ge(e)===`ready`}function wt(e){return e?{...e,autoStart:!1}:null}function Tt(e){let t=(0,Q.c)(28),{createdAccount:n,onAutoStartConsumed:r,environmentId:i,provider:a,serverConfig:o,terminalOpen:s,onOpenTerminal:c}=e,l=re(i,w),u=oe(J.updateSettings,`Codex setup settings`),d;t[0]!==n?.instanceId||t[1]!==a?.instanceId?(d=n?.instanceId??a?.instanceId??j(E.make(`codex`)),t[0]=n?.instanceId,t[1]=a?.instanceId,t[2]=d):d=t[2];let f=d,p=o.settings,m;t[3]!==n||t[4]!==f||t[5]!==p.providerInstances?(m=p.providerInstances[f]??{driver:E.make(`codex`),config:n?{enabled:!0,setupMode:`managed`}:{}},t[3]=n,t[4]=f,t[5]=p.providerInstances,t[6]=m):m=t[6];let h=m,g;t[7]===h.config?g=t[8]:(g=Je(h.config),t[7]=h.config,t[8]=g);let _=g,v=_===`existing`&&h.config!==null&&typeof h.config==`object`&&`setupMode`in h.config&&h.config.setupMode===`existing`,y;t[9]!==i||t[10]!==h||t[11]!==f||t[12]!==p||t[13]!==u?(y=e=>{u({environmentId:i,input:{patch:Ve({settings:p,instanceId:f,instance:{...h,enabled:!0,config:{...h.config!==null&&typeof h.config==`object`?h.config:{},enabled:!0,setupMode:e}}})}})},t[9]=i,t[10]=h,t[11]=f,t[12]=p,t[13]=u,t[14]=y):y=t[14];let b=y,x;return t[15]!==l||t[16]!==b||t[17]!==n?.autoStart||t[18]!==n?.displayName||t[19]!==i||t[20]!==v||t[21]!==f||t[22]!==_||t[23]!==r||t[24]!==c||t[25]!==a||t[26]!==s?(x=v?(0,$.jsx)(Et,{driver:`codex`,provider:a,terminalOpen:s,terminalAvailable:l,onOpenTerminal:c}):(0,$.jsx)(We,{presentation:`onboarding`,autoStart:n?.autoStart===!0,displayName:n?.displayName,onAutoStartConsumed:r,environmentId:i,instanceId:f,provider:a,mode:_,enabled:a?.enabled??!0,onModeChange:b}),t[15]=l,t[16]=b,t[17]=n?.autoStart,t[18]=n?.displayName,t[19]=i,t[20]=v,t[21]=f,t[22]=_,t[23]=r,t[24]=c,t[25]=a,t[26]=s,t[27]=x):x=t[27],x}function Et(e){let t=(0,Q.c)(29),{driver:n,provider:r,terminalOpen:i,terminalAvailable:o,onOpenTerminal:s}=e,l;t[0]===n?l=t[1]:(l=Se.get(E.make(n)),t[0]=n,t[1]=l);let u=l,d=r?.displayName||(n===`claudeAgent`?`Claude Code`:u?.label??n),f;t[2]===r?f=t[3]:(f=qe(r),t[2]=r,t[3]=f);let p=f,h;t[4]===r?h=t[5]:(h=Ge(r),t[4]=r,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=E.make(n),t[6]=n,t[7]=_);let v;t[8]!==d||t[9]!==_?(v=(0,$.jsx)(Ce,{driverKind:_,displayName:d,iconClassName:`size-5`}),t[8]=d,t[9]=_,t[10]=v):v=t[10];let y;t[11]===d?y=t[12]:(y=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:d}),t[11]=d,t[12]=y);let b=g===`ready`?`Ready to code.`:p.headline,x=g!==`ready`&&p.detail?` · ${p.detail}`:``,S;t[13]!==b||t[14]!==x?(S=(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground`,children:[b,x]}),t[13]=b,t[14]=x,t[15]=S):S=t[15];let C;t[16]!==y||t[17]!==S?(C=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[y,S]}),t[16]=y,t[17]=S,t[18]=C):C=t[18];let w;t[19]!==s||t[20]!==g||t[21]!==p||t[22]!==o||t[23]!==i?(w=(0,$.jsx)(`div`,{className:`shrink-0`,children:g===`ready`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,$.jsx)(a,{className:`size-3.5`}),`Ready`]}):g===`checking`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):g===`disabled`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Disabled`}):g===`attention`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:p.headline}):(0,$.jsxs)(m,{size:`xs`,variant:`ghost`,onClick:s,disabled:i||!o,children:[(0,$.jsx)(c,{className:`size-3.5`}),g===`signIn`?`Sign in`:`Install`]})}),t[19]=s,t[20]=g,t[21]=p,t[22]=o,t[23]=i,t[24]=w):w=t[24];let T;return t[25]!==C||t[26]!==w||t[27]!==v?(T=(0,$.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-4`,children:[v,C,w]}),t[25]=C,t[26]=w,t[27]=v,t[28]=T):T=t[28],T}function Dt(e){let t=(0,Q.c)(60),{session:n,onClose:r}=e,{command:i,cwd:a,driver:o,environmentId:c,keybindings:u,providerInstanceId:d}=n,f=re(c,w),[h]=l(Ne,!1,T),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={reportFailure:!1},t[0]=g):g=t[0];let _=oe(ve.open,g),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v={reportFailure:!1},t[1]=v):v=t[1];let y=oe(ve.write,v),b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},t[2]=b):b=t[2];let x=oe(ve.close,b),S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=Promise.resolve(),t[3]=S):S=t[3];let C=(0,Z.useRef)(S),E=(0,Z.useRef)(0),D=(0,Z.useRef)(null),O;t[4]===o?O=t[5]:(O=()=>`onboarding-${o}-${p()}`,t[4]=o,t[5]=O);let[k]=(0,Z.useState)(O),A;t[6]===c?A=t[7]:(A=s(c,dt),t[6]=c,t[7]=A);let j=A,[M,N]=(0,Z.useState)(0),[P,F]=(0,Z.useState)(`preparing`),I=P===`ready`||P===`writeFailed`,L;t[8]!==x||t[9]!==i||t[10]!==a||t[11]!==c||t[12]!==_||t[13]!==d||t[14]!==k||t[15]!==y?(L=()=>{let e=E.current+1;return E.current=e,D.current=e,F(`preparing`),C.current=C.current.then(async()=>{if(D.current!==e)return;if(!Y(c,`terminal:operate`)){F(`openFailed`);return}if((await _({environmentId:c,input:{threadId:dt,terminalId:k,cwd:a,providerInstanceId:d}}))._tag!==`Success`){D.current===e&&F(`openFailed`);return}if(D.current!==e)return;if(!Y(c,`terminal:operate`)){F(`writeFailed`);return}let t=await y({environmentId:c,input:{threadId:dt,terminalId:k,data:i}});D.current===e&&F(t._tag===`Success`?`ready`:`writeFailed`)}),()=>{D.current===e&&(D.current=null),C.current=C.current.then(async()=>{Y(c,`terminal:operate`)&&await x({environmentId:c,input:{threadId:dt,terminalId:k,deleteHistory:!0}})})}},t[8]=x,t[9]=i,t[10]=a,t[11]=c,t[12]=_,t[13]=d,t[14]=k,t[15]=y,t[16]=L):L=t[16];let R;t[17]!==x||t[18]!==i||t[19]!==a||t[20]!==c||t[21]!==_||t[22]!==d||t[23]!==M||t[24]!==k||t[25]!==y?(R=[x,i,a,c,_,d,M,k,y],t[17]=x,t[18]=i,t[19]=a,t[20]=c,t[21]=_,t[22]=d,t[23]=M,t[24]=k,t[25]=y,t[26]=R):R=t[26],(0,Z.useEffect)(L,R);let z;t[27]!==f||t[28]!==i||t[29]!==P?(z=f?P===`writeFailed`?(0,$.jsxs)($.Fragment,{children:[`Run `,(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:i}),` in this terminal.`]}):P===`ready`?`Review the command, then press Enter to run it.`:P===`openFailed`?`Could not open the setup terminal.`:`Preparing command...`:`This connection cannot control terminals.`,t[27]=f,t[28]=i,t[29]=P,t[30]=z):z=t[30];let B;t[31]===z?B=t[32]:(B=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:z}),t[31]=z,t[32]=B);let V;t[33]!==f||t[34]!==c||t[35]!==P?(V=P===`openFailed`?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:!f,onClick:()=>{Y(c,`terminal:operate`)&&N(Ot)},children:`Retry`}):null,t[33]=f,t[34]=c,t[35]=P,t[36]=V):V=t[36];let H;t[37]===r?H=t[38]:(H=(0,$.jsx)(m,{size:`xs`,variant:`ghost-muted`,onClick:r,children:`Close`}),t[37]=r,t[38]=H);let U;t[39]!==V||t[40]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[V,H]}),t[39]=V,t[40]=H,t[41]=U):U=t[41];let ee;t[42]!==B||t[43]!==U?(ee=(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/60 bg-background/60 px-3 py-1.5`,children:[B,U]}),t[42]=B,t[43]=U,t[44]=ee):ee=t[44];let W;t[45]!==h||t[46]!==a||t[47]!==o||t[48]!==u||t[49]!==r||t[50]!==d||t[51]!==k||t[52]!==I||t[53]!==j?(W=I?(0,$.jsx)(_e,{threadRef:j,threadId:dt,terminalId:k,terminalLabel:`Install ${o}`,cwd:a,providerInstanceId:d,advancedTypography:h,onSessionExited:r,focusRequestId:1,autoFocus:!0,visible:!0,resizeEpoch:0,drawerHeight:256,keybindings:u}):null,t[45]=h,t[46]=a,t[47]=o,t[48]=u,t[49]=r,t[50]=d,t[51]=k,t[52]=I,t[53]=j,t[54]=W):W=t[54];let G;t[55]===W?G=t[56]:(G=(0,$.jsx)(`div`,{className:`h-64`,children:W}),t[55]=W,t[56]=G);let K;return t[57]!==ee||t[58]!==G?(K=(0,$.jsxs)(`div`,{"data-thread-terminal-drawer":!0,className:`mt-4 overflow-hidden rounded-lg border border-border/70 bg-background text-foreground`,children:[ee,G]}),t[57]=ee,t[58]=G,t[59]=K):K=t[59],K}function Ot(e){return e+1}var kt=`This connection cannot import projects or thread history.`;function At(e){let t=(0,Q.c)(85),{scans:n,importSelection:r,onImportSelectionChange:i,isImporting:a,setIsImporting:o,onDone:s}=e,{environments:c}=te(),l=ie(n,C),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[0]=u):u=t[0];let d=oe(H.create,u),f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f={reportFailure:!1},t[1]=f):f=t[1];let p=oe(ot,f),g=(0,Z.useRef)(``),_=(0,Z.useRef)(0),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Map,t[3]=x):x=t[3];let S=(0,Z.useRef)(x),w;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[4]=w):w=t[4];let T=(0,Z.useRef)(w),E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Map,t[5]=E):E=t[5];let D=(0,Z.useRef)(E),O=(0,Z.useRef)(0),k,A;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>(O.current+=1,()=>{O.current+=1}),A=[],t[6]=k,t[7]=A):(k=t[6],A=t[7]),(0,Z.useEffect)(k,A);let j;t[8]===n?j=t[9]:(j=Qe(n.flatMap(Bt)),t[8]=n,t[9]=j);let{available:M,recent:P}=j,F;t[10]===P?F=t[11]:(F=new Set(P.map(zt)),t[10]=P,t[11]=F);let L=F,R;if(t[12]!==M||t[13]!==r||t[14]!==L){let e;t[16]!==r||t[17]!==L?(e=e=>r?.environmentIds.has(e.environmentId)?r.keys.has(e.key):L.has(e.key),t[16]=r,t[17]=L,t[18]=e):e=t[18],R=M.filter(e),t[12]=M,t[13]=r,t[14]=L,t[15]=R}else R=t[15];let z=R,B;t[19]===z?B=t[20]:(B=new Set(z.map(Rt)),t[19]=z,t[20]=B);let V=B,G;t[21]!==i||t[22]!==n?(G=e=>i({environmentIds:new Set(n.flatMap(Lt)),keys:e}),t[21]=i,t[22]=n,t[23]=G):G=t[23];let K=G,q;if(t[24]!==z||t[25]!==l){let e;t[27]===l?e=t[28]:(e=e=>l.has(e.environmentId),t[27]=l,t[28]=e),q=z.every(e),t[24]=z,t[25]=l,t[26]=q}else q=t[26];let ne=q,[J,re]=(0,Z.useState)(``),Y=ne?J===kt?``:J:kt,ae;t[29]!==s||t[30]!==o?(ae=()=>{let e=nt(T.current,S.current,b.current);if(e===void 0){s(void 0,g.current,_.current);return}o(!0);let t=O.current;U(e).then(()=>e,It).then(async e=>{t===O.current&&(await s(e,g.current,_.current)||o(!1))})},t[29]=s,t[30]=o,t[31]=ae):ae=t[31];let se=ae,ce;t[32]!==d||t[33]!==se||t[34]!==p||t[35]!==a||t[36]!==s||t[37]!==n||t[38]!==o?(ce=async e=>{if(a)return;let t=()=>e.every(Ft),r=()=>{o(!1),re(kt)};if(!t()){r();return}if(e.length===0){s();return}o(!0),g.current=``,_.current=0,T.current=e.map(Pt);let i=O.current,c=b.current,l=D.current,u=c.size>0?e.filter(e=>c.has(e.key)).length:0,f=0,m=0,y=new Set;for(let n of e){let{environmentId:e}=n;if(i!==O.current||c!==b.current)return;if(!t()){r();return}if(c.has(n.key))continue;let a=tt(ee(),e,n);if(a===null){let t=l.get(n.key);if(t===void 0){let e=h();t={projectId:e,commandId:N.make(`onboarding:project:create:${e}`)},l.set(n.key,t)}a=t.projectId;let r=await d({environmentId:e,input:{projectId:a,commandId:t.commandId,title:n.title,workspaceRoot:n.path,createWorkspaceRootIfMissing:!1,defaultModelSelection:null}});if(i!==O.current||c!==b.current)return;if(r._tag!==`Success`){I(r)||(l.delete(n.key),y.add(e));continue}}if(!t()){r();return}let o=await p({environmentId:e,input:{projectId:a,expectedWorkspaceRoot:n.path}});if(i!==O.current||c!==b.current)return;o._tag===`Success`?(f+=o.value.importedCount,m+=o.value.skippedCount,o.value.importedCount>0&&S.current.set(n.key,v(e,a)),o.value.skippedCount===0&&(u+=1,c.set(n.key,v(e,a)))):I(o)||(l.delete(n.key),y.add(e))}for(let e of n)y.has(e.environmentId)&&e.refresh();o(!1),_.current=f,u<e.length&&(f>0&&m>0?g.current=`Imported ${f} ${f===1?`thread`:`threads`}. ${m} ${m===1?`thread`:`threads`} could not be imported.`:m>0?g.current=`${m} ${m===1?`thread could`:`threads could`} not be imported.`:f>0?g.current=`Imported ${f} ${f===1?`thread`:`threads`}. Some thread history could not be imported.`:g.current=`Could not import thread history.`),se()},t[32]=d,t[33]=se,t[34]=p,t[35]=a,t[36]=s,t[37]=n,t[38]=o,t[39]=ce):ce=t[39];let le=ce;if(n.every(Nt)&&n.some(Mt)){let e;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Your projects`}),t[40]=e):e=t[40];let n;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-6`,children:[(0,$.jsx)(W,{size:`lg`,tone:`muted`}),(0,$.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:`Looking for projects from Claude Code and Codex…`})]}),t[41]=n):n=t[41];let r;return t[42]===s?r=t[43]:(r=(0,$.jsxs)(`div`,{className:`flex h-full min-h-40 flex-col`,children:[e,n,(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(m,{variant:`ghost-muted`,onClick:()=>void s(),children:`Do not import projects`})})]}),t[42]=s,t[43]=r),r}let ue;t[44]!==M||t[45]!==a||t[46]!==z.length||t[47]!==K?(ue=M.length>0?(0,$.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{role:`status`,children:[z.length,` of `,M.length,` selected`]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(m,{variant:`ghost`,size:`xs`,disabled:a||z.length===M.length,onClick:()=>K(new Set(M.map(jt))),children:`Select all`}),(0,$.jsx)(m,{variant:`ghost`,size:`xs`,disabled:a||z.length===0,onClick:()=>K(new Set),children:`Select none`})]})]}):null,t[44]=M,t[45]=a,t[46]=z.length,t[47]=K,t[48]=ue):ue=t[48];let de;if(t[49]!==M||t[50]!==c||t[51]!==a||t[52]!==n||t[53]!==V||t[54]!==K){let e;t[56]!==M||t[57]!==c||t[58]!==a||t[59]!==n.length||t[60]!==V||t[61]!==K?(e=e=>{let t=M.filter(t=>t.environmentId===e.environmentId),r=c.find(t=>t.environmentId===e.environmentId)?.label??`Computer`;return(0,$.jsxs)(`fieldset`,{className:`min-w-0 space-y-0.5`,disabled:a,children:[n.length>1?(0,$.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:r}):null,e.isPending&&e.data===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(W,{size:`md`}),`Looking for projects…`]}):e.error===null?t.length===0?(0,$.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No existing Claude Code or Codex projects found.`}):null:(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 text-sm text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[`Could not check projects. `,e.error]}),(0,$.jsx)(m,{variant:`ghost`,size:`sm`,onClick:e.refresh,children:`Retry`})]}),e.data?.truncated?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:pt}):null,(0,$.jsx)(Vt,{candidates:t,selectedKeys:V,onSelectionChange:K})]},e.environmentId)},t[56]=M,t[57]=c,t[58]=a,t[59]=n.length,t[60]=V,t[61]=K,t[62]=e):e=t[62],de=n.map(e),t[49]=M,t[50]=c,t[51]=a,t[52]=n,t[53]=V,t[54]=K,t[55]=de}else de=t[55];let pe;t[63]===de?pe=t[64]:(pe=(0,$.jsx)(fe,{scrollFade:!0,className:`mt-2 h-auto max-h-80`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:de})}),t[63]=de,t[64]=pe);let me;t[65]===Y?me=t[66]:(me=Y?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:Y}):null,t[65]=Y,t[66]=me);let he;t[67]!==se||t[68]!==a?(he=(0,$.jsx)(m,{variant:`ghost-muted`,disabled:a,onClick:se,children:`Do not import projects`}),t[67]=se,t[68]=a,t[69]=he):he=t[69];let ge=!ne||a||z.length===0,X;t[70]!==le||t[71]!==z?(X=()=>void le(z),t[70]=le,t[71]=z,t[72]=X):X=t[72];let _e=a?`Importing…`:`Import ${z.length} ${z.length===1?`project`:`projects`}`,ve;t[73]!==ge||t[74]!==X||t[75]!==_e?(ve=(0,$.jsx)(m,{autoFocus:!0,disabled:ge,onClick:X,children:_e}),t[73]=ge,t[74]=X,t[75]=_e,t[76]=ve):ve=t[76];let ye;t[77]!==he||t[78]!==ve?(ye=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-end gap-3`,children:[he,ve]}),t[77]=he,t[78]=ve,t[79]=ye):ye=t[79];let be;return t[80]!==ue||t[81]!==pe||t[82]!==me||t[83]!==ye?(be=(0,$.jsxs)(Yt,{title:`Import your projects`,description:`Import projects and conversations from Claude Code and Codex on your selected computers.`,children:[ue,pe,me,ye]}),t[80]=ue,t[81]=pe,t[82]=me,t[83]=ye,t[84]=be):be=t[84],be}function jt(e){return e.key}function Mt(e){return e.isPending}function Nt(e){return e.data===null}function Pt(e){return e.key}function Ft(e){return Y(e.environmentId,C)}function It(){}function Lt(e){return e.data===null?[]:[e.environmentId]}function Rt(e){return e.key}function zt(e){return e.key}function Bt(e){return(e.data?.candidates??[]).map(t=>({...t,environmentId:e.environmentId,key:it(e.environmentId,t.path)}))}function Vt(e){let t=(0,Q.c)(25),{candidates:n,selectedKeys:r,onSelectionChange:a}=e,o;t[0]===n?o=t[1]:(o=et(n),t[0]=n,t[1]=o);let{repositories:s,other:c}=o,l;t[2]!==a||t[3]!==r?(l=(e,t)=>{let n=new Set(r);for(let r of e)t?n.add(r):n.delete(r);a(n)},t[2]=a,t[3]=r,t[4]=l):l=t[4];let u=l,d;if(t[5]!==c||t[6]!==r){let e;t[8]===r?e=t[9]:(e=e=>r.has(e.key),t[8]=r,t[9]=e),d=c.filter(e),t[5]=c,t[6]=r,t[7]=d}else d=t[7];let f=d.length,p;if(t[10]!==s||t[11]!==r||t[12]!==u){let e;t[14]!==r||t[15]!==u?(e=e=>(0,$.jsx)(Ut,{group:e,selectedKeys:r,onToggle:u},e.key),t[14]=r,t[15]=u,t[16]=e):e=t[16],p=s.map(e),t[10]=s,t[11]=r,t[12]=u,t[13]=p}else p=t[13];let m;t[17]!==c||t[18]!==f||t[19]!==r||t[20]!==u?(m=c.length>0?(0,$.jsxs)(Fe,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[(0,$.jsx)(X,{checked:f===c.length,indeterminate:f>0&&f<c.length,onCheckedChange:e=>u(c.map(Ht),e===!0)}),(0,$.jsxs)(Pe,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[(0,$.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),(0,$.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:`Other folders`}),(0,$.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[c.length,` `,c.length===1?`folder`:`folders`]})]})]}),(0,$.jsx)(Te,{children:c.map(e=>(0,$.jsx)(qt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>u([e.key],t)},e.key))})]}):null,t[17]=c,t[18]=f,t[19]=r,t[20]=u,t[21]=m):m=t[21];let h;return t[22]!==p||t[23]!==m?(h=(0,$.jsxs)($.Fragment,{children:[p,m]}),t[22]=p,t[23]=m,t[24]=h):h=t[24],h}function Ht(e){return e.key}function Ut(e){let t=(0,Q.c)(53),{group:n,selectedKeys:r,onToggle:a}=e,o,s;if(t[0]!==n.candidates||t[1]!==r){o=n.candidates.map(Gt);let e;t[4]===r?e=t[5]:(e=e=>r.has(e),t[4]=r,t[5]=e),s=o.filter(e),t[0]=n.candidates,t[1]=r,t[2]=o,t[3]=s}else o=t[2],s=t[3];let c=s.length,l=n.candidates.length===1,u=n.candidates[0];if(l&&u!==void 0){let e=n.label,i=u.path,o;t[6]!==u.key||t[7]!==r?(o=r.has(u.key),t[6]=u.key,t[7]=r,t[8]=o):o=t[8];let s;t[9]!==a||t[10]!==u.key?(s=e=>a([u.key],e),t[9]=a,t[10]=u.key,t[11]=s):s=t[11];let c;return t[12]!==n.label||t[13]!==u||t[14]!==o||t[15]!==s?(c=(0,$.jsx)(qt,{candidate:u,label:e,path:i,checked:o,onCheckedChange:s}),t[12]=n.label,t[13]=u,t[14]=o,t[15]=s,t[16]=c):c=t[16],c}let d=c===o.length,f=c>0&&c<o.length,p;t[17]!==o||t[18]!==a?(p=e=>a(o,e===!0),t[17]=o,t[18]=a,t[19]=p):p=t[19];let m;t[20]!==d||t[21]!==f||t[22]!==p?(m=(0,$.jsx)(X,{checked:d,indeterminate:f,onCheckedChange:p}),t[20]=d,t[21]=f,t[22]=p,t[23]=m):m=t[23];let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),t[24]=h):h=t[24];let g;t[25]===n.label?g=t[26]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.label}),t[25]=n.label,t[26]=g);let _;t[27]===n.candidates?_=t[28]:(_=new Set(n.candidates.flatMap(Wt)),t[27]=n.candidates,t[28]=_);let v;t[29]===_?v=t[30]:(v=[..._],t[29]=_,t[30]=v);let y;t[31]!==n.lastActiveAt||t[32]!==n.threadCount||t[33]!==v?(y=(0,$.jsx)(Jt,{sources:v,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[31]=n.lastActiveAt,t[32]=n.threadCount,t[33]=v,t[34]=y):y=t[34];let b;t[35]!==y||t[36]!==g?(b=(0,$.jsxs)(Pe,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[h,g,y]}),t[35]=y,t[36]=g,t[37]=b):b=t[37];let x;t[38]!==b||t[39]!==m?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[m,b]}),t[38]=b,t[39]=m,t[40]=x):x=t[40];let S;if(t[41]!==n.candidates||t[42]!==a||t[43]!==r){let e;t[45]!==a||t[46]!==r?(e=e=>(0,$.jsx)(qt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>a([e.key],t)},e.key),t[45]=a,t[46]=r,t[47]=e):e=t[47],S=n.candidates.map(e),t[41]=n.candidates,t[42]=a,t[43]=r,t[44]=S}else S=t[44];let C;t[48]===S?C=t[49]:(C=(0,$.jsx)(Te,{children:S}),t[48]=S,t[49]=C);let w;return t[50]!==x||t[51]!==C?(w=(0,$.jsxs)(Fe,{defaultOpen:!0,children:[x,C]}),t[50]=x,t[51]=C,t[52]=w):w=t[52],w}function Wt(e){return e.sources}function Gt(e){return e.key}function Kt(e){let t=(0,Q.c)(12),{path:n,className:r}=e,i;t[0]===n?i=t[1]:(i=rt(n),t[0]=n,t[1]=i);let{name:a,parent:o}=i,s;t[2]===r?s=t[3]:(s=y(`flex min-w-0 items-baseline font-mono`,r),t[2]=r,t[3]=s);let c;t[4]===o?c=t[5]:(c=o.length>0?(0,$.jsx)(`span`,{className:`truncate`,children:o}):null,t[4]=o,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,$.jsx)(`span`,{className:`max-w-full shrink-0 truncate`,children:a}),t[6]=a,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function qt(e){let t=(0,Q.c)(30),{candidate:n,label:r,path:i,nested:a,checked:o,onCheckedChange:s}=e,c=a!==void 0&&a,l=c&&`pl-8`,u;t[0]===l?u=t[1]:(u=y(`flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40 has-disabled:cursor-default`,l),t[0]=l,t[1]=u);let d;t[2]===s?d=t[3]:(d=e=>s(e===!0),t[2]=s,t[3]=d);let f;t[4]!==o||t[5]!==d?(f=(0,$.jsx)(X,{checked:o,onCheckedChange:d}),t[4]=o,t[5]=d,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2 truncate`}),t[7]=p):p=t[7];let m;t[8]===r?m=t[9]:(m=r===void 0?null:(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r}),t[8]=r,t[9]=m);let h;t[10]!==r||t[11]!==i?(h=i===void 0?null:(0,$.jsx)(Kt,{path:i,className:r===void 0?`text-xs`:`text-2xs text-muted-foreground`}),t[10]=r,t[11]=i,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,$.jsxs)(ce,{render:p,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]===n.path?_=t[17]:(_=(0,$.jsx)(le,{variant:`code`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==_||t[19]!==g?(v=(0,$.jsxs)(ue,{children:[g,_]}),t[18]=_,t[19]=g,t[20]=v):v=t[20];let b=c?null:n.sources,x;t[21]!==n.lastActiveAt||t[22]!==n.threadCount||t[23]!==b?(x=(0,$.jsx)(Jt,{sources:b,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[21]=n.lastActiveAt,t[22]=n.threadCount,t[23]=b,t[24]=x):x=t[24];let S;return t[25]!==v||t[26]!==x||t[27]!==u||t[28]!==f?(S=(0,$.jsxs)(`label`,{className:u,children:[f,v,x]}),t[25]=v,t[26]=x,t[27]=u,t[28]=f,t[29]=S):S=t[29],S}function Jt(e){let t=(0,Q.c)(19),{sources:n,threadCount:r,lastActiveAt:i}=e,a;t[0]===i?a=t[1]:(a=i===null?null:se(i),t[0]=i,t[1]=a);let o=a,s=o===null?``:o.suffix===null?`now`:o.value,c;t[2]===n?c=t[3]:(c=n?.includes(`claudeAgent`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Claude Code`,children:(0,$.jsx)(Ce,{driverKind:E.make(`claudeAgent`),displayName:`Claude Code`,iconClassName:`size-3`})}):null,t[2]=n,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:c}),t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=n?.includes(`codex`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Codex`,children:(0,$.jsx)(Ce,{driverKind:E.make(`codex`),displayName:`Codex`,iconClassName:`size-3`})}):null,t[6]=n,t[7]=u);let d;t[8]===u?d=t[9]:(d=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:u}),t[8]=u,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,$.jsx)(`span`,{className:`text-right`,children:r}),t[10]=r,t[11]=f);let p;t[12]===s?p=t[13]:(p=(0,$.jsx)(`span`,{className:`text-right whitespace-nowrap`,children:s}),t[12]=s,t[13]=p);let m;return t[14]!==l||t[15]!==d||t[16]!==f||t[17]!==p?(m=(0,$.jsxs)(`span`,{className:`ml-auto grid shrink-0 grid-cols-[1rem_1rem_2.5rem_2.25rem] items-center gap-x-1 text-xs text-muted-foreground tabular-nums`,children:[l,d,f,p]}),t[14]=l,t[15]=d,t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function Yt(e){let t=(0,Q.c)(8),{title:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)($.Fragment,{children:[a,o,i]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Xt=O(S);function Zt(){let e=(0,Q.c)(14),{authGateState:t}=je.useRouteContext(),n=G(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={select:$t},e[0]=r):r=e[0];let i=K(r),a;e[1]===i?a=e[2]:(a=i.startsWith(`agents:`)?D(Xt(i.slice(7))):void 0,e[1]=i,e[2]=a);let o=a,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={select:Qt},e[3]=s):s=e[3];let c=K(s),[l,u]=(0,Z.useState)(!1),d=ye(),f=t.status===`authenticated`,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ze,{}),e[4]=p):p=e[4];let m;e[5]!==l||e[6]!==c||e[7]!==f||e[8]!==n||e[9]!==d||e[10]!==o?(m=c&&!l?(0,$.jsx)(mt,{localAvailable:f,resumeEnvironmentId:o,onDone:async e=>{u(!0),e===void 0?await n({to:`/`,replace:!0}):await d(e,{replace:!0}).catch(()=>n({to:`/`,replace:!0}))}}):null,e[5]=l,e[6]=c,e[7]=f,e[8]=n,e[9]=d,e[10]=o,e[11]=m):m=e[11];let h;return e[12]===m?h=e[13]:(h=(0,$.jsxs)($.Fragment,{children:[p,m]}),e[12]=m,e[13]=h),h}function Qt(e){return e.pathname===`/welcome`}function $t(e){return e.hash}export{Zt as component};
2
+ //# sourceMappingURL=welcome-CJjj0VVp.js.map
@@ -384,7 +384,7 @@
384
384
  </script>
385
385
  <style>html,body,#root{width:100%;height:100%;margin:0}body{color:#262626;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}html.dark body{color:#f5f5f5;background:#0a0a0a}#boot-shell{background:inherit;min-height:100%;color:inherit;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}html[data-theme-selected=true] #boot-shell{background:var(--boot-background);color:var(--boot-foreground)}#boot-shell-card{z-index:1;justify-content:center;align-items:center;width:96px;height:96px;display:flex;position:relative}#boot-shell-logo{object-fit:contain;width:64px;height:64px}#boot-error{text-align:center;justify-items:center;gap:16px;max-width:600px;padding:24px;display:grid}#boot-error p{overflow-wrap:anywhere;margin:0}#boot-error button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:1px solid;border-radius:4px;padding:8px 16px}</style>
386
386
  <title>P4 Code</title>
387
- <script type="module" crossorigin src="/assets/index-ColdECgE.js"></script>
387
+ <script type="module" crossorigin src="/assets/index-C5VbGbq-.js"></script>
388
388
  </head>
389
389
  <body>
390
390
  <div id="root">
@@ -59148,7 +59148,7 @@ const writeFileStringAtomically = (input) => scoped(gen(function* () {
59148
59148
  yield* fs.rename(tempPath, targetPath);
59149
59149
  }));
59150
59150
  // package.json
59151
- var version = "0.9.20";
59151
+ var version = "0.9.21";
59152
59152
  // src/auth/ServerSecretStore.ts
59153
59153
  const secretStoreErrorContext = {
59154
59154
  resource: String$2,
@@ -98162,4 +98162,4 @@ function normalizePreviewUrl(rawUrl) {
98162
98162
  }
98163
98163
  export { layer$26 as $, normalizeThreadPullRequestKey as $a, LogLevel as $c, newProjectFolderName as $i, WebSocketConstructor as $l, CLOUD_ENDPOINT_CONFIRMED_ORIGIN as $n, nonEmptyTrimmed as $o, layer$59 as $r, resolveSpawnCommand as $s, sanitizeBranchFragment as $t, GitVcsDriver as A, readMcpAppPermissions as Aa, modifyEffect as Ac, pendingBackgroundTurnItems as Ai, get$2 as Al, layer$52 as An, compareExactServiceVersions as Ao, ServerConfig as Ar, satisfiesSemverRange as As, webhookDeliveriesTotal as At, hasProjectSettingsOverrides as B, htmlRenderThemeFragment as Ba, tags as Bc, constants as Bi, get$3 as Bl, redactServerSettingsForClient as Bn, pinnedRuntimePaths as Bo, getBackgroundActivityPresetSettings as Br, modelSelectionsEqual as Bs, RepositoryIdentityResolver as Bt, formatPatch as C, MCP_APP_OUTPUT_KEY as Ca, Terminal as Cc, sweepStalePendingAttachments as Ci, set$1 as Cl, ServerEnvironment as Cn, void_ as Co, isSecretAlreadyExistsError as Cr, redactCauseCredentials as Cs, providerTurnsTotal as Ct, SourceControlRateLimit as D, injectMcpAppThemeBootstrap as Da, get as Dc, resolveAttachmentRelativePath as Di, TracerDisabledWhen as Dl, ServerSelfUpdate as Dn, SERVICE_RESTART_PENDING_FILE as Do, writeFileStringAtomically as Dr, layerJson as Ds, secretRequestsTotal as Dt, Interactive as E, injectMcpAppCsp as Ea, make$61 as Ec, parseBase64DataUrl as Ei, HttpClient as El, layerIdentity as En, SERVICE_LAUNCHER_CONTEXT_ENV as Eo, version as Er, OtlpSerialization as Es, secretRefsConsumedTotal as Et, makeIsServerInternalPath as F, HTML_RENDER_THEME_GUIDE as Fa, SpanPropagationEnabled as Fc, usageLimitBlockedRun as Fi, tap as Fl, writeAllToFileDescriptor as Fn, serviceStateHasPendingUpdate as Fo, otlpResource as Fr, getModelSelectionBooleanOptionValue as Fs, withMetrics as Ft, planThreadDeletion as G, mergeWithDefaultKeybindings as Ga, make$66 as Gc, projectComposerContextForProvider as Gi, set$2 as Gl, FxSettings as Gn, COMPACT_SLASH_COMMAND as Go, fromLenientJson as Gr, CommandResolutionCache as Gs, flattenTemporaryWorktreeBranchName as Gt, resolveWorktreeCleanup as H, DEFAULT_KEYBINDINGS as Ha, when as Hc, longestStreak as Hi, getAndUpdate as Hl, OpenCodeSettings as Hn, ProcessRunner as Ho, decodeJsonResult as Hr, readCustomModelEntries as Hs, make$38 as Ht, extractBranchNameFromRemoteRef as I, HTML_RENDER_TOOL_NAME as Ia, isSqlError as Ic, chatMarkdownImageSources as Ii, tapError as Il, subscribeBeforeSnapshot as In, PinnedRuntimeInstallError as Io, resolveStaticDir as Ir, getModelSelectionStringOptionValue as Is, normalizeModelMetricLabel as It, LegacyV1ThreadImporter as J, BUILT_IN_THEME_IDS as Ja, Crypto as Jc, isExplicitRelativePath as Ji, CloseEvent as Jl, decode as Jn, buildSelectOptionDescriptor as Jo, none as Jr, listLoginShellCandidates as Js, mergeGitStatusParts as Jt, ThreadCommandExecutor as K, parseKeybindingShortcut as Ka, run as Kc, remapComposerContextAttachments as Ki, update$1 as Kl, CursorSettings as Kn, DEFAULT_TIMEOUT_MS$4 as Ko, layerResourceAttributes as Kr, SpawnExecutableResolution as Ks, formatGeneratedBranchName as Kt, isFilesystemRoot as L, blankNonMarkup as La, exhaustive as Lc, formatThreadLink as Li, transform$1 as Ll, subscribeBeforeSnapshotWithoutMutex as Ln, ensurePinnedRuntimeInstalled as Lo, parsePersistedServerObservabilitySettings as Lr, getProviderOptionCurrentValue as Ls, make$36 as Lt, VcsProcess as M, HTML_RENDER_MAX_HEIGHT as Ma, update as Mc, latestExecutedRun as Mi, mapRequestEffect as Ml, layer$53 as Mn, isExactServiceVersion as Mo, ensureServerDirectories as Mr, codexModelFamily as Ms, webhookHeldDelay as Mt, layer$22 as N, HTML_RENDER_MEASURE_FONTS as Na, map$2 as Nc, latestRootProviderFailure as Ni, retry as Nl, DesktopTelemetryReceiver as Nn, parseServiceState as No, layer$57 as Nr, createModelCapabilities as Ns, webhookRunsTotal as Nt, layer$20 as O, mcpAppToolCallableByApp as Oa, make$62 as Oc, backgroundWorkHoldsCompletion as Oi, TracerPropagationEnabled as Ol, layer$51 as On, SERVICE_STATE_FILE as Oo, DEFAULT_PORT as Or, compareSemverVersions as Os, terminalRestartsTotal as Ot, PATCH_RENDER_PREFIX_ARGS as P, HTML_RENDER_MEASURE_WIDTHS as Pa, SqlClient as Pc, runRanAfter as Pi, retryTransient as Pl, layer$54 as Pn, serviceStateActiveVersion as Po, make$53 as Pr, formatCodexModelName as Ps, withCommandMetrics as Pt, deriveThreadFromProviderThread as Q, legacyThreadPullRequestKey as Qa, Int as Qc, isWindowsDrivePath as Qi, WebSocket as Ql, toUint8Array as Qn, isWindowsCommandNotFound as Qo, ProjectionMaintenanceV2 as Qr, resolveCommandPath as Qs, resolveAutoFeatureBranchName as Qt, managedWorktreesDirectories as R, clampHtmlRenderHeight as Ra, is as Rc, remarkGfm as Ri, transformResponse as Rl, ServerSettingsService as Rn, launcherOwnsVersionsDir as Ro, resolveReviewGuideModelSelection as Rr, getProviderOptionDescriptors as Rs, ProjectEnrichmentService as Rt, FILE_HEADERS_ONLY as S, MCP_APP_MIME_TYPE as Sa, QuitError as Sc, resolveAttachmentPathById as Si, refresh as Sl, layer$45 as Sn, findOneOption as So, ServerSecretStore as Sr, makeTraceSink as Ss, providerTurnDuration as St, unquoteGitPatchPath as T, injectMcpAppCookieBootstrap as Ta, Stdio as Tc, inferImageExtension as Ti, nextIntBetween as Tl, layer$50 as Tn, readOnly as To, layer$56 as Tr, makeAsyncRotatingFileSink as Ts, rpcRequestsTotal as Tt, ProjectService as U, compileResolvedKeybindingRule as Ua, awaitEmpty as Uc, assistantCitationsToPlainText as Ui, make$72 as Ul, MuseSettings as Un, layer$64 as Uo, extractJsonObject as Ur, resolvePromptInjectedEffort as Us, buildTemporaryWorktreeBranchName as Ut, resolveProjectSettings as V, injectHtmlRenderBootstrap as Va, value as Vc, codes as Vi, getAndSet as Vl, PiSettings as Vn, pinnedRuntimeVersionsDir as Vo, resolveServerBackgroundActivitySettings as Vr, normalizeModelSlug as Vs, layer$34 as Vt, layer$23 as W, compileResolvedKeybindingsConfig as Wa, clear as Wc, isAttachmentOnlyBootstrapPrompt as Wi, modify$1 as Wl, GrokSettings as Wn, AUTH_PROBE_TIMEOUT_MS as Wo, fromJsonStringPretty as Wr, collectUint8StreamText as Ws, detectSourceControlProviderFromGitRemoteUrl as Wt, IdAllocatorV2 as X, P4_CODE_LIGHT_THEME_COLORS as Xa, Boolean$1 as Xc, isUncPath as Xi, SocketErrorReason as Xl, pipeThroughDuplex as Xn, collectStreamAsString as Xo, NetService as Xr, readEnvironmentFromLoginShell as Xs, parseGitHubRepositoryNameWithOwnerFromRemoteUrl as Xt, layer$25 as Y, P4_CODE_DARK_THEME_COLORS as Ya, make$67 as Yc, isNetworkPath as Yi, SocketError as Yl, fromReadable as Yn, buildServerProvider as Yo, resolveSignalEndpoint as Yr, mergePathEntries as Ys, normalizeGitRemoteUrl as Yt, derive as Z, UNPUBLISHABLE_THEME_IDS as Za, ConfigError as Zc, isWindowsAbsolutePath as Zi, SocketOpenError as Zl, toArrayBuffer as Zn, isCommandMissingCause as Zo, layer$58 as Zr, readPathFromLaunchctl as Zs, parseOriginUrlFromGitConfig as Zt, layer$6 as _, toolOutputImages as _a, IsExecutable as _c, parseAttachmentFileExtension as _i, invalidate as _l, require_dist as _n, PersistenceDecodeError as _o, resolveHostCliCommand as _r, causeErrorTag as _s, increment as _t, normalizePreviewUrl as a, markdownLineEndingOrSpace as aa, CLI_RELEASE_CHANNELS as ac, InvalidThreadHistoryCursorError as ai, String$1 as al, WorkspacePaths as an, changeRequestUrlFor as ao, PUBLISH_AGENT_ACTIVITY_SECRET as ar, makeManualOnlyProviderMaintenanceCapabilities as as, layer$29 as at, isGreaterThanOrEqualTo as au, firstNonEmptyLine as b, MCP_APP_EXTENSION_ID as ba, WorkingDirectory as bc, planAttachmentClaim as bi, make$70 as bl, make$42 as bn, makeLiveStreamBudget as bo, SecretStoreDecodeError as br, layerOtlpSerialization as bs, orchestrationEffectQueueWait as bt, rejectCommandsDuringClone as c, capProjectionCheckpointFilesForWire as ca, RequestInit as cc, buildBoundedThreadProjection as ci, map$3 as cl, WorkspaceRootNotExistsError as cn, canonicalRepositoryKey as co, RELAY_URL_SECRET as cr, makeTargetedProviderUpdateAction as cs, REPLAY_SAFE_EFFECT_TYPES_AFTER_PROCESS_LOSS as ct, encode$1 as cu, SourceControlProviderRegistry as d, projectTurnItemForDetail as da, Arguments as dc, attachmentFileExtension as di, schema as dl, layer$37 as dn, isSshRemoteUrl as do, encodeConfirmedOriginJson as dr, resolveProviderMaintenanceCapabilitiesEffect as ds, ServerActivation as dt, withAttributes as du, normalizeProjectPathForComparison as ea, resolveWindowsEnvironment as ec, ProjectionStoreV2 as ei, NonEmptyString as el, sanitizeFeatureBranchName as en, resolveThreadPullRequestChains as eo, CLOUD_ENDPOINT_RUNTIME_CONFIG as er, parseGenericCliVersion as es, randomUuidV4 as et, fromWebSocket as eu, layer$2 as f, MAX_TOOL_OUTPUT_IMAGE_BASE64_LENGTH as fa, Environment as fc, attachmentRelativePath as fi, withDefault as fl, claudeLaunchArgDirectories as fn, sourceControlRepositorySelector as fo, encodeEndpointRuntimeConfigJson as fr, ProviderLatestVersions as fs, forkParked as ft, layer$5 as g, toolOutputImageBlocks as ga, InvokedAs as gc, createPendingAttachmentId as gi, getSuccess as gl, expandHomePath as gn, layer$62 as go, resolveCliCommand as gr, OtlpProtocol as gs, layer$32 as gt, VcsDriverRegistry as h, readToolOutputImage as ha, Hostname as hc, createDeterministicAttachmentId as hi, getOption as hl, resolveClaudeConfigDirPath as hn, OrchestrationEventStore as ho, readRelayConnection as hr, OtlpHeadersFromString as hs, layerFromApplicationReceipts as ht, newPreviewTabId as i, markdownLineEnding as ia, CLI_RELEASE_BASE_URL_ENV as ic, threadShellFromProjection as ii, Redacted as il, WorkspacePathOutsideRootError as in, visibleThreadPullRequests as io, HOLD_WEBHOOKS_WHILE_OFFLINE_SECRET as ir, makeCachedProviderMaintenanceResolution as is, ProjectStoreV2 as it, getType as iu, layer$21 as j, HTML_RENDER_LAYOUT_GUIDE as ja, set as jc, turnItemUpdateCanEndBackgroundWork as ji, mapRequest as jl, runServicePreflight as jn, decodeServiceLauncherChildMessage as jo, deriveServerPaths as jr, applyClaudePromptEffortPrefix as js, webhookDeliveryDuration as jt, repositoryPathFromRemoteUrl as k, readMcpAppCsp as ka, modify as kc, derivePendingBackgroundWork as ki, filterStatusOk as kl, ServiceLauncherClient as kn, SERVICE_STOP_MARKER_FILE as ko, RuntimeMode as kr, parseSemver as ks, terminalSessionsTotal as kt, SourceControlRepositoryService as l, projectDomainEventForWire as la, layer$66 as lc, decodeThreadHistoryCursor as li, mapEffect as ll, WorkspaceRootStatFailedError as ln, detectSourceControlProviderFromRemoteUrl as lo, decodeConfirmedOrigin as lr, normalizeCommandPath as ls, layer$30 as lt, snapshotUnsafe as lu, layer$3 as m, mcpToolResultOutput as ma, HomeDirectory as mc, createAttachmentId as mi, get$1 as ml, readClaudeSettingsEnv as mn, layerFromOrchestrationEventStore as mo, readHoldWebhooksWhileOffline as mr, DEFAULT_SIGNAL_EXPORT as ms, CommandReceiptStoreV2 as mt, isLoopbackHost as n, remarkParse as na, make$58 as nc, emptyProjection as ni, Port as nl, layer$35 as nn, threadPullRequestKeysEqual as no, CLOUD_LINK_REVOKED as nr, spawnAndCollect as ns, layerFromStores as nt, make$73 as nu, ProjectCloneTracker as o, ok$1 as oa, cliReleaseChannelIndexUrl as oc, THREAD_HISTORY_PAGE_POLICY as oi, URL$1 as ol, WorkspaceRootCreateFailedError as on, parseChangeRequestUrl as oo, RELAY_ENVIRONMENT_CREDENTIAL_SECRET as or, makePackageManagedProviderMaintenanceResolver as os, EffectOutboxV2 as ot, decode$2 as ou, BUILT_IN_SOURCE_CONTROL_DRIVERS as p, mcpAppFromToolItem as pa, ExecutablePath as pc, chatAttachmentStableKey as pi, SourceError as pl, discoverClaudeSkills as pn, layer$61 as po, isAgentActivityPublishingEnabledValue as pr, layer$65 as ps, forkParkedFiber as pt, layer$24 as q, parseKeybindingWhenExpression as qa, runtime as qc, markdownDestinationHostPath as qi, updateAndGet as ql, AcpRegistrySettings as qn, buildBooleanOptionDescriptor as qo, load as qr, isCommandAvailable as qs, isTemporaryWorktreeBranch as qt, isPreviewUrlNormalizationError as r, factorySpace as ra, ChildProcessSpawner as rc, layer$60 as ri, Record as rl, layer$36 as rn, threadPullRequestsOf as ro, CLOUD_MINT_PUBLIC_KEY as rr, enrichProviderSnapshotWithVersionAdvisory as rs, layer$28 as rt, makeWebSocket as ru, layer as s, boundFileChangeForStorage as sa, cliReleaseChannelOf as sc, THREAD_HISTORY_SNAPSHOT_ROW_LIMIT as si, all$4 as sl, WorkspaceRootNotDirectoryError as sn, siblingPullRequestUrl as so, RELAY_ISSUER_SECRET as sr, makeProviderMaintenanceCapabilities as ss, PROCESS_BOUND_EFFECT_TYPES as st, decodeString$2 as su, LSOF_LOCAL_HOST_TOKENS as t, unified as ta, withPathDirectoryListings as tc, applyToProjection as ti, Number$1 as tl, ProjectFaviconResolver as tn, threadPullRequestKeyOf as to, CLOUD_LINKED_USER_ID as tr, providerModelsFromSettings as ts, EventSinkV2 as tt, isSocketError as tu, layer$1 as u, projectThreadProjectionForWire as ua, Architecture as uc, PENDING_ATTACHMENT_THREAD_SEGMENT as ui, option as ul, isWithinRoot as un, getChangeRequestTerminologyForKind as uo, decodeRuntimeConfig as ur, resolveLatestProviderVersion as us, layerPruneWorker as ut, update$2 as uu, GitHubCredentials as v, P4_MCP_TOOL_NAMES as va, Platform as vc, parseAttachmentUuid as vi, invalidateAll as vl, parseCliArgs as vn, PersistenceSqlError as vo, resolveRootCliCommand as vr, decodeOtlpTraceRecords as vs, metricAttributes as vt, structuredPatch as w, MCP_APP_RESOURCE_SCHEME as wa, isQuitError as wc, toSafeThreadAttachmentSegment as wi, next$1 as wl, ServerEnvironmentIdentity as wn, layer$63 as wo, isSecretStoreError as wr, RotatingFileSink as ws, rpcRequestDuration as wt, PullRequestProviderError as x, MCP_APP_MAX_HTML_BYTES as xa, isWindows as xc, resolveAttachmentPath as xi, makeWith$2 as xl, layer$38 as xn, findAll as xo, SecretStoreEncodeError as xr, makeLocalFileTracer as xs, providerSessionsTotal as xt, detailFromCause as y, resolveP4McpToolDefinition as ya, UserId as yc, parseThreadSegmentFromAttachmentId as yi, keys$1 as yl, tokenizeCliArgs as yn, bufferLiveStream as yo, SecretStoreConcurrentReadError as yr, errorTag as ys, orchestrationEffectClaimsTotal as yt, removeLinkedWorktree as z, htmlRenderTheme as za, tag as zc, types as zi, withScope as zl, layer$55 as zn, pinnedRuntimeCommand as zo, resolveSourceControlWriterModelSelection as zr, modelSelectionCommandType as zs, layer$33 as zt };
98164
98164
 
98165
- //# sourceMappingURL=preview-DcFC_OYY.mjs.map
98165
+ //# sourceMappingURL=preview-JlPVV2bV.mjs.map