@p4code/cli 0.9.12 → 0.9.13

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 (270) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-D9zhTalS.mjs → binCli-D22yxtxv.mjs} +273 -36
  3. package/dist/client/.vite/manifest.json +2046 -2046
  4. package/dist/client/assets/{2NI2N5EU-DOvURDwM.js → 2NI2N5EU-DBKJSvEQ.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-CArKQR6u.js → 4UO7MD6I-1JuY3zN7.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-D3yJKYTq.js → 5B3SVYGG-CwgmePuE.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-C7D6qJvm.js → 5GK6JWQ2-D9VJsozU.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-DDTV444t.js → 5N7A7DKN-CFgZoUw5.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-CYaAiBA5.js → 5OC2THR4-Cx6keXWX.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-jYzQX9YI.js → 5S6HY5KT-Ce1reKKv.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-CZSZgyOb.js → 6IMQ5BUJ-D7X0q9kf.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-D_TpeHsd.js → 6OLKWJ4F-YLfMA9aH.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-VJq-BY7c.js → 74OO7NKP-Wm5pZPTC.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-BCik3Y9V.js → 75O6YZUN-D2He6_fp.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-Ce_-nZaY.js → 77XECAW3-CV_JLSeU.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-C1hL61qL.js → ABYRPUBD-D0xOVN1A.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-DaczVYX9.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-DEeywxgS.js → AnimatedHeight-yuTG4G03.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-835o12nS.js → AuthSurfaceShell-CCBOJP5G.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-DlIE2g50.js → BB2UYUI2-BdXGRPif.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-D9NQPxww.js → BUM34MOA-isqGnSvm.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-BsiY6pPC.js → CEQABKGZ-DE0PWXRq.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-t7YfF0UQ.js → CXAC5362-0Zr5tv4C.js} +2 -2
  24. package/dist/client/assets/{ChatGptUsageButton-C3xHekTe.js → ChatGptUsageButton-w6RkBCUH.js} +2 -2
  25. package/dist/client/assets/{ChatMarkdown-Cw9bEYxG.js → ChatMarkdown-CFUfXlYp.js} +5 -5
  26. package/dist/client/assets/{CheckboxIndicator-XdXpYxXy.js → CheckboxIndicator-lkbFKbE7.js} +2 -2
  27. package/dist/client/assets/{ClippedText-C-unQqBz.js → ClippedText-Bf8FSQkX.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-Bl5OcEqH.js → CodexSetupSection.logic-SHExnMKR.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-CBRGIQSm.js → ComboboxClear-B0HJXjbz.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-DVAwRoGV.js → ComboboxGroupLabel-CMc5xUrd.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-D6NTupaO.js → CommandBlock-CluJmhVo.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-BqLNVkse.js → ComposerPromptEditor-DR1WsmjD.js} +4 -4
  33. package/dist/client/assets/{CompositeRoot-DBS-Yo_S.js → CompositeRoot-BMHKb-nN.js} +2 -2
  34. package/dist/client/assets/{ConnectAgentSurface-TBgGDnVI.js → ConnectAgentSurface-CNWdh9ck.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-CR_qWdCU.js → ConnectionStatusDot-CpmZ8NE5.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-DkTzG_pM.js → DRLTVNUE-Dttc5MrD.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-BBRUtn6A.js → DYY6UVD2-DTrZAR1D.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-BS7y97f_.js → DevicePanel-CRFuAv_j.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-TIKLCkls.js → DeviceSetup-DRzepax4.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-DzoEjZ6h.js → DialogTitle-pLX9Mw1n.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-y1CrEDvy.js → DiffCommentAnnotation-6V9nI3Cm.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-BM7RDTEn.js → DiffFileTree-CBEjDul5.js} +2 -2
  43. package/dist/client/assets/{DiffPanel-CAK_DAYa.js → DiffPanel-CM5Rvb_z.js} +2 -2
  44. package/dist/client/assets/{DiffWorkerPoolProvider-D2t5zRbN.js → DiffWorkerPoolProvider-f4-YQsHo.js} +2 -2
  45. package/dist/client/assets/{EmbeddedDesign-_id3IQO6.js → EmbeddedDesign-DSEjf0KK.js} +2 -2
  46. package/dist/client/assets/{EnvironmentMachineIcon-oObSi9GI.js → EnvironmentMachineIcon-B6wAZat7.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-BLwIQ2BJ.js → ExpandableText-Cjat32hh.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-B469NSHv.js → FNOVOB4O-LisHSqAM.js} +2 -2
  49. package/dist/client/assets/{FieldControl-Btl-j-6W.js → FieldControl-DwBVFJAI.js} +2 -2
  50. package/dist/client/assets/{FileDiff-CGLKzg3V.js → FileDiff-Bj9kBLN2.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-DJ-LkCJ7.js → FilePreviewPanel-z6NirC2y.js} +2 -2
  52. package/dist/client/assets/{FoldedSettingsSection-DPTJODig.js → FoldedSettingsSection-DIlgxayr.js} +2 -2
  53. package/dist/client/assets/{FormContext-Be16jmaZ.js → FormContext-DcnLkh-4.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-BUMQl9WF.js → HDGCDEEZ-Bn1jLSys.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-C08sJAK2.js → HSJLKHB7-CHpiqxlA.js} +2 -2
  56. package/dist/client/assets/{Icons-2l7Ym4KO.js → Icons-Be1TL1sN.js} +2 -2
  57. package/dist/client/assets/Input-BZ1XdBC0.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-BZEjBuKj.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-D4RWgVJJ.js → K3MD6TGW-D5oCFPkP.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-B8UDebPA.js → K7RP3OMA-ZIPW--CU.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-CCfOv-KZ.js → KeybindingsSettings.logic-Ctmq4InP.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-DwRY1EjH.js → LHDIQX7Q-BkDTNH4X.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-BTGUp3oJ.js → LUXOKEGN-BMFFLlMk.js} +2 -2
  64. package/dist/client/assets/{LinkMachineSelect-DoHeQGoj.js → LinkMachineSelect-DGm4EDKi.js} +2 -2
  65. package/dist/client/assets/{MathTypeset-DZCUnfpK.js → MathTypeset-DpXMOBGY.js} +2 -2
  66. package/dist/client/assets/{N3JZAHOW-C-bkdj1S.js → N3JZAHOW-CV9TIlCo.js} +2 -2
  67. package/dist/client/assets/{NUIALGQ3-COfmKsf1.js → NUIALGQ3-WBqakHka.js} +2 -2
  68. package/dist/client/assets/{NoProjectsHero-CbIPjHEJ.js → NoProjectsHero-BfU7AxbB.js} +2 -2
  69. package/dist/client/assets/{O65XPQGZ-BPK2EL3_.js → O65XPQGZ-CYhr2tYZ.js} +2 -2
  70. package/dist/client/assets/{O7XIQ6OM-qzVUZXbW.js → O7XIQ6OM-D2JMbFqc.js} +2 -2
  71. package/dist/client/assets/{OFQON5FD-DJVnaZou.js → OFQON5FD-B1aTfx9o.js} +2 -2
  72. package/dist/client/assets/{P4ConnectAccountPages-DwBbHN5Q.js → P4ConnectAccountPages-J205rNHS.js} +2 -2
  73. package/dist/client/assets/{P4ConnectSidebarSignIn-D7VczA30.js → P4ConnectSidebarSignIn-Bc4xlsJh.js} +2 -2
  74. package/dist/client/assets/{PJQHF43J-CTXALHLE.js → PJQHF43J-Dm3RMjWi.js} +2 -2
  75. package/dist/client/assets/{PanelLayoutControls-D8g6TJ8z.js → PanelLayoutControls-BQZYES2T.js} +4 -4
  76. package/dist/client/assets/{PierreEntryIcon-CUoKY0yE.js → PierreEntryIcon-CHy821MU.js} +2 -2
  77. package/dist/client/assets/{PopoverHandle-tRSwNzqr.js → PopoverHandle-BkzqaTB6.js} +2 -2
  78. package/dist/client/assets/{PreviewPanel-cYx50TF6.js → PreviewPanel-D8V2zDl4.js} +2 -2
  79. package/dist/client/assets/{ProjectDefaultsSettings-G0FTRG0c.js → ProjectDefaultsSettings-6UkudkKP.js} +2 -2
  80. package/dist/client/assets/{ProjectFavicon-in-OyDkg.js → ProjectFavicon-LcyFYpHB.js} +3 -3
  81. package/dist/client/assets/{ProjectIconPickerDialog-JCPOaZup.js → ProjectIconPickerDialog-D03-Jrsi.js} +2 -2
  82. package/dist/client/assets/{ProjectMonogram-DdbScW3Y.js → ProjectMonogram-C8FlNLaU.js} +2 -2
  83. package/dist/client/assets/{ProviderAuthTerminal-CCw2XmNz.js → ProviderAuthTerminal-DMTbKboR.js} +2 -2
  84. package/dist/client/assets/{ProviderModelPicker-DWqfDVY9.js → ProviderModelPicker-CpWE-Lfx.js} +2 -2
  85. package/dist/client/assets/{ProviderSettingsForm-_viBEB9w.js → ProviderSettingsForm-DrCFln8c.js} +2 -2
  86. package/dist/client/assets/{PullRequestCodeTab-D3ntjIAg.js → PullRequestCodeTab-CjBrGNWY.js} +2 -2
  87. package/dist/client/assets/{RHNBAITX-BR5h8H8U.js → RHNBAITX-C7mnxleL.js} +2 -2
  88. package/dist/client/assets/{ReadOnlySourcePreview-Bx9Jebzp.js → ReadOnlySourcePreview-BasbTHVd.js} +2 -2
  89. package/dist/client/assets/{RedactedSensitiveText-DM7Kme26.js → RedactedSensitiveText-DACYfm7e.js} +2 -2
  90. package/dist/client/assets/{RenderErrorBoundary-BeYcnW7D.js → RenderErrorBoundary-CIVNp8r9.js} +2 -2
  91. package/dist/client/assets/{SLD4V6NK-DfUtjUb_.js → SLD4V6NK-BkeVs7gb.js} +2 -2
  92. package/dist/client/assets/{ScheduledTasksSettings-BcF7IiOl.js → ScheduledTasksSettings-DpYigye5.js} +2 -2
  93. package/dist/client/assets/{ScopedSwitch-CD9C3Bhs.js → ScopedSwitch-D1uscoF8.js} +2 -2
  94. package/dist/client/assets/{ScrollAreaCorner-D5JbJL5g.js → ScrollAreaCorner-DBtks1xb.js} +2 -2
  95. package/dist/client/assets/{SecretInput-ttyiYbVY.js → SecretInput-ZW3hnCoN.js} +2 -2
  96. package/dist/client/assets/{SelectScrollUpArrow-BV1xykNQ.js → SelectScrollUpArrow-Bq-GYRhT.js} +2 -2
  97. package/dist/client/assets/{SelfImproveSettingsSection-Dm8NhqV7.js → SelfImproveSettingsSection-CDIhJO4P.js} +2 -2
  98. package/dist/client/assets/{SettingsPanels-BsyJETg8.js → SettingsPanels-Co5mks6X.js} +2 -2
  99. package/dist/client/assets/{SettingsPanels.logic-DS-Semyc.js → SettingsPanels.logic-H5v8FTnu.js} +2 -2
  100. package/dist/client/assets/{SettingsScopeNotice--a-aNSRR.js → SettingsScopeNotice-gFtgpybO.js} +2 -2
  101. package/dist/client/assets/{SidebarStageBackdrop-ntSLLOvm.js → SidebarStageBackdrop-DSuAw8Ob.js} +2 -2
  102. package/dist/client/assets/{T3PCR2KE-C5JeZecU.js → T3PCR2KE-D6MHoseG.js} +2 -2
  103. package/dist/client/assets/{TKWO2OVW-B11aaxW8.js → TKWO2OVW-gZK7dLQZ.js} +2 -2
  104. package/dist/client/assets/{TSHNXIZL-2800Jt5F.js → TSHNXIZL-BKUmF3Cu.js} +2 -2
  105. package/dist/client/assets/{ThemeEditorPanel-CTXEQSgi.js → ThemeEditorPanel-lI_9CbBH.js} +2 -2
  106. package/dist/client/assets/{ThreadTerminalDrawer-DIUp50A3.js → ThreadTerminalDrawer-CD3plt2C.js} +2 -2
  107. package/dist/client/assets/{TooltipViewport-rDmof6w5.js → TooltipViewport-Be_gbUW1.js} +2 -2
  108. package/dist/client/assets/{UQJE5E4I-BG1U9EIM.js → UQJE5E4I-D6av033t.js} +2 -2
  109. package/dist/client/assets/{USNYFO5S-d4iGw5HU.js → USNYFO5S-Cy6sDMEU.js} +2 -2
  110. package/dist/client/assets/{Virtualizer-CzClYBap.js → Virtualizer-B_IsUzcr.js} +2 -2
  111. package/dist/client/assets/{WEVWDWVA-V2MwjUCO.js → WEVWDWVA-Cq1fZcng.js} +2 -2
  112. package/dist/client/assets/{WorkspaceBreadcrumb-Dpau2BKr.js → WorkspaceBreadcrumb-DbQW7iNE.js} +2 -2
  113. package/dist/client/assets/{WorkspacePageContainer-C3u06BW-.js → WorkspacePageContainer-BxI-x0oV.js} +2 -2
  114. package/dist/client/assets/{WorkspacePageHeader-MBEFb20_.js → WorkspacePageHeader-Bc_F6Uog.js} +2 -2
  115. package/dist/client/assets/{X5RFHQXM-D_mIa6o9.js → X5RFHQXM-DdtKPA-W.js} +2 -2
  116. package/dist/client/assets/{X62E3GBT-Cwvyi_iR.js → X62E3GBT-C7OjB5pB.js} +2 -2
  117. package/dist/client/assets/{XBNEOJTC-sfA1U_fe.js → XBNEOJTC-_Tbl2Kwh.js} +2 -2
  118. package/dist/client/assets/{YHV2MVVZ-CZoP6AAo.js → YHV2MVVZ-CA4YS5f4.js} +2 -2
  119. package/dist/client/assets/{YURCZMG2-DYo6rqon.js → YURCZMG2-DSnhUUsH.js} +2 -2
  120. package/dist/client/assets/{YVG2LODB-D8sTsTwc.js → YVG2LODB-D-qFsH5t.js} +2 -2
  121. package/dist/client/assets/_chat-Cnc6rxt6.js +47 -0
  122. package/dist/client/assets/{_chat.design-Nh4vxHDS.js → _chat.design-SX7SShjI.js} +2 -2
  123. package/dist/client/assets/{_chat.index-YNITFXX3.js → _chat.index-Bz1lJLpv.js} +2 -2
  124. package/dist/client/assets/{_chat.new-B16PAbQN.js → _chat.new-BEqc5oJc.js} +2 -2
  125. package/dist/client/assets/{_chat.pull-requests-DEHC0db5.js → _chat.pull-requests-A3IwVYWs.js} +2 -2
  126. package/dist/client/assets/{alert-UH7IbYie.js → alert-BOVMKHDy.js} +2 -2
  127. package/dist/client/assets/{alert-dialog-D3mCT6Vy.js → alert-dialog-Du3fYY3I.js} +2 -2
  128. package/dist/client/assets/{assetUrls-BNjjSBLP.js → assetUrls-CYjvy6P4.js} +2 -2
  129. package/dist/client/assets/{assets-CrCgj2yM.js → assets-JgE2I_Ix.js} +2 -2
  130. package/dist/client/assets/{browserHistoryStore-CW_ylkPy.js → browserHistoryStore-CdncPjG8.js} +2 -2
  131. package/dist/client/assets/{browserLinkTarget-Dlnk6CC2.js → browserLinkTarget-Bf9H9UVe.js} +2 -2
  132. package/dist/client/assets/{checkbox-Bqcsvpsf.js → checkbox-d50pgAVe.js} +2 -2
  133. package/dist/client/assets/{color-picker-DAcpRn0k.js → color-picker-zcQshxaE.js} +2 -2
  134. package/dist/client/assets/{combobox-CoLp0McG.js → combobox-BrCd1kH5.js} +2 -2
  135. package/dist/client/assets/{command-cKnhWwdw.js → command-DFkhX6wm.js} +2 -2
  136. package/dist/client/assets/{connect-rbXRyqde.js → connect-DkH09d_M.js} +2 -2
  137. package/dist/client/assets/connect-agent-DJHm1Ubj.js +2 -0
  138. package/dist/client/assets/{design-BJbd-4a9.js → design-DrpehYJf.js} +2 -2
  139. package/dist/client/assets/{device-BqGYZxfg.js → device-Nh7DArH7.js} +2 -2
  140. package/dist/client/assets/{dialog-CjB1WWbE.js → dialog-BpR3dRVS.js} +2 -2
  141. package/dist/client/assets/{diffRendering-JsGpyVJ1.js → diffRendering-BuOJdnZ8.js} +2 -2
  142. package/dist/client/assets/{dist-D4GndTOF.js → dist-CMJL98Oz.js} +3 -3
  143. package/dist/client/assets/{draft-input-1ySc55QI.js → draft-input-CzfhM72Z.js} +2 -2
  144. package/dist/client/assets/{duoViewer-DvlUJy5A.js → duoViewer-ChrCWcjO.js} +2 -2
  145. package/dist/client/assets/{dynamic-B8PD-aHj.js → dynamic-CVt07u2H.js} +2 -2
  146. package/dist/client/assets/{embeddedScripts-ByokzHX1.js → embeddedScripts-BWqMWwOU.js} +2 -2
  147. package/dist/client/assets/{empty-CMnFXg8W.js → empty-Cy-8us9l.js} +2 -2
  148. package/dist/client/assets/{entities-CTJ1ube2.js → entities-aKdRyfsJ.js} +2 -2
  149. package/dist/client/assets/{fileLinks-lUzqPrjb.js → fileLinks-BgHa8yE4.js} +2 -2
  150. package/dist/client/assets/{fileTreeExpansion-B6sjoSXU.js → fileTreeExpansion-CBn1SzSX.js} +2 -2
  151. package/dist/client/assets/{getDiffFileInput-Bt5vSiss.js → getDiffFileInput-IQ1TDM4E.js} +2 -2
  152. package/dist/client/assets/{guideRunStore-DFawhaj_.js → guideRunStore-DfNfJUIu.js} +2 -2
  153. package/dist/client/assets/{htmlRender-DJLbbd4O.js → htmlRender-lwQ3HyqS.js} +2 -2
  154. package/dist/client/assets/{index-CxLeDuff.js → index-BXvrSYK3.js} +3 -3
  155. package/dist/client/assets/{input-CSgYZgdv.js → input-FUjAUGXY.js} +2 -2
  156. package/dist/client/assets/{input-group-a-sGQMiV.js → input-group-BdZ_CKvG.js} +2 -2
  157. package/dist/client/assets/{kbd-D3uRVBMx.js → kbd-CGgmav-Q.js} +2 -2
  158. package/dist/client/assets/{keybindings-B9X0TLvu.js → keybindings-DuCyi9aT.js} +2 -2
  159. package/dist/client/assets/{lazy-C_hQh3dP.js → lazy-Bs2SFpYS.js} +4 -4
  160. package/dist/client/assets/{lazyRouteComponent-GMfIUG8o.js → lazyRouteComponent-CYNRqeNP.js} +2 -2
  161. package/dist/client/assets/{link-BmkuqfGQ.js → link-DW1IQk5s.js} +2 -2
  162. package/dist/client/assets/{linkedPrompt-BNxBPorU.js → linkedPrompt-yo2xi4Z8.js} +2 -2
  163. package/dist/client/assets/{main-DIEsHSIy.js → main-C0z861OK.js} +7 -7
  164. package/dist/client/assets/{mediaReference-CVS-Yvam.js → mediaReference-BQ9J-tjl.js} +2 -2
  165. package/dist/client/assets/{mediaSource-DQsJoeCH.js → mediaSource-BLpxwEw3.js} +2 -2
  166. package/dist/client/assets/{number-field-Bw2BDGyn.js → number-field-Pve745k3.js} +2 -2
  167. package/dist/client/assets/{observeResize-Br7VOcTc.js → observeResize-CZuDzlcZ.js} +2 -2
  168. package/dist/client/assets/{onboarding-D6kvYnD1.js → onboarding-CE8pzS12.js} +2 -2
  169. package/dist/client/assets/{openFileInPreview-52PEk4wb.js → openFileInPreview-Dns9tPaB.js} +2 -2
  170. package/dist/client/assets/{p4ProjectFile-B1qTw64E.js → p4ProjectFile-jwYvYDE-.js} +2 -2
  171. package/dist/client/assets/{pair-Das8G2kV.js → pair-OPslYcM9.js} +2 -2
  172. package/dist/client/assets/{pendingSendStore-B1MXHU-Y.js → pendingSendStore-CLwMM17y.js} +2 -2
  173. package/dist/client/assets/{phoneViewer-iWL9Ocv_.js → phoneViewer-CkTxyA9N.js} +2 -2
  174. package/dist/client/assets/{pierre-icons-CyZxWykW.js → pierre-icons-DY8ZeGCr.js} +2 -2
  175. package/dist/client/assets/{popover-Cpc0L75h.js → popover-hYAmvSJj.js} +2 -2
  176. package/dist/client/assets/{preview-DRZGCh-w.js → preview-CI9HEdfV.js} +2 -2
  177. package/dist/client/assets/{preview-CDQ5ceMi.js → preview-YhZE3kRt.js} +2 -2
  178. package/dist/client/assets/{previewMiniPlayerStore-Dd2KfilQ.js → previewMiniPlayerStore-DUPe1gGI.js} +2 -2
  179. package/dist/client/assets/{primary-YDhFfOF8.js → primary-BlS2rEKe.js} +2 -2
  180. package/dist/client/assets/{primaryCloudLinkState-kvnCGEBC.js → primaryCloudLinkState-CyPf4N0F.js} +2 -2
  181. package/dist/client/assets/{projectFilesQueryState-DvEcN38K.js → projectFilesQueryState-BdWJ4WwI.js} +2 -2
  182. package/dist/client/assets/{projectScriptEditor-lOSI5meb.js → projectScriptEditor-C0FBhCbn.js} +2 -2
  183. package/dist/client/assets/{providerSkills-CRmME5qO.js → providerSkills-Ca_7EbAx.js} +2 -2
  184. package/dist/client/assets/{pullRequestDetail.logic-CXEtJJcn.js → pullRequestDetail.logic-DYx7bEwE.js} +2 -2
  185. package/dist/client/assets/{pullRequestIcons-D8Koo716.js → pullRequestIcons-csprKuju.js} +2 -2
  186. package/dist/client/assets/{pullRequestReviewStore-CpLjLBJR.js → pullRequestReviewStore-_uEYgfaW.js} +2 -2
  187. package/dist/client/assets/{pullRequests-DKqH-UAm.js → pullRequests-B85p5Xnw.js} +2 -2
  188. package/dist/client/assets/{queries-eqpX-CHf.js → queries-B0FvRKmk.js} +2 -2
  189. package/dist/client/assets/{query-D5Kb9u_z.js → query-B2_Td0ad.js} +2 -2
  190. package/dist/client/assets/{radio-group-DpxVKrML.js → radio-group-IyWHDcIP.js} +2 -2
  191. package/dist/client/assets/{renderScheduler-B1rJHKDM.js → renderScheduler-DR2WAtIH.js} +2 -2
  192. package/dist/client/assets/{rightPanelStore-DQ1c3-Lt.js → rightPanelStore-rZSIb-5z.js} +2 -2
  193. package/dist/client/assets/{runtime-DCbEdU32.js → runtime-BK2Lh1vB.js} +3 -3
  194. package/dist/client/assets/{runtime-DeVKKxNz.js → runtime-BVmDVuJ-.js} +3 -3
  195. package/dist/client/assets/{runtimeModeConfig-CZCsG9b4.js → runtimeModeConfig-DFxXOIlV.js} +2 -2
  196. package/dist/client/assets/{scheduledTasksSettings.logic-gN3n5v-e.js → scheduledTasksSettings.logic-W9AQpJk4.js} +2 -2
  197. package/dist/client/assets/{scroll-area-C9Jh_pl0.js → scroll-area-Cf7uLi_s.js} +2 -2
  198. package/dist/client/assets/{select-oshTwPZM.js → select-vBkqTMKL.js} +2 -2
  199. package/dist/client/assets/selfImproveFindings-4GGN9cRm.js +2 -0
  200. package/dist/client/assets/{server-Ct4-BCZx.js → server-DwkxciXh.js} +2 -2
  201. package/dist/client/assets/{session-Bb7JWdWO.js → session-BIwsf8Q4.js} +2 -2
  202. package/dist/client/assets/{session-logic-D0Wb0fc2.js → session-logic-D8FbVFDm.js} +2 -2
  203. package/dist/client/assets/{settings-CQtFOh_t.js → settings-C58Y7hMl.js} +2 -2
  204. package/dist/client/assets/{settings.appearance-CqHPJVJ2.js → settings.appearance-C9ZmuG-n.js} +2 -2
  205. package/dist/client/assets/settings.archived-BxqS4kuW.js +2 -0
  206. package/dist/client/assets/{settings.computer-use-CDrWkvkD.js → settings.computer-use-CeIs-8zf.js} +2 -2
  207. package/dist/client/assets/{settings.connections-CHXX5kH0.js → settings.connections-CEr4PdrJ.js} +2 -2
  208. package/dist/client/assets/{settings.data-controls-Bd79f82M.js → settings.data-controls-BbzJxjBi.js} +2 -2
  209. package/dist/client/assets/{settings.decisions-B-i781li.js → settings.decisions-DagsCV4K.js} +2 -2
  210. package/dist/client/assets/{settings.designs-DpX9xXFH.js → settings.designs-DEThhuEj.js} +2 -2
  211. package/dist/client/assets/{settings.diagnostics-Du6_cMwQ.js → settings.diagnostics-DdsecwWn.js} +2 -2
  212. package/dist/client/assets/{settings.general-6bgZAoM7.js → settings.general-RgU1jNmB.js} +2 -2
  213. package/dist/client/assets/{settings.integrations-Ct8ruO3E.js → settings.integrations-CO-aLXSC.js} +2 -2
  214. package/dist/client/assets/{settings.keybindings-DzB2I9OY.js → settings.keybindings-CU8fBQaI.js} +2 -2
  215. package/dist/client/assets/{settings.open-source-licenses-C-RX63iR.js → settings.open-source-licenses-rG8Neftl.js} +2 -2
  216. package/dist/client/assets/{settings.plugins-CqpVlMrk.js → settings.plugins-Dr0VpcPy.js} +2 -2
  217. package/dist/client/assets/{settings.projects-DosfFxrs.js → settings.projects-hxwk8_7r.js} +3 -3
  218. package/dist/client/assets/{settings.providers-DKgzTRpw.js → settings.providers-D5-Kj1jY.js} +3 -3
  219. package/dist/client/assets/{settings.scheduled-tasks-Ca4XxyAg.js → settings.scheduled-tasks-DwUd14Xj.js} +2 -2
  220. package/dist/client/assets/{settings.snap-shot-BkSOnsJ3.js → settings.snap-shot-CTMJRtJe.js} +2 -2
  221. package/dist/client/assets/{settings.source-control-uZ0ges0j.js → settings.source-control-BHD5KE8W.js} +2 -2
  222. package/dist/client/assets/{settings.storage-BkURtSS0.js → settings.storage-Bhd9ragP.js} +2 -2
  223. package/dist/client/assets/{settingsLayout-krWuVpsF.js → settingsLayout-WhjsCfB6.js} +2 -2
  224. package/dist/client/assets/{sidebar-PSpwc3Zu.js → sidebar-O52WtiJv.js} +2 -2
  225. package/dist/client/assets/{sidebarProjectGrouping-D02jVAL6.js → sidebarProjectGrouping-BYVdJp_w.js} +2 -2
  226. package/dist/client/assets/{skeleton-DIPW_H7N.js → skeleton-PlPtYr_f.js} +2 -2
  227. package/dist/client/assets/{sourceControl-B9aMMjp2.js → sourceControl-BkJeQRrv.js} +2 -2
  228. package/dist/client/assets/{sourceControlClients-XtdH6kjx.js → sourceControlClients-CtMx7u86.js} +2 -2
  229. package/dist/client/assets/{spinner-BeAnBYcY.js → spinner-BZ5ohCyO.js} +2 -2
  230. package/dist/client/assets/{terminal-links-CYEBYRi6.js → terminal-links-UI2UJn0y.js} +2 -2
  231. package/dist/client/assets/{terminalSessions-C2k3TT8f.js → terminalSessions-C1xOLG3i.js} +2 -2
  232. package/dist/client/assets/{textarea-DBTtAB2q.js → textarea-DIg__-Gi.js} +2 -2
  233. package/dist/client/assets/{themePalette-Uk7bx8zb.js → themePalette-BMlBfFUx.js} +2 -2
  234. package/dist/client/assets/{toast-Dkj3G-UM.js → toast-BZ96uuab.js} +2 -2
  235. package/dist/client/assets/{toggle-DYYe3Gb8.js → toggle-DJ8KOwn5.js} +2 -2
  236. package/dist/client/assets/{toggle-group-hQw0fxkT.js → toggle-group-2e3XGJdx.js} +2 -2
  237. package/dist/client/assets/{tooltip-BeHmtauD.js → tooltip-BPiLl1TV.js} +2 -2
  238. package/dist/client/assets/{uiStateStore-Cd96D_GT.js → uiStateStore-4i21PZUL.js} +2 -2
  239. package/dist/client/assets/{usage-ChIGOn5O.js → usage-uuNPbJve.js} +2 -2
  240. package/dist/client/assets/{usageAccess-DTKEwCKL.js → usageAccess-CsMv6eC9.js} +2 -2
  241. package/dist/client/assets/{usageFormat-D1mf8I5d.js → usageFormat-DhefL58S.js} +2 -2
  242. package/dist/client/assets/{usageShortcuts-C0jTsdR4.js → usageShortcuts-CREc0FBr.js} +2 -2
  243. package/dist/client/assets/{use-atom-command-D4TeQyNE.js → use-atom-command-CdV5BZYB.js} +2 -2
  244. package/dist/client/assets/{useAriaLabelledBy-Cod6bMX5.js → useAriaLabelledBy-CYRfRdAq.js} +2 -2
  245. package/dist/client/assets/{useHandleNewThread-CJ3yJ6tD.js → useHandleNewThread-BsnMrEPr.js} +2 -2
  246. package/dist/client/assets/{useLocation-DNv7cb59.js → useLocation-DHd-KBb-.js} +2 -2
  247. package/dist/client/assets/{useNavigate-PfhtEZbl.js → useNavigate-AZUCIeU4.js} +2 -2
  248. package/dist/client/assets/{useNavigateBack-DUje4FcE.js → useNavigateBack-C7DkQuEE.js} +2 -2
  249. package/dist/client/assets/{useP4ConnectAuthPrompt-evKe5nuS.js → useP4ConnectAuthPrompt-u1GHgwlc.js} +2 -2
  250. package/dist/client/assets/{useParams-CzC0HF0R.js → useParams-rbhXoEw9.js} +2 -2
  251. package/dist/client/assets/{usePermissionStatus-BUDWSxLm.js → usePermissionStatus-DHzE_VGG.js} +2 -2
  252. package/dist/client/assets/{usePullRequestActions-Cxt5UQ0d.js → usePullRequestActions-Cv12eqOn.js} +2 -2
  253. package/dist/client/assets/{useRegisterFieldControl-B4MJ2axN.js → useRegisterFieldControl-D4FG4i3_.js} +2 -2
  254. package/dist/client/assets/{useScopedModelAvailability-ujoqpGuE.js → useScopedModelAvailability-D6cbxQLl.js} +2 -2
  255. package/dist/client/assets/{useSettings-Cg0O7Ek7.js → useSettings-B09a3zie.js} +2 -2
  256. package/dist/client/assets/utils-C5GGWTfe.js +37 -0
  257. package/dist/client/assets/{vcsRefInvalidation-B5V_HlR9.js → vcsRefInvalidation-B66hRx4g.js} +2 -2
  258. package/dist/client/assets/{welcome-DqtsIjdN.js → welcome-D2-tjFV3.js} +2 -2
  259. package/dist/client/index.html +1 -1
  260. package/dist/{renderer-CmxAcIV2.mjs → renderer-CuqsXHrO.mjs} +2 -2
  261. package/dist/{runtime-CAtWuL14.mjs → runtime-CWPUW_8Y.mjs} +24 -7
  262. package/package.json +1 -1
  263. package/dist/client/assets/AlertDialogRoot-C6RQ4Ag-.js +0 -2
  264. package/dist/client/assets/Input--rtZ2Jji.js +0 -2
  265. package/dist/client/assets/JZOYTAAL-PmkwTnld.js +0 -1
  266. package/dist/client/assets/_chat-DNoJniWX.js +0 -47
  267. package/dist/client/assets/connect-agent-CsvW078q.js +0 -2
  268. package/dist/client/assets/selfImproveFindings-DUmfxmCO.js +0 -2
  269. package/dist/client/assets/settings.archived-DDtPGPcJ.js +0 -2
  270. package/dist/client/assets/utils-CcBaVOX5.js +0 -37
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-D3ntjIAg.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-CcBaVOX5.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-stop-0Wd2uKSK.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/runtime-DeVKKxNz.js","assets/runtime-DCbEdU32.js","assets/TooltipViewport-rDmof6w5.js","assets/toast-Dkj3G-UM.js","assets/spinner-BeAnBYcY.js","assets/useParams-CzC0HF0R.js","assets/DiffFileTree-BM7RDTEn.js","assets/useSettings-Cg0O7Ek7.js","assets/server-Ct4-BCZx.js","assets/session-Bb7JWdWO.js","assets/use-atom-command-D4TeQyNE.js","assets/themePalette-Uk7bx8zb.js","assets/diffRendering-JsGpyVJ1.js","assets/index-CxLeDuff.js","assets/fileTreeExpansion-B6sjoSXU.js","assets/pierre-icons-CyZxWykW.js","assets/query-D5Kb9u_z.js","assets/DiffCommentAnnotation-y1CrEDvy.js","assets/Virtualizer-CzClYBap.js","assets/getDiffFileInput-Bt5vSiss.js","assets/main-DIEsHSIy.js","assets/vcsRefInvalidation-B5V_HlR9.js","assets/entities-CTJ1ube2.js","assets/number-field-Bw2BDGyn.js","assets/useRegisterFieldControl-B4MJ2axN.js","assets/FormContext-Be16jmaZ.js","assets/CSPContext-jKZ42W4p.js","assets/select-oshTwPZM.js","assets/SelectScrollUpArrow-BV1xykNQ.js","assets/link-BmkuqfGQ.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-GMfIUG8o.js","assets/useNavigate-PfhtEZbl.js","assets/useLocation-DNv7cb59.js","assets/rightPanelStore-DQ1c3-Lt.js","assets/toastHelpers-DxXYm50b.js","assets/queries-eqpX-CHf.js","assets/session-logic-D0Wb0fc2.js","assets/htmlRender-DJLbbd4O.js","assets/mediaSource-DQsJoeCH.js","assets/fileLinks-lUzqPrjb.js","assets/mediaReference-CVS-Yvam.js","assets/usageFormat-D1mf8I5d.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-BeHmtauD.js","assets/skeleton-DIPW_H7N.js","assets/useAriaLabelledBy-Cod6bMX5.js","assets/toggle-DYYe3Gb8.js","assets/toggle-group-hQw0fxkT.js","assets/CompositeRoot-DBS-Yo_S.js","assets/input-CSgYZgdv.js","assets/Input--rtZ2Jji.js","assets/FieldControl-Btl-j-6W.js","assets/scroll-area-C9Jh_pl0.js","assets/ScrollAreaCorner-D5JbJL5g.js","assets/dist-D4GndTOF.js","assets/dialog-CjB1WWbE.js","assets/DialogTitle-DzoEjZ6h.js","assets/sidebar-PSpwc3Zu.js","assets/useResizeDrag-CWrW8GV3.js","assets/observeResize-Br7VOcTc.js","assets/AnimatedHeight-DEeywxgS.js","assets/assets-CrCgj2yM.js","assets/sourceControl-B9aMMjp2.js","assets/assetUrls-BNjjSBLP.js","assets/browserHistoryStore-CW_ylkPy.js","assets/preview-CDQ5ceMi.js","assets/openFileInPreview-52PEk4wb.js","assets/keybindings-B9X0TLvu.js","assets/Icons-2l7Ym4KO.js","assets/preview-DRZGCh-w.js","assets/PierreEntryIcon-CUoKY0yE.js","assets/RenderErrorBoundary-BeYcnW7D.js","assets/sourceControlClients-XtdH6kjx.js","assets/browserLinkTarget-Dlnk6CC2.js","assets/pullRequestIcons-D8Koo716.js","assets/pullRequests-DKqH-UAm.js","assets/threadSort-Bd2rijEy.js","assets/popover-Cpc0L75h.js","assets/PopoverHandle-tRSwNzqr.js","assets/ProjectFavicon-in-OyDkg.js","assets/ProjectMonogram-DdbScW3Y.js","assets/composerTrigger-BGi0iyhl.js","assets/projectFilesQueryState-DvEcN38K.js","assets/checkbox-Bqcsvpsf.js","assets/CheckboxIndicator-XdXpYxXy.js","assets/FieldItemContext-sr3mCd2v.js","assets/terminalSessions-C2k3TT8f.js","assets/useHandleNewThread-CJ3yJ6tD.js","assets/p4ProjectFile-B1qTw64E.js","assets/uiStateStore-Cd96D_GT.js","assets/guideRunStore-DFawhaj_.js","assets/pullRequestDetail.logic-CXEtJJcn.js","assets/pullRequestReviewStore-CpLjLBJR.js","assets/sidebarProjectGrouping-D02jVAL6.js","assets/EnvironmentMachineIcon-oObSi9GI.js","assets/alert-UH7IbYie.js","assets/alert-dialog-D3mCT6Vy.js","assets/AlertDialogRoot-C6RQ4Ag-.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-C3xHekTe.js","assets/RedactedSensitiveText-DM7Kme26.js","assets/kbd-D3uRVBMx.js","assets/settingsLayout-krWuVpsF.js","assets/WorkspacePageContainer-C3u06BW-.js","assets/KeybindingsSettings.logic-CCfOv-KZ.js","assets/usageShortcuts-C0jTsdR4.js","assets/primaryCloudLinkState-kvnCGEBC.js","assets/command-cKnhWwdw.js","assets/ComboboxClear-CBRGIQSm.js","assets/ComboboxGroupLabel-DVAwRoGV.js","assets/ConnectionStatusDot-CR_qWdCU.js","assets/standalone-page-DrNBm39d.js","assets/primary-YDhFfOF8.js","assets/onboarding-D6kvYnD1.js","assets/scheduledTasksSettings.logic-gN3n5v-e.js","assets/main-BD4pReCY.css","assets/DiffWorkerPoolProvider-D2t5zRbN.js","assets/textarea-DBTtAB2q.js"])))=>i.map(i=>d[i]);
2
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-CxLeDuff.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,$p as o,A as s,Cf as c,Cp as l,D as u,Dm as d,Em as f,F as p,Fd as m,Ff as h,Fs as g,Hp as _,Id as v,Im as y,Is as b,Jp as x,Kp as S,Ld as C,Lf as w,Mp as T,Ns as E,Of as D,Pl as O,Qn as k,Qo as A,Rd as j,Ta as M,Tg as N,Tm as P,Vp as F,Wf as I,Wm as L,Wp as R,Xn as z,Yn as B,Zn as V,_b as H,_f as ee,_m as te,bd as ne,bp as re,ch as U,cp as ie,dm as ae,dr as oe,eb as se,er as W,fd as ce,ff as le,fr as G,gf as ue,ib as de,ic as fe,ih as pe,ir as me,lh as he,md as ge,mf as _e,nc as ve,nm as ye,nr as be,ns as xe,of as Se,op as Ce,or as we,pd as Te,pf as Ee,pr as De,qd as Oe,qf as ke,qm as Ae,rr as je,rv as Me,sr as Ne,t as K,tc as Pe,th as Fe,uh as Ie,um as Le,uv as Re,vf as ze,wd as Be,xp as Ve,zd as He,zm as Ue}from"./utils-CcBaVOX5.js";import{W as We}from"./runtime-DeVKKxNz.js";import{C as Ge,O as Ke,k as qe,w as Je}from"./entities-CTJ1ube2.js";import{Cn as Ye,bn as Xe,dn as Ze,gn as Qe,xn as $e,yn as et}from"./runtime-DCbEdU32.js";import{F as tt,K as nt,P as rt,V as it,_ as at,l as ot,q as st,x as ct,y as lt}from"./TooltipViewport-rDmof6w5.js";import{J as ut,L as dt,R as ft,n as pt}from"./ChatMarkdown-Cw9bEYxG.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-oshTwPZM.js";import{t as vt}from"./spinner-BeAnBYcY.js";import{i as yt,m as bt,p as xt}from"./toast-Dkj3G-UM.js";import{E as St,J as Ct,K as wt,d as Tt}from"./useSettings-Cg0O7Ek7.js";import{s as Et}from"./server-Ct4-BCZx.js";import{i as Dt,n as Ot}from"./session-Bb7JWdWO.js";import{n as kt}from"./query-D5Kb9u_z.js";import{t as At}from"./use-atom-command-D4TeQyNE.js";import{t as q,u as jt}from"./rightPanelStore-DQ1c3-Lt.js";import{u as Mt}from"./queries-eqpX-CHf.js";import{C as Nt,Q as Pt,Z as Ft,_ as It,at as Lt,c as Rt,d as zt,ft as Bt,l as Vt,lt as Ht,nt as Ut,ot as Wt,s as Gt,t as Kt,tt as qt,u as Jt,v as Yt,w as Xt}from"./diffRendering-JsGpyVJ1.js";import{C as Zt,E as Qt,G as $t,H as en,K as tn,U as nn,V as rn,W as an,d as on,i as sn,u as cn}from"./Virtualizer-CzClYBap.js";import{l as ln,ut as un}from"./getDiffFileInput-Bt5vSiss.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-D2t5zRbN.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-CGLKzg3V.js";import{S as vn,a as yn,b as bn,i as xn,n as Sn,r as Cn,t as wn}from"./DiffCommentAnnotation-y1CrEDvy.js";import{r as Tn}from"./mediaSource-DQsJoeCH.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{a as J,n as Y,r as On,t as X}from"./tooltip-BeHmtauD.js";import{t as kn}from"./skeleton-DIPW_H7N.js";import{t as An}from"./textarea-DBTtAB2q.js";import{t as jn}from"./toggle-DYYe3Gb8.js";import{n as Mn,t as Nn}from"./toggle-group-hQw0fxkT.js";import{i as Pn,l as Fn,o as In,r as Ln,s as Rn,t as zn}from"./combobox-CoLp0McG.js";import{t as Bn}from"./input-CSgYZgdv.js";import{t as Vn}from"./scroll-area-C9Jh_pl0.js";import{a as Hn,c as Un,i as Wn,o as Gn,r as Kn,s as qn,t as Jn}from"./dialog-CjB1WWbE.js";import{t as Yn}from"./useResizeDrag-CWrW8GV3.js";import{a as Xn,i as Zn,o as Qn,r as $n,t as er}from"./empty-CMnFXg8W.js";import{i as tr}from"./device-BqGYZxfg.js";import{t as nr}from"./observeResize-Br7VOcTc.js";import{n as rr,t as ir}from"./assetUrls-BNjjSBLP.js";import{f as ar}from"./browserHistoryStore-CW_ylkPy.js";import{_ as or,y as sr}from"./keybindings-B9X0TLvu.js";import{i as cr,n as lr}from"./Icons-2l7Ym4KO.js";import{t as ur}from"./PierreEntryIcon-CUoKY0yE.js";import{C as dr,E as fr,S as pr,T as mr,_ as hr,a as gr,b as _r,c as vr,d as yr,dt as br,g as xr,h as Sr,l as Cr,m as wr,o as Tr,p as Er,rt as Dr,s as Or,u as kr,ut as Ar,v as jr,w as Mr,x as Nr,y as Pr}from"./RenderErrorBoundary-BeYcnW7D.js";import{n as Fr,r as Ir}from"./sourceControlClients-XtdH6kjx.js";import{n as Lr}from"./pullRequestIcons-D8Koo716.js";import{D as Rr,a as zr,c as Br,i as Vr,k as Hr,n as Ur,r as Wr,u as Gr}from"./pullRequests-DKqH-UAm.js";import{a as Kr,i as qr,n as Jr,o as Yr,t as Xr}from"./popover-Cpc0L75h.js";import{A as Zr,B as Qr,C as $r,D as ei,E as ti,G as ni,H as ri,I as ii,J as ai,K as oi,L as si,M as ci,N as li,O as ui,P as di,R as fi,S as pi,T as mi,U as hi,V as gi,Y as _i,_ as vi,a as yi,b as bi,c as xi,d as Si,f as Ci,g as wi,i as Ti,j as Ei,k as Di,l as Oi,o as ki,p as Ai,r as ji,s as Mi,t as Ni,v as Pi,w as Fi,y as Ii,z as Li}from"./pullRequestDetail.logic-CXEtJJcn.js";import{i as Ri,n as zi,r as Bi,t as Vi}from"./pullRequestReviewStore-CpLjLBJR.js";import{t as Hi}from"./terminalLabels-BgLOlb2G.js";import{n as Ui}from"./useHandleNewThread-CJ3yJ6tD.js";import{r as Wi}from"./uiStateStore-Cd96D_GT.js";import{i as Gi,m as Ki,n as qi,r as Ji,t as Yi}from"./guideRunStore-DFawhaj_.js";import{n as Xi}from"./EnvironmentMachineIcon-oObSi9GI.js";import{i as Zi,n as Qi,r as $i,t as ea}from"./alert-UH7IbYie.js";import{t as ta}from"./kbd-D3uRVBMx.js";import{d as na,l as ra,t as ia,u as aa}from"./command-cKnhWwdw.js";import{Ai as oa,Ei as sa,Eo as ca,Fi as la,Ga as ua,Ii as da,Mi as fa,Ni as pa,Oi as ma,Pi as ha,Ua as ga,_o as _a,bi as va,ho as ya,mn as ba,mo as xa,oi as Sa,po as Ca,si as wa,wi as Ta,xi as Ea}from"./main-DIEsHSIy.js";import"./WorkspacePageHeader-MBEFb20_.js";import{r as Da,s as Oa,t as ka}from"./usePullRequestActions-Cxt5UQ0d.js";function Aa(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function ja(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Ma(e.items,t.items)}function Ma(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 Na(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Pt,``),t.before(r)):(r.setAttribute(Ft,``),t.after(r)),n?.observe(r),r}function Pa(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Fa=1e5,Ia=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,La=`data-diffs-search`,Ra=`:host {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-CjBrGNWY.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-C5GGWTfe.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-stop-0Wd2uKSK.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/runtime-BVmDVuJ-.js","assets/runtime-BK2Lh1vB.js","assets/TooltipViewport-Be_gbUW1.js","assets/toast-BZ96uuab.js","assets/spinner-BZ5ohCyO.js","assets/useParams-rbhXoEw9.js","assets/DiffFileTree-CBEjDul5.js","assets/useSettings-B09a3zie.js","assets/server-DwkxciXh.js","assets/session-BIwsf8Q4.js","assets/use-atom-command-CdV5BZYB.js","assets/themePalette-BMlBfFUx.js","assets/diffRendering-BuOJdnZ8.js","assets/index-BXvrSYK3.js","assets/fileTreeExpansion-CBn1SzSX.js","assets/pierre-icons-DY8ZeGCr.js","assets/query-B2_Td0ad.js","assets/DiffCommentAnnotation-6V9nI3Cm.js","assets/Virtualizer-B_IsUzcr.js","assets/getDiffFileInput-IQ1TDM4E.js","assets/main-C0z861OK.js","assets/vcsRefInvalidation-B66hRx4g.js","assets/entities-aKdRyfsJ.js","assets/number-field-Pve745k3.js","assets/useRegisterFieldControl-D4FG4i3_.js","assets/FormContext-DcnLkh-4.js","assets/CSPContext-jKZ42W4p.js","assets/select-vBkqTMKL.js","assets/SelectScrollUpArrow-Bq-GYRhT.js","assets/link-DW1IQk5s.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-CYNRqeNP.js","assets/useNavigate-AZUCIeU4.js","assets/useLocation-DHd-KBb-.js","assets/rightPanelStore-rZSIb-5z.js","assets/toastHelpers-DxXYm50b.js","assets/queries-B0FvRKmk.js","assets/session-logic-D8FbVFDm.js","assets/htmlRender-lwQ3HyqS.js","assets/mediaSource-BLpxwEw3.js","assets/fileLinks-BgHa8yE4.js","assets/mediaReference-BQ9J-tjl.js","assets/usageFormat-DhefL58S.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-BPiLl1TV.js","assets/skeleton-PlPtYr_f.js","assets/useAriaLabelledBy-CYRfRdAq.js","assets/toggle-DJ8KOwn5.js","assets/toggle-group-2e3XGJdx.js","assets/CompositeRoot-BMHKb-nN.js","assets/input-FUjAUGXY.js","assets/Input-BZ1XdBC0.js","assets/FieldControl-DwBVFJAI.js","assets/scroll-area-Cf7uLi_s.js","assets/ScrollAreaCorner-DBtks1xb.js","assets/dist-CMJL98Oz.js","assets/dialog-BpR3dRVS.js","assets/DialogTitle-pLX9Mw1n.js","assets/sidebar-O52WtiJv.js","assets/useResizeDrag-CWrW8GV3.js","assets/observeResize-CZuDzlcZ.js","assets/AnimatedHeight-yuTG4G03.js","assets/assets-JgE2I_Ix.js","assets/sourceControl-BkJeQRrv.js","assets/assetUrls-CYjvy6P4.js","assets/browserHistoryStore-CdncPjG8.js","assets/preview-YhZE3kRt.js","assets/openFileInPreview-Dns9tPaB.js","assets/keybindings-DuCyi9aT.js","assets/Icons-Be1TL1sN.js","assets/preview-CI9HEdfV.js","assets/PierreEntryIcon-CHy821MU.js","assets/RenderErrorBoundary-CIVNp8r9.js","assets/sourceControlClients-CtMx7u86.js","assets/browserLinkTarget-Bf9H9UVe.js","assets/pullRequestIcons-csprKuju.js","assets/pullRequests-B85p5Xnw.js","assets/threadSort-Bd2rijEy.js","assets/popover-hYAmvSJj.js","assets/PopoverHandle-BkzqaTB6.js","assets/ProjectFavicon-LcyFYpHB.js","assets/ProjectMonogram-C8FlNLaU.js","assets/composerTrigger-BGi0iyhl.js","assets/projectFilesQueryState-BdWJ4WwI.js","assets/checkbox-d50pgAVe.js","assets/CheckboxIndicator-lkbFKbE7.js","assets/FieldItemContext-sr3mCd2v.js","assets/terminalSessions-C1xOLG3i.js","assets/useHandleNewThread-BsnMrEPr.js","assets/p4ProjectFile-jwYvYDE-.js","assets/uiStateStore-4i21PZUL.js","assets/guideRunStore-DfNfJUIu.js","assets/pullRequestDetail.logic-DYx7bEwE.js","assets/pullRequestReviewStore-_uEYgfaW.js","assets/sidebarProjectGrouping-BYVdJp_w.js","assets/EnvironmentMachineIcon-B6wAZat7.js","assets/alert-BOVMKHDy.js","assets/alert-dialog-Du3fYY3I.js","assets/AlertDialogRoot-DaczVYX9.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-w6RkBCUH.js","assets/RedactedSensitiveText-DACYfm7e.js","assets/kbd-CGgmav-Q.js","assets/settingsLayout-WhjsCfB6.js","assets/WorkspacePageContainer-BxI-x0oV.js","assets/KeybindingsSettings.logic-Ctmq4InP.js","assets/usageShortcuts-CREc0FBr.js","assets/primaryCloudLinkState-CyPf4N0F.js","assets/command-DFkhX6wm.js","assets/ComboboxClear-B0HJXjbz.js","assets/ComboboxGroupLabel-CMc5xUrd.js","assets/ConnectionStatusDot-CpmZ8NE5.js","assets/standalone-page-DrNBm39d.js","assets/primary-BlS2rEKe.js","assets/onboarding-CE8pzS12.js","assets/scheduledTasksSettings.logic-W9AQpJk4.js","assets/main-BD4pReCY.css","assets/DiffWorkerPoolProvider-f4-YQsHo.js","assets/textarea-DIg__-Gi.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-BXvrSYK3.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,$p as o,A as s,Cf as c,Cp as l,D as u,Dm as d,Em as f,F as p,Fd as m,Ff as h,Fs as g,Hp as _,Id as v,Im as y,Is as b,Jp as x,Kp as S,Ld as C,Lf as w,Mp as T,Ns as E,Of as D,Pl as O,Qn as k,Qo as A,Rd as j,Ta as M,Tg as N,Tm as P,Vp as F,Wf as I,Wm as L,Wp as R,Xn as z,Yn as B,Zn as V,_b as H,_f as ee,_m as te,bd as ne,bp as re,ch as U,cp as ie,dm as ae,dr as oe,eb as se,er as W,fd as ce,ff as le,fr as G,gf as ue,ib as de,ic as fe,ih as pe,ir as me,lh as he,md as ge,mf as _e,nc as ve,nm as ye,nr as be,ns as xe,of as Se,op as Ce,or as we,pd as Te,pf as Ee,pr as De,qd as Oe,qf as ke,qm as Ae,rr as je,rv as Me,sr as Ne,t as K,tc as Pe,th as Fe,uh as Ie,um as Le,uv as Re,vf as ze,wd as Be,xp as Ve,zd as He,zm as Ue}from"./utils-C5GGWTfe.js";import{W as We}from"./runtime-BVmDVuJ-.js";import{C as Ge,O as Ke,k as qe,w as Je}from"./entities-aKdRyfsJ.js";import{Cn as Ye,bn as Xe,dn as Ze,gn as Qe,xn as $e,yn as et}from"./runtime-BK2Lh1vB.js";import{F as tt,K as nt,P as rt,V as it,_ as at,l as ot,q as st,x as ct,y as lt}from"./TooltipViewport-Be_gbUW1.js";import{J as ut,L as dt,R as ft,n as pt}from"./ChatMarkdown-CFUfXlYp.js";import{a as mt,o as ht,s as gt,t as _t}from"./select-vBkqTMKL.js";import{t as vt}from"./spinner-BZ5ohCyO.js";import{i as yt,m as bt,p as xt}from"./toast-BZ96uuab.js";import{E as St,J as Ct,K as wt,d as Tt}from"./useSettings-B09a3zie.js";import{s as Et}from"./server-DwkxciXh.js";import{i as Dt,n as Ot}from"./session-BIwsf8Q4.js";import{n as kt}from"./query-B2_Td0ad.js";import{t as At}from"./use-atom-command-CdV5BZYB.js";import{t as q,u as jt}from"./rightPanelStore-rZSIb-5z.js";import{u as Mt}from"./queries-B0FvRKmk.js";import{C as Nt,Q as Pt,Z as Ft,_ as It,at as Lt,c as Rt,d as zt,ft as Bt,l as Vt,lt as Ht,nt as Ut,ot as Wt,s as Gt,t as Kt,tt as qt,u as Jt,v as Yt,w as Xt}from"./diffRendering-BuOJdnZ8.js";import{C as Zt,E as Qt,G as $t,H as en,K as tn,U as nn,V as rn,W as an,d as on,i as sn,u as cn}from"./Virtualizer-B_IsUzcr.js";import{l as ln,ut as un}from"./getDiffFileInput-IQ1TDM4E.js";import{i as dn,r as fn,t as pn}from"./DiffWorkerPoolProvider-f4-YQsHo.js";import{t as mn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as hn,r as gn,t as _n}from"./FileDiff-Bj9kBLN2.js";import{S as vn,a as yn,b as bn,i as xn,n as Sn,r as Cn,t as wn}from"./DiffCommentAnnotation-6V9nI3Cm.js";import{r as Tn}from"./mediaSource-BLpxwEw3.js";import{o as En}from"./timestampFormat-wac2e_Jz.js";import{t as Dn}from"./env-wK1YYxA8.js";import{a as J,n as Y,r as On,t as X}from"./tooltip-BPiLl1TV.js";import{t as kn}from"./skeleton-PlPtYr_f.js";import{t as An}from"./textarea-DIg__-Gi.js";import{t as jn}from"./toggle-DJ8KOwn5.js";import{n as Mn,t as Nn}from"./toggle-group-2e3XGJdx.js";import{i as Pn,l as Fn,o as In,r as Ln,s as Rn,t as zn}from"./combobox-BrCd1kH5.js";import{t as Bn}from"./input-FUjAUGXY.js";import{t as Vn}from"./scroll-area-Cf7uLi_s.js";import{a as Hn,c as Un,i as Wn,o as Gn,r as Kn,s as qn,t as Jn}from"./dialog-BpR3dRVS.js";import{t as Yn}from"./useResizeDrag-CWrW8GV3.js";import{a as Xn,i as Zn,o as Qn,r as $n,t as er}from"./empty-Cy-8us9l.js";import{i as tr}from"./device-Nh7DArH7.js";import{t as nr}from"./observeResize-CZuDzlcZ.js";import{n as rr,t as ir}from"./assetUrls-CYjvy6P4.js";import{f as ar}from"./browserHistoryStore-CdncPjG8.js";import{_ as or,y as sr}from"./keybindings-DuCyi9aT.js";import{i as cr,n as lr}from"./Icons-Be1TL1sN.js";import{t as ur}from"./PierreEntryIcon-CHy821MU.js";import{C as dr,E as fr,S as pr,T as mr,_ as hr,a as gr,b as _r,c as vr,d as yr,dt as br,g as xr,h as Sr,l as Cr,m as wr,o as Tr,p as Er,rt as Dr,s as Or,u as kr,ut as Ar,v as jr,w as Mr,x as Nr,y as Pr}from"./RenderErrorBoundary-CIVNp8r9.js";import{n as Fr,r as Ir}from"./sourceControlClients-CtMx7u86.js";import{n as Lr}from"./pullRequestIcons-csprKuju.js";import{D as Rr,a as zr,c as Br,i as Vr,k as Hr,n as Ur,r as Wr,u as Gr}from"./pullRequests-B85p5Xnw.js";import{a as Kr,i as qr,n as Jr,o as Yr,t as Xr}from"./popover-hYAmvSJj.js";import{A as Zr,B as Qr,C as $r,D as ei,E as ti,G as ni,H as ri,I as ii,J as ai,K as oi,L as si,M as ci,N as li,O as ui,P as di,R as fi,S as pi,T as mi,U as hi,V as gi,Y as _i,_ as vi,a as yi,b as bi,c as xi,d as Si,f as Ci,g as wi,i as Ti,j as Ei,k as Di,l as Oi,o as ki,p as Ai,r as ji,s as Mi,t as Ni,v as Pi,w as Fi,y as Ii,z as Li}from"./pullRequestDetail.logic-DYx7bEwE.js";import{i as Ri,n as zi,r as Bi,t as Vi}from"./pullRequestReviewStore-_uEYgfaW.js";import{t as Hi}from"./terminalLabels-BgLOlb2G.js";import{n as Ui}from"./useHandleNewThread-BsnMrEPr.js";import{r as Wi}from"./uiStateStore-4i21PZUL.js";import{i as Gi,m as Ki,n as qi,r as Ji,t as Yi}from"./guideRunStore-DfNfJUIu.js";import{n as Xi}from"./EnvironmentMachineIcon-B6wAZat7.js";import{i as Zi,n as Qi,r as $i,t as ea}from"./alert-BOVMKHDy.js";import{t as ta}from"./kbd-CGgmav-Q.js";import{d as na,l as ra,t as ia,u as aa}from"./command-DFkhX6wm.js";import{Ai as oa,Ei as sa,Eo as ca,Fi as la,Ga as ua,Ii as da,Mi as fa,Ni as pa,Oi as ma,Pi as ha,Ua as ga,_o as _a,bi as va,ho as ya,mn as ba,mo as xa,oi as Sa,po as Ca,si as wa,wi as Ta,xi as Ea}from"./main-C0z861OK.js";import"./WorkspacePageHeader-Bc_F6Uog.js";import{r as Da,s as Oa,t as ka}from"./usePullRequestActions-Cv12eqOn.js";function Aa(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function ja(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Ma(e.items,t.items)}function Ma(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 Na(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Pt,``),t.before(r)):(r.setAttribute(Ft,``),t.after(r)),n?.observe(r),r}function Pa(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Fa=1e5,Ia=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,La=`data-diffs-search`,Ra=`:host {
3
3
  display: block;
