@p4code/cli 0.8.8 → 0.8.9

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 (277) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CnPGSVWN.mjs → binCli-C7u9q31G.mjs} +25 -113
  3. package/dist/client/.vite/manifest.json +2071 -2071
  4. package/dist/client/assets/{AnimatedHeight-CeIqOXkD.js → AnimatedHeight-DZPLUjm9.js} +2 -2
  5. package/dist/client/assets/{AuthSurfaceShell-CeFbPegZ.js → AuthSurfaceShell-CY0yRsGY.js} +2 -2
  6. package/dist/client/assets/{CSPContext-BLmE8rVK.js → CSPContext-D9jns38x.js} +2 -2
  7. package/dist/client/assets/{ChatGptUsageButton-gEF4N7W7.js → ChatGptUsageButton-jceJZ5U0.js} +2 -2
  8. package/dist/client/assets/{ChatMarkdown-DQ3uXQzt.js → ChatMarkdown-B2cnntMF.js} +4 -4
  9. package/dist/client/assets/{CodexSetupSection.logic-DobP-gmw.js → CodexSetupSection.logic-Bfp0M73n.js} +2 -2
  10. package/dist/client/assets/{ComboboxClear-fNH6Tj-4.js → ComboboxClear-B-WUNsj0.js} +2 -2
  11. package/dist/client/assets/{CommandBlock-X-DC1M4o.js → CommandBlock-BI9G-Hs9.js} +2 -2
  12. package/dist/client/assets/{ComposerPromptEditor-DiF8eMQV.js → ComposerPromptEditor-CYQVwHWc.js} +4 -4
  13. package/dist/client/assets/{CompositeRoot-Bu_9wjlN.js → CompositeRoot-CZqNlh6y.js} +2 -2
  14. package/dist/client/assets/{ConnectionStatusDot-0G2DkC_D.js → ConnectionStatusDot-BNGv8ojc.js} +2 -2
  15. package/dist/client/assets/{DevicePanel-BkS5Q-Y2.js → DevicePanel-C5V7qlX0.js} +2 -2
  16. package/dist/client/assets/{DeviceSetup-C0iRuaPp.js → DeviceSetup-lLd1Dxuc.js} +2 -2
  17. package/dist/client/assets/{DialogTitle-B7ZsIcBO.js → DialogTitle-Bti0gMwZ.js} +2 -2
  18. package/dist/client/assets/{DiffCommentAnnotation-UyWIyKIO.js → DiffCommentAnnotation-DpZ1jfFT.js} +2 -2
  19. package/dist/client/assets/{DiffFileTree-LZwmN24l.js → DiffFileTree-DW_wXLvM.js} +2 -2
  20. package/dist/client/assets/{DiffPanel-DfD6emFU.js → DiffPanel-DvsF1RpU.js} +2 -2
  21. package/dist/client/assets/{DiffWorkerPoolProvider-BCslhrpA.js → DiffWorkerPoolProvider-BGHe4Gu5.js} +2 -2
  22. package/dist/client/assets/{EnvironmentMachineIcon-Bn0qgNMW.js → EnvironmentMachineIcon-BzeEbEQS.js} +2 -2
  23. package/dist/client/assets/{ExpandableText-DPFtEjPq.js → ExpandableText-CZAoe3pn.js} +2 -2
  24. package/dist/client/assets/{FieldControl-Dcug7PQN.js → FieldControl-DSYkAElP.js} +2 -2
  25. package/dist/client/assets/{FileDiff-CztExdxl.js → FileDiff-qUCf81Vy.js} +2 -2
  26. package/dist/client/assets/{FilePreviewPanel-C_Q3mPlo.js → FilePreviewPanel-DgsQ3_bI.js} +2 -2
  27. package/dist/client/assets/{FoldedSettingsSection-MrezZXWL.js → FoldedSettingsSection-B8ucLmcM.js} +2 -2
  28. package/dist/client/assets/{FormContext-N50VWQHc.js → FormContext-TllbMdtd.js} +2 -2
  29. package/dist/client/assets/{Icons-CBnVp61L.js → Icons-CyDEOiJ2.js} +2 -2
  30. package/dist/client/assets/{KeybindingsSettings.logic-CCa_n5Wn.js → KeybindingsSettings.logic-Dx9jAbbW.js} +2 -2
  31. package/dist/client/assets/{NoProjectsHero-sRJlYzCx.js → NoProjectsHero-Lxz19PUh.js} +2 -2
  32. package/dist/client/assets/{PanelLayoutControls-bgJzxuTg.js → PanelLayoutControls-jZ_kyR1v.js} +4 -4
  33. package/dist/client/assets/{PierreEntryIcon-Bid6ECoT.js → PierreEntryIcon-zwmwEij7.js} +2 -2
  34. package/dist/client/assets/{PreviewPanel-CQlsmVXf.js → PreviewPanel-Cgu0PLKZ.js} +2 -2
  35. package/dist/client/assets/{ProjectDefaultsSettings-BaW9gkj0.js → ProjectDefaultsSettings-DaLgF84f.js} +2 -2
  36. package/dist/client/assets/{ProjectFavicon-oQ8xOLai.js → ProjectFavicon-Cs-IpJFL.js} +3 -3
  37. package/dist/client/assets/{ProjectIconPickerDialog-D1QKDGMX.js → ProjectIconPickerDialog-CWU1aanN.js} +2 -2
  38. package/dist/client/assets/{ProjectMonogram-wj_aiPmM.js → ProjectMonogram-De9Vi6mM.js} +2 -2
  39. package/dist/client/assets/{ProviderAuthTerminal-BXJZPbVk.js → ProviderAuthTerminal-Dod9VT45.js} +2 -2
  40. package/dist/client/assets/{ProviderModelPicker-CQQUHTh0.js → ProviderModelPicker-DnPxGK8M.js} +2 -2
  41. package/dist/client/assets/{ProviderSettingsForm-CX9Fb8_8.js → ProviderSettingsForm-CK0XB_2n.js} +2 -2
  42. package/dist/client/assets/{PullRequestCodeTab-DLqbGyR7.js → PullRequestCodeTab-TTmg3elC.js} +2 -2
  43. package/dist/client/assets/{ReadOnlySourcePreview-B7C0GGAq.js → ReadOnlySourcePreview-DS49yxPu.js} +2 -2
  44. package/dist/client/assets/{RenderErrorBoundary-DfL11xnF.js → RenderErrorBoundary-ChsSTLIX.js} +2 -2
  45. package/dist/client/assets/{ScheduledTasksSettings-Di6Z2urM.js → ScheduledTasksSettings-DK0fR_O9.js} +2 -2
  46. package/dist/client/assets/{ScopedSwitch-DYM42LM4.js → ScopedSwitch-zab4bpLE.js} +2 -2
  47. package/dist/client/assets/{SecretInput-CpQgS_zs.js → SecretInput-7_dN8OZO.js} +2 -2
  48. package/dist/client/assets/{SettingsPanels-D-wcH1Qk.js → SettingsPanels-CvD-BKml.js} +2 -2
  49. package/dist/client/assets/{SettingsPanels.logic-BQHrLt25.js → SettingsPanels.logic-BxZ7DzP5.js} +2 -2
  50. package/dist/client/assets/{SettingsScopeNotice-BbuY3OvE.js → SettingsScopeNotice-Bq3kVMy1.js} +2 -2
  51. package/dist/client/assets/{T3ConnectAccountPages-Bb49yKNe.js → T3ConnectAccountPages-C37rBXr1.js} +2 -2
  52. package/dist/client/assets/{T3ConnectSidebarSignIn-CjmtmsbE.js → T3ConnectSidebarSignIn-Dcx0wC1Y.js} +2 -2
  53. package/dist/client/assets/{ThemeEditorPanel-CeucoKK-.js → ThemeEditorPanel-CDg13cbU.js} +2 -2
  54. package/dist/client/assets/{ThreadTerminalDrawer-Di41e66k.js → ThreadTerminalDrawer-CJZ5gJIq.js} +2 -2
  55. package/dist/client/assets/{Virtualizer-YMJF6Rgn.js → Virtualizer-BzpMB2EV.js} +2 -2
  56. package/dist/client/assets/{WorkspaceBreadcrumb-B4olYudc.js → WorkspaceBreadcrumb-BG0QcIel.js} +2 -2
  57. package/dist/client/assets/{WorkspacePageContainer-D_NDP2pC.js → WorkspacePageContainer-D4M31vG4.js} +2 -2
  58. package/dist/client/assets/{WorkspacePageHeader-CF_fkCJo.js → WorkspacePageHeader-xG2EcvME.js} +2 -2
  59. package/dist/client/assets/{_chat-BvSmDiLw.js → _chat-DWZuy8TH.js} +5 -5
  60. package/dist/client/assets/{_chat.index-B86aUAxh.js → _chat.index-CFbhMaCi.js} +2 -2
  61. package/dist/client/assets/{_chat.new-COnJvlNC.js → _chat.new-B9CmLitW.js} +2 -2
  62. package/dist/client/assets/{_chat.pull-requests-CMa0EuoS.js → _chat.pull-requests-BvS3LBJa.js} +2 -2
  63. package/dist/client/assets/{abnfDiagram-VCTEODGH-GKlp-wAF.js → abnfDiagram-VCTEODGH-DTgtRsRm.js} +2 -2
  64. package/dist/client/assets/{alert-BOSKZyDW.js → alert-BFkMrLRZ.js} +2 -2
  65. package/dist/client/assets/architecture-7GRP2DOG-B_WCZ15Q.js +1 -0
  66. package/dist/client/assets/{architectureDiagram-5GKGNRK7-BbKUUHgQ.js → architectureDiagram-5GKGNRK7-DoSCknS9.js} +2 -2
  67. package/dist/client/assets/{assets-arnK8cZJ.js → assets-CH9UWZJ9.js} +2 -2
  68. package/dist/client/assets/{blockDiagram-I7D4REHJ-BvV9OXgS.js → blockDiagram-I7D4REHJ-CIO7Vskr.js} +2 -2
  69. package/dist/client/assets/{browserHistoryStore-D3NmgwWz.js → browserHistoryStore-CUwwaVj8.js} +2 -2
  70. package/dist/client/assets/{browserLinkTarget-CTDv30-a.js → browserLinkTarget-o1Hmp1Jv.js} +2 -2
  71. package/dist/client/assets/{c4Diagram-7LVT6UL2-BT2fKwga.js → c4Diagram-7LVT6UL2-CmnScM2q.js} +2 -2
  72. package/dist/client/assets/channel-Qn29FVeD.js +2 -0
  73. package/dist/client/assets/{checkbox-B0Q9zWdp.js → checkbox-DSb65NrE.js} +2 -2
  74. package/dist/client/assets/{chunk-4HAMMTFA-BPIUCP2N.js → chunk-4HAMMTFA-CuQTMYv7.js} +2 -2
  75. package/dist/client/assets/{chunk-75Z2AOVW-BY1XFSYe.js → chunk-75Z2AOVW-xNjAbRtQ.js} +2 -2
  76. package/dist/client/assets/{chunk-DU6HZSFF-BhfbeXEz.js → chunk-DU6HZSFF-B-vhPkPw.js} +2 -2
  77. package/dist/client/assets/{chunk-F27PBJKO-CkPC4b2I.js → chunk-F27PBJKO-HjvfKtnV.js} +2 -2
  78. package/dist/client/assets/{chunk-GMAD6QVW-D9bW2adv.js → chunk-GMAD6QVW-kPi65s4F.js} +2 -2
  79. package/dist/client/assets/{chunk-GVQU2GXP-C-gRpKGj.js → chunk-GVQU2GXP-xSVP_0Ga.js} +2 -2
  80. package/dist/client/assets/{chunk-IMKFNOWR-CGR_s6mQ.js → chunk-IMKFNOWR-Bo44GnXt.js} +2 -2
  81. package/dist/client/assets/{chunk-L3NEJ4N5-BPN8qLtR.js → chunk-L3NEJ4N5-CL_FAp25.js} +2 -2
  82. package/dist/client/assets/{chunk-OSK3NFVY-C83gEYhi.js → chunk-OSK3NFVY-C-UAFrKw.js} +2 -2
  83. package/dist/client/assets/{chunk-P2QGCYS3-DoadH0FQ.js → chunk-P2QGCYS3-Cu_kTzsg.js} +2 -2
  84. package/dist/client/assets/{chunk-POPQ4Y6H-OENQdCtW.js → chunk-POPQ4Y6H-DlEI3XVl.js} +2 -2
  85. package/dist/client/assets/{chunk-PWAF6VOD-Bm9xwnBb.js → chunk-PWAF6VOD-COj3Z6PV.js} +2 -2
  86. package/dist/client/assets/{chunk-SHT3W25Y-CZdeFTa3.js → chunk-SHT3W25Y-DmOdlcB6.js} +2 -2
  87. package/dist/client/assets/{chunk-SVP7TREG-CWjZG-1G.js → chunk-SVP7TREG-DZcmFNGC.js} +2 -2
  88. package/dist/client/assets/{chunk-TICWLB2K-C6_3qr0T.js → chunk-TICWLB2K-D2Au2dCv.js} +2 -2
  89. package/dist/client/assets/classDiagram-ZZMXUADV-BNlFiwih.js +2 -0
  90. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BNlFiwih.js +2 -0
  91. package/dist/client/assets/{color-picker-B_vY4rCj.js → color-picker-8XrkJD1z.js} +2 -2
  92. package/dist/client/assets/{combobox-CZ_uig0z.js → combobox-BdHSd-gh.js} +2 -2
  93. package/dist/client/assets/{command-DGoFksB6.js → command-DywgXMPU.js} +2 -2
  94. package/dist/client/assets/{connect-CuZjH_Pw.js → connect-D6Vr-odX.js} +2 -2
  95. package/dist/client/assets/{connect-agent-BhcB_UCW.js → connect-agent-D6S_10vE.js} +2 -2
  96. package/dist/client/assets/{cynefin-OW5HDTMX-BBaHuZtP.js → cynefin-OW5HDTMX-Cl8Piv1U.js} +1 -1
  97. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-D0TOipYC.js → cynefinDiagram-5FMLGOSQ-BlrMhOzc.js} +2 -2
  98. package/dist/client/assets/{dagre-GXQ25YYZ-BqIStTWM.js → dagre-GXQ25YYZ-zcnnhkbu.js} +2 -2
  99. package/dist/client/assets/{device-Dy_6ukvt.js → device-CVYEIUNR.js} +2 -2
  100. package/dist/client/assets/{diagram-S7CK7UJ4-DtlY2HLu.js → diagram-S7CK7UJ4-bDWotpej.js} +2 -2
  101. package/dist/client/assets/{diagram-UQ7AKVKN-AFvyPgaY.js → diagram-UQ7AKVKN-QfcGX0wU.js} +2 -2
  102. package/dist/client/assets/{diagram-VSXAHHWV-BX0DQrOR.js → diagram-VSXAHHWV-B6rtnGIC.js} +2 -2
  103. package/dist/client/assets/{diagram-VX7I27RA-RpuCJkmb.js → diagram-VX7I27RA-Bh7jDf_z.js} +2 -2
  104. package/dist/client/assets/{diagram-Z3DM3KII-YDywc4a-.js → diagram-Z3DM3KII-BF8BOL3s.js} +2 -2
  105. package/dist/client/assets/{dialog-COvCzBu5.js → dialog-B5b8j4VI.js} +2 -2
  106. package/dist/client/assets/{diffRendering-EBC4wPDV.js → diffRendering-CnRmUrdi.js} +2 -2
  107. package/dist/client/assets/{discovery-list-B1TD-soO.js → discovery-list-DLWA9rLh.js} +2 -2
  108. package/dist/client/assets/{dist-Cg-eOU-v.js → dist-B181ZKao.js} +3 -3
  109. package/dist/client/assets/{draft-input-DHW6QTyZ.js → draft-input-CidATm_k.js} +2 -2
  110. package/dist/client/assets/{duoViewer-B9J_QozU.js → duoViewer-gLqnN26Y.js} +2 -2
  111. package/dist/client/assets/{dynamic-CUevKA9_.js → dynamic-C9YFXILD.js} +2 -2
  112. package/dist/client/assets/{ebnfDiagram-PWID7BFC-CAfVAMWI.js → ebnfDiagram-PWID7BFC-DbaAPr36.js} +2 -2
  113. package/dist/client/assets/{embeddedScripts-Cvalo74G.js → embeddedScripts-DZZY2Y12.js} +2 -2
  114. package/dist/client/assets/{empty-Dmvz5ya5.js → empty-BQwNj0_P.js} +2 -2
  115. package/dist/client/assets/{entities-DPdxOTpx.js → entities-CW57Cs5E.js} +2 -2
  116. package/dist/client/assets/{erDiagram-RLTQ6QDP-B8I9HNiQ.js → erDiagram-RLTQ6QDP-CkFVQs9q.js} +2 -2
  117. package/dist/client/assets/eventmodeling-NTZA5JFV-Bx5bcL3d.js +1 -0
  118. package/dist/client/assets/{fileLinks-Cfgs6wOJ.js → fileLinks-CJJSqeqK.js} +2 -2
  119. package/dist/client/assets/{fileTreeExpansion-BbO9lBJr.js → fileTreeExpansion-D1dm7wQj.js} +2 -2
  120. package/dist/client/assets/flowDiagram-HODETNUW-BOrqEpZF.js +1 -0
  121. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-G4XFicxk.js → ganttDiagram-EL5Y4UJY-bgGfFOUy.js} +2 -2
  122. package/dist/client/assets/{getDiffFileInput-BhtRP4yl.js → getDiffFileInput-C3kf5492.js} +2 -2
  123. package/dist/client/assets/{gitGraph-4MIJSDKK-Dz9vbKwX.js → gitGraph-4MIJSDKK-CkcsQXce.js} +1 -1
  124. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BRPk5Iff.js → gitGraphDiagram-WWUBYQGX-D9-3rabr.js} +2 -2
  125. package/dist/client/assets/{guideRunStore-OyuNEz1_.js → guideRunStore-C7ZnghV_.js} +2 -2
  126. package/dist/client/assets/{htmlRender-94mfYlmv.js → htmlRender-Dwrbtk9Z.js} +2 -2
  127. package/dist/client/assets/{index-BGHZIIwm.js → index-CG78-Gl5.js} +3 -3
  128. package/dist/client/assets/{info-A6RAGUB7-C2HElvlZ.js → info-A6RAGUB7-D_d0Mq_H.js} +1 -1
  129. package/dist/client/assets/{infoDiagram-27XIBGKW-IOOCD2gD.js → infoDiagram-27XIBGKW-DYnd3lec.js} +2 -2
  130. package/dist/client/assets/{input-OK9fSGsW.js → input-CNGP9r-b.js} +2 -2
  131. package/dist/client/assets/{input-group-DLt_QDs-.js → input-group-CIDwGwLV.js} +2 -2
  132. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DVm2wQsr.js → ishikawaDiagram-5VMMS53U-Br3IhV30.js} +2 -2
  133. package/dist/client/assets/{journeyDiagram-3NMN7TZE-KFjVMjGh.js → journeyDiagram-3NMN7TZE-D4gshgtr.js} +2 -2
  134. package/dist/client/assets/{kanban-definition-UXKFOSKX-DxT40hgP.js → kanban-definition-UXKFOSKX-DODm_gbD.js} +2 -2
  135. package/dist/client/assets/{kbd-LyGbiGLS.js → kbd-C3OLELe_.js} +2 -2
  136. package/dist/client/assets/{keybindings-BWCWrY_-.js → keybindings-Dw_FB1Sr.js} +2 -2
  137. package/dist/client/assets/{lazyRouteComponent-Doka-Cpt.js → lazyRouteComponent-knQbCz5Y.js} +2 -2
  138. package/dist/client/assets/{line-BUx_Qlcs.js → line-B2pKNKWO.js} +2 -2
  139. package/dist/client/assets/{link-DaswZEsz.js → link-CBNV8k75.js} +2 -2
  140. package/dist/client/assets/{linkedPrompt-3u_uoe6Y.js → linkedPrompt-BsxfomUU.js} +2 -2
  141. package/dist/client/assets/{main-DB45P6Gd.js → main-pmaKofkn.js} +7 -7
  142. package/dist/client/assets/{mediaReference-T3SNj1En.js → mediaReference-BLVT2VlI.js} +2 -2
  143. package/dist/client/assets/{mediaSource-DAJ35Twr.js → mediaSource-1xb6xNr7.js} +2 -2
  144. package/dist/client/assets/{mermaid-parser.core-CuUxy4fc.js → mermaid-parser.core-CT916xNb.js} +4 -4
  145. package/dist/client/assets/{mermaid.core-CV-2Hipl.js → mermaid.core-dZGXThQe.js} +5 -5
  146. package/dist/client/assets/{mindmap-definition-YA3MSWOX-B5gC6PY9.js → mindmap-definition-YA3MSWOX-DRDe2pwU.js} +2 -2
  147. package/dist/client/assets/{number-field-CHOp4dMK.js → number-field-CrV4BtLe.js} +2 -2
  148. package/dist/client/assets/{observeResize-B7tl_Rye.js → observeResize-jQzrVN_N.js} +2 -2
  149. package/dist/client/assets/{onboarding-CFB4Wz5g.js → onboarding-DnxQtcwh.js} +2 -2
  150. package/dist/client/assets/{openFileInPreview-D80asiJZ.js → openFileInPreview-Dx_dxN9N.js} +2 -2
  151. package/dist/client/assets/{p4ProjectFile-BfBM2HoW.js → p4ProjectFile-BfRZT-Cd.js} +2 -2
  152. package/dist/client/assets/{packet-AYTQ26CC-CJ0qzIIY.js → packet-AYTQ26CC-BewZkvu0.js} +1 -1
  153. package/dist/client/assets/{pair-CQbNFhjc.js → pair-B5ki01nI.js} +2 -2
  154. package/dist/client/assets/{pegDiagram-XKGWAZYB-BzvO80-H.js → pegDiagram-XKGWAZYB-C9c_KSl7.js} +2 -2
  155. package/dist/client/assets/{phoneViewer-BghY79hZ.js → phoneViewer-HVXHif_1.js} +2 -2
  156. package/dist/client/assets/{pie-WAS4IAKB-M62byk0f.js → pie-WAS4IAKB-CzmLCGka.js} +1 -1
  157. package/dist/client/assets/{pieDiagram-E7YTZNPT-O5p8eSgL.js → pieDiagram-E7YTZNPT-C-Z8w4pJ.js} +2 -2
  158. package/dist/client/assets/{pierre-icons-BweC0Ojp.js → pierre-icons-CnfzBsKG.js} +2 -2
  159. package/dist/client/assets/{popover-DzOky6C0.js → popover-CCsUmLYF.js} +2 -2
  160. package/dist/client/assets/{preview-DLjmZv-h.js → preview-BJJOaGR2.js} +2 -2
  161. package/dist/client/assets/{preview-CP02VJQW.js → preview-BXxrRVX-.js} +2 -2
  162. package/dist/client/assets/{previewMiniPlayerStore-DnzLYNg5.js → previewMiniPlayerStore-C7poB4-A.js} +2 -2
  163. package/dist/client/assets/{primary-z0kWcTid.js → primary-DBlVHyxT.js} +2 -2
  164. package/dist/client/assets/{primaryCloudLinkState-Bup2zk6b.js → primaryCloudLinkState-BfCEo8Kn.js} +2 -2
  165. package/dist/client/assets/{projectFilesQueryState-BKJPj8kq.js → projectFilesQueryState-CgqhXdfj.js} +2 -2
  166. package/dist/client/assets/{projectScriptEditor-C10v2IgV.js → projectScriptEditor-CARl6hYK.js} +2 -2
  167. package/dist/client/assets/{providerSkills-DPGvsbQq.js → providerSkills-B2xzNGmJ.js} +2 -2
  168. package/dist/client/assets/{pullRequestDetail.logic-CQ1l2jWB.js → pullRequestDetail.logic-CYwAUOQC.js} +2 -2
  169. package/dist/client/assets/{pullRequestIcons-Cwz6tomi.js → pullRequestIcons-SCwBWGeD.js} +2 -2
  170. package/dist/client/assets/{pullRequestReviewStore-DejvzSy2.js → pullRequestReviewStore-C7gfd5m3.js} +2 -2
  171. package/dist/client/assets/{pullRequests-DmlU8TRv.js → pullRequests-DQFba6Nz.js} +2 -2
  172. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DMpTBqB0.js → quadrantDiagram-AXDQQJYC-I8UtWMv_.js} +2 -2
  173. package/dist/client/assets/{queries-DUuhuhAL.js → queries-DfOxYbXr.js} +2 -2
  174. package/dist/client/assets/{query-BWYUB_iK.js → query-w0R7LhwJ.js} +2 -2
  175. package/dist/client/assets/{radar-RG4KPBEZ-CRHj_0uz.js → radar-RG4KPBEZ-CuVsLyvG.js} +1 -1
  176. package/dist/client/assets/{radio-group-8ftKbjDf.js → radio-group-DwQ0T1X6.js} +2 -2
  177. package/dist/client/assets/{railroad-74A4TZTK-LCbjmT_s.js → railroad-74A4TZTK-CZZIaT2B.js} +1 -1
  178. package/dist/client/assets/railroad-abnf-HS5TGJTU-DieERyRq.js +1 -0
  179. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BVbP0cR7.js +1 -0
  180. package/dist/client/assets/railroad-peg-WCYAUIDC-BDR9vaLF.js +1 -0
  181. package/dist/client/assets/{railroadDiagram-O6MQD6OU-B1mHyPCC.js → railroadDiagram-O6MQD6OU-CogIhoTG.js} +2 -2
  182. package/dist/client/assets/{renderScheduler-D3-fIVU2.js → renderScheduler-wjSXDjer.js} +2 -2
  183. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BH8vaSWt.js → requirementDiagram-BXWQKSXE-B9wTphzK.js} +2 -2
  184. package/dist/client/assets/{rightPanelStore-Dfw-4Ia_.js → rightPanelStore-CRw1DWSH.js} +2 -2
  185. package/dist/client/assets/{runtime-ivCTGH5C.js → runtime-ZOY8Qeg_.js} +2 -2
  186. package/dist/client/assets/{runtime-VHJoq9so.js → runtime-qAs3Aj0U.js} +3 -3
  187. package/dist/client/assets/{runtimeModeConfig-JkwDqP4L.js → runtimeModeConfig-VaVDuoFW.js} +2 -2
  188. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DqqzdGsV.js → sankeyDiagram-P5KCCOFB-CeJuchFj.js} +2 -2
  189. package/dist/client/assets/{scheduledTasksSettings.logic-b-y7WIWN.js → scheduledTasksSettings.logic-BBBjz09I.js} +2 -2
  190. package/dist/client/assets/{scroll-area-BtAqRLpC.js → scroll-area-DyzCabMe.js} +2 -2
  191. package/dist/client/assets/{select-FY7psXk-.js → select-BX0YSg0P.js} +2 -2
  192. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-D6EXXu_o.js → sequenceDiagram-WJ2MYXX4-xpNi2v3f.js} +2 -2
  193. package/dist/client/assets/{server-C-qtaHHG.js → server-BxsIDqAi.js} +2 -2
  194. package/dist/client/assets/{session-KZUTmmZy.js → session-Lp4r-IPM.js} +2 -2
  195. package/dist/client/assets/{session-logic-Dy9r5m2F.js → session-logic-BFdJF3Bv.js} +2 -2
  196. package/dist/client/assets/{settings-xVK7Yt1y.js → settings-D6fi9-XU.js} +2 -2
  197. package/dist/client/assets/{settings.appearance-BUsQj9AN.js → settings.appearance-BBT8xGDi.js} +2 -2
  198. package/dist/client/assets/settings.archived-Cg-9thGj.js +2 -0
  199. package/dist/client/assets/{settings.computer-use-CvtFf-rW.js → settings.computer-use-Bona3Wg6.js} +2 -2
  200. package/dist/client/assets/{settings.connections-C90xtGng.js → settings.connections-BqAUuYT4.js} +2 -2
  201. package/dist/client/assets/{settings.data-controls-DemQiCxT.js → settings.data-controls-OJqN88f4.js} +2 -2
  202. package/dist/client/assets/{settings.decisions-DtOP9oNq.js → settings.decisions-CZWGkeug.js} +2 -2
  203. package/dist/client/assets/{settings.diagnostics-DXaoukRP.js → settings.diagnostics-DELbs4ob.js} +2 -2
  204. package/dist/client/assets/{settings.general-DkWee1YY.js → settings.general-B-fstEU-.js} +2 -2
  205. package/dist/client/assets/{settings.integrations-BXlqBhz3.js → settings.integrations-B9_Yw0oa.js} +2 -2
  206. package/dist/client/assets/{settings.keybindings-Br0uBlw0.js → settings.keybindings-tFQjI19L.js} +2 -2
  207. package/dist/client/assets/{settings.open-source-licenses-C7LrTwqH.js → settings.open-source-licenses-J0KhjvdX.js} +2 -2
  208. package/dist/client/assets/{settings.plugins-BWko147F.js → settings.plugins-BnMZc7bA.js} +2 -2
  209. package/dist/client/assets/{settings.projects-Hlmn9qBx.js → settings.projects-B9iYESeP.js} +3 -3
  210. package/dist/client/assets/{settings.providers-CUBhfBx1.js → settings.providers-D_HCdEfA.js} +3 -3
  211. package/dist/client/assets/{settings.scheduled-tasks-CDDYe3d2.js → settings.scheduled-tasks-DaNDwLtr.js} +2 -2
  212. package/dist/client/assets/{settings.snap-shot-BlVwefsY.js → settings.snap-shot-ClQxMhzg.js} +2 -2
  213. package/dist/client/assets/{settings.source-control-b4BRd-7w.js → settings.source-control-Bs4O94Ae.js} +2 -2
  214. package/dist/client/assets/{settings.storage-DHuqQ3GN.js → settings.storage-BYJ2h7qr.js} +2 -2
  215. package/dist/client/assets/{settingsLayout-CthFz77S.js → settingsLayout-DhPKINaL.js} +2 -2
  216. package/dist/client/assets/{sidebar-BvjZQtR9.js → sidebar-ZKIDHqbk.js} +2 -2
  217. package/dist/client/assets/{sidebarProjectGrouping-CvY13nmg.js → sidebarProjectGrouping-BFqO8E5C.js} +2 -2
  218. package/dist/client/assets/{skeleton-p05dxp84.js → skeleton--v3ra8uu.js} +2 -2
  219. package/dist/client/assets/{sortable.esm-BVaB8fBB.js → sortable.esm-UojJGtqY.js} +2 -2
  220. package/dist/client/assets/{sourceControl-CtDr1raw.js → sourceControl-ByZv2xxh.js} +2 -2
  221. package/dist/client/assets/{spinner-CTNKP1wB.js → spinner-CH-Dn9Fj.js} +2 -2
  222. package/dist/client/assets/{standalone-page-BmCMlz1u.js → standalone-page-BwpW1F1h.js} +2 -2
  223. package/dist/client/assets/{stateDiagram-D77RDMKH-CVk9L7UB.js → stateDiagram-D77RDMKH-BMh5LMip.js} +2 -2
  224. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CK8WckkU.js +2 -0
  225. package/dist/client/assets/{swimlanes-42K2YHIH-eDs6vlYW.js → swimlanes-42K2YHIH-CGCv__e7.js} +2 -2
  226. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-D_se7el1.js +9 -0
  227. package/dist/client/assets/{terminal-links-MjQ9lNGX.js → terminal-links-DX86FsHj.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-BEOZlx0H.js → terminalSessions-CUABDfio.js} +2 -2
  229. package/dist/client/assets/{textarea-_oDVfjxe.js → textarea-B3ib3YW-.js} +2 -2
  230. package/dist/client/assets/{themePalette-DtFR3xYu.js → themePalette-Bl55tW1x.js} +2 -2
  231. package/dist/client/assets/{threadSort-BgwLDPpx.js → threadSort-DDAHH_-8.js} +2 -2
  232. package/dist/client/assets/{timeline-definition-24CTP7MA-nEI4h-Tk.js → timeline-definition-24CTP7MA-C_Okwnia.js} +2 -2
  233. package/dist/client/assets/{toast-CyScduZI.js → toast-3I2gpMYd.js} +2 -2
  234. package/dist/client/assets/{toggle-BBpi92mE.js → toggle-Ce46mx2g.js} +2 -2
  235. package/dist/client/assets/{toggle-group--QyJ7uYY.js → toggle-group-Dt1Yldxx.js} +2 -2
  236. package/dist/client/assets/{tooltip-DcTdC2PH.js → tooltip-DdUPPKq4.js} +2 -2
  237. package/dist/client/assets/{treeView-Q6P3EWNA-BqkVgtYX.js → treeView-Q6P3EWNA-23mUAiRP.js} +1 -1
  238. package/dist/client/assets/{treemap-WGGIJYW6-DT4jZxe1.js → treemap-WGGIJYW6-CFr3RCz-.js} +1 -1
  239. package/dist/client/assets/{usage-BoakMkho.js → usage-DXTqHj0T.js} +2 -2
  240. package/dist/client/assets/{usageAccess-Tjotp_ad.js → usageAccess-BX6xSC4z.js} +2 -2
  241. package/dist/client/assets/{usageFormat-C1GJS5IW.js → usageFormat-CWi_Qt3l.js} +2 -2
  242. package/dist/client/assets/{usageShortcuts-BmYIhNjb.js → usageShortcuts-CGv3_tEe.js} +2 -2
  243. package/dist/client/assets/{use-atom-command-CYY238HA.js → use-atom-command-CVDCnNHi.js} +2 -2
  244. package/dist/client/assets/{useAriaLabelledBy-_J6EHbv7.js → useAriaLabelledBy-BnxRm9-q.js} +2 -2
  245. package/dist/client/assets/{useHandleNewThread-BhaVM65m.js → useHandleNewThread-BrxevYhf.js} +2 -2
  246. package/dist/client/assets/{useLocation-Cfwex-wi.js → useLocation-BdZaQ50l.js} +2 -2
  247. package/dist/client/assets/useNavigate-Cdy4Jh5i.js +2 -0
  248. package/dist/client/assets/{useNavigateBack-B0NrYlh8.js → useNavigateBack-BLZDxCI_.js} +2 -2
  249. package/dist/client/assets/{useParams-U7vgc6nk.js → useParams-3tEZUuVD.js} +2 -2
  250. package/dist/client/assets/{usePermissionStatus-Urd4cbKv.js → usePermissionStatus-DCcJZUJC.js} +2 -2
  251. package/dist/client/assets/{usePullRequestActions-DpAVW9io.js → usePullRequestActions-cqQ4IRFz.js} +2 -2
  252. package/dist/client/assets/{useRegisterFieldControl-B-o6bvd-.js → useRegisterFieldControl-Cs54XrA4.js} +2 -2
  253. package/dist/client/assets/{useScopedModelAvailability-CIh6LpSK.js → useScopedModelAvailability-DSe3UBFZ.js} +2 -2
  254. package/dist/client/assets/{useSettings-gJURpIkJ.js → useSettings-DsvnJBf2.js} +2 -2
  255. package/dist/client/assets/{useT3ConnectAuthPrompt-Np9NC6fS.js → useT3ConnectAuthPrompt-CBxfN-Bk.js} +2 -2
  256. package/dist/client/assets/{utils-BBRDx4UJ.js → utils-TSzPLNGf.js} +2 -2
  257. package/dist/client/assets/{vcsRefInvalidation-DwljOjdx.js → vcsRefInvalidation-iz2QneVc.js} +2 -2
  258. package/dist/client/assets/{vennDiagram-4TSXK5OY-kVbUFMzz.js → vennDiagram-4TSXK5OY-DsePUj7P.js} +2 -2
  259. package/dist/client/assets/{wardley-WFR3VGLG-B5JrY4hA.js → wardley-WFR3VGLG-DADViFrd.js} +1 -1
  260. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kNz0Ytm1.js → wardleyDiagram-VM6X3IG4-B7tstBZh.js} +2 -2
  261. package/dist/client/assets/{welcome-vYaNWLrj.js → welcome-CQKf0B5f.js} +2 -2
  262. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DGSU7PNa.js → xychartDiagram-S5SC5T6Z-DRAYLcYA.js} +2 -2
  263. package/dist/client/index.html +1 -1
  264. package/package.json +1 -1
  265. package/dist/client/assets/architecture-7GRP2DOG-BTjma_hq.js +0 -1
  266. package/dist/client/assets/channel-BbVwyPme.js +0 -2
  267. package/dist/client/assets/classDiagram-ZZMXUADV-BZN2DxkM.js +0 -2
  268. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BZN2DxkM.js +0 -2
  269. package/dist/client/assets/eventmodeling-NTZA5JFV-Cg0CFdkZ.js +0 -1
  270. package/dist/client/assets/flowDiagram-HODETNUW-RF9W51fq.js +0 -1
  271. package/dist/client/assets/railroad-abnf-HS5TGJTU-DJLpez1j.js +0 -1
  272. package/dist/client/assets/railroad-ebnf-LZEXJU2U-FSaf-eSC.js +0 -1
  273. package/dist/client/assets/railroad-peg-WCYAUIDC-pIcyAgnc.js +0 -1
  274. package/dist/client/assets/settings.archived-B-IVcn1Z.js +0 -2
  275. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DNtAQSJX.js +0 -2
  276. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CEvm2POs.js +0 -9
  277. package/dist/client/assets/useNavigate-B3U2CN2A.js +0 -2
