@p4code/cli 0.9.18 → 0.9.20

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 (342) hide show
  1. package/dist/AcpMcpStdioBridge-DbCGhPmy.mjs +3 -0
  2. package/dist/{AcpMcpStdioBridge-4vUttgH1.mjs → AcpMcpStdioBridge-DxIZyDJz.mjs} +4 -4
  3. package/dist/{Effect-_Rz7VLdg.mjs → Effect-BqRgldaH.mjs} +20 -4
  4. package/dist/{Schema-APnY3Ozr.mjs → Schema-CkGB1Dgx.mjs} +2 -2
  5. package/dist/{Stream-CJtpwu3-.mjs → Stream-DZTo5F3N.mjs} +2 -2
  6. package/dist/{TraceDiagnostics-CeQ-TvdA.mjs → TraceDiagnostics-BYrlvKdA.mjs} +278 -50
  7. package/dist/bin.mjs +2 -2
  8. package/dist/{binCli-DzRO6f_z.mjs → binCli-DReuiGmk.mjs} +297 -125
  9. package/dist/claude-history-worker.mjs +1 -1
  10. package/dist/{claudeHistoryWorker-B6KX_N9G.mjs → claudeHistoryWorker-Cst8OnLH.mjs} +1 -1
  11. package/dist/{claudeHistoryWorker-DZ1Ft4NK.mjs → claudeHistoryWorker-r4mV4Dxy.mjs} +2 -2
  12. package/dist/client/.vite/manifest.json +2139 -2127
  13. package/dist/client/assets/{2NI2N5EU-Ds9jiLPm.js → 2NI2N5EU-DjM2qwkD.js} +2 -2
  14. package/dist/client/assets/{4UO7MD6I-BWEQQJHY.js → 4UO7MD6I-BJdq41GZ.js} +2 -2
  15. package/dist/client/assets/{5B3SVYGG-lcm66GRf.js → 5B3SVYGG-D21CBy6j.js} +2 -2
  16. package/dist/client/assets/{5GK6JWQ2-DegG64te.js → 5GK6JWQ2-DOIdqlC8.js} +2 -2
  17. package/dist/client/assets/{5N7A7DKN-CDv2ioO3.js → 5N7A7DKN-Bckll9rH.js} +2 -2
  18. package/dist/client/assets/{5OC2THR4-CaZVvwg8.js → 5OC2THR4-skJPz5iO.js} +2 -2
  19. package/dist/client/assets/{5S6HY5KT-B8WMtvrw.js → 5S6HY5KT-CRwXaSb1.js} +2 -2
  20. package/dist/client/assets/{6IMQ5BUJ-R-et-GtO.js → 6IMQ5BUJ-sJYhkmUL.js} +2 -2
  21. package/dist/client/assets/{6OLKWJ4F-CdOZHr7D.js → 6OLKWJ4F-DY2aNKk1.js} +2 -2
  22. package/dist/client/assets/{74OO7NKP-DVS5qE0v.js → 74OO7NKP-DpZyVE6P.js} +2 -2
  23. package/dist/client/assets/{75O6YZUN-B6bJpGs2.js → 75O6YZUN-8DIThGtQ.js} +2 -2
  24. package/dist/client/assets/{77XECAW3-DDozcJnk.js → 77XECAW3-BE-MTjvu.js} +2 -2
  25. package/dist/client/assets/{ABYRPUBD-BZd5-ucB.js → ABYRPUBD-DB_eiHX6.js} +2 -2
  26. package/dist/client/assets/AlertDialogRoot-COfNlajP.js +2 -0
  27. package/dist/client/assets/{AnimatedHeight-CsOfc5H1.js → AnimatedHeight-BoS1RBdk.js} +2 -2
  28. package/dist/client/assets/{AuthSurfaceShell--2lH1vql.js → AuthSurfaceShell-BM3c1qJe.js} +2 -2
  29. package/dist/client/assets/{BB2UYUI2-DAb-WdIu.js → BB2UYUI2-BhRNS6b8.js} +2 -2
  30. package/dist/client/assets/{BUM34MOA-DMU6CGcz.js → BUM34MOA-RvYWUXux.js} +2 -2
  31. package/dist/client/assets/{CEQABKGZ-BnDJUiDl.js → CEQABKGZ-byct14yE.js} +2 -2
  32. package/dist/client/assets/{CXAC5362-QKBU6D2s.js → CXAC5362-YcQsQFwj.js} +2 -2
  33. package/dist/client/assets/ChatGptUsageButton-BQOZ260S.js +2 -0
  34. package/dist/client/assets/ChatMarkdown-BdoTEVpd.js +49 -0
  35. package/dist/client/assets/{CheckboxIndicator-CLFg8-A1.js → CheckboxIndicator-Dj91Im5z.js} +2 -2
  36. package/dist/client/assets/{ClippedText-aNLi0IDp.js → ClippedText-CmBRrYNb.js} +2 -2
  37. package/dist/client/assets/CodexSetupSection.logic-CseyxFgK.js +2 -0
  38. package/dist/client/assets/{CollapsiblePanel-BlUD5mJC.js → CollapsiblePanel-BwDr-EKA.js} +2 -2
  39. package/dist/client/assets/{ComboboxClear-DKHwuDAL.js → ComboboxClear-DeqR6c-6.js} +2 -2
  40. package/dist/client/assets/{ComboboxGroupLabel-BaZLyLCv.js → ComboboxGroupLabel-Dk-MF4sD.js} +2 -2
  41. package/dist/client/assets/{CommandBlock-Bg2O3rbF.js → CommandBlock-Cg8P2GXg.js} +2 -2
  42. package/dist/client/assets/{CompositeRoot-_C3uLH2F.js → CompositeRoot-Cx12XSsh.js} +2 -2
  43. package/dist/client/assets/{ConnectAgentSurface-D-fMTn_R.js → ConnectAgentSurface-D9MYjA6g.js} +2 -2
  44. package/dist/client/assets/{ConnectionStatusDot-vOKtZfeV.js → ConnectionStatusDot-BnhNFCMA.js} +2 -2
  45. package/dist/client/assets/{DRLTVNUE-DvpJAT6K.js → DRLTVNUE-BZ7eTlHc.js} +2 -2
  46. package/dist/client/assets/{DYY6UVD2-DFSg5DAZ.js → DYY6UVD2-DIWnFjlV.js} +2 -2
  47. package/dist/client/assets/{DevicePanel-Dvozgov3.js → DevicePanel-CpWnw2HZ.js} +2 -2
  48. package/dist/client/assets/DeviceSetup-C02U1yvN.js +2 -0
  49. package/dist/client/assets/{DialogTitle-C9j5Tmuy.js → DialogTitle-5cBExuFs.js} +2 -2
  50. package/dist/client/assets/{DiffCommentAnnotation-CAml763Q.js → DiffCommentAnnotation-CHYeyesq.js} +3 -3
  51. package/dist/client/assets/{DiffFileTree-2Y-Da6MW.js → DiffFileTree-zq0G5Jq3.js} +2 -2
  52. package/dist/client/assets/DiffPanel-ghqOrQdi.js +2 -0
  53. package/dist/client/assets/{DiffWorkerPoolProvider-Czi5bOUV.js → DiffWorkerPoolProvider-QbRiMHeR.js} +3 -3
  54. package/dist/client/assets/{EmbeddedDesign-AHra-cLY.js → EmbeddedDesign-ExUecHKZ.js} +6 -6
  55. package/dist/client/assets/{EnvironmentMachineIcon-BnMVjB89.js → EnvironmentMachineIcon-Lz2YGk0G.js} +2 -2
  56. package/dist/client/assets/{ExpandableText-gKNgCxfU.js → ExpandableText-B034p2kF.js} +2 -2
  57. package/dist/client/assets/{FNOVOB4O-D2IqnTWb.js → FNOVOB4O-Cch7VyQQ.js} +2 -2
  58. package/dist/client/assets/{FieldControl-Bjdbc6Ii.js → FieldControl-H6iQvC-Q.js} +2 -2
  59. package/dist/client/assets/{FileDiff-Di0hvnyJ.js → FileDiff-C1_8HZ7T.js} +2 -2
  60. package/dist/client/assets/{FilePreviewPanel-2-RLs_YZ.js → FilePreviewPanel-DERxofVe.js} +6 -6
  61. package/dist/client/assets/FoldedSettingsSection-okCu3zVD.js +2 -0
  62. package/dist/client/assets/{HDGCDEEZ-AZF834xy.js → HDGCDEEZ-CJ_9BjZ0.js} +2 -2
  63. package/dist/client/assets/{HSJLKHB7-Dtz-7WMf.js → HSJLKHB7-BvfNYUiJ.js} +2 -2
  64. package/dist/client/assets/{Icons-BzIBDVKW.js → Icons-DmQwwfAN.js} +2 -2
  65. package/dist/client/assets/Input-DWc7cRWt.js +2 -0
  66. package/dist/client/assets/{IntervalSecondsField-Fdrpvkqj.js → IntervalSecondsField-S7jLIub2.js} +2 -2
  67. package/dist/client/assets/JZOYTAAL-RUIcMwMn.js +1 -0
  68. package/dist/client/assets/{K3MD6TGW-BPz_yQfQ.js → K3MD6TGW-C513S1_s.js} +2 -2
  69. package/dist/client/assets/{K7RP3OMA-C-IhAYzY.js → K7RP3OMA-zhgZmSWl.js} +2 -2
  70. package/dist/client/assets/{KeybindingsSettings.logic-DjD-8Wsr.js → KeybindingsSettings.logic-C6XG7NtX.js} +2 -2
  71. package/dist/client/assets/{LHDIQX7Q-Dw7FK-yZ.js → LHDIQX7Q-BmjYN5gQ.js} +2 -2
  72. package/dist/client/assets/{LUXOKEGN-Cp4yLfcO.js → LUXOKEGN-B0Kwi43W.js} +2 -2
  73. package/dist/client/assets/{LinkMachineSelect-v3ZAAPFG.js → LinkMachineSelect-GyKAeGYQ.js} +2 -2
  74. package/dist/client/assets/{MathTypeset-CAVYwtpt.js → MathTypeset-DfU_zRMI.js} +2 -2
  75. package/dist/client/assets/ModelLiveLayer-DjtYQpVe.js +3 -0
  76. package/dist/client/assets/{N3JZAHOW-sZve4CbV.js → N3JZAHOW-BXB2c-Us.js} +2 -2
  77. package/dist/client/assets/{NUIALGQ3-DMlKhtdq.js → NUIALGQ3-BkehuL9A.js} +2 -2
  78. package/dist/client/assets/{NoProjectsHero-B0ChXuQG.js → NoProjectsHero-C-VNr8Ui.js} +2 -2
  79. package/dist/client/assets/{O65XPQGZ-COhBlGA1.js → O65XPQGZ-CPn-XJue.js} +2 -2
  80. package/dist/client/assets/{O7XIQ6OM-D-y75rjS.js → O7XIQ6OM-DAQPVVnq.js} +2 -2
  81. package/dist/client/assets/{OFQON5FD-kw-f4mV4.js → OFQON5FD-BKoNBxEK.js} +2 -2
  82. package/dist/client/assets/{P4ConnectAccountPages-BXM_FJyy.js → P4ConnectAccountPages-C_7SfUQ2.js} +2 -2
  83. package/dist/client/assets/{P4ConnectSidebarSignIn-D8uwPPR6.js → P4ConnectSidebarSignIn-B6e-wkqI.js} +2 -2
  84. package/dist/client/assets/{PJQHF43J-Dww1R-k6.js → PJQHF43J-Byb4NdRa.js} +2 -2
  85. package/dist/client/assets/PanelLayoutControls-BpjspxNc.js +216 -0
  86. package/dist/client/assets/{PierreEntryIcon-C-5f-jFb.js → PierreEntryIcon-h4qT502J.js} +2 -2
  87. package/dist/client/assets/{PopoverHandle-BwqnKm9Y.js → PopoverHandle-DEcvmS0k.js} +2 -2
  88. package/dist/client/assets/PreviewPanel-lT6UT8SC.js +2 -0
  89. package/dist/client/assets/{ProjectDefaultsSettings-rvN_67Gu.js → ProjectDefaultsSettings-nqWOPUBM.js} +2 -2
  90. package/dist/client/assets/{ProjectFavicon-CPvmNs3J.js → ProjectFavicon-wwkvNTYJ.js} +3 -3
  91. package/dist/client/assets/{ProjectIconPickerDialog-blbck4gY.js → ProjectIconPickerDialog-CAEx0HQF.js} +2 -2
  92. package/dist/client/assets/{ProjectMonogram-Cesz5yVS.js → ProjectMonogram-C8btbogu.js} +2 -2
  93. package/dist/client/assets/{ProviderAuthTerminal-BXGE9cPY.js → ProviderAuthTerminal-Seln-0IQ.js} +2 -2
  94. package/dist/client/assets/ProviderModelPicker-p5oWTfTD.js +2 -0
  95. package/dist/client/assets/{ProviderSettingsForm-CRvI8mDe.js → ProviderSettingsForm-DP5cO9tc.js} +2 -2
  96. package/dist/client/assets/PullRequestCodeTab-BhWK4Zqq.js +6 -0
  97. package/dist/client/assets/{RHNBAITX-CY4FKVtu.js → RHNBAITX-ZKmIoa8f.js} +2 -2
  98. package/dist/client/assets/{ReadOnlySourcePreview-DK9ZCAf4.js → ReadOnlySourcePreview-C8hhN481.js} +2 -2
  99. package/dist/client/assets/{RedactedSensitiveText-DrIhPFXw.js → RedactedSensitiveText-BMXImj30.js} +2 -2
  100. package/dist/client/assets/RenderErrorBoundary-CYWiIuBa.js +23 -0
  101. package/dist/client/assets/{RightPanelResizeHandle-DBCfKzRv.js → RightPanelResizeHandle-Cog3JVw0.js} +2 -2
  102. package/dist/client/assets/{SLD4V6NK-Dtrbq5qR.js → SLD4V6NK-BW_1--rc.js} +2 -2
  103. package/dist/client/assets/{ScheduledTasksSettings-CvbQDrJp.js → ScheduledTasksSettings-D6cHBUhW.js} +6 -6
  104. package/dist/client/assets/{ScopedSwitch-DQHfQgMZ.js → ScopedSwitch-BzU8Hn6s.js} +2 -2
  105. package/dist/client/assets/{ScrollAreaCorner-B9Aiu69u.js → ScrollAreaCorner-DFCZuJ0r.js} +2 -2
  106. package/dist/client/assets/{SecretInput-CxJl9pux.js → SecretInput-CRgvNUgU.js} +2 -2
  107. package/dist/client/assets/{SelectScrollUpArrow-Dj2om6Qx.js → SelectScrollUpArrow-C-MWJdyw.js} +2 -2
  108. package/dist/client/assets/{SelfImproveSettingsSection-yFj7aCio.js → SelfImproveSettingsSection--Dcxxm73.js} +2 -2
  109. package/dist/client/assets/{SettingsPanels-H_7XUe5G.js → SettingsPanels-C79826rW.js} +7 -7
  110. package/dist/client/assets/{SettingsPanels.logic-BYLv56aj.js → SettingsPanels.logic-DPfiTtgf.js} +2 -2
  111. package/dist/client/assets/{SettingsScopeNotice-pJqEfHRd.js → SettingsScopeNotice-C9OAfACb.js} +2 -2
  112. package/dist/client/assets/{SidebarStageBackdrop-DWShR_RZ.js → SidebarStageBackdrop-syJ1VaYP.js} +2 -2
  113. package/dist/client/assets/{T3PCR2KE-BFmO9IZ-.js → T3PCR2KE-Bc51hYDo.js} +2 -2
  114. package/dist/client/assets/{TKWO2OVW-DMeVANpK.js → TKWO2OVW-mV-gJkJw.js} +2 -2
  115. package/dist/client/assets/{TSHNXIZL-COvYTPCc.js → TSHNXIZL-Bs_azRDw.js} +2 -2
  116. package/dist/client/assets/{ThemeEditorPanel-BxOl9N6E.js → ThemeEditorPanel-DvlDdC-r.js} +3 -3
  117. package/dist/client/assets/{ThreadDetailsItemsMenu-BXQbo6bY.js → ThreadDetailsItemsMenu-DFAwPwtf.js} +44 -44
  118. package/dist/client/assets/ThreadTerminalDrawer-CBRpijGu.js +5 -0
  119. package/dist/client/assets/TooltipProvider-DiV5KdTq.js +2 -0
  120. package/dist/client/assets/{UQJE5E4I-CajoppS3.js → UQJE5E4I-DL8IPyLr.js} +2 -2
  121. package/dist/client/assets/{USNYFO5S-BQLaJAkC.js → USNYFO5S-CxX5m2eb.js} +2 -2
  122. package/dist/client/assets/{Virtualizer-kAxtf9JI.js → Virtualizer-hL0IrPqB.js} +2 -2
  123. package/dist/client/assets/{WEVWDWVA-Bn1CMBLe.js → WEVWDWVA-CCg7BLOe.js} +2 -2
  124. package/dist/client/assets/{WorkspaceBreadcrumb-KdZMrP13.js → WorkspaceBreadcrumb-Cok6l_SJ.js} +2 -2
  125. package/dist/client/assets/{WorkspacePageContainer-VqvvyrKx.js → WorkspacePageContainer-_--jFIZ8.js} +2 -2
  126. package/dist/client/assets/{WorkspacePageHeader-Ca7-ugiS.js → WorkspacePageHeader-CJB6rvZc.js} +2 -2
  127. package/dist/client/assets/{X5RFHQXM-CPBgn0uR.js → X5RFHQXM-CoEhAoaG.js} +2 -2
  128. package/dist/client/assets/{X62E3GBT-DEsBFWSE.js → X62E3GBT-v3am3MF5.js} +2 -2
  129. package/dist/client/assets/{XBNEOJTC-rIiejuIa.js → XBNEOJTC-CNH8QiJb.js} +2 -2
  130. package/dist/client/assets/{YHV2MVVZ-FepTeOr1.js → YHV2MVVZ-BAtBSLld.js} +2 -2
  131. package/dist/client/assets/{YURCZMG2-Co7j1onF.js → YURCZMG2-B0qIfRPW.js} +2 -2
  132. package/dist/client/assets/{YVG2LODB-CH8YtqJ9.js → YVG2LODB-7yKJRNqu.js} +2 -2
  133. package/dist/client/assets/_chat-CPyEKO_k.js +47 -0
  134. package/dist/client/assets/_chat.design-BkPz6B_R.js +2 -0
  135. package/dist/client/assets/{_chat.index-DZmhCx_Q.js → _chat.index-DGRldHwy.js} +2 -2
  136. package/dist/client/assets/{_chat.new-BLxqLetm.js → _chat.new-Be-FWv3w.js} +2 -2
  137. package/dist/client/assets/_chat.pull-requests-Csb_f8e_.js +2 -0
  138. package/dist/client/assets/{alert-BdISKl4u.js → alert-D6WJ0q4-.js} +2 -2
  139. package/dist/client/assets/{alert-dialog-Broi1wym.js → alert-dialog-DsMTn0ZK.js} +2 -2
  140. package/dist/client/assets/{assetUrls-DyJx-URx.js → assetUrls-CsEDCYyh.js} +2 -2
  141. package/dist/client/assets/assets-CA-ZYmQr.js +2 -0
  142. package/dist/client/assets/{browserHistoryStore-zdRsIuMc.js → browserHistoryStore-BVGoot2u.js} +2 -2
  143. package/dist/client/assets/{browserLinkTarget-aye_Gpt4.js → browserLinkTarget-zjhG9Lyg.js} +2 -2
  144. package/dist/client/assets/{checkbox-ueGFMqVv.js → checkbox-Cw33xyU7.js} +2 -2
  145. package/dist/client/assets/{color-picker-CUoPp4AJ.js → color-picker-Bmtarpj9.js} +2 -2
  146. package/dist/client/assets/{combobox-BfOjf6Iu.js → combobox-D6RfzdE7.js} +2 -2
  147. package/dist/client/assets/{command-CeMH9lgx.js → command-1dJ-vX2N.js} +2 -2
  148. package/dist/client/assets/{connect-CQUjsv6p.js → connect-BdyG6QZP.js} +2 -2
  149. package/dist/client/assets/connect-agent-BZgF1WVU.js +2 -0
  150. package/dist/client/assets/{design-BL2REeQ-.js → design-9PZeJvkV.js} +2 -2
  151. package/dist/client/assets/{device-DUMKyegd.js → device-B_zaE4OU.js} +2 -2
  152. package/dist/client/assets/{dialog-BzESHWgr.js → dialog-5OaxRXCC.js} +2 -2
  153. package/dist/client/assets/{diffPanelStore-B-hQEy6C.js → diffPanelStore-D3ARjaef.js} +2 -2
  154. package/dist/client/assets/{diffRendering-BnN6RWwy.js → diffRendering-aGA2PUMV.js} +2 -2
  155. package/dist/client/assets/{dist--Lo1A95S.js → dist-DQanjDEK.js} +3 -3
  156. package/dist/client/assets/{draft-input-BozMgkbl.js → draft-input-DM7mC5ty.js} +2 -2
  157. package/dist/client/assets/{duoViewer-mOZwt5UN.js → duoViewer-WUHHsw83.js} +2 -2
  158. package/dist/client/assets/{dynamic-3CmgXeht.js → dynamic-BrZIqKQ1.js} +3 -3
  159. package/dist/client/assets/{embeddedScripts-g3gqCUmg.js → embeddedScripts-Bjon5VEq.js} +2 -2
  160. package/dist/client/assets/{empty-CeYEMFdG.js → empty-VkAC9qIO.js} +2 -2
  161. package/dist/client/assets/entities-iVR9hStG.js +2 -0
  162. package/dist/client/assets/{fileLinks-LQyYck3z.js → fileLinks-ZsyrXe-F.js} +2 -2
  163. package/dist/client/assets/{fileTreeExpansion-CY-keZ2e.js → fileTreeExpansion-CZA6X0sP.js} +2 -2
  164. package/dist/client/assets/fold-vertical-CN9ryhZz.js +2 -0
  165. package/dist/client/assets/{getDiffFileInput-ClUa7N40.js → getDiffFileInput-C973oCCO.js} +2 -2
  166. package/dist/client/assets/{htmlRender-CxBGTvqW.js → htmlRender-DYI6n9Xo.js} +2 -2
  167. package/dist/client/assets/index-ColdECgE.js +3 -0
  168. package/dist/client/assets/{input-K95B1E2P.js → input-CiPGmOLv.js} +2 -2
  169. package/dist/client/assets/{input-group-BAbOiIZs.js → input-group-DOUsG7P-.js} +2 -2
  170. package/dist/client/assets/{kbd-D9Q8zN3_.js → kbd-C8opCm5n.js} +2 -2
  171. package/dist/client/assets/{keybindings-C427DPQo.js → keybindings-CbaDrm2P.js} +2 -2
  172. package/dist/client/assets/{lazy-BDrl-IrZ.js → lazy-BWBxhQ9c.js} +4 -4
  173. package/dist/client/assets/{lazyRouteComponent-Bi84pz13.js → lazyRouteComponent-BZe6tHvz.js} +2 -2
  174. package/dist/client/assets/{link-B57I0_wC.js → link-BHR6GsRr.js} +2 -2
  175. package/dist/client/assets/{linkedPrompt-zM8XlD0_.js → linkedPrompt-CN5vzMKu.js} +2 -2
  176. package/dist/client/assets/main-i3nSjwXu.css +2 -0
  177. package/dist/client/assets/main-xeaL6Ue7.js +38 -0
  178. package/dist/client/assets/mediaReference-D4xASAKr.js +2 -0
  179. package/dist/client/assets/{mediaSource-BQkNpHYP.js → mediaSource-DJf0a3Hm.js} +2 -2
  180. package/dist/client/assets/{modelScene-DWYEc7-j.js → modelScene-Dg2T9WKU.js} +2 -2
  181. package/dist/client/assets/{number-field-D6t0GpAB.js → number-field-BkDsfSCt.js} +2 -2
  182. package/dist/client/assets/{observeResize-nOwAB2yP.js → observeResize-BESwMMOy.js} +2 -2
  183. package/dist/client/assets/{onboarding-BpYTNtvC.js → onboarding-7dyWHc7v.js} +2 -2
  184. package/dist/client/assets/{openFileInPreview-DFpXOfx7.js → openFileInPreview-l71la8rp.js} +2 -2
  185. package/dist/client/assets/{p4ProjectFile-Dkwk3dWQ.js → p4ProjectFile-CC8L8IBq.js} +2 -2
  186. package/dist/client/assets/{pair-Bc34xPWk.js → pair-CjGF7d0N.js} +2 -2
  187. package/dist/client/assets/{pendingSendStore-ettG1x40.js → pendingSendStore-CX8QB7C5.js} +2 -2
  188. package/dist/client/assets/{phoneViewer-BCeyyPaZ.js → phoneViewer-CpRP0Ylg.js} +2 -2
  189. package/dist/client/assets/{pierre-icons-C2-xRx0J.js → pierre-icons-CX8MNnZC.js} +2 -2
  190. package/dist/client/assets/{popover-CtPuvMeZ.js → popover-hyDlWUPU.js} +2 -2
  191. package/dist/client/assets/{preview-CS0uw3GP.js → preview-DX0t2QY_.js} +2 -2
  192. package/dist/client/assets/{preview-DIIM6Lws.js → preview-DnCP9Q0k.js} +2 -2
  193. package/dist/client/assets/{previewMiniPlayerStore-oJw0qrRM.js → previewMiniPlayerStore-DByen2Nk.js} +2 -2
  194. package/dist/client/assets/{primary-B0bbGdiR.js → primary-BvBZk3BL.js} +2 -2
  195. package/dist/client/assets/primaryCloudLinkState-CHXPTqr2.js +2 -0
  196. package/dist/client/assets/{projectFilesQueryState-DpLF9eJd.js → projectFilesQueryState-D1KYNZXm.js} +2 -2
  197. package/dist/client/assets/{projectScriptEditor-Bp7idsB3.js → projectScriptEditor-Dy8U6TBl.js} +2 -2
  198. package/dist/client/assets/providerSkills-CpjiWlTj.js +2 -0
  199. package/dist/client/assets/{pullRequestDetail.logic-8vF2qB9V.js → pullRequestDetail.logic-CHJRE71s.js} +3 -3
  200. package/dist/client/assets/{pullRequestIcons-6_4tgVDN.js → pullRequestIcons-1lUVOGQJ.js} +2 -2
  201. package/dist/client/assets/{pullRequestReviewStore-C8_coQYO.js → pullRequestReviewStore-CUZ0N4F2.js} +2 -2
  202. package/dist/client/assets/pullRequests-DjzqqdNY.js +2 -0
  203. package/dist/client/assets/queries-D2fZuj-t.js +2 -0
  204. package/dist/client/assets/{query-DpmTmXUV.js → query-CeIgbVxh.js} +2 -2
  205. package/dist/client/assets/{radio-group-DSfZzUu8.js → radio-group-C14CASyG.js} +2 -2
  206. package/dist/client/assets/relay-aZlRxOWS.js +2 -0
  207. package/dist/client/assets/{renderScheduler-Cvu4oEGc.js → renderScheduler-BLaTctiX.js} +2 -2
  208. package/dist/client/assets/{rightPanelStore-D-meSGn7.js → rightPanelStore-Bt0unAo8.js} +2 -2
  209. package/dist/client/assets/runtime-D5AfNyNA.js +7 -0
  210. package/dist/client/assets/{runtimeModeConfig-MYD8WQl8.js → runtimeModeConfig-DymGoV55.js} +2 -2
  211. package/dist/client/assets/{scheduledTasksSettings.logic-DmlMHwKF.js → scheduledTasksSettings.logic-BjvsiCPJ.js} +3 -3
  212. package/dist/client/assets/{scroll-area-D9QT2Odm.js → scroll-area-D2D-AlvC.js} +2 -2
  213. package/dist/client/assets/{select-BtqP8nTL.js → select-CE2f-g-3.js} +2 -2
  214. package/dist/client/assets/{selfImproveFindings-DZS7PCvJ.js → selfImproveFindings-Bhi6QF1b.js} +2 -2
  215. package/dist/client/assets/{server-BYnv0CK4.js → server-B2y_yoz_.js} +2 -2
  216. package/dist/client/assets/{session-BryEqNW-.js → session-Dt_Dt-Og.js} +2 -2
  217. package/dist/client/assets/session-logic-CPQJM-gL.js +27 -0
  218. package/dist/client/assets/{settings-A-pqSt1Y.js → settings-BIR_Igib.js} +2 -2
  219. package/dist/client/assets/{settings.appearance-C_uChPSz.js → settings.appearance-D0uNLG6m.js} +2 -2
  220. package/dist/client/assets/settings.archived-DHE_0aGh.js +2 -0
  221. package/dist/client/assets/{settings.computer-use-Dg_7f0JL.js → settings.computer-use-CNVg4Kl5.js} +2 -2
  222. package/dist/client/assets/settings.connections-Bt5upKXR.js +2 -0
  223. package/dist/client/assets/{settings.data-controls-SDdipjc2.js → settings.data-controls-Bu-fCPHf.js} +2 -2
  224. package/dist/client/assets/{settings.decisions-CoyKjdc1.js → settings.decisions-B9lckxtw.js} +2 -2
  225. package/dist/client/assets/{settings.designs-4eHPAt6y.js → settings.designs-CLLnQttY.js} +2 -2
  226. package/dist/client/assets/settings.diagnostics-Bl2X85nQ.js +2 -0
  227. package/dist/client/assets/{settings.general-DAWqQIHm.js → settings.general-CJSdSR2k.js} +2 -2
  228. package/dist/client/assets/settings.integrations-DRpNV9D5.js +2 -0
  229. package/dist/client/assets/{settings.keybindings-B0oNRJrN.js → settings.keybindings-BPtpYe84.js} +2 -2
  230. package/dist/client/assets/{settings.open-source-licenses-BI8-fEG8.js → settings.open-source-licenses-DYpshDh1.js} +2 -2
  231. package/dist/client/assets/{settings.plugins-B6My9wD7.js → settings.plugins-C9ZOoiar.js} +4 -4
  232. package/dist/client/assets/settings.projects-CMHQJUvG.js +4 -0
  233. package/dist/client/assets/settings.providers-Bfr9fIiF.js +3 -0
  234. package/dist/client/assets/{settings.scheduled-tasks-Bx6ZIK0R.js → settings.scheduled-tasks-BEYOe2xs.js} +2 -2
  235. package/dist/client/assets/{settings.secrets-Dt4ORQnt.js → settings.secrets-DIyDPOQx.js} +2 -2
  236. package/dist/client/assets/{settings.snap-shot-CytMd2pC.js → settings.snap-shot-DmjWtA3x.js} +2 -2
  237. package/dist/client/assets/settings.source-control-DvaOZ7kM.js +2 -0
  238. package/dist/client/assets/{settings.storage-BfvQd358.js → settings.storage-B4XbjYVO.js} +2 -2
  239. package/dist/client/assets/settingsLayout-Ds1fJJk7.js +3 -0
  240. package/dist/client/assets/{sidebar-DbrWNN9-.js → sidebar-4oe_dr6q.js} +2 -2
  241. package/dist/client/assets/{sidebarProjectGrouping-CZnpDNTf.js → sidebarProjectGrouping-RQlsFe56.js} +2 -2
  242. package/dist/client/assets/{skeleton-DxuQc9Kk.js → skeleton-D6RVfMa8.js} +2 -2
  243. package/dist/client/assets/{sourceControl-BbrGhAuF.js → sourceControl-BhvxhaEx.js} +2 -2
  244. package/dist/client/assets/sourceControlClients-Bs5R87fg.js +2 -0
  245. package/dist/client/assets/{spinner-DmRIQvmI.js → spinner-C-qDE4WQ.js} +2 -2
  246. package/dist/client/assets/src-R7EkrVcv.js +15 -0
  247. package/dist/client/assets/terminal-links-BohHFDfc.js +2 -0
  248. package/dist/client/assets/terminalSessions-Cnj30QDx.js +2 -0
  249. package/dist/client/assets/{textarea-C_3SxeEV.js → textarea-CWbMGhL9.js} +2 -2
  250. package/dist/client/assets/{themePalette-DSR5tBE9.js → themePalette-B_fGWNEh.js} +3 -3
  251. package/dist/client/assets/{threadCheckpoints-D0dMlqZE.js → threadCheckpoints-B88N2CXf.js} +2 -2
  252. package/dist/client/assets/{toggle-Zti3zuzr.js → toggle-CKr6iZUR.js} +2 -2
  253. package/dist/client/assets/{toggle-group-D015gcqT.js → toggle-group-B1WN0Pgy.js} +2 -2
  254. package/dist/client/assets/{tooltip-CAzkzAoH.js → tooltip-CCYU8XGM.js} +2 -2
  255. package/dist/client/assets/uiStateStore-BZ4RuLIL.js +2 -0
  256. package/dist/client/assets/unfold-vertical-CldLe1hB.js +2 -0
  257. package/dist/client/assets/{usage-BJA7zQoS.js → usage-GID8Ml88.js} +2 -2
  258. package/dist/client/assets/{usageAccess-D5FAb4jV.js → usageAccess-B0nqd8U-.js} +2 -2
  259. package/dist/client/assets/{usageFormat-Njxx7Q49.js → usageFormat-CUSzTPTq.js} +2 -2
  260. package/dist/client/assets/{usageShortcuts-DuJeedG7.js → usageShortcuts-jGu1QJHr.js} +2 -2
  261. package/dist/client/assets/{use-atom-command-DMW6SFOx.js → use-atom-command-QDd_NqJQ.js} +2 -2
  262. package/dist/client/assets/{useAriaLabelledBy-E7KNTqMb.js → useAriaLabelledBy-CJvtvui4.js} +2 -2
  263. package/dist/client/assets/useHandleNewThread-ClgC6Lcw.js +2 -0
  264. package/dist/client/assets/{useLocation-hVHAnHTx.js → useLocation-KvBZAN7v.js} +2 -2
  265. package/dist/client/assets/{useNavigate-B7EiSugn.js → useNavigate-DXSBYc-k.js} +2 -2
  266. package/dist/client/assets/{useNavigateBack-BC3GGm7e.js → useNavigateBack-DzR35iiJ.js} +2 -2
  267. package/dist/client/assets/{useP4ConnectAuthPrompt-D3qxx30I.js → useP4ConnectAuthPrompt-DMl-0U53.js} +2 -2
  268. package/dist/client/assets/{useParams-C5b2x5BH.js → useParams-D9reDvT8.js} +2 -2
  269. package/dist/client/assets/{usePermissionStatus-Zf48W2tu.js → usePermissionStatus-C5YvHVz-.js} +2 -2
  270. package/dist/client/assets/{usePopupViewport-Dtwu2x5j.js → usePopupViewport-D7yp2NvZ.js} +2 -2
  271. package/dist/client/assets/{usePullRequestActions-BtPaWuCg.js → usePullRequestActions-CJvtylIq.js} +2 -2
  272. package/dist/client/assets/{useRegisterFieldControl-BMmbsxkx.js → useRegisterFieldControl-D-hYtXkm.js} +2 -2
  273. package/dist/client/assets/{useScopedModelAvailability-BIveWOlk.js → useScopedModelAvailability-DGPFTMHL.js} +2 -2
  274. package/dist/client/assets/useSettings-BJR7Rf97.js +3 -0
  275. package/dist/client/assets/utils-DkKLB01I.js +24 -0
  276. package/dist/client/assets/vcsRefInvalidation-Bnup-5J0.js +2 -0
  277. package/dist/client/assets/welcome-CMuTnFAm.js +2 -0
  278. package/dist/client/index.html +1 -1
  279. package/dist/{mcpResponsePayloads-BBvPAlwj.mjs → mcpResponsePayloads-tqyeJD3c.mjs} +10 -9
  280. package/dist/{ProjectCloneTracker-DAE46hjz.mjs → preview-DcFC_OYY.mjs} +902 -438
  281. package/dist/{renderer-iWfzRWCX.mjs → renderer-CswgrCon.mjs} +2 -2
  282. package/dist/{runtime-CllDK9QU.mjs → runtime-Bec3_bh8.mjs} +3 -3
  283. package/dist/{runtimeLayer-D1H3yRj8.mjs → runtimeLayer-B6H9jZgZ.mjs} +1 -1
  284. package/dist/{runtimeLayer-CblMBDQ6.mjs → runtimeLayer-D4LpzNmS.mjs} +3263 -2983
  285. package/dist/{server-vm1eH-y1.mjs → server-4nWc1d6L.mjs} +385 -229
  286. package/dist/{sha2-9FUhed4s.mjs → sha2-BfCJmkJJ.mjs} +47 -8
  287. package/package.json +1 -1
  288. package/dist/AcpMcpStdioBridge-RQnwhGrw.mjs +0 -3
  289. package/dist/client/assets/AlertDialogRoot-D2Lzxp77.js +0 -2
  290. package/dist/client/assets/ChatGptUsageButton-CM16mB7z.js +0 -2
  291. package/dist/client/assets/ChatMarkdown-LYkpVHJO.js +0 -49
  292. package/dist/client/assets/CodexSetupSection.logic-CNAX4_fV.js +0 -2
  293. package/dist/client/assets/DeviceSetup-O_9LLGD9.js +0 -2
  294. package/dist/client/assets/DiffPanel-CDixqNzb.js +0 -2
  295. package/dist/client/assets/FoldedSettingsSection-CrJX4FnL.js +0 -2
  296. package/dist/client/assets/Input-BWhtnCC0.js +0 -2
  297. package/dist/client/assets/JZOYTAAL-BCdmxsmo.js +0 -1
  298. package/dist/client/assets/ModelLiveLayer-CxX5pYmA.js +0 -3
  299. package/dist/client/assets/PanelLayoutControls-CC5OYRRR.js +0 -216
  300. package/dist/client/assets/PreviewPanel-BvRNyyKQ.js +0 -2
  301. package/dist/client/assets/ProviderModelPicker-Cq3CogU6.js +0 -2
  302. package/dist/client/assets/PullRequestCodeTab-C5kr72DG.js +0 -6
  303. package/dist/client/assets/RenderErrorBoundary-DgYrYlQR.js +0 -23
  304. package/dist/client/assets/ThreadTerminalDrawer-DcYWT4k2.js +0 -5
  305. package/dist/client/assets/TooltipProvider-BzOo4iyi.js +0 -2
  306. package/dist/client/assets/_chat-DoDgVLYz.js +0 -47
  307. package/dist/client/assets/_chat.design-C593M39o.js +0 -2
  308. package/dist/client/assets/_chat.pull-requests-0Ce1mGUC.js +0 -2
  309. package/dist/client/assets/assets-lJdcWn_Q.js +0 -2
  310. package/dist/client/assets/connect-agent-DsQQcex2.js +0 -2
  311. package/dist/client/assets/entities-CpJdh0W5.js +0 -2
  312. package/dist/client/assets/fold-vertical-BscQ96iN.js +0 -2
  313. package/dist/client/assets/index-BWKkBtFt.js +0 -3
  314. package/dist/client/assets/main-C8b9a0ht.js +0 -37
  315. package/dist/client/assets/main-CCH0X0zL.css +0 -2
  316. package/dist/client/assets/mediaReference-BIsAfUoY.js +0 -2
  317. package/dist/client/assets/primaryCloudLinkState-B6CxZwAR.js +0 -2
  318. package/dist/client/assets/providerSkills-yqPKKW6i.js +0 -2
  319. package/dist/client/assets/pullRequests-u-PJpGXV.js +0 -2
  320. package/dist/client/assets/queries-DDAXRF4r.js +0 -2
  321. package/dist/client/assets/relay-CnLeC-mg.js +0 -2
  322. package/dist/client/assets/runtime-DUPVFypn.js +0 -7
  323. package/dist/client/assets/session-logic-DZfPxiBF.js +0 -26
  324. package/dist/client/assets/settings.archived-BtKfrhpi.js +0 -2
  325. package/dist/client/assets/settings.connections-CHawbHDz.js +0 -2
  326. package/dist/client/assets/settings.diagnostics-BFlcsuN0.js +0 -2
  327. package/dist/client/assets/settings.integrations-CpUf4-MX.js +0 -2
  328. package/dist/client/assets/settings.projects-hrhEEIli.js +0 -4
  329. package/dist/client/assets/settings.providers-BKeGnq6G.js +0 -3
  330. package/dist/client/assets/settings.source-control-B6eUVvNg.js +0 -2
  331. package/dist/client/assets/settingsLayout-BijX6mlS.js +0 -3
  332. package/dist/client/assets/sourceControlClients-CG8qRQgm.js +0 -2
  333. package/dist/client/assets/src-BZzGU-vc.js +0 -15
  334. package/dist/client/assets/terminal-links-FD1wyGOp.js +0 -2
  335. package/dist/client/assets/terminalSessions-D1m7FXoa.js +0 -2
  336. package/dist/client/assets/uiStateStore-B0Z02qoV.js +0 -2
  337. package/dist/client/assets/unfold-vertical-DeuiNAAp.js +0 -2
  338. package/dist/client/assets/useHandleNewThread-Cmiu3y4G.js +0 -2
  339. package/dist/client/assets/useSettings-C6RmJr-q.js +0 -3
  340. package/dist/client/assets/utils-Cs97wR6T.js +0 -24
  341. package/dist/client/assets/vcsRefInvalidation-CAa5en8i.js +0 -2
  342. package/dist/client/assets/welcome-BRX7e-eN.js +0 -2