4
4
  position: sticky;
5
5
  z-index: 100;
@@ -211,6 +211,6 @@ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-CxLeDuff.js
211
211
  [data-code]::-webkit-scrollbar-thumb {
212
212
  background-color: var(--diffs-bg-context);
213
213
  }
214
- `;function fd(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:a,commenting:o,loadDiffFiles:c,onOpenFile:l}=e,[u,d]=(0,Z.useState)(null),{resolvedTheme:f}=wt(),m;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){m=null;break bb0}let e=$u(r),i=ed(e,n);if(i.length===0){m=null;break bb0}let a=Rt(nd(n.path,zt(r),i),`pull-request-guide-excerpt:${n.path}:${n.side}:${n.start}-${n.end}`),o=a?.kind===`files`?a.files[0]:void 0;if(o===void 0){m=null;break bb0}let s={additions:new Set(i.flatMap(gd)),deletions:new Set(i.flatMap(hd))},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,_;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){_=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==g?(e=async e=>{let t=await c(e),r=rd(t.newFile.contents,g);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=g,t[13]=e):e=t[13],_=e}let v=_,y;t[14]!==o?.pending||t[15]!==u||t[16]!==n.path||t[17]!==n.side||t[18]!==a||t[19]!==h?.drawn?(y=()=>{let e=new Map,t=(t,n)=>{let r=`${t}:${n}`,i=e.get(r);if(i!==void 0)return i;let a={side:t,lineNumber:n,metadata:{markers:[],pending:[],draft:!1}};return e.set(r,a),a},r=(n,r,i)=>{let a=t(n,r);e.set(`${n}:${r}`,{...a,metadata:i(a.metadata)})},i=n.side===`new`?`additions`:`deletions`;for(let e of a)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of o?.pending??[]){if(e.path!==n.path)continue;let t=hc(e.position),i=mc(t.side);h?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=hc(u.position);r(mc(e.side),e.line,md)}return[...e.values()]},t[14]=o?.pending,t[15]=u,t[16]=n.path,t[17]=n.side,t[18]=a,t[19]=h?.drawn,t[20]=y):y=t[20],o?.pending;let b;t[21]===y?b=t[22]:(b=y(),t[21]=y,t[22]=b);let x=b,S;t[23]===r?S=t[24]:(S=e=>{if(e===null||r===null)return;let t=p(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=o!==null&&u===null,T=o?.onAskAgent??null,E;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==T?(E=e=>{if(u===null||r===null||T===null)return;let t=s({id:`pull-request-guide:${n.path}:${u.range.start}:${u.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:u.range,text:e});d(null),t!==null&&T(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=T,t[29]=E):E=t[29];let D=E,O;t[30]===f?O=t[31]:(O=Vt(f),t[30]=f,t[31]=O);let k;t[32]===v?k=t[33]:(k=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=k);let A;t[34]!==C||t[35]!==w||t[36]!==f||t[37]!==O||t[38]!==k?(A={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:f,preferredHighlighter:_a,unsafeCSS:dd,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...k},t[34]=C,t[35]=w,t[36]=f,t[37]=O,t[38]=k,t[39]=A):A=t[39];let j=A,M;t[40]===n.caption?M=t[41]:(M=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(Ju,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=M);let N;t[42]!==x||t[43]!==D||t[44]!==o||t[45]!==u||t[46]!==n.end||t[47]!==n.path||t[48]!==n.side||t[49]!==n.start||t[50]!==r||t[51]!==i||t[52]!==T||t[53]!==l||t[54]!==j||t[55]!==h?(N=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:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(_n,{fileDiff:h.fileDiff,options:j,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(pd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(gc,{comment:e,onRemove:()=>o?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&o!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${hc(u.position).line}`,text:``,placeholder:o.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:o.canComment?`Add to review`:`Ask agent`,...o.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{o.canComment?(o.onComment({path:n.path,oldPath:r===null?null:_d(r,n.path),position:u.position,body:e}),d(null)):D(e)}}):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:()=>l(n.path),children:(0,$.jsx)(ne,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=o,t[45]=u,t[46]=n.end,t[47]=n.path,t[48]=n.side,t[49]=n.start,t[50]=r,t[51]=i,t[52]=T,t[53]=l,t[54]=j,t[55]=h,t[56]=N):N=t[56];let P;return t[57]!==M||t[58]!==N?(P=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[M,N]}),t[57]=M,t[58]=N,t[59]=P):P=t[59],P}function pd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(cd,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function md(e){return{...e,draft:!0}}function hd(e){return e.oldLine===null?[]:[e.oldLine]}function gd(e){return e.newLine===null?[]:[e.newLine]}function _d(e,t){let n=zt(e);return n===t?null:n}function vd(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=wt(),a;t[0]===n?a=t[1]:(a=mn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Vt(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:_a,unsafeCSS:Yo,loadDiffFiles:r},t[4]=r,t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c,u;return t[8]!==o||t[9]!==l?(u=(0,$.jsx)(`div`,{className:`border-t border-border/60`,children:(0,$.jsx)(_n,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var yd={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function bd(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:a,onRailOpenChange:o,stopList:s,nextTitle:c,files:u,loadDiffFiles:d,diffLoading:f,commenting:p,onStep:m,onAsk:h,onFinish:g,onOpenFile:_}=e,y;t[0]===n?y=t[1]:(y=id(n),t[0]=n,t[1]=y);let{lettered:b,byExcerpt:x}=y,S;t[2]===n.excerpts?S=t[3]:(S=new Set(n.excerpts.map(xd)),t[2]=n.excerpts,t[3]=S);let C=S,w,T,E,D,O,k,A,M,N;if(t[4]!==x||t[5]!==p||t[6]!==f||t[7]!==C||t[8]!==u||t[9]!==r||t[10]!==b||t[11]!==d||t[12]!==_||t[13]!==o||t[14]!==m||t[15]!==a||t[16]!==n.attention||t[17]!==n.excerpts||t[18]!==n.files||t[19]!==n.summary||t[20]!==n.title||t[21]!==i||t[22]!==s){let e;t[32]===C?e=t[33]:(e=e=>!C.has(e.path),t[32]=C,t[33]=e);let c=n.files.filter(e);w=b.length>0;let l=w&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===l?T=t[35]:(T=K(`grid gap-8`,l),t[34]=l,t[35]=T),E=`flex min-w-0 flex-col gap-5`;let h=r+1,g;t[36]!==i||t[37]!==h?(g=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,i]}),t[36]=i,t[37]=h,t[38]=g):g=t[38];let y;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=y):y=t[39];let S=r+1,P;t[40]!==i||t[41]!==S?(P=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,S,` of `,i]}),t[40]=i,t[41]=S,t[42]=P):P=t[42];let F=a&&`rotate-180`,I;t[43]===F?I=t[44]:(I=K(F),t[43]=F,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,$.jsx)(v,{"aria-hidden":!0,className:I}),t[45]=I,t[46]=L);let R;t[47]!==P||t[48]!==L?(R=(0,$.jsxs)(ya,{render:y,children:[P,L]}),t[47]=P,t[48]=L,t[49]=R):R=t[49];let z=r===0,B;t[50]===m?B=t[51]:(B=()=>m(-1),t[50]=m,t[51]=B);let V;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(He,{"aria-hidden":!0}),t[52]=V):V=t[52];let H;t[53]!==z||t[54]!==B?(H=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:z,onClick:B,children:V}),t[53]=z,t[54]=B,t[55]=H):H=t[55];let ee=r===i-1,te;t[56]===m?te=t[57]:(te=()=>m(1),t[56]=m,t[57]=te);let ne;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(v,{"aria-hidden":!0}),t[58]=ne):ne=t[58];let re;t[59]!==ee||t[60]!==te?(re=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:ee,onClick:te,children:ne}),t[59]=ee,t[60]=te,t[61]=re):re=t[61];let U;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(ta,{children:`J`}),(0,$.jsx)(ta,{children:`K`})]}),t[62]=U):U=t[62];let ie;t[63]!==H||t[64]!==re?(ie=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[H,re,U]}),t[63]=H,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]!==g||t[67]!==R||t[68]!==ie?(ae=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[g,R,ie]}),t[66]=g,t[67]=R,t[68]=ie,t[69]=ae):ae=t[69];let oe;t[70]===s?oe=t[71]:(oe=(0,$.jsx)(xa,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=oe),t[72]!==o||t[73]!==a||t[74]!==ae||t[75]!==oe?(D=(0,$.jsxs)(Ca,{open:a,onOpenChange:o,children:[ae,oe]}),t[72]=o,t[73]=a,t[74]=ae,t[75]=oe,t[76]=D):D=t[76];let se;t[77]===n.title?se=t[78]:(se=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=se);let W;t[79]===n.summary?W=t[80]:(W=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(Ju,{text:n.summary})}),t[79]=n.summary,t[80]=W),t[81]!==se||t[82]!==W?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[se,W]}),t[81]=se,t[82]=W,t[83]=O):O=t[83],t[84]===n.attention?k=t[85]:(k=n.attention===null?null:(0,$.jsxs)(ea,{controlAlignment:`first-line`,children:[(0,$.jsx)(_e,{}),(0,$.jsx)(Zi,{children:yd[n.attention.kind]}),(0,$.jsx)($i,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Ju,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=k),t[86]!==x||t[87]!==p||t[88]!==f||t[89]!==u||t[90]!==d||t[91]!==_||t[92]!==n.excerpts?(A=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(pn,{children:n.excerpts.map((e,t)=>(0,$.jsx)(fd,{excerpt:e,file:u.get(e.path)??null,loading:f,notes:x[t]??[],commenting:p,loadDiffFiles:d,onOpenFile:_},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=x,t[87]=p,t[88]=f,t[89]=u,t[90]=d,t[91]=_,t[92]=n.excerpts,t[93]=A):A=t[93],t[94]===b?M=t[95]:(M=(0,$.jsx)(ld,{notes:b,className:`@min-[90rem]/guide:hidden`}),t[94]=b,t[95]=M),N=c.length>0?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n.excerpts.length>0?`Also in this stop`:`Files in this stop`}),(0,$.jsx)(pn,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:c.map(e=>{let t=u.get(e.path),n=t===void 0?null:Gt([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(Ca,{children:[(0,$.jsxs)(ya,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left text-xs outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(j,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(ze,{"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)(Ju,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Cr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(xa,{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)(vd,{file:t,loadDiffFiles:d})})]})},e.path)})})})]}):null,t[4]=x,t[5]=p,t[6]=f,t[7]=C,t[8]=u,t[9]=r,t[10]=b,t[11]=d,t[12]=_,t[13]=o,t[14]=m,t[15]=a,t[16]=n.attention,t[17]=n.excerpts,t[18]=n.files,t[19]=n.summary,t[20]=n.title,t[21]=i,t[22]=s,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=M,t[31]=N}else w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28],A=t[29],M=t[30],N=t[31];let P;t[96]!==h||t[97]!==n.questions?(P=n.questions.length>0||h!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>h===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Ju,{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)(Ve,{"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)(Ju,{text:e,plain:!0})})]},e)),h===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>h(``),children:[(0,$.jsx)(Ve,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=h,t[97]=n.questions,t[98]=P):P=t[98];let F;t[99]!==c||t[100]!==g||t[101]!==m?(F=c===null?g===null?null:(0,$.jsxs)(G,{onClick:g,children:[(0,$.jsx)(l,{"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: `,c]}),(0,$.jsx)(ge,{"aria-hidden":!0})]}),t[99]=c,t[100]=g,t[101]=m,t[102]=F):F=t[102];let I;t[103]===F?I=t[104]:(I=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:F}),t[103]=F,t[104]=I);let L;t[105]!==P||t[106]!==I||t[107]!==E||t[108]!==D||t[109]!==O||t[110]!==k||t[111]!==A||t[112]!==M||t[113]!==N?(L=(0,$.jsxs)(`article`,{className:E,children:[D,O,k,A,M,N,P,I]}),t[105]=P,t[106]=I,t[107]=E,t[108]=D,t[109]=O,t[110]=k,t[111]=A,t[112]=M,t[113]=N,t[114]=L):L=t[114];let R;t[115]!==w||t[116]!==b?(R=w?(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)(ld,{notes:b})}):null,t[115]=w,t[116]=b,t[117]=R):R=t[117];let z;return t[118]!==T||t[119]!==L||t[120]!==R?(z=(0,$.jsxs)(`div`,{className:T,children:[L,R]}),t[118]=T,t[119]=L,t[120]=R,t[121]=z):z=t[121],z}function xd(e){return e.path}var Sd=new Map;function Cd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=zi(r),t[0]=r,t[1]=o);let s=`${n}:${o}:${i}`,c;t[2]===s?c=t[3]:(c={key:s,cursor:null,done:!1,files:Sd},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:Sd},f=a.some(e=>!d.files.has(e))&&!d.done,p=kt,m=f?Wr.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:Sd};if(t.cursor!==_||t.done)return t;let n=Rt(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Jt(e),e);return{key:s,cursor:g.nextCursor,done:g.nextCursor===null,files:r}})},y=[_,g,s],t[13]=_,t[14]=g,t[15]=s,t[16]=v,t[17]=y):(v=t[16],y=t[17]),(0,Z.useEffect)(v,y);let b=f&&h.error===null,x=f?h.error:null,S;return t[18]!==d.files||t[19]!==h.refresh||t[20]!==b||t[21]!==x?(S={files:d.files,loading:b,error:x,retry:h.refresh},t[18]=d.files,t[19]=h.refresh,t[20]=b,t[21]=x,t[22]=S):S=t[22],S}function wd(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=Yi(qi(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=Ji(f),m;t[4]===f?m=t[5]:(m=e=>Gi.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?[]:Xu(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=Cd(C),T=At(Wr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=$o(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(Yu(y,e,v)),t[21]=j,t[22]=y,t[23]=v,t[24]=M):M=t[24];let N=M,P;t[25]===N?P=t[26]:(P=e=>{e.defaultPrevented||e.isComposing||Sa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key!==`j`&&e.key!==`k`||Ki(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)(ad,{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)(bd,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(ad,{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 Td(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Wr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=kt(a),s;t[3]===n?s=t[4]:(s=Wr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=xe(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=At(Wr.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=()=>Gi.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`&&(Gi.getState().settle(qi(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:fi(We(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 Ed(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:f,onTourShown:p}=e,m;t[0]!==n||t[1]!==r||t[2]!==i?(m={environmentId:n,reference:r,title:i},t[0]=n,t[1]=r,t[2]=i,t[3]=m):m=t[3];let{query:h,data:g,running:_,canWrite:v,write:y}=Td(m),b;t[4]!==n||t[5]!==r?(b=qi(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=zi(r),t[7]=r,t[8]=S);let C=S,w=Bi(r),T=Ri(Od),E=Ri(Dd),D;t[9]!==T||t[10]!==s||t[11]!==c||t[12]!==w||t[13]!==E||t[14]!==C?(D=!s&&c===null?null:{canComment:s,pending:w,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return T(C,{id:Vi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>E(C,e),onAskAgent:c},t[9]=T,t[10]=s,t[11]=c,t[12]=w,t[13]=E,t[14]=C,t[15]=D):D=t[15];let O=D,k,A;t[16]!==o||t[17]!==x?(k=()=>{if(o)return Gi.getState().setShown(x),()=>{Gi.getState().shownKey===x&&Gi.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]===p?N=t[21]:(N=()=>p?.(),t[20]=p,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)(vt,{}):(0,$.jsx)(d,{"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)(vt,{})}),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)(ea,{variant:_?`info`:`warning`,children:[_?(0,$.jsx)(vt,{}):(0,$.jsx)(Ae,{}),(0,$.jsx)($i,{children:_?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!_&&v?(0,$.jsx)(Qi,{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 re;t[52]!==j||t[53]!==l?(re=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]=re):re=t[54];let U;t[55]!==o||t[56]!==te||t[57]!==O||t[58]!==n||t[59]!==j||t[60]!==u||t[61]!==f||t[62]!==r||t[63]!==re?(U=(0,$.jsx)(wd,{environmentId:n,reference:r,guide:j,banner:te,active:o,commenting:O,onAsk:re,onFinish:u,onOpenFile:f}),t[55]=o,t[56]=te,t[57]=O,t[58]=n,t[59]=j,t[60]=u,t[61]=f,t[62]=r,t[63]=re,t[64]=U):U=t[64];let ie;return t[65]!==ne||t[66]!==U?(ie=(0,$.jsx)(qu,{value:ne,children:U}),t[65]=ne,t[66]=U,t[67]=ie):ie=t[67],ie}function Dd(e){return e.removeComment}function Od(e){return e.addComment}function kd(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 Ad={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`},jd={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.`},Md=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,Nd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Pd=()=>n(()=>import(`./PullRequestCodeTab-D3ntjIAg.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,337,338,339])),Fd=(0,Z.lazy)(Pd),Id=new Map,Ld=e=>typeof e==`string`?e:fe(e);function Rd(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:i,disabled:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(we,{}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;if(t[3]!==a||t[4]!==n){let e;t[6]===a?e=t[7]:(e=e=>(0,$.jsx)(me,{value:e.environmentId,disabled:a,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Xi,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=a,t[7]=e),c=n.map(e),t[3]=a,t[4]=n,t[5]=c}else c=t[5];let l;return t[8]!==s||t[9]!==c||t[10]!==r?(l=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(je,{value:r,onValueChange:s,children:c})]}),t[8]=s,t[9]=c,t[10]=r,t[11]=l):l=t[11],l}var zd=(e,t)=>{e.preventDefault(),e.stopPropagation(),Ml({url:t.url,openLabel:Al(Fr.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function Bd(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=K(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=K(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(Ae,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Yr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(G,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(Lr.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(qr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Xr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function Vd({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:r=null,reference:i,listEntry:a=null,refreshToken:s=0,onActed:c,onClose:f,context:p=`page`,composerDraftTarget:g,onBack:_,onSelectPullRequest:y,onGuideShown:b}){let x=Je(),S=Ge(),C=S.find(t=>t.id===i.projectId&&t.environmentId===e),E=C?.repositoryIdentity,k=x.get(e)?.environment.capabilities.threadPullRequests===!0,A=(0,Z.useMemo)(()=>k?hi(i,E):{projectId:i.projectId,repository:i.repository,number:i.number},[i,E,k]),j=`${A.projectId}:${A.host??``}:${A.repository}#${A.number}`,M=a?.projectId===A.projectId&&a.repository.toLowerCase()===A.repository.toLowerCase()&&(A.host===void 0||a.host.toLowerCase()===A.host.toLowerCase())&&a.number===A.number?a:null,[N,P]=(0,Z.useState)(!1),[F,I]=(0,Z.useState)(0),[V,H]=(0,Z.useState)(`summary`),[te,re]=(0,Z.useState)(`newest`),[U,ie]=(0,Z.useState)(()=>({pullRequestKey:j,oid:null})),se=U.pullRequestKey===j?U.oid:null,le=e=>{ie({pullRequestKey:j,oid:e})},ue=e=>{le(e),H(`code`)},[de,fe]=(0,Z.useState)(null),pe=e=>{le(null),fe(t=>({path:e,nonce:(t?.nonce??0)+1})),Pd(),H(`code`)},he=Gi(t=>t.openRequestKey===qi(e,A));he&&V!==`guide`&&H(`guide`),(0,Z.useEffect)(()=>{he&&Gi.getState().requestOpen(null)},[he]);let ge=`${e}:${j}`,[_e,ye]=(0,Z.useState)(()=>({key:ge,tabs:new Set([`summary`])})),De=_e.key===ge?_e.tabs:new Set([V]);(0,Z.useEffect)(()=>{ye(e=>e.key===ge?e.tabs.has(V)?e:{key:ge,tabs:new Set(e.tabs).add(V)}:{key:ge,tabs:new Set([V])})},[V,ge]);let[Ae,Fe]=(0,Z.useState)(!1),Ie=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Fe(Ie.current[V]??!1)},[V]);let Le=Ae,ze=(0,Z.useRef)({}),He=(0,Z.useMemo)(()=>({summary:e=>{ze.current.summary=e},timeline:e=>{ze.current.timeline=e},code:e=>{ze.current.code=e}}),[]),Ue=(0,Z.useRef)(null),Ke=(0,Z.useRef)(null),qe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=qe.current;e!==null&&(qe.current=null,Le&&e.tab===V&&ze.current[V]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Le,V]);let Ze=Wi(e=>e.pullRequestMergeMethod),Qe=Wi(e=>e.setPullRequestMergeMethod),et=Da(e,A.projectId),tt=(0,Z.useMemo)(()=>et(),[et]),[nt,rt]=(0,Z.useState)(null),it=e=>{rt({pullRequestKey:j,method:e})},at=kd(j),[ot,st]=(0,Z.useState)(null),ct=Dt(e,Re),lt=kt(Wr.detail({environmentId:e,input:A})),ut=kt(Wr.activity({environmentId:e,input:A})),dt=Br(e),[ft,pt]=(0,Z.useState)(()=>si(typeof window>`u`?void 0:window.localStorage,e,A));(0,Z.useEffect)(()=>{pt(si(typeof window>`u`?void 0:window.localStorage,e,A))},[e,j,A.projectId,A.repository,A.number]),(0,Z.useEffect)(()=>{lt.data!==null&&(_i(typeof window>`u`?void 0:window.localStorage,e,A,lt.data),pt(lt.data))},[lt.data,e,j,A.projectId,A.repository,A.number]);let mt=Qr({live:lt.data,cached:ft,reference:A}),ht=(0,Z.useMemo)(()=>M===null?null:Vr(M),[M]),gt=(0,Z.useMemo)(()=>lt.data===null?null:{...lt.data,checksState:jr(lt.data.checks)},[lt.data]),_t=Gr(e,A,gt,lt.dataUpdatedAt),vt=(0,Z.useMemo)(()=>Ur(mt,Ur(_t,ht)),[mt,_t,ht]),bt=(0,Z.useMemo)(()=>mt===null||vt===null||vt===mt?mt:{...mt,title:vt.title,state:vt.state,headBranch:vt.headBranch,baseBranch:vt.baseBranch,updatedAt:vt.updatedAt,author:vt.author??mt.author,additions:vt.additions??mt.additions,deletions:vt.deletions??mt.deletions,changedFiles:vt.changedFiles??mt.changedFiles,mergeability:vt.mergeability??mt.mergeability,closedAt:vt.closedAt===void 0?mt.closedAt:vt.closedAt,mergedAt:vt.mergedAt===void 0?mt.mergedAt:vt.mergedAt,isDraft:vt.isDraft??mt.isDraft},[mt,vt]),wt=ut.data,q=(0,Z.useMemo)(()=>bt===null?null:{...bt,capabilities:ct?bt.capabilities:{...bt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:ct?bt.viewerPermissions:{...bt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:wt?.author??bt.author,reviewers:wt?.reviewers??bt.reviewers,comments:wt?.comments??[],commentCount:wt?.commentCount??0,commentsTruncated:wt?.commentsTruncated??!1,reviewThreads:wt?.reviewThreads??[],commits:wt?.commits??[],reactions:wt?.reactions??[]},[wt,ct,bt]),Nt=q??vt,Pt=xe(Et),{copyToClipboard:Ft}=xt({target:`pull request reference`,onCopy:e=>yt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>yt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),It=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||Sa()||or(e,Pt,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||Ft(`#${A.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,j]);let Lt=q===null?null:Xe(q.url),Rt=Fr.get(q?.provider),zt=(0,Z.useMemo)(()=>({repositoryUrl:Lt===null?null:Rt.referenceAutolinkRepositoryUrl(Lt),threadRef:r}),[Rt,Lt,r]),Bt=q?.author&&Lt!==null?Rt.authorProfileUrl(q.author.login,Lt):null,Vt=Nt?ci(Nt.provider,Nt.number,Nt.headBranch,q?.headRepositoryNameWithOwner,Xe(Nt.url)):ti(A,E),Ht=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Ut=kt(q===null?null:Mt.listRefs({environmentId:e,input:{cwd:q.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Wt=q!==null&&Fi(q.baseBranch,Ut.data?.refs??[]),Gt=wc(e,(0,Z.useMemo)(()=>q===null||q.capabilities.stacks!==!0||!k?null:{...A,host:A.host??Ye(q.url)?.host},[q,A,k])),Kt=Gt.data,qt=k&&q?.capabilities.stacks===!0&&q.capabilities.stackActions===!0&&x.get(e)?.environment.capabilities.pullRequestStackActions===!0,Jt=ji({supportsStackActions:qt,hasStack:Kt!==null,stackPending:!Gt.isFresh,stackError:Gt.error}),Yt=ut.isPending&&wt===null,Xt=wt===null?ut.error:null,Zt=(0,Z.useCallback)(()=>{lt.refresh(),ut.refresh(),Gt.refresh()},[ut.refresh,lt.refresh,Gt.refresh]),[Qt,$t]=(0,Z.useState)(0),en=Qt+(dt??0),tn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!bt)return;let e={key:ge,updatedAt:bt.updatedAt};if(ni(tn.current,e)){if(ut.isPending)return;ut.refresh(),$t(e=>e+1)}tn.current=e},[ut.isPending,ut.refresh,bt,ge]),Rc(()=>{lt.refresh()},{key:`pull-request:${e}:${j}`});let nn=At(Wr.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:A}}),Zt(),$t(e=>e+1)}finally{an(!1)}},[e,nn,A,Zt]),cn=(0,Z.useRef)(s);(0,Z.useEffect)(()=>{cn.current!==s&&(cn.current=s,sn())},[s,sn]);let ln=At(Wr.runAction,{reportFailure:!1}),un=At(Wr.comment,{reportFailure:!1}),[dn,fn]=(0,Z.useState)(null),pn=dn!==null,mn=At(Wr.update,{reportFailure:!1}),[hn,gn]=(0,Z.useState)(null),_n=hn?.pullRequestKey===j?hn.text:null,[vn,yn]=(0,Z.useState)(!1),bn=Ui(),{environments:xn}=St(),Sn=(0,Z.useMemo)(()=>{let t=S.find(t=>t.id===A.projectId&&t.environmentId===e)?.repositoryIdentity;return $e(t,A.repository,A.number)},[e,S,A.number,A.projectId,A.repository]),Cn=(0,Z.useMemo)(()=>p===`page`?xc({environmentId:e,projectId:A.projectId},S,xn.map(e=>({environmentId:e.environmentId,label:e.label,machine:O(e.serverConfig)}))):[],[p,e,xn,S,A.projectId]),[wn,Tn]=(0,Z.useState)(null),Dn=wn?.pullRequestKey===j?wn.environmentId:e,kn=Cn.find(e=>e.environmentId===Dn)??null,An=kn?.environmentId??e,jn=kn?.workspaceRoot??q?.workspaceRoot??C?.workspaceRoot??null,Mn=Dt(An,Me),Nn=Oa({environmentId:An,cwd:jn}),Pn=async(t,n,r)=>{c?.(t,`sent`);let i=await ln({environmentId:e,input:{...A,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(fn(null),i._tag===`Failure`){let e=We(i),n=r===`rebase`?Md:jd[t];return yt.add({type:`error`,title:Ad[t],description:fi(e,n)}),c?.(t,`failed`),!1}return t===`revert`&&yt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&yt.add({type:`success`,title:`Branch deleted`}),Ei(t)?sn():Zt(),c?.(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:{...A,body:t}}))._tag===`Failure`?(fn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Pn(n)||Zt(),{commentPosted:!0})),Ln=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:{...A,title:n}});yn(!1),r._tag===`Failure`?yt.add({type:`error`,title:`The title could not be saved`,description:fi(We(r),`The host refused the new title.`)}):(gn(null),Zt())},Rn=g??null,zn=Nn.isAllowed&&Mn,Vn=Rn!==null||zn,Hn=di(Rn!==null),Un=Td({environmentId:e,reference:A,title:q?.title??null}),Wn=()=>{Un.write(),Un.data?.guide??H(`guide`)},Gn=(e,t)=>{let n=u.getState(),r=n.getComposerDraft(e),i=Ld(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=oi(r?.prompt??``,r?.reviewComments??[],o),c=Ii({prompt:s,lastHandoffPrompt:Id.get(i)},t.prompt);Id.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,bi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Kn=async(e,t,n)=>{let r=n??await 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(Rn!==null){Gn(Rn,n),yt.add({type:`success`,title:`Added to the composer`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`});return}st(t);let i=Pe(An,kn?.projectId??q.projectId),a=await Kn(i,n);if(st(null),a!==null&&r?.keepGuide===!0){let t=u.getState().getDraftSession(a.draftId);t!==null&&(jt.getState().openPullRequest(ve(t.environmentId,t.threadId),{environmentId:e,projectId:A.projectId,...A.host===void 0?{}:{host:A.host},repository:A.repository,number:A.number,url:q.url}),Gi.getState().requestOpen(qi(e,A)))}a===null?yt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):yt.add({type:`success`,title:`Asked in a thread`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},Jn=async(e,t,n=`worktree`)=>{if(!Nt||ot!==null)return;if(Rn!==null&&t!==null){Gn(Rn,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(jn===null||!Nn.isAllowed||!Ot(An,`source-control:write`)||n===`worktree`&&!Ot(An,`orchestration:operate`))return;st(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=Pe(An,kn?.projectId??Nt.projectId),a=await bn(i).then(e=>e,()=>null);if(a===null){st(null),yt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Nn.run({reference:Nt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){st(null);let e=Nn.error instanceof Error?Nn.error.message:null;yt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await bn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){st(null),yt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}st(null);let s={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};t===null?yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:s):(await Kn(i,t,a),yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s))},Yn=()=>{q&&qn(`ask`,{...ki({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`,{...Mi({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}`,yi({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}`,Ti({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(li(e),xi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,finding:e}))},tr=()=>{q&&Jn(`findings`,Oi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,reviewThreads:q.reviewThreads,comments:q.comments,checks:Dr?[]:q.checks,commentsTruncated:q.commentsTruncated}))},nr=()=>{Nt&&Jn(`conflicts`,{prompt:Ci({number:Nt.number,url:Nt.url,headBranch:Nt.headBranch,baseBranch:Nt.baseBranch})})},rr=q?q.capabilities.mergeMethods.filter(e=>q.mergeCapabilities[e]):[],ir=nt?.pullRequestKey===j?nt.method:null,ar=gi(rr,ir,tt,Ze),cr=Ni[ar],lr=`Auto-merge (${cr.toLowerCase()})`,ur=q?.state===`open`&&q.mergeability===`conflicting`,fr=q?.state===`open`&&q.autoMergeEnabled===!0,pr=q?.autoMergeMethod,hr=pr?`Auto-merge (${Ni[pr].toLowerCase()})`:`Auto-merge`,gr=q?.state===`open`?q.workflowApprovalsRequired??0:0,_r=q===null?null:Li(q),vr=Tt(e,e=>e.reviewGuidesEnabled),br=Nd.filter(e=>(e.value!==`code`||q===null||q.capabilities.diff)&&(e.value!==`guide`||vr));(0,Z.useEffect)(()=>{br.some(e=>e.value===V)||H(`summary`)},[V,br]);let xr=e=>q?.capabilities.actions.includes(e)===!0&&q.viewerPermissions.actions.includes(e),Cr=q?jr(q.checks):null,wr=vt?.checksState===void 0?Cr:vt.checksState,Er=wr!==`failing`&&q?.checks.some(e=>e.status===`action-required`)?`pending`:wr,Dr=Er!==Cr,Or=q?ri({state:q.state,isDraft:q.isDraft,mergeability:q.mergeability,checksState:Er,autoMergeEnabled:q.autoMergeEnabled,hasMergeMethod:rr.length>0,canMerge:Jt&&xr(`merge`),canMarkReady:xr(`ready`),canEnableAutoMerge:Jt&&xr(`enable-auto-merge`)}):null,kr=q?.state===`open`&&xr(q.isDraft?`ready`:`draft`)&&!(q.isDraft&&Or===`ready`),Ar=Jt&&q?.state===`open`&&(fr&&xr(`disable-auto-merge`)||!fr&&Or!==`enable-auto-merge`&&!q.isDraft&&!ur&&xr(`enable-auto-merge`)&&rr.length>0),Nr=Jt&&q?.state===`open`&&(Or===`enable-auto-merge`||Or===`auto-merge-armed`)&&xr(`merge`)&&!q.isDraft&&!ur&&rr.length>0,Ir=q?.state===`open`&&xr(`merge`)&&!q.isDraft&&!ur&&rr.length>1,Rr=q?Mr({state:q.state,isDraft:q.isDraft}):null,zr=q!==null&&Ai(q),Hr=xn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),Kr=async()=>{q!==null&&await Ct()?.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 fd(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:a,commenting:o,loadDiffFiles:c,onOpenFile:l}=e,[u,d]=(0,Z.useState)(null),{resolvedTheme:f}=wt(),m;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){m=null;break bb0}let e=$u(r),i=ed(e,n);if(i.length===0){m=null;break bb0}let a=Rt(nd(n.path,zt(r),i),`pull-request-guide-excerpt:${n.path}:${n.side}:${n.start}-${n.end}`),o=a?.kind===`files`?a.files[0]:void 0;if(o===void 0){m=null;break bb0}let s={additions:new Set(i.flatMap(gd)),deletions:new Set(i.flatMap(hd))},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,_;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){_=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==g?(e=async e=>{let t=await c(e),r=rd(t.newFile.contents,g);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=g,t[13]=e):e=t[13],_=e}let v=_,y;t[14]!==o?.pending||t[15]!==u||t[16]!==n.path||t[17]!==n.side||t[18]!==a||t[19]!==h?.drawn?(y=()=>{let e=new Map,t=(t,n)=>{let r=`${t}:${n}`,i=e.get(r);if(i!==void 0)return i;let a={side:t,lineNumber:n,metadata:{markers:[],pending:[],draft:!1}};return e.set(r,a),a},r=(n,r,i)=>{let a=t(n,r);e.set(`${n}:${r}`,{...a,metadata:i(a.metadata)})},i=n.side===`new`?`additions`:`deletions`;for(let e of a)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of o?.pending??[]){if(e.path!==n.path)continue;let t=hc(e.position),i=mc(t.side);h?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=hc(u.position);r(mc(e.side),e.line,md)}return[...e.values()]},t[14]=o?.pending,t[15]=u,t[16]=n.path,t[17]=n.side,t[18]=a,t[19]=h?.drawn,t[20]=y):y=t[20],o?.pending;let b;t[21]===y?b=t[22]:(b=y(),t[21]=y,t[22]=b);let x=b,S;t[23]===r?S=t[24]:(S=e=>{if(e===null||r===null)return;let t=p(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=o!==null&&u===null,T=o?.onAskAgent??null,E;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==T?(E=e=>{if(u===null||r===null||T===null)return;let t=s({id:`pull-request-guide:${n.path}:${u.range.start}:${u.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:u.range,text:e});d(null),t!==null&&T(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=T,t[29]=E):E=t[29];let D=E,O;t[30]===f?O=t[31]:(O=Vt(f),t[30]=f,t[31]=O);let k;t[32]===v?k=t[33]:(k=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=k);let A;t[34]!==C||t[35]!==w||t[36]!==f||t[37]!==O||t[38]!==k?(A={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:f,preferredHighlighter:_a,unsafeCSS:dd,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...k},t[34]=C,t[35]=w,t[36]=f,t[37]=O,t[38]=k,t[39]=A):A=t[39];let j=A,M;t[40]===n.caption?M=t[41]:(M=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(Ju,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=M);let N;t[42]!==x||t[43]!==D||t[44]!==o||t[45]!==u||t[46]!==n.end||t[47]!==n.path||t[48]!==n.side||t[49]!==n.start||t[50]!==r||t[51]!==i||t[52]!==T||t[53]!==l||t[54]!==j||t[55]!==h?(N=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:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(_n,{fileDiff:h.fileDiff,options:j,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(pd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(gc,{comment:e,onRemove:()=>o?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&o!==null?(0,$.jsx)(wn,{kind:`draft`,rangeLabel:`${n.path}:${hc(u.position).line}`,text:``,placeholder:o.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:o.canComment?`Add to review`:`Ask agent`,...o.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{o.canComment?(o.onComment({path:n.path,oldPath:r===null?null:_d(r,n.path),position:u.position,body:e}),d(null)):D(e)}}):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:()=>l(n.path),children:(0,$.jsx)(ne,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=o,t[45]=u,t[46]=n.end,t[47]=n.path,t[48]=n.side,t[49]=n.start,t[50]=r,t[51]=i,t[52]=T,t[53]=l,t[54]=j,t[55]=h,t[56]=N):N=t[56];let P;return t[57]!==M||t[58]!==N?(P=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[M,N]}),t[57]=M,t[58]=N,t[59]=P):P=t[59],P}function pd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(cd,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function md(e){return{...e,draft:!0}}function hd(e){return e.oldLine===null?[]:[e.oldLine]}function gd(e){return e.newLine===null?[]:[e.newLine]}function _d(e,t){let n=zt(e);return n===t?null:n}function vd(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=wt(),a;t[0]===n?a=t[1]:(a=mn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Vt(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:_a,unsafeCSS:Yo,loadDiffFiles:r},t[4]=r,t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c,u;return t[8]!==o||t[9]!==l?(u=(0,$.jsx)(`div`,{className:`border-t border-border/60`,children:(0,$.jsx)(_n,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var yd={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function bd(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:a,onRailOpenChange:o,stopList:s,nextTitle:c,files:u,loadDiffFiles:d,diffLoading:f,commenting:p,onStep:m,onAsk:h,onFinish:g,onOpenFile:_}=e,y;t[0]===n?y=t[1]:(y=id(n),t[0]=n,t[1]=y);let{lettered:b,byExcerpt:x}=y,S;t[2]===n.excerpts?S=t[3]:(S=new Set(n.excerpts.map(xd)),t[2]=n.excerpts,t[3]=S);let C=S,w,T,E,D,O,k,A,M,N;if(t[4]!==x||t[5]!==p||t[6]!==f||t[7]!==C||t[8]!==u||t[9]!==r||t[10]!==b||t[11]!==d||t[12]!==_||t[13]!==o||t[14]!==m||t[15]!==a||t[16]!==n.attention||t[17]!==n.excerpts||t[18]!==n.files||t[19]!==n.summary||t[20]!==n.title||t[21]!==i||t[22]!==s){let e;t[32]===C?e=t[33]:(e=e=>!C.has(e.path),t[32]=C,t[33]=e);let c=n.files.filter(e);w=b.length>0;let l=w&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===l?T=t[35]:(T=K(`grid gap-8`,l),t[34]=l,t[35]=T),E=`flex min-w-0 flex-col gap-5`;let h=r+1,g;t[36]!==i||t[37]!==h?(g=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,i]}),t[36]=i,t[37]=h,t[38]=g):g=t[38];let y;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(G,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=y):y=t[39];let S=r+1,P;t[40]!==i||t[41]!==S?(P=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,S,` of `,i]}),t[40]=i,t[41]=S,t[42]=P):P=t[42];let F=a&&`rotate-180`,I;t[43]===F?I=t[44]:(I=K(F),t[43]=F,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,$.jsx)(v,{"aria-hidden":!0,className:I}),t[45]=I,t[46]=L);let R;t[47]!==P||t[48]!==L?(R=(0,$.jsxs)(ya,{render:y,children:[P,L]}),t[47]=P,t[48]=L,t[49]=R):R=t[49];let z=r===0,B;t[50]===m?B=t[51]:(B=()=>m(-1),t[50]=m,t[51]=B);let V;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(He,{"aria-hidden":!0}),t[52]=V):V=t[52];let H;t[53]!==z||t[54]!==B?(H=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:z,onClick:B,children:V}),t[53]=z,t[54]=B,t[55]=H):H=t[55];let ee=r===i-1,te;t[56]===m?te=t[57]:(te=()=>m(1),t[56]=m,t[57]=te);let ne;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(v,{"aria-hidden":!0}),t[58]=ne):ne=t[58];let re;t[59]!==ee||t[60]!==te?(re=(0,$.jsx)(G,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:ee,onClick:te,children:ne}),t[59]=ee,t[60]=te,t[61]=re):re=t[61];let U;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(ta,{children:`J`}),(0,$.jsx)(ta,{children:`K`})]}),t[62]=U):U=t[62];let ie;t[63]!==H||t[64]!==re?(ie=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[H,re,U]}),t[63]=H,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]!==g||t[67]!==R||t[68]!==ie?(ae=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[g,R,ie]}),t[66]=g,t[67]=R,t[68]=ie,t[69]=ae):ae=t[69];let oe;t[70]===s?oe=t[71]:(oe=(0,$.jsx)(xa,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=oe),t[72]!==o||t[73]!==a||t[74]!==ae||t[75]!==oe?(D=(0,$.jsxs)(Ca,{open:a,onOpenChange:o,children:[ae,oe]}),t[72]=o,t[73]=a,t[74]=ae,t[75]=oe,t[76]=D):D=t[76];let se;t[77]===n.title?se=t[78]:(se=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=se);let W;t[79]===n.summary?W=t[80]:(W=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(Ju,{text:n.summary})}),t[79]=n.summary,t[80]=W),t[81]!==se||t[82]!==W?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[se,W]}),t[81]=se,t[82]=W,t[83]=O):O=t[83],t[84]===n.attention?k=t[85]:(k=n.attention===null?null:(0,$.jsxs)(ea,{controlAlignment:`first-line`,children:[(0,$.jsx)(_e,{}),(0,$.jsx)(Zi,{children:yd[n.attention.kind]}),(0,$.jsx)($i,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Ju,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=k),t[86]!==x||t[87]!==p||t[88]!==f||t[89]!==u||t[90]!==d||t[91]!==_||t[92]!==n.excerpts?(A=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(pn,{children:n.excerpts.map((e,t)=>(0,$.jsx)(fd,{excerpt:e,file:u.get(e.path)??null,loading:f,notes:x[t]??[],commenting:p,loadDiffFiles:d,onOpenFile:_},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=x,t[87]=p,t[88]=f,t[89]=u,t[90]=d,t[91]=_,t[92]=n.excerpts,t[93]=A):A=t[93],t[94]===b?M=t[95]:(M=(0,$.jsx)(ld,{notes:b,className:`@min-[90rem]/guide:hidden`}),t[94]=b,t[95]=M),N=c.length>0?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n.excerpts.length>0?`Also in this stop`:`Files in this stop`}),(0,$.jsx)(pn,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:c.map(e=>{let t=u.get(e.path),n=t===void 0?null:Gt([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(Ca,{children:[(0,$.jsxs)(ya,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left text-xs outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(j,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(ze,{"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)(Ju,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Cr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(xa,{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)(vd,{file:t,loadDiffFiles:d})})]})},e.path)})})})]}):null,t[4]=x,t[5]=p,t[6]=f,t[7]=C,t[8]=u,t[9]=r,t[10]=b,t[11]=d,t[12]=_,t[13]=o,t[14]=m,t[15]=a,t[16]=n.attention,t[17]=n.excerpts,t[18]=n.files,t[19]=n.summary,t[20]=n.title,t[21]=i,t[22]=s,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=M,t[31]=N}else w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28],A=t[29],M=t[30],N=t[31];let P;t[96]!==h||t[97]!==n.questions?(P=n.questions.length>0||h!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>h===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Ju,{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)(Ve,{"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)(Ju,{text:e,plain:!0})})]},e)),h===null?null:(0,$.jsxs)(G,{size:`sm`,variant:`ghost-muted`,onClick:()=>h(``),children:[(0,$.jsx)(Ve,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=h,t[97]=n.questions,t[98]=P):P=t[98];let F;t[99]!==c||t[100]!==g||t[101]!==m?(F=c===null?g===null?null:(0,$.jsxs)(G,{onClick:g,children:[(0,$.jsx)(l,{"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: `,c]}),(0,$.jsx)(ge,{"aria-hidden":!0})]}),t[99]=c,t[100]=g,t[101]=m,t[102]=F):F=t[102];let I;t[103]===F?I=t[104]:(I=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:F}),t[103]=F,t[104]=I);let L;t[105]!==P||t[106]!==I||t[107]!==E||t[108]!==D||t[109]!==O||t[110]!==k||t[111]!==A||t[112]!==M||t[113]!==N?(L=(0,$.jsxs)(`article`,{className:E,children:[D,O,k,A,M,N,P,I]}),t[105]=P,t[106]=I,t[107]=E,t[108]=D,t[109]=O,t[110]=k,t[111]=A,t[112]=M,t[113]=N,t[114]=L):L=t[114];let R;t[115]!==w||t[116]!==b?(R=w?(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)(ld,{notes:b})}):null,t[115]=w,t[116]=b,t[117]=R):R=t[117];let z;return t[118]!==T||t[119]!==L||t[120]!==R?(z=(0,$.jsxs)(`div`,{className:T,children:[L,R]}),t[118]=T,t[119]=L,t[120]=R,t[121]=z):z=t[121],z}function xd(e){return e.path}var Sd=new Map;function Cd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=zi(r),t[0]=r,t[1]=o);let s=`${n}:${o}:${i}`,c;t[2]===s?c=t[3]:(c={key:s,cursor:null,done:!1,files:Sd},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:Sd},f=a.some(e=>!d.files.has(e))&&!d.done,p=kt,m=f?Wr.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:Sd};if(t.cursor!==_||t.done)return t;let n=Rt(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Jt(e),e);return{key:s,cursor:g.nextCursor,done:g.nextCursor===null,files:r}})},y=[_,g,s],t[13]=_,t[14]=g,t[15]=s,t[16]=v,t[17]=y):(v=t[16],y=t[17]),(0,Z.useEffect)(v,y);let b=f&&h.error===null,x=f?h.error:null,S;return t[18]!==d.files||t[19]!==h.refresh||t[20]!==b||t[21]!==x?(S={files:d.files,loading:b,error:x,retry:h.refresh},t[18]=d.files,t[19]=h.refresh,t[20]=b,t[21]=x,t[22]=S):S=t[22],S}function wd(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=Yi(qi(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=Ji(f),m;t[4]===f?m=t[5]:(m=e=>Gi.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?[]:Xu(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=Cd(C),T=At(Wr.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=$o(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(Yu(y,e,v)),t[21]=j,t[22]=y,t[23]=v,t[24]=M):M=t[24];let N=M,P;t[25]===N?P=t[26]:(P=e=>{e.defaultPrevented||e.isComposing||Sa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key!==`j`&&e.key!==`k`||Ki(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)(ad,{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)(bd,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(ad,{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 Td(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Wr.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=kt(a),s;t[3]===n?s=t[4]:(s=Wr.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=xe(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=At(Wr.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=()=>Gi.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`&&(Gi.getState().settle(qi(n,r)),yt.add({type:`error`,title:`Could not start a review guide`,description:fi(We(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 Ed(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:f,onTourShown:p}=e,m;t[0]!==n||t[1]!==r||t[2]!==i?(m={environmentId:n,reference:r,title:i},t[0]=n,t[1]=r,t[2]=i,t[3]=m):m=t[3];let{query:h,data:g,running:_,canWrite:v,write:y}=Td(m),b;t[4]!==n||t[5]!==r?(b=qi(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=zi(r),t[7]=r,t[8]=S);let C=S,w=Bi(r),T=Ri(Od),E=Ri(Dd),D;t[9]!==T||t[10]!==s||t[11]!==c||t[12]!==w||t[13]!==E||t[14]!==C?(D=!s&&c===null?null:{canComment:s,pending:w,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return T(C,{id:Vi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>E(C,e),onAskAgent:c},t[9]=T,t[10]=s,t[11]=c,t[12]=w,t[13]=E,t[14]=C,t[15]=D):D=t[15];let O=D,k,A;t[16]!==o||t[17]!==x?(k=()=>{if(o)return Gi.getState().setShown(x),()=>{Gi.getState().shownKey===x&&Gi.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]===p?N=t[21]:(N=()=>p?.(),t[20]=p,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)(vt,{}):(0,$.jsx)(d,{"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)(vt,{})}),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)(ea,{variant:_?`info`:`warning`,children:[_?(0,$.jsx)(vt,{}):(0,$.jsx)(Ae,{}),(0,$.jsx)($i,{children:_?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!_&&v?(0,$.jsx)(Qi,{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 re;t[52]!==j||t[53]!==l?(re=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]=re):re=t[54];let U;t[55]!==o||t[56]!==te||t[57]!==O||t[58]!==n||t[59]!==j||t[60]!==u||t[61]!==f||t[62]!==r||t[63]!==re?(U=(0,$.jsx)(wd,{environmentId:n,reference:r,guide:j,banner:te,active:o,commenting:O,onAsk:re,onFinish:u,onOpenFile:f}),t[55]=o,t[56]=te,t[57]=O,t[58]=n,t[59]=j,t[60]=u,t[61]=f,t[62]=r,t[63]=re,t[64]=U):U=t[64];let ie;return t[65]!==ne||t[66]!==U?(ie=(0,$.jsx)(qu,{value:ne,children:U}),t[65]=ne,t[66]=U,t[67]=ie):ie=t[67],ie}function Dd(e){return e.removeComment}function Od(e){return e.addComment}function kd(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 Ad={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`},jd={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.`},Md=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,Nd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Pd=()=>n(()=>import(`./PullRequestCodeTab-CjBrGNWY.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,337,338,339])),Fd=(0,Z.lazy)(Pd),Id=new Map,Ld=e=>typeof e==`string`?e:fe(e);function Rd(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:i,disabled:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(we,{}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;if(t[3]!==a||t[4]!==n){let e;t[6]===a?e=t[7]:(e=e=>(0,$.jsx)(me,{value:e.environmentId,disabled:a,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Xi,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=a,t[7]=e),c=n.map(e),t[3]=a,t[4]=n,t[5]=c}else c=t[5];let l;return t[8]!==s||t[9]!==c||t[10]!==r?(l=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(je,{value:r,onValueChange:s,children:c})]}),t[8]=s,t[9]=c,t[10]=r,t[11]=l):l=t[11],l}var zd=(e,t)=>{e.preventDefault(),e.stopPropagation(),Ml({url:t.url,openLabel:Al(Fr.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function Bd(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=K(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=K(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(Ae,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Yr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(G,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(Lr.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(qr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Xr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function Vd({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:r=null,reference:i,listEntry:a=null,refreshToken:s=0,onActed:c,onClose:f,context:p=`page`,composerDraftTarget:g,onBack:_,onSelectPullRequest:y,onGuideShown:b}){let x=Je(),S=Ge(),C=S.find(t=>t.id===i.projectId&&t.environmentId===e),E=C?.repositoryIdentity,k=x.get(e)?.environment.capabilities.threadPullRequests===!0,A=(0,Z.useMemo)(()=>k?hi(i,E):{projectId:i.projectId,repository:i.repository,number:i.number},[i,E,k]),j=`${A.projectId}:${A.host??``}:${A.repository}#${A.number}`,M=a?.projectId===A.projectId&&a.repository.toLowerCase()===A.repository.toLowerCase()&&(A.host===void 0||a.host.toLowerCase()===A.host.toLowerCase())&&a.number===A.number?a:null,[N,P]=(0,Z.useState)(!1),[F,I]=(0,Z.useState)(0),[V,H]=(0,Z.useState)(`summary`),[te,re]=(0,Z.useState)(`newest`),[U,ie]=(0,Z.useState)(()=>({pullRequestKey:j,oid:null})),se=U.pullRequestKey===j?U.oid:null,le=e=>{ie({pullRequestKey:j,oid:e})},ue=e=>{le(e),H(`code`)},[de,fe]=(0,Z.useState)(null),pe=e=>{le(null),fe(t=>({path:e,nonce:(t?.nonce??0)+1})),Pd(),H(`code`)},he=Gi(t=>t.openRequestKey===qi(e,A));he&&V!==`guide`&&H(`guide`),(0,Z.useEffect)(()=>{he&&Gi.getState().requestOpen(null)},[he]);let ge=`${e}:${j}`,[_e,ye]=(0,Z.useState)(()=>({key:ge,tabs:new Set([`summary`])})),De=_e.key===ge?_e.tabs:new Set([V]);(0,Z.useEffect)(()=>{ye(e=>e.key===ge?e.tabs.has(V)?e:{key:ge,tabs:new Set(e.tabs).add(V)}:{key:ge,tabs:new Set([V])})},[V,ge]);let[Ae,Fe]=(0,Z.useState)(!1),Ie=(0,Z.useRef)({});(0,Z.useEffect)(()=>{Fe(Ie.current[V]??!1)},[V]);let Le=Ae,ze=(0,Z.useRef)({}),He=(0,Z.useMemo)(()=>({summary:e=>{ze.current.summary=e},timeline:e=>{ze.current.timeline=e},code:e=>{ze.current.code=e}}),[]),Ue=(0,Z.useRef)(null),Ke=(0,Z.useRef)(null),qe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=qe.current;e!==null&&(qe.current=null,Le&&e.tab===V&&ze.current[V]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Le,V]);let Ze=Wi(e=>e.pullRequestMergeMethod),Qe=Wi(e=>e.setPullRequestMergeMethod),et=Da(e,A.projectId),tt=(0,Z.useMemo)(()=>et(),[et]),[nt,rt]=(0,Z.useState)(null),it=e=>{rt({pullRequestKey:j,method:e})},at=kd(j),[ot,st]=(0,Z.useState)(null),ct=Dt(e,Re),lt=kt(Wr.detail({environmentId:e,input:A})),ut=kt(Wr.activity({environmentId:e,input:A})),dt=Br(e),[ft,pt]=(0,Z.useState)(()=>si(typeof window>`u`?void 0:window.localStorage,e,A));(0,Z.useEffect)(()=>{pt(si(typeof window>`u`?void 0:window.localStorage,e,A))},[e,j,A.projectId,A.repository,A.number]),(0,Z.useEffect)(()=>{lt.data!==null&&(_i(typeof window>`u`?void 0:window.localStorage,e,A,lt.data),pt(lt.data))},[lt.data,e,j,A.projectId,A.repository,A.number]);let mt=Qr({live:lt.data,cached:ft,reference:A}),ht=(0,Z.useMemo)(()=>M===null?null:Vr(M),[M]),gt=(0,Z.useMemo)(()=>lt.data===null?null:{...lt.data,checksState:jr(lt.data.checks)},[lt.data]),_t=Gr(e,A,gt,lt.dataUpdatedAt),vt=(0,Z.useMemo)(()=>Ur(mt,Ur(_t,ht)),[mt,_t,ht]),bt=(0,Z.useMemo)(()=>mt===null||vt===null||vt===mt?mt:{...mt,title:vt.title,state:vt.state,headBranch:vt.headBranch,baseBranch:vt.baseBranch,updatedAt:vt.updatedAt,author:vt.author??mt.author,additions:vt.additions??mt.additions,deletions:vt.deletions??mt.deletions,changedFiles:vt.changedFiles??mt.changedFiles,mergeability:vt.mergeability??mt.mergeability,closedAt:vt.closedAt===void 0?mt.closedAt:vt.closedAt,mergedAt:vt.mergedAt===void 0?mt.mergedAt:vt.mergedAt,isDraft:vt.isDraft??mt.isDraft},[mt,vt]),wt=ut.data,q=(0,Z.useMemo)(()=>bt===null?null:{...bt,capabilities:ct?bt.capabilities:{...bt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:ct?bt.viewerPermissions:{...bt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:wt?.author??bt.author,reviewers:wt?.reviewers??bt.reviewers,comments:wt?.comments??[],commentCount:wt?.commentCount??0,commentsTruncated:wt?.commentsTruncated??!1,reviewThreads:wt?.reviewThreads??[],commits:wt?.commits??[],reactions:wt?.reactions??[]},[wt,ct,bt]),Nt=q??vt,Pt=xe(Et),{copyToClipboard:Ft}=xt({target:`pull request reference`,onCopy:e=>yt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>yt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),It=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||Sa()||or(e,Pt,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||Ft(`#${A.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,j]);let Lt=q===null?null:Xe(q.url),Rt=Fr.get(q?.provider),zt=(0,Z.useMemo)(()=>({repositoryUrl:Lt===null?null:Rt.referenceAutolinkRepositoryUrl(Lt),threadRef:r}),[Rt,Lt,r]),Bt=q?.author&&Lt!==null?Rt.authorProfileUrl(q.author.login,Lt):null,Vt=Nt?ci(Nt.provider,Nt.number,Nt.headBranch,q?.headRepositoryNameWithOwner,Xe(Nt.url)):ti(A,E),Ht=(0,Z.useCallback)(e=>{yt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Ut=kt(q===null?null:Mt.listRefs({environmentId:e,input:{cwd:q.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Wt=q!==null&&Fi(q.baseBranch,Ut.data?.refs??[]),Gt=wc(e,(0,Z.useMemo)(()=>q===null||q.capabilities.stacks!==!0||!k?null:{...A,host:A.host??Ye(q.url)?.host},[q,A,k])),Kt=Gt.data,qt=k&&q?.capabilities.stacks===!0&&q.capabilities.stackActions===!0&&x.get(e)?.environment.capabilities.pullRequestStackActions===!0,Jt=ji({supportsStackActions:qt,hasStack:Kt!==null,stackPending:!Gt.isFresh,stackError:Gt.error}),Yt=ut.isPending&&wt===null,Xt=wt===null?ut.error:null,Zt=(0,Z.useCallback)(()=>{lt.refresh(),ut.refresh(),Gt.refresh()},[ut.refresh,lt.refresh,Gt.refresh]),[Qt,$t]=(0,Z.useState)(0),en=Qt+(dt??0),tn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!bt)return;let e={key:ge,updatedAt:bt.updatedAt};if(ni(tn.current,e)){if(ut.isPending)return;ut.refresh(),$t(e=>e+1)}tn.current=e},[ut.isPending,ut.refresh,bt,ge]),Rc(()=>{lt.refresh()},{key:`pull-request:${e}:${j}`});let nn=At(Wr.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:A}}),Zt(),$t(e=>e+1)}finally{an(!1)}},[e,nn,A,Zt]),cn=(0,Z.useRef)(s);(0,Z.useEffect)(()=>{cn.current!==s&&(cn.current=s,sn())},[s,sn]);let ln=At(Wr.runAction,{reportFailure:!1}),un=At(Wr.comment,{reportFailure:!1}),[dn,fn]=(0,Z.useState)(null),pn=dn!==null,mn=At(Wr.update,{reportFailure:!1}),[hn,gn]=(0,Z.useState)(null),_n=hn?.pullRequestKey===j?hn.text:null,[vn,yn]=(0,Z.useState)(!1),bn=Ui(),{environments:xn}=St(),Sn=(0,Z.useMemo)(()=>{let t=S.find(t=>t.id===A.projectId&&t.environmentId===e)?.repositoryIdentity;return $e(t,A.repository,A.number)},[e,S,A.number,A.projectId,A.repository]),Cn=(0,Z.useMemo)(()=>p===`page`?xc({environmentId:e,projectId:A.projectId},S,xn.map(e=>({environmentId:e.environmentId,label:e.label,machine:O(e.serverConfig)}))):[],[p,e,xn,S,A.projectId]),[wn,Tn]=(0,Z.useState)(null),Dn=wn?.pullRequestKey===j?wn.environmentId:e,kn=Cn.find(e=>e.environmentId===Dn)??null,An=kn?.environmentId??e,jn=kn?.workspaceRoot??q?.workspaceRoot??C?.workspaceRoot??null,Mn=Dt(An,Me),Nn=Oa({environmentId:An,cwd:jn}),Pn=async(t,n,r)=>{c?.(t,`sent`);let i=await ln({environmentId:e,input:{...A,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(fn(null),i._tag===`Failure`){let e=We(i),n=r===`rebase`?Md:jd[t];return yt.add({type:`error`,title:Ad[t],description:fi(e,n)}),c?.(t,`failed`),!1}return t===`revert`&&yt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&yt.add({type:`success`,title:`Branch deleted`}),Ei(t)?sn():Zt(),c?.(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:{...A,body:t}}))._tag===`Failure`?(fn(null),yt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Pn(n)||Zt(),{commentPosted:!0})),Ln=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:{...A,title:n}});yn(!1),r._tag===`Failure`?yt.add({type:`error`,title:`The title could not be saved`,description:fi(We(r),`The host refused the new title.`)}):(gn(null),Zt())},Rn=g??null,zn=Nn.isAllowed&&Mn,Vn=Rn!==null||zn,Hn=di(Rn!==null),Un=Td({environmentId:e,reference:A,title:q?.title??null}),Wn=()=>{Un.write(),Un.data?.guide??H(`guide`)},Gn=(e,t)=>{let n=u.getState(),r=n.getComposerDraft(e),i=Ld(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=oi(r?.prompt??``,r?.reviewComments??[],o),c=Ii({prompt:s,lastHandoffPrompt:Id.get(i)},t.prompt);Id.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,bi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},Kn=async(e,t,n)=>{let r=n??await 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(Rn!==null){Gn(Rn,n),yt.add({type:`success`,title:`Added to the composer`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`});return}st(t);let i=Pe(An,kn?.projectId??q.projectId),a=await Kn(i,n);if(st(null),a!==null&&r?.keepGuide===!0){let t=u.getState().getDraftSession(a.draftId);t!==null&&(jt.getState().openPullRequest(ve(t.environmentId,t.threadId),{environmentId:e,projectId:A.projectId,...A.host===void 0?{}:{host:A.host},repository:A.repository,number:A.number,url:q.url}),Gi.getState().requestOpen(qi(e,A)))}a===null?yt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):yt.add({type:`success`,title:`Asked in a thread`,description:n.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},Jn=async(e,t,n=`worktree`)=>{if(!Nt||ot!==null)return;if(Rn!==null&&t!==null){Gn(Rn,t),yt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(jn===null||!Nn.isAllowed||!Ot(An,`source-control:write`)||n===`worktree`&&!Ot(An,`orchestration:operate`))return;st(e);let r=yt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=Pe(An,kn?.projectId??Nt.projectId),a=await bn(i).then(e=>e,()=>null);if(a===null){st(null),yt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Nn.run({reference:Nt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){st(null);let e=Nn.error instanceof Error?Nn.error.message:null;yt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await bn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){st(null),yt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}st(null);let s={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};t===null?yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:s):(await Kn(i,t,a),yt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s))},Yn=()=>{q&&qn(`ask`,{...ki({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`,{...Mi({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}`,yi({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}`,Ti({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(li(e),xi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,finding:e}))},tr=()=>{q&&Jn(`findings`,Oi({number:q.number,title:q.title,url:q.url,headBranch:q.headBranch,baseBranch:q.baseBranch,reviewThreads:q.reviewThreads,comments:q.comments,checks:Dr?[]:q.checks,commentsTruncated:q.commentsTruncated}))},nr=()=>{Nt&&Jn(`conflicts`,{prompt:Ci({number:Nt.number,url:Nt.url,headBranch:Nt.headBranch,baseBranch:Nt.baseBranch})})},rr=q?q.capabilities.mergeMethods.filter(e=>q.mergeCapabilities[e]):[],ir=nt?.pullRequestKey===j?nt.method:null,ar=gi(rr,ir,tt,Ze),cr=Ni[ar],lr=`Auto-merge (${cr.toLowerCase()})`,ur=q?.state===`open`&&q.mergeability===`conflicting`,fr=q?.state===`open`&&q.autoMergeEnabled===!0,pr=q?.autoMergeMethod,hr=pr?`Auto-merge (${Ni[pr].toLowerCase()})`:`Auto-merge`,gr=q?.state===`open`?q.workflowApprovalsRequired??0:0,_r=q===null?null:Li(q),vr=Tt(e,e=>e.reviewGuidesEnabled),br=Nd.filter(e=>(e.value!==`code`||q===null||q.capabilities.diff)&&(e.value!==`guide`||vr));(0,Z.useEffect)(()=>{br.some(e=>e.value===V)||H(`summary`)},[V,br]);let xr=e=>q?.capabilities.actions.includes(e)===!0&&q.viewerPermissions.actions.includes(e),Cr=q?jr(q.checks):null,wr=vt?.checksState===void 0?Cr:vt.checksState,Er=wr!==`failing`&&q?.checks.some(e=>e.status===`action-required`)?`pending`:wr,Dr=Er!==Cr,Or=q?ri({state:q.state,isDraft:q.isDraft,mergeability:q.mergeability,checksState:Er,autoMergeEnabled:q.autoMergeEnabled,hasMergeMethod:rr.length>0,canMerge:Jt&&xr(`merge`),canMarkReady:xr(`ready`),canEnableAutoMerge:Jt&&xr(`enable-auto-merge`)}):null,kr=q?.state===`open`&&xr(q.isDraft?`ready`:`draft`)&&!(q.isDraft&&Or===`ready`),Ar=Jt&&q?.state===`open`&&(fr&&xr(`disable-auto-merge`)||!fr&&Or!==`enable-auto-merge`&&!q.isDraft&&!ur&&xr(`enable-auto-merge`)&&rr.length>0),Nr=Jt&&q?.state===`open`&&(Or===`enable-auto-merge`||Or===`auto-merge-armed`)&&xr(`merge`)&&!q.isDraft&&!ur&&rr.length>0,Ir=q?.state===`open`&&xr(`merge`)&&!q.isDraft&&!ur&&rr.length>1,Rr=q?Mr({state:q.state,isDraft:q.isDraft}):null,zr=q!==null&&Ai(q),Hr=xn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),Kr=async()=>{q!==null&&await Ct()?.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=gr>0&&!Dr&&xr(`approve-workflows`),Jr=Dr?Er===null?`No checks reported`:Pr(Er).label:q?mr(q.checks):null,Yr=q&&!q.commentsTruncated?mi(q.comments,q.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,Xr=p===`page`?(0,$.jsxs)(z,{children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(oe,{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)(h,{"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)(v,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(Y,{children:`Check out this pull request`})]}),(0,$.jsxs)(be,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(W,{disabled:!zn,onClick:()=>$n(`worktree`),children:[(0,$.jsx)(h,{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)(D,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:`In this repository`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:"Switches the branch you are working in, like `gh pr checkout`."})]})]}),Cn.length>0?(0,$.jsx)(Rd,{environments:Cn,value:An,onChange:e=>Tn({pullRequestKey:j,environmentId:e}),disabled:ot!==null}):null]})]}):null,$r=(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||Rn===null&&jn===null,onClick:nr,"aria-label":ot===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(Lr.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)(bl,{seed:M,summary:vt,checkoutCommand:Vt,onCheckoutError:Ht,number:A.number,tabs:br,activeTab:V,..._?{onBack:_}:{},...f?{onClose:f}:{},actions:Nt?(0,$.jsxs)(On,{delay:150,closeDelay:150,timeout:400,children:[Nt.state===`open`&&Nt.mergeability===`conflicting`?$r:null,Xr]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[N&&q?(0,$.jsx)(il,{display:`picker`,environmentId:e,reference:A,url:q.url,threadRef:null,onPickerOpenChange:P},`${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&&!f&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":Le,inert:Le,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`,Le?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:q&&Rr?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,onClick:_,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(Te,{"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 Ct()?.shell.openExternal(Lt),className:`min-w-0 cursor-pointer truncate text-left font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children: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 Ct()?.shell.openExternal(q.url),onContextMenu:e=>zd(e,q),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Rr.toneClassName),"aria-label":`Open pull request #${q.number} on host`,children:[`#`,q.number,(0,$.jsx)(Ee,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(Y,{side:`top`,children:Al(Rt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!Le,inert:!Le,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`,Le?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:q&&Rr?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(G,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:Le?0:-1,onClick:_,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(Te,{"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:Le?0:-1,onClick:()=>void Ct()?.shell.openExternal(q.url),onContextMenu:e=>zd(e,q),className:K(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Rr.toneClassName),"aria-label":`Open pull request #${q.number} on host`,children:[`#`,q.number,(0,$.jsx)(Ee,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(Y,{side:`top`,children:Al(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 select-none items-center justify-end gap-1`,children:[q?(0,$.jsxs)(On,{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)(Hc,{hostLabel:Rt.label,stack:Kt,notice:Gt.notice,onRetry:Gt.error?Gt.refresh:void 0,reference:A,environmentId:e,onSelect:y,mergeMethod:ar,canMerge:Gt.isFresh&&qt&&xr(`merge`)&&rr.length>0,canRebase:Gt.isFresh&&qt&&q.viewerPermissions.stackRebase===!0,onActed:()=>{Zt(),c?.()}}):null,p===`page`?(0,$.jsx)(il,{display:`count`,environmentId:e,reference:A,url:q.url,threadRef:null}):null,fr&&Or!==`auto-merge-armed`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(B,{size:`control`,variant:`info`,role:`img`,"aria-label":hr,children:[(0,$.jsx)(Lr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:hr})]})}),(0,$.jsxs)(Y,{side:`top`,children:[hr,`: the host will merge this on its own once its requirements are met`]})]}):null,Or===`resolve`?$r:Or===`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)(Lr.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`})]}):Or===`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`,ar)),"aria-label":dn===`enable-auto-merge`?`Enabling...`:at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:lr,children:[at.isArmed(`enable-auto-merge`)?(0,$.jsx)(m,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Lr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Ec,{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})]}):Or===`auto-merge-armed`?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsxs)(B,{size:`control`,variant:`info`,role:`img`,"aria-label":hr,children:[(0,$.jsx)(Lr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:hr})]})}),(0,$.jsxs)(Y,{side:`top`,children:[hr,`: the host will merge this on its own once its requirements are met`]})]}):Or===`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`,ar)),"aria-label":dn===`merge`?`Merging...`:at.isArmed(`merge`)?`Confirm merge?`:cr,children:[at.isArmed(`merge`)?(0,$.jsx)(m,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Lr.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Ec,{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})]}):(Or===`merged`||Or===`closed`)&&Rr!==null?(0,$.jsx)(B,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:K(`flex items-center gap-1`,Rr.toneClassName),children:[(0,$.jsx)(Rr.Icon,{className:`size-3.5`}),Rr.label]})}):null,Xr,(0,$.jsxs)(z,{children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(oe,{render:(0,$.jsx)(G,{"aria-label":on?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:on?(0,$.jsx)(ca,{refreshing:!0,size:`md`}):(0,$.jsx)(T,{className:`size-4`})})}),(0,$.jsx)(Y,{children:on?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(be,{align:`end`,side:`bottom`,children:[(0,$.jsx)(il,{display:`menu-item`,environmentId:e,reference:A,url:q.url,threadRef:r??(typeof g==`object`?g:null),onPickerOpenChange:P}),(0,$.jsxs)(W,{disabled:on,onClick:()=>void sn(),children:[(0,$.jsx)(ca,{size:`sm`,refreshing:on}),`Refresh`]}),(0,$.jsxs)(W,{disabled:ot!==null,onClick:Yn,children:[(0,$.jsx)(Ve,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:ot===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Rn===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(W,{disabled:ot!==null,onClick:Xn,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: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)(ke,{className:`size-3.5`}),ot===`findings`?`Preparing...`:Hn.fixFindings]}),vr&&Un.canWrite?(0,$.jsxs)(W,{disabled:Un.running,onClick:Wn,children:[(0,$.jsx)(d,{className:`size-3.5`}),Un.running?`Writing guide...`:Un.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,Cn.length>0?(0,$.jsx)(Rd,{environments:Cn,value:An,onChange:e=>Tn({pullRequestKey:j,environmentId:e}),disabled:ot!==null}):null,(0,$.jsx)(we,{}),q.state===`open`?(0,$.jsxs)($.Fragment,{children:[kr?(0,$.jsxs)(W,{disabled:pn,onClick:()=>void Fn(q.isDraft?`ready`:`draft`),children:[q.isDraft?(0,$.jsx)(Lr.pullRequest,{className:`size-3.5`}):(0,$.jsx)(Lr.draft,{className:`size-3.5`}),q.isDraft?`Ready for review`:`Convert to draft`]}):null,Nr?(0,$.jsxs)(W,{closeOnClick:at.isArmed(`merge`),"aria-label":at.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:pn,...at.props(`merge`,()=>void Fn(`merge`,ar)),children:[(0,$.jsx)(Lr.merged,{className:`size-3.5`}),at.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,fr&&xr(`disable-auto-merge`)?(0,$.jsxs)(W,{disabled:pn,onClick:()=>void Fn(`disable-auto-merge`),children:[(0,$.jsx)(Lr.merged,{className:`size-3.5`}),`Disable auto-merge`]}):Ar?(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`,ar)),children:[(0,$.jsx)(Lr.merged,{className:`size-3.5`}),at.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Ir?(0,$.jsxs)($.Fragment,{children:[kr||Nr||Ar?(0,$.jsx)(we,{}):null,(0,$.jsx)(je,{value:ar,onValueChange:e=>{let t=e;it(t),Qe(t)},children:rr.map(e=>(0,$.jsx)(me,{value:e,disabled:pn,closeOnClick:!0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Lr.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Ni[e]})]})},e))})]}):null,Zr(kr,Ar||Nr,Ir)?(0,$.jsx)(we,{}):null]}):null,(0,$.jsxs)(W,{onClick:()=>void Ct()?.shell.openExternal(q.url),children:[(0,$.jsx)(ne,{className:`size-3.5`}),Al(Rt)]}),(0,$.jsxs)(W,{onClick:()=>Ft(q.url,`PR link`),children:[(0,$.jsx)(Ce,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(Ne,{children:sr(Pt,`thread.copyReference`)})]}),(0,$.jsxs)(W,{onClick:()=>Ft(`#${A.number}`,`PR number`),children:[(0,$.jsx)(Se,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(Ne,{children:sr(Pt,`pullRequest.copyNumber`)})]}),q.state===`open`&&xr(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(we,{}),(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)(Lr.closed,{className:`size-3.5`}),at.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):q.state===`closed`&&xr(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(we,{}),(0,$.jsxs)(W,{disabled:pn,onClick:()=>void Fn(`reopen`),children:[(0,$.jsx)(Lr.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):q.state===`merged`&&xr(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(we,{}),(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)(ae,{className:`size-3.5`}),at.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null,zr?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(we,{}),(0,$.jsxs)(W,{variant:`destructive`,disabled:pn||!Hr,onClick:()=>void Kr(),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:Hr?q.headBranch:`Reconnect to delete this branch`})]})]})]}):null]})]})]}):null,f?(0,$.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:f,children:(0,$.jsx)(R,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Le?`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`,Le?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!Le,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)(Tr,{actor:q.author,profileUrl:Bt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:En(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:[_r?(0,$.jsxs)(Bd,{baseBranch:q.baseBranch,freshness:_r,pending:pn,onUpdate:e=>void Fn(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Lr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{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)(Lr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{value:q.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(Y,{side:`top`,children:Wt?`Stacked on ${q.baseBranch}`:q.baseBranch})]}),(0,$.jsx)(Te,{"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)(ba,{value:q.headBranch,showTitle:!1})})}),(0,$.jsx)(Y,{side:`top`,children:q.headBranch})]})]}),(0,$.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-baseline justify-end gap-2 text-2xs`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-baseline gap-1 tabular-nums`,"aria-label":`${q.changedFiles.toLocaleString()} changed ${q.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(ee,{"aria-hidden":!0,className:`size-3 self-center`}),q.changedFiles.toLocaleString()]}),(0,$.jsx)(el,{environmentId:e,reference:A,additions:q.additions,deletions:q.deletions,className:`shrink-0 font-mono text-2xs`,eager:!0})]})]})}):null})}),(0,$.jsx)(`div`,{className:K(`col-span-2 grid`,Le?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:Ue,className:K(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Le?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:Le,children:q?(0,$.jsx)(ll,{title:_n===null?(0,$.jsxs)(ul,{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})]}),ws(q)?(0,$.jsx)(Ds,{"aria-label":`Edit title`,onClick:()=>gn({pullRequestKey:j,text:q.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Bn,{autoFocus:!0,size:`sm`,disabled:vn,value:_n,"aria-label":`Pull request title`,onChange:e=>gn({pullRequestKey:j,text:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Ln(_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 Ln(_n),children:vn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(Tr,{actor:q.author,profileUrl:Bt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,En(q.updatedAt)]}),checkout:Vt?(0,$.jsx)(pl,{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:_r?(0,$.jsxs)(Bd,{baseBranch:q.baseBranch,freshness:_r,pending:pn,onUpdate:e=>void Fn(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Wt?(0,$.jsx)(Lr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{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)(Lr.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{value:q.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(Y,{side:`top`,children:Wt?`Stacked on ${q.baseBranch}`:q.baseBranch})]}),head:(0,$.jsx)(pl,{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)(el,{environmentId:e,reference:A,additions:q.additions,deletions:q.deletions,className:`shrink-0 font-mono text-xs`,eager:!0})}):null})}),q?(0,$.jsx)(dl,{tabs:br,value:V,onValueChange:H,onTabIntent:e=>{e===`code`&&Pd()},children:V===`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)(o,{"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)(fl,{className:`text-muted-foreground`,"aria-label":Jr?`Checks: ${Jr}`:`Checks`,icon:Er===null?(0,$.jsx)(Oe,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Uu,{checks:q.checks,stale:Dr,checksState:Er,threadRef:r}),label:Jr}):V===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(yr,{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)(l,{"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)(w,{"aria-hidden":!0,className:`size-3`}),Xt?`—`:Yt?`…`:q.commits.length.toLocaleString()]}),Yr>0?(0,$.jsxs)(`span`,{className:K(`inline-flex items-center gap-1`,dr(`approved`)),children:[(0,$.jsx)(Sr,{outcome:`approved`,className:`size-3`}),Yr.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:Yr===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(G,{size:`xs`,variant:`ghost-muted`,"aria-label":te===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>re(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(ce,{"aria-hidden":!0,className:`size-3`}),te===`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[V];if(e.target!==t||t==null)return;let n=t.scrollTop;Fe(e=>{let r=e,i=Ue.current?.scrollHeight??0,a=i-(Ke.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(qe.current={tab:V,scroller:t,delta:-a},r=!0),Ie.current[V]=r,r})},children:lt.error&&!q?(0,$.jsx)(kl,{...pi(lt.failure)?{title:`Pull request #${A.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)(Js,{value:zt,children:[De.has(`summary`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,V!==`summary`&&`invisible`),children:(0,$.jsx)(pu,{scrollerRef:He.summary,environmentId:e,threadRef:r,reference:A,detail:q,activityPending:Yt,checksStale:Dr,activityError:Xt,pendingFinding:ot,fixFindingLabel:Hn.fixFinding,fixCheckLabel:Hn.fixCheck,...Vn?{onFixFinding:er}:{},onRefresh:Zt,onRefreshChecks:sn})}):null,De.has(`guide`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,V!==`guide`&&`invisible`),children:(0,$.jsx)(Ed,{environmentId:e,reference:A,active:V===`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))?()=>I(e=>e+1):null,onOpenFile:pe,onTourShown:b})}):null,De.has(`timeline`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,V!==`timeline`&&`invisible`),children:Yt?(0,$.jsx)(wl,{}):Xt?(0,$.jsx)(Ol,{error:Xt,onRetry:ut.refresh}):(0,$.jsx)(Lu,{scrollerRef:He.timeline,detail:q,environmentId:e,threadRef:r,reference:A,order:te,onOpenCommit:ue,onRefresh:Zt})}):null,De.has(`code`)?(0,$.jsx)(`div`,{className:K(`absolute inset-0`,V!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Fo,{label:`Loading pull request diff...`}),children:(0,$.jsx)(Fd,{scrollerRef:He.code,onAddToAgentSelection:Qn,environmentId:e,reference:A,detail:q,selectedCommitOid:se,onSelectedCommitChange:le,pendingFinding:ot,fixFindingLabel:Hn.fixFinding,...Vn?{onFixFinding:er}:{},onRefresh:Zt,refreshToken:en,revealRequest:de})})}):null]}):null}),q?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(Vl,{environmentId:e,reference:A,detail:q,actionPending:pn,onCommentAction:In,onCommented:Zt,onReviewSubmitted:Zt,openReviewRequest:F},JSON.stringify([e,A.projectId,A.host,A.repository,A.number]))}):null]})}function Hd(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=Wr.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=d);let f=xe(d),p=Da(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 gi(t,null,p(),Wi.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}=ka(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=Hr(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=Ud[e].label,r=Ud[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)(vt,{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 Ud={close:{label:`Close`,Icon:Lr.closed},merge:{label:`Merge`,Icon:Lr.merged},ready:{label:`Ready for review`,Icon:Lr.pullRequest},reopen:{label:`Reopen`,Icon:Lr.reopen}},Wd=`group/pr-row flex w-full items-center gap-2 rounded-md py-1 pr-1 text-left`,Gd=`shrink-0 font-mono text-xs tabular-nums text-muted-foreground`;function Kd(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)(xr,{state:n,isDraft:r}),t[2]=r,t[3]=n,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{mergeability:i},t[5]=i,t[6]=u);let d;t[7]===a?d=t[8]:(d=a===void 0?{}:{baseBranch:a},t[7]=a,t[8]=d);let f;t[9]!==r||t[10]!==n||t[11]!==u||t[12]!==d?(f=(0,$.jsx)(`span`,{className:`absolute -right-1 -bottom-1 inline-flex`,children:(0,$.jsx)(vr,{state:n,isDraft:r,...u,...d,className:`size-3 fill-background [stroke-width:2.5]`})}),t[9]=r,t[10]=n,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]!==l||t[15]!==f?(p=(0,$.jsxs)(`span`,{className:`relative inline-flex`,children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16];let m;t[17]===o?m=t[18]:(m=o?(0,$.jsx)(`span`,{className:`inline-flex text-2xs`,children:o}):null,t[17]=o,t[18]=m);let h;return t[19]!==c||t[20]!==p||t[21]!==m?(h=(0,$.jsxs)(`span`,{className:c,children:[p,m]}),t[19]=c,t[20]=p,t[21]=m,t[22]=h):h=t[22],h}function qd(e){let t=(0,Q.c)(22),{number:n,title:r,status:i,signals:a,meta:o,metaClassName:s,updatedAt:c}=e,l;t[0]===r?l=t[1]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm`,children:r}),t[0]=r,t[1]=l);let u;t[2]===a?u=t[3]:(u=a?(0,$.jsx)(`span`,{className:`flex shrink-0 items-center gap-1 text-2xs`,children:a}):null,t[2]=a,t[3]=u);let d;t[4]===i?d=t[5]:(d=i?(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-2xs`,children:i}):null,t[4]=i,t[5]=d);let f;t[6]!==n||t[7]!==l||t[8]!==u||t[9]!==d?(f=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[n,l,u,d]}),t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===s?p=t[12]:(p=K(`flex min-w-0 items-center gap-1.5 overflow-hidden text-2xs text-muted-foreground`,s),t[11]=s,t[12]=p);let m;t[13]===c?m=t[14]:(m=c?(0,$.jsx)(`span`,{className:`ml-auto shrink-0 whitespace-nowrap tabular-nums`,children:En(c)}):null,t[13]=c,t[14]=m);let h;t[15]!==o||t[16]!==p||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:p,children:[o,m]}),t[15]=o,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==f||t[20]!==h?(g=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,h]}),t[19]=f,t[20]=h,t[21]=g):g=t[21],g}function Jd(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)(gr,{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 Yd(e){let t=(0,Q.c)(8),{head:n,base:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(ba,{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)(ba,{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 Xd=`[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"]`,Zd={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.`},Qd=1,$d=[Ea,va];function ef(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function tf(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function nf(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function rf(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function af(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 of(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function sf(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 cf(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),i=[{label:`Browser`,icon:I,shortcut:`B`,available:e.browserAvailable,disabledReason:Zd.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:Ue,shortcut:`T`,available:e.terminalAvailable,disabledReason:Zd.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:c,shortcut:`F`,available:e.filesAvailable,disabledReason:Zd.files,onClick:e.onAddFiles},...e.onAddDesign?[{label:`Design`,icon:F,shortcut:`G`,available:e.filesAvailable,disabledReason:`Open a project to use Design.`,onClick:e.onAddDesign}]:[],{label:`Diff`,icon:ee,shortcut:`D`,available:e.diffAvailable,disabledReason:Zd.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:Lr.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Zd.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:Lr.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Zd.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:P,shortcut:`M`,available:e.deviceAvailable,disabledReason:Zd.device,onClick:e.onAddDevice}],a=i.filter(ff),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=af(s.current,e);if(!t||document.querySelector(Xd))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&of(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);else if(e.key===`ArrowUp`||e.key===`ArrowLeft`)e.preventDefault(),r(o===-1?a.length-1:(o-1+a.length)%a.length);else if(e.key===`Enter`){if(e.target!==e.currentTarget)return;let t=a[o];if(!t)return;e.preventDefault(),t.onClick()}}},d=df,f=e=>o!==-1&&a[o]===e,p=uf,m;t[1]===a?m=t[2]:(m=a.map(lf),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)(ta,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(z,{children:[(0,$.jsx)(oe,{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)(v,{className:`size-3.5`})}),(0,$.jsx)(be,{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)(sf,{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)(ta,{variant:`pill`,children:t.shortcut})]})},t.label)),y;t[4]===_?y=t[5]:(y=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:_}),t[4]=_,t[5]=y);let b;t[6]!==y||t[7]!==g?(b=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[g,y]}),t[6]=y,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 lf(e){return e.shortcut}function uf(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 df(e){e?.focus()}function ff(e){return e.available}function pf(e,t,n,r){switch(e.kind){case`diff`:return`Diff`;case`design`:return`Design`;case`files`:return`Files`;case`file`:return e.relativePath.slice(Math.max(e.relativePath.lastIndexOf(`/`),e.relativePath.lastIndexOf(`\\`))+1);case`terminal`:return n.get(e.activeTerminalId)??Hi(e.activeTerminalId);case`pull-request`:return`#${e.number}`;case`pull-requests`:return`Pull requests`;case`tools`:return`Tools`;case`aside`:return r?.get(e.threadId)??`Side chat`;case`device`:return e.title??e.target?.name??`Device`;case`preview`:{let n=e.resourceId?t[e.resourceId]:null;if(!n||n.navStatus._tag===`Idle`)return`New tab`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function mf(e){let t=(0,Q.c)(8),{capturedUrl:n,url:r}=e,i;t[0]===r?i=t[1]:(i=ft(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)(I,{className:`size-3 shrink-0`}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,$.jsx)(vs,{sources:o,fallback:s,className:`size-3 shrink-0 rounded-sm object-contain`}),t[6]=o,t[7]=c),c}function hf(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function gf(e){let t=(0,Q.c)(19),{surface:n,sessions:r,desktopByTabId:i,theme:a,environmentId:o,pullRequestStatusSeeds:s}=e;switch(n.kind){case`preview`:{let e=n.resourceId?r[n.resourceId]:null,a=!e||e.navStatus._tag===`Idle`?null:e.navStatus.url,o=e?i[e.tabId]?.favicon??null:null,s=o&&a&&hf(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(mf,{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)(ee,{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)(F,{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)(c,{className:`size-3 shrink-0`}),t[5]=e):e=t[5],e}case`file`:{let e;return t[6]!==n.relativePath||t[7]!==a?(e=(0,$.jsx)(ur,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[6]=n.relativePath,t[7]=a,t[8]=e):e=t[8],e}case`terminal`:{let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ue,{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)(vf,{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)(Lr.link,{className:`size-3 shrink-0`}),t[14]=e):e=t[14],e}case`tools`:{let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{className:`size-3 shrink-0`}),t[15]=e):e=t[15],e}case`aside`:{let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(re,{className:`size-3 shrink-0`}),t[16]=e):e=t[16],e}case`device`:{let e;return t[17]===n.target?.platform?e=t[18]:(e=n.target?.platform===`ios`?(0,$.jsx)(cr,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(lr,{className:`size-3 shrink-0`}):(0,$.jsx)(P,{className:`size-3 shrink-0`}),t[17]=n.target?.platform,t[18]=e),e}}}function _f(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 et(a.pullRequests))Qe(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function vf(e){let t=(0,Q.c)(11),{surface:n,environmentId:r,seed:i}=e,a=n.environmentId??r,o=Ge(),s=qe(),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?N(l,l.provider):null),d=Je(),f=a===null?void 0:d.get(a)?.environment.capabilities,p=f?.threadPullRequests===!0?_f(s,a,u,n)?.snapshot??null:null,m=kt(a===null||f?.pullRequests!==!0||p!==null?null:Wr.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 _=Gr(a,g,null),v=p??Ur(m,_)??i??null;if(v===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Lr.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let y=Mr({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 yf(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=la(ha(fa,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(bf),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)(Ta,{items:a,strategy:sa,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)(oa,{sensors:r,collisionDetection:pa,modifiers:$d,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function bf(e){return e.id}function xf(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}=ma(o),f;t[8]===l?f=t[9]:(f=da.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 Sf(e){let t=(0,Q.c)(102),n=Dn&&e.mode===`inline`,r=ar().profiles,{resolvedTheme:i}=wt(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=c):c=t[0];let[l,u]=(0,Z.useState)(c),d=e.open!==!1&&e.surfaces.length>0,f=d&&e.onAddTools!==void 0,p;t[1]!==d||t[2]!==f||t[3]!==e?(p=t=>{t.defaultPrevented||t.isComposing||or(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&(document.querySelector(Xd)||(!d||f&&e.browserAvailable)&&(t.preventDefault(),t.stopPropagation(),!t.repeat&&(f?e.onAddTools?.():document.querySelector(`[data-surface-launcher-keys]`)?.focus())))},t[1]=d,t[2]=f,t[3]=e,t[4]=p):p=t[4];let m=(0,Z.useEffectEvent)(p),h;t[5]!==m||t[6]!==e.open?(h=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,m,!0),()=>document.removeEventListener(`keydown`,m,!0)},t[5]=m,t[6]=e.open,t[7]=h):h=t[7];let g;t[8]===e.open?g=t[9]:(g=[e.open],t[8]=e.open,t[9]=g),(0,Z.useEffect)(h,g);let _;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{let e=ef(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Qd,n=t&&e.scrollLeft>Qd,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Qd;u(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[10]=_):_=t[10];let v=_,y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=ef(a.current);if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollBy({left:e*Math.max(120,t.clientWidth*.75),behavior:n?`auto`:`smooth`})},t[11]=y):y=t[11];let b=y,x;t[12]===e?x=t[13]:(x=async(t,n)=>{t.preventDefault(),t.stopPropagation();let r=Ct();if(!r)return;let i=e.surfaces.findIndex(e=>e.id===n.id);if(i<0)return;let a=[];n.kind===`device`&&e.onRenameDevice&&a.push({id:`rename`,label:`Rename`}),n.kind===`file`&&n.attachment===void 0&&a.push({id:`copy-path`,label:`Copy path`});let o=tf(n,e.previewSessions),c=o?e.desktopByTabId[o]??null:null,l=c?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...nf({overlay:c,canResolveRuntimeTabId:e.previewRuntimeTabId!==void 0})}),a.push({id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:e.surfaces.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:i>=e.surfaces.length-1},{id:`close-all`,label:`Close all`,disabled:e.surfaces.length===0});let u=await r.contextMenu.show(a,{x:t.clientX,y:t.clientY});bb134:switch(u){case`rename`:s(n.id);break bb134;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb134;case`toggle-mute`:{let t=o&&c?e.previewRuntimeTabId?.(o)??null:null;t&&ua?.setAudioMuted(t,!l).catch(Ef);break bb134}case`close`:e.onCloseSurface(n);break bb134;case`close-others`:e.onCloseOtherSurfaces(n);break bb134;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb134;case`close-all`:e.onCloseAllSurfaces();break bb134}},t[12]=e,t[13]=x);let S=x,w=Tf,T;t[14]===e?T=t[15]:(T=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[14]=e,t[15]=T);let E=T,D,O;t[16]!==e.activeSurfaceId||t[17]!==l.hasOverflow?(D=()=>{e.activeSurfaceId&&l.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},O=[e.activeSurfaceId,l.hasOverflow],t[16]=e.activeSurfaceId,t[17]=l.hasOverflow,t[18]=D,t[19]=O):(D=t[18],O=t[19]),(0,Z.useEffect)(D,O);let k,A;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{let e=ef(a.current);if(!e)return;let t=e.firstElementChild,n=nr(t?[e,t]:e,v);return e.addEventListener(`scroll`,v,{passive:!0}),v(),()=>{n(),e.removeEventListener(`scroll`,v)}},A=[v],t[20]=k,t[21]=A):(k=t[20],A=t[21]),(0,Z.useEffect)(k,A);let M,N;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{let e=ef(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(),v())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},N=[v],t[22]=M,t[23]=N):(M=t[22],N=t[23]),(0,Z.useEffect)(M,N);let P=e.mode,F;t[24]===e.maximized?F=t[25]:(F=e.maximized===void 0?{}:{maximized:e.maximized},t[24]=e.maximized,t[25]=F);let I;t[26]===e.open?I=t[27]:(I=e.open===void 0?{}:{open:e.open},t[26]=e.open,t[27]=I);let L;t[28]===e.widthStorageKey?L=t[29]:(L=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[28]=e.widthStorageKey,t[29]=L);let R;t[30]===e.defaultWidth?R=t[31]:(R=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[30]=e.defaultWidth,t[31]=R);let z;t[32]===e.inlineSize?z=t[33]:(z=e.inlineSize?{inlineSize:e.inlineSize}:{},t[32]=e.inlineSize,t[33]=z);let B=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,V=n&&`drag-region`,H=n&&`wco:pr-(--workspace-native-controls-inset)`,ee=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)]`,te;t[34]!==B||t[35]!==V||t[36]!==H||t[37]!==ee?(te=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`,B,V,H,ee),t[34]=B,t[35]=V,t[36]=H,t[37]=ee,t[38]=te):te=t[38];let ne=e.surfaces,re=e.onMoveSurface,U;t[39]!==E||t[40]!==S||t[41]!==n||t[42]!==e||t[43]!==o||t[44]!==i?(U=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),c=pf(t,e.previewSessions,e.terminalLabelsById,e.asideTitlesByThreadId),l=tf(t,e.previewSessions),u=rf(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(xf,{surfaceId:t.id,disabled:!e.onMoveSurface||o===t.id,"data-active-tab":r,onMouseDown:w,onAuxClick:e=>E(e,t),onContextMenu:e=>void S(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)(gf,{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(),ua?.setAudioMuted(d,u!==`muted`).catch(wf)},children:(0,$.jsx)(ot,{className:`size-3`,icon:u===`muted`?st:nt})})}),(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:Cf,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)(Df,{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)(Ie,{className:`size-3.5`})})]},t.id)}),t[39]=E,t[40]=S,t[41]=n,t[42]=e,t[43]=o,t[44]=i,t[45]=U):U=t[45];let ie;t[46]!==e.onMoveSurface||t[47]!==e.surfaces||t[48]!==U?(ie=(0,$.jsx)(Vn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`w-fit min-w-0 flex-initial`,"data-right-panel-tab-list":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:(0,$.jsx)(yf,{surfaces:ne,onMove:re,children:U})})}),t[46]=e.onMoveSurface,t[47]=e.surfaces,t[48]=U,t[49]=ie):ie=t[49];let ae;t[50]!==l.canScrollLeft||t[51]!==l.canScrollRight||t[52]!==l.hasOverflow?(ae=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:()=>b(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(C,{})})})}),(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:()=>b(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(j,{})})})}),(0,$.jsx)(Y,{children:`Scroll tabs right`})]})]}):null,t[50]=l.canScrollLeft,t[51]=l.canScrollRight,t[52]=l.hasOverflow,t[53]=ae):ae=t[53];let oe;t[54]!==f||t[55]!==e.onAddTools?(oe=f?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(G,{"aria-label":`New tab`,className:`shrink-0 [-webkit-app-region:no-drag]`,onClick:e.onAddTools,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(ye,{className:`size-4`})}),(0,$.jsx)(Y,{children:`New tab`})]}):null,t[54]=f,t[55]=e.onAddTools,t[56]=oe):oe=t[56];let se;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`min-w-0 flex-1`}),t[57]=se):se=t[57];let W;t[58]!==n||t[59]!==e.layoutControls?(W=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[58]=n,t[59]=e.layoutControls,t[60]=W):W=t[60];let ce;t[61]===n?ce=t[62]:(ce=n?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]`}):null,t[61]=n,t[62]=ce);let le;t[63]!==e.layoutControls||t[64]!==te||t[65]!==ie||t[66]!==ae||t[67]!==oe||t[68]!==W||t[69]!==ce?(le=(0,$.jsxs)(`div`,{className:te,"data-right-panel-tabbar":!0,children:[ie,ae,oe,se,e.layoutControls,W,ce]}),t[63]=e.layoutControls,t[64]=te,t[65]=ie,t[66]=ae,t[67]=oe,t[68]=W,t[69]=ce,t[70]=le):le=t[70];let ue;t[71]!==r||t[72]!==e.activeSurfaceId||t[73]!==e.browserAvailable||t[74]!==e.children||t[75]!==e.deviceAvailable||t[76]!==e.diffAvailable||t[77]!==e.filesAvailable||t[78]!==e.onAddBrowser||t[79]!==e.onAddBrowserInProfile||t[80]!==e.onAddDesign||t[81]!==e.onAddDevice||t[82]!==e.onAddDiff||t[83]!==e.onAddFiles||t[84]!==e.onAddPullRequest||t[85]!==e.onAddPullRequests||t[86]!==e.onAddTerminal||t[87]!==e.pullRequestAvailable||t[88]!==e.pullRequestsAvailable||t[89]!==e.terminalAvailable?(ue=e.activeSurfaceId===null||e.activeSurfaceId===`tools`?(0,$.jsx)(cf,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,...e.onAddDesign?{onAddDesign:e.onAddDesign}:{},onAddPullRequest:e.onAddPullRequest,onAddPullRequests:e.onAddPullRequests,onAddDevice:e.onAddDevice,browserAvailable:e.browserAvailable,terminalAvailable:e.terminalAvailable,diffAvailable:e.diffAvailable,filesAvailable:e.filesAvailable,pullRequestAvailable:e.pullRequestAvailable,pullRequestsAvailable:e.pullRequestsAvailable,deviceAvailable:e.deviceAvailable}):e.children,t[71]=r,t[72]=e.activeSurfaceId,t[73]=e.browserAvailable,t[74]=e.children,t[75]=e.deviceAvailable,t[76]=e.diffAvailable,t[77]=e.filesAvailable,t[78]=e.onAddBrowser,t[79]=e.onAddBrowserInProfile,t[80]=e.onAddDesign,t[81]=e.onAddDevice,t[82]=e.onAddDiff,t[83]=e.onAddFiles,t[84]=e.onAddPullRequest,t[85]=e.onAddPullRequests,t[86]=e.onAddTerminal,t[87]=e.pullRequestAvailable,t[88]=e.pullRequestsAvailable,t[89]=e.terminalAvailable,t[90]=ue):ue=t[90];let de;t[91]===ue?de=t[92]:(de=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:ue}),t[91]=ue,t[92]=de);let fe;return t[93]!==e.mode||t[94]!==F||t[95]!==I||t[96]!==L||t[97]!==R||t[98]!==z||t[99]!==le||t[100]!==de?(fe=(0,$.jsxs)(ps,{mode:P,...F,...I,...L,...R,...z,children:[le,de]}),t[93]=e.mode,t[94]=F,t[95]=I,t[96]=L,t[97]=R,t[98]=z,t[99]=le,t[100]=de,t[101]=fe):fe=t[101],fe}function Cf(e){e?.focus(),e?.select()}function wf(){}function Tf(e){e.button===1&&e.preventDefault()}function Ef(){}function Df(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=tr(n?e.environmentId:null),i;t[0]!==r||t[1]!==n?(i=n?r.devices.find(e=>e.hostId===n.hostId&&e.id===n.deviceId):void 0,t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=n?r.hosts.find(e=>e.id===n.hostId):void 0,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===e.title?c=t[7]:(c=(0,$.jsx)(`span`,{children:e.title}),t[6]=e.title,t[7]=c);let l;t[8]!==a?.version||t[9]!==s?.label||t[10]!==n?(l=n?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[s?.label??`Device host`,` ·`,` `,a?.version??(n.platform===`ios`?`iOS`:`Android`)]}):null,t[8]=a?.version,t[9]=s?.label,t[10]=n,t[11]=l):l=t[11];let u;return t[12]!==c||t[13]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14],u}var Of=(0,Z.memo)(function(e){let t=(0,Q.c)(32),{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:v,onToggleThreadPanel:y,onToggleRightPanel:b}=e,x=n===void 0||n,S=r===void 0||r,C=i===void 0||i,w=h===void 0?`Right panel is unavailable`:h,T=g===void 0?0:g,E=l===`popover`?void 0:y,D;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(jf,{}),t[0]=D):D=t[0];let O;t[1]!==E||t[2]!==c?(O=(0,$.jsx)(jn,{className:`relative shrink-0 [-webkit-app-region:no-drag]`,pressed:c,onPressedChange:E,"aria-label":`Toggle thread details panel`,variant:`ghost`,size:`sm`,children:D}),t[1]=E,t[2]=c,t[3]=O):O=t[3];let k=O,A;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`span`,{className:`flex shrink-0`}),t[4]=A):A=t[4];let j;t[5]!==u||t[6]!==l||t[7]!==k?(j=(0,$.jsx)(J,{render:A,children:l===`popover`?(0,$.jsx)(Yr,{handle:u,render:k}):k}),t[5]=u,t[6]=l,t[7]=k,t[8]=j):j=t[8];let M=d?` (${d})`:``,N;t[9]===M?N=t[10]:(N=(0,$.jsxs)(Y,{side:`bottom`,children:[`Toggle thread details`,M]}),t[9]=M,t[10]=N);let P;t[11]!==j||t[12]!==N?(P=(0,$.jsxs)(X,{children:[j,N]}),t[11]=j,t[12]=N,t[13]=P):P=t[13];let F=x?P:null,I;t[14]!==v||t[15]!==S||t[16]!==a||t[17]!==o||t[18]!==s?(I=S?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(jn,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:o,onPressedChange:v,"aria-label":`Toggle terminal drawer`,variant:`ghost`,size:`sm`,disabled:!a,children:(0,$.jsx)(_,{className:`size-4`})})}),(0,$.jsx)(Y,{side:`bottom`,children:a?`Toggle terminal drawer${s?` (${s})`:``}`:`Terminal drawer is unavailable`})]}):null,t[14]=v,t[15]=S,t[16]=a,t[17]=o,t[18]=s,t[19]=I):I=t[19];let L;t[20]!==b||t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==T||t[25]!==w||t[26]!==C?(L=C?(0,$.jsxs)(X,{children:[(0,$.jsx)(J,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(jn,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:p,onPressedChange:b,"aria-label":T>0?`Toggle right panel, ${T} ${T===1?`tab`:`tabs`}`:`Toggle right panel`,variant:`ghost`,size:`sm`,disabled:!f,children:T>0?(0,$.jsx)(kf,{count:T}):(0,$.jsx)(ot,{className:`size-4`,icon:p?ct:it})})}),(0,$.jsx)(Y,{side:`bottom`,children:f?`Toggle right panel${m?` (${m})`:``}`:w})]}):null,t[20]=b,t[21]=f,t[22]=p,t[23]=m,t[24]=T,t[25]=w,t[26]=C,t[27]=L):L=t[27];let R;return t[28]!==F||t[29]!==I||t[30]!==L?(R=(0,$.jsxs)(`div`,{className:`flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,"data-panel-layout-controls":!0,children:[F,I,L]}),t[28]=F,t[29]=I,t[30]=L,t[31]=R):R=t[31],R});function kf(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 Af=(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?tt:rt,o;t[0]===a?o=t[1]:(o=(0,$.jsx)(ot,{className:`size-3.5`,icon:a}),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(s=(0,$.jsx)(J,{render:(0,$.jsx)(jn,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:n,onPressedChange:r,"aria-label":i,variant:`ghost`,size:`sm`,children:o})}),t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,$.jsx)(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 jf(){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{Es as A,wc as C,hc as D,vc as E,$o as F,Xo as I,No as L,ps as M,cs as N,mc as O,Qo as P,Fo as R,Rc as S,gc as T,vl as _,Gd as a,Vc as b,Kd as c,Vd as d,Uu as f,bl as g,kl as h,Wd as i,Ss as j,Ts as k,qd as l,Ml as m,Af as n,Jd as o,Al as p,Sf as r,Yd as s,Of as t,Hd as u,tl as v,bc as w,Bc as x,el as y,Mo as z};
216
- //# sourceMappingURL=PanelLayoutControls-D8g6TJ8z.js.map
216
+ //# sourceMappingURL=PanelLayoutControls-BQZYES2T.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Af as i,Yc as a,l_ as o,t as s,vf as c}from"./utils-CcBaVOX5.js";import{B as l,L as u,M as d,W as f}from"./runtime-DeVKKxNz.js";import{a as p,r as m}from"./pierre-icons-CyZxWykW.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:a.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:a.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,o)}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=n(),w=e(t(),1),T=e(r(),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 a=r;if(!a){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(i,{className:s(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(c,{className:s(`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[a.token??`default`]??E.default,l=a.name,u=a.token,d;t[8]===e.className?d=t[9]:(d=s(`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=`#${a.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==a.name||t[15]!==a.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]=a.name,t[15]=a.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-CUoKY0yE.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Af as i,Yc as a,l_ as o,t as s,vf as c}from"./utils-C5GGWTfe.js";import{B as l,L as u,M as d,W as f}from"./runtime-BVmDVuJ-.js";import{a as p,r as m}from"./pierre-icons-DY8ZeGCr.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:a.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:a.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,o)}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=n(),w=e(t(),1),T=e(r(),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 a=r;if(!a){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(i,{className:s(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(c,{className:s(`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[a.token??`default`]??E.default,l=a.name,u=a.token,d;t[8]===e.className?d=t[9]:(d=s(`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=`#${a.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==a.name||t[15]!==a.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]=a.name,t[15]=a.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-CHy821MU.js.map