@p4code/cli 0.8.19 → 0.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-BfqWHczJ.mjs → binCli-7vuQm4vY.mjs} +130 -37
  3. package/dist/client/.vite/manifest.json +2226 -2189
  4. package/dist/client/assets/AlertDialogRoot-CI-BT04n.js +2 -0
  5. package/dist/client/assets/{AnimatedHeight-Bt23tBJu.js → AnimatedHeight-B1LdeRxh.js} +2 -2
  6. package/dist/client/assets/{AuthSurfaceShell-CScpeyCZ.js → AuthSurfaceShell-BwoVNx9S.js} +2 -2
  7. package/dist/client/assets/{CSPContext-CCVdxObl.js → CSPContext-Bn8q5RdR.js} +2 -2
  8. package/dist/client/assets/{ChatGptUsageButton-yYHsmy4T.js → ChatGptUsageButton-BKwNHMSp.js} +2 -2
  9. package/dist/client/assets/{ChatMarkdown-B0DVA2sH.js → ChatMarkdown-DvwRAy0e.js} +4 -4
  10. package/dist/client/assets/{CheckboxIndicator-wz_7NgXC.js → CheckboxIndicator-DUUgNp1r.js} +2 -2
  11. package/dist/client/assets/{CodexSetupSection.logic-BtAckihn.js → CodexSetupSection.logic-CGR92Snb.js} +2 -2
  12. package/dist/client/assets/{CollapsiblePanel-lE29H_pe.js → CollapsiblePanel-D1aZAbsh.js} +2 -2
  13. package/dist/client/assets/{ComboboxClear-DNFG72Hd.js → ComboboxClear-CMNv82AR.js} +2 -2
  14. package/dist/client/assets/{ComboboxGroupLabel-B_bH_C6n.js → ComboboxGroupLabel-BqpdqndG.js} +2 -2
  15. package/dist/client/assets/{CommandBlock-VGf7qjr7.js → CommandBlock-BGFFySU3.js} +2 -2
  16. package/dist/client/assets/{ComposerPromptEditor-CVko-EBm.js → ComposerPromptEditor-DlIuiQ2e.js} +4 -4
  17. package/dist/client/assets/{CompositeRoot-BaL7J4TF.js → CompositeRoot-BP063J4d.js} +2 -2
  18. package/dist/client/assets/{ConnectionStatusDot-IvAZUpIh.js → ConnectionStatusDot-DvalNlEr.js} +2 -2
  19. package/dist/client/assets/{DevicePanel-fh1omTPb.js → DevicePanel-FC3DPqLr.js} +2 -2
  20. package/dist/client/assets/{DeviceSetup-wfV02sXR.js → DeviceSetup-ERWR4ZzH.js} +2 -2
  21. package/dist/client/assets/{DialogTitle-CJosg0_K.js → DialogTitle-OaePW-Ih.js} +2 -2
  22. package/dist/client/assets/{DiffCommentAnnotation-C4ODeTG1.js → DiffCommentAnnotation-YjjFdEbc.js} +2 -2
  23. package/dist/client/assets/{DiffFileTree-Cm5AwI-L.js → DiffFileTree-DynXKsOn.js} +2 -2
  24. package/dist/client/assets/{DiffPanel-DW_sAhx0.js → DiffPanel-BpuFnTQ7.js} +2 -2
  25. package/dist/client/assets/{DiffWorkerPoolProvider-CXn9pnyS.js → DiffWorkerPoolProvider-DDWtmCyP.js} +2 -2
  26. package/dist/client/assets/{EmbeddedDesign-QMT8odFI.js → EmbeddedDesign-B1fJ5Mbz.js} +7 -7
  27. package/dist/client/assets/{EmbeddedDesign-nRjXWU5Y.css → EmbeddedDesign-DmybFtYo.css} +1 -1
  28. package/dist/client/assets/{EnvironmentMachineIcon-Cs4BoaOB.js → EnvironmentMachineIcon-DszKXxD_.js} +2 -2
  29. package/dist/client/assets/{ExpandableText-DUYIICsi.js → ExpandableText-hoL-6ubc.js} +2 -2
  30. package/dist/client/assets/{FieldControl-CSR5qaN6.js → FieldControl-DDVVfmpB.js} +2 -2
  31. package/dist/client/assets/{FileDiff-DfokdNMp.js → FileDiff-BAjD8hTV.js} +2 -2
  32. package/dist/client/assets/{FilePreviewPanel-BiO1c4ia.js → FilePreviewPanel-BjYyaBX0.js} +4 -4
  33. package/dist/client/assets/{FoldedSettingsSection-CqteSm77.js → FoldedSettingsSection-CoyiJ_Zj.js} +2 -2
  34. package/dist/client/assets/{FormContext-D3Ve_Lza.js → FormContext-B0PXExmu.js} +2 -2
  35. package/dist/client/assets/{Icons-Bfx5fXpN.js → Icons-CX6xNdVb.js} +2 -2
  36. package/dist/client/assets/Input-C7aWgRC_.js +2 -0
  37. package/dist/client/assets/{KeybindingsSettings.logic-0P2hWpBG.js → KeybindingsSettings.logic-6FRd2ilb.js} +2 -2
  38. package/dist/client/assets/{NoProjectsHero-GWvfTakA.js → NoProjectsHero-A1VZ7ogx.js} +2 -2
  39. package/dist/client/assets/{PanelLayoutControls-yA-MhIU3.js → PanelLayoutControls-Bp96ytbx.js} +4 -4
  40. package/dist/client/assets/{PierreEntryIcon-x_cG473l.js → PierreEntryIcon-Ds39h2AA.js} +2 -2
  41. package/dist/client/assets/{PopoverHandle-CY2mrZwB.js → PopoverHandle-DRjGw1Yt.js} +2 -2
  42. package/dist/client/assets/{PreviewPanel-Dh9n6Ys-.js → PreviewPanel-ChNkAjUz.js} +2 -2
  43. package/dist/client/assets/{ProjectDefaultsSettings-DS-3kgM0.js → ProjectDefaultsSettings-Df_lGEeD.js} +2 -2
  44. package/dist/client/assets/{ProjectFavicon-Bdl7Tzds.js → ProjectFavicon-BtNx7IEw.js} +3 -3
  45. package/dist/client/assets/{ProjectIconPickerDialog-BaajvQh5.js → ProjectIconPickerDialog-CODB2BT9.js} +2 -2
  46. package/dist/client/assets/{ProjectMonogram-TlvVxVmS.js → ProjectMonogram-IuYJI7zN.js} +2 -2
  47. package/dist/client/assets/{ProviderAuthTerminal-UECuLZ2G.js → ProviderAuthTerminal-78p4XZgL.js} +2 -2
  48. package/dist/client/assets/{ProviderModelPicker-De9mZUTr.js → ProviderModelPicker-C3S7ixLD.js} +2 -2
  49. package/dist/client/assets/{ProviderSettingsForm-Ck0g4BIu.js → ProviderSettingsForm-j7_6yEo7.js} +2 -2
  50. package/dist/client/assets/{PullRequestCodeTab-Ba54Mifj.js → PullRequestCodeTab-DkUNpmvf.js} +2 -2
  51. package/dist/client/assets/{ReadOnlySourcePreview-CVocraam.js → ReadOnlySourcePreview-kG5bicDV.js} +2 -2
  52. package/dist/client/assets/{RenderErrorBoundary-DKs56Rs9.js → RenderErrorBoundary-BbYl2ykS.js} +2 -2
  53. package/dist/client/assets/{ScheduledTasksSettings-d4dmI9oH.js → ScheduledTasksSettings-YdKTaY5U.js} +2 -2
  54. package/dist/client/assets/{ScopedSwitch-Z6zp5sHo.js → ScopedSwitch-D9a9Wx-e.js} +2 -2
  55. package/dist/client/assets/{ScrollAreaCorner-B-Z3OJHa.js → ScrollAreaCorner-Ck3L5tlH.js} +2 -2
  56. package/dist/client/assets/{SecretInput-DeAPhcuN.js → SecretInput-UofV3Jxx.js} +2 -2
  57. package/dist/client/assets/{SelectScrollUpArrow-DfDNBpqc.js → SelectScrollUpArrow-C_YHAw_f.js} +2 -2
  58. package/dist/client/assets/{SettingsPanels-CWgjxAiG.js → SettingsPanels-BoUeQYqp.js} +2 -2
  59. package/dist/client/assets/{SettingsPanels.logic-D3iQ5aZy.js → SettingsPanels.logic-BE_JM5Fc.js} +2 -2
  60. package/dist/client/assets/{SettingsScopeNotice-BfjZTvSz.js → SettingsScopeNotice-CHsOo_U6.js} +2 -2
  61. package/dist/client/assets/{T3ConnectAccountPages-CsFviIjD.js → T3ConnectAccountPages-Cfc33ihi.js} +2 -2
  62. package/dist/client/assets/{T3ConnectSidebarSignIn-3MsegucL.js → T3ConnectSidebarSignIn-HRtCfmCk.js} +2 -2
  63. package/dist/client/assets/{ThemeEditorPanel-Bj9nHohX.js → ThemeEditorPanel-ezln4yFM.js} +2 -2
  64. package/dist/client/assets/{ThreadTerminalDrawer-Cks3C8wv.js → ThreadTerminalDrawer-D_GQQ1Ly.js} +2 -2
  65. package/dist/client/assets/{TooltipViewport-WRCNCy-2.js → TooltipViewport-B_Oz-gLq.js} +2 -2
  66. package/dist/client/assets/{Virtualizer-D6VpBTPc.js → Virtualizer-DRAoNAc2.js} +2 -2
  67. package/dist/client/assets/{WorkspaceBreadcrumb-CR_Yk7Ph.js → WorkspaceBreadcrumb-CpHuVRke.js} +2 -2
  68. package/dist/client/assets/{WorkspacePageContainer-D3M3Ncv4.js → WorkspacePageContainer-BQ0Bk5Qy.js} +2 -2
  69. package/dist/client/assets/{WorkspacePageHeader-xuSJTTO0.js → WorkspacePageHeader-Cx1gpU1l.js} +2 -2
  70. package/dist/client/assets/_chat-COwukFSB.js +45 -0
  71. package/dist/client/assets/{_chat.index-B5-xqP_5.js → _chat.index-T3ADOYa1.js} +2 -2
  72. package/dist/client/assets/{_chat.new-DxPEFJcT.js → _chat.new-egywwPr3.js} +2 -2
  73. package/dist/client/assets/{_chat.pull-requests-BBVWbXyN.js → _chat.pull-requests-CkgRG9UN.js} +2 -2
  74. package/dist/client/assets/{abnfDiagram-VCTEODGH-CxxMo560.js → abnfDiagram-VCTEODGH-BctM0h9j.js} +2 -2
  75. package/dist/client/assets/{alert-BXnCHOJp.js → alert-CNni4aGm.js} +2 -2
  76. package/dist/client/assets/architecture-7GRP2DOG-5VIB8Eba.js +1 -0
  77. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DJiRjS82.js → architectureDiagram-5GKGNRK7-T6dn-Aw8.js} +2 -2
  78. package/dist/client/assets/{assets-B5H7ruRK.js → assets-B_A7RkiF.js} +2 -2
  79. package/dist/client/assets/{blockDiagram-I7D4REHJ-kDnwtgKo.js → blockDiagram-I7D4REHJ-2KUW7DJ1.js} +2 -2
  80. package/dist/client/assets/{browserHistoryStore-o7hGV5zZ.js → browserHistoryStore-hEHIMltt.js} +2 -2
  81. package/dist/client/assets/{browserLinkTarget-hn6UyJXl.js → browserLinkTarget-CdzL1FA-.js} +2 -2
  82. package/dist/client/assets/{c4Diagram-7LVT6UL2-D1fm-1EX.js → c4Diagram-7LVT6UL2-1uZnjRIl.js} +2 -2
  83. package/dist/client/assets/channel-B7HSUXfW.js +2 -0
  84. package/dist/client/assets/{checkbox-tOWU_Z9Y.js → checkbox-BpAfakhx.js} +2 -2
  85. package/dist/client/assets/{chunk-4HAMMTFA-BLYTHhED.js → chunk-4HAMMTFA-DTdSC_bt.js} +2 -2
  86. package/dist/client/assets/{chunk-75Z2AOVW-DT7Umtgk.js → chunk-75Z2AOVW-D8m_ip6d.js} +2 -2
  87. package/dist/client/assets/{chunk-DU6HZSFF-D0K-8X_H.js → chunk-DU6HZSFF-cx0FIxcU.js} +2 -2
  88. package/dist/client/assets/{chunk-F27PBJKO-5P4LORWK.js → chunk-F27PBJKO-CLaT5xm4.js} +2 -2
  89. package/dist/client/assets/{chunk-GMAD6QVW-DO-mb18X.js → chunk-GMAD6QVW-Dh_22wYw.js} +2 -2
  90. package/dist/client/assets/{chunk-GVQU2GXP-CxauyvGQ.js → chunk-GVQU2GXP-Cl592Z8q.js} +2 -2
  91. package/dist/client/assets/{chunk-IMKFNOWR-QGonsH_m.js → chunk-IMKFNOWR-b4olkqo9.js} +2 -2
  92. package/dist/client/assets/{chunk-L3NEJ4N5-DxKhJ2tE.js → chunk-L3NEJ4N5-C3zHyNed.js} +2 -2
  93. package/dist/client/assets/{chunk-OSK3NFVY-BlR0vtv9.js → chunk-OSK3NFVY-DfOyV50p.js} +2 -2
  94. package/dist/client/assets/{chunk-P2QGCYS3-BIit_gMZ.js → chunk-P2QGCYS3-CtwwhFBb.js} +2 -2
  95. package/dist/client/assets/{chunk-POPQ4Y6H-Ojuitc4K.js → chunk-POPQ4Y6H-Bn_dv1-6.js} +2 -2
  96. package/dist/client/assets/{chunk-PWAF6VOD-B6Uc75KF.js → chunk-PWAF6VOD-DB5x5BPu.js} +2 -2
  97. package/dist/client/assets/{chunk-SHT3W25Y-DSzF0_aF.js → chunk-SHT3W25Y-4SWCrL8G.js} +2 -2
  98. package/dist/client/assets/{chunk-SVP7TREG-BbxrRzvm.js → chunk-SVP7TREG-B9UQB6rs.js} +2 -2
  99. package/dist/client/assets/{chunk-TICWLB2K-qxbKtZBK.js → chunk-TICWLB2K-I0Ma7uE4.js} +2 -2
  100. package/dist/client/assets/classDiagram-ZZMXUADV-9HCpqDrm.js +2 -0
  101. package/dist/client/assets/classDiagram-v2-VYDZK3BY-9HCpqDrm.js +2 -0
  102. package/dist/client/assets/{color-picker-C_20-4RB.js → color-picker-KVitc2gM.js} +2 -2
  103. package/dist/client/assets/{combobox-NsYaIiJL.js → combobox-DiUoVqyf.js} +2 -2
  104. package/dist/client/assets/{command-DJR9ebnx.js → command-CMR1n6Uf.js} +2 -2
  105. package/dist/client/assets/{composer-logic-CkuMSzLW.js → composer-logic-D76QXdUM.js} +2 -2
  106. package/dist/client/assets/{composerDraftUploads-D0K1HfK_.js → composerDraftUploads-Vg0GXwnb.js} +2 -2
  107. package/dist/client/assets/{connect-BSmdC-l-.js → connect-C-gMnpNs.js} +2 -2
  108. package/dist/client/assets/{connect-agent-BNeGfFIv.js → connect-agent-C4zyA6ta.js} +2 -2
  109. package/dist/client/assets/{cynefin-OW5HDTMX-BRoWQ1nZ.js → cynefin-OW5HDTMX-BJCfymNy.js} +1 -1
  110. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BPoK_fdY.js → cynefinDiagram-5FMLGOSQ-Cxc8iWLh.js} +2 -2
  111. package/dist/client/assets/{dagre-GXQ25YYZ-B6n9u2fx.js → dagre-GXQ25YYZ-DvjGFTC6.js} +2 -2
  112. package/dist/client/assets/design-Cvqy5-YM.js +2 -0
  113. package/dist/client/assets/{device-V5bbUMMx.js → device-CHTG1mA3.js} +2 -2
  114. package/dist/client/assets/{diagram-S7CK7UJ4-B4H5MfDU.js → diagram-S7CK7UJ4-DQ3d5nRG.js} +2 -2
  115. package/dist/client/assets/{diagram-UQ7AKVKN-BN9pt82T.js → diagram-UQ7AKVKN-Hzoc39HG.js} +2 -2
  116. package/dist/client/assets/{diagram-VSXAHHWV-C69gO9TK.js → diagram-VSXAHHWV-BiAz9eK3.js} +2 -2
  117. package/dist/client/assets/{diagram-VX7I27RA-qliQCn2I.js → diagram-VX7I27RA-ZvxW6orI.js} +2 -2
  118. package/dist/client/assets/{diagram-Z3DM3KII-JnCXFjMD.js → diagram-Z3DM3KII-DYVNNS6J.js} +2 -2
  119. package/dist/client/assets/{dialog-C4UzQSL1.js → dialog-D--IO2tX.js} +2 -2
  120. package/dist/client/assets/{diffRendering-Cuv7q0nc.js → diffRendering-CH8Pp2NZ.js} +2 -2
  121. package/dist/client/assets/{discovery-list-ppl7-G1K.js → discovery-list-E9mW3ie9.js} +2 -2
  122. package/dist/client/assets/{dist-CnDtgaa3.js → dist-D_us60iU.js} +3 -3
  123. package/dist/client/assets/{draft-input-DUB7VaUv.js → draft-input-BqhTvFTz.js} +2 -2
  124. package/dist/client/assets/{duoViewer-Bi-KrG5F.js → duoViewer-C1ysZzHj.js} +2 -2
  125. package/dist/client/assets/{dynamic-mqe80fw7.js → dynamic-D3BvMY7V.js} +3 -3
  126. package/dist/client/assets/{ebnfDiagram-PWID7BFC-jdXVhqCj.js → ebnfDiagram-PWID7BFC-ARv-iUm5.js} +2 -2
  127. package/dist/client/assets/{embeddedScripts-Qhl8LxE1.js → embeddedScripts-iET5Slgf.js} +2 -2
  128. package/dist/client/assets/{empty-GrsNgo1m.js → empty-IIGW45Hv.js} +2 -2
  129. package/dist/client/assets/{entities-D6pHmUcl.js → entities-BNeCRVLN.js} +2 -2
  130. package/dist/client/assets/{erDiagram-RLTQ6QDP-DdgQriY9.js → erDiagram-RLTQ6QDP-BbhShOfn.js} +2 -2
  131. package/dist/client/assets/eventmodeling-NTZA5JFV-7Qy1WUdw.js +1 -0
  132. package/dist/client/assets/{fileLinks-DKkO_IJu.js → fileLinks-BVZWyXb4.js} +2 -2
  133. package/dist/client/assets/{fileTreeExpansion-C1UNNqSC.js → fileTreeExpansion-CWBDW5x7.js} +2 -2
  134. package/dist/client/assets/flowDiagram-HODETNUW-WrRfiKZh.js +1 -0
  135. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DFCwukfW.js → ganttDiagram-EL5Y4UJY-YyvVQr9f.js} +2 -2
  136. package/dist/client/assets/{getDiffFileInput-phPjSTY8.js → getDiffFileInput-CqWRYbh0.js} +2 -2
  137. package/dist/client/assets/{gitGraph-4MIJSDKK-B-iBBweB.js → gitGraph-4MIJSDKK-B1sT41xD.js} +1 -1
  138. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-w7enwZUZ.js → gitGraphDiagram-WWUBYQGX-2YfTeJPY.js} +2 -2
  139. package/dist/client/assets/{guideRunStore-C-LauQUS.js → guideRunStore-C8EitNtt.js} +2 -2
  140. package/dist/client/assets/{htmlRender-DVq1i7PZ.js → htmlRender-n-z4ejOb.js} +2 -2
  141. package/dist/client/assets/{index-CW8ApI1G.js → index-D5grnFOh.js} +3 -3
  142. package/dist/client/assets/{info-A6RAGUB7-zYd5-_tB.js → info-A6RAGUB7-Bxvrguok.js} +1 -1
  143. package/dist/client/assets/{infoDiagram-27XIBGKW-BlWLgzyt.js → infoDiagram-27XIBGKW-Ci9YhEz1.js} +2 -2
  144. package/dist/client/assets/{input-DpZhQSV2.js → input-DX_wpYEr.js} +2 -2
  145. package/dist/client/assets/{input-group-BjfPTIWt.js → input-group-B7App4HX.js} +2 -2
  146. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-oNq825oe.js → ishikawaDiagram-5VMMS53U-DrTMtdZr.js} +2 -2
  147. package/dist/client/assets/{journeyDiagram-3NMN7TZE-BQqGB1_d.js → journeyDiagram-3NMN7TZE-Cad85NEf.js} +2 -2
  148. package/dist/client/assets/{kanban-definition-UXKFOSKX-CDCYjq7t.js → kanban-definition-UXKFOSKX-CyPoc7fr.js} +2 -2
  149. package/dist/client/assets/{kbd-BfsP5lvQ.js → kbd-CBsCsK1C.js} +2 -2
  150. package/dist/client/assets/{keybindings-BD3cM3Jm.js → keybindings-DQLn36Qh.js} +2 -2
  151. package/dist/client/assets/layout-grid-CCkPw5ih.js +2 -0
  152. package/dist/client/assets/{lazyRouteComponent-DebYKx4q.js → lazyRouteComponent-F8XJwdjp.js} +2 -2
  153. package/dist/client/assets/{line-Dr_Yg9S8.js → line-D-vamv77.js} +2 -2
  154. package/dist/client/assets/{link-wJO6kwX4.js → link-Dsk-mMeT.js} +2 -2
  155. package/dist/client/assets/{linkedPrompt-Dx_WF0Gk.js → linkedPrompt-QuSBC7T4.js} +2 -2
  156. package/dist/client/assets/main-B3UqEpE9.css +2 -0
  157. package/dist/client/assets/main-D398MK8V.js +26 -0
  158. package/dist/client/assets/{mediaReference-DEdeypAC.js → mediaReference-CyhWqXsL.js} +2 -2
  159. package/dist/client/assets/{mediaSource-DTry5UU8.js → mediaSource-DzNyV4QZ.js} +2 -2
  160. package/dist/client/assets/{mermaid-parser.core-EKu4BBvw.js → mermaid-parser.core-DPipy20D.js} +4 -4
  161. package/dist/client/assets/{mermaid.core-C-FRLnEk.js → mermaid.core-BhvlRFAw.js} +5 -5
  162. package/dist/client/assets/{mindmap-definition-YA3MSWOX-Bo-8FCl-.js → mindmap-definition-YA3MSWOX-BmaL4P3W.js} +2 -2
  163. package/dist/client/assets/{number-field-B0OyTTUs.js → number-field-CO0djGoZ.js} +2 -2
  164. package/dist/client/assets/{observeResize-CBAzjAMz.js → observeResize-DnTxIA8M.js} +2 -2
  165. package/dist/client/assets/{onboarding-EecLmYJ0.js → onboarding-Bk1fay_k.js} +2 -2
  166. package/dist/client/assets/{openFileInPreview-MgwNsNCM.js → openFileInPreview-BoDixD_F.js} +2 -2
  167. package/dist/client/assets/{p4ProjectFile-DZ6HGjaI.js → p4ProjectFile-Cvz5u0b7.js} +2 -2
  168. package/dist/client/assets/{packet-AYTQ26CC-DD_SFe63.js → packet-AYTQ26CC-Dv1A4BvT.js} +1 -1
  169. package/dist/client/assets/{pair-BzsQ1gz0.js → pair-Bvx1yb_1.js} +2 -2
  170. package/dist/client/assets/{pegDiagram-XKGWAZYB-Bbw22YYs.js → pegDiagram-XKGWAZYB-BSldN3hU.js} +2 -2
  171. package/dist/client/assets/{phoneViewer-DZyuQ-is.js → phoneViewer-CEU-YPRt.js} +2 -2
  172. package/dist/client/assets/{pie-WAS4IAKB-CNHjs-Ma.js → pie-WAS4IAKB-iLUxjnvf.js} +1 -1
  173. package/dist/client/assets/{pieDiagram-E7YTZNPT-_ZbKy7eA.js → pieDiagram-E7YTZNPT-4ZtbrRQa.js} +2 -2
  174. package/dist/client/assets/{pierre-icons-BubjdUjD.js → pierre-icons-duX6avqL.js} +2 -2
  175. package/dist/client/assets/{popover-BuuvISBT.js → popover-BJ6nvlLO.js} +2 -2
  176. package/dist/client/assets/{preview-CwzKOKVG.js → preview-Cf8NQ1hB.js} +2 -2
  177. package/dist/client/assets/{preview-BlW45a9H.js → preview-iwQ6KbXA.js} +2 -2
  178. package/dist/client/assets/{previewMiniPlayerStore-CGiA2h59.js → previewMiniPlayerStore-C-S6Z_7R.js} +2 -2
  179. package/dist/client/assets/{primary-3GB-obcz.js → primary-BWLl-lP0.js} +2 -2
  180. package/dist/client/assets/{primaryCloudLinkState-DYmepSfi.js → primaryCloudLinkState-_2yJcM8W.js} +2 -2
  181. package/dist/client/assets/{projectFilesQueryState-D2rMhOEA.js → projectFilesQueryState-Dnhdh9Fp.js} +2 -2
  182. package/dist/client/assets/{projectScriptEditor-BxnriUVv.js → projectScriptEditor-BI4TQzLb.js} +2 -2
  183. package/dist/client/assets/{providerSkills-C_OG7yP0.js → providerSkills-h-0NbrXw.js} +2 -2
  184. package/dist/client/assets/{pullRequestDetail.logic-BhGUhCGd.js → pullRequestDetail.logic-w9YCNM32.js} +2 -2
  185. package/dist/client/assets/{pullRequestIcons-DsTinQ4q.js → pullRequestIcons-BjW5TUsG.js} +2 -2
  186. package/dist/client/assets/{pullRequestReviewStore-BKYNixhZ.js → pullRequestReviewStore-CfDcNEFp.js} +2 -2
  187. package/dist/client/assets/{pullRequests-CQ2Zte1o.js → pullRequests-PrPMEuwL.js} +2 -2
  188. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Bnl3w7OY.js → quadrantDiagram-AXDQQJYC-BA_0gIwm.js} +2 -2
  189. package/dist/client/assets/{queries-_Qf89qTX.js → queries-WzVTFKPw.js} +2 -2
  190. package/dist/client/assets/{query-CRlRG7rf.js → query-MZn8giyP.js} +2 -2
  191. package/dist/client/assets/{radar-RG4KPBEZ-DweWJU_g.js → radar-RG4KPBEZ-ClHSGc5G.js} +1 -1
  192. package/dist/client/assets/{radio-group-iJUHzvZC.js → radio-group-Ca6IMyWa.js} +2 -2
  193. package/dist/client/assets/{railroad-74A4TZTK-DmxX8fKE.js → railroad-74A4TZTK-CLfqlsOS.js} +1 -1
  194. package/dist/client/assets/railroad-abnf-HS5TGJTU-D6sBNrTv.js +1 -0
  195. package/dist/client/assets/railroad-ebnf-LZEXJU2U-DQmVNLBf.js +1 -0
  196. package/dist/client/assets/railroad-peg-WCYAUIDC-BmxuO4Yw.js +1 -0
  197. package/dist/client/assets/{railroadDiagram-O6MQD6OU-D94VfvdV.js → railroadDiagram-O6MQD6OU-C3O0sd3N.js} +2 -2
  198. package/dist/client/assets/{renderScheduler-DIWSOdLy.js → renderScheduler-C_PxJDPT.js} +2 -2
  199. package/dist/client/assets/{requirementDiagram-BXWQKSXE-4Sss1rRH.js → requirementDiagram-BXWQKSXE-DTD2i006.js} +2 -2
  200. package/dist/client/assets/{rightPanelStore-C3FvIXSq.js → rightPanelStore-UcehuwgS.js} +2 -2
  201. package/dist/client/assets/{runtime-CJNEsw6U.js → runtime-CvGlGrbH.js} +3 -3
  202. package/dist/client/assets/{runtime-ets76j-h.js → runtime-DgUiDuq4.js} +2 -2
  203. package/dist/client/assets/{runtimeModeConfig-DNgZlBoC.js → runtimeModeConfig-CTQ97M7F.js} +2 -2
  204. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-CFV5CXMi.js → sankeyDiagram-P5KCCOFB-DN-FD0Rw.js} +2 -2
  205. package/dist/client/assets/{scheduledTasksSettings.logic-CGYf8FQi.js → scheduledTasksSettings.logic-V_IgyOeJ.js} +2 -2
  206. package/dist/client/assets/{scroll-area-By1ARHPp.js → scroll-area-BStafc_O.js} +2 -2
  207. package/dist/client/assets/{select-DqGlaY40.js → select-BIK-KVyd.js} +2 -2
  208. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-Cln2JnVw.js → sequenceDiagram-WJ2MYXX4-BpTwzO_D.js} +2 -2
  209. package/dist/client/assets/{server-DpLkyQ0R.js → server-h8-LTzsE.js} +2 -2
  210. package/dist/client/assets/{session-Cau_XThy.js → session-BnZv-sUV.js} +2 -2
  211. package/dist/client/assets/{session-logic-CRwcdrNw.js → session-logic-Chq6Fhx9.js} +2 -2
  212. package/dist/client/assets/{settings-B4aWX2xy.js → settings-CX5J7KOC.js} +2 -2
  213. package/dist/client/assets/{settings.appearance-C__igzME.js → settings.appearance-CX8WldRu.js} +2 -2
  214. package/dist/client/assets/settings.archived-BLphtU6e.js +2 -0
  215. package/dist/client/assets/{settings.computer-use-SngXUHmk.js → settings.computer-use-CYOpSx3u.js} +2 -2
  216. package/dist/client/assets/{settings.connections-Bw61DbEx.js → settings.connections-CPZLelaw.js} +2 -2
  217. package/dist/client/assets/{settings.data-controls-DbqXwsIJ.js → settings.data-controls-Dw1t2NUy.js} +2 -2
  218. package/dist/client/assets/{settings.decisions-Bw-dFoGZ.js → settings.decisions-CjQBlU5H.js} +2 -2
  219. package/dist/client/assets/settings.designs-CdUp5EKA.js +2 -0
  220. package/dist/client/assets/{settings.diagnostics-D5dG-CTq.js → settings.diagnostics-CChxKGXN.js} +2 -2
  221. package/dist/client/assets/{settings.general-DVafi8E5.js → settings.general-fPNbGy-A.js} +2 -2
  222. package/dist/client/assets/{settings.integrations-C4t8diIu.js → settings.integrations-lsI9Ds_Z.js} +2 -2
  223. package/dist/client/assets/{settings.keybindings-B1dMCy_G.js → settings.keybindings-BYfmXPXW.js} +2 -2
  224. package/dist/client/assets/{settings.open-source-licenses-kgRl8SYE.js → settings.open-source-licenses-Cmww0egR.js} +2 -2
  225. package/dist/client/assets/{settings.plugins-HtKh3bu8.js → settings.plugins-DOL0xzP_.js} +2 -2
  226. package/dist/client/assets/{settings.projects-CtKhtmR8.js → settings.projects-BmPcRKSU.js} +3 -3
  227. package/dist/client/assets/{settings.providers-Bd0702hD.js → settings.providers-BmXJRxVY.js} +3 -3
  228. package/dist/client/assets/{settings.scheduled-tasks-Tpcp-BCI.js → settings.scheduled-tasks-DIrqKW18.js} +2 -2
  229. package/dist/client/assets/{settings.snap-shot-BngynTBI.js → settings.snap-shot-cYlYvsZa.js} +2 -2
  230. package/dist/client/assets/{settings.source-control-DmQkMruN.js → settings.source-control-DiCRUoZ-.js} +2 -2
  231. package/dist/client/assets/{settings.storage-CUeYkScx.js → settings.storage-_Qk3Am6V.js} +2 -2
  232. package/dist/client/assets/{settingsLayout-Du5mjDQU.js → settingsLayout-BxEP0uF3.js} +2 -2
  233. package/dist/client/assets/{sidebar-Dxq8kloB.js → sidebar-CilourkR.js} +2 -2
  234. package/dist/client/assets/{sidebarProjectGrouping-BfZ705hQ.js → sidebarProjectGrouping-Bk_4pOCF.js} +2 -2
  235. package/dist/client/assets/{skeleton--M5AJWoC.js → skeleton-DoQ8WJ33.js} +2 -2
  236. package/dist/client/assets/{sourceControl-Cmvk57z0.js → sourceControl-CbwbzP2H.js} +2 -2
  237. package/dist/client/assets/{sourceControlClients-C0IkCWsN.js → sourceControlClients-Bqx0yIVC.js} +2 -2
  238. package/dist/client/assets/{spinner-cHzhZrgb.js → spinner-dBHTxMdw.js} +2 -2
  239. package/dist/client/assets/{standalone-page-BaVFigS5.js → standalone-page-7u6OMfTi.js} +2 -2
  240. package/dist/client/assets/{stateDiagram-D77RDMKH-CZ_bsdqp.js → stateDiagram-D77RDMKH-B5DXt7YQ.js} +2 -2
  241. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DKxchkZ_.js +2 -0
  242. package/dist/client/assets/{swimlanes-42K2YHIH-My4j-GD7.js → swimlanes-42K2YHIH-BwtHh4XF.js} +2 -2
  243. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DcmT28cJ.js +9 -0
  244. package/dist/client/assets/{terminal-links-BSEOjQCo.js → terminal-links-DaTgSxq7.js} +2 -2
  245. package/dist/client/assets/{terminalSessions-BpuHxk1q.js → terminalSessions-BH4SsD0n.js} +2 -2
  246. package/dist/client/assets/{textarea-XR9lgl40.js → textarea-DyCJe8OO.js} +2 -2
  247. package/dist/client/assets/{themePalette-CONAHv4I.js → themePalette-mGukKeaJ.js} +2 -2
  248. package/dist/client/assets/{timeline-definition-24CTP7MA-Q9JBFJBF.js → timeline-definition-24CTP7MA-DcZAbrWX.js} +2 -2
  249. package/dist/client/assets/{toast-CwJ-bjHi.js → toast-CylvOlB4.js} +2 -2
  250. package/dist/client/assets/{toggle-FqX4CVcC.js → toggle-C4iGKTHY.js} +2 -2
  251. package/dist/client/assets/{toggle-group-JCVlIQ5i.js → toggle-group-CM-lVPv_.js} +2 -2
  252. package/dist/client/assets/{tooltip-CtZ6PJJw.js → tooltip-C85X81rS.js} +2 -2
  253. package/dist/client/assets/{treeView-Q6P3EWNA-3qBVWI88.js → treeView-Q6P3EWNA-Bi9LlHgf.js} +1 -1
  254. package/dist/client/assets/{treemap-WGGIJYW6-O3_0iynh.js → treemap-WGGIJYW6-Ddxv0kaw.js} +1 -1
  255. package/dist/client/assets/{uiStateStore-CcTtH1Jz.js → uiStateStore-BQNw2Dqk.js} +2 -2
  256. package/dist/client/assets/{usage-DWATWAhJ.js → usage-D_p-kdF1.js} +2 -2
  257. package/dist/client/assets/{usageAccess-Cpk_Aec9.js → usageAccess-BS7RH41F.js} +2 -2
  258. package/dist/client/assets/{usageFormat-B23xwSbG.js → usageFormat-neDCKBUu.js} +2 -2
  259. package/dist/client/assets/{usageShortcuts-BMHWlKT1.js → usageShortcuts-BXE7khxl.js} +2 -2
  260. package/dist/client/assets/{use-atom-command-3Z4EZbCj.js → use-atom-command-BZ0heqC5.js} +2 -2
  261. package/dist/client/assets/{useAriaLabelledBy-CMSGO3cd.js → useAriaLabelledBy-0jbiz1G5.js} +2 -2
  262. package/dist/client/assets/{useHandleNewThread-B9RCcbnw.js → useHandleNewThread-xDPfeiE8.js} +2 -2
  263. package/dist/client/assets/{useLocation-BTH6wjAt.js → useLocation-CEeuom34.js} +2 -2
  264. package/dist/client/assets/useNavigate-B5WzUZJ7.js +2 -0
  265. package/dist/client/assets/{useNavigateBack-DskLvJ9n.js → useNavigateBack-B1hKrkap.js} +2 -2
  266. package/dist/client/assets/{useParams-DhNu716j.js → useParams-DPNRViD9.js} +2 -2
  267. package/dist/client/assets/{usePermissionStatus-DaOsrYgE.js → usePermissionStatus-DhHAmOgT.js} +2 -2
  268. package/dist/client/assets/{usePullRequestActions-3vXHUgiG.js → usePullRequestActions-BxkTyNnd.js} +2 -2
  269. package/dist/client/assets/{useRegisterFieldControl-BX1EsUxP.js → useRegisterFieldControl-DHg4qk95.js} +2 -2
  270. package/dist/client/assets/{useScopedModelAvailability-BcYNdaQr.js → useScopedModelAvailability-6832Pqao.js} +2 -2
  271. package/dist/client/assets/{useSettings-D_OJJgNE.js → useSettings-CHo-Nv-3.js} +2 -2
  272. package/dist/client/assets/{useT3ConnectAuthPrompt-BcMgBGvL.js → useT3ConnectAuthPrompt-xAWzgrFw.js} +2 -2
  273. package/dist/client/assets/utils-ChK8VEFC.js +37 -0
  274. package/dist/client/assets/{vcsRefInvalidation-Dj5BpmJA.js → vcsRefInvalidation-C1-o4QR4.js} +2 -2
  275. package/dist/client/assets/{vennDiagram-4TSXK5OY-CGJ_vzL4.js → vennDiagram-4TSXK5OY-gRgKfcwz.js} +2 -2
  276. package/dist/client/assets/{wardley-WFR3VGLG-dLKWDrdG.js → wardley-WFR3VGLG-DcrHek4R.js} +1 -1
  277. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CZY3cfuL.js → wardleyDiagram-VM6X3IG4-Dy8jwPMm.js} +2 -2
  278. package/dist/client/assets/{welcome-BSKechyt.js → welcome-Bx0ykTSW.js} +2 -2
  279. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-H2sll7xl.js → xychartDiagram-S5SC5T6Z-BE_oCBL1.js} +2 -2
  280. package/dist/client/index.html +1 -1
  281. package/dist/{renderer-CCVomMFP.mjs → renderer-5lNN05tA.mjs} +2 -2
  282. package/dist/{runtime-DKclsP_7.mjs → runtime-BuR0otfT.mjs} +85 -53
  283. package/package.json +1 -1
  284. package/dist/client/assets/AlertDialogRoot-D5I6scXr.js +0 -2
  285. package/dist/client/assets/Input-DyKzFpW0.js +0 -2
  286. package/dist/client/assets/_chat-DkCa6MKZ.js +0 -45
  287. package/dist/client/assets/architecture-7GRP2DOG-CrDVVAg3.js +0 -1
  288. package/dist/client/assets/channel-CzmVRCkd.js +0 -2
  289. package/dist/client/assets/classDiagram-ZZMXUADV-Ce7tu2gJ.js +0 -2
  290. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Ce7tu2gJ.js +0 -2
  291. package/dist/client/assets/eventmodeling-NTZA5JFV-C45g87dF.js +0 -1
  292. package/dist/client/assets/flowDiagram-HODETNUW-CxTQXeBP.js +0 -1
  293. package/dist/client/assets/layout-grid-DDlG0mCT.js +0 -2
  294. package/dist/client/assets/main-DklPMTd5.css +0 -2
  295. package/dist/client/assets/main-DqlnVz2C.js +0 -26
  296. package/dist/client/assets/railroad-abnf-HS5TGJTU-CSGCBDLE.js +0 -1
  297. package/dist/client/assets/railroad-ebnf-LZEXJU2U-qkcBzemM.js +0 -1
  298. package/dist/client/assets/railroad-peg-WCYAUIDC-B-rmMXQT.js +0 -1
  299. package/dist/client/assets/settings.archived-Bs-jKZBo.js +0 -2
  300. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-93FSJgV8.js +0 -2
  301. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-1FS1ow3r.js +0 -9
  302. package/dist/client/assets/useNavigate-BS8hIoQr.js +0 -2
  303. package/dist/client/assets/utils-DqIvhFCT.js +0 -37
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-Ba54Mifj.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-DqIvhFCT.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-CJNEsw6U.js","assets/runtime-ets76j-h.js","assets/TooltipViewport-WRCNCy-2.js","assets/toast-CwJ-bjHi.js","assets/spinner-cHzhZrgb.js","assets/useParams-DhNu716j.js","assets/DiffFileTree-Cm5AwI-L.js","assets/useSettings-D_OJJgNE.js","assets/server-DpLkyQ0R.js","assets/session-Cau_XThy.js","assets/use-atom-command-3Z4EZbCj.js","assets/themePalette-CONAHv4I.js","assets/diffRendering-Cuv7q0nc.js","assets/index-CW8ApI1G.js","assets/fileTreeExpansion-C1UNNqSC.js","assets/pierre-icons-BubjdUjD.js","assets/query-CRlRG7rf.js","assets/DiffCommentAnnotation-C4ODeTG1.js","assets/Virtualizer-D6VpBTPc.js","assets/getDiffFileInput-phPjSTY8.js","assets/main-DqlnVz2C.js","assets/vcsRefInvalidation-Dj5BpmJA.js","assets/entities-D6pHmUcl.js","assets/number-field-B0OyTTUs.js","assets/useRegisterFieldControl-BX1EsUxP.js","assets/FormContext-D3Ve_Lza.js","assets/CSPContext-CCVdxObl.js","assets/select-DqGlaY40.js","assets/SelectScrollUpArrow-DfDNBpqc.js","assets/link-wJO6kwX4.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-DebYKx4q.js","assets/useNavigate-BS8hIoQr.js","assets/useLocation-BTH6wjAt.js","assets/rightPanelStore-C3FvIXSq.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-_Qf89qTX.js","assets/session-logic-CRwcdrNw.js","assets/htmlRender-DVq1i7PZ.js","assets/mediaSource-DTry5UU8.js","assets/fileLinks-DKkO_IJu.js","assets/mediaReference-DEdeypAC.js","assets/usageFormat-B23xwSbG.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-CtZ6PJJw.js","assets/skeleton--M5AJWoC.js","assets/useAriaLabelledBy-CMSGO3cd.js","assets/toggle-FqX4CVcC.js","assets/toggle-group-JCVlIQ5i.js","assets/CompositeRoot-BaL7J4TF.js","assets/input-DpZhQSV2.js","assets/Input-DyKzFpW0.js","assets/FieldControl-CSR5qaN6.js","assets/scroll-area-By1ARHPp.js","assets/ScrollAreaCorner-B-Z3OJHa.js","assets/dist-CnDtgaa3.js","assets/DialogTitle-CJosg0_K.js","assets/dialog-C4UzQSL1.js","assets/sidebar-Dxq8kloB.js","assets/useResizeDrag-KJl_F2EN.js","assets/CollapsiblePanel-lE29H_pe.js","assets/observeResize-CBAzjAMz.js","assets/AnimatedHeight-Bt23tBJu.js","assets/assets-B5H7ruRK.js","assets/sourceControl-Cmvk57z0.js","assets/openFileInPreview-MgwNsNCM.js","assets/browserHistoryStore-o7hGV5zZ.js","assets/preview-CwzKOKVG.js","assets/keybindings-BD3cM3Jm.js","assets/Icons-Bfx5fXpN.js","assets/preview-BlW45a9H.js","assets/PierreEntryIcon-x_cG473l.js","assets/RenderErrorBoundary-DKs56Rs9.js","assets/sourceControlClients-C0IkCWsN.js","assets/browserLinkTarget-hn6UyJXl.js","assets/pullRequestIcons-DsTinQ4q.js","assets/pullRequests-CQ2Zte1o.js","assets/threadSort-Bd2rijEy.js","assets/popover-BuuvISBT.js","assets/PopoverHandle-CY2mrZwB.js","assets/ProjectFavicon-Bdl7Tzds.js","assets/ProjectMonogram-TlvVxVmS.js","assets/projectFilesQueryState-D2rMhOEA.js","assets/checkbox-tOWU_Z9Y.js","assets/CheckboxIndicator-wz_7NgXC.js","assets/FieldItemContext-Bn6xBVJg.js","assets/terminalSessions-BpuHxk1q.js","assets/AlertDialogRoot-D5I6scXr.js","assets/uiStateStore-CcTtH1Jz.js","assets/composer-logic-CkuMSzLW.js","assets/useHandleNewThread-B9RCcbnw.js","assets/p4ProjectFile-DZ6HGjaI.js","assets/composerDraftUploads-D0K1HfK_.js","assets/guideRunStore-C-LauQUS.js","assets/pullRequestDetail.logic-BhGUhCGd.js","assets/pullRequestReviewStore-BKYNixhZ.js","assets/sidebarProjectGrouping-BfZ705hQ.js","assets/EnvironmentMachineIcon-Cs4BoaOB.js","assets/alert-BXnCHOJp.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-yYHsmy4T.js","assets/kbd-BfsP5lvQ.js","assets/settingsLayout-Du5mjDQU.js","assets/WorkspacePageContainer-D3M3Ncv4.js","assets/KeybindingsSettings.logic-0P2hWpBG.js","assets/usageShortcuts-BMHWlKT1.js","assets/primaryCloudLinkState-DYmepSfi.js","assets/command-DJR9ebnx.js","assets/ComboboxClear-DNFG72Hd.js","assets/ComboboxGroupLabel-B_bH_C6n.js","assets/ConnectionStatusDot-IvAZUpIh.js","assets/standalone-page-BaVFigS5.js","assets/primary-3GB-obcz.js","assets/onboarding-EecLmYJ0.js","assets/scheduledTasksSettings.logic-CGYf8FQi.js","assets/main-DklPMTd5.css","assets/DiffWorkerPoolProvider-CXn9pnyS.js","assets/textarea-XR9lgl40.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CW8ApI1G.js";import{r as n}from"./Icon-l19w4AjM.js";import{$f as r,$n as i,$u as a,A as o,Bf as s,Cf as c,Cm as l,Cs as u,D as d,Dd as f,Ef as p,Em as m,Ep as h,Es as g,F as _,Gd as v,Gn as y,Go as b,Gs as x,Gu as S,Hm as C,Hp as w,Jh as T,Jn as E,Js as D,Kd as O,Kn as k,Ks as A,Ku as j,Lm as M,NE as N,Pm as P,Pp as F,Qn as I,Rf as L,Ry as R,Sp as z,Ts as B,Ty as V,Um as H,Up as ee,Wn as te,Xd as ne,Yd as U,Yn as W,Yo as re,Yp as ie,Zd as ae,Zn as oe,__ as se,_d as ce,am as le,bp as ue,cr as de,gd as fe,gf as pe,hd as me,hm as he,im as ge,jp as _e,lE as ve,lm as ye,mf as be,nf as xe,nr as Se,or as Ce,qd as we,qn as Te,qu as Ee,rd as De,rm as Oe,sf as ke,sr as G,t as K,tp as Ae,tr as je,up as Me,va as Ne,vd as Pe,vm as Fe,w_ as Ie,wp as Le,xy as Re,yd as ze,yl as Be,yp as Ve,zd as He}from"./utils-DqIvhFCT.js";import{W as Ue}from"./runtime-CJNEsw6U.js";import{C as We,O as Ge,k as Ke,w as qe}from"./entities-D6pHmUcl.js";import{$t as Je,cn as Ye,dn as Xe,in as Ze,ln as Qe,sn as $e}from"./runtime-ets76j-h.js";import{G as et,N as tt,P as nt,W as rt,_ as it,l as at,y as ot}from"./TooltipViewport-WRCNCy-2.js";import{$ as st,B as ct,n as lt,z as ut}from"./ChatMarkdown-B0DVA2sH.js";import{a as dt,o as ft,s as pt,t as mt}from"./select-DqGlaY40.js";import{t as ht}from"./spinner-cHzhZrgb.js";import{i as gt,m as _t,p as vt}from"./toast-CwJ-bjHi.js";import{E as yt,J as bt,K as xt,f as St}from"./useSettings-D_OJJgNE.js";import{s as Ct}from"./server-DpLkyQ0R.js";import{i as wt,n as Tt}from"./session-Cau_XThy.js";import{n as Et}from"./query-CRlRG7rf.js";import{t as Dt}from"./use-atom-command-3Z4EZbCj.js";import{l as Ot,t as kt}from"./rightPanelStore-C3FvIXSq.js";import{u as At}from"./queries-_Qf89qTX.js";import{C as jt,Q as Mt,Z as q,_ as Nt,at as Pt,c as Ft,d as It,ft as Lt,l as Rt,lt as zt,nt as Bt,ot as Vt,s as Ht,t as Ut,tt as Wt,u as Gt,v as Kt,w as qt}from"./diffRendering-Cuv7q0nc.js";import{C as Jt,E as Yt,G as Xt,H as Zt,K as Qt,U as $t,V as en,W as tn,d as nn,i as rn,u as an}from"./Virtualizer-D6VpBTPc.js";import{l as on,ut as sn}from"./getDiffFileInput-phPjSTY8.js";import{i as cn,r as ln,t as un}from"./DiffWorkerPoolProvider-CXn9pnyS.js";import{t as dn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as fn,r as pn,t as mn}from"./FileDiff-DfokdNMp.js";import{S as hn,a as gn,b as _n,i as vn,n as yn,r as bn,t as xn}from"./DiffCommentAnnotation-C4ODeTG1.js";import{r as Sn}from"./mediaSource-DTry5UU8.js";import{o as Cn}from"./timestampFormat-wac2e_Jz.js";import{t as wn}from"./env-wK1YYxA8.js";import{a as J,n as Y,r as Tn,t as X}from"./tooltip-CtZ6PJJw.js";import{t as En}from"./skeleton--M5AJWoC.js";import{t as Dn}from"./textarea-XR9lgl40.js";import{t as On}from"./toggle-FqX4CVcC.js";import{n as kn,t as An}from"./toggle-group-JCVlIQ5i.js";import{i as jn,l as Mn,o as Nn,r as Pn,s as Fn,t as In}from"./combobox-NsYaIiJL.js";import{t as Ln}from"./input-DpZhQSV2.js";import{t as Rn}from"./scroll-area-By1ARHPp.js";import{a as zn,c as Bn,i as Vn,o as Hn,r as Un,s as Wn,t as Gn}from"./dialog-C4UzQSL1.js";import{t as Kn}from"./useResizeDrag-KJl_F2EN.js";import{a as qn,i as Jn,o as Yn,r as Xn,t as Zn}from"./empty-GrsNgo1m.js";import{i as Qn}from"./device-V5bbUMMx.js";import{t as $n}from"./observeResize-CBAzjAMz.js";import{o as er,s as tr}from"./openFileInPreview-MgwNsNCM.js";import{f as nr}from"./browserHistoryStore-o7hGV5zZ.js";import{_ as rr,y as ir}from"./keybindings-BD3cM3Jm.js";import{i as ar,n as or}from"./Icons-Bfx5fXpN.js";import{t as sr}from"./PierreEntryIcon-x_cG473l.js";import{F as cr,H as lr,U as ur,_ as dr,a as fr,b as pr,c as mr,d as hr,f as gr,g as _r,h as vr,i as yr,m as br,n as xr,o as Sr,p as Cr,r as wr,s as Tr,u as Er,v as Dr,x as Or,y as kr}from"./RenderErrorBoundary-DKs56Rs9.js";import{n as Ar,r as jr}from"./sourceControlClients-C0IkCWsN.js";import{n as Mr}from"./pullRequestIcons-DsTinQ4q.js";import{D as Nr,a as Pr,c as Fr,i as Ir,k as Lr,n as Rr,r as zr,u as Br}from"./pullRequests-CQ2Zte1o.js";import{a as Vr,i as Hr,n as Ur,o as Wr,t as Gr}from"./popover-BuuvISBT.js";import{A as Kr,B as qr,C as Jr,D as Yr,E as Xr,H as Zr,I as Qr,K as $r,L as ei,M as ti,N as ni,O as ri,P as ii,R as ai,S as oi,T as si,U as ci,V as li,X as ui,Y as di,_ as fi,a as pi,b as mi,c as hi,d as gi,f as _i,g as vi,i as yi,j as bi,k as xi,l as Si,o as Ci,p as wi,q as Ti,r as Ei,s as Di,t as Oi,v as ki,w as Ai,y as ji,z as Mi}from"./pullRequestDetail.logic-BhGUhCGd.js";import{i as Ni,n as Pi,r as Fi,t as Ii}from"./pullRequestReviewStore-BKYNixhZ.js";import{t as Li}from"./terminalLabels-BgLOlb2G.js";import{_ as Ri,c as zi,f as Bi,g as Vi,i as Hi,o as Ui,p as Wi,r as Gi,u as Ki,v as qi}from"./uiStateStore-CcTtH1Jz.js";import{n as Ji}from"./useHandleNewThread-B9RCcbnw.js";import{i as Yi,m as Xi,n as Zi,r as Qi,t as $i}from"./guideRunStore-C-LauQUS.js";import{n as ea}from"./EnvironmentMachineIcon-Cs4BoaOB.js";import{i as ta,n as na,r as ra,t as ia}from"./alert-BXnCHOJp.js";import{t as aa}from"./kbd-BfsP5lvQ.js";import{d as oa,l as sa,t as ca,u as la}from"./command-DJR9ebnx.js";import{$i as ua,Gr as da,Jt as fa,Kr as pa,Nr as ma,Pr as ha,ea as ga,fa as _a,ji as va,ki as ya,ra as ba,ta as xa}from"./main-DqlnVz2C.js";import"./WorkspacePageHeader-xuSJTTO0.js";import{r as Sa,s as Ca,t as wa}from"./usePullRequestActions-3vXHUgiG.js";function Ta(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Ea(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Da(e.items,t.items)}function Da(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 Oa(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Mt,``),t.before(r)):(r.setAttribute(q,``),t.after(r)),n?.observe(r),r}function ka(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Aa=1e5,ja=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Ma=`data-diffs-search`,Na=`:host {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-DkUNpmvf.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-ChK8VEFC.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-CvGlGrbH.js","assets/runtime-DgUiDuq4.js","assets/TooltipViewport-B_Oz-gLq.js","assets/toast-CylvOlB4.js","assets/spinner-dBHTxMdw.js","assets/useParams-DPNRViD9.js","assets/DiffFileTree-DynXKsOn.js","assets/useSettings-CHo-Nv-3.js","assets/server-h8-LTzsE.js","assets/session-BnZv-sUV.js","assets/use-atom-command-BZ0heqC5.js","assets/themePalette-mGukKeaJ.js","assets/diffRendering-CH8Pp2NZ.js","assets/index-D5grnFOh.js","assets/fileTreeExpansion-CWBDW5x7.js","assets/pierre-icons-duX6avqL.js","assets/query-MZn8giyP.js","assets/DiffCommentAnnotation-YjjFdEbc.js","assets/Virtualizer-DRAoNAc2.js","assets/getDiffFileInput-CqWRYbh0.js","assets/main-D398MK8V.js","assets/vcsRefInvalidation-C1-o4QR4.js","assets/entities-BNeCRVLN.js","assets/number-field-CO0djGoZ.js","assets/useRegisterFieldControl-DHg4qk95.js","assets/FormContext-B0PXExmu.js","assets/CSPContext-Bn8q5RdR.js","assets/select-BIK-KVyd.js","assets/SelectScrollUpArrow-C_YHAw_f.js","assets/link-Dsk-mMeT.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-F8XJwdjp.js","assets/useNavigate-B5WzUZJ7.js","assets/useLocation-CEeuom34.js","assets/rightPanelStore-UcehuwgS.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-WzVTFKPw.js","assets/session-logic-Chq6Fhx9.js","assets/htmlRender-n-z4ejOb.js","assets/mediaSource-DzNyV4QZ.js","assets/fileLinks-BVZWyXb4.js","assets/mediaReference-CyhWqXsL.js","assets/usageFormat-neDCKBUu.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-C85X81rS.js","assets/skeleton-DoQ8WJ33.js","assets/useAriaLabelledBy-0jbiz1G5.js","assets/toggle-C4iGKTHY.js","assets/toggle-group-CM-lVPv_.js","assets/CompositeRoot-BP063J4d.js","assets/input-DX_wpYEr.js","assets/Input-C7aWgRC_.js","assets/FieldControl-DDVVfmpB.js","assets/scroll-area-BStafc_O.js","assets/ScrollAreaCorner-Ck3L5tlH.js","assets/dist-D_us60iU.js","assets/DialogTitle-OaePW-Ih.js","assets/dialog-D--IO2tX.js","assets/sidebar-CilourkR.js","assets/useResizeDrag-KJl_F2EN.js","assets/CollapsiblePanel-D1aZAbsh.js","assets/observeResize-DnTxIA8M.js","assets/AnimatedHeight-B1LdeRxh.js","assets/assets-B_A7RkiF.js","assets/sourceControl-CbwbzP2H.js","assets/openFileInPreview-BoDixD_F.js","assets/browserHistoryStore-hEHIMltt.js","assets/preview-Cf8NQ1hB.js","assets/keybindings-DQLn36Qh.js","assets/Icons-CX6xNdVb.js","assets/preview-iwQ6KbXA.js","assets/PierreEntryIcon-Ds39h2AA.js","assets/RenderErrorBoundary-BbYl2ykS.js","assets/sourceControlClients-Bqx0yIVC.js","assets/browserLinkTarget-CdzL1FA-.js","assets/pullRequestIcons-BjW5TUsG.js","assets/pullRequests-PrPMEuwL.js","assets/threadSort-Bd2rijEy.js","assets/popover-BJ6nvlLO.js","assets/PopoverHandle-DRjGw1Yt.js","assets/ProjectFavicon-BtNx7IEw.js","assets/ProjectMonogram-IuYJI7zN.js","assets/projectFilesQueryState-Dnhdh9Fp.js","assets/checkbox-BpAfakhx.js","assets/CheckboxIndicator-DUUgNp1r.js","assets/FieldItemContext-Bn6xBVJg.js","assets/terminalSessions-BH4SsD0n.js","assets/AlertDialogRoot-CI-BT04n.js","assets/uiStateStore-BQNw2Dqk.js","assets/composer-logic-D76QXdUM.js","assets/useHandleNewThread-xDPfeiE8.js","assets/p4ProjectFile-Cvz5u0b7.js","assets/composerDraftUploads-Vg0GXwnb.js","assets/guideRunStore-C8EitNtt.js","assets/pullRequestDetail.logic-w9YCNM32.js","assets/pullRequestReviewStore-CfDcNEFp.js","assets/sidebarProjectGrouping-Bk_4pOCF.js","assets/EnvironmentMachineIcon-DszKXxD_.js","assets/alert-CNni4aGm.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-BKwNHMSp.js","assets/kbd-CBsCsK1C.js","assets/settingsLayout-BxEP0uF3.js","assets/WorkspacePageContainer-BQ0Bk5Qy.js","assets/KeybindingsSettings.logic-6FRd2ilb.js","assets/usageShortcuts-BXE7khxl.js","assets/primaryCloudLinkState-_2yJcM8W.js","assets/command-CMR1n6Uf.js","assets/ComboboxClear-CMNv82AR.js","assets/ComboboxGroupLabel-BqpdqndG.js","assets/ConnectionStatusDot-DvalNlEr.js","assets/standalone-page-7u6OMfTi.js","assets/primary-BWLl-lP0.js","assets/onboarding-Bk1fay_k.js","assets/scheduledTasksSettings.logic-V_IgyOeJ.js","assets/main-B3UqEpE9.css","assets/DiffWorkerPoolProvider-DDWtmCyP.js","assets/textarea-DyCJe8OO.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-D5grnFOh.js";import{r as n}from"./Icon-l19w4AjM.js";import{$f as r,$n as i,$u as a,A as o,Bf as s,Cf as c,Cm as l,Cs as u,D as d,Dd as f,Ef as p,Em as m,Ep as h,Es as g,F as _,Gd as v,Gn as y,Go as b,Gs as x,Gu as S,Hm as C,Hp as w,Jh as T,Jn as E,Js as D,Kd as O,Kn as k,Ks as A,Ku as j,Lm as M,NE as N,Pm as P,Pp as F,Qn as I,Rf as L,Ry as R,Sp as z,Ts as B,Ty as V,Um as H,Up as ee,Wn as te,Xd as ne,Yd as U,Yn as W,Yo as re,Yp as ie,Zd as ae,Zn as oe,__ as se,_d as ce,am as le,bp as ue,cr as de,gd as fe,gf as pe,hd as me,hm as he,im as ge,jp as _e,lE as ve,lm as ye,mf as be,nf as xe,nr as Se,or as Ce,qd as we,qn as Te,qu as Ee,rd as De,rm as Oe,sf as ke,sr as G,t as K,tp as Ae,tr as je,up as Me,va as Ne,vd as Pe,vm as Fe,w_ as Ie,wp as Le,xy as Re,yd as ze,yl as Be,yp as Ve,zd as He}from"./utils-ChK8VEFC.js";import{W as Ue}from"./runtime-CvGlGrbH.js";import{C as We,O as Ge,k as Ke,w as qe}from"./entities-BNeCRVLN.js";import{$t as Je,cn as Ye,dn as Xe,in as Ze,ln as Qe,sn as $e}from"./runtime-DgUiDuq4.js";import{G as et,N as tt,P as nt,W as rt,_ as it,l as at,y as ot}from"./TooltipViewport-B_Oz-gLq.js";import{$ as st,B as ct,n as lt,z as ut}from"./ChatMarkdown-DvwRAy0e.js";import{a as dt,o as ft,s as pt,t as mt}from"./select-BIK-KVyd.js";import{t as ht}from"./spinner-dBHTxMdw.js";import{i as gt,m as _t,p as vt}from"./toast-CylvOlB4.js";import{E as yt,J as bt,K as xt,f as St}from"./useSettings-CHo-Nv-3.js";import{s as Ct}from"./server-h8-LTzsE.js";import{i as wt,n as Tt}from"./session-BnZv-sUV.js";import{n as Et}from"./query-MZn8giyP.js";import{t as Dt}from"./use-atom-command-BZ0heqC5.js";import{l as Ot,t as kt}from"./rightPanelStore-UcehuwgS.js";import{u as At}from"./queries-WzVTFKPw.js";import{C as jt,Q as Mt,Z as q,_ as Nt,at as Pt,c as Ft,d as It,ft as Lt,l as Rt,lt as zt,nt as Bt,ot as Vt,s as Ht,t as Ut,tt as Wt,u as Gt,v as Kt,w as qt}from"./diffRendering-CH8Pp2NZ.js";import{C as Jt,E as Yt,G as Xt,H as Zt,K as Qt,U as $t,V as en,W as tn,d as nn,i as rn,u as an}from"./Virtualizer-DRAoNAc2.js";import{l as on,ut as sn}from"./getDiffFileInput-CqWRYbh0.js";import{i as cn,r as ln,t as un}from"./DiffWorkerPoolProvider-DDWtmCyP.js";import{t as dn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as fn,r as pn,t as mn}from"./FileDiff-BAjD8hTV.js";import{S as hn,a as gn,b as _n,i as vn,n as yn,r as bn,t as xn}from"./DiffCommentAnnotation-YjjFdEbc.js";import{r as Sn}from"./mediaSource-DzNyV4QZ.js";import{o as Cn}from"./timestampFormat-wac2e_Jz.js";import{t as wn}from"./env-wK1YYxA8.js";import{a as J,n as Y,r as Tn,t as X}from"./tooltip-C85X81rS.js";import{t as En}from"./skeleton-DoQ8WJ33.js";import{t as Dn}from"./textarea-DyCJe8OO.js";import{t as On}from"./toggle-C4iGKTHY.js";import{n as kn,t as An}from"./toggle-group-CM-lVPv_.js";import{i as jn,l as Mn,o as Nn,r as Pn,s as Fn,t as In}from"./combobox-DiUoVqyf.js";import{t as Ln}from"./input-DX_wpYEr.js";import{t as Rn}from"./scroll-area-BStafc_O.js";import{a as zn,c as Bn,i as Vn,o as Hn,r as Un,s as Wn,t as Gn}from"./dialog-D--IO2tX.js";import{t as Kn}from"./useResizeDrag-KJl_F2EN.js";import{a as qn,i as Jn,o as Yn,r as Xn,t as Zn}from"./empty-IIGW45Hv.js";import{i as Qn}from"./device-CHTG1mA3.js";import{t as $n}from"./observeResize-DnTxIA8M.js";import{o as er,s as tr}from"./openFileInPreview-BoDixD_F.js";import{f as nr}from"./browserHistoryStore-hEHIMltt.js";import{_ as rr,y as ir}from"./keybindings-DQLn36Qh.js";import{i as ar,n as or}from"./Icons-CX6xNdVb.js";import{t as sr}from"./PierreEntryIcon-Ds39h2AA.js";import{F as cr,H as lr,U as ur,_ as dr,a as fr,b as pr,c as mr,d as hr,f as gr,g as _r,h as vr,i as yr,m as br,n as xr,o as Sr,p as Cr,r as wr,s as Tr,u as Er,v as Dr,x as Or,y as kr}from"./RenderErrorBoundary-BbYl2ykS.js";import{n as Ar,r as jr}from"./sourceControlClients-Bqx0yIVC.js";import{n as Mr}from"./pullRequestIcons-BjW5TUsG.js";import{D as Nr,a as Pr,c as Fr,i as Ir,k as Lr,n as Rr,r as zr,u as Br}from"./pullRequests-PrPMEuwL.js";import{a as Vr,i as Hr,n as Ur,o as Wr,t as Gr}from"./popover-BJ6nvlLO.js";import{A as Kr,B as qr,C as Jr,D as Yr,E as Xr,H as Zr,I as Qr,K as $r,L as ei,M as ti,N as ni,O as ri,P as ii,R as ai,S as oi,T as si,U as ci,V as li,X as ui,Y as di,_ as fi,a as pi,b as mi,c as hi,d as gi,f as _i,g as vi,i as yi,j as bi,k as xi,l as Si,o as Ci,p as wi,q as Ti,r as Ei,s as Di,t as Oi,v as ki,w as Ai,y as ji,z as Mi}from"./pullRequestDetail.logic-w9YCNM32.js";import{i as Ni,n as Pi,r as Fi,t as Ii}from"./pullRequestReviewStore-CfDcNEFp.js";import{t as Li}from"./terminalLabels-BgLOlb2G.js";import{_ as Ri,c as zi,f as Bi,g as Vi,i as Hi,o as Ui,p as Wi,r as Gi,u as Ki,v as qi}from"./uiStateStore-BQNw2Dqk.js";import{n as Ji}from"./useHandleNewThread-xDPfeiE8.js";import{i as Yi,m as Xi,n as Zi,r as Qi,t as $i}from"./guideRunStore-C8EitNtt.js";import{n as ea}from"./EnvironmentMachineIcon-DszKXxD_.js";import{i as ta,n as na,r as ra,t as ia}from"./alert-CNni4aGm.js";import{t as aa}from"./kbd-CBsCsK1C.js";import{d as oa,l as sa,t as ca,u as la}from"./command-CMR1n6Uf.js";import{$i as ua,Gr as da,Jt as fa,Kr as pa,Nr as ma,Pr as ha,ea as ga,fa as _a,ji as va,ki as ya,ra as ba,ta as xa}from"./main-D398MK8V.js";import"./WorkspacePageHeader-Cx1gpU1l.js";import{r as Sa,s as Ca,t as wa}from"./usePullRequestActions-BxkTyNnd.js";function Ta(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Ea(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Da(e.items,t.items)}function Da(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 Oa(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Mt,``),t.before(r)):(r.setAttribute(q,``),t.after(r)),n?.observe(r),r}function ka(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Aa=1e5,ja=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Ma=`data-diffs-search`,Na=`:host {
3
3
  display: block;
4
4
  position: sticky;
5
5
  z-index: 100;
@@ -211,6 +211,6 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CW8ApI1
211
211
  [data-code]::-webkit-scrollbar-thumb {
212
212
  background-color: var(--diffs-bg-context);
213
213
  }
214
- `;function td(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:s,commenting:c,loadDiffFiles:l,onOpenFile:u}=e,[d,f]=(0,Z.useState)(null),{resolvedTheme:p}=xt(),m;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){m=null;break bb0}let e=Hu(r),i=Uu(e,n);if(i.length===0){m=null;break bb0}let a=Ft(Gu(n.path,It(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){m=null;break bb0}let s={additions:new Set(i.flatMap(ad)),deletions:new Set(i.flatMap(id))},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],m=c}t[0]=n,t[1]=r,t[2]=m}else m=t[2];let h=m,g=h?.rows??null,v;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){v=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==l||t[12]!==g?(e=async e=>{let t=await l(e),r=Ku(t.newFile.contents,g);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=l,t[12]=g,t[13]=e):e=t[13],v=e}let y=v,b;t[14]!==c?.pending||t[15]!==d||t[16]!==n.path||t[17]!==n.side||t[18]!==s||t[19]!==h?.drawn?(b=()=>{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 s)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of c?.pending??[]){if(e.path!==n.path)continue;let t=uc(e.position),i=lc(t.side);h?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(d!==null){let e=uc(d.position);r(lc(e.side),e.line,rd)}return[...e.values()]},t[14]=c?.pending,t[15]=d,t[16]=n.path,t[17]=n.side,t[18]=s,t[19]=h?.drawn,t[20]=b):b=t[20],c?.pending;let x;t[21]===b?x=t[22]:(x=b(),t[21]=b,t[22]=x);let S=x,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&&f({range:e,position:t})},t[23]=r,t[24]=C);let w=C,T=c!==null&&d===null,E=c?.onAskAgent??null,D;t[25]!==d||t[26]!==n.path||t[27]!==r||t[28]!==E?(D=e=>{if(d===null||r===null||E===null)return;let t=o({id:`pull-request-guide:${n.path}:${d.range.start}:${d.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:d.range,text:e});f(null),t!==null&&E(t,e)},t[25]=d,t[26]=n.path,t[27]=r,t[28]=E,t[29]=D):D=t[29];let O=D,k;t[30]===p?k=t[31]:(k=Rt(p),t[30]=p,t[31]=k);let A;t[32]===y?A=t[33]:(A=y===null?{hunkSeparators:`simple`}:{loadDiffFiles:y},t[32]=y,t[33]=A);let j;t[34]!==w||t[35]!==T||t[36]!==p||t[37]!==k||t[38]!==A?(j={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:k,themeType:p,preferredHighlighter:ba,unsafeCSS:ed,enableGutterUtility:T,enableLineSelection:T,onGutterUtilityClick:w,onLineSelectionEnd:w,...A},t[34]=w,t[35]=T,t[36]=p,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)(Lu,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=N);let P;t[42]!==S||t[43]!==O||t[44]!==c||t[45]!==d||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]!==u||t[54]!==M||t[55]!==h?(P=h===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:()=>u(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(mn,{fileDiff:h.fileDiff,options:M,lineAnnotations:S,selectedLines:d?.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(nd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(dc,{comment:e,onRemove:()=>c?.onRemove(e.id)},e.id)),e.metadata.draft&&d!==null&&c!==null?(0,$.jsx)(xn,{kind:`draft`,rangeLabel:`${n.path}:${uc(d.position).line}`,text:``,placeholder:c.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:c.canComment?`Add to review`:`Ask agent`,...c.canComment&&E!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>O(e)}}:{},onCancel:()=>f(null),onComment:e=>{if(!c.canComment){O(e);return}c.onComment({path:n.path,oldPath:r===null?null:od(r,n.path),position:d.position,body:e}),f(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 `,h.shown,` of`,` `,h.total,` diff lines`]}),(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>u(n.path),children:(0,$.jsx)(a,{"aria-hidden":!0})})]})})}),t[42]=S,t[43]=O,t[44]=c,t[45]=d,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]=u,t[54]=M,t[55]=h,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 nd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(Zu,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function rd(e){return{...e,draft:!0}}function id(e){return e.oldLine===null?[]:[e.oldLine]}function ad(e){return e.newLine===null?[]:[e.newLine]}function od(e,t){let n=It(e);return n===t?null:n}function sd(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=xt(),a;t[0]===n?a=t[1]:(a=dn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Rt(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:ba,unsafeCSS:Wo,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)(mn,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var cd={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function ld(e){let t=(0,Q.c)(122),{stop:n,index:i,stopCount:a,railOpen:o,onRailOpenChange:s,stopList:c,nextTitle:l,files:u,loadDiffFiles:d,diffLoading:f,commenting:p,onStep:m,onAsk:h,onFinish:g,onOpenFile:_}=e,v;t[0]===n?v=t[1]:(v=qu(n),t[0]=n,t[1]=v);let{lettered:y,byExcerpt:b}=v,x;t[2]===n.excerpts?x=t[3]:(x=new Set(n.excerpts.map(ud)),t[2]=n.excerpts,t[3]=x);let S=x,C,w,T,E,D,O,k,A,j;if(t[4]!==b||t[5]!==p||t[6]!==f||t[7]!==S||t[8]!==u||t[9]!==i||t[10]!==y||t[11]!==d||t[12]!==_||t[13]!==s||t[14]!==m||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]!==a||t[22]!==c){let e;t[32]===S?e=t[33]:(e=e=>!S.has(e.path),t[32]=S,t[33]=e);let r=n.files.filter(e);C=y.length>0;let l=C&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===l?w=t[35]:(w=K(`grid gap-8`,l),t[34]=l,t[35]=w),T=`flex min-w-0 flex-col gap-5`;let h=i+1,g;t[36]!==a||t[37]!==h?(g=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,a]}),t[36]=a,t[37]=h,t[38]=g):g=t[38];let v;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=v):v=t[39];let x=i+1,M;t[40]!==a||t[41]!==x?(M=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,x,` of `,a]}),t[40]=a,t[41]=x,t[42]=M):M=t[42];let N=o&&`rotate-180`,P;t[43]===N?P=t[44]:(P=K(N),t[43]=N,t[44]=P);let F;t[45]===P?F=t[46]:(F=(0,$.jsx)(fe,{"aria-hidden":!0,className:P}),t[45]=P,t[46]=F);let I;t[47]!==M||t[48]!==F?(I=(0,$.jsxs)(xa,{render:v,children:[M,F]}),t[47]=M,t[48]=F,t[49]=I):I=t[49];let L=i===0,R;t[50]===m?R=t[51]:(R=()=>m(-1),t[50]=m,t[51]=R);let z;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(ze,{"aria-hidden":!0}),t[52]=z):z=t[52];let B;t[53]!==L||t[54]!==R?(B=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:L,onClick:R,children:z}),t[53]=L,t[54]=R,t[55]=B):B=t[55];let V=i===a-1,H;t[56]===m?H=t[57]:(H=()=>m(1),t[56]=m,t[57]=H);let ee;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(fe,{"aria-hidden":!0}),t[58]=ee):ee=t[58];let te;t[59]!==V||t[60]!==H?(te=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:V,onClick:H,children:ee}),t[59]=V,t[60]=H,t[61]=te):te=t[61];let ne;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(aa,{children:`J`}),(0,$.jsx)(aa,{children:`K`})]}),t[62]=ne):ne=t[62];let U;t[63]!==B||t[64]!==te?(U=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[B,te,ne]}),t[63]=B,t[64]=te,t[65]=U):U=t[65];let W;t[66]!==g||t[67]!==I||t[68]!==U?(W=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[g,I,U]}),t[66]=g,t[67]=I,t[68]=U,t[69]=W):W=t[69];let re;t[70]===c?re=t[71]:(re=(0,$.jsx)(ga,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:c})}),t[70]=c,t[71]=re),t[72]!==s||t[73]!==o||t[74]!==W||t[75]!==re?(E=(0,$.jsxs)(ua,{open:o,onOpenChange:s,children:[W,re]}),t[72]=s,t[73]=o,t[74]=W,t[75]=re,t[76]=E):E=t[76];let ie;t[77]===n.title?ie=t[78]:(ie=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=ie);let oe;t[79]===n.summary?oe=t[80]:(oe=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(Lu,{text:n.summary})}),t[79]=n.summary,t[80]=oe),t[81]!==ie||t[82]!==oe?(D=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[ie,oe]}),t[81]=ie,t[82]=oe,t[83]=D):D=t[83],t[84]===n.attention?O=t[85]:(O=n.attention===null?null:(0,$.jsxs)(ia,{controlAlignment:`first-line`,children:[(0,$.jsx)(we,{}),(0,$.jsx)(ta,{children:cd[n.attention.kind]}),(0,$.jsx)(ra,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Lu,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=O),t[86]!==b||t[87]!==p||t[88]!==f||t[89]!==u||t[90]!==d||t[91]!==_||t[92]!==n.excerpts?(k=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(un,{children:n.excerpts.map((e,t)=>(0,$.jsx)(td,{excerpt:e,file:u.get(e.path)??null,loading:f,notes:b[t]??[],commenting:p,loadDiffFiles:d,onOpenFile:_},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=b,t[87]=p,t[88]=f,t[89]=u,t[90]=d,t[91]=_,t[92]=n.excerpts,t[93]=k):k=t[93],t[94]===y?A=t[95]:(A=(0,$.jsx)(Qu,{notes:y,className:`@min-[90rem]/guide:hidden`}),t[94]=y,t[95]=A),j=r.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)(un,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:r.map(e=>{let t=u.get(e.path),n=t===void 0?null:Ht([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(ua,{children:[(0,$.jsxs)(xa,{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)(Pe,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(ae,{"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)(Lu,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Sr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(ga,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:f?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(sd,{file:t,loadDiffFiles:d})})]})},e.path)})})})]}):null,t[4]=b,t[5]=p,t[6]=f,t[7]=S,t[8]=u,t[9]=i,t[10]=y,t[11]=d,t[12]=_,t[13]=s,t[14]=m,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]=a,t[22]=c,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A,t[31]=j}else C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28],k=t[29],A=t[30],j=t[31];let M;t[96]!==h||t[97]!==n.questions?(M=n.questions.length>0||h!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>h===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Lu,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>h(e),className:`flex min-w-0 items-start gap-2 rounded-lg border border-border/60 px-3 py-1.5 text-left text-sm text-foreground outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(r,{"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)(Lu,{text:e,plain:!0})})]},e)),h===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>h(``),children:[(0,$.jsx)(r,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=h,t[97]=n.questions,t[98]=M):M=t[98];let N;t[99]!==l||t[100]!==g||t[101]!==m?(N=l===null?g===null?null:(0,$.jsxs)(G,{onClick:g,children:[(0,$.jsx)(Ae,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(G,{className:`min-w-0`,onClick:()=>m(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,l]}),(0,$.jsx)(Ee,{"aria-hidden":!0})]}),t[99]=l,t[100]=g,t[101]=m,t[102]=N):N=t[102];let P;t[103]===N?P=t[104]:(P=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:N}),t[103]=N,t[104]=P);let F;t[105]!==M||t[106]!==P||t[107]!==T||t[108]!==E||t[109]!==D||t[110]!==O||t[111]!==k||t[112]!==A||t[113]!==j?(F=(0,$.jsxs)(`article`,{className:T,children:[E,D,O,k,A,j,M,P]}),t[105]=M,t[106]=P,t[107]=T,t[108]=E,t[109]=D,t[110]=O,t[111]=k,t[112]=A,t[113]=j,t[114]=F):F=t[114];let I;t[115]!==C||t[116]!==y?(I=C?(0,$.jsx)(`aside`,{className:`hidden @min-[90rem]/guide:block @min-[90rem]/guide:sticky @min-[90rem]/guide:top-4 @min-[90rem]/guide:self-start`,children:(0,$.jsx)(Qu,{notes:y})}):null,t[115]=C,t[116]=y,t[117]=I):I=t[117];let L;return t[118]!==w||t[119]!==F||t[120]!==I?(L=(0,$.jsxs)(`div`,{className:w,children:[F,I]}),t[118]=w,t[119]=F,t[120]=I,t[121]=L):L=t[121],L}function ud(e){return e.path}var dd=new Map;function fd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=Pi(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:dd},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:dd},f=a.some(e=>!d.files.has(e))&&!d.done,p=Et,m=f?zr.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:dd};if(t.cursor!==_||t.done)return t;let n=Ft(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Gt(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 pd(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=$i(Zi(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=Qi(f),m;t[4]===f?m=t[5]:(m=e=>Yi.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?[]:zu(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=fd(C),T=Dt(zr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Jo(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(Ru(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||ma()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Xi(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)(Ju,{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)(ld,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(Ju,{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 md(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=zr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=Et(a),s;t[3]===n?s=t[4]:(s=zr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=re(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=Dt(zr.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=()=>Yi.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`&&(Yi.getState().settle(Zi(n,r)),gt.add({type:`error`,title:`Could not start a review guide`,description:ai(Ue(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 hd(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:h,data:g,running:_,canWrite:v,write:y}=md(p),b;t[4]!==n||t[5]!==r?(b=Zi(n,r),t[4]=n,t[5]=r,t[6]=b):b=t[6];let x=b,S;t[7]===r?S=t[8]:(S=Pi(r),t[7]=r,t[8]=S);let C=S,w=Fi(r),T=Ni(_d),E=Ni(gd),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:Ii(),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 Yi.getState().setShown(x),()=>{Yi.getState().shownKey===x&&Yi.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=g?.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=g?.run??null,R=g?.currentHeadSha??null,z=j!==null&&R!==null&&R!==j.headSha,B=L?._tag===`Failed`&&L.headSha===R?L.detail:null,V;t[27]!==v||t[28]!==_||t[29]!==y?(V=(e,t)=>v?(0,$.jsxs)(G,{size:t,variant:`outline`,disabled:_,onClick:()=>void y(),children:[_?(0,$.jsx)(ht,{}):(0,$.jsx)(le,{"aria-hidden":!0,className:`size-3.5`}),_?`Reading the change...`:e]}):null,t[27]=v,t[28]=_,t[29]=y,t[30]=V):V=t[30];let H=V;if(j===null){if(h.isPending&&g===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)(ht,{})}),t[31]=e):e=t[31],e}let e=_?`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??h.error??(_?`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]!==v||t[44]!==B||t[45]!==_||t[46]!==z||t[47]!==H?(ee=z||B!==null||_?(0,$.jsxs)(ia,{variant:_?`info`:`warning`,children:[_?(0,$.jsx)(ht,{}):(0,$.jsx)(m,{}),(0,$.jsx)(ra,{children:_?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!_&&v?(0,$.jsx)(na,{children:H(`Rewrite`,`xs`)}):null]}):null,t[43]=v,t[44]=B,t[45]=_,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 W;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?(W=(0,$.jsx)(pd,{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]=W):W=t[64];let re;return t[65]!==ne||t[66]!==W?(re=(0,$.jsx)(Iu,{value:ne,children:W}),t[65]=ne,t[66]=W,t[67]=re):re=t[67],re}function gd(e){return e.removeComment}function _d(e){return e.addComment}function vd(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 yd={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not turn on auto-merge`,"disable-auto-merge":`Could not turn off auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},bd={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access to the branch — one from a fork also needs its author to allow edits from maintainers — and that it does not conflict with the base.`,"enable-auto-merge":`The host refused it. Check that this repository allows auto-merge, that you have write access, and that there is something left for it to wait on.`,"disable-auto-merge":`The host refused it. Check that you have write access, and that the merge has not already happened.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`},xd=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,Sd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Cd=()=>t(()=>import(`./PullRequestCodeTab-Ba54Mifj.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336])),wd=(0,Z.lazy)(Cd),Td=new Map,Ed=e=>typeof e==`string`?e:D(e);function Dd(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)(je,{}),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)(ea,{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)(I,{value:r,onValueChange:c,children:l})]}),t[8]=c,t[9]=l,t[10]=r,t[11]=u):u=t[11],u}var Od=(e,t)=>{e.preventDefault(),e.stopPropagation(),Sl({url:t.url,openLabel:bl(Ar.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function kd(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 h;t[9]===p?h=t[10]:(h=(0,$.jsx)(m,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=h);let g;t[11]!==c||t[12]!==f||t[13]!==h?(g=(0,$.jsxs)(Wr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,h]}),t[11]=c,t[12]=f,t[13]=h,t[14]=g):g=t[14];let _;t[15]===u?_=t[16]:(_=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=_);let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=v):v=t[17];let y;t[18]!==r.methods||t[19]!==a||t[20]!==i?(y=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)(Mr.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]=y):y=t[21];let b;t[22]!==_||t[23]!==y?(b=(0,$.jsxs)(Hr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[_,v,y]}),t[22]=_,t[23]=y,t[24]=b):b=t[24];let x;return t[25]!==b||t[26]!==g?(x=(0,$.jsxs)(Gr,{children:[g,b]}),t[25]=b,t[26]=g,t[27]=x):x=t[27],x}function Ad({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:o=null,reference:s,listEntry:c=null,refreshToken:u=0,onActed:m,onClose:h,context:g=`page`,composerDraftTarget:_,onBack:v,onSelectPullRequest:b,onGuideShown:C}){let w=qe(),T=We(),E=T.find(t=>t.id===s.projectId&&t.environmentId===e),D=E?.repositoryIdentity,k=w.get(e)?.environment.capabilities.threadPullRequests===!0,M=(0,Z.useMemo)(()=>k?ci(s,D):{projectId:s.projectId,repository:s.repository,number:s.number},[s,D,k]),N=`${M.projectId}:${M.host??``}:${M.repository}#${M.number}`,P=c?.projectId===M.projectId&&c.repository.toLowerCase()===M.repository.toLowerCase()&&(M.host===void 0||c.host.toLowerCase()===M.host.toLowerCase())&&c.number===M.number?c:null,[F,R]=(0,Z.useState)(!1),[B,V]=(0,Z.useState)(0),[H,U]=(0,Z.useState)(`summary`),[ie,ae]=(0,Z.useState)(`newest`),[ce,ue]=(0,Z.useState)(()=>({pullRequestKey:N,oid:null})),de=ce.pullRequestKey===N?ce.oid:null,he=e=>{ue({pullRequestKey:N,oid:e})},ge=e=>{he(e),U(`code`)},[ve,ye]=(0,Z.useState)(null),xe=e=>{he(null),ye(t=>({path:e,nonce:(t?.nonce??0)+1})),Cd(),U(`code`)},we=Yi(t=>t.openRequestKey===Zi(e,M));we&&H!==`guide`&&U(`guide`),(0,Z.useEffect)(()=>{we&&Yi.getState().requestOpen(null)},[we]);let Te=`${e}:${N}`,[Ee,Oe]=(0,Z.useState)(()=>({key:Te,tabs:new Set([`summary`])})),Ne=Ee.key===Te?Ee.tabs:new Set([H]);(0,Z.useEffect)(()=>{Oe(e=>e.key===Te?e.tabs.has(H)?e:{key:Te,tabs:new Set(e.tabs).add(H)}:{key:Te,tabs:new Set([H])})},[H,Te]);let[Pe,Fe]=(0,Z.useState)(!1),Le=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Fe(Le.current[H]??!1)},[H]);let Re=Pe,ze=(0,Z.useRef)({}),Ve=(0,Z.useMemo)(()=>({summary:e=>{ze.current.summary=e},timeline:e=>{ze.current.timeline=e},code:e=>{ze.current.code=e}}),[]),Ge=(0,Z.useRef)(null),Ke=(0,Z.useRef)(null),Je=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=Je.current;e!==null&&(Je.current=null,Re&&e.tab===H&&ze.current[H]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Re,H]);let Ze=Gi(e=>e.pullRequestMergeMethod),$e=Gi(e=>e.setPullRequestMergeMethod),et=Sa(e,M.projectId),tt=(0,Z.useMemo)(()=>et(),[et]),[nt,rt]=(0,Z.useState)(null),it=e=>{rt({pullRequestKey:N,method:e})},at=vd(N),[ot,st]=(0,Z.useState)(null),ct=wt(e,Ie),lt=Et(zr.detail({environmentId:e,input:M})),ut=Et(zr.activity({environmentId:e,input:M})),dt=Fr(e),[ft,pt]=(0,Z.useState)(()=>ei(typeof window>`u`?void 0:window.localStorage,e,M));(0,Z.useEffect)(()=>{pt(ei(typeof window>`u`?void 0:window.localStorage,e,M))},[e,N,M.projectId,M.repository,M.number]),(0,Z.useEffect)(()=>{lt.data!==null&&(ui(typeof window>`u`?void 0:window.localStorage,e,M,lt.data),pt(lt.data))},[lt.data,e,N,M.projectId,M.repository,M.number]);let mt=qr({live:lt.data,cached:ft,reference:M}),ht=(0,Z.useMemo)(()=>P===null?null:Ir(P),[P]),_t=(0,Z.useMemo)(()=>lt.data===null?null:{...lt.data,checksState:br(lt.data.checks)},[lt.data]),xt=Br(e,M,_t,lt.dataUpdatedAt),kt=(0,Z.useMemo)(()=>Rr(mt,Rr(xt,ht)),[mt,xt,ht]),jt=(0,Z.useMemo)(()=>mt===null||kt===null||kt===mt?mt:{...mt,title:kt.title,state:kt.state,headBranch:kt.headBranch,baseBranch:kt.baseBranch,updatedAt:kt.updatedAt,author:kt.author??mt.author,additions:kt.additions??mt.additions,deletions:kt.deletions??mt.deletions,changedFiles:kt.changedFiles??mt.changedFiles,mergeability:kt.mergeability??mt.mergeability,closedAt:kt.closedAt===void 0?mt.closedAt:kt.closedAt,mergedAt:kt.mergedAt===void 0?mt.mergedAt:kt.mergedAt,isDraft:kt.isDraft??mt.isDraft},[mt,kt]),Mt=ut.data,q=(0,Z.useMemo)(()=>jt===null?null:{...jt,capabilities:ct?jt.capabilities:{...jt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:ct?jt.viewerPermissions:{...jt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:Mt?.author??jt.author,reviewers:Mt?.reviewers??jt.reviewers,comments:Mt?.comments??[],commentCount:Mt?.commentCount??0,commentsTruncated:Mt?.commentsTruncated??!1,reviewThreads:Mt?.reviewThreads??[],commits:Mt?.commits??[],reactions:Mt?.reactions??[]},[Mt,ct,jt]),Nt=q??kt,Pt=re(Ct),{copyToClipboard:Ft}=vt({target:`pull request reference`,onCopy:e=>gt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>gt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),It=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||ma()||rr(e,Pt,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||Ft(`#${M.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)(()=>{q?.autoMergeMethod!==void 0&&it(q.autoMergeMethod)},[q?.autoMergeMethod,N]);let Lt=q===null?null:Ye(q.url),Rt=Ar.get(q?.provider),zt=(0,Z.useMemo)(()=>({repositoryUrl:Lt===null?null:Rt.referenceAutolinkRepositoryUrl(Lt),threadRef:o}),[Rt,Lt,o]),Bt=q?.author&&Lt!==null?Rt.authorProfileUrl(q.author.login,Lt):null,Vt=Nt?ti(Nt.provider,Nt.number,Nt.headBranch,q?.headRepositoryNameWithOwner,Ye(Nt.url)):Xr(M,D),Ht=(0,Z.useCallback)(e=>{gt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Ut=Et(q===null?null:At.listRefs({environmentId:e,input:{cwd:q.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Wt=q!==null&&Ai(q.baseBranch,Ut.data?.refs??[]),Gt=yc(e,(0,Z.useMemo)(()=>q===null||q.capabilities.stacks!==!0||!k?null:{...M,host:M.host??Xe(q.url)?.host},[q,M,k])),Kt=Gt.data,qt=k&&q?.capabilities.stacks===!0&&q.capabilities.stackActions===!0&&w.get(e)?.environment.capabilities.pullRequestStackActions===!0,Jt=Ei({supportsStackActions:qt,hasStack:Kt!==null,stackPending:!Gt.isFresh,stackError:Gt.error}),Yt=ut.isPending&&Mt===null,Xt=Mt===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(!jt)return;let e={key:Te,updatedAt:jt.updatedAt};if($r(tn.current,e)){if(ut.isPending)return;ut.refresh(),$t(e=>e+1)}tn.current=e},[ut.isPending,ut.refresh,jt,Te]),Nc(()=>{lt.refresh()},{key:`pull-request:${e}:${N}`});let nn=Dt(zr.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:M}}),Zt(),$t(e=>e+1)}finally{an(!1)}},[e,nn,M,Zt]),cn=(0,Z.useRef)(u);(0,Z.useEffect)(()=>{cn.current!==u&&(cn.current=u,sn())},[u,sn]);let ln=Dt(zr.runAction,{reportFailure:!1}),un=Dt(zr.comment,{reportFailure:!1}),[dn,fn]=(0,Z.useState)(null),pn=dn!==null,mn=Dt(zr.update,{reportFailure:!1}),[hn,gn]=(0,Z.useState)(null),_n=hn?.pullRequestKey===N?hn.text:null,[vn,yn]=(0,Z.useState)(!1),bn=Ji(),{environments:xn}=yt(),Sn=(0,Z.useMemo)(()=>{let t=T.find(t=>t.id===M.projectId&&t.environmentId===e)?.repositoryIdentity;return Qe(t,M.repository,M.number)},[e,T,M.number,M.projectId,M.repository]),wn=(0,Z.useMemo)(()=>g===`page`?gc({environmentId:e,projectId:M.projectId},T,xn.map(e=>({environmentId:e.environmentId,label:e.label,machine:Be(e.serverConfig)}))):[],[g,e,xn,T,M.projectId]),[En,Dn]=(0,Z.useState)(null),On=En?.pullRequestKey===N?En.environmentId:e,kn=wn.find(e=>e.environmentId===On)??null,An=kn?.environmentId??e,jn=kn?.workspaceRoot??q?.workspaceRoot??E?.workspaceRoot??null,Mn=wt(An,se),Nn=Ca({environmentId:An,cwd:jn}),Pn=async(t,n,r)=>{m?.(t,`sent`);let i=await ln({environmentId:e,input:{...M,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(fn(null),i._tag===`Failure`){let e=Ue(i),n=r===`rebase`?xd:bd[t];return gt.add({type:`error`,title:yd[t],description:ai(e,n)}),m?.(t,`failed`),!1}return t===`revert`&&gt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&gt.add({type:`success`,title:`Branch deleted`}),bi(t)?sn():Zt(),m?.(t,`done`),!0},Fn=async(e,t,n)=>!ct||dn!==null?!1:(fn(e),Pn(e,t,n)),In=async(t,n)=>!ct||dn!==null?{commentPosted:!1}:(fn(n),(await un({environmentId:e,input:{...M,body:t}}))._tag===`Failure`?(fn(null),gt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Pn(n)||Zt(),{commentPosted:!0})),Rn=async t=>{let n=t.trim();if(!ct||q===null||vn)return;if(n.length===0||n===q.title){gn(null);return}yn(!0);let r=await mn({environmentId:e,input:{...M,title:n}});if(yn(!1),r._tag===`Failure`){gt.add({type:`error`,title:`The title could not be saved`,description:ai(Ue(r),`The host refused the new title.`)});return}gn(null),Zt()},zn=_??null,Bn=Nn.isAllowed&&Mn,Vn=zn!==null||Bn,Hn=ii(zn!==null),Un=md({environmentId:e,reference:M,title:q?.title??null}),Wn=()=>{Un.write(),Un.data?.guide??U(`guide`)},Gn=(e,t)=>{let n=d.getState(),r=n.getComposerDraft(e),i=Ed(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=Ti(r?.prompt??``,r?.reviewComments??[],o),c=ji({prompt:s,lastHandoffPrompt:Td.get(i)},t.prompt);Td.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,mi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Kn=async(e,t,n)=>{let r=n??await bn(e).then(e=>e,()=>null);return r===null?null:(t===null||Gn(r.draftId,t),r)},qn=async(t,n,r)=>{if(!q||ot!==null)return;if(zn!==null){Gn(zn,n),gt.add({type:`success`,title:`Added to the composer`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`});return}st(t);let i=x(An,kn?.projectId??q.projectId),a=await Kn(i,n);if(st(null),a!==null&&r?.keepGuide===!0){let t=d.getState().getDraftSession(a.draftId);t!==null&&(Ot.getState().openPullRequest(A(t.environmentId,t.threadId),{environmentId:e,projectId:M.projectId,...M.host===void 0?{}:{host:M.host},repository:M.repository,number:M.number,url:q.url}),Yi.getState().requestOpen(Zi(e,M)))}if(a===null){gt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}gt.add({type:`success`,title:`Asked in a thread`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},Jn=async(e,t,n=`worktree`)=>{if(!Nt||ot!==null)return;if(zn!==null&&t!==null){Gn(zn,t),gt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(jn===null||!Nn.isAllowed||!Tt(An,`source-control:write`)||n===`worktree`&&!Tt(An,`orchestration:operate`))return;st(e);let r=gt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=x(An,kn?.projectId??Nt.projectId),a=await bn(i).then(e=>e,()=>null);if(a===null){st(null),gt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Nn.run({reference:Nt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){st(null);let e=Nn.error instanceof Error?Nn.error.message:null;gt.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)){st(null),gt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}st(null);let s={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){gt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:s);return}await Kn(i,t,a),gt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s)},Yn=()=>{q&&qn(`ask`,{...Ci({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft})})},Xn=()=>{q&&qn(`explain`,{...Di({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft})})},Zn=(e,t,n)=>{q&&qn(`guide-stop:${t}`,pi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},Qn=(e,t)=>{q&&qn(`selection:${e.comment.id}`,yi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft,comment:e.comment,request:e.request}),t)},$n=e=>{Nt&&Jn(`checkout:${e}`,null,e)},er=e=>{q&&Jn(ni(e),hi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,finding:e}))},tr=()=>{q&&Jn(`findings`,Si({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,reviewThreads:q.reviewThreads,comments:q.comments,checks:Nr?[]:q.checks,commentsTruncated:q.commentsTruncated}))},nr=()=>{Nt&&Jn(`conflicts`,{prompt:_i({number:Nt.number,url:Nt.url,headBranch:Nt.headBranch,baseBranch:Nt.baseBranch})})},ar=q?q.capabilities.mergeMethods.filter(e=>q.mergeCapabilities[e]):[],or=nt?.pullRequestKey===N?nt.method:null,sr=li(ar,or,tt,Ze),cr=Oi[sr],lr=`Auto-merge (${cr.toLowerCase()})`,ur=q?.state===`open`&&q.mergeability===`conflicting`,dr=q?.state===`open`&&q.autoMergeEnabled===!0,fr=q?.autoMergeMethod,gr=fr?`Auto-merge (${Oi[fr].toLowerCase()})`:`Auto-merge`,_r=q?.state===`open`?q.workflowApprovalsRequired??0:0,yr=q===null?null:Mi(q),xr=St(e,e=>e.reviewGuidesEnabled),Cr=Sd.filter(e=>(e.value!==`code`||q===null||q.capabilities.diff)&&(e.value!==`guide`||xr));(0,Z.useEffect)(()=>{Cr.some(e=>e.value===H)||U(`summary`)},[H,Cr]);let Tr=e=>q?.capabilities.actions.includes(e)===!0&&q.viewerPermissions.actions.includes(e),Er=q?br(q.checks):null,Dr=kt?.checksState===void 0?Er:kt.checksState,jr=Dr!==`failing`&&q?.checks.some(e=>e.status===`action-required`)?`pending`:Dr,Nr=jr!==Er,Pr=q?Zr({state:q.state,isDraft:q.isDraft,mergeability:q.mergeability,checksState:jr,autoMergeEnabled:q.autoMergeEnabled,hasMergeMethod:ar.length>0,canMerge:Jt&&Tr(`merge`),canMarkReady:Tr(`ready`),canEnableAutoMerge:Jt&&Tr(`enable-auto-merge`)}):null,Lr=q?.state===`open`&&Tr(q.isDraft?`ready`:`draft`)&&!(q.isDraft&&Pr===`ready`),Vr=Jt&&q?.state===`open`&&(dr&&Tr(`disable-auto-merge`)||!dr&&Pr!==`enable-auto-merge`&&!q.isDraft&&!ur&&Tr(`enable-auto-merge`)&&ar.length>0),Hr=Jt&&q?.state===`open`&&(Pr===`enable-auto-merge`||Pr===`auto-merge-armed`)&&Tr(`merge`)&&!q.isDraft&&!ur&&ar.length>0,Ur=q?.state===`open`&&Tr(`merge`)&&!q.isDraft&&!ur&&ar.length>1,Wr=q?pr({state:q.state,isDraft:q.isDraft}):null,Gr=q!==null&&wi(q),Jr=xn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),Yr=async()=>{q!==null&&await bt()?.dialogs.confirm([`Delete branch ${q.headBranch}?`,`This deletes ${q.headBranch} from ${q.headRepositoryNameWithOwner??q.repository}. Local branches and worktrees are not changed.`].join(`
214
+ `;function td(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:s,commenting:c,loadDiffFiles:l,onOpenFile:u}=e,[d,f]=(0,Z.useState)(null),{resolvedTheme:p}=xt(),m;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){m=null;break bb0}let e=Hu(r),i=Uu(e,n);if(i.length===0){m=null;break bb0}let a=Ft(Gu(n.path,It(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){m=null;break bb0}let s={additions:new Set(i.flatMap(ad)),deletions:new Set(i.flatMap(id))},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],m=c}t[0]=n,t[1]=r,t[2]=m}else m=t[2];let h=m,g=h?.rows??null,v;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){v=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==l||t[12]!==g?(e=async e=>{let t=await l(e),r=Ku(t.newFile.contents,g);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=l,t[12]=g,t[13]=e):e=t[13],v=e}let y=v,b;t[14]!==c?.pending||t[15]!==d||t[16]!==n.path||t[17]!==n.side||t[18]!==s||t[19]!==h?.drawn?(b=()=>{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 s)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of c?.pending??[]){if(e.path!==n.path)continue;let t=uc(e.position),i=lc(t.side);h?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(d!==null){let e=uc(d.position);r(lc(e.side),e.line,rd)}return[...e.values()]},t[14]=c?.pending,t[15]=d,t[16]=n.path,t[17]=n.side,t[18]=s,t[19]=h?.drawn,t[20]=b):b=t[20],c?.pending;let x;t[21]===b?x=t[22]:(x=b(),t[21]=b,t[22]=x);let S=x,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&&f({range:e,position:t})},t[23]=r,t[24]=C);let w=C,T=c!==null&&d===null,E=c?.onAskAgent??null,D;t[25]!==d||t[26]!==n.path||t[27]!==r||t[28]!==E?(D=e=>{if(d===null||r===null||E===null)return;let t=o({id:`pull-request-guide:${n.path}:${d.range.start}:${d.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:d.range,text:e});f(null),t!==null&&E(t,e)},t[25]=d,t[26]=n.path,t[27]=r,t[28]=E,t[29]=D):D=t[29];let O=D,k;t[30]===p?k=t[31]:(k=Rt(p),t[30]=p,t[31]=k);let A;t[32]===y?A=t[33]:(A=y===null?{hunkSeparators:`simple`}:{loadDiffFiles:y},t[32]=y,t[33]=A);let j;t[34]!==w||t[35]!==T||t[36]!==p||t[37]!==k||t[38]!==A?(j={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:k,themeType:p,preferredHighlighter:ba,unsafeCSS:ed,enableGutterUtility:T,enableLineSelection:T,onGutterUtilityClick:w,onLineSelectionEnd:w,...A},t[34]=w,t[35]=T,t[36]=p,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)(Lu,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=N);let P;t[42]!==S||t[43]!==O||t[44]!==c||t[45]!==d||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]!==u||t[54]!==M||t[55]!==h?(P=h===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:()=>u(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(mn,{fileDiff:h.fileDiff,options:M,lineAnnotations:S,selectedLines:d?.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(nd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(dc,{comment:e,onRemove:()=>c?.onRemove(e.id)},e.id)),e.metadata.draft&&d!==null&&c!==null?(0,$.jsx)(xn,{kind:`draft`,rangeLabel:`${n.path}:${uc(d.position).line}`,text:``,placeholder:c.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:c.canComment?`Add to review`:`Ask agent`,...c.canComment&&E!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>O(e)}}:{},onCancel:()=>f(null),onComment:e=>{if(!c.canComment){O(e);return}c.onComment({path:n.path,oldPath:r===null?null:od(r,n.path),position:d.position,body:e}),f(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 `,h.shown,` of`,` `,h.total,` diff lines`]}),(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>u(n.path),children:(0,$.jsx)(a,{"aria-hidden":!0})})]})})}),t[42]=S,t[43]=O,t[44]=c,t[45]=d,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]=u,t[54]=M,t[55]=h,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 nd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(Zu,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function rd(e){return{...e,draft:!0}}function id(e){return e.oldLine===null?[]:[e.oldLine]}function ad(e){return e.newLine===null?[]:[e.newLine]}function od(e,t){let n=It(e);return n===t?null:n}function sd(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=xt(),a;t[0]===n?a=t[1]:(a=dn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Rt(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:ba,unsafeCSS:Wo,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)(mn,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var cd={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function ld(e){let t=(0,Q.c)(122),{stop:n,index:i,stopCount:a,railOpen:o,onRailOpenChange:s,stopList:c,nextTitle:l,files:u,loadDiffFiles:d,diffLoading:f,commenting:p,onStep:m,onAsk:h,onFinish:g,onOpenFile:_}=e,v;t[0]===n?v=t[1]:(v=qu(n),t[0]=n,t[1]=v);let{lettered:y,byExcerpt:b}=v,x;t[2]===n.excerpts?x=t[3]:(x=new Set(n.excerpts.map(ud)),t[2]=n.excerpts,t[3]=x);let S=x,C,w,T,E,D,O,k,A,j;if(t[4]!==b||t[5]!==p||t[6]!==f||t[7]!==S||t[8]!==u||t[9]!==i||t[10]!==y||t[11]!==d||t[12]!==_||t[13]!==s||t[14]!==m||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]!==a||t[22]!==c){let e;t[32]===S?e=t[33]:(e=e=>!S.has(e.path),t[32]=S,t[33]=e);let r=n.files.filter(e);C=y.length>0;let l=C&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===l?w=t[35]:(w=K(`grid gap-8`,l),t[34]=l,t[35]=w),T=`flex min-w-0 flex-col gap-5`;let h=i+1,g;t[36]!==a||t[37]!==h?(g=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,a]}),t[36]=a,t[37]=h,t[38]=g):g=t[38];let v;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=v):v=t[39];let x=i+1,M;t[40]!==a||t[41]!==x?(M=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,x,` of `,a]}),t[40]=a,t[41]=x,t[42]=M):M=t[42];let N=o&&`rotate-180`,P;t[43]===N?P=t[44]:(P=K(N),t[43]=N,t[44]=P);let F;t[45]===P?F=t[46]:(F=(0,$.jsx)(fe,{"aria-hidden":!0,className:P}),t[45]=P,t[46]=F);let I;t[47]!==M||t[48]!==F?(I=(0,$.jsxs)(xa,{render:v,children:[M,F]}),t[47]=M,t[48]=F,t[49]=I):I=t[49];let L=i===0,R;t[50]===m?R=t[51]:(R=()=>m(-1),t[50]=m,t[51]=R);let z;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(ze,{"aria-hidden":!0}),t[52]=z):z=t[52];let B;t[53]!==L||t[54]!==R?(B=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:L,onClick:R,children:z}),t[53]=L,t[54]=R,t[55]=B):B=t[55];let V=i===a-1,H;t[56]===m?H=t[57]:(H=()=>m(1),t[56]=m,t[57]=H);let ee;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(fe,{"aria-hidden":!0}),t[58]=ee):ee=t[58];let te;t[59]!==V||t[60]!==H?(te=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:V,onClick:H,children:ee}),t[59]=V,t[60]=H,t[61]=te):te=t[61];let ne;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(aa,{children:`J`}),(0,$.jsx)(aa,{children:`K`})]}),t[62]=ne):ne=t[62];let U;t[63]!==B||t[64]!==te?(U=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[B,te,ne]}),t[63]=B,t[64]=te,t[65]=U):U=t[65];let W;t[66]!==g||t[67]!==I||t[68]!==U?(W=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[g,I,U]}),t[66]=g,t[67]=I,t[68]=U,t[69]=W):W=t[69];let re;t[70]===c?re=t[71]:(re=(0,$.jsx)(ga,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:c})}),t[70]=c,t[71]=re),t[72]!==s||t[73]!==o||t[74]!==W||t[75]!==re?(E=(0,$.jsxs)(ua,{open:o,onOpenChange:s,children:[W,re]}),t[72]=s,t[73]=o,t[74]=W,t[75]=re,t[76]=E):E=t[76];let ie;t[77]===n.title?ie=t[78]:(ie=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=ie);let oe;t[79]===n.summary?oe=t[80]:(oe=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(Lu,{text:n.summary})}),t[79]=n.summary,t[80]=oe),t[81]!==ie||t[82]!==oe?(D=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[ie,oe]}),t[81]=ie,t[82]=oe,t[83]=D):D=t[83],t[84]===n.attention?O=t[85]:(O=n.attention===null?null:(0,$.jsxs)(ia,{controlAlignment:`first-line`,children:[(0,$.jsx)(we,{}),(0,$.jsx)(ta,{children:cd[n.attention.kind]}),(0,$.jsx)(ra,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Lu,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=O),t[86]!==b||t[87]!==p||t[88]!==f||t[89]!==u||t[90]!==d||t[91]!==_||t[92]!==n.excerpts?(k=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(un,{children:n.excerpts.map((e,t)=>(0,$.jsx)(td,{excerpt:e,file:u.get(e.path)??null,loading:f,notes:b[t]??[],commenting:p,loadDiffFiles:d,onOpenFile:_},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=b,t[87]=p,t[88]=f,t[89]=u,t[90]=d,t[91]=_,t[92]=n.excerpts,t[93]=k):k=t[93],t[94]===y?A=t[95]:(A=(0,$.jsx)(Qu,{notes:y,className:`@min-[90rem]/guide:hidden`}),t[94]=y,t[95]=A),j=r.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)(un,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:r.map(e=>{let t=u.get(e.path),n=t===void 0?null:Ht([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(ua,{children:[(0,$.jsxs)(xa,{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)(Pe,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(ae,{"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)(Lu,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Sr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(ga,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:f?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(sd,{file:t,loadDiffFiles:d})})]})},e.path)})})})]}):null,t[4]=b,t[5]=p,t[6]=f,t[7]=S,t[8]=u,t[9]=i,t[10]=y,t[11]=d,t[12]=_,t[13]=s,t[14]=m,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]=a,t[22]=c,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A,t[31]=j}else C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28],k=t[29],A=t[30],j=t[31];let M;t[96]!==h||t[97]!==n.questions?(M=n.questions.length>0||h!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>h===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Lu,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>h(e),className:`flex min-w-0 items-start gap-2 rounded-lg border border-border/60 px-3 py-1.5 text-left text-sm text-foreground outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(r,{"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)(Lu,{text:e,plain:!0})})]},e)),h===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>h(``),children:[(0,$.jsx)(r,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=h,t[97]=n.questions,t[98]=M):M=t[98];let N;t[99]!==l||t[100]!==g||t[101]!==m?(N=l===null?g===null?null:(0,$.jsxs)(G,{onClick:g,children:[(0,$.jsx)(Ae,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(G,{className:`min-w-0`,onClick:()=>m(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,l]}),(0,$.jsx)(Ee,{"aria-hidden":!0})]}),t[99]=l,t[100]=g,t[101]=m,t[102]=N):N=t[102];let P;t[103]===N?P=t[104]:(P=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:N}),t[103]=N,t[104]=P);let F;t[105]!==M||t[106]!==P||t[107]!==T||t[108]!==E||t[109]!==D||t[110]!==O||t[111]!==k||t[112]!==A||t[113]!==j?(F=(0,$.jsxs)(`article`,{className:T,children:[E,D,O,k,A,j,M,P]}),t[105]=M,t[106]=P,t[107]=T,t[108]=E,t[109]=D,t[110]=O,t[111]=k,t[112]=A,t[113]=j,t[114]=F):F=t[114];let I;t[115]!==C||t[116]!==y?(I=C?(0,$.jsx)(`aside`,{className:`hidden @min-[90rem]/guide:block @min-[90rem]/guide:sticky @min-[90rem]/guide:top-4 @min-[90rem]/guide:self-start`,children:(0,$.jsx)(Qu,{notes:y})}):null,t[115]=C,t[116]=y,t[117]=I):I=t[117];let L;return t[118]!==w||t[119]!==F||t[120]!==I?(L=(0,$.jsxs)(`div`,{className:w,children:[F,I]}),t[118]=w,t[119]=F,t[120]=I,t[121]=L):L=t[121],L}function ud(e){return e.path}var dd=new Map;function fd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=Pi(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:dd},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:dd},f=a.some(e=>!d.files.has(e))&&!d.done,p=Et,m=f?zr.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:dd};if(t.cursor!==_||t.done)return t;let n=Ft(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Gt(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 pd(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=$i(Zi(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=Qi(f),m;t[4]===f?m=t[5]:(m=e=>Yi.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?[]:zu(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=fd(C),T=Dt(zr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Jo(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(Ru(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||ma()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||(e.key===`j`||e.key===`k`)&&(Xi(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)(Ju,{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)(ld,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(Ju,{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 md(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=zr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=Et(a),s;t[3]===n?s=t[4]:(s=zr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=re(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=Dt(zr.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=()=>Yi.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`&&(Yi.getState().settle(Zi(n,r)),gt.add({type:`error`,title:`Could not start a review guide`,description:ai(Ue(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 hd(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:h,data:g,running:_,canWrite:v,write:y}=md(p),b;t[4]!==n||t[5]!==r?(b=Zi(n,r),t[4]=n,t[5]=r,t[6]=b):b=t[6];let x=b,S;t[7]===r?S=t[8]:(S=Pi(r),t[7]=r,t[8]=S);let C=S,w=Fi(r),T=Ni(_d),E=Ni(gd),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:Ii(),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 Yi.getState().setShown(x),()=>{Yi.getState().shownKey===x&&Yi.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=g?.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=g?.run??null,R=g?.currentHeadSha??null,z=j!==null&&R!==null&&R!==j.headSha,B=L?._tag===`Failed`&&L.headSha===R?L.detail:null,V;t[27]!==v||t[28]!==_||t[29]!==y?(V=(e,t)=>v?(0,$.jsxs)(G,{size:t,variant:`outline`,disabled:_,onClick:()=>void y(),children:[_?(0,$.jsx)(ht,{}):(0,$.jsx)(le,{"aria-hidden":!0,className:`size-3.5`}),_?`Reading the change...`:e]}):null,t[27]=v,t[28]=_,t[29]=y,t[30]=V):V=t[30];let H=V;if(j===null){if(h.isPending&&g===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)(ht,{})}),t[31]=e):e=t[31],e}let e=_?`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??h.error??(_?`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]!==v||t[44]!==B||t[45]!==_||t[46]!==z||t[47]!==H?(ee=z||B!==null||_?(0,$.jsxs)(ia,{variant:_?`info`:`warning`,children:[_?(0,$.jsx)(ht,{}):(0,$.jsx)(m,{}),(0,$.jsx)(ra,{children:_?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!_&&v?(0,$.jsx)(na,{children:H(`Rewrite`,`xs`)}):null]}):null,t[43]=v,t[44]=B,t[45]=_,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 W;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?(W=(0,$.jsx)(pd,{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]=W):W=t[64];let re;return t[65]!==ne||t[66]!==W?(re=(0,$.jsx)(Iu,{value:ne,children:W}),t[65]=ne,t[66]=W,t[67]=re):re=t[67],re}function gd(e){return e.removeComment}function _d(e){return e.addComment}function vd(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 yd={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not turn on auto-merge`,"disable-auto-merge":`Could not turn off auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},bd={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access to the branch — one from a fork also needs its author to allow edits from maintainers — and that it does not conflict with the base.`,"enable-auto-merge":`The host refused it. Check that this repository allows auto-merge, that you have write access, and that there is something left for it to wait on.`,"disable-auto-merge":`The host refused it. Check that you have write access, and that the merge has not already happened.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`},xd=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,Sd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Cd=()=>t(()=>import(`./PullRequestCodeTab-DkUNpmvf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336])),wd=(0,Z.lazy)(Cd),Td=new Map,Ed=e=>typeof e==`string`?e:D(e);function Dd(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)(je,{}),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)(ea,{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)(I,{value:r,onValueChange:c,children:l})]}),t[8]=c,t[9]=l,t[10]=r,t[11]=u):u=t[11],u}var Od=(e,t)=>{e.preventDefault(),e.stopPropagation(),Sl({url:t.url,openLabel:bl(Ar.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function kd(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 h;t[9]===p?h=t[10]:(h=(0,$.jsx)(m,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=h);let g;t[11]!==c||t[12]!==f||t[13]!==h?(g=(0,$.jsxs)(Wr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,h]}),t[11]=c,t[12]=f,t[13]=h,t[14]=g):g=t[14];let _;t[15]===u?_=t[16]:(_=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=_);let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=v):v=t[17];let y;t[18]!==r.methods||t[19]!==a||t[20]!==i?(y=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)(Mr.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]=y):y=t[21];let b;t[22]!==_||t[23]!==y?(b=(0,$.jsxs)(Hr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[_,v,y]}),t[22]=_,t[23]=y,t[24]=b):b=t[24];let x;return t[25]!==b||t[26]!==g?(x=(0,$.jsxs)(Gr,{children:[g,b]}),t[25]=b,t[26]=g,t[27]=x):x=t[27],x}function Ad({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:o=null,reference:s,listEntry:c=null,refreshToken:u=0,onActed:m,onClose:h,context:g=`page`,composerDraftTarget:_,onBack:v,onSelectPullRequest:b,onGuideShown:C}){let w=qe(),T=We(),E=T.find(t=>t.id===s.projectId&&t.environmentId===e),D=E?.repositoryIdentity,k=w.get(e)?.environment.capabilities.threadPullRequests===!0,M=(0,Z.useMemo)(()=>k?ci(s,D):{projectId:s.projectId,repository:s.repository,number:s.number},[s,D,k]),N=`${M.projectId}:${M.host??``}:${M.repository}#${M.number}`,P=c?.projectId===M.projectId&&c.repository.toLowerCase()===M.repository.toLowerCase()&&(M.host===void 0||c.host.toLowerCase()===M.host.toLowerCase())&&c.number===M.number?c:null,[F,R]=(0,Z.useState)(!1),[B,V]=(0,Z.useState)(0),[H,U]=(0,Z.useState)(`summary`),[ie,ae]=(0,Z.useState)(`newest`),[ce,ue]=(0,Z.useState)(()=>({pullRequestKey:N,oid:null})),de=ce.pullRequestKey===N?ce.oid:null,he=e=>{ue({pullRequestKey:N,oid:e})},ge=e=>{he(e),U(`code`)},[ve,ye]=(0,Z.useState)(null),xe=e=>{he(null),ye(t=>({path:e,nonce:(t?.nonce??0)+1})),Cd(),U(`code`)},we=Yi(t=>t.openRequestKey===Zi(e,M));we&&H!==`guide`&&U(`guide`),(0,Z.useEffect)(()=>{we&&Yi.getState().requestOpen(null)},[we]);let Te=`${e}:${N}`,[Ee,Oe]=(0,Z.useState)(()=>({key:Te,tabs:new Set([`summary`])})),Ne=Ee.key===Te?Ee.tabs:new Set([H]);(0,Z.useEffect)(()=>{Oe(e=>e.key===Te?e.tabs.has(H)?e:{key:Te,tabs:new Set(e.tabs).add(H)}:{key:Te,tabs:new Set([H])})},[H,Te]);let[Pe,Fe]=(0,Z.useState)(!1),Le=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Fe(Le.current[H]??!1)},[H]);let Re=Pe,ze=(0,Z.useRef)({}),Ve=(0,Z.useMemo)(()=>({summary:e=>{ze.current.summary=e},timeline:e=>{ze.current.timeline=e},code:e=>{ze.current.code=e}}),[]),Ge=(0,Z.useRef)(null),Ke=(0,Z.useRef)(null),Je=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=Je.current;e!==null&&(Je.current=null,Re&&e.tab===H&&ze.current[H]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Re,H]);let Ze=Gi(e=>e.pullRequestMergeMethod),$e=Gi(e=>e.setPullRequestMergeMethod),et=Sa(e,M.projectId),tt=(0,Z.useMemo)(()=>et(),[et]),[nt,rt]=(0,Z.useState)(null),it=e=>{rt({pullRequestKey:N,method:e})},at=vd(N),[ot,st]=(0,Z.useState)(null),ct=wt(e,Ie),lt=Et(zr.detail({environmentId:e,input:M})),ut=Et(zr.activity({environmentId:e,input:M})),dt=Fr(e),[ft,pt]=(0,Z.useState)(()=>ei(typeof window>`u`?void 0:window.localStorage,e,M));(0,Z.useEffect)(()=>{pt(ei(typeof window>`u`?void 0:window.localStorage,e,M))},[e,N,M.projectId,M.repository,M.number]),(0,Z.useEffect)(()=>{lt.data!==null&&(ui(typeof window>`u`?void 0:window.localStorage,e,M,lt.data),pt(lt.data))},[lt.data,e,N,M.projectId,M.repository,M.number]);let mt=qr({live:lt.data,cached:ft,reference:M}),ht=(0,Z.useMemo)(()=>P===null?null:Ir(P),[P]),_t=(0,Z.useMemo)(()=>lt.data===null?null:{...lt.data,checksState:br(lt.data.checks)},[lt.data]),xt=Br(e,M,_t,lt.dataUpdatedAt),kt=(0,Z.useMemo)(()=>Rr(mt,Rr(xt,ht)),[mt,xt,ht]),jt=(0,Z.useMemo)(()=>mt===null||kt===null||kt===mt?mt:{...mt,title:kt.title,state:kt.state,headBranch:kt.headBranch,baseBranch:kt.baseBranch,updatedAt:kt.updatedAt,author:kt.author??mt.author,additions:kt.additions??mt.additions,deletions:kt.deletions??mt.deletions,changedFiles:kt.changedFiles??mt.changedFiles,mergeability:kt.mergeability??mt.mergeability,closedAt:kt.closedAt===void 0?mt.closedAt:kt.closedAt,mergedAt:kt.mergedAt===void 0?mt.mergedAt:kt.mergedAt,isDraft:kt.isDraft??mt.isDraft},[mt,kt]),Mt=ut.data,q=(0,Z.useMemo)(()=>jt===null?null:{...jt,capabilities:ct?jt.capabilities:{...jt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:ct?jt.viewerPermissions:{...jt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:Mt?.author??jt.author,reviewers:Mt?.reviewers??jt.reviewers,comments:Mt?.comments??[],commentCount:Mt?.commentCount??0,commentsTruncated:Mt?.commentsTruncated??!1,reviewThreads:Mt?.reviewThreads??[],commits:Mt?.commits??[],reactions:Mt?.reactions??[]},[Mt,ct,jt]),Nt=q??kt,Pt=re(Ct),{copyToClipboard:Ft}=vt({target:`pull request reference`,onCopy:e=>gt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>gt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),It=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||ma()||rr(e,Pt,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||Ft(`#${M.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)(()=>{q?.autoMergeMethod!==void 0&&it(q.autoMergeMethod)},[q?.autoMergeMethod,N]);let Lt=q===null?null:Ye(q.url),Rt=Ar.get(q?.provider),zt=(0,Z.useMemo)(()=>({repositoryUrl:Lt===null?null:Rt.referenceAutolinkRepositoryUrl(Lt),threadRef:o}),[Rt,Lt,o]),Bt=q?.author&&Lt!==null?Rt.authorProfileUrl(q.author.login,Lt):null,Vt=Nt?ti(Nt.provider,Nt.number,Nt.headBranch,q?.headRepositoryNameWithOwner,Ye(Nt.url)):Xr(M,D),Ht=(0,Z.useCallback)(e=>{gt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Ut=Et(q===null?null:At.listRefs({environmentId:e,input:{cwd:q.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Wt=q!==null&&Ai(q.baseBranch,Ut.data?.refs??[]),Gt=yc(e,(0,Z.useMemo)(()=>q===null||q.capabilities.stacks!==!0||!k?null:{...M,host:M.host??Xe(q.url)?.host},[q,M,k])),Kt=Gt.data,qt=k&&q?.capabilities.stacks===!0&&q.capabilities.stackActions===!0&&w.get(e)?.environment.capabilities.pullRequestStackActions===!0,Jt=Ei({supportsStackActions:qt,hasStack:Kt!==null,stackPending:!Gt.isFresh,stackError:Gt.error}),Yt=ut.isPending&&Mt===null,Xt=Mt===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(!jt)return;let e={key:Te,updatedAt:jt.updatedAt};if($r(tn.current,e)){if(ut.isPending)return;ut.refresh(),$t(e=>e+1)}tn.current=e},[ut.isPending,ut.refresh,jt,Te]),Nc(()=>{lt.refresh()},{key:`pull-request:${e}:${N}`});let nn=Dt(zr.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:M}}),Zt(),$t(e=>e+1)}finally{an(!1)}},[e,nn,M,Zt]),cn=(0,Z.useRef)(u);(0,Z.useEffect)(()=>{cn.current!==u&&(cn.current=u,sn())},[u,sn]);let ln=Dt(zr.runAction,{reportFailure:!1}),un=Dt(zr.comment,{reportFailure:!1}),[dn,fn]=(0,Z.useState)(null),pn=dn!==null,mn=Dt(zr.update,{reportFailure:!1}),[hn,gn]=(0,Z.useState)(null),_n=hn?.pullRequestKey===N?hn.text:null,[vn,yn]=(0,Z.useState)(!1),bn=Ji(),{environments:xn}=yt(),Sn=(0,Z.useMemo)(()=>{let t=T.find(t=>t.id===M.projectId&&t.environmentId===e)?.repositoryIdentity;return Qe(t,M.repository,M.number)},[e,T,M.number,M.projectId,M.repository]),wn=(0,Z.useMemo)(()=>g===`page`?gc({environmentId:e,projectId:M.projectId},T,xn.map(e=>({environmentId:e.environmentId,label:e.label,machine:Be(e.serverConfig)}))):[],[g,e,xn,T,M.projectId]),[En,Dn]=(0,Z.useState)(null),On=En?.pullRequestKey===N?En.environmentId:e,kn=wn.find(e=>e.environmentId===On)??null,An=kn?.environmentId??e,jn=kn?.workspaceRoot??q?.workspaceRoot??E?.workspaceRoot??null,Mn=wt(An,se),Nn=Ca({environmentId:An,cwd:jn}),Pn=async(t,n,r)=>{m?.(t,`sent`);let i=await ln({environmentId:e,input:{...M,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(fn(null),i._tag===`Failure`){let e=Ue(i),n=r===`rebase`?xd:bd[t];return gt.add({type:`error`,title:yd[t],description:ai(e,n)}),m?.(t,`failed`),!1}return t===`revert`&&gt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&gt.add({type:`success`,title:`Branch deleted`}),bi(t)?sn():Zt(),m?.(t,`done`),!0},Fn=async(e,t,n)=>!ct||dn!==null?!1:(fn(e),Pn(e,t,n)),In=async(t,n)=>!ct||dn!==null?{commentPosted:!1}:(fn(n),(await un({environmentId:e,input:{...M,body:t}}))._tag===`Failure`?(fn(null),gt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Pn(n)||Zt(),{commentPosted:!0})),Rn=async t=>{let n=t.trim();if(!ct||q===null||vn)return;if(n.length===0||n===q.title){gn(null);return}yn(!0);let r=await mn({environmentId:e,input:{...M,title:n}});if(yn(!1),r._tag===`Failure`){gt.add({type:`error`,title:`The title could not be saved`,description:ai(Ue(r),`The host refused the new title.`)});return}gn(null),Zt()},zn=_??null,Bn=Nn.isAllowed&&Mn,Vn=zn!==null||Bn,Hn=ii(zn!==null),Un=md({environmentId:e,reference:M,title:q?.title??null}),Wn=()=>{Un.write(),Un.data?.guide??U(`guide`)},Gn=(e,t)=>{let n=d.getState(),r=n.getComposerDraft(e),i=Ed(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=Ti(r?.prompt??``,r?.reviewComments??[],o),c=ji({prompt:s,lastHandoffPrompt:Td.get(i)},t.prompt);Td.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,mi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Kn=async(e,t,n)=>{let r=n??await bn(e).then(e=>e,()=>null);return r===null?null:(t===null||Gn(r.draftId,t),r)},qn=async(t,n,r)=>{if(!q||ot!==null)return;if(zn!==null){Gn(zn,n),gt.add({type:`success`,title:`Added to the composer`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`});return}st(t);let i=x(An,kn?.projectId??q.projectId),a=await Kn(i,n);if(st(null),a!==null&&r?.keepGuide===!0){let t=d.getState().getDraftSession(a.draftId);t!==null&&(Ot.getState().openPullRequest(A(t.environmentId,t.threadId),{environmentId:e,projectId:M.projectId,...M.host===void 0?{}:{host:M.host},repository:M.repository,number:M.number,url:q.url}),Yi.getState().requestOpen(Zi(e,M)))}if(a===null){gt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}gt.add({type:`success`,title:`Asked in a thread`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},Jn=async(e,t,n=`worktree`)=>{if(!Nt||ot!==null)return;if(zn!==null&&t!==null){Gn(zn,t),gt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(jn===null||!Nn.isAllowed||!Tt(An,`source-control:write`)||n===`worktree`&&!Tt(An,`orchestration:operate`))return;st(e);let r=gt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=x(An,kn?.projectId??Nt.projectId),a=await bn(i).then(e=>e,()=>null);if(a===null){st(null),gt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Nn.run({reference:Nt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){st(null);let e=Nn.error instanceof Error?Nn.error.message:null;gt.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)){st(null),gt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}st(null);let s={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){gt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:s);return}await Kn(i,t,a),gt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s)},Yn=()=>{q&&qn(`ask`,{...Ci({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft})})},Xn=()=>{q&&qn(`explain`,{...Di({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft})})},Zn=(e,t,n)=>{q&&qn(`guide-stop:${t}`,pi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},Qn=(e,t)=>{q&&qn(`selection:${e.comment.id}`,yi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,state:q.state,isDraft:q.isDraft,comment:e.comment,request:e.request}),t)},$n=e=>{Nt&&Jn(`checkout:${e}`,null,e)},er=e=>{q&&Jn(ni(e),hi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,finding:e}))},tr=()=>{q&&Jn(`findings`,Si({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,reviewThreads:q.reviewThreads,comments:q.comments,checks:Nr?[]:q.checks,commentsTruncated:q.commentsTruncated}))},nr=()=>{Nt&&Jn(`conflicts`,{prompt:_i({number:Nt.number,url:Nt.url,headBranch:Nt.headBranch,baseBranch:Nt.baseBranch})})},ar=q?q.capabilities.mergeMethods.filter(e=>q.mergeCapabilities[e]):[],or=nt?.pullRequestKey===N?nt.method:null,sr=li(ar,or,tt,Ze),cr=Oi[sr],lr=`Auto-merge (${cr.toLowerCase()})`,ur=q?.state===`open`&&q.mergeability===`conflicting`,dr=q?.state===`open`&&q.autoMergeEnabled===!0,fr=q?.autoMergeMethod,gr=fr?`Auto-merge (${Oi[fr].toLowerCase()})`:`Auto-merge`,_r=q?.state===`open`?q.workflowApprovalsRequired??0:0,yr=q===null?null:Mi(q),xr=St(e,e=>e.reviewGuidesEnabled),Cr=Sd.filter(e=>(e.value!==`code`||q===null||q.capabilities.diff)&&(e.value!==`guide`||xr));(0,Z.useEffect)(()=>{Cr.some(e=>e.value===H)||U(`summary`)},[H,Cr]);let Tr=e=>q?.capabilities.actions.includes(e)===!0&&q.viewerPermissions.actions.includes(e),Er=q?br(q.checks):null,Dr=kt?.checksState===void 0?Er:kt.checksState,jr=Dr!==`failing`&&q?.checks.some(e=>e.status===`action-required`)?`pending`:Dr,Nr=jr!==Er,Pr=q?Zr({state:q.state,isDraft:q.isDraft,mergeability:q.mergeability,checksState:jr,autoMergeEnabled:q.autoMergeEnabled,hasMergeMethod:ar.length>0,canMerge:Jt&&Tr(`merge`),canMarkReady:Tr(`ready`),canEnableAutoMerge:Jt&&Tr(`enable-auto-merge`)}):null,Lr=q?.state===`open`&&Tr(q.isDraft?`ready`:`draft`)&&!(q.isDraft&&Pr===`ready`),Vr=Jt&&q?.state===`open`&&(dr&&Tr(`disable-auto-merge`)||!dr&&Pr!==`enable-auto-merge`&&!q.isDraft&&!ur&&Tr(`enable-auto-merge`)&&ar.length>0),Hr=Jt&&q?.state===`open`&&(Pr===`enable-auto-merge`||Pr===`auto-merge-armed`)&&Tr(`merge`)&&!q.isDraft&&!ur&&ar.length>0,Ur=q?.state===`open`&&Tr(`merge`)&&!q.isDraft&&!ur&&ar.length>1,Wr=q?pr({state:q.state,isDraft:q.isDraft}):null,Gr=q!==null&&wi(q),Jr=xn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),Yr=async()=>{q!==null&&await bt()?.dialogs.confirm([`Delete branch ${q.headBranch}?`,`This deletes ${q.headBranch} from ${q.headRepositoryNameWithOwner??q.repository}. Local branches and worktrees are not changed.`].join(`
215
215
  `),{variant:`destructive`})&&Fn(`delete-branch`)},Qr=_r>0&&!Nr&&Tr(`approve-workflows`),ri=Nr?jr===null?`No checks reported`:vr(jr).label:q?Or(q.checks):null,di=q&&!q.commentsTruncated?si(q.comments,q.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,fi=g===`page`?(0,$.jsxs)(y,{children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(Ce,{disabled:ot!==null||jn===null,render:(0,$.jsxs)(G,{size:`xs`,variant:`outline`,"aria-label":ot?.startsWith(`checkout`)?`Checking out...`:`Check out`,children:[(0,$.jsx)(be,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[35rem]/pr-header:hidden`,children:ot?.startsWith(`checkout`)?`Checking out...`:`Check out`}),(0,$.jsx)(fe,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(Y,{children:`Check out this pull request`})]}),(0,$.jsxs)(oe,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(W,{disabled:!Bn,onClick:()=>$n(`worktree`),children:[(0,$.jsx)(be,{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)(W,{disabled:!Nn.isAllowed,onClick:()=>$n(`local`),children:[(0,$.jsx)(ke,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:`In this repository`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:"Switches the branch you are working in, like `gh pr checkout`."})]})]}),wn.length>0?(0,$.jsx)(Dd,{environments:wn,value:An,onChange:e=>Dn({pullRequestKey:N,environmentId:e}),disabled:ot!==null}):null]})]}):null,gi=(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`destructive-outline`,disabled:ot!==null||zn===null&&jn===null,onClick:nr,"aria-label":ot===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(Mr.conflicting,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:ot===`conflicts`?`Preparing...`:`Resolve conflicts`})]})})}),(0,$.jsx)(Y,{side:`top`,children:ot===`conflicts`?`Preparing...`:`Resolve conflicts`})]});return lt.isPending&&!q?(0,$.jsx)(ul,{seed:P,summary:kt,checkoutCommand:Vt,onCheckoutError:Ht,number:M.number,tabs:Cr,activeTab:H,...v?{onBack:v}:{},...h?{onClose:h}:{},actions:Nt?(0,$.jsxs)(Tn,{delay:150,closeDelay:150,timeout:400,children:[Nt.state===`open`&&Nt.mergeability===`conflicting`?gi:null,fi]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[F&&q?(0,$.jsx)(Jc,{display:`picker`,environmentId:e,reference:M,url:q.url,threadRef:null,onPickerOpenChange:R},`${e}:${q.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`,q&&`border-b border-border/60`,!q&&!h&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":Re,inert:Re,className: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`,Re?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:q&&Wr?(0,$.jsxs)($.Fragment,{children:[v?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,onClick:v,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(j,{"aria-hidden":!0,className:`size-3.5`})})}),(0,$.jsx)(Y,{side:`top`,children:`Back to pull requests`})]}):null,(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:Lt?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void bt()?.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:q.repository}):(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:q.repository})}),(0,$.jsx)(Y,{side:`top`,children:Lt?`Open ${q.repository} repository`:q.repository})]}),(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void bt()?.shell.openExternal(q.url),onContextMenu:e=>Od(e,q),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Wr.toneClassName),"aria-label":`Open pull request #${q.number} on host`,children:[`#`,q.number,(0,$.jsx)(O,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(Y,{side:`top`,children:bl(Rt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!Re,inert:!Re,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`,Re?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:q&&Wr?(0,$.jsxs)($.Fragment,{children:[v?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:Re?0:-1,onClick:v,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(j,{"aria-hidden":!0,className:`size-3.5`})})}),(0,$.jsx)(Y,{side:`top`,children:`Back to pull requests`})]}):null,(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(`button`,{type:`button`,tabIndex:Re?0:-1,onClick:()=>void bt()?.shell.openExternal(q.url),onContextMenu:e=>Od(e,q),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Wr.toneClassName),"aria-label":`Open pull request #${q.number} on host`,children:[`#`,q.number,(0,$.jsx)(O,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(Y,{side:`top`,children:bl(Rt)})]}),(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:q.title})}),(0,$.jsx)(Y,{side:`top`,children:q.title})]})]}):null})]}),(0,$.jsxs)(`div`,{className:`mr-4 flex h-7 shrink-0 items-center justify-end gap-1`,children:[q?(0,$.jsxs)(Tn,{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)(Lc,{hostLabel:Rt.label,stack:Kt,notice:Gt.notice,onRetry:Gt.error?Gt.refresh:void 0,reference:M,environmentId:e,onSelect:b,mergeMethod:sr,canMerge:Gt.isFresh&&qt&&Tr(`merge`)&&ar.length>0,canRebase:Gt.isFresh&&qt&&q.viewerPermissions.stackRebase===!0,onActed:()=>{Zt(),m?.()}}):null,g===`page`?(0,$.jsx)(Jc,{display:`count`,environmentId:e,reference:M,url:q.url,threadRef:null}):null,dr&&Pr!==`auto-merge-armed`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(te,{size:`control`,variant:`info`,role:`img`,"aria-label":gr,children:[(0,$.jsx)(Mr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:gr})]})}),(0,$.jsxs)(Y,{side:`top`,children:[gr,`: the host will merge this on its own once its requirements are met`]})]}):null,Pr===`resolve`?gi:Pr===`ready`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,onClick:()=>void Fn(`ready`),"aria-label":`Ready for review`,children:[(0,$.jsx)(Mr.pullRequest,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:`Ready for review`})]})})}),(0,$.jsx)(Y,{side:`top`,children:`Ready for review`})]}):Pr===`enable-auto-merge`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,...at.props(`enable-auto-merge`,()=>void Fn(`enable-auto-merge`,sr)),"aria-label":dn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:lr,children:[at.isArmed(`enable-auto-merge`)?(0,$.jsx)(me,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Mr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(xc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:lr}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:dn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:lr})]})})]})})}),(0,$.jsx)(Y,{side:`top`,children:dn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:lr})]}):Pr===`auto-merge-armed`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(te,{size:`control`,variant:`info`,role:`img`,"aria-label":gr,children:[(0,$.jsx)(Mr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:gr})]})}),(0,$.jsxs)(Y,{side:`top`,children:[gr,`: the host will merge this on its own once its requirements are met`]})]}):Pr===`merge`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`default`,disabled:pn,...at.props(`merge`,()=>void Fn(`merge`,sr)),"aria-label":dn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:cr,children:[at.isArmed(`merge`)?(0,$.jsx)(me,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Mr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(xc,{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:cr}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:dn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:cr})]})})]})})}),(0,$.jsx)(Y,{side:`top`,children:dn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:cr})]}):(Pr===`merged`||Pr===`closed`)&&Wr!==null?(0,$.jsx)(te,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:K(`flex items-center gap-1`,Wr.toneClassName),children:[(0,$.jsx)(Wr.Icon,{className:`size-3.5`}),Wr.label]})}):null,fi,(0,$.jsxs)(y,{children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(Ce,{render:(0,$.jsx)(G,{"aria-label":on?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:on?(0,$.jsx)(_a,{refreshing:!0,size:`md`}):(0,$.jsx)(Me,{className:`size-4`})})}),(0,$.jsx)(Y,{children:on?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(oe,{align:`end`,side:`bottom`,children:[(0,$.jsx)(Jc,{display:`menu-item`,environmentId:e,reference:M,url:q.url,threadRef:o??(typeof _==`object`?_:null),onPickerOpenChange:R}),(0,$.jsxs)(W,{disabled:on,onClick:()=>void sn(),children:[(0,$.jsx)(_a,{size:`sm`,refreshing:on}),`Refresh`]}),(0,$.jsxs)(W,{disabled:ot!==null,onClick:Yn,children:[(0,$.jsx)(r,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:ot===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:zn===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(W,{disabled:ot!==null,onClick:Xn,children:[(0,$.jsx)(De,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:ot===`explain`?`Opening...`:`Explain this PR`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`A walk through the diff and what to read closely.`})]})]}),(0,$.jsxs)(W,{disabled:ot!==null||!Vn,onClick:tr,children:[(0,$.jsx)(p,{className:`size-3.5`}),ot===`findings`?`Preparing...`:Hn.fixFindings]}),xr&&Un.canWrite?(0,$.jsxs)(W,{disabled:Un.running,onClick:Wn,children:[(0,$.jsx)(le,{className:`size-3.5`}),Un.running?`Writing guide...`:Un.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,wn.length>0?(0,$.jsx)(Dd,{environments:wn,value:An,onChange:e=>Dn({pullRequestKey:N,environmentId:e}),disabled:ot!==null}):null,(0,$.jsx)(je,{}),q.state===`open`?(0,$.jsxs)($.Fragment,{children:[Lr?(0,$.jsxs)(W,{disabled:pn,onClick:()=>void Fn(q.isDraft?`ready`:`draft`),children:[q.isDraft?(0,$.jsx)(Mr.pullRequest,{className:`size-3.5`}):(0,$.jsx)(Mr.draft,{className:`size-3.5`}),q.isDraft?`Ready for review`:`Convert to draft`]}):null,Hr?(0,$.jsxs)(W,{closeOnClick:at.isArmed(`merge`),"aria-label":at.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:pn,...at.props(`merge`,()=>void Fn(`merge`,sr)),children:[(0,$.jsx)(Mr.merged,{className:`size-3.5`}),at.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,dr&&Tr(`disable-auto-merge`)?(0,$.jsxs)(W,{disabled:pn,onClick:()=>void Fn(`disable-auto-merge`),children:[(0,$.jsx)(Mr.merged,{className:`size-3.5`}),`Disable auto-merge`]}):Vr?(0,$.jsxs)(W,{closeOnClick:at.isArmed(`enable-auto-merge`),"aria-label":at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`,disabled:pn,...at.props(`enable-auto-merge`,()=>void Fn(`enable-auto-merge`,sr)),children:[(0,$.jsx)(Mr.merged,{className:`size-3.5`}),at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Ur?(0,$.jsxs)($.Fragment,{children:[Lr||Hr||Vr?(0,$.jsx)(je,{}):null,(0,$.jsx)(I,{value:sr,onValueChange:e=>{let t=e;it(t),$e(t)},children:ar.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)(Mr.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Oi[e]})]})},e))})]}):null,Kr(Lr,Vr||Hr,Ur)?(0,$.jsx)(je,{}):null]}):null,(0,$.jsxs)(W,{onClick:()=>void bt()?.shell.openExternal(q.url),children:[(0,$.jsx)(a,{className:`size-3.5`}),bl(Rt)]}),(0,$.jsxs)(W,{onClick:()=>Ft(q.url,`PR link`),children:[(0,$.jsx)(L,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(Se,{children:ir(Pt,`thread.copyReference`)})]}),(0,$.jsxs)(W,{onClick:()=>Ft(`#${M.number}`,`PR number`),children:[(0,$.jsx)(He,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(Se,{children:ir(Pt,`pullRequest.copyNumber`)})]}),q.state===`open`&&Tr(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{}),(0,$.jsxs)(W,{closeOnClick:at.isArmed(`close`),"aria-label":at.isArmed(`close`)?`Confirm close?`:`Close pull request`,variant:`destructive`,disabled:pn,...at.props(`close`,()=>void Fn(`close`)),children:[(0,$.jsx)(Mr.closed,{className:`size-3.5`}),at.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):q.state===`closed`&&Tr(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{}),(0,$.jsxs)(W,{disabled:pn,onClick:()=>void Fn(`reopen`),children:[(0,$.jsx)(Mr.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):q.state===`merged`&&Tr(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{}),(0,$.jsxs)(W,{closeOnClick:at.isArmed(`revert`),"aria-label":at.isArmed(`revert`)?`Confirm revert?`:`Revert changes`,variant:at.isArmed(`revert`)?`destructive`:`default`,disabled:pn,...at.props(`revert`,()=>void Fn(`revert`)),children:[(0,$.jsx)(ee,{className:`size-3.5`}),at.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null,Gr?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{}),(0,$.jsxs)(W,{variant:`destructive`,disabled:pn||!Jr,onClick:()=>void Yr(),children:[(0,$.jsx)(l,{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:dn===`delete-branch`?`Deleting branch...`:`Delete branch`}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:Jr?q.headBranch:`Reconnect to delete this branch`})]})]})]}):null]})]})]}):null,h?(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:h,children:(0,$.jsx)(z,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Re?`grid-rows-[1fr]`:`grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ke,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Re?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!Re,children:q?(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)(wr,{actor:q.author,profileUrl:Bt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:Cn(q.updatedAt)})]}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-3 w-px shrink-0 bg-border/70`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 font-mono text-2xs text-muted-foreground/65`,children:[yr?(0,$.jsxs)(kd,{baseBranch:q.baseBranch,freshness:yr,pending:pn,onUpdate:e=>void Fn(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Mr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(fa,{value:q.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Wt?(0,$.jsx)(Mr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(fa,{value:q.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(Y,{side:`top`,children:Wt?`Stacked on ${q.baseBranch}`:q.baseBranch})]}),(0,$.jsx)(j,{"aria-label":`receives changes from`,className:`size-3 shrink-0 opacity-60`}),(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`code`,{className:`flex min-w-0 flex-1`,children:(0,$.jsx)(fa,{value:q.headBranch,showTitle:!1})})}),(0,$.jsx)(Y,{side:`top`,children:q.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":`${q.changedFiles.toLocaleString()} changed ${q.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3`}),q.changedFiles.toLocaleString()]}),(0,$.jsx)(Sr,{additions:q.additions,deletions:q.deletions,className:`shrink-0 font-mono text-2xs`})]})]})}):null})}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Re?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ge,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Re?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:Re,children:q?(0,$.jsx)($c,{title:_n===null?(0,$.jsxs)(el,{className:`group gap-1`,children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold leading-snug`,children:q.title})}),(0,$.jsx)(Y,{side:`top`,children:q.title})]}),ys(q)?(0,$.jsx)(Ss,{"aria-label":`Edit title`,onClick:()=>gn({pullRequestKey:N,text:q.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Ln,{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(),Rn(_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:!ct||vn||_n.trim().length===0,onClick:()=>void Rn(_n),children:vn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(wr,{actor:q.author,profileUrl:Bt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,Cn(q.updatedAt)]}),checkout:Vt?(0,$.jsx)(rl,{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:yr?(0,$.jsxs)(kd,{baseBranch:q.baseBranch,freshness:yr,pending:pn,onUpdate:e=>void Fn(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Mr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(fa,{value:q.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Wt?(0,$.jsx)(Mr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(fa,{value:q.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(Y,{side:`top`,children:Wt?`Stacked on ${q.baseBranch}`:q.baseBranch})]}),head:(0,$.jsx)(rl,{value:q.headBranch,target:`branch name`,copyLabel:`Copy pull request branch`,copiedLabel:`Branch name copied`},q.headBranch),files:`${q.changedFiles.toLocaleString()} ${q.changedFiles===1?`file`:`files`}`,diffStat:(0,$.jsx)(Sr,{additions:q.additions,deletions:q.deletions,className:`shrink-0 font-mono text-xs`})}):null})}),q?(0,$.jsx)(tl,{tabs:Cr,value:H,onValueChange:U,onTabIntent:e=>{e===`code`&&Cd()},children:H===`summary`?Qr?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`ml-auto inline-flex shrink-0`,children:(0,$.jsxs)(G,{size:`xs`,variant:`warning-outline`,disabled:pn,...at.props(`approve-workflows`,()=>void Fn(`approve-workflows`)),"aria-label":dn===`approve-workflows`?`Approving...`:at.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`,children:[(0,$.jsx)(_e,{"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...`:at.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]})]})})}),(0,$.jsx)(Y,{side:`top`,children:dn===`approve-workflows`?`Approving...`:at.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]}):(0,$.jsx)(nl,{className:`text-muted-foreground`,"aria-label":ri?`Checks: ${ri}`:`Checks`,icon:jr===null?(0,$.jsx)(f,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Mu,{checks:q.checks,stale:Nr,checksState:jr,threadRef:o}),label:ri}):H===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(mr,{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`:`${q.commentCount.toLocaleString()} ${q.commentCount===1?`comment`:`comments`}`,children:[(0,$.jsx)(Ae,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:q.commentCount.toLocaleString()]}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Xt?`Commits unavailable`:`${q.commits.length.toLocaleString()} ${q.commits.length===1?`commit`:`commits`}`,children:[(0,$.jsx)(pe,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:q.commits.length.toLocaleString()]}),di>0?(0,$.jsxs)(`span`,{className:K(`inline-flex items-center gap-1`,kr(`approved`)),children:[(0,$.jsx)(hr,{outcome:`approved`,className:`size-3`}),di.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:di===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(G,{size:`xs`,variant:`ghost-muted`,"aria-label":ie===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>ae(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(S,{"aria-hidden":!0,className:`size-3`}),ie===`newest`?`Newest first`:`Oldest first`]})]}):null}):null]}),(0,$.jsx)(`div`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,onScrollCapture:e=>{let t=ze.current[H];if(e.target!==t||t==null)return;let n=t.scrollTop;Fe(e=>{let r=e,i=Ge.current?.scrollHeight??0,a=i-(Ke.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(Je.current={tab:H,scroller:t,delta:-a},r=!0),Le.current[H]=r,r})},children:lt.error&&!q?(0,$.jsx)(yl,{...oi(lt.failure)?{title:`Pull request #${M.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}:{}}):q?(0,$.jsxs)(Us,{value:zt,children:[Ne.has(`summary`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,H!==`summary`&&`invisible`),children:(0,$.jsx)(ru,{scrollerRef:Ve.summary,environmentId:e,threadRef:o,reference:M,detail:q,activityPending:Yt,checksStale:Nr,activityError:Xt,pendingFinding:ot,fixFindingLabel:Hn.fixFinding,fixCheckLabel:Hn.fixCheck,...Vn?{onFixFinding:er}:{},onRefresh:Zt,onRefreshChecks:sn})}):null,Ne.has(`guide`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,H!==`guide`&&`invisible`),children:(0,$.jsx)(hd,{environmentId:e,reference:M,active:H===`guide`,title:q.title,workspaceRoot:q.workspaceRoot,canComment:q.capabilities.review.inlineComment&&q.viewerPermissions.comment,onAskAboutLines:(e,t)=>Qn({comment:e,request:t},{keepGuide:!0}),onAskAboutStop:Zn,onFinishReview:q.capabilities.review.verdicts.some(e=>q.viewerPermissions.verdicts.includes(e))?()=>V(e=>e+1):null,onOpenFile:xe,onTourShown:C})}):null,Ne.has(`timeline`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,H!==`timeline`&&`invisible`),children:Yt?(0,$.jsx)(ml,{}):Xt?(0,$.jsx)(vl,{error:Xt,onRetry:ut.refresh}):(0,$.jsx)(Eu,{scrollerRef:Ve.timeline,detail:q,environmentId:e,threadRef:o,reference:M,order:ie,onOpenCommit:ge,onRefresh:Zt})}):null,Ne.has(`code`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,H!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Ao,{label:`Loading pull request diff...`}),children:(0,$.jsx)(wd,{scrollerRef:Ve.code,onAddToAgentSelection:Qn,environmentId:e,reference:M,detail:q,selectedCommitOid:de,onSelectedCommitChange:he,pendingFinding:ot,fixFindingLabel:Hn.fixFinding,...Vn?{onFixFinding:er}:{},onRefresh:Zt,refreshToken:en,revealRequest:ve})})}):null]}):null}),q?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(jl,{environmentId:e,reference:M,detail:q,actionPending:pn,onCommentAction:In,onCommented:Zt,onReviewSubmitted:Zt,openReviewRequest:B},JSON.stringify([e,M.projectId,M.host,M.repository,M.number]))}):null]})}function jd(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=zr.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=d);let f=re(d),p=Sa(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 li(t,null,p(),Gi.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}=wa(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=Lr(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=Md[e].label,r=Md[e].Icon;return(0,$.jsxs)(X,{children:[(0,$.jsxs)(J,{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)(ht,{size:`xs`}):(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),t]}),(0,$.jsx)(Y,{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 Md={close:{label:`Close`,Icon:Mr.closed},merge:{label:`Merge`,Icon:Mr.merged},ready:{label:`Ready for review`,Icon:Mr.pullRequest},reopen:{label:`Reopen`,Icon:Mr.reopen}},Nd=`group/pr-row flex w-full items-center gap-2 rounded-md py-1 pr-1 text-left`,Pd=`shrink-0 font-mono text-xs tabular-nums text-muted-foreground`;function Fd(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)(gr,{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)(fr,{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 Id(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:Cn(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 Ld(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)(xr,{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)(J,{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)(Y,{side:`top`,children:f}),t[15]=f,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(X,{children:[d,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function Rd(e){let t=(0,Q.c)(8),{head:n,base:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(fa,{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)(fa,{value:r,className:`max-w-[45%] shrink-0`}),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 font-mono`,children:[i,a,o]}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}var zd=[`[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(`,`),Bd={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.`},Vd=1,Hd=[pa,da];function Ud(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function Wd(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function Gd(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function Kd(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function qd(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 Jd(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function Yd(e){let t=(0,Q.c)(7),n;t[0]===e.trigger?n=t[1]:(n=(0,$.jsx)(J,{render:e.trigger}),t[0]=e.trigger,t[1]=n);let r;t[2]===e.reason?r=t[3]:(r=(0,$.jsx)(Y,{side:`top`,children:e.reason}),t[2]=e.reason,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(X,{children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Xd(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),i=[{label:`Browser`,icon:c,shortcut:`B`,available:e.browserAvailable,disabledReason:Bd.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:Fe,shortcut:`T`,available:e.terminalAvailable,disabledReason:Bd.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:xe,shortcut:`F`,available:e.filesAvailable,disabledReason:Bd.files,onClick:e.onAddFiles},...e.onAddDesign?[{label:`Design`,icon:Ve,shortcut:`G`,available:e.filesAvailable,disabledReason:`Open a project to use Design.`,onClick:e.onAddDesign}]:[],{label:`Diff`,icon:ne,shortcut:`D`,available:e.diffAvailable,disabledReason:Bd.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:Mr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Bd.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:Mr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Bd.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:Oe,shortcut:`M`,available:e.deviceAvailable,disabledReason:Bd.device,onClick:e.onAddDevice}],a=i.filter(ef),o=a.length===0?-1:Math.min(n,a.length-1),s=(0,Z.useRef)(a);(0,Z.useEffect)(()=>{s.current=a});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=qd(s.current,e);if(!t||document.querySelector(zd))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&Jd(n)||(e.preventDefault(),e.stopPropagation(),t.onClick())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},l);let u=e=>{if(!(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)&&a.length!==0){if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault(),r((o+1)%a.length);return}if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault(),r(o===-1?a.length-1:(o-1+a.length)%a.length);return}if(e.key===`Enter`){if(e.target!==e.currentTarget)return;let t=a[o];if(!t)return;e.preventDefault(),t.onClick()}}},d=$d,f=e=>o!==-1&&a[o]===e,p=Qd,m;t[1]===a?m=t[2]:(m=a.map(Zd),t[1]=a,t[2]=m);let h=m.join(``),g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`h3`,{className:`mb-3 font-medium text-foreground text-sm`,children:`Tools`}),t[3]=g):g=t[3];let _=i.map(t=>t.available?(0,$.jsxs)(`div`,{className:`group relative`,onMouseEnter:()=>r(a.indexOf(t)),onMouseLeave:()=>r(e=>e===a.indexOf(t)?-1:e),children:[(0,$.jsxs)(`button`,{type:`button`,onClick:t.onClick,className:K(`flex h-10 w-full cursor-pointer items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm transition-colors group-hover:bg-card/60`,f(t)&&`bg-card/60`),children:[p(t,`size-4`),(0,$.jsx)(`span`,{className:K(`min-w-0 flex-1 truncate`,t.label===`Browser`&&e.browserProfiles.length>1&&`pr-8`),children:t.label}),(0,$.jsx)(aa,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(y,{children:[(0,$.jsx)(Ce,{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)(fe,{className:`size-3.5`})}),(0,$.jsx)(oe,{align:`end`,side:`bottom`,sideOffset:6,className:`max-w-56`,children:e.browserProfiles.map(t=>(0,$.jsx)(W,{onClick:()=>e.onAddBrowserInProfile(t.id),children:(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.name})},t.id))})]}):null]},t.label):(0,$.jsx)(Yd,{reason:t.disabledReason,trigger:(0,$.jsxs)(`div`,{tabIndex:0,"aria-disabled":`true`,className:`flex h-10 w-full cursor-default items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm opacity-50`,children:[p(t,`size-4`),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,$.jsx)(aa,{variant:`pill`,children:t.shortcut})]})},t.label)),v;t[4]===_?v=t[5]:(v=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:_}),t[4]=_,t[5]=v);let b;t[6]!==v||t[7]!==g?(b=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[g,v]}),t[6]=v,t[7]=g,t[8]=b):b=t[8];let x;return t[9]!==d||t[10]!==u||t[11]!==b||t[12]!==h?(x=(0,$.jsx)(`div`,{ref:d,tabIndex:0,onKeyDown:u,"aria-label":`Open a surface`,"data-surface-launcher-keys":h,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted px-5 py-6 outline-none`,children:b}),t[9]=d,t[10]=u,t[11]=b,t[12]=h,t[13]=x):x=t[13],x}function Zd(e){return e.shortcut}function Qd(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 $d(e){e?.focus()}function ef(e){return e.available}function tf(e,t,n){switch(e.kind){case`diff`:return`Diff`;case`design`:return`Design`;case`files`:return`Files`;case`file`:return e.relativePath.slice(Math.max(e.relativePath.lastIndexOf(`/`),e.relativePath.lastIndexOf(`\\`))+1);case`terminal`:return n.get(e.activeTerminalId)??Li(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`New tab`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function nf(e){let t=(0,Q.c)(8),{capturedUrl:n,url:r}=e,i;t[0]===r?i=t[1]:(i=ct(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)(c,{className:`size-3 shrink-0`}),t[5]=s):s=t[5];let l;return t[6]===o?l=t[7]:(l=(0,$.jsx)(ps,{sources:o,fallback:s,className:`size-3 shrink-0 rounded-sm object-contain`}),t[6]=o,t[7]=l),l}function rf(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function af(e){let t=(0,Q.c)(17),{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&&rf(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(nf,{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)(ne,{className:`size-3 shrink-0`}),t[3]=e):e=t[3],e}case`design`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ve,{className:`size-3 shrink-0`}),t[4]=e):e=t[4],e}case`files`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(xe,{className:`size-3 shrink-0`}),t[5]=e):e=t[5],e}case`file`:{let e;return t[6]!==n.relativePath||t[7]!==a?(e=(0,$.jsx)(sr,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[6]=n.relativePath,t[7]=a,t[8]=e):e=t[8],e}case`terminal`:{let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Fe,{className:`size-3 shrink-0`}),t[9]=e):e=t[9],e}case`pull-request`:{let e=s?.[n.id],r;return t[10]!==o||t[11]!==n||t[12]!==e?(r=(0,$.jsx)(sf,{surface:n,environmentId:o,seed:e}),t[10]=o,t[11]=n,t[12]=e,t[13]=r):r=t[13],r}case`pull-requests`:{let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Mr.link,{className:`size-3 shrink-0`}),t[14]=e):e=t[14],e}case`device`:{let e;return t[15]===n.target?.platform?e=t[16]:(e=n.target?.platform===`ios`?(0,$.jsx)(ar,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(or,{className:`size-3 shrink-0`}):(0,$.jsx)(Oe,{className:`size-3 shrink-0`}),t[15]=n.target?.platform,t[16]=e),e}}}function of(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 $e(a.pullRequests))Ze(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function sf(e){let t=(0,Q.c)(11),{surface:n,environmentId:r,seed:i}=e,a=n.environmentId??r,o=We(),s=Ke(),c;t[0]!==a||t[1]!==n.projectId?(c=e=>e.environmentId===a&&e.id===n.projectId,t[0]=a,t[1]=n.projectId,t[2]=c):c=t[2];let l=o.find(c)?.repositoryIdentity,u=n.host??(l?.provider?T(l,l.provider):null),d=qe(),f=a===null?void 0:d.get(a)?.environment.capabilities,p=f?.threadPullRequests===!0?of(s,a,u,n)?.snapshot??null:null,m=Et(a===null||f?.pullRequests!==!0||p!==null?null:zr.detail({environmentId:a,input:{projectId:n.projectId,...f?.threadPullRequests===!0&&n.host!==void 0?{host:n.host}:{},repository:n.repository,number:n.number}})).data,h=n.projectId,g;t[3]!==n.number||t[4]!==n.repository||t[5]!==h?(g={projectId:h,repository:n.repository,number:n.number},t[3]=n.number,t[4]=n.repository,t[5]=h,t[6]=g):g=t[6];let _=Br(a,g,null),v=p??Rr(m,_)??i??null;if(v===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Mr.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let y=pr({state:v.state,isDraft:v.isDraft??m?.isDraft??i?.isDraft??!1}),b=y.Icon,x=K(`size-3 shrink-0`,y.toneClassName),S;return t[8]!==y||t[9]!==x?(S=(0,$.jsx)(b,{className:x}),t[8]=y,t[9]=x,t[10]=S):S=t[10],S}function cf(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=Ri(Vi(Bi,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(lf),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)(Hi,{items:a,strategy:Ui,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)(Ki,{sensors:r,collisionDetection:Wi,modifiers:Hd,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function lf(e){return e.id}function uf(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}=zi(o),f;t[8]===l?f=t[9]:(f=qi.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 df(e){let t=(0,Q.c)(101),n=wn&&e.mode===`inline`,r=nr().profiles,{resolvedTheme:i}=xt(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=c):c=t[0];let[l,u]=(0,Z.useState)(c),d=e.open!==!1&&e.surfaces.length>0,f;t[1]!==d||t[2]!==e?(f=t=>{if(!(t.defaultPrevented||t.isComposing)&&rr(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&!document.querySelector(zd)&&(!d||e.browserAvailable)&&(t.preventDefault(),t.stopPropagation(),!t.repeat)){if(!d){document.querySelector(`[data-surface-launcher-keys]`)?.focus();return}e.onAddBrowser()}},t[1]=d,t[2]=e,t[3]=f):f=t[3];let p=(0,Z.useEffectEvent)(f),m;t[4]!==p||t[5]!==e.open?(m=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,p,!0),()=>document.removeEventListener(`keydown`,p,!0)},t[4]=p,t[5]=e.open,t[6]=m):m=t[6];let h;t[7]===e.open?h=t[8]:(h=[e.open],t[7]=e.open,t[8]=h),(0,Z.useEffect)(m,h);let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=Ud(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Vd,n=t&&e.scrollLeft>Vd,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Vd;u(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[9]=g):g=t[9];let _=g,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{let t=Ud(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[10]=v):v=t[10];let y=v,b;t[11]===e?b=t[12]:(b=async(t,n)=>{t.preventDefault(),t.stopPropagation();let r=bt();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=Wd(n,e.previewSessions),c=o?e.desktopByTabId[o]??null:null,l=c?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...Gd({overlay:c,canResolveRuntimeTabId:e.previewRuntimeTabId!==void 0})}),a.push({id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:e.surfaces.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:i>=e.surfaces.length-1},{id:`close-all`,label:`Close all`,disabled:e.surfaces.length===0});let u=await r.contextMenu.show(a,{x:t.clientX,y:t.clientY});bb122:switch(u){case`rename`:s(n.id);break bb122;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb122;case`toggle-mute`:{let t=o&&c?e.previewRuntimeTabId?.(o)??null:null;t&&va?.setAudioMuted(t,!l).catch(hf);break bb122}case`close`:e.onCloseSurface(n);break bb122;case`close-others`:e.onCloseOtherSurfaces(n);break bb122;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb122;case`close-all`:e.onCloseAllSurfaces();break bb122}},t[11]=e,t[12]=b);let x=b,S=mf,C;t[13]===e?C=t[14]:(C=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[13]=e,t[14]=C);let w=C,T,E;t[15]!==e.activeSurfaceId||t[16]!==l.hasOverflow?(T=()=>{e.activeSurfaceId&&l.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},E=[e.activeSurfaceId,l.hasOverflow],t[15]=e.activeSurfaceId,t[16]=l.hasOverflow,t[17]=T,t[18]=E):(T=t[17],E=t[18]),(0,Z.useEffect)(T,E);let D,O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=Ud(a.current);if(!e)return;let t=e.firstElementChild,n=$n(t?[e,t]:e,_);return e.addEventListener(`scroll`,_,{passive:!0}),_(),()=>{n(),e.removeEventListener(`scroll`,_)}},O=[_],t[19]=D,t[20]=O):(D=t[19],O=t[20]),(0,Z.useEffect)(D,O);let k,A;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{let e=Ud(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(),_())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},A=[_],t[21]=k,t[22]=A):(k=t[21],A=t[22]),(0,Z.useEffect)(k,A);let j=e.mode,M;t[23]===e.maximized?M=t[24]:(M=e.maximized===void 0?{}:{maximized:e.maximized},t[23]=e.maximized,t[24]=M);let N;t[25]===e.open?N=t[26]:(N=e.open===void 0?{}:{open:e.open},t[25]=e.open,t[26]=N);let P;t[27]===e.widthStorageKey?P=t[28]:(P=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[27]=e.widthStorageKey,t[28]=P);let I;t[29]===e.defaultWidth?I=t[30]:(I=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[29]=e.defaultWidth,t[30]=I);let L;t[31]===e.inlineSize?L=t[32]:(L=e.inlineSize?{inlineSize:e.inlineSize}:{},t[31]=e.inlineSize,t[32]=L);let R=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,z=n&&`drag-region`,B=n&&`wco:pr-(--workspace-native-controls-inset)`,V=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)]`,ee;t[33]!==R||t[34]!==z||t[35]!==B||t[36]!==V?(ee=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`,R,z,B,V),t[33]=R,t[34]=z,t[35]=B,t[36]=V,t[37]=ee):ee=t[37];let te=e.surfaces,ne=e.onMoveSurface,U;t[38]!==w||t[39]!==x||t[40]!==n||t[41]!==e||t[42]!==o||t[43]!==i?(U=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),c=tf(t,e.previewSessions,e.terminalLabelsById),l=Wd(t,e.previewSessions),u=Kd(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(uf,{surfaceId:t.id,disabled:!e.onMoveSurface||o===t.id,"data-active-tab":r,onMouseDown:S,onAuxClick:e=>w(e,t),onContextMenu:e=>void x(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)(af,{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)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`button`,{type:`button`,className:`cursor-pointer flex size-4 shrink-0 items-center justify-center rounded-sm hover:bg-muted`,"aria-label":u===`muted`?`Unmute ${c}`:`Mute ${c}`,onClick:e=>{e.stopPropagation(),va?.setAudioMuted(d,u!==`muted`).catch(pf)},children:(0,$.jsx)(at,{className:`size-3`,icon:u===`muted`?et:rt})})}),(0,$.jsx)(Y,{children:u===`muted`?`Unmute tab`:`Mute tab`})]}),o===t.id?(0,$.jsx)(`input`,{"aria-label":`Device tab name`,className:`min-w-0 flex-1 rounded-sm bg-background px-1 outline-none ring-1 ring-inset ring-ring`,defaultValue:c,ref:ff,onBlur:n=>{e.onRenameDevice?.(t.id,n.currentTarget.value),s(null)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=c,e.currentTarget.blur())}}):(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`button`,{type:`button`,onDoubleClick:()=>{t.kind===`device`&&e.onRenameDevice&&s(t.id)},className:`cursor-pointer flex h-full min-w-0 flex-1 items-center`,onClick:()=>e.onActivate(t),children:(0,$.jsx)(`span`,{className:`truncate`,children:c})})}),(0,$.jsx)(Y,{children:t.kind===`device`?(0,$.jsx)(gf,{surface:t,environmentId:e.environmentId,title:c}):c})]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close ${c}`,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[38]=w,t[39]=x,t[40]=n,t[41]=e,t[42]=o,t[43]=i,t[44]=U):U=t[44];let W;t[45]!==e.onMoveSurface||t[46]!==e.surfaces||t[47]!==U?(W=(0,$.jsx)(Rn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-right-panel-tab-list":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:(0,$.jsx)(cf,{surfaces:te,onMove:ne,children:U})})}),t[45]=e.onMoveSurface,t[46]=e.surfaces,t[47]=U,t[48]=W):W=t[48];let re;t[49]!==l.canScrollLeft||t[50]!==l.canScrollRight||t[51]!==l.hasOverflow?(re=l.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)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs left`,disabled:!l.canScrollLeft,onClick:()=>y(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(ce,{})})})}),(0,$.jsx)(Y,{children:`Scroll tabs left`})]}),(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(G,{"aria-label":`Scroll tabs right`,disabled:!l.canScrollRight,onClick:()=>y(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(Pe,{})})})}),(0,$.jsx)(Y,{children:`Scroll tabs right`})]})]}):null,t[49]=l.canScrollLeft,t[50]=l.canScrollRight,t[51]=l.hasOverflow,t[52]=re):re=t[52];let ie;t[53]!==d||t[54]!==e.browserAvailable||t[55]!==e.onAddBrowser?(ie=d?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(G,{"aria-label":`New browser tab`,className:`shrink-0 [-webkit-app-region:no-drag]`,disabled:!e.browserAvailable,onClick:e.onAddBrowser,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(F,{className:`size-4`})}),(0,$.jsx)(Y,{children:`New browser tab`})]}):null,t[53]=d,t[54]=e.browserAvailable,t[55]=e.onAddBrowser,t[56]=ie):ie=t[56];let ae;t[57]!==n||t[58]!==e.layoutControls?(ae=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[57]=n,t[58]=e.layoutControls,t[59]=ae):ae=t[59];let oe;t[60]===n?oe=t[61]:(oe=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[60]=n,t[61]=oe);let se;t[62]!==e.layoutControls||t[63]!==ee||t[64]!==W||t[65]!==re||t[66]!==ie||t[67]!==ae||t[68]!==oe?(se=(0,$.jsxs)(`div`,{className:ee,"data-right-panel-tabbar":!0,children:[W,re,ie,e.layoutControls,ae,oe]}),t[62]=e.layoutControls,t[63]=ee,t[64]=W,t[65]=re,t[66]=ie,t[67]=ae,t[68]=oe,t[69]=se):se=t[69];let le;t[70]!==r||t[71]!==e.activeSurfaceId||t[72]!==e.browserAvailable||t[73]!==e.children||t[74]!==e.deviceAvailable||t[75]!==e.diffAvailable||t[76]!==e.filesAvailable||t[77]!==e.onAddBrowser||t[78]!==e.onAddBrowserInProfile||t[79]!==e.onAddDesign||t[80]!==e.onAddDevice||t[81]!==e.onAddDiff||t[82]!==e.onAddFiles||t[83]!==e.onAddPullRequest||t[84]!==e.onAddPullRequests||t[85]!==e.onAddTerminal||t[86]!==e.pullRequestAvailable||t[87]!==e.pullRequestsAvailable||t[88]!==e.terminalAvailable?(le=e.activeSurfaceId===null?(0,$.jsx)(Xd,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,...e.onAddDesign?{onAddDesign:e.onAddDesign}:{},onAddPullRequest:e.onAddPullRequest,onAddPullRequests:e.onAddPullRequests,onAddDevice:e.onAddDevice,browserAvailable:e.browserAvailable,terminalAvailable:e.terminalAvailable,diffAvailable:e.diffAvailable,filesAvailable:e.filesAvailable,pullRequestAvailable:e.pullRequestAvailable,pullRequestsAvailable:e.pullRequestsAvailable,deviceAvailable:e.deviceAvailable}):e.children,t[70]=r,t[71]=e.activeSurfaceId,t[72]=e.browserAvailable,t[73]=e.children,t[74]=e.deviceAvailable,t[75]=e.diffAvailable,t[76]=e.filesAvailable,t[77]=e.onAddBrowser,t[78]=e.onAddBrowserInProfile,t[79]=e.onAddDesign,t[80]=e.onAddDevice,t[81]=e.onAddDiff,t[82]=e.onAddFiles,t[83]=e.onAddPullRequest,t[84]=e.onAddPullRequests,t[85]=e.onAddTerminal,t[86]=e.pullRequestAvailable,t[87]=e.pullRequestsAvailable,t[88]=e.terminalAvailable,t[89]=le):le=t[89];let ue;t[90]===le?ue=t[91]:(ue=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:le}),t[90]=le,t[91]=ue);let de;return t[92]!==e.mode||t[93]!==M||t[94]!==N||t[95]!==P||t[96]!==I||t[97]!==L||t[98]!==se||t[99]!==ue?(de=(0,$.jsxs)(cs,{mode:j,...M,...N,...P,...I,...L,children:[se,ue]}),t[92]=e.mode,t[93]=M,t[94]=N,t[95]=P,t[96]=I,t[97]=L,t[98]=se,t[99]=ue,t[100]=de):de=t[100],de}function ff(e){e?.focus(),e?.select()}function pf(){}function mf(e){e.button===1&&e.preventDefault()}function hf(){}function gf(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=Qn(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 _f=(0,Z.memo)(function(e){let t=(0,Q.c)(31),{showThreadPanelControl:n,showTerminalControl:r,showRightPanelControl:i,terminalAvailable:a,terminalOpen:o,terminalShortcutLabel:s,threadPanelOpen:c,threadPanelPresentation:l,threadPanelPopoverHandle:u,threadPanelShortcutLabel:d,rightPanelAvailable:f,rightPanelOpen:p,rightPanelShortcutLabel:m,rightPanelUnavailableLabel:h,rightPanelTabCount:g,onToggleTerminal:_,onToggleThreadPanel:v,onToggleRightPanel:y}=e,b=n===void 0||n,x=r===void 0||r,S=i===void 0||i,C=h===void 0?`Right panel is unavailable`:h,w=g===void 0?0:g,T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(bf,{}),t[0]=T):T=t[0];let E;t[1]===c?E=t[2]:(E=(0,$.jsx)(On,{className:`relative shrink-0 [-webkit-app-region:no-drag]`,pressed:c,"aria-label":`Toggle thread details panel`,variant:`ghost`,size:`sm`,children:T}),t[1]=c,t[2]=E);let D=E,O;t[3]!==v||t[4]!==l||t[5]!==d?(O=e=>(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:e,...l===`popover`?{}:{onClick:v}}),(0,$.jsxs)(Y,{side:`bottom`,children:[`Toggle thread details`,d?` (${d})`:``]})]}),t[3]=v,t[4]=l,t[5]=d,t[6]=O):O=t[6];let k=O,A;t[7]!==b||t[8]!==u||t[9]!==l||t[10]!==D||t[11]!==k?(A=b?k(l===`popover`?(0,$.jsx)(Wr,{handle:u,render:D}):D):null,t[7]=b,t[8]=u,t[9]=l,t[10]=D,t[11]=k,t[12]=A):A=t[12];let j;t[13]!==_||t[14]!==x||t[15]!==a||t[16]!==o||t[17]!==s?(j=x?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(On,{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)(ue,{className:`size-4`})})}),(0,$.jsx)(Y,{side:`bottom`,children:a?`Toggle terminal drawer${s?` (${s})`:``}`:`Terminal drawer is unavailable`})]}):null,t[13]=_,t[14]=x,t[15]=a,t[16]=o,t[17]=s,t[18]=j):j=t[18];let M;t[19]!==y||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==w||t[24]!==C||t[25]!==S?(M=S?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(On,{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)(vf,{count:w}):(0,$.jsx)(ye,{className:`size-4`})})}),(0,$.jsx)(Y,{side:`bottom`,children:f?`Toggle right panel${m?` (${m})`:``}`:C})]}):null,t[19]=y,t[20]=f,t[21]=p,t[22]=m,t[23]=w,t[24]=C,t[25]=S,t[26]=M):M=t[26];let N;return t[27]!==j||t[28]!==M||t[29]!==A?(N=(0,$.jsxs)(`div`,{className:`flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,"data-panel-layout-controls":!0,children:[A,j,M]}),t[27]=j,t[28]=M,t[29]=A,t[30]=N):N=t[30],N});function vf(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 yf=(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?nt:tt,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)(J,{render:(0,$.jsx)(On,{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)(Y,{side:`bottom`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(X,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l});function bf(){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{cs as A,dc as C,bs as D,lc as E,Oo as F,Ao as I,Do as L,qo as M,Jo as N,xs as O,Go as P,hc as S,uc as T,cl as _,Pd as a,Nc as b,Fd as c,Ad as d,Mu as f,ul as g,yl as h,Nd as i,rs as j,_s as k,Id as l,Sl as m,yf as n,Ld as o,bl as p,df as r,Rd as s,_f as t,jd as u,Ic as v,pc as w,yc as x,Fc as y};
216
- //# sourceMappingURL=PanelLayoutControls-yA-MhIU3.js.map
216
+ //# sourceMappingURL=PanelLayoutControls-Bp96ytbx.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cg as n,Lc as r,NE as i,Zd as a,lE as o,lf as s,t as c}from"./utils-DqIvhFCT.js";import{B as l,L as u,M as d,W as f}from"./runtime-CJNEsw6U.js";import{a as p,r as m}from"./pierre-icons-BubjdUjD.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:r.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:r.attachmentsDelete})}}function g(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AssetAttachmentNotFoundError`}async function _(e){let t=await u(e.registry,e.createAssetUrl({environmentId:e.environmentId,input:{resource:{_tag:`attachment`,attachmentId:e.attachmentId}}}),{reportFailure:!1,reportDefect:!1,refresh:!0});if(t._tag===`Success`)return{status:`verified`};let n=f(t);return g(n)?{status:`missing`}:{status:`failed`,error:n}}function v(e){l(e.registry,e.remove,{environmentId:e.environmentId,input:{attachmentId:e.attachmentId}},{reportFailure:!1,reportDefect:!1})}async function y(e){let t=await l(e.registry,e.createUploadUrl,{environmentId:e.environmentId,input:e.upload},{reportFailure:!1});if(t._tag!==`Success`)return{status:`failed`,step:`mint`,attachmentId:null,error:f(t)};let n=t.value.attachmentId;if(e.onMinted?.(n)===`cancel`)return v({registry:e.registry,remove:e.remove,environmentId:e.environmentId,attachmentId:n}),{status:`cancelled`,attachmentId:n};let r=e.resolveUploadUrl(t.value.relativeUrl);if(!r)return{status:`failed`,step:`resolve-url`,attachmentId:n,error:Error(`The environment is not connected.`)};let i=e.transport(r);e.onTransferStart?.(i.abort);try{await i.done}catch(e){return{status:`failed`,step:`transfer`,attachmentId:n,error:e}}return{status:`uploaded`,attachmentId:n}}function b(e){return Math.min(e,n)}function x(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.ceil(e/1024))} KB`}function S(e,t){return`'${e}' exceeds the ${t>=1048576&&t%1048576==0?`${t/1048576} MB`:t>=1024&&t%1024==0?`${t/1024} KB`:`${t} ${t===1?`byte`:`bytes`}`} attachment limit.`}var C=i(),w=e(t(),1),T=e(o(),1),E={astro:[`#a631be`,`#d568ea`],babel:[`#d5a910`,`#ffd452`],bash:[`#199f43`,`#5ecc71`],biome:[`#1a85d4`,`#69b1ff`],bootstrap:[`#693acf`,`#9d6afb`],browserslist:[`#d5a910`,`#ffd452`],bun:[`#594c5b`,`#79697b`],c:[`#1a85d4`,`#69b1ff`],claude:[`#d47628`,`#ffa359`],cpp:[`#1a85d4`,`#69b1ff`],css:[`#693acf`,`#9d6afb`],database:[`#a631be`,`#d568ea`],default:[`#84848a`,`#adadb1`],docker:[`#1a85d4`,`#69b1ff`],eslint:[`#693acf`,`#9d6afb`],git:[`#ff8c5b`,`#d5512f`],go:[`#1ca1c7`,`#68cdf2`],graphql:[`#d32a61`,`#ff678d`],html:[`#d47628`,`#ffa359`],image:[`#d32a61`,`#ff678d`],javascript:[`#d5a910`,`#ffd452`],json:[`#d47628`,`#ffa359`],markdown:[`#199f43`,`#5ecc71`],mcp:[`#17a5af`,`#64d1db`],nextjs:[`#84848a`,`#adadb1`],npm:[`#d52c36`,`#ff6762`],oxc:[`#1ca1c7`,`#68cdf2`],postcss:[`#d52c36`,`#ff6762`],prettier:[`#17a5af`,`#64d1db`],python:[`#1a85d4`,`#69b1ff`],react:[`#1ca1c7`,`#68cdf2`],ruby:[`#d52c36`,`#ff6762`],rust:[`#d47628`,`#ffa359`],sass:[`#d32a61`,`#ff678d`],stylelint:[`#84848a`,`#adadb1`],svelte:[`#d52c36`,`#ff6762`],svg:[`#d47628`,`#ffa359`],svgo:[`#199f43`,`#5ecc71`],swift:[`#d47628`,`#ffa359`],table:[`#17a5af`,`#64d1db`],tailwind:[`#1ca1c7`,`#68cdf2`],terraform:[`#693acf`,`#9d6afb`],text:[`#84848a`,`#adadb1`],typescript:[`#1a85d4`,`#69b1ff`],vite:[`#a631be`,`#d568ea`],vscode:[`#1a85d4`,`#69b1ff`],vue:[`#199f43`,`#5ecc71`],wasm:[`#693acf`,`#9d6afb`],webpack:[`#1a85d4`,`#69b1ff`],yml:[`#d52c36`,`#ff6762`],zig:[`#d47628`,`#ffa359`],zip:[`#d47628`,`#ffa359`]},D=(0,w.memo)(function(e){let t=(0,C.c)(20),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0],(0,w.useInsertionEffect)(m,n);let r;t[1]!==e.kind||t[2]!==e.mimeType||t[3]!==e.pathValue?(r=p(e.pathValue,e.kind,e.mimeType),t[1]=e.kind,t[2]=e.mimeType,t[3]=e.pathValue,t[4]=r):r=t[4];let i=r;if(!i){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(s,{className:c(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(a,{className:c(`size-4 text-icon-muted`,e.className)}),t[5]=e.className,t[6]=e.kind,t[7]=n):n=t[7],n}let o=E[i.token??`default`]??E.default,l=i.name,u=i.token,d;t[8]===e.className?d=t[9]:(d=c(`size-4 shrink-0`,e.className),t[8]=e.className,t[9]=d);let f=o?.[e.theme===`light`?0:1],h;t[10]===f?h=t[11]:(h={color:f},t[10]=f,t[11]=h);let g=`#${i.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==i.name||t[15]!==i.token||t[16]!==d||t[17]!==h||t[18]!==_?(v=(0,T.jsx)(`svg`,{"aria-hidden":`true`,"data-pierre-icon":l,"data-icon-token":u,className:d,style:h,viewBox:`0 0 16 16`,children:_}),t[14]=i.name,t[15]=i.token,t[16]=d,t[17]=h,t[18]=_,t[19]=v):v=t[19],v});export{S as a,_ as c,v as i,b as n,x as o,h as r,y as s,D as t};
2
- //# sourceMappingURL=PierreEntryIcon-x_cG473l.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cg as n,Lc as r,NE as i,Zd as a,lE as o,lf as s,t as c}from"./utils-ChK8VEFC.js";import{B as l,L as u,M as d,W as f}from"./runtime-CvGlGrbH.js";import{a as p,r as m}from"./pierre-icons-duX6avqL.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:r.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:r.attachmentsDelete})}}function g(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AssetAttachmentNotFoundError`}async function _(e){let t=await u(e.registry,e.createAssetUrl({environmentId:e.environmentId,input:{resource:{_tag:`attachment`,attachmentId:e.attachmentId}}}),{reportFailure:!1,reportDefect:!1,refresh:!0});if(t._tag===`Success`)return{status:`verified`};let n=f(t);return g(n)?{status:`missing`}:{status:`failed`,error:n}}function v(e){l(e.registry,e.remove,{environmentId:e.environmentId,input:{attachmentId:e.attachmentId}},{reportFailure:!1,reportDefect:!1})}async function y(e){let t=await l(e.registry,e.createUploadUrl,{environmentId:e.environmentId,input:e.upload},{reportFailure:!1});if(t._tag!==`Success`)return{status:`failed`,step:`mint`,attachmentId:null,error:f(t)};let n=t.value.attachmentId;if(e.onMinted?.(n)===`cancel`)return v({registry:e.registry,remove:e.remove,environmentId:e.environmentId,attachmentId:n}),{status:`cancelled`,attachmentId:n};let r=e.resolveUploadUrl(t.value.relativeUrl);if(!r)return{status:`failed`,step:`resolve-url`,attachmentId:n,error:Error(`The environment is not connected.`)};let i=e.transport(r);e.onTransferStart?.(i.abort);try{await i.done}catch(e){return{status:`failed`,step:`transfer`,attachmentId:n,error:e}}return{status:`uploaded`,attachmentId:n}}function b(e){return Math.min(e,n)}function x(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.ceil(e/1024))} KB`}function S(e,t){return`'${e}' exceeds the ${t>=1048576&&t%1048576==0?`${t/1048576} MB`:t>=1024&&t%1024==0?`${t/1024} KB`:`${t} ${t===1?`byte`:`bytes`}`} attachment limit.`}var C=i(),w=e(t(),1),T=e(o(),1),E={astro:[`#a631be`,`#d568ea`],babel:[`#d5a910`,`#ffd452`],bash:[`#199f43`,`#5ecc71`],biome:[`#1a85d4`,`#69b1ff`],bootstrap:[`#693acf`,`#9d6afb`],browserslist:[`#d5a910`,`#ffd452`],bun:[`#594c5b`,`#79697b`],c:[`#1a85d4`,`#69b1ff`],claude:[`#d47628`,`#ffa359`],cpp:[`#1a85d4`,`#69b1ff`],css:[`#693acf`,`#9d6afb`],database:[`#a631be`,`#d568ea`],default:[`#84848a`,`#adadb1`],docker:[`#1a85d4`,`#69b1ff`],eslint:[`#693acf`,`#9d6afb`],git:[`#ff8c5b`,`#d5512f`],go:[`#1ca1c7`,`#68cdf2`],graphql:[`#d32a61`,`#ff678d`],html:[`#d47628`,`#ffa359`],image:[`#d32a61`,`#ff678d`],javascript:[`#d5a910`,`#ffd452`],json:[`#d47628`,`#ffa359`],markdown:[`#199f43`,`#5ecc71`],mcp:[`#17a5af`,`#64d1db`],nextjs:[`#84848a`,`#adadb1`],npm:[`#d52c36`,`#ff6762`],oxc:[`#1ca1c7`,`#68cdf2`],postcss:[`#d52c36`,`#ff6762`],prettier:[`#17a5af`,`#64d1db`],python:[`#1a85d4`,`#69b1ff`],react:[`#1ca1c7`,`#68cdf2`],ruby:[`#d52c36`,`#ff6762`],rust:[`#d47628`,`#ffa359`],sass:[`#d32a61`,`#ff678d`],stylelint:[`#84848a`,`#adadb1`],svelte:[`#d52c36`,`#ff6762`],svg:[`#d47628`,`#ffa359`],svgo:[`#199f43`,`#5ecc71`],swift:[`#d47628`,`#ffa359`],table:[`#17a5af`,`#64d1db`],tailwind:[`#1ca1c7`,`#68cdf2`],terraform:[`#693acf`,`#9d6afb`],text:[`#84848a`,`#adadb1`],typescript:[`#1a85d4`,`#69b1ff`],vite:[`#a631be`,`#d568ea`],vscode:[`#1a85d4`,`#69b1ff`],vue:[`#199f43`,`#5ecc71`],wasm:[`#693acf`,`#9d6afb`],webpack:[`#1a85d4`,`#69b1ff`],yml:[`#d52c36`,`#ff6762`],zig:[`#d47628`,`#ffa359`],zip:[`#d47628`,`#ffa359`]},D=(0,w.memo)(function(e){let t=(0,C.c)(20),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0],(0,w.useInsertionEffect)(m,n);let r;t[1]!==e.kind||t[2]!==e.mimeType||t[3]!==e.pathValue?(r=p(e.pathValue,e.kind,e.mimeType),t[1]=e.kind,t[2]=e.mimeType,t[3]=e.pathValue,t[4]=r):r=t[4];let i=r;if(!i){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(s,{className:c(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(a,{className:c(`size-4 text-icon-muted`,e.className)}),t[5]=e.className,t[6]=e.kind,t[7]=n):n=t[7],n}let o=E[i.token??`default`]??E.default,l=i.name,u=i.token,d;t[8]===e.className?d=t[9]:(d=c(`size-4 shrink-0`,e.className),t[8]=e.className,t[9]=d);let f=o?.[e.theme===`light`?0:1],h;t[10]===f?h=t[11]:(h={color:f},t[10]=f,t[11]=h);let g=`#${i.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==i.name||t[15]!==i.token||t[16]!==d||t[17]!==h||t[18]!==_?(v=(0,T.jsx)(`svg`,{"aria-hidden":`true`,"data-pierre-icon":l,"data-icon-token":u,className:d,style:h,viewBox:`0 0 16 16`,children:_}),t[14]=i.name,t[15]=i.token,t[16]=d,t[17]=h,t[18]=_,t[19]=v):v=t[19],v});export{S as a,_ as c,v as i,b as n,x as o,h as r,y as s,D as t};
2
+ //# sourceMappingURL=PierreEntryIcon-Ds39h2AA.js.map