@@ -1,2 +0,0 @@
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,au as s,l as c,mr as l,t as u}from"./utils-Cs97wR6T.js";import{Cn as d,Fc as f,Oa as p,da as m,fh as h,ua as g,xn as _}from"./src-BZzGU-vc.js";import{Dr as v,Sr as y}from"./runtime-DUPVFypn.js";import{C as b,S as x,f as ee,k as te,q as S}from"./useSettings-C6RmJr-q.js";import{f as C}from"./server-BYnv0CK4.js";import{i as w,n as ne}from"./session-BryEqNW-.js";import{n as re}from"./query-DpmTmXUV.js";import{t as T}from"./use-atom-command-DMW6SFOx.js";import{n as E,t as D}from"./radio-group-DSfZzUu8.js";import{t as ie}from"./input-K95B1E2P.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-BzESHWgr.js";import{S as N}from"./Icons-BzIBDVKW.js";import{t as P}from"./preview-DIIM6Lws.js";import{S as F,t as oe}from"./ChatGptUsageButton-CM16mB7z.js";import{t as I}from"./RedactedSensitiveText-DrIhPFXw.js";import{a as se}from"./settingsLayout-BijX6mlS.js";import{Do as L,Eo as ce,Mo as le,Oo as ue,Ra as de,jo as fe,ko as R,za as pe}from"./main-C8b9a0ht.js";var z=e(t(),1),B=n(),V=e(r(),1);function me(e){let t=(0,B.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,V.jsxs)(l,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function he(e){let t=(0,B.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(_e),[s,c]=(0,z.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=ae,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=M,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsxs)(O,{children:[(0,V.jsx)(k,{children:`Reconnect ChatGPT`}),(0,V.jsx)(j,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(ge),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:`chatgpt-change-account`}),(0,V.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,V.jsx)(`div`,{className:`px-6 pb-6`,children:(0,V.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,V.jsx)(A,{children:(0,V.jsx)(me,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,V.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,V.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function ge(e){return(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:e.id}),(0,V.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function _e(e){return e.id.startsWith(`chatgpt-profile:`)}function ve(e){let t=(0,B.c)(58),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=w(n,p),u=ee(n),d;t[0]===n?d=t[1]:(d=C.providersValueAtom(n),t[0]=n,t[1]=d);let f=o(d),h=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,z.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,z.useState)(null),[S,re]=(0,z.useState)(!1),E,D,O,k,A,j,M,N,P;if(t[4]!==b||t[5]!==n||t[6]!==x||t[7]!==_||t[8]!==a||t[9]!==r||t[10]!==S||t[11]!==f||t[12]!==i||t[13]!==u||t[14]!==h){let e=f?.find(e=>e.instanceId===x),o=F(e),s;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==r||t[29]!==S||t[30]!==u||t[31]!==h?(s=async()=>{if(S||!_.trim()||!ne(n,`providers:manage`))return;re(!0);let e=m.make(`codex_${c()}`);(await h({environmentId:n,input:{patch:{providerInstances:{...u.providerInstances,[e]:{driver:g.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=a,t[28]=r,t[29]=S,t[30]=u,t[31]=h,t[32]=s):s=t[32];let l=s;O=ae,M=!o,t[33]===r?N=t[34]:(N=e=>{e||r()},t[33]=r,t[34]=N),P=e=>{!e&&o&&r()},D=R,A=`wide`;let d=x?b:`Add ChatGPT account`;t[35]===d?j=t[36]:(j=(0,V.jsx)(L,{title:d,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=d,t[36]=j),E=ue,k=x?e?.setup?i(x,e):(0,V.jsx)(se,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,V.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),l()},children:(0,V.jsx)(se,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,V.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),t[4]=b,t[5]=n,t[6]=x,t[7]=_,t[8]=a,t[9]=r,t[10]=S,t[11]=f,t[12]=i,t[13]=u,t[14]=h,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P}else E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23];let oe;t[37]!==E||t[38]!==k?(oe=(0,V.jsx)(E,{children:k}),t[37]=E,t[38]=k,t[39]=oe):oe=t[39];let I;t[40]!==s||t[41]!==x||t[42]!==_||t[43]!==r||t[44]!==S?(I=(0,V.jsx)(ce,{children:x?(0,V.jsx)(l,{variant:`outline`,onClick:r,children:`Finish later`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,V.jsx)(l,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!s,children:S?`Adding account…`:`Continue`})]})}),t[40]=s,t[41]=x,t[42]=_,t[43]=r,t[44]=S,t[45]=I):I=t[45];let le;t[46]!==D||t[47]!==I||t[48]!==A||t[49]!==j||t[50]!==oe?(le=(0,V.jsxs)(D,{size:A,children:[j,oe,I]}),t[46]=D,t[47]=I,t[48]=A,t[49]=j,t[50]=oe,t[51]=le):le=t[51];let de;return t[52]!==O||t[53]!==le||t[54]!==M||t[55]!==N||t[56]!==P?(de=(0,V.jsx)(O,{open:M,onOpenChange:N,onOpenChangeComplete:P,children:le}),t[52]=O,t[53]=le,t[54]=M,t[55]=N,t[56]=P,t[57]=de):de=t[57],de}var ye=f(_),be=f(d),xe=/^[A-Za-z0-9_./:\\-]+$/;function Se(e,t,n){return xe.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Ce(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function U(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[Ce(n)]>H[Ce(e)])&&t.set(n.driver,n)}return t}var we={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Te(e,t){let n=we[e];return t===`windows`?n.windows:n.posix}function Ee(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ye(r?.config??{});return`${Se(h(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=be(r?.config??{});return`${Se(h(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var De={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function W(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Oe(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var ke={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Ae(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Oe(n)??t.recommendedRange;return{title:ke[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Oe(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var je=()=>void 0;function Me(e){let t=(0,B.c)(11),[n,r]=(0,z.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Ce(e.provider),t[0]=e.provider,t[1]=i);let o=i,s=e.enabled&&o===`ready`,c=e.provider?.auth.status===`authenticated`,u=o===`checking`,d;t[2]===e.provider?d=t[3]:(d=W(e.provider),t[2]=e.provider,t[3]=d);let f=d,p;return t[4]!==c||t[5]!==u||t[6]!==s||t[7]!==f||t[8]!==e||t[9]!==n?(p=e.mode===`existing`&&e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:s?e.provider?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:u?`Checking your Codex CLI...`:e.provider?.installed?f.headline:`Code with your ChatGPT subscription.`,control:s?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(a,{className:`size-3.5`}),`Ready`]}):u?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):c?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.headline}):(0,V.jsx)(me,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!c&&!s&&!u?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,V.jsx)(Fe,{}),control:(0,V.jsx)(l,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,V.jsx)(se,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,V.jsx)(Pe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=c,t[5]=u,t[6]=s,t[7]=f,t[8]=e,t[9]=n,t[10]=p):p=t[10],p}function Ne(e){let t=(0,B.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,p),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,V.jsx)(Pe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:je,onModeChange:je,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,V.jsx)(ve,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Pe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:o,autoStart:c,onAutoStartConsumed:d,allowExistingCli:f=!0,presentation:p,displayName:m,onSignInCancelled:h}){let g={environmentId:e,input:{instanceId:t}},_=re(C.providerAuthState(g)),ee=re(C.providerInstallState(g)),[w,ne]=(0,z.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:_.data,[O,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(`chatgpt`),M=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,ae=D?.methods?.find(e=>e.id===A)?.accountEmail,N=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),F=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,L=ee.data,ce=b(e),ue=ce!==null&&P(new URL(ce).hostname),R={reportFailure:!1,reportDefect:!1},B=T(C.startProviderAuth,R),ge=T(C.refreshProviders,R),_e=T(C.completeProviderAuth,R),ve=T(C.cancelProviderAuth,R),ye=T(C.logoutProviderAuth,R),be=T(C.startProviderInstall,R),xe=T(C.cancelProviderInstall,R),Se=T(C.chatGptReconnectProfile,R),Ce=T(C.chatGptImportProfile,R),H=!w&&(!ue||window.desktopBridge?.receiveProviderAuthCallback!==void 0),U=H&&!window.desktopBridge?.receiveProviderAuthCallback,we=te(),Te=x(we),Ee=b(we),De=!ue&&we&&Te?.connection.phase===`connected`&&Ee&&P(new URL(Ee).hostname)&&(window.desktopBridge!==void 0||P(window.location.hostname))?we:null,W=new URL(window.location.href);W.pathname===`/welcome`&&(W.hash=`agents:${e}`),W.pathname===`/settings/providers`&&W.searchParams.set(`instanceId`,t);let Oe=U,ke=(0,z.useId)(),[Ae,je]=(0,z.useState)(!1),[Me,Ne]=(0,z.useState)({flowId:``,value:``}),Pe=Me.flowId===D?.flowId?Me.value:``,[G,Le]=(0,z.useState)(!1),[Re,ze]=(0,z.useState)(null),Be=(0,z.useRef)(!1),[Ve,He]=(0,z.useState)(null),K=(0,z.useRef)(null),Ue=(0,z.useRef)(!1),We=(0,z.useRef)(null),[Ge,Ke]=(0,z.useState)(!1),q=L?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&L?.source!==`local`&&L?.version!=null&&L.version!==L.installedVersion,Je=Re!==null&&!J&&(D?.phase===`succeeded`||Re===`handoff`);(0,z.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&ze(null)},[J,D?.phase]),(0,z.useEffect)(()=>{Re&&D?.phase===`succeeded`&&ge({environmentId:e,input:{instanceId:t}})},[Re,D?.phase,ge,e,t]);let Ye=c&&!Ge,Xe=Re===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=L?.phase===`downloading`||L?.phase===`extracting`||L?.phase===`verifying`,X=Ye||Ze||G&&!Y,Z=i||!r||G||_.error!==null||ee.error!==null,Q=G||Ze||Y,$=(0,z.useCallback)(async(e,t)=>{if(Be.current)return!1;Be.current=!0,Le(!0),He(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!y(r)){let e=v(r);He(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{He(`Codex setup failed. Try again.`)}return Be.current=!1,Le(!1),n},[]),Qe=(0,z.useId)(),$e=(0,z.useRef)(0),et=(0,z.useRef)(null),[tt,nt]=(0,z.useState)(!1),rt=(0,z.useCallback)(async n=>{let r=await $(()=>Ce({environmentId:e,input:{instanceId:t,profile:n}}));r&&(ze(`handoff`),ne(null)),nt(!r)},[$,Ce,e,t]);(0,z.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[w,E.data,rt]),(0,z.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(He(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let it=(0,z.useCallback)(()=>(ze(null),w?(ne(null),Promise.resolve()):$(()=>ve({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,$,ve,e,t,D]),at=(0,z.useCallback)(async(n=`chatgpt`)=>{if(Be.current)return;Ue.current=!0,nt(!1),j(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),De){let i=`${Qe}:${++$e.current}`;await $(()=>Se({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:De,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ue.current=!1)}else await $(()=>B({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>ze(`sign-in`))||(Ue.current=!1)},[e,t,$,B,H,De,Se,Qe]),ot=(0,z.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(K.current=n,await $(()=>be({environmentId:e,input:{instanceId:t}}))||(K.current=null)))},[Z,Q,q,qe,at,$,be,e,t]);(0,z.useEffect)(()=>{!c||Ge||Z||Q||L===null||!n?.setup?.canInstall||(Ke(!0),d(),ot())},[c,Ge,Z,Q,L,n?.setup?.canInstall,d,ot]),(0,z.useEffect)(()=>{if(!(!K.current||G||Y)){if(L?.phase===`failed`||L?.phase===`cancelled`)K.current=null;else if(q){let e=K.current;K.current=null,at(e)}}},[G,Y,L?.phase,q,at]);let st=(0,z.useRef)(null),ct=D?.flowId,lt=(0,z.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&ct){if(st.current===n){await S().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>_e({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await S().shell.openExternal(n)}catch{He(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,ct,$,_e,e,t]);(0,z.useEffect)(()=>{if(H&&F&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===F&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(F).catch(()=>void 0)}},[H,F]),(0,z.useEffect)(()=>{Ue.current&&D?.phase===`waiting`&&D.flowId&&F&&We.current!==D.flowId&&(We.current=D.flowId,Ue.current=!1,U||lt(F))},[D?.phase,D?.flowId,F,lt,U]);let ut=L?.phase===`downloading`?`Downloading ${(L.downloadedBytes/1e6).toFixed(1)}${L.totalBytes===null?``:` of ${(L.totalBytes/1e6).toFixed(1)}`} MB.`:L?.phase===`extracting`?`Installing Codex.`:L?.phase===`verifying`?`Checking Codex.`:q?`${L?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${L?.installedVersion?` · v${L.installedVersion}`:``}.`:L?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&ae?`Continue as ${ae} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:M??`Use your ChatGPT subscription.`,ft=Oe&&F&&D?.flowId&&pe(W.toString())?de({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,V.jsx)(l,{size:`sm`,variant:U?`default`:`outline`,className:p===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?G||!tt:!F||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):F&&lt(F)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?U?`Open ChatGPT sign-in`:`Open sign-in page`:p===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&F?(0,V.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,V.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Pe.trim())return;let r=Pe.trim(),i=D.flowId;$(()=>_e({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Ne({flowId:i,value:``})})},children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Pe,maxLength:16384,disabled:G||i,onChange:e=>Ne({flowId:D.flowId??``,value:e.target.value})})}),(0,V.jsx)(l,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),U?null:(0,V.jsx)(`div`,{children:(0,V.jsxs)(l,{size:`xs`,variant:`ghost-muted`,onClick:()=>void S().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,V.jsx)(s,{className:`size-3.5`})]})}),ft?(0,V.jsxs)(`details`,{children:[(0,V.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,V.jsx)(l,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,V.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,V.jsx)(fe,{open:Ae,children:(0,V.jsx)(le,{children:(0,V.jsx)(`div`,{id:ke,className:u(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=Oe?mt:mt?(0,V.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(Fe,{label:`Having trouble signing in?`,expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,V.jsx)(he,{open:O,methods:D?.methods??[],onClose:()=>k(!1),onSelect:e=>{k(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(p===`onboarding`){let r=vt??Ve??(_.error||ee.error?`Could not read setup status. Reconnect and try again.`:L?.phase===`failed`?L.message:null);return(0,V.jsxs)(V.Fragment,{children:[_t,(0,V.jsxs)(Ie,{title:m||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!Oe?(0,V.jsx)(Fe,{expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||G&&!Y?(0,V.jsx)(Fe,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(a,{className:`size-3.5`}),`Ready`]}):X?pt:(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:Y||G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:G||i,onClick:()=>{Ue.current=!1,K.current=null,w||X&&D?.flowId?it():L?.operationId&&$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}}))},children:`Cancel`}):!X&&!J&&N?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&f?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[Oe?gt:ht(),r?(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,V.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,V.jsx)(se,{title:`ChatGPT account`,description:dt,control:(0,V.jsx)(`div`,{className:`flex max-w-88 flex-wrap items-center justify-end gap-2`,children:X?(0,V.jsxs)(V.Fragment,{children:[pt,!Je&&(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),h?.())},children:`Cancel`})]}):Y?(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{L?.operationId&&(K.current=null,$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}})))},children:`Cancel`}):J?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ye(g)),children:`Disconnect`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),N?(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null,f?(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null]})})}),J?(0,V.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,V.jsx)(oe,{})}):null,vt?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,V.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,Ve||_.error||ee.error||L?.phase===`failed`?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:Ve??(L?.phase===`failed`?L.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function G(e){let t=(0,B.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,V.jsx)(se,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,V.jsx)(se,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,V.jsx)(se,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,V.jsxs)(V.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Fe(e){let t=(0,B.c)(10),{label:n,expanded:r,controls:a,onToggle:o}=e,s=n===void 0?`Complete sign-in in your browser.`:n,c=r!==void 0&&r;if(!o){let e;return t[0]===s?e=t[1]:(e=(0,V.jsx)(`div`,{className:`leading-relaxed`,children:s}),t[0]=s,t[1]=e),e}let l=`size-3 shrink-0 ${c?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,V.jsx)(i,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==o||t[8]!==u?(d=(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":c,"aria-controls":a,onClick:o,children:[s,u]}),t[4]=a,t[5]=c,t[6]=s,t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function Ie(e){let t=(0,B.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=z.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(N,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,V.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,V.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,V.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Le(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{De as a,Oe as c,Ee as d,U as f,Me as i,Ce as l,Ne as n,W as o,me as p,G as r,Ae as s,Le as t,Te as u};
2
- //# sourceMappingURL=CodexSetupSection.logic-CNAX4_fV.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Dl as i,mr as a,t as o}from"./utils-Cs97wR6T.js";import{ja as s}from"./src-BZzGU-vc.js";import{f as c,u as l,y as u}from"./TooltipProvider-BzOo4iyi.js";import{t as d}from"./spinner-DmRIQvmI.js";import{i as f,n as p}from"./session-BryEqNW-.js";import{t as m}from"./use-atom-command-DMW6SFOx.js";import{n as h}from"./dialog-BzESHWgr.js";import{t as g}from"./device-DUMKyegd.js";import{Ao as _,Do as v,Eo as ee,Oo as te,Po as y}from"./main-C8b9a0ht.js";var b=n(),x=e(t(),1),S=e(r(),1);function C(e){let t=(0,b.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[o,s]=(0,x.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,S.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,S.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,S.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,S.jsx)(a,{size:`compact`,variant:`outline`,disabled:o!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:o===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=o,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,S.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var w=e=>e===`ios`?`iOS`:`Android`,T=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,E=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,D=e=>Object.values(e.hostStatuses).some(e=>e.status===`ready`&&e.androidDiscoveryIncomplete);function O(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function k(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&D(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${w(t)} support was not detected.`};if(i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`).length>0&&!n)return{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let a=i.every(e=>e.kind!==`local`)?i[0]:void 0,o=a?` on ${a.label}`:``;return{ready:!0,message:a?.kind===`eas`?`${a.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${o}.`:`The Android SDK and Emulator are available${o}.`}}function A(e){let t=(0,b.c)(75),n=f(e.environmentId,s),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,x.useState)(null),[d,w]=(0,x.useState)(0),D=e.state.hostStatus!==`disabled`,k;t[1]===e.state?k=t[2]:(k=O(e.state),t[1]=e.state,t[2]=k);let{ready:A,busy:j}=k,F;t[3]===e.state.hosts?F=t[4]:(F=e.state.hosts.some(ne),t[3]=e.state.hosts,t[4]=F);let I=F,L,R;t[5]!==D||t[6]!==c||t[7]!==e.environmentId?(L=()=>{D&&c({environmentId:e.environmentId,input:{}})},R=[D,c,e.environmentId],t[5]=D,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,x.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==j||t[15]!==l||t[16]!==d?(H=e=>j||l!==null||e>d,t[14]=j,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,S.jsx)(v,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,S.jsx)(_,{steps:V,currentStep:d,onStepChange:w,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,S.jsx)(C,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==j||t[25]!==n||t[26]!==D||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,S.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:T}),(0,S.jsx)(y,{checked:D,disabled:!n||j||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,S.jsx)(M,{state:e.state,pending:l===`hub`||j&&l!==`agent`})]}):null,t[24]=j,t[25]=n,t[26]=D,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==j||t[33]!==D||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&D&&I?(0,S.jsxs)(`section`,{className:o(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,S.jsx)(N,{state:e.state,checking:l===`check`,disabled:!D||j||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=j,t[33]=D,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==j||t[42]!==n||t[43]!==D||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,S.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,S.jsx)(y,{checked:e.state.agentAccessEnabled,disabled:!n||!D||j||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,S.jsx)(P,{state:e.state,pending:l===`agent`}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=j,t[42]=n,t[43]=D,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,S.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,S.jsxs)(te,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==j||t[59]!==l||t[60]!==d?(X=d===0?(0,S.jsx)(h,{render:(0,S.jsx)(a,{variant:`outline`}),children:`Cancel`}):(0,S.jsx)(a,{variant:`outline`,disabled:j||l!==null,onClick:()=>w(d-1),children:`Back`}),t[58]=j,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==A||t[65]!==d||t[66]!==B?(Z=d<2?(0,S.jsx)(a,{disabled:!A||l!==null,onClick:()=>w(d+1),children:`Continue`}):(0,S.jsx)(a,{disabled:!n||!A||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=A,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,S.jsxs)(ee,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,S.jsxs)(S.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function ne(e){return e.kind===`local`&&!e.platforms.some(j)}function j(e){return e.available}function M(e){let t=(0,b.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!O(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,S.jsx)(d,{size:`xs`}):(0,S.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function N(e){let t=(0,b.c)(20),n;t[0]===e.state?n=t[1]:(n=k(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,S.jsx)(I,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=k(e.state,`android`),t[4]=e.state,t[5]=i);let o;t[6]===i?o=t[7]:(o=(0,S.jsx)(I,{platform:`Android`,status:i}),t[6]=i,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,S.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,S.jsxs)(a,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==o||t[18]!==u?(f=(0,S.jsxs)(`div`,{className:`space-y-3`,children:[r,o,s,u]}),t[16]=r,t[17]=o,t[18]=u,t[19]=f):f=t[19],f}function P(e){let t=(0,b.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,S.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&O(e.state).ready&&e.state.hosts.some(F)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function F(e){return e.agentDeviceInstalled}function I(e){let t=(0,b.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=o(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=o(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let s=e.status.ready?c:u,d;t[4]!==a||t[5]!==s?(d=(0,S.jsx)(l,{className:a,icon:s}),t[4]=a,t[5]=s,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=o(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,S.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,S.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,S.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{E as a,D as c,I as i,k as l,M as n,T as o,A as r,O as s,P as t,C as u};
2
- //# sourceMappingURL=DeviceSetup-O_9LLGD9.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{A as i,D as a,Dl as o,Ff as s,I as c,Jo as l,Ku as u,Ol as d,Os as f,Ss as p,Tu as m,Wd as h,Yo as g,Zl as _,Zn as v,Zo as ee,af as te,ar as y,dr as ne,es as re,fr as b,ir as x,lr as S,mr as C,ns as w,ol as T,rr as ie,sf as ae,t as oe,ur as se}from"./utils-Cs97wR6T.js";import{Au as E,Hd as D,Tu as O,Wl as ce,Xs as k,jr as le,n as A,ts as j}from"./src-BZzGU-vc.js";import{Ar as M,Dr as N,Sr as P,Ur as F,_r as I,gr as ue,hr as L,pr as R,t as z}from"./runtime-DUPVFypn.js";import{s as B}from"./vcsRefInvalidation-CAa5en8i.js";import{E as V,O as de,S as fe}from"./entities-CpJdh0W5.js";import{C as pe,_ as me,f as he,g as ge,m as _e,p as H,u as ve}from"./TooltipProvider-BzOo4iyi.js";import{t as ye}from"./useParams-C5b2x5BH.js";import{m as be,u as xe}from"./relay-CnLeC-mg.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./DiffFileTree-2Y-Da6MW.js";import{K as De,s as Oe,v as ke}from"./useSettings-C6RmJr-q.js";import{f as Ae}from"./server-BYnv0CK4.js";import{n as je}from"./query-DpmTmXUV.js";import{t as Me}from"./use-atom-command-DMW6SFOx.js";import{f as Ne,p as Pe}from"./providerSkills-yqPKKW6i.js";import{t as Fe,u as Ie}from"./queries-DDAXRF4r.js";import{n as Le,t as Re}from"./diffPanelStore-B-hQEy6C.js";import{a as ze,c as Be,l as Ve,n as He,o as Ue,r as We,s as Ge,u as U}from"./diffRendering-BnN6RWwy.js";import{B as Ke,F as qe,L as Je,R as W,z as Ye}from"./PanelLayoutControls-CC5OYRRR.js";import{t as Xe}from"./DiffCommentAnnotation-CAml763Q.js";import{c as Ze}from"./timestampFormat-Dq7sHZpd.js";import{B as Qe,H as $e,V as et}from"./ThreadDetailsItemsMenu-BXQbo6bY.js";import{a as tt,n as nt,t as rt}from"./tooltip-CAzkzAoH.js";import{n as G}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as it,t as at}from"./toggle-group-D015gcqT.js";import{i as ot,l as st,n as ct,o as lt,r as ut,s as dt,t as ft}from"./combobox-BfOjf6Iu.js";import{Fo as pt,Po as mt,Vo as ht,Wo as gt}from"./main-C8b9a0ht.js";import{C as _t,S as vt,w as yt}from"./_chat-DoDgVLYz.js";var K=e(t(),1),q=n();function bt(e,t){let n=(0,q.c)(4),r=Fe(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var J=e(r(),1);function xt(e){let t=(0,q.c)(17),{filePath:n}=e,r=(0,K.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>$e(r),onError:e=>et(r,e),timeout:Qe},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=be(i),s;t[1]!==a||t[2]!==n?(s=(0,J.jsx)(C,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=oe(`size-3`,c),t[4]=c,t[5]=l);let u=o?he:pe,d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(ve,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,J.jsx)(tt,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,J.jsx)(nt,{children:(0,J.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,J.jsxs)(rt,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var St=[];function Ct(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function Y(e,t,n){let r=Ct(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function wt(e){let t=(0,q.c)(66),{codeViewKey:n,files:r,sectionId:o,sectionTitle:s,composerDraftTarget:l,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:v}=e,ee=a(kt),te=a(X),y;t[0]===l?y=t[1]:(y=e=>e.getComposerDraft(l)?.reviewComments??St,t[0]=l,t[1]=y);let ne=a(y),[re,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(``),T;t[2]===r?T=t[3]:(T=new Map(r.map(Ot)),t[2]=r,t[3]=T);let ie=T,ae;if(t[4]!==x||t[5]!==r||t[6]!==ne||t[7]!==o){let e;t[9]!==x||t[10]!==ne||t[11]!==o?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:a}=e,s=ne.filter(e=>e.sectionId===o&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=c(t,n);return r?Y(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),l=x?.fileKey===r?[...s,x.annotation]:s;return{id:r,type:`diff`,fileDiff:t,annotations:l,collapsed:a,version:ze(`${i}:${a?`1`:`0`}:${l.flatMap(Et).join(`:`)}`)}},t[9]=x,t[10]=ne,t[11]=o,t[12]=e):e=t[12],ae=r.map(e),t[4]=x,t[5]=r,t[6]=ne,t[7]=o,t[8]=ae}else ae=t[8];let oe=ae,se;t[13]!==l||t[14]!==x?.annotation||t[15]!==te?(se=e=>{b(null),x?.annotation.metadata.entries.some(t=>t.id===e)?(S(null),w(``)):te(l,e)},t[13]=l,t[14]=x?.annotation,t[15]=te,t[16]=se):se=t[16];let E=se,D;t[17]!==ee||t[18]!==l||t[19]!==x||t[20]!==ie||t[21]!==o||t[22]!==s?(D=(e,t)=>{let n=x?.annotation.metadata.entries.find(t=>t.id===e),r=x?ie.get(x.fileKey):void 0;if(!n||!r)return;let a=i({id:n.id,sectionId:o,sectionTitle:s,filePath:r.filePath,fileDiff:r.fileDiff,range:n.range,text:t});a&&ee(l,a),b(null),S(null),w(``)},t[17]=ee,t[18]=l,t[19]=x,t[20]=ie,t[21]=o,t[22]=s,t[23]=D):D=t[23];let O=D,ce;t[24]!==o||t[25]!==s?(ce=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let r=G(),a=i({id:r,sectionId:o,sectionTitle:s,filePath:U(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});a&&(w(``),S({fileKey:n.id,annotation:{side:Ct(e),lineNumber:e.end,metadata:{entries:[{id:r,kind:`draft`,range:e,rangeLabel:a.rangeLabel,text:``}]}}}))},t[24]=o,t[25]=s,t[26]=ce):ce=t[26];let k=ce,le=x!==null,A;t[27]===d?A=t[28]:(A=d?{viewerRef:d}:{},t[27]=d,t[28]=A);let j;t[29]===f?j=t[30]:(j=f?{className:f}:{},t[29]=f,t[30]=j);let M;t[31]===m?M=t[32]:(M=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=M);let N;t[33]===h?N=t[34]:(N=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=N);let P;t[35]===p?P=t[36]:(P=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=P);let F;t[37]===v?F=t[38]:(F=e=>v(e.id),t[37]=v,t[38]=F);let I=!le,ue=!le,L;t[39]!==k||t[40]!==u||t[41]!==I||t[42]!==ue?(L={...u,enableGutterUtility:I,enableLineSelection:ue,onGutterUtilityClick:k},t[39]=k,t[40]=u,t[41]=I,t[42]=ue,t[43]=L):L=t[43];let R;t[44]===g?R=t[45]:(R=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=R);let z;t[46]===_?z=t[47]:(z=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=z);let B;t[48]!==C||t[49]!==E||t[50]!==O?(B=e=>{let t=e.metadata.entries.some(Tt);return(0,J.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,J.jsx)(Xe,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?C:e.text,onTextChange:w,onCancel:()=>E(e.id),onComment:t=>O(e.id,t),onDelete:()=>E(e.id)},e.id))})},t[48]=C,t[49]=E,t[50]=O,t[51]=B):B=t[51];let V;return t[52]!==n||t[53]!==oe||t[54]!==re||t[55]!==N||t[56]!==P||t[57]!==F||t[58]!==L||t[59]!==R||t[60]!==z||t[61]!==B||t[62]!==A||t[63]!==j||t[64]!==M?(V=(0,J.jsx)(Je,{...A,...j,...M,...N,...P,items:oe,selectedLines:re,onSelectedLinesChange:b,onRevealSearchMatch:F,options:L,renderHeaderFilenameSuffix:R,renderHeaderPrefix:z,renderAnnotation:B},n),t[52]=n,t[53]=oe,t[54]=re,t[55]=N,t[56]=P,t[57]=F,t[58]=L,t[59]=R,t[60]=z,t[61]=B,t[62]=A,t[63]=j,t[64]=M,t[65]=V):V=t[65],V}function Tt(e){return e.kind===`draft`}function Et(e){return e.metadata.entries.map(Dt)}function Dt(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ot(e){return[e.fileKey,e]}function X(e){return e.removeReviewComment}function kt(e){return e.addReviewComment}function At(e){let t=j(4),n=R();return{diffPreview:I(e,{label:`environment-data:review:diff-preview`,tag:A.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:L(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>M(A.reviewGetDiffPreview,e.request).pipe(t.withPermit,E(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?D(n):O(new le({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:ue(e,{label:`environment-data:review:diff-file-contents`,tag:A.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var jt=At(z);function Mt(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function Nt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&Mt(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function Pt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var Ft=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function It(e){let t=(0,q.c)(86),{environmentId:n,cwd:r,source:i,baseRef:a,ignoreWhitespace:o,theme:s,revision:c,preview:u}=e,d=(0,K.useContext)(g),f;t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==o||t[4]!==i?.diffHash||t[5]!==i?.kind?(f=JSON.stringify([n,r,i?.kind,i?.diffHash,a,o]),t[0]=a,t[1]=r,t[2]=n,t[3]=o,t[4]=i?.diffHash,t[5]=i?.kind,t[6]=f):f=t[6];let m=f,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=[0,1,2,3],t[7]=h):h=t[7];let _;t[8]===m?_=t[9]:(_={scope:m,indices:h},t[8]=m,t[9]=_);let[v,te]=(0,K.useState)(_),y;t[10]!==v.indices||t[11]!==v.scope||t[12]!==m?(y=v.scope===m?v.indices:[0,1,2,3],t[10]=v.indices,t[11]=v.scope,t[12]=m,t[13]=y):y=t[13];let ne=y,b;t[14]===i?.files?b=t[15]:(b=()=>i?.files?.toSorted(Q)??[],t[14]=i?.files,t[15]=b),i?.files;let x;t[16]===b?x=t[17]:(x=b(),t[16]=b,t[17]=x);let S=x,C;t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==S||t[22]!==o||t[23]!==ne||t[24]!==m||t[25]!==i?(C=!n||!r||!i?[]:ne.filter(e=>e<S.length).map(e=>{let t=S[e];return{index:e,query:jt.diffFilePatch({environmentId:n,input:{cacheKey:m,request:{cwd:r,...a?{baseRef:a}:{},ignoreWhitespace:o,file:{path:t.path,previousPath:t.previousPath,sourceKind:i.kind}}}})}}),t[18]=a,t[19]=r,t[20]=n,t[21]=S,t[22]=o,t[23]=ne,t[24]=m,t[25]=i,t[26]=C):C=t[26];let T=C,ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[],t[27]=ie):ie=t[27];let ae;t[28]!==c||t[29]!==m?(ae={scope:m,revision:c,queries:ie},t[28]=c,t[29]=m,t[30]=ae):ae=t[30];let oe=(0,K.useRef)(ae),se,E;t[31]!==T||t[32]!==d||t[33]!==c||t[34]!==m?(se=()=>{let e=oe.current;oe.current={scope:m,revision:c,queries:T};for(let{query:t}of T){let n=e.scope===m&&e.revision!==c,r=!e.queries.some(e=>e.query===t)&&d.get(t)._tag!==`Initial`&&!d.get(t).waiting;(n||r)&&d.refresh(t)}},E=[m,c,T,d],t[31]=T,t[32]=d,t[33]=c,t[34]=m,t[35]=se,t[36]=E):(se=t[35],E=t[36]),(0,K.useEffect)(se,E);let D;t[37]===s?D=t[38]:(D=ee(e=>w(e,e=>p(e,e=>{let t=Be(e.diff,`diff-panel:${s}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=s,t[38]=D);let O=D,ce;t[39]!==O||t[40]!==T?(ce=re(e=>new Map(T.map(t=>{let{index:n,query:r}=t;return[n,e(O(r))]}))),t[39]=O,t[40]=T,t[41]=ce):ce=t[41];let k=l(ce),le;t[42]===k?le=t[43]:(le=(e,t)=>{let n=k.get(t);return!n||n._tag===`Initial`},t[42]=k,t[43]=le);let A=S.findIndex(le),j=i?A<0?S.length:A:u?.kind===`files`?u.files.length:0,M;t[44]===m?M=t[45]:(M=e=>te(t=>{let n=t.scope===m?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:m,indices:[...n,...r]}}),t[44]=m,t[45]=M);let N=M,P;t[46]!==N||t[47]!==j?(P=()=>N(Array.from({length:4},(e,t)=>j+t)),t[46]=N,t[47]=j,t[48]=P):P=t[48];let F=P,I;t[49]===N?I=t[50]:(I=e=>N([e]),t[49]=N,t[50]=I);let ue=I,L;t[51]!==S||t[52]!==T?(L={queries:T,files:S},t[51]=S,t[52]=T,t[53]=L):L=t[53];let R=(0,K.useRef)(L),z,B;t[54]!==S||t[55]!==T?(z=()=>{R.current={queries:T,files:S}},B=[T,S],t[54]=S,t[55]=T,t[56]=z,t[57]=B):(z=t[56],B=t[57]),(0,K.useLayoutEffect)(z,B);let V;t[58]===d?V=t[59]:(V=e=>{let{queries:t,files:n}=R.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&d.refresh(r)},t[58]=d,t[59]=V);let de=V,fe;t[60]!==S||t[61]!==k||t[62]!==u||t[63]!==m||t[64]!==i?(fe=i?S.map((e,t)=>{let n=k.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>U(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${m}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Rt),t[60]=S,t[61]=k,t[62]=u,t[63]=m,t[64]=i,t[65]=fe):fe=t[65];let pe=fe,me;if(t[66]!==S||t[67]!==k){let e;t[69]===k?e=t[70]:(e=(e,t)=>{let n=k.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>U(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=k,t[70]=e),me=new Map(S.map(e)),t[66]=S,t[67]=k,t[68]=me}else me=t[68];let he=me,ge;if(t[71]!==S||t[72]!==k){let e;t[74]===k?e=t[75]:(e=(e,t)=>{let n=k.get(t);return n&&n._tag!==`Initial`},t[74]=k,t[75]=e),ge=new Set(S.filter(e).map(Lt)),t[71]=S,t[72]=k,t[73]=ge}else ge=t[73];let _e=ge,H=[...k.values()].some(Z),ve;return t[76]!==he||t[77]!==F||t[78]!==_e||t[79]!==pe||t[80]!==ue||t[81]!==de||t[82]!==m||t[83]!==j||t[84]!==H?(ve={scope:m,fileStates:he,isPending:H,retry:de,requestFile:ue,readyFilePaths:_e,renderableFiles:pe,settledFileCount:j,loadNextFiles:F},t[76]=he,t[77]=F,t[78]=_e,t[79]=pe,t[80]=ue,t[81]=de,t[82]=m,t[83]=j,t[84]=H,t[85]=ve):ve=t[85],ve}function Z(e){return e._tag===`Initial`||e.waiting}function Lt(e){return e.path}function Rt(e,t){return Ft.compare(U(e),U(t))}function Q(e,t){return Ft.compare(e.path,t.path)}function zt(e){let t=(0,q.c)(5),{load:n,count:r}=e,i=(0,K.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Vt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,K.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,J.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Bt)}),t[3]=r,t[4]=s),s}function Bt(e,t){return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,J.jsx)(W,{titleWidth:`medium`})},t)}function Vt(e){return e.isIntersecting}function Ht(e){let t=(0,q.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,J.jsx)(C,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,J.jsx)(te,{className:`size-3`}):(0,J.jsx)(u,{className:`size-3`}),t[6]=n,t[7]=c);let l;t[8]!==s||t[9]!==c?(l=(0,J.jsx)(tt,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let d=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,f;t[11]===d?f=t[12]:(f=(0,J.jsx)(nt,{children:d}),t[11]=d,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,J.jsxs)(rt,{children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p}var Ut=`__automatic_base_ref__`,Wt=`p4code.diffFileTreeOpen`,Gt=new WeakMap;function Kt(e){let t=Gt.get(e);if(t)return t;let n={fileDiff:e,fileKey:We(e),fileVersion:He(e)};return Gt.set(e,n),n}var qt=new Set;function Jt(e){let t=(0,q.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,J.jsx)(C,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=oe(`size-4`,o),t[8]=o,t[9]=f);let p=i?_e:H,m;t[10]!==f||t[11]!==p?(m=(0,J.jsx)(ve,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,J.jsx)(tt,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,J.jsx)(nt,{side:`top`,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==h?(v=(0,J.jsxs)(rt,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=v):v=t[20],v}function Yt(e){let t=(0,q.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,J.jsx)(xt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,J.jsx)(Ht,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsxs)(J.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Xt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:n}){let{resolvedTheme:r}=De(),i=Oe(),a=i.diffLayout,c=ke(),[u,p]=(0,K.useState)(i.wordWrap),[g,ee]=(0,K.useState)(i.diffIgnoreWhitespace),[te,re]=f(Wt,!1,k),[w,E]=(0,K.useState)(``),[D,O]=(0,K.useState)(()=>({scopeKey:null,fileKeys:qt})),[le,A]=(0,K.useState)(0),[j,M]=(0,K.useState)(null),I=ye({strict:!1,select:e=>xe(e)}),ue=I?.threadId??null,L=de(I),R=V(I)?.projection??null,z=B(L?.environmentId??null),{canReadFiles:pe}=z,he=L?.projectId??null,_e=fe(L&&he?{environmentId:L.environmentId,projectId:he}:null),H=L?.worktreePath??_e?.workspaceRoot,be=L?.worktreePath?void 0:_e?.repositoryIdentity?.rootPath,Fe=l(Ae.configValueAtom(L?.environmentId??null)),ze=Ne(L?.environmentId??null),He=ht(L?.environmentId??null,Fe?.availableEditors??[]),We=Me(jt.diffFileContents),Je=je(L!=null&&H!=null?Ie.status({environmentId:L.environmentId,input:{cwd:H}}):null),W=Le(e=>Re(e.byThreadKey,I)),Xe=Je.data?.isRepo??!0,{turnDiffSummaries:Qe,inferredCheckpointTurnCountByRunId:$e}=yt(R),et=(0,K.useMemo)(()=>[...Qe].toSorted((e,t)=>{let n=e.checkpointTurnCount??$e[e.runId]??0,r=t.checkpointTurnCount??$e[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[$e,Qe]);(0,K.useEffect)(()=>{I&&W.kind===`turn`&&Le.getState().reconcileTurnSelection(I,et.map(e=>e.runId))},[W,et,I]);let G=W.kind===`turn`?W.turnId:null,q=W.kind===`unstaged`?`unstaged`:`branch`,xt=W.kind===`branch`?W.baseRef:null,St=W.kind===`turn`?W.filePath:null,Ct=W.kind===`turn`?W.revealRequestId:0,Y=G===null?void 0:et.find(e=>e.runId===G)??et[0],Tt=Y&&(Y.checkpointTurnCount??$e[Y.runId]),Et=et[0],Dt=G===null?q===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Et?.runId?`Latest turn`:`Turn ${Tt??`?`}`,Ot=Y?`turn:${Y.runId}`:q,X=I?`${I.environmentId}:${I.threadId}:${Ot}`:null,kt=`${X??Ot}:${le}`,At=Y?`Turn ${Tt??`?`}`:q===`unstaged`?`Uncommitted`:`Changes`,Mt=(0,K.useMemo)(()=>typeof Tt==`number`?{fromTurnCount:Math.max(0,Tt-1),toTurnCount:Tt}:null,[Tt]),Ft=bt({environmentId:L?.environmentId??null,threadId:ue,fromTurnCount:Mt?.fromTurnCount??null,toTurnCount:Mt?.toTurnCount??null,ignoreWhitespace:g,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:Xe&&Y!==void 0}),Z=je(pe&&G===null&&L&&H?jt.diffPreview({environmentId:L.environmentId,input:{cwd:H,...xt?{baseRef:xt}:{},ignoreWhitespace:g}}):null),Lt=Xe&&G===null&&L!=null&&H!=null,Rt=I?`${I.environmentId}:${I.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(q===`unstaged`?`working-tree`:`branch-range`)),Bt=Z.refresh,Vt=Bt,Ht=(0,K.useMemo)(()=>{let e=Z.data;if(G===null&&L&&e&&Q&&pe)return qe(We,{environmentId:L.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[L,Z.data,We,pe,Q,G]),Gt=(0,K.useRef)(Ht);Gt.current=Ht;let Xt=(0,K.useCallback)(async e=>{let t=Gt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Zt=Q?.headRef??Je.data?.refName??`HEAD`,Qt=Q?.baseRef??xt??`Automatic`,$t=G===null&&pe&&Lt&&q===`branch`,en=Z.data?.cwd??H,tn=je($t&&L&&en?Ie.listRefs({environmentId:L.environmentId,input:{cwd:en,includeMatchingRemoteRefs:!0,refKind:`local`,...w.trim().length>0?{query:w.trim()}:{},limit:100}}):null),nn=je($t&&L&&en?Ie.listRefs({environmentId:L.environmentId,input:{cwd:en,includeMatchingRemoteRefs:!0,refKind:`remote`,...w.trim().length>0?{query:w.trim()}:{},limit:100}}):null),rn=Nt(tn.data?.refs.filter(e=>e.name!==Zt)??[],nn.data?.refs??[]),an=Pt(rn,w),on=e=>xt&&xt===e.remote?.name?xt:e.local?.name??e.remote?.name??e.id,sn=[Ut,...rn.map(on)],cn=[...w.trim().length===0?[Ut]:[],...an.map(on)],ln=Q?.diff,un=Y?Ft.data?.diff:ln,dn=!Y&&Q?.truncated===!0,fn=Y?Ft.isPending:Z.isPending,pn=Y?Ft.error:Z.error,mn=typeof un==`string`&&un.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,hn=(0,K.useMemo)(()=>$?null:Be(un,`diff-panel:${r}`,{compactPartialHunkOffsets:G===null}),[$,r,un,G]),gn=(0,K.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:_n,isPending:vn,fileStates:yn,retry:bn,requestFile:xn,readyFilePaths:Sn,renderableFiles:Cn,settledFileCount:wn,loadNextFiles:Tn}=It({environmentId:L?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??xt,ignoreWhitespace:g,theme:r,revision:Z.data?ce(Z.data.generatedAt):void 0,preview:hn}),En=Bt;(0,K.useEffect)(()=>{if(!Lt)return;let e=()=>En();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,En]),_t({enabled:Lt,mutationId:n,refresh:En,resourceKey:`diff:${Rt??``}`});let Dn=Z.isPending||vn,On=(0,K.useMemo)(()=>Cn.map(Kt),[Cn]),kn=(0,K.useMemo)(()=>i.diffFilesCollapsed?new Set(On.map(e=>e.fileKey)):qt,[On,i.diffFilesCollapsed]),An=D.scopeKey===X?D.fileKeys:kn,jn=(0,K.useCallback)(()=>wn<Cn.length?(0,J.jsx)(zt,{load:Tn,count:Cn.length-wn}):null,[wn,Cn.length,Tn]),Mn=(0,K.useMemo)(()=>On.filter(({fileDiff:e})=>!$||Sn.has(U(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:U(e),fileKey:t,fileVersion:n,collapsed:An.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[An,On,$,Sn]),Nn=(0,K.useMemo)(()=>On.map(e=>e.fileKey),[On]),Pn=Te(Nn,An),Fn=(0,K.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):Ge(Cn),[Cn,Q,Y]),In=(0,K.useMemo)(()=>we(Cn),[Cn]),Ln=St?Mn.find(e=>e.filePath===St)?.fileKey??null:null;(0,K.useEffect)(()=>{Ln&&j?.getInstance()&&j.scrollTo({type:`item`,id:Ln,align:`start`})},[j,kt,Ln,Ct]);let Rn=(0,K.useMemo)(()=>({collapseScopeKey:X,diffSelection:W}),[X,W]),zn=Se(j,Rn,Mn.map(e=>e.fileKey)),Bn=(0,K.useCallback)(e=>{let t=On.findIndex(t=>U(t.fileDiff)===e),n=On[t];n&&(O(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:kn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=wn&&xn(t),zn(n.fileKey))},[On,X,kn,zn,$,wn,xn]),Vn=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(Vn.current?.cache!==_n||Vn.current.key!==e)&&(Vn.current={cache:_n,key:e},Bn(St))},[$,St,Ct,_n,Bn]);let Hn=(0,K.useCallback)(e=>{Pe({threadRef:I,filePath:e,activeCwd:H,repositoryRoot:be,openInEditor:e=>{(async()=>{let t=await He(e);t._tag===`Failure`&&!P(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...I?{environmentId:I.environmentId,threadId:I.threadId}:{},...F(N(t))})})()}})},[H,be,He,I]),Un=(0,K.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:kn});(0,K.useLayoutEffect)(()=>{Un.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:kn}},[X,kn]);let Wn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Un.current;O(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Gn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Un.current;O(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Kn=(0,K.useCallback)(()=>{A(e=>e+1),O(e=>{let t=e.scopeKey===X?e.fileKeys:kn;return{scopeKey:X,fileKeys:Ce(Nn,t)}})},[X,kn,Nn]),qn=e=>{I&&Le.getState().selectTurn(I,e)},Jn=e=>{I&&Le.getState().selectGitScope(I,e)},Yn=e=>{I&&Le.getState().selectBranchBaseRef(I,e)},Xn=Y?`turn:${Y.runId}`:``,Zn=G===null?q:Y?.runId===Et?.runId?`latest`:Xn,Qn=e=>{if(e===`unstaged`||e===`branch`)Jn(e);else if(e===`latest`)Et&&qn(Et.runId);else{let t=et.find(t=>`turn:${t.runId}`===e);t&&qn(t.runId)}},$n=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,J.jsxs)(v,{children:[(0,J.jsxs)(b,{render:(0,J.jsx)(C,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Dt}`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:Dt}),(0,J.jsx)(d,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(ie,{align:`start`,children:[(0,J.jsxs)(x,{value:Zn,onValueChange:Qn,children:[(0,J.jsx)(y,{value:`branch`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Changes`})}),(0,J.jsx)(y,{value:`unstaged`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Uncommitted`})}),(0,J.jsx)(y,{value:`latest`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Latest turn`})})]}),(0,J.jsxs)(S,{children:[(0,J.jsx)(ne,{children:`Turn`}),(0,J.jsx)(se,{children:(0,J.jsx)(x,{value:Xn,onValueChange:Qn,children:et.map(e=>{let t=e.checkpointTurnCount??$e[e.runId]??`?`;return(0,J.jsx)(y,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{children:[`Turn `,t]}),(0,J.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:Ze(e.completedAt,i.timestampFormat)})]})},e.runId)})})})]})]})]}),$t&&(0,J.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Zt} against ${Qt}`,children:[(0,J.jsxs)(rt,{children:[(0,J.jsxs)(tt,{render:(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,J.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Zt}),(0,J.jsx)(T,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsx)(nt,{side:`top`,children:`${Zt} → ${Qt}`})]}),(0,J.jsxs)(ft,{items:sn,filteredItems:cn,value:xt??Ut,onOpenChange:e=>{e||E(``)},onValueChange:e=>{e&&Yn(e===Ut?null:e)},children:[(0,J.jsxs)(st,{render:(0,J.jsx)(C,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Qt}`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:Qt}),(0,J.jsx)(d,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(lt,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,J.jsx)(dt,{placeholder:`Search refs...`,value:w,onChange:e=>E(e.target.value)}),(0,J.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,J.jsx)(`span`,{children:`Branch`}),(0,J.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,J.jsx)(ct,{children:`No matching refs.`}),(0,J.jsxs)(ot,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,J.jsx)(ut,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:Ut,children:(0,J.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),rn.map(e=>{let t=on(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,J.jsx)(ut,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,J.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,J.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,J.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,J.jsx)(mt,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Yn(n)}})}):e.remote?(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,J.jsx)(o,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,J.jsx)(nt,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[Mn.length>0||!Y&&Q?.files?.length?(0,J.jsx)(vt,{additions:Fn.additions,deletions:Fn.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(C,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Dn?`Refreshing diff`:`Refresh diff`,onClick:Vt}),children:(0,J.jsx)(gt,{size:`sm`,refreshing:Dn})}),(0,J.jsx)(nt,{side:`top`,children:Dn?`Refreshing diff…`:`Refresh diff`})]}),Nn.length>0&&(0,J.jsx)(C,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Pn?`Expand all files`:`Collapse all files`,onClick:Kn,children:(0,J.jsx)(ve,{className:`size-3.5`,icon:Pn?me:ge})}),(0,J.jsxs)(it,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[a],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&c({diffLayout:t})},children:[(0,J.jsx)(at,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,J.jsx)(ae,{className:`size-3.5`})}),(0,J.jsx)(at,{"aria-label":`Split diff view`,value:`split`,children:(0,J.jsx)(_,{className:`size-3.5`})})]}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":u?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:u,onPressedChange:e=>{p(!!e)}}),children:(0,J.jsx)(s,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:u?`Disable line wrapping`:`Enable line wrapping`})]}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":g?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:g,onPressedChange:e=>{ee(!!e)}}),children:(0,J.jsx)(h,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:g?`Show whitespace changes`:`Hide whitespace changes`})]}),Nn.length>0&&(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":te?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:te,onPressedChange:e=>re(!!e)}),children:(0,J.jsx)(m,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:te?`Hide file tree`:`Show file tree`})]})]})]});return(0,J.jsx)(Ke,{mode:e,header:$n,children:L?Xe?G!==null&&et.length===0?(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):G===null&&!pe?z.isPending?(0,J.jsx)(Ye,{label:`Checking file access...`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:z.error??`This connection cannot read local diffs.`}):(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[dn&&!$&&(0,J.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),pn&&!hn&&(0,J.jsx)(`div`,{className:`px-3`,children:(0,J.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:pn})}),!hn&&!$?fn?(0,J.jsx)(Ye,{label:Y?`Loading checkpoint diff...`:q===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,J.jsx)(`p`,{children:mn?`No net changes in this selection.`:`No patch available for this selection.`})}):$||hn?.kind===`files`?(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Hn(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=Mn.find(e=>e.filePath===r);i&&Wn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),ze({environmentId:L?.environmentId??null,filePath:t,workspaceRoot:H,repositoryRoot:be},e))},children:(0,J.jsx)(wt,{viewerRef:M,codeViewKey:`${kt}:${$?_n:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:Mn,renderCodeViewFooter:jn,sectionId:Ot,sectionTitle:At,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=U(e),n=yn.get(t);return(0,J.jsx)(Yt,{filePath:t,hasStat:gn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:bn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=gn.get(U(e));return t?(0,J.jsx)(vt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Gn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,J.jsx)(Jt,{filePath:U(e),fileKey:t,collapsed:n||An.has(t),unavailable:n,iconClassName:Ue(e),onToggle:Wn})},options:{diffStyle:a===`split`?`split`:`unified`,lineDiffType:`none`,overflow:u?`wrap`:`scroll`,theme:Ve(r),preferredHighlighter:pt,themeType:r,stickyHeaders:!0,...Ht?{loadDiffFiles:Xt}:{}}},X??Ot)}),te?(0,J.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,J.jsx)(Ee,{ariaLabel:`${At} files`,entries:In,selectedPath:St,revealRequestId:Ct,onSelectFile:Bn})}):null]}):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:hn?.kind===`raw`?hn.reason:null}),(0,J.jsx)(`pre`,{className:oe(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,u?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:hn?.kind===`raw`?hn.text:null})]})})]})}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{Xt as default};
2
- //# sourceMappingURL=DiffPanel-CDixqNzb.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,t as a}from"./utils-Cs97wR6T.js";import{G as o,d as s,f as c}from"./settingsLayout-BijX6mlS.js";import{Mo as l,No as u,jo as d}from"./main-C8b9a0ht.js";var f=n(),p=e(t(),1),m=e(r(),1);function h(e){let t=(0,f.c)(50),{id:n,title:r,summary:h,control:g,headerPlacement:_,children:v}=e,y=_===void 0?`inside`:_,[b,x]=(0,p.useState)(!1),S=c(),C=s(n),[w,T]=(0,p.useState)(null);if(S===n&&w!==n&&(T(n),b||x(!0)),y===`outside`){let e=b&&`rotate-90`,s;t[0]===e?s=t[1]:(s=a(`size-4 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,e),t[0]=e,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,m.jsx)(i,{"aria-hidden":!0,className:s}),t[2]=s,t[3]=c);let f;t[4]!==c||t[5]!==r?(f=(0,m.jsx)(`h2`,{children:(0,m.jsxs)(u,{className:`flex min-h-7 items-center gap-2 rounded-md text-sm font-normal text-foreground/70 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[r,c]})}),t[4]=c,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==g||t[8]!==f?(p=(0,m.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[f,g]}),t[7]=g,t[8]=f,t[9]=p):p=t[9];let h;t[10]===v?h=t[11]:(h=(0,m.jsx)(l,{children:(0,m.jsx)(o,{children:v})}),t[10]=v,t[11]=h);let _;t[12]!==p||t[13]!==h?(_=(0,m.jsxs)(`div`,{className:`space-y-2.5`,children:[p,h]}),t[12]=p,t[13]=h,t[14]=_):_=t[14];let y;t[15]!==b||t[16]!==_?(y=(0,m.jsx)(d,{open:b,onOpenChange:x,children:_}),t[15]=b,t[16]=_,t[17]=y):y=t[17];let S;return t[18]!==n||t[19]!==y||t[20]!==C?(S=(0,m.jsx)(`section`,{id:n,ref:C,tabIndex:-1,className:`outline-none`,children:y}),t[18]=n,t[19]=y,t[20]=C,t[21]=S):S=t[21],S}let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,m.jsx)(o,{divided:!1}),t[22]=E):E=t[22];let D=b&&`rotate-90`,O;t[23]===D?O=t[24]:(O=a(`size-4 shrink-0 text-muted-foreground transition-transform duration-150 motion-reduce:transition-none`,D),t[23]=D,t[24]=O);let k;t[25]===O?k=t[26]:(k=(0,m.jsx)(i,{"aria-hidden":!0,className:O}),t[25]=O,t[26]=k);let A;t[27]===r?A=t[28]:(A=(0,m.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:r}),t[27]=r,t[28]=A);let j;t[29]===h?j=t[30]:(j=h?(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:h}):null,t[29]=h,t[30]=j);let M;t[31]!==k||t[32]!==A||t[33]!==j?(M=(0,m.jsxs)(u,{className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring rounded-md`,children:[k,A,j]}),t[31]=k,t[32]=A,t[33]=j,t[34]=M):M=t[34];let N;t[35]===g?N=t[36]:(N=g?(0,m.jsx)(`div`,{className:`flex shrink-0 items-center`,children:g}):null,t[35]=g,t[36]=N);let P;t[37]!==M||t[38]!==N?(P=(0,m.jsxs)(`div`,{className:`flex items-center gap-4 px-3 sm:px-4`,children:[M,N]}),t[37]=M,t[38]=N,t[39]=P):P=t[39];let F;t[40]===v?F=t[41]:(F=(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`border-t border-border/50 [&>*+*]:border-t [&>*+*]:border-border/50`,children:v})}),t[40]=v,t[41]=F);let I;t[42]!==b||t[43]!==P||t[44]!==F?(I=(0,m.jsxs)(d,{open:b,onOpenChange:x,render:E,children:[P,F]}),t[42]=b,t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==n||t[47]!==I||t[48]!==C?(L=(0,m.jsx)(`section`,{id:n,ref:C,tabIndex:-1,className:`outline-none`,children:I}),t[46]=n,t[47]=I,t[48]=C,t[49]=L):L=t[49],L}export{h as t};
2
- //# sourceMappingURL=FoldedSettingsSection-CrJX4FnL.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{t as r}from"./FieldControl-Bjdbc6Ii.js";var i=e(t()),a=e(n()),o=i.forwardRef(function(e,t){return(0,a.jsx)(r,{ref:t,...e})});export{o as t};
2
- //# sourceMappingURL=Input-BWhtnCC0.js.map
@@ -1 +0,0 @@
1
- export{t as flowchart}from"./O65XPQGZ-COhBlGA1.js";
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/modelScene-DWYEc7-j.js","assets/index-BWKkBtFt.js","assets/EmbeddedDesign-AHra-cLY.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/arrow-down-up-CQvYrirj.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/box-D-FyjNxy.js","assets/boxes-C-8su4bQ.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-up-down-DakHVkrx.js","assets/circle-alert-DsKXULDS.js","assets/circle-Doq0I3MA.js","assets/component-JSmFb2_b.js","assets/download-S2u-tXaE.js","assets/ellipsis-Zza4fevQ.js","assets/file-code-corner-eTofF8xM.js","assets/focus-BDyIV5Sk.js","assets/folder-7OwzWKex.js","assets/frame-DP6YmttG.js","assets/group-CnfjRknC.js","assets/hand-DYZjsgDX.js","assets/history-CdIQPf9A.js","assets/image-Dp6bFTt-.js","assets/layers-DnKM4R7R.js","assets/layout-grid-D1Rx_z3B.js","assets/library-CIkKvFHO.js","assets/link-BG0xfm4f.js","assets/lock-CUPWkQFd.js","assets/map-pin-5j8sOIXW.js","assets/maximize-2-Ci1M4n4b.js","assets/message-square-plus-CEJzfFo0.js","assets/message-square-HrqKYo9g.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/plus-B2sOrZDk.js","assets/refresh-cw-D5OcXJqv.js","assets/scan-search-fpkwq8GA.js","assets/scan-C9HMBvTB.js","assets/search-BXnNiPfE.js","assets/settings-DSIgI7hn.js","assets/spline-DfCXrygK.js","assets/square-ekoTCPwL.js","assets/swatch-book-07--zpLt.js","assets/type-CjUvBO4t.js","assets/upload-Cra7ct3V.js","assets/wifi-off-ODm5nCE4.js","assets/x-C35beONT.js","assets/utils-Cs97wR6T.js","assets/activity-CbqMUSRC.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chromium-x91nZeen.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-stop-0Wd2uKSK.js","assets/circle-x-DMkHWcTz.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/house-ClTLFcnB.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/key-round-POn1aRXW.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/zap-BIb9m3mg.js","assets/src-BZzGU-vc.js","assets/useRender-BP5vR6yH.js","assets/runtime-DUPVFypn.js","assets/entities-CpJdh0W5.js","assets/server-BYnv0CK4.js","assets/session-BryEqNW-.js","assets/SelectScrollUpArrow-Dj2om6Qx.js","assets/usePreviousValue-Dx4Nv0v8.js","assets/useRegisterFieldControl-BMmbsxkx.js","assets/FormContext-CXpUoAJn.js","assets/CSPContext-jKZ42W4p.js","assets/useNavigate-B7EiSugn.js","assets/useParams-C5b2x5BH.js","assets/useSettings-C6RmJr-q.js","assets/relay-CnLeC-mg.js","assets/TooltipProvider-BzOo4iyi.js","assets/spinner-DmRIQvmI.js","assets/CollapsiblePanel-BlUD5mJC.js","assets/use-atom-command-DMW6SFOx.js","assets/themePalette-DSR5tBE9.js","assets/rightPanelStore-D-meSGn7.js","assets/ClippedText-aNLi0IDp.js","assets/usePopupViewport-Dtwu2x5j.js","assets/CheckboxIndicator-CLFg8-A1.js","assets/useAriaLabelledBy-E7KNTqMb.js","assets/FieldItemContext-sr3mCd2v.js","assets/ComboboxClear-DKHwuDAL.js","assets/combobox-BfOjf6Iu.js","assets/input-K95B1E2P.js","assets/Input-BWhtnCC0.js","assets/FieldControl-Bjdbc6Ii.js","assets/scroll-area-D9QT2Odm.js","assets/ScrollAreaCorner-B9Aiu69u.js","assets/ComboboxGroupLabel-BaZLyLCv.js","assets/DialogTitle-C9j5Tmuy.js","assets/PopoverHandle-BwqnKm9Y.js","assets/AlertDialogRoot-D2Lzxp77.js","assets/DesignPageTile-BpKKK7zG.js","assets/design-BL2REeQ-.js","assets/main-C8b9a0ht.js","assets/vcsRefInvalidation-CAa5en8i.js","assets/query-DpmTmXUV.js","assets/number-field-D6t0GpAB.js","assets/select-BtqP8nTL.js","assets/link-B57I0_wC.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-Bi84pz13.js","assets/useLocation-hVHAnHTx.js","assets/toastHelpers-DxXYm50b.js","assets/queries-DDAXRF4r.js","assets/diffPanelStore-B-hQEy6C.js","assets/diffRendering-BnN6RWwy.js","assets/threadCheckpoints-D0dMlqZE.js","assets/session-logic-DZfPxiBF.js","assets/htmlRender-CxBGTvqW.js","assets/mediaSource-BQkNpHYP.js","assets/fileLinks-LQyYck3z.js","assets/mediaReference-BIsAfUoY.js","assets/usageFormat-Njxx7Q49.js","assets/timestampFormat-Dq7sHZpd.js","assets/env-BfPir1X4.js","assets/tooltip-CAzkzAoH.js","assets/skeleton-DxuQc9Kk.js","assets/toggle-Zti3zuzr.js","assets/toggle-group-D015gcqT.js","assets/CompositeRoot-_C3uLH2F.js","assets/dist--Lo1A95S.js","assets/dialog-BzESHWgr.js","assets/sidebar-DbrWNN9-.js","assets/useResizeDrag-CWrW8GV3.js","assets/previewMiniPlayerStore-oJw0qrRM.js","assets/observeResize-nOwAB2yP.js","assets/AnimatedHeight-CsOfc5H1.js","assets/assets-lJdcWn_Q.js","assets/sourceControl-BbrGhAuF.js","assets/assetUrls-DyJx-URx.js","assets/browserHistoryStore-zdRsIuMc.js","assets/preview-DIIM6Lws.js","assets/openFileInPreview-DFpXOfx7.js","assets/keybindings-C427DPQo.js","assets/Icons-BzIBDVKW.js","assets/preview-CS0uw3GP.js","assets/PierreEntryIcon-C-5f-jFb.js","assets/pierre-icons-C2-xRx0J.js","assets/RenderErrorBoundary-DgYrYlQR.js","assets/sourceControlClients-CG8qRQgm.js","assets/browserLinkTarget-aye_Gpt4.js","assets/pullRequestIcons-6_4tgVDN.js","assets/pullRequests-u-PJpGXV.js","assets/threadSort-Bd2rijEy.js","assets/popover-CtPuvMeZ.js","assets/ProjectFavicon-CPvmNs3J.js","assets/ProjectMonogram-Cesz5yVS.js","assets/composerTrigger-BGi0iyhl.js","assets/projectFilesQueryState-DpLF9eJd.js","assets/pullRequestDetail.logic-8vF2qB9V.js","assets/checkbox-ueGFMqVv.js","assets/pullRequestReviewStore-C8_coQYO.js","assets/terminalSessions-D1m7FXoa.js","assets/useHandleNewThread-Cmiu3y4G.js","assets/p4ProjectFile-Dkwk3dWQ.js","assets/uiStateStore-B0Z02qoV.js","assets/sidebarProjectGrouping-CZnpDNTf.js","assets/EnvironmentMachineIcon-BnMVjB89.js","assets/alert-BdISKl4u.js","assets/alert-dialog-Broi1wym.js","assets/semver-BoU8Be_3.js","assets/ChatGptUsageButton-CM16mB7z.js","assets/RedactedSensitiveText-DrIhPFXw.js","assets/kbd-D9Q8zN3_.js","assets/settingsLayout-BijX6mlS.js","assets/WorkspacePageContainer-VqvvyrKx.js","assets/KeybindingsSettings.logic-DjD-8Wsr.js","assets/usageShortcuts-DuJeedG7.js","assets/primaryCloudLinkState-B6CxZwAR.js","assets/command-CeMH9lgx.js","assets/ConnectionStatusDot-vOKtZfeV.js","assets/standalone-page-DrNBm39d.js","assets/primary-B0bbGdiR.js","assets/onboarding-BpYTNtvC.js","assets/scheduledTasksSettings.logic-DmlMHwKF.js","assets/main-CCH0X0zL.css","assets/EmbeddedDesign-2h_Gl1nY.css","assets/GLTFLoader-DL026JyV.js","assets/RoomEnvironment-Iz7-KYrN.js"])))=>i.map(i=>d[i]);
2
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-BWKkBtFt.js";import{t as r}from"./jsx-runtime-DJeoFXNw.js";import{t as i}from"./check-CdrGo1Oa.js";import{t as a}from"./image-up-f7X837EZ.js";import{t as o}from"./orbit-CTbdaXs-.js";import{t as s}from"./pause-5XtmSS7L.js";import{t as c}from"./play-3I2EkmKd.js";import{t as l}from"./rotate-ccw-DpwKQVbi.js";import{a as u,c as d,l as f,o as p,s as m,u as h}from"./EmbeddedDesign-AHra-cLY.js";var g=e(t(),1),_={created:0,disposed:0,frames:0},v=2048;function y(e,t,n){return Math.max(.25,Math.min(2,n,v/Math.max(e,t,1)))}function b(e){let t=null,n=null,r=0,i=0,a=0,o=0,s=0,c=!0,l=!1,d=0,m=0,h={phase:`idle`,playing:!1,progress:0,orbited:!1,firstFrame:!1},g=t=>{h={...h,...t},e.onState(h)},v=0,b=e=>{if(!t||!n)return;let r=f(n,h.progress);t.setCamera(u(r.camera,d,m)),e&&!h.playing&&t.setClipTime(r.clipTime),v=r.clipTime},x=e=>{if(i=0,t){if(!c)a=0;else{if(h.playing){let n=a?Math.min(100,e-a):0;a=e,t.advance(n/1e3),o+=n,o>=s&&(a=0,g({playing:!1}))}t.render(),_.frames++,l=!1,h.firstFrame||g({firstFrame:!0}),h.playing&&S()}}},S=()=>{l=!0,!i&&t&&c&&(i=e.schedule(x))},C=()=>{i&&e.cancel(i),i=0,a=0,t&&(t.dispose(),_.disposed++),t=null},w={get state(){return h},async open(e,i,a){C();let s=++r;n=e,d=m=0,o=0,g({phase:`loading`,playing:!1,progress:0,orbited:!1,firstFrame:!1});let c;try{c=await i(),_.created++}catch{s===r&&g({phase:`fallback`});return}s===r?(t=c,b(!0),g({phase:`live`}),e.animation?.autoplay&&!a.reduceMotion&&t.clipSeconds?w.play():S()):(c.dispose(),_.disposed++)},close(){r++,C(),n=null,g({phase:`idle`,playing:!1,firstFrame:!1})},lost(){C(),g({phase:`fallback`,playing:!1})},update(e){n=e,b(f(e,h.progress).clipTime!==v),S()},resize(e,n,r){t?.setSize(e,n,y(e,n,r)),S()},setDrawable(t){t!==c&&(c=t,!t&&i&&(e.cancel(i),i=0,a=0),t&&(l||h.playing)&&S())},scrub(e){g({progress:Math.min(1,Math.max(0,e))}),b(!0),S()},orbit(e,t){d+=e,m+=t,g({orbited:!0}),b(!1),S()},resetOrbit(){d=m=0,g({orbited:!1}),b(!1),S()},play(){t?.clipSeconds&&n&&(o=0,s=p(t.clipSeconds,n.animation?.loop??!1),!n.animation?.loop&&t.clipTime()>=t.clipSeconds-.001&&t.setClipTime(0),a=0,g({playing:!0}),S())},pause(){h.playing&&g({playing:!1})},capture(e,r){if(!t||!n)return Promise.reject(Error(`No live model`));let i=t,a=i.clipTime(),o=f(n,0);i.setCamera(o.camera),i.setClipTime(o.clipTime);let s=i.capture(e,r);return i.setClipTime(a),b(!1),S(),s}};return w}var x=e(r(),1),S=150,C=48,w=168,T={phase:`idle`,playing:!1,progress:0,orbited:!1,firstFrame:!1};function E({nodeId:e,node:t,posterAsset:r,world:u,screen:f,clip:p,canvas:_,background:v,leaving:E,loadModel:D,savePoster:O}){let k=(0,g.useRef)(null),A=(0,g.useRef)({width:0,height:0}),[j,M]=(0,g.useState)(T),[N,P]=(0,g.useState)(!1),[F,I]=(0,g.useState)(`idle`),L=(0,g.useMemo)(()=>b({schedule:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e),onState:M}),[]),R=(0,g.useMemo)(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,[]),z=m(t),B=t.poster===void 0?`missing`:r?.provenance?.source===`poster`&&r.provenance.reference!==z?`stale`:null,V=Math.min(f.width,f.height)>=C,H=(0,g.useRef)({node:t,loadModel:D,background:v,screen:f});H.current={node:t,loadModel:D,background:v,screen:f},(0,g.useEffect)(()=>{let e=k.current;if(!e||!V)return;let t=window.document.createElement(`canvas`);t.setAttribute(`aria-label`,`${H.current.node.name}, live 3D view`),e.append(t);let r=e=>{e.preventDefault(),L.lost()};t.addEventListener(`webglcontextlost`,r);let i=!0;return L.open(H.current.node,async()=>{let e=await H.current.loadModel();if(!e)throw Error(`Model file is unavailable`);let{createModelScene:r}=await n(async()=>{let{createModelScene:e}=await import(`./modelScene-DWYEc7-j.js`);return{createModelScene:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361])),a=await r(t,e,H.current.node,H.current.background,()=>i),{width:o,height:s}=H.current.screen;return a.setSize(o,s,y(o,s,window.devicePixelRatio||1)),a},{reduceMotion:R}),()=>{i=!1,t.removeEventListener(`webglcontextlost`,r),L.close(),t.remove(),A.current={width:0,height:0}}},[L,V,e,t.model,t.environment,t.animation?.clip,t.animation?.loop,v,R]),(0,g.useEffect)(()=>{j.phase===`live`&&L.update(t)},[L,t,j.phase]);let U=f.x+f.width>0&&f.y+f.height>0&&f.x<_.width&&f.y<_.height,[W,G]=(0,g.useState)(!1),[K,q]=(0,g.useState)(()=>window.document.hidden);(0,g.useEffect)(()=>{let e=()=>q(window.document.hidden);return window.document.addEventListener(`visibilitychange`,e),()=>window.document.removeEventListener(`visibilitychange`,e)},[]),(0,g.useEffect)(()=>{if(j.phase!==`live`)return;let e=!A.current.width;e||G(!0);let t=()=>{G(!1);let{width:e,height:t}=H.current.screen;(A.current.width!==e||A.current.height!==t)&&(A.current={width:e,height:t},L.resize(e,t,window.devicePixelRatio||1))};if(e){t();return}let n=setTimeout(t,S);return()=>clearTimeout(n)},[L,j.phase,f.x,f.y,f.width,f.height]),(0,g.useEffect)(()=>{L.setDrawable(U&&!K&&!W&&!E)},[L,U,K,W,E]);let J=(0,g.useRef)(null),Y=async()=>{if(O){I(`saving`);try{let t=d(u.width,u.height),n=await L.capture(t.width,t.height),r=await O({nodeId:e,data:new Uint8Array(await n.arrayBuffer()),mimeType:n.type===`image/webp`?`image/webp`:`image/png`,width:t.width,height:t.height,posterKey:z});I(r?`saved`:`idle`)}catch{I(`idle`)}}};(0,g.useEffect)(()=>{j.firstFrame&&B===`missing`&&O&&J.current!==`${e}:${z}`&&(J.current=`${e}:${z}`,Y())}),(0,g.useEffect)(()=>{if(F!==`saved`)return;let e=setTimeout(()=>I(`idle`),1600);return()=>clearTimeout(e)},[F]),(0,g.useEffect)(()=>{if(!N)return;let e=e=>{e.key===`Escape`&&(P(!1),L.resetOrbit())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[N,L]);let X=(0,g.useRef)(null),Z=j.firstFrame&&j.phase===`live`,Q=p?`inset(${Math.max(0,p.y-f.y)}px ${Math.max(0,f.x+f.width-(p.x+p.width))}px ${Math.max(0,f.y+f.height-(p.y+p.height))}px ${Math.max(0,p.x-f.x)}px)`:void 0,ee=!!t.animation&&j.phase===`live`,$={left:Math.max(0,-f.x)+8,top:Math.max(0,-f.y)+8,bottom:Math.max(0,f.y+f.height-_.height)+8},te=Math.min(f.width,_.width-$.left+8)>=w&&j.phase===`live`;return(0,x.jsxs)(`div`,{className:`design-model-live`,"data-shown":Z||void 0,"data-leaving":E||void 0,"data-orbiting":N||void 0,style:{transform:`translate3d(${f.x}px, ${f.y}px, 0)`,width:f.width,height:f.height,...Q?{clipPath:Q}:{}},children:[V?(0,x.jsx)(`div`,{ref:k,className:`design-model-canvas`,onPointerDown:e=>{N&&(e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),X.current={x:e.clientX,y:e.clientY})},onPointerMove:e=>{if(!X.current)return;let t=e.clientX-X.current.x,n=e.clientY-X.current.y;X.current={x:e.clientX,y:e.clientY},L.orbit(-t*.01,n*.01)},onPointerUp:()=>{X.current=null},onPointerCancel:()=>{X.current=null}}):null,V&&j.phase!==`idle`?(0,x.jsx)(`span`,{className:`design-model-chip`,style:{left:$.left,top:$.top},"data-tone":j.phase===`fallback`?`warning`:void 0,"data-gone":j.phase===`live`||void 0,role:`status`,children:j.phase===`fallback`?`3D preview unavailable`:`Loading 3D model`}):null,te?(0,x.jsxs)(`div`,{className:`design-model-toolbar`,role:`toolbar`,"aria-label":`3D model`,style:{left:$.left,bottom:$.bottom},children:[ee?(0,x.jsx)(h,{size:`icon-sm`,variant:`ghost`,"aria-label":j.playing?`Pause`:`Play`,onClick:()=>j.playing?L.pause():L.play(),children:(0,x.jsxs)(`span`,{className:`design-model-swap`,"data-on":j.playing||void 0,children:[(0,x.jsx)(c,{"aria-hidden":`true`}),(0,x.jsx)(s,{"aria-hidden":`true`})]})}):null,t.scroll?(0,x.jsx)(`input`,{className:`design-model-scrub`,type:`range`,min:0,max:100,step:1,value:Math.round(j.progress*100),"aria-label":`Scroll timeline`,onChange:e=>L.scrub(Number(e.currentTarget.value)/100)}):null,(0,x.jsx)(h,{size:`icon-sm`,variant:`ghost`,"aria-label":`Orbit`,"aria-pressed":N,onClick:()=>P(e=>!e),children:(0,x.jsx)(o,{"aria-hidden":`true`})}),j.orbited?(0,x.jsx)(h,{size:`icon-sm`,variant:`ghost`,"aria-label":`Reset view`,onClick:()=>{P(!1),L.resetOrbit()},children:(0,x.jsx)(l,{"aria-hidden":`true`})}):null,O&&(B||F!==`idle`)?(0,x.jsxs)(h,{size:`sm`,variant:`ghost`,disabled:F===`saving`,onClick:()=>void Y(),children:[F===`saved`?(0,x.jsx)(i,{"aria-hidden":`true`}):(0,x.jsx)(a,{"aria-hidden":`true`}),F===`saved`?`Poster saved`:B===`missing`?`Save poster`:`Update poster`]}):null]}):null]})}export{E as ModelLiveLayer};
3
- //# sourceMappingURL=ModelLiveLayer-CxX5pYmA.js.map