@p4code/cli 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-BFaqyrJo.mjs → binCli-D_84b0CF.mjs} +151 -47
  3. package/dist/client/.vite/manifest.json +2069 -2069
  4. package/dist/client/assets/{AnimatedHeight-4Jo1qKaP.js → AnimatedHeight-DewGDSmN.js} +2 -2
  5. package/dist/client/assets/{AuthSurfaceShell-BgwhQCPc.js → AuthSurfaceShell-D29U36jB.js} +2 -2
  6. package/dist/client/assets/{CSPContext-BuROUwKB.js → CSPContext-CB4Jj3Uk.js} +2 -2
  7. package/dist/client/assets/{ChatGptUsageButton-CG-YKS6A.js → ChatGptUsageButton-CFN6c9Ue.js} +2 -2
  8. package/dist/client/assets/{ChatMarkdown-CNhzmB5x.js → ChatMarkdown-DTSMYNs8.js} +4 -4
  9. package/dist/client/assets/{CodexSetupSection.logic-C0ptwwry.js → CodexSetupSection.logic-DQMTTenV.js} +2 -2
  10. package/dist/client/assets/{ComboboxClear-CB7SvrMN.js → ComboboxClear-D8WYxa7i.js} +2 -2
  11. package/dist/client/assets/{CommandBlock-D5btlz0n.js → CommandBlock-VzUG411k.js} +2 -2
  12. package/dist/client/assets/{ComposerPromptEditor-DMONEQeI.js → ComposerPromptEditor-lIFv0Iko.js} +4 -4
  13. package/dist/client/assets/{CompositeRoot-NCPzVvXO.js → CompositeRoot-CLSWLNTl.js} +2 -2
  14. package/dist/client/assets/{ConnectionStatusDot-vBtwC3Vj.js → ConnectionStatusDot-B0ZKI-zI.js} +2 -2
  15. package/dist/client/assets/{DevicePanel-B07cF6Kr.js → DevicePanel-BQ6aWeSD.js} +2 -2
  16. package/dist/client/assets/{DeviceSetup-BEH97y5X.js → DeviceSetup-Bg5OpWbo.js} +2 -2
  17. package/dist/client/assets/{DialogTitle-DrhNhCSD.js → DialogTitle-BVkBTuS9.js} +2 -2
  18. package/dist/client/assets/{DiffCommentAnnotation-DRify9qt.js → DiffCommentAnnotation-BsI9yTe1.js} +2 -2
  19. package/dist/client/assets/{DiffFileTree-wSWCfkHQ.js → DiffFileTree-Bg8GHn2r.js} +2 -2
  20. package/dist/client/assets/{DiffPanel-DuYnpEdL.js → DiffPanel-D2TxWIFd.js} +2 -2
  21. package/dist/client/assets/{DiffWorkerPoolProvider-C7kCyuBf.js → DiffWorkerPoolProvider-B9BXoLYM.js} +2 -2
  22. package/dist/client/assets/{EnvironmentMachineIcon-pSS7qKfw.js → EnvironmentMachineIcon-DX1wHHgS.js} +2 -2
  23. package/dist/client/assets/{ExpandableText-BMD3qugZ.js → ExpandableText-DfTvwfDp.js} +2 -2
  24. package/dist/client/assets/{FieldControl-BTrrbQ3K.js → FieldControl-CrNWnPN_.js} +2 -2
  25. package/dist/client/assets/{FileDiff-DHS_UG0K.js → FileDiff-Ds-DSHzC.js} +2 -2
  26. package/dist/client/assets/{FilePreviewPanel-CYb5xyMm.js → FilePreviewPanel-CyR5pXUr.js} +2 -2
  27. package/dist/client/assets/{FoldedSettingsSection-CyRBKQ16.js → FoldedSettingsSection-DQesC0Ch.js} +2 -2
  28. package/dist/client/assets/{FormContext-CBGeQN77.js → FormContext-CUf-dYwe.js} +2 -2
  29. package/dist/client/assets/{Icons-AkySFIEx.js → Icons-DMu3kCVA.js} +2 -2
  30. package/dist/client/assets/{KeybindingsSettings.logic-CkDiTn0M.js → KeybindingsSettings.logic-BB1oFV_W.js} +2 -2
  31. package/dist/client/assets/{NoProjectsHero-DyNL-MrS.js → NoProjectsHero-D0SwrjYG.js} +2 -2
  32. package/dist/client/assets/{PanelLayoutControls-NUeu7nMQ.js → PanelLayoutControls-Bfgdx7QX.js} +4 -4
  33. package/dist/client/assets/{PierreEntryIcon-IuSWNqlA.js → PierreEntryIcon-BUl5qtCE.js} +2 -2
  34. package/dist/client/assets/{PreviewPanel-CxJz5hUK.js → PreviewPanel-CbotCgGz.js} +2 -2
  35. package/dist/client/assets/{ProjectDefaultsSettings-bQ5ORxlD.js → ProjectDefaultsSettings-GpUKCz2U.js} +2 -2
  36. package/dist/client/assets/{ProjectFavicon-ClxI7OY3.js → ProjectFavicon-BKEw0TrD.js} +3 -3
  37. package/dist/client/assets/{ProjectIconPickerDialog-BTsAZWr2.js → ProjectIconPickerDialog-C-KFxEg0.js} +2 -2
  38. package/dist/client/assets/{ProjectMonogram-DCxOyCyM.js → ProjectMonogram-B2dsNF6-.js} +2 -2
  39. package/dist/client/assets/{ProviderAuthTerminal-KAhmp-D6.js → ProviderAuthTerminal-Cwr8Z1Ly.js} +2 -2
  40. package/dist/client/assets/{ProviderModelPicker-DQG8_Hn8.js → ProviderModelPicker-CIxbqWeL.js} +2 -2
  41. package/dist/client/assets/{ProviderSettingsForm-BRBhNcWm.js → ProviderSettingsForm-DpmAB_Jq.js} +2 -2
  42. package/dist/client/assets/{PullRequestCodeTab-sN76VbmK.js → PullRequestCodeTab-qEGBl5Kn.js} +2 -2
  43. package/dist/client/assets/{ReadOnlySourcePreview-BiWn5R0O.js → ReadOnlySourcePreview-C5y6ELAP.js} +2 -2
  44. package/dist/client/assets/{RenderErrorBoundary-CwR9l2vj.js → RenderErrorBoundary-CyH8UwmD.js} +2 -2
  45. package/dist/client/assets/{ScheduledTasksSettings-iPAhYreZ.js → ScheduledTasksSettings-deUjWQ39.js} +2 -2
  46. package/dist/client/assets/{ScopedSwitch-DrThVUz_.js → ScopedSwitch-pdvWIJp5.js} +2 -2
  47. package/dist/client/assets/{SecretInput-C8iO0LWS.js → SecretInput-C11F3Wuh.js} +2 -2
  48. package/dist/client/assets/{SettingsPanels-BtdHxcNW.js → SettingsPanels-DExy67bz.js} +2 -2
  49. package/dist/client/assets/{SettingsPanels.logic-yZixYwld.js → SettingsPanels.logic-zUA6f3HT.js} +2 -2
  50. package/dist/client/assets/{SettingsScopeNotice-f82KPnDY.js → SettingsScopeNotice-N6bcXfto.js} +2 -2
  51. package/dist/client/assets/{T3ConnectAccountPages-m_7RF9L_.js → T3ConnectAccountPages-uVnu-v4W.js} +2 -2
  52. package/dist/client/assets/{T3ConnectSidebarSignIn-DJTcBcGh.js → T3ConnectSidebarSignIn-CZCWzt6C.js} +2 -2
  53. package/dist/client/assets/{ThemeEditorPanel-olXdAmEu.js → ThemeEditorPanel-CjUB7HmU.js} +2 -2
  54. package/dist/client/assets/{ThreadTerminalDrawer-BQDs5eem.js → ThreadTerminalDrawer-CAh-h3eK.js} +2 -2
  55. package/dist/client/assets/{Virtualizer-DqZNglST.js → Virtualizer-CB4f0UTD.js} +2 -2
  56. package/dist/client/assets/{WorkspaceBreadcrumb-B6kfrQ73.js → WorkspaceBreadcrumb-3VgFkWcC.js} +2 -2
  57. package/dist/client/assets/{WorkspacePageContainer-DSbQuXwt.js → WorkspacePageContainer-8jksqZGW.js} +2 -2
  58. package/dist/client/assets/{WorkspacePageHeader-GK8yx2Yo.js → WorkspacePageHeader-IRvZnA0X.js} +2 -2
  59. package/dist/client/assets/{_chat-DsJhLPIV.js → _chat-BfQTKc_9.js} +5 -5
  60. package/dist/client/assets/{_chat.index-BPJ4rR-G.js → _chat.index-DnYerwxz.js} +2 -2
  61. package/dist/client/assets/{_chat.new-CfqCt0Fk.js → _chat.new-XtBIcyRw.js} +2 -2
  62. package/dist/client/assets/{_chat.pull-requests-BfTP6YhJ.js → _chat.pull-requests-Dz-eLkAP.js} +2 -2
  63. package/dist/client/assets/{abnfDiagram-VCTEODGH-Cg5QSgHP.js → abnfDiagram-VCTEODGH-DUPWAarL.js} +2 -2
  64. package/dist/client/assets/{alert-DwFQdL_W.js → alert-DzxRsWWi.js} +2 -2
  65. package/dist/client/assets/architecture-7GRP2DOG-DTyqnvkZ.js +1 -0
  66. package/dist/client/assets/{architectureDiagram-5GKGNRK7-Dk3aYsC1.js → architectureDiagram-5GKGNRK7-ipdl5Chl.js} +2 -2
  67. package/dist/client/assets/{assets-1IiF113B.js → assets-B7aY-rQd.js} +2 -2
  68. package/dist/client/assets/{blockDiagram-I7D4REHJ-C3znhuKn.js → blockDiagram-I7D4REHJ-CCqcBoEP.js} +2 -2
  69. package/dist/client/assets/{browserHistoryStore-DNPsjLW4.js → browserHistoryStore-TLJ0k3I1.js} +2 -2
  70. package/dist/client/assets/{browserLinkTarget-1GMN2suO.js → browserLinkTarget-Du_qPFvd.js} +2 -2
  71. package/dist/client/assets/{c4Diagram-7LVT6UL2-D-Q_GaXJ.js → c4Diagram-7LVT6UL2-D0uMteR1.js} +2 -2
  72. package/dist/client/assets/channel-BO8pVrSI.js +2 -0
  73. package/dist/client/assets/{checkbox-CzKUo-R1.js → checkbox-Gd1YCUIl.js} +2 -2
  74. package/dist/client/assets/{chunk-4HAMMTFA-CY7q81OM.js → chunk-4HAMMTFA-B3SWgtem.js} +2 -2
  75. package/dist/client/assets/{chunk-75Z2AOVW-14_TWBCK.js → chunk-75Z2AOVW-CXAakYxI.js} +2 -2
  76. package/dist/client/assets/{chunk-DU6HZSFF-BWG3N9au.js → chunk-DU6HZSFF-B4qcstD9.js} +2 -2
  77. package/dist/client/assets/{chunk-F27PBJKO-vnlzbF2j.js → chunk-F27PBJKO-DimzPDjs.js} +2 -2
  78. package/dist/client/assets/{chunk-GMAD6QVW-CL48mY_-.js → chunk-GMAD6QVW-BHA-Os4E.js} +2 -2
  79. package/dist/client/assets/{chunk-GVQU2GXP-Dzgc6o98.js → chunk-GVQU2GXP-P9nMI_GJ.js} +2 -2
  80. package/dist/client/assets/{chunk-IMKFNOWR-BP3CZAoc.js → chunk-IMKFNOWR-RgWCceFN.js} +2 -2
  81. package/dist/client/assets/{chunk-L3NEJ4N5-DJr6VoYO.js → chunk-L3NEJ4N5-9p7zIkHC.js} +2 -2
  82. package/dist/client/assets/{chunk-OSK3NFVY-B7dCia9b.js → chunk-OSK3NFVY-C9IokqLY.js} +2 -2
  83. package/dist/client/assets/{chunk-P2QGCYS3-C39wNHCE.js → chunk-P2QGCYS3-Dwk8ORW_.js} +2 -2
  84. package/dist/client/assets/{chunk-POPQ4Y6H-lHPfawSy.js → chunk-POPQ4Y6H-BwYKYQwt.js} +2 -2
  85. package/dist/client/assets/{chunk-PWAF6VOD-B-onoF1f.js → chunk-PWAF6VOD-BMw0rklB.js} +2 -2
  86. package/dist/client/assets/{chunk-SHT3W25Y-Df8OXB-a.js → chunk-SHT3W25Y-D3ovSAoa.js} +2 -2
  87. package/dist/client/assets/{chunk-SVP7TREG-B5Jq9B5Y.js → chunk-SVP7TREG-CpaRTznV.js} +2 -2
  88. package/dist/client/assets/{chunk-TICWLB2K-B5SLi6aM.js → chunk-TICWLB2K-CAtIccZJ.js} +2 -2
  89. package/dist/client/assets/classDiagram-ZZMXUADV-Scmt9e5N.js +2 -0
  90. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Scmt9e5N.js +2 -0
  91. package/dist/client/assets/{color-picker-CkJLA9Jr.js → color-picker-DYoHU1P8.js} +2 -2
  92. package/dist/client/assets/{combobox-B6mdMhHV.js → combobox-Ddag8Jom.js} +2 -2
  93. package/dist/client/assets/{command-DJuCVIR5.js → command-B35zAYVN.js} +2 -2
  94. package/dist/client/assets/{connect-rtC5Yxq-.js → connect-XgeleCz9.js} +2 -2
  95. package/dist/client/assets/{connect-agent-CPPwjVyn.js → connect-agent-BRIcxQbo.js} +2 -2
  96. package/dist/client/assets/{cynefin-OW5HDTMX-CARsjMgW.js → cynefin-OW5HDTMX-Br0UWz2p.js} +1 -1
  97. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CHY9mnu2.js → cynefinDiagram-5FMLGOSQ-Bz8AWXlE.js} +2 -2
  98. package/dist/client/assets/{dagre-GXQ25YYZ-C0FrjxaN.js → dagre-GXQ25YYZ-Kk1kLU-A.js} +2 -2
  99. package/dist/client/assets/{device-CR5lpfef.js → device-CJH4ixRH.js} +2 -2
  100. package/dist/client/assets/{diagram-S7CK7UJ4-PtPpZAI6.js → diagram-S7CK7UJ4-Dogw5edZ.js} +2 -2
  101. package/dist/client/assets/{diagram-UQ7AKVKN-DUgq-dTJ.js → diagram-UQ7AKVKN-kg5DSfbZ.js} +2 -2
  102. package/dist/client/assets/{diagram-VSXAHHWV-Gh5HsUIP.js → diagram-VSXAHHWV-DXdyRkdD.js} +2 -2
  103. package/dist/client/assets/{diagram-VX7I27RA-D5FMJiCf.js → diagram-VX7I27RA-CNO5Z04I.js} +2 -2
  104. package/dist/client/assets/{diagram-Z3DM3KII-CmAYyvaL.js → diagram-Z3DM3KII-7Pw0HXMg.js} +2 -2
  105. package/dist/client/assets/{dialog-DF47CrNT.js → dialog-C9_Ef3sx.js} +2 -2
  106. package/dist/client/assets/{diffRendering-zhNPdu0X.js → diffRendering-CAxImuLd.js} +2 -2
  107. package/dist/client/assets/{discovery-list-BHQKwt20.js → discovery-list-DXE1P9pq.js} +2 -2
  108. package/dist/client/assets/{dist-xJXPIdFu.js → dist-DOyHkZUI.js} +3 -3
  109. package/dist/client/assets/{draft-input-Dj2IHuwL.js → draft-input-6dynCiw_.js} +2 -2
  110. package/dist/client/assets/{duoViewer-uYgErMSw.js → duoViewer-BFeSS1Av.js} +2 -2
  111. package/dist/client/assets/{dynamic-CM5x0VU9.js → dynamic-BxCDxZLw.js} +2 -2
  112. package/dist/client/assets/{ebnfDiagram-PWID7BFC-C2bi_JaD.js → ebnfDiagram-PWID7BFC-DD9UVmrJ.js} +2 -2
  113. package/dist/client/assets/{embeddedScripts-CrApSF9h.js → embeddedScripts-CIC2AYGL.js} +2 -2
  114. package/dist/client/assets/{empty-DqTsGaFf.js → empty-BvJSXK20.js} +2 -2
  115. package/dist/client/assets/{entities-BJX4eZyc.js → entities-Dzl1j2jY.js} +2 -2
  116. package/dist/client/assets/{erDiagram-RLTQ6QDP-BNnOWsqy.js → erDiagram-RLTQ6QDP-BJ--ph2e.js} +2 -2
  117. package/dist/client/assets/eventmodeling-NTZA5JFV-DrPNirV-.js +1 -0
  118. package/dist/client/assets/{fileLinks-DO5hZpK2.js → fileLinks-BZV-xG7Q.js} +2 -2
  119. package/dist/client/assets/{fileTreeExpansion-CIOHZWsx.js → fileTreeExpansion-SSkII8h0.js} +2 -2
  120. package/dist/client/assets/flowDiagram-HODETNUW-D4bD8hue.js +1 -0
  121. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Bnkb2Ngr.js → ganttDiagram-EL5Y4UJY-CAMkT1YN.js} +2 -2
  122. package/dist/client/assets/{getDiffFileInput-DQz1O4Oa.js → getDiffFileInput-BbRHVLd8.js} +2 -2
  123. package/dist/client/assets/{gitGraph-4MIJSDKK-D-LR6ljt.js → gitGraph-4MIJSDKK-DsGem99u.js} +1 -1
  124. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-Dxeh7Ifh.js → gitGraphDiagram-WWUBYQGX-BkbTIyDI.js} +2 -2
  125. package/dist/client/assets/{guideRunStore-BDwUrwVG.js → guideRunStore-CRgghh5M.js} +2 -2
  126. package/dist/client/assets/{htmlRender-u6aukaIS.js → htmlRender-DhaCAG_8.js} +2 -2
  127. package/dist/client/assets/{index-CX66rK96.js → index-CyuShNwE.js} +3 -3
  128. package/dist/client/assets/{info-A6RAGUB7-UNUNy-u6.js → info-A6RAGUB7-BBQkQpY8.js} +1 -1
  129. package/dist/client/assets/{infoDiagram-27XIBGKW-CGvleawa.js → infoDiagram-27XIBGKW-B-aRfZJ5.js} +2 -2
  130. package/dist/client/assets/{input-Co98bOaa.js → input-BZEAWLAC.js} +2 -2
  131. package/dist/client/assets/{input-group-C65K0cEy.js → input-group-DQ0hiSJt.js} +2 -2
  132. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-D-QGLluZ.js → ishikawaDiagram-5VMMS53U-BuQT0JFA.js} +2 -2
  133. package/dist/client/assets/{journeyDiagram-3NMN7TZE-Cc9GB3QS.js → journeyDiagram-3NMN7TZE-DvMkIp6_.js} +2 -2
  134. package/dist/client/assets/{kanban-definition-UXKFOSKX-BgUV6FhS.js → kanban-definition-UXKFOSKX-BH-BleQp.js} +2 -2
  135. package/dist/client/assets/{kbd-CwLhv_1P.js → kbd-B5U1dWuw.js} +2 -2
  136. package/dist/client/assets/{keybindings-DcZTzIOk.js → keybindings-BOV97yVS.js} +2 -2
  137. package/dist/client/assets/{lazyRouteComponent-OwDgZa6d.js → lazyRouteComponent-Cz9CWj20.js} +2 -2
  138. package/dist/client/assets/{line-sNp2Ita4.js → line-ldmXyAfR.js} +2 -2
  139. package/dist/client/assets/{link-Djjm-r3O.js → link-GWWfOiYJ.js} +2 -2
  140. package/dist/client/assets/{linkedPrompt-jLrYuA9Q.js → linkedPrompt-CUOURNo0.js} +2 -2
  141. package/dist/client/assets/{main-BD763ru4.js → main-DJbmaTSv.js} +7 -7
  142. package/dist/client/assets/{mediaReference-DWr_Q7C6.js → mediaReference-CHMrPLS_.js} +2 -2
  143. package/dist/client/assets/{mediaSource-N7mIMF8c.js → mediaSource-C2DVrhoI.js} +2 -2
  144. package/dist/client/assets/{mermaid-parser.core-BlZknfsy.js → mermaid-parser.core-CLu3jfMo.js} +4 -4
  145. package/dist/client/assets/{mermaid.core--V3R0CM0.js → mermaid.core-CcbjUEO9.js} +5 -5
  146. package/dist/client/assets/{mindmap-definition-YA3MSWOX-Dcl1V19a.js → mindmap-definition-YA3MSWOX-BgA-mHTZ.js} +2 -2
  147. package/dist/client/assets/{number-field-Dl9-pPML.js → number-field-BuLW4JjE.js} +2 -2
  148. package/dist/client/assets/{observeResize-Cu9WOk75.js → observeResize-DRhwSBbU.js} +2 -2
  149. package/dist/client/assets/{onboarding-D28jAqhK.js → onboarding-JdAo8zsA.js} +2 -2
  150. package/dist/client/assets/{openFileInPreview-D8k3bAuB.js → openFileInPreview-fPqhkMo9.js} +2 -2
  151. package/dist/client/assets/{p4ProjectFile-CA-XB2mx.js → p4ProjectFile-CvON4UbU.js} +2 -2
  152. package/dist/client/assets/{packet-AYTQ26CC-Cq8cyogA.js → packet-AYTQ26CC-DApn8qRX.js} +1 -1
  153. package/dist/client/assets/{pair-DTdVCqrt.js → pair-BZFzlFlB.js} +2 -2
  154. package/dist/client/assets/{pegDiagram-XKGWAZYB-CIlCIsuG.js → pegDiagram-XKGWAZYB-CXEiF-e_.js} +2 -2
  155. package/dist/client/assets/{phoneViewer-Cq9_4rg4.js → phoneViewer-B2PYzUOK.js} +2 -2
  156. package/dist/client/assets/{pie-WAS4IAKB-C1UwrJ5y.js → pie-WAS4IAKB-CYqWZV05.js} +1 -1
  157. package/dist/client/assets/{pieDiagram-E7YTZNPT-DE2DXJ6n.js → pieDiagram-E7YTZNPT-DI-IJXNl.js} +2 -2
  158. package/dist/client/assets/{pierre-icons-CTwu60OQ.js → pierre-icons-bBNX7pHG.js} +2 -2
  159. package/dist/client/assets/{popover-C_CynHVT.js → popover-O8JaXWO5.js} +2 -2
  160. package/dist/client/assets/{preview-BQQJkcGO.js → preview-BVbvXV-T.js} +2 -2
  161. package/dist/client/assets/{preview-BhxAapOU.js → preview-CBNZZm4k.js} +2 -2
  162. package/dist/client/assets/{previewMiniPlayerStore-DFZVAQQT.js → previewMiniPlayerStore-C_DZeWb5.js} +2 -2
  163. package/dist/client/assets/{primary-DSRxd6M2.js → primary-fvERVyIG.js} +2 -2
  164. package/dist/client/assets/{primaryCloudLinkState-CFpdks4W.js → primaryCloudLinkState-CT9FDATw.js} +2 -2
  165. package/dist/client/assets/{projectFilesQueryState-C-ocQLMP.js → projectFilesQueryState-D-fWLsA3.js} +2 -2
  166. package/dist/client/assets/{projectScriptEditor-B8vMmwB8.js → projectScriptEditor-BqddH5Lr.js} +2 -2
  167. package/dist/client/assets/{providerSkills-CcHRwAN-.js → providerSkills-JMYzRM2N.js} +2 -2
  168. package/dist/client/assets/{pullRequestDetail.logic-BtIgsnU5.js → pullRequestDetail.logic-BVBxawC1.js} +2 -2
  169. package/dist/client/assets/{pullRequestIcons-DIZr6jl2.js → pullRequestIcons-CuqlEFYV.js} +2 -2
  170. package/dist/client/assets/{pullRequestReviewStore-amd6o4Qz.js → pullRequestReviewStore-DmxuV1dp.js} +2 -2
  171. package/dist/client/assets/{pullRequests-DYydEt0i.js → pullRequests-CEpTVk5m.js} +2 -2
  172. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-B71DEG2g.js → quadrantDiagram-AXDQQJYC-Os8jPhhw.js} +2 -2
  173. package/dist/client/assets/{queries-CL96nG-6.js → queries-BBd2XSpN.js} +2 -2
  174. package/dist/client/assets/{query-BUdsNuE-.js → query-fboCqXXy.js} +2 -2
  175. package/dist/client/assets/{radar-RG4KPBEZ-DXixQtmq.js → radar-RG4KPBEZ-BwFp-k4W.js} +1 -1
  176. package/dist/client/assets/{radio-group-A1S0ujjv.js → radio-group-B2ziR973.js} +2 -2
  177. package/dist/client/assets/{railroad-74A4TZTK-Dc3k62gE.js → railroad-74A4TZTK-BhaeCUUR.js} +1 -1
  178. package/dist/client/assets/railroad-abnf-HS5TGJTU-D_PV710-.js +1 -0
  179. package/dist/client/assets/railroad-ebnf-LZEXJU2U-CmXdS8HA.js +1 -0
  180. package/dist/client/assets/railroad-peg-WCYAUIDC-BpmFZ4-g.js +1 -0
  181. package/dist/client/assets/{railroadDiagram-O6MQD6OU-CI6QRate.js → railroadDiagram-O6MQD6OU-BwEd4kBJ.js} +2 -2
  182. package/dist/client/assets/{renderScheduler-5H6UPjvu.js → renderScheduler-C031Kal5.js} +2 -2
  183. package/dist/client/assets/{requirementDiagram-BXWQKSXE-B0Buh6ge.js → requirementDiagram-BXWQKSXE-B3cJlOEK.js} +2 -2
  184. package/dist/client/assets/{rightPanelStore-DqykKcOU.js → rightPanelStore-JWjHC9l1.js} +2 -2
  185. package/dist/client/assets/{runtime-CKyYqaHd.js → runtime-B-UcwNuZ.js} +2 -2
  186. package/dist/client/assets/{runtime-CUfZ5Phy.js → runtime-BVzm9sLS.js} +3 -3
  187. package/dist/client/assets/{runtimeModeConfig-UzS-MhY2.js → runtimeModeConfig-Ce0Dnm2_.js} +2 -2
  188. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-Deq_JVb6.js → sankeyDiagram-P5KCCOFB-C8CBmy9t.js} +2 -2
  189. package/dist/client/assets/{scheduledTasksSettings.logic-C4ccNgNW.js → scheduledTasksSettings.logic-CJBRz5bk.js} +2 -2
  190. package/dist/client/assets/{scroll-area-Cv4W51s4.js → scroll-area-D4H8QGpd.js} +2 -2
  191. package/dist/client/assets/{select-DzlDEkfd.js → select-D0wmEFXx.js} +2 -2
  192. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-1qHr7xDW.js → sequenceDiagram-WJ2MYXX4-IbrowOt4.js} +2 -2
  193. package/dist/client/assets/{server-wAR-1-oq.js → server-97u7Iupv.js} +2 -2
  194. package/dist/client/assets/{session-kQcn2Ab9.js → session-CPQQ27HG.js} +2 -2
  195. package/dist/client/assets/{session-logic-0uuqchi0.js → session-logic-CiMoVF-V.js} +2 -2
  196. package/dist/client/assets/{settings-CJRxKrr5.js → settings-mAdVdtYz.js} +2 -2
  197. package/dist/client/assets/{settings.appearance-CdYf34t-.js → settings.appearance-SUyLnEit.js} +2 -2
  198. package/dist/client/assets/settings.archived-C-clMQMK.js +2 -0
  199. package/dist/client/assets/{settings.computer-use-BBwkrRF0.js → settings.computer-use-IGLZXOs8.js} +2 -2
  200. package/dist/client/assets/{settings.connections-C0ScdFUO.js → settings.connections-DhpKQ7ay.js} +2 -2
  201. package/dist/client/assets/{settings.data-controls-CqmbYgtL.js → settings.data-controls-FiLy_ddv.js} +2 -2
  202. package/dist/client/assets/{settings.decisions-Bze1TWCV.js → settings.decisions-DZO8QWHd.js} +2 -2
  203. package/dist/client/assets/{settings.diagnostics-DljjNhZd.js → settings.diagnostics-CG2kVUBD.js} +2 -2
  204. package/dist/client/assets/{settings.general-DbmtxjMV.js → settings.general-jsS1Ydzs.js} +2 -2
  205. package/dist/client/assets/{settings.integrations-o3KHIBuO.js → settings.integrations-DDlR7Et9.js} +2 -2
  206. package/dist/client/assets/{settings.keybindings-DKWMv6nZ.js → settings.keybindings-BYwCM_iI.js} +2 -2
  207. package/dist/client/assets/{settings.open-source-licenses-BRMYfP3x.js → settings.open-source-licenses-CZcWXiGu.js} +2 -2
  208. package/dist/client/assets/{settings.plugins-CxGm36pf.js → settings.plugins-P_B4taFp.js} +2 -2
  209. package/dist/client/assets/{settings.projects-B_Zp3Z9z.js → settings.projects-DqNHL2Mx.js} +3 -3
  210. package/dist/client/assets/{settings.providers-DLodyAaO.js → settings.providers-olNQXPOc.js} +3 -3
  211. package/dist/client/assets/{settings.scheduled-tasks-me1XYuBY.js → settings.scheduled-tasks-Dwr1Iiu5.js} +2 -2
  212. package/dist/client/assets/{settings.snap-shot-rYPhb3ty.js → settings.snap-shot-uj9CX5J6.js} +2 -2
  213. package/dist/client/assets/{settings.source-control-CEp3bQpF.js → settings.source-control-H60mYM0m.js} +2 -2
  214. package/dist/client/assets/{settings.storage-Bt3UPsm5.js → settings.storage--Ghi4ySm.js} +2 -2
  215. package/dist/client/assets/{settingsLayout-B-2za2g9.js → settingsLayout-BdqCokK9.js} +2 -2
  216. package/dist/client/assets/{sidebar-DmtBLMTN.js → sidebar-7a8hvtAS.js} +2 -2
  217. package/dist/client/assets/{sidebarProjectGrouping-CnKGrI1j.js → sidebarProjectGrouping-BGgp_M_h.js} +2 -2
  218. package/dist/client/assets/{skeleton-B4ai8OyH.js → skeleton-7wGNlCET.js} +2 -2
  219. package/dist/client/assets/{sortable.esm-wPMp_PEb.js → sortable.esm-CG0AZByT.js} +2 -2
  220. package/dist/client/assets/{sourceControl-CrWHksgJ.js → sourceControl-B8VqenU-.js} +2 -2
  221. package/dist/client/assets/{spinner-CqTy7FSl.js → spinner-YUJ6Pwvq.js} +2 -2
  222. package/dist/client/assets/{standalone-page-DjPR_lp1.js → standalone-page-BxErOfZy.js} +2 -2
  223. package/dist/client/assets/{stateDiagram-D77RDMKH-DBZk-pTE.js → stateDiagram-D77RDMKH-C0i1_7JQ.js} +2 -2
  224. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-nFt0QPRs.js +2 -0
  225. package/dist/client/assets/{swimlanes-42K2YHIH-ByvgaAKf.js → swimlanes-42K2YHIH-DlWorw-a.js} +2 -2
  226. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Byr1T2AB.js +9 -0
  227. package/dist/client/assets/{terminal-links-BleTJXkt.js → terminal-links-DnuUiEnP.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-dTMJKZUr.js → terminalSessions-B89lkZlG.js} +2 -2
  229. package/dist/client/assets/{textarea-DIyHbcIw.js → textarea-Br1ny3dw.js} +2 -2
  230. package/dist/client/assets/{themePalette-ELqAvm4C.js → themePalette-B4vIs8Bi.js} +2 -2
  231. package/dist/client/assets/{threadSort-C6bJOgqf.js → threadSort-BN7fK5qZ.js} +2 -2
  232. package/dist/client/assets/{timeline-definition-24CTP7MA-Q0Al5L2-.js → timeline-definition-24CTP7MA-f1puoyJY.js} +2 -2
  233. package/dist/client/assets/{toast-MGWD1Vlb.js → toast-Bkc7xsho.js} +2 -2
  234. package/dist/client/assets/{toggle-BAcxn8F-.js → toggle-DNxTFG4o.js} +2 -2
  235. package/dist/client/assets/{toggle-group-XAlRECP9.js → toggle-group-CQtXH1ph.js} +2 -2
  236. package/dist/client/assets/{tooltip-BTZmEp2R.js → tooltip-DH7_Fmka.js} +2 -2
  237. package/dist/client/assets/{treeView-Q6P3EWNA-CA5VrBlD.js → treeView-Q6P3EWNA-cachkR0K.js} +1 -1
  238. package/dist/client/assets/{treemap-WGGIJYW6-VkJwMEUW.js → treemap-WGGIJYW6-5vI1Z8yq.js} +1 -1
  239. package/dist/client/assets/{usage-BAr-_U4h.js → usage-Cuwnw3mn.js} +2 -2
  240. package/dist/client/assets/{usageAccess-DHG-PXT1.js → usageAccess-BRuBlcgN.js} +2 -2
  241. package/dist/client/assets/{usageFormat-B7-dLMvL.js → usageFormat-B0V5dWS3.js} +2 -2
  242. package/dist/client/assets/{usageShortcuts-BffpH2Am.js → usageShortcuts-CK0JjnNA.js} +2 -2
  243. package/dist/client/assets/{use-atom-command-CwLq1NLm.js → use-atom-command-JNR1Jqwn.js} +2 -2
  244. package/dist/client/assets/{useAriaLabelledBy-DuZF33ag.js → useAriaLabelledBy-BNA1QLXP.js} +2 -2
  245. package/dist/client/assets/{useHandleNewThread-Dz0hXG9T.js → useHandleNewThread-vYbjmg4i.js} +2 -2
  246. package/dist/client/assets/{useLocation-Ck2WxARJ.js → useLocation-D91_HRP0.js} +2 -2
  247. package/dist/client/assets/useNavigate-NmIi-1RV.js +2 -0
  248. package/dist/client/assets/{useNavigateBack-DkhnvN2P.js → useNavigateBack-DnwpvjrN.js} +2 -2
  249. package/dist/client/assets/{useParams-ZpfAkQ5u.js → useParams-CYkWvywV.js} +2 -2
  250. package/dist/client/assets/{usePermissionStatus-BXGMw-SX.js → usePermissionStatus-CuzpUXth.js} +2 -2
  251. package/dist/client/assets/{usePullRequestActions-CtlawWSo.js → usePullRequestActions-DqgBdoH5.js} +2 -2
  252. package/dist/client/assets/{useRegisterFieldControl-Bnfq4Sq_.js → useRegisterFieldControl-C127nghN.js} +2 -2
  253. package/dist/client/assets/{useScopedModelAvailability-BH0nl2bK.js → useScopedModelAvailability-BsIJUZbS.js} +2 -2
  254. package/dist/client/assets/{useSettings-B_UiwKX2.js → useSettings-DYKTOdxY.js} +2 -2
  255. package/dist/client/assets/{useT3ConnectAuthPrompt-CgOEppM6.js → useT3ConnectAuthPrompt-DlW3HUgA.js} +2 -2
  256. package/dist/client/assets/{utils-BSj_I6H5.js → utils-vKlT_s3D.js} +2 -2
  257. package/dist/client/assets/{vcsRefInvalidation-CagWw7RC.js → vcsRefInvalidation-CC_2_Ufo.js} +2 -2
  258. package/dist/client/assets/{vennDiagram-4TSXK5OY-CYfZGFGR.js → vennDiagram-4TSXK5OY-HkY_FANS.js} +2 -2
  259. package/dist/client/assets/{wardley-WFR3VGLG-CTushXoY.js → wardley-WFR3VGLG-B9HKXiPi.js} +1 -1
  260. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-YUv9rcpO.js → wardleyDiagram-VM6X3IG4-CJL7EyS8.js} +2 -2
  261. package/dist/client/assets/{welcome-CF1pFivU.js → welcome-BOXDf4R_.js} +2 -2
  262. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DSqIxe9e.js → xychartDiagram-S5SC5T6Z-Bsll1-pV.js} +2 -2
  263. package/dist/client/index.html +1 -1
  264. package/package.json +1 -1
  265. package/dist/client/assets/architecture-7GRP2DOG-BYbXaKhk.js +0 -1
  266. package/dist/client/assets/channel-B0viw1HQ.js +0 -2
  267. package/dist/client/assets/classDiagram-ZZMXUADV-CaSHZ6o_.js +0 -2
  268. package/dist/client/assets/classDiagram-v2-VYDZK3BY-CaSHZ6o_.js +0 -2
  269. package/dist/client/assets/eventmodeling-NTZA5JFV-b-UZANga.js +0 -1
  270. package/dist/client/assets/flowDiagram-HODETNUW-CZR0K3VV.js +0 -1
  271. package/dist/client/assets/railroad-abnf-HS5TGJTU-KGox1mtk.js +0 -1
  272. package/dist/client/assets/railroad-ebnf-LZEXJU2U-B3MJWEk4.js +0 -1
  273. package/dist/client/assets/railroad-peg-WCYAUIDC-Dvcg1m8U.js +0 -1
  274. package/dist/client/assets/settings.archived-CBKnSA9g.js +0 -2
  275. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-01P-rV-b.js +0 -2
  276. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-0fZWpnCF.js +0 -9
  277. package/dist/client/assets/useNavigate-gpe7yDrs.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-sN76VbmK.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-BSj_I6H5.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-CUfZ5Phy.js","assets/runtime-CKyYqaHd.js","assets/tooltip-BTZmEp2R.js","assets/env-wK1YYxA8.js","assets/toast-MGWD1Vlb.js","assets/spinner-CqTy7FSl.js","assets/useParams-ZpfAkQ5u.js","assets/DiffFileTree-wSWCfkHQ.js","assets/useSettings-B_UiwKX2.js","assets/server-wAR-1-oq.js","assets/session-kQcn2Ab9.js","assets/use-atom-command-CwLq1NLm.js","assets/themePalette-ELqAvm4C.js","assets/diffRendering-zhNPdu0X.js","assets/index-CX66rK96.js","assets/fileTreeExpansion-CIOHZWsx.js","assets/pierre-icons-CTwu60OQ.js","assets/query-BUdsNuE-.js","assets/DiffCommentAnnotation-DRify9qt.js","assets/Virtualizer-DqZNglST.js","assets/getDiffFileInput-DQz1O4Oa.js","assets/main-BD763ru4.js","assets/vcsRefInvalidation-CagWw7RC.js","assets/entities-BJX4eZyc.js","assets/number-field-Dl9-pPML.js","assets/useRegisterFieldControl-Bnfq4Sq_.js","assets/FormContext-CBGeQN77.js","assets/CSPContext-BuROUwKB.js","assets/select-DzlDEkfd.js","assets/link-Djjm-r3O.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-OwDgZa6d.js","assets/useNavigate-gpe7yDrs.js","assets/useLocation-Ck2WxARJ.js","assets/rightPanelStore-DqykKcOU.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-CL96nG-6.js","assets/session-logic-0uuqchi0.js","assets/htmlRender-u6aukaIS.js","assets/mediaSource-N7mIMF8c.js","assets/fileLinks-DO5hZpK2.js","assets/mediaReference-DWr_Q7C6.js","assets/usageFormat-B7-dLMvL.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-B4ai8OyH.js","assets/useAriaLabelledBy-DuZF33ag.js","assets/checkbox-CzKUo-R1.js","assets/FieldItemContext-Bn6xBVJg.js","assets/toggle-BAcxn8F-.js","assets/toggle-group-XAlRECP9.js","assets/CompositeRoot-NCPzVvXO.js","assets/command-DJuCVIR5.js","assets/ComboboxClear-CB7SvrMN.js","assets/input-Co98bOaa.js","assets/FieldControl-BTrrbQ3K.js","assets/scroll-area-Cv4W51s4.js","assets/DialogTitle-DrhNhCSD.js","assets/dialog-DF47CrNT.js","assets/dist-xJXPIdFu.js","assets/sidebar-DmtBLMTN.js","assets/useResizeDrag-KJl_F2EN.js","assets/observeResize-Cu9WOk75.js","assets/AnimatedHeight-4Jo1qKaP.js","assets/assets-1IiF113B.js","assets/sourceControl-CrWHksgJ.js","assets/openFileInPreview-D8k3bAuB.js","assets/browserHistoryStore-DNPsjLW4.js","assets/preview-BhxAapOU.js","assets/keybindings-DcZTzIOk.js","assets/Icons-AkySFIEx.js","assets/preview-BQQJkcGO.js","assets/PierreEntryIcon-IuSWNqlA.js","assets/RenderErrorBoundary-CwR9l2vj.js","assets/threadSort-C6bJOgqf.js","assets/browserLinkTarget-1GMN2suO.js","assets/pullRequestIcons-DIZr6jl2.js","assets/pullRequests-DYydEt0i.js","assets/popover-C_CynHVT.js","assets/ProjectFavicon-ClxI7OY3.js","assets/ProjectMonogram-DCxOyCyM.js","assets/projectFilesQueryState-C-ocQLMP.js","assets/terminalSessions-dTMJKZUr.js","assets/guideRunStore-BDwUrwVG.js","assets/pullRequestDetail.logic-BtIgsnU5.js","assets/pullRequestReviewStore-amd6o4Qz.js","assets/sortable.esm-wPMp_PEb.js","assets/p4ProjectFile-CA-XB2mx.js","assets/sidebarProjectGrouping-CnKGrI1j.js","assets/useHandleNewThread-Dz0hXG9T.js","assets/EnvironmentMachineIcon-pSS7qKfw.js","assets/alert-DwFQdL_W.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-CG-YKS6A.js","assets/kbd-CwLhv_1P.js","assets/settingsLayout-B-2za2g9.js","assets/WorkspacePageContainer-DSbQuXwt.js","assets/KeybindingsSettings.logic-CkDiTn0M.js","assets/usageShortcuts-BffpH2Am.js","assets/primaryCloudLinkState-CFpdks4W.js","assets/ConnectionStatusDot-vBtwC3Vj.js","assets/standalone-page-DjPR_lp1.js","assets/primary-DSRxd6M2.js","assets/onboarding-D28jAqhK.js","assets/scheduledTasksSettings.logic-C4ccNgNW.js","assets/main-bt-A8VDR.css","assets/DiffWorkerPoolProvider-C7kCyuBf.js","assets/textarea-DIyHbcIw.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CX66rK96.js";import{r as n}from"./Icon-l19w4AjM.js";import{$d as r,$n as i,$u as a,A as o,Ad as s,Ah as c,Au as l,Bp as u,Bs as d,Bu as f,Cf as p,D as m,Em as h,Ep as g,F as _,Gn as v,HT as y,Hp as b,If as x,Iu as S,Jn as C,Kn as w,Kp as T,Lo as E,Ls as D,Md as O,Mp as k,Nd as A,Od as j,Ou as M,Pd as N,Qn as P,Qp as F,Qu as I,Rf as L,Rs as R,Sd as z,Tm as B,Tp as V,Vo as H,Vp as ee,Wd as te,Wn as ne,Yn as U,Zd as re,Zg as ie,Zn as ae,_m as oe,_p as W,_s as se,ap as ce,ar as le,ay as ue,bm as de,cr as fe,dE as pe,ed as me,hs as he,i_ as ge,ir as _e,kd as ve,ku as ye,lf as be,lm as xe,lp as Se,mp as Ce,nd as we,nr as Te,of as Ee,ol as De,om as Oe,or as ke,qf as Ae,qn as je,rp as Me,rr as Ne,sp as Pe,sr as G,t as K,td as Fe,tm as Ie,tr as Le,ty as Re,ua as ze,ud as Be,vs as Ve,vy as He,xf as Ue,zd as We}from"./utils-BSj_I6H5.js";import{U as Ge}from"./runtime-CUfZ5Phy.js";import{C as Ke,O as qe,k as Je,w as Ye}from"./entities-BJX4eZyc.js";import{$t as Xe,cn as Ze,dn as Qe,in as $e,ln as et,sn as tt}from"./runtime-CKyYqaHd.js";import{H as nt,M as rt,U as it,a as q,c as at,g as ot,j as st,n as J,r as ct,t as Y,v as lt}from"./tooltip-BTZmEp2R.js";import{$ as ut,B as dt,n as ft,z as pt}from"./ChatMarkdown-CNhzmB5x.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-DzlDEkfd.js";import{t as vt}from"./spinner-CqTy7FSl.js";import{i as yt,m as bt,p as xt}from"./toast-MGWD1Vlb.js";import{E as St,J as Ct,K as wt,f as Tt}from"./useSettings-B_UiwKX2.js";import{s as Et}from"./server-wAR-1-oq.js";import{i as Dt,n as Ot}from"./session-kQcn2Ab9.js";import{n as kt}from"./query-BUdsNuE-.js";import{t as At}from"./use-atom-command-CwLq1NLm.js";import{l as jt,t as X}from"./rightPanelStore-DqykKcOU.js";import{u as Mt}from"./queries-CL96nG-6.js";import{C as Nt,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-zhNPdu0X.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-DqZNglST.js";import{l as ln,ut as un}from"./getDiffFileInput-DQz1O4Oa.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-C7kCyuBf.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-DHS_UG0K.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-DRify9qt.js";import{r as Tn}from"./mediaSource-N7mIMF8c.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{t as On}from"./skeleton-B4ai8OyH.js";import{t as kn}from"./textarea-DIyHbcIw.js";import{t as An}from"./toggle-BAcxn8F-.js";import{n as jn,t as Mn}from"./toggle-group-XAlRECP9.js";import{i as Nn,l as Pn,o as Fn,r as In,s as Ln,t as Rn}from"./combobox-B6mdMhHV.js";import{d as zn,l as Bn,t as Vn,u as Hn}from"./command-DJuCVIR5.js";import{t as Un}from"./input-Co98bOaa.js";import{t as Wn}from"./scroll-area-Cv4W51s4.js";import{a as Gn,c as Kn,i as qn,o as Jn,r as Yn,s as Xn,t as Zn}from"./dialog-DF47CrNT.js";import{t as Qn}from"./useResizeDrag-KJl_F2EN.js";import{a as $n,i as er,o as tr,r as nr,t as rr}from"./empty-DqTsGaFf.js";import{i as ir}from"./device-CR5lpfef.js";import{t as ar}from"./observeResize-Cu9WOk75.js";import{o as or,s as sr}from"./openFileInPreview-D8k3bAuB.js";import{f as cr}from"./browserHistoryStore-DNPsjLW4.js";import{_ as lr,y as ur}from"./keybindings-DcZTzIOk.js";import{i as dr,n as fr}from"./Icons-AkySFIEx.js";import{t as pr}from"./PierreEntryIcon-IuSWNqlA.js";import{F as mr,H as hr,U as gr,_ as _r,a as vr,b as yr,c as br,d as xr,f as Sr,g as Cr,h as wr,i as Tr,m as Er,n as Dr,o as Or,p as kr,r as Ar,s as jr,u as Mr,v as Nr,x as Pr,y as Fr}from"./RenderErrorBoundary-CwR9l2vj.js";import{c as Ir,l as Lr}from"./threadSort-C6bJOgqf.js";import{n as Rr}from"./pullRequestIcons-DIZr6jl2.js";import{D as zr,a as Br,c as Vr,i as Hr,k as Ur,n as Wr,r as Gr,u as Kr}from"./pullRequests-DYydEt0i.js";import{a as qr,i as Jr,n as Yr,o as Xr,t as Zr}from"./popover-C_CynHVT.js";import{A as Qr,B as $r,C as ei,D as ti,E as ni,F as ri,G as ii,H as ai,I as oi,J as si,K as ci,L as li,M as ui,N as di,O as fi,R as pi,S as mi,T as hi,V as gi,Y as _i,_ as vi,a as yi,c as bi,d as xi,f as Si,g as Ci,h as wi,i as Ti,j as Ei,k as Di,l as Oi,o as ki,r as Ai,s as ji,t as Mi,v as Ni,w as Pi,x as Fi,y as Ii,z as Li}from"./pullRequestDetail.logic-BtIgsnU5.js";import{i as Ri,n as zi,r as Bi,t as Vi}from"./pullRequestReviewStore-amd6o4Qz.js";import{t as Hi}from"./terminalLabels-BgLOlb2G.js";import{i as Ui,m as Wi,n as Gi,r as Ki,t as qi}from"./guideRunStore-BDwUrwVG.js";import{a as Ji,b as Yi,h as Xi,l as Zi,m as Qi,p as $i,r as ea,s as ta,t as na,u as ra}from"./sortable.esm-wPMp_PEb.js";import{n as ia}from"./useHandleNewThread-Dz0hXG9T.js";import{n as aa}from"./EnvironmentMachineIcon-pSS7qKfw.js";import{i as oa,n as sa,r as ca,t as la}from"./alert-DwFQdL_W.js";import{t as ua}from"./kbd-CwLhv_1P.js";import{Fa as da,Ia as fa,Jr as pa,Pa as ma,Ra as ha,ai as ga,cn as _a,fa as va,oi as ya,qa as ba,qr as xa,ua as Sa}from"./main-BD763ru4.js";import"./WorkspacePageHeader-GK8yx2Yo.js";import{r as Ca,s as wa,t as Ta}from"./usePullRequestActions-CtlawWSo.js";function Ea(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Da(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Oa(e.items,t.items)}function Oa(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 ka(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 Aa(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var ja=1e5,Ma=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Na=`data-diffs-search`,Pa=`:host {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-qEGBl5Kn.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-vKlT_s3D.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-BVzm9sLS.js","assets/runtime-B-UcwNuZ.js","assets/tooltip-DH7_Fmka.js","assets/env-wK1YYxA8.js","assets/toast-Bkc7xsho.js","assets/spinner-YUJ6Pwvq.js","assets/useParams-CYkWvywV.js","assets/DiffFileTree-Bg8GHn2r.js","assets/useSettings-DYKTOdxY.js","assets/server-97u7Iupv.js","assets/session-CPQQ27HG.js","assets/use-atom-command-JNR1Jqwn.js","assets/themePalette-B4vIs8Bi.js","assets/diffRendering-CAxImuLd.js","assets/index-CyuShNwE.js","assets/fileTreeExpansion-SSkII8h0.js","assets/pierre-icons-bBNX7pHG.js","assets/query-fboCqXXy.js","assets/DiffCommentAnnotation-BsI9yTe1.js","assets/Virtualizer-CB4f0UTD.js","assets/getDiffFileInput-BbRHVLd8.js","assets/main-DJbmaTSv.js","assets/vcsRefInvalidation-CC_2_Ufo.js","assets/entities-Dzl1j2jY.js","assets/number-field-BuLW4JjE.js","assets/useRegisterFieldControl-C127nghN.js","assets/FormContext-CUf-dYwe.js","assets/CSPContext-CB4Jj3Uk.js","assets/select-D0wmEFXx.js","assets/link-GWWfOiYJ.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-Cz9CWj20.js","assets/useNavigate-NmIi-1RV.js","assets/useLocation-D91_HRP0.js","assets/rightPanelStore-JWjHC9l1.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-BBd2XSpN.js","assets/session-logic-CiMoVF-V.js","assets/htmlRender-DhaCAG_8.js","assets/mediaSource-C2DVrhoI.js","assets/fileLinks-BZV-xG7Q.js","assets/mediaReference-CHMrPLS_.js","assets/usageFormat-B0V5dWS3.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-7wGNlCET.js","assets/useAriaLabelledBy-BNA1QLXP.js","assets/checkbox-Gd1YCUIl.js","assets/FieldItemContext-Bn6xBVJg.js","assets/toggle-DNxTFG4o.js","assets/toggle-group-CQtXH1ph.js","assets/CompositeRoot-CLSWLNTl.js","assets/command-B35zAYVN.js","assets/ComboboxClear-D8WYxa7i.js","assets/input-BZEAWLAC.js","assets/FieldControl-CrNWnPN_.js","assets/scroll-area-D4H8QGpd.js","assets/DialogTitle-BVkBTuS9.js","assets/dialog-C9_Ef3sx.js","assets/dist-DOyHkZUI.js","assets/sidebar-7a8hvtAS.js","assets/useResizeDrag-KJl_F2EN.js","assets/observeResize-DRhwSBbU.js","assets/AnimatedHeight-DewGDSmN.js","assets/assets-B7aY-rQd.js","assets/sourceControl-B8VqenU-.js","assets/openFileInPreview-fPqhkMo9.js","assets/browserHistoryStore-TLJ0k3I1.js","assets/preview-CBNZZm4k.js","assets/keybindings-BOV97yVS.js","assets/Icons-DMu3kCVA.js","assets/preview-BVbvXV-T.js","assets/PierreEntryIcon-BUl5qtCE.js","assets/RenderErrorBoundary-CyH8UwmD.js","assets/threadSort-BN7fK5qZ.js","assets/browserLinkTarget-Du_qPFvd.js","assets/pullRequestIcons-CuqlEFYV.js","assets/pullRequests-CEpTVk5m.js","assets/popover-O8JaXWO5.js","assets/ProjectFavicon-BKEw0TrD.js","assets/ProjectMonogram-B2dsNF6-.js","assets/projectFilesQueryState-D-fWLsA3.js","assets/terminalSessions-B89lkZlG.js","assets/guideRunStore-CRgghh5M.js","assets/pullRequestDetail.logic-BVBxawC1.js","assets/pullRequestReviewStore-DmxuV1dp.js","assets/sortable.esm-CG0AZByT.js","assets/p4ProjectFile-CvON4UbU.js","assets/sidebarProjectGrouping-BGgp_M_h.js","assets/useHandleNewThread-vYbjmg4i.js","assets/EnvironmentMachineIcon-DX1wHHgS.js","assets/alert-DzxRsWWi.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-CFN6c9Ue.js","assets/kbd-B5U1dWuw.js","assets/settingsLayout-BdqCokK9.js","assets/WorkspacePageContainer-8jksqZGW.js","assets/KeybindingsSettings.logic-BB1oFV_W.js","assets/usageShortcuts-CK0JjnNA.js","assets/primaryCloudLinkState-CT9FDATw.js","assets/ConnectionStatusDot-B0ZKI-zI.js","assets/standalone-page-BxErOfZy.js","assets/primary-fvERVyIG.js","assets/onboarding-JdAo8zsA.js","assets/scheduledTasksSettings.logic-CJBRz5bk.js","assets/main-bt-A8VDR.css","assets/DiffWorkerPoolProvider-B9BXoLYM.js","assets/textarea-Br1ny3dw.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CyuShNwE.js";import{r as n}from"./Icon-l19w4AjM.js";import{$d as r,$n as i,$u as a,A as o,Ad as s,Ah as c,Au as l,Bp as u,Bs as d,Bu as f,Cf as p,D as m,Em as h,Ep as g,F as _,Gn as v,HT as y,Hp as b,If as x,Iu as S,Jn as C,Kn as w,Kp as T,Lo as E,Ls as D,Md as O,Mp as k,Nd as A,Od as j,Ou as M,Pd as N,Qn as P,Qp as F,Qu as I,Rf as L,Rs as R,Sd as z,Tm as B,Tp as V,Vo as H,Vp as ee,Wd as te,Wn as ne,Yn as U,Zd as re,Zg as ie,Zn as ae,_m as oe,_p as W,_s as se,ap as ce,ar as le,ay as ue,bm as de,cr as fe,dE as pe,ed as me,hs as he,i_ as ge,ir as _e,kd as ve,ku as ye,lf as be,lm as xe,lp as Se,mp as Ce,nd as we,nr as Te,of as Ee,ol as De,om as Oe,or as ke,qf as Ae,qn as je,rp as Me,rr as Ne,sp as Pe,sr as G,t as K,td as Fe,tm as Ie,tr as Le,ty as Re,ua as ze,ud as Be,vs as Ve,vy as He,xf as Ue,zd as We}from"./utils-vKlT_s3D.js";import{U as Ge}from"./runtime-BVzm9sLS.js";import{C as Ke,O as qe,k as Je,w as Ye}from"./entities-Dzl1j2jY.js";import{$t as Xe,cn as Ze,dn as Qe,in as $e,ln as et,sn as tt}from"./runtime-B-UcwNuZ.js";import{H as nt,M as rt,U as it,a as q,c as at,g as ot,j as st,n as J,r as ct,t as Y,v as lt}from"./tooltip-DH7_Fmka.js";import{$ as ut,B as dt,n as ft,z as pt}from"./ChatMarkdown-DTSMYNs8.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-D0wmEFXx.js";import{t as vt}from"./spinner-YUJ6Pwvq.js";import{i as yt,m as bt,p as xt}from"./toast-Bkc7xsho.js";import{E as St,J as Ct,K as wt,f as Tt}from"./useSettings-DYKTOdxY.js";import{s as Et}from"./server-97u7Iupv.js";import{i as Dt,n as Ot}from"./session-CPQQ27HG.js";import{n as kt}from"./query-fboCqXXy.js";import{t as At}from"./use-atom-command-JNR1Jqwn.js";import{l as jt,t as X}from"./rightPanelStore-JWjHC9l1.js";import{u as Mt}from"./queries-BBd2XSpN.js";import{C as Nt,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-CAxImuLd.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-CB4f0UTD.js";import{l as ln,ut as un}from"./getDiffFileInput-BbRHVLd8.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-B9BXoLYM.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-Ds-DSHzC.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-BsI9yTe1.js";import{r as Tn}from"./mediaSource-C2DVrhoI.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{t as On}from"./skeleton-7wGNlCET.js";import{t as kn}from"./textarea-Br1ny3dw.js";import{t as An}from"./toggle-DNxTFG4o.js";import{n as jn,t as Mn}from"./toggle-group-CQtXH1ph.js";import{i as Nn,l as Pn,o as Fn,r as In,s as Ln,t as Rn}from"./combobox-Ddag8Jom.js";import{d as zn,l as Bn,t as Vn,u as Hn}from"./command-B35zAYVN.js";import{t as Un}from"./input-BZEAWLAC.js";import{t as Wn}from"./scroll-area-D4H8QGpd.js";import{a as Gn,c as Kn,i as qn,o as Jn,r as Yn,s as Xn,t as Zn}from"./dialog-C9_Ef3sx.js";import{t as Qn}from"./useResizeDrag-KJl_F2EN.js";import{a as $n,i as er,o as tr,r as nr,t as rr}from"./empty-BvJSXK20.js";import{i as ir}from"./device-CJH4ixRH.js";import{t as ar}from"./observeResize-DRhwSBbU.js";import{o as or,s as sr}from"./openFileInPreview-fPqhkMo9.js";import{f as cr}from"./browserHistoryStore-TLJ0k3I1.js";import{_ as lr,y as ur}from"./keybindings-BOV97yVS.js";import{i as dr,n as fr}from"./Icons-DMu3kCVA.js";import{t as pr}from"./PierreEntryIcon-BUl5qtCE.js";import{F as mr,H as hr,U as gr,_ as _r,a as vr,b as yr,c as br,d as xr,f as Sr,g as Cr,h as wr,i as Tr,m as Er,n as Dr,o as Or,p as kr,r as Ar,s as jr,u as Mr,v as Nr,x as Pr,y as Fr}from"./RenderErrorBoundary-CyH8UwmD.js";import{c as Ir,l as Lr}from"./threadSort-BN7fK5qZ.js";import{n as Rr}from"./pullRequestIcons-CuqlEFYV.js";import{D as zr,a as Br,c as Vr,i as Hr,k as Ur,n as Wr,r as Gr,u as Kr}from"./pullRequests-CEpTVk5m.js";import{a as qr,i as Jr,n as Yr,o as Xr,t as Zr}from"./popover-O8JaXWO5.js";import{A as Qr,B as $r,C as ei,D as ti,E as ni,F as ri,G as ii,H as ai,I as oi,J as si,K as ci,L as li,M as ui,N as di,O as fi,R as pi,S as mi,T as hi,V as gi,Y as _i,_ as vi,a as yi,c as bi,d as xi,f as Si,g as Ci,h as wi,i as Ti,j as Ei,k as Di,l as Oi,o as ki,r as Ai,s as ji,t as Mi,v as Ni,w as Pi,x as Fi,y as Ii,z as Li}from"./pullRequestDetail.logic-BVBxawC1.js";import{i as Ri,n as zi,r as Bi,t as Vi}from"./pullRequestReviewStore-DmxuV1dp.js";import{t as Hi}from"./terminalLabels-BgLOlb2G.js";import{i as Ui,m as Wi,n as Gi,r as Ki,t as qi}from"./guideRunStore-CRgghh5M.js";import{a as Ji,b as Yi,h as Xi,l as Zi,m as Qi,p as $i,r as ea,s as ta,t as na,u as ra}from"./sortable.esm-CG0AZByT.js";import{n as ia}from"./useHandleNewThread-vYbjmg4i.js";import{n as aa}from"./EnvironmentMachineIcon-DX1wHHgS.js";import{i as oa,n as sa,r as ca,t as la}from"./alert-DzxRsWWi.js";import{t as ua}from"./kbd-B5U1dWuw.js";import{Fa as da,Ia as fa,Jr as pa,Pa as ma,Ra as ha,ai as ga,cn as _a,fa as va,oi as ya,qa as ba,qr as xa,ua as Sa}from"./main-DJbmaTSv.js";import"./WorkspacePageHeader-IRvZnA0X.js";import{r as Ca,s as wa,t as Ta}from"./usePullRequestActions-DqgBdoH5.js";function Ea(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Da(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Oa(e.items,t.items)}function Oa(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 ka(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 Aa(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var ja=1e5,Ma=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Na=`data-diffs-search`,Pa=`:host {
3
3
  display: block;
4
4
  position: sticky;
5
5
  z-index: 100;
@@ -211,5 +211,5 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CX66rK9
211
211
  [data-code]::-webkit-scrollbar-thumb {
212
212
  background-color: var(--diffs-bg-context);
213
213
  }
214
- `;function nd(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=Uu(r),i=Wu(e,n);if(i.length===0){p=null;break bb0}let a=Rt(Ku(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(od)),deletions:new Set(i.flatMap(ad))},c;t[3]!==s||t[4]!==o||t[5]!==e||t[6]!==i?(c={fileDiff:o,rows:i,shown:i.length,total:e.length,drawn:s},t[3]=s,t[4]=o,t[5]=e,t[6]=i,t[7]=c):c=t[7],p=c}t[0]=n,t[1]=r,t[2]=p}else p=t[2];let m=p,h=m?.rows??null,g;bb1:{if(h===null||h.some(e=>e.hunk!==h[0]?.hunk)){g=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==h?(e=async e=>{let t=await c(e),r=qu(t.newFile.contents,h);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=h,t[13]=e):e=t[13],g=e}let v=g,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=dc(e.position),i=uc(t.side);m?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=dc(u.position);r(uc(e.side),e.line,id)}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,C;t[23]===r?C=t[24]:(C=e=>{if(e===null||r===null)return;let t=_(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=C);let w=C,T=s!==null&&u===null,E=s?.onAskAgent??null,D;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==E?(D=e=>{if(u===null||r===null||E===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&&E(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=E,t[29]=D):D=t[29];let O=D,k;t[30]===f?k=t[31]:(k=Vt(f),t[30]=f,t[31]=k);let A;t[32]===v?A=t[33]:(A=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=A);let j;t[34]!==w||t[35]!==T||t[36]!==f||t[37]!==k||t[38]!==A?(j={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:k,themeType:f,preferredHighlighter:ha,unsafeCSS:td,enableGutterUtility:T,enableLineSelection:T,onGutterUtilityClick:w,onLineSelectionEnd:w,...A},t[34]=w,t[35]=T,t[36]=f,t[37]=k,t[38]=A,t[39]=j):j=t[39];let M=j,N;t[40]===n.caption?N=t[41]:(N=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(Ru,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=N);let P;t[42]!==x||t[43]!==O||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]!==E||t[53]!==l||t[54]!==M||t[55]!==m?(P=m===null?i?(0,$.jsxs)(`p`,{className:`rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[`Loading `,n.path,`...`]}):(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,$.jsx)(`span`,{className:`font-mono text-foreground`,children:n.path}),` lines `,n.start,`-`,n.end,` are not in the loaded diff.`]}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(_n,{fileDiff:m.fileDiff,options:M,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(rd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(fc,{comment:e,onRemove:()=>s?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&s!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${dc(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&&E!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>O(e)}}:{},onCancel:()=>d(null),onComment:e=>{if(!s.canComment){O(e);return}s.onComment({path:n.path,oldPath:r===null?null:sd(r,n.path),position:u.position,body:e}),d(null)}}):null]}),renderHeaderMetadata:()=>(0,$.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[n.side===`old`?`removed code, `:``,`showing `,m.shown,` of`,` `,m.total,` diff lines`]}),(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(S,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=O,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]=E,t[53]=l,t[54]=M,t[55]=m,t[56]=P):P=t[56];let F;return t[57]!==N||t[58]!==P?(F=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[N,P]}),t[57]=N,t[58]=P,t[59]=F):F=t[59],F}function rd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(Qu,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function id(e){return{...e,draft:!0}}function ad(e){return e.oldLine===null?[]:[e.oldLine]}function od(e){return e.newLine===null?[]:[e.newLine]}function sd(e,t){let n=zt(e);return n===t?null:n}function cd(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:ha,unsafeCSS:Go,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 ld={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function ud(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:o,onRailOpenChange:c,stopList:u,nextTitle:d,files:f,loadDiffFiles:p,diffLoading:m,commenting:h,onStep:g,onAsk:_,onFinish:v,onOpenFile:y}=e,b;t[0]===n?b=t[1]:(b=Ju(n),t[0]=n,t[1]=b);let{lettered:S,byExcerpt:C}=b,w;t[2]===n.excerpts?w=t[3]:(w=new Set(n.excerpts.map(dd)),t[2]=n.excerpts,t[3]=w);let T=w,E,D,O,k,A,j,M,P,F;if(t[4]!==C||t[5]!==h||t[6]!==m||t[7]!==T||t[8]!==f||t[9]!==r||t[10]!==S||t[11]!==p||t[12]!==y||t[13]!==c||t[14]!==g||t[15]!==o||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]!==u){let e;t[32]===T?e=t[33]:(e=e=>!T.has(e.path),t[32]=T,t[33]=e);let l=n.files.filter(e);E=S.length>0;let d=E&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===d?D=t[35]:(D=K(`grid gap-8`,d),t[34]=d,t[35]=D),O=`flex min-w-0 flex-col gap-5`;let _=r+1,v;t[36]!==i||t[37]!==_?(v=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,_,` of `,i]}),t[36]=i,t[37]=_,t[38]=v):v=t[38];let b;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=b):b=t[39];let x=r+1,w;t[40]!==i||t[41]!==x?(w=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,x,` of `,i]}),t[40]=i,t[41]=x,t[42]=w):w=t[42];let I=o&&`rotate-180`,L;t[43]===I?L=t[44]:(L=K(I),t[43]=I,t[44]=L);let R;t[45]===L?R=t[46]:(R=(0,$.jsx)(a,{"aria-hidden":!0,className:L}),t[45]=L,t[46]=R);let z;t[47]!==w||t[48]!==R?(z=(0,$.jsxs)(fa,{render:b,children:[w,R]}),t[47]=w,t[48]=R,t[49]=z):z=t[49];let B=r===0,V;t[50]===g?V=t[51]:(V=()=>g(-1),t[50]=g,t[51]=V);let H;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(we,{"aria-hidden":!0}),t[52]=H):H=t[52];let ee;t[53]!==B||t[54]!==V?(ee=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:B,onClick:V,children:H}),t[53]=B,t[54]=V,t[55]=ee):ee=t[55];let te=r===i-1,ne;t[56]===g?ne=t[57]:(ne=()=>g(1),t[56]=g,t[57]=ne);let U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(a,{"aria-hidden":!0}),t[58]=U):U=t[58];let re;t[59]!==te||t[60]!==ne?(re=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:te,onClick:ne,children:U}),t[59]=te,t[60]=ne,t[61]=re):re=t[61];let ie;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(ua,{children:`J`}),(0,$.jsx)(ua,{children:`K`})]}),t[62]=ie):ie=t[62];let ae;t[63]!==ee||t[64]!==re?(ae=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[ee,re,ie]}),t[63]=ee,t[64]=re,t[65]=ae):ae=t[65];let oe;t[66]!==v||t[67]!==z||t[68]!==ae?(oe=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[v,z,ae]}),t[66]=v,t[67]=z,t[68]=ae,t[69]=oe):oe=t[69];let W;t[70]===u?W=t[71]:(W=(0,$.jsx)(da,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:u})}),t[70]=u,t[71]=W),t[72]!==c||t[73]!==o||t[74]!==oe||t[75]!==W?(k=(0,$.jsxs)(ma,{open:o,onOpenChange:c,children:[oe,W]}),t[72]=c,t[73]=o,t[74]=oe,t[75]=W,t[76]=k):k=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)(Ru,{text:n.summary})}),t[79]=n.summary,t[80]=ce),t[81]!==se||t[82]!==ce?(A=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[se,ce]}),t[81]=se,t[82]=ce,t[83]=A):A=t[83],t[84]===n.attention?j=t[85]:(j=n.attention===null?null:(0,$.jsxs)(la,{controlAlignment:`first-line`,children:[(0,$.jsx)(s,{}),(0,$.jsx)(oa,{children:ld[n.attention.kind]}),(0,$.jsx)(ca,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Ru,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=j),t[86]!==C||t[87]!==h||t[88]!==m||t[89]!==f||t[90]!==p||t[91]!==y||t[92]!==n.excerpts?(M=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)(nd,{excerpt:e,file:f.get(e.path)??null,loading:m,notes:C[t]??[],commenting:h,loadDiffFiles:p,onOpenFile:y},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=C,t[87]=h,t[88]=m,t[89]=f,t[90]=p,t[91]=y,t[92]=n.excerpts,t[93]=M):M=t[93],t[94]===S?P=t[95]:(P=(0,$.jsx)($u,{notes:S,className:`@min-[90rem]/guide:hidden`}),t[94]=S,t[95]=P),F=l.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:l.map(e=>{let t=f.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)(ma,{children:[(0,$.jsxs)(fa,{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)(Fe,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(N,{"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)(Ru,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Or,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(da,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:m?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(cd,{file:t,loadDiffFiles:p})})]})},e.path)})})})]}):null,t[4]=C,t[5]=h,t[6]=m,t[7]=T,t[8]=f,t[9]=r,t[10]=S,t[11]=p,t[12]=y,t[13]=c,t[14]=g,t[15]=o,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]=u,t[23]=E,t[24]=D,t[25]=O,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=P,t[31]=F}else E=t[23],D=t[24],O=t[25],k=t[26],A=t[27],j=t[28],M=t[29],P=t[30],F=t[31];let I;t[96]!==_||t[97]!==n.questions?(I=n.questions.length>0||_!==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=>_===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Ru,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>_(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)(x,{"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)(Ru,{text:e,plain:!0})})]},e)),_===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>_(``),children:[(0,$.jsx)(x,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=_,t[97]=n.questions,t[98]=I):I=t[98];let R;t[99]!==d||t[100]!==v||t[101]!==g?(R=d===null?v===null?null:(0,$.jsxs)(G,{onClick:v,children:[(0,$.jsx)(L,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(G,{className:`min-w-0`,onClick:()=>g(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,d]}),(0,$.jsx)(l,{"aria-hidden":!0})]}),t[99]=d,t[100]=v,t[101]=g,t[102]=R):R=t[102];let z;t[103]===R?z=t[104]:(z=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:R}),t[103]=R,t[104]=z);let B;t[105]!==I||t[106]!==z||t[107]!==O||t[108]!==k||t[109]!==A||t[110]!==j||t[111]!==M||t[112]!==P||t[113]!==F?(B=(0,$.jsxs)(`article`,{className:O,children:[k,A,j,M,P,F,I,z]}),t[105]=I,t[106]=z,t[107]=O,t[108]=k,t[109]=A,t[110]=j,t[111]=M,t[112]=P,t[113]=F,t[114]=B):B=t[114];let V;t[115]!==E||t[116]!==S?(V=E?(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)($u,{notes:S})}):null,t[115]=E,t[116]=S,t[117]=V):V=t[117];let H;return t[118]!==D||t[119]!==B||t[120]!==V?(H=(0,$.jsxs)(`div`,{className:D,children:[B,V]}),t[118]=D,t[119]=B,t[120]=V,t[121]=H):H=t[121],H}function dd(e){return e.path}var fd=new Map;function pd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=zi(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:fd},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:fd},f=a.some(e=>!d.files.has(e))&&!d.done,p=kt,m=f?Gr.diff({environmentId:n,input:{...r,...d.cursor===null?{}:{cursor:d.cursor}}}):null,t[4]=n,t[5]=s,t[6]=l,t[7]=r,t[8]=a,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(d=t[9],f=t[10],p=t[11],m=t[12]);let h=p(m),g=h.data,_=d.cursor,v,y;t[13]!==_||t[14]!==g||t[15]!==s?(v=()=>{g!==null&&u(e=>{let t=e.key===s?e:{key:s,cursor:null,done:!1,files:fd};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 md(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=qi(Gi(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=Ki(f),m;t[4]===f?m=t[5]:(m=e=>Ui.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?[]:Bu(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=pd(C),T=At(Gr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Yo(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(zu(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||xa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Wi(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)(Yu,{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)(ud,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(Yu,{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 hd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Gr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=kt(a),s;t[3]===n?s=t[4]:(s=Gr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=H(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=At(Gr.generateReviewGuide,l),[d,f]=(0,Z.useState)(!1),p=o.data,m=d||p?.run?._tag===`Running`,h;t[6]!==p||t[7]!==n||t[8]!==r||t[9]!==i?(h=()=>Ui.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:p?.guide?.generatedAt??null,previousFailedAt:p?.run?._tag===`Failed`?p.run.failedAt:null,since:Date.now()}),t[6]=p,t[7]=n,t[8]=r,t[9]=i,t[10]=h):h=t[10];let g=(0,Z.useEffectEvent)(h),_;t[11]!==p?.run?._tag||t[12]!==g?(_=()=>{p?.run?._tag===`Running`&&g()},t[11]=p?.run?._tag,t[12]=g,t[13]=_):_=t[13];let v=p?.run?._tag,y;t[14]===v?y=t[15]:(y=[v],t[14]=v,t[15]=y),(0,Z.useEffect)(_,y);let b;t[16]!==n||t[17]!==u||t[18]!==r||t[19]!==m||t[20]!==g?(b=async()=>{if(m)return;f(!0),g();let e=await u({environmentId:n,input:r});f(!1),e._tag===`Failure`&&(Ui.getState().settle(Gi(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:li(Ge(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=u,t[18]=r,t[19]=m,t[20]=g,t[21]=b):b=t[21];let x=b,S;return t[22]!==c||t[23]!==p||t[24]!==o||t[25]!==m||t[26]!==x?(S={query:o,data:p,running:m,canWrite:c,write:x},t[22]=c,t[23]=p,t[24]=o,t[25]=m,t[26]=x,t[27]=S):S=t[27],S}function gd(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}=hd(p),y;t[4]!==n||t[5]!==r?(y=Gi(n,r),t[4]=n,t[5]=r,t[6]=y):y=t[6];let x=y,S;t[7]===r?S=t[8]:(S=zi(r),t[7]=r,t[8]=S);let C=S,w=Bi(r),T=Ri(vd),E=Ri(_d),D;t[9]!==T||t[10]!==s||t[11]!==c||t[12]!==w||t[13]!==E||t[14]!==C?(D=!s&&c===null?null:{canComment:s,pending:w,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return T(C,{id:Vi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>E(C,e),onAskAgent:c},t[9]=T,t[10]=s,t[11]=c,t[12]=w,t[13]=E,t[14]=C,t[15]=D):D=t[15];let O=D,k,A;t[16]!==o||t[17]!==x?(k=()=>{if(o)return Ui.getState().setShown(x),()=>{Ui.getState().shownKey===x&&Ui.getState().setShown(null)}},A=[o,x],t[16]=o,t[17]=x,t[18]=k,t[19]=A):(k=t[18],A=t[19]),(0,Z.useEffect)(k,A);let j=h?.guide??null,M=o&&j!==null,N;t[20]===f?N=t[21]:(N=()=>f?.(),t[20]=f,t[21]=N);let P=(0,Z.useEffectEvent)(N),F;t[22]!==P||t[23]!==M?(F=()=>{M&&P()},t[22]=P,t[23]=M,t[24]=F):F=t[24];let I;t[25]===M?I=t[26]:(I=[M],t[25]=M,t[26]=I),(0,Z.useEffect)(F,I);let L=h?.run??null,R=h?.currentHeadSha??null,z=j!==null&&R!==null&&R!==j.headSha,B=L?._tag===`Failed`&&L.headSha===R?L.detail:null,V;t[27]!==_||t[28]!==g||t[29]!==v?(V=(e,t)=>_?(0,$.jsxs)(G,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(b,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=V):V=t[30];let H=V;if(j===null){if(m.isPending&&h===null){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-48 items-center justify-center`,children:(0,$.jsx)(vt,{})}),t[31]=e):e=t[31],e}let e=g?`Writing a review guide`:`No review guide yet`,n;t[32]===e?n=t[33]:(n=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),t[32]=e,t[33]=n);let r=B??m.error??(g?`An agent is reading the change. A large one takes a few minutes. You can leave; you will be told when it is ready.`:`A guide is a tour of the change: stops through the code in reading order, with the calls only a maintainer can make.`),i;t[34]===r?i=t[35]:(i=(0,$.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:r}),t[34]=r,t[35]=i);let a=B===null?`Write guide`:`Try again`,o;t[36]!==a||t[37]!==H?(o=H(a,`sm`),t[36]=a,t[37]=H,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 ee;t[43]!==_||t[44]!==B||t[45]!==g||t[46]!==z||t[47]!==H?(ee=z||B!==null||g?(0,$.jsxs)(la,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(xe,{}),(0,$.jsx)(ca,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!g&&_?(0,$.jsx)(sa,{children:H(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=B,t[45]=g,t[46]=z,t[47]=H,t[48]=ee):ee=t[48];let te=ee,ne;t[49]!==n||t[50]!==a?(ne={environmentId:n,cwd:a},t[49]=n,t[50]=a,t[51]=ne):ne=t[51];let U;t[52]!==j||t[53]!==l?(U=l===null?null:(e,t)=>{let n=j.stops[e];n!==void 0&&l(n,e,t)},t[52]=j,t[53]=l,t[54]=U):U=t[54];let re;t[55]!==o||t[56]!==te||t[57]!==O||t[58]!==n||t[59]!==j||t[60]!==u||t[61]!==d||t[62]!==r||t[63]!==U?(re=(0,$.jsx)(md,{environmentId:n,reference:r,guide:j,banner:te,active:o,commenting:O,onAsk:U,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=te,t[57]=O,t[58]=n,t[59]=j,t[60]=u,t[61]=d,t[62]=r,t[63]=U,t[64]=re):re=t[64];let ie;return t[65]!==ne||t[66]!==re?(ie=(0,$.jsx)(Lu,{value:ne,children:re}),t[65]=ne,t[66]=re,t[67]=ie):ie=t[67],ie}function _d(e){return e.removeComment}function vd(e){return e.addComment}function yd(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 bd={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`,"approve-workflows":`Could not approve workflows`},xd={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.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`},Sd=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,Cd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],wd=()=>t(()=>import(`./PullRequestCodeTab-sN76VbmK.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])),Td=(0,Z.lazy)(wd),Ed=new Map,Dd=e=>typeof e==`string`?e:d(e);function Od(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:a,disabled:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(Le,{}),t[0]=s):s=t[0];let c;t[1]===a?c=t[2]:(c=e=>a(e),t[1]=a,t[2]=c);let l;if(t[3]!==o||t[4]!==n){let e;t[6]===o?e=t[7]:(e=e=>(0,$.jsx)(i,{value:e.environmentId,disabled:o,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(aa,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=o,t[7]=e),l=n.map(e),t[3]=o,t[4]=n,t[5]=l}else l=t[5];let u;return t[8]!==c||t[9]!==l||t[10]!==r?(u=(0,$.jsxs)($.Fragment,{children:[s,(0,$.jsx)(P,{value:r,onValueChange:c,children:l})]}),t[8]=c,t[9]=l,t[10]=r,t[11]=u):u=t[11],u}var kd=(e,t)=>{e.preventDefault(),e.stopPropagation(),Cl({url:t.url,openLabel:xl(Ir.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function Ad(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=K(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=K(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(xe,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Xr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(G,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(Jr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Zr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function jd({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:o=null,reference:s,listEntry:c=null,refreshToken:l=0,onActed:u,onClose:d,context:p=`page`,composerDraftTarget:h,onBack:_,onSelectPullRequest:y,onGuideShown:C}){let w=Ye(),T=Ke(),E=T.find(t=>t.id===s.projectId&&t.environmentId===e),O=E?.repositoryIdentity,k=w.get(e)?.environment.capabilities.threadPullRequests===!0,j=(0,Z.useMemo)(()=>k?ai(s,O):{projectId:s.projectId,repository:s.repository,number:s.number},[s,O,k]),N=`${j.projectId}:${j.host??``}:${j.repository}#${j.number}`,F=c?.projectId===j.projectId&&c.repository.toLowerCase()===j.repository.toLowerCase()&&(j.host===void 0||c.host.toLowerCase()===j.host.toLowerCase())&&c.number===j.number?c:null,[B,V]=(0,Z.useState)(!1),[ee,oe]=(0,Z.useState)(0),[W,se]=(0,Z.useState)(`summary`),[le,ue]=(0,Z.useState)(`newest`),[de,fe]=(0,Z.useState)(()=>({pullRequestKey:N,oid:null})),pe=de.pullRequestKey===N?de.oid:null,me=e=>{fe({pullRequestKey:N,oid:e})},he=e=>{me(e),se(`code`)},[_e,xe]=(0,Z.useState)(null),Se=e=>{me(null),xe(t=>({path:e,nonce:(t?.nonce??0)+1})),wd(),se(`code`)},we=Ui(t=>t.openRequestKey===Gi(e,j));we&&W!==`guide`&&se(`guide`),(0,Z.useEffect)(()=>{we&&Ui.getState().requestOpen(null)},[we]);let Ee=`${e}:${N}`,[Oe,je]=(0,Z.useState)(()=>({key:Ee,tabs:new Set([`summary`])})),Me=Oe.key===Ee?Oe.tabs:new Set([W]);(0,Z.useEffect)(()=>{je(e=>e.key===Ee?e.tabs.has(W)?e:{key:Ee,tabs:new Set(e.tabs).add(W)}:{key:Ee,tabs:new Set([W])})},[W,Ee]);let[Ne,Pe]=(0,Z.useState)(!1),Fe=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Pe(Fe.current[W]??!1)},[W]);let Ie=Ne,Re=(0,Z.useRef)({}),ze=(0,Z.useMemo)(()=>({summary:e=>{Re.current.summary=e},timeline:e=>{Re.current.timeline=e},code:e=>{Re.current.code=e}}),[]),Ve=(0,Z.useRef)(null),He=(0,Z.useRef)(null),We=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=We.current;e!==null&&(We.current=null,Ie&&e.tab===W&&Re.current[W]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Ie,W]);let qe=Yi(e=>e.pullRequestMergeMethod),Je=Yi(e=>e.setPullRequestMergeMethod),Xe=Ca(e,j.projectId),$e=(0,Z.useMemo)(()=>Xe(),[Xe]),[tt,nt]=(0,Z.useState)(null),rt=e=>{nt({pullRequestKey:N,method:e})},it=yd(N),[at,ot]=(0,Z.useState)(null),st=Dt(e,ge),lt=kt(Gr.detail({environmentId:e,input:j})),ut=kt(Gr.activity({environmentId:e,input:j})),dt=Vr(e),[ft,pt]=(0,Z.useState)(()=>oi(typeof window>`u`?void 0:window.localStorage,e,j));(0,Z.useEffect)(()=>{pt(oi(typeof window>`u`?void 0:window.localStorage,e,j))},[e,N,j.projectId,j.repository,j.number]),(0,Z.useEffect)(()=>{lt.data!==null&&(_i(typeof window>`u`?void 0:window.localStorage,e,j,lt.data),pt(lt.data))},[lt.data,e,N,j.projectId,j.repository,j.number]);let mt=Li({live:lt.data,cached:ft,reference:j}),ht=(0,Z.useMemo)(()=>F===null?null:Hr(F),[F]),gt=(0,Z.useMemo)(()=>lt.data===null?null:{...lt.data,checksState:Er(lt.data.checks)},[lt.data]),_t=Kr(e,j,gt,lt.dataUpdatedAt),vt=(0,Z.useMemo)(()=>Wr(mt,Wr(_t,ht)),[mt,_t,ht]),bt=(0,Z.useMemo)(()=>mt===null||vt===null||vt===mt?mt:{...mt,title:vt.title,state:vt.state,headBranch:vt.headBranch,baseBranch:vt.baseBranch,updatedAt:vt.updatedAt,author:vt.author??mt.author,additions:vt.additions??mt.additions,deletions:vt.deletions??mt.deletions,changedFiles:vt.changedFiles??mt.changedFiles,mergeability:vt.mergeability??mt.mergeability,closedAt:vt.closedAt===void 0?mt.closedAt:vt.closedAt,mergedAt:vt.mergedAt===void 0?mt.mergedAt:vt.mergedAt,isDraft:vt.isDraft??mt.isDraft},[mt,vt]),wt=ut.data,X=(0,Z.useMemo)(()=>bt===null?null:{...bt,capabilities:st?bt.capabilities:{...bt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:st?bt.viewerPermissions:{...bt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:wt?.author??bt.author,reviewers:wt?.reviewers??bt.reviewers,comments:wt?.comments??[],commentCount:wt?.commentCount??0,commentsTruncated:wt?.commentsTruncated??!1,reviewThreads:wt?.reviewThreads??[],commits:wt?.commits??[],reactions:wt?.reactions??[]},[wt,st,bt]),Nt=X??vt,Pt=H(Et),{copyToClipboard:Ft}=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})}),It=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||xa()||lr(e,Pt,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||Ft(`#${j.number}`,`PR number`))});(0,Z.useEffect)(()=>{let e=e=>It(e);return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Z.useEffect)(()=>{X?.autoMergeMethod!==void 0&&rt(X.autoMergeMethod)},[X?.autoMergeMethod,N]);let Lt=X===null?null:Ze(X.url),Rt=Ir.get(X?.provider),zt=(0,Z.useMemo)(()=>({repositoryUrl:Lt===null?null:Rt.referenceAutolinkRepositoryUrl(Lt),threadRef:o}),[Rt,Lt,o]),Bt=X?.author&&Lt!==null?Rt.authorProfileUrl(X.author.login,Lt):null,Vt=Nt?Ei(Nt.provider,Nt.number,Nt.headBranch,X?.headRepositoryNameWithOwner,Ze(Nt.url)):hi(j,O),Ht=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Ut=kt(X===null?null:Mt.listRefs({environmentId:e,input:{cwd:X.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Wt=X!==null&&ei(X.baseBranch,Ut.data?.refs??[]),Gt=bc(e,(0,Z.useMemo)(()=>X===null||X.capabilities.stacks!==!0||!k?null:{...j,host:j.host??Qe(X.url)?.host},[X,j,k])),Kt=Gt.data,qt=k&&X?.capabilities.stacks===!0&&X.capabilities.stackActions===!0&&w.get(e)?.environment.capabilities.pullRequestStackActions===!0,Jt=Ai({supportsStackActions:qt,hasStack:Kt!==null,stackPending:!Gt.isFresh,stackError:Gt.error}),Yt=ut.isPending&&wt===null,Xt=wt===null?ut.error:null,Zt=(0,Z.useCallback)(()=>{lt.refresh(),ut.refresh(),Gt.refresh()},[ut.refresh,lt.refresh,Gt.refresh]),[Qt,$t]=(0,Z.useState)(0),en=Qt+(dt??0),tn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!bt)return;let e={key:Ee,updatedAt:bt.updatedAt};if(ii(tn.current,e)){if(ut.isPending)return;ut.refresh(),$t(e=>e+1)}tn.current=e},[ut.isPending,ut.refresh,bt,Ee]),Pc(()=>{lt.refresh()},{key:`pull-request:${e}:${N}`});let nn=At(Gr.invalidate,{reportFailure:!1}),[rn,an]=(0,Z.useState)(!1),on=rn||lt.isPending,sn=(0,Z.useCallback)(async()=>{an(!0);try{await nn({environmentId:e,input:{reference:j}}),Zt(),$t(e=>e+1)}finally{an(!1)}},[e,nn,j,Zt]),cn=(0,Z.useRef)(l);(0,Z.useEffect)(()=>{cn.current!==l&&(cn.current=l,sn())},[l,sn]);let ln=At(Gr.runAction,{reportFailure:!1}),un=At(Gr.comment,{reportFailure:!1}),[dn,fn]=(0,Z.useState)(null),pn=dn!==null,mn=At(Gr.update,{reportFailure:!1}),[hn,gn]=(0,Z.useState)(null),_n=hn?.pullRequestKey===N?hn.text:null,[vn,yn]=(0,Z.useState)(!1),bn=ia(),{environments:xn}=St(),Sn=(0,Z.useMemo)(()=>{let t=T.find(t=>t.id===j.projectId&&t.environmentId===e)?.repositoryIdentity;return et(t,j.repository,j.number)},[e,T,j.number,j.projectId,j.repository]),Cn=(0,Z.useMemo)(()=>p===`page`?_c({environmentId:e,projectId:j.projectId},T,xn.map(e=>({environmentId:e.environmentId,label:e.label,machine:De(e.serverConfig)}))):[],[p,e,xn,T,j.projectId]),[wn,Tn]=(0,Z.useState)(null),Dn=wn?.pullRequestKey===N?wn.environmentId:e,On=Cn.find(e=>e.environmentId===Dn)??null,kn=On?.environmentId??e,An=On?.workspaceRoot??X?.workspaceRoot??E?.workspaceRoot??null,jn=Dt(kn,ie),Mn=wa({environmentId:kn,cwd:An}),Nn=async(t,n,r)=>{u?.(t,`sent`);let i=await ln({environmentId:e,input:{...j,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(fn(null),i._tag===`Failure`){let e=Ge(i),n=r===`rebase`?Sd:xd[t];return yt.add({type:`error`,title:bd[t],description:li(e,n)}),u?.(t,`failed`),!1}return t===`revert`&&yt.add({type:`success`,title:`Revert pull request opened`}),Qr(t)?sn():Zt(),u?.(t,`done`),!0},Pn=async(e,t,n)=>!st||dn!==null?!1:(fn(e),Nn(e,t,n)),Fn=async(t,n)=>!st||dn!==null?{commentPosted:!1}:(fn(n),(await un({environmentId:e,input:{...j,body:t}}))._tag===`Failure`?(fn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Nn(n)||Zt(),{commentPosted:!0})),In=async t=>{let n=t.trim();if(!st||X===null||vn)return;if(n.length===0||n===X.title){gn(null);return}yn(!0);let r=await mn({environmentId:e,input:{...j,title:n}});if(yn(!1),r._tag===`Failure`){yt.add({type:`error`,title:`The title could not be saved`,description:li(Ge(r),`The host refused the new title.`)});return}gn(null),Zt()},Ln=h??null,Rn=Mn.isAllowed&&jn,zn=Ln!==null||Rn,Bn=di(Ln!==null),Vn=hd({environmentId:e,reference:j,title:X?.title??null}),Hn=()=>{Vn.write(),Vn.data?.guide??se(`guide`)},Wn=(e,t)=>{let n=m.getState(),r=n.getComposerDraft(e),i=Dd(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=ci(r?.prompt??``,r?.reviewComments??[],o),c=Ni({prompt:s,lastHandoffPrompt:Ed.get(i)},t.prompt);Ed.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,Ii(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Gn=async(e,t,n)=>{let r=n??await bn(e).then(e=>e,()=>null);return r===null?null:(t===null||Wn(r.draftId,t),r)},Kn=async(t,n,r)=>{if(!X||at!==null)return;if(Ln!==null){Wn(Ln,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}ot(t);let i=D(kn,On?.projectId??X.projectId),a=await Gn(i,n);if(ot(null),a!==null&&r?.keepGuide===!0){let t=m.getState().getDraftSession(a.draftId);t!==null&&(jt.getState().openPullRequest(R(t.environmentId,t.threadId),{environmentId:e,projectId:j.projectId,...j.host===void 0?{}:{host:j.host},repository:j.repository,number:j.number,url:X.url}),Ui.getState().requestOpen(Gi(e,j)))}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.`})},qn=async(e,t,n=`worktree`)=>{if(!Nt||at!==null)return;if(Ln!==null&&t!==null){Wn(Ln,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(An===null||!Mn.isAllowed||!Ot(kn,`source-control:write`)||n===`worktree`&&!Ot(kn,`orchestration:operate`))return;ot(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=D(kn,On?.projectId??Nt.projectId),a=await bn(i).then(e=>e,()=>null);if(a===null){ot(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 Mn.run({reference:Nt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){ot(null);let e=Mn.error instanceof Error?Mn.error.message:null;yt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await bn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){ot(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}ot(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 Gn(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)},Jn=()=>{X&&Kn(`ask`,{...ki({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Yn=()=>{X&&Kn(`explain`,{...ji({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Xn=(e,t,n)=>{X&&Kn(`guide-stop:${t}`,yi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},Zn=(e,t)=>{X&&Kn(`selection:${e.comment.id}`,Ti({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,comment:e.comment,request:e.request}),t)},Qn=e=>{Nt&&qn(`checkout:${e}`,null,e)},$n=e=>{X&&qn(ui(e),bi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,finding:e}))},er=()=>{X&&qn(`findings`,Oi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,reviewThreads:X.reviewThreads,comments:X.comments,checks:Tr?[]:X.checks,commentsTruncated:X.commentsTruncated}))},tr=()=>{Nt&&qn(`conflicts`,{prompt:Si({number:Nt.number,url:Nt.url,headBranch:Nt.headBranch,baseBranch:Nt.baseBranch})})},nr=X?X.capabilities.mergeMethods.filter(e=>X.mergeCapabilities[e]):[],rr=tt?.pullRequestKey===N?tt.method:null,ir=$r(nr,rr,$e,qe),ar=Mi[ir],or=`Auto-merge (${ar.toLowerCase()})`,sr=X?.state===`open`&&X.mergeability===`conflicting`,cr=X?.state===`open`&&X.autoMergeEnabled===!0,dr=X?.autoMergeMethod,fr=dr?`Auto-merge (${Mi[dr].toLowerCase()})`:`Auto-merge`,pr=X?.state===`open`?X.workflowApprovalsRequired??0:0,mr=X===null?null:pi(X),hr=Tt(e,e=>e.reviewGuidesEnabled),gr=Cd.filter(e=>(e.value!==`code`||X===null||X.capabilities.diff)&&(e.value!==`guide`||hr));(0,Z.useEffect)(()=>{gr.some(e=>e.value===W)||se(`summary`)},[W,gr]);let _r=e=>X?.capabilities.actions.includes(e)===!0&&X.viewerPermissions.actions.includes(e),vr=X?Er(X.checks):null,Sr=vt?.checksState===void 0?vr:vt.checksState,Cr=Sr!==`failing`&&X?.checks.some(e=>e.status===`action-required`)?`pending`:Sr,Tr=Cr!==vr,Dr=X?gi({state:X.state,isDraft:X.isDraft,mergeability:X.mergeability,checksState:Cr,autoMergeEnabled:X.autoMergeEnabled,hasMergeMethod:nr.length>0,canMerge:Jt&&_r(`merge`),canMarkReady:_r(`ready`),canEnableAutoMerge:Jt&&_r(`enable-auto-merge`)}):null,kr=X?.state===`open`&&_r(X.isDraft?`ready`:`draft`)&&!(X.isDraft&&Dr===`ready`),jr=Jt&&X?.state===`open`&&(cr&&_r(`disable-auto-merge`)||!cr&&Dr!==`enable-auto-merge`&&!X.isDraft&&!sr&&_r(`enable-auto-merge`)&&nr.length>0),Mr=Jt&&X?.state===`open`&&(Dr===`enable-auto-merge`||Dr===`auto-merge-armed`)&&_r(`merge`)&&!X.isDraft&&!sr&&nr.length>0,Nr=X?.state===`open`&&_r(`merge`)&&!X.isDraft&&!sr&&nr.length>1,Lr=X?yr({state:X.state,isDraft:X.isDraft}):null,zr=pr>0&&!Tr&&_r(`approve-workflows`),Br=Tr?Cr===null?`No checks reported`:wr(Cr).label:X?Pr(X.checks):null,Ur=X&&!X.commentsTruncated?Pi(X.comments,X.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,qr=p===`page`?(0,$.jsxs)(v,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(ke,{disabled:at!==null||An===null,render:(0,$.jsxs)(G,{size:`xs`,variant:`outline`,"aria-label":at?.startsWith(`checkout`)?`Checking out...`:`Check out`,children:[(0,$.jsx)(re,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[35rem]/pr-header:hidden`,children:at?.startsWith(`checkout`)?`Checking out...`:`Check out`}),(0,$.jsx)(a,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(J,{children:`Check out this pull request`})]}),(0,$.jsxs)(ae,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(U,{disabled:!Rn,onClick:()=>Qn(`worktree`),children:[(0,$.jsx)(re,{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:!Mn.isAllowed,onClick:()=>Qn(`local`),children:[(0,$.jsx)(te,{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`."})]})]}),Cn.length>0?(0,$.jsx)(Od,{environments:Cn,value:kn,onChange:e=>Tn({pullRequestKey:N,environmentId:e}),disabled:at!==null}):null]})]}):null,Jr=(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`destructive-outline`,disabled:at!==null||Ln===null&&An===null,onClick:tr,"aria-label":at===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(Rr.conflicting,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:at===`conflicts`?`Preparing...`:`Resolve conflicts`})]})})}),(0,$.jsx)(J,{side:`top`,children:at===`conflicts`?`Preparing...`:`Resolve conflicts`})]});return lt.isPending&&!X?(0,$.jsx)(dl,{seed:F,summary:vt,checkoutCommand:Vt,onCheckoutError:Ht,number:j.number,tabs:gr,activeTab:W,..._?{onBack:_}:{},...d?{onClose:d}:{},actions:Nt?(0,$.jsxs)(ct,{delay:150,closeDelay:150,timeout:400,children:[Nt.state===`open`&&Nt.mergeability===`conflicting`?Jr:null,qr]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[B&&X?(0,$.jsx)(Yc,{display:`picker`,environmentId:e,reference:j,url:X.url,threadRef:null,onPickerOpenChange:V},`${e}:${X.url}`):null,(0,$.jsxs)(`div`,{className:K(`@container/pr-header grid min-w-0 shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2`,X&&`border-b border-border/60`,!X&&!d&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":Ie,inert:Ie,className:K(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,Ie?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:X&&Lr?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,onClick:_,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ye,{"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:Lt?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(Lt),className:`min-w-0 cursor-pointer truncate text-left font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:X.repository}):(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:X.repository})}),(0,$.jsx)(J,{side:`top`,children:Lt?`Open ${X.repository} repository`:X.repository})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(X.url),onContextMenu:e=>kd(e,X),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Lr.toneClassName),"aria-label":`Open pull request #${X.number} on host`,children:[`#`,X.number,(0,$.jsx)(ve,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:xl(Rt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!Ie,inert:!Ie,className:K(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,Ie?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:X&&Lr?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:Ie?0:-1,onClick:_,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ye,{"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:Ie?0:-1,onClick:()=>void Ct()?.shell.openExternal(X.url),onContextMenu:e=>kd(e,X),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Lr.toneClassName),"aria-label":`Open pull request #${X.number} on host`,children:[`#`,X.number,(0,$.jsx)(ve,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:xl(Rt)})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:X.title})}),(0,$.jsx)(J,{side:`top`,children:X.title})]})]}):null})]}),(0,$.jsxs)(`div`,{className:`mr-4 flex h-7 shrink-0 items-center justify-end gap-1`,children:[X?(0,$.jsxs)(ct,{delay:150,closeDelay:150,timeout:400,children:[!Kt&&qt&&Gt.error?(0,$.jsx)(G,{variant:`ghost`,size:`xs`,onClick:Gt.refresh,children:`Retry stack lookup`}):null,Kt?(0,$.jsx)(Rc,{hostLabel:Rt.label,stack:Kt,notice:Gt.notice,onRetry:Gt.error?Gt.refresh:void 0,reference:j,environmentId:e,onSelect:y,mergeMethod:ir,canMerge:Gt.isFresh&&qt&&_r(`merge`)&&nr.length>0,canRebase:Gt.isFresh&&qt&&X.viewerPermissions.stackRebase===!0,onActed:()=>{Zt(),u?.()}}):null,p===`page`?(0,$.jsx)(Yc,{display:`count`,environmentId:e,reference:j,url:X.url,threadRef:null}):null,cr&&Dr!==`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(ne,{size:`control`,variant:`info`,role:`img`,"aria-label":fr,children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:fr})]})}),(0,$.jsxs)(J,{side:`top`,children:[fr,`: the host will merge this on its own once its requirements are met`]})]}):null,Dr===`resolve`?Jr:Dr===`ready`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,onClick:()=>void Pn(`ready`),"aria-label":`Ready for review`,children:[(0,$.jsx)(Rr.pullRequest,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:`Ready for review`})]})})}),(0,$.jsx)(J,{side:`top`,children:`Ready for review`})]}):Dr===`enable-auto-merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,...it.props(`enable-auto-merge`,()=>void Pn(`enable-auto-merge`,ir)),"aria-label":dn===`enable-auto-merge`?`Enabling...`:it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:or,children:[it.isArmed(`enable-auto-merge`)?(0,$.jsx)(I,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Sc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:or}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:dn===`enable-auto-merge`?`Enabling...`:it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:or})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:dn===`enable-auto-merge`?`Enabling...`:it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:or})]}):Dr===`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(ne,{size:`control`,variant:`info`,role:`img`,"aria-label":fr,children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:fr})]})}),(0,$.jsxs)(J,{side:`top`,children:[fr,`: the host will merge this on its own once its requirements are met`]})]}):Dr===`merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,...it.props(`merge`,()=>void Pn(`merge`,ir)),"aria-label":dn===`merge`?`Merging...`:it.isArmed(`merge`)?`Confirm merge?`:ar,children:[it.isArmed(`merge`)?(0,$.jsx)(I,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Sc,{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:ar}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:dn===`merge`?`Merging...`:it.isArmed(`merge`)?`Confirm merge?`:ar})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:dn===`merge`?`Merging...`:it.isArmed(`merge`)?`Confirm merge?`:ar})]}):(Dr===`merged`||Dr===`closed`)&&Lr!==null?(0,$.jsx)(ne,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:K(`flex items-center gap-1`,Lr.toneClassName),children:[(0,$.jsx)(Lr.Icon,{className:`size-3.5`}),Lr.label]})}):null,qr,(0,$.jsxs)(v,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(ke,{render:(0,$.jsx)(G,{"aria-label":on?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:on?(0,$.jsx)(ba,{refreshing:!0,size:`md`}):(0,$.jsx)(Ae,{className:`size-4`})})}),(0,$.jsx)(J,{children:on?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(ae,{align:`end`,side:`bottom`,children:[(0,$.jsx)(Yc,{display:`menu-item`,environmentId:e,reference:j,url:X.url,threadRef:o??(typeof h==`object`?h:null),onPickerOpenChange:V}),(0,$.jsxs)(U,{disabled:on,onClick:()=>void sn(),children:[(0,$.jsx)(ba,{size:`sm`,refreshing:on}),`Refresh`]}),(0,$.jsxs)(U,{disabled:at!==null,onClick:Jn,children:[(0,$.jsx)(x,{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:at===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Ln===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(U,{disabled:at!==null,onClick:Yn,children:[(0,$.jsx)(f,{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:at===`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:at!==null||!zn,onClick:er,children:[(0,$.jsx)(be,{className:`size-3.5`}),at===`findings`?`Preparing...`:Bn.fixFindings]}),hr&&Vn.canWrite?(0,$.jsxs)(U,{disabled:Vn.running,onClick:Hn,children:[(0,$.jsx)(b,{className:`size-3.5`}),Vn.running?`Writing guide...`:Vn.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,Cn.length>0?(0,$.jsx)(Od,{environments:Cn,value:kn,onChange:e=>Tn({pullRequestKey:N,environmentId:e}),disabled:at!==null}):null,(0,$.jsx)(Le,{}),X.state===`open`?(0,$.jsxs)($.Fragment,{children:[kr?(0,$.jsxs)(U,{disabled:pn,onClick:()=>void Pn(X.isDraft?`ready`:`draft`),children:[X.isDraft?(0,$.jsx)(Rr.pullRequest,{className:`size-3.5`}):(0,$.jsx)(Rr.draft,{className:`size-3.5`}),X.isDraft?`Ready for review`:`Convert to draft`]}):null,Mr?(0,$.jsxs)(U,{closeOnClick:it.isArmed(`merge`),"aria-label":it.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:pn,...it.props(`merge`,()=>void Pn(`merge`,ir)),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),it.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,cr&&_r(`disable-auto-merge`)?(0,$.jsxs)(U,{disabled:pn,onClick:()=>void Pn(`disable-auto-merge`),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),`Disable auto-merge`]}):jr?(0,$.jsxs)(U,{closeOnClick:it.isArmed(`enable-auto-merge`),"aria-label":it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`,disabled:pn,...it.props(`enable-auto-merge`,()=>void Pn(`enable-auto-merge`,ir)),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Nr?(0,$.jsxs)($.Fragment,{children:[kr||Mr||jr?(0,$.jsx)(Le,{}):null,(0,$.jsx)(P,{value:ir,onValueChange:e=>{let t=e;rt(t),Je(t)},children:nr.map(e=>(0,$.jsx)(i,{value:e,disabled:pn,closeOnClick:!0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Mi[e]})]})},e))})]}):null,Di(kr,jr||Mr,Nr)?(0,$.jsx)(Le,{}):null]}):null,(0,$.jsxs)(U,{onClick:()=>void Ct()?.shell.openExternal(X.url),children:[(0,$.jsx)(S,{className:`size-3.5`}),xl(Rt)]}),(0,$.jsxs)(U,{onClick:()=>Ft(X.url,`PR link`),children:[(0,$.jsx)(Ue,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(Te,{children:ur(Pt,`thread.copyReference`)})]}),(0,$.jsxs)(U,{onClick:()=>Ft(`#${j.number}`,`PR number`),children:[(0,$.jsx)(z,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(Te,{children:ur(Pt,`pullRequest.copyNumber`)})]}),X.state===`open`&&_r(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{}),(0,$.jsxs)(U,{closeOnClick:it.isArmed(`close`),"aria-label":it.isArmed(`close`)?`Confirm close?`:`Close pull request`,variant:`destructive`,disabled:pn,...it.props(`close`,()=>void Pn(`close`)),children:[(0,$.jsx)(Rr.closed,{className:`size-3.5`}),it.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):X.state===`closed`&&_r(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{}),(0,$.jsxs)(U,{disabled:pn,onClick:()=>void Pn(`reopen`),children:[(0,$.jsx)(Rr.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):X.state===`merged`&&_r(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{}),(0,$.jsxs)(U,{closeOnClick:it.isArmed(`revert`),"aria-label":it.isArmed(`revert`)?`Confirm revert?`:`Revert changes`,variant:it.isArmed(`revert`)?`destructive`:`default`,disabled:pn,...it.props(`revert`,()=>void Pn(`revert`)),children:[(0,$.jsx)(g,{className:`size-3.5`}),it.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null]})]})]}):null,d?(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:d,children:(0,$.jsx)(ce,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Ie?`grid-rows-[1fr]`:`grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:He,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Ie?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!Ie,children:X?(0,$.jsx)(`div`,{className:`col-span-2 min-w-0 px-4 pb-2 pt-1`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 shrink items-center gap-1.5 overflow-hidden text-xs text-muted-foreground`,children:[(0,$.jsx)(Ar,{actor:X.author,profileUrl:Bt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:En(X.updatedAt)})]}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-3 w-px shrink-0 bg-border/70`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 font-mono text-2xs text-muted-foreground/65`,children:[mr?(0,$.jsxs)(Ad,{baseBranch:X.baseBranch,freshness:mr,pending:pn,onUpdate:e=>void Pn(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Wt?`Stacked on ${X.baseBranch}`:X.baseBranch})]}),(0,$.jsx)(ye,{"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:X.headBranch,showTitle:!1})})}),(0,$.jsx)(J,{side:`top`,children:X.headBranch})]})]}),(0,$.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center justify-end gap-2 text-2xs`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 tabular-nums`,"aria-label":`${X.changedFiles.toLocaleString()} changed ${X.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(A,{"aria-hidden":!0,className:`size-3`}),X.changedFiles.toLocaleString()]}),(0,$.jsx)(Or,{additions:X.additions,deletions:X.deletions,className:`shrink-0 font-mono text-2xs`})]})]})}):null})}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Ie?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ve,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Ie?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:Ie,children:X?(0,$.jsx)(el,{title:_n===null?(0,$.jsxs)(tl,{className:`group gap-1`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold leading-snug`,children:X.title})}),(0,$.jsx)(J,{side:`top`,children:X.title})]}),bs(X)?(0,$.jsx)(Cs,{"aria-label":`Edit title`,onClick:()=>gn({pullRequestKey:N,text:X.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Un,{autoFocus:!0,size:`sm`,disabled:vn,value:_n,"aria-label":`Pull request title`,onChange:e=>gn({pullRequestKey:N,text:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),In(_n)):e.key===`Escape`&&(e.preventDefault(),gn(null))}}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(G,{size:`xs`,variant:`ghost`,disabled:vn,onClick:()=>gn(null),children:`Cancel`}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,disabled:!st||vn||_n.trim().length===0,onClick:()=>void In(_n),children:vn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(Ar,{actor:X.author,profileUrl:Bt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,En(X.updatedAt)]}),checkout:Vt?(0,$.jsx)(il,{value:Vt,target:`pull request checkout command`,copyLabel:`Copy checkout command`,copiedLabel:`Checkout command copied`,className:`ml-auto font-mono`,tooltipSide:`bottom`,onError:Ht},Vt):null,base:mr?(0,$.jsxs)(Ad,{baseBranch:X.baseBranch,freshness:mr,pending:pn,onUpdate:e=>void Pn(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Wt?`Stacked on ${X.baseBranch}`:X.baseBranch})]}),head:(0,$.jsx)(il,{value:X.headBranch,target:`branch name`,copyLabel:`Copy pull request branch`,copiedLabel:`Branch name copied`},X.headBranch),files:`${X.changedFiles.toLocaleString()} ${X.changedFiles===1?`file`:`files`}`,diffStat:(0,$.jsx)(Or,{additions:X.additions,deletions:X.deletions,className:`shrink-0 font-mono text-xs`})}):null})}),X?(0,$.jsx)(nl,{tabs:gr,value:W,onValueChange:se,onTabIntent:e=>{e===`code`&&wd()},children:W===`summary`?zr?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`ml-auto inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`warning-outline`,disabled:pn,...it.props(`approve-workflows`,()=>void Pn(`approve-workflows`)),"aria-label":dn===`approve-workflows`?`Approving...`:it.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`,children:[(0,$.jsx)(Ce,{"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:dn===`approve-workflows`?`Approving...`:it.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]})]})})}),(0,$.jsx)(J,{side:`top`,children:dn===`approve-workflows`?`Approving...`:it.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]}):(0,$.jsx)(rl,{className:`text-muted-foreground`,"aria-label":Br?`Checks: ${Br}`:`Checks`,icon:Cr===null?(0,$.jsx)(Be,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Nu,{checks:X.checks,stale:Tr,checksState:Cr,threadRef:o}),label:Br}):W===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(br,{className:K(`whitespace-nowrap text-2xs transition-opacity`,(Yt||Xt)&&`opacity-35`),children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Xt?`Comments unavailable`:`${X.commentCount.toLocaleString()} ${X.commentCount===1?`comment`:`comments`}`,children:[(0,$.jsx)(L,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:X.commentCount.toLocaleString()]}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Xt?`Commits unavailable`:`${X.commits.length.toLocaleString()} ${X.commits.length===1?`commit`:`commits`}`,children:[(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:X.commits.length.toLocaleString()]}),Ur>0?(0,$.jsxs)(`span`,{className:K(`inline-flex items-center gap-1`,Fr(`approved`)),children:[(0,$.jsx)(xr,{outcome:`approved`,className:`size-3`}),Ur.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:Ur===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(G,{size:`xs`,variant:`ghost-muted`,"aria-label":le===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>ue(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(M,{"aria-hidden":!0,className:`size-3`}),le===`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=Re.current[W];if(e.target!==t||t==null)return;let n=t.scrollTop;Pe(e=>{let r=e,i=Ve.current?.scrollHeight??0,a=i-(He.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(We.current={tab:W,scroller:t,delta:-a},r=!0),Fe.current[W]=r,r})},children:lt.error&&!X?(0,$.jsx)(bl,{...Fi(lt.failure)?{title:`Pull request #${j.number} not found`,error:`It may be an issue rather than a pull request, or this account can't see it.`}:{error:lt.error},refreshing:lt.isPending,onRetry:Zt,...Sn?{gitHubUrl:Sn}:{}}):X?(0,$.jsxs)(Ws,{value:zt,children:[Me.has(`summary`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`summary`&&`invisible`),children:(0,$.jsx)(iu,{scrollerRef:ze.summary,environmentId:e,threadRef:o,reference:j,detail:X,activityPending:Yt,checksStale:Tr,activityError:Xt,pendingFinding:at,fixFindingLabel:Bn.fixFinding,fixCheckLabel:Bn.fixCheck,...zn?{onFixFinding:$n}:{},onRefresh:Zt,onRefreshChecks:sn})}):null,Me.has(`guide`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`guide`&&`invisible`),children:(0,$.jsx)(gd,{environmentId:e,reference:j,active:W===`guide`,title:X.title,workspaceRoot:X.workspaceRoot,canComment:X.capabilities.review.inlineComment&&X.viewerPermissions.comment,onAskAboutLines:(e,t)=>Zn({comment:e,request:t},{keepGuide:!0}),onAskAboutStop:Xn,onFinishReview:X.capabilities.review.verdicts.some(e=>X.viewerPermissions.verdicts.includes(e))?()=>oe(e=>e+1):null,onOpenFile:Se,onTourShown:C})}):null,Me.has(`timeline`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`timeline`&&`invisible`),children:Yt?(0,$.jsx)(hl,{}):Xt?(0,$.jsx)(yl,{error:Xt,onRetry:ut.refresh}):(0,$.jsx)(Du,{scrollerRef:ze.timeline,detail:X,environmentId:e,threadRef:o,reference:j,order:le,onOpenCommit:he,onRefresh:Zt})}):null,Me.has(`code`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(jo,{label:`Loading pull request diff...`}),children:(0,$.jsx)(Td,{scrollerRef:ze.code,onAddToAgentSelection:Zn,environmentId:e,reference:j,detail:X,selectedCommitOid:pe,onSelectedCommitChange:me,pendingFinding:at,fixFindingLabel:Bn.fixFinding,...zn?{onFixFinding:$n}:{},onRefresh:Zt,refreshToken:en,revealRequest:_e})})}):null]}):null}),X?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(Ml,{environmentId:e,reference:j,detail:X,actionPending:pn,onCommentAction:Fn,onCommented:Zt,onReviewSubmitted:Zt,openReviewRequest:ee},JSON.stringify([e,j.projectId,j.host,j.repository,j.number]))}):null]})}function Md(e){let t=(0,Q.c)(36),{entry:n,hostActions:r,visible:i,onActed:a,closing:o,sweeping:s,onCloseSweepStart:c}=e,l=o!==void 0&&o,u=s!==void 0&&s,d;t[0]===n.environmentId?d=t[1]:(d=Gr.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=d);let f=H(d),p=Ca(n.environmentId,n.projectId),m;t[2]!==n.host||t[3]!==n.number||t[4]!==n.projectId||t[5]!==n.repository?(m={projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},t[2]=n.host,t[3]=n.number,t[4]=n.projectId,t[5]=n.repository,t[6]=m):m=t[6];let h=m,g;t[7]!==n||t[8]!==a?(g=e=>a?.({entry:n,action:e}),t[7]=n,t[8]=a,t[9]=g):g=t[9];let _;t[10]===p?_=t[11]:(_=e=>{let t=e.capabilities.mergeMethods.filter(t=>e.mergeCapabilities[t]);if(t.length===0)throw Error(`No merge method is available for this repository.`);return $r(t,null,p(),Yi.getState().pullRequestMergeMethod)},t[10]=p,t[11]=_);let v;t[12]!==n.environmentId||t[13]!==h||t[14]!==g||t[15]!==_?(v={environmentId:n.environmentId,reference:h,onSuccess:g,resolveMergeMethod:_},t[12]=n.environmentId,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let{actionPending:y,perform:b}=Ta(v),x,S;if(t[17]!==y||t[18]!==f||t[19]!==l||t[20]!==n||t[21]!==r||t[22]!==c||t[23]!==b||t[24]!==u||t[25]!==i){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Ur(n,r),a=y||l||u;if(e.length===0){S=null;break bb0}let o=i||a?`flex`:`none`,s;t[28]===o?s=t[29]:(s={display:o},t[28]=o,t[29]=s);let d;t[30]!==a||t[31]!==f||t[32]!==n||t[33]!==c||t[34]!==b?(d=e=>{let t=Nd[e].label,r=Nd[e].Icon;return(0,$.jsxs)(Y,{children:[(0,$.jsxs)(q,{render:(0,$.jsx)(G,{variant:e===`close`?`destructive-outline`:`outline`,size:`xs`,disabled:!f||a||e===`merge`&&n.stack!==void 0,"aria-label":`${t} #${n.number}`,onClick:()=>void b(e),onPointerDown:t=>{e===`close`&&t.isPrimary&&t.button===0&&(t.stopPropagation(),c?.(n,t.nativeEvent))}}),children:[a?(0,$.jsx)(vt,{size:`xs`}):(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),t]}),(0,$.jsx)(J,{children:e===`merge`&&n.stack?`Open this pull request to merge its stack`:e===`close`&&c?`Close immediately, or drag across rows to close several`:`${t} immediately`})]},e)},t[30]=a,t[31]=f,t[32]=n,t[33]=c,t[34]=b,t[35]=d):d=t[35],x=(0,$.jsx)(`div`,{className:`shrink-0 items-center gap-1 pr-3`,style:s,role:`group`,"aria-label":`Quick actions for pull request #${n.number}`,"data-pull-request-action-pending":y||l,children:e.map(d)})}t[17]=y,t[18]=f,t[19]=l,t[20]=n,t[21]=r,t[22]=c,t[23]=b,t[24]=u,t[25]=i,t[26]=x,t[27]=S}else x=t[26],S=t[27];return S===Symbol.for(`react.early_return_sentinel`)?x:S}var Nd={close:{label:`Close`,Icon:Rr.closed},merge:{label:`Merge`,Icon:Rr.merged},ready:{label:`Ready for review`,Icon:Rr.pullRequest},reopen:{label:`Reopen`,Icon:Rr.reopen}},Pd=`group/pr-row flex w-full items-center gap-2 rounded-md py-1 pr-1 text-left`,Fd=`shrink-0 font-mono text-xs tabular-nums text-muted-foreground`;function Id(e){let t=(0,Q.c)(23),{state:n,isDraft:r,mergeability:i,baseBranch:a,below:o,className:s}=e,c;t[0]===s?c=t[1]:(c=K(`flex w-4 shrink-0 flex-col items-center gap-0.5`,s),t[0]=s,t[1]=c);let l;t[2]!==r||t[3]!==n?(l=(0,$.jsx)(Sr,{state:n,isDraft:r}),t[2]=r,t[3]=n,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{mergeability:i},t[5]=i,t[6]=u);let d;t[7]===a?d=t[8]:(d=a===void 0?{}:{baseBranch:a},t[7]=a,t[8]=d);let f;t[9]!==r||t[10]!==n||t[11]!==u||t[12]!==d?(f=(0,$.jsx)(`span`,{className:`absolute -right-1 -bottom-1 inline-flex`,children:(0,$.jsx)(vr,{state:n,isDraft:r,...u,...d,className:`size-3 fill-background [stroke-width:2.5]`})}),t[9]=r,t[10]=n,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]!==l||t[15]!==f?(p=(0,$.jsxs)(`span`,{className:`relative inline-flex`,children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16];let m;t[17]===o?m=t[18]:(m=o?(0,$.jsx)(`span`,{className:`inline-flex text-2xs`,children:o}):null,t[17]=o,t[18]=m);let h;return t[19]!==c||t[20]!==p||t[21]!==m?(h=(0,$.jsxs)(`span`,{className:c,children:[p,m]}),t[19]=c,t[20]=p,t[21]=m,t[22]=h):h=t[22],h}function Ld(e){let t=(0,Q.c)(22),{number:n,title:r,status:i,signals:a,meta:o,metaClassName:s,updatedAt:c}=e,l;t[0]===r?l=t[1]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm`,children:r}),t[0]=r,t[1]=l);let u;t[2]===a?u=t[3]:(u=a?(0,$.jsx)(`span`,{className:`flex shrink-0 items-center gap-1 text-2xs`,children:a}):null,t[2]=a,t[3]=u);let d;t[4]===i?d=t[5]:(d=i?(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-2xs`,children:i}):null,t[4]=i,t[5]=d);let f;t[6]!==n||t[7]!==l||t[8]!==u||t[9]!==d?(f=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[n,l,u,d]}),t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===s?p=t[12]:(p=K(`flex min-w-0 items-center gap-1.5 overflow-hidden text-2xs text-muted-foreground`,s),t[11]=s,t[12]=p);let m;t[13]===c?m=t[14]:(m=c?(0,$.jsx)(`span`,{className:`ml-auto shrink-0 whitespace-nowrap tabular-nums`,children:En(c)}):null,t[13]=c,t[14]=m);let h;t[15]!==o||t[16]!==p||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:p,children:[o,m]}),t[15]=o,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==f||t[20]!==h?(g=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,h]}),t[19]=f,t[20]=h,t[21]=g):g=t[21],g}function Rd(e){let t=(0,Q.c)(20),{actor:n,className:r,labelClassName:i}=e,a=n?.login??`ghost`,o;t[0]===r?o=t[1]:(o=K(`inline-flex min-w-0 items-center gap-1`,r),t[0]=r,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,$.jsx)(`span`,{className:o}),t[2]=o,t[3]=s);let c;t[4]===n?c=t[5]:(c=(0,$.jsx)(Dr,{actor:n,className:`size-3.5`}),t[4]=n,t[5]=c);let l;t[6]===i?l=t[7]:(l=K(`truncate`,i),t[6]=i,t[7]=l);let u;t[8]!==a||t[9]!==l?(u=(0,$.jsx)(`span`,{className:l,children:a}),t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,$.jsxs)(q,{render:s,children:[c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14];let f=n?.name&&n.name!==a?`${n.name} (@${a})`:a,p;t[15]===f?p=t[16]:(p=(0,$.jsx)(J,{side:`top`,children:f}),t[15]=f,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(Y,{children:[d,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function zd(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}function Bd(e){return e!==`touch`}var Vd={browser:`Browser previews are only available in the P4 Code desktop app.`,terminal:`Terminal surfaces are only available from a project thread.`,files:`Files are only available when a project is open.`,diff:`Diff is only available for server threads in Git repositories.`,pullRequest:`This thread's branch has no pull request yet.`,pullRequests:`No linked pull requests are available for this thread.`,device:`Devices are only available from a thread.`},Hd=[`[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(`,`),Ud={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.`},Wd=1,Gd=[ya,ga];function Kd(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function qd(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function Jd(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function Yd(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function Xd(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 Zd(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function Qd(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 $d(e){let t=(0,Q.c)(12),n=e.available?void 0:`data-disabled:pointer-events-auto`,r=!e.available,i;t[0]===e.shortcut?i=t[1]:(i=(0,$.jsx)(Te,{children:e.shortcut}),t[0]=e.shortcut,t[1]=i);let a;t[2]!==e.children||t[3]!==e.onClick||t[4]!==e.shortcut||t[5]!==n||t[6]!==r||t[7]!==i?(a=(0,$.jsxs)(U,{className:n,onClick:e.onClick,disabled:r,"aria-keyshortcuts":e.shortcut,children:[e.children,i]}),t[2]=e.children,t[3]=e.onClick,t[4]=e.shortcut,t[5]=n,t[6]=r,t[7]=i,t[8]=a):a=t[8];let o=a;if(e.available||!e.disabledReason)return o;let s;return t[9]!==o||t[10]!==e.disabledReason?(s=(0,$.jsx)(Qd,{reason:e.disabledReason,trigger:o}),t[9]=o,t[10]=e.disabledReason,t[11]=s):s=t[11],s}function ef(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),i=[{label:`Browser`,icon:Ee,shortcut:`B`,available:e.browserAvailable,disabledReason:Ud.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:Ie,shortcut:`T`,available:e.terminalAvailable,disabledReason:Ud.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:We,shortcut:`F`,available:e.filesAvailable,disabledReason:Ud.files,onClick:e.onAddFiles},{label:`Diff`,icon:A,shortcut:`D`,available:e.diffAvailable,disabledReason:Ud.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:Rr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Ud.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:Rr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Ud.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:u,shortcut:`M`,available:e.deviceAvailable,disabledReason:Ud.device,onClick:e.onAddDevice}],o=i.filter(af),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=Xd(c.current,e);if(!t||document.querySelector(Hd))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&Zd(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=rf,p=e=>s!==-1&&o[s]===e,m=nf,h;t[1]===o?h=t[2]:(h=o.map(tf),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 y=i.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:K(`flex h-10 w-full cursor-pointer items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm transition-colors group-hover:bg-card/60`,p(t)&&`bg-card/60`),children:[m(t,`size-4`),(0,$.jsx)(`span`,{className:K(`min-w-0 flex-1 truncate`,t.label===`Browser`&&e.browserProfiles.length>1&&`pr-8`),children:t.label}),(0,$.jsx)(ua,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(v,{children:[(0,$.jsx)(ke,{render:(0,$.jsx)(G,{"aria-label":`Open browser in a profile`,className:`absolute top-1/2 right-10 -translate-y-1/2`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(a,{className:`size-3.5`})}),(0,$.jsx)(ae,{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)(Qd,{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)(ua,{variant:`pill`,children:t.shortcut})]})},t.label)),b;t[4]===y?b=t[5]:(b=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:y}),t[4]=y,t[5]=b);let x;t[6]!==b||t[7]!==_?(x=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[_,b]}),t[6]=b,t[7]=_,t[8]=x):x=t[8];let S;return t[9]!==f||t[10]!==d||t[11]!==x||t[12]!==g?(S=(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:x}),t[9]=f,t[10]=d,t[11]=x,t[12]=g,t[13]=S):S=t[13],S}function tf(e){return e.shortcut}function nf(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 rf(e){e?.focus()}function af(e){return e.available}function of(e,t,n){switch(e.kind){case`diff`:return`Diff`;case`files`:return`Files`;case`file`:return e.relativePath.slice(Math.max(e.relativePath.lastIndexOf(`/`),e.relativePath.lastIndexOf(`\\`))+1);case`terminal`:return n.get(e.activeTerminalId)??Hi(e.activeTerminalId);case`pull-request`:return`#${e.number}`;case`pull-requests`:return`Pull requests`;case`device`:return e.title??e.target?.name??`Device`;case`preview`:{let n=e.resourceId?t[e.resourceId]:null;if(!n||n.navStatus._tag===`Idle`)return`Browser`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function sf(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)(Ee,{className:`size-3 shrink-0`}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,$.jsx)(ms,{sources:o,fallback:s,className:`size-3 shrink-0 rounded-sm object-contain`}),t[6]=o,t[7]=c),c}function cf(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function lf(e){let t=(0,Q.c)(16),{surface:n,sessions:r,desktopByTabId:i,theme:a,environmentId:o,pullRequestStatusSeeds:s}=e;switch(n.kind){case`preview`:{let e=n.resourceId?r[n.resourceId]:null,a=!e||e.navStatus._tag===`Idle`?null:e.navStatus.url,o=e?i[e.tabId]?.favicon??null:null,s=o&&a&&cf(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(sf,{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)(A,{className:`size-3 shrink-0`}),t[3]=e):e=t[3],e}case`files`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(We,{className:`size-3 shrink-0`}),t[4]=e):e=t[4],e}case`file`:{let e;return t[5]!==n.relativePath||t[6]!==a?(e=(0,$.jsx)(pr,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[5]=n.relativePath,t[6]=a,t[7]=e):e=t[7],e}case`terminal`:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ie,{className:`size-3 shrink-0`}),t[8]=e):e=t[8],e}case`pull-request`:{let e=s?.[n.id],r;return t[9]!==o||t[10]!==n||t[11]!==e?(r=(0,$.jsx)(df,{surface:n,environmentId:o,seed:e}),t[9]=o,t[10]=n,t[11]=e,t[12]=r):r=t[12],r}case`pull-requests`:{let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rr.link,{className:`size-3 shrink-0`}),t[13]=e):e=t[13],e}case`device`:{let e;return t[14]===n.target?.platform?e=t[15]:(e=n.target?.platform===`ios`?(0,$.jsx)(dr,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(fr,{className:`size-3 shrink-0`}):(0,$.jsx)(u,{className:`size-3 shrink-0`}),t[14]=n.target?.platform,t[15]=e),e}}}function uf(e,t,n,r){if(t===null||n===null)return;let i;for(let a of e)if(a.environmentId===t)for(let e of tt(a.pullRequests))$e(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function df(e){let t=(0,Q.c)(11),{surface:n,environmentId:r,seed:i}=e,a=n.environmentId??r,o=Ke(),s=Je(),l;t[0]!==a||t[1]!==n.projectId?(l=e=>e.environmentId===a&&e.id===n.projectId,t[0]=a,t[1]=n.projectId,t[2]=l):l=t[2];let u=o.find(l)?.repositoryIdentity,d=n.host??(u?.provider?c(u,u.provider):null),f=Ye(),p=a===null?void 0:f.get(a)?.environment.capabilities,m=p?.threadPullRequests===!0?uf(s,a,d,n)?.snapshot??null:null,h=kt(a===null||p?.pullRequests!==!0||m!==null?null:Gr.detail({environmentId:a,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=Kr(a,_,null),y=m??Wr(h,v)??i??null;if(y===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rr.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let b=yr({state:y.state,isDraft:y.isDraft??h?.isDraft??i?.isDraft??!1}),x=b.Icon,S=K(`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 ff(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=Qi($i(Zi,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(pf),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)(na,{items:a,strategy:ea,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)(ta,{sensors:r,collisionDetection:ra,modifiers:Gd,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function pf(e){return e.id}function mf(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}=Ji(o),f;t[8]===l?f=t[9]:(f=Xi.Translate.toString(l),t[8]=l,t[9]=f);let p;t[10]!==f||t[11]!==u?(p={transform:f,transition:u},t[10]=f,t[11]=u,t[12]=p):p=t[12];let m=d&&`relative z-10`,h;t[13]!==n||t[14]!==m?(h=K(n,m),t[13]=n,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==s||t[17]!==i||t[18]!==c||t[19]!==p||t[20]!==h?(g=(0,$.jsx)(`div`,{...i,...s,ref:c,style:p,className:h}),t[16]=s,t[17]=i,t[18]=c,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}function hf(e){let t=(0,Q.c)(137),n=Dn&&e.mode===`inline`,r=cr().profiles,{resolvedTheme:i}=wt(),a=(0,Z.useRef)(null),o=(0,Z.useRef)(null),[s,c]=(0,Z.useState)(null),[l,d]=(0,Z.useState)(!1),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=f):f=t[0];let[p,m]=(0,Z.useState)(f),g=e.open!==!1&&e.surfaces.length>0;!g&&l&&d(!1);let _;t[1]!==g||t[2]!==l||t[3]!==e?(_=t=>{if(!(t.defaultPrevented||t.isComposing)&&lr(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&(l||!document.querySelector(Hd))&&(t.preventDefault(),t.stopPropagation(),!t.repeat)){if(!g){document.querySelector(`[data-surface-launcher-keys]`)?.focus();return}o.current?.focus(),d(!0)}},t[1]=g,t[2]=l,t[3]=e,t[4]=_):_=t[4];let y=(0,Z.useEffectEvent)(_),b;t[5]!==y||t[6]!==e.open?(b=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,y,!0),()=>document.removeEventListener(`keydown`,y,!0)},t[5]=y,t[6]=e.open,t[7]=b):b=t[7];let x;t[8]===e.open?x=t[9]:(x=[e.open],t[8]=e.open,t[9]=x),(0,Z.useEffect)(b,x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{let e=Kd(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Wd,n=t&&e.scrollLeft>Wd,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Wd;m(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[10]=S):S=t[10];let C=S,w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{let t=Kd(a.current);if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollBy({left:e*Math.max(120,t.clientWidth*.75),behavior:n?`auto`:`smooth`})},t[11]=w):w=t[11];let T=w,E;t[12]!==e.browserAvailable||t[13]!==e.onAddBrowser?(E={label:`Browser`,icon:Ee,shortcut:`B`,available:e.browserAvailable,disabledReason:Vd.browser,onClick:e.onAddBrowser},t[12]=e.browserAvailable,t[13]=e.onAddBrowser,t[14]=E):E=t[14];let D;t[15]!==e.onAddTerminal||t[16]!==e.terminalAvailable?(D={label:`Terminal`,icon:Ie,shortcut:`T`,available:e.terminalAvailable,disabledReason:Vd.terminal,onClick:e.onAddTerminal},t[15]=e.onAddTerminal,t[16]=e.terminalAvailable,t[17]=D):D=t[17];let O;t[18]!==e.filesAvailable||t[19]!==e.onAddFiles?(O={label:`Files`,icon:We,shortcut:`F`,available:e.filesAvailable,disabledReason:Vd.files,onClick:e.onAddFiles},t[18]=e.filesAvailable,t[19]=e.onAddFiles,t[20]=O):O=t[20];let k;t[21]!==e.diffAvailable||t[22]!==e.onAddDiff?(k={label:`Diff`,icon:A,shortcut:`D`,available:e.diffAvailable,disabledReason:Vd.diff,onClick:e.onAddDiff},t[21]=e.diffAvailable,t[22]=e.onAddDiff,t[23]=k):k=t[23];let j;t[24]!==e.onAddPullRequest||t[25]!==e.pullRequestAvailable?(j={label:`Pull request`,icon:Rr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Vd.pullRequest,onClick:e.onAddPullRequest},t[24]=e.onAddPullRequest,t[25]=e.pullRequestAvailable,t[26]=j):j=t[26];let M;t[27]!==e.onAddPullRequests||t[28]!==e.pullRequestsAvailable?(M={label:`Linked pull requests`,icon:Rr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Vd.pullRequests,onClick:e.onAddPullRequests},t[27]=e.onAddPullRequests,t[28]=e.pullRequestsAvailable,t[29]=M):M=t[29];let N;t[30]!==e.deviceAvailable||t[31]!==e.onAddDevice?(N={label:`Device`,icon:u,shortcut:`M`,available:e.deviceAvailable,disabledReason:Vd.device,onClick:e.onAddDevice},t[30]=e.deviceAvailable,t[31]=e.onAddDevice,t[32]=N):N=t[32];let P;t[33]!==j||t[34]!==M||t[35]!==N||t[36]!==E||t[37]!==D||t[38]!==O||t[39]!==k?(P=[E,D,O,k,j,M,N],t[33]=j,t[34]=M,t[35]=N,t[36]=E,t[37]=D,t[38]=O,t[39]=k,t[40]=P):P=t[40];let F=P,I;t[41]===F?I=t[42]:(I=e=>{let t=Xd(F,e.nativeEvent);t&&(e.preventDefault(),e.stopPropagation(),d(!1),t.onClick())},t[41]=F,t[42]=I);let L=I,R;t[43]===e?R=t[44]:(R=async(t,n)=>{t.preventDefault(),t.stopPropagation();let r=Ct();if(!r)return;let i=e.surfaces.findIndex(e=>e.id===n.id);if(i<0)return;let a=[];n.kind===`device`&&e.onRenameDevice&&a.push({id:`rename`,label:`Rename`}),n.kind===`file`&&n.attachment===void 0&&a.push({id:`copy-path`,label:`Copy path`});let o=qd(n,e.previewSessions),s=o?e.desktopByTabId[o]??null:null,l=s?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...Jd({overlay:s,canResolveRuntimeTabId:e.previewRuntimeTabId!==void 0})}),a.push({id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:e.surfaces.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:i>=e.surfaces.length-1},{id:`close-all`,label:`Close all`,disabled:e.surfaces.length===0});let u=await r.contextMenu.show(a,{x:t.clientX,y:t.clientY});bb136:switch(u){case`rename`:c(n.id);break bb136;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb136;case`toggle-mute`:{let t=o&&s?e.previewRuntimeTabId?.(o)??null:null;t&&va?.setAudioMuted(t,!l).catch(yf);break bb136}case`close`:e.onCloseSurface(n);break bb136;case`close-others`:e.onCloseOtherSurfaces(n);break bb136;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb136;case`close-all`:e.onCloseAllSurfaces();break bb136}},t[43]=e,t[44]=R);let z=R,B=vf,V;t[45]===e?V=t[46]:(V=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[45]=e,t[46]=V);let H=V,ee,te;t[47]!==e.activeSurfaceId||t[48]!==p.hasOverflow?(ee=()=>{e.activeSurfaceId&&p.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},te=[e.activeSurfaceId,p.hasOverflow],t[47]=e.activeSurfaceId,t[48]=p.hasOverflow,t[49]=ee,t[50]=te):(ee=t[49],te=t[50]),(0,Z.useEffect)(ee,te);let ne,re;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ne=()=>{let e=Kd(a.current);if(!e)return;let t=e.firstElementChild,n=ar(t?[e,t]:e,C);return e.addEventListener(`scroll`,C,{passive:!0}),C(),()=>{n(),e.removeEventListener(`scroll`,C)}},re=[C],t[51]=ne,t[52]=re):(ne=t[51],re=t[52]),(0,Z.useEffect)(ne,re);let ie,oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{let e=Kd(a.current);if(!e)return;let t=t=>{if(t.ctrlKey)return;let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=16),t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=e.clientWidth),n===0)return;let r=e.scrollLeft;e.scrollLeft+=n,e.scrollLeft!==r&&(t.preventDefault(),C())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},oe=[C],t[53]=ie,t[54]=oe):(ie=t[53],oe=t[54]),(0,Z.useEffect)(ie,oe);let se=e.mode,ce;t[55]===e.maximized?ce=t[56]:(ce=e.maximized===void 0?{}:{maximized:e.maximized},t[55]=e.maximized,t[56]=ce);let ue;t[57]===e.open?ue=t[58]:(ue=e.open===void 0?{}:{open:e.open},t[57]=e.open,t[58]=ue);let de;t[59]===e.widthStorageKey?de=t[60]:(de=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[59]=e.widthStorageKey,t[60]=de);let fe;t[61]===e.defaultWidth?fe=t[62]:(fe=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[61]=e.defaultWidth,t[62]=fe);let pe;t[63]===e.inlineSize?pe=t[64]:(pe=e.inlineSize?{inlineSize:e.inlineSize}:{},t[63]=e.inlineSize,t[64]=pe);let he=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,ge=n&&`drag-region`,ve=n&&`wco:pr-(--workspace-native-controls-inset)`,ye=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)]`,be;t[65]!==he||t[66]!==ge||t[67]!==ve||t[68]!==ye?(be=K(`flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-1 bg-(--app-chrome-background) pl-2`,he,ge,ve,ye),t[65]=he,t[66]=ge,t[67]=ve,t[68]=ye,t[69]=be):be=t[69];let xe=e.surfaces,Se=e.onMoveSurface,Ce;t[70]!==H||t[71]!==z||t[72]!==n||t[73]!==e||t[74]!==s||t[75]!==i?(Ce=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),o=of(t,e.previewSessions,e.terminalLabelsById),l=qd(t,e.previewSessions),u=Yd(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(mf,{surfaceId:t.id,disabled:!e.onMoveSurface||s===t.id,"data-active-tab":r,onMouseDown:B,onAuxClick:e=>H(e,t),onContextMenu:e=>void z(e,t),className:K(`cursor-pointer group/tab flex h-7 w-52 shrink-0 items-center gap-2 rounded-md pr-1 pl-2.5 text-sm transition-colors duration-150`,n&&`[-webkit-app-region:no-drag]`,r?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[(0,$.jsxs)(`span`,{className:`relative flex size-4 shrink-0 items-center justify-center [&_img]:size-3.5 [&_svg]:size-3.5`,children:[(0,$.jsx)(lf,{surface:t,sessions:e.previewSessions,desktopByTabId:e.desktopByTabId,theme:i,environmentId:e.environmentId,pullRequestStatusSeeds:e.pullRequestStatusSeeds}),a?(0,$.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full bg-current`,"aria-hidden":!0}):null]}),u===`none`||!d?null:(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,className:`cursor-pointer flex size-4 shrink-0 items-center justify-center rounded-sm hover:bg-muted`,"aria-label":u===`muted`?`Unmute ${o}`:`Mute ${o}`,onClick:e=>{e.stopPropagation(),va?.setAudioMuted(d,u!==`muted`).catch(_f)},children:(0,$.jsx)(at,{className:`size-3`,icon:u===`muted`?it:nt})})}),(0,$.jsx)(J,{children:u===`muted`?`Unmute tab`:`Mute tab`})]}),s===t.id?(0,$.jsx)(`input`,{"aria-label":`Device tab name`,className:`min-w-0 flex-1 rounded-sm bg-background px-1 outline-none ring-1 ring-inset ring-ring`,defaultValue:o,ref:gf,onBlur:n=>{e.onRenameDevice?.(t.id,n.currentTarget.value),c(null)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=o,e.currentTarget.blur())}}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,onDoubleClick:()=>{t.kind===`device`&&e.onRenameDevice&&c(t.id)},className:`cursor-pointer flex h-full min-w-0 flex-1 items-center`,onClick:()=>e.onActivate(t),children:(0,$.jsx)(`span`,{className:`truncate`,children:o})})}),(0,$.jsx)(J,{children:t.kind===`device`?(0,$.jsx)(bf,{surface:t,environmentId:e.environmentId,title:o}):o})]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close ${o}`,className:K(`cursor-pointer flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-opacity duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 pointer-coarse:opacity-100 motion-reduce:transition-none`,r?`opacity-100`:`opacity-0 group-hover/tab:opacity-100`),onClick:()=>e.onCloseSurface(t),children:(0,$.jsx)(h,{className:`size-3.5`})})]},t.id)}),t[70]=H,t[71]=z,t[72]=n,t[73]=e,t[74]=s,t[75]=i,t[76]=Ce):Ce=t[76];let we;t[77]!==e.onMoveSurface||t[78]!==e.surfaces||t[79]!==Ce?(we=(0,$.jsx)(ff,{surfaces:xe,onMove:Se,children:Ce}),t[77]=e.onMoveSurface,t[78]=e.surfaces,t[79]=Ce,t[80]=we):we=t[80];let De;t[81]!==F||t[82]!==g||t[83]!==l||t[84]!==r||t[85]!==L||t[86]!==e?(De=g?(0,$.jsxs)(v,{open:l,onOpenChange:d,children:[(0,$.jsx)(ke,{ref:o,render:(0,$.jsx)(G,{"aria-label":`Add panel surface`,className:`shrink-0`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(W,{className:`size-4`})}),(0,$.jsx)(ae,{align:`start`,side:`bottom`,sideOffset:6,onKeyDownCapture:L,children:F.map(t=>{let n=t.icon;return t.label===`Browser`&&t.available?(0,$.jsxs)(Ne,{children:[(0,$.jsxs)(le,{className:`[&>svg:last-child]:ms-0`,"aria-keyshortcuts":t.shortcut,onClick:e=>{Bd(`pointerType`in e.nativeEvent&&typeof e.nativeEvent.pointerType==`string`?e.nativeEvent.pointerType:void 0)&&(d(!1),t.onClick())},children:[(0,$.jsx)(n,{}),t.label,(0,$.jsx)(Te,{children:t.shortcut})]}),(0,$.jsx)(_e,{className:`max-w-56`,children:r.map(t=>(0,$.jsx)(U,{onClick:()=>e.onAddBrowserInProfile(t.id),children:(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.name})},t.id))})]},t.label):(0,$.jsxs)($d,{available:t.available,disabledReason:t.disabledReason,shortcut:t.shortcut,onClick:t.onClick,children:[(0,$.jsx)(n,{}),t.label]},t.label)})})]}):null,t[81]=F,t[82]=g,t[83]=l,t[84]=r,t[85]=L,t[86]=e,t[87]=De):De=t[87];let Oe;t[88]!==we||t[89]!==De?(Oe=(0,$.jsx)(Wn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-right-panel-tab-list":!0,children:(0,$.jsxs)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:[we,De]})}),t[88]=we,t[89]=De,t[90]=Oe):Oe=t[90];let Ae;t[91]!==p.canScrollLeft||t[92]!==p.canScrollRight||t[93]!==p.hasOverflow?(Ae=p.hasOverflow?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 [-webkit-app-region:no-drag]`,role:`group`,"aria-label":`Scroll panel tabs`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs left`,disabled:!p.canScrollLeft,onClick:()=>T(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(me,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs left`})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs right`,disabled:!p.canScrollRight,onClick:()=>T(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(Fe,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs right`})]})]}):null,t[91]=p.canScrollLeft,t[92]=p.canScrollRight,t[93]=p.hasOverflow,t[94]=Ae):Ae=t[94];let je;t[95]!==n||t[96]!==e.layoutControls?(je=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[95]=n,t[96]=e.layoutControls,t[97]=je):je=t[97];let Me;t[98]===n?Me=t[99]:(Me=n?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]`}):null,t[98]=n,t[99]=Me);let Pe;t[100]!==e.layoutControls||t[101]!==be||t[102]!==Oe||t[103]!==Ae||t[104]!==je||t[105]!==Me?(Pe=(0,$.jsxs)(`div`,{className:be,"data-right-panel-tabbar":!0,children:[Oe,Ae,e.layoutControls,je,Me]}),t[100]=e.layoutControls,t[101]=be,t[102]=Oe,t[103]=Ae,t[104]=je,t[105]=Me,t[106]=Pe):Pe=t[106];let Le;t[107]!==r||t[108]!==e.activeSurfaceId||t[109]!==e.browserAvailable||t[110]!==e.children||t[111]!==e.deviceAvailable||t[112]!==e.diffAvailable||t[113]!==e.filesAvailable||t[114]!==e.onAddBrowser||t[115]!==e.onAddBrowserInProfile||t[116]!==e.onAddDevice||t[117]!==e.onAddDiff||t[118]!==e.onAddFiles||t[119]!==e.onAddPullRequest||t[120]!==e.onAddPullRequests||t[121]!==e.onAddTerminal||t[122]!==e.pullRequestAvailable||t[123]!==e.pullRequestsAvailable||t[124]!==e.terminalAvailable?(Le=e.activeSurfaceId===null?(0,$.jsx)(ef,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,onAddPullRequest:e.onAddPullRequest,onAddPullRequests:e.onAddPullRequests,onAddDevice:e.onAddDevice,browserAvailable:e.browserAvailable,terminalAvailable:e.terminalAvailable,diffAvailable:e.diffAvailable,filesAvailable:e.filesAvailable,pullRequestAvailable:e.pullRequestAvailable,pullRequestsAvailable:e.pullRequestsAvailable,deviceAvailable:e.deviceAvailable}):e.children,t[107]=r,t[108]=e.activeSurfaceId,t[109]=e.browserAvailable,t[110]=e.children,t[111]=e.deviceAvailable,t[112]=e.diffAvailable,t[113]=e.filesAvailable,t[114]=e.onAddBrowser,t[115]=e.onAddBrowserInProfile,t[116]=e.onAddDevice,t[117]=e.onAddDiff,t[118]=e.onAddFiles,t[119]=e.onAddPullRequest,t[120]=e.onAddPullRequests,t[121]=e.onAddTerminal,t[122]=e.pullRequestAvailable,t[123]=e.pullRequestsAvailable,t[124]=e.terminalAvailable,t[125]=Le):Le=t[125];let Re;t[126]===Le?Re=t[127]:(Re=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:Le}),t[126]=Le,t[127]=Re);let ze;return t[128]!==e.mode||t[129]!==ce||t[130]!==ue||t[131]!==de||t[132]!==fe||t[133]!==pe||t[134]!==Pe||t[135]!==Re?(ze=(0,$.jsxs)(ls,{mode:se,...ce,...ue,...de,...fe,...pe,children:[Pe,Re]}),t[128]=e.mode,t[129]=ce,t[130]=ue,t[131]=de,t[132]=fe,t[133]=pe,t[134]=Pe,t[135]=Re,t[136]=ze):ze=t[136],ze}function gf(e){e?.focus(),e?.select()}function _f(){}function vf(e){e.button===1&&e.preventDefault()}function yf(){}function bf(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=ir(n?e.environmentId:null),i;t[0]!==r||t[1]!==n?(i=n?r.devices.find(e=>e.hostId===n.hostId&&e.id===n.deviceId):void 0,t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=n?r.hosts.find(e=>e.id===n.hostId):void 0,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===e.title?c=t[7]:(c=(0,$.jsx)(`span`,{children:e.title}),t[6]=e.title,t[7]=c);let l;t[8]!==a?.version||t[9]!==s?.label||t[10]!==n?(l=n?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[s?.label??`Device host`,` ·`,` `,a?.version??(n.platform===`ios`?`iOS`:`Android`)]}):null,t[8]=a?.version,t[9]=s?.label,t[10]=n,t[11]=l):l=t[11];let u;return t[12]!==c||t[13]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14],u}var xf=(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,E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(wf,{}),t[0]=E):E=t[0];let D;t[1]===c?D=t[2]:(D=(0,$.jsx)(An,{className:`relative shrink-0 [-webkit-app-region:no-drag]`,pressed:c,"aria-label":`Toggle thread details panel`,variant:`ghost`,size:`sm`,children:E}),t[1]=c,t[2]=D);let O=D,k;t[3]!==v||t[4]!==l||t[5]!==d?(k=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]=k):k=t[6];let A=k,j;t[7]!==b||t[8]!==u||t[9]!==l||t[10]!==O||t[11]!==A?(j=b?A(l===`popover`?(0,$.jsx)(Xr,{handle:u,render:O}):O):null,t[7]=b,t[8]=u,t[9]=l,t[10]=O,t[11]=A,t[12]=j):j=t[12];let M;t[13]!==_||t[14]!==x||t[15]!==a||t[16]!==o||t[17]!==s?(M=x?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:o,onPressedChange:_,"aria-label":`Toggle terminal drawer`,variant:`ghost`,size:`sm`,disabled:!a,children:(0,$.jsx)(Me,{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]=M):M=t[18];let N;t[19]!==y||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==w||t[24]!==C||t[25]!==S?(N=S?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:p,onPressedChange:y,"aria-label":w>0?`Toggle right panel, ${w} ${w===1?`tab`:`tabs`}`:`Toggle right panel`,variant:`ghost`,size:`sm`,disabled:!f,children:w>0?(0,$.jsx)(Sf,{count:w}):(0,$.jsx)(T,{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]=N):N=t[26];let P;return t[27]!==M||t[28]!==N||t[29]!==j?(P=(0,$.jsxs)(`div`,{className:`flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,"data-panel-layout-controls":!0,children:[j,M,N]}),t[27]=M,t[28]=N,t[29]=j,t[30]=P):P=t[30],P});function Sf(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 Cf=(0,Z.memo)(function(e){let t=(0,Q.c)(12),{maximized:n,onToggle:r}=e,i=n?`Restore panel size`:`Maximize panel`,a=n?rt:st,o;t[0]===a?o=t[1]:(o=(0,$.jsx)(at,{className:`size-3.5`,icon:a}),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(s=(0,$.jsx)(q,{render:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:n,onPressedChange:r,"aria-label":i,variant:`ghost`,size:`sm`,children:o})}),t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,$.jsx)(J,{side:`bottom`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(Y,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l});function wf(){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{ls as A,fc as C,xs as D,uc as E,ko as F,jo as I,Oo as L,Jo as M,Yo as N,Ss as O,Ko as P,gc as S,dc as T,ll as _,Fd as a,Pc as b,Id as c,jd as d,Nu as f,dl as g,bl as h,Pd as i,is as j,vs as k,Ld as l,Cl as m,Cf as n,Rd as o,xl as p,hf as r,zd as s,xf as t,Md as u,Lc as v,mc as w,bc as x,Ic as y};
215
- //# sourceMappingURL=PanelLayoutControls-NUeu7nMQ.js.map
214
+ `;function nd(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=Uu(r),i=Wu(e,n);if(i.length===0){p=null;break bb0}let a=Rt(Ku(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(od)),deletions:new Set(i.flatMap(ad))},c;t[3]!==s||t[4]!==o||t[5]!==e||t[6]!==i?(c={fileDiff:o,rows:i,shown:i.length,total:e.length,drawn:s},t[3]=s,t[4]=o,t[5]=e,t[6]=i,t[7]=c):c=t[7],p=c}t[0]=n,t[1]=r,t[2]=p}else p=t[2];let m=p,h=m?.rows??null,g;bb1:{if(h===null||h.some(e=>e.hunk!==h[0]?.hunk)){g=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==h?(e=async e=>{let t=await c(e),r=qu(t.newFile.contents,h);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=h,t[13]=e):e=t[13],g=e}let v=g,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=dc(e.position),i=uc(t.side);m?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=dc(u.position);r(uc(e.side),e.line,id)}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,C;t[23]===r?C=t[24]:(C=e=>{if(e===null||r===null)return;let t=_(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=C);let w=C,T=s!==null&&u===null,E=s?.onAskAgent??null,D;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==E?(D=e=>{if(u===null||r===null||E===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&&E(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=E,t[29]=D):D=t[29];let O=D,k;t[30]===f?k=t[31]:(k=Vt(f),t[30]=f,t[31]=k);let A;t[32]===v?A=t[33]:(A=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=A);let j;t[34]!==w||t[35]!==T||t[36]!==f||t[37]!==k||t[38]!==A?(j={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:k,themeType:f,preferredHighlighter:ha,unsafeCSS:td,enableGutterUtility:T,enableLineSelection:T,onGutterUtilityClick:w,onLineSelectionEnd:w,...A},t[34]=w,t[35]=T,t[36]=f,t[37]=k,t[38]=A,t[39]=j):j=t[39];let M=j,N;t[40]===n.caption?N=t[41]:(N=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(Ru,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=N);let P;t[42]!==x||t[43]!==O||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]!==E||t[53]!==l||t[54]!==M||t[55]!==m?(P=m===null?i?(0,$.jsxs)(`p`,{className:`rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[`Loading `,n.path,`...`]}):(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,$.jsx)(`span`,{className:`font-mono text-foreground`,children:n.path}),` lines `,n.start,`-`,n.end,` are not in the loaded diff.`]}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(_n,{fileDiff:m.fileDiff,options:M,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(rd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(fc,{comment:e,onRemove:()=>s?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&s!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${dc(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&&E!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>O(e)}}:{},onCancel:()=>d(null),onComment:e=>{if(!s.canComment){O(e);return}s.onComment({path:n.path,oldPath:r===null?null:sd(r,n.path),position:u.position,body:e}),d(null)}}):null]}),renderHeaderMetadata:()=>(0,$.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[n.side===`old`?`removed code, `:``,`showing `,m.shown,` of`,` `,m.total,` diff lines`]}),(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(S,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=O,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]=E,t[53]=l,t[54]=M,t[55]=m,t[56]=P):P=t[56];let F;return t[57]!==N||t[58]!==P?(F=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[N,P]}),t[57]=N,t[58]=P,t[59]=F):F=t[59],F}function rd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(Qu,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function id(e){return{...e,draft:!0}}function ad(e){return e.oldLine===null?[]:[e.oldLine]}function od(e){return e.newLine===null?[]:[e.newLine]}function sd(e,t){let n=zt(e);return n===t?null:n}function cd(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:ha,unsafeCSS:Go,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 ld={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function ud(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:o,onRailOpenChange:c,stopList:u,nextTitle:d,files:f,loadDiffFiles:p,diffLoading:m,commenting:h,onStep:g,onAsk:_,onFinish:v,onOpenFile:y}=e,b;t[0]===n?b=t[1]:(b=Ju(n),t[0]=n,t[1]=b);let{lettered:S,byExcerpt:C}=b,w;t[2]===n.excerpts?w=t[3]:(w=new Set(n.excerpts.map(dd)),t[2]=n.excerpts,t[3]=w);let T=w,E,D,O,k,A,j,M,P,F;if(t[4]!==C||t[5]!==h||t[6]!==m||t[7]!==T||t[8]!==f||t[9]!==r||t[10]!==S||t[11]!==p||t[12]!==y||t[13]!==c||t[14]!==g||t[15]!==o||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]!==u){let e;t[32]===T?e=t[33]:(e=e=>!T.has(e.path),t[32]=T,t[33]=e);let l=n.files.filter(e);E=S.length>0;let d=E&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===d?D=t[35]:(D=K(`grid gap-8`,d),t[34]=d,t[35]=D),O=`flex min-w-0 flex-col gap-5`;let _=r+1,v;t[36]!==i||t[37]!==_?(v=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,_,` of `,i]}),t[36]=i,t[37]=_,t[38]=v):v=t[38];let b;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=b):b=t[39];let x=r+1,w;t[40]!==i||t[41]!==x?(w=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,x,` of `,i]}),t[40]=i,t[41]=x,t[42]=w):w=t[42];let I=o&&`rotate-180`,L;t[43]===I?L=t[44]:(L=K(I),t[43]=I,t[44]=L);let R;t[45]===L?R=t[46]:(R=(0,$.jsx)(a,{"aria-hidden":!0,className:L}),t[45]=L,t[46]=R);let z;t[47]!==w||t[48]!==R?(z=(0,$.jsxs)(fa,{render:b,children:[w,R]}),t[47]=w,t[48]=R,t[49]=z):z=t[49];let B=r===0,V;t[50]===g?V=t[51]:(V=()=>g(-1),t[50]=g,t[51]=V);let H;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(we,{"aria-hidden":!0}),t[52]=H):H=t[52];let ee;t[53]!==B||t[54]!==V?(ee=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:B,onClick:V,children:H}),t[53]=B,t[54]=V,t[55]=ee):ee=t[55];let te=r===i-1,ne;t[56]===g?ne=t[57]:(ne=()=>g(1),t[56]=g,t[57]=ne);let U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(a,{"aria-hidden":!0}),t[58]=U):U=t[58];let re;t[59]!==te||t[60]!==ne?(re=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:te,onClick:ne,children:U}),t[59]=te,t[60]=ne,t[61]=re):re=t[61];let ie;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(ua,{children:`J`}),(0,$.jsx)(ua,{children:`K`})]}),t[62]=ie):ie=t[62];let ae;t[63]!==ee||t[64]!==re?(ae=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[ee,re,ie]}),t[63]=ee,t[64]=re,t[65]=ae):ae=t[65];let oe;t[66]!==v||t[67]!==z||t[68]!==ae?(oe=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[v,z,ae]}),t[66]=v,t[67]=z,t[68]=ae,t[69]=oe):oe=t[69];let W;t[70]===u?W=t[71]:(W=(0,$.jsx)(da,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:u})}),t[70]=u,t[71]=W),t[72]!==c||t[73]!==o||t[74]!==oe||t[75]!==W?(k=(0,$.jsxs)(ma,{open:o,onOpenChange:c,children:[oe,W]}),t[72]=c,t[73]=o,t[74]=oe,t[75]=W,t[76]=k):k=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)(Ru,{text:n.summary})}),t[79]=n.summary,t[80]=ce),t[81]!==se||t[82]!==ce?(A=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[se,ce]}),t[81]=se,t[82]=ce,t[83]=A):A=t[83],t[84]===n.attention?j=t[85]:(j=n.attention===null?null:(0,$.jsxs)(la,{controlAlignment:`first-line`,children:[(0,$.jsx)(s,{}),(0,$.jsx)(oa,{children:ld[n.attention.kind]}),(0,$.jsx)(ca,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Ru,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=j),t[86]!==C||t[87]!==h||t[88]!==m||t[89]!==f||t[90]!==p||t[91]!==y||t[92]!==n.excerpts?(M=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)(nd,{excerpt:e,file:f.get(e.path)??null,loading:m,notes:C[t]??[],commenting:h,loadDiffFiles:p,onOpenFile:y},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=C,t[87]=h,t[88]=m,t[89]=f,t[90]=p,t[91]=y,t[92]=n.excerpts,t[93]=M):M=t[93],t[94]===S?P=t[95]:(P=(0,$.jsx)($u,{notes:S,className:`@min-[90rem]/guide:hidden`}),t[94]=S,t[95]=P),F=l.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:l.map(e=>{let t=f.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)(ma,{children:[(0,$.jsxs)(fa,{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)(Fe,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(N,{"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)(Ru,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Or,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(da,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:m?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(cd,{file:t,loadDiffFiles:p})})]})},e.path)})})})]}):null,t[4]=C,t[5]=h,t[6]=m,t[7]=T,t[8]=f,t[9]=r,t[10]=S,t[11]=p,t[12]=y,t[13]=c,t[14]=g,t[15]=o,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]=u,t[23]=E,t[24]=D,t[25]=O,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=P,t[31]=F}else E=t[23],D=t[24],O=t[25],k=t[26],A=t[27],j=t[28],M=t[29],P=t[30],F=t[31];let I;t[96]!==_||t[97]!==n.questions?(I=n.questions.length>0||_!==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=>_===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Ru,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>_(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)(x,{"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)(Ru,{text:e,plain:!0})})]},e)),_===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>_(``),children:[(0,$.jsx)(x,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=_,t[97]=n.questions,t[98]=I):I=t[98];let R;t[99]!==d||t[100]!==v||t[101]!==g?(R=d===null?v===null?null:(0,$.jsxs)(G,{onClick:v,children:[(0,$.jsx)(L,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(G,{className:`min-w-0`,onClick:()=>g(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,d]}),(0,$.jsx)(l,{"aria-hidden":!0})]}),t[99]=d,t[100]=v,t[101]=g,t[102]=R):R=t[102];let z;t[103]===R?z=t[104]:(z=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:R}),t[103]=R,t[104]=z);let B;t[105]!==I||t[106]!==z||t[107]!==O||t[108]!==k||t[109]!==A||t[110]!==j||t[111]!==M||t[112]!==P||t[113]!==F?(B=(0,$.jsxs)(`article`,{className:O,children:[k,A,j,M,P,F,I,z]}),t[105]=I,t[106]=z,t[107]=O,t[108]=k,t[109]=A,t[110]=j,t[111]=M,t[112]=P,t[113]=F,t[114]=B):B=t[114];let V;t[115]!==E||t[116]!==S?(V=E?(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)($u,{notes:S})}):null,t[115]=E,t[116]=S,t[117]=V):V=t[117];let H;return t[118]!==D||t[119]!==B||t[120]!==V?(H=(0,$.jsxs)(`div`,{className:D,children:[B,V]}),t[118]=D,t[119]=B,t[120]=V,t[121]=H):H=t[121],H}function dd(e){return e.path}var fd=new Map;function pd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=zi(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:fd},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:fd},f=a.some(e=>!d.files.has(e))&&!d.done,p=kt,m=f?Gr.diff({environmentId:n,input:{...r,...d.cursor===null?{}:{cursor:d.cursor}}}):null,t[4]=n,t[5]=s,t[6]=l,t[7]=r,t[8]=a,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(d=t[9],f=t[10],p=t[11],m=t[12]);let h=p(m),g=h.data,_=d.cursor,v,y;t[13]!==_||t[14]!==g||t[15]!==s?(v=()=>{g!==null&&u(e=>{let t=e.key===s?e:{key:s,cursor:null,done:!1,files:fd};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 md(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=qi(Gi(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=Ki(f),m;t[4]===f?m=t[5]:(m=e=>Ui.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?[]:Bu(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=pd(C),T=At(Gr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Yo(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(zu(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||xa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Wi(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)(Yu,{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)(ud,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(Yu,{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 hd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Gr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=kt(a),s;t[3]===n?s=t[4]:(s=Gr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=H(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=At(Gr.generateReviewGuide,l),[d,f]=(0,Z.useState)(!1),p=o.data,m=d||p?.run?._tag===`Running`,h;t[6]!==p||t[7]!==n||t[8]!==r||t[9]!==i?(h=()=>Ui.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:p?.guide?.generatedAt??null,previousFailedAt:p?.run?._tag===`Failed`?p.run.failedAt:null,since:Date.now()}),t[6]=p,t[7]=n,t[8]=r,t[9]=i,t[10]=h):h=t[10];let g=(0,Z.useEffectEvent)(h),_;t[11]!==p?.run?._tag||t[12]!==g?(_=()=>{p?.run?._tag===`Running`&&g()},t[11]=p?.run?._tag,t[12]=g,t[13]=_):_=t[13];let v=p?.run?._tag,y;t[14]===v?y=t[15]:(y=[v],t[14]=v,t[15]=y),(0,Z.useEffect)(_,y);let b;t[16]!==n||t[17]!==u||t[18]!==r||t[19]!==m||t[20]!==g?(b=async()=>{if(m)return;f(!0),g();let e=await u({environmentId:n,input:r});f(!1),e._tag===`Failure`&&(Ui.getState().settle(Gi(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:li(Ge(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=u,t[18]=r,t[19]=m,t[20]=g,t[21]=b):b=t[21];let x=b,S;return t[22]!==c||t[23]!==p||t[24]!==o||t[25]!==m||t[26]!==x?(S={query:o,data:p,running:m,canWrite:c,write:x},t[22]=c,t[23]=p,t[24]=o,t[25]=m,t[26]=x,t[27]=S):S=t[27],S}function gd(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}=hd(p),y;t[4]!==n||t[5]!==r?(y=Gi(n,r),t[4]=n,t[5]=r,t[6]=y):y=t[6];let x=y,S;t[7]===r?S=t[8]:(S=zi(r),t[7]=r,t[8]=S);let C=S,w=Bi(r),T=Ri(vd),E=Ri(_d),D;t[9]!==T||t[10]!==s||t[11]!==c||t[12]!==w||t[13]!==E||t[14]!==C?(D=!s&&c===null?null:{canComment:s,pending:w,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return T(C,{id:Vi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>E(C,e),onAskAgent:c},t[9]=T,t[10]=s,t[11]=c,t[12]=w,t[13]=E,t[14]=C,t[15]=D):D=t[15];let O=D,k,A;t[16]!==o||t[17]!==x?(k=()=>{if(o)return Ui.getState().setShown(x),()=>{Ui.getState().shownKey===x&&Ui.getState().setShown(null)}},A=[o,x],t[16]=o,t[17]=x,t[18]=k,t[19]=A):(k=t[18],A=t[19]),(0,Z.useEffect)(k,A);let j=h?.guide??null,M=o&&j!==null,N;t[20]===f?N=t[21]:(N=()=>f?.(),t[20]=f,t[21]=N);let P=(0,Z.useEffectEvent)(N),F;t[22]!==P||t[23]!==M?(F=()=>{M&&P()},t[22]=P,t[23]=M,t[24]=F):F=t[24];let I;t[25]===M?I=t[26]:(I=[M],t[25]=M,t[26]=I),(0,Z.useEffect)(F,I);let L=h?.run??null,R=h?.currentHeadSha??null,z=j!==null&&R!==null&&R!==j.headSha,B=L?._tag===`Failed`&&L.headSha===R?L.detail:null,V;t[27]!==_||t[28]!==g||t[29]!==v?(V=(e,t)=>_?(0,$.jsxs)(G,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(b,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=V):V=t[30];let H=V;if(j===null){if(m.isPending&&h===null){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-48 items-center justify-center`,children:(0,$.jsx)(vt,{})}),t[31]=e):e=t[31],e}let e=g?`Writing a review guide`:`No review guide yet`,n;t[32]===e?n=t[33]:(n=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),t[32]=e,t[33]=n);let r=B??m.error??(g?`An agent is reading the change. A large one takes a few minutes. You can leave; you will be told when it is ready.`:`A guide is a tour of the change: stops through the code in reading order, with the calls only a maintainer can make.`),i;t[34]===r?i=t[35]:(i=(0,$.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:r}),t[34]=r,t[35]=i);let a=B===null?`Write guide`:`Try again`,o;t[36]!==a||t[37]!==H?(o=H(a,`sm`),t[36]=a,t[37]=H,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 ee;t[43]!==_||t[44]!==B||t[45]!==g||t[46]!==z||t[47]!==H?(ee=z||B!==null||g?(0,$.jsxs)(la,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(vt,{}):(0,$.jsx)(xe,{}),(0,$.jsx)(ca,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!g&&_?(0,$.jsx)(sa,{children:H(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=B,t[45]=g,t[46]=z,t[47]=H,t[48]=ee):ee=t[48];let te=ee,ne;t[49]!==n||t[50]!==a?(ne={environmentId:n,cwd:a},t[49]=n,t[50]=a,t[51]=ne):ne=t[51];let U;t[52]!==j||t[53]!==l?(U=l===null?null:(e,t)=>{let n=j.stops[e];n!==void 0&&l(n,e,t)},t[52]=j,t[53]=l,t[54]=U):U=t[54];let re;t[55]!==o||t[56]!==te||t[57]!==O||t[58]!==n||t[59]!==j||t[60]!==u||t[61]!==d||t[62]!==r||t[63]!==U?(re=(0,$.jsx)(md,{environmentId:n,reference:r,guide:j,banner:te,active:o,commenting:O,onAsk:U,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=te,t[57]=O,t[58]=n,t[59]=j,t[60]=u,t[61]=d,t[62]=r,t[63]=U,t[64]=re):re=t[64];let ie;return t[65]!==ne||t[66]!==re?(ie=(0,$.jsx)(Lu,{value:ne,children:re}),t[65]=ne,t[66]=re,t[67]=ie):ie=t[67],ie}function _d(e){return e.removeComment}function vd(e){return e.addComment}function yd(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 bd={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`,"approve-workflows":`Could not approve workflows`},xd={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.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`},Sd=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,Cd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],wd=()=>t(()=>import(`./PullRequestCodeTab-qEGBl5Kn.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])),Td=(0,Z.lazy)(wd),Ed=new Map,Dd=e=>typeof e==`string`?e:d(e);function Od(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:a,disabled:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(Le,{}),t[0]=s):s=t[0];let c;t[1]===a?c=t[2]:(c=e=>a(e),t[1]=a,t[2]=c);let l;if(t[3]!==o||t[4]!==n){let e;t[6]===o?e=t[7]:(e=e=>(0,$.jsx)(i,{value:e.environmentId,disabled:o,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(aa,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=o,t[7]=e),l=n.map(e),t[3]=o,t[4]=n,t[5]=l}else l=t[5];let u;return t[8]!==c||t[9]!==l||t[10]!==r?(u=(0,$.jsxs)($.Fragment,{children:[s,(0,$.jsx)(P,{value:r,onValueChange:c,children:l})]}),t[8]=c,t[9]=l,t[10]=r,t[11]=u):u=t[11],u}var kd=(e,t)=>{e.preventDefault(),e.stopPropagation(),Cl({url:t.url,openLabel:xl(Ir.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function Ad(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=K(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=K(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(xe,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Xr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(G,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(Jr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Zr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function jd({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:o=null,reference:s,listEntry:c=null,refreshToken:l=0,onActed:u,onClose:d,context:p=`page`,composerDraftTarget:h,onBack:_,onSelectPullRequest:y,onGuideShown:C}){let w=Ye(),T=Ke(),E=T.find(t=>t.id===s.projectId&&t.environmentId===e),O=E?.repositoryIdentity,k=w.get(e)?.environment.capabilities.threadPullRequests===!0,j=(0,Z.useMemo)(()=>k?ai(s,O):{projectId:s.projectId,repository:s.repository,number:s.number},[s,O,k]),N=`${j.projectId}:${j.host??``}:${j.repository}#${j.number}`,F=c?.projectId===j.projectId&&c.repository.toLowerCase()===j.repository.toLowerCase()&&(j.host===void 0||c.host.toLowerCase()===j.host.toLowerCase())&&c.number===j.number?c:null,[B,V]=(0,Z.useState)(!1),[ee,oe]=(0,Z.useState)(0),[W,se]=(0,Z.useState)(`summary`),[le,ue]=(0,Z.useState)(`newest`),[de,fe]=(0,Z.useState)(()=>({pullRequestKey:N,oid:null})),pe=de.pullRequestKey===N?de.oid:null,me=e=>{fe({pullRequestKey:N,oid:e})},he=e=>{me(e),se(`code`)},[_e,xe]=(0,Z.useState)(null),Se=e=>{me(null),xe(t=>({path:e,nonce:(t?.nonce??0)+1})),wd(),se(`code`)},we=Ui(t=>t.openRequestKey===Gi(e,j));we&&W!==`guide`&&se(`guide`),(0,Z.useEffect)(()=>{we&&Ui.getState().requestOpen(null)},[we]);let Ee=`${e}:${N}`,[Oe,je]=(0,Z.useState)(()=>({key:Ee,tabs:new Set([`summary`])})),Me=Oe.key===Ee?Oe.tabs:new Set([W]);(0,Z.useEffect)(()=>{je(e=>e.key===Ee?e.tabs.has(W)?e:{key:Ee,tabs:new Set(e.tabs).add(W)}:{key:Ee,tabs:new Set([W])})},[W,Ee]);let[Ne,Pe]=(0,Z.useState)(!1),Fe=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Pe(Fe.current[W]??!1)},[W]);let Ie=Ne,Re=(0,Z.useRef)({}),ze=(0,Z.useMemo)(()=>({summary:e=>{Re.current.summary=e},timeline:e=>{Re.current.timeline=e},code:e=>{Re.current.code=e}}),[]),Ve=(0,Z.useRef)(null),He=(0,Z.useRef)(null),We=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=We.current;e!==null&&(We.current=null,Ie&&e.tab===W&&Re.current[W]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Ie,W]);let qe=Yi(e=>e.pullRequestMergeMethod),Je=Yi(e=>e.setPullRequestMergeMethod),Xe=Ca(e,j.projectId),$e=(0,Z.useMemo)(()=>Xe(),[Xe]),[tt,nt]=(0,Z.useState)(null),rt=e=>{nt({pullRequestKey:N,method:e})},it=yd(N),[at,ot]=(0,Z.useState)(null),st=Dt(e,ge),lt=kt(Gr.detail({environmentId:e,input:j})),ut=kt(Gr.activity({environmentId:e,input:j})),dt=Vr(e),[ft,pt]=(0,Z.useState)(()=>oi(typeof window>`u`?void 0:window.localStorage,e,j));(0,Z.useEffect)(()=>{pt(oi(typeof window>`u`?void 0:window.localStorage,e,j))},[e,N,j.projectId,j.repository,j.number]),(0,Z.useEffect)(()=>{lt.data!==null&&(_i(typeof window>`u`?void 0:window.localStorage,e,j,lt.data),pt(lt.data))},[lt.data,e,N,j.projectId,j.repository,j.number]);let mt=Li({live:lt.data,cached:ft,reference:j}),ht=(0,Z.useMemo)(()=>F===null?null:Hr(F),[F]),gt=(0,Z.useMemo)(()=>lt.data===null?null:{...lt.data,checksState:Er(lt.data.checks)},[lt.data]),_t=Kr(e,j,gt,lt.dataUpdatedAt),vt=(0,Z.useMemo)(()=>Wr(mt,Wr(_t,ht)),[mt,_t,ht]),bt=(0,Z.useMemo)(()=>mt===null||vt===null||vt===mt?mt:{...mt,title:vt.title,state:vt.state,headBranch:vt.headBranch,baseBranch:vt.baseBranch,updatedAt:vt.updatedAt,author:vt.author??mt.author,additions:vt.additions??mt.additions,deletions:vt.deletions??mt.deletions,changedFiles:vt.changedFiles??mt.changedFiles,mergeability:vt.mergeability??mt.mergeability,closedAt:vt.closedAt===void 0?mt.closedAt:vt.closedAt,mergedAt:vt.mergedAt===void 0?mt.mergedAt:vt.mergedAt,isDraft:vt.isDraft??mt.isDraft},[mt,vt]),wt=ut.data,X=(0,Z.useMemo)(()=>bt===null?null:{...bt,capabilities:st?bt.capabilities:{...bt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:st?bt.viewerPermissions:{...bt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:wt?.author??bt.author,reviewers:wt?.reviewers??bt.reviewers,comments:wt?.comments??[],commentCount:wt?.commentCount??0,commentsTruncated:wt?.commentsTruncated??!1,reviewThreads:wt?.reviewThreads??[],commits:wt?.commits??[],reactions:wt?.reactions??[]},[wt,st,bt]),Nt=X??vt,Pt=H(Et),{copyToClipboard:Ft}=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})}),It=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||xa()||lr(e,Pt,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||Ft(`#${j.number}`,`PR number`))});(0,Z.useEffect)(()=>{let e=e=>It(e);return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Z.useEffect)(()=>{X?.autoMergeMethod!==void 0&&rt(X.autoMergeMethod)},[X?.autoMergeMethod,N]);let Lt=X===null?null:Ze(X.url),Rt=Ir.get(X?.provider),zt=(0,Z.useMemo)(()=>({repositoryUrl:Lt===null?null:Rt.referenceAutolinkRepositoryUrl(Lt),threadRef:o}),[Rt,Lt,o]),Bt=X?.author&&Lt!==null?Rt.authorProfileUrl(X.author.login,Lt):null,Vt=Nt?Ei(Nt.provider,Nt.number,Nt.headBranch,X?.headRepositoryNameWithOwner,Ze(Nt.url)):hi(j,O),Ht=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Ut=kt(X===null?null:Mt.listRefs({environmentId:e,input:{cwd:X.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Wt=X!==null&&ei(X.baseBranch,Ut.data?.refs??[]),Gt=bc(e,(0,Z.useMemo)(()=>X===null||X.capabilities.stacks!==!0||!k?null:{...j,host:j.host??Qe(X.url)?.host},[X,j,k])),Kt=Gt.data,qt=k&&X?.capabilities.stacks===!0&&X.capabilities.stackActions===!0&&w.get(e)?.environment.capabilities.pullRequestStackActions===!0,Jt=Ai({supportsStackActions:qt,hasStack:Kt!==null,stackPending:!Gt.isFresh,stackError:Gt.error}),Yt=ut.isPending&&wt===null,Xt=wt===null?ut.error:null,Zt=(0,Z.useCallback)(()=>{lt.refresh(),ut.refresh(),Gt.refresh()},[ut.refresh,lt.refresh,Gt.refresh]),[Qt,$t]=(0,Z.useState)(0),en=Qt+(dt??0),tn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!bt)return;let e={key:Ee,updatedAt:bt.updatedAt};if(ii(tn.current,e)){if(ut.isPending)return;ut.refresh(),$t(e=>e+1)}tn.current=e},[ut.isPending,ut.refresh,bt,Ee]),Pc(()=>{lt.refresh()},{key:`pull-request:${e}:${N}`});let nn=At(Gr.invalidate,{reportFailure:!1}),[rn,an]=(0,Z.useState)(!1),on=rn||lt.isPending,sn=(0,Z.useCallback)(async()=>{an(!0);try{await nn({environmentId:e,input:{reference:j}}),Zt(),$t(e=>e+1)}finally{an(!1)}},[e,nn,j,Zt]),cn=(0,Z.useRef)(l);(0,Z.useEffect)(()=>{cn.current!==l&&(cn.current=l,sn())},[l,sn]);let ln=At(Gr.runAction,{reportFailure:!1}),un=At(Gr.comment,{reportFailure:!1}),[dn,fn]=(0,Z.useState)(null),pn=dn!==null,mn=At(Gr.update,{reportFailure:!1}),[hn,gn]=(0,Z.useState)(null),_n=hn?.pullRequestKey===N?hn.text:null,[vn,yn]=(0,Z.useState)(!1),bn=ia(),{environments:xn}=St(),Sn=(0,Z.useMemo)(()=>{let t=T.find(t=>t.id===j.projectId&&t.environmentId===e)?.repositoryIdentity;return et(t,j.repository,j.number)},[e,T,j.number,j.projectId,j.repository]),Cn=(0,Z.useMemo)(()=>p===`page`?_c({environmentId:e,projectId:j.projectId},T,xn.map(e=>({environmentId:e.environmentId,label:e.label,machine:De(e.serverConfig)}))):[],[p,e,xn,T,j.projectId]),[wn,Tn]=(0,Z.useState)(null),Dn=wn?.pullRequestKey===N?wn.environmentId:e,On=Cn.find(e=>e.environmentId===Dn)??null,kn=On?.environmentId??e,An=On?.workspaceRoot??X?.workspaceRoot??E?.workspaceRoot??null,jn=Dt(kn,ie),Mn=wa({environmentId:kn,cwd:An}),Nn=async(t,n,r)=>{u?.(t,`sent`);let i=await ln({environmentId:e,input:{...j,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(fn(null),i._tag===`Failure`){let e=Ge(i),n=r===`rebase`?Sd:xd[t];return yt.add({type:`error`,title:bd[t],description:li(e,n)}),u?.(t,`failed`),!1}return t===`revert`&&yt.add({type:`success`,title:`Revert pull request opened`}),Qr(t)?sn():Zt(),u?.(t,`done`),!0},Pn=async(e,t,n)=>!st||dn!==null?!1:(fn(e),Nn(e,t,n)),Fn=async(t,n)=>!st||dn!==null?{commentPosted:!1}:(fn(n),(await un({environmentId:e,input:{...j,body:t}}))._tag===`Failure`?(fn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Nn(n)||Zt(),{commentPosted:!0})),In=async t=>{let n=t.trim();if(!st||X===null||vn)return;if(n.length===0||n===X.title){gn(null);return}yn(!0);let r=await mn({environmentId:e,input:{...j,title:n}});if(yn(!1),r._tag===`Failure`){yt.add({type:`error`,title:`The title could not be saved`,description:li(Ge(r),`The host refused the new title.`)});return}gn(null),Zt()},Ln=h??null,Rn=Mn.isAllowed&&jn,zn=Ln!==null||Rn,Bn=di(Ln!==null),Vn=hd({environmentId:e,reference:j,title:X?.title??null}),Hn=()=>{Vn.write(),Vn.data?.guide??se(`guide`)},Wn=(e,t)=>{let n=m.getState(),r=n.getComposerDraft(e),i=Dd(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=ci(r?.prompt??``,r?.reviewComments??[],o),c=Ni({prompt:s,lastHandoffPrompt:Ed.get(i)},t.prompt);Ed.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,Ii(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Gn=async(e,t,n)=>{let r=n??await bn(e).then(e=>e,()=>null);return r===null?null:(t===null||Wn(r.draftId,t),r)},Kn=async(t,n,r)=>{if(!X||at!==null)return;if(Ln!==null){Wn(Ln,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}ot(t);let i=D(kn,On?.projectId??X.projectId),a=await Gn(i,n);if(ot(null),a!==null&&r?.keepGuide===!0){let t=m.getState().getDraftSession(a.draftId);t!==null&&(jt.getState().openPullRequest(R(t.environmentId,t.threadId),{environmentId:e,projectId:j.projectId,...j.host===void 0?{}:{host:j.host},repository:j.repository,number:j.number,url:X.url}),Ui.getState().requestOpen(Gi(e,j)))}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.`})},qn=async(e,t,n=`worktree`)=>{if(!Nt||at!==null)return;if(Ln!==null&&t!==null){Wn(Ln,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(An===null||!Mn.isAllowed||!Ot(kn,`source-control:write`)||n===`worktree`&&!Ot(kn,`orchestration:operate`))return;ot(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=D(kn,On?.projectId??Nt.projectId),a=await bn(i).then(e=>e,()=>null);if(a===null){ot(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 Mn.run({reference:Nt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){ot(null);let e=Mn.error instanceof Error?Mn.error.message:null;yt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await bn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){ot(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}ot(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 Gn(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)},Jn=()=>{X&&Kn(`ask`,{...ki({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Yn=()=>{X&&Kn(`explain`,{...ji({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft})})},Xn=(e,t,n)=>{X&&Kn(`guide-stop:${t}`,yi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},Zn=(e,t)=>{X&&Kn(`selection:${e.comment.id}`,Ti({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,state:X.state,isDraft:X.isDraft,comment:e.comment,request:e.request}),t)},Qn=e=>{Nt&&qn(`checkout:${e}`,null,e)},$n=e=>{X&&qn(ui(e),bi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,finding:e}))},er=()=>{X&&qn(`findings`,Oi({number:X.number,title:X.title,url:X.url,headBranch:X.headBranch,baseBranch:X.baseBranch,reviewThreads:X.reviewThreads,comments:X.comments,checks:Tr?[]:X.checks,commentsTruncated:X.commentsTruncated}))},tr=()=>{Nt&&qn(`conflicts`,{prompt:Si({number:Nt.number,url:Nt.url,headBranch:Nt.headBranch,baseBranch:Nt.baseBranch})})},nr=X?X.capabilities.mergeMethods.filter(e=>X.mergeCapabilities[e]):[],rr=tt?.pullRequestKey===N?tt.method:null,ir=$r(nr,rr,$e,qe),ar=Mi[ir],or=`Auto-merge (${ar.toLowerCase()})`,sr=X?.state===`open`&&X.mergeability===`conflicting`,cr=X?.state===`open`&&X.autoMergeEnabled===!0,dr=X?.autoMergeMethod,fr=dr?`Auto-merge (${Mi[dr].toLowerCase()})`:`Auto-merge`,pr=X?.state===`open`?X.workflowApprovalsRequired??0:0,mr=X===null?null:pi(X),hr=Tt(e,e=>e.reviewGuidesEnabled),gr=Cd.filter(e=>(e.value!==`code`||X===null||X.capabilities.diff)&&(e.value!==`guide`||hr));(0,Z.useEffect)(()=>{gr.some(e=>e.value===W)||se(`summary`)},[W,gr]);let _r=e=>X?.capabilities.actions.includes(e)===!0&&X.viewerPermissions.actions.includes(e),vr=X?Er(X.checks):null,Sr=vt?.checksState===void 0?vr:vt.checksState,Cr=Sr!==`failing`&&X?.checks.some(e=>e.status===`action-required`)?`pending`:Sr,Tr=Cr!==vr,Dr=X?gi({state:X.state,isDraft:X.isDraft,mergeability:X.mergeability,checksState:Cr,autoMergeEnabled:X.autoMergeEnabled,hasMergeMethod:nr.length>0,canMerge:Jt&&_r(`merge`),canMarkReady:_r(`ready`),canEnableAutoMerge:Jt&&_r(`enable-auto-merge`)}):null,kr=X?.state===`open`&&_r(X.isDraft?`ready`:`draft`)&&!(X.isDraft&&Dr===`ready`),jr=Jt&&X?.state===`open`&&(cr&&_r(`disable-auto-merge`)||!cr&&Dr!==`enable-auto-merge`&&!X.isDraft&&!sr&&_r(`enable-auto-merge`)&&nr.length>0),Mr=Jt&&X?.state===`open`&&(Dr===`enable-auto-merge`||Dr===`auto-merge-armed`)&&_r(`merge`)&&!X.isDraft&&!sr&&nr.length>0,Nr=X?.state===`open`&&_r(`merge`)&&!X.isDraft&&!sr&&nr.length>1,Lr=X?yr({state:X.state,isDraft:X.isDraft}):null,zr=pr>0&&!Tr&&_r(`approve-workflows`),Br=Tr?Cr===null?`No checks reported`:wr(Cr).label:X?Pr(X.checks):null,Ur=X&&!X.commentsTruncated?Pi(X.comments,X.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,qr=p===`page`?(0,$.jsxs)(v,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(ke,{disabled:at!==null||An===null,render:(0,$.jsxs)(G,{size:`xs`,variant:`outline`,"aria-label":at?.startsWith(`checkout`)?`Checking out...`:`Check out`,children:[(0,$.jsx)(re,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[35rem]/pr-header:hidden`,children:at?.startsWith(`checkout`)?`Checking out...`:`Check out`}),(0,$.jsx)(a,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(J,{children:`Check out this pull request`})]}),(0,$.jsxs)(ae,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(U,{disabled:!Rn,onClick:()=>Qn(`worktree`),children:[(0,$.jsx)(re,{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:!Mn.isAllowed,onClick:()=>Qn(`local`),children:[(0,$.jsx)(te,{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`."})]})]}),Cn.length>0?(0,$.jsx)(Od,{environments:Cn,value:kn,onChange:e=>Tn({pullRequestKey:N,environmentId:e}),disabled:at!==null}):null]})]}):null,Jr=(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`destructive-outline`,disabled:at!==null||Ln===null&&An===null,onClick:tr,"aria-label":at===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(Rr.conflicting,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:at===`conflicts`?`Preparing...`:`Resolve conflicts`})]})})}),(0,$.jsx)(J,{side:`top`,children:at===`conflicts`?`Preparing...`:`Resolve conflicts`})]});return lt.isPending&&!X?(0,$.jsx)(dl,{seed:F,summary:vt,checkoutCommand:Vt,onCheckoutError:Ht,number:j.number,tabs:gr,activeTab:W,..._?{onBack:_}:{},...d?{onClose:d}:{},actions:Nt?(0,$.jsxs)(ct,{delay:150,closeDelay:150,timeout:400,children:[Nt.state===`open`&&Nt.mergeability===`conflicting`?Jr:null,qr]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[B&&X?(0,$.jsx)(Yc,{display:`picker`,environmentId:e,reference:j,url:X.url,threadRef:null,onPickerOpenChange:V},`${e}:${X.url}`):null,(0,$.jsxs)(`div`,{className:K(`@container/pr-header grid min-w-0 shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2`,X&&`border-b border-border/60`,!X&&!d&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":Ie,inert:Ie,className:K(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,Ie?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:X&&Lr?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,onClick:_,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ye,{"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:Lt?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(Lt),className:`min-w-0 cursor-pointer truncate text-left font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:X.repository}):(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:X.repository})}),(0,$.jsx)(J,{side:`top`,children:Lt?`Open ${X.repository} repository`:X.repository})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Ct()?.shell.openExternal(X.url),onContextMenu:e=>kd(e,X),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Lr.toneClassName),"aria-label":`Open pull request #${X.number} on host`,children:[`#`,X.number,(0,$.jsx)(ve,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:xl(Rt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!Ie,inert:!Ie,className:K(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,Ie?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:X&&Lr?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:Ie?0:-1,onClick:_,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ye,{"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:Ie?0:-1,onClick:()=>void Ct()?.shell.openExternal(X.url),onContextMenu:e=>kd(e,X),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Lr.toneClassName),"aria-label":`Open pull request #${X.number} on host`,children:[`#`,X.number,(0,$.jsx)(ve,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:xl(Rt)})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:X.title})}),(0,$.jsx)(J,{side:`top`,children:X.title})]})]}):null})]}),(0,$.jsxs)(`div`,{className:`mr-4 flex h-7 shrink-0 items-center justify-end gap-1`,children:[X?(0,$.jsxs)(ct,{delay:150,closeDelay:150,timeout:400,children:[!Kt&&qt&&Gt.error?(0,$.jsx)(G,{variant:`ghost`,size:`xs`,onClick:Gt.refresh,children:`Retry stack lookup`}):null,Kt?(0,$.jsx)(Rc,{hostLabel:Rt.label,stack:Kt,notice:Gt.notice,onRetry:Gt.error?Gt.refresh:void 0,reference:j,environmentId:e,onSelect:y,mergeMethod:ir,canMerge:Gt.isFresh&&qt&&_r(`merge`)&&nr.length>0,canRebase:Gt.isFresh&&qt&&X.viewerPermissions.stackRebase===!0,onActed:()=>{Zt(),u?.()}}):null,p===`page`?(0,$.jsx)(Yc,{display:`count`,environmentId:e,reference:j,url:X.url,threadRef:null}):null,cr&&Dr!==`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(ne,{size:`control`,variant:`info`,role:`img`,"aria-label":fr,children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:fr})]})}),(0,$.jsxs)(J,{side:`top`,children:[fr,`: the host will merge this on its own once its requirements are met`]})]}):null,Dr===`resolve`?Jr:Dr===`ready`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,onClick:()=>void Pn(`ready`),"aria-label":`Ready for review`,children:[(0,$.jsx)(Rr.pullRequest,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:`Ready for review`})]})})}),(0,$.jsx)(J,{side:`top`,children:`Ready for review`})]}):Dr===`enable-auto-merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,...it.props(`enable-auto-merge`,()=>void Pn(`enable-auto-merge`,ir)),"aria-label":dn===`enable-auto-merge`?`Enabling...`:it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:or,children:[it.isArmed(`enable-auto-merge`)?(0,$.jsx)(I,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Sc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:or}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:dn===`enable-auto-merge`?`Enabling...`:it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:or})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:dn===`enable-auto-merge`?`Enabling...`:it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:or})]}):Dr===`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(ne,{size:`control`,variant:`info`,role:`img`,"aria-label":fr,children:[(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:fr})]})}),(0,$.jsxs)(J,{side:`top`,children:[fr,`: the host will merge this on its own once its requirements are met`]})]}):Dr===`merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,...it.props(`merge`,()=>void Pn(`merge`,ir)),"aria-label":dn===`merge`?`Merging...`:it.isArmed(`merge`)?`Confirm merge?`:ar,children:[it.isArmed(`merge`)?(0,$.jsx)(I,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Rr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Sc,{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:ar}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:dn===`merge`?`Merging...`:it.isArmed(`merge`)?`Confirm merge?`:ar})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:dn===`merge`?`Merging...`:it.isArmed(`merge`)?`Confirm merge?`:ar})]}):(Dr===`merged`||Dr===`closed`)&&Lr!==null?(0,$.jsx)(ne,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:K(`flex items-center gap-1`,Lr.toneClassName),children:[(0,$.jsx)(Lr.Icon,{className:`size-3.5`}),Lr.label]})}):null,qr,(0,$.jsxs)(v,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(ke,{render:(0,$.jsx)(G,{"aria-label":on?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:on?(0,$.jsx)(ba,{refreshing:!0,size:`md`}):(0,$.jsx)(Ae,{className:`size-4`})})}),(0,$.jsx)(J,{children:on?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(ae,{align:`end`,side:`bottom`,children:[(0,$.jsx)(Yc,{display:`menu-item`,environmentId:e,reference:j,url:X.url,threadRef:o??(typeof h==`object`?h:null),onPickerOpenChange:V}),(0,$.jsxs)(U,{disabled:on,onClick:()=>void sn(),children:[(0,$.jsx)(ba,{size:`sm`,refreshing:on}),`Refresh`]}),(0,$.jsxs)(U,{disabled:at!==null,onClick:Jn,children:[(0,$.jsx)(x,{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:at===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Ln===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(U,{disabled:at!==null,onClick:Yn,children:[(0,$.jsx)(f,{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:at===`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:at!==null||!zn,onClick:er,children:[(0,$.jsx)(be,{className:`size-3.5`}),at===`findings`?`Preparing...`:Bn.fixFindings]}),hr&&Vn.canWrite?(0,$.jsxs)(U,{disabled:Vn.running,onClick:Hn,children:[(0,$.jsx)(b,{className:`size-3.5`}),Vn.running?`Writing guide...`:Vn.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,Cn.length>0?(0,$.jsx)(Od,{environments:Cn,value:kn,onChange:e=>Tn({pullRequestKey:N,environmentId:e}),disabled:at!==null}):null,(0,$.jsx)(Le,{}),X.state===`open`?(0,$.jsxs)($.Fragment,{children:[kr?(0,$.jsxs)(U,{disabled:pn,onClick:()=>void Pn(X.isDraft?`ready`:`draft`),children:[X.isDraft?(0,$.jsx)(Rr.pullRequest,{className:`size-3.5`}):(0,$.jsx)(Rr.draft,{className:`size-3.5`}),X.isDraft?`Ready for review`:`Convert to draft`]}):null,Mr?(0,$.jsxs)(U,{closeOnClick:it.isArmed(`merge`),"aria-label":it.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:pn,...it.props(`merge`,()=>void Pn(`merge`,ir)),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),it.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,cr&&_r(`disable-auto-merge`)?(0,$.jsxs)(U,{disabled:pn,onClick:()=>void Pn(`disable-auto-merge`),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),`Disable auto-merge`]}):jr?(0,$.jsxs)(U,{closeOnClick:it.isArmed(`enable-auto-merge`),"aria-label":it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`,disabled:pn,...it.props(`enable-auto-merge`,()=>void Pn(`enable-auto-merge`,ir)),children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),it.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Nr?(0,$.jsxs)($.Fragment,{children:[kr||Mr||jr?(0,$.jsx)(Le,{}):null,(0,$.jsx)(P,{value:ir,onValueChange:e=>{let t=e;rt(t),Je(t)},children:nr.map(e=>(0,$.jsx)(i,{value:e,disabled:pn,closeOnClick:!0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Rr.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Mi[e]})]})},e))})]}):null,Di(kr,jr||Mr,Nr)?(0,$.jsx)(Le,{}):null]}):null,(0,$.jsxs)(U,{onClick:()=>void Ct()?.shell.openExternal(X.url),children:[(0,$.jsx)(S,{className:`size-3.5`}),xl(Rt)]}),(0,$.jsxs)(U,{onClick:()=>Ft(X.url,`PR link`),children:[(0,$.jsx)(Ue,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(Te,{children:ur(Pt,`thread.copyReference`)})]}),(0,$.jsxs)(U,{onClick:()=>Ft(`#${j.number}`,`PR number`),children:[(0,$.jsx)(z,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(Te,{children:ur(Pt,`pullRequest.copyNumber`)})]}),X.state===`open`&&_r(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{}),(0,$.jsxs)(U,{closeOnClick:it.isArmed(`close`),"aria-label":it.isArmed(`close`)?`Confirm close?`:`Close pull request`,variant:`destructive`,disabled:pn,...it.props(`close`,()=>void Pn(`close`)),children:[(0,$.jsx)(Rr.closed,{className:`size-3.5`}),it.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):X.state===`closed`&&_r(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{}),(0,$.jsxs)(U,{disabled:pn,onClick:()=>void Pn(`reopen`),children:[(0,$.jsx)(Rr.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):X.state===`merged`&&_r(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{}),(0,$.jsxs)(U,{closeOnClick:it.isArmed(`revert`),"aria-label":it.isArmed(`revert`)?`Confirm revert?`:`Revert changes`,variant:it.isArmed(`revert`)?`destructive`:`default`,disabled:pn,...it.props(`revert`,()=>void Pn(`revert`)),children:[(0,$.jsx)(g,{className:`size-3.5`}),it.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null]})]})]}):null,d?(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:d,children:(0,$.jsx)(ce,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Ie?`grid-rows-[1fr]`:`grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:He,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Ie?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!Ie,children:X?(0,$.jsx)(`div`,{className:`col-span-2 min-w-0 px-4 pb-2 pt-1`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 shrink items-center gap-1.5 overflow-hidden text-xs text-muted-foreground`,children:[(0,$.jsx)(Ar,{actor:X.author,profileUrl:Bt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:En(X.updatedAt)})]}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-3 w-px shrink-0 bg-border/70`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 font-mono text-2xs text-muted-foreground/65`,children:[mr?(0,$.jsxs)(Ad,{baseBranch:X.baseBranch,freshness:mr,pending:pn,onUpdate:e=>void Pn(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Wt?`Stacked on ${X.baseBranch}`:X.baseBranch})]}),(0,$.jsx)(ye,{"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:X.headBranch,showTitle:!1})})}),(0,$.jsx)(J,{side:`top`,children:X.headBranch})]})]}),(0,$.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center justify-end gap-2 text-2xs`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 tabular-nums`,"aria-label":`${X.changedFiles.toLocaleString()} changed ${X.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(A,{"aria-hidden":!0,className:`size-3`}),X.changedFiles.toLocaleString()]}),(0,$.jsx)(Or,{additions:X.additions,deletions:X.deletions,className:`shrink-0 font-mono text-2xs`})]})]})}):null})}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Ie?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ve,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Ie?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:Ie,children:X?(0,$.jsx)(el,{title:_n===null?(0,$.jsxs)(tl,{className:`group gap-1`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold leading-snug`,children:X.title})}),(0,$.jsx)(J,{side:`top`,children:X.title})]}),bs(X)?(0,$.jsx)(Cs,{"aria-label":`Edit title`,onClick:()=>gn({pullRequestKey:N,text:X.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Un,{autoFocus:!0,size:`sm`,disabled:vn,value:_n,"aria-label":`Pull request title`,onChange:e=>gn({pullRequestKey:N,text:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),In(_n)):e.key===`Escape`&&(e.preventDefault(),gn(null))}}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(G,{size:`xs`,variant:`ghost`,disabled:vn,onClick:()=>gn(null),children:`Cancel`}),(0,$.jsx)(G,{size:`xs`,variant:`outline`,disabled:!st||vn||_n.trim().length===0,onClick:()=>void In(_n),children:vn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(Ar,{actor:X.author,profileUrl:Bt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,En(X.updatedAt)]}),checkout:Vt?(0,$.jsx)(il,{value:Vt,target:`pull request checkout command`,copyLabel:`Copy checkout command`,copiedLabel:`Checkout command copied`,className:`ml-auto font-mono`,tooltipSide:`bottom`,onError:Ht},Vt):null,base:mr?(0,$.jsxs)(Ad,{baseBranch:X.baseBranch,freshness:mr,pending:pn,onUpdate:e=>void Pn(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Wt?(0,$.jsx)(Rr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(_a,{value:X.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Wt?`Stacked on ${X.baseBranch}`:X.baseBranch})]}),head:(0,$.jsx)(il,{value:X.headBranch,target:`branch name`,copyLabel:`Copy pull request branch`,copiedLabel:`Branch name copied`},X.headBranch),files:`${X.changedFiles.toLocaleString()} ${X.changedFiles===1?`file`:`files`}`,diffStat:(0,$.jsx)(Or,{additions:X.additions,deletions:X.deletions,className:`shrink-0 font-mono text-xs`})}):null})}),X?(0,$.jsx)(nl,{tabs:gr,value:W,onValueChange:se,onTabIntent:e=>{e===`code`&&wd()},children:W===`summary`?zr?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`ml-auto inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`warning-outline`,disabled:pn,...it.props(`approve-workflows`,()=>void Pn(`approve-workflows`)),"aria-label":dn===`approve-workflows`?`Approving...`:it.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`,children:[(0,$.jsx)(Ce,{"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:dn===`approve-workflows`?`Approving...`:it.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]})]})})}),(0,$.jsx)(J,{side:`top`,children:dn===`approve-workflows`?`Approving...`:it.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]}):(0,$.jsx)(rl,{className:`text-muted-foreground`,"aria-label":Br?`Checks: ${Br}`:`Checks`,icon:Cr===null?(0,$.jsx)(Be,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Nu,{checks:X.checks,stale:Tr,checksState:Cr,threadRef:o}),label:Br}):W===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(br,{className:K(`whitespace-nowrap text-2xs transition-opacity`,(Yt||Xt)&&`opacity-35`),children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Xt?`Comments unavailable`:`${X.commentCount.toLocaleString()} ${X.commentCount===1?`comment`:`comments`}`,children:[(0,$.jsx)(L,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:X.commentCount.toLocaleString()]}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Xt?`Commits unavailable`:`${X.commits.length.toLocaleString()} ${X.commits.length===1?`commit`:`commits`}`,children:[(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:X.commits.length.toLocaleString()]}),Ur>0?(0,$.jsxs)(`span`,{className:K(`inline-flex items-center gap-1`,Fr(`approved`)),children:[(0,$.jsx)(xr,{outcome:`approved`,className:`size-3`}),Ur.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:Ur===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(G,{size:`xs`,variant:`ghost-muted`,"aria-label":le===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>ue(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(M,{"aria-hidden":!0,className:`size-3`}),le===`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=Re.current[W];if(e.target!==t||t==null)return;let n=t.scrollTop;Pe(e=>{let r=e,i=Ve.current?.scrollHeight??0,a=i-(He.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(We.current={tab:W,scroller:t,delta:-a},r=!0),Fe.current[W]=r,r})},children:lt.error&&!X?(0,$.jsx)(bl,{...Fi(lt.failure)?{title:`Pull request #${j.number} not found`,error:`It may be an issue rather than a pull request, or this account can't see it.`}:{error:lt.error},refreshing:lt.isPending,onRetry:Zt,...Sn?{gitHubUrl:Sn}:{}}):X?(0,$.jsxs)(Ws,{value:zt,children:[Me.has(`summary`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`summary`&&`invisible`),children:(0,$.jsx)(iu,{scrollerRef:ze.summary,environmentId:e,threadRef:o,reference:j,detail:X,activityPending:Yt,checksStale:Tr,activityError:Xt,pendingFinding:at,fixFindingLabel:Bn.fixFinding,fixCheckLabel:Bn.fixCheck,...zn?{onFixFinding:$n}:{},onRefresh:Zt,onRefreshChecks:sn})}):null,Me.has(`guide`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`guide`&&`invisible`),children:(0,$.jsx)(gd,{environmentId:e,reference:j,active:W===`guide`,title:X.title,workspaceRoot:X.workspaceRoot,canComment:X.capabilities.review.inlineComment&&X.viewerPermissions.comment,onAskAboutLines:(e,t)=>Zn({comment:e,request:t},{keepGuide:!0}),onAskAboutStop:Xn,onFinishReview:X.capabilities.review.verdicts.some(e=>X.viewerPermissions.verdicts.includes(e))?()=>oe(e=>e+1):null,onOpenFile:Se,onTourShown:C})}):null,Me.has(`timeline`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`timeline`&&`invisible`),children:Yt?(0,$.jsx)(hl,{}):Xt?(0,$.jsx)(yl,{error:Xt,onRetry:ut.refresh}):(0,$.jsx)(Du,{scrollerRef:ze.timeline,detail:X,environmentId:e,threadRef:o,reference:j,order:le,onOpenCommit:he,onRefresh:Zt})}):null,Me.has(`code`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,W!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(jo,{label:`Loading pull request diff...`}),children:(0,$.jsx)(Td,{scrollerRef:ze.code,onAddToAgentSelection:Zn,environmentId:e,reference:j,detail:X,selectedCommitOid:pe,onSelectedCommitChange:me,pendingFinding:at,fixFindingLabel:Bn.fixFinding,...zn?{onFixFinding:$n}:{},onRefresh:Zt,refreshToken:en,revealRequest:_e})})}):null]}):null}),X?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(Ml,{environmentId:e,reference:j,detail:X,actionPending:pn,onCommentAction:Fn,onCommented:Zt,onReviewSubmitted:Zt,openReviewRequest:ee},JSON.stringify([e,j.projectId,j.host,j.repository,j.number]))}):null]})}function Md(e){let t=(0,Q.c)(36),{entry:n,hostActions:r,visible:i,onActed:a,closing:o,sweeping:s,onCloseSweepStart:c}=e,l=o!==void 0&&o,u=s!==void 0&&s,d;t[0]===n.environmentId?d=t[1]:(d=Gr.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=d);let f=H(d),p=Ca(n.environmentId,n.projectId),m;t[2]!==n.host||t[3]!==n.number||t[4]!==n.projectId||t[5]!==n.repository?(m={projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},t[2]=n.host,t[3]=n.number,t[4]=n.projectId,t[5]=n.repository,t[6]=m):m=t[6];let h=m,g;t[7]!==n||t[8]!==a?(g=e=>a?.({entry:n,action:e}),t[7]=n,t[8]=a,t[9]=g):g=t[9];let _;t[10]===p?_=t[11]:(_=e=>{let t=e.capabilities.mergeMethods.filter(t=>e.mergeCapabilities[t]);if(t.length===0)throw Error(`No merge method is available for this repository.`);return $r(t,null,p(),Yi.getState().pullRequestMergeMethod)},t[10]=p,t[11]=_);let v;t[12]!==n.environmentId||t[13]!==h||t[14]!==g||t[15]!==_?(v={environmentId:n.environmentId,reference:h,onSuccess:g,resolveMergeMethod:_},t[12]=n.environmentId,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let{actionPending:y,perform:b}=Ta(v),x,S;if(t[17]!==y||t[18]!==f||t[19]!==l||t[20]!==n||t[21]!==r||t[22]!==c||t[23]!==b||t[24]!==u||t[25]!==i){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Ur(n,r),a=y||l||u;if(e.length===0){S=null;break bb0}let o=i||a?`flex`:`none`,s;t[28]===o?s=t[29]:(s={display:o},t[28]=o,t[29]=s);let d;t[30]!==a||t[31]!==f||t[32]!==n||t[33]!==c||t[34]!==b?(d=e=>{let t=Nd[e].label,r=Nd[e].Icon;return(0,$.jsxs)(Y,{children:[(0,$.jsxs)(q,{render:(0,$.jsx)(G,{variant:e===`close`?`destructive-outline`:`outline`,size:`xs`,disabled:!f||a||e===`merge`&&n.stack!==void 0,"aria-label":`${t} #${n.number}`,onClick:()=>void b(e),onPointerDown:t=>{e===`close`&&t.isPrimary&&t.button===0&&(t.stopPropagation(),c?.(n,t.nativeEvent))}}),children:[a?(0,$.jsx)(vt,{size:`xs`}):(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),t]}),(0,$.jsx)(J,{children:e===`merge`&&n.stack?`Open this pull request to merge its stack`:e===`close`&&c?`Close immediately, or drag across rows to close several`:`${t} immediately`})]},e)},t[30]=a,t[31]=f,t[32]=n,t[33]=c,t[34]=b,t[35]=d):d=t[35],x=(0,$.jsx)(`div`,{className:`shrink-0 items-center gap-1 pr-3`,style:s,role:`group`,"aria-label":`Quick actions for pull request #${n.number}`,"data-pull-request-action-pending":y||l,children:e.map(d)})}t[17]=y,t[18]=f,t[19]=l,t[20]=n,t[21]=r,t[22]=c,t[23]=b,t[24]=u,t[25]=i,t[26]=x,t[27]=S}else x=t[26],S=t[27];return S===Symbol.for(`react.early_return_sentinel`)?x:S}var Nd={close:{label:`Close`,Icon:Rr.closed},merge:{label:`Merge`,Icon:Rr.merged},ready:{label:`Ready for review`,Icon:Rr.pullRequest},reopen:{label:`Reopen`,Icon:Rr.reopen}},Pd=`group/pr-row flex w-full items-center gap-2 rounded-md py-1 pr-1 text-left`,Fd=`shrink-0 font-mono text-xs tabular-nums text-muted-foreground`;function Id(e){let t=(0,Q.c)(23),{state:n,isDraft:r,mergeability:i,baseBranch:a,below:o,className:s}=e,c;t[0]===s?c=t[1]:(c=K(`flex w-4 shrink-0 flex-col items-center gap-0.5`,s),t[0]=s,t[1]=c);let l;t[2]!==r||t[3]!==n?(l=(0,$.jsx)(Sr,{state:n,isDraft:r}),t[2]=r,t[3]=n,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{mergeability:i},t[5]=i,t[6]=u);let d;t[7]===a?d=t[8]:(d=a===void 0?{}:{baseBranch:a},t[7]=a,t[8]=d);let f;t[9]!==r||t[10]!==n||t[11]!==u||t[12]!==d?(f=(0,$.jsx)(`span`,{className:`absolute -right-1 -bottom-1 inline-flex`,children:(0,$.jsx)(vr,{state:n,isDraft:r,...u,...d,className:`size-3 fill-background [stroke-width:2.5]`})}),t[9]=r,t[10]=n,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]!==l||t[15]!==f?(p=(0,$.jsxs)(`span`,{className:`relative inline-flex`,children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16];let m;t[17]===o?m=t[18]:(m=o?(0,$.jsx)(`span`,{className:`inline-flex text-2xs`,children:o}):null,t[17]=o,t[18]=m);let h;return t[19]!==c||t[20]!==p||t[21]!==m?(h=(0,$.jsxs)(`span`,{className:c,children:[p,m]}),t[19]=c,t[20]=p,t[21]=m,t[22]=h):h=t[22],h}function Ld(e){let t=(0,Q.c)(22),{number:n,title:r,status:i,signals:a,meta:o,metaClassName:s,updatedAt:c}=e,l;t[0]===r?l=t[1]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm`,children:r}),t[0]=r,t[1]=l);let u;t[2]===a?u=t[3]:(u=a?(0,$.jsx)(`span`,{className:`flex shrink-0 items-center gap-1 text-2xs`,children:a}):null,t[2]=a,t[3]=u);let d;t[4]===i?d=t[5]:(d=i?(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-2xs`,children:i}):null,t[4]=i,t[5]=d);let f;t[6]!==n||t[7]!==l||t[8]!==u||t[9]!==d?(f=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[n,l,u,d]}),t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===s?p=t[12]:(p=K(`flex min-w-0 items-center gap-1.5 overflow-hidden text-2xs text-muted-foreground`,s),t[11]=s,t[12]=p);let m;t[13]===c?m=t[14]:(m=c?(0,$.jsx)(`span`,{className:`ml-auto shrink-0 whitespace-nowrap tabular-nums`,children:En(c)}):null,t[13]=c,t[14]=m);let h;t[15]!==o||t[16]!==p||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:p,children:[o,m]}),t[15]=o,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==f||t[20]!==h?(g=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,h]}),t[19]=f,t[20]=h,t[21]=g):g=t[21],g}function Rd(e){let t=(0,Q.c)(20),{actor:n,className:r,labelClassName:i}=e,a=n?.login??`ghost`,o;t[0]===r?o=t[1]:(o=K(`inline-flex min-w-0 items-center gap-1`,r),t[0]=r,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,$.jsx)(`span`,{className:o}),t[2]=o,t[3]=s);let c;t[4]===n?c=t[5]:(c=(0,$.jsx)(Dr,{actor:n,className:`size-3.5`}),t[4]=n,t[5]=c);let l;t[6]===i?l=t[7]:(l=K(`truncate`,i),t[6]=i,t[7]=l);let u;t[8]!==a||t[9]!==l?(u=(0,$.jsx)(`span`,{className:l,children:a}),t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,$.jsxs)(q,{render:s,children:[c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14];let f=n?.name&&n.name!==a?`${n.name} (@${a})`:a,p;t[15]===f?p=t[16]:(p=(0,$.jsx)(J,{side:`top`,children:f}),t[15]=f,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(Y,{children:[d,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function zd(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}function Bd(e){return e!==`touch`}var Vd={browser:`Browser previews are only available in the P4 Code desktop app.`,terminal:`Terminal surfaces are only available from a project thread.`,files:`Files are only available when a project is open.`,diff:`Diff is only available for server threads in Git repositories.`,pullRequest:`This thread's branch has no pull request yet.`,pullRequests:`No linked pull requests are available for this thread.`,device:`Devices are only available from a thread.`},Hd=[`[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(`,`),Ud={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.`},Wd=1,Gd=[ya,ga];function Kd(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function qd(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function Jd(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function Yd(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function Xd(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 Zd(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function Qd(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 $d(e){let t=(0,Q.c)(12),n=e.available?void 0:`data-disabled:pointer-events-auto`,r=!e.available,i;t[0]===e.shortcut?i=t[1]:(i=(0,$.jsx)(Te,{children:e.shortcut}),t[0]=e.shortcut,t[1]=i);let a;t[2]!==e.children||t[3]!==e.onClick||t[4]!==e.shortcut||t[5]!==n||t[6]!==r||t[7]!==i?(a=(0,$.jsxs)(U,{className:n,onClick:e.onClick,disabled:r,"aria-keyshortcuts":e.shortcut,children:[e.children,i]}),t[2]=e.children,t[3]=e.onClick,t[4]=e.shortcut,t[5]=n,t[6]=r,t[7]=i,t[8]=a):a=t[8];let o=a;if(e.available||!e.disabledReason)return o;let s;return t[9]!==o||t[10]!==e.disabledReason?(s=(0,$.jsx)(Qd,{reason:e.disabledReason,trigger:o}),t[9]=o,t[10]=e.disabledReason,t[11]=s):s=t[11],s}function ef(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),i=[{label:`Browser`,icon:Ee,shortcut:`B`,available:e.browserAvailable,disabledReason:Ud.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:Ie,shortcut:`T`,available:e.terminalAvailable,disabledReason:Ud.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:We,shortcut:`F`,available:e.filesAvailable,disabledReason:Ud.files,onClick:e.onAddFiles},{label:`Diff`,icon:A,shortcut:`D`,available:e.diffAvailable,disabledReason:Ud.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:Rr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Ud.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:Rr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Ud.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:u,shortcut:`M`,available:e.deviceAvailable,disabledReason:Ud.device,onClick:e.onAddDevice}],o=i.filter(af),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=Xd(c.current,e);if(!t||document.querySelector(Hd))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&Zd(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=rf,p=e=>s!==-1&&o[s]===e,m=nf,h;t[1]===o?h=t[2]:(h=o.map(tf),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 y=i.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:K(`flex h-10 w-full cursor-pointer items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm transition-colors group-hover:bg-card/60`,p(t)&&`bg-card/60`),children:[m(t,`size-4`),(0,$.jsx)(`span`,{className:K(`min-w-0 flex-1 truncate`,t.label===`Browser`&&e.browserProfiles.length>1&&`pr-8`),children:t.label}),(0,$.jsx)(ua,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(v,{children:[(0,$.jsx)(ke,{render:(0,$.jsx)(G,{"aria-label":`Open browser in a profile`,className:`absolute top-1/2 right-10 -translate-y-1/2`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(a,{className:`size-3.5`})}),(0,$.jsx)(ae,{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)(Qd,{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)(ua,{variant:`pill`,children:t.shortcut})]})},t.label)),b;t[4]===y?b=t[5]:(b=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:y}),t[4]=y,t[5]=b);let x;t[6]!==b||t[7]!==_?(x=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[_,b]}),t[6]=b,t[7]=_,t[8]=x):x=t[8];let S;return t[9]!==f||t[10]!==d||t[11]!==x||t[12]!==g?(S=(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:x}),t[9]=f,t[10]=d,t[11]=x,t[12]=g,t[13]=S):S=t[13],S}function tf(e){return e.shortcut}function nf(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 rf(e){e?.focus()}function af(e){return e.available}function of(e,t,n){switch(e.kind){case`diff`:return`Diff`;case`files`:return`Files`;case`file`:return e.relativePath.slice(Math.max(e.relativePath.lastIndexOf(`/`),e.relativePath.lastIndexOf(`\\`))+1);case`terminal`:return n.get(e.activeTerminalId)??Hi(e.activeTerminalId);case`pull-request`:return`#${e.number}`;case`pull-requests`:return`Pull requests`;case`device`:return e.title??e.target?.name??`Device`;case`preview`:{let n=e.resourceId?t[e.resourceId]:null;if(!n||n.navStatus._tag===`Idle`)return`Browser`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function sf(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)(Ee,{className:`size-3 shrink-0`}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,$.jsx)(ms,{sources:o,fallback:s,className:`size-3 shrink-0 rounded-sm object-contain`}),t[6]=o,t[7]=c),c}function cf(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function lf(e){let t=(0,Q.c)(16),{surface:n,sessions:r,desktopByTabId:i,theme:a,environmentId:o,pullRequestStatusSeeds:s}=e;switch(n.kind){case`preview`:{let e=n.resourceId?r[n.resourceId]:null,a=!e||e.navStatus._tag===`Idle`?null:e.navStatus.url,o=e?i[e.tabId]?.favicon??null:null,s=o&&a&&cf(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(sf,{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)(A,{className:`size-3 shrink-0`}),t[3]=e):e=t[3],e}case`files`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(We,{className:`size-3 shrink-0`}),t[4]=e):e=t[4],e}case`file`:{let e;return t[5]!==n.relativePath||t[6]!==a?(e=(0,$.jsx)(pr,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[5]=n.relativePath,t[6]=a,t[7]=e):e=t[7],e}case`terminal`:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ie,{className:`size-3 shrink-0`}),t[8]=e):e=t[8],e}case`pull-request`:{let e=s?.[n.id],r;return t[9]!==o||t[10]!==n||t[11]!==e?(r=(0,$.jsx)(df,{surface:n,environmentId:o,seed:e}),t[9]=o,t[10]=n,t[11]=e,t[12]=r):r=t[12],r}case`pull-requests`:{let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rr.link,{className:`size-3 shrink-0`}),t[13]=e):e=t[13],e}case`device`:{let e;return t[14]===n.target?.platform?e=t[15]:(e=n.target?.platform===`ios`?(0,$.jsx)(dr,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(fr,{className:`size-3 shrink-0`}):(0,$.jsx)(u,{className:`size-3 shrink-0`}),t[14]=n.target?.platform,t[15]=e),e}}}function uf(e,t,n,r){if(t===null||n===null)return;let i;for(let a of e)if(a.environmentId===t)for(let e of tt(a.pullRequests))$e(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function df(e){let t=(0,Q.c)(11),{surface:n,environmentId:r,seed:i}=e,a=n.environmentId??r,o=Ke(),s=Je(),l;t[0]!==a||t[1]!==n.projectId?(l=e=>e.environmentId===a&&e.id===n.projectId,t[0]=a,t[1]=n.projectId,t[2]=l):l=t[2];let u=o.find(l)?.repositoryIdentity,d=n.host??(u?.provider?c(u,u.provider):null),f=Ye(),p=a===null?void 0:f.get(a)?.environment.capabilities,m=p?.threadPullRequests===!0?uf(s,a,d,n)?.snapshot??null:null,h=kt(a===null||p?.pullRequests!==!0||m!==null?null:Gr.detail({environmentId:a,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=Kr(a,_,null),y=m??Wr(h,v)??i??null;if(y===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rr.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let b=yr({state:y.state,isDraft:y.isDraft??h?.isDraft??i?.isDraft??!1}),x=b.Icon,S=K(`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 ff(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=Qi($i(Zi,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(pf),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)(na,{items:a,strategy:ea,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)(ta,{sensors:r,collisionDetection:ra,modifiers:Gd,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function pf(e){return e.id}function mf(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}=Ji(o),f;t[8]===l?f=t[9]:(f=Xi.Translate.toString(l),t[8]=l,t[9]=f);let p;t[10]!==f||t[11]!==u?(p={transform:f,transition:u},t[10]=f,t[11]=u,t[12]=p):p=t[12];let m=d&&`relative z-10`,h;t[13]!==n||t[14]!==m?(h=K(n,m),t[13]=n,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==s||t[17]!==i||t[18]!==c||t[19]!==p||t[20]!==h?(g=(0,$.jsx)(`div`,{...i,...s,ref:c,style:p,className:h}),t[16]=s,t[17]=i,t[18]=c,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}function hf(e){let t=(0,Q.c)(137),n=Dn&&e.mode===`inline`,r=cr().profiles,{resolvedTheme:i}=wt(),a=(0,Z.useRef)(null),o=(0,Z.useRef)(null),[s,c]=(0,Z.useState)(null),[l,d]=(0,Z.useState)(!1),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=f):f=t[0];let[p,m]=(0,Z.useState)(f),g=e.open!==!1&&e.surfaces.length>0;!g&&l&&d(!1);let _;t[1]!==g||t[2]!==l||t[3]!==e?(_=t=>{if(!(t.defaultPrevented||t.isComposing)&&lr(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&(l||!document.querySelector(Hd))&&(t.preventDefault(),t.stopPropagation(),!t.repeat)){if(!g){document.querySelector(`[data-surface-launcher-keys]`)?.focus();return}o.current?.focus(),d(!0)}},t[1]=g,t[2]=l,t[3]=e,t[4]=_):_=t[4];let y=(0,Z.useEffectEvent)(_),b;t[5]!==y||t[6]!==e.open?(b=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,y,!0),()=>document.removeEventListener(`keydown`,y,!0)},t[5]=y,t[6]=e.open,t[7]=b):b=t[7];let x;t[8]===e.open?x=t[9]:(x=[e.open],t[8]=e.open,t[9]=x),(0,Z.useEffect)(b,x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{let e=Kd(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Wd,n=t&&e.scrollLeft>Wd,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Wd;m(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[10]=S):S=t[10];let C=S,w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{let t=Kd(a.current);if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollBy({left:e*Math.max(120,t.clientWidth*.75),behavior:n?`auto`:`smooth`})},t[11]=w):w=t[11];let T=w,E;t[12]!==e.browserAvailable||t[13]!==e.onAddBrowser?(E={label:`Browser`,icon:Ee,shortcut:`B`,available:e.browserAvailable,disabledReason:Vd.browser,onClick:e.onAddBrowser},t[12]=e.browserAvailable,t[13]=e.onAddBrowser,t[14]=E):E=t[14];let D;t[15]!==e.onAddTerminal||t[16]!==e.terminalAvailable?(D={label:`Terminal`,icon:Ie,shortcut:`T`,available:e.terminalAvailable,disabledReason:Vd.terminal,onClick:e.onAddTerminal},t[15]=e.onAddTerminal,t[16]=e.terminalAvailable,t[17]=D):D=t[17];let O;t[18]!==e.filesAvailable||t[19]!==e.onAddFiles?(O={label:`Files`,icon:We,shortcut:`F`,available:e.filesAvailable,disabledReason:Vd.files,onClick:e.onAddFiles},t[18]=e.filesAvailable,t[19]=e.onAddFiles,t[20]=O):O=t[20];let k;t[21]!==e.diffAvailable||t[22]!==e.onAddDiff?(k={label:`Diff`,icon:A,shortcut:`D`,available:e.diffAvailable,disabledReason:Vd.diff,onClick:e.onAddDiff},t[21]=e.diffAvailable,t[22]=e.onAddDiff,t[23]=k):k=t[23];let j;t[24]!==e.onAddPullRequest||t[25]!==e.pullRequestAvailable?(j={label:`Pull request`,icon:Rr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Vd.pullRequest,onClick:e.onAddPullRequest},t[24]=e.onAddPullRequest,t[25]=e.pullRequestAvailable,t[26]=j):j=t[26];let M;t[27]!==e.onAddPullRequests||t[28]!==e.pullRequestsAvailable?(M={label:`Linked pull requests`,icon:Rr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Vd.pullRequests,onClick:e.onAddPullRequests},t[27]=e.onAddPullRequests,t[28]=e.pullRequestsAvailable,t[29]=M):M=t[29];let N;t[30]!==e.deviceAvailable||t[31]!==e.onAddDevice?(N={label:`Device`,icon:u,shortcut:`M`,available:e.deviceAvailable,disabledReason:Vd.device,onClick:e.onAddDevice},t[30]=e.deviceAvailable,t[31]=e.onAddDevice,t[32]=N):N=t[32];let P;t[33]!==j||t[34]!==M||t[35]!==N||t[36]!==E||t[37]!==D||t[38]!==O||t[39]!==k?(P=[E,D,O,k,j,M,N],t[33]=j,t[34]=M,t[35]=N,t[36]=E,t[37]=D,t[38]=O,t[39]=k,t[40]=P):P=t[40];let F=P,I;t[41]===F?I=t[42]:(I=e=>{let t=Xd(F,e.nativeEvent);t&&(e.preventDefault(),e.stopPropagation(),d(!1),t.onClick())},t[41]=F,t[42]=I);let L=I,R;t[43]===e?R=t[44]:(R=async(t,n)=>{t.preventDefault(),t.stopPropagation();let r=Ct();if(!r)return;let i=e.surfaces.findIndex(e=>e.id===n.id);if(i<0)return;let a=[];n.kind===`device`&&e.onRenameDevice&&a.push({id:`rename`,label:`Rename`}),n.kind===`file`&&n.attachment===void 0&&a.push({id:`copy-path`,label:`Copy path`});let o=qd(n,e.previewSessions),s=o?e.desktopByTabId[o]??null:null,l=s?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...Jd({overlay:s,canResolveRuntimeTabId:e.previewRuntimeTabId!==void 0})}),a.push({id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:e.surfaces.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:i>=e.surfaces.length-1},{id:`close-all`,label:`Close all`,disabled:e.surfaces.length===0});let u=await r.contextMenu.show(a,{x:t.clientX,y:t.clientY});bb136:switch(u){case`rename`:c(n.id);break bb136;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb136;case`toggle-mute`:{let t=o&&s?e.previewRuntimeTabId?.(o)??null:null;t&&va?.setAudioMuted(t,!l).catch(yf);break bb136}case`close`:e.onCloseSurface(n);break bb136;case`close-others`:e.onCloseOtherSurfaces(n);break bb136;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb136;case`close-all`:e.onCloseAllSurfaces();break bb136}},t[43]=e,t[44]=R);let z=R,B=vf,V;t[45]===e?V=t[46]:(V=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[45]=e,t[46]=V);let H=V,ee,te;t[47]!==e.activeSurfaceId||t[48]!==p.hasOverflow?(ee=()=>{e.activeSurfaceId&&p.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},te=[e.activeSurfaceId,p.hasOverflow],t[47]=e.activeSurfaceId,t[48]=p.hasOverflow,t[49]=ee,t[50]=te):(ee=t[49],te=t[50]),(0,Z.useEffect)(ee,te);let ne,re;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ne=()=>{let e=Kd(a.current);if(!e)return;let t=e.firstElementChild,n=ar(t?[e,t]:e,C);return e.addEventListener(`scroll`,C,{passive:!0}),C(),()=>{n(),e.removeEventListener(`scroll`,C)}},re=[C],t[51]=ne,t[52]=re):(ne=t[51],re=t[52]),(0,Z.useEffect)(ne,re);let ie,oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{let e=Kd(a.current);if(!e)return;let t=t=>{if(t.ctrlKey)return;let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=16),t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=e.clientWidth),n===0)return;let r=e.scrollLeft;e.scrollLeft+=n,e.scrollLeft!==r&&(t.preventDefault(),C())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},oe=[C],t[53]=ie,t[54]=oe):(ie=t[53],oe=t[54]),(0,Z.useEffect)(ie,oe);let se=e.mode,ce;t[55]===e.maximized?ce=t[56]:(ce=e.maximized===void 0?{}:{maximized:e.maximized},t[55]=e.maximized,t[56]=ce);let ue;t[57]===e.open?ue=t[58]:(ue=e.open===void 0?{}:{open:e.open},t[57]=e.open,t[58]=ue);let de;t[59]===e.widthStorageKey?de=t[60]:(de=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[59]=e.widthStorageKey,t[60]=de);let fe;t[61]===e.defaultWidth?fe=t[62]:(fe=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[61]=e.defaultWidth,t[62]=fe);let pe;t[63]===e.inlineSize?pe=t[64]:(pe=e.inlineSize?{inlineSize:e.inlineSize}:{},t[63]=e.inlineSize,t[64]=pe);let he=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,ge=n&&`drag-region`,ve=n&&`wco:pr-(--workspace-native-controls-inset)`,ye=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)]`,be;t[65]!==he||t[66]!==ge||t[67]!==ve||t[68]!==ye?(be=K(`flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-1 bg-(--app-chrome-background) pl-2`,he,ge,ve,ye),t[65]=he,t[66]=ge,t[67]=ve,t[68]=ye,t[69]=be):be=t[69];let xe=e.surfaces,Se=e.onMoveSurface,Ce;t[70]!==H||t[71]!==z||t[72]!==n||t[73]!==e||t[74]!==s||t[75]!==i?(Ce=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),o=of(t,e.previewSessions,e.terminalLabelsById),l=qd(t,e.previewSessions),u=Yd(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(mf,{surfaceId:t.id,disabled:!e.onMoveSurface||s===t.id,"data-active-tab":r,onMouseDown:B,onAuxClick:e=>H(e,t),onContextMenu:e=>void z(e,t),className:K(`cursor-pointer group/tab flex h-7 w-52 shrink-0 items-center gap-2 rounded-md pr-1 pl-2.5 text-sm transition-colors duration-150`,n&&`[-webkit-app-region:no-drag]`,r?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[(0,$.jsxs)(`span`,{className:`relative flex size-4 shrink-0 items-center justify-center [&_img]:size-3.5 [&_svg]:size-3.5`,children:[(0,$.jsx)(lf,{surface:t,sessions:e.previewSessions,desktopByTabId:e.desktopByTabId,theme:i,environmentId:e.environmentId,pullRequestStatusSeeds:e.pullRequestStatusSeeds}),a?(0,$.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full bg-current`,"aria-hidden":!0}):null]}),u===`none`||!d?null:(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,className:`cursor-pointer flex size-4 shrink-0 items-center justify-center rounded-sm hover:bg-muted`,"aria-label":u===`muted`?`Unmute ${o}`:`Mute ${o}`,onClick:e=>{e.stopPropagation(),va?.setAudioMuted(d,u!==`muted`).catch(_f)},children:(0,$.jsx)(at,{className:`size-3`,icon:u===`muted`?it:nt})})}),(0,$.jsx)(J,{children:u===`muted`?`Unmute tab`:`Mute tab`})]}),s===t.id?(0,$.jsx)(`input`,{"aria-label":`Device tab name`,className:`min-w-0 flex-1 rounded-sm bg-background px-1 outline-none ring-1 ring-inset ring-ring`,defaultValue:o,ref:gf,onBlur:n=>{e.onRenameDevice?.(t.id,n.currentTarget.value),c(null)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=o,e.currentTarget.blur())}}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,onDoubleClick:()=>{t.kind===`device`&&e.onRenameDevice&&c(t.id)},className:`cursor-pointer flex h-full min-w-0 flex-1 items-center`,onClick:()=>e.onActivate(t),children:(0,$.jsx)(`span`,{className:`truncate`,children:o})})}),(0,$.jsx)(J,{children:t.kind===`device`?(0,$.jsx)(bf,{surface:t,environmentId:e.environmentId,title:o}):o})]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close ${o}`,className:K(`cursor-pointer flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-opacity duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 pointer-coarse:opacity-100 motion-reduce:transition-none`,r?`opacity-100`:`opacity-0 group-hover/tab:opacity-100`),onClick:()=>e.onCloseSurface(t),children:(0,$.jsx)(h,{className:`size-3.5`})})]},t.id)}),t[70]=H,t[71]=z,t[72]=n,t[73]=e,t[74]=s,t[75]=i,t[76]=Ce):Ce=t[76];let we;t[77]!==e.onMoveSurface||t[78]!==e.surfaces||t[79]!==Ce?(we=(0,$.jsx)(ff,{surfaces:xe,onMove:Se,children:Ce}),t[77]=e.onMoveSurface,t[78]=e.surfaces,t[79]=Ce,t[80]=we):we=t[80];let De;t[81]!==F||t[82]!==g||t[83]!==l||t[84]!==r||t[85]!==L||t[86]!==e?(De=g?(0,$.jsxs)(v,{open:l,onOpenChange:d,children:[(0,$.jsx)(ke,{ref:o,render:(0,$.jsx)(G,{"aria-label":`Add panel surface`,className:`shrink-0`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(W,{className:`size-4`})}),(0,$.jsx)(ae,{align:`start`,side:`bottom`,sideOffset:6,onKeyDownCapture:L,children:F.map(t=>{let n=t.icon;return t.label===`Browser`&&t.available?(0,$.jsxs)(Ne,{children:[(0,$.jsxs)(le,{className:`[&>svg:last-child]:ms-0`,"aria-keyshortcuts":t.shortcut,onClick:e=>{Bd(`pointerType`in e.nativeEvent&&typeof e.nativeEvent.pointerType==`string`?e.nativeEvent.pointerType:void 0)&&(d(!1),t.onClick())},children:[(0,$.jsx)(n,{}),t.label,(0,$.jsx)(Te,{children:t.shortcut})]}),(0,$.jsx)(_e,{className:`max-w-56`,children:r.map(t=>(0,$.jsx)(U,{onClick:()=>e.onAddBrowserInProfile(t.id),children:(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.name})},t.id))})]},t.label):(0,$.jsxs)($d,{available:t.available,disabledReason:t.disabledReason,shortcut:t.shortcut,onClick:t.onClick,children:[(0,$.jsx)(n,{}),t.label]},t.label)})})]}):null,t[81]=F,t[82]=g,t[83]=l,t[84]=r,t[85]=L,t[86]=e,t[87]=De):De=t[87];let Oe;t[88]!==we||t[89]!==De?(Oe=(0,$.jsx)(Wn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-right-panel-tab-list":!0,children:(0,$.jsxs)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:[we,De]})}),t[88]=we,t[89]=De,t[90]=Oe):Oe=t[90];let Ae;t[91]!==p.canScrollLeft||t[92]!==p.canScrollRight||t[93]!==p.hasOverflow?(Ae=p.hasOverflow?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 [-webkit-app-region:no-drag]`,role:`group`,"aria-label":`Scroll panel tabs`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs left`,disabled:!p.canScrollLeft,onClick:()=>T(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(me,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs left`})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs right`,disabled:!p.canScrollRight,onClick:()=>T(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(Fe,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs right`})]})]}):null,t[91]=p.canScrollLeft,t[92]=p.canScrollRight,t[93]=p.hasOverflow,t[94]=Ae):Ae=t[94];let je;t[95]!==n||t[96]!==e.layoutControls?(je=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[95]=n,t[96]=e.layoutControls,t[97]=je):je=t[97];let Me;t[98]===n?Me=t[99]:(Me=n?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]`}):null,t[98]=n,t[99]=Me);let Pe;t[100]!==e.layoutControls||t[101]!==be||t[102]!==Oe||t[103]!==Ae||t[104]!==je||t[105]!==Me?(Pe=(0,$.jsxs)(`div`,{className:be,"data-right-panel-tabbar":!0,children:[Oe,Ae,e.layoutControls,je,Me]}),t[100]=e.layoutControls,t[101]=be,t[102]=Oe,t[103]=Ae,t[104]=je,t[105]=Me,t[106]=Pe):Pe=t[106];let Le;t[107]!==r||t[108]!==e.activeSurfaceId||t[109]!==e.browserAvailable||t[110]!==e.children||t[111]!==e.deviceAvailable||t[112]!==e.diffAvailable||t[113]!==e.filesAvailable||t[114]!==e.onAddBrowser||t[115]!==e.onAddBrowserInProfile||t[116]!==e.onAddDevice||t[117]!==e.onAddDiff||t[118]!==e.onAddFiles||t[119]!==e.onAddPullRequest||t[120]!==e.onAddPullRequests||t[121]!==e.onAddTerminal||t[122]!==e.pullRequestAvailable||t[123]!==e.pullRequestsAvailable||t[124]!==e.terminalAvailable?(Le=e.activeSurfaceId===null?(0,$.jsx)(ef,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,onAddPullRequest:e.onAddPullRequest,onAddPullRequests:e.onAddPullRequests,onAddDevice:e.onAddDevice,browserAvailable:e.browserAvailable,terminalAvailable:e.terminalAvailable,diffAvailable:e.diffAvailable,filesAvailable:e.filesAvailable,pullRequestAvailable:e.pullRequestAvailable,pullRequestsAvailable:e.pullRequestsAvailable,deviceAvailable:e.deviceAvailable}):e.children,t[107]=r,t[108]=e.activeSurfaceId,t[109]=e.browserAvailable,t[110]=e.children,t[111]=e.deviceAvailable,t[112]=e.diffAvailable,t[113]=e.filesAvailable,t[114]=e.onAddBrowser,t[115]=e.onAddBrowserInProfile,t[116]=e.onAddDevice,t[117]=e.onAddDiff,t[118]=e.onAddFiles,t[119]=e.onAddPullRequest,t[120]=e.onAddPullRequests,t[121]=e.onAddTerminal,t[122]=e.pullRequestAvailable,t[123]=e.pullRequestsAvailable,t[124]=e.terminalAvailable,t[125]=Le):Le=t[125];let Re;t[126]===Le?Re=t[127]:(Re=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:Le}),t[126]=Le,t[127]=Re);let ze;return t[128]!==e.mode||t[129]!==ce||t[130]!==ue||t[131]!==de||t[132]!==fe||t[133]!==pe||t[134]!==Pe||t[135]!==Re?(ze=(0,$.jsxs)(ls,{mode:se,...ce,...ue,...de,...fe,...pe,children:[Pe,Re]}),t[128]=e.mode,t[129]=ce,t[130]=ue,t[131]=de,t[132]=fe,t[133]=pe,t[134]=Pe,t[135]=Re,t[136]=ze):ze=t[136],ze}function gf(e){e?.focus(),e?.select()}function _f(){}function vf(e){e.button===1&&e.preventDefault()}function yf(){}function bf(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=ir(n?e.environmentId:null),i;t[0]!==r||t[1]!==n?(i=n?r.devices.find(e=>e.hostId===n.hostId&&e.id===n.deviceId):void 0,t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=n?r.hosts.find(e=>e.id===n.hostId):void 0,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===e.title?c=t[7]:(c=(0,$.jsx)(`span`,{children:e.title}),t[6]=e.title,t[7]=c);let l;t[8]!==a?.version||t[9]!==s?.label||t[10]!==n?(l=n?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[s?.label??`Device host`,` ·`,` `,a?.version??(n.platform===`ios`?`iOS`:`Android`)]}):null,t[8]=a?.version,t[9]=s?.label,t[10]=n,t[11]=l):l=t[11];let u;return t[12]!==c||t[13]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14],u}var xf=(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,E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(wf,{}),t[0]=E):E=t[0];let D;t[1]===c?D=t[2]:(D=(0,$.jsx)(An,{className:`relative shrink-0 [-webkit-app-region:no-drag]`,pressed:c,"aria-label":`Toggle thread details panel`,variant:`ghost`,size:`sm`,children:E}),t[1]=c,t[2]=D);let O=D,k;t[3]!==v||t[4]!==l||t[5]!==d?(k=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]=k):k=t[6];let A=k,j;t[7]!==b||t[8]!==u||t[9]!==l||t[10]!==O||t[11]!==A?(j=b?A(l===`popover`?(0,$.jsx)(Xr,{handle:u,render:O}):O):null,t[7]=b,t[8]=u,t[9]=l,t[10]=O,t[11]=A,t[12]=j):j=t[12];let M;t[13]!==_||t[14]!==x||t[15]!==a||t[16]!==o||t[17]!==s?(M=x?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:o,onPressedChange:_,"aria-label":`Toggle terminal drawer`,variant:`ghost`,size:`sm`,disabled:!a,children:(0,$.jsx)(Me,{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]=M):M=t[18];let N;t[19]!==y||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==w||t[24]!==C||t[25]!==S?(N=S?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:p,onPressedChange:y,"aria-label":w>0?`Toggle right panel, ${w} ${w===1?`tab`:`tabs`}`:`Toggle right panel`,variant:`ghost`,size:`sm`,disabled:!f,children:w>0?(0,$.jsx)(Sf,{count:w}):(0,$.jsx)(T,{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]=N):N=t[26];let P;return t[27]!==M||t[28]!==N||t[29]!==j?(P=(0,$.jsxs)(`div`,{className:`flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,"data-panel-layout-controls":!0,children:[j,M,N]}),t[27]=M,t[28]=N,t[29]=j,t[30]=P):P=t[30],P});function Sf(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 Cf=(0,Z.memo)(function(e){let t=(0,Q.c)(12),{maximized:n,onToggle:r}=e,i=n?`Restore panel size`:`Maximize panel`,a=n?rt:st,o;t[0]===a?o=t[1]:(o=(0,$.jsx)(at,{className:`size-3.5`,icon:a}),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(s=(0,$.jsx)(q,{render:(0,$.jsx)(An,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:n,onPressedChange:r,"aria-label":i,variant:`ghost`,size:`sm`,children:o})}),t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,$.jsx)(J,{side:`bottom`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(Y,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l});function wf(){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{ls as A,fc as C,xs as D,uc as E,ko as F,jo as I,Oo as L,Jo as M,Yo as N,Ss as O,Ko as P,gc as S,dc as T,ll as _,Fd as a,Pc as b,Id as c,jd as d,Nu as f,dl as g,bl as h,Pd as i,is as j,vs as k,Ld as l,Cl as m,Cf as n,Rd as o,xl as p,hf as r,zd as s,xf as t,Md as u,Lc as v,mc as w,bc as x,Ic as y};
215
+ //# sourceMappingURL=PanelLayoutControls-Bfgdx7QX.js.map