@@ -1,2 +1,2 @@
1
- import{Cg as e,Ec as t,gc as n,vc as r,wc as i}from"./utils-BBRDx4UJ.js";import"./keybindings-BWCWrY_-.js";import{n as a,t as o}from"./usageShortcuts-BmYIhNjb.js";var s=new Map([`usage.open`,...[...o,...a].map(e=>e.command)].map((e,t)=>[e,t])),c=o[0].command;function l(e,t,n){let r=s.get(e),i=s.get(t);return r!==void 0&&i!==void 0?r-i:n(r===void 0?e:c).localeCompare(n(i===void 0?t:c))}var u=[`terminalFocus`,`terminalOpen`,`isWeb`,`isDesktop`,`true`,`false`],d=new Set(u);for(let e of n)k(e.whenAst,d);var f=[...d].find(e=>e!==`true`&&e!==`false`)??`terminalFocus`,p=new Set(d);function m(e){let t=[];return e.modKey&&t.push(`mod`),e.metaKey&&t.push(`meta`),e.ctrlKey&&t.push(`ctrl`),e.altKey&&t.push(`alt`),e.shiftKey&&t.push(`shift`),t.push(e.key===` `?`space`:e.key===`escape`?`esc`:e.key),t.join(`+`)}function h(e){if(!e)return``;switch(e.type){case`identifier`:return e.name;case`not`:return`!${_(e.node)}`;case`and`:return`${_(e.left)} && ${_(e.right)}`;case`or`:return`${_(e.left)} || ${_(e.right)}`}}function g(e,t){return t===0?`Clear all conditions`:e.type===`identifier`||e.type===`not`&&e.node.type===`identifier`?`Remove condition`:`Remove group and its conditions`}function _(e){return e.type===`identifier`||e.type===`not`?h(e):`(${h(e)})`}function v(e){let t=e.trim();if(t.length===0)return{ok:!0,value:void 0};let n=i(t);return n?{ok:!0,value:n}:{ok:!1,message:`Use variables with !, &&, ||, and parentheses.`}}function y(e){if(String(e.command).startsWith(`script.`))return`Project`;let t=m(e.shortcut),r=h(e.whenAst);return n.some(n=>n.command===e.command&&m(n.shortcut)===t&&h(n.whenAst)===r)?`Default`:`Custom`}function b(e){let t=m(e.shortcut),r=h(e.whenAst);return n.find(n=>n.command===e.command&&m(n.shortcut)===t&&h(n.whenAst)===r)??n.find(t=>t.command===e.command&&h(t.whenAst)===r)??n.find(t=>t.command===e.command)}function x(e,t,n){return`${e}\u0000${t}\u0000${n}`}function S(e,t){return e.length===0||t.length===0||e===t}function C(e,t){if(t.key.trim().length===0)return[];let n=[];for(let r of e)r.id!==t.rowId&&r.key===t.key&&S(r.when,t.when)&&n.push(P(r.command));return[...new Set(n)].toSorted()}var w=[{id:`navigation`,title:`Navigation`,prefixes:[`sidebar`,`rightPanel`,`commandPalette`,`filePicker`,`projectSearch`,`editor`]},{id:`threads`,title:`Threads`,prefixes:[`thread`,`chat`,`pullRequest`]},{id:`composer`,title:`Composer`,prefixes:[`composer`,`modelPicker`]},{id:`terminal`,title:`Terminal`,prefixes:[`terminal`]},{id:`preview`,title:`Preview & diff`,prefixes:[`preview`,`diff`]},{id:`appearance`,title:`Appearance`,prefixes:[`theme`,`appearance`,`themeEditor`]},{id:`scripts`,title:`Project scripts`,prefixes:[`script`]}],T={id:`other`,title:`Other`};function E(e){let t=String(e).split(`.`)[0]??``;return w.find(e=>e.prefixes.includes(t))??T}function D(e){let t=new Map;for(let n of e){let e=E(n.command),r=t.get(e.id);r?r.push(n):t.set(e.id,[n])}return[...w,T].flatMap(e=>{let n=t.get(e.id);return n?[{id:e.id,title:e.title,rows:n}]:[]})}function O(e,t){let n=t.trim().toLowerCase(),r=e.map((e,t)=>{let n=b(e),r=m(e.shortcut),i=h(e.whenAst);return{id:`${x(e.command,r,i)}\u0000${t}`,command:e.command,key:r,when:i,source:y(e),defaultKey:n?m(n.shortcut):null,defaultWhen:h(n?.whenAst),binding:e,conflicts:[]}}),i=r.map(e=>{let t=C(r,{rowId:e.id,key:e.key,when:e.when});return t.length>0?Object.assign({},e,{conflicts:[...new Set(t)].toSorted()}):e});return i.sort((e,t)=>{let n=l(e.command,t.command,e=>e);return n===0?e.key.localeCompare(t.key):n}),n.length===0?i:i.filter(e=>e.command.toLowerCase().includes(n)||P(e.command).toLowerCase().includes(n)||e.key.toLowerCase().includes(n)||e.when.toLowerCase().includes(n)||e.source.toLowerCase().includes(n))}function k(e,t){if(e)switch(e.type){case`identifier`:t.add(e.name);return;case`not`:k(e.node,t);return;case`and`:case`or`:k(e.left,t),k(e.right,t);return}}function A(e){return p.has(e)}function j(e){let t=new Set;return k(e,t),[...t].filter(e=>!A(e)).toSorted()}function M(){return[...p].toSorted((e,t)=>{let n=u.indexOf(e),r=u.indexOf(t);return n!==-1||r!==-1?(n===-1?2**53-1:n)-(r===-1?2**53-1:r):e.localeCompare(t)})}function N(t){let n=new Set(e);for(let e of t)n.add(e.command);return[...n].toSorted((e,t)=>l(e,t,P))}function P(e){if(e===`composer.sendAlternate`)return`Composer: Opposite Queue or Steer Action`;if(e===`composer.sendBackground`)return`Composer: Start in Background`;if(e===`composer.sendAndNewThread`)return`Composer: Send and Start New Thread`;if(e===`thread.steerQueuedMessage`)return`Queue: Send First Queued Message as Steer`;if(e===`thread.editQueuedMessage`)return`Queue: Edit Last Queued Message`;if(e===`thread.copyReference`)return`Pull Request: Copy Link or Thread ID`;let t=o.find(t=>t.command===e);if(t)return`Usage: ${t.label}`;let n=a.find(t=>t.command===e);if(n)return`Usage: Period: ${n.label}`;if(e===`view.reopenClosed`)return`Reopen Closed Tab`;if(e===`preview.focusUrl`)return`Preview: Focus URL`;let r=String(e);return r.startsWith(`script.`)&&r.endsWith(`.run`)?`Run Script: ${F(r.slice(7,-4))}`:r.split(`.`).map(F).join(`: `)}function F(e){let t=[];for(let n of e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/))n.length>0&&t.push(n.slice(0,1).toUpperCase()+n.slice(1));return t.join(` `)}function I(e){let t=e.toLowerCase();return t===`meta`||t===`control`||t===`ctrl`||t===`shift`||t===`alt`||t===`option`?null:t===` `?`space`:t===`escape`?`esc`:t===`arrowup`?`arrowup`:t===`arrowdown`?`arrowdown`:t===`arrowleft`?`arrowleft`:t===`arrowright`?`arrowright`:t.length===1||/^f\d{1,2}$/.test(t)||t===`enter`||t===`tab`||t===`backspace`||t===`delete`||t===`home`||t===`end`||t===`pageup`||t===`pagedown`?t:null}function L(e,n){let i=I(t(e));if(!i)return null;let a=[];return r(n)?(e.metaKey&&a.push(`mod`),e.ctrlKey&&a.push(`ctrl`)):(e.ctrlKey&&a.push(`mod`),e.metaKey&&a.push(`meta`)),e.altKey&&a.push(`alt`),e.shiftKey&&a.push(`shift`),a.push(i),a.join(`+`)}export{P as a,C as c,m as d,j as f,M as i,L as l,g as m,N as n,D as o,h as p,O as r,A as s,f as t,v as u};
2
- //# sourceMappingURL=KeybindingsSettings.logic-CCa_n5Wn.js.map
1
+ import{Cg as e,Ec as t,gc as n,vc as r,wc as i}from"./utils-TSzPLNGf.js";import"./keybindings-Dw_FB1Sr.js";import{n as a,t as o}from"./usageShortcuts-CGv3_tEe.js";var s=new Map([`usage.open`,...[...o,...a].map(e=>e.command)].map((e,t)=>[e,t])),c=o[0].command;function l(e,t,n){let r=s.get(e),i=s.get(t);return r!==void 0&&i!==void 0?r-i:n(r===void 0?e:c).localeCompare(n(i===void 0?t:c))}var u=[`terminalFocus`,`terminalOpen`,`isWeb`,`isDesktop`,`true`,`false`],d=new Set(u);for(let e of n)k(e.whenAst,d);var f=[...d].find(e=>e!==`true`&&e!==`false`)??`terminalFocus`,p=new Set(d);function m(e){let t=[];return e.modKey&&t.push(`mod`),e.metaKey&&t.push(`meta`),e.ctrlKey&&t.push(`ctrl`),e.altKey&&t.push(`alt`),e.shiftKey&&t.push(`shift`),t.push(e.key===` `?`space`:e.key===`escape`?`esc`:e.key),t.join(`+`)}function h(e){if(!e)return``;switch(e.type){case`identifier`:return e.name;case`not`:return`!${_(e.node)}`;case`and`:return`${_(e.left)} && ${_(e.right)}`;case`or`:return`${_(e.left)} || ${_(e.right)}`}}function g(e,t){return t===0?`Clear all conditions`:e.type===`identifier`||e.type===`not`&&e.node.type===`identifier`?`Remove condition`:`Remove group and its conditions`}function _(e){return e.type===`identifier`||e.type===`not`?h(e):`(${h(e)})`}function v(e){let t=e.trim();if(t.length===0)return{ok:!0,value:void 0};let n=i(t);return n?{ok:!0,value:n}:{ok:!1,message:`Use variables with !, &&, ||, and parentheses.`}}function y(e){if(String(e.command).startsWith(`script.`))return`Project`;let t=m(e.shortcut),r=h(e.whenAst);return n.some(n=>n.command===e.command&&m(n.shortcut)===t&&h(n.whenAst)===r)?`Default`:`Custom`}function b(e){let t=m(e.shortcut),r=h(e.whenAst);return n.find(n=>n.command===e.command&&m(n.shortcut)===t&&h(n.whenAst)===r)??n.find(t=>t.command===e.command&&h(t.whenAst)===r)??n.find(t=>t.command===e.command)}function x(e,t,n){return`${e}\u0000${t}\u0000${n}`}function S(e,t){return e.length===0||t.length===0||e===t}function C(e,t){if(t.key.trim().length===0)return[];let n=[];for(let r of e)r.id!==t.rowId&&r.key===t.key&&S(r.when,t.when)&&n.push(P(r.command));return[...new Set(n)].toSorted()}var w=[{id:`navigation`,title:`Navigation`,prefixes:[`sidebar`,`rightPanel`,`commandPalette`,`filePicker`,`projectSearch`,`editor`]},{id:`threads`,title:`Threads`,prefixes:[`thread`,`chat`,`pullRequest`]},{id:`composer`,title:`Composer`,prefixes:[`composer`,`modelPicker`]},{id:`terminal`,title:`Terminal`,prefixes:[`terminal`]},{id:`preview`,title:`Preview & diff`,prefixes:[`preview`,`diff`]},{id:`appearance`,title:`Appearance`,prefixes:[`theme`,`appearance`,`themeEditor`]},{id:`scripts`,title:`Project scripts`,prefixes:[`script`]}],T={id:`other`,title:`Other`};function E(e){let t=String(e).split(`.`)[0]??``;return w.find(e=>e.prefixes.includes(t))??T}function D(e){let t=new Map;for(let n of e){let e=E(n.command),r=t.get(e.id);r?r.push(n):t.set(e.id,[n])}return[...w,T].flatMap(e=>{let n=t.get(e.id);return n?[{id:e.id,title:e.title,rows:n}]:[]})}function O(e,t){let n=t.trim().toLowerCase(),r=e.map((e,t)=>{let n=b(e),r=m(e.shortcut),i=h(e.whenAst);return{id:`${x(e.command,r,i)}\u0000${t}`,command:e.command,key:r,when:i,source:y(e),defaultKey:n?m(n.shortcut):null,defaultWhen:h(n?.whenAst),binding:e,conflicts:[]}}),i=r.map(e=>{let t=C(r,{rowId:e.id,key:e.key,when:e.when});return t.length>0?Object.assign({},e,{conflicts:[...new Set(t)].toSorted()}):e});return i.sort((e,t)=>{let n=l(e.command,t.command,e=>e);return n===0?e.key.localeCompare(t.key):n}),n.length===0?i:i.filter(e=>e.command.toLowerCase().includes(n)||P(e.command).toLowerCase().includes(n)||e.key.toLowerCase().includes(n)||e.when.toLowerCase().includes(n)||e.source.toLowerCase().includes(n))}function k(e,t){if(e)switch(e.type){case`identifier`:t.add(e.name);return;case`not`:k(e.node,t);return;case`and`:case`or`:k(e.left,t),k(e.right,t);return}}function A(e){return p.has(e)}function j(e){let t=new Set;return k(e,t),[...t].filter(e=>!A(e)).toSorted()}function M(){return[...p].toSorted((e,t)=>{let n=u.indexOf(e),r=u.indexOf(t);return n!==-1||r!==-1?(n===-1?2**53-1:n)-(r===-1?2**53-1:r):e.localeCompare(t)})}function N(t){let n=new Set(e);for(let e of t)n.add(e.command);return[...n].toSorted((e,t)=>l(e,t,P))}function P(e){if(e===`composer.sendAlternate`)return`Composer: Opposite Queue or Steer Action`;if(e===`composer.sendBackground`)return`Composer: Start in Background`;if(e===`composer.sendAndNewThread`)return`Composer: Send and Start New Thread`;if(e===`thread.steerQueuedMessage`)return`Queue: Send First Queued Message as Steer`;if(e===`thread.editQueuedMessage`)return`Queue: Edit Last Queued Message`;if(e===`thread.copyReference`)return`Pull Request: Copy Link or Thread ID`;let t=o.find(t=>t.command===e);if(t)return`Usage: ${t.label}`;let n=a.find(t=>t.command===e);if(n)return`Usage: Period: ${n.label}`;if(e===`view.reopenClosed`)return`Reopen Closed Tab`;if(e===`preview.focusUrl`)return`Preview: Focus URL`;let r=String(e);return r.startsWith(`script.`)&&r.endsWith(`.run`)?`Run Script: ${F(r.slice(7,-4))}`:r.split(`.`).map(F).join(`: `)}function F(e){let t=[];for(let n of e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/))n.length>0&&t.push(n.slice(0,1).toUpperCase()+n.slice(1));return t.join(` `)}function I(e){let t=e.toLowerCase();return t===`meta`||t===`control`||t===`ctrl`||t===`shift`||t===`alt`||t===`option`?null:t===` `?`space`:t===`escape`?`esc`:t===`arrowup`?`arrowup`:t===`arrowdown`?`arrowdown`:t===`arrowleft`?`arrowleft`:t===`arrowright`?`arrowright`:t.length===1||/^f\d{1,2}$/.test(t)||t===`enter`||t===`tab`||t===`backspace`||t===`delete`||t===`home`||t===`end`||t===`pageup`||t===`pagedown`?t:null}function L(e,n){let i=I(t(e));if(!i)return null;let a=[];return r(n)?(e.metaKey&&a.push(`mod`),e.ctrlKey&&a.push(`ctrl`)):(e.ctrlKey&&a.push(`mod`),e.metaKey&&a.push(`meta`)),e.altKey&&a.push(`alt`),e.shiftKey&&a.push(`shift`),a.push(i),a.join(`+`)}export{P as a,C as c,m as d,j as f,M as i,L as l,g as m,N as n,D as o,h as p,O as r,A as s,f as t,v as u};
2
+ //# sourceMappingURL=KeybindingsSettings.logic-Dx9jAbbW.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Rf as t,WT as n,mE as r,sr as i,vp as a}from"./utils-BBRDx4UJ.js";import{O as o}from"./useSettings-gJURpIkJ.js";import{t as s}from"./env-wK1YYxA8.js";import{o as c}from"./sidebar-BvjZQtR9.js";import{i as l,o as u,r as d,t as f}from"./empty-Dmvz5ya5.js";import{Cn as p,Jr as m}from"./main-DB45P6Gd.js";import{t as h}from"./WorkspacePageHeader-CF_fkCJo.js";var g=r(),_=e(n(),1);function v(){let e=(0,g.c)(16),n=y,r=o(),{scratchEnvironmentId:m,startScratchThread:v}=p(),b;e[0]!==r||e[1]!==m?(b=m(r),e[0]=r,e[1]=m,e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=s?(0,_.jsx)(h,{electron:!0}):null,e[3]=S):S=e[3];let C;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,_.jsx)(u,{children:`What should we work on?`}),e[4]=C):C=e[4];let w=x===null?`Add a project to start your first thread.`:`Add a project, or start without one.`,T;e[5]===w?T=e[6]:(T=(0,_.jsx)(d,{children:w}),e[5]=w,e[6]=T);let E;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,_.jsxs)(i,{size:`sm`,onClick:n,children:[(0,_.jsx)(a,{className:`size-4`}),`Add project`]}),e[7]=E):E=e[7];let D;e[8]!==x||e[9]!==v?(D=x===null?null:(0,_.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>void v(x),children:[(0,_.jsx)(t,{className:`size-4`}),`Start without a project`]}),e[8]=x,e[9]=v,e[10]=D):D=e[10];let O;e[11]===D?O=e[12]:(O=(0,_.jsxs)(`div`,{className:`mt-6 flex justify-center gap-2`,children:[E,D]}),e[11]=D,e[12]=O);let k;return e[13]!==T||e[14]!==O?(k=(0,_.jsx)(c,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,_.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background`,children:[S,(0,_.jsx)(f,{size:`hero`,className:`flex-1`,children:(0,_.jsx)(`div`,{className:`w-full max-w-lg px-8 py-12`,children:(0,_.jsxs)(l,{className:`max-w-none`,children:[C,T,O]})})})]})}),e[13]=T,e[14]=O,e[15]=k):k=e[15],k}function y(){return m({open:`add-project`})}export{v as t};
2
- //# sourceMappingURL=NoProjectsHero-sRJlYzCx.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Rf as t,WT as n,mE as r,sr as i,vp as a}from"./utils-TSzPLNGf.js";import{O as o}from"./useSettings-DsvnJBf2.js";import{t as s}from"./env-wK1YYxA8.js";import{o as c}from"./sidebar-ZKIDHqbk.js";import{i as l,o as u,r as d,t as f}from"./empty-BQwNj0_P.js";import{Cn as p,Jr as m}from"./main-pmaKofkn.js";import{t as h}from"./WorkspacePageHeader-xG2EcvME.js";var g=r(),_=e(n(),1);function v(){let e=(0,g.c)(16),n=y,r=o(),{scratchEnvironmentId:m,startScratchThread:v}=p(),b;e[0]!==r||e[1]!==m?(b=m(r),e[0]=r,e[1]=m,e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=s?(0,_.jsx)(h,{electron:!0}):null,e[3]=S):S=e[3];let C;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,_.jsx)(u,{children:`What should we work on?`}),e[4]=C):C=e[4];let w=x===null?`Add a project to start your first thread.`:`Add a project, or start without one.`,T;e[5]===w?T=e[6]:(T=(0,_.jsx)(d,{children:w}),e[5]=w,e[6]=T);let E;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,_.jsxs)(i,{size:`sm`,onClick:n,children:[(0,_.jsx)(a,{className:`size-4`}),`Add project`]}),e[7]=E):E=e[7];let D;e[8]!==x||e[9]!==v?(D=x===null?null:(0,_.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>void v(x),children:[(0,_.jsx)(t,{className:`size-4`}),`Start without a project`]}),e[8]=x,e[9]=v,e[10]=D):D=e[10];let O;e[11]===D?O=e[12]:(O=(0,_.jsxs)(`div`,{className:`mt-6 flex justify-center gap-2`,children:[E,D]}),e[11]=D,e[12]=O);let k;return e[13]!==T||e[14]!==O?(k=(0,_.jsx)(c,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,_.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background`,children:[S,(0,_.jsx)(f,{size:`hero`,className:`flex-1`,children:(0,_.jsx)(`div`,{className:`w-full max-w-lg px-8 py-12`,children:(0,_.jsxs)(l,{className:`max-w-none`,children:[C,T,O]})})})]})}),e[13]=T,e[14]=O,e[15]=k):k=e[15],k}function y(){return m({open:`add-project`})}export{v as t};
2
+ //# sourceMappingURL=NoProjectsHero-Lxz19PUh.js.map
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-DLqbGyR7.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-BBRDx4UJ.js","assets/activity-C1Y3O_v1.js","assets/createLucideIcon-CacG5mZC.js","assets/alarm-clock-Pw90g7hE.js","assets/app-window-D2LBv8RE.js","assets/archive-0Qz6rgBl.js","assets/arrow-down-up-B46gw0xW.js","assets/arrow-down-DvRecXuy.js","assets/arrow-left-BLE461db.js","assets/arrow-right-left-BqjFeAD_.js","assets/arrow-right-CoV5ameY.js","assets/arrow-up-down-ibtVnemT.js","assets/arrow-up-left-BMvgV_8i.js","assets/arrow-up-right-C6IM-WPd.js","assets/arrow-up-3Yp3lsoe.js","assets/battery-Bjbw2yxu.js","assets/bell-CLuvLMth.js","assets/blocks-B-VfW07Q.js","assets/book-open-HEEW8eqT.js","assets/bookmark-HM-xwl47.js","assets/bot-DpQzHyXo.js","assets/box-CKWcQvdq.js","assets/bug-Dtc5BRVF.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-clock-DTUOomkO.js","assets/calendar-c_JH_1V1.js","assets/camera-V1Ufc9sC.js","assets/chart-no-axes-column-DKbSsm0y.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-left-DrNh6cTh.js","assets/chevron-right-NbahR9_s.js","assets/chevron-up-C-w52bD6.js","assets/chevrons-left-right-ellipsis-D2Qu5H2y.js","assets/chevrons-up-down-BMPucOK_.js","assets/chromium-BusoCgri.js","assets/circle-alert-B83jEPoh.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/circle-check-Y1T60J9X.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-slash-Ceo-2WKq.js","assets/circle-x-C-GXnJRB.js","assets/circle-4zZlZno3.js","assets/clock-3-SBiWJYHb.js","assets/clock-bc9N_wA2.js","assets/cloud-download-BE7c7r3I.js","assets/cloud-upload-noux3Cbp.js","assets/cloud-DyVMWy7X.js","assets/code-xml-CbuCFrkh.js","assets/code-DuFehkNQ.js","assets/columns-2-D1kdFD9w.js","assets/copy-CoM62e83.js","assets/corner-left-up-BCqW4dF8.js","assets/corner-up-right--t3OPVhh.js","assets/cpu-mffhvvYB.js","assets/database-DipbOz0U.js","assets/download-BAp4p4A-.js","assets/earth-CTY23Bx1.js","assets/ellipsis-vertical-fYTS1grT.js","assets/ellipsis-6x3R4_IB.js","assets/external-link-NWS0I_zo.js","assets/eye-off-BJFC-Vn7.js","assets/eye-Dh5UEUs_.js","assets/file-braces-CcggTVd0.js","assets/file-code-corner-Dt6PpZnb.js","assets/file-diff-BE4sroJp.js","assets/file-search-DotMSEoS.js","assets/file-spreadsheet-Boc78Vjm.js","assets/file-text-xj3y_Xbg.js","assets/file-1cutE11R.js","assets/files-CQwG7JjF.js","assets/film-CYJIuMHb.js","assets/flask-conical-WkWFg73e.js","assets/folder-closed-zBKiY8_q.js","assets/folder-cog-BMK_9DOi.js","assets/folder-git-2-BxqGR5ht.js","assets/folder-git-CoMYGJp_.js","assets/folder-open-BqgCWh1y.js","assets/folder-plus-BHa3aD6W.js","assets/folder-tree-CIpeR87A.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/git-branch-plus-BQ_ISFgF.js","assets/git-branch-CAP5iwh8.js","assets/git-commit-horizontal-6IR7R88i.js","assets/git-fork-BEEZa2l_.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/globe-BygqUCSx.js","assets/grip-vertical-B8ERFH5y.js","assets/hammer-BRTj-Vot.js","assets/hard-drive-CVWUL95f.js","assets/history-B22_6xEN.js","assets/house-D_gjXlRt.js","assets/image-xUrgiZ2i.js","assets/inbox-48iST-IJ.js","assets/info-BHB-83EA.js","assets/keyboard-9HUE6Zs7.js","assets/laptop-05PEAB3d.js","assets/layers-BqgDAlx3.js","assets/lightbulb-CEqRo_1f.js","assets/link-2-B_p2EG7Q.js","assets/link-zAXVcUwk.js","assets/list-checks-CQu2FTgJ.js","assets/list-filter-BOx8tW9q.js","assets/list-ordered-f2n8ZhGo.js","assets/list-todo-D7F9k-PE.js","assets/list-BAEaXVbr.js","assets/loader-circle-B3Ce8JIQ.js","assets/lock-open-Bt3QlIE2.js","assets/lock-Cc3mNdEd.js","assets/log-in-BpPtfyCd.js","assets/mail-J8kfrAC7.js","assets/maximize-2-CHT2IkVy.js","assets/maximize-CoWtPryT.js","assets/memory-stick-C7kBEkBW.js","assets/message-circle-question-mark-Blboafqi.js","assets/message-circle-CwQpPAbq.js","assets/message-square-dashed-DrEYZ6F3.js","assets/message-square-off-BstjdZP9.js","assets/message-square-text-CJTpB0rs.js","assets/message-square-warning-I95tWaoN.js","assets/message-square-DLzUyuIE.js","assets/messages-square-BNeF2306.js","assets/minimize-2-DOhpJbnX.js","assets/minus-C7W28oE7.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/mouse-pointer-2-DbBU41il.js","assets/mouse-pointer-click-DsDE4K7M.js","assets/octagon-alert-BKVCgU--.js","assets/package-plus-Cl7EzKuY.js","assets/package-CeeyHFJU.js","assets/paintbrush-D1BKpWrm.js","assets/palette-Xj4s0pmv.js","assets/panel-bottom-BzpRd9wr.js","assets/panel-left-DzXd97so.js","assets/panel-right-C3EFo10c.js","assets/paperclip-BCpF_jt0.js","assets/panels-top-left-C5lf6BGD.js","assets/pen-line-BeMREvYs.js","assets/pencil-ruler-CU_Sl28D.js","assets/pencil-CnxrJI7X.js","assets/picture-in-picture-2-g5nsWFVw.js","assets/pilcrow-DMiXqMTk.js","assets/pin-DfMqpQHz.js","assets/play-Bvcnzkvl.js","assets/plug-2-DkrvJqyh.js","assets/plus-Cr075-cy.js","assets/plug-Cdxb0djR.js","assets/power-BZu57mPF.js","assets/presentation-DvMc9hxG.js","assets/puzzle-Bv9mngwk.js","assets/qr-code-D3ZNC-wH.js","assets/quote-zNyOHYG3.js","assets/radio-tower-CT5Np78y.js","assets/redo-2-DRHZshO-.js","assets/refresh-cw-PY_ECjtI.js","assets/rotate-ccw-Dr4MwDMq.js","assets/rotate-cw-10CQA0Ej.js","assets/route-CQ6wZzks.js","assets/rows-3-Bhc8vjss.js","assets/scale-V7dmr96y.js","assets/search-Cr9eaeTj.js","assets/send-CMOvB09P.js","assets/server-Le_hLOlf.js","assets/settings-2-XzWAl_8P.js","assets/settings-CTjEqsg3.js","assets/shield-check-k2SY7zjx.js","assets/shield-question-mark-pgYZYoSI.js","assets/shield-veV1FXDO.js","assets/sliders-horizontal-lg5XUMZM.js","assets/smartphone-zkhAIn1Q.js","assets/smile-plus-20kjE9KX.js","assets/sparkles-cStmYKbH.js","assets/square-arrow-out-up-right-DRKYZdVU.js","assets/square-pen-DIW48FdK.js","assets/square-plus-CeFmBUPF.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/star-DJ6Ycqv6.js","assets/sun-C8irSiA-.js","assets/tag-DhRIoqTo.js","assets/target-DziMQLku.js","assets/terminal-6kKaKv-Q.js","assets/text-align-start-C-EHiBr4.js","assets/text-search-BsqmpFYh.js","assets/text-wrap-C8SwAUbc.js","assets/ticket-LnwYlhC1.js","assets/trash-2-CiyAV2xI.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/triangle-alert-BiHUyRl3.js","assets/type-ChjbxAhu.js","assets/undo-2-ZlIXiNdF.js","assets/unlink-2-DKAoaBiV.js","assets/unplug-Dg15iaHA.js","assets/upload-D9-Kv89Z.js","assets/user-check-BtCtF_-l.js","assets/user-lock-BWt0Um72.js","assets/user-plus-DbG1t95t.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/users-LmqvhHnq.js","assets/wifi-off-DtJhRDhE.js","assets/workflow-Za5zYpKH.js","assets/wrench-CSZxFJCP.js","assets/x-CSwbgjBe.js","assets/zap-CrtYfJ8v.js","assets/runtime-VHJoq9so.js","assets/runtime-ivCTGH5C.js","assets/tooltip-DcTdC2PH.js","assets/env-wK1YYxA8.js","assets/toast-CyScduZI.js","assets/spinner-CTNKP1wB.js","assets/useParams-U7vgc6nk.js","assets/DiffFileTree-LZwmN24l.js","assets/useSettings-gJURpIkJ.js","assets/server-C-qtaHHG.js","assets/session-KZUTmmZy.js","assets/use-atom-command-CYY238HA.js","assets/themePalette-DtFR3xYu.js","assets/diffRendering-EBC4wPDV.js","assets/index-BGHZIIwm.js","assets/fileTreeExpansion-BbO9lBJr.js","assets/pierre-icons-BweC0Ojp.js","assets/query-BWYUB_iK.js","assets/DiffCommentAnnotation-UyWIyKIO.js","assets/Virtualizer-YMJF6Rgn.js","assets/getDiffFileInput-BhtRP4yl.js","assets/main-DB45P6Gd.js","assets/vcsRefInvalidation-DwljOjdx.js","assets/entities-DPdxOTpx.js","assets/number-field-CHOp4dMK.js","assets/useRegisterFieldControl-B-o6bvd-.js","assets/FormContext-N50VWQHc.js","assets/CSPContext-BLmE8rVK.js","assets/select-FY7psXk-.js","assets/link-DaswZEsz.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-Doka-Cpt.js","assets/useNavigate-B3U2CN2A.js","assets/useLocation-Cfwex-wi.js","assets/rightPanelStore-Dfw-4Ia_.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-DUuhuhAL.js","assets/session-logic-Dy9r5m2F.js","assets/htmlRender-94mfYlmv.js","assets/mediaSource-DAJ35Twr.js","assets/fileLinks-Cfgs6wOJ.js","assets/mediaReference-T3SNj1En.js","assets/usageFormat-C1GJS5IW.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-p05dxp84.js","assets/useAriaLabelledBy-_J6EHbv7.js","assets/checkbox-B0Q9zWdp.js","assets/FieldItemContext-Bn6xBVJg.js","assets/toggle-BBpi92mE.js","assets/toggle-group--QyJ7uYY.js","assets/CompositeRoot-Bu_9wjlN.js","assets/command-DGoFksB6.js","assets/ComboboxClear-fNH6Tj-4.js","assets/input-OK9fSGsW.js","assets/FieldControl-Dcug7PQN.js","assets/scroll-area-BtAqRLpC.js","assets/DialogTitle-B7ZsIcBO.js","assets/dialog-COvCzBu5.js","assets/dist-Cg-eOU-v.js","assets/sidebar-BvjZQtR9.js","assets/useResizeDrag-KJl_F2EN.js","assets/observeResize-B7tl_Rye.js","assets/AnimatedHeight-CeIqOXkD.js","assets/assets-arnK8cZJ.js","assets/sourceControl-CtDr1raw.js","assets/openFileInPreview-D80asiJZ.js","assets/browserHistoryStore-D3NmgwWz.js","assets/preview-CP02VJQW.js","assets/keybindings-BWCWrY_-.js","assets/Icons-CBnVp61L.js","assets/preview-DLjmZv-h.js","assets/PierreEntryIcon-Bid6ECoT.js","assets/RenderErrorBoundary-DfL11xnF.js","assets/threadSort-BgwLDPpx.js","assets/browserLinkTarget-CTDv30-a.js","assets/pullRequestIcons-Cwz6tomi.js","assets/pullRequests-DmlU8TRv.js","assets/popover-DzOky6C0.js","assets/ProjectFavicon-oQ8xOLai.js","assets/ProjectMonogram-wj_aiPmM.js","assets/projectFilesQueryState-BKJPj8kq.js","assets/terminalSessions-BEOZlx0H.js","assets/guideRunStore-OyuNEz1_.js","assets/pullRequestDetail.logic-CQ1l2jWB.js","assets/pullRequestReviewStore-DejvzSy2.js","assets/sortable.esm-BVaB8fBB.js","assets/p4ProjectFile-BfBM2HoW.js","assets/sidebarProjectGrouping-CvY13nmg.js","assets/useHandleNewThread-BhaVM65m.js","assets/EnvironmentMachineIcon-Bn0qgNMW.js","assets/alert-BOSKZyDW.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-gEF4N7W7.js","assets/kbd-LyGbiGLS.js","assets/settingsLayout-CthFz77S.js","assets/WorkspacePageContainer-D_NDP2pC.js","assets/KeybindingsSettings.logic-CCa_n5Wn.js","assets/usageShortcuts-BmYIhNjb.js","assets/primaryCloudLinkState-Bup2zk6b.js","assets/ConnectionStatusDot-0G2DkC_D.js","assets/standalone-page-BmCMlz1u.js","assets/primary-z0kWcTid.js","assets/onboarding-CFB4Wz5g.js","assets/scheduledTasksSettings.logic-b-y7WIWN.js","assets/main-BEavB8iB.css","assets/DiffWorkerPoolProvider-BCslhrpA.js","assets/textarea-_oDVfjxe.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-BGHZIIwm.js";import{r as n}from"./Icon-l19w4AjM.js";import{$g as r,$n as i,$p as a,$u as o,A as s,Ad as c,Au as l,Bd as u,Bs as d,Cd as f,D as p,Dm as m,Dp as h,Em as g,Ep as _,F as v,Fd as y,Gd as b,Gn as x,Hp as S,Jf as C,Jn as w,Kn as T,Lf as E,Lo as D,Ls as O,Lu as k,Mh as A,Nd as j,Np as M,Pd as N,Qd as P,Qn as F,Rs as I,Sf as L,Up as R,Vo as z,Vp as B,Vu as ee,WT as V,Wn as H,Yn as U,Zn as te,_s as ne,ar as re,by as ie,cp as ae,cr as oe,dd as se,ed as ce,ef as le,hp as ue,hs as W,ip as de,ir as fe,jd as pe,ju as me,kd as he,ku as ge,mE as _e,nd as ve,nm as ye,nr as be,o_ as xe,ol as Se,op as Ce,or as we,qn as Te,qp as Ee,rd as De,rr as Oe,ry as ke,sf as Ae,sm as je,sr as G,sy as Me,t as K,td as Ne,tr as Pe,ua as Fe,uf as Ie,um as Le,up as Re,vm as ze,vp as Be,vs as Ve,wf as He,xm as Ue,zf as We}from"./utils-BBRDx4UJ.js";import{U as Ge}from"./runtime-VHJoq9so.js";import{C as Ke,O as qe,k as Je,w as Ye}from"./entities-DPdxOTpx.js";import{$t as Xe,cn as Ze,dn as Qe,in as $e,ln as et,sn as tt}from"./runtime-ivCTGH5C.js";import{M as nt,N as rt,U as it,W as at,a as q,c as ot,g as st,n as J,r as ct,t as Y,v as lt}from"./tooltip-DcTdC2PH.js";import{$ as ut,B as dt,n as ft,z as pt}from"./ChatMarkdown-DQ3uXQzt.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-FY7psXk-.js";import{t as vt}from"./spinner-CTNKP1wB.js";import{i as yt,m as bt,p as xt}from"./toast-CyScduZI.js";import{E as St,J as Ct,K as wt,f as Tt}from"./useSettings-gJURpIkJ.js";import{s as Et}from"./server-C-qtaHHG.js";import{i as Dt,n as Ot}from"./session-KZUTmmZy.js";import{n as kt}from"./query-BWYUB_iK.js";import{t as At}from"./use-atom-command-CYY238HA.js";import{l as jt,t as Mt}from"./rightPanelStore-Dfw-4Ia_.js";import{u as Nt}from"./queries-DUuhuhAL.js";import{C as X,Q as Pt,Z as Ft,_ as It,at as Lt,c as Rt,d as zt,ft as Bt,l as Vt,lt as Ht,nt as Ut,ot as Wt,s as Gt,t as Kt,tt as qt,u as Jt,v as Yt,w as Xt}from"./diffRendering-EBC4wPDV.js";import{C as Zt,E as Qt,G as $t,H as en,K as tn,U as nn,V as rn,W as an,d as on,i as sn,u as cn}from"./Virtualizer-YMJF6Rgn.js";import{l as ln,ut as un}from"./getDiffFileInput-BhtRP4yl.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-BCslhrpA.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-CztExdxl.js";import{S as vn,a as yn,b as bn,i as xn,n as Sn,r as Cn,t as wn}from"./DiffCommentAnnotation-UyWIyKIO.js";import{r as Tn}from"./mediaSource-DAJ35Twr.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{t as On}from"./skeleton-p05dxp84.js";import{t as kn}from"./textarea-_oDVfjxe.js";import{t as An}from"./toggle-BBpi92mE.js";import{n as jn,t as Mn}from"./toggle-group--QyJ7uYY.js";import{i as Nn,l as Pn,o as Fn,r as In,s as Ln,t as Rn}from"./combobox-CZ_uig0z.js";import{d as zn,l as Bn,t as Vn,u as Hn}from"./command-DGoFksB6.js";import{t as Un}from"./input-OK9fSGsW.js";import{t as Wn}from"./scroll-area-BtAqRLpC.js";import{a as Gn,c as Kn,i as qn,o as Jn,r as Yn,s as Xn,t as Zn}from"./dialog-COvCzBu5.js";import{t as Qn}from"./useResizeDrag-KJl_F2EN.js";import{a as $n,i as er,o as tr,r as nr,t as rr}from"./empty-Dmvz5ya5.js";import{i as ir}from"./device-Dy_6ukvt.js";import{t as ar}from"./observeResize-B7tl_Rye.js";import{o as or,s as sr}from"./openFileInPreview-D80asiJZ.js";import{f as cr}from"./browserHistoryStore-D3NmgwWz.js";import{_ as lr,y as ur}from"./keybindings-BWCWrY_-.js";import{i as dr,n as fr}from"./Icons-CBnVp61L.js";import{t as pr}from"./PierreEntryIcon-Bid6ECoT.js";import{F as mr,H as hr,U as gr,_ as _r,a as vr,b as yr,c as br,d as xr,f as Sr,g as Cr,h as wr,i as Tr,m as Er,n as Dr,o as Or,p as kr,r as Ar,s as jr,u as Mr,v as Nr,x as Pr,y as Fr}from"./RenderErrorBoundary-DfL11xnF.js";import{c as Ir,l as Lr}from"./threadSort-BgwLDPpx.js";import{n as Rr}from"./pullRequestIcons-Cwz6tomi.js";import{D as zr,a as Br,c as Vr,i as Hr,k as Ur,n as Wr,r as Gr,u as Kr}from"./pullRequests-DmlU8TRv.js";import{a as qr,i as Jr,n as Yr,o as Xr,t as Zr}from"./popover-DzOky6C0.js";import{A as Qr,B as $r,C as ei,D as ti,E as ni,H as ri,I as ii,K as ai,L as oi,M as si,N as ci,O as li,P as ui,R as di,S as fi,T as pi,U as mi,V as hi,X as gi,Y as _i,_ as vi,a as yi,b as bi,c as xi,d as Si,f as Ci,g as wi,i as Ti,j as Ei,k as Di,l as Oi,o as ki,p as Ai,q as ji,r as Mi,s as Ni,t as Pi,v as Fi,w as Ii,y as Li,z as Ri}from"./pullRequestDetail.logic-CQ1l2jWB.js";import{i as zi,n as Bi,r as Vi,t as Hi}from"./pullRequestReviewStore-DejvzSy2.js";import{t as Ui}from"./terminalLabels-BgLOlb2G.js";import{i as Wi,m as Gi,n as Ki,r as qi,t as Ji}from"./guideRunStore-OyuNEz1_.js";import{a as Yi,b as Xi,h as Zi,l as Qi,m as $i,p as ea,r as ta,s as na,t as ra,u as ia}from"./sortable.esm-BVaB8fBB.js";import{n as aa}from"./useHandleNewThread-BhaVM65m.js";import{n as oa}from"./EnvironmentMachineIcon-Bn0qgNMW.js";import{i as sa,n as ca,r as la,t as ua}from"./alert-BOSKZyDW.js";import{t as da}from"./kbd-LyGbiGLS.js";import{Fa as fa,Ia as pa,Jr as ma,Pa as ha,Ra as ga,ai as _a,cn as va,fa as ya,oi as ba,qa as xa,qr as Sa,ua as Ca}from"./main-DB45P6Gd.js";import"./WorkspacePageHeader-CF_fkCJo.js";import{r as wa,s as Ta,t as Ea}from"./usePullRequestActions-DpAVW9io.js";function Da(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Oa(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:ka(e.items,t.items)}function ka(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function Aa(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Pt,``),t.before(r)):(r.setAttribute(Ft,``),t.after(r)),n?.observe(r),r}function ja(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Ma=1e5,Na=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Pa=`data-diffs-search`,Fa=`:host {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-TTmg3elC.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-TSzPLNGf.js","assets/activity-C1Y3O_v1.js","assets/createLucideIcon-CacG5mZC.js","assets/alarm-clock-Pw90g7hE.js","assets/app-window-D2LBv8RE.js","assets/archive-0Qz6rgBl.js","assets/arrow-down-up-B46gw0xW.js","assets/arrow-down-DvRecXuy.js","assets/arrow-left-BLE461db.js","assets/arrow-right-left-BqjFeAD_.js","assets/arrow-right-CoV5ameY.js","assets/arrow-up-down-ibtVnemT.js","assets/arrow-up-left-BMvgV_8i.js","assets/arrow-up-right-C6IM-WPd.js","assets/arrow-up-3Yp3lsoe.js","assets/battery-Bjbw2yxu.js","assets/bell-CLuvLMth.js","assets/blocks-B-VfW07Q.js","assets/book-open-HEEW8eqT.js","assets/bookmark-HM-xwl47.js","assets/bot-DpQzHyXo.js","assets/box-CKWcQvdq.js","assets/bug-Dtc5BRVF.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-clock-DTUOomkO.js","assets/calendar-c_JH_1V1.js","assets/camera-V1Ufc9sC.js","assets/chart-no-axes-column-DKbSsm0y.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-left-DrNh6cTh.js","assets/chevron-right-NbahR9_s.js","assets/chevron-up-C-w52bD6.js","assets/chevrons-left-right-ellipsis-D2Qu5H2y.js","assets/chevrons-up-down-BMPucOK_.js","assets/chromium-BusoCgri.js","assets/circle-alert-B83jEPoh.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/circle-check-Y1T60J9X.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-slash-Ceo-2WKq.js","assets/circle-x-C-GXnJRB.js","assets/circle-4zZlZno3.js","assets/clock-3-SBiWJYHb.js","assets/clock-bc9N_wA2.js","assets/cloud-download-BE7c7r3I.js","assets/cloud-upload-noux3Cbp.js","assets/cloud-DyVMWy7X.js","assets/code-xml-CbuCFrkh.js","assets/code-DuFehkNQ.js","assets/columns-2-D1kdFD9w.js","assets/copy-CoM62e83.js","assets/corner-left-up-BCqW4dF8.js","assets/corner-up-right--t3OPVhh.js","assets/cpu-mffhvvYB.js","assets/database-DipbOz0U.js","assets/download-BAp4p4A-.js","assets/earth-CTY23Bx1.js","assets/ellipsis-vertical-fYTS1grT.js","assets/ellipsis-6x3R4_IB.js","assets/external-link-NWS0I_zo.js","assets/eye-off-BJFC-Vn7.js","assets/eye-Dh5UEUs_.js","assets/file-braces-CcggTVd0.js","assets/file-code-corner-Dt6PpZnb.js","assets/file-diff-BE4sroJp.js","assets/file-search-DotMSEoS.js","assets/file-spreadsheet-Boc78Vjm.js","assets/file-text-xj3y_Xbg.js","assets/file-1cutE11R.js","assets/files-CQwG7JjF.js","assets/film-CYJIuMHb.js","assets/flask-conical-WkWFg73e.js","assets/folder-closed-zBKiY8_q.js","assets/folder-cog-BMK_9DOi.js","assets/folder-git-2-BxqGR5ht.js","assets/folder-git-CoMYGJp_.js","assets/folder-open-BqgCWh1y.js","assets/folder-plus-BHa3aD6W.js","assets/folder-tree-CIpeR87A.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/git-branch-plus-BQ_ISFgF.js","assets/git-branch-CAP5iwh8.js","assets/git-commit-horizontal-6IR7R88i.js","assets/git-fork-BEEZa2l_.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/globe-BygqUCSx.js","assets/grip-vertical-B8ERFH5y.js","assets/hammer-BRTj-Vot.js","assets/hard-drive-CVWUL95f.js","assets/history-B22_6xEN.js","assets/house-D_gjXlRt.js","assets/image-xUrgiZ2i.js","assets/inbox-48iST-IJ.js","assets/info-BHB-83EA.js","assets/keyboard-9HUE6Zs7.js","assets/laptop-05PEAB3d.js","assets/layers-BqgDAlx3.js","assets/lightbulb-CEqRo_1f.js","assets/link-2-B_p2EG7Q.js","assets/link-zAXVcUwk.js","assets/list-checks-CQu2FTgJ.js","assets/list-filter-BOx8tW9q.js","assets/list-ordered-f2n8ZhGo.js","assets/list-todo-D7F9k-PE.js","assets/list-BAEaXVbr.js","assets/loader-circle-B3Ce8JIQ.js","assets/lock-open-Bt3QlIE2.js","assets/lock-Cc3mNdEd.js","assets/log-in-BpPtfyCd.js","assets/mail-J8kfrAC7.js","assets/maximize-2-CHT2IkVy.js","assets/maximize-CoWtPryT.js","assets/memory-stick-C7kBEkBW.js","assets/message-circle-question-mark-Blboafqi.js","assets/message-circle-CwQpPAbq.js","assets/message-square-dashed-DrEYZ6F3.js","assets/message-square-off-BstjdZP9.js","assets/message-square-text-CJTpB0rs.js","assets/message-square-warning-I95tWaoN.js","assets/message-square-DLzUyuIE.js","assets/messages-square-BNeF2306.js","assets/minimize-2-DOhpJbnX.js","assets/minus-C7W28oE7.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/mouse-pointer-2-DbBU41il.js","assets/mouse-pointer-click-DsDE4K7M.js","assets/octagon-alert-BKVCgU--.js","assets/package-plus-Cl7EzKuY.js","assets/package-CeeyHFJU.js","assets/paintbrush-D1BKpWrm.js","assets/palette-Xj4s0pmv.js","assets/panel-bottom-BzpRd9wr.js","assets/panel-left-DzXd97so.js","assets/panel-right-C3EFo10c.js","assets/paperclip-BCpF_jt0.js","assets/panels-top-left-C5lf6BGD.js","assets/pen-line-BeMREvYs.js","assets/pencil-ruler-CU_Sl28D.js","assets/pencil-CnxrJI7X.js","assets/picture-in-picture-2-g5nsWFVw.js","assets/pilcrow-DMiXqMTk.js","assets/pin-DfMqpQHz.js","assets/play-Bvcnzkvl.js","assets/plug-2-DkrvJqyh.js","assets/plus-Cr075-cy.js","assets/plug-Cdxb0djR.js","assets/power-BZu57mPF.js","assets/presentation-DvMc9hxG.js","assets/puzzle-Bv9mngwk.js","assets/qr-code-D3ZNC-wH.js","assets/quote-zNyOHYG3.js","assets/radio-tower-CT5Np78y.js","assets/redo-2-DRHZshO-.js","assets/refresh-cw-PY_ECjtI.js","assets/rotate-ccw-Dr4MwDMq.js","assets/rotate-cw-10CQA0Ej.js","assets/route-CQ6wZzks.js","assets/rows-3-Bhc8vjss.js","assets/scale-V7dmr96y.js","assets/search-Cr9eaeTj.js","assets/send-CMOvB09P.js","assets/server-Le_hLOlf.js","assets/settings-2-XzWAl_8P.js","assets/settings-CTjEqsg3.js","assets/shield-check-k2SY7zjx.js","assets/shield-question-mark-pgYZYoSI.js","assets/shield-veV1FXDO.js","assets/sliders-horizontal-lg5XUMZM.js","assets/smartphone-zkhAIn1Q.js","assets/smile-plus-20kjE9KX.js","assets/sparkles-cStmYKbH.js","assets/square-arrow-out-up-right-DRKYZdVU.js","assets/square-pen-DIW48FdK.js","assets/square-plus-CeFmBUPF.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/star-DJ6Ycqv6.js","assets/sun-C8irSiA-.js","assets/tag-DhRIoqTo.js","assets/target-DziMQLku.js","assets/terminal-6kKaKv-Q.js","assets/text-align-start-C-EHiBr4.js","assets/text-search-BsqmpFYh.js","assets/text-wrap-C8SwAUbc.js","assets/ticket-LnwYlhC1.js","assets/trash-2-CiyAV2xI.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/triangle-alert-BiHUyRl3.js","assets/type-ChjbxAhu.js","assets/undo-2-ZlIXiNdF.js","assets/unlink-2-DKAoaBiV.js","assets/unplug-Dg15iaHA.js","assets/upload-D9-Kv89Z.js","assets/user-check-BtCtF_-l.js","assets/user-lock-BWt0Um72.js","assets/user-plus-DbG1t95t.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/users-LmqvhHnq.js","assets/wifi-off-DtJhRDhE.js","assets/workflow-Za5zYpKH.js","assets/wrench-CSZxFJCP.js","assets/x-CSwbgjBe.js","assets/zap-CrtYfJ8v.js","assets/runtime-qAs3Aj0U.js","assets/runtime-ZOY8Qeg_.js","assets/tooltip-DdUPPKq4.js","assets/env-wK1YYxA8.js","assets/toast-3I2gpMYd.js","assets/spinner-CH-Dn9Fj.js","assets/useParams-3tEZUuVD.js","assets/DiffFileTree-DW_wXLvM.js","assets/useSettings-DsvnJBf2.js","assets/server-BxsIDqAi.js","assets/session-Lp4r-IPM.js","assets/use-atom-command-CVDCnNHi.js","assets/themePalette-Bl55tW1x.js","assets/diffRendering-CnRmUrdi.js","assets/index-CG78-Gl5.js","assets/fileTreeExpansion-D1dm7wQj.js","assets/pierre-icons-CnfzBsKG.js","assets/query-w0R7LhwJ.js","assets/DiffCommentAnnotation-DpZ1jfFT.js","assets/Virtualizer-BzpMB2EV.js","assets/getDiffFileInput-C3kf5492.js","assets/main-pmaKofkn.js","assets/vcsRefInvalidation-iz2QneVc.js","assets/entities-CW57Cs5E.js","assets/number-field-CrV4BtLe.js","assets/useRegisterFieldControl-Cs54XrA4.js","assets/FormContext-TllbMdtd.js","assets/CSPContext-D9jns38x.js","assets/select-BX0YSg0P.js","assets/link-CBNV8k75.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-knQbCz5Y.js","assets/useNavigate-Cdy4Jh5i.js","assets/useLocation-BdZaQ50l.js","assets/rightPanelStore-CRw1DWSH.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-DfOxYbXr.js","assets/session-logic-BFdJF3Bv.js","assets/htmlRender-Dwrbtk9Z.js","assets/mediaSource-1xb6xNr7.js","assets/fileLinks-CJJSqeqK.js","assets/mediaReference-BLVT2VlI.js","assets/usageFormat-CWi_Qt3l.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton--v3ra8uu.js","assets/useAriaLabelledBy-BnxRm9-q.js","assets/checkbox-DSb65NrE.js","assets/FieldItemContext-Bn6xBVJg.js","assets/toggle-Ce46mx2g.js","assets/toggle-group-Dt1Yldxx.js","assets/CompositeRoot-CZqNlh6y.js","assets/command-DywgXMPU.js","assets/ComboboxClear-B-WUNsj0.js","assets/input-CNGP9r-b.js","assets/FieldControl-DSYkAElP.js","assets/scroll-area-DyzCabMe.js","assets/DialogTitle-Bti0gMwZ.js","assets/dialog-B5b8j4VI.js","assets/dist-B181ZKao.js","assets/sidebar-ZKIDHqbk.js","assets/useResizeDrag-KJl_F2EN.js","assets/observeResize-jQzrVN_N.js","assets/AnimatedHeight-DZPLUjm9.js","assets/assets-CH9UWZJ9.js","assets/sourceControl-ByZv2xxh.js","assets/openFileInPreview-Dx_dxN9N.js","assets/browserHistoryStore-CUwwaVj8.js","assets/preview-BXxrRVX-.js","assets/keybindings-Dw_FB1Sr.js","assets/Icons-CyDEOiJ2.js","assets/preview-BJJOaGR2.js","assets/PierreEntryIcon-zwmwEij7.js","assets/RenderErrorBoundary-ChsSTLIX.js","assets/threadSort-DDAHH_-8.js","assets/browserLinkTarget-o1Hmp1Jv.js","assets/pullRequestIcons-SCwBWGeD.js","assets/pullRequests-DQFba6Nz.js","assets/popover-CCsUmLYF.js","assets/ProjectFavicon-Cs-IpJFL.js","assets/ProjectMonogram-De9Vi6mM.js","assets/projectFilesQueryState-CgqhXdfj.js","assets/terminalSessions-CUABDfio.js","assets/guideRunStore-C7ZnghV_.js","assets/pullRequestDetail.logic-CYwAUOQC.js","assets/pullRequestReviewStore-C7gfd5m3.js","assets/sortable.esm-UojJGtqY.js","assets/p4ProjectFile-BfRZT-Cd.js","assets/sidebarProjectGrouping-BFqO8E5C.js","assets/useHandleNewThread-BrxevYhf.js","assets/EnvironmentMachineIcon-BzeEbEQS.js","assets/alert-BFkMrLRZ.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-jceJZ5U0.js","assets/kbd-C3OLELe_.js","assets/settingsLayout-DhPKINaL.js","assets/WorkspacePageContainer-D4M31vG4.js","assets/KeybindingsSettings.logic-Dx9jAbbW.js","assets/usageShortcuts-CGv3_tEe.js","assets/primaryCloudLinkState-BfCEo8Kn.js","assets/ConnectionStatusDot-BNGv8ojc.js","assets/standalone-page-BwpW1F1h.js","assets/primary-DBlVHyxT.js","assets/onboarding-DnxQtcwh.js","assets/scheduledTasksSettings.logic-BBBjz09I.js","assets/main-BEavB8iB.css","assets/DiffWorkerPoolProvider-BGHe4Gu5.js","assets/textarea-B3ib3YW-.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CG78-Gl5.js";import{r as n}from"./Icon-l19w4AjM.js";import{$g as r,$n as i,$p as a,$u as o,A as s,Ad as c,Au as l,Bd as u,Bs as d,Cd as f,D as p,Dm as m,Dp as h,Em as g,Ep as _,F as v,Fd as y,Gd as b,Gn as x,Hp as S,Jf as C,Jn as w,Kn as T,Lf as E,Lo as D,Ls as O,Lu as k,Mh as A,Nd as j,Np as M,Pd as N,Qd as P,Qn as F,Rs as I,Sf as L,Up as R,Vo as z,Vp as B,Vu as ee,WT as V,Wn as H,Yn as U,Zn as te,_s as ne,ar as re,by as ie,cp as ae,cr as oe,dd as se,ed as ce,ef as le,hp as ue,hs as W,ip as de,ir as fe,jd as pe,ju as me,kd as he,ku as ge,mE as _e,nd as ve,nm as ye,nr as be,o_ as xe,ol as Se,op as Ce,or as we,qn as Te,qp as Ee,rd as De,rr as Oe,ry as ke,sf as Ae,sm as je,sr as G,sy as Me,t as K,td as Ne,tr as Pe,ua as Fe,uf as Ie,um as Le,up as Re,vm as ze,vp as Be,vs as Ve,wf as He,xm as Ue,zf as We}from"./utils-TSzPLNGf.js";import{U as Ge}from"./runtime-qAs3Aj0U.js";import{C as Ke,O as qe,k as Je,w as Ye}from"./entities-CW57Cs5E.js";import{$t as Xe,cn as Ze,dn as Qe,in as $e,ln as et,sn as tt}from"./runtime-ZOY8Qeg_.js";import{M as nt,N as rt,U as it,W as at,a as q,c as ot,g as st,n as J,r as ct,t as Y,v as lt}from"./tooltip-DdUPPKq4.js";import{$ as ut,B as dt,n as ft,z as pt}from"./ChatMarkdown-B2cnntMF.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-BX0YSg0P.js";import{t as vt}from"./spinner-CH-Dn9Fj.js";import{i as yt,m as bt,p as xt}from"./toast-3I2gpMYd.js";import{E as St,J as Ct,K as wt,f as Tt}from"./useSettings-DsvnJBf2.js";import{s as Et}from"./server-BxsIDqAi.js";import{i as Dt,n as Ot}from"./session-Lp4r-IPM.js";import{n as kt}from"./query-w0R7LhwJ.js";import{t as At}from"./use-atom-command-CVDCnNHi.js";import{l as jt,t as Mt}from"./rightPanelStore-CRw1DWSH.js";import{u as Nt}from"./queries-DfOxYbXr.js";import{C as X,Q as Pt,Z as Ft,_ as It,at as Lt,c as Rt,d as zt,ft as Bt,l as Vt,lt as Ht,nt as Ut,ot as Wt,s as Gt,t as Kt,tt as qt,u as Jt,v as Yt,w as Xt}from"./diffRendering-CnRmUrdi.js";import{C as Zt,E as Qt,G as $t,H as en,K as tn,U as nn,V as rn,W as an,d as on,i as sn,u as cn}from"./Virtualizer-BzpMB2EV.js";import{l as ln,ut as un}from"./getDiffFileInput-C3kf5492.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-BGHe4Gu5.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-qUCf81Vy.js";import{S as vn,a as yn,b as bn,i as xn,n as Sn,r as Cn,t as wn}from"./DiffCommentAnnotation-DpZ1jfFT.js";import{r as Tn}from"./mediaSource-1xb6xNr7.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{t as On}from"./skeleton--v3ra8uu.js";import{t as kn}from"./textarea-B3ib3YW-.js";import{t as An}from"./toggle-Ce46mx2g.js";import{n as jn,t as Mn}from"./toggle-group-Dt1Yldxx.js";import{i as Nn,l as Pn,o as Fn,r as In,s as Ln,t as Rn}from"./combobox-BdHSd-gh.js";import{d as zn,l as Bn,t as Vn,u as Hn}from"./command-DywgXMPU.js";import{t as Un}from"./input-CNGP9r-b.js";import{t as Wn}from"./scroll-area-DyzCabMe.js";import{a as Gn,c as Kn,i as qn,o as Jn,r as Yn,s as Xn,t as Zn}from"./dialog-B5b8j4VI.js";import{t as Qn}from"./useResizeDrag-KJl_F2EN.js";import{a as $n,i as er,o as tr,r as nr,t as rr}from"./empty-BQwNj0_P.js";import{i as ir}from"./device-CVYEIUNR.js";import{t as ar}from"./observeResize-jQzrVN_N.js";import{o as or,s as sr}from"./openFileInPreview-Dx_dxN9N.js";import{f as cr}from"./browserHistoryStore-CUwwaVj8.js";import{_ as lr,y as ur}from"./keybindings-Dw_FB1Sr.js";import{i as dr,n as fr}from"./Icons-CyDEOiJ2.js";import{t as pr}from"./PierreEntryIcon-zwmwEij7.js";import{F as mr,H as hr,U as gr,_ as _r,a as vr,b as yr,c as br,d as xr,f as Sr,g as Cr,h as wr,i as Tr,m as Er,n as Dr,o as Or,p as kr,r as Ar,s as jr,u as Mr,v as Nr,x as Pr,y as Fr}from"./RenderErrorBoundary-ChsSTLIX.js";import{c as Ir,l as Lr}from"./threadSort-DDAHH_-8.js";import{n as Rr}from"./pullRequestIcons-SCwBWGeD.js";import{D as zr,a as Br,c as Vr,i as Hr,k as Ur,n as Wr,r as Gr,u as Kr}from"./pullRequests-DQFba6Nz.js";import{a as qr,i as Jr,n as Yr,o as Xr,t as Zr}from"./popover-CCsUmLYF.js";import{A as Qr,B as $r,C as ei,D as ti,E as ni,H as ri,I as ii,K as ai,L as oi,M as si,N as ci,O as li,P as ui,R as di,S as fi,T as pi,U as mi,V as hi,X as gi,Y as _i,_ as vi,a as yi,b as bi,c as xi,d as Si,f as Ci,g as wi,i as Ti,j as Ei,k as Di,l as Oi,o as ki,p as Ai,q as ji,r as Mi,s as Ni,t as Pi,v as Fi,w as Ii,y as Li,z as Ri}from"./pullRequestDetail.logic-CYwAUOQC.js";import{i as zi,n as Bi,r as Vi,t as Hi}from"./pullRequestReviewStore-C7gfd5m3.js";import{t as Ui}from"./terminalLabels-BgLOlb2G.js";import{i as Wi,m as Gi,n as Ki,r as qi,t as Ji}from"./guideRunStore-C7ZnghV_.js";import{a as Yi,b as Xi,h as Zi,l as Qi,m as $i,p as ea,r as ta,s as na,t as ra,u as ia}from"./sortable.esm-UojJGtqY.js";import{n as aa}from"./useHandleNewThread-BrxevYhf.js";import{n as oa}from"./EnvironmentMachineIcon-BzeEbEQS.js";import{i as sa,n as ca,r as la,t as ua}from"./alert-BFkMrLRZ.js";import{t as da}from"./kbd-C3OLELe_.js";import{Fa as fa,Ia as pa,Jr as ma,Pa as ha,Ra as ga,ai as _a,cn as va,fa as ya,oi as ba,qa as xa,qr as Sa,ua as Ca}from"./main-pmaKofkn.js";import"./WorkspacePageHeader-xG2EcvME.js";import{r as wa,s as Ta,t as Ea}from"./usePullRequestActions-cqQ4IRFz.js";function Da(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Oa(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:ka(e.items,t.items)}function ka(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function Aa(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Pt,``),t.before(r)):(r.setAttribute(Ft,``),t.after(r)),n?.observe(r),r}function ja(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Ma=1e5,Na=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Pa=`data-diffs-search`,Fa=`:host {
3
3
  display: block;
4
4
  position: sticky;
5
5
  z-index: 100;
@@ -211,6 +211,6 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-BGHZIIw
211
211
  [data-code]::-webkit-scrollbar-thumb {
212
212
  background-color: var(--diffs-bg-context);
213
213
  }
214
- `;function rd(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:a,commenting:o,loadDiffFiles:c,onOpenFile:l}=e,[u,d]=(0,Z.useState)(null),{resolvedTheme:f}=wt(),p;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){p=null;break bb0}let e=Wu(r),i=Gu(e,n);if(i.length===0){p=null;break bb0}let a=Rt(qu(n.path,zt(r),i),`pull-request-guide-excerpt:${n.path}:${n.side}:${n.start}-${n.end}`),o=a?.kind===`files`?a.files[0]:void 0;if(o===void 0){p=null;break bb0}let s={additions:new Set(i.flatMap(sd)),deletions:new Set(i.flatMap(od))},c;t[3]!==s||t[4]!==o||t[5]!==e||t[6]!==i?(c={fileDiff:o,rows:i,shown:i.length,total:e.length,drawn:s},t[3]=s,t[4]=o,t[5]=e,t[6]=i,t[7]=c):c=t[7],p=c}t[0]=n,t[1]=r,t[2]=p}else p=t[2];let m=p,h=m?.rows??null,g;bb1:{if(h===null||h.some(e=>e.hunk!==h[0]?.hunk)){g=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==h?(e=async e=>{let t=await c(e),r=Ju(t.newFile.contents,h);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=h,t[13]=e):e=t[13],g=e}let _=g,y;t[14]!==o?.pending||t[15]!==u||t[16]!==n.path||t[17]!==n.side||t[18]!==a||t[19]!==m?.drawn?(y=()=>{let e=new Map,t=(t,n)=>{let r=`${t}:${n}`,i=e.get(r);if(i!==void 0)return i;let a={side:t,lineNumber:n,metadata:{markers:[],pending:[],draft:!1}};return e.set(r,a),a},r=(n,r,i)=>{let a=t(n,r);e.set(`${n}:${r}`,{...a,metadata:i(a.metadata)})},i=n.side===`new`?`additions`:`deletions`;for(let e of a)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of o?.pending??[]){if(e.path!==n.path)continue;let t=fc(e.position),i=dc(t.side);m?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=fc(u.position);r(dc(e.side),e.line,ad)}return[...e.values()]},t[14]=o?.pending,t[15]=u,t[16]=n.path,t[17]=n.side,t[18]=a,t[19]=m?.drawn,t[20]=y):y=t[20],o?.pending;let b;t[21]===y?b=t[22]:(b=y(),t[21]=y,t[22]=b);let x=b,S;t[23]===r?S=t[24]:(S=e=>{if(e===null||r===null)return;let t=v(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=o!==null&&u===null,T=o?.onAskAgent??null,E;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==T?(E=e=>{if(u===null||r===null||T===null)return;let t=s({id:`pull-request-guide:${n.path}:${u.range.start}:${u.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:u.range,text:e});d(null),t!==null&&T(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=T,t[29]=E):E=t[29];let D=E,O;t[30]===f?O=t[31]:(O=Vt(f),t[30]=f,t[31]=O);let A;t[32]===_?A=t[33]:(A=_===null?{hunkSeparators:`simple`}:{loadDiffFiles:_},t[32]=_,t[33]=A);let j;t[34]!==C||t[35]!==w||t[36]!==f||t[37]!==O||t[38]!==A?(j={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:f,preferredHighlighter:ga,unsafeCSS:nd,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...A},t[34]=C,t[35]=w,t[36]=f,t[37]=O,t[38]=A,t[39]=j):j=t[39];let M=j,N;t[40]===n.caption?N=t[41]:(N=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(zu,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=N);let P;t[42]!==x||t[43]!==D||t[44]!==o||t[45]!==u||t[46]!==n.end||t[47]!==n.path||t[48]!==n.side||t[49]!==n.start||t[50]!==r||t[51]!==i||t[52]!==T||t[53]!==l||t[54]!==M||t[55]!==m?(P=m===null?i?(0,$.jsxs)(`p`,{className:`rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[`Loading `,n.path,`...`]}):(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,$.jsx)(`span`,{className:`font-mono text-foreground`,children:n.path}),` lines `,n.start,`-`,n.end,` are not in the loaded diff.`]}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(_n,{fileDiff:m.fileDiff,options:M,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(id)}):null,e.metadata.pending.map(e=>(0,$.jsx)(pc,{comment:e,onRemove:()=>o?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&o!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${fc(u.position).line}`,text:``,placeholder:o.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:o.canComment?`Add to review`:`Ask agent`,...o.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{if(!o.canComment){D(e);return}o.onComment({path:n.path,oldPath:r===null?null:cd(r,n.path),position:u.position,body:e}),d(null)}}):null]}),renderHeaderMetadata:()=>(0,$.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[n.side===`old`?`removed code, `:``,`showing `,m.shown,` of`,` `,m.total,` diff lines`]}),(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(k,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=o,t[45]=u,t[46]=n.end,t[47]=n.path,t[48]=n.side,t[49]=n.start,t[50]=r,t[51]=i,t[52]=T,t[53]=l,t[54]=M,t[55]=m,t[56]=P):P=t[56];let F;return t[57]!==N||t[58]!==P?(F=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[N,P]}),t[57]=N,t[58]=P,t[59]=F):F=t[59],F}function id(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)($u,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function ad(e){return{...e,draft:!0}}function od(e){return e.oldLine===null?[]:[e.oldLine]}function sd(e){return e.newLine===null?[]:[e.newLine]}function cd(e,t){let n=zt(e);return n===t?null:n}function ld(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=wt(),a;t[0]===n?a=t[1]:(a=mn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Vt(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:ga,unsafeCSS:Ko,loadDiffFiles:r},t[4]=r,t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c,u;return t[8]!==o||t[9]!==l?(u=(0,$.jsx)(`div`,{className:`border-t border-border/60`,children:(0,$.jsx)(_n,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var ud={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function dd(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:a,onRailOpenChange:o,stopList:s,nextTitle:c,files:l,loadDiffFiles:u,diffLoading:d,commenting:f,onStep:p,onAsk:m,onFinish:h,onOpenFile:g}=e,_;t[0]===n?_=t[1]:(_=Yu(n),t[0]=n,t[1]=_);let{lettered:v,byExcerpt:b}=_,x;t[2]===n.excerpts?x=t[3]:(x=new Set(n.excerpts.map(fd)),t[2]=n.excerpts,t[3]=x);let S=x,C,w,T,D,O,k,A,j,M;if(t[4]!==b||t[5]!==f||t[6]!==d||t[7]!==S||t[8]!==l||t[9]!==r||t[10]!==v||t[11]!==u||t[12]!==g||t[13]!==o||t[14]!==p||t[15]!==a||t[16]!==n.attention||t[17]!==n.excerpts||t[18]!==n.files||t[19]!==n.summary||t[20]!==n.title||t[21]!==i||t[22]!==s){let e;t[32]===S?e=t[33]:(e=e=>!S.has(e.path),t[32]=S,t[33]=e);let c=n.files.filter(e);C=v.length>0;let m=C&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===m?w=t[35]:(w=K(`grid gap-8`,m),t[34]=m,t[35]=w),T=`flex min-w-0 flex-col gap-5`;let h=r+1,_;t[36]!==i||t[37]!==h?(_=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,i]}),t[36]=i,t[37]=h,t[38]=_):_=t[38];let x;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=x):x=t[39];let E=r+1,N;t[40]!==i||t[41]!==E?(N=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,E,` of `,i]}),t[40]=i,t[41]=E,t[42]=N):N=t[42];let P=a&&`rotate-180`,F;t[43]===P?F=t[44]:(F=K(P),t[43]=P,t[44]=F);let I;t[45]===F?I=t[46]:(I=(0,$.jsx)(ce,{"aria-hidden":!0,className:F}),t[45]=F,t[46]=I);let L;t[47]!==N||t[48]!==I?(L=(0,$.jsxs)(pa,{render:x,children:[N,I]}),t[47]=N,t[48]=I,t[49]=L):L=t[49];let R=r===0,z;t[50]===p?z=t[51]:(z=()=>p(-1),t[50]=p,t[51]=z);let B;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(De,{"aria-hidden":!0}),t[52]=B):B=t[52];let ee;t[53]!==R||t[54]!==z?(ee=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:R,onClick:z,children:B}),t[53]=R,t[54]=z,t[55]=ee):ee=t[55];let V=r===i-1,H;t[56]===p?H=t[57]:(H=()=>p(1),t[56]=p,t[57]=H);let U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(ce,{"aria-hidden":!0}),t[58]=U):U=t[58];let te;t[59]!==V||t[60]!==H?(te=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:V,onClick:H,children:U}),t[59]=V,t[60]=H,t[61]=te):te=t[61];let ne;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(da,{children:`J`}),(0,$.jsx)(da,{children:`K`})]}),t[62]=ne):ne=t[62];let re;t[63]!==ee||t[64]!==te?(re=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[ee,te,ne]}),t[63]=ee,t[64]=te,t[65]=re):re=t[65];let ie;t[66]!==_||t[67]!==L||t[68]!==re?(ie=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[_,L,re]}),t[66]=_,t[67]=L,t[68]=re,t[69]=ie):ie=t[69];let ae;t[70]===s?ae=t[71]:(ae=(0,$.jsx)(fa,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=ae),t[72]!==o||t[73]!==a||t[74]!==ie||t[75]!==ae?(D=(0,$.jsxs)(ha,{open:a,onOpenChange:o,children:[ie,ae]}),t[72]=o,t[73]=a,t[74]=ie,t[75]=ae,t[76]=D):D=t[76];let oe;t[77]===n.title?oe=t[78]:(oe=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=oe);let se;t[79]===n.summary?se=t[80]:(se=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(zu,{text:n.summary})}),t[79]=n.summary,t[80]=se),t[81]!==oe||t[82]!==se?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[oe,se]}),t[81]=oe,t[82]=se,t[83]=O):O=t[83],t[84]===n.attention?k=t[85]:(k=n.attention===null?null:(0,$.jsxs)(ua,{controlAlignment:`first-line`,children:[(0,$.jsx)(pe,{}),(0,$.jsx)(sa,{children:ud[n.attention.kind]}),(0,$.jsx)(la,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(zu,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=k),t[86]!==b||t[87]!==f||t[88]!==d||t[89]!==l||t[90]!==u||t[91]!==g||t[92]!==n.excerpts?(A=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(pn,{children:n.excerpts.map((e,t)=>(0,$.jsx)(rd,{excerpt:e,file:l.get(e.path)??null,loading:d,notes:b[t]??[],commenting:f,loadDiffFiles:u,onOpenFile:g},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=b,t[87]=f,t[88]=d,t[89]=l,t[90]=u,t[91]=g,t[92]=n.excerpts,t[93]=A):A=t[93],t[94]===v?j=t[95]:(j=(0,$.jsx)(ed,{notes:v,className:`@min-[90rem]/guide:hidden`}),t[94]=v,t[95]=j),M=c.length>0?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n.excerpts.length>0?`Also in this stop`:`Files in this stop`}),(0,$.jsx)(pn,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:c.map(e=>{let t=l.get(e.path),n=t===void 0?null:Gt([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(ha,{children:[(0,$.jsxs)(pa,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left text-xs outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(ve,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(y,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-foreground`,children:e.path}),e.note!==void 0&&e.note.trim()!==``?(0,$.jsx)(`span`,{className:`ml-auto min-w-0 truncate text-muted-foreground @max-[30rem]/guide:hidden`,children:(0,$.jsx)(zu,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Or,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(fa,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:d?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(ld,{file:t,loadDiffFiles:u})})]})},e.path)})})})]}):null,t[4]=b,t[5]=f,t[6]=d,t[7]=S,t[8]=l,t[9]=r,t[10]=v,t[11]=u,t[12]=g,t[13]=o,t[14]=p,t[15]=a,t[16]=n.attention,t[17]=n.excerpts,t[18]=n.files,t[19]=n.summary,t[20]=n.title,t[21]=i,t[22]=s,t[23]=C,t[24]=w,t[25]=T,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j,t[31]=M}else C=t[23],w=t[24],T=t[25],D=t[26],O=t[27],k=t[28],A=t[29],j=t[30],M=t[31];let N;t[96]!==m||t[97]!==n.questions?(N=n.questions.length>0||m!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>m===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(zu,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(e),className:`flex min-w-0 items-start gap-2 rounded-lg border border-border/60 px-3 py-1.5 text-left text-sm text-foreground outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(E,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Ask an agent: `}),(0,$.jsx)(`span`,{children:(0,$.jsx)(zu,{text:e,plain:!0})})]},e)),m===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>m(``),children:[(0,$.jsx)(E,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=m,t[97]=n.questions,t[98]=N):N=t[98];let P;t[99]!==c||t[100]!==h||t[101]!==p?(P=c===null?h===null?null:(0,$.jsxs)(G,{onClick:h,children:[(0,$.jsx)(We,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(G,{className:`min-w-0`,onClick:()=>p(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,c]}),(0,$.jsx)(me,{"aria-hidden":!0})]}),t[99]=c,t[100]=h,t[101]=p,t[102]=P):P=t[102];let F;t[103]===P?F=t[104]:(F=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:P}),t[103]=P,t[104]=F);let I;t[105]!==N||t[106]!==F||t[107]!==T||t[108]!==D||t[109]!==O||t[110]!==k||t[111]!==A||t[112]!==j||t[113]!==M?(I=(0,$.jsxs)(`article`,{className:T,children:[D,O,k,A,j,M,N,F]}),t[105]=N,t[106]=F,t[107]=T,t[108]=D,t[109]=O,t[110]=k,t[111]=A,t[112]=j,t[113]=M,t[114]=I):I=t[114];let L;t[115]!==C||t[116]!==v?(L=C?(0,$.jsx)(`aside`,{className:`hidden @min-[90rem]/guide:block @min-[90rem]/guide:sticky @min-[90rem]/guide:top-4 @min-[90rem]/guide:self-start`,children:(0,$.jsx)(ed,{notes:v})}):null,t[115]=C,t[116]=v,t[117]=L):L=t[117];let R;return t[118]!==w||t[119]!==I||t[120]!==L?(R=(0,$.jsxs)(`div`,{className:w,children:[I,L]}),t[118]=w,t[119]=I,t[120]=L,t[121]=R):R=t[121],R}function fd(e){return e.path}var pd=new Map;function md(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=Bi(r),t[0]=r,t[1]=o);let s=`${n}:${o}:${i}`,c;t[2]===s?c=t[3]:(c={key:s,cursor:null,done:!1,files:pd},t[2]=s,t[3]=c);let[l,u]=(0,Z.useState)(c),d,f,p,m;t[4]!==n||t[5]!==s||t[6]!==l||t[7]!==r||t[8]!==a?(d=l.key===s?l:{key:s,cursor:null,done:!1,files:pd},f=a.some(e=>!d.files.has(e))&&!d.done,p=kt,m=f?Gr.diff({environmentId:n,input:{...r,...d.cursor===null?{}:{cursor:d.cursor}}}):null,t[4]=n,t[5]=s,t[6]=l,t[7]=r,t[8]=a,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(d=t[9],f=t[10],p=t[11],m=t[12]);let h=p(m),g=h.data,_=d.cursor,v,y;t[13]!==_||t[14]!==g||t[15]!==s?(v=()=>{g!==null&&u(e=>{let t=e.key===s?e:{key:s,cursor:null,done:!1,files:pd};if(t.cursor!==_||t.done)return t;let n=Rt(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Jt(e),e);return{key:s,cursor:g.nextCursor,done:g.nextCursor===null,files:r}})},y=[_,g,s],t[13]=_,t[14]=g,t[15]=s,t[16]=v,t[17]=y):(v=t[16],y=t[17]),(0,Z.useEffect)(v,y);let b=f&&h.error===null,x=f?h.error:null,S;return t[18]!==d.files||t[19]!==h.refresh||t[20]!==b||t[21]!==x?(S={files:d.files,loading:b,error:x,retry:h.refresh},t[18]=d.files,t[19]=h.refresh,t[20]=b,t[21]=x,t[22]=S):S=t[22],S}function hd(e){let t=(0,Q.c)(63),{environmentId:n,reference:r,guide:i,banner:a,active:o,commenting:s,onAsk:c,onFinish:l,onOpenFile:u}=e,d;t[0]!==n||t[1]!==i.headSha||t[2]!==r?(d=Ji(Ki(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=qi(f),m;t[4]===f?m=t[5]:(m=e=>Wi.getState().setProgress(f,t=>({...t,...e(t)})),t[4]=f,t[5]=m);let h=m,[g,_]=(0,Z.useState)(!1),v=i.stops.length,y=Math.max(Math.min(p.position,v-1),0),b=i.stops[y]??null,x;t[6]===b?x=t[7]:(x=b===null?[]:Vu(b),t[6]=b,t[7]=x);let S=x,C;t[8]!==n||t[9]!==i.headSha||t[10]!==r||t[11]!==S?(C={environmentId:n,reference:r,headSha:i.headSha,wantedPaths:S},t[8]=n,t[9]=i.headSha,t[10]=r,t[11]=S,t[12]=C):C=t[12];let w=md(C),T=At(Gr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Xo(T,{environmentId:n,reference:r,commit:null,cacheKey:E}),t[13]=n,t[14]=T,t[15]=r,t[16]=E,t[17]=D):D=t[17];let O=D,k=(0,Z.useRef)(null),A;t[18]!==y||t[19]!==h?(A=e=>{h(t=>({position:e,seen:e>y?new Set(t.seen).add(y):t.seen})),_(!1),k.current?.scrollTo({top:0})},t[18]=y,t[19]=h,t[20]=A):A=t[20];let j=A,M;t[21]!==j||t[22]!==y||t[23]!==v?(M=e=>j(Bu(y,e,v)),t[21]=j,t[22]=y,t[23]=v,t[24]=M):M=t[24];let N=M,P;t[25]===N?P=t[26]:(P=e=>{e.defaultPrevented||e.isComposing||Sa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Gi(e.target)||(e.preventDefault(),N(e.key===`j`?1:-1)))},t[25]=N,t[26]=P);let F=(0,Z.useEffectEvent)(P),I;t[27]!==o||t[28]!==F?(I=()=>{if(!o)return;let e=e=>F(e);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},t[27]=o,t[28]=F,t[29]=I):I=t[29];let L;t[30]===o?L=t[31]:(L=[o],t[30]=o,t[31]=L),(0,Z.useEffect)(I,L);let R;t[32]!==j||t[33]!==i.stops||t[34]!==y||t[35]!==p.seen?(R=(0,$.jsx)(`aside`,{className:`sticky top-4 self-start @max-[56rem]/guide:hidden`,children:(0,$.jsx)(Xu,{stops:i.stops,position:y,seen:p.seen,onSelect:j})}),t[32]=j,t[33]=i.stops,t[34]=y,t[35]=p.seen,t[36]=R):R=t[36];let z;t[37]===w.error?z=t[38]:(z=w.error===null?null:(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`The diff could not be loaded, so excerpts are missing: `,w.error]}),t[37]=w.error,t[38]=z);let B;t[39]!==s||t[40]!==w.files||t[41]!==w.loading||t[42]!==j||t[43]!==i.stops||t[44]!==O||t[45]!==c||t[46]!==l||t[47]!==u||t[48]!==y||t[49]!==g||t[50]!==N||t[51]!==b||t[52]!==v||t[53]!==p.seen||t[54]!==h?(B=b===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This change has no files to tour.`}):(0,$.jsx)(dd,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(Xu,{stops:i.stops,position:y,seen:p.seen,onSelect:j}),nextTitle:i.stops[y+1]?.title??null,files:w.files,loadDiffFiles:O,diffLoading:w.loading,commenting:s,onStep:N,onAsk:c===null?null:e=>c(y,e),onFinish:l===null?null:()=>{h(e=>({seen:new Set(e.seen).add(y)})),l()},onOpenFile:u},y),t[39]=s,t[40]=w.files,t[41]=w.loading,t[42]=j,t[43]=i.stops,t[44]=O,t[45]=c,t[46]=l,t[47]=u,t[48]=y,t[49]=g,t[50]=N,t[51]=b,t[52]=v,t[53]=p.seen,t[54]=h,t[55]=B):B=t[55];let ee;t[56]!==a||t[57]!==z||t[58]!==B?(ee=(0,$.jsxs)(`main`,{className:`flex min-w-0 flex-col gap-4`,children:[a,z,B]}),t[56]=a,t[57]=z,t[58]=B,t[59]=ee):ee=t[59];let V;return t[60]!==R||t[61]!==ee?(V=(0,$.jsx)(`div`,{ref:k,className:`@container/guide h-full overflow-y-auto scrollbar-gutter-both`,children:(0,$.jsxs)(`div`,{className:`mx-auto grid max-w-[100rem] gap-6 px-4 py-4 @min-[56rem]/guide:grid-cols-[16rem_minmax(0,1fr)] @min-[90rem]/guide:gap-8 @min-[90rem]/guide:px-6`,children:[R,ee]})}),t[60]=R,t[61]=ee,t[62]=V):V=t[62],V}function gd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Gr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=kt(a),s;t[3]===n?s=t[4]:(s=Gr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=z(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=At(Gr.generateReviewGuide,l),[d,f]=(0,Z.useState)(!1),p=o.data,m=d||p?.run?._tag===`Running`,h;t[6]!==p||t[7]!==n||t[8]!==r||t[9]!==i?(h=()=>Wi.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:p?.guide?.generatedAt??null,previousFailedAt:p?.run?._tag===`Failed`?p.run.failedAt:null,since:Date.now()}),t[6]=p,t[7]=n,t[8]=r,t[9]=i,t[10]=h):h=t[10];let g=(0,Z.useEffectEvent)(h),_;t[11]!==p?.run?._tag||t[12]!==g?(_=()=>{p?.run?._tag===`Running`&&g()},t[11]=p?.run?._tag,t[12]=g,t[13]=_):_=t[13];let v=p?.run?._tag,y;t[14]===v?y=t[15]:(y=[v],t[14]=v,t[15]=y),(0,Z.useEffect)(_,y);let b;t[16]!==n||t[17]!==u||t[18]!==r||t[19]!==m||t[20]!==g?(b=async()=>{if(m)return;f(!0),g();let e=await u({environmentId:n,input:r});f(!1),e._tag===`Failure`&&(Wi.getState().settle(Ki(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:di(Ge(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=u,t[18]=r,t[19]=m,t[20]=g,t[21]=b):b=t[21];let x=b,S;return t[22]!==c||t[23]!==p||t[24]!==o||t[25]!==m||t[26]!==x?(S={query:o,data:p,running:m,canWrite:c,write:x},t[22]=c,t[23]=p,t[24]=o,t[25]=m,t[26]=x,t[27]=S):S=t[27],S}function _d(e){let t=(0,Q.c)(68),{environmentId:n,reference:r,title:i,workspaceRoot:a,active:o,canComment:s,onAskAboutLines:c,onAskAboutStop:l,onFinishReview:u,onOpenFile:d,onTourShown:f}=e,p;t[0]!==n||t[1]!==r||t[2]!==i?(p={environmentId:n,reference:r,title:i},t[0]=n,t[1]=r,t[2]=i,t[3]=p):p=t[3];let{query:m,data:h,running:g,canWrite:_,write:v}=gd(p),y;t[4]!==n||t[5]!==r?(y=Ki(n,r),t[4]=n,t[5]=r,t[6]=y):y=t[6];let b=y,x;t[7]===r?x=t[8]:(x=Bi(r),t[7]=r,t[8]=x);let S=x,C=Vi(r),w=zi(yd),T=zi(vd),E;t[9]!==w||t[10]!==s||t[11]!==c||t[12]!==C||t[13]!==T||t[14]!==S?(E=!s&&c===null?null:{canComment:s,pending:C,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return w(S,{id:Hi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>T(S,e),onAskAgent:c},t[9]=w,t[10]=s,t[11]=c,t[12]=C,t[13]=T,t[14]=S,t[15]=E):E=t[15];let D=E,O,k;t[16]!==o||t[17]!==b?(O=()=>{if(o)return Wi.getState().setShown(b),()=>{Wi.getState().shownKey===b&&Wi.getState().setShown(null)}},k=[o,b],t[16]=o,t[17]=b,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,Z.useEffect)(O,k);let A=h?.guide??null,j=o&&A!==null,M;t[20]===f?M=t[21]:(M=()=>f?.(),t[20]=f,t[21]=M);let N=(0,Z.useEffectEvent)(M),P;t[22]!==N||t[23]!==j?(P=()=>{j&&N()},t[22]=N,t[23]=j,t[24]=P):P=t[24];let F;t[25]===j?F=t[26]:(F=[j],t[25]=j,t[26]=F),(0,Z.useEffect)(P,F);let I=h?.run??null,L=h?.currentHeadSha??null,z=A!==null&&L!==null&&L!==A.headSha,B=I?._tag===`Failed`&&I.headSha===L?I.detail:null,ee;t[27]!==_||t[28]!==g||t[29]!==v?(ee=(e,t)=>_?(0,$.jsxs)(G,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(R,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=ee):ee=t[30];let V=ee;if(A===null){if(m.isPending&&h===null){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-48 items-center justify-center`,children:(0,$.jsx)(vt,{})}),t[31]=e):e=t[31],e}let e=g?`Writing a review guide`:`No review guide yet`,n;t[32]===e?n=t[33]:(n=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),t[32]=e,t[33]=n);let r=B??m.error??(g?`An agent is reading the change. A large one takes a few minutes. You can leave; you will be told when it is ready.`:`A guide is a tour of the change: stops through the code in reading order, with the calls only a maintainer can make.`),i;t[34]===r?i=t[35]:(i=(0,$.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:r}),t[34]=r,t[35]=i);let a=B===null?`Write guide`:`Try again`,o;t[36]!==a||t[37]!==V?(o=V(a,`sm`),t[36]=a,t[37]=V,t[38]=o):o=t[38];let s;return t[39]!==n||t[40]!==i||t[41]!==o?(s=(0,$.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-2 px-4 py-10 text-center`,children:[n,i,o]}),t[39]=n,t[40]=i,t[41]=o,t[42]=s):s=t[42],s}let H;t[43]!==_||t[44]!==B||t[45]!==g||t[46]!==z||t[47]!==V?(H=z||B!==null||g?(0,$.jsxs)(ua,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(Le,{}),(0,$.jsx)(la,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!g&&_?(0,$.jsx)(ca,{children:V(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=B,t[45]=g,t[46]=z,t[47]=V,t[48]=H):H=t[48];let U=H,te;t[49]!==n||t[50]!==a?(te={environmentId:n,cwd:a},t[49]=n,t[50]=a,t[51]=te):te=t[51];let ne;t[52]!==A||t[53]!==l?(ne=l===null?null:(e,t)=>{let n=A.stops[e];n!==void 0&&l(n,e,t)},t[52]=A,t[53]=l,t[54]=ne):ne=t[54];let re;t[55]!==o||t[56]!==U||t[57]!==D||t[58]!==n||t[59]!==A||t[60]!==u||t[61]!==d||t[62]!==r||t[63]!==ne?(re=(0,$.jsx)(hd,{environmentId:n,reference:r,guide:A,banner:U,active:o,commenting:D,onAsk:ne,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=U,t[57]=D,t[58]=n,t[59]=A,t[60]=u,t[61]=d,t[62]=r,t[63]=ne,t[64]=re):re=t[64];let ie;return t[65]!==te||t[66]!==re?(ie=(0,$.jsx)(Ru,{value:te,children:re}),t[65]=te,t[66]=re,t[67]=ie):ie=t[67],ie}function vd(e){return e.removeComment}function yd(e){return e.addComment}function bd(e){let t=(0,Q.c)(12),[n,r]=(0,Z.useState)(null),i=n?.scopeKey===e?n:null,a,o;t[0]!==n||t[1]!==e?(a=()=>{if(!n)return;let t=()=>r(null);if(n.scopeKey!==e){t();return}let i=e=>{e.target instanceof Node&&!n.element.contains(e.target)&&t()},a=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())},o=window.setTimeout(t,3e3);return document.addEventListener(`pointerdown`,i,!0),window.addEventListener(`keydown`,a,!0),window.addEventListener(`blur`,t),()=>{window.clearTimeout(o),document.removeEventListener(`pointerdown`,i,!0),window.removeEventListener(`keydown`,a,!0),window.removeEventListener(`blur`,t)}},o=[n,e],t[0]=n,t[1]=e,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,Z.useEffect)(a,o);let s;t[4]===i?.action?s=t[5]:(s=e=>i?.action===e,t[4]=i?.action,t[5]=s);let c;t[6]!==i||t[7]!==e?(c=(t,n)=>({onClick:a=>{i?.action===t&&i.element===a.currentTarget?(r(null),n()):r({scopeKey:e,action:t,element:a.currentTarget})},onBlur:()=>r(null)}),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l={isArmed:s,props:c},t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var xd={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not turn on auto-merge`,"disable-auto-merge":`Could not turn off auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Sd={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access to the branch — one from a fork also needs its author to allow edits from maintainers — and that it does not conflict with the base.`,"enable-auto-merge":`The host refused it. Check that this repository allows auto-merge, that you have write access, and that there is something left for it to wait on.`,"disable-auto-merge":`The host refused it. Check that you have write access, and that the merge has not already happened.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`},Cd=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,wd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Td=()=>t(()=>import(`./PullRequestCodeTab-DLqbGyR7.js`),__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])),Ed=(0,Z.lazy)(Td),Dd=new Map,Od=e=>typeof e==`string`?e:d(e);function kd(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:a,disabled:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(Pe,{}),t[0]=s):s=t[0];let c;t[1]===a?c=t[2]:(c=e=>a(e),t[1]=a,t[2]=c);let l;if(t[3]!==o||t[4]!==n){let e;t[6]===o?e=t[7]:(e=e=>(0,$.jsx)(i,{value:e.environmentId,disabled:o,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(oa,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=o,t[7]=e),l=n.map(e),t[3]=o,t[4]=n,t[5]=l}else l=t[5];let u;return t[8]!==c||t[9]!==l||t[10]!==r?(u=(0,$.jsxs)($.Fragment,{children:[s,(0,$.jsx)(F,{value:r,onValueChange:c,children:l})]}),t[8]=c,t[9]=l,t[10]=r,t[11]=u):u=t[11],u}var Ad=(e,t)=>{e.preventDefault(),e.stopPropagation(),wl({url:t.url,openLabel:Sl(Ir.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function jd(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=K(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=K(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(Le,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Xr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(G,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(Jr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Zr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function Md({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:a=null,reference:s,listEntry:u=null,refreshToken:d=0,onActed:m,onClose:g,context:_=`page`,composerDraftTarget:v,onBack:y,onSelectPullRequest:S,onGuideShown:w}){let T=Ye(),D=Ke(),A=D.find(t=>t.id===s.projectId&&t.environmentId===e),j=A?.repositoryIdentity,M=T.get(e)?.environment.capabilities.threadPullRequests===!0,B=(0,Z.useMemo)(()=>M?mi(s,j):{projectId:s.projectId,repository:s.repository,number:s.number},[s,j,M]),V=`${B.projectId}:${B.host??``}:${B.repository}#${B.number}`,ne=u?.projectId===B.projectId&&u.repository.toLowerCase()===B.repository.toLowerCase()&&(B.host===void 0||u.host.toLowerCase()===B.host.toLowerCase())&&u.number===B.number?u:null,[re,ie]=(0,Z.useState)(!1),[ae,oe]=(0,Z.useState)(0),[W,de]=(0,Z.useState)(`summary`),[fe,pe]=(0,Z.useState)(`newest`),[me,he]=(0,Z.useState)(()=>({pullRequestKey:V,oid:null})),_e=me.pullRequestKey===V?me.oid:null,ve=e=>{he({pullRequestKey:V,oid:e})},ye=e=>{ve(e),de(`code`)},[Te,Ee]=(0,Z.useState)(null),De=e=>{ve(null),Ee(t=>({path:e,nonce:(t?.nonce??0)+1})),Td(),de(`code`)},Oe=Wi(t=>t.openRequestKey===Ki(e,B));Oe&&W!==`guide`&&de(`guide`),(0,Z.useEffect)(()=>{Oe&&Wi.getState().requestOpen(null)},[Oe]);let ke=`${e}:${V}`,[Ae,Me]=(0,Z.useState)(()=>({key:ke,tabs:new Set([`summary`])})),Ne=Ae.key===ke?Ae.tabs:new Set([W]);(0,Z.useEffect)(()=>{Me(e=>e.key===ke?e.tabs.has(W)?e:{key:ke,tabs:new Set(e.tabs).add(W)}:{key:ke,tabs:new Set([W])})},[W,ke]);let[Fe,Le]=(0,Z.useState)(!1),Re=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Le(Re.current[W]??!1)},[W]);let ze=Fe,Be=(0,Z.useRef)({}),Ve=(0,Z.useMemo)(()=>({summary:e=>{Be.current.summary=e},timeline:e=>{Be.current.timeline=e},code:e=>{Be.current.code=e}}),[]),He=(0,Z.useRef)(null),Ue=(0,Z.useRef)(null),qe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=qe.current;e!==null&&(qe.current=null,ze&&e.tab===W&&Be.current[W]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[ze,W]);let Je=Xi(e=>e.pullRequestMergeMethod),Xe=Xi(e=>e.setPullRequestMergeMethod),$e=wa(e,B.projectId),tt=(0,Z.useMemo)(()=>$e(),[$e]),[nt,rt]=(0,Z.useState)(null),it=e=>{rt({pullRequestKey:V,method:e})},at=bd(V),[ot,st]=(0,Z.useState)(null),lt=Dt(e,xe),ut=kt(Gr.detail({environmentId:e,input:B})),dt=kt(Gr.activity({environmentId:e,input:B})),ft=Vr(e),[pt,mt]=(0,Z.useState)(()=>oi(typeof window>`u`?void 0:window.localStorage,e,B));(0,Z.useEffect)(()=>{mt(oi(typeof window>`u`?void 0:window.localStorage,e,B))},[e,V,B.projectId,B.repository,B.number]),(0,Z.useEffect)(()=>{ut.data!==null&&(gi(typeof window>`u`?void 0:window.localStorage,e,B,ut.data),mt(ut.data))},[ut.data,e,V,B.projectId,B.repository,B.number]);let ht=$r({live:ut.data,cached:pt,reference:B}),gt=(0,Z.useMemo)(()=>ne===null?null:Hr(ne),[ne]),_t=(0,Z.useMemo)(()=>ut.data===null?null:{...ut.data,checksState:Er(ut.data.checks)},[ut.data]),vt=Kr(e,B,_t,ut.dataUpdatedAt),bt=(0,Z.useMemo)(()=>Wr(ht,Wr(vt,gt)),[ht,vt,gt]),wt=(0,Z.useMemo)(()=>ht===null||bt===null||bt===ht?ht:{...ht,title:bt.title,state:bt.state,headBranch:bt.headBranch,baseBranch:bt.baseBranch,updatedAt:bt.updatedAt,author:bt.author??ht.author,additions:bt.additions??ht.additions,deletions:bt.deletions??ht.deletions,changedFiles:bt.changedFiles??ht.changedFiles,mergeability:bt.mergeability??ht.mergeability,closedAt:bt.closedAt===void 0?ht.closedAt:bt.closedAt,mergedAt:bt.mergedAt===void 0?ht.mergedAt:bt.mergedAt,isDraft:bt.isDraft??ht.isDraft},[ht,bt]),Mt=dt.data,X=(0,Z.useMemo)(()=>wt===null?null:{...wt,capabilities:lt?wt.capabilities:{...wt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:lt?wt.viewerPermissions:{...wt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:Mt?.author??wt.author,reviewers:Mt?.reviewers??wt.reviewers,comments:Mt?.comments??[],commentCount:Mt?.commentCount??0,commentsTruncated:Mt?.commentsTruncated??!1,reviewThreads:Mt?.reviewThreads??[],commits:Mt?.commits??[],reactions:Mt?.reactions??[]},[Mt,lt,wt]),Pt=X??bt,Ft=z(Et),{copyToClipboard:It}=xt({target:`pull request reference`,onCopy:e=>yt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>yt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),Lt=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||Sa()||lr(e,Ft,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||It(`#${B.number}`,`PR number`))});(0,Z.useEffect)(()=>{let e=e=>Lt(e);return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Z.useEffect)(()=>{X?.autoMergeMethod!==void 0&&it(X.autoMergeMethod)},[X?.autoMergeMethod,V]);let Rt=X===null?null:Ze(X.url),zt=Ir.get(X?.provider),Bt=(0,Z.useMemo)(()=>({repositoryUrl:Rt===null?null:zt.referenceAutolinkRepositoryUrl(Rt),threadRef:a}),[zt,Rt,a]),Vt=X?.author&&Rt!==null?zt.authorProfileUrl(X.author.login,Rt):null,Ht=Pt?si(Pt.provider,Pt.number,Pt.headBranch,X?.headRepositoryNameWithOwner,Ze(Pt.url)):ni(B,j),Ut=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Wt=kt(X===null?null:Nt.listRefs({environmentId:e,input:{cwd:X.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Gt=X!==null&&Ii(X.baseBranch,Wt.data?.refs??[]),Kt=xc(e,(0,Z.useMemo)(()=>X===null||X.capabilities.stacks!==!0||!M?null:{...B,host:B.host??Qe(X.url)?.host},[X,B,M])),qt=Kt.data,Jt=M&&X?.capabilities.stacks===!0&&X.capabilities.stackActions===!0&&T.get(e)?.environment.capabilities.pullRequestStackActions===!0,Yt=Mi({supportsStackActions:Jt,hasStack:qt!==null,stackPending:!Kt.isFresh,stackError:Kt.error}),Xt=dt.isPending&&Mt===null,Zt=Mt===null?dt.error:null,Qt=(0,Z.useCallback)(()=>{ut.refresh(),dt.refresh(),Kt.refresh()},[dt.refresh,ut.refresh,Kt.refresh]),[$t,en]=(0,Z.useState)(0),tn=$t+(ft??0),nn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!wt)return;let e={key:ke,updatedAt:wt.updatedAt};if(ai(nn.current,e)){if(dt.isPending)return;dt.refresh(),en(e=>e+1)}nn.current=e},[dt.isPending,dt.refresh,wt,ke]),Fc(()=>{ut.refresh()},{key:`pull-request:${e}:${V}`});let rn=At(Gr.invalidate,{reportFailure:!1}),[an,on]=(0,Z.useState)(!1),sn=an||ut.isPending,cn=(0,Z.useCallback)(async()=>{on(!0);try{await rn({environmentId:e,input:{reference:B}}),Qt(),en(e=>e+1)}finally{on(!1)}},[e,rn,B,Qt]),ln=(0,Z.useRef)(d);(0,Z.useEffect)(()=>{ln.current!==d&&(ln.current=d,cn())},[d,cn]);let un=At(Gr.runAction,{reportFailure:!1}),dn=At(Gr.comment,{reportFailure:!1}),[fn,pn]=(0,Z.useState)(null),mn=fn!==null,hn=At(Gr.update,{reportFailure:!1}),[gn,_n]=(0,Z.useState)(null),vn=gn?.pullRequestKey===V?gn.text:null,[yn,bn]=(0,Z.useState)(!1),xn=aa(),{environments:Sn}=St(),Cn=(0,Z.useMemo)(()=>{let t=D.find(t=>t.id===B.projectId&&t.environmentId===e)?.repositoryIdentity;return et(t,B.repository,B.number)},[e,D,B.number,B.projectId,B.repository]),wn=(0,Z.useMemo)(()=>_===`page`?vc({environmentId:e,projectId:B.projectId},D,Sn.map(e=>({environmentId:e.environmentId,label:e.label,machine:Se(e.serverConfig)}))):[],[_,e,Sn,D,B.projectId]),[Tn,Dn]=(0,Z.useState)(null),On=Tn?.pullRequestKey===V?Tn.environmentId:e,kn=wn.find(e=>e.environmentId===On)??null,An=kn?.environmentId??e,jn=kn?.workspaceRoot??X?.workspaceRoot??A?.workspaceRoot??null,Mn=Dt(An,r),Nn=Ta({environmentId:An,cwd:jn}),Pn=async(t,n,r)=>{m?.(t,`sent`);let i=await un({environmentId:e,input:{...B,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(pn(null),i._tag===`Failure`){let e=Ge(i),n=r===`rebase`?Cd:Sd[t];return yt.add({type:`error`,title:xd[t],description:di(e,n)}),m?.(t,`failed`),!1}return t===`revert`&&yt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&yt.add({type:`success`,title:`Branch deleted`}),Ei(t)?cn():Qt(),m?.(t,`done`),!0},Fn=async(e,t,n)=>!lt||fn!==null?!1:(pn(e),Pn(e,t,n)),In=async(t,n)=>!lt||fn!==null?{commentPosted:!1}:(pn(n),(await dn({environmentId:e,input:{...B,body:t}}))._tag===`Failure`?(pn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Pn(n)||Qt(),{commentPosted:!0})),Ln=async t=>{let n=t.trim();if(!lt||X===null||yn)return;if(n.length===0||n===X.title){_n(null);return}bn(!0);let r=await hn({environmentId:e,input:{...B,title:n}});if(bn(!1),r._tag===`Failure`){yt.add({type:`error`,title:`The title could not be saved`,description:di(Ge(r),`The host refused the new title.`)});return}_n(null),Qt()},Rn=v??null,zn=Nn.isAllowed&&Mn,Bn=Rn!==null||zn,Vn=ui(Rn!==null),Hn=gd({environmentId:e,reference:B,title:X?.title??null}),Wn=()=>{Hn.write(),Hn.data?.guide??de(`guide`)},Gn=(e,t)=>{let n=p.getState(),r=n.getComposerDraft(e),i=Od(e),a=new Set((r?.reviewComments??[]).map(e=>e.id)),o=new Set((t.reviewComments??[]).filter(e=>a.has(e.id)).map(e=>e.id)),s=ji(r?.prompt??``,r?.reviewComments??[],o),c=Li({prompt:s,lastHandoffPrompt:Dd.get(i)},t.prompt);Dd.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,bi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Kn=async(e,t,n)=>{let r=n??await xn(e).then(e=>e,()=>null);return r===null?null:(t===null||Gn(r.draftId,t),r)},qn=async(t,n,r)=>{if(!X||ot!==null)return;if(Rn!==null){Gn(Rn,n),yt.add({type:`success`,title:`Added to the composer`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`});return}st(t);let i=O(An,kn?.projectId??X.projectId),a=await Kn(i,n);if(st(null),a!==null&&r?.keepGuide===!0){let t=p.getState().getDraftSession(a.draftId);t!==null&&(jt.getState().openPullRequest(I(t.environmentId,t.threadId),{environmentId:e,projectId:B.projectId,...B.host===void 0?{}:{host:B.host},repository:B.repository,number:B.number,url:X.url}),Wi.getState().requestOpen(Ki(e,B)))}if(a===null){yt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}yt.add({type:`success`,title:`Asked in a thread`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},Jn=async(e,t,n=`worktree`)=>{if(!Pt||ot!==null)return;if(Rn!==null&&t!==null){Gn(Rn,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(jn===null||!Nn.isAllowed||!Ot(An,`source-control:write`)||n===`worktree`&&!Ot(An,`orchestration:operate`))return;st(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=O(An,kn?.projectId??Pt.projectId),a=await xn(i).then(e=>e,()=>null);if(a===null){st(null),yt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Nn.run({reference:Pt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){st(null);let e=Nn.error instanceof Error?Nn.error.message:null;yt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await xn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){st(null),yt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}st(null);let s={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:s);return}await Kn(i,t,a),yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s)},Yn=()=>{X&&qn(`ask`,{...ki({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Xn=()=>{X&&qn(`explain`,{...Ni({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Zn=(e,t,n)=>{X&&qn(`guide-stop:${t}`,yi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},Qn=(e,t)=>{X&&qn(`selection:${e.comment.id}`,Ti({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,comment:e.comment,request:e.request}),t)},$n=e=>{Pt&&Jn(`checkout:${e}`,null,e)},er=e=>{X&&Jn(ci(e),xi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,finding:e}))},tr=()=>{X&&Jn(`findings`,Oi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,reviewThreads:X.reviewThreads,comments:X.comments,checks:Dr?[]:X.checks,commentsTruncated:X.commentsTruncated}))},nr=()=>{Pt&&Jn(`conflicts`,{prompt:Ci({number:Pt.number,url:Pt.url,headBranch:Pt.headBranch,baseBranch:Pt.baseBranch})})},rr=X?X.capabilities.mergeMethods.filter(e=>X.mergeCapabilities[e]):[],ir=nt?.pullRequestKey===V?nt.method:null,ar=hi(rr,ir,tt,Je),or=Pi[ar],sr=`Auto-merge (${or.toLowerCase()})`,cr=X?.state===`open`&&X.mergeability===`conflicting`,dr=X?.state===`open`&&X.autoMergeEnabled===!0,fr=X?.autoMergeMethod,pr=fr?`Auto-merge (${Pi[fr].toLowerCase()})`:`Auto-merge`,mr=X?.state===`open`?X.workflowApprovalsRequired??0:0,hr=X===null?null:Ri(X),gr=Tt(e,e=>e.reviewGuidesEnabled),_r=wd.filter(e=>(e.value!==`code`||X===null||X.capabilities.diff)&&(e.value!==`guide`||gr));(0,Z.useEffect)(()=>{_r.some(e=>e.value===W)||de(`summary`)},[W,_r]);let vr=e=>X?.capabilities.actions.includes(e)===!0&&X.viewerPermissions.actions.includes(e),Sr=X?Er(X.checks):null,Cr=bt?.checksState===void 0?Sr:bt.checksState,Tr=Cr!==`failing`&&X?.checks.some(e=>e.status===`action-required`)?`pending`:Cr,Dr=Tr!==Sr,kr=X?ri({state:X.state,isDraft:X.isDraft,mergeability:X.mergeability,checksState:Tr,autoMergeEnabled:X.autoMergeEnabled,hasMergeMethod:rr.length>0,canMerge:Yt&&vr(`merge`),canMarkReady:vr(`ready`),canEnableAutoMerge:Yt&&vr(`enable-auto-merge`)}):null,jr=X?.state===`open`&&vr(X.isDraft?`ready`:`draft`)&&!(X.isDraft&&kr===`ready`),Mr=Yt&&X?.state===`open`&&(dr&&vr(`disable-auto-merge`)||!dr&&kr!==`enable-auto-merge`&&!X.isDraft&&!cr&&vr(`enable-auto-merge`)&&rr.length>0),Nr=Yt&&X?.state===`open`&&(kr===`enable-auto-merge`||kr===`auto-merge-armed`)&&vr(`merge`)&&!X.isDraft&&!cr&&rr.length>0,Lr=X?.state===`open`&&vr(`merge`)&&!X.isDraft&&!cr&&rr.length>1,zr=X?yr({state:X.state,isDraft:X.isDraft}):null,Br=X!==null&&Ai(X),Ur=Sn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),qr=async()=>{X!==null&&await Ct()?.dialogs.confirm([`Delete branch ${X.headBranch}?`,`This deletes ${X.headBranch} from ${X.headRepositoryNameWithOwner??X.repository}. Local branches and worktrees are not changed.`].join(`
214
+ `;function rd(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:a,commenting:o,loadDiffFiles:c,onOpenFile:l}=e,[u,d]=(0,Z.useState)(null),{resolvedTheme:f}=wt(),p;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){p=null;break bb0}let e=Wu(r),i=Gu(e,n);if(i.length===0){p=null;break bb0}let a=Rt(qu(n.path,zt(r),i),`pull-request-guide-excerpt:${n.path}:${n.side}:${n.start}-${n.end}`),o=a?.kind===`files`?a.files[0]:void 0;if(o===void 0){p=null;break bb0}let s={additions:new Set(i.flatMap(sd)),deletions:new Set(i.flatMap(od))},c;t[3]!==s||t[4]!==o||t[5]!==e||t[6]!==i?(c={fileDiff:o,rows:i,shown:i.length,total:e.length,drawn:s},t[3]=s,t[4]=o,t[5]=e,t[6]=i,t[7]=c):c=t[7],p=c}t[0]=n,t[1]=r,t[2]=p}else p=t[2];let m=p,h=m?.rows??null,g;bb1:{if(h===null||h.some(e=>e.hunk!==h[0]?.hunk)){g=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==h?(e=async e=>{let t=await c(e),r=Ju(t.newFile.contents,h);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=h,t[13]=e):e=t[13],g=e}let _=g,y;t[14]!==o?.pending||t[15]!==u||t[16]!==n.path||t[17]!==n.side||t[18]!==a||t[19]!==m?.drawn?(y=()=>{let e=new Map,t=(t,n)=>{let r=`${t}:${n}`,i=e.get(r);if(i!==void 0)return i;let a={side:t,lineNumber:n,metadata:{markers:[],pending:[],draft:!1}};return e.set(r,a),a},r=(n,r,i)=>{let a=t(n,r);e.set(`${n}:${r}`,{...a,metadata:i(a.metadata)})},i=n.side===`new`?`additions`:`deletions`;for(let e of a)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of o?.pending??[]){if(e.path!==n.path)continue;let t=fc(e.position),i=dc(t.side);m?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=fc(u.position);r(dc(e.side),e.line,ad)}return[...e.values()]},t[14]=o?.pending,t[15]=u,t[16]=n.path,t[17]=n.side,t[18]=a,t[19]=m?.drawn,t[20]=y):y=t[20],o?.pending;let b;t[21]===y?b=t[22]:(b=y(),t[21]=y,t[22]=b);let x=b,S;t[23]===r?S=t[24]:(S=e=>{if(e===null||r===null)return;let t=v(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=o!==null&&u===null,T=o?.onAskAgent??null,E;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==T?(E=e=>{if(u===null||r===null||T===null)return;let t=s({id:`pull-request-guide:${n.path}:${u.range.start}:${u.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:u.range,text:e});d(null),t!==null&&T(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=T,t[29]=E):E=t[29];let D=E,O;t[30]===f?O=t[31]:(O=Vt(f),t[30]=f,t[31]=O);let A;t[32]===_?A=t[33]:(A=_===null?{hunkSeparators:`simple`}:{loadDiffFiles:_},t[32]=_,t[33]=A);let j;t[34]!==C||t[35]!==w||t[36]!==f||t[37]!==O||t[38]!==A?(j={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:f,preferredHighlighter:ga,unsafeCSS:nd,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...A},t[34]=C,t[35]=w,t[36]=f,t[37]=O,t[38]=A,t[39]=j):j=t[39];let M=j,N;t[40]===n.caption?N=t[41]:(N=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(zu,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=N);let P;t[42]!==x||t[43]!==D||t[44]!==o||t[45]!==u||t[46]!==n.end||t[47]!==n.path||t[48]!==n.side||t[49]!==n.start||t[50]!==r||t[51]!==i||t[52]!==T||t[53]!==l||t[54]!==M||t[55]!==m?(P=m===null?i?(0,$.jsxs)(`p`,{className:`rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[`Loading `,n.path,`...`]}):(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,$.jsx)(`span`,{className:`font-mono text-foreground`,children:n.path}),` lines `,n.start,`-`,n.end,` are not in the loaded diff.`]}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(_n,{fileDiff:m.fileDiff,options:M,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(id)}):null,e.metadata.pending.map(e=>(0,$.jsx)(pc,{comment:e,onRemove:()=>o?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&o!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${fc(u.position).line}`,text:``,placeholder:o.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:o.canComment?`Add to review`:`Ask agent`,...o.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{if(!o.canComment){D(e);return}o.onComment({path:n.path,oldPath:r===null?null:cd(r,n.path),position:u.position,body:e}),d(null)}}):null]}),renderHeaderMetadata:()=>(0,$.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[n.side===`old`?`removed code, `:``,`showing `,m.shown,` of`,` `,m.total,` diff lines`]}),(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(k,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=o,t[45]=u,t[46]=n.end,t[47]=n.path,t[48]=n.side,t[49]=n.start,t[50]=r,t[51]=i,t[52]=T,t[53]=l,t[54]=M,t[55]=m,t[56]=P):P=t[56];let F;return t[57]!==N||t[58]!==P?(F=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[N,P]}),t[57]=N,t[58]=P,t[59]=F):F=t[59],F}function id(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)($u,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function ad(e){return{...e,draft:!0}}function od(e){return e.oldLine===null?[]:[e.oldLine]}function sd(e){return e.newLine===null?[]:[e.newLine]}function cd(e,t){let n=zt(e);return n===t?null:n}function ld(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=wt(),a;t[0]===n?a=t[1]:(a=mn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Vt(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:ga,unsafeCSS:Ko,loadDiffFiles:r},t[4]=r,t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c,u;return t[8]!==o||t[9]!==l?(u=(0,$.jsx)(`div`,{className:`border-t border-border/60`,children:(0,$.jsx)(_n,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var ud={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function dd(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:a,onRailOpenChange:o,stopList:s,nextTitle:c,files:l,loadDiffFiles:u,diffLoading:d,commenting:f,onStep:p,onAsk:m,onFinish:h,onOpenFile:g}=e,_;t[0]===n?_=t[1]:(_=Yu(n),t[0]=n,t[1]=_);let{lettered:v,byExcerpt:b}=_,x;t[2]===n.excerpts?x=t[3]:(x=new Set(n.excerpts.map(fd)),t[2]=n.excerpts,t[3]=x);let S=x,C,w,T,D,O,k,A,j,M;if(t[4]!==b||t[5]!==f||t[6]!==d||t[7]!==S||t[8]!==l||t[9]!==r||t[10]!==v||t[11]!==u||t[12]!==g||t[13]!==o||t[14]!==p||t[15]!==a||t[16]!==n.attention||t[17]!==n.excerpts||t[18]!==n.files||t[19]!==n.summary||t[20]!==n.title||t[21]!==i||t[22]!==s){let e;t[32]===S?e=t[33]:(e=e=>!S.has(e.path),t[32]=S,t[33]=e);let c=n.files.filter(e);C=v.length>0;let m=C&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===m?w=t[35]:(w=K(`grid gap-8`,m),t[34]=m,t[35]=w),T=`flex min-w-0 flex-col gap-5`;let h=r+1,_;t[36]!==i||t[37]!==h?(_=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,i]}),t[36]=i,t[37]=h,t[38]=_):_=t[38];let x;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=x):x=t[39];let E=r+1,N;t[40]!==i||t[41]!==E?(N=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,E,` of `,i]}),t[40]=i,t[41]=E,t[42]=N):N=t[42];let P=a&&`rotate-180`,F;t[43]===P?F=t[44]:(F=K(P),t[43]=P,t[44]=F);let I;t[45]===F?I=t[46]:(I=(0,$.jsx)(ce,{"aria-hidden":!0,className:F}),t[45]=F,t[46]=I);let L;t[47]!==N||t[48]!==I?(L=(0,$.jsxs)(pa,{render:x,children:[N,I]}),t[47]=N,t[48]=I,t[49]=L):L=t[49];let R=r===0,z;t[50]===p?z=t[51]:(z=()=>p(-1),t[50]=p,t[51]=z);let B;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(De,{"aria-hidden":!0}),t[52]=B):B=t[52];let ee;t[53]!==R||t[54]!==z?(ee=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:R,onClick:z,children:B}),t[53]=R,t[54]=z,t[55]=ee):ee=t[55];let V=r===i-1,H;t[56]===p?H=t[57]:(H=()=>p(1),t[56]=p,t[57]=H);let U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(ce,{"aria-hidden":!0}),t[58]=U):U=t[58];let te;t[59]!==V||t[60]!==H?(te=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:V,onClick:H,children:U}),t[59]=V,t[60]=H,t[61]=te):te=t[61];let ne;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(da,{children:`J`}),(0,$.jsx)(da,{children:`K`})]}),t[62]=ne):ne=t[62];let re;t[63]!==ee||t[64]!==te?(re=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[ee,te,ne]}),t[63]=ee,t[64]=te,t[65]=re):re=t[65];let ie;t[66]!==_||t[67]!==L||t[68]!==re?(ie=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[_,L,re]}),t[66]=_,t[67]=L,t[68]=re,t[69]=ie):ie=t[69];let ae;t[70]===s?ae=t[71]:(ae=(0,$.jsx)(fa,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=ae),t[72]!==o||t[73]!==a||t[74]!==ie||t[75]!==ae?(D=(0,$.jsxs)(ha,{open:a,onOpenChange:o,children:[ie,ae]}),t[72]=o,t[73]=a,t[74]=ie,t[75]=ae,t[76]=D):D=t[76];let oe;t[77]===n.title?oe=t[78]:(oe=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=oe);let se;t[79]===n.summary?se=t[80]:(se=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(zu,{text:n.summary})}),t[79]=n.summary,t[80]=se),t[81]!==oe||t[82]!==se?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[oe,se]}),t[81]=oe,t[82]=se,t[83]=O):O=t[83],t[84]===n.attention?k=t[85]:(k=n.attention===null?null:(0,$.jsxs)(ua,{controlAlignment:`first-line`,children:[(0,$.jsx)(pe,{}),(0,$.jsx)(sa,{children:ud[n.attention.kind]}),(0,$.jsx)(la,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(zu,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=k),t[86]!==b||t[87]!==f||t[88]!==d||t[89]!==l||t[90]!==u||t[91]!==g||t[92]!==n.excerpts?(A=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(pn,{children:n.excerpts.map((e,t)=>(0,$.jsx)(rd,{excerpt:e,file:l.get(e.path)??null,loading:d,notes:b[t]??[],commenting:f,loadDiffFiles:u,onOpenFile:g},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=b,t[87]=f,t[88]=d,t[89]=l,t[90]=u,t[91]=g,t[92]=n.excerpts,t[93]=A):A=t[93],t[94]===v?j=t[95]:(j=(0,$.jsx)(ed,{notes:v,className:`@min-[90rem]/guide:hidden`}),t[94]=v,t[95]=j),M=c.length>0?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n.excerpts.length>0?`Also in this stop`:`Files in this stop`}),(0,$.jsx)(pn,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:c.map(e=>{let t=l.get(e.path),n=t===void 0?null:Gt([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(ha,{children:[(0,$.jsxs)(pa,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left text-xs outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(ve,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(y,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-foreground`,children:e.path}),e.note!==void 0&&e.note.trim()!==``?(0,$.jsx)(`span`,{className:`ml-auto min-w-0 truncate text-muted-foreground @max-[30rem]/guide:hidden`,children:(0,$.jsx)(zu,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Or,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(fa,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:d?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(ld,{file:t,loadDiffFiles:u})})]})},e.path)})})})]}):null,t[4]=b,t[5]=f,t[6]=d,t[7]=S,t[8]=l,t[9]=r,t[10]=v,t[11]=u,t[12]=g,t[13]=o,t[14]=p,t[15]=a,t[16]=n.attention,t[17]=n.excerpts,t[18]=n.files,t[19]=n.summary,t[20]=n.title,t[21]=i,t[22]=s,t[23]=C,t[24]=w,t[25]=T,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j,t[31]=M}else C=t[23],w=t[24],T=t[25],D=t[26],O=t[27],k=t[28],A=t[29],j=t[30],M=t[31];let N;t[96]!==m||t[97]!==n.questions?(N=n.questions.length>0||m!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>m===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(zu,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(e),className:`flex min-w-0 items-start gap-2 rounded-lg border border-border/60 px-3 py-1.5 text-left text-sm text-foreground outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(E,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Ask an agent: `}),(0,$.jsx)(`span`,{children:(0,$.jsx)(zu,{text:e,plain:!0})})]},e)),m===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>m(``),children:[(0,$.jsx)(E,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=m,t[97]=n.questions,t[98]=N):N=t[98];let P;t[99]!==c||t[100]!==h||t[101]!==p?(P=c===null?h===null?null:(0,$.jsxs)(G,{onClick:h,children:[(0,$.jsx)(We,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(G,{className:`min-w-0`,onClick:()=>p(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,c]}),(0,$.jsx)(me,{"aria-hidden":!0})]}),t[99]=c,t[100]=h,t[101]=p,t[102]=P):P=t[102];let F;t[103]===P?F=t[104]:(F=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:P}),t[103]=P,t[104]=F);let I;t[105]!==N||t[106]!==F||t[107]!==T||t[108]!==D||t[109]!==O||t[110]!==k||t[111]!==A||t[112]!==j||t[113]!==M?(I=(0,$.jsxs)(`article`,{className:T,children:[D,O,k,A,j,M,N,F]}),t[105]=N,t[106]=F,t[107]=T,t[108]=D,t[109]=O,t[110]=k,t[111]=A,t[112]=j,t[113]=M,t[114]=I):I=t[114];let L;t[115]!==C||t[116]!==v?(L=C?(0,$.jsx)(`aside`,{className:`hidden @min-[90rem]/guide:block @min-[90rem]/guide:sticky @min-[90rem]/guide:top-4 @min-[90rem]/guide:self-start`,children:(0,$.jsx)(ed,{notes:v})}):null,t[115]=C,t[116]=v,t[117]=L):L=t[117];let R;return t[118]!==w||t[119]!==I||t[120]!==L?(R=(0,$.jsxs)(`div`,{className:w,children:[I,L]}),t[118]=w,t[119]=I,t[120]=L,t[121]=R):R=t[121],R}function fd(e){return e.path}var pd=new Map;function md(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=Bi(r),t[0]=r,t[1]=o);let s=`${n}:${o}:${i}`,c;t[2]===s?c=t[3]:(c={key:s,cursor:null,done:!1,files:pd},t[2]=s,t[3]=c);let[l,u]=(0,Z.useState)(c),d,f,p,m;t[4]!==n||t[5]!==s||t[6]!==l||t[7]!==r||t[8]!==a?(d=l.key===s?l:{key:s,cursor:null,done:!1,files:pd},f=a.some(e=>!d.files.has(e))&&!d.done,p=kt,m=f?Gr.diff({environmentId:n,input:{...r,...d.cursor===null?{}:{cursor:d.cursor}}}):null,t[4]=n,t[5]=s,t[6]=l,t[7]=r,t[8]=a,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(d=t[9],f=t[10],p=t[11],m=t[12]);let h=p(m),g=h.data,_=d.cursor,v,y;t[13]!==_||t[14]!==g||t[15]!==s?(v=()=>{g!==null&&u(e=>{let t=e.key===s?e:{key:s,cursor:null,done:!1,files:pd};if(t.cursor!==_||t.done)return t;let n=Rt(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Jt(e),e);return{key:s,cursor:g.nextCursor,done:g.nextCursor===null,files:r}})},y=[_,g,s],t[13]=_,t[14]=g,t[15]=s,t[16]=v,t[17]=y):(v=t[16],y=t[17]),(0,Z.useEffect)(v,y);let b=f&&h.error===null,x=f?h.error:null,S;return t[18]!==d.files||t[19]!==h.refresh||t[20]!==b||t[21]!==x?(S={files:d.files,loading:b,error:x,retry:h.refresh},t[18]=d.files,t[19]=h.refresh,t[20]=b,t[21]=x,t[22]=S):S=t[22],S}function hd(e){let t=(0,Q.c)(63),{environmentId:n,reference:r,guide:i,banner:a,active:o,commenting:s,onAsk:c,onFinish:l,onOpenFile:u}=e,d;t[0]!==n||t[1]!==i.headSha||t[2]!==r?(d=Ji(Ki(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=qi(f),m;t[4]===f?m=t[5]:(m=e=>Wi.getState().setProgress(f,t=>({...t,...e(t)})),t[4]=f,t[5]=m);let h=m,[g,_]=(0,Z.useState)(!1),v=i.stops.length,y=Math.max(Math.min(p.position,v-1),0),b=i.stops[y]??null,x;t[6]===b?x=t[7]:(x=b===null?[]:Vu(b),t[6]=b,t[7]=x);let S=x,C;t[8]!==n||t[9]!==i.headSha||t[10]!==r||t[11]!==S?(C={environmentId:n,reference:r,headSha:i.headSha,wantedPaths:S},t[8]=n,t[9]=i.headSha,t[10]=r,t[11]=S,t[12]=C):C=t[12];let w=md(C),T=At(Gr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Xo(T,{environmentId:n,reference:r,commit:null,cacheKey:E}),t[13]=n,t[14]=T,t[15]=r,t[16]=E,t[17]=D):D=t[17];let O=D,k=(0,Z.useRef)(null),A;t[18]!==y||t[19]!==h?(A=e=>{h(t=>({position:e,seen:e>y?new Set(t.seen).add(y):t.seen})),_(!1),k.current?.scrollTo({top:0})},t[18]=y,t[19]=h,t[20]=A):A=t[20];let j=A,M;t[21]!==j||t[22]!==y||t[23]!==v?(M=e=>j(Bu(y,e,v)),t[21]=j,t[22]=y,t[23]=v,t[24]=M):M=t[24];let N=M,P;t[25]===N?P=t[26]:(P=e=>{e.defaultPrevented||e.isComposing||Sa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Gi(e.target)||(e.preventDefault(),N(e.key===`j`?1:-1)))},t[25]=N,t[26]=P);let F=(0,Z.useEffectEvent)(P),I;t[27]!==o||t[28]!==F?(I=()=>{if(!o)return;let e=e=>F(e);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},t[27]=o,t[28]=F,t[29]=I):I=t[29];let L;t[30]===o?L=t[31]:(L=[o],t[30]=o,t[31]=L),(0,Z.useEffect)(I,L);let R;t[32]!==j||t[33]!==i.stops||t[34]!==y||t[35]!==p.seen?(R=(0,$.jsx)(`aside`,{className:`sticky top-4 self-start @max-[56rem]/guide:hidden`,children:(0,$.jsx)(Xu,{stops:i.stops,position:y,seen:p.seen,onSelect:j})}),t[32]=j,t[33]=i.stops,t[34]=y,t[35]=p.seen,t[36]=R):R=t[36];let z;t[37]===w.error?z=t[38]:(z=w.error===null?null:(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`The diff could not be loaded, so excerpts are missing: `,w.error]}),t[37]=w.error,t[38]=z);let B;t[39]!==s||t[40]!==w.files||t[41]!==w.loading||t[42]!==j||t[43]!==i.stops||t[44]!==O||t[45]!==c||t[46]!==l||t[47]!==u||t[48]!==y||t[49]!==g||t[50]!==N||t[51]!==b||t[52]!==v||t[53]!==p.seen||t[54]!==h?(B=b===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This change has no files to tour.`}):(0,$.jsx)(dd,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(Xu,{stops:i.stops,position:y,seen:p.seen,onSelect:j}),nextTitle:i.stops[y+1]?.title??null,files:w.files,loadDiffFiles:O,diffLoading:w.loading,commenting:s,onStep:N,onAsk:c===null?null:e=>c(y,e),onFinish:l===null?null:()=>{h(e=>({seen:new Set(e.seen).add(y)})),l()},onOpenFile:u},y),t[39]=s,t[40]=w.files,t[41]=w.loading,t[42]=j,t[43]=i.stops,t[44]=O,t[45]=c,t[46]=l,t[47]=u,t[48]=y,t[49]=g,t[50]=N,t[51]=b,t[52]=v,t[53]=p.seen,t[54]=h,t[55]=B):B=t[55];let ee;t[56]!==a||t[57]!==z||t[58]!==B?(ee=(0,$.jsxs)(`main`,{className:`flex min-w-0 flex-col gap-4`,children:[a,z,B]}),t[56]=a,t[57]=z,t[58]=B,t[59]=ee):ee=t[59];let V;return t[60]!==R||t[61]!==ee?(V=(0,$.jsx)(`div`,{ref:k,className:`@container/guide h-full overflow-y-auto scrollbar-gutter-both`,children:(0,$.jsxs)(`div`,{className:`mx-auto grid max-w-[100rem] gap-6 px-4 py-4 @min-[56rem]/guide:grid-cols-[16rem_minmax(0,1fr)] @min-[90rem]/guide:gap-8 @min-[90rem]/guide:px-6`,children:[R,ee]})}),t[60]=R,t[61]=ee,t[62]=V):V=t[62],V}function gd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Gr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=kt(a),s;t[3]===n?s=t[4]:(s=Gr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=z(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=At(Gr.generateReviewGuide,l),[d,f]=(0,Z.useState)(!1),p=o.data,m=d||p?.run?._tag===`Running`,h;t[6]!==p||t[7]!==n||t[8]!==r||t[9]!==i?(h=()=>Wi.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:p?.guide?.generatedAt??null,previousFailedAt:p?.run?._tag===`Failed`?p.run.failedAt:null,since:Date.now()}),t[6]=p,t[7]=n,t[8]=r,t[9]=i,t[10]=h):h=t[10];let g=(0,Z.useEffectEvent)(h),_;t[11]!==p?.run?._tag||t[12]!==g?(_=()=>{p?.run?._tag===`Running`&&g()},t[11]=p?.run?._tag,t[12]=g,t[13]=_):_=t[13];let v=p?.run?._tag,y;t[14]===v?y=t[15]:(y=[v],t[14]=v,t[15]=y),(0,Z.useEffect)(_,y);let b;t[16]!==n||t[17]!==u||t[18]!==r||t[19]!==m||t[20]!==g?(b=async()=>{if(m)return;f(!0),g();let e=await u({environmentId:n,input:r});f(!1),e._tag===`Failure`&&(Wi.getState().settle(Ki(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:di(Ge(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=u,t[18]=r,t[19]=m,t[20]=g,t[21]=b):b=t[21];let x=b,S;return t[22]!==c||t[23]!==p||t[24]!==o||t[25]!==m||t[26]!==x?(S={query:o,data:p,running:m,canWrite:c,write:x},t[22]=c,t[23]=p,t[24]=o,t[25]=m,t[26]=x,t[27]=S):S=t[27],S}function _d(e){let t=(0,Q.c)(68),{environmentId:n,reference:r,title:i,workspaceRoot:a,active:o,canComment:s,onAskAboutLines:c,onAskAboutStop:l,onFinishReview:u,onOpenFile:d,onTourShown:f}=e,p;t[0]!==n||t[1]!==r||t[2]!==i?(p={environmentId:n,reference:r,title:i},t[0]=n,t[1]=r,t[2]=i,t[3]=p):p=t[3];let{query:m,data:h,running:g,canWrite:_,write:v}=gd(p),y;t[4]!==n||t[5]!==r?(y=Ki(n,r),t[4]=n,t[5]=r,t[6]=y):y=t[6];let b=y,x;t[7]===r?x=t[8]:(x=Bi(r),t[7]=r,t[8]=x);let S=x,C=Vi(r),w=zi(yd),T=zi(vd),E;t[9]!==w||t[10]!==s||t[11]!==c||t[12]!==C||t[13]!==T||t[14]!==S?(E=!s&&c===null?null:{canComment:s,pending:C,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return w(S,{id:Hi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>T(S,e),onAskAgent:c},t[9]=w,t[10]=s,t[11]=c,t[12]=C,t[13]=T,t[14]=S,t[15]=E):E=t[15];let D=E,O,k;t[16]!==o||t[17]!==b?(O=()=>{if(o)return Wi.getState().setShown(b),()=>{Wi.getState().shownKey===b&&Wi.getState().setShown(null)}},k=[o,b],t[16]=o,t[17]=b,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,Z.useEffect)(O,k);let A=h?.guide??null,j=o&&A!==null,M;t[20]===f?M=t[21]:(M=()=>f?.(),t[20]=f,t[21]=M);let N=(0,Z.useEffectEvent)(M),P;t[22]!==N||t[23]!==j?(P=()=>{j&&N()},t[22]=N,t[23]=j,t[24]=P):P=t[24];let F;t[25]===j?F=t[26]:(F=[j],t[25]=j,t[26]=F),(0,Z.useEffect)(P,F);let I=h?.run??null,L=h?.currentHeadSha??null,z=A!==null&&L!==null&&L!==A.headSha,B=I?._tag===`Failed`&&I.headSha===L?I.detail:null,ee;t[27]!==_||t[28]!==g||t[29]!==v?(ee=(e,t)=>_?(0,$.jsxs)(G,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(R,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=ee):ee=t[30];let V=ee;if(A===null){if(m.isPending&&h===null){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-48 items-center justify-center`,children:(0,$.jsx)(vt,{})}),t[31]=e):e=t[31],e}let e=g?`Writing a review guide`:`No review guide yet`,n;t[32]===e?n=t[33]:(n=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),t[32]=e,t[33]=n);let r=B??m.error??(g?`An agent is reading the change. A large one takes a few minutes. You can leave; you will be told when it is ready.`:`A guide is a tour of the change: stops through the code in reading order, with the calls only a maintainer can make.`),i;t[34]===r?i=t[35]:(i=(0,$.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:r}),t[34]=r,t[35]=i);let a=B===null?`Write guide`:`Try again`,o;t[36]!==a||t[37]!==V?(o=V(a,`sm`),t[36]=a,t[37]=V,t[38]=o):o=t[38];let s;return t[39]!==n||t[40]!==i||t[41]!==o?(s=(0,$.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-2 px-4 py-10 text-center`,children:[n,i,o]}),t[39]=n,t[40]=i,t[41]=o,t[42]=s):s=t[42],s}let H;t[43]!==_||t[44]!==B||t[45]!==g||t[46]!==z||t[47]!==V?(H=z||B!==null||g?(0,$.jsxs)(ua,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(Le,{}),(0,$.jsx)(la,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!g&&_?(0,$.jsx)(ca,{children:V(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=B,t[45]=g,t[46]=z,t[47]=V,t[48]=H):H=t[48];let U=H,te;t[49]!==n||t[50]!==a?(te={environmentId:n,cwd:a},t[49]=n,t[50]=a,t[51]=te):te=t[51];let ne;t[52]!==A||t[53]!==l?(ne=l===null?null:(e,t)=>{let n=A.stops[e];n!==void 0&&l(n,e,t)},t[52]=A,t[53]=l,t[54]=ne):ne=t[54];let re;t[55]!==o||t[56]!==U||t[57]!==D||t[58]!==n||t[59]!==A||t[60]!==u||t[61]!==d||t[62]!==r||t[63]!==ne?(re=(0,$.jsx)(hd,{environmentId:n,reference:r,guide:A,banner:U,active:o,commenting:D,onAsk:ne,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=U,t[57]=D,t[58]=n,t[59]=A,t[60]=u,t[61]=d,t[62]=r,t[63]=ne,t[64]=re):re=t[64];let ie;return t[65]!==te||t[66]!==re?(ie=(0,$.jsx)(Ru,{value:te,children:re}),t[65]=te,t[66]=re,t[67]=ie):ie=t[67],ie}function vd(e){return e.removeComment}function yd(e){return e.addComment}function bd(e){let t=(0,Q.c)(12),[n,r]=(0,Z.useState)(null),i=n?.scopeKey===e?n:null,a,o;t[0]!==n||t[1]!==e?(a=()=>{if(!n)return;let t=()=>r(null);if(n.scopeKey!==e){t();return}let i=e=>{e.target instanceof Node&&!n.element.contains(e.target)&&t()},a=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())},o=window.setTimeout(t,3e3);return document.addEventListener(`pointerdown`,i,!0),window.addEventListener(`keydown`,a,!0),window.addEventListener(`blur`,t),()=>{window.clearTimeout(o),document.removeEventListener(`pointerdown`,i,!0),window.removeEventListener(`keydown`,a,!0),window.removeEventListener(`blur`,t)}},o=[n,e],t[0]=n,t[1]=e,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,Z.useEffect)(a,o);let s;t[4]===i?.action?s=t[5]:(s=e=>i?.action===e,t[4]=i?.action,t[5]=s);let c;t[6]!==i||t[7]!==e?(c=(t,n)=>({onClick:a=>{i?.action===t&&i.element===a.currentTarget?(r(null),n()):r({scopeKey:e,action:t,element:a.currentTarget})},onBlur:()=>r(null)}),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l={isArmed:s,props:c},t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var xd={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not turn on auto-merge`,"disable-auto-merge":`Could not turn off auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Sd={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access to the branch — one from a fork also needs its author to allow edits from maintainers — and that it does not conflict with the base.`,"enable-auto-merge":`The host refused it. Check that this repository allows auto-merge, that you have write access, and that there is something left for it to wait on.`,"disable-auto-merge":`The host refused it. Check that you have write access, and that the merge has not already happened.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`},Cd=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,wd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Td=()=>t(()=>import(`./PullRequestCodeTab-TTmg3elC.js`),__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])),Ed=(0,Z.lazy)(Td),Dd=new Map,Od=e=>typeof e==`string`?e:d(e);function kd(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:a,disabled:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(Pe,{}),t[0]=s):s=t[0];let c;t[1]===a?c=t[2]:(c=e=>a(e),t[1]=a,t[2]=c);let l;if(t[3]!==o||t[4]!==n){let e;t[6]===o?e=t[7]:(e=e=>(0,$.jsx)(i,{value:e.environmentId,disabled:o,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(oa,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=o,t[7]=e),l=n.map(e),t[3]=o,t[4]=n,t[5]=l}else l=t[5];let u;return t[8]!==c||t[9]!==l||t[10]!==r?(u=(0,$.jsxs)($.Fragment,{children:[s,(0,$.jsx)(F,{value:r,onValueChange:c,children:l})]}),t[8]=c,t[9]=l,t[10]=r,t[11]=u):u=t[11],u}var Ad=(e,t)=>{e.preventDefault(),e.stopPropagation(),wl({url:t.url,openLabel:Sl(Ir.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function jd(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=K(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=K(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(Le,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Xr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(G,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(Jr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Zr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function Md({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:a=null,reference:s,listEntry:u=null,refreshToken:d=0,onActed:m,onClose:g,context:_=`page`,composerDraftTarget:v,onBack:y,onSelectPullRequest:S,onGuideShown:w}){let T=Ye(),D=Ke(),A=D.find(t=>t.id===s.projectId&&t.environmentId===e),j=A?.repositoryIdentity,M=T.get(e)?.environment.capabilities.threadPullRequests===!0,B=(0,Z.useMemo)(()=>M?mi(s,j):{projectId:s.projectId,repository:s.repository,number:s.number},[s,j,M]),V=`${B.projectId}:${B.host??``}:${B.repository}#${B.number}`,ne=u?.projectId===B.projectId&&u.repository.toLowerCase()===B.repository.toLowerCase()&&(B.host===void 0||u.host.toLowerCase()===B.host.toLowerCase())&&u.number===B.number?u:null,[re,ie]=(0,Z.useState)(!1),[ae,oe]=(0,Z.useState)(0),[W,de]=(0,Z.useState)(`summary`),[fe,pe]=(0,Z.useState)(`newest`),[me,he]=(0,Z.useState)(()=>({pullRequestKey:V,oid:null})),_e=me.pullRequestKey===V?me.oid:null,ve=e=>{he({pullRequestKey:V,oid:e})},ye=e=>{ve(e),de(`code`)},[Te,Ee]=(0,Z.useState)(null),De=e=>{ve(null),Ee(t=>({path:e,nonce:(t?.nonce??0)+1})),Td(),de(`code`)},Oe=Wi(t=>t.openRequestKey===Ki(e,B));Oe&&W!==`guide`&&de(`guide`),(0,Z.useEffect)(()=>{Oe&&Wi.getState().requestOpen(null)},[Oe]);let ke=`${e}:${V}`,[Ae,Me]=(0,Z.useState)(()=>({key:ke,tabs:new Set([`summary`])})),Ne=Ae.key===ke?Ae.tabs:new Set([W]);(0,Z.useEffect)(()=>{Me(e=>e.key===ke?e.tabs.has(W)?e:{key:ke,tabs:new Set(e.tabs).add(W)}:{key:ke,tabs:new Set([W])})},[W,ke]);let[Fe,Le]=(0,Z.useState)(!1),Re=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Le(Re.current[W]??!1)},[W]);let ze=Fe,Be=(0,Z.useRef)({}),Ve=(0,Z.useMemo)(()=>({summary:e=>{Be.current.summary=e},timeline:e=>{Be.current.timeline=e},code:e=>{Be.current.code=e}}),[]),He=(0,Z.useRef)(null),Ue=(0,Z.useRef)(null),qe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=qe.current;e!==null&&(qe.current=null,ze&&e.tab===W&&Be.current[W]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[ze,W]);let Je=Xi(e=>e.pullRequestMergeMethod),Xe=Xi(e=>e.setPullRequestMergeMethod),$e=wa(e,B.projectId),tt=(0,Z.useMemo)(()=>$e(),[$e]),[nt,rt]=(0,Z.useState)(null),it=e=>{rt({pullRequestKey:V,method:e})},at=bd(V),[ot,st]=(0,Z.useState)(null),lt=Dt(e,xe),ut=kt(Gr.detail({environmentId:e,input:B})),dt=kt(Gr.activity({environmentId:e,input:B})),ft=Vr(e),[pt,mt]=(0,Z.useState)(()=>oi(typeof window>`u`?void 0:window.localStorage,e,B));(0,Z.useEffect)(()=>{mt(oi(typeof window>`u`?void 0:window.localStorage,e,B))},[e,V,B.projectId,B.repository,B.number]),(0,Z.useEffect)(()=>{ut.data!==null&&(gi(typeof window>`u`?void 0:window.localStorage,e,B,ut.data),mt(ut.data))},[ut.data,e,V,B.projectId,B.repository,B.number]);let ht=$r({live:ut.data,cached:pt,reference:B}),gt=(0,Z.useMemo)(()=>ne===null?null:Hr(ne),[ne]),_t=(0,Z.useMemo)(()=>ut.data===null?null:{...ut.data,checksState:Er(ut.data.checks)},[ut.data]),vt=Kr(e,B,_t,ut.dataUpdatedAt),bt=(0,Z.useMemo)(()=>Wr(ht,Wr(vt,gt)),[ht,vt,gt]),wt=(0,Z.useMemo)(()=>ht===null||bt===null||bt===ht?ht:{...ht,title:bt.title,state:bt.state,headBranch:bt.headBranch,baseBranch:bt.baseBranch,updatedAt:bt.updatedAt,author:bt.author??ht.author,additions:bt.additions??ht.additions,deletions:bt.deletions??ht.deletions,changedFiles:bt.changedFiles??ht.changedFiles,mergeability:bt.mergeability??ht.mergeability,closedAt:bt.closedAt===void 0?ht.closedAt:bt.closedAt,mergedAt:bt.mergedAt===void 0?ht.mergedAt:bt.mergedAt,isDraft:bt.isDraft??ht.isDraft},[ht,bt]),Mt=dt.data,X=(0,Z.useMemo)(()=>wt===null?null:{...wt,capabilities:lt?wt.capabilities:{...wt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:lt?wt.viewerPermissions:{...wt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:Mt?.author??wt.author,reviewers:Mt?.reviewers??wt.reviewers,comments:Mt?.comments??[],commentCount:Mt?.commentCount??0,commentsTruncated:Mt?.commentsTruncated??!1,reviewThreads:Mt?.reviewThreads??[],commits:Mt?.commits??[],reactions:Mt?.reactions??[]},[Mt,lt,wt]),Pt=X??bt,Ft=z(Et),{copyToClipboard:It}=xt({target:`pull request reference`,onCopy:e=>yt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>yt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),Lt=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||Sa()||lr(e,Ft,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||It(`#${B.number}`,`PR number`))});(0,Z.useEffect)(()=>{let e=e=>Lt(e);return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Z.useEffect)(()=>{X?.autoMergeMethod!==void 0&&it(X.autoMergeMethod)},[X?.autoMergeMethod,V]);let Rt=X===null?null:Ze(X.url),zt=Ir.get(X?.provider),Bt=(0,Z.useMemo)(()=>({repositoryUrl:Rt===null?null:zt.referenceAutolinkRepositoryUrl(Rt),threadRef:a}),[zt,Rt,a]),Vt=X?.author&&Rt!==null?zt.authorProfileUrl(X.author.login,Rt):null,Ht=Pt?si(Pt.provider,Pt.number,Pt.headBranch,X?.headRepositoryNameWithOwner,Ze(Pt.url)):ni(B,j),Ut=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Wt=kt(X===null?null:Nt.listRefs({environmentId:e,input:{cwd:X.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Gt=X!==null&&Ii(X.baseBranch,Wt.data?.refs??[]),Kt=xc(e,(0,Z.useMemo)(()=>X===null||X.capabilities.stacks!==!0||!M?null:{...B,host:B.host??Qe(X.url)?.host},[X,B,M])),qt=Kt.data,Jt=M&&X?.capabilities.stacks===!0&&X.capabilities.stackActions===!0&&T.get(e)?.environment.capabilities.pullRequestStackActions===!0,Yt=Mi({supportsStackActions:Jt,hasStack:qt!==null,stackPending:!Kt.isFresh,stackError:Kt.error}),Xt=dt.isPending&&Mt===null,Zt=Mt===null?dt.error:null,Qt=(0,Z.useCallback)(()=>{ut.refresh(),dt.refresh(),Kt.refresh()},[dt.refresh,ut.refresh,Kt.refresh]),[$t,en]=(0,Z.useState)(0),tn=$t+(ft??0),nn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!wt)return;let e={key:ke,updatedAt:wt.updatedAt};if(ai(nn.current,e)){if(dt.isPending)return;dt.refresh(),en(e=>e+1)}nn.current=e},[dt.isPending,dt.refresh,wt,ke]),Fc(()=>{ut.refresh()},{key:`pull-request:${e}:${V}`});let rn=At(Gr.invalidate,{reportFailure:!1}),[an,on]=(0,Z.useState)(!1),sn=an||ut.isPending,cn=(0,Z.useCallback)(async()=>{on(!0);try{await rn({environmentId:e,input:{reference:B}}),Qt(),en(e=>e+1)}finally{on(!1)}},[e,rn,B,Qt]),ln=(0,Z.useRef)(d);(0,Z.useEffect)(()=>{ln.current!==d&&(ln.current=d,cn())},[d,cn]);let un=At(Gr.runAction,{reportFailure:!1}),dn=At(Gr.comment,{reportFailure:!1}),[fn,pn]=(0,Z.useState)(null),mn=fn!==null,hn=At(Gr.update,{reportFailure:!1}),[gn,_n]=(0,Z.useState)(null),vn=gn?.pullRequestKey===V?gn.text:null,[yn,bn]=(0,Z.useState)(!1),xn=aa(),{environments:Sn}=St(),Cn=(0,Z.useMemo)(()=>{let t=D.find(t=>t.id===B.projectId&&t.environmentId===e)?.repositoryIdentity;return et(t,B.repository,B.number)},[e,D,B.number,B.projectId,B.repository]),wn=(0,Z.useMemo)(()=>_===`page`?vc({environmentId:e,projectId:B.projectId},D,Sn.map(e=>({environmentId:e.environmentId,label:e.label,machine:Se(e.serverConfig)}))):[],[_,e,Sn,D,B.projectId]),[Tn,Dn]=(0,Z.useState)(null),On=Tn?.pullRequestKey===V?Tn.environmentId:e,kn=wn.find(e=>e.environmentId===On)??null,An=kn?.environmentId??e,jn=kn?.workspaceRoot??X?.workspaceRoot??A?.workspaceRoot??null,Mn=Dt(An,r),Nn=Ta({environmentId:An,cwd:jn}),Pn=async(t,n,r)=>{m?.(t,`sent`);let i=await un({environmentId:e,input:{...B,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(pn(null),i._tag===`Failure`){let e=Ge(i),n=r===`rebase`?Cd:Sd[t];return yt.add({type:`error`,title:xd[t],description:di(e,n)}),m?.(t,`failed`),!1}return t===`revert`&&yt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&yt.add({type:`success`,title:`Branch deleted`}),Ei(t)?cn():Qt(),m?.(t,`done`),!0},Fn=async(e,t,n)=>!lt||fn!==null?!1:(pn(e),Pn(e,t,n)),In=async(t,n)=>!lt||fn!==null?{commentPosted:!1}:(pn(n),(await dn({environmentId:e,input:{...B,body:t}}))._tag===`Failure`?(pn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Pn(n)||Qt(),{commentPosted:!0})),Ln=async t=>{let n=t.trim();if(!lt||X===null||yn)return;if(n.length===0||n===X.title){_n(null);return}bn(!0);let r=await hn({environmentId:e,input:{...B,title:n}});if(bn(!1),r._tag===`Failure`){yt.add({type:`error`,title:`The title could not be saved`,description:di(Ge(r),`The host refused the new title.`)});return}_n(null),Qt()},Rn=v??null,zn=Nn.isAllowed&&Mn,Bn=Rn!==null||zn,Vn=ui(Rn!==null),Hn=gd({environmentId:e,reference:B,title:X?.title??null}),Wn=()=>{Hn.write(),Hn.data?.guide??de(`guide`)},Gn=(e,t)=>{let n=p.getState(),r=n.getComposerDraft(e),i=Od(e),a=new Set((r?.reviewComments??[]).map(e=>e.id)),o=new Set((t.reviewComments??[]).filter(e=>a.has(e.id)).map(e=>e.id)),s=ji(r?.prompt??``,r?.reviewComments??[],o),c=Li({prompt:s,lastHandoffPrompt:Dd.get(i)},t.prompt);Dd.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,bi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Kn=async(e,t,n)=>{let r=n??await xn(e).then(e=>e,()=>null);return r===null?null:(t===null||Gn(r.draftId,t),r)},qn=async(t,n,r)=>{if(!X||ot!==null)return;if(Rn!==null){Gn(Rn,n),yt.add({type:`success`,title:`Added to the composer`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`});return}st(t);let i=O(An,kn?.projectId??X.projectId),a=await Kn(i,n);if(st(null),a!==null&&r?.keepGuide===!0){let t=p.getState().getDraftSession(a.draftId);t!==null&&(jt.getState().openPullRequest(I(t.environmentId,t.threadId),{environmentId:e,projectId:B.projectId,...B.host===void 0?{}:{host:B.host},repository:B.repository,number:B.number,url:X.url}),Wi.getState().requestOpen(Ki(e,B)))}if(a===null){yt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}yt.add({type:`success`,title:`Asked in a thread`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},Jn=async(e,t,n=`worktree`)=>{if(!Pt||ot!==null)return;if(Rn!==null&&t!==null){Gn(Rn,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(jn===null||!Nn.isAllowed||!Ot(An,`source-control:write`)||n===`worktree`&&!Ot(An,`orchestration:operate`))return;st(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=O(An,kn?.projectId??Pt.projectId),a=await xn(i).then(e=>e,()=>null);if(a===null){st(null),yt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Nn.run({reference:Pt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){st(null);let e=Nn.error instanceof Error?Nn.error.message:null;yt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await xn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){st(null),yt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}st(null);let s={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:s);return}await Kn(i,t,a),yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s)},Yn=()=>{X&&qn(`ask`,{...ki({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Xn=()=>{X&&qn(`explain`,{...Ni({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Zn=(e,t,n)=>{X&&qn(`guide-stop:${t}`,yi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},Qn=(e,t)=>{X&&qn(`selection:${e.comment.id}`,Ti({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,comment:e.comment,request:e.request}),t)},$n=e=>{Pt&&Jn(`checkout:${e}`,null,e)},er=e=>{X&&Jn(ci(e),xi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,finding:e}))},tr=()=>{X&&Jn(`findings`,Oi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,reviewThreads:X.reviewThreads,comments:X.comments,checks:Dr?[]:X.checks,commentsTruncated:X.commentsTruncated}))},nr=()=>{Pt&&Jn(`conflicts`,{prompt:Ci({number:Pt.number,url:Pt.url,headBranch:Pt.headBranch,baseBranch:Pt.baseBranch})})},rr=X?X.capabilities.mergeMethods.filter(e=>X.mergeCapabilities[e]):[],ir=nt?.pullRequestKey===V?nt.method:null,ar=hi(rr,ir,tt,Je),or=Pi[ar],sr=`Auto-merge (${or.toLowerCase()})`,cr=X?.state===`open`&&X.mergeability===`conflicting`,dr=X?.state===`open`&&X.autoMergeEnabled===!0,fr=X?.autoMergeMethod,pr=fr?`Auto-merge (${Pi[fr].toLowerCase()})`:`Auto-merge`,mr=X?.state===`open`?X.workflowApprovalsRequired??0:0,hr=X===null?null:Ri(X),gr=Tt(e,e=>e.reviewGuidesEnabled),_r=wd.filter(e=>(e.value!==`code`||X===null||X.capabilities.diff)&&(e.value!==`guide`||gr));(0,Z.useEffect)(()=>{_r.some(e=>e.value===W)||de(`summary`)},[W,_r]);let vr=e=>X?.capabilities.actions.includes(e)===!0&&X.viewerPermissions.actions.includes(e),Sr=X?Er(X.checks):null,Cr=bt?.checksState===void 0?Sr:bt.checksState,Tr=Cr!==`failing`&&X?.checks.some(e=>e.status===`action-required`)?`pending`:Cr,Dr=Tr!==Sr,kr=X?ri({state:X.state,isDraft:X.isDraft,mergeability:X.mergeability,checksState:Tr,autoMergeEnabled:X.autoMergeEnabled,hasMergeMethod:rr.length>0,canMerge:Yt&&vr(`merge`),canMarkReady:vr(`ready`),canEnableAutoMerge:Yt&&vr(`enable-auto-merge`)}):null,jr=X?.state===`open`&&vr(X.isDraft?`ready`:`draft`)&&!(X.isDraft&&kr===`ready`),Mr=Yt&&X?.state===`open`&&(dr&&vr(`disable-auto-merge`)||!dr&&kr!==`enable-auto-merge`&&!X.isDraft&&!cr&&vr(`enable-auto-merge`)&&rr.length>0),Nr=Yt&&X?.state===`open`&&(kr===`enable-auto-merge`||kr===`auto-merge-armed`)&&vr(`merge`)&&!X.isDraft&&!cr&&rr.length>0,Lr=X?.state===`open`&&vr(`merge`)&&!X.isDraft&&!cr&&rr.length>1,zr=X?yr({state:X.state,isDraft:X.isDraft}):null,Br=X!==null&&Ai(X),Ur=Sn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),qr=async()=>{X!==null&&await Ct()?.dialogs.confirm([`Delete branch ${X.headBranch}?`,`This deletes ${X.headBranch} from ${X.headRepositoryNameWithOwner??X.repository}. Local branches and worktrees are not changed.`].join(`
215
215
  `),{variant:`destructive`})&&Fn(`delete-branch`)},Jr=mr>0&&!Dr&&vr(`approve-workflows`),Yr=Dr?Tr===null?`No checks reported`:wr(Tr).label:X?Pr(X.checks):null,Xr=X&&!X.commentsTruncated?pi(X.comments,X.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,Zr=_===`page`?(0,$.jsxs)(x,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(we,{disabled:ot!==null||jn===null,render:(0,$.jsxs)(G,{size:`xs`,variant:`outline`,"aria-label":ot?.startsWith(`checkout`)?`Checking out...`:`Check out`,children:[(0,$.jsx)(P,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[35rem]/pr-header:hidden`,children:ot?.startsWith(`checkout`)?`Checking out...`:`Check out`}),(0,$.jsx)(ce,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(J,{children:`Check out this pull request`})]}),(0,$.jsxs)(te,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(U,{disabled:!zn,onClick:()=>$n(`worktree`),children:[(0,$.jsx)(P,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:`In a separate worktree`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Its own folder and thread. Nothing you have open moves.`})]})]}),(0,$.jsxs)(U,{disabled:!Nn.isAllowed,onClick:()=>$n(`local`),children:[(0,$.jsx)(b,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:`In this repository`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:"Switches the branch you are working in, like `gh pr checkout`."})]})]}),wn.length>0?(0,$.jsx)(kd,{environments:wn,value:An,onChange:e=>Dn({pullRequestKey:V,environmentId:e}),disabled:ot!==null}):null]})]}):null,ei=(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`destructive-outline`,disabled:ot!==null||Rn===null&&jn===null,onClick:nr,"aria-label":ot===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(Rr.conflicting,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:ot===`conflicts`?`Preparing...`:`Resolve conflicts`})]})})}),(0,$.jsx)(J,{side:`top`,children:ot===`conflicts`?`Preparing...`:`Resolve conflicts`})]});return ut.isPending&&!X?(0,$.jsx)(fl,{seed:ne,summary:bt,checkoutCommand:Ht,onCheckoutError:Ut,number:B.number,tabs:_r,activeTab:W,...y?{onBack:y}:{},...g?{onClose:g}:{},actions:Pt?(0,$.jsxs)(ct,{delay:150,closeDelay:150,timeout:400,children:[Pt.state===`open`&&Pt.mergeability===`conflicting`?ei:null,Zr]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[re&&X?(0,$.jsx)(Xc,{display:`picker`,environmentId:e,reference:B,url:X.url,threadRef:null,onPickerOpenChange:ie},`${e}:${X.url}`):null,(0,$.jsxs)(`div`,{className:K(`@container/pr-header grid min-w-0 shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2`,X&&`border-b border-border/60`,!X&&!g&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":ze,inert:ze,className:K(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,ze?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:X&&zr?(0,$.jsxs)($.Fragment,{children:[y?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,onClick:y,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(l,{"aria-hidden":!0,className:`size-3.5`})})}),(0,$.jsx)(J,{side:`top`,children:`Back to pull requests`})]}):null,(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:Rt?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(Rt),className:`min-w-0 cursor-pointer truncate text-left font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:X.repository}):(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:X.repository})}),(0,$.jsx)(J,{side:`top`,children:Rt?`Open ${X.repository} repository`:X.repository})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(X.url),onContextMenu:e=>Ad(e,X),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,zr.toneClassName),"aria-label":`Open pull request #${X.number} on host`,children:[`#`,X.number,(0,$.jsx)(c,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:Sl(zt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!ze,inert:!ze,className:K(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,ze?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:X&&zr?(0,$.jsxs)($.Fragment,{children:[y?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:ze?0:-1,onClick:y,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(l,{"aria-hidden":!0,className:`size-3.5`})})}),(0,$.jsx)(J,{side:`top`,children:`Back to pull requests`})]}):null,(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,tabIndex:ze?0:-1,onClick:()=>void Ct()?.shell.openExternal(X.url),onContextMenu:e=>Ad(e,X),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,zr.toneClassName),"aria-label":`Open pull request #${X.number} on host`,children:[`#`,X.number,(0,$.jsx)(c,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:Sl(zt)})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:X.title})}),(0,$.jsx)(J,{side:`top`,children:X.title})]})]}):null})]}),(0,$.jsxs)(`div`,{className:`mr-4 flex h-7 shrink-0 items-center justify-end gap-1`,children:[X?(0,$.jsxs)(ct,{delay:150,closeDelay:150,timeout:400,children:[!qt&&Jt&&Kt.error?(0,$.jsx)(G,{variant:`ghost`,size:`xs`,onClick:Kt.refresh,children:`Retry stack lookup`}):null,qt?(0,$.jsx)(zc,{hostLabel:zt.label,stack:qt,notice:Kt.notice,onRetry:Kt.error?Kt.refresh:void 0,reference:B,environmentId:e,onSelect:S,mergeMethod:ar,canMerge:Kt.isFresh&&Jt&&vr(`merge`)&&rr.length>0,canRebase:Kt.isFresh&&Jt&&X.viewerPermissions.stackRebase===!0,onActed:()=>{Qt(),m?.()}}):null,_===`page`?(0,$.jsx)(Xc,{display:`count`,environmentId:e,reference:B,url:X.url,threadRef:null}):null,dr&&kr!==`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(H,{size:`control`,variant:`info`,role:`img`,"aria-label":pr,children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:pr})]})}),(0,$.jsxs)(J,{side:`top`,children:[pr,`: the host will merge this on its own once its requirements are met`]})]}):null,kr===`resolve`?ei:kr===`ready`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:mn,onClick:()=>void Fn(`ready`),"aria-label":`Ready for review`,children:[(0,$.jsx)(Rr.pullRequest,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:`Ready for review`})]})})}),(0,$.jsx)(J,{side:`top`,children:`Ready for review`})]}):kr===`enable-auto-merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:mn,...at.props(`enable-auto-merge`,()=>void Fn(`enable-auto-merge`,ar)),"aria-label":fn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:sr,children:[at.isArmed(`enable-auto-merge`)?(0,$.jsx)(o,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Cc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:sr}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:sr})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:sr})]}):kr===`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(H,{size:`control`,variant:`info`,role:`img`,"aria-label":pr,children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:pr})]})}),(0,$.jsxs)(J,{side:`top`,children:[pr,`: the host will merge this on its own once its requirements are met`]})]}):kr===`merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:mn,...at.props(`merge`,()=>void Fn(`merge`,ar)),"aria-label":fn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:or,children:[at.isArmed(`merge`)?(0,$.jsx)(o,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Cc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:or}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:or})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:or})]}):(kr===`merged`||kr===`closed`)&&zr!==null?(0,$.jsx)(H,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:K(`flex items-center gap-1`,zr.toneClassName),children:[(0,$.jsx)(zr.Icon,{className:`size-3.5`}),zr.label]})}):null,Zr,(0,$.jsxs)(x,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(we,{render:(0,$.jsx)(G,{"aria-label":sn?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:sn?(0,$.jsx)(xa,{refreshing:!0,size:`md`}):(0,$.jsx)(C,{className:`size-4`})})}),(0,$.jsx)(J,{children:sn?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(te,{align:`end`,side:`bottom`,children:[(0,$.jsx)(Xc,{display:`menu-item`,environmentId:e,reference:B,url:X.url,threadRef:a??(typeof v==`object`?v:null),onPickerOpenChange:ie}),(0,$.jsxs)(U,{disabled:sn,onClick:()=>void cn(),children:[(0,$.jsx)(xa,{size:`sm`,refreshing:sn}),`Refresh`]}),(0,$.jsxs)(U,{disabled:ot!==null,onClick:Yn,children:[(0,$.jsx)(E,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:ot===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Rn===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(U,{disabled:ot!==null,onClick:Xn,children:[(0,$.jsx)(ee,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:ot===`explain`?`Opening...`:`Explain this PR`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`A walk through the diff and what to read closely.`})]})]}),(0,$.jsxs)(U,{disabled:ot!==null||!Bn,onClick:tr,children:[(0,$.jsx)(Ie,{className:`size-3.5`}),ot===`findings`?`Preparing...`:Vn.fixFindings]}),gr&&Hn.canWrite?(0,$.jsxs)(U,{disabled:Hn.running,onClick:Wn,children:[(0,$.jsx)(R,{className:`size-3.5`}),Hn.running?`Writing guide...`:Hn.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,wn.length>0?(0,$.jsx)(kd,{environments:wn,value:An,onChange:e=>Dn({pullRequestKey:V,environmentId:e}),disabled:ot!==null}):null,(0,$.jsx)(Pe,{}),X.state===`open`?(0,$.jsxs)($.Fragment,{children:[jr?(0,$.jsxs)(U,{disabled:mn,onClick:()=>void Fn(X.isDraft?`ready`:`draft`),children:[X.isDraft?(0,$.jsx)(Rr.pullRequest,{className:`size-3.5`}):(0,$.jsx)(Rr.draft,{className:`size-3.5`}),X.isDraft?`Ready for review`:`Convert to draft`]}):null,Nr?(0,$.jsxs)(U,{closeOnClick:at.isArmed(`merge`),"aria-label":at.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:mn,...at.props(`merge`,()=>void Fn(`merge`,ar)),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),at.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,dr&&vr(`disable-auto-merge`)?(0,$.jsxs)(U,{disabled:mn,onClick:()=>void Fn(`disable-auto-merge`),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),`Disable auto-merge`]}):Mr?(0,$.jsxs)(U,{closeOnClick:at.isArmed(`enable-auto-merge`),"aria-label":at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`,disabled:mn,...at.props(`enable-auto-merge`,()=>void Fn(`enable-auto-merge`,ar)),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Lr?(0,$.jsxs)($.Fragment,{children:[jr||Nr||Mr?(0,$.jsx)(Pe,{}):null,(0,$.jsx)(F,{value:ar,onValueChange:e=>{let t=e;it(t),Xe(t)},children:rr.map(e=>(0,$.jsx)(i,{value:e,disabled:mn,closeOnClick:!0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Pi[e]})]})},e))})]}):null,Qr(jr,Mr||Nr,Lr)?(0,$.jsx)(Pe,{}):null]}):null,(0,$.jsxs)(U,{onClick:()=>void Ct()?.shell.openExternal(X.url),children:[(0,$.jsx)(k,{className:`size-3.5`}),Sl(zt)]}),(0,$.jsxs)(U,{onClick:()=>It(X.url,`PR link`),children:[(0,$.jsx)(L,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(be,{children:ur(Ft,`thread.copyReference`)})]}),(0,$.jsxs)(U,{onClick:()=>It(`#${B.number}`,`PR number`),children:[(0,$.jsx)(f,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(be,{children:ur(Ft,`pullRequest.copyNumber`)})]}),X.state===`open`&&vr(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Pe,{}),(0,$.jsxs)(U,{closeOnClick:at.isArmed(`close`),"aria-label":at.isArmed(`close`)?`Confirm close?`:`Close pull request`,variant:`destructive`,disabled:mn,...at.props(`close`,()=>void Fn(`close`)),children:[(0,$.jsx)(Rr.closed,{className:`size-3.5`}),at.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):X.state===`closed`&&vr(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Pe,{}),(0,$.jsxs)(U,{disabled:mn,onClick:()=>void Fn(`reopen`),children:[(0,$.jsx)(Rr.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):X.state===`merged`&&vr(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Pe,{}),(0,$.jsxs)(U,{closeOnClick:at.isArmed(`revert`),"aria-label":at.isArmed(`revert`)?`Confirm revert?`:`Revert changes`,variant:at.isArmed(`revert`)?`destructive`:`default`,disabled:mn,...at.props(`revert`,()=>void Fn(`revert`)),children:[(0,$.jsx)(h,{className:`size-3.5`}),at.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null,Br?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Pe,{}),(0,$.jsxs)(U,{variant:`destructive`,disabled:mn||!Ur,onClick:()=>void qr(),children:[(0,$.jsx)(je,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:fn===`delete-branch`?`Deleting branch...`:`Delete branch`}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:Ur?X.headBranch:`Reconnect to delete this branch`})]})]})]}):null]})]})]}):null,g?(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:g,children:(0,$.jsx)(Ce,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,ze?`grid-rows-[1fr]`:`grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ue,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,ze?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!ze,children:X?(0,$.jsx)(`div`,{className:`col-span-2 min-w-0 px-4 pb-2 pt-1`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 shrink items-center gap-1.5 overflow-hidden text-xs text-muted-foreground`,children:[(0,$.jsx)(Ar,{actor:X.author,profileUrl:Vt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:En(X.updatedAt)})]}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-3 w-px shrink-0 bg-border/70`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 font-mono text-2xs text-muted-foreground/65`,children:[hr?(0,$.jsxs)(jd,{baseBranch:X.baseBranch,freshness:hr,pending:mn,onUpdate:e=>void Fn(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Gt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(va,{value:X.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Gt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(va,{value:X.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Gt?`Stacked on ${X.baseBranch}`:X.baseBranch})]}),(0,$.jsx)(l,{"aria-label":`receives changes from`,className:`size-3 shrink-0 opacity-60`}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`code`,{className:`flex min-w-0 flex-1`,children:(0,$.jsx)(va,{value:X.headBranch,showTitle:!1})})}),(0,$.jsx)(J,{side:`top`,children:X.headBranch})]})]}),(0,$.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center justify-end gap-2 text-2xs`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 tabular-nums`,"aria-label":`${X.changedFiles.toLocaleString()} changed ${X.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(N,{"aria-hidden":!0,className:`size-3`}),X.changedFiles.toLocaleString()]}),(0,$.jsx)(Or,{additions:X.additions,deletions:X.deletions,className:`shrink-0 font-mono text-2xs`})]})]})}):null})}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,ze?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:He,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,ze?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:ze,children:X?(0,$.jsx)(tl,{title:vn===null?(0,$.jsxs)(nl,{className:`group gap-1`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold leading-snug`,children:X.title})}),(0,$.jsx)(J,{side:`top`,children:X.title})]}),xs(X)?(0,$.jsx)(ws,{"aria-label":`Edit title`,onClick:()=>_n({pullRequestKey:V,text:X.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Un,{autoFocus:!0,size:`sm`,disabled:yn,value:vn,"aria-label":`Pull request title`,onChange:e=>_n({pullRequestKey:V,text:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Ln(vn)):e.key===`Escape`&&(e.preventDefault(),_n(null))}}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(G,{size:`xs`,variant:`ghost`,disabled:yn,onClick:()=>_n(null),children:`Cancel`}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,disabled:!lt||yn||vn.trim().length===0,onClick:()=>void Ln(vn),children:yn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(Ar,{actor:X.author,profileUrl:Vt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,En(X.updatedAt)]}),checkout:Ht?(0,$.jsx)(al,{value:Ht,target:`pull request checkout command`,copyLabel:`Copy checkout command`,copiedLabel:`Checkout command copied`,className:`ml-auto font-mono`,tooltipSide:`bottom`,onError:Ut},Ht):null,base:hr?(0,$.jsxs)(jd,{baseBranch:X.baseBranch,freshness:hr,pending:mn,onUpdate:e=>void Fn(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Gt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(va,{value:X.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Gt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(va,{value:X.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Gt?`Stacked on ${X.baseBranch}`:X.baseBranch})]}),head:(0,$.jsx)(al,{value:X.headBranch,target:`branch name`,copyLabel:`Copy pull request branch`,copiedLabel:`Branch name copied`},X.headBranch),files:`${X.changedFiles.toLocaleString()} ${X.changedFiles===1?`file`:`files`}`,diffStat:(0,$.jsx)(Or,{additions:X.additions,deletions:X.deletions,className:`shrink-0 font-mono text-xs`})}):null})}),X?(0,$.jsx)(rl,{tabs:_r,value:W,onValueChange:de,onTabIntent:e=>{e===`code`&&Td()},children:W===`summary`?Jr?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`ml-auto inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`warning-outline`,disabled:mn,...at.props(`approve-workflows`,()=>void Fn(`approve-workflows`)),"aria-label":fn===`approve-workflows`?`Approving...`:at.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`,children:[(0,$.jsx)(ue,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsxs)(`span`,{className:`inline-grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:`Approve workflows to run`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:`Confirm approve?`}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`approve-workflows`?`Approving...`:at.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`approve-workflows`?`Approving...`:at.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]}):(0,$.jsx)(il,{className:`text-muted-foreground`,"aria-label":Yr?`Checks: ${Yr}`:`Checks`,icon:Tr===null?(0,$.jsx)(se,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Pu,{checks:X.checks,stale:Dr,checksState:Tr,threadRef:a}),label:Yr}):W===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(br,{className:K(`whitespace-nowrap text-2xs transition-opacity`,(Xt||Zt)&&`opacity-35`),children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Zt?`Comments unavailable`:`${X.commentCount.toLocaleString()} ${X.commentCount===1?`comment`:`comments`}`,children:[(0,$.jsx)(We,{"aria-hidden":!0,className:`size-3`}),Zt?`—`:Xt?`…`:X.commentCount.toLocaleString()]}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Zt?`Commits unavailable`:`${X.commits.length.toLocaleString()} ${X.commits.length===1?`commit`:`commits`}`,children:[(0,$.jsx)(le,{"aria-hidden":!0,className:`size-3`}),Zt?`—`:Xt?`…`:X.commits.length.toLocaleString()]}),Xr>0?(0,$.jsxs)(`span`,{className:K(`inline-flex items-center gap-1`,Fr(`approved`)),children:[(0,$.jsx)(xr,{outcome:`approved`,className:`size-3`}),Xr.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:Xr===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(G,{size:`xs`,variant:`ghost-muted`,"aria-label":fe===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>pe(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(ge,{"aria-hidden":!0,className:`size-3`}),fe===`newest`?`Newest first`:`Oldest first`]})]}):null}):null]}),(0,$.jsx)(`div`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,onScrollCapture:e=>{let t=Be.current[W];if(e.target!==t||t==null)return;let n=t.scrollTop;Le(e=>{let r=e,i=He.current?.scrollHeight??0,a=i-(Ue.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(qe.current={tab:W,scroller:t,delta:-a},r=!0),Re.current[W]=r,r})},children:ut.error&&!X?(0,$.jsx)(xl,{...fi(ut.failure)?{title:`Pull request #${B.number} not found`,error:`It may be an issue rather than a pull request, or this account can't see it.`}:{error:ut.error},refreshing:ut.isPending,onRetry:Qt,...Cn?{gitHubUrl:Cn}:{}}):X?(0,$.jsxs)(Gs,{value:Bt,children:[Ne.has(`summary`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`summary`&&`invisible`),children:(0,$.jsx)(au,{scrollerRef:Ve.summary,environmentId:e,threadRef:a,reference:B,detail:X,activityPending:Xt,checksStale:Dr,activityError:Zt,pendingFinding:ot,fixFindingLabel:Vn.fixFinding,fixCheckLabel:Vn.fixCheck,...Bn?{onFixFinding:er}:{},onRefresh:Qt,onRefreshChecks:cn})}):null,Ne.has(`guide`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`guide`&&`invisible`),children:(0,$.jsx)(_d,{environmentId:e,reference:B,active:W===`guide`,title:X.title,workspaceRoot:X.workspaceRoot,canComment:X.capabilities.review.inlineComment&&X.viewerPermissions.comment,onAskAboutLines:(e,t)=>Qn({comment:e,request:t},{keepGuide:!0}),onAskAboutStop:Zn,onFinishReview:X.capabilities.review.verdicts.some(e=>X.viewerPermissions.verdicts.includes(e))?()=>oe(e=>e+1):null,onOpenFile:De,onTourShown:w})}):null,Ne.has(`timeline`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`timeline`&&`invisible`),children:Xt?(0,$.jsx)(gl,{}):Zt?(0,$.jsx)(bl,{error:Zt,onRetry:dt.refresh}):(0,$.jsx)(Ou,{scrollerRef:Ve.timeline,detail:X,environmentId:e,threadRef:a,reference:B,order:fe,onOpenCommit:ye,onRefresh:Qt})}):null,Ne.has(`code`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Mo,{label:`Loading pull request diff...`}),children:(0,$.jsx)(Ed,{scrollerRef:Ve.code,onAddToAgentSelection:Qn,environmentId:e,reference:B,detail:X,selectedCommitOid:_e,onSelectedCommitChange:ve,pendingFinding:ot,fixFindingLabel:Vn.fixFinding,...Bn?{onFixFinding:er}:{},onRefresh:Qt,refreshToken:tn,revealRequest:Te})})}):null]}):null}),X?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(Nl,{environmentId:e,reference:B,detail:X,actionPending:mn,onCommentAction:In,onCommented:Qt,onReviewSubmitted:Qt,openReviewRequest:ae},JSON.stringify([e,B.projectId,B.host,B.repository,B.number]))}):null]})}function Nd(e){let t=(0,Q.c)(36),{entry:n,hostActions:r,visible:i,onActed:a,closing:o,sweeping:s,onCloseSweepStart:c}=e,l=o!==void 0&&o,u=s!==void 0&&s,d;t[0]===n.environmentId?d=t[1]:(d=Gr.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=d);let f=z(d),p=wa(n.environmentId,n.projectId),m;t[2]!==n.host||t[3]!==n.number||t[4]!==n.projectId||t[5]!==n.repository?(m={projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},t[2]=n.host,t[3]=n.number,t[4]=n.projectId,t[5]=n.repository,t[6]=m):m=t[6];let h=m,g;t[7]!==n||t[8]!==a?(g=e=>a?.({entry:n,action:e}),t[7]=n,t[8]=a,t[9]=g):g=t[9];let _;t[10]===p?_=t[11]:(_=e=>{let t=e.capabilities.mergeMethods.filter(t=>e.mergeCapabilities[t]);if(t.length===0)throw Error(`No merge method is available for this repository.`);return hi(t,null,p(),Xi.getState().pullRequestMergeMethod)},t[10]=p,t[11]=_);let v;t[12]!==n.environmentId||t[13]!==h||t[14]!==g||t[15]!==_?(v={environmentId:n.environmentId,reference:h,onSuccess:g,resolveMergeMethod:_},t[12]=n.environmentId,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let{actionPending:y,perform:b}=Ea(v),x,S;if(t[17]!==y||t[18]!==f||t[19]!==l||t[20]!==n||t[21]!==r||t[22]!==c||t[23]!==b||t[24]!==u||t[25]!==i){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Ur(n,r),a=y||l||u;if(e.length===0){S=null;break bb0}let o=i||a?`flex`:`none`,s;t[28]===o?s=t[29]:(s={display:o},t[28]=o,t[29]=s);let d;t[30]!==a||t[31]!==f||t[32]!==n||t[33]!==c||t[34]!==b?(d=e=>{let t=Pd[e].label,r=Pd[e].Icon;return(0,$.jsxs)(Y,{children:[(0,$.jsxs)(q,{render:(0,$.jsx)(G,{variant:e===`close`?`destructive-outline`:`outline`,size:`xs`,disabled:!f||a||e===`merge`&&n.stack!==void 0,"aria-label":`${t} #${n.number}`,onClick:()=>void b(e),onPointerDown:t=>{e===`close`&&t.isPrimary&&t.button===0&&(t.stopPropagation(),c?.(n,t.nativeEvent))}}),children:[a?(0,$.jsx)(vt,{size:`xs`}):(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),t]}),(0,$.jsx)(J,{children:e===`merge`&&n.stack?`Open this pull request to merge its stack`:e===`close`&&c?`Close immediately, or drag across rows to close several`:`${t} immediately`})]},e)},t[30]=a,t[31]=f,t[32]=n,t[33]=c,t[34]=b,t[35]=d):d=t[35],x=(0,$.jsx)(`div`,{className:`shrink-0 items-center gap-1 pr-3`,style:s,role:`group`,"aria-label":`Quick actions for pull request #${n.number}`,"data-pull-request-action-pending":y||l,children:e.map(d)})}t[17]=y,t[18]=f,t[19]=l,t[20]=n,t[21]=r,t[22]=c,t[23]=b,t[24]=u,t[25]=i,t[26]=x,t[27]=S}else x=t[26],S=t[27];return S===Symbol.for(`react.early_return_sentinel`)?x:S}var Pd={close:{label:`Close`,Icon:Rr.closed},merge:{label:`Merge`,Icon:Rr.merged},ready:{label:`Ready for review`,Icon:Rr.pullRequest},reopen:{label:`Reopen`,Icon:Rr.reopen}},Fd=`group/pr-row flex w-full items-center gap-2 rounded-md py-1 pr-1 text-left`,Id=`shrink-0 font-mono text-xs tabular-nums text-muted-foreground`;function Ld(e){let t=(0,Q.c)(23),{state:n,isDraft:r,mergeability:i,baseBranch:a,below:o,className:s}=e,c;t[0]===s?c=t[1]:(c=K(`flex w-4 shrink-0 flex-col items-center gap-0.5`,s),t[0]=s,t[1]=c);let l;t[2]!==r||t[3]!==n?(l=(0,$.jsx)(Sr,{state:n,isDraft:r}),t[2]=r,t[3]=n,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{mergeability:i},t[5]=i,t[6]=u);let d;t[7]===a?d=t[8]:(d=a===void 0?{}:{baseBranch:a},t[7]=a,t[8]=d);let f;t[9]!==r||t[10]!==n||t[11]!==u||t[12]!==d?(f=(0,$.jsx)(`span`,{className:`absolute -right-1 -bottom-1 inline-flex`,children:(0,$.jsx)(vr,{state:n,isDraft:r,...u,...d,className:`size-3 fill-background [stroke-width:2.5]`})}),t[9]=r,t[10]=n,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]!==l||t[15]!==f?(p=(0,$.jsxs)(`span`,{className:`relative inline-flex`,children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16];let m;t[17]===o?m=t[18]:(m=o?(0,$.jsx)(`span`,{className:`inline-flex text-2xs`,children:o}):null,t[17]=o,t[18]=m);let h;return t[19]!==c||t[20]!==p||t[21]!==m?(h=(0,$.jsxs)(`span`,{className:c,children:[p,m]}),t[19]=c,t[20]=p,t[21]=m,t[22]=h):h=t[22],h}function Rd(e){let t=(0,Q.c)(22),{number:n,title:r,status:i,signals:a,meta:o,metaClassName:s,updatedAt:c}=e,l;t[0]===r?l=t[1]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm`,children:r}),t[0]=r,t[1]=l);let u;t[2]===a?u=t[3]:(u=a?(0,$.jsx)(`span`,{className:`flex shrink-0 items-center gap-1 text-2xs`,children:a}):null,t[2]=a,t[3]=u);let d;t[4]===i?d=t[5]:(d=i?(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-2xs`,children:i}):null,t[4]=i,t[5]=d);let f;t[6]!==n||t[7]!==l||t[8]!==u||t[9]!==d?(f=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[n,l,u,d]}),t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===s?p=t[12]:(p=K(`flex min-w-0 items-center gap-1.5 overflow-hidden text-2xs text-muted-foreground`,s),t[11]=s,t[12]=p);let m;t[13]===c?m=t[14]:(m=c?(0,$.jsx)(`span`,{className:`ml-auto shrink-0 whitespace-nowrap tabular-nums`,children:En(c)}):null,t[13]=c,t[14]=m);let h;t[15]!==o||t[16]!==p||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:p,children:[o,m]}),t[15]=o,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==f||t[20]!==h?(g=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,h]}),t[19]=f,t[20]=h,t[21]=g):g=t[21],g}function zd(e){let t=(0,Q.c)(20),{actor:n,className:r,labelClassName:i}=e,a=n?.login??`ghost`,o;t[0]===r?o=t[1]:(o=K(`inline-flex min-w-0 items-center gap-1`,r),t[0]=r,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,$.jsx)(`span`,{className:o}),t[2]=o,t[3]=s);let c;t[4]===n?c=t[5]:(c=(0,$.jsx)(Dr,{actor:n,className:`size-3.5`}),t[4]=n,t[5]=c);let l;t[6]===i?l=t[7]:(l=K(`truncate`,i),t[6]=i,t[7]=l);let u;t[8]!==a||t[9]!==l?(u=(0,$.jsx)(`span`,{className:l,children:a}),t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,$.jsxs)(q,{render:s,children:[c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14];let f=n?.name&&n.name!==a?`${n.name} (@${a})`:a,p;t[15]===f?p=t[16]:(p=(0,$.jsx)(J,{side:`top`,children:f}),t[15]=f,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(Y,{children:[d,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function Bd(e){let t=(0,Q.c)(8),{head:n,base:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(va,{value:n}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`span`,{className:`shrink-0`,children:`→`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=(0,$.jsx)(va,{value:r,className:`max-w-[45%] shrink-0`}),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 font-mono`,children:[i,a,o]}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function Vd(e){return e!==`touch`}var Hd={browser:`Browser previews are only available in the P4 Code desktop app.`,terminal:`Terminal surfaces are only available from a project thread.`,files:`Files are only available when a project is open.`,diff:`Diff is only available for server threads in Git repositories.`,pullRequest:`This thread's branch has no pull request yet.`,pullRequests:`No linked pull requests are available for this thread.`,device:`Devices are only available from a thread.`},Ud=[`[data-slot="dialog-popup"]`,`[data-slot="alert-dialog-popup"]`,`[data-slot="command-dialog-popup"]`,`[data-slot="menu-popup"]`,`[data-slot="select-popup"]`,`[data-slot="popover-popup"]`,`[data-slot="combobox-popup"]`,`[data-slot="autocomplete-popup"]`].join(`,`),Wd={browser:`Only available in the desktop app.`,terminal:`Available when a project is open.`,files:`Available when a project is open.`,diff:`Available for Git repositories.`,pullRequest:`No pull request on this branch yet.`,pullRequests:`No linked pull requests available.`,device:`Available from a thread.`},Gd=1,Kd=[ba,_a];function qd(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function Jd(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function Yd(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function Xd(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function Zd(e,t){return t.defaultPrevented||t.isComposing||t.metaKey||t.ctrlKey||t.altKey?null:e.find(e=>e.available&&e.shortcut.toLowerCase()===t.key.toLowerCase())??null}function Qd(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function $d(e){let t=(0,Q.c)(7),n;t[0]===e.trigger?n=t[1]:(n=(0,$.jsx)(q,{render:e.trigger}),t[0]=e.trigger,t[1]=n);let r;t[2]===e.reason?r=t[3]:(r=(0,$.jsx)(J,{side:`top`,children:e.reason}),t[2]=e.reason,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(Y,{children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function ef(e){let t=(0,Q.c)(12),n=e.available?void 0:`data-disabled:pointer-events-auto`,r=!e.available,i;t[0]===e.shortcut?i=t[1]:(i=(0,$.jsx)(be,{children:e.shortcut}),t[0]=e.shortcut,t[1]=i);let a;t[2]!==e.children||t[3]!==e.onClick||t[4]!==e.shortcut||t[5]!==n||t[6]!==r||t[7]!==i?(a=(0,$.jsxs)(U,{className:n,onClick:e.onClick,disabled:r,"aria-keyshortcuts":e.shortcut,children:[e.children,i]}),t[2]=e.children,t[3]=e.onClick,t[4]=e.shortcut,t[5]=n,t[6]=r,t[7]=i,t[8]=a):a=t[8];let o=a;if(e.available||!e.disabledReason)return o;let s;return t[9]!==o||t[10]!==e.disabledReason?(s=(0,$.jsx)($d,{reason:e.disabledReason,trigger:o}),t[9]=o,t[10]=e.disabledReason,t[11]=s):s=t[11],s}function tf(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),i=[{label:`Browser`,icon:Ae,shortcut:`B`,available:e.browserAvailable,disabledReason:Wd.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:ye,shortcut:`T`,available:e.terminalAvailable,disabledReason:Wd.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:u,shortcut:`F`,available:e.filesAvailable,disabledReason:Wd.files,onClick:e.onAddFiles},{label:`Diff`,icon:N,shortcut:`D`,available:e.diffAvailable,disabledReason:Wd.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:Rr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Wd.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:Rr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Wd.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:B,shortcut:`M`,available:e.deviceAvailable,disabledReason:Wd.device,onClick:e.onAddDevice}],a=i.filter(of),o=a.length===0?-1:Math.min(n,a.length-1),s=(0,Z.useRef)(a);(0,Z.useEffect)(()=>{s.current=a});let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[0]=c):c=t[0],(0,Z.useEffect)(()=>{let e=e=>{let t=Zd(s.current,e);if(!t||document.querySelector(Ud))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&Qd(n)||(e.preventDefault(),e.stopPropagation(),t.onClick())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},c);let l=e=>{if(!(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)&&a.length!==0){if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault(),r((o+1)%a.length);return}if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault(),r(o===-1?a.length-1:(o-1+a.length)%a.length);return}if(e.key===`Enter`){if(e.target!==e.currentTarget)return;let t=a[o];if(!t)return;e.preventDefault(),t.onClick()}}},d=af,f=e=>o!==-1&&a[o]===e,p=rf,m;t[1]===a?m=t[2]:(m=a.map(nf),t[1]=a,t[2]=m);let h=m.join(``),g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`h3`,{className:`mb-3 font-medium text-foreground text-sm`,children:`Tools`}),t[3]=g):g=t[3];let _=i.map(t=>t.available?(0,$.jsxs)(`div`,{className:`group relative`,onMouseEnter:()=>r(a.indexOf(t)),onMouseLeave:()=>r(e=>e===a.indexOf(t)?-1:e),children:[(0,$.jsxs)(`button`,{type:`button`,onClick:t.onClick,className:K(`flex h-10 w-full cursor-pointer items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm transition-colors group-hover:bg-card/60`,f(t)&&`bg-card/60`),children:[p(t,`size-4`),(0,$.jsx)(`span`,{className:K(`min-w-0 flex-1 truncate`,t.label===`Browser`&&e.browserProfiles.length>1&&`pr-8`),children:t.label}),(0,$.jsx)(da,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(x,{children:[(0,$.jsx)(we,{render:(0,$.jsx)(G,{"aria-label":`Open browser in a profile`,className:`absolute top-1/2 right-10 -translate-y-1/2`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(ce,{className:`size-3.5`})}),(0,$.jsx)(te,{align:`end`,side:`bottom`,sideOffset:6,className:`max-w-56`,children:e.browserProfiles.map(t=>(0,$.jsx)(U,{onClick:()=>e.onAddBrowserInProfile(t.id),children:(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.name})},t.id))})]}):null]},t.label):(0,$.jsx)($d,{reason:t.disabledReason,trigger:(0,$.jsxs)(`div`,{tabIndex:0,"aria-disabled":`true`,className:`flex h-10 w-full cursor-default items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm opacity-50`,children:[p(t,`size-4`),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,$.jsx)(da,{variant:`pill`,children:t.shortcut})]})},t.label)),v;t[4]===_?v=t[5]:(v=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:_}),t[4]=_,t[5]=v);let y;t[6]!==v||t[7]!==g?(y=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[g,v]}),t[6]=v,t[7]=g,t[8]=y):y=t[8];let b;return t[9]!==d||t[10]!==l||t[11]!==y||t[12]!==h?(b=(0,$.jsx)(`div`,{ref:d,tabIndex:0,onKeyDown:l,"aria-label":`Open a surface`,"data-surface-launcher-keys":h,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted px-5 py-6 outline-none`,children:y}),t[9]=d,t[10]=l,t[11]=y,t[12]=h,t[13]=b):b=t[13],b}function nf(e){return e.shortcut}function rf(e,t){let n=t===void 0?`size-4`:t,r=e.icon;return(0,$.jsx)(`span`,{className:`relative inline-flex shrink-0 text-muted-foreground`,children:(0,$.jsx)(r,{className:n})})}function af(e){e?.focus()}function of(e){return e.available}function sf(e,t,n){switch(e.kind){case`diff`:return`Diff`;case`files`:return`Files`;case`file`:return e.relativePath.slice(Math.max(e.relativePath.lastIndexOf(`/`),e.relativePath.lastIndexOf(`\\`))+1);case`terminal`:return n.get(e.activeTerminalId)??Ui(e.activeTerminalId);case`pull-request`:return`#${e.number}`;case`pull-requests`:return`Pull requests`;case`device`:return e.title??e.target?.name??`Device`;case`preview`:{let n=e.resourceId?t[e.resourceId]:null;if(!n||n.navStatus._tag===`Idle`)return`Browser`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function cf(e){let t=(0,Q.c)(8),{capturedUrl:n,url:r}=e,i;t[0]===r?i=t[1]:(i=dt(r,32),t[0]=r,t[1]=i);let a=i,o;t[2]!==n||t[3]!==a?(o=[n,a],t[2]=n,t[3]=a,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(Ae,{className:`size-3 shrink-0`}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,$.jsx)(hs,{sources:o,fallback:s,className:`size-3 shrink-0 rounded-sm object-contain`}),t[6]=o,t[7]=c),c}function lf(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function uf(e){let t=(0,Q.c)(16),{surface:n,sessions:r,desktopByTabId:i,theme:a,environmentId:o,pullRequestStatusSeeds:s}=e;switch(n.kind){case`preview`:{let e=n.resourceId?r[n.resourceId]:null,a=!e||e.navStatus._tag===`Idle`?null:e.navStatus.url,o=e?i[e.tabId]?.favicon??null:null,s=o&&a&&lf(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(cf,{capturedUrl:s,url:a}),t[0]=s,t[1]=a,t[2]=c):c=t[2],c}case`diff`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(N,{className:`size-3 shrink-0`}),t[3]=e):e=t[3],e}case`files`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(u,{className:`size-3 shrink-0`}),t[4]=e):e=t[4],e}case`file`:{let e;return t[5]!==n.relativePath||t[6]!==a?(e=(0,$.jsx)(pr,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[5]=n.relativePath,t[6]=a,t[7]=e):e=t[7],e}case`terminal`:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ye,{className:`size-3 shrink-0`}),t[8]=e):e=t[8],e}case`pull-request`:{let e=s?.[n.id],r;return t[9]!==o||t[10]!==n||t[11]!==e?(r=(0,$.jsx)(ff,{surface:n,environmentId:o,seed:e}),t[9]=o,t[10]=n,t[11]=e,t[12]=r):r=t[12],r}case`pull-requests`:{let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rr.link,{className:`size-3 shrink-0`}),t[13]=e):e=t[13],e}case`device`:{let e;return t[14]===n.target?.platform?e=t[15]:(e=n.target?.platform===`ios`?(0,$.jsx)(dr,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(fr,{className:`size-3 shrink-0`}):(0,$.jsx)(B,{className:`size-3 shrink-0`}),t[14]=n.target?.platform,t[15]=e),e}}}function df(e,t,n,r){if(t===null||n===null)return;let i;for(let a of e)if(a.environmentId===t)for(let e of tt(a.pullRequests))$e(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function ff(e){let t=(0,Q.c)(11),{surface:n,environmentId:r,seed:i}=e,a=n.environmentId??r,o=Ke(),s=Je(),c;t[0]!==a||t[1]!==n.projectId?(c=e=>e.environmentId===a&&e.id===n.projectId,t[0]=a,t[1]=n.projectId,t[2]=c):c=t[2];let l=o.find(c)?.repositoryIdentity,u=n.host??(l?.provider?A(l,l.provider):null),d=Ye(),f=a===null?void 0:d.get(a)?.environment.capabilities,p=f?.threadPullRequests===!0?df(s,a,u,n)?.snapshot??null:null,m=kt(a===null||f?.pullRequests!==!0||p!==null?null:Gr.detail({environmentId:a,input:{projectId:n.projectId,...f?.threadPullRequests===!0&&n.host!==void 0?{host:n.host}:{},repository:n.repository,number:n.number}})).data,h=n.projectId,g;t[3]!==n.number||t[4]!==n.repository||t[5]!==h?(g={projectId:h,repository:n.repository,number:n.number},t[3]=n.number,t[4]=n.repository,t[5]=h,t[6]=g):g=t[6];let _=Kr(a,g,null),v=p??Wr(m,_)??i??null;if(v===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rr.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let y=yr({state:v.state,isDraft:v.isDraft??m?.isDraft??i?.isDraft??!1}),b=y.Icon,x=K(`size-3 shrink-0`,y.toneClassName),S;return t[8]!==y||t[9]!==x?(S=(0,$.jsx)(b,{className:x}),t[8]=y,t[9]=x,t[10]=S):S=t[10],S}function pf(e){let t=(0,Q.c)(13),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={activationConstraint:{distance:6}},t[0]=n):n=t[0];let r=$i(ea(Qi,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(mf),t[1]=e.surfaces,t[2]=i);let a=i,{onMove:o,surfaces:s}=e,c;t[3]!==o||t[4]!==s?(c=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=s.findIndex(e=>e.id===n.id);r>=0&&o?.(String(t.id),r)},t[3]=o,t[4]=s,t[5]=c):c=t[5];let l=c,u;t[6]!==e.children||t[7]!==a?(u=(0,$.jsx)(ra,{items:a,strategy:ta,children:e.children}),t[6]=e.children,t[7]=a,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==r||t[11]!==u?(d=(0,$.jsx)(na,{sensors:r,collisionDetection:ia,modifiers:Kd,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function mf(e){return e.id}function hf(e){let t=(0,Q.c)(22),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({surfaceId:a,disabled:r,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]!==r||t[6]!==a?(o={id:a,disabled:r},t[5]=r,t[6]=a,t[7]=o):o=t[7];let{listeners:s,setNodeRef:c,transform:l,transition:u,isDragging:d}=Yi(o),f;t[8]===l?f=t[9]:(f=Zi.Translate.toString(l),t[8]=l,t[9]=f);let p;t[10]!==f||t[11]!==u?(p={transform:f,transition:u},t[10]=f,t[11]=u,t[12]=p):p=t[12];let m=d&&`relative z-10`,h;t[13]!==n||t[14]!==m?(h=K(n,m),t[13]=n,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==s||t[17]!==i||t[18]!==c||t[19]!==p||t[20]!==h?(g=(0,$.jsx)(`div`,{...i,...s,ref:c,style:p,className:h}),t[16]=s,t[17]=i,t[18]=c,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}function gf(e){let t=(0,Q.c)(137),n=Dn&&e.mode===`inline`,r=cr().profiles,{resolvedTheme:i}=wt(),a=(0,Z.useRef)(null),o=(0,Z.useRef)(null),[s,c]=(0,Z.useState)(null),[l,d]=(0,Z.useState)(!1),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=f):f=t[0];let[p,h]=(0,Z.useState)(f),g=e.open!==!1&&e.surfaces.length>0;!g&&l&&d(!1);let _;t[1]!==g||t[2]!==l||t[3]!==e?(_=t=>{if(!(t.defaultPrevented||t.isComposing)&&lr(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&(l||!document.querySelector(Ud))&&(t.preventDefault(),t.stopPropagation(),!t.repeat)){if(!g){document.querySelector(`[data-surface-launcher-keys]`)?.focus();return}o.current?.focus(),d(!0)}},t[1]=g,t[2]=l,t[3]=e,t[4]=_):_=t[4];let v=(0,Z.useEffectEvent)(_),y;t[5]!==v||t[6]!==e.open?(y=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,v,!0),()=>document.removeEventListener(`keydown`,v,!0)},t[5]=v,t[6]=e.open,t[7]=y):y=t[7];let b;t[8]===e.open?b=t[9]:(b=[e.open],t[8]=e.open,t[9]=b),(0,Z.useEffect)(y,b);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{let e=qd(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Gd,n=t&&e.scrollLeft>Gd,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Gd;h(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[10]=S):S=t[10];let C=S,w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{let t=qd(a.current);if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollBy({left:e*Math.max(120,t.clientWidth*.75),behavior:n?`auto`:`smooth`})},t[11]=w):w=t[11];let T=w,E;t[12]!==e.browserAvailable||t[13]!==e.onAddBrowser?(E={label:`Browser`,icon:Ae,shortcut:`B`,available:e.browserAvailable,disabledReason:Hd.browser,onClick:e.onAddBrowser},t[12]=e.browserAvailable,t[13]=e.onAddBrowser,t[14]=E):E=t[14];let D;t[15]!==e.onAddTerminal||t[16]!==e.terminalAvailable?(D={label:`Terminal`,icon:ye,shortcut:`T`,available:e.terminalAvailable,disabledReason:Hd.terminal,onClick:e.onAddTerminal},t[15]=e.onAddTerminal,t[16]=e.terminalAvailable,t[17]=D):D=t[17];let O;t[18]!==e.filesAvailable||t[19]!==e.onAddFiles?(O={label:`Files`,icon:u,shortcut:`F`,available:e.filesAvailable,disabledReason:Hd.files,onClick:e.onAddFiles},t[18]=e.filesAvailable,t[19]=e.onAddFiles,t[20]=O):O=t[20];let k;t[21]!==e.diffAvailable||t[22]!==e.onAddDiff?(k={label:`Diff`,icon:N,shortcut:`D`,available:e.diffAvailable,disabledReason:Hd.diff,onClick:e.onAddDiff},t[21]=e.diffAvailable,t[22]=e.onAddDiff,t[23]=k):k=t[23];let A;t[24]!==e.onAddPullRequest||t[25]!==e.pullRequestAvailable?(A={label:`Pull request`,icon:Rr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Hd.pullRequest,onClick:e.onAddPullRequest},t[24]=e.onAddPullRequest,t[25]=e.pullRequestAvailable,t[26]=A):A=t[26];let j;t[27]!==e.onAddPullRequests||t[28]!==e.pullRequestsAvailable?(j={label:`Linked pull requests`,icon:Rr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Hd.pullRequests,onClick:e.onAddPullRequests},t[27]=e.onAddPullRequests,t[28]=e.pullRequestsAvailable,t[29]=j):j=t[29];let M;t[30]!==e.deviceAvailable||t[31]!==e.onAddDevice?(M={label:`Device`,icon:B,shortcut:`M`,available:e.deviceAvailable,disabledReason:Hd.device,onClick:e.onAddDevice},t[30]=e.deviceAvailable,t[31]=e.onAddDevice,t[32]=M):M=t[32];let P;t[33]!==A||t[34]!==j||t[35]!==M||t[36]!==E||t[37]!==D||t[38]!==O||t[39]!==k?(P=[E,D,O,k,A,j,M],t[33]=A,t[34]=j,t[35]=M,t[36]=E,t[37]=D,t[38]=O,t[39]=k,t[40]=P):P=t[40];let F=P,I;t[41]===F?I=t[42]:(I=e=>{let t=Zd(F,e.nativeEvent);t&&(e.preventDefault(),e.stopPropagation(),d(!1),t.onClick())},t[41]=F,t[42]=I);let L=I,R;t[43]===e?R=t[44]:(R=async(t,n)=>{t.preventDefault(),t.stopPropagation();let r=Ct();if(!r)return;let i=e.surfaces.findIndex(e=>e.id===n.id);if(i<0)return;let a=[];n.kind===`device`&&e.onRenameDevice&&a.push({id:`rename`,label:`Rename`}),n.kind===`file`&&n.attachment===void 0&&a.push({id:`copy-path`,label:`Copy path`});let o=Jd(n,e.previewSessions),s=o?e.desktopByTabId[o]??null:null,l=s?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...Yd({overlay:s,canResolveRuntimeTabId:e.previewRuntimeTabId!==void 0})}),a.push({id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:e.surfaces.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:i>=e.surfaces.length-1},{id:`close-all`,label:`Close all`,disabled:e.surfaces.length===0});let u=await r.contextMenu.show(a,{x:t.clientX,y:t.clientY});bb136:switch(u){case`rename`:c(n.id);break bb136;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb136;case`toggle-mute`:{let t=o&&s?e.previewRuntimeTabId?.(o)??null:null;t&&ya?.setAudioMuted(t,!l).catch(bf);break bb136}case`close`:e.onCloseSurface(n);break bb136;case`close-others`:e.onCloseOtherSurfaces(n);break bb136;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb136;case`close-all`:e.onCloseAllSurfaces();break bb136}},t[43]=e,t[44]=R);let z=R,ee=yf,V;t[45]===e?V=t[46]:(V=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[45]=e,t[46]=V);let H=V,ne,ie;t[47]!==e.activeSurfaceId||t[48]!==p.hasOverflow?(ne=()=>{e.activeSurfaceId&&p.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},ie=[e.activeSurfaceId,p.hasOverflow],t[47]=e.activeSurfaceId,t[48]=p.hasOverflow,t[49]=ne,t[50]=ie):(ne=t[49],ie=t[50]),(0,Z.useEffect)(ne,ie);let ae,oe;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{let e=qd(a.current);if(!e)return;let t=e.firstElementChild,n=ar(t?[e,t]:e,C);return e.addEventListener(`scroll`,C,{passive:!0}),C(),()=>{n(),e.removeEventListener(`scroll`,C)}},oe=[C],t[51]=ae,t[52]=oe):(ae=t[51],oe=t[52]),(0,Z.useEffect)(ae,oe);let se,ce;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(se=()=>{let e=qd(a.current);if(!e)return;let t=t=>{if(t.ctrlKey)return;let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=16),t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=e.clientWidth),n===0)return;let r=e.scrollLeft;e.scrollLeft+=n,e.scrollLeft!==r&&(t.preventDefault(),C())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},ce=[C],t[53]=se,t[54]=ce):(se=t[53],ce=t[54]),(0,Z.useEffect)(se,ce);let le=e.mode,ue;t[55]===e.maximized?ue=t[56]:(ue=e.maximized===void 0?{}:{maximized:e.maximized},t[55]=e.maximized,t[56]=ue);let W;t[57]===e.open?W=t[58]:(W=e.open===void 0?{}:{open:e.open},t[57]=e.open,t[58]=W);let de;t[59]===e.widthStorageKey?de=t[60]:(de=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[59]=e.widthStorageKey,t[60]=de);let pe;t[61]===e.defaultWidth?pe=t[62]:(pe=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[61]=e.defaultWidth,t[62]=pe);let me;t[63]===e.inlineSize?me=t[64]:(me=e.inlineSize?{inlineSize:e.inlineSize}:{},t[63]=e.inlineSize,t[64]=me);let he=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,ge=n&&`drag-region`,_e=n&&`wco:pr-(--workspace-native-controls-inset)`,xe=e.mode===`inline`&&e.maximized&&`[[data-sidebar-state=collapsed]_&]:pl-[var(--workspace-titlebar-content-left)] max-md:[[data-sidebar-state=expanded]_&]:pl-[var(--workspace-titlebar-content-left)]`,Se;t[65]!==he||t[66]!==ge||t[67]!==_e||t[68]!==xe?(Se=K(`flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-1 bg-(--app-chrome-background) pl-2`,he,ge,_e,xe),t[65]=he,t[66]=ge,t[67]=_e,t[68]=xe,t[69]=Se):Se=t[69];let Ce=e.surfaces,Te=e.onMoveSurface,Ee;t[70]!==H||t[71]!==z||t[72]!==n||t[73]!==e||t[74]!==s||t[75]!==i?(Ee=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),o=sf(t,e.previewSessions,e.terminalLabelsById),l=Jd(t,e.previewSessions),u=Xd(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(hf,{surfaceId:t.id,disabled:!e.onMoveSurface||s===t.id,"data-active-tab":r,onMouseDown:ee,onAuxClick:e=>H(e,t),onContextMenu:e=>void z(e,t),className:K(`cursor-pointer group/tab flex h-7 w-52 shrink-0 items-center gap-2 rounded-md pr-1 pl-2.5 text-sm transition-colors duration-150`,n&&`[-webkit-app-region:no-drag]`,r?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[(0,$.jsxs)(`span`,{className:`relative flex size-4 shrink-0 items-center justify-center [&_img]:size-3.5 [&_svg]:size-3.5`,children:[(0,$.jsx)(uf,{surface:t,sessions:e.previewSessions,desktopByTabId:e.desktopByTabId,theme:i,environmentId:e.environmentId,pullRequestStatusSeeds:e.pullRequestStatusSeeds}),a?(0,$.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full bg-current`,"aria-hidden":!0}):null]}),u===`none`||!d?null:(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,className:`cursor-pointer flex size-4 shrink-0 items-center justify-center rounded-sm hover:bg-muted`,"aria-label":u===`muted`?`Unmute ${o}`:`Mute ${o}`,onClick:e=>{e.stopPropagation(),ya?.setAudioMuted(d,u!==`muted`).catch(vf)},children:(0,$.jsx)(ot,{className:`size-3`,icon:u===`muted`?at:it})})}),(0,$.jsx)(J,{children:u===`muted`?`Unmute tab`:`Mute tab`})]}),s===t.id?(0,$.jsx)(`input`,{"aria-label":`Device tab name`,className:`min-w-0 flex-1 rounded-sm bg-background px-1 outline-none ring-1 ring-inset ring-ring`,defaultValue:o,ref:_f,onBlur:n=>{e.onRenameDevice?.(t.id,n.currentTarget.value),c(null)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=o,e.currentTarget.blur())}}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,onDoubleClick:()=>{t.kind===`device`&&e.onRenameDevice&&c(t.id)},className:`cursor-pointer flex h-full min-w-0 flex-1 items-center`,onClick:()=>e.onActivate(t),children:(0,$.jsx)(`span`,{className:`truncate`,children:o})})}),(0,$.jsx)(J,{children:t.kind===`device`?(0,$.jsx)(xf,{surface:t,environmentId:e.environmentId,title:o}):o})]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close ${o}`,className:K(`cursor-pointer flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-opacity duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 pointer-coarse:opacity-100 motion-reduce:transition-none`,r?`opacity-100`:`opacity-0 group-hover/tab:opacity-100`),onClick:()=>e.onCloseSurface(t),children:(0,$.jsx)(m,{className:`size-3.5`})})]},t.id)}),t[70]=H,t[71]=z,t[72]=n,t[73]=e,t[74]=s,t[75]=i,t[76]=Ee):Ee=t[76];let De;t[77]!==e.onMoveSurface||t[78]!==e.surfaces||t[79]!==Ee?(De=(0,$.jsx)(pf,{surfaces:Ce,onMove:Te,children:Ee}),t[77]=e.onMoveSurface,t[78]=e.surfaces,t[79]=Ee,t[80]=De):De=t[80];let ke;t[81]!==F||t[82]!==g||t[83]!==l||t[84]!==r||t[85]!==L||t[86]!==e?(ke=g?(0,$.jsxs)(x,{open:l,onOpenChange:d,children:[(0,$.jsx)(we,{ref:o,render:(0,$.jsx)(G,{"aria-label":`Add panel surface`,className:`shrink-0`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(Be,{className:`size-4`})}),(0,$.jsx)(te,{align:`start`,side:`bottom`,sideOffset:6,onKeyDownCapture:L,children:F.map(t=>{let n=t.icon;return t.label===`Browser`&&t.available?(0,$.jsxs)(Oe,{children:[(0,$.jsxs)(re,{className:`[&>svg:last-child]:ms-0`,"aria-keyshortcuts":t.shortcut,onClick:e=>{Vd(`pointerType`in e.nativeEvent&&typeof e.nativeEvent.pointerType==`string`?e.nativeEvent.pointerType:void 0)&&(d(!1),t.onClick())},children:[(0,$.jsx)(n,{}),t.label,(0,$.jsx)(be,{children:t.shortcut})]}),(0,$.jsx)(fe,{className:`max-w-56`,children:r.map(t=>(0,$.jsx)(U,{onClick:()=>e.onAddBrowserInProfile(t.id),children:(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.name})},t.id))})]},t.label):(0,$.jsxs)(ef,{available:t.available,disabledReason:t.disabledReason,shortcut:t.shortcut,onClick:t.onClick,children:[(0,$.jsx)(n,{}),t.label]},t.label)})})]}):null,t[81]=F,t[82]=g,t[83]=l,t[84]=r,t[85]=L,t[86]=e,t[87]=ke):ke=t[87];let je;t[88]!==De||t[89]!==ke?(je=(0,$.jsx)(Wn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-right-panel-tab-list":!0,children:(0,$.jsxs)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:[De,ke]})}),t[88]=De,t[89]=ke,t[90]=je):je=t[90];let Me;t[91]!==p.canScrollLeft||t[92]!==p.canScrollRight||t[93]!==p.hasOverflow?(Me=p.hasOverflow?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 [-webkit-app-region:no-drag]`,role:`group`,"aria-label":`Scroll panel tabs`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs left`,disabled:!p.canScrollLeft,onClick:()=>T(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(Ne,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs left`})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs right`,disabled:!p.canScrollRight,onClick:()=>T(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(ve,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs right`})]})]}):null,t[91]=p.canScrollLeft,t[92]=p.canScrollRight,t[93]=p.hasOverflow,t[94]=Me):Me=t[94];let Pe;t[95]!==n||t[96]!==e.layoutControls?(Pe=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[95]=n,t[96]=e.layoutControls,t[97]=Pe):Pe=t[97];let Fe;t[98]===n?Fe=t[99]:(Fe=n?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]`}):null,t[98]=n,t[99]=Fe);let Ie;t[100]!==e.layoutControls||t[101]!==Se||t[102]!==je||t[103]!==Me||t[104]!==Pe||t[105]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:Se,"data-right-panel-tabbar":!0,children:[je,Me,e.layoutControls,Pe,Fe]}),t[100]=e.layoutControls,t[101]=Se,t[102]=je,t[103]=Me,t[104]=Pe,t[105]=Fe,t[106]=Ie):Ie=t[106];let Le;t[107]!==r||t[108]!==e.activeSurfaceId||t[109]!==e.browserAvailable||t[110]!==e.children||t[111]!==e.deviceAvailable||t[112]!==e.diffAvailable||t[113]!==e.filesAvailable||t[114]!==e.onAddBrowser||t[115]!==e.onAddBrowserInProfile||t[116]!==e.onAddDevice||t[117]!==e.onAddDiff||t[118]!==e.onAddFiles||t[119]!==e.onAddPullRequest||t[120]!==e.onAddPullRequests||t[121]!==e.onAddTerminal||t[122]!==e.pullRequestAvailable||t[123]!==e.pullRequestsAvailable||t[124]!==e.terminalAvailable?(Le=e.activeSurfaceId===null?(0,$.jsx)(tf,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,onAddPullRequest:e.onAddPullRequest,onAddPullRequests:e.onAddPullRequests,onAddDevice:e.onAddDevice,browserAvailable:e.browserAvailable,terminalAvailable:e.terminalAvailable,diffAvailable:e.diffAvailable,filesAvailable:e.filesAvailable,pullRequestAvailable:e.pullRequestAvailable,pullRequestsAvailable:e.pullRequestsAvailable,deviceAvailable:e.deviceAvailable}):e.children,t[107]=r,t[108]=e.activeSurfaceId,t[109]=e.browserAvailable,t[110]=e.children,t[111]=e.deviceAvailable,t[112]=e.diffAvailable,t[113]=e.filesAvailable,t[114]=e.onAddBrowser,t[115]=e.onAddBrowserInProfile,t[116]=e.onAddDevice,t[117]=e.onAddDiff,t[118]=e.onAddFiles,t[119]=e.onAddPullRequest,t[120]=e.onAddPullRequests,t[121]=e.onAddTerminal,t[122]=e.pullRequestAvailable,t[123]=e.pullRequestsAvailable,t[124]=e.terminalAvailable,t[125]=Le):Le=t[125];let Re;t[126]===Le?Re=t[127]:(Re=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:Le}),t[126]=Le,t[127]=Re);let ze;return t[128]!==e.mode||t[129]!==ue||t[130]!==W||t[131]!==de||t[132]!==pe||t[133]!==me||t[134]!==Ie||t[135]!==Re?(ze=(0,$.jsxs)(us,{mode:le,...ue,...W,...de,...pe,...me,children:[Ie,Re]}),t[128]=e.mode,t[129]=ue,t[130]=W,t[131]=de,t[132]=pe,t[133]=me,t[134]=Ie,t[135]=Re,t[136]=ze):ze=t[136],ze}function _f(e){e?.focus(),e?.select()}function vf(){}function yf(e){e.button===1&&e.preventDefault()}function bf(){}function xf(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=ir(n?e.environmentId:null),i;t[0]!==r||t[1]!==n?(i=n?r.devices.find(e=>e.hostId===n.hostId&&e.id===n.deviceId):void 0,t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=n?r.hosts.find(e=>e.id===n.hostId):void 0,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===e.title?c=t[7]:(c=(0,$.jsx)(`span`,{children:e.title}),t[6]=e.title,t[7]=c);let l;t[8]!==a?.version||t[9]!==s?.label||t[10]!==n?(l=n?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[s?.label??`Device host`,` ·`,` `,a?.version??(n.platform===`ios`?`iOS`:`Android`)]}):null,t[8]=a?.version,t[9]=s?.label,t[10]=n,t[11]=l):l=t[11];let u;return t[12]!==c||t[13]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14],u}var Sf=(0,Z.memo)(function(e){let t=(0,Q.c)(31),{showThreadPanelControl:n,showTerminalControl:r,showRightPanelControl:i,terminalAvailable:a,terminalOpen:o,terminalShortcutLabel:s,threadPanelOpen:c,threadPanelPresentation:l,threadPanelPopoverHandle:u,threadPanelShortcutLabel:d,rightPanelAvailable:f,rightPanelOpen:p,rightPanelShortcutLabel:m,rightPanelUnavailableLabel:h,rightPanelTabCount:g,onToggleTerminal:_,onToggleThreadPanel:v,onToggleRightPanel:y}=e,b=n===void 0||n,x=r===void 0||r,S=i===void 0||i,C=h===void 0?`Right panel is unavailable`:h,w=g===void 0?0:g,T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(Tf,{}),t[0]=T):T=t[0];let E;t[1]===c?E=t[2]:(E=(0,$.jsx)(An,{className:`relative shrink-0 [-webkit-app-region:no-drag]`,pressed:c,"aria-label":`Toggle thread details panel`,variant:`ghost`,size:`sm`,children:T}),t[1]=c,t[2]=E);let D=E,O;t[3]!==v||t[4]!==l||t[5]!==d?(O=e=>(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:e,...l===`popover`?{}:{onClick:v}}),(0,$.jsxs)(J,{side:`bottom`,children:[`Toggle thread details`,d?` (${d})`:``]})]}),t[3]=v,t[4]=l,t[5]=d,t[6]=O):O=t[6];let k=O,A;t[7]!==b||t[8]!==u||t[9]!==l||t[10]!==D||t[11]!==k?(A=b?k(l===`popover`?(0,$.jsx)(Xr,{handle:u,render:D}):D):null,t[7]=b,t[8]=u,t[9]=l,t[10]=D,t[11]=k,t[12]=A):A=t[12];let j;t[13]!==_||t[14]!==x||t[15]!==a||t[16]!==o||t[17]!==s?(j=x?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:o,onPressedChange:_,"aria-label":`Toggle terminal drawer`,variant:`ghost`,size:`sm`,disabled:!a,children:(0,$.jsx)(de,{className:`size-4`})})}),(0,$.jsx)(J,{side:`bottom`,children:a?`Toggle terminal drawer${s?` (${s})`:``}`:`Terminal drawer is unavailable`})]}):null,t[13]=_,t[14]=x,t[15]=a,t[16]=o,t[17]=s,t[18]=j):j=t[18];let M;t[19]!==y||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==w||t[24]!==C||t[25]!==S?(M=S?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:p,onPressedChange:y,"aria-label":w>0?`Toggle right panel, ${w} ${w===1?`tab`:`tabs`}`:`Toggle right panel`,variant:`ghost`,size:`sm`,disabled:!f,children:w>0?(0,$.jsx)(Cf,{count:w}):(0,$.jsx)(Ee,{className:`size-4`})})}),(0,$.jsx)(J,{side:`bottom`,children:f?`Toggle right panel${m?` (${m})`:``}`:C})]}):null,t[19]=y,t[20]=f,t[21]=p,t[22]=m,t[23]=w,t[24]=C,t[25]=S,t[26]=M):M=t[26];let N;return t[27]!==j||t[28]!==M||t[29]!==A?(N=(0,$.jsxs)(`div`,{className:`flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,"data-panel-layout-controls":!0,children:[A,j,M]}),t[27]=j,t[28]=M,t[29]=A,t[30]=N):N=t[30],N});function Cf(e){let t=(0,Q.c)(4),{count:n}=e,r=n>99?`∞`:String(n),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),t[0]=i):i=t[0];let a=r.length>1?11:13,o;return t[1]!==r||t[2]!==a?(o=(0,$.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:[i,(0,$.jsx)(`text`,{x:`12`,y:`12.5`,fill:`currentColor`,stroke:`none`,fontSize:a,fontWeight:600,textAnchor:`middle`,dominantBaseline:`central`,className:`tabular-nums`,children:r})]}),t[1]=r,t[2]=a,t[3]=o):o=t[3],o}var wf=(0,Z.memo)(function(e){let t=(0,Q.c)(12),{maximized:n,onToggle:r}=e,i=n?`Restore panel size`:`Maximize panel`,a=n?rt:nt,o;t[0]===a?o=t[1]:(o=(0,$.jsx)(ot,{className:`size-3.5`,icon:a}),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(s=(0,$.jsx)(q,{render:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:n,onPressedChange:r,"aria-label":i,variant:`ghost`,size:`sm`,children:o})}),t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,$.jsx)(J,{side:`bottom`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(Y,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l});function Tf(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,className:`size-4`,children:[(0,$.jsx)(`circle`,{cx:`6`,cy:`7.5`,r:`2.5`}),(0,$.jsx)(`circle`,{cx:`6`,cy:`16.5`,r:`2.5`}),(0,$.jsx)(`path`,{d:`M12 7.5h8`}),(0,$.jsx)(`path`,{d:`M12 16.5h8`})]}),e[0]=t):t=e[0],t}export{us as A,pc as C,Ss as D,dc as E,Ao as F,Mo as I,ko as L,Yo as M,Xo as N,Cs as O,qo as P,_c as S,fc as T,ul as _,Id as a,Fc as b,Ld as c,Md as d,Pu as f,fl as g,xl as h,Fd as i,as as j,ys as k,Rd as l,wl as m,wf as n,zd as o,Sl as p,gf as r,Bd as s,Sf as t,Nd as u,Rc as v,hc as w,xc as x,Lc as y};
216
- //# sourceMappingURL=PanelLayoutControls-bgJzxuTg.js.map
216
+ //# sourceMappingURL=PanelLayoutControls-jZ_kyR1v.js.map