@p4code/cli 0.8.23 → 0.8.24

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 (217) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-DzKk3bdm.mjs → binCli-DNod5652.mjs} +2 -2
  3. package/dist/client/.vite/manifest.json +1315 -1315
  4. package/dist/client/assets/{AuthSurfaceShell-DJcUG_EN.js → AuthSurfaceShell-Wwq6fM9A.js} +2 -2
  5. package/dist/client/assets/{ChatGptUsageButton-BDCO7XMy.js → ChatGptUsageButton-8lmdyDiG.js} +2 -2
  6. package/dist/client/assets/{ChatMarkdown-CDno8Ayh.js → ChatMarkdown-Cd3yE4VU.js} +4 -4
  7. package/dist/client/assets/{CodexSetupSection.logic-BB9JxUR1.js → CodexSetupSection.logic-oYzzgIWo.js} +2 -2
  8. package/dist/client/assets/{CommandBlock-DQi0VdAG.js → CommandBlock-ByCjpPww.js} +2 -2
  9. package/dist/client/assets/{ComposerPromptEditor-DCjk2_nI.js → ComposerPromptEditor-4EkkS1N5.js} +4 -4
  10. package/dist/client/assets/{DevicePanel-D192Fic3.js → DevicePanel-DWlHQcLW.js} +2 -2
  11. package/dist/client/assets/{DeviceSetup-D9F7F9pV.js → DeviceSetup-Dm9ZbkMC.js} +2 -2
  12. package/dist/client/assets/{DiffCommentAnnotation-mA-RZ8Su.js → DiffCommentAnnotation-Dx-VhoLU.js} +2 -2
  13. package/dist/client/assets/{DiffFileTree-CaPQB8J4.js → DiffFileTree-BgjyfH71.js} +2 -2
  14. package/dist/client/assets/{DiffPanel-3G1enpU9.js → DiffPanel-tZN29mdM.js} +2 -2
  15. package/dist/client/assets/{DiffWorkerPoolProvider-BOInEqDW.js → DiffWorkerPoolProvider-C_yNvh6o.js} +2 -2
  16. package/dist/client/assets/{EmbeddedDesign-D97sS_-D.js → EmbeddedDesign-DDApp-WI.js} +2 -2
  17. package/dist/client/assets/{FileDiff-DLYKd8S8.js → FileDiff-B_422yEN.js} +2 -2
  18. package/dist/client/assets/{FilePreviewPanel-BCtCBzc7.js → FilePreviewPanel-B26lXYsA.js} +2 -2
  19. package/dist/client/assets/{FoldedSettingsSection-BIr-uvTu.js → FoldedSettingsSection-TLqDB_1b.js} +2 -2
  20. package/dist/client/assets/{NoProjectsHero-Dj3URl4e.js → NoProjectsHero-Bx1X9Us-.js} +2 -2
  21. package/dist/client/assets/{P4ConnectAccountPages-CFPHk3YU.js → P4ConnectAccountPages-BWvaLOY-.js} +2 -2
  22. package/dist/client/assets/{P4ConnectSidebarSignIn-BMrzp8XI.js → P4ConnectSidebarSignIn-C8z-Gfq5.js} +2 -2
  23. package/dist/client/assets/{PanelLayoutControls-C1Bf67DQ.js → PanelLayoutControls-C2deQDB2.js} +4 -4
  24. package/dist/client/assets/{PierreEntryIcon--dw21QmY.js → PierreEntryIcon-Ddl-VPd4.js} +2 -2
  25. package/dist/client/assets/{PreviewPanel-DCqFsoQM.js → PreviewPanel-8NDLwOfI.js} +2 -2
  26. package/dist/client/assets/{ProjectDefaultsSettings-B4srG1Zj.js → ProjectDefaultsSettings-DN1GxlYC.js} +2 -2
  27. package/dist/client/assets/{ProjectFavicon--HkFaTb7.js → ProjectFavicon-BDaMxno-.js} +3 -3
  28. package/dist/client/assets/{ProjectIconPickerDialog-Bl6Uid40.js → ProjectIconPickerDialog-Be5IQyyr.js} +2 -2
  29. package/dist/client/assets/{ProviderAuthTerminal-njw98kWo.js → ProviderAuthTerminal-BFGd236-.js} +2 -2
  30. package/dist/client/assets/{ProviderModelPicker-DBjdgQjr.js → ProviderModelPicker-DMtMvBKn.js} +2 -2
  31. package/dist/client/assets/{ProviderSettingsForm-_kCwzsZ5.js → ProviderSettingsForm-D6u9dY73.js} +2 -2
  32. package/dist/client/assets/{PullRequestCodeTab-2OTuKeLP.js → PullRequestCodeTab-hXtKZAP9.js} +2 -2
  33. package/dist/client/assets/{ReadOnlySourcePreview-BfF8Dhuk.js → ReadOnlySourcePreview-CDLZaWo2.js} +2 -2
  34. package/dist/client/assets/{RenderErrorBoundary-CReszKsZ.js → RenderErrorBoundary-BkcvpgEh.js} +2 -2
  35. package/dist/client/assets/{ScheduledTasksSettings-BJ6fD98R.js → ScheduledTasksSettings-BJyFxVyR.js} +2 -2
  36. package/dist/client/assets/{ScopedSwitch-QH2iiv6j.js → ScopedSwitch-yznbaSh9.js} +2 -2
  37. package/dist/client/assets/{SettingsPanels-BRQsxDAj.js → SettingsPanels-DdhZ2nXb.js} +2 -2
  38. package/dist/client/assets/{SettingsPanels.logic-DADnLbJa.js → SettingsPanels.logic-DIuWE5Xf.js} +2 -2
  39. package/dist/client/assets/{SettingsScopeNotice-D8WXgfaz.js → SettingsScopeNotice-D8K81IzP.js} +2 -2
  40. package/dist/client/assets/{ThemeEditorPanel-UEzfMVAc.js → ThemeEditorPanel-ePX4nwaV.js} +2 -2
  41. package/dist/client/assets/{ThreadTerminalDrawer-Do19kCZu.js → ThreadTerminalDrawer-5z4y3z0y.js} +2 -2
  42. package/dist/client/assets/{Virtualizer-BSpDafyf.js → Virtualizer-DEM6HN7-.js} +2 -2
  43. package/dist/client/assets/{_chat-D4YotsBW.js → _chat-C0vR23gu.js} +5 -5
  44. package/dist/client/assets/{_chat.design-BPvdgNpo.js → _chat.design-CQ52N70I.js} +2 -2
  45. package/dist/client/assets/{_chat.index-Z_VqAv7I.js → _chat.index-SFAYIX_P.js} +2 -2
  46. package/dist/client/assets/{_chat.new-DOi-AUHb.js → _chat.new-BO6oEisx.js} +2 -2
  47. package/dist/client/assets/{_chat.pull-requests-6QyjmUBZ.js → _chat.pull-requests-BfyCJw7Q.js} +2 -2
  48. package/dist/client/assets/{abnfDiagram-VCTEODGH--jeYDB6y.js → abnfDiagram-VCTEODGH-DhiN6SMz.js} +2 -2
  49. package/dist/client/assets/architecture-7GRP2DOG-Yd6b7qRF.js +1 -0
  50. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CZT297Q4.js → architectureDiagram-5GKGNRK7-bs37U5FM.js} +2 -2
  51. package/dist/client/assets/{assets-CJFG5Oow.js → assets-BU-ex_t8.js} +2 -2
  52. package/dist/client/assets/{blockDiagram-I7D4REHJ-EkNtHyvf.js → blockDiagram-I7D4REHJ-Bz9mN89n.js} +2 -2
  53. package/dist/client/assets/{browserHistoryStore-DO5WuJ8O.js → browserHistoryStore-KDG9Uz1t.js} +2 -2
  54. package/dist/client/assets/{browserLinkTarget-CJGymzWC.js → browserLinkTarget-DmKK3HY0.js} +2 -2
  55. package/dist/client/assets/{c4Diagram-7LVT6UL2-CWpB4Da8.js → c4Diagram-7LVT6UL2-CtkHQd_E.js} +2 -2
  56. package/dist/client/assets/channel-DrCQqhMU.js +2 -0
  57. package/dist/client/assets/{chunk-4HAMMTFA-DmxkShmg.js → chunk-4HAMMTFA-BtUnQAH6.js} +2 -2
  58. package/dist/client/assets/{chunk-75Z2AOVW-DR0PpYOm.js → chunk-75Z2AOVW-CwSe19lZ.js} +2 -2
  59. package/dist/client/assets/{chunk-DU6HZSFF-BO8x-KoS.js → chunk-DU6HZSFF-Bwy7A0TF.js} +2 -2
  60. package/dist/client/assets/{chunk-F27PBJKO-Bj6z3Mgi.js → chunk-F27PBJKO-CVsi2uk3.js} +2 -2
  61. package/dist/client/assets/{chunk-GMAD6QVW-DDPfmhbi.js → chunk-GMAD6QVW-CVzXn5Hv.js} +2 -2
  62. package/dist/client/assets/{chunk-GVQU2GXP-Dt2y3Ljq.js → chunk-GVQU2GXP-7pPJVhuz.js} +2 -2
  63. package/dist/client/assets/{chunk-IMKFNOWR-ulVnFkwU.js → chunk-IMKFNOWR-D-dmx49n.js} +2 -2
  64. package/dist/client/assets/{chunk-L3NEJ4N5-Bq_d7JXK.js → chunk-L3NEJ4N5-DEJnMXSk.js} +2 -2
  65. package/dist/client/assets/{chunk-OSK3NFVY-D3zjZoqS.js → chunk-OSK3NFVY-CBtNmbZ8.js} +2 -2
  66. package/dist/client/assets/{chunk-P2QGCYS3-BO8zGK2Q.js → chunk-P2QGCYS3-TNHN3Sve.js} +2 -2
  67. package/dist/client/assets/{chunk-POPQ4Y6H-gzBrIuwg.js → chunk-POPQ4Y6H-1cq1nl-Z.js} +2 -2
  68. package/dist/client/assets/{chunk-PWAF6VOD-D5kNvXnl.js → chunk-PWAF6VOD-B85KpsBk.js} +2 -2
  69. package/dist/client/assets/{chunk-SHT3W25Y-BUoRhLSC.js → chunk-SHT3W25Y-3tA2UDk1.js} +2 -2
  70. package/dist/client/assets/{chunk-SVP7TREG-Bjv2VnZc.js → chunk-SVP7TREG-CHzBNDDY.js} +2 -2
  71. package/dist/client/assets/{chunk-TICWLB2K-DAdtg5Kx.js → chunk-TICWLB2K-MeLbkhnz.js} +2 -2
  72. package/dist/client/assets/classDiagram-ZZMXUADV-MCjIu9oU.js +2 -0
  73. package/dist/client/assets/classDiagram-v2-VYDZK3BY-MCjIu9oU.js +2 -0
  74. package/dist/client/assets/{composer-logic-LXlav2Vb.js → composer-logic-DyIi6K9e.js} +2 -2
  75. package/dist/client/assets/{composerDraftUploads-ykQlcbPE.js → composerDraftUploads-BEFyD-t4.js} +2 -2
  76. package/dist/client/assets/{connect-BtrTxy8-.js → connect-BUAMGrjt.js} +2 -2
  77. package/dist/client/assets/{connect-agent-CVmArWh1.js → connect-agent-BNwEsc4t.js} +2 -2
  78. package/dist/client/assets/{cynefin-OW5HDTMX-DOViMxbO.js → cynefin-OW5HDTMX-DTUXnTov.js} +1 -1
  79. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BWRCt23-.js → cynefinDiagram-5FMLGOSQ-Cd9_EwZX.js} +2 -2
  80. package/dist/client/assets/{dagre-GXQ25YYZ-DgnOAR1P.js → dagre-GXQ25YYZ-D0hUgab8.js} +2 -2
  81. package/dist/client/assets/{design-D2FoGDbP.js → design-DaqMSnWJ.js} +2 -2
  82. package/dist/client/assets/{device-CdLsoK0D.js → device-DnfWBPpo.js} +2 -2
  83. package/dist/client/assets/{diagram-S7CK7UJ4-C-BUdvbR.js → diagram-S7CK7UJ4-DY-wIVhL.js} +2 -2
  84. package/dist/client/assets/{diagram-UQ7AKVKN-CYox921O.js → diagram-UQ7AKVKN-CmWAx8wR.js} +2 -2
  85. package/dist/client/assets/{diagram-VSXAHHWV-CCHV1RQz.js → diagram-VSXAHHWV-DvIYORJP.js} +2 -2
  86. package/dist/client/assets/{diagram-VX7I27RA-B4SkxxZx.js → diagram-VX7I27RA-Dj3l0KCm.js} +2 -2
  87. package/dist/client/assets/{diagram-Z3DM3KII-D80OJGVQ.js → diagram-Z3DM3KII-ClP8dtWB.js} +2 -2
  88. package/dist/client/assets/{diffRendering-CdquEtfn.js → diffRendering-BWY0g219.js} +2 -2
  89. package/dist/client/assets/{dist-DWlOCBGN.js → dist-C5JAYxip.js} +2 -2
  90. package/dist/client/assets/{duoViewer-Cig0lw70.js → duoViewer-fztyITHM.js} +2 -2
  91. package/dist/client/assets/{dynamic-DUhOBcsP.js → dynamic-CnYAeR9T.js} +2 -2
  92. package/dist/client/assets/{ebnfDiagram-PWID7BFC-AJpsDjYU.js → ebnfDiagram-PWID7BFC-DtbBVfJO.js} +2 -2
  93. package/dist/client/assets/{embeddedScripts-DVwzRCwI.js → embeddedScripts-Bf2j7tmA.js} +2 -2
  94. package/dist/client/assets/{entities-BBhhC0Ry.js → entities-BJgMc8pv.js} +2 -2
  95. package/dist/client/assets/{erDiagram-RLTQ6QDP-qU4wtJw2.js → erDiagram-RLTQ6QDP-Dm2mBAGp.js} +2 -2
  96. package/dist/client/assets/eventmodeling-NTZA5JFV-rDo_pcJr.js +1 -0
  97. package/dist/client/assets/{fileLinks-16LrhkMX.js → fileLinks-C9oYzhXv.js} +2 -2
  98. package/dist/client/assets/{fileTreeExpansion-BwModZ8t.js → fileTreeExpansion-CpkONCrM.js} +2 -2
  99. package/dist/client/assets/flowDiagram-HODETNUW-C55XBPww.js +1 -0
  100. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CMa5sD7U.js → ganttDiagram-EL5Y4UJY-D4UHegQH.js} +2 -2
  101. package/dist/client/assets/{getDiffFileInput-CMp2lO2J.js → getDiffFileInput-BKRfCrth.js} +2 -2
  102. package/dist/client/assets/ghostty-write-pty-BWDOU6dy.wasm +0 -0
  103. package/dist/client/assets/{gitGraph-4MIJSDKK-d8ivfU97.js → gitGraph-4MIJSDKK-BUhEDO22.js} +1 -1
  104. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-dltGGWCt.js → gitGraphDiagram-WWUBYQGX-BwJT0OjN.js} +2 -2
  105. package/dist/client/assets/{guideRunStore-CKZDf9-2.js → guideRunStore-DkBR0CPU.js} +2 -2
  106. package/dist/client/assets/{index-oiPu1asR.js → index-BYQ1ybfT.js} +3 -3
  107. package/dist/client/assets/{info-A6RAGUB7-B_ozJ3Df.js → info-A6RAGUB7-scwAD75p.js} +1 -1
  108. package/dist/client/assets/{infoDiagram-27XIBGKW-BiB0fE5_.js → infoDiagram-27XIBGKW-BgR5Wn6l.js} +2 -2
  109. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhfuI9PX.js → ishikawaDiagram-5VMMS53U-BOnOvOet.js} +2 -2
  110. package/dist/client/assets/{journeyDiagram-3NMN7TZE-8alknR0e.js → journeyDiagram-3NMN7TZE-B1wXWe62.js} +2 -2
  111. package/dist/client/assets/{kanban-definition-UXKFOSKX-IrCQ1z1D.js → kanban-definition-UXKFOSKX-DI-FwQ_D.js} +2 -2
  112. package/dist/client/assets/{line-wwHo_z2p.js → line-c6BqGnEH.js} +2 -2
  113. package/dist/client/assets/{linkedPrompt-P6UqYCja.js → linkedPrompt-DjSidfRe.js} +2 -2
  114. package/dist/client/assets/{main-COMts6-0.js → main-4dRVuXx2.js} +7 -7
  115. package/dist/client/assets/{mediaReference-C10FT-nO.js → mediaReference-CWzBBNFa.js} +2 -2
  116. package/dist/client/assets/{mediaSource-tGWQYhPt.js → mediaSource-CHfRwmOf.js} +2 -2
  117. package/dist/client/assets/{mermaid-parser.core-YE1Gxotj.js → mermaid-parser.core-DOOH_cP_.js} +4 -4
  118. package/dist/client/assets/{mermaid.core-DE9uOpTH.js → mermaid.core-9Tao6ZdD.js} +5 -5
  119. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CLa2hbBW.js → mindmap-definition-YA3MSWOX-CqmRXnVH.js} +2 -2
  120. package/dist/client/assets/{onboarding-DCwprQF7.js → onboarding-BmDFkmWD.js} +2 -2
  121. package/dist/client/assets/{openFileInPreview-Dj9ZUFfJ.js → openFileInPreview-DF_vZEIK.js} +2 -2
  122. package/dist/client/assets/{p4ProjectFile-DfE23uqD.js → p4ProjectFile-YfIRB1xP.js} +2 -2
  123. package/dist/client/assets/{packet-AYTQ26CC-Be9nXFns.js → packet-AYTQ26CC-B8LkZ5j3.js} +1 -1
  124. package/dist/client/assets/{pair-CZDxH6ja.js → pair-DSE8uuft.js} +2 -2
  125. package/dist/client/assets/{pegDiagram-XKGWAZYB-C230ixTv.js → pegDiagram-XKGWAZYB-CS17GwTP.js} +2 -2
  126. package/dist/client/assets/{phoneViewer-CdFM4t6r.js → phoneViewer-CYzqv5af.js} +2 -2
  127. package/dist/client/assets/{pie-WAS4IAKB-DdxLVm9y.js → pie-WAS4IAKB-B0WBcNHW.js} +1 -1
  128. package/dist/client/assets/{pieDiagram-E7YTZNPT-AK3e5d1A.js → pieDiagram-E7YTZNPT-Bk2IwUHp.js} +2 -2
  129. package/dist/client/assets/{pierre-icons-BodtO6xC.js → pierre-icons-CY4HbMoq.js} +2 -2
  130. package/dist/client/assets/{preview-x-GNJPih.js → preview-B5v36DP8.js} +2 -2
  131. package/dist/client/assets/{primary-BDy4SXjC.js → primary-BKQnuXrW.js} +2 -2
  132. package/dist/client/assets/{primaryCloudLinkState--Kh80aBj.js → primaryCloudLinkState-CJSCsrUH.js} +2 -2
  133. package/dist/client/assets/{projectFilesQueryState-Bb-3twEo.js → projectFilesQueryState-DltGYM_H.js} +2 -2
  134. package/dist/client/assets/{projectScriptEditor-CAk1a7Bv.js → projectScriptEditor-CZb_iNq3.js} +2 -2
  135. package/dist/client/assets/{providerSkills-9AaADmXt.js → providerSkills-Ct4SZ-mY.js} +2 -2
  136. package/dist/client/assets/{pullRequestDetail.logic-Fv7ouL_B.js → pullRequestDetail.logic-COstpMB1.js} +2 -2
  137. package/dist/client/assets/{pullRequests-I9yJXxf5.js → pullRequests-ClG7PJe0.js} +2 -2
  138. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-CcagVHbG.js → quadrantDiagram-AXDQQJYC-B0vWHjBG.js} +2 -2
  139. package/dist/client/assets/{queries-DY5q7KFy.js → queries-BWcz-n4a.js} +2 -2
  140. package/dist/client/assets/{radar-RG4KPBEZ-YiDR7Sp-.js → radar-RG4KPBEZ-DmYBXYPt.js} +1 -1
  141. package/dist/client/assets/{railroad-74A4TZTK-Cg9vU93U.js → railroad-74A4TZTK-D-4grcyc.js} +1 -1
  142. package/dist/client/assets/railroad-abnf-HS5TGJTU-6H_zYY6R.js +1 -0
  143. package/dist/client/assets/railroad-ebnf-LZEXJU2U-DYahAqN_.js +1 -0
  144. package/dist/client/assets/railroad-peg-WCYAUIDC-CdcgHAXA.js +1 -0
  145. package/dist/client/assets/{railroadDiagram-O6MQD6OU-DKJFQoet.js → railroadDiagram-O6MQD6OU-C7n4Qist.js} +2 -2
  146. package/dist/client/assets/{renderScheduler-skv2ZK84.js → renderScheduler-DrstEe4y.js} +2 -2
  147. package/dist/client/assets/{requirementDiagram-BXWQKSXE-CsnTqOO2.js → requirementDiagram-BXWQKSXE-BYX3uen6.js} +2 -2
  148. package/dist/client/assets/{runtime-BSS7jQw6.js → runtime-CArTL2GH.js} +2 -2
  149. package/dist/client/assets/{runtime-D-mOwjrE.js → runtime-Cj24N7je.js} +3 -3
  150. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DkydPO4_.js → sankeyDiagram-P5KCCOFB-tAgp-_Ny.js} +2 -2
  151. package/dist/client/assets/{scheduledTasksSettings.logic-C-rCAoCn.js → scheduledTasksSettings.logic-zleH3iJ_.js} +2 -2
  152. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-Df0N4Qqb.js → sequenceDiagram-WJ2MYXX4-DlvnWAh_.js} +2 -2
  153. package/dist/client/assets/{server-WufAYYa2.js → server-Vynm5NwP.js} +2 -2
  154. package/dist/client/assets/{session-pjgqVscl.js → session-DyiiEN5g.js} +2 -2
  155. package/dist/client/assets/{session-logic-VyTvpA5f.js → session-logic-B8t9Dfk3.js} +2 -2
  156. package/dist/client/assets/{settings-CsOciX79.js → settings-CjeBlT1I.js} +2 -2
  157. package/dist/client/assets/{settings.appearance-BTa_DZJP.js → settings.appearance-DUvYlE0y.js} +2 -2
  158. package/dist/client/assets/settings.archived-B5WGVqfk.js +2 -0
  159. package/dist/client/assets/{settings.computer-use-0aB9RoDX.js → settings.computer-use-S7DPGiAx.js} +2 -2
  160. package/dist/client/assets/{settings.connections-DUkG_06v.js → settings.connections-DJEqNVad.js} +2 -2
  161. package/dist/client/assets/{settings.data-controls-Cn2MWFbv.js → settings.data-controls-Bj1pQ5cL.js} +2 -2
  162. package/dist/client/assets/{settings.decisions-nRlfWokn.js → settings.decisions-BufUBcem.js} +2 -2
  163. package/dist/client/assets/{settings.designs-CYIwYmP5.js → settings.designs-bWCNQca4.js} +2 -2
  164. package/dist/client/assets/{settings.diagnostics-pCb9rEgL.js → settings.diagnostics-Dx_NdxOm.js} +2 -2
  165. package/dist/client/assets/{settings.general-DPkJcwHC.js → settings.general-BQ6775Hi.js} +2 -2
  166. package/dist/client/assets/{settings.integrations-DVMeSb1K.js → settings.integrations-CgxBXw6p.js} +2 -2
  167. package/dist/client/assets/{settings.keybindings-PZlDKFMi.js → settings.keybindings-DrBH8mlK.js} +2 -2
  168. package/dist/client/assets/{settings.open-source-licenses-CoY0kkph.js → settings.open-source-licenses-B3CGE-JI.js} +2 -2
  169. package/dist/client/assets/{settings.plugins-DCo7nzjN.js → settings.plugins-BGUgmDOY.js} +2 -2
  170. package/dist/client/assets/{settings.projects-iA51Y3aj.js → settings.projects-BJ1cpGGM.js} +3 -3
  171. package/dist/client/assets/{settings.providers-BkUKaZF-.js → settings.providers-D2I5mNzk.js} +3 -3
  172. package/dist/client/assets/{settings.scheduled-tasks-C0FpV34l.js → settings.scheduled-tasks-D8hRaqp8.js} +2 -2
  173. package/dist/client/assets/{settings.snap-shot-C29-fDJw.js → settings.snap-shot-C2X5_E0H.js} +2 -2
  174. package/dist/client/assets/{settings.source-control-CqLszsPJ.js → settings.source-control-Dvac_5mZ.js} +2 -2
  175. package/dist/client/assets/{settings.storage-JCo0X6p0.js → settings.storage-1JdpL3lo.js} +2 -2
  176. package/dist/client/assets/{settingsLayout-DkRcMtAs.js → settingsLayout-CuUCC6iL.js} +2 -2
  177. package/dist/client/assets/{sidebarProjectGrouping-C94BzdFc.js → sidebarProjectGrouping-r5ezKRMx.js} +2 -2
  178. package/dist/client/assets/{sourceControl-BvubWC9K.js → sourceControl-b1QZpCro.js} +2 -2
  179. package/dist/client/assets/{sourceControlClients-DKVeNHGN.js → sourceControlClients-DUvOeR-2.js} +2 -2
  180. package/dist/client/assets/{stateDiagram-D77RDMKH-Ctp0qVPg.js → stateDiagram-D77RDMKH-BOgNCEU1.js} +2 -2
  181. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-D00LPIWv.js +2 -0
  182. package/dist/client/assets/{swimlanes-42K2YHIH-_LIKBAWu.js → swimlanes-42K2YHIH-BZG7hJb7.js} +2 -2
  183. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-vkEAWikD.js +9 -0
  184. package/dist/client/assets/{terminalSessions-WR45SySR.js → terminalSessions-BHzkH7av.js} +2 -2
  185. package/dist/client/assets/{timeline-definition-24CTP7MA--fH4g9Xi.js → timeline-definition-24CTP7MA-B5YiUA25.js} +2 -2
  186. package/dist/client/assets/{toast-x69BFrW5.js → toast-B3hjhWRf.js} +2 -2
  187. package/dist/client/assets/{treeView-Q6P3EWNA-BYF4NjYA.js → treeView-Q6P3EWNA-Cb4H3xoG.js} +1 -1
  188. package/dist/client/assets/{treemap-WGGIJYW6-DTEnfmuA.js → treemap-WGGIJYW6-BdpTgSX1.js} +1 -1
  189. package/dist/client/assets/{uiStateStore-CP4WDmc8.js → uiStateStore-DoJ0IbwQ.js} +2 -2
  190. package/dist/client/assets/{usage-C8NW06hk.js → usage-C2lJ6qWL.js} +2 -2
  191. package/dist/client/assets/{use-atom-command-rhVarDA8.js → use-atom-command-D34CFqu3.js} +2 -2
  192. package/dist/client/assets/{useHandleNewThread-Bhl1v82B.js → useHandleNewThread-DtUtwJAY.js} +2 -2
  193. package/dist/client/assets/{useP4ConnectAuthPrompt-ubtmHQ6f.js → useP4ConnectAuthPrompt-D4kHnZ3Q.js} +2 -2
  194. package/dist/client/assets/{usePullRequestActions-Djf1UHJs.js → usePullRequestActions-BypvA9CK.js} +2 -2
  195. package/dist/client/assets/{useScopedModelAvailability-BAzgc0gB.js → useScopedModelAvailability-YXOv7_8D.js} +2 -2
  196. package/dist/client/assets/{useSettings-BNs1IeKk.js → useSettings-BcmuuiTp.js} +2 -2
  197. package/dist/client/assets/{vcsRefInvalidation-DmqB0sWy.js → vcsRefInvalidation-hPKz3TmL.js} +2 -2
  198. package/dist/client/assets/{vennDiagram-4TSXK5OY-BzIqk05W.js → vennDiagram-4TSXK5OY-D4zvlwrY.js} +2 -2
  199. package/dist/client/assets/{wardley-WFR3VGLG-CWuiB19I.js → wardley-WFR3VGLG-Cscy0eBS.js} +1 -1
  200. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-C3KRakQk.js → wardleyDiagram-VM6X3IG4-od5X9Ppf.js} +2 -2
  201. package/dist/client/assets/{welcome-BFUhADQd.js → welcome-7UQgfS5x.js} +2 -2
  202. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-cK0SAbmi.js → xychartDiagram-S5SC5T6Z-KWfWaW4I.js} +2 -2
  203. package/dist/client/index.html +1 -1
  204. package/package.json +1 -1
  205. package/dist/client/assets/architecture-7GRP2DOG-5FKzTtFB.js +0 -1
  206. package/dist/client/assets/channel-mtMr1s7n.js +0 -2
  207. package/dist/client/assets/classDiagram-ZZMXUADV-B1oFCLrU.js +0 -2
  208. package/dist/client/assets/classDiagram-v2-VYDZK3BY-B1oFCLrU.js +0 -2
  209. package/dist/client/assets/eventmodeling-NTZA5JFV-CIzOZUSe.js +0 -1
  210. package/dist/client/assets/flowDiagram-HODETNUW-G6NoS3v2.js +0 -1
  211. package/dist/client/assets/ghostty-write-pty-hgyAvVbe.wasm +0 -0
  212. package/dist/client/assets/railroad-abnf-HS5TGJTU-CFQBiMqT.js +0 -1
  213. package/dist/client/assets/railroad-ebnf-LZEXJU2U-KvUMMzpJ.js +0 -1
  214. package/dist/client/assets/railroad-peg-WCYAUIDC-ps7Jjity.js +0 -1
  215. package/dist/client/assets/settings.archived-5E_Gxvpz.js +0 -2
  216. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DTjnbS5I.js +0 -2
  217. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BEo2_7TC.js +0 -9
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-2OTuKeLP.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-hgbJ2TVM.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-D-mOwjrE.js","assets/runtime-BSS7jQw6.js","assets/TooltipViewport-DJ2VRKCt.js","assets/toast-x69BFrW5.js","assets/spinner-Bzrp5oww.js","assets/useParams-Br7l7qPU.js","assets/DiffFileTree-CaPQB8J4.js","assets/useSettings-BNs1IeKk.js","assets/server-WufAYYa2.js","assets/session-pjgqVscl.js","assets/use-atom-command-rhVarDA8.js","assets/themePalette-CLR_iiPi.js","assets/diffRendering-CdquEtfn.js","assets/index-oiPu1asR.js","assets/fileTreeExpansion-BwModZ8t.js","assets/pierre-icons-BodtO6xC.js","assets/query-BFP47tsD.js","assets/DiffCommentAnnotation-mA-RZ8Su.js","assets/Virtualizer-BSpDafyf.js","assets/getDiffFileInput-CMp2lO2J.js","assets/main-COMts6-0.js","assets/vcsRefInvalidation-DmqB0sWy.js","assets/entities-BBhhC0Ry.js","assets/number-field-Dj0uYTJQ.js","assets/useRegisterFieldControl-qXOWsCr5.js","assets/FormContext-Vtmj_mkP.js","assets/CSPContext-BjqtxKhA.js","assets/select-Bsag72zE.js","assets/SelectScrollUpArrow-D_o_f6Fh.js","assets/link-BjP3qTK9.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-CByGrW41.js","assets/useNavigate-DCj963r2.js","assets/useLocation-7uJHNdPS.js","assets/rightPanelStore-XfAJpUIA.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-DY5q7KFy.js","assets/session-logic-VyTvpA5f.js","assets/htmlRender-BUb_wWp9.js","assets/mediaSource-tGWQYhPt.js","assets/fileLinks-16LrhkMX.js","assets/mediaReference-C10FT-nO.js","assets/usageFormat-C54RJiV9.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-D-SzZpgJ.js","assets/skeleton-Bq50sEah.js","assets/useAriaLabelledBy-BG5RCb1o.js","assets/toggle-ExdxBJoI.js","assets/toggle-group-Clz6KDtW.js","assets/CompositeRoot-Bg5KGYGp.js","assets/input-D_jxqXLR.js","assets/Input-B0ah2lnC.js","assets/FieldControl-mq4xNgmP.js","assets/scroll-area-DORwTFtw.js","assets/ScrollAreaCorner-3gSiyg8H.js","assets/dist-DWlOCBGN.js","assets/DialogTitle-CVP748Gv.js","assets/dialog-Cgb4jap2.js","assets/sidebar-CV_a9dPF.js","assets/useResizeDrag-KJl_F2EN.js","assets/observeResize-jHx61cGA.js","assets/AnimatedHeight-wZzihILs.js","assets/assets-CJFG5Oow.js","assets/sourceControl-BvubWC9K.js","assets/openFileInPreview-Dj9ZUFfJ.js","assets/browserHistoryStore-DO5WuJ8O.js","assets/preview-8bBtJM5H.js","assets/keybindings-CqjUKNRx.js","assets/Icons-C0Zjws-3.js","assets/preview-x-GNJPih.js","assets/PierreEntryIcon--dw21QmY.js","assets/RenderErrorBoundary-CReszKsZ.js","assets/sourceControlClients-DKVeNHGN.js","assets/browserLinkTarget-CJGymzWC.js","assets/pullRequestIcons-e8EZW8_y.js","assets/pullRequests-I9yJXxf5.js","assets/threadSort-Bd2rijEy.js","assets/popover-2XJd3KEJ.js","assets/PopoverHandle-BT83XTq9.js","assets/ProjectFavicon--HkFaTb7.js","assets/ProjectMonogram-BUy_N1of.js","assets/projectFilesQueryState-Bb-3twEo.js","assets/checkbox-Q0bv8RvC.js","assets/CheckboxIndicator-CuZi7Ixm.js","assets/FieldItemContext-Bn6xBVJg.js","assets/terminalSessions-WR45SySR.js","assets/AlertDialogRoot-Cc8kVCUa.js","assets/uiStateStore-CP4WDmc8.js","assets/composer-logic-LXlav2Vb.js","assets/useHandleNewThread-Bhl1v82B.js","assets/p4ProjectFile-DfE23uqD.js","assets/composerDraftUploads-ykQlcbPE.js","assets/guideRunStore-CKZDf9-2.js","assets/pullRequestDetail.logic-Fv7ouL_B.js","assets/pullRequestReviewStore-DJx8EOVl.js","assets/sidebarProjectGrouping-C94BzdFc.js","assets/EnvironmentMachineIcon-B2v_GWgB.js","assets/alert-CdZT7d18.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-BDCO7XMy.js","assets/kbd-B2uytHus.js","assets/settingsLayout-DkRcMtAs.js","assets/WorkspacePageContainer-BTN44jG6.js","assets/KeybindingsSettings.logic-D-GClV-c.js","assets/usageShortcuts-B3af64g0.js","assets/primaryCloudLinkState--Kh80aBj.js","assets/command-CIj8Rufv.js","assets/ComboboxClear-zheEdyAa.js","assets/ComboboxGroupLabel-BxCdL7I3.js","assets/ConnectionStatusDot-Bx8Imvqc.js","assets/standalone-page-BGqmgLmI.js","assets/primary-BDy4SXjC.js","assets/onboarding-DCwprQF7.js","assets/scheduledTasksSettings.logic-C-rCAoCn.js","assets/main-Dwir4BoC.css","assets/DiffWorkerPoolProvider-BOInEqDW.js","assets/textarea-wDfYVvpo.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-oiPu1asR.js";import{r as n}from"./Icon-l19w4AjM.js";import{$h as r,$n as i,$o as a,A as o,As as s,Ay as c,Cd as l,Cm as u,D as d,Dp as f,Ds as p,Ey as m,F as h,Gf as g,Hm as _,Ip as v,Jm as y,Jn as b,Jp as x,Km as S,Kn as C,Md as w,Of as T,Om as E,Qd as D,Qs as O,Qu as k,RE as A,S_ as j,Sa as M,Sd as N,Sl as P,Tp as F,Uf as I,Uy as L,Wd as R,Xd as z,Xn as B,Xs as V,Xu as H,Yn as ee,Yo as te,Ys as ne,Zd as re,Zn as U,Zu as ie,bd as ae,bm as oe,cd as se,cm as ce,cr as le,ef as ue,em as de,er as fe,ff as pe,hp as me,id as he,ip as ge,ir as _e,jf as ve,jm as ye,jp as be,k_ as xe,kp as Se,ks as Ce,lm as we,lr as W,mE as Te,mm as Ee,nf as De,op as Oe,qm as ke,qn as Ae,qp as je,rp as Me,rr as Ne,sf as Pe,t as G,tf as Fe,tr as Ie,um as Le,ur as Re,wd as ze,wp as Be,xd as Ve,xf as He,yf as Ue,zm as We,zp as Ge}from"./utils-hgbJ2TVM.js";import{W as Ke}from"./runtime-D-mOwjrE.js";import{A as qe,T as Je,k as Ye,w as Xe}from"./entities-BBhhC0Ry.js";import{dn as Ze,fn as Qe,mn as $e,nn as et,sn as tt,un as nt}from"./runtime-BSS7jQw6.js";import{G as rt,N as it,P as at,W as ot,_ as st,l as ct,y as lt}from"./TooltipViewport-DJ2VRKCt.js";import{$ as ut,B as dt,n as ft,z as pt}from"./ChatMarkdown-CDno8Ayh.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-Bsag72zE.js";import{t as vt}from"./spinner-Bzrp5oww.js";import{i as yt,m as bt,p as xt}from"./toast-x69BFrW5.js";import{E as St,J as Ct,K as wt,f as Tt}from"./useSettings-BNs1IeKk.js";import{s as Et}from"./server-WufAYYa2.js";import{i as Dt,n as Ot}from"./session-pjgqVscl.js";import{n as kt}from"./query-BFP47tsD.js";import{t as At}from"./use-atom-command-rhVarDA8.js";import{t as jt,u as Mt}from"./rightPanelStore-XfAJpUIA.js";import{u as Nt}from"./queries-DY5q7KFy.js";import{C as K,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-CdquEtfn.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-BSpDafyf.js";import{l as ln,ut as un}from"./getDiffFileInput-CMp2lO2J.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-BOInEqDW.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-DLYKd8S8.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-mA-RZ8Su.js";import{r as Tn}from"./mediaSource-tGWQYhPt.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{a as q,n as J,r as On,t as Y}from"./tooltip-D-SzZpgJ.js";import{t as kn}from"./skeleton-Bq50sEah.js";import{t as An}from"./textarea-wDfYVvpo.js";import{t as jn}from"./toggle-ExdxBJoI.js";import{n as Mn,t as Nn}from"./toggle-group-Clz6KDtW.js";import{i as Pn,l as Fn,o as In,r as Ln,s as Rn,t as zn}from"./combobox-BdGKdc6i.js";import{t as Bn}from"./input-D_jxqXLR.js";import{t as Vn}from"./scroll-area-DORwTFtw.js";import{a as Hn,c as Un,i as Wn,o as Gn,r as Kn,s as qn,t as Jn}from"./dialog-Cgb4jap2.js";import{t as Yn}from"./useResizeDrag-KJl_F2EN.js";import{a as Xn,i as Zn,o as Qn,r as $n,t as er}from"./empty-DHl8_LXy.js";import{i as tr}from"./device-CdLsoK0D.js";import{t as nr}from"./observeResize-jHx61cGA.js";import{o as rr,s as ir}from"./openFileInPreview-Dj9ZUFfJ.js";import{f as ar}from"./browserHistoryStore-DO5WuJ8O.js";import{_ as or,y as sr}from"./keybindings-CqjUKNRx.js";import{i as cr,n as lr}from"./Icons-C0Zjws-3.js";import{t as ur}from"./PierreEntryIcon--dw21QmY.js";import{F as dr,H as fr,U as pr,_ as mr,a as hr,b as gr,c as _r,d as vr,f as yr,g as br,h as xr,i as Sr,m as Cr,n as wr,o as Tr,p as Er,r as Dr,s as Or,u as kr,v as Ar,x as jr,y as Mr}from"./RenderErrorBoundary-CReszKsZ.js";import{n as Nr,r as Pr}from"./sourceControlClients-DKVeNHGN.js";import{n as X}from"./pullRequestIcons-e8EZW8_y.js";import{D as Fr,a as Ir,c as Lr,i as Rr,k as zr,n as Br,r as Vr,u as Hr}from"./pullRequests-I9yJXxf5.js";import{a as Ur,i as Wr,n as Gr,o as Kr,t as qr}from"./popover-2XJd3KEJ.js";import{A as Jr,B as Yr,C as Xr,D as Zr,E as Qr,H as $r,I as ei,K as ti,L as ni,M as ri,N as ii,O as ai,P as oi,R as si,S as ci,T as li,U as ui,V as di,X as fi,Y as pi,_ as mi,a as hi,b as gi,c as _i,d as vi,f as yi,g as bi,i as xi,j as Si,k as Ci,l as wi,o as Ti,p as Ei,q as Di,r as Oi,s as ki,t as Ai,v as ji,w as Mi,y as Ni,z as Pi}from"./pullRequestDetail.logic-Fv7ouL_B.js";import{i as Fi,n as Ii,r as Li,t as Ri}from"./pullRequestReviewStore-DJx8EOVl.js";import{t as zi}from"./terminalLabels-BgLOlb2G.js";import{_ as Bi,c as Vi,f as Hi,g as Ui,i as Wi,o as Gi,p as Ki,r as qi,u as Ji,v as Yi}from"./uiStateStore-CP4WDmc8.js";import{n as Xi}from"./useHandleNewThread-Bhl1v82B.js";import{i as Zi,m as Qi,n as $i,r as ea,t as ta}from"./guideRunStore-CKZDf9-2.js";import{n as na}from"./EnvironmentMachineIcon-B2v_GWgB.js";import{i as ra,n as ia,r as aa,t as oa}from"./alert-CdZT7d18.js";import{t as sa}from"./kbd-B2uytHus.js";import{d as ca,l as la,t as ua,u as da}from"./command-CIj8Rufv.js";import{Bi as fa,Ca as pa,Gr as ma,Hi as ha,Wr as ga,Xt as _a,da as va,fa as ya,ma as ba,ni as xa,ri as Sa,ua as Ca}from"./main-COMts6-0.js";import"./WorkspacePageHeader-BaCxaW-R.js";import{r as wa,s as Ta,t as Ea}from"./usePullRequestActions-Djf1UHJs.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-hXtKZAP9.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-hgbJ2TVM.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-Cj24N7je.js","assets/runtime-CArTL2GH.js","assets/TooltipViewport-DJ2VRKCt.js","assets/toast-B3hjhWRf.js","assets/spinner-Bzrp5oww.js","assets/useParams-Br7l7qPU.js","assets/DiffFileTree-BgjyfH71.js","assets/useSettings-BcmuuiTp.js","assets/server-Vynm5NwP.js","assets/session-DyiiEN5g.js","assets/use-atom-command-D34CFqu3.js","assets/themePalette-CLR_iiPi.js","assets/diffRendering-BWY0g219.js","assets/index-BYQ1ybfT.js","assets/fileTreeExpansion-CpkONCrM.js","assets/pierre-icons-CY4HbMoq.js","assets/query-BFP47tsD.js","assets/DiffCommentAnnotation-Dx-VhoLU.js","assets/Virtualizer-DEM6HN7-.js","assets/getDiffFileInput-BKRfCrth.js","assets/main-4dRVuXx2.js","assets/vcsRefInvalidation-hPKz3TmL.js","assets/entities-BJgMc8pv.js","assets/number-field-Dj0uYTJQ.js","assets/useRegisterFieldControl-qXOWsCr5.js","assets/FormContext-Vtmj_mkP.js","assets/CSPContext-BjqtxKhA.js","assets/select-Bsag72zE.js","assets/SelectScrollUpArrow-D_o_f6Fh.js","assets/link-BjP3qTK9.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-CByGrW41.js","assets/useNavigate-DCj963r2.js","assets/useLocation-7uJHNdPS.js","assets/rightPanelStore-XfAJpUIA.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-BWcz-n4a.js","assets/session-logic-B8t9Dfk3.js","assets/htmlRender-BUb_wWp9.js","assets/mediaSource-CHfRwmOf.js","assets/fileLinks-C9oYzhXv.js","assets/mediaReference-CWzBBNFa.js","assets/usageFormat-C54RJiV9.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-D-SzZpgJ.js","assets/skeleton-Bq50sEah.js","assets/useAriaLabelledBy-BG5RCb1o.js","assets/toggle-ExdxBJoI.js","assets/toggle-group-Clz6KDtW.js","assets/CompositeRoot-Bg5KGYGp.js","assets/input-D_jxqXLR.js","assets/Input-B0ah2lnC.js","assets/FieldControl-mq4xNgmP.js","assets/scroll-area-DORwTFtw.js","assets/ScrollAreaCorner-3gSiyg8H.js","assets/dist-C5JAYxip.js","assets/DialogTitle-CVP748Gv.js","assets/dialog-Cgb4jap2.js","assets/sidebar-CV_a9dPF.js","assets/useResizeDrag-KJl_F2EN.js","assets/observeResize-jHx61cGA.js","assets/AnimatedHeight-wZzihILs.js","assets/assets-BU-ex_t8.js","assets/sourceControl-b1QZpCro.js","assets/openFileInPreview-DF_vZEIK.js","assets/browserHistoryStore-KDG9Uz1t.js","assets/preview-8bBtJM5H.js","assets/keybindings-CqjUKNRx.js","assets/Icons-C0Zjws-3.js","assets/preview-B5v36DP8.js","assets/PierreEntryIcon-Ddl-VPd4.js","assets/RenderErrorBoundary-BkcvpgEh.js","assets/sourceControlClients-DUvOeR-2.js","assets/browserLinkTarget-DmKK3HY0.js","assets/pullRequestIcons-e8EZW8_y.js","assets/pullRequests-ClG7PJe0.js","assets/threadSort-Bd2rijEy.js","assets/popover-2XJd3KEJ.js","assets/PopoverHandle-BT83XTq9.js","assets/ProjectFavicon-BDaMxno-.js","assets/ProjectMonogram-BUy_N1of.js","assets/projectFilesQueryState-DltGYM_H.js","assets/checkbox-Q0bv8RvC.js","assets/CheckboxIndicator-CuZi7Ixm.js","assets/FieldItemContext-Bn6xBVJg.js","assets/terminalSessions-BHzkH7av.js","assets/AlertDialogRoot-Cc8kVCUa.js","assets/uiStateStore-DoJ0IbwQ.js","assets/composer-logic-DyIi6K9e.js","assets/useHandleNewThread-DtUtwJAY.js","assets/p4ProjectFile-YfIRB1xP.js","assets/composerDraftUploads-BEFyD-t4.js","assets/guideRunStore-DkBR0CPU.js","assets/pullRequestDetail.logic-COstpMB1.js","assets/pullRequestReviewStore-DJx8EOVl.js","assets/sidebarProjectGrouping-r5ezKRMx.js","assets/EnvironmentMachineIcon-B2v_GWgB.js","assets/alert-CdZT7d18.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-8lmdyDiG.js","assets/kbd-B2uytHus.js","assets/settingsLayout-CuUCC6iL.js","assets/WorkspacePageContainer-BTN44jG6.js","assets/KeybindingsSettings.logic-D-GClV-c.js","assets/usageShortcuts-B3af64g0.js","assets/primaryCloudLinkState-CJSCsrUH.js","assets/command-CIj8Rufv.js","assets/ComboboxClear-zheEdyAa.js","assets/ComboboxGroupLabel-BxCdL7I3.js","assets/ConnectionStatusDot-Bx8Imvqc.js","assets/standalone-page-BGqmgLmI.js","assets/primary-BKQnuXrW.js","assets/onboarding-BmDFkmWD.js","assets/scheduledTasksSettings.logic-zleH3iJ_.js","assets/main-Dwir4BoC.css","assets/DiffWorkerPoolProvider-C_yNvh6o.js","assets/textarea-wDfYVvpo.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-BYQ1ybfT.js";import{r as n}from"./Icon-l19w4AjM.js";import{$h as r,$n as i,$o as a,A as o,As as s,Ay as c,Cd as l,Cm as u,D as d,Dp as f,Ds as p,Ey as m,F as h,Gf as g,Hm as _,Ip as v,Jm as y,Jn as b,Jp as x,Km as S,Kn as C,Md as w,Of as T,Om as E,Qd as D,Qs as O,Qu as k,RE as A,S_ as j,Sa as M,Sd as N,Sl as P,Tp as F,Uf as I,Uy as L,Wd as R,Xd as z,Xn as B,Xs as V,Xu as H,Yn as ee,Yo as te,Ys as ne,Zd as re,Zn as U,Zu as ie,bd as ae,bm as oe,cd as se,cm as ce,cr as le,ef as ue,em as de,er as fe,ff as pe,hp as me,id as he,ip as ge,ir as _e,jf as ve,jm as ye,jp as be,k_ as xe,kp as Se,ks as Ce,lm as we,lr as W,mE as Te,mm as Ee,nf as De,op as Oe,qm as ke,qn as Ae,qp as je,rp as Me,rr as Ne,sf as Pe,t as G,tf as Fe,tr as Ie,um as Le,ur as Re,wd as ze,wp as Be,xd as Ve,xf as He,yf as Ue,zm as We,zp as Ge}from"./utils-hgbJ2TVM.js";import{W as Ke}from"./runtime-Cj24N7je.js";import{A as qe,T as Je,k as Ye,w as Xe}from"./entities-BJgMc8pv.js";import{dn as Ze,fn as Qe,mn as $e,nn as et,sn as tt,un as nt}from"./runtime-CArTL2GH.js";import{G as rt,N as it,P as at,W as ot,_ as st,l as ct,y as lt}from"./TooltipViewport-DJ2VRKCt.js";import{$ as ut,B as dt,n as ft,z as pt}from"./ChatMarkdown-Cd3yE4VU.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-Bsag72zE.js";import{t as vt}from"./spinner-Bzrp5oww.js";import{i as yt,m as bt,p as xt}from"./toast-B3hjhWRf.js";import{E as St,J as Ct,K as wt,f as Tt}from"./useSettings-BcmuuiTp.js";import{s as Et}from"./server-Vynm5NwP.js";import{i as Dt,n as Ot}from"./session-DyiiEN5g.js";import{n as kt}from"./query-BFP47tsD.js";import{t as At}from"./use-atom-command-D34CFqu3.js";import{t as jt,u as Mt}from"./rightPanelStore-XfAJpUIA.js";import{u as Nt}from"./queries-BWcz-n4a.js";import{C as K,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-BWY0g219.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-DEM6HN7-.js";import{l as ln,ut as un}from"./getDiffFileInput-BKRfCrth.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-C_yNvh6o.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-B_422yEN.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-Dx-VhoLU.js";import{r as Tn}from"./mediaSource-CHfRwmOf.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{a as q,n as J,r as On,t as Y}from"./tooltip-D-SzZpgJ.js";import{t as kn}from"./skeleton-Bq50sEah.js";import{t as An}from"./textarea-wDfYVvpo.js";import{t as jn}from"./toggle-ExdxBJoI.js";import{n as Mn,t as Nn}from"./toggle-group-Clz6KDtW.js";import{i as Pn,l as Fn,o as In,r as Ln,s as Rn,t as zn}from"./combobox-BdGKdc6i.js";import{t as Bn}from"./input-D_jxqXLR.js";import{t as Vn}from"./scroll-area-DORwTFtw.js";import{a as Hn,c as Un,i as Wn,o as Gn,r as Kn,s as qn,t as Jn}from"./dialog-Cgb4jap2.js";import{t as Yn}from"./useResizeDrag-KJl_F2EN.js";import{a as Xn,i as Zn,o as Qn,r as $n,t as er}from"./empty-DHl8_LXy.js";import{i as tr}from"./device-DnfWBPpo.js";import{t as nr}from"./observeResize-jHx61cGA.js";import{o as rr,s as ir}from"./openFileInPreview-DF_vZEIK.js";import{f as ar}from"./browserHistoryStore-KDG9Uz1t.js";import{_ as or,y as sr}from"./keybindings-CqjUKNRx.js";import{i as cr,n as lr}from"./Icons-C0Zjws-3.js";import{t as ur}from"./PierreEntryIcon-Ddl-VPd4.js";import{F as dr,H as fr,U as pr,_ as mr,a as hr,b as gr,c as _r,d as vr,f as yr,g as br,h as xr,i as Sr,m as Cr,n as wr,o as Tr,p as Er,r as Dr,s as Or,u as kr,v as Ar,x as jr,y as Mr}from"./RenderErrorBoundary-BkcvpgEh.js";import{n as Nr,r as Pr}from"./sourceControlClients-DUvOeR-2.js";import{n as X}from"./pullRequestIcons-e8EZW8_y.js";import{D as Fr,a as Ir,c as Lr,i as Rr,k as zr,n as Br,r as Vr,u as Hr}from"./pullRequests-ClG7PJe0.js";import{a as Ur,i as Wr,n as Gr,o as Kr,t as qr}from"./popover-2XJd3KEJ.js";import{A as Jr,B as Yr,C as Xr,D as Zr,E as Qr,H as $r,I as ei,K as ti,L as ni,M as ri,N as ii,O as ai,P as oi,R as si,S as ci,T as li,U as ui,V as di,X as fi,Y as pi,_ as mi,a as hi,b as gi,c as _i,d as vi,f as yi,g as bi,i as xi,j as Si,k as Ci,l as wi,o as Ti,p as Ei,q as Di,r as Oi,s as ki,t as Ai,v as ji,w as Mi,y as Ni,z as Pi}from"./pullRequestDetail.logic-COstpMB1.js";import{i as Fi,n as Ii,r as Li,t as Ri}from"./pullRequestReviewStore-DJx8EOVl.js";import{t as zi}from"./terminalLabels-BgLOlb2G.js";import{_ as Bi,c as Vi,f as Hi,g as Ui,i as Wi,o as Gi,p as Ki,r as qi,u as Ji,v as Yi}from"./uiStateStore-DoJ0IbwQ.js";import{n as Xi}from"./useHandleNewThread-DtUtwJAY.js";import{i as Zi,m as Qi,n as $i,r as ea,t as ta}from"./guideRunStore-DkBR0CPU.js";import{n as na}from"./EnvironmentMachineIcon-B2v_GWgB.js";import{i as ra,n as ia,r as aa,t as oa}from"./alert-CdZT7d18.js";import{t as sa}from"./kbd-B2uytHus.js";import{d as ca,l as la,t as ua,u as da}from"./command-CIj8Rufv.js";import{Bi as fa,Ca as pa,Gr as ma,Hi as ha,Wr as ga,Xt as _a,da as va,fa as ya,ma as ba,ni as xa,ri as Sa,ua as Ca}from"./main-4dRVuXx2.js";import"./WorkspacePageHeader-BaCxaW-R.js";import{r as wa,s as Ta,t as Ea}from"./usePullRequestActions-BypvA9CK.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-oiPu1as
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:s,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,g=m?.rows??null,_;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){_=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==g?(e=async e=>{let t=await c(e),r=Ju(t.newFile.contents,g);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]=g,t[13]=e):e=t[13],_=e}let v=_,y;t[14]!==s?.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 s?.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]=s?.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],s?.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=h(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=s!==null&&u===null,T=s?.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=o({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 k;t[32]===v?k=t[33]:(k=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=k);let A;t[34]!==C||t[35]!==w||t[36]!==f||t[37]!==O||t[38]!==k?(A={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:f,preferredHighlighter:ba,unsafeCSS:nd,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...k},t[34]=C,t[35]=w,t[36]=f,t[37]=O,t[38]=k,t[39]=A):A=t[39];let j=A,M;t[40]===n.caption?M=t[41]:(M=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]=M);let N;t[42]!==x||t[43]!==D||t[44]!==s||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]!==j||t[55]!==m?(N=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)(W,{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:j,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:()=>s?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&s!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${fc(u.position).line}`,text:``,placeholder:s.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:s.canComment?`Add to review`:`Ask agent`,...s.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{if(!s.canComment){D(e);return}s.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)(W,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(he,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=s,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]=j,t[55]=m,t[56]=N):N=t[56];let P;return t[57]!==M||t[58]!==N?(P=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[M,N]}),t[57]=M,t[58]=N,t[59]=P):P=t[59],P}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:ba,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:u,loadDiffFiles:d,diffLoading:f,commenting:p,onStep:m,onAsk:h,onFinish:g,onOpenFile:_}=e,v;t[0]===n?v=t[1]:(v=Yu(n),t[0]=n,t[1]=v);let{lettered:y,byExcerpt:b}=v,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,E,O,A,j,M,N;if(t[4]!==b||t[5]!==p||t[6]!==f||t[7]!==S||t[8]!==u||t[9]!==r||t[10]!==y||t[11]!==d||t[12]!==_||t[13]!==o||t[14]!==m||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=y.length>0;let h=C&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===h?w=t[35]:(w=G(`grid gap-8`,h),t[34]=h,t[35]=w),T=`flex min-w-0 flex-col gap-5`;let g=r+1,v;t[36]!==i||t[37]!==g?(v=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,g,` of `,i]}),t[36]=i,t[37]=g,t[38]=v):v=t[38];let x;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(W,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=x):x=t[39];let k=r+1,P;t[40]!==i||t[41]!==k?(P=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,k,` of `,i]}),t[40]=i,t[41]=k,t[42]=P):P=t[42];let F=a&&`rotate-180`,I;t[43]===F?I=t[44]:(I=G(F),t[43]=F,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,$.jsx)(Ve,{"aria-hidden":!0,className:I}),t[45]=I,t[46]=L);let R;t[47]!==P||t[48]!==L?(R=(0,$.jsxs)(ya,{render:x,children:[P,L]}),t[47]=P,t[48]=L,t[49]=R):R=t[49];let z=r===0,B;t[50]===m?B=t[51]:(B=()=>m(-1),t[50]=m,t[51]=B);let V;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(ze,{"aria-hidden":!0}),t[52]=V):V=t[52];let H;t[53]!==z||t[54]!==B?(H=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:z,onClick:B,children:V}),t[53]=z,t[54]=B,t[55]=H):H=t[55];let ee=r===i-1,te;t[56]===m?te=t[57]:(te=()=>m(1),t[56]=m,t[57]=te);let ne;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(Ve,{"aria-hidden":!0}),t[58]=ne):ne=t[58];let re;t[59]!==ee||t[60]!==te?(re=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:ee,onClick:te,children:ne}),t[59]=ee,t[60]=te,t[61]=re):re=t[61];let U;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(sa,{children:`J`}),(0,$.jsx)(sa,{children:`K`})]}),t[62]=U):U=t[62];let ie;t[63]!==H||t[64]!==re?(ie=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[H,re,U]}),t[63]=H,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]!==v||t[67]!==R||t[68]!==ie?(ae=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[v,R,ie]}),t[66]=v,t[67]=R,t[68]=ie,t[69]=ae):ae=t[69];let oe;t[70]===s?oe=t[71]:(oe=(0,$.jsx)(va,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=oe),t[72]!==o||t[73]!==a||t[74]!==ae||t[75]!==oe?(E=(0,$.jsxs)(Ca,{open:a,onOpenChange:o,children:[ae,oe]}),t[72]=o,t[73]=a,t[74]=ae,t[75]=oe,t[76]=E):E=t[76];let se;t[77]===n.title?se=t[78]:(se=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=se);let ce;t[79]===n.summary?ce=t[80]:(ce=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]=ce),t[81]!==se||t[82]!==ce?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[se,ce]}),t[81]=se,t[82]=ce,t[83]=O):O=t[83],t[84]===n.attention?A=t[85]:(A=n.attention===null?null:(0,$.jsxs)(oa,{controlAlignment:`first-line`,children:[(0,$.jsx)(D,{}),(0,$.jsx)(ra,{children:ud[n.attention.kind]}),(0,$.jsx)(aa,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(zu,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=A),t[86]!==b||t[87]!==p||t[88]!==f||t[89]!==u||t[90]!==d||t[91]!==_||t[92]!==n.excerpts?(j=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:u.get(e.path)??null,loading:f,notes:b[t]??[],commenting:p,loadDiffFiles:d,onOpenFile:_},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=b,t[87]=p,t[88]=f,t[89]=u,t[90]=d,t[91]=_,t[92]=n.excerpts,t[93]=j):j=t[93],t[94]===y?M=t[95]:(M=(0,$.jsx)(ed,{notes:y,className:`@min-[90rem]/guide:hidden`}),t[94]=y,t[95]=M),N=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=u.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)(Ca,{children:[(0,$.jsxs)(ya,{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)(l,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(De,{"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)(Tr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(va,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:f?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(ld,{file:t,loadDiffFiles:d})})]})},e.path)})})})]}):null,t[4]=b,t[5]=p,t[6]=f,t[7]=S,t[8]=u,t[9]=r,t[10]=y,t[11]=d,t[12]=_,t[13]=o,t[14]=m,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]=E,t[27]=O,t[28]=A,t[29]=j,t[30]=M,t[31]=N}else C=t[23],w=t[24],T=t[25],E=t[26],O=t[27],A=t[28],j=t[29],M=t[30],N=t[31];let P;t[96]!==h||t[97]!==n.questions?(P=n.questions.length>0||h!==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=>h===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(zu,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>h(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)(ge,{"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)),h===null?null:(0,$.jsxs)(W,{size:`sm`,variant:`ghost-muted`,onClick:()=>h(``),children:[(0,$.jsx)(ge,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=h,t[97]=n.questions,t[98]=P):P=t[98];let F;t[99]!==c||t[100]!==g||t[101]!==m?(F=c===null?g===null?null:(0,$.jsxs)(W,{onClick:g,children:[(0,$.jsx)(Oe,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(W,{className:`min-w-0`,onClick:()=>m(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,c]}),(0,$.jsx)(k,{"aria-hidden":!0})]}),t[99]=c,t[100]=g,t[101]=m,t[102]=F):F=t[102];let I;t[103]===F?I=t[104]:(I=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:F}),t[103]=F,t[104]=I);let L;t[105]!==P||t[106]!==I||t[107]!==T||t[108]!==E||t[109]!==O||t[110]!==A||t[111]!==j||t[112]!==M||t[113]!==N?(L=(0,$.jsxs)(`article`,{className:T,children:[E,O,A,j,M,N,P,I]}),t[105]=P,t[106]=I,t[107]=T,t[108]=E,t[109]=O,t[110]=A,t[111]=j,t[112]=M,t[113]=N,t[114]=L):L=t[114];let R;t[115]!==C||t[116]!==y?(R=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:y})}):null,t[115]=C,t[116]=y,t[117]=R):R=t[117];let z;return t[118]!==w||t[119]!==L||t[120]!==R?(z=(0,$.jsxs)(`div`,{className:w,children:[L,R]}),t[118]=w,t[119]=L,t[120]=R,t[121]=z):z=t[121],z}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=Ii(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?Vr.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=ta($i(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=ea(f),m;t[4]===f?m=t[5]:(m=e=>Zi.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(Vr.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||ga()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Qi(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 V;t[56]!==a||t[57]!==z||t[58]!==B?(V=(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]=V):V=t[59];let H;return t[60]!==R||t[61]!==V?(H=(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,V]})}),t[60]=R,t[61]=V,t[62]=H):H=t[62],H}function gd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,o;t[0]!==n||t[1]!==r?(o=Vr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=kt(o),c;t[3]===n?c=t[4]:(c=Vr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=c);let l=a(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[5]=u):u=t[5];let d=At(Vr.generateReviewGuide,u),[f,p]=(0,Z.useState)(!1),m=s.data,h=f||m?.run?._tag===`Running`,g;t[6]!==m||t[7]!==n||t[8]!==r||t[9]!==i?(g=()=>Zi.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:m?.guide?.generatedAt??null,previousFailedAt:m?.run?._tag===`Failed`?m.run.failedAt:null,since:Date.now()}),t[6]=m,t[7]=n,t[8]=r,t[9]=i,t[10]=g):g=t[10];let _=(0,Z.useEffectEvent)(g),v;t[11]!==m?.run?._tag||t[12]!==_?(v=()=>{m?.run?._tag===`Running`&&_()},t[11]=m?.run?._tag,t[12]=_,t[13]=v):v=t[13];let y=m?.run?._tag,b;t[14]===y?b=t[15]:(b=[y],t[14]=y,t[15]=b),(0,Z.useEffect)(v,b);let x;t[16]!==n||t[17]!==d||t[18]!==r||t[19]!==h||t[20]!==_?(x=async()=>{if(h)return;p(!0),_();let e=await d({environmentId:n,input:r});p(!1),e._tag===`Failure`&&(Zi.getState().settle($i(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:si(Ke(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=d,t[18]=r,t[19]=h,t[20]=_,t[21]=x):x=t[21];let S=x,C;return t[22]!==l||t[23]!==m||t[24]!==s||t[25]!==h||t[26]!==S?(C={query:s,data:m,running:h,canWrite:l,write:S},t[22]=l,t[23]=m,t[24]=s,t[25]=h,t[26]=S,t[27]=C):C=t[27],C}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=$i(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=Ii(r),t[7]=r,t[8]=x);let S=x,C=Li(r),w=Fi(yd),T=Fi(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:Ri(),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 Zi.getState().setShown(b),()=>{Zi.getState().shownKey===b&&Zi.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,R=A!==null&&L!==null&&L!==A.headSha,z=I?._tag===`Failed`&&I.headSha===L?I.detail:null,B;t[27]!==_||t[28]!==g||t[29]!==v?(B=(e,t)=>_?(0,$.jsxs)(W,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(Le,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=B):B=t[30];let V=B;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=z??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=z===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]!==z||t[45]!==g||t[46]!==R||t[47]!==V?(H=R||z!==null||g?(0,$.jsxs)(oa,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(ye,{}),(0,$.jsx)(aa,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:z??`Written before the latest push.`}),!g&&_?(0,$.jsx)(ia,{children:V(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=z,t[45]=g,t[46]=R,t[47]=V,t[48]=H):H=t[48];let ee=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]!==ee||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:ee,active:o,commenting:D,onAsk:ne,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=ee,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 U;return t[65]!==te||t[66]!==re?(U=(0,$.jsx)(Ru,{value:te,children:re}),t[65]=te,t[66]=re,t[67]=U):U=t[67],U}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-2OTuKeLP.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,325,326,327,328,329,330,331,332,333,334,335])),Ed=(0,Z.lazy)(Td),Dd=new Map,Od=e=>typeof e==`string`?e:O(e);function kd(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:i,disabled:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Ne,{}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;if(t[3]!==a||t[4]!==n){let e;t[6]===a?e=t[7]:(e=e=>(0,$.jsx)(Ie,{value:e.environmentId,disabled:a,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(na,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=a,t[7]=e),c=n.map(e),t[3]=a,t[4]=n,t[5]=c}else c=t[5];let l;return t[8]!==s||t[9]!==c||t[10]!==r?(l=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(fe,{value:r,onValueChange:s,children:c})]}),t[8]=s,t[9]=c,t[10]=r,t[11]=l):l=t[11],l}var Ad=(e,t)=>{e.preventDefault(),e.stopPropagation(),wl({url:t.url,openLabel:Sl(Nr.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=G(`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=G(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(ye,{"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)(Kr,{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)(W,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(X.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)(Wr,{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)(qr,{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:r=null,reference:o,listEntry:s=null,refreshToken:c=0,onActed:l,onClose:u,context:p=`page`,composerDraftTarget:m,onBack:h,onSelectPullRequest:g,onGuideShown:_}){let y=Je(),b=Xe(),S=b.find(t=>t.id===o.projectId&&t.environmentId===e),T=S?.repositoryIdentity,D=y.get(e)?.environment.capabilities.threadPullRequests===!0,O=(0,Z.useMemo)(()=>D?ui(o,T):{projectId:o.projectId,repository:o.repository,number:o.number},[o,T,D]),k=`${O.projectId}:${O.host??``}:${O.repository}#${O.number}`,A=s?.projectId===O.projectId&&s.repository.toLowerCase()===O.repository.toLowerCase()&&(O.host===void 0||s.host.toLowerCase()===O.host.toLowerCase())&&s.number===O.number?s:null,[M,N]=(0,Z.useState)(!1),[F,L]=(0,Z.useState)(0),[z,B]=(0,Z.useState)(`summary`),[ee,te]=(0,Z.useState)(`newest`),[oe,ce]=(0,Z.useState)(()=>({pullRequestKey:k,oid:null})),ue=oe.pullRequestKey===k?oe.oid:null,de=e=>{ce({pullRequestKey:k,oid:e})},ye=e=>{de(e),B(`code`)},[be,Se]=(0,Z.useState)(null),Ce=e=>{de(null),Se(t=>({path:e,nonce:(t?.nonce??0)+1})),Td(),B(`code`)},we=Zi(t=>t.openRequestKey===$i(e,O));we&&z!==`guide`&&B(`guide`),(0,Z.useEffect)(()=>{we&&Zi.getState().requestOpen(null)},[we]);let Te=`${e}:${k}`,[Ee,De]=(0,Z.useState)(()=>({key:Te,tabs:new Set([`summary`])})),ke=Ee.key===Te?Ee.tabs:new Set([z]);(0,Z.useEffect)(()=>{De(e=>e.key===Te?e.tabs.has(z)?e:{key:Te,tabs:new Set(e.tabs).add(z)}:{key:Te,tabs:new Set([z])})},[z,Te]);let[je,Me]=(0,Z.useState)(!1),Pe=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Me(Pe.current[z]??!1)},[z]);let Re=je,ze=(0,Z.useRef)({}),Be=(0,Z.useMemo)(()=>({summary:e=>{ze.current.summary=e},timeline:e=>{ze.current.timeline=e},code:e=>{ze.current.code=e}}),[]),We=(0,Z.useRef)(null),Ge=(0,Z.useRef)(null),qe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=qe.current;e!==null&&(qe.current=null,Re&&e.tab===z&&ze.current[z]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Re,z]);let Ye=qi(e=>e.pullRequestMergeMethod),et=qi(e=>e.setPullRequestMergeMethod),tt=wa(e,O.projectId),nt=(0,Z.useMemo)(()=>tt(),[tt]),[rt,it]=(0,Z.useState)(null),at=e=>{it({pullRequestKey:k,method:e})},ot=bd(k),[st,ct]=(0,Z.useState)(null),lt=Dt(e,xe),ut=kt(Vr.detail({environmentId:e,input:O})),dt=kt(Vr.activity({environmentId:e,input:O})),ft=Lr(e),[pt,mt]=(0,Z.useState)(()=>ni(typeof window>`u`?void 0:window.localStorage,e,O));(0,Z.useEffect)(()=>{mt(ni(typeof window>`u`?void 0:window.localStorage,e,O))},[e,k,O.projectId,O.repository,O.number]),(0,Z.useEffect)(()=>{ut.data!==null&&(fi(typeof window>`u`?void 0:window.localStorage,e,O,ut.data),mt(ut.data))},[ut.data,e,k,O.projectId,O.repository,O.number]);let ht=Yr({live:ut.data,cached:pt,reference:O}),gt=(0,Z.useMemo)(()=>A===null?null:Rr(A),[A]),_t=(0,Z.useMemo)(()=>ut.data===null?null:{...ut.data,checksState:Cr(ut.data.checks)},[ut.data]),vt=Hr(e,O,_t,ut.dataUpdatedAt),bt=(0,Z.useMemo)(()=>Br(ht,Br(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]),jt=dt.data,K=(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:jt?.author??wt.author,reviewers:jt?.reviewers??wt.reviewers,comments:jt?.comments??[],commentCount:jt?.commentCount??0,commentsTruncated:jt?.commentsTruncated??!1,reviewThreads:jt?.reviewThreads??[],commits:jt?.commits??[],reactions:jt?.reactions??[]},[jt,lt,wt]),Pt=K??bt,Ft=a(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||ga()||or(e,Ft,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||It(`#${O.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)(()=>{K?.autoMergeMethod!==void 0&&at(K.autoMergeMethod)},[K?.autoMergeMethod,k]);let Rt=K===null?null:Ze(K.url),zt=Nr.get(K?.provider),Bt=(0,Z.useMemo)(()=>({repositoryUrl:Rt===null?null:zt.referenceAutolinkRepositoryUrl(Rt),threadRef:r}),[zt,Rt,r]),Vt=K?.author&&Rt!==null?zt.authorProfileUrl(K.author.login,Rt):null,Ht=Pt?ri(Pt.provider,Pt.number,Pt.headBranch,K?.headRepositoryNameWithOwner,Ze(Pt.url)):Qr(O,T),Ut=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Wt=kt(K===null?null:Nt.listRefs({environmentId:e,input:{cwd:K.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Gt=K!==null&&Mi(K.baseBranch,Wt.data?.refs??[]),Kt=xc(e,(0,Z.useMemo)(()=>K===null||K.capabilities.stacks!==!0||!D?null:{...O,host:O.host??$e(K.url)?.host},[K,O,D])),qt=Kt.data,Jt=D&&K?.capabilities.stacks===!0&&K.capabilities.stackActions===!0&&y.get(e)?.environment.capabilities.pullRequestStackActions===!0,Yt=Oi({supportsStackActions:Jt,hasStack:qt!==null,stackPending:!Kt.isFresh,stackError:Kt.error}),Xt=dt.isPending&&jt===null,Zt=jt===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:Te,updatedAt:wt.updatedAt};if(ti(nn.current,e)){if(dt.isPending)return;dt.refresh(),en(e=>e+1)}nn.current=e},[dt.isPending,dt.refresh,wt,Te]),Fc(()=>{ut.refresh()},{key:`pull-request:${e}:${k}`});let rn=At(Vr.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:O}}),Qt(),en(e=>e+1)}finally{on(!1)}},[e,rn,O,Qt]),ln=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{ln.current!==c&&(ln.current=c,cn())},[c,cn]);let un=At(Vr.runAction,{reportFailure:!1}),dn=At(Vr.comment,{reportFailure:!1}),[fn,pn]=(0,Z.useState)(null),mn=fn!==null,hn=At(Vr.update,{reportFailure:!1}),[gn,_n]=(0,Z.useState)(null),vn=gn?.pullRequestKey===k?gn.text:null,[yn,bn]=(0,Z.useState)(!1),xn=Xi(),{environments:Sn}=St(),Cn=(0,Z.useMemo)(()=>{let t=b.find(t=>t.id===O.projectId&&t.environmentId===e)?.repositoryIdentity;return Qe(t,O.repository,O.number)},[e,b,O.number,O.projectId,O.repository]),wn=(0,Z.useMemo)(()=>p===`page`?vc({environmentId:e,projectId:O.projectId},b,Sn.map(e=>({environmentId:e.environmentId,label:e.label,machine:P(e.serverConfig)}))):[],[p,e,Sn,b,O.projectId]),[Tn,Dn]=(0,Z.useState)(null),kn=Tn?.pullRequestKey===k?Tn.environmentId:e,An=wn.find(e=>e.environmentId===kn)??null,jn=An?.environmentId??e,Mn=An?.workspaceRoot??K?.workspaceRoot??S?.workspaceRoot??null,Nn=Dt(jn,j),Pn=Ta({environmentId:jn,cwd:Mn}),Fn=async(t,n,r)=>{l?.(t,`sent`);let i=await un({environmentId:e,input:{...O,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(pn(null),i._tag===`Failure`){let e=Ke(i),n=r===`rebase`?Cd:Sd[t];return yt.add({type:`error`,title:xd[t],description:si(e,n)}),l?.(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`}),Si(t)?cn():Qt(),l?.(t,`done`),!0},In=async(e,t,n)=>!lt||fn!==null?!1:(pn(e),Fn(e,t,n)),Ln=async(t,n)=>!lt||fn!==null?{commentPosted:!1}:(pn(n),(await dn({environmentId:e,input:{...O,body:t}}))._tag===`Failure`?(pn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Fn(n)||Qt(),{commentPosted:!0})),Rn=async t=>{let n=t.trim();if(!lt||K===null||yn)return;if(n.length===0||n===K.title){_n(null);return}bn(!0);let r=await hn({environmentId:e,input:{...O,title:n}});if(bn(!1),r._tag===`Failure`){yt.add({type:`error`,title:`The title could not be saved`,description:si(Ke(r),`The host refused the new title.`)});return}_n(null),Qt()},zn=m??null,Vn=Pn.isAllowed&&Nn,Hn=zn!==null||Vn,Un=oi(zn!==null),Wn=gd({environmentId:e,reference:O,title:K?.title??null}),Gn=()=>{Wn.write(),Wn.data?.guide??B(`guide`)},Kn=(e,t)=>{let n=d.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=Di(r?.prompt??``,r?.reviewComments??[],o),c=Ni({prompt:s,lastHandoffPrompt:Dd.get(i)},t.prompt);Dd.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,gi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},qn=async(e,t,n)=>{let r=n??await xn(e).then(e=>e,()=>null);return r===null?null:(t===null||Kn(r.draftId,t),r)},Jn=async(t,n,r)=>{if(!K||st!==null)return;if(zn!==null){Kn(zn,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}ct(t);let i=ne(jn,An?.projectId??K.projectId),a=await qn(i,n);if(ct(null),a!==null&&r?.keepGuide===!0){let t=d.getState().getDraftSession(a.draftId);t!==null&&(Mt.getState().openPullRequest(V(t.environmentId,t.threadId),{environmentId:e,projectId:O.projectId,...O.host===void 0?{}:{host:O.host},repository:O.repository,number:O.number,url:K.url}),Zi.getState().requestOpen($i(e,O)))}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.`})},Yn=async(e,t,n=`worktree`)=>{if(!Pt||st!==null)return;if(zn!==null&&t!==null){Kn(zn,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(Mn===null||!Pn.isAllowed||!Ot(jn,`source-control:write`)||n===`worktree`&&!Ot(jn,`orchestration:operate`))return;ct(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=ne(jn,An?.projectId??Pt.projectId),a=await xn(i).then(e=>e,()=>null);if(a===null){ct(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 Pn.run({reference:Pt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){ct(null);let e=Pn.error instanceof Error?Pn.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)){ct(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}ct(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 qn(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)},Xn=()=>{K&&Jn(`ask`,{...Ti({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Zn=()=>{K&&Jn(`explain`,{...ki({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Qn=(e,t,n)=>{K&&Jn(`guide-stop:${t}`,hi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},$n=(e,t)=>{K&&Jn(`selection:${e.comment.id}`,xi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,comment:e.comment,request:e.request}),t)},er=e=>{Pt&&Yn(`checkout:${e}`,null,e)},tr=e=>{K&&Yn(ii(e),_i({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,finding:e}))},nr=()=>{K&&Yn(`findings`,wi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,reviewThreads:K.reviewThreads,comments:K.comments,checks:Ar?[]:K.checks,commentsTruncated:K.commentsTruncated}))},rr=()=>{Pt&&Yn(`conflicts`,{prompt:yi({number:Pt.number,url:Pt.url,headBranch:Pt.headBranch,baseBranch:Pt.baseBranch})})},ir=K?K.capabilities.mergeMethods.filter(e=>K.mergeCapabilities[e]):[],ar=rt?.pullRequestKey===k?rt.method:null,cr=di(ir,ar,nt,Ye),lr=Ai[cr],ur=`Auto-merge (${lr.toLowerCase()})`,dr=K?.state===`open`&&K.mergeability===`conflicting`,fr=K?.state===`open`&&K.autoMergeEnabled===!0,pr=K?.autoMergeMethod,mr=pr?`Auto-merge (${Ai[pr].toLowerCase()})`:`Auto-merge`,hr=K?.state===`open`?K.workflowApprovalsRequired??0:0,yr=K===null?null:Pi(K),br=Tt(e,e=>e.reviewGuidesEnabled),Sr=wd.filter(e=>(e.value!==`code`||K===null||K.capabilities.diff)&&(e.value!==`guide`||br));(0,Z.useEffect)(()=>{Sr.some(e=>e.value===z)||B(`summary`)},[z,Sr]);let wr=e=>K?.capabilities.actions.includes(e)===!0&&K.viewerPermissions.actions.includes(e),Er=K?Cr(K.checks):null,Or=bt?.checksState===void 0?Er:bt.checksState,kr=Or!==`failing`&&K?.checks.some(e=>e.status===`action-required`)?`pending`:Or,Ar=kr!==Er,Pr=K?$r({state:K.state,isDraft:K.isDraft,mergeability:K.mergeability,checksState:kr,autoMergeEnabled:K.autoMergeEnabled,hasMergeMethod:ir.length>0,canMerge:Yt&&wr(`merge`),canMarkReady:wr(`ready`),canEnableAutoMerge:Yt&&wr(`enable-auto-merge`)}):null,Fr=K?.state===`open`&&wr(K.isDraft?`ready`:`draft`)&&!(K.isDraft&&Pr===`ready`),Ir=Yt&&K?.state===`open`&&(fr&&wr(`disable-auto-merge`)||!fr&&Pr!==`enable-auto-merge`&&!K.isDraft&&!dr&&wr(`enable-auto-merge`)&&ir.length>0),zr=Yt&&K?.state===`open`&&(Pr===`enable-auto-merge`||Pr===`auto-merge-armed`)&&wr(`merge`)&&!K.isDraft&&!dr&&ir.length>0,Ur=K?.state===`open`&&wr(`merge`)&&!K.isDraft&&!dr&&ir.length>1,Wr=K?gr({state:K.state,isDraft:K.isDraft}):null,Gr=K!==null&&Ei(K),Kr=Sn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),qr=async()=>{K!==null&&await Ct()?.dialogs.confirm([`Delete branch ${K.headBranch}?`,`This deletes ${K.headBranch} from ${K.headRepositoryNameWithOwner??K.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:s,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,g=m?.rows??null,_;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){_=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==g?(e=async e=>{let t=await c(e),r=Ju(t.newFile.contents,g);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]=g,t[13]=e):e=t[13],_=e}let v=_,y;t[14]!==s?.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 s?.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]=s?.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],s?.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=h(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=s!==null&&u===null,T=s?.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=o({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 k;t[32]===v?k=t[33]:(k=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=k);let A;t[34]!==C||t[35]!==w||t[36]!==f||t[37]!==O||t[38]!==k?(A={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:f,preferredHighlighter:ba,unsafeCSS:nd,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...k},t[34]=C,t[35]=w,t[36]=f,t[37]=O,t[38]=k,t[39]=A):A=t[39];let j=A,M;t[40]===n.caption?M=t[41]:(M=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]=M);let N;t[42]!==x||t[43]!==D||t[44]!==s||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]!==j||t[55]!==m?(N=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)(W,{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:j,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:()=>s?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&s!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${fc(u.position).line}`,text:``,placeholder:s.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:s.canComment?`Add to review`:`Ask agent`,...s.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{if(!s.canComment){D(e);return}s.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)(W,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(he,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=s,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]=j,t[55]=m,t[56]=N):N=t[56];let P;return t[57]!==M||t[58]!==N?(P=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[M,N]}),t[57]=M,t[58]=N,t[59]=P):P=t[59],P}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:ba,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:u,loadDiffFiles:d,diffLoading:f,commenting:p,onStep:m,onAsk:h,onFinish:g,onOpenFile:_}=e,v;t[0]===n?v=t[1]:(v=Yu(n),t[0]=n,t[1]=v);let{lettered:y,byExcerpt:b}=v,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,E,O,A,j,M,N;if(t[4]!==b||t[5]!==p||t[6]!==f||t[7]!==S||t[8]!==u||t[9]!==r||t[10]!==y||t[11]!==d||t[12]!==_||t[13]!==o||t[14]!==m||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=y.length>0;let h=C&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===h?w=t[35]:(w=G(`grid gap-8`,h),t[34]=h,t[35]=w),T=`flex min-w-0 flex-col gap-5`;let g=r+1,v;t[36]!==i||t[37]!==g?(v=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,g,` of `,i]}),t[36]=i,t[37]=g,t[38]=v):v=t[38];let x;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(W,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=x):x=t[39];let k=r+1,P;t[40]!==i||t[41]!==k?(P=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,k,` of `,i]}),t[40]=i,t[41]=k,t[42]=P):P=t[42];let F=a&&`rotate-180`,I;t[43]===F?I=t[44]:(I=G(F),t[43]=F,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,$.jsx)(Ve,{"aria-hidden":!0,className:I}),t[45]=I,t[46]=L);let R;t[47]!==P||t[48]!==L?(R=(0,$.jsxs)(ya,{render:x,children:[P,L]}),t[47]=P,t[48]=L,t[49]=R):R=t[49];let z=r===0,B;t[50]===m?B=t[51]:(B=()=>m(-1),t[50]=m,t[51]=B);let V;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(ze,{"aria-hidden":!0}),t[52]=V):V=t[52];let H;t[53]!==z||t[54]!==B?(H=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:z,onClick:B,children:V}),t[53]=z,t[54]=B,t[55]=H):H=t[55];let ee=r===i-1,te;t[56]===m?te=t[57]:(te=()=>m(1),t[56]=m,t[57]=te);let ne;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(Ve,{"aria-hidden":!0}),t[58]=ne):ne=t[58];let re;t[59]!==ee||t[60]!==te?(re=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:ee,onClick:te,children:ne}),t[59]=ee,t[60]=te,t[61]=re):re=t[61];let U;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(sa,{children:`J`}),(0,$.jsx)(sa,{children:`K`})]}),t[62]=U):U=t[62];let ie;t[63]!==H||t[64]!==re?(ie=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[H,re,U]}),t[63]=H,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]!==v||t[67]!==R||t[68]!==ie?(ae=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[v,R,ie]}),t[66]=v,t[67]=R,t[68]=ie,t[69]=ae):ae=t[69];let oe;t[70]===s?oe=t[71]:(oe=(0,$.jsx)(va,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=oe),t[72]!==o||t[73]!==a||t[74]!==ae||t[75]!==oe?(E=(0,$.jsxs)(Ca,{open:a,onOpenChange:o,children:[ae,oe]}),t[72]=o,t[73]=a,t[74]=ae,t[75]=oe,t[76]=E):E=t[76];let se;t[77]===n.title?se=t[78]:(se=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=se);let ce;t[79]===n.summary?ce=t[80]:(ce=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]=ce),t[81]!==se||t[82]!==ce?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[se,ce]}),t[81]=se,t[82]=ce,t[83]=O):O=t[83],t[84]===n.attention?A=t[85]:(A=n.attention===null?null:(0,$.jsxs)(oa,{controlAlignment:`first-line`,children:[(0,$.jsx)(D,{}),(0,$.jsx)(ra,{children:ud[n.attention.kind]}),(0,$.jsx)(aa,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(zu,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=A),t[86]!==b||t[87]!==p||t[88]!==f||t[89]!==u||t[90]!==d||t[91]!==_||t[92]!==n.excerpts?(j=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:u.get(e.path)??null,loading:f,notes:b[t]??[],commenting:p,loadDiffFiles:d,onOpenFile:_},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=b,t[87]=p,t[88]=f,t[89]=u,t[90]=d,t[91]=_,t[92]=n.excerpts,t[93]=j):j=t[93],t[94]===y?M=t[95]:(M=(0,$.jsx)(ed,{notes:y,className:`@min-[90rem]/guide:hidden`}),t[94]=y,t[95]=M),N=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=u.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)(Ca,{children:[(0,$.jsxs)(ya,{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)(l,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(De,{"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)(Tr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(va,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:f?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(ld,{file:t,loadDiffFiles:d})})]})},e.path)})})})]}):null,t[4]=b,t[5]=p,t[6]=f,t[7]=S,t[8]=u,t[9]=r,t[10]=y,t[11]=d,t[12]=_,t[13]=o,t[14]=m,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]=E,t[27]=O,t[28]=A,t[29]=j,t[30]=M,t[31]=N}else C=t[23],w=t[24],T=t[25],E=t[26],O=t[27],A=t[28],j=t[29],M=t[30],N=t[31];let P;t[96]!==h||t[97]!==n.questions?(P=n.questions.length>0||h!==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=>h===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(zu,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>h(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)(ge,{"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)),h===null?null:(0,$.jsxs)(W,{size:`sm`,variant:`ghost-muted`,onClick:()=>h(``),children:[(0,$.jsx)(ge,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=h,t[97]=n.questions,t[98]=P):P=t[98];let F;t[99]!==c||t[100]!==g||t[101]!==m?(F=c===null?g===null?null:(0,$.jsxs)(W,{onClick:g,children:[(0,$.jsx)(Oe,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(W,{className:`min-w-0`,onClick:()=>m(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,c]}),(0,$.jsx)(k,{"aria-hidden":!0})]}),t[99]=c,t[100]=g,t[101]=m,t[102]=F):F=t[102];let I;t[103]===F?I=t[104]:(I=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:F}),t[103]=F,t[104]=I);let L;t[105]!==P||t[106]!==I||t[107]!==T||t[108]!==E||t[109]!==O||t[110]!==A||t[111]!==j||t[112]!==M||t[113]!==N?(L=(0,$.jsxs)(`article`,{className:T,children:[E,O,A,j,M,N,P,I]}),t[105]=P,t[106]=I,t[107]=T,t[108]=E,t[109]=O,t[110]=A,t[111]=j,t[112]=M,t[113]=N,t[114]=L):L=t[114];let R;t[115]!==C||t[116]!==y?(R=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:y})}):null,t[115]=C,t[116]=y,t[117]=R):R=t[117];let z;return t[118]!==w||t[119]!==L||t[120]!==R?(z=(0,$.jsxs)(`div`,{className:w,children:[L,R]}),t[118]=w,t[119]=L,t[120]=R,t[121]=z):z=t[121],z}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=Ii(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?Vr.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=ta($i(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=ea(f),m;t[4]===f?m=t[5]:(m=e=>Zi.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(Vr.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||ga()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Qi(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 V;t[56]!==a||t[57]!==z||t[58]!==B?(V=(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]=V):V=t[59];let H;return t[60]!==R||t[61]!==V?(H=(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,V]})}),t[60]=R,t[61]=V,t[62]=H):H=t[62],H}function gd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,o;t[0]!==n||t[1]!==r?(o=Vr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=kt(o),c;t[3]===n?c=t[4]:(c=Vr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=c);let l=a(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[5]=u):u=t[5];let d=At(Vr.generateReviewGuide,u),[f,p]=(0,Z.useState)(!1),m=s.data,h=f||m?.run?._tag===`Running`,g;t[6]!==m||t[7]!==n||t[8]!==r||t[9]!==i?(g=()=>Zi.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:m?.guide?.generatedAt??null,previousFailedAt:m?.run?._tag===`Failed`?m.run.failedAt:null,since:Date.now()}),t[6]=m,t[7]=n,t[8]=r,t[9]=i,t[10]=g):g=t[10];let _=(0,Z.useEffectEvent)(g),v;t[11]!==m?.run?._tag||t[12]!==_?(v=()=>{m?.run?._tag===`Running`&&_()},t[11]=m?.run?._tag,t[12]=_,t[13]=v):v=t[13];let y=m?.run?._tag,b;t[14]===y?b=t[15]:(b=[y],t[14]=y,t[15]=b),(0,Z.useEffect)(v,b);let x;t[16]!==n||t[17]!==d||t[18]!==r||t[19]!==h||t[20]!==_?(x=async()=>{if(h)return;p(!0),_();let e=await d({environmentId:n,input:r});p(!1),e._tag===`Failure`&&(Zi.getState().settle($i(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:si(Ke(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=d,t[18]=r,t[19]=h,t[20]=_,t[21]=x):x=t[21];let S=x,C;return t[22]!==l||t[23]!==m||t[24]!==s||t[25]!==h||t[26]!==S?(C={query:s,data:m,running:h,canWrite:l,write:S},t[22]=l,t[23]=m,t[24]=s,t[25]=h,t[26]=S,t[27]=C):C=t[27],C}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=$i(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=Ii(r),t[7]=r,t[8]=x);let S=x,C=Li(r),w=Fi(yd),T=Fi(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:Ri(),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 Zi.getState().setShown(b),()=>{Zi.getState().shownKey===b&&Zi.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,R=A!==null&&L!==null&&L!==A.headSha,z=I?._tag===`Failed`&&I.headSha===L?I.detail:null,B;t[27]!==_||t[28]!==g||t[29]!==v?(B=(e,t)=>_?(0,$.jsxs)(W,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(Le,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=B):B=t[30];let V=B;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=z??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=z===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]!==z||t[45]!==g||t[46]!==R||t[47]!==V?(H=R||z!==null||g?(0,$.jsxs)(oa,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(ye,{}),(0,$.jsx)(aa,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:z??`Written before the latest push.`}),!g&&_?(0,$.jsx)(ia,{children:V(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=z,t[45]=g,t[46]=R,t[47]=V,t[48]=H):H=t[48];let ee=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]!==ee||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:ee,active:o,commenting:D,onAsk:ne,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=ee,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 U;return t[65]!==te||t[66]!==re?(U=(0,$.jsx)(Ru,{value:te,children:re}),t[65]=te,t[66]=re,t[67]=U):U=t[67],U}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-hXtKZAP9.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,325,326,327,328,329,330,331,332,333,334,335])),Ed=(0,Z.lazy)(Td),Dd=new Map,Od=e=>typeof e==`string`?e:O(e);function kd(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:i,disabled:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Ne,{}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;if(t[3]!==a||t[4]!==n){let e;t[6]===a?e=t[7]:(e=e=>(0,$.jsx)(Ie,{value:e.environmentId,disabled:a,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(na,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=a,t[7]=e),c=n.map(e),t[3]=a,t[4]=n,t[5]=c}else c=t[5];let l;return t[8]!==s||t[9]!==c||t[10]!==r?(l=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(fe,{value:r,onValueChange:s,children:c})]}),t[8]=s,t[9]=c,t[10]=r,t[11]=l):l=t[11],l}var Ad=(e,t)=>{e.preventDefault(),e.stopPropagation(),wl({url:t.url,openLabel:Sl(Nr.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=G(`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=G(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(ye,{"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)(Kr,{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)(W,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(X.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)(Wr,{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)(qr,{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:r=null,reference:o,listEntry:s=null,refreshToken:c=0,onActed:l,onClose:u,context:p=`page`,composerDraftTarget:m,onBack:h,onSelectPullRequest:g,onGuideShown:_}){let y=Je(),b=Xe(),S=b.find(t=>t.id===o.projectId&&t.environmentId===e),T=S?.repositoryIdentity,D=y.get(e)?.environment.capabilities.threadPullRequests===!0,O=(0,Z.useMemo)(()=>D?ui(o,T):{projectId:o.projectId,repository:o.repository,number:o.number},[o,T,D]),k=`${O.projectId}:${O.host??``}:${O.repository}#${O.number}`,A=s?.projectId===O.projectId&&s.repository.toLowerCase()===O.repository.toLowerCase()&&(O.host===void 0||s.host.toLowerCase()===O.host.toLowerCase())&&s.number===O.number?s:null,[M,N]=(0,Z.useState)(!1),[F,L]=(0,Z.useState)(0),[z,B]=(0,Z.useState)(`summary`),[ee,te]=(0,Z.useState)(`newest`),[oe,ce]=(0,Z.useState)(()=>({pullRequestKey:k,oid:null})),ue=oe.pullRequestKey===k?oe.oid:null,de=e=>{ce({pullRequestKey:k,oid:e})},ye=e=>{de(e),B(`code`)},[be,Se]=(0,Z.useState)(null),Ce=e=>{de(null),Se(t=>({path:e,nonce:(t?.nonce??0)+1})),Td(),B(`code`)},we=Zi(t=>t.openRequestKey===$i(e,O));we&&z!==`guide`&&B(`guide`),(0,Z.useEffect)(()=>{we&&Zi.getState().requestOpen(null)},[we]);let Te=`${e}:${k}`,[Ee,De]=(0,Z.useState)(()=>({key:Te,tabs:new Set([`summary`])})),ke=Ee.key===Te?Ee.tabs:new Set([z]);(0,Z.useEffect)(()=>{De(e=>e.key===Te?e.tabs.has(z)?e:{key:Te,tabs:new Set(e.tabs).add(z)}:{key:Te,tabs:new Set([z])})},[z,Te]);let[je,Me]=(0,Z.useState)(!1),Pe=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Me(Pe.current[z]??!1)},[z]);let Re=je,ze=(0,Z.useRef)({}),Be=(0,Z.useMemo)(()=>({summary:e=>{ze.current.summary=e},timeline:e=>{ze.current.timeline=e},code:e=>{ze.current.code=e}}),[]),We=(0,Z.useRef)(null),Ge=(0,Z.useRef)(null),qe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=qe.current;e!==null&&(qe.current=null,Re&&e.tab===z&&ze.current[z]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Re,z]);let Ye=qi(e=>e.pullRequestMergeMethod),et=qi(e=>e.setPullRequestMergeMethod),tt=wa(e,O.projectId),nt=(0,Z.useMemo)(()=>tt(),[tt]),[rt,it]=(0,Z.useState)(null),at=e=>{it({pullRequestKey:k,method:e})},ot=bd(k),[st,ct]=(0,Z.useState)(null),lt=Dt(e,xe),ut=kt(Vr.detail({environmentId:e,input:O})),dt=kt(Vr.activity({environmentId:e,input:O})),ft=Lr(e),[pt,mt]=(0,Z.useState)(()=>ni(typeof window>`u`?void 0:window.localStorage,e,O));(0,Z.useEffect)(()=>{mt(ni(typeof window>`u`?void 0:window.localStorage,e,O))},[e,k,O.projectId,O.repository,O.number]),(0,Z.useEffect)(()=>{ut.data!==null&&(fi(typeof window>`u`?void 0:window.localStorage,e,O,ut.data),mt(ut.data))},[ut.data,e,k,O.projectId,O.repository,O.number]);let ht=Yr({live:ut.data,cached:pt,reference:O}),gt=(0,Z.useMemo)(()=>A===null?null:Rr(A),[A]),_t=(0,Z.useMemo)(()=>ut.data===null?null:{...ut.data,checksState:Cr(ut.data.checks)},[ut.data]),vt=Hr(e,O,_t,ut.dataUpdatedAt),bt=(0,Z.useMemo)(()=>Br(ht,Br(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]),jt=dt.data,K=(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:jt?.author??wt.author,reviewers:jt?.reviewers??wt.reviewers,comments:jt?.comments??[],commentCount:jt?.commentCount??0,commentsTruncated:jt?.commentsTruncated??!1,reviewThreads:jt?.reviewThreads??[],commits:jt?.commits??[],reactions:jt?.reactions??[]},[jt,lt,wt]),Pt=K??bt,Ft=a(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||ga()||or(e,Ft,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||It(`#${O.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)(()=>{K?.autoMergeMethod!==void 0&&at(K.autoMergeMethod)},[K?.autoMergeMethod,k]);let Rt=K===null?null:Ze(K.url),zt=Nr.get(K?.provider),Bt=(0,Z.useMemo)(()=>({repositoryUrl:Rt===null?null:zt.referenceAutolinkRepositoryUrl(Rt),threadRef:r}),[zt,Rt,r]),Vt=K?.author&&Rt!==null?zt.authorProfileUrl(K.author.login,Rt):null,Ht=Pt?ri(Pt.provider,Pt.number,Pt.headBranch,K?.headRepositoryNameWithOwner,Ze(Pt.url)):Qr(O,T),Ut=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Wt=kt(K===null?null:Nt.listRefs({environmentId:e,input:{cwd:K.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Gt=K!==null&&Mi(K.baseBranch,Wt.data?.refs??[]),Kt=xc(e,(0,Z.useMemo)(()=>K===null||K.capabilities.stacks!==!0||!D?null:{...O,host:O.host??$e(K.url)?.host},[K,O,D])),qt=Kt.data,Jt=D&&K?.capabilities.stacks===!0&&K.capabilities.stackActions===!0&&y.get(e)?.environment.capabilities.pullRequestStackActions===!0,Yt=Oi({supportsStackActions:Jt,hasStack:qt!==null,stackPending:!Kt.isFresh,stackError:Kt.error}),Xt=dt.isPending&&jt===null,Zt=jt===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:Te,updatedAt:wt.updatedAt};if(ti(nn.current,e)){if(dt.isPending)return;dt.refresh(),en(e=>e+1)}nn.current=e},[dt.isPending,dt.refresh,wt,Te]),Fc(()=>{ut.refresh()},{key:`pull-request:${e}:${k}`});let rn=At(Vr.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:O}}),Qt(),en(e=>e+1)}finally{on(!1)}},[e,rn,O,Qt]),ln=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{ln.current!==c&&(ln.current=c,cn())},[c,cn]);let un=At(Vr.runAction,{reportFailure:!1}),dn=At(Vr.comment,{reportFailure:!1}),[fn,pn]=(0,Z.useState)(null),mn=fn!==null,hn=At(Vr.update,{reportFailure:!1}),[gn,_n]=(0,Z.useState)(null),vn=gn?.pullRequestKey===k?gn.text:null,[yn,bn]=(0,Z.useState)(!1),xn=Xi(),{environments:Sn}=St(),Cn=(0,Z.useMemo)(()=>{let t=b.find(t=>t.id===O.projectId&&t.environmentId===e)?.repositoryIdentity;return Qe(t,O.repository,O.number)},[e,b,O.number,O.projectId,O.repository]),wn=(0,Z.useMemo)(()=>p===`page`?vc({environmentId:e,projectId:O.projectId},b,Sn.map(e=>({environmentId:e.environmentId,label:e.label,machine:P(e.serverConfig)}))):[],[p,e,Sn,b,O.projectId]),[Tn,Dn]=(0,Z.useState)(null),kn=Tn?.pullRequestKey===k?Tn.environmentId:e,An=wn.find(e=>e.environmentId===kn)??null,jn=An?.environmentId??e,Mn=An?.workspaceRoot??K?.workspaceRoot??S?.workspaceRoot??null,Nn=Dt(jn,j),Pn=Ta({environmentId:jn,cwd:Mn}),Fn=async(t,n,r)=>{l?.(t,`sent`);let i=await un({environmentId:e,input:{...O,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(pn(null),i._tag===`Failure`){let e=Ke(i),n=r===`rebase`?Cd:Sd[t];return yt.add({type:`error`,title:xd[t],description:si(e,n)}),l?.(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`}),Si(t)?cn():Qt(),l?.(t,`done`),!0},In=async(e,t,n)=>!lt||fn!==null?!1:(pn(e),Fn(e,t,n)),Ln=async(t,n)=>!lt||fn!==null?{commentPosted:!1}:(pn(n),(await dn({environmentId:e,input:{...O,body:t}}))._tag===`Failure`?(pn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Fn(n)||Qt(),{commentPosted:!0})),Rn=async t=>{let n=t.trim();if(!lt||K===null||yn)return;if(n.length===0||n===K.title){_n(null);return}bn(!0);let r=await hn({environmentId:e,input:{...O,title:n}});if(bn(!1),r._tag===`Failure`){yt.add({type:`error`,title:`The title could not be saved`,description:si(Ke(r),`The host refused the new title.`)});return}_n(null),Qt()},zn=m??null,Vn=Pn.isAllowed&&Nn,Hn=zn!==null||Vn,Un=oi(zn!==null),Wn=gd({environmentId:e,reference:O,title:K?.title??null}),Gn=()=>{Wn.write(),Wn.data?.guide??B(`guide`)},Kn=(e,t)=>{let n=d.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=Di(r?.prompt??``,r?.reviewComments??[],o),c=Ni({prompt:s,lastHandoffPrompt:Dd.get(i)},t.prompt);Dd.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,gi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},qn=async(e,t,n)=>{let r=n??await xn(e).then(e=>e,()=>null);return r===null?null:(t===null||Kn(r.draftId,t),r)},Jn=async(t,n,r)=>{if(!K||st!==null)return;if(zn!==null){Kn(zn,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}ct(t);let i=ne(jn,An?.projectId??K.projectId),a=await qn(i,n);if(ct(null),a!==null&&r?.keepGuide===!0){let t=d.getState().getDraftSession(a.draftId);t!==null&&(Mt.getState().openPullRequest(V(t.environmentId,t.threadId),{environmentId:e,projectId:O.projectId,...O.host===void 0?{}:{host:O.host},repository:O.repository,number:O.number,url:K.url}),Zi.getState().requestOpen($i(e,O)))}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.`})},Yn=async(e,t,n=`worktree`)=>{if(!Pt||st!==null)return;if(zn!==null&&t!==null){Kn(zn,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(Mn===null||!Pn.isAllowed||!Ot(jn,`source-control:write`)||n===`worktree`&&!Ot(jn,`orchestration:operate`))return;ct(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=ne(jn,An?.projectId??Pt.projectId),a=await xn(i).then(e=>e,()=>null);if(a===null){ct(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 Pn.run({reference:Pt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){ct(null);let e=Pn.error instanceof Error?Pn.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)){ct(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}ct(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 qn(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)},Xn=()=>{K&&Jn(`ask`,{...Ti({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Zn=()=>{K&&Jn(`explain`,{...ki({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Qn=(e,t,n)=>{K&&Jn(`guide-stop:${t}`,hi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},$n=(e,t)=>{K&&Jn(`selection:${e.comment.id}`,xi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,comment:e.comment,request:e.request}),t)},er=e=>{Pt&&Yn(`checkout:${e}`,null,e)},tr=e=>{K&&Yn(ii(e),_i({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,finding:e}))},nr=()=>{K&&Yn(`findings`,wi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,reviewThreads:K.reviewThreads,comments:K.comments,checks:Ar?[]:K.checks,commentsTruncated:K.commentsTruncated}))},rr=()=>{Pt&&Yn(`conflicts`,{prompt:yi({number:Pt.number,url:Pt.url,headBranch:Pt.headBranch,baseBranch:Pt.baseBranch})})},ir=K?K.capabilities.mergeMethods.filter(e=>K.mergeCapabilities[e]):[],ar=rt?.pullRequestKey===k?rt.method:null,cr=di(ir,ar,nt,Ye),lr=Ai[cr],ur=`Auto-merge (${lr.toLowerCase()})`,dr=K?.state===`open`&&K.mergeability===`conflicting`,fr=K?.state===`open`&&K.autoMergeEnabled===!0,pr=K?.autoMergeMethod,mr=pr?`Auto-merge (${Ai[pr].toLowerCase()})`:`Auto-merge`,hr=K?.state===`open`?K.workflowApprovalsRequired??0:0,yr=K===null?null:Pi(K),br=Tt(e,e=>e.reviewGuidesEnabled),Sr=wd.filter(e=>(e.value!==`code`||K===null||K.capabilities.diff)&&(e.value!==`guide`||br));(0,Z.useEffect)(()=>{Sr.some(e=>e.value===z)||B(`summary`)},[z,Sr]);let wr=e=>K?.capabilities.actions.includes(e)===!0&&K.viewerPermissions.actions.includes(e),Er=K?Cr(K.checks):null,Or=bt?.checksState===void 0?Er:bt.checksState,kr=Or!==`failing`&&K?.checks.some(e=>e.status===`action-required`)?`pending`:Or,Ar=kr!==Er,Pr=K?$r({state:K.state,isDraft:K.isDraft,mergeability:K.mergeability,checksState:kr,autoMergeEnabled:K.autoMergeEnabled,hasMergeMethod:ir.length>0,canMerge:Yt&&wr(`merge`),canMarkReady:wr(`ready`),canEnableAutoMerge:Yt&&wr(`enable-auto-merge`)}):null,Fr=K?.state===`open`&&wr(K.isDraft?`ready`:`draft`)&&!(K.isDraft&&Pr===`ready`),Ir=Yt&&K?.state===`open`&&(fr&&wr(`disable-auto-merge`)||!fr&&Pr!==`enable-auto-merge`&&!K.isDraft&&!dr&&wr(`enable-auto-merge`)&&ir.length>0),zr=Yt&&K?.state===`open`&&(Pr===`enable-auto-merge`||Pr===`auto-merge-armed`)&&wr(`merge`)&&!K.isDraft&&!dr&&ir.length>0,Ur=K?.state===`open`&&wr(`merge`)&&!K.isDraft&&!dr&&ir.length>1,Wr=K?gr({state:K.state,isDraft:K.isDraft}):null,Gr=K!==null&&Ei(K),Kr=Sn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),qr=async()=>{K!==null&&await Ct()?.dialogs.confirm([`Delete branch ${K.headBranch}?`,`This deletes ${K.headBranch} from ${K.headRepositoryNameWithOwner??K.repository}. Local branches and worktrees are not changed.`].join(`
215
215
  `),{variant:`destructive`})&&In(`delete-branch`)},Xr=hr>0&&!Ar&&wr(`approve-workflows`),Zr=Ar?kr===null?`No checks reported`:xr(kr).label:K?jr(K.checks):null,ei=K&&!K.commentsTruncated?li(K.comments,K.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,ai=p===`page`?(0,$.jsxs)(Ae,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(le,{disabled:st!==null||Mn===null,render:(0,$.jsxs)(W,{size:`xs`,variant:`outline`,"aria-label":st?.startsWith(`checkout`)?`Checking out...`:`Check out`,children:[(0,$.jsx)(Ue,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[35rem]/pr-header:hidden`,children:st?.startsWith(`checkout`)?`Checking out...`:`Check out`}),(0,$.jsx)(Ve,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(J,{children:`Check out this pull request`})]}),(0,$.jsxs)(i,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(U,{disabled:!Vn,onClick:()=>er(`worktree`),children:[(0,$.jsx)(Ue,{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:!Pn.isAllowed,onClick:()=>er(`local`),children:[(0,$.jsx)(pe,{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:jn,onChange:e=>Dn({pullRequestKey:k,environmentId:e}),disabled:st!==null}):null]})]}):null,pi=(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`destructive-outline`,disabled:st!==null||zn===null&&Mn===null,onClick:rr,"aria-label":st===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(X.conflicting,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:st===`conflicts`?`Preparing...`:`Resolve conflicts`})]})})}),(0,$.jsx)(J,{side:`top`,children:st===`conflicts`?`Preparing...`:`Resolve conflicts`})]});return ut.isPending&&!K?(0,$.jsx)(fl,{seed:A,summary:bt,checkoutCommand:Ht,onCheckoutError:Ut,number:O.number,tabs:Sr,activeTab:z,...h?{onBack:h}:{},...u?{onClose:u}:{},actions:Pt?(0,$.jsxs)(On,{delay:150,closeDelay:150,timeout:400,children:[Pt.state===`open`&&Pt.mergeability===`conflicting`?pi:null,ai]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[M&&K?(0,$.jsx)(Xc,{display:`picker`,environmentId:e,reference:O,url:K.url,threadRef:null,onPickerOpenChange:N},`${e}:${K.url}`):null,(0,$.jsxs)(`div`,{className:G(`@container/pr-header grid min-w-0 shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2`,K&&`border-b border-border/60`,!K&&!u&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":Re,inert:Re,className:G(`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`,Re?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:K&&Wr?(0,$.jsxs)($.Fragment,{children:[h?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(W,{size:`icon-micro`,variant:`ghost-muted`,onClick:h,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ie,{"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:K.repository}):(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:K.repository})}),(0,$.jsx)(J,{side:`top`,children:Rt?`Open ${K.repository} repository`:K.repository})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(K.url),onContextMenu:e=>Ad(e,K),className:G(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Wr.toneClassName),"aria-label":`Open pull request #${K.number} on host`,children:[`#`,K.number,(0,$.jsx)(re,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:Sl(zt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!Re,inert:!Re,className:G(`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`,Re?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:K&&Wr?(0,$.jsxs)($.Fragment,{children:[h?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(W,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:Re?0:-1,onClick:h,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ie,{"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:Re?0:-1,onClick:()=>void Ct()?.shell.openExternal(K.url),onContextMenu:e=>Ad(e,K),className:G(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Wr.toneClassName),"aria-label":`Open pull request #${K.number} on host`,children:[`#`,K.number,(0,$.jsx)(re,{"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:K.title})}),(0,$.jsx)(J,{side:`top`,children:K.title})]})]}):null})]}),(0,$.jsxs)(`div`,{className:`mr-4 flex h-7 shrink-0 items-center justify-end gap-1`,children:[K?(0,$.jsxs)(On,{delay:150,closeDelay:150,timeout:400,children:[!qt&&Jt&&Kt.error?(0,$.jsx)(W,{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:O,environmentId:e,onSelect:g,mergeMethod:cr,canMerge:Kt.isFresh&&Jt&&wr(`merge`)&&ir.length>0,canRebase:Kt.isFresh&&Jt&&K.viewerPermissions.stackRebase===!0,onActed:()=>{Qt(),l?.()}}):null,p===`page`?(0,$.jsx)(Xc,{display:`count`,environmentId:e,reference:O,url:K.url,threadRef:null}):null,fr&&Pr!==`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(C,{size:`control`,variant:`info`,role:`img`,"aria-label":mr,children:[(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:mr})]})}),(0,$.jsxs)(J,{side:`top`,children:[mr,`: the host will merge this on its own once its requirements are met`]})]}):null,Pr===`resolve`?pi:Pr===`ready`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`default`,disabled:mn,onClick:()=>void In(`ready`),"aria-label":`Ready for review`,children:[(0,$.jsx)(X.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`})]}):Pr===`enable-auto-merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`default`,disabled:mn,...ot.props(`enable-auto-merge`,()=>void In(`enable-auto-merge`,cr)),"aria-label":fn===`enable-auto-merge`?`Enabling...`:ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:ur,children:[ot.isArmed(`enable-auto-merge`)?(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(X.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:ur}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`enable-auto-merge`?`Enabling...`:ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:ur})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`enable-auto-merge`?`Enabling...`:ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:ur})]}):Pr===`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(C,{size:`control`,variant:`info`,role:`img`,"aria-label":mr,children:[(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:mr})]})}),(0,$.jsxs)(J,{side:`top`,children:[mr,`: the host will merge this on its own once its requirements are met`]})]}):Pr===`merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`default`,disabled:mn,...ot.props(`merge`,()=>void In(`merge`,cr)),"aria-label":fn===`merge`?`Merging...`:ot.isArmed(`merge`)?`Confirm merge?`:lr,children:[ot.isArmed(`merge`)?(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(X.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:lr}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`merge`?`Merging...`:ot.isArmed(`merge`)?`Confirm merge?`:lr})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`merge`?`Merging...`:ot.isArmed(`merge`)?`Confirm merge?`:lr})]}):(Pr===`merged`||Pr===`closed`)&&Wr!==null?(0,$.jsx)(C,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:G(`flex items-center gap-1`,Wr.toneClassName),children:[(0,$.jsx)(Wr.Icon,{className:`size-3.5`}),Wr.label]})}):null,ai,(0,$.jsxs)(Ae,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(le,{render:(0,$.jsx)(W,{"aria-label":sn?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:sn?(0,$.jsx)(pa,{refreshing:!0,size:`md`}):(0,$.jsx)(me,{className:`size-4`})})}),(0,$.jsx)(J,{children:sn?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(i,{align:`end`,side:`bottom`,children:[(0,$.jsx)(Xc,{display:`menu-item`,environmentId:e,reference:O,url:K.url,threadRef:r??(typeof m==`object`?m:null),onPickerOpenChange:N}),(0,$.jsxs)(U,{disabled:sn,onClick:()=>void cn(),children:[(0,$.jsx)(pa,{size:`sm`,refreshing:sn}),`Refresh`]}),(0,$.jsxs)(U,{disabled:st!==null,onClick:Xn,children:[(0,$.jsx)(ge,{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:st===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:zn===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(U,{disabled:st!==null,onClick:Zn,children:[(0,$.jsx)(se,{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:st===`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:st!==null||!Hn,onClick:nr,children:[(0,$.jsx)(ve,{className:`size-3.5`}),st===`findings`?`Preparing...`:Un.fixFindings]}),br&&Wn.canWrite?(0,$.jsxs)(U,{disabled:Wn.running,onClick:Gn,children:[(0,$.jsx)(Le,{className:`size-3.5`}),Wn.running?`Writing guide...`:Wn.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,wn.length>0?(0,$.jsx)(kd,{environments:wn,value:jn,onChange:e=>Dn({pullRequestKey:k,environmentId:e}),disabled:st!==null}):null,(0,$.jsx)(Ne,{}),K.state===`open`?(0,$.jsxs)($.Fragment,{children:[Fr?(0,$.jsxs)(U,{disabled:mn,onClick:()=>void In(K.isDraft?`ready`:`draft`),children:[K.isDraft?(0,$.jsx)(X.pullRequest,{className:`size-3.5`}):(0,$.jsx)(X.draft,{className:`size-3.5`}),K.isDraft?`Ready for review`:`Convert to draft`]}):null,zr?(0,$.jsxs)(U,{closeOnClick:ot.isArmed(`merge`),"aria-label":ot.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:mn,...ot.props(`merge`,()=>void In(`merge`,cr)),children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),ot.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,fr&&wr(`disable-auto-merge`)?(0,$.jsxs)(U,{disabled:mn,onClick:()=>void In(`disable-auto-merge`),children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),`Disable auto-merge`]}):Ir?(0,$.jsxs)(U,{closeOnClick:ot.isArmed(`enable-auto-merge`),"aria-label":ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`,disabled:mn,...ot.props(`enable-auto-merge`,()=>void In(`enable-auto-merge`,cr)),children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Ur?(0,$.jsxs)($.Fragment,{children:[Fr||zr||Ir?(0,$.jsx)(Ne,{}):null,(0,$.jsx)(fe,{value:cr,onValueChange:e=>{let t=e;at(t),et(t)},children:ir.map(e=>(0,$.jsx)(Ie,{value:e,disabled:mn,closeOnClick:!0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Ai[e]})]})},e))})]}):null,Jr(Fr,Ir||zr,Ur)?(0,$.jsx)(Ne,{}):null]}):null,(0,$.jsxs)(U,{onClick:()=>void Ct()?.shell.openExternal(K.url),children:[(0,$.jsx)(he,{className:`size-3.5`}),Sl(zt)]}),(0,$.jsxs)(U,{onClick:()=>It(K.url,`PR link`),children:[(0,$.jsx)(I,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(_e,{children:sr(Ft,`thread.copyReference`)})]}),(0,$.jsxs)(U,{onClick:()=>It(`#${O.number}`,`PR number`),children:[(0,$.jsx)(R,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(_e,{children:sr(Ft,`pullRequest.copyNumber`)})]}),K.state===`open`&&wr(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ne,{}),(0,$.jsxs)(U,{closeOnClick:ot.isArmed(`close`),"aria-label":ot.isArmed(`close`)?`Confirm close?`:`Close pull request`,variant:`destructive`,disabled:mn,...ot.props(`close`,()=>void In(`close`)),children:[(0,$.jsx)(X.closed,{className:`size-3.5`}),ot.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):K.state===`closed`&&wr(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ne,{}),(0,$.jsxs)(U,{disabled:mn,onClick:()=>void In(`reopen`),children:[(0,$.jsx)(X.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):K.state===`merged`&&wr(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ne,{}),(0,$.jsxs)(U,{closeOnClick:ot.isArmed(`revert`),"aria-label":ot.isArmed(`revert`)?`Confirm revert?`:`Revert changes`,variant:ot.isArmed(`revert`)?`destructive`:`default`,disabled:mn,...ot.props(`revert`,()=>void In(`revert`)),children:[(0,$.jsx)(x,{className:`size-3.5`}),ot.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null,Gr?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ne,{}),(0,$.jsxs)(U,{variant:`destructive`,disabled:mn||!Kr,onClick:()=>void qr(),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:fn===`delete-branch`?`Deleting branch...`:`Delete branch`}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:Kr?K.headBranch:`Reconnect to delete this branch`})]})]})]}):null]})]})]}):null,u?(0,$.jsx)(W,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:u,children:(0,$.jsx)(f,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:G(`col-span-2 grid`,Re?`grid-rows-[1fr]`:`grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ge,className:G(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Re?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!Re,children:K?(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)(Dr,{actor:K.author,profileUrl:Vt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:En(K.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:[yr?(0,$.jsxs)(jd,{baseBranch:K.baseBranch,freshness:yr,pending:mn,onUpdate:e=>void In(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Gt?(0,$.jsx)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:K.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)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:K.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Gt?`Stacked on ${K.baseBranch}`:K.baseBranch})]}),(0,$.jsx)(ie,{"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)(_a,{value:K.headBranch,showTitle:!1})})}),(0,$.jsx)(J,{side:`top`,children:K.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":`${K.changedFiles.toLocaleString()} changed ${K.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(Fe,{"aria-hidden":!0,className:`size-3`}),K.changedFiles.toLocaleString()]}),(0,$.jsx)(Tr,{additions:K.additions,deletions:K.deletions,className:`shrink-0 font-mono text-2xs`})]})]})}):null})}),(0,$.jsx)(`div`,{className:G(`col-span-2 grid`,Re?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:We,className:G(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Re?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:Re,children:K?(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:K.title})}),(0,$.jsx)(J,{side:`top`,children:K.title})]}),xs(K)?(0,$.jsx)(ws,{"aria-label":`Edit title`,onClick:()=>_n({pullRequestKey:k,text:K.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Bn,{autoFocus:!0,size:`sm`,disabled:yn,value:vn,"aria-label":`Pull request title`,onChange:e=>_n({pullRequestKey:k,text:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Rn(vn)):e.key===`Escape`&&(e.preventDefault(),_n(null))}}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(W,{size:`xs`,variant:`ghost`,disabled:yn,onClick:()=>_n(null),children:`Cancel`}),(0,$.jsx)(W,{size:`xs`,variant:`outline`,disabled:!lt||yn||vn.trim().length===0,onClick:()=>void Rn(vn),children:yn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(Dr,{actor:K.author,profileUrl:Vt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,En(K.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:yr?(0,$.jsxs)(jd,{baseBranch:K.baseBranch,freshness:yr,pending:mn,onUpdate:e=>void In(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Gt?(0,$.jsx)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:K.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)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:K.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Gt?`Stacked on ${K.baseBranch}`:K.baseBranch})]}),head:(0,$.jsx)(al,{value:K.headBranch,target:`branch name`,copyLabel:`Copy pull request branch`,copiedLabel:`Branch name copied`},K.headBranch),files:`${K.changedFiles.toLocaleString()} ${K.changedFiles===1?`file`:`files`}`,diffStat:(0,$.jsx)(Tr,{additions:K.additions,deletions:K.deletions,className:`shrink-0 font-mono text-xs`})}):null})}),K?(0,$.jsx)(rl,{tabs:Sr,value:z,onValueChange:B,onTabIntent:e=>{e===`code`&&Td()},children:z===`summary`?Xr?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`ml-auto inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`warning-outline`,disabled:mn,...ot.props(`approve-workflows`,()=>void In(`approve-workflows`)),"aria-label":fn===`approve-workflows`?`Approving...`:ot.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`,children:[(0,$.jsx)(v,{"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...`:ot.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`approve-workflows`?`Approving...`:ot.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]}):(0,$.jsx)(il,{className:`text-muted-foreground`,"aria-label":Zr?`Checks: ${Zr}`:`Checks`,icon:kr===null?(0,$.jsx)(w,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Pu,{checks:K.checks,stale:Ar,checksState:kr,threadRef:r}),label:Zr}):z===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(_r,{className:G(`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`:`${K.commentCount.toLocaleString()} ${K.commentCount===1?`comment`:`comments`}`,children:[(0,$.jsx)(Oe,{"aria-hidden":!0,className:`size-3`}),Zt?`—`:Xt?`…`:K.commentCount.toLocaleString()]}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Zt?`Commits unavailable`:`${K.commits.length.toLocaleString()} ${K.commits.length===1?`commit`:`commits`}`,children:[(0,$.jsx)(He,{"aria-hidden":!0,className:`size-3`}),Zt?`—`:Xt?`…`:K.commits.length.toLocaleString()]}),ei>0?(0,$.jsxs)(`span`,{className:G(`inline-flex items-center gap-1`,Mr(`approved`)),children:[(0,$.jsx)(vr,{outcome:`approved`,className:`size-3`}),ei.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:ei===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(W,{size:`xs`,variant:`ghost-muted`,"aria-label":ee===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>te(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-3`}),ee===`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=ze.current[z];if(e.target!==t||t==null)return;let n=t.scrollTop;Me(e=>{let r=e,i=We.current?.scrollHeight??0,a=i-(Ge.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(qe.current={tab:z,scroller:t,delta:-a},r=!0),Pe.current[z]=r,r})},children:ut.error&&!K?(0,$.jsx)(xl,{...ci(ut.failure)?{title:`Pull request #${O.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}:{}}):K?(0,$.jsxs)(Gs,{value:Bt,children:[ke.has(`summary`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,z!==`summary`&&`invisible`),children:(0,$.jsx)(au,{scrollerRef:Be.summary,environmentId:e,threadRef:r,reference:O,detail:K,activityPending:Xt,checksStale:Ar,activityError:Zt,pendingFinding:st,fixFindingLabel:Un.fixFinding,fixCheckLabel:Un.fixCheck,...Hn?{onFixFinding:tr}:{},onRefresh:Qt,onRefreshChecks:cn})}):null,ke.has(`guide`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,z!==`guide`&&`invisible`),children:(0,$.jsx)(_d,{environmentId:e,reference:O,active:z===`guide`,title:K.title,workspaceRoot:K.workspaceRoot,canComment:K.capabilities.review.inlineComment&&K.viewerPermissions.comment,onAskAboutLines:(e,t)=>$n({comment:e,request:t},{keepGuide:!0}),onAskAboutStop:Qn,onFinishReview:K.capabilities.review.verdicts.some(e=>K.viewerPermissions.verdicts.includes(e))?()=>L(e=>e+1):null,onOpenFile:Ce,onTourShown:_})}):null,ke.has(`timeline`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,z!==`timeline`&&`invisible`),children:Xt?(0,$.jsx)(gl,{}):Zt?(0,$.jsx)(bl,{error:Zt,onRetry:dt.refresh}):(0,$.jsx)(Ou,{scrollerRef:Be.timeline,detail:K,environmentId:e,threadRef:r,reference:O,order:ee,onOpenCommit:ye,onRefresh:Qt})}):null,ke.has(`code`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,z!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Mo,{label:`Loading pull request diff...`}),children:(0,$.jsx)(Ed,{scrollerRef:Be.code,onAddToAgentSelection:$n,environmentId:e,reference:O,detail:K,selectedCommitOid:ue,onSelectedCommitChange:de,pendingFinding:st,fixFindingLabel:Un.fixFinding,...Hn?{onFixFinding:tr}:{},onRefresh:Qt,refreshToken:tn,revealRequest:be})})}):null]}):null}),K?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(Nl,{environmentId:e,reference:O,detail:K,actionPending:mn,onCommentAction:Ln,onCommented:Qt,onReviewSubmitted:Qt,openReviewRequest:F},JSON.stringify([e,O.projectId,O.host,O.repository,O.number]))}):null]})}function Nd(e){let t=(0,Q.c)(36),{entry:n,hostActions:r,visible:i,onActed:o,closing:s,sweeping:c,onCloseSweepStart:l}=e,u=s!==void 0&&s,d=c!==void 0&&c,f;t[0]===n.environmentId?f=t[1]:(f=Vr.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=f);let p=a(f),m=wa(n.environmentId,n.projectId),h;t[2]!==n.host||t[3]!==n.number||t[4]!==n.projectId||t[5]!==n.repository?(h={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]=h):h=t[6];let g=h,_;t[7]!==n||t[8]!==o?(_=e=>o?.({entry:n,action:e}),t[7]=n,t[8]=o,t[9]=_):_=t[9];let v;t[10]===m?v=t[11]:(v=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 di(t,null,m(),qi.getState().pullRequestMergeMethod)},t[10]=m,t[11]=v);let y;t[12]!==n.environmentId||t[13]!==g||t[14]!==_||t[15]!==v?(y={environmentId:n.environmentId,reference:g,onSuccess:_,resolveMergeMethod:v},t[12]=n.environmentId,t[13]=g,t[14]=_,t[15]=v,t[16]=y):y=t[16];let{actionPending:b,perform:x}=Ea(y),S,C;if(t[17]!==b||t[18]!==p||t[19]!==u||t[20]!==n||t[21]!==r||t[22]!==l||t[23]!==x||t[24]!==d||t[25]!==i){C=Symbol.for(`react.early_return_sentinel`);bb0:{let e=zr(n,r),a=b||u||d;if(e.length===0){C=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 c;t[30]!==a||t[31]!==p||t[32]!==n||t[33]!==l||t[34]!==x?(c=e=>{let t=Pd[e].label,r=Pd[e].Icon;return(0,$.jsxs)(Y,{children:[(0,$.jsxs)(q,{render:(0,$.jsx)(W,{variant:e===`close`?`destructive-outline`:`outline`,size:`xs`,disabled:!p||a||e===`merge`&&n.stack!==void 0,"aria-label":`${t} #${n.number}`,onClick:()=>void x(e),onPointerDown:t=>{e===`close`&&t.isPrimary&&t.button===0&&(t.stopPropagation(),l?.(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`&&l?`Close immediately, or drag across rows to close several`:`${t} immediately`})]},e)},t[30]=a,t[31]=p,t[32]=n,t[33]=l,t[34]=x,t[35]=c):c=t[35],S=(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":b||u,children:e.map(c)})}t[17]=b,t[18]=p,t[19]=u,t[20]=n,t[21]=r,t[22]=l,t[23]=x,t[24]=d,t[25]=i,t[26]=S,t[27]=C}else S=t[26],C=t[27];return C===Symbol.for(`react.early_return_sentinel`)?S:C}var Pd={close:{label:`Close`,Icon:X.closed},merge:{label:`Merge`,Icon:X.merged},ready:{label:`Ready for review`,Icon:X.pullRequest},reopen:{label:`Reopen`,Icon:X.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=G(`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)(yr,{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)(hr,{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=G(`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=G(`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)(wr,{actor:n,className:`size-3.5`}),t[4]=n,t[5]=c);let l;t[6]===i?l=t[7]:(l=G(`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)(_a,{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)(_a,{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}var Vd=[`[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(`,`),Hd={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.`},Ud=1,Wd=[Sa,xa];function Gd(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function Kd(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function qd(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function Jd(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function Yd(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 Xd(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function Zd(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 Qd(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),a=[{label:`Browser`,icon:T,shortcut:`B`,available:e.browserAvailable,disabledReason:Hd.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:u,shortcut:`T`,available:e.terminalAvailable,disabledReason:Hd.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:Pe,shortcut:`F`,available:e.filesAvailable,disabledReason:Hd.files,onClick:e.onAddFiles},...e.onAddDesign?[{label:`Design`,icon:Be,shortcut:`G`,available:e.filesAvailable,disabledReason:`Open a project to use Design.`,onClick:e.onAddDesign}]:[],{label:`Diff`,icon:Fe,shortcut:`D`,available:e.diffAvailable,disabledReason:Hd.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:X.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Hd.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:X.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Hd.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:ce,shortcut:`M`,available:e.deviceAvailable,disabledReason:Hd.device,onClick:e.onAddDevice}],o=a.filter(nf),s=o.length===0?-1:Math.min(n,o.length-1),c=(0,Z.useRef)(o);(0,Z.useEffect)(()=>{c.current=o});let l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=[],t[0]=l):l=t[0],(0,Z.useEffect)(()=>{let e=e=>{let t=Yd(c.current,e);if(!t||document.querySelector(Vd))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&Xd(n)||(e.preventDefault(),e.stopPropagation(),t.onClick())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},l);let d=e=>{if(!(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)&&o.length!==0){if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault(),r((s+1)%o.length);return}if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault(),r(s===-1?o.length-1:(s-1+o.length)%o.length);return}if(e.key===`Enter`){if(e.target!==e.currentTarget)return;let t=o[s];if(!t)return;e.preventDefault(),t.onClick()}}},f=tf,p=e=>s!==-1&&o[s]===e,m=ef,h;t[1]===o?h=t[2]:(h=o.map($d),t[1]=o,t[2]=h);let g=h.join(``),_;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`h3`,{className:`mb-3 font-medium text-foreground text-sm`,children:`Tools`}),t[3]=_):_=t[3];let v=a.map(t=>t.available?(0,$.jsxs)(`div`,{className:`group relative`,onMouseEnter:()=>r(o.indexOf(t)),onMouseLeave:()=>r(e=>e===o.indexOf(t)?-1:e),children:[(0,$.jsxs)(`button`,{type:`button`,onClick:t.onClick,className:G(`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`,p(t)&&`bg-card/60`),children:[m(t,`size-4`),(0,$.jsx)(`span`,{className:G(`min-w-0 flex-1 truncate`,t.label===`Browser`&&e.browserProfiles.length>1&&`pr-8`),children:t.label}),(0,$.jsx)(sa,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(Ae,{children:[(0,$.jsx)(le,{render:(0,$.jsx)(W,{"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)(Ve,{className:`size-3.5`})}),(0,$.jsx)(i,{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)(Zd,{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:[m(t,`size-4`),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,$.jsx)(sa,{variant:`pill`,children:t.shortcut})]})},t.label)),y;t[4]===v?y=t[5]:(y=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==y||t[7]!==_?(b=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[_,y]}),t[6]=y,t[7]=_,t[8]=b):b=t[8];let x;return t[9]!==f||t[10]!==d||t[11]!==b||t[12]!==g?(x=(0,$.jsx)(`div`,{ref:f,tabIndex:0,onKeyDown:d,"aria-label":`Open a surface`,"data-surface-launcher-keys":g,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted px-5 py-6 outline-none`,children:b}),t[9]=f,t[10]=d,t[11]=b,t[12]=g,t[13]=x):x=t[13],x}function $d(e){return e.shortcut}function ef(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 tf(e){e?.focus()}function nf(e){return e.available}function rf(e,t,n,r){switch(e.kind){case`diff`:return`Diff`;case`design`:return`Design`;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)??zi(e.activeTerminalId);case`pull-request`:return`#${e.number}`;case`pull-requests`:return`Pull requests`;case`tools`:return`Tools`;case`aside`:return r?.get(e.threadId)??`Side chat`;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`New tab`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function af(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)(T,{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 of(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function sf(e){let t=(0,Q.c)(19),{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&&of(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(af,{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)(Fe,{className:`size-3 shrink-0`}),t[3]=e):e=t[3],e}case`design`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Be,{className:`size-3 shrink-0`}),t[4]=e):e=t[4],e}case`files`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{className:`size-3 shrink-0`}),t[5]=e):e=t[5],e}case`file`:{let e;return t[6]!==n.relativePath||t[7]!==a?(e=(0,$.jsx)(ur,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[6]=n.relativePath,t[7]=a,t[8]=e):e=t[8],e}case`terminal`:{let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(u,{className:`size-3 shrink-0`}),t[9]=e):e=t[9],e}case`pull-request`:{let e=s?.[n.id],r;return t[10]!==o||t[11]!==n||t[12]!==e?(r=(0,$.jsx)(lf,{surface:n,environmentId:o,seed:e}),t[10]=o,t[11]=n,t[12]=e,t[13]=r):r=t[13],r}case`pull-requests`:{let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(X.link,{className:`size-3 shrink-0`}),t[14]=e):e=t[14],e}case`tools`:{let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(S,{className:`size-3 shrink-0`}),t[15]=e):e=t[15],e}case`aside`:{let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Me,{className:`size-3 shrink-0`}),t[16]=e):e=t[16],e}case`device`:{let e;return t[17]===n.target?.platform?e=t[18]:(e=n.target?.platform===`ios`?(0,$.jsx)(cr,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(lr,{className:`size-3 shrink-0`}):(0,$.jsx)(ce,{className:`size-3 shrink-0`}),t[17]=n.target?.platform,t[18]=e),e}}}function cf(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 nt(a.pullRequests))tt(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function lf(e){let t=(0,Q.c)(11),{surface:n,environmentId:i,seed:a}=e,o=n.environmentId??i,s=Xe(),c=qe(),l;t[0]!==o||t[1]!==n.projectId?(l=e=>e.environmentId===o&&e.id===n.projectId,t[0]=o,t[1]=n.projectId,t[2]=l):l=t[2];let u=s.find(l)?.repositoryIdentity,d=n.host??(u?.provider?r(u,u.provider):null),f=Je(),p=o===null?void 0:f.get(o)?.environment.capabilities,m=p?.threadPullRequests===!0?cf(c,o,d,n)?.snapshot??null:null,h=kt(o===null||p?.pullRequests!==!0||m!==null?null:Vr.detail({environmentId:o,input:{projectId:n.projectId,...p?.threadPullRequests===!0&&n.host!==void 0?{host:n.host}:{},repository:n.repository,number:n.number}})).data,g=n.projectId,_;t[3]!==n.number||t[4]!==n.repository||t[5]!==g?(_={projectId:g,repository:n.repository,number:n.number},t[3]=n.number,t[4]=n.repository,t[5]=g,t[6]=_):_=t[6];let v=Hr(o,_,null),y=m??Br(h,v)??a??null;if(y===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(X.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let b=gr({state:y.state,isDraft:y.isDraft??h?.isDraft??a?.isDraft??!1}),x=b.Icon,S=G(`size-3 shrink-0`,b.toneClassName),C;return t[8]!==b||t[9]!==S?(C=(0,$.jsx)(x,{className:S}),t[8]=b,t[9]=S,t[10]=C):C=t[10],C}function uf(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=Bi(Ui(Hi,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(df),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)(Wi,{items:a,strategy:Gi,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)(Ji,{sensors:r,collisionDetection:Ki,modifiers:Wd,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function df(e){return e.id}function ff(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}=Vi(o),f;t[8]===l?f=t[9]:(f=Yi.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=G(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 pf(e){let t=(0,Q.c)(102),n=Dn&&e.mode===`inline`,r=ar().profiles,{resolvedTheme:i}=wt(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=c):c=t[0];let[u,d]=(0,Z.useState)(c),f=e.open!==!1&&e.surfaces.length>0,p=f&&e.onAddTools!==void 0,m;t[1]!==f||t[2]!==p||t[3]!==e?(m=t=>{if(!(t.defaultPrevented||t.isComposing)&&or(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&!document.querySelector(Vd)&&(!f||p&&e.browserAvailable)&&(t.preventDefault(),t.stopPropagation(),!t.repeat)){if(!p){document.querySelector(`[data-surface-launcher-keys]`)?.focus();return}e.onAddTools?.()}},t[1]=f,t[2]=p,t[3]=e,t[4]=m):m=t[4];let h=(0,Z.useEffectEvent)(m),g;t[5]!==h||t[6]!==e.open?(g=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,h,!0),()=>document.removeEventListener(`keydown`,h,!0)},t[5]=h,t[6]=e.open,t[7]=g):g=t[7];let _;t[8]===e.open?_=t[9]:(_=[e.open],t[8]=e.open,t[9]=_),(0,Z.useEffect)(g,_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{let e=Gd(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Ud,n=t&&e.scrollLeft>Ud,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Ud;d(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[10]=v):v=t[10];let b=v,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{let t=Gd(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]=x):x=t[11];let S=x,C;t[12]===e?C=t[13]:(C=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=Kd(n,e.previewSessions),c=o?e.desktopByTabId[o]??null:null,l=c?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...qd({overlay:c,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});bb134:switch(u){case`rename`:s(n.id);break bb134;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb134;case`toggle-mute`:{let t=o&&c?e.previewRuntimeTabId?.(o)??null:null;t&&ha?.setAudioMuted(t,!l).catch(_f);break bb134}case`close`:e.onCloseSurface(n);break bb134;case`close-others`:e.onCloseOtherSurfaces(n);break bb134;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb134;case`close-all`:e.onCloseAllSurfaces();break bb134}},t[12]=e,t[13]=C);let w=C,T=gf,E;t[14]===e?E=t[15]:(E=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[14]=e,t[15]=E);let D=E,O,k;t[16]!==e.activeSurfaceId||t[17]!==u.hasOverflow?(O=()=>{e.activeSurfaceId&&u.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},k=[e.activeSurfaceId,u.hasOverflow],t[16]=e.activeSurfaceId,t[17]=u.hasOverflow,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,Z.useEffect)(O,k);let A,j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{let e=Gd(a.current);if(!e)return;let t=e.firstElementChild,n=nr(t?[e,t]:e,b);return e.addEventListener(`scroll`,b,{passive:!0}),b(),()=>{n(),e.removeEventListener(`scroll`,b)}},j=[b],t[20]=A,t[21]=j):(A=t[20],j=t[21]),(0,Z.useEffect)(A,j);let M,P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{let e=Gd(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(),b())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},P=[b],t[22]=M,t[23]=P):(M=t[22],P=t[23]),(0,Z.useEffect)(M,P);let F=e.mode,I;t[24]===e.maximized?I=t[25]:(I=e.maximized===void 0?{}:{maximized:e.maximized},t[24]=e.maximized,t[25]=I);let L;t[26]===e.open?L=t[27]:(L=e.open===void 0?{}:{open:e.open},t[26]=e.open,t[27]=L);let R;t[28]===e.widthStorageKey?R=t[29]:(R=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[28]=e.widthStorageKey,t[29]=R);let z;t[30]===e.defaultWidth?z=t[31]:(z=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[30]=e.defaultWidth,t[31]=z);let B;t[32]===e.inlineSize?B=t[33]:(B=e.inlineSize?{inlineSize:e.inlineSize}:{},t[32]=e.inlineSize,t[33]=B);let V=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,H=n&&`drag-region`,ee=n&&`wco:pr-(--workspace-native-controls-inset)`,te=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)]`,ne;t[34]!==V||t[35]!==H||t[36]!==ee||t[37]!==te?(ne=G(`flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-1 bg-(--app-chrome-background) pl-2`,V,H,ee,te),t[34]=V,t[35]=H,t[36]=ee,t[37]=te,t[38]=ne):ne=t[38];let re=e.surfaces,U=e.onMoveSurface,ie;t[39]!==D||t[40]!==w||t[41]!==n||t[42]!==e||t[43]!==o||t[44]!==i?(ie=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),c=rf(t,e.previewSessions,e.terminalLabelsById,e.asideTitlesByThreadId),l=Kd(t,e.previewSessions),u=Jd(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(ff,{surfaceId:t.id,disabled:!e.onMoveSurface||o===t.id,"data-active-tab":r,onMouseDown:T,onAuxClick:e=>D(e,t),onContextMenu:e=>void w(e,t),className:G(`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)(sf,{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 ${c}`:`Mute ${c}`,onClick:e=>{e.stopPropagation(),ha?.setAudioMuted(d,u!==`muted`).catch(hf)},children:(0,$.jsx)(ct,{className:`size-3`,icon:u===`muted`?rt:ot})})}),(0,$.jsx)(J,{children:u===`muted`?`Unmute tab`:`Mute tab`})]}),o===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:c,ref:mf,onBlur:n=>{e.onRenameDevice?.(t.id,n.currentTarget.value),s(null)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=c,e.currentTarget.blur())}}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,onDoubleClick:()=>{t.kind===`device`&&e.onRenameDevice&&s(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:c})})}),(0,$.jsx)(J,{children:t.kind===`device`?(0,$.jsx)(vf,{surface:t,environmentId:e.environmentId,title:c}):c})]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close ${c}`,className:G(`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)(y,{className:`size-3.5`})})]},t.id)}),t[39]=D,t[40]=w,t[41]=n,t[42]=e,t[43]=o,t[44]=i,t[45]=ie):ie=t[45];let ae;t[46]!==e.onMoveSurface||t[47]!==e.surfaces||t[48]!==ie?(ae=(0,$.jsx)(Vn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`w-fit min-w-0 flex-initial`,"data-right-panel-tab-list":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:(0,$.jsx)(uf,{surfaces:re,onMove:U,children:ie})})}),t[46]=e.onMoveSurface,t[47]=e.surfaces,t[48]=ie,t[49]=ae):ae=t[49];let oe;t[50]!==u.canScrollLeft||t[51]!==u.canScrollRight||t[52]!==u.hasOverflow?(oe=u.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)(W,{"aria-label":`Scroll tabs left`,disabled:!u.canScrollLeft,onClick:()=>S(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(N,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs left`})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(W,{"aria-label":`Scroll tabs right`,disabled:!u.canScrollRight,onClick:()=>S(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(l,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs right`})]})]}):null,t[50]=u.canScrollLeft,t[51]=u.canScrollRight,t[52]=u.hasOverflow,t[53]=oe):oe=t[53];let se;t[54]!==p||t[55]!==e.onAddTools?(se=p?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(W,{"aria-label":`New tab`,className:`shrink-0 [-webkit-app-region:no-drag]`,onClick:e.onAddTools,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(Ge,{className:`size-4`})}),(0,$.jsx)(J,{children:`New tab`})]}):null,t[54]=p,t[55]=e.onAddTools,t[56]=se):se=t[56];let ce;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`min-w-0 flex-1`}),t[57]=ce):ce=t[57];let le;t[58]!==n||t[59]!==e.layoutControls?(le=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[58]=n,t[59]=e.layoutControls,t[60]=le):le=t[60];let ue;t[61]===n?ue=t[62]:(ue=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[61]=n,t[62]=ue);let de;t[63]!==e.layoutControls||t[64]!==ne||t[65]!==ae||t[66]!==oe||t[67]!==se||t[68]!==le||t[69]!==ue?(de=(0,$.jsxs)(`div`,{className:ne,"data-right-panel-tabbar":!0,children:[ae,oe,se,ce,e.layoutControls,le,ue]}),t[63]=e.layoutControls,t[64]=ne,t[65]=ae,t[66]=oe,t[67]=se,t[68]=le,t[69]=ue,t[70]=de):de=t[70];let fe;t[71]!==r||t[72]!==e.activeSurfaceId||t[73]!==e.browserAvailable||t[74]!==e.children||t[75]!==e.deviceAvailable||t[76]!==e.diffAvailable||t[77]!==e.filesAvailable||t[78]!==e.onAddBrowser||t[79]!==e.onAddBrowserInProfile||t[80]!==e.onAddDesign||t[81]!==e.onAddDevice||t[82]!==e.onAddDiff||t[83]!==e.onAddFiles||t[84]!==e.onAddPullRequest||t[85]!==e.onAddPullRequests||t[86]!==e.onAddTerminal||t[87]!==e.pullRequestAvailable||t[88]!==e.pullRequestsAvailable||t[89]!==e.terminalAvailable?(fe=e.activeSurfaceId===null||e.activeSurfaceId===`tools`?(0,$.jsx)(Qd,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,...e.onAddDesign?{onAddDesign:e.onAddDesign}:{},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[71]=r,t[72]=e.activeSurfaceId,t[73]=e.browserAvailable,t[74]=e.children,t[75]=e.deviceAvailable,t[76]=e.diffAvailable,t[77]=e.filesAvailable,t[78]=e.onAddBrowser,t[79]=e.onAddBrowserInProfile,t[80]=e.onAddDesign,t[81]=e.onAddDevice,t[82]=e.onAddDiff,t[83]=e.onAddFiles,t[84]=e.onAddPullRequest,t[85]=e.onAddPullRequests,t[86]=e.onAddTerminal,t[87]=e.pullRequestAvailable,t[88]=e.pullRequestsAvailable,t[89]=e.terminalAvailable,t[90]=fe):fe=t[90];let pe;t[91]===fe?pe=t[92]:(pe=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:fe}),t[91]=fe,t[92]=pe);let me;return t[93]!==e.mode||t[94]!==I||t[95]!==L||t[96]!==R||t[97]!==z||t[98]!==B||t[99]!==de||t[100]!==pe?(me=(0,$.jsxs)(us,{mode:F,...I,...L,...R,...z,...B,children:[de,pe]}),t[93]=e.mode,t[94]=I,t[95]=L,t[96]=R,t[97]=z,t[98]=B,t[99]=de,t[100]=pe,t[101]=me):me=t[101],me}function mf(e){e?.focus(),e?.select()}function hf(){}function gf(e){e.button===1&&e.preventDefault()}function _f(){}function vf(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=tr(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 yf=(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)(Sf,{}),t[0]=T):T=t[0];let E;t[1]===c?E=t[2]:(E=(0,$.jsx)(jn,{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)(Kr,{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)(jn,{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)(F,{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)(jn,{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)(bf,{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 bf(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 xf=(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?at:it,o;t[0]===a?o=t[1]:(o=(0,$.jsx)(ct,{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)(jn,{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 Sf(){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,xf as n,zd as o,Sl as p,pf as r,Bd as s,yf as t,Nd as u,Rc as v,hc as w,xc as x,Lc as y};
216
- //# sourceMappingURL=PanelLayoutControls-C1Bf67DQ.js.map
216
+ //# sourceMappingURL=PanelLayoutControls-C2deQDB2.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Og as n,RE as r,Vc as i,mE as a,mf as o,nf as s,t as c}from"./utils-hgbJ2TVM.js";import{B as l,L as u,M as d,W as f}from"./runtime-D-mOwjrE.js";import{a as p,r as m}from"./pierre-icons-BodtO6xC.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:i.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:i.attachmentsDelete})}}function g(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AssetAttachmentNotFoundError`}async function _(e){let t=await u(e.registry,e.createAssetUrl({environmentId:e.environmentId,input:{resource:{_tag:`attachment`,attachmentId:e.attachmentId}}}),{reportFailure:!1,reportDefect:!1,refresh:!0});if(t._tag===`Success`)return{status:`verified`};let n=f(t);return g(n)?{status:`missing`}:{status:`failed`,error:n}}function v(e){l(e.registry,e.remove,{environmentId:e.environmentId,input:{attachmentId:e.attachmentId}},{reportFailure:!1,reportDefect:!1})}async function y(e){let t=await l(e.registry,e.createUploadUrl,{environmentId:e.environmentId,input:e.upload},{reportFailure:!1});if(t._tag!==`Success`)return{status:`failed`,step:`mint`,attachmentId:null,error:f(t)};let n=t.value.attachmentId;if(e.onMinted?.(n)===`cancel`)return v({registry:e.registry,remove:e.remove,environmentId:e.environmentId,attachmentId:n}),{status:`cancelled`,attachmentId:n};let r=e.resolveUploadUrl(t.value.relativeUrl);if(!r)return{status:`failed`,step:`resolve-url`,attachmentId:n,error:Error(`The environment is not connected.`)};let i=e.transport(r);e.onTransferStart?.(i.abort);try{await i.done}catch(e){return{status:`failed`,step:`transfer`,attachmentId:n,error:e}}return{status:`uploaded`,attachmentId:n}}function b(e){return Math.min(e,n)}function x(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.ceil(e/1024))} KB`}function S(e,t){return`'${e}' exceeds the ${t>=1048576&&t%1048576==0?`${t/1048576} MB`:t>=1024&&t%1024==0?`${t/1024} KB`:`${t} ${t===1?`byte`:`bytes`}`} attachment limit.`}var C=r(),w=e(t(),1),T=e(a(),1),E={astro:[`#a631be`,`#d568ea`],babel:[`#d5a910`,`#ffd452`],bash:[`#199f43`,`#5ecc71`],biome:[`#1a85d4`,`#69b1ff`],bootstrap:[`#693acf`,`#9d6afb`],browserslist:[`#d5a910`,`#ffd452`],bun:[`#594c5b`,`#79697b`],c:[`#1a85d4`,`#69b1ff`],claude:[`#d47628`,`#ffa359`],cpp:[`#1a85d4`,`#69b1ff`],css:[`#693acf`,`#9d6afb`],database:[`#a631be`,`#d568ea`],default:[`#84848a`,`#adadb1`],docker:[`#1a85d4`,`#69b1ff`],eslint:[`#693acf`,`#9d6afb`],git:[`#ff8c5b`,`#d5512f`],go:[`#1ca1c7`,`#68cdf2`],graphql:[`#d32a61`,`#ff678d`],html:[`#d47628`,`#ffa359`],image:[`#d32a61`,`#ff678d`],javascript:[`#d5a910`,`#ffd452`],json:[`#d47628`,`#ffa359`],markdown:[`#199f43`,`#5ecc71`],mcp:[`#17a5af`,`#64d1db`],nextjs:[`#84848a`,`#adadb1`],npm:[`#d52c36`,`#ff6762`],oxc:[`#1ca1c7`,`#68cdf2`],postcss:[`#d52c36`,`#ff6762`],prettier:[`#17a5af`,`#64d1db`],python:[`#1a85d4`,`#69b1ff`],react:[`#1ca1c7`,`#68cdf2`],ruby:[`#d52c36`,`#ff6762`],rust:[`#d47628`,`#ffa359`],sass:[`#d32a61`,`#ff678d`],stylelint:[`#84848a`,`#adadb1`],svelte:[`#d52c36`,`#ff6762`],svg:[`#d47628`,`#ffa359`],svgo:[`#199f43`,`#5ecc71`],swift:[`#d47628`,`#ffa359`],table:[`#17a5af`,`#64d1db`],tailwind:[`#1ca1c7`,`#68cdf2`],terraform:[`#693acf`,`#9d6afb`],text:[`#84848a`,`#adadb1`],typescript:[`#1a85d4`,`#69b1ff`],vite:[`#a631be`,`#d568ea`],vscode:[`#1a85d4`,`#69b1ff`],vue:[`#199f43`,`#5ecc71`],wasm:[`#693acf`,`#9d6afb`],webpack:[`#1a85d4`,`#69b1ff`],yml:[`#d52c36`,`#ff6762`],zig:[`#d47628`,`#ffa359`],zip:[`#d47628`,`#ffa359`]},D=(0,w.memo)(function(e){let t=(0,C.c)(20),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0],(0,w.useInsertionEffect)(m,n);let r;t[1]!==e.kind||t[2]!==e.mimeType||t[3]!==e.pathValue?(r=p(e.pathValue,e.kind,e.mimeType),t[1]=e.kind,t[2]=e.mimeType,t[3]=e.pathValue,t[4]=r):r=t[4];let i=r;if(!i){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(o,{className:c(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(s,{className:c(`size-4 text-icon-muted`,e.className)}),t[5]=e.className,t[6]=e.kind,t[7]=n):n=t[7],n}let a=E[i.token??`default`]??E.default,l=i.name,u=i.token,d;t[8]===e.className?d=t[9]:(d=c(`size-4 shrink-0`,e.className),t[8]=e.className,t[9]=d);let f=a?.[e.theme===`light`?0:1],h;t[10]===f?h=t[11]:(h={color:f},t[10]=f,t[11]=h);let g=`#${i.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==i.name||t[15]!==i.token||t[16]!==d||t[17]!==h||t[18]!==_?(v=(0,T.jsx)(`svg`,{"aria-hidden":`true`,"data-pierre-icon":l,"data-icon-token":u,className:d,style:h,viewBox:`0 0 16 16`,children:_}),t[14]=i.name,t[15]=i.token,t[16]=d,t[17]=h,t[18]=_,t[19]=v):v=t[19],v});export{S as a,_ as c,v as i,b as n,x as o,h as r,y as s,D as t};
2
- //# sourceMappingURL=PierreEntryIcon--dw21QmY.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Og as n,RE as r,Vc as i,mE as a,mf as o,nf as s,t as c}from"./utils-hgbJ2TVM.js";import{B as l,L as u,M as d,W as f}from"./runtime-Cj24N7je.js";import{a as p,r as m}from"./pierre-icons-CY4HbMoq.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:i.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:i.attachmentsDelete})}}function g(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AssetAttachmentNotFoundError`}async function _(e){let t=await u(e.registry,e.createAssetUrl({environmentId:e.environmentId,input:{resource:{_tag:`attachment`,attachmentId:e.attachmentId}}}),{reportFailure:!1,reportDefect:!1,refresh:!0});if(t._tag===`Success`)return{status:`verified`};let n=f(t);return g(n)?{status:`missing`}:{status:`failed`,error:n}}function v(e){l(e.registry,e.remove,{environmentId:e.environmentId,input:{attachmentId:e.attachmentId}},{reportFailure:!1,reportDefect:!1})}async function y(e){let t=await l(e.registry,e.createUploadUrl,{environmentId:e.environmentId,input:e.upload},{reportFailure:!1});if(t._tag!==`Success`)return{status:`failed`,step:`mint`,attachmentId:null,error:f(t)};let n=t.value.attachmentId;if(e.onMinted?.(n)===`cancel`)return v({registry:e.registry,remove:e.remove,environmentId:e.environmentId,attachmentId:n}),{status:`cancelled`,attachmentId:n};let r=e.resolveUploadUrl(t.value.relativeUrl);if(!r)return{status:`failed`,step:`resolve-url`,attachmentId:n,error:Error(`The environment is not connected.`)};let i=e.transport(r);e.onTransferStart?.(i.abort);try{await i.done}catch(e){return{status:`failed`,step:`transfer`,attachmentId:n,error:e}}return{status:`uploaded`,attachmentId:n}}function b(e){return Math.min(e,n)}function x(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.ceil(e/1024))} KB`}function S(e,t){return`'${e}' exceeds the ${t>=1048576&&t%1048576==0?`${t/1048576} MB`:t>=1024&&t%1024==0?`${t/1024} KB`:`${t} ${t===1?`byte`:`bytes`}`} attachment limit.`}var C=r(),w=e(t(),1),T=e(a(),1),E={astro:[`#a631be`,`#d568ea`],babel:[`#d5a910`,`#ffd452`],bash:[`#199f43`,`#5ecc71`],biome:[`#1a85d4`,`#69b1ff`],bootstrap:[`#693acf`,`#9d6afb`],browserslist:[`#d5a910`,`#ffd452`],bun:[`#594c5b`,`#79697b`],c:[`#1a85d4`,`#69b1ff`],claude:[`#d47628`,`#ffa359`],cpp:[`#1a85d4`,`#69b1ff`],css:[`#693acf`,`#9d6afb`],database:[`#a631be`,`#d568ea`],default:[`#84848a`,`#adadb1`],docker:[`#1a85d4`,`#69b1ff`],eslint:[`#693acf`,`#9d6afb`],git:[`#ff8c5b`,`#d5512f`],go:[`#1ca1c7`,`#68cdf2`],graphql:[`#d32a61`,`#ff678d`],html:[`#d47628`,`#ffa359`],image:[`#d32a61`,`#ff678d`],javascript:[`#d5a910`,`#ffd452`],json:[`#d47628`,`#ffa359`],markdown:[`#199f43`,`#5ecc71`],mcp:[`#17a5af`,`#64d1db`],nextjs:[`#84848a`,`#adadb1`],npm:[`#d52c36`,`#ff6762`],oxc:[`#1ca1c7`,`#68cdf2`],postcss:[`#d52c36`,`#ff6762`],prettier:[`#17a5af`,`#64d1db`],python:[`#1a85d4`,`#69b1ff`],react:[`#1ca1c7`,`#68cdf2`],ruby:[`#d52c36`,`#ff6762`],rust:[`#d47628`,`#ffa359`],sass:[`#d32a61`,`#ff678d`],stylelint:[`#84848a`,`#adadb1`],svelte:[`#d52c36`,`#ff6762`],svg:[`#d47628`,`#ffa359`],svgo:[`#199f43`,`#5ecc71`],swift:[`#d47628`,`#ffa359`],table:[`#17a5af`,`#64d1db`],tailwind:[`#1ca1c7`,`#68cdf2`],terraform:[`#693acf`,`#9d6afb`],text:[`#84848a`,`#adadb1`],typescript:[`#1a85d4`,`#69b1ff`],vite:[`#a631be`,`#d568ea`],vscode:[`#1a85d4`,`#69b1ff`],vue:[`#199f43`,`#5ecc71`],wasm:[`#693acf`,`#9d6afb`],webpack:[`#1a85d4`,`#69b1ff`],yml:[`#d52c36`,`#ff6762`],zig:[`#d47628`,`#ffa359`],zip:[`#d47628`,`#ffa359`]},D=(0,w.memo)(function(e){let t=(0,C.c)(20),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0],(0,w.useInsertionEffect)(m,n);let r;t[1]!==e.kind||t[2]!==e.mimeType||t[3]!==e.pathValue?(r=p(e.pathValue,e.kind,e.mimeType),t[1]=e.kind,t[2]=e.mimeType,t[3]=e.pathValue,t[4]=r):r=t[4];let i=r;if(!i){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(o,{className:c(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(s,{className:c(`size-4 text-icon-muted`,e.className)}),t[5]=e.className,t[6]=e.kind,t[7]=n):n=t[7],n}let a=E[i.token??`default`]??E.default,l=i.name,u=i.token,d;t[8]===e.className?d=t[9]:(d=c(`size-4 shrink-0`,e.className),t[8]=e.className,t[9]=d);let f=a?.[e.theme===`light`?0:1],h;t[10]===f?h=t[11]:(h={color:f},t[10]=f,t[11]=h);let g=`#${i.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==i.name||t[15]!==i.token||t[16]!==d||t[17]!==h||t[18]!==_?(v=(0,T.jsx)(`svg`,{"aria-hidden":`true`,"data-pierre-icon":l,"data-icon-token":u,className:d,style:h,viewBox:`0 0 16 16`,children:_}),t[14]=i.name,t[15]=i.token,t[16]=d,t[17]=h,t[18]=_,t[19]=v):v=t[19],v});export{S as a,_ as c,v as i,b as n,x as o,h as r,y as s,D as t};
2
+ //# sourceMappingURL=PierreEntryIcon-Ddl-VPd4.js.map