@p4code/cli 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-BFaqyrJo.mjs → binCli-D_84b0CF.mjs} +151 -47
  3. package/dist/client/.vite/manifest.json +2069 -2069
  4. package/dist/client/assets/{AnimatedHeight-4Jo1qKaP.js → AnimatedHeight-DewGDSmN.js} +2 -2
  5. package/dist/client/assets/{AuthSurfaceShell-BgwhQCPc.js → AuthSurfaceShell-D29U36jB.js} +2 -2
  6. package/dist/client/assets/{CSPContext-BuROUwKB.js → CSPContext-CB4Jj3Uk.js} +2 -2
  7. package/dist/client/assets/{ChatGptUsageButton-CG-YKS6A.js → ChatGptUsageButton-CFN6c9Ue.js} +2 -2
  8. package/dist/client/assets/{ChatMarkdown-CNhzmB5x.js → ChatMarkdown-DTSMYNs8.js} +4 -4
  9. package/dist/client/assets/{CodexSetupSection.logic-C0ptwwry.js → CodexSetupSection.logic-DQMTTenV.js} +2 -2
  10. package/dist/client/assets/{ComboboxClear-CB7SvrMN.js → ComboboxClear-D8WYxa7i.js} +2 -2
  11. package/dist/client/assets/{CommandBlock-D5btlz0n.js → CommandBlock-VzUG411k.js} +2 -2
  12. package/dist/client/assets/{ComposerPromptEditor-DMONEQeI.js → ComposerPromptEditor-lIFv0Iko.js} +4 -4
  13. package/dist/client/assets/{CompositeRoot-NCPzVvXO.js → CompositeRoot-CLSWLNTl.js} +2 -2
  14. package/dist/client/assets/{ConnectionStatusDot-vBtwC3Vj.js → ConnectionStatusDot-B0ZKI-zI.js} +2 -2
  15. package/dist/client/assets/{DevicePanel-B07cF6Kr.js → DevicePanel-BQ6aWeSD.js} +2 -2
  16. package/dist/client/assets/{DeviceSetup-BEH97y5X.js → DeviceSetup-Bg5OpWbo.js} +2 -2
  17. package/dist/client/assets/{DialogTitle-DrhNhCSD.js → DialogTitle-BVkBTuS9.js} +2 -2
  18. package/dist/client/assets/{DiffCommentAnnotation-DRify9qt.js → DiffCommentAnnotation-BsI9yTe1.js} +2 -2
  19. package/dist/client/assets/{DiffFileTree-wSWCfkHQ.js → DiffFileTree-Bg8GHn2r.js} +2 -2
  20. package/dist/client/assets/{DiffPanel-DuYnpEdL.js → DiffPanel-D2TxWIFd.js} +2 -2
  21. package/dist/client/assets/{DiffWorkerPoolProvider-C7kCyuBf.js → DiffWorkerPoolProvider-B9BXoLYM.js} +2 -2
  22. package/dist/client/assets/{EnvironmentMachineIcon-pSS7qKfw.js → EnvironmentMachineIcon-DX1wHHgS.js} +2 -2
  23. package/dist/client/assets/{ExpandableText-BMD3qugZ.js → ExpandableText-DfTvwfDp.js} +2 -2
  24. package/dist/client/assets/{FieldControl-BTrrbQ3K.js → FieldControl-CrNWnPN_.js} +2 -2
  25. package/dist/client/assets/{FileDiff-DHS_UG0K.js → FileDiff-Ds-DSHzC.js} +2 -2
  26. package/dist/client/assets/{FilePreviewPanel-CYb5xyMm.js → FilePreviewPanel-CyR5pXUr.js} +2 -2
  27. package/dist/client/assets/{FoldedSettingsSection-CyRBKQ16.js → FoldedSettingsSection-DQesC0Ch.js} +2 -2
  28. package/dist/client/assets/{FormContext-CBGeQN77.js → FormContext-CUf-dYwe.js} +2 -2
  29. package/dist/client/assets/{Icons-AkySFIEx.js → Icons-DMu3kCVA.js} +2 -2
  30. package/dist/client/assets/{KeybindingsSettings.logic-CkDiTn0M.js → KeybindingsSettings.logic-BB1oFV_W.js} +2 -2
  31. package/dist/client/assets/{NoProjectsHero-DyNL-MrS.js → NoProjectsHero-D0SwrjYG.js} +2 -2
  32. package/dist/client/assets/{PanelLayoutControls-NUeu7nMQ.js → PanelLayoutControls-Bfgdx7QX.js} +4 -4
  33. package/dist/client/assets/{PierreEntryIcon-IuSWNqlA.js → PierreEntryIcon-BUl5qtCE.js} +2 -2
  34. package/dist/client/assets/{PreviewPanel-CxJz5hUK.js → PreviewPanel-CbotCgGz.js} +2 -2
  35. package/dist/client/assets/{ProjectDefaultsSettings-bQ5ORxlD.js → ProjectDefaultsSettings-GpUKCz2U.js} +2 -2
  36. package/dist/client/assets/{ProjectFavicon-ClxI7OY3.js → ProjectFavicon-BKEw0TrD.js} +3 -3
  37. package/dist/client/assets/{ProjectIconPickerDialog-BTsAZWr2.js → ProjectIconPickerDialog-C-KFxEg0.js} +2 -2
  38. package/dist/client/assets/{ProjectMonogram-DCxOyCyM.js → ProjectMonogram-B2dsNF6-.js} +2 -2
  39. package/dist/client/assets/{ProviderAuthTerminal-KAhmp-D6.js → ProviderAuthTerminal-Cwr8Z1Ly.js} +2 -2
  40. package/dist/client/assets/{ProviderModelPicker-DQG8_Hn8.js → ProviderModelPicker-CIxbqWeL.js} +2 -2
  41. package/dist/client/assets/{ProviderSettingsForm-BRBhNcWm.js → ProviderSettingsForm-DpmAB_Jq.js} +2 -2
  42. package/dist/client/assets/{PullRequestCodeTab-sN76VbmK.js → PullRequestCodeTab-qEGBl5Kn.js} +2 -2
  43. package/dist/client/assets/{ReadOnlySourcePreview-BiWn5R0O.js → ReadOnlySourcePreview-C5y6ELAP.js} +2 -2
  44. package/dist/client/assets/{RenderErrorBoundary-CwR9l2vj.js → RenderErrorBoundary-CyH8UwmD.js} +2 -2
  45. package/dist/client/assets/{ScheduledTasksSettings-iPAhYreZ.js → ScheduledTasksSettings-deUjWQ39.js} +2 -2
  46. package/dist/client/assets/{ScopedSwitch-DrThVUz_.js → ScopedSwitch-pdvWIJp5.js} +2 -2
  47. package/dist/client/assets/{SecretInput-C8iO0LWS.js → SecretInput-C11F3Wuh.js} +2 -2
  48. package/dist/client/assets/{SettingsPanels-BtdHxcNW.js → SettingsPanels-DExy67bz.js} +2 -2
  49. package/dist/client/assets/{SettingsPanels.logic-yZixYwld.js → SettingsPanels.logic-zUA6f3HT.js} +2 -2
  50. package/dist/client/assets/{SettingsScopeNotice-f82KPnDY.js → SettingsScopeNotice-N6bcXfto.js} +2 -2
  51. package/dist/client/assets/{T3ConnectAccountPages-m_7RF9L_.js → T3ConnectAccountPages-uVnu-v4W.js} +2 -2
  52. package/dist/client/assets/{T3ConnectSidebarSignIn-DJTcBcGh.js → T3ConnectSidebarSignIn-CZCWzt6C.js} +2 -2
  53. package/dist/client/assets/{ThemeEditorPanel-olXdAmEu.js → ThemeEditorPanel-CjUB7HmU.js} +2 -2
  54. package/dist/client/assets/{ThreadTerminalDrawer-BQDs5eem.js → ThreadTerminalDrawer-CAh-h3eK.js} +2 -2
  55. package/dist/client/assets/{Virtualizer-DqZNglST.js → Virtualizer-CB4f0UTD.js} +2 -2
  56. package/dist/client/assets/{WorkspaceBreadcrumb-B6kfrQ73.js → WorkspaceBreadcrumb-3VgFkWcC.js} +2 -2
  57. package/dist/client/assets/{WorkspacePageContainer-DSbQuXwt.js → WorkspacePageContainer-8jksqZGW.js} +2 -2
  58. package/dist/client/assets/{WorkspacePageHeader-GK8yx2Yo.js → WorkspacePageHeader-IRvZnA0X.js} +2 -2
  59. package/dist/client/assets/{_chat-DsJhLPIV.js → _chat-BfQTKc_9.js} +5 -5
  60. package/dist/client/assets/{_chat.index-BPJ4rR-G.js → _chat.index-DnYerwxz.js} +2 -2
  61. package/dist/client/assets/{_chat.new-CfqCt0Fk.js → _chat.new-XtBIcyRw.js} +2 -2
  62. package/dist/client/assets/{_chat.pull-requests-BfTP6YhJ.js → _chat.pull-requests-Dz-eLkAP.js} +2 -2
  63. package/dist/client/assets/{abnfDiagram-VCTEODGH-Cg5QSgHP.js → abnfDiagram-VCTEODGH-DUPWAarL.js} +2 -2
  64. package/dist/client/assets/{alert-DwFQdL_W.js → alert-DzxRsWWi.js} +2 -2
  65. package/dist/client/assets/architecture-7GRP2DOG-DTyqnvkZ.js +1 -0
  66. package/dist/client/assets/{architectureDiagram-5GKGNRK7-Dk3aYsC1.js → architectureDiagram-5GKGNRK7-ipdl5Chl.js} +2 -2
  67. package/dist/client/assets/{assets-1IiF113B.js → assets-B7aY-rQd.js} +2 -2
  68. package/dist/client/assets/{blockDiagram-I7D4REHJ-C3znhuKn.js → blockDiagram-I7D4REHJ-CCqcBoEP.js} +2 -2
  69. package/dist/client/assets/{browserHistoryStore-DNPsjLW4.js → browserHistoryStore-TLJ0k3I1.js} +2 -2
  70. package/dist/client/assets/{browserLinkTarget-1GMN2suO.js → browserLinkTarget-Du_qPFvd.js} +2 -2
  71. package/dist/client/assets/{c4Diagram-7LVT6UL2-D-Q_GaXJ.js → c4Diagram-7LVT6UL2-D0uMteR1.js} +2 -2
  72. package/dist/client/assets/channel-BO8pVrSI.js +2 -0
  73. package/dist/client/assets/{checkbox-CzKUo-R1.js → checkbox-Gd1YCUIl.js} +2 -2
  74. package/dist/client/assets/{chunk-4HAMMTFA-CY7q81OM.js → chunk-4HAMMTFA-B3SWgtem.js} +2 -2
  75. package/dist/client/assets/{chunk-75Z2AOVW-14_TWBCK.js → chunk-75Z2AOVW-CXAakYxI.js} +2 -2
  76. package/dist/client/assets/{chunk-DU6HZSFF-BWG3N9au.js → chunk-DU6HZSFF-B4qcstD9.js} +2 -2
  77. package/dist/client/assets/{chunk-F27PBJKO-vnlzbF2j.js → chunk-F27PBJKO-DimzPDjs.js} +2 -2
  78. package/dist/client/assets/{chunk-GMAD6QVW-CL48mY_-.js → chunk-GMAD6QVW-BHA-Os4E.js} +2 -2
  79. package/dist/client/assets/{chunk-GVQU2GXP-Dzgc6o98.js → chunk-GVQU2GXP-P9nMI_GJ.js} +2 -2
  80. package/dist/client/assets/{chunk-IMKFNOWR-BP3CZAoc.js → chunk-IMKFNOWR-RgWCceFN.js} +2 -2
  81. package/dist/client/assets/{chunk-L3NEJ4N5-DJr6VoYO.js → chunk-L3NEJ4N5-9p7zIkHC.js} +2 -2
  82. package/dist/client/assets/{chunk-OSK3NFVY-B7dCia9b.js → chunk-OSK3NFVY-C9IokqLY.js} +2 -2
  83. package/dist/client/assets/{chunk-P2QGCYS3-C39wNHCE.js → chunk-P2QGCYS3-Dwk8ORW_.js} +2 -2
  84. package/dist/client/assets/{chunk-POPQ4Y6H-lHPfawSy.js → chunk-POPQ4Y6H-BwYKYQwt.js} +2 -2
  85. package/dist/client/assets/{chunk-PWAF6VOD-B-onoF1f.js → chunk-PWAF6VOD-BMw0rklB.js} +2 -2
  86. package/dist/client/assets/{chunk-SHT3W25Y-Df8OXB-a.js → chunk-SHT3W25Y-D3ovSAoa.js} +2 -2
  87. package/dist/client/assets/{chunk-SVP7TREG-B5Jq9B5Y.js → chunk-SVP7TREG-CpaRTznV.js} +2 -2
  88. package/dist/client/assets/{chunk-TICWLB2K-B5SLi6aM.js → chunk-TICWLB2K-CAtIccZJ.js} +2 -2
  89. package/dist/client/assets/classDiagram-ZZMXUADV-Scmt9e5N.js +2 -0
  90. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Scmt9e5N.js +2 -0
  91. package/dist/client/assets/{color-picker-CkJLA9Jr.js → color-picker-DYoHU1P8.js} +2 -2
  92. package/dist/client/assets/{combobox-B6mdMhHV.js → combobox-Ddag8Jom.js} +2 -2
  93. package/dist/client/assets/{command-DJuCVIR5.js → command-B35zAYVN.js} +2 -2
  94. package/dist/client/assets/{connect-rtC5Yxq-.js → connect-XgeleCz9.js} +2 -2
  95. package/dist/client/assets/{connect-agent-CPPwjVyn.js → connect-agent-BRIcxQbo.js} +2 -2
  96. package/dist/client/assets/{cynefin-OW5HDTMX-CARsjMgW.js → cynefin-OW5HDTMX-Br0UWz2p.js} +1 -1
  97. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CHY9mnu2.js → cynefinDiagram-5FMLGOSQ-Bz8AWXlE.js} +2 -2
  98. package/dist/client/assets/{dagre-GXQ25YYZ-C0FrjxaN.js → dagre-GXQ25YYZ-Kk1kLU-A.js} +2 -2
  99. package/dist/client/assets/{device-CR5lpfef.js → device-CJH4ixRH.js} +2 -2
  100. package/dist/client/assets/{diagram-S7CK7UJ4-PtPpZAI6.js → diagram-S7CK7UJ4-Dogw5edZ.js} +2 -2
  101. package/dist/client/assets/{diagram-UQ7AKVKN-DUgq-dTJ.js → diagram-UQ7AKVKN-kg5DSfbZ.js} +2 -2
  102. package/dist/client/assets/{diagram-VSXAHHWV-Gh5HsUIP.js → diagram-VSXAHHWV-DXdyRkdD.js} +2 -2
  103. package/dist/client/assets/{diagram-VX7I27RA-D5FMJiCf.js → diagram-VX7I27RA-CNO5Z04I.js} +2 -2
  104. package/dist/client/assets/{diagram-Z3DM3KII-CmAYyvaL.js → diagram-Z3DM3KII-7Pw0HXMg.js} +2 -2
  105. package/dist/client/assets/{dialog-DF47CrNT.js → dialog-C9_Ef3sx.js} +2 -2
  106. package/dist/client/assets/{diffRendering-zhNPdu0X.js → diffRendering-CAxImuLd.js} +2 -2
  107. package/dist/client/assets/{discovery-list-BHQKwt20.js → discovery-list-DXE1P9pq.js} +2 -2
  108. package/dist/client/assets/{dist-xJXPIdFu.js → dist-DOyHkZUI.js} +3 -3
  109. package/dist/client/assets/{draft-input-Dj2IHuwL.js → draft-input-6dynCiw_.js} +2 -2
  110. package/dist/client/assets/{duoViewer-uYgErMSw.js → duoViewer-BFeSS1Av.js} +2 -2
  111. package/dist/client/assets/{dynamic-CM5x0VU9.js → dynamic-BxCDxZLw.js} +2 -2
  112. package/dist/client/assets/{ebnfDiagram-PWID7BFC-C2bi_JaD.js → ebnfDiagram-PWID7BFC-DD9UVmrJ.js} +2 -2
  113. package/dist/client/assets/{embeddedScripts-CrApSF9h.js → embeddedScripts-CIC2AYGL.js} +2 -2
  114. package/dist/client/assets/{empty-DqTsGaFf.js → empty-BvJSXK20.js} +2 -2
  115. package/dist/client/assets/{entities-BJX4eZyc.js → entities-Dzl1j2jY.js} +2 -2
  116. package/dist/client/assets/{erDiagram-RLTQ6QDP-BNnOWsqy.js → erDiagram-RLTQ6QDP-BJ--ph2e.js} +2 -2
  117. package/dist/client/assets/eventmodeling-NTZA5JFV-DrPNirV-.js +1 -0
  118. package/dist/client/assets/{fileLinks-DO5hZpK2.js → fileLinks-BZV-xG7Q.js} +2 -2
  119. package/dist/client/assets/{fileTreeExpansion-CIOHZWsx.js → fileTreeExpansion-SSkII8h0.js} +2 -2
  120. package/dist/client/assets/flowDiagram-HODETNUW-D4bD8hue.js +1 -0
  121. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Bnkb2Ngr.js → ganttDiagram-EL5Y4UJY-CAMkT1YN.js} +2 -2
  122. package/dist/client/assets/{getDiffFileInput-DQz1O4Oa.js → getDiffFileInput-BbRHVLd8.js} +2 -2
  123. package/dist/client/assets/{gitGraph-4MIJSDKK-D-LR6ljt.js → gitGraph-4MIJSDKK-DsGem99u.js} +1 -1
  124. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-Dxeh7Ifh.js → gitGraphDiagram-WWUBYQGX-BkbTIyDI.js} +2 -2
  125. package/dist/client/assets/{guideRunStore-BDwUrwVG.js → guideRunStore-CRgghh5M.js} +2 -2
  126. package/dist/client/assets/{htmlRender-u6aukaIS.js → htmlRender-DhaCAG_8.js} +2 -2
  127. package/dist/client/assets/{index-CX66rK96.js → index-CyuShNwE.js} +3 -3
  128. package/dist/client/assets/{info-A6RAGUB7-UNUNy-u6.js → info-A6RAGUB7-BBQkQpY8.js} +1 -1
  129. package/dist/client/assets/{infoDiagram-27XIBGKW-CGvleawa.js → infoDiagram-27XIBGKW-B-aRfZJ5.js} +2 -2
  130. package/dist/client/assets/{input-Co98bOaa.js → input-BZEAWLAC.js} +2 -2
  131. package/dist/client/assets/{input-group-C65K0cEy.js → input-group-DQ0hiSJt.js} +2 -2
  132. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-D-QGLluZ.js → ishikawaDiagram-5VMMS53U-BuQT0JFA.js} +2 -2
  133. package/dist/client/assets/{journeyDiagram-3NMN7TZE-Cc9GB3QS.js → journeyDiagram-3NMN7TZE-DvMkIp6_.js} +2 -2
  134. package/dist/client/assets/{kanban-definition-UXKFOSKX-BgUV6FhS.js → kanban-definition-UXKFOSKX-BH-BleQp.js} +2 -2
  135. package/dist/client/assets/{kbd-CwLhv_1P.js → kbd-B5U1dWuw.js} +2 -2
  136. package/dist/client/assets/{keybindings-DcZTzIOk.js → keybindings-BOV97yVS.js} +2 -2
  137. package/dist/client/assets/{lazyRouteComponent-OwDgZa6d.js → lazyRouteComponent-Cz9CWj20.js} +2 -2
  138. package/dist/client/assets/{line-sNp2Ita4.js → line-ldmXyAfR.js} +2 -2
  139. package/dist/client/assets/{link-Djjm-r3O.js → link-GWWfOiYJ.js} +2 -2
  140. package/dist/client/assets/{linkedPrompt-jLrYuA9Q.js → linkedPrompt-CUOURNo0.js} +2 -2
  141. package/dist/client/assets/{main-BD763ru4.js → main-DJbmaTSv.js} +7 -7
  142. package/dist/client/assets/{mediaReference-DWr_Q7C6.js → mediaReference-CHMrPLS_.js} +2 -2
  143. package/dist/client/assets/{mediaSource-N7mIMF8c.js → mediaSource-C2DVrhoI.js} +2 -2
  144. package/dist/client/assets/{mermaid-parser.core-BlZknfsy.js → mermaid-parser.core-CLu3jfMo.js} +4 -4
  145. package/dist/client/assets/{mermaid.core--V3R0CM0.js → mermaid.core-CcbjUEO9.js} +5 -5
  146. package/dist/client/assets/{mindmap-definition-YA3MSWOX-Dcl1V19a.js → mindmap-definition-YA3MSWOX-BgA-mHTZ.js} +2 -2
  147. package/dist/client/assets/{number-field-Dl9-pPML.js → number-field-BuLW4JjE.js} +2 -2
  148. package/dist/client/assets/{observeResize-Cu9WOk75.js → observeResize-DRhwSBbU.js} +2 -2
  149. package/dist/client/assets/{onboarding-D28jAqhK.js → onboarding-JdAo8zsA.js} +2 -2
  150. package/dist/client/assets/{openFileInPreview-D8k3bAuB.js → openFileInPreview-fPqhkMo9.js} +2 -2
  151. package/dist/client/assets/{p4ProjectFile-CA-XB2mx.js → p4ProjectFile-CvON4UbU.js} +2 -2
  152. package/dist/client/assets/{packet-AYTQ26CC-Cq8cyogA.js → packet-AYTQ26CC-DApn8qRX.js} +1 -1
  153. package/dist/client/assets/{pair-DTdVCqrt.js → pair-BZFzlFlB.js} +2 -2
  154. package/dist/client/assets/{pegDiagram-XKGWAZYB-CIlCIsuG.js → pegDiagram-XKGWAZYB-CXEiF-e_.js} +2 -2
  155. package/dist/client/assets/{phoneViewer-Cq9_4rg4.js → phoneViewer-B2PYzUOK.js} +2 -2
  156. package/dist/client/assets/{pie-WAS4IAKB-C1UwrJ5y.js → pie-WAS4IAKB-CYqWZV05.js} +1 -1
  157. package/dist/client/assets/{pieDiagram-E7YTZNPT-DE2DXJ6n.js → pieDiagram-E7YTZNPT-DI-IJXNl.js} +2 -2
  158. package/dist/client/assets/{pierre-icons-CTwu60OQ.js → pierre-icons-bBNX7pHG.js} +2 -2
  159. package/dist/client/assets/{popover-C_CynHVT.js → popover-O8JaXWO5.js} +2 -2
  160. package/dist/client/assets/{preview-BQQJkcGO.js → preview-BVbvXV-T.js} +2 -2
  161. package/dist/client/assets/{preview-BhxAapOU.js → preview-CBNZZm4k.js} +2 -2
  162. package/dist/client/assets/{previewMiniPlayerStore-DFZVAQQT.js → previewMiniPlayerStore-C_DZeWb5.js} +2 -2
  163. package/dist/client/assets/{primary-DSRxd6M2.js → primary-fvERVyIG.js} +2 -2
  164. package/dist/client/assets/{primaryCloudLinkState-CFpdks4W.js → primaryCloudLinkState-CT9FDATw.js} +2 -2
  165. package/dist/client/assets/{projectFilesQueryState-C-ocQLMP.js → projectFilesQueryState-D-fWLsA3.js} +2 -2
  166. package/dist/client/assets/{projectScriptEditor-B8vMmwB8.js → projectScriptEditor-BqddH5Lr.js} +2 -2
  167. package/dist/client/assets/{providerSkills-CcHRwAN-.js → providerSkills-JMYzRM2N.js} +2 -2
  168. package/dist/client/assets/{pullRequestDetail.logic-BtIgsnU5.js → pullRequestDetail.logic-BVBxawC1.js} +2 -2
  169. package/dist/client/assets/{pullRequestIcons-DIZr6jl2.js → pullRequestIcons-CuqlEFYV.js} +2 -2
  170. package/dist/client/assets/{pullRequestReviewStore-amd6o4Qz.js → pullRequestReviewStore-DmxuV1dp.js} +2 -2
  171. package/dist/client/assets/{pullRequests-DYydEt0i.js → pullRequests-CEpTVk5m.js} +2 -2
  172. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-B71DEG2g.js → quadrantDiagram-AXDQQJYC-Os8jPhhw.js} +2 -2
  173. package/dist/client/assets/{queries-CL96nG-6.js → queries-BBd2XSpN.js} +2 -2
  174. package/dist/client/assets/{query-BUdsNuE-.js → query-fboCqXXy.js} +2 -2
  175. package/dist/client/assets/{radar-RG4KPBEZ-DXixQtmq.js → radar-RG4KPBEZ-BwFp-k4W.js} +1 -1
  176. package/dist/client/assets/{radio-group-A1S0ujjv.js → radio-group-B2ziR973.js} +2 -2
  177. package/dist/client/assets/{railroad-74A4TZTK-Dc3k62gE.js → railroad-74A4TZTK-BhaeCUUR.js} +1 -1
  178. package/dist/client/assets/railroad-abnf-HS5TGJTU-D_PV710-.js +1 -0
  179. package/dist/client/assets/railroad-ebnf-LZEXJU2U-CmXdS8HA.js +1 -0
  180. package/dist/client/assets/railroad-peg-WCYAUIDC-BpmFZ4-g.js +1 -0
  181. package/dist/client/assets/{railroadDiagram-O6MQD6OU-CI6QRate.js → railroadDiagram-O6MQD6OU-BwEd4kBJ.js} +2 -2
  182. package/dist/client/assets/{renderScheduler-5H6UPjvu.js → renderScheduler-C031Kal5.js} +2 -2
  183. package/dist/client/assets/{requirementDiagram-BXWQKSXE-B0Buh6ge.js → requirementDiagram-BXWQKSXE-B3cJlOEK.js} +2 -2
  184. package/dist/client/assets/{rightPanelStore-DqykKcOU.js → rightPanelStore-JWjHC9l1.js} +2 -2
  185. package/dist/client/assets/{runtime-CKyYqaHd.js → runtime-B-UcwNuZ.js} +2 -2
  186. package/dist/client/assets/{runtime-CUfZ5Phy.js → runtime-BVzm9sLS.js} +3 -3
  187. package/dist/client/assets/{runtimeModeConfig-UzS-MhY2.js → runtimeModeConfig-Ce0Dnm2_.js} +2 -2
  188. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-Deq_JVb6.js → sankeyDiagram-P5KCCOFB-C8CBmy9t.js} +2 -2
  189. package/dist/client/assets/{scheduledTasksSettings.logic-C4ccNgNW.js → scheduledTasksSettings.logic-CJBRz5bk.js} +2 -2
  190. package/dist/client/assets/{scroll-area-Cv4W51s4.js → scroll-area-D4H8QGpd.js} +2 -2
  191. package/dist/client/assets/{select-DzlDEkfd.js → select-D0wmEFXx.js} +2 -2
  192. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-1qHr7xDW.js → sequenceDiagram-WJ2MYXX4-IbrowOt4.js} +2 -2
  193. package/dist/client/assets/{server-wAR-1-oq.js → server-97u7Iupv.js} +2 -2
  194. package/dist/client/assets/{session-kQcn2Ab9.js → session-CPQQ27HG.js} +2 -2
  195. package/dist/client/assets/{session-logic-0uuqchi0.js → session-logic-CiMoVF-V.js} +2 -2
  196. package/dist/client/assets/{settings-CJRxKrr5.js → settings-mAdVdtYz.js} +2 -2
  197. package/dist/client/assets/{settings.appearance-CdYf34t-.js → settings.appearance-SUyLnEit.js} +2 -2
  198. package/dist/client/assets/settings.archived-C-clMQMK.js +2 -0
  199. package/dist/client/assets/{settings.computer-use-BBwkrRF0.js → settings.computer-use-IGLZXOs8.js} +2 -2
  200. package/dist/client/assets/{settings.connections-C0ScdFUO.js → settings.connections-DhpKQ7ay.js} +2 -2
  201. package/dist/client/assets/{settings.data-controls-CqmbYgtL.js → settings.data-controls-FiLy_ddv.js} +2 -2
  202. package/dist/client/assets/{settings.decisions-Bze1TWCV.js → settings.decisions-DZO8QWHd.js} +2 -2
  203. package/dist/client/assets/{settings.diagnostics-DljjNhZd.js → settings.diagnostics-CG2kVUBD.js} +2 -2
  204. package/dist/client/assets/{settings.general-DbmtxjMV.js → settings.general-jsS1Ydzs.js} +2 -2
  205. package/dist/client/assets/{settings.integrations-o3KHIBuO.js → settings.integrations-DDlR7Et9.js} +2 -2
  206. package/dist/client/assets/{settings.keybindings-DKWMv6nZ.js → settings.keybindings-BYwCM_iI.js} +2 -2
  207. package/dist/client/assets/{settings.open-source-licenses-BRMYfP3x.js → settings.open-source-licenses-CZcWXiGu.js} +2 -2
  208. package/dist/client/assets/{settings.plugins-CxGm36pf.js → settings.plugins-P_B4taFp.js} +2 -2
  209. package/dist/client/assets/{settings.projects-B_Zp3Z9z.js → settings.projects-DqNHL2Mx.js} +3 -3
  210. package/dist/client/assets/{settings.providers-DLodyAaO.js → settings.providers-olNQXPOc.js} +3 -3
  211. package/dist/client/assets/{settings.scheduled-tasks-me1XYuBY.js → settings.scheduled-tasks-Dwr1Iiu5.js} +2 -2
  212. package/dist/client/assets/{settings.snap-shot-rYPhb3ty.js → settings.snap-shot-uj9CX5J6.js} +2 -2
  213. package/dist/client/assets/{settings.source-control-CEp3bQpF.js → settings.source-control-H60mYM0m.js} +2 -2
  214. package/dist/client/assets/{settings.storage-Bt3UPsm5.js → settings.storage--Ghi4ySm.js} +2 -2
  215. package/dist/client/assets/{settingsLayout-B-2za2g9.js → settingsLayout-BdqCokK9.js} +2 -2
  216. package/dist/client/assets/{sidebar-DmtBLMTN.js → sidebar-7a8hvtAS.js} +2 -2
  217. package/dist/client/assets/{sidebarProjectGrouping-CnKGrI1j.js → sidebarProjectGrouping-BGgp_M_h.js} +2 -2
  218. package/dist/client/assets/{skeleton-B4ai8OyH.js → skeleton-7wGNlCET.js} +2 -2
  219. package/dist/client/assets/{sortable.esm-wPMp_PEb.js → sortable.esm-CG0AZByT.js} +2 -2
  220. package/dist/client/assets/{sourceControl-CrWHksgJ.js → sourceControl-B8VqenU-.js} +2 -2
  221. package/dist/client/assets/{spinner-CqTy7FSl.js → spinner-YUJ6Pwvq.js} +2 -2
  222. package/dist/client/assets/{standalone-page-DjPR_lp1.js → standalone-page-BxErOfZy.js} +2 -2
  223. package/dist/client/assets/{stateDiagram-D77RDMKH-DBZk-pTE.js → stateDiagram-D77RDMKH-C0i1_7JQ.js} +2 -2
  224. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-nFt0QPRs.js +2 -0
  225. package/dist/client/assets/{swimlanes-42K2YHIH-ByvgaAKf.js → swimlanes-42K2YHIH-DlWorw-a.js} +2 -2
  226. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Byr1T2AB.js +9 -0
  227. package/dist/client/assets/{terminal-links-BleTJXkt.js → terminal-links-DnuUiEnP.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-dTMJKZUr.js → terminalSessions-B89lkZlG.js} +2 -2
  229. package/dist/client/assets/{textarea-DIyHbcIw.js → textarea-Br1ny3dw.js} +2 -2
  230. package/dist/client/assets/{themePalette-ELqAvm4C.js → themePalette-B4vIs8Bi.js} +2 -2
  231. package/dist/client/assets/{threadSort-C6bJOgqf.js → threadSort-BN7fK5qZ.js} +2 -2
  232. package/dist/client/assets/{timeline-definition-24CTP7MA-Q0Al5L2-.js → timeline-definition-24CTP7MA-f1puoyJY.js} +2 -2
  233. package/dist/client/assets/{toast-MGWD1Vlb.js → toast-Bkc7xsho.js} +2 -2
  234. package/dist/client/assets/{toggle-BAcxn8F-.js → toggle-DNxTFG4o.js} +2 -2
  235. package/dist/client/assets/{toggle-group-XAlRECP9.js → toggle-group-CQtXH1ph.js} +2 -2
  236. package/dist/client/assets/{tooltip-BTZmEp2R.js → tooltip-DH7_Fmka.js} +2 -2
  237. package/dist/client/assets/{treeView-Q6P3EWNA-CA5VrBlD.js → treeView-Q6P3EWNA-cachkR0K.js} +1 -1
  238. package/dist/client/assets/{treemap-WGGIJYW6-VkJwMEUW.js → treemap-WGGIJYW6-5vI1Z8yq.js} +1 -1
  239. package/dist/client/assets/{usage-BAr-_U4h.js → usage-Cuwnw3mn.js} +2 -2
  240. package/dist/client/assets/{usageAccess-DHG-PXT1.js → usageAccess-BRuBlcgN.js} +2 -2
  241. package/dist/client/assets/{usageFormat-B7-dLMvL.js → usageFormat-B0V5dWS3.js} +2 -2
  242. package/dist/client/assets/{usageShortcuts-BffpH2Am.js → usageShortcuts-CK0JjnNA.js} +2 -2
  243. package/dist/client/assets/{use-atom-command-CwLq1NLm.js → use-atom-command-JNR1Jqwn.js} +2 -2
  244. package/dist/client/assets/{useAriaLabelledBy-DuZF33ag.js → useAriaLabelledBy-BNA1QLXP.js} +2 -2
  245. package/dist/client/assets/{useHandleNewThread-Dz0hXG9T.js → useHandleNewThread-vYbjmg4i.js} +2 -2
  246. package/dist/client/assets/{useLocation-Ck2WxARJ.js → useLocation-D91_HRP0.js} +2 -2
  247. package/dist/client/assets/useNavigate-NmIi-1RV.js +2 -0
  248. package/dist/client/assets/{useNavigateBack-DkhnvN2P.js → useNavigateBack-DnwpvjrN.js} +2 -2
  249. package/dist/client/assets/{useParams-ZpfAkQ5u.js → useParams-CYkWvywV.js} +2 -2
  250. package/dist/client/assets/{usePermissionStatus-BXGMw-SX.js → usePermissionStatus-CuzpUXth.js} +2 -2
  251. package/dist/client/assets/{usePullRequestActions-CtlawWSo.js → usePullRequestActions-DqgBdoH5.js} +2 -2
  252. package/dist/client/assets/{useRegisterFieldControl-Bnfq4Sq_.js → useRegisterFieldControl-C127nghN.js} +2 -2
  253. package/dist/client/assets/{useScopedModelAvailability-BH0nl2bK.js → useScopedModelAvailability-BsIJUZbS.js} +2 -2
  254. package/dist/client/assets/{useSettings-B_UiwKX2.js → useSettings-DYKTOdxY.js} +2 -2
  255. package/dist/client/assets/{useT3ConnectAuthPrompt-CgOEppM6.js → useT3ConnectAuthPrompt-DlW3HUgA.js} +2 -2
  256. package/dist/client/assets/{utils-BSj_I6H5.js → utils-vKlT_s3D.js} +2 -2
  257. package/dist/client/assets/{vcsRefInvalidation-CagWw7RC.js → vcsRefInvalidation-CC_2_Ufo.js} +2 -2
  258. package/dist/client/assets/{vennDiagram-4TSXK5OY-CYfZGFGR.js → vennDiagram-4TSXK5OY-HkY_FANS.js} +2 -2
  259. package/dist/client/assets/{wardley-WFR3VGLG-CTushXoY.js → wardley-WFR3VGLG-B9HKXiPi.js} +1 -1
  260. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-YUv9rcpO.js → wardleyDiagram-VM6X3IG4-CJL7EyS8.js} +2 -2
  261. package/dist/client/assets/{welcome-CF1pFivU.js → welcome-BOXDf4R_.js} +2 -2
  262. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DSqIxe9e.js → xychartDiagram-S5SC5T6Z-Bsll1-pV.js} +2 -2
  263. package/dist/client/index.html +1 -1
  264. package/package.json +1 -1
  265. package/dist/client/assets/architecture-7GRP2DOG-BYbXaKhk.js +0 -1
  266. package/dist/client/assets/channel-B0viw1HQ.js +0 -2
  267. package/dist/client/assets/classDiagram-ZZMXUADV-CaSHZ6o_.js +0 -2
  268. package/dist/client/assets/classDiagram-v2-VYDZK3BY-CaSHZ6o_.js +0 -2
  269. package/dist/client/assets/eventmodeling-NTZA5JFV-b-UZANga.js +0 -1
  270. package/dist/client/assets/flowDiagram-HODETNUW-CZR0K3VV.js +0 -1
  271. package/dist/client/assets/railroad-abnf-HS5TGJTU-KGox1mtk.js +0 -1
  272. package/dist/client/assets/railroad-ebnf-LZEXJU2U-B3MJWEk4.js +0 -1
  273. package/dist/client/assets/railroad-peg-WCYAUIDC-Dvcg1m8U.js +0 -1
  274. package/dist/client/assets/settings.archived-CBKnSA9g.js +0 -2
  275. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-01P-rV-b.js +0 -2
  276. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-0fZWpnCF.js +0 -9
  277. package/dist/client/assets/useNavigate-gpe7yDrs.js +0 -2
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{HT as n,cd as r,dE as i,sr as a}from"./utils-BSj_I6H5.js";var o=i(),s=e(n(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:i}=e,c=i!==void 0&&i,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(r,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
- //# sourceMappingURL=usePermissionStatus-BXGMw-SX.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{HT as n,cd as r,dE as i,sr as a}from"./utils-vKlT_s3D.js";var o=i(),s=e(n(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:i}=e,c=i!==void 0&&i,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(r,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
+ //# sourceMappingURL=usePermissionStatus-CuzpUXth.js.map
@@ -1,3 +1,3 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{D as n,KC as r,Lo as i,Ls as a,Oc as o,Vo as s,Zg as c,dE as l,ds as u,fT as d,i_ as f,l_ as p,ms as m,os as h}from"./utils-BSj_I6H5.js";import{M as g,U as _,j as v}from"./runtime-CUfZ5Phy.js";import{a as y,i as b}from"./vcsRefInvalidation-CagWw7RC.js";import{C as ee}from"./entities-BJX4eZyc.js";import{t as te}from"./runtime-CKyYqaHd.js";import{i as x}from"./toast-MGWD1Vlb.js";import{O as S,f as C,s as w}from"./useSettings-B_UiwKX2.js";import{i as T,n as E}from"./session-kQcn2Ab9.js";import{n as D}from"./query-BUdsNuE-.js";import{t as O}from"./use-atom-command-CwLq1NLm.js";import{d as k,l as A,u as j}from"./queries-CL96nG-6.js";import{t as M}from"./sourceControl-CrWHksgJ.js";import{C as N,r as P}from"./pullRequests-DYydEt0i.js";import{L as F,v as ne,y as re}from"./pullRequestDetail.logic-BtIgsnU5.js";import{c as ie,f as ae,i as I,s as L}from"./p4ProjectFile-CA-XB2mx.js";import{t as R}from"./sidebarProjectGrouping-CnKGrI1j.js";import{n as z}from"./useHandleNewThread-Dz0hXG9T.js";var B=e(t(),1),V=l();function H(e){return{pullRequestResolution:g(e,{label:`environment-data:git:resolve-pull-request`,tag:o.gitResolvePullRequest}),preparePullRequestThread:v(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:o.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,f),n=W[e.kind],a=s(A.stateAtom(e.scope)),o=a.operation===n,c=(0,B.useCallback)(()=>{A.resetError(i,e.scope,n)},[e.scope,n]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return h(r(new p({requiredScope:f,message:`This connection cannot change source control.`})));let a=async()=>{let n=await e.action(...t);return u(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?a():A.track(i,e.scope,{operation:n,label:e.label},a)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:o?a.error:null,isPending:o&&a.isRunning,resetError:c,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=s(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(j.init,n),a;t[1]!==i||t[2]!==e?(a=async()=>{let t=K(e);return t===null?h(r(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):i({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=i,t[2]=e,t[3]=a):a=t[3];let o=a,s;return t[4]!==o||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(j.pull,n),a;t[1]!==e.cwd||t[2]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=a):a=t[3];let o=D(a),s;t[4]!==i||t[5]!==e?(s=async()=>{let t=K(e);return t===null?h(r(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):i({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=i,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[2]=i):i=t[2];let a=O(n,i),o;t[3]!==e.cwd||t[4]!==e.environmentId?(o=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=o):o=t[5];let s=D(o),c;t[6]!==a||t[7]!==e?(c=async t=>K(e)===null?h(r(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):a(t),t[6]=a,t[7]=e,t[8]=c):c=t[8];let l=c,u;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=u):u=t[12],G(u)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(M.publishRepository,n),a;t[1]!==e.cwd||t[2]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=a):a=t[3];let o=D(a),s;t[4]!==i||t[5]!==e?(s=async t=>{let n=K(e);return n===null?h(r(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):i({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=i,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(U.preparePullRequestThread,n),a;t[1]!==i||t[2]!==e?(a=async t=>{let n=K(e);return n===null?h(r(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?h(r(new p({requiredScope:c,message:`This connection cannot change threads.`}))):i({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=i,t[2]=e,t[3]=a):a=t[3];let o=a,s;return t[4]!==o||t[5]!==e?(s={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:d(m(i.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>I(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(ae),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=R({projects:s,settings:o,primaryEnvironmentId:c}).get(ie(n))??L(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"approve-workflows":`Workflows approved`},pe={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 enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"approve-workflows":`Could not approve workflows`},Z={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, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw _(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw _(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{D as n,KC as r,Lo as i,Ls as a,Oc as o,Vo as s,Zg as c,dE as l,ds as u,fT as d,i_ as f,l_ as p,ms as m,os as h}from"./utils-vKlT_s3D.js";import{M as g,U as _,j as v}from"./runtime-BVzm9sLS.js";import{a as y,i as b}from"./vcsRefInvalidation-CC_2_Ufo.js";import{C as ee}from"./entities-Dzl1j2jY.js";import{t as te}from"./runtime-B-UcwNuZ.js";import{i as x}from"./toast-Bkc7xsho.js";import{O as S,f as C,s as w}from"./useSettings-DYKTOdxY.js";import{i as T,n as E}from"./session-CPQQ27HG.js";import{n as D}from"./query-fboCqXXy.js";import{t as O}from"./use-atom-command-JNR1Jqwn.js";import{d as k,l as A,u as j}from"./queries-BBd2XSpN.js";import{t as M}from"./sourceControl-B8VqenU-.js";import{C as N,r as P}from"./pullRequests-CEpTVk5m.js";import{L as F,v as ne,y as re}from"./pullRequestDetail.logic-BVBxawC1.js";import{c as ie,f as ae,i as I,s as L}from"./p4ProjectFile-CvON4UbU.js";import{t as R}from"./sidebarProjectGrouping-BGgp_M_h.js";import{n as z}from"./useHandleNewThread-vYbjmg4i.js";var B=e(t(),1),V=l();function H(e){return{pullRequestResolution:g(e,{label:`environment-data:git:resolve-pull-request`,tag:o.gitResolvePullRequest}),preparePullRequestThread:v(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:o.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,f),n=W[e.kind],a=s(A.stateAtom(e.scope)),o=a.operation===n,c=(0,B.useCallback)(()=>{A.resetError(i,e.scope,n)},[e.scope,n]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return h(r(new p({requiredScope:f,message:`This connection cannot change source control.`})));let a=async()=>{let n=await e.action(...t);return u(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?a():A.track(i,e.scope,{operation:n,label:e.label},a)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:o?a.error:null,isPending:o&&a.isRunning,resetError:c,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=s(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(j.init,n),a;t[1]!==i||t[2]!==e?(a=async()=>{let t=K(e);return t===null?h(r(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):i({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=i,t[2]=e,t[3]=a):a=t[3];let o=a,s;return t[4]!==o||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(j.pull,n),a;t[1]!==e.cwd||t[2]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=a):a=t[3];let o=D(a),s;t[4]!==i||t[5]!==e?(s=async()=>{let t=K(e);return t===null?h(r(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):i({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=i,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[2]=i):i=t[2];let a=O(n,i),o;t[3]!==e.cwd||t[4]!==e.environmentId?(o=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=o):o=t[5];let s=D(o),c;t[6]!==a||t[7]!==e?(c=async t=>K(e)===null?h(r(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):a(t),t[6]=a,t[7]=e,t[8]=c):c=t[8];let l=c,u;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=u):u=t[12],G(u)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(M.publishRepository,n),a;t[1]!==e.cwd||t[2]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=a):a=t[3];let o=D(a),s;t[4]!==i||t[5]!==e?(s=async t=>{let n=K(e);return n===null?h(r(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):i({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=i,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let i=O(U.preparePullRequestThread,n),a;t[1]!==i||t[2]!==e?(a=async t=>{let n=K(e);return n===null?h(r(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?h(r(new p({requiredScope:c,message:`This connection cannot change threads.`}))):i({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=i,t[2]=e,t[3]=a):a=t[3];let o=a,s;return t[4]!==o||t[5]!==e?(s={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:d(m(i.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>I(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(ae),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=R({projects:s,settings:o,primaryEnvironmentId:c}).get(ie(n))??L(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"approve-workflows":`Workflows approved`},pe={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 enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"approve-workflows":`Could not approve workflows`},Z={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, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw _(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw _(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
2
2
  `)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:r,detail:i}=e,o=z(),s=i?.workspaceRoot??null,c;t[0]!==r||t[1]!==s?(c={environmentId:r,cwd:s},t[0]=r,t[1]=s,t[2]=c):c=t[2];let l=Y(c),[u,d]=(0,B.useState)(null),f;t[3]===o?f=t[4]:(f=async(e,t,r)=>{let i=r??await o(e).then(xe,be);if(i===null)return null;let a=n.getState();if(t===null)return i;let s=a.getComposerDraft(i.draftId),c=s?.reviewComments??[],l=ne({prompt:s?.prompt??``,lastHandoffPrompt:$.get(i.draftId)},t.prompt);return $.set(i.draftId,t.prompt),a.setPrompt(i.draftId,l),a.setReviewComments(i.draftId,re(c,t.reviewComments??[])),i},t[3]=o,t[4]=f);let p=f,m;t[5]!==i||t[6]!==r||t[7]!==u||t[8]!==p?(m=async(e,t)=>{if(!i||u!==null)return;d(e);let n=a(r,i.projectId),o=await p(n,t);if(d(null),o===null){x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}x.add({type:`success`,title:`Asked in a thread`,description:t.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.`})},t[5]=i,t[6]=r,t[7]=u,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==i||t[11]!==r||t[12]!==u||t[13]!==o||t[14]!==p||t[15]!==l?(g=async(e,t,n)=>{let s=n===void 0?`worktree`:n;if(!i||u!==null)return;d(e);let c=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),f=a(r,i.projectId),m=await o(f).then(ye,ve);if(m===null){d(null),x.update(c,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await l.run({reference:i.url,mode:s,threadId:m.threadId});if(h._tag===`Failure`){d(null);let e=l.error instanceof Error?l.error.message:null;x.update(c,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await o(f,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){d(null),x.update(c,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}d(null);let g={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){x.update(c,h.value.isOnPullRequestHead?{type:`success`,title:s===`local`?`Checked out here`:`Checked out`,description:s===`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.`}:g);return}await p(f,t,m),x.update(c,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g)},t[10]=i,t[11]=r,t[12]=u,t[13]=o,t[14]=p,t[15]=l,t[16]=g):g=t[16];let _=g,v;return t[17]!==u||t[18]!==h||t[19]!==_?(v={handoff:u,startAsk:h,startHandoff:_},t[17]=u,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
3
- //# sourceMappingURL=usePullRequestActions-CtlawWSo.js.map
3
+ //# sourceMappingURL=usePullRequestActions-DqgBdoH5.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Da as n,Ln as r}from"./utils-BSj_I6H5.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=r(),l=i.useRef(null);l.current||=Symbol(),n(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
2
- //# sourceMappingURL=useRegisterFieldControl-Bnfq4Sq_.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Da as n,Ln as r}from"./utils-vKlT_s3D.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=r(),l=i.useRef(null);l.current||=Symbol(),n(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
2
+ //# sourceMappingURL=useRegisterFieldControl-C127nghN.js.map
@@ -1,2 +1,2 @@
1
- import{Ht as e,Nt as t,Vt as n,dE as r}from"./utils-BSj_I6H5.js";import{E as i,i as a}from"./useSettings-B_UiwKX2.js";import{B as o}from"./settingsLayout-B-2za2g9.js";var s=r();function c(r,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==r||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=n(e(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(a(c.settings,r),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=r,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
- //# sourceMappingURL=useScopedModelAvailability-BH0nl2bK.js.map
1
+ import{Ht as e,Nt as t,Vt as n,dE as r}from"./utils-vKlT_s3D.js";import{E as i,i as a}from"./useSettings-DYKTOdxY.js";import{B as o}from"./settingsLayout-BdqCokK9.js";var s=r();function c(r,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==r||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=n(e(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(a(c.settings,r),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=r,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
+ //# sourceMappingURL=useScopedModelAvailability-BsIJUZbS.js.map
@@ -1,3 +1,3 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,As as r,Aw as i,Bm as a,Dy as o,Fx as s,Go as c,Gy as l,Ho as u,Ig as d,Km as f,Lg as p,Lo as ee,Ly as te,Mw as m,Nx as ne,Ny as re,Ow as h,Rg as ie,Rm as ae,Ry as oe,Ty as se,Uo as ce,Vm as le,Vo as g,Wm as ue,Zm as de,_s as fe,ah as pe,by as me,cx as he,cy as ge,dE as _e,dT as ve,d_ as ye,db as be,ds as xe,fT as _,fb as Se,gT as Ce,gg as we,gy as Te,hb as Ee,hs as De,il as Oe,jy as ke,lb as Ae,lv as je,m_ as Me,mb as Ne,mg as Pe,ms as Fe,nb as Ie,nh as Le,oh as Re,ol as ze,qm as Be,r_ as Ve,rl as He,ry as Ue,sh as We,tb as Ge,vc as Ke}from"./utils-BSj_I6H5.js";import{F as qe,L as Je,T as Ye,U as Xe,gt as v,kt as Ze,w as Qe,xn as $e}from"./runtime-CUfZ5Phy.js";import{Ct as et,T as tt,t as nt,yt as rt}from"./runtime-CKyYqaHd.js";import{i as y}from"./toast-MGWD1Vlb.js";import{f as b,h as x,m as it,u as at}from"./server-wAR-1-oq.js";import{i as ot,n as st,s as ct,t as lt}from"./session-kQcn2Ab9.js";import{t as ut}from"./use-atom-command-CwLq1NLm.js";import{B as dt,C as ft,F as pt,N as mt,P as ht,V as gt,b as _t,c as vt,i as S,k as yt,l as bt,n as C,o as xt,r as St,v as Ct,w as wt,x as Tt}from"./themePalette-ELqAvm4C.js";var w=e(t(),1),T=_e();function Et(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function Dt(e){let t=ce(t=>c(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=ve(Fe(n(e.stateAtom(t))),()=>$e);return{entry:r,connection:r.unsupportedReason===void 0?et(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(n(`environment-presentation:${t}`))),r=new Map;return{presentationAtom:t,presentationsAtom:c(n=>{let i=new Map;for(let r of n(e.catalogValueAtom).entries.keys()){let e=n(t(r));e!==null&&i.set(r,e)}return Et(r,i)||(r=i),r}).pipe(n(`environment-presentations`))}}function Ot(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:rt(t.entry)??``,isRelayManaged:Ze(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function kt(e){let t=c(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),r=c(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),i=ce(t=>c(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=Ot(t,r),a=_(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),a=c(t=>{let n=[];for(let r of t(e.catalogValueAtom).entries.keys()){let e=t(i(r));e!==null&&n.push(e)}let r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}).pipe(n(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:c(e=>{let n=e(t).filter(t=>e(i(t))?.connectionState===`connected`),r=_(e.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),identitiesAtom:r,environmentsAtom:a,machineByIdAtom:c(n=>{let r=new Map(n(t).map(t=>[t,ze(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&Et(i,r)?i:r}),pullRequestsSupportedAtom:c(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var E=Dt({catalogValueAtom:x.catalogValueAtom,stateAtom:x.stateAtom,serverConfigValueAtom:b.configValueAtom}),At=kt({catalogValueAtom:x.catalogValueAtom,presentationAtom:E.presentationAtom}),jt=c(null).pipe(n(`web-environment-presentation:empty`));function Mt(e){let t=(0,T.c)(5),n=g(x.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?jt:E.presentationAtom(e),t[0]=e,t[1]=r);let i=g(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Nt={status:`idle`},D=Nt,O=null,k=[],A=0,Pt=new Set;function j(e){D=e;for(let e of Pt)e()}function Ft(e){O?.resolve(e);for(let t of k)t.resolve(e);O=null,k=[]}function It(){return D}function Lt(e){return Pt.add(e),()=>{Pt.delete(e)}}function Rt(){A+=1;let e=!0;return()=>{e&&(e=!1,A=Math.max(0,A-1),A===0&&(Ft(!1),j(Nt)))}}function zt(e,t){if(A!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(O||D.status===`closing`){k.push(r);return}O=r,j({status:`confirming`,message:e,variant:r.variant})})}function Bt(){return D.status!==`idle`||O!==null||k.length>0}function Vt(e){if(D.status!==`confirming`||!O)return;let t=O;O=null,t.resolve(e),j({status:`closing`,message:D.message,variant:D.variant})}function Ht(){if(D.status!==`closing`)return;let e=k.shift();if(!e){j(Nt);return}O=e,j({status:`confirming`,message:e.message,variant:e.variant})}var Ut={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Wt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return Ke(t)?`${n.map(e=>Ut[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Gt=`http://www.w3.org/2000/svg`,Kt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function qt(e,t){let n=Kt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Gt,`svg`);r.setAttribute(`xmlns`,Gt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Gt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Jt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Yt(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var M=null;function Xt(){return M!==null}function Zt(){M?.(),M=null}function Qt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,M===c&&(M=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=Yt(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!Yt(e.target,i)&&l(null)},f=e=>{s&&!Yt(e.target,i)&&(e.preventDefault(),l(null))},p=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ee=(e,t,n,r,o)=>{p(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?qt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=qt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Wt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,Ke(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=qt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ee(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Jt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{p(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{Jt(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),ee(e,t?.x??0,t?.y??0,0),M&&M(),M=c,requestAnimationFrame(()=>{s=!0})})}var $t=`t3code:client-settings:v1`;function en(){return typeof window<`u`}function tn(){return en()?De($t,ae):null}function nn(e){en()&&fe($t,e,ae)}var rn;function an(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>zt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Qt(e,t),close:async()=>{window.desktopBridge||Zt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():tn(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);nn(e)}}}}function on(){return an()}function sn(){if(typeof window<`u`)return rn||(rn=on(),rn)}function cn(){let e=sn();if(!e)throw Error(`Local API not found`);return e}var N=`t3code:theme`,ln=`(prefers-color-scheme: dark)`,P={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function un(){return F()}function dn(){return typeof window>`u`?{}:fn()}function F(){if(typeof window>`u`)return null;try{return yt(window.localStorage.getItem(S))}catch{return null}}function fn(){try{let e=JSON.parse(window.localStorage.getItem(`t3code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function I(e){return`${e?.light??``}|${e?.dark??``}`}var pn=`theme-color`,mn=`meta[name="${pn}"][data-dynamic-theme-color="true"]`,L=class extends me()(`ThemeStorageError`,{operation:ge([`read`,`write`]),storageKey:Te,theme:l(xt),cause:Ue()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},hn=oe(L),gn=class extends me()(`DesktopThemeSyncError`,{theme:xt,cause:Ue()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},_n=oe(gn),R=[],z=null,vn=!0,B=null,V=null,H=null;function U(){vn=!0;for(let e of R)e()}function yn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(ln).matches}function bn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(St);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function xn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(C);if(xn(e))return e}catch{}return bn(e)?`system`:_t(e)??`light`}function Sn(e){if(typeof window<`u`)try{window.localStorage.setItem(C,e)}catch(e){throw new L({operation:`write`,storageKey:C,cause:e})}}function Cn(){if(typeof window>`u`)return P.theme;let e;try{e=window.localStorage.getItem(N)}catch(e){throw new L({operation:`read`,storageKey:N,cause:e})}return e!==null&&wt(e)?bt(e):P.theme}function wn(e){if(typeof window<`u`)try{window.localStorage.setItem(N,e),H=null}catch(t){throw new L({operation:`write`,storageKey:N,theme:e,cause:t})}}function G(){if(H!==null)return P.theme;try{return Cn()}catch(e){let t=hn(e)?e:new L({operation:`read`,storageKey:N,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),P.theme}}function Tn(){let e=document.querySelector(mn);return e||(e=document.createElement(`meta`),e.name=pn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function En(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function Dn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function On(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?En(e.getPropertyValue(`--app-chrome-background`)):null,n=En(getComputedStyle(Dn()).backgroundColor),r=En(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${pn}"]`);if(a.length===0){Tn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?yn():!1,o=F();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&I(V.themeHalves)===I(o)){An(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=ht(e,a,i,r,o);vt(pt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},On(),An(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function kn(e,t,n,r,i=F()){try{await e.setTheme(mt(t,n,r,i))}catch(e){throw new gn({theme:t,cause:e})}}function An(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=F(),a=mt(e,t,n,i);r&&typeof r.setTheme==`function`&&B!==a&&(B=a,kn(r,e,t,n,i).catch(t=>{let n=_n(t)?t:new gn({theme:e,cause:t});console.error(n.message,{theme:n.theme,...v(n)}),B===a&&(B=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function jn(){if(typeof window>`u`)return P;if(!vn&&z)return z;vn=!1;let e=G(),t=W(e),n=t===`system`,r=n?yn():!1,i=F(),a=ht(e,r,n,t,i);return z&&z.theme===e&&z.resolvedTheme===a&&z.systemDark===r&&z.followSystem===n&&z.appearanceMode===t&&I(z.themeHalves)===I(i)||(z={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),z}function Mn(){return P}function Nn(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function Pn(e){e.key===N?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`t3code:theme-follow-system`||e.key===`t3code:theme-appearance-mode`||e.key===`t3code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`t3code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),ft(),V=null,K(G(),{suppressTransitions:!0}),U())}var Fn=null;function In(e){if(typeof window>`u`)return()=>{};if(R.push(e),!Fn){let e=typeof window.matchMedia==`function`?window.matchMedia(ln):null;e?.addEventListener(`change`,Nn),window.addEventListener(`storage`,Pn),Fn=()=>{e?.removeEventListener(`change`,Nn),window.removeEventListener(`storage`,Pn)}}return()=>{R=R.filter(t=>t!==e),R.length===0&&(Fn?.(),Fn=null)}}function Ln(){let e=(0,w.useSyncExternalStore)(In,jn,Mn),{theme:t,resolvedTheme:n}=e,r=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{Sn(W(G()));let t=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{wn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(S,t)}catch{}throw e}}catch(t){let n=hn(t)?t:new L({operation:`write`,storageKey:N,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...v(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{Sn(e)}catch(e){let t=hn(e)?e:new L({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,w.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?_t(t)??`light`:n;return i(r)},[i,t]),o=(0,w.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...fn()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(S):window.localStorage.setItem(S,JSON.stringify(n))}catch(e){let t=new L({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,w.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(S)}catch(e){let t=new L({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,w.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,w.useEffect)(()=>{K(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Rn=o(te(se)),zn=Ee(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Rn(t).pipe(s(e=>e.issue))}),Bn=new Ae(zn,Ne());Se().pipe(be(Ne({space:2})));var Vn=e=>Te.pipe(ke(e,Bn)),Hn={performance:{profile:`performance`,automaticGitFetchInterval:i(15),providerHealthRefreshInterval:h(1),hostPowerMonitorActiveInterval:i(30),hostPowerMonitorIdleInterval:h(2),idleClientTtl:i(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:a,providerHealthRefreshInterval:f,hostPowerMonitorActiveInterval:i(30),hostPowerMonitorIdleInterval:h(5),idleClientTtl:i(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:i(0),providerHealthRefreshInterval:h(15),hostPowerMonitorActiveInterval:h(1),hostPowerMonitorIdleInterval:h(10),idleClientTtl:i(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return Hn[e]}function Un(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Wn(e){let t=Un(e),n=Hn[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return m(e)===m(t)}function Gn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Kn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Wn(e),n=[Un(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(Gn(t,Hn[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Un(e),i=Hn[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function qn(e){let t={schemaVersion:1,profile:le,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||m(e.automaticGitFetchInterval)!==m(a)||m(e.providerHealthRefreshInterval)!==m(f);return Wn(n&&i?{schemaVersion:1,profile:m(e.automaticGitFetchInterval)===m(q(r).automaticGitFetchInterval)&&m(e.providerHealthRefreshInterval)===m(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...m(e.automaticGitFetchInterval)===m(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...m(e.providerHealthRefreshInterval)===m(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Jn(e){let t=qn(e);return Kn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Yn=Vn(de);re(Yn);function Xn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?Le(t.instanceId):We(n)}var Zn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>d.make(e));function Qn(e,t,n){let i=[...Zn.map(e=>[ie(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Zn.includes(t.driver)?[[p.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(i===void 0)return null;let[a,o]=i,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&r(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:we[o]??Pe[o]??`gpt-6-luna`}}function $n(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Re(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&He(i)&&Oe(i)?r:e.textGenerationModelSelection}function er(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Re(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&He(e)&&Oe(e))return r}return $n(e,t,n)}function tr(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function nr(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var rr=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function ir(e){let t={},n={};for(let[r,i]of Object.entries(e))rr.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function ar(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Xn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Ie(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Ie(e,[`continueThreadsAfterServerUpdate`])}function or(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function sr(e){let t=e.atom(je(Ye.pipe(ne(e=>Me(e.state)))),{initialValue:Qe});return{stateAtom:t,stateValueAtom:c(e=>ve(Fe(e(t)),()=>Qe)).pipe(n(`relay-environment-discovery-value`)),refresh:qe(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>Ye.pipe(he(e=>e.refresh))})}}var cr=sr(nt);function lr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:rt(t.entry),relayManaged:Ze(t.entry)}}function ur(){let e=(0,T.c)(7),t=g(x.catalogValueAtom),n=g(x.networkStatusValueAtom),r=g(E.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(dr),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function dr(e){let[t,n]=e;return lr(t,n)}function fr(){return g(it)}function pr(e){let t=(0,T.c)(3),{presentation:n}=Mt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:lr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function mr(){return pr(fr())}function hr(e){let t=(0,T.c)(2),n=ct(e),r;return t[0]===n?r=t[1]:(r=Ce(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function gr(){return g(cr.stateValueAtom)}function _r(){return g(At.environmentIdsAtom)}function vr(){return g(At.identitiesAtom)}function yr(){return g(At.pullRequestsSupportedAtom)}var br=`[CLIENT_SETTINGS]`,xr=new Set,Sr=new Set,Cr=ue,Y=`pending`,X=null,wr=0,Tr=Promise.resolve(),Er=0;function Dr(){for(let e of xr)e()}function Or(){for(let e of Sr)e()}function Z(){return Cr}function kr(e){Cr=e,Dr()}function Ar(e){Y!==e&&(Y=e,Or())}function jr(e){return xr.add(e),Q().catch(()=>void 0),()=>{xr.delete(e)}}function Mr(){return Y===`ready`}function Nr(){return Y}function Pr(e){return Sr.add(e),Q().catch(()=>void 0),()=>{Sr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=wr;Ar(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await cn().persistence.getClientSettings();if(e!==wr)return;t&&kr({...ue,...t}),Ar(`ready`)}catch(t){throw e===wr&&Ar(`failed`),console.error(`${br} hydrate failed`,{operation:`hydrate`,...v(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Fr=e=>cn().persistence.setClientSettings(e);function Ir(e){let t=Tr.then(e);return Tr=t.then(()=>void 0,()=>void 0),t}function Lr(e,t=Fr){let n=Y!==`ready`||Er>0;return n?Er+=1:kr({...Z(),...e}),Ir(async()=>{if(n)try{Y!==`ready`&&await Q(),kr({...Z(),...e})}finally{--Er}await t(Z())}).catch(e=>{console.error(`${br} persist failed`,{operation:`persist`,...v(e)})})}async function Rr(e,t=Fr){return Ir(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return kr(r),r}})}var zr=new Set(Ge(de.fields));function Br(e){let t={},n={};for(let[r,i]of Object.entries(e))zr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Vr(){return Z()}function Hr(){return Q()}function Ur(){return(0,w.useSyncExternalStore)(Pr,Mr,Wr)}function Wr(){return!1}function Gr(){return(0,w.useSyncExternalStore)(Pr,Nr,Kr)}function Kr(){return`pending`}function $(){return(0,w.useSyncExternalStore)(jr,Z,qr)}function qr(){return ue}function Jr(e,t){return{...t,...e,...tr(e,t)}}var Yr=new Set;function Xr(e,t){let n=(0,T.c)(8),r=$(),i=Ur(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=ut(b.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Yr.has(e))return;let n=nr(t,r);n&&(Yr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Yr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,w.useEffect)(s,c)}function Zr(e,t){let n=(0,T.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=Jr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Qr(e){let t=(0,T.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function $r(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function ei(){let e=(0,T.c)(7),t=Ur(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=Ln(),o=(0,w.useSyncExternalStore)(dt,Tt,ti),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=pt(i,a,r),l=Ct(c);s=$r({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??gt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function ti(){return null}async function ni(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Hr(),{...nr(e,Vr()),...t}}function ri(e){let t=(0,T.c)(6),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):ai,t[0]=e,t[1]=n);let r=g(n),i=ut(b.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await ni(r,t)}catch{y.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function ii(e){let t=(0,w.use)(u),n=(0,w.useRef)(new Map),r=ri(e);return(0,w.useCallback)(async(i,a)=>{if(!e)return;let o=b.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Hr()}catch{y.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=tr(c,Vr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&xe(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var ai=c(null);function oi(e){let t=(0,T.c)(5),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):ai,t[0]=e,t[1]=n);let r=g(n),i=$();Xr(e,r);let a=r??Be,o;return t[2]!==i||t[3]!==a?(o=tr(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function si(e,t){let n=(0,T.c)(2),r;n[0]===e?r=n[1]:(r=b.settingsValueAtom(e),n[0]=e,n[1]=r);let i=g(r);return Xr(e,i),Zr(i??Be,t)}function ci(e){let t=(0,T.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=ut(b.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function li(e){let t=mr(),n=g(at);return Xr(t?.environmentId??null,t?.serverConfig?.settings??null),Zr(n,e)}var ui=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function di(){let e=(0,T.c)(2),t=mr(),n;return e[0]===t?n=e[1]:(n=t!==null||!tt(),e[0]=t,e[1]=n),n}function fi(e){let t=(0,T.c)(3),n=e!==void 0&&e,{environments:r}=ur(),i;return t[0]!==r||t[1]!==n?(i=c(e=>r.filter(or).flatMap(t=>{let r=e(lt.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(Fe(r));return i!==null&&ye(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],g(i)}function pi(e){let t=(0,T.c)(10);ot(e,Ve);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=ut(b.updateSettings,n),{environments:i}=ur(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Je(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Xe(t);y.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=fi(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=Br(t),c=e===null||pe(n).every(t=>st(e,t));if(Object.keys(n).length>0&&!c&&y.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=ir(n),c=vi;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=ar(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);if(Object.keys(s).length!==0){if(ee.get(lt.sessionStateAtom(r))._tag!==`Initial`&&!pe(t).every(e=>st(r,e))){l.push(a?.label??r);continue}o.push({environmentId:r,input:{patch:s}})}}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(mi)}}Object.keys(a).length>0&&Lr(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function mi(e){let t=e.flatMap(_i);if(t.length===0)return;let n=e.filter(gi).map(hi);y.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,As as r,Aw as i,Bm as a,Dy as o,Fx as s,Go as c,Gy as l,Ho as u,Ig as d,Km as f,Lg as p,Lo as ee,Ly as te,Mw as m,Nx as ne,Ny as re,Ow as h,Rg as ie,Rm as ae,Ry as oe,Ty as se,Uo as ce,Vm as le,Vo as g,Wm as ue,Zm as de,_s as fe,ah as pe,by as me,cx as he,cy as ge,dE as _e,dT as ve,d_ as ye,db as be,ds as xe,fT as _,fb as Se,gT as Ce,gg as we,gy as Te,hb as Ee,hs as De,il as Oe,jy as ke,lb as Ae,lv as je,m_ as Me,mb as Ne,mg as Pe,ms as Fe,nb as Ie,nh as Le,oh as Re,ol as ze,qm as Be,r_ as Ve,rl as He,ry as Ue,sh as We,tb as Ge,vc as Ke}from"./utils-vKlT_s3D.js";import{F as qe,L as Je,T as Ye,U as Xe,gt as v,kt as Ze,w as Qe,xn as $e}from"./runtime-BVzm9sLS.js";import{Ct as et,T as tt,t as nt,yt as rt}from"./runtime-B-UcwNuZ.js";import{i as y}from"./toast-Bkc7xsho.js";import{f as b,h as x,m as it,u as at}from"./server-97u7Iupv.js";import{i as ot,n as st,s as ct,t as lt}from"./session-CPQQ27HG.js";import{t as ut}from"./use-atom-command-JNR1Jqwn.js";import{B as dt,C as ft,F as pt,N as mt,P as ht,V as gt,b as _t,c as vt,i as S,k as yt,l as bt,n as C,o as xt,r as St,v as Ct,w as wt,x as Tt}from"./themePalette-B4vIs8Bi.js";var w=e(t(),1),T=_e();function Et(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function Dt(e){let t=ce(t=>c(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=ve(Fe(n(e.stateAtom(t))),()=>$e);return{entry:r,connection:r.unsupportedReason===void 0?et(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(n(`environment-presentation:${t}`))),r=new Map;return{presentationAtom:t,presentationsAtom:c(n=>{let i=new Map;for(let r of n(e.catalogValueAtom).entries.keys()){let e=n(t(r));e!==null&&i.set(r,e)}return Et(r,i)||(r=i),r}).pipe(n(`environment-presentations`))}}function Ot(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:rt(t.entry)??``,isRelayManaged:Ze(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function kt(e){let t=c(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),r=c(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),i=ce(t=>c(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=Ot(t,r),a=_(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),a=c(t=>{let n=[];for(let r of t(e.catalogValueAtom).entries.keys()){let e=t(i(r));e!==null&&n.push(e)}let r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}).pipe(n(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:c(e=>{let n=e(t).filter(t=>e(i(t))?.connectionState===`connected`),r=_(e.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),identitiesAtom:r,environmentsAtom:a,machineByIdAtom:c(n=>{let r=new Map(n(t).map(t=>[t,ze(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&Et(i,r)?i:r}),pullRequestsSupportedAtom:c(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var E=Dt({catalogValueAtom:x.catalogValueAtom,stateAtom:x.stateAtom,serverConfigValueAtom:b.configValueAtom}),At=kt({catalogValueAtom:x.catalogValueAtom,presentationAtom:E.presentationAtom}),jt=c(null).pipe(n(`web-environment-presentation:empty`));function Mt(e){let t=(0,T.c)(5),n=g(x.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?jt:E.presentationAtom(e),t[0]=e,t[1]=r);let i=g(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Nt={status:`idle`},D=Nt,O=null,k=[],A=0,Pt=new Set;function j(e){D=e;for(let e of Pt)e()}function Ft(e){O?.resolve(e);for(let t of k)t.resolve(e);O=null,k=[]}function It(){return D}function Lt(e){return Pt.add(e),()=>{Pt.delete(e)}}function Rt(){A+=1;let e=!0;return()=>{e&&(e=!1,A=Math.max(0,A-1),A===0&&(Ft(!1),j(Nt)))}}function zt(e,t){if(A!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(O||D.status===`closing`){k.push(r);return}O=r,j({status:`confirming`,message:e,variant:r.variant})})}function Bt(){return D.status!==`idle`||O!==null||k.length>0}function Vt(e){if(D.status!==`confirming`||!O)return;let t=O;O=null,t.resolve(e),j({status:`closing`,message:D.message,variant:D.variant})}function Ht(){if(D.status!==`closing`)return;let e=k.shift();if(!e){j(Nt);return}O=e,j({status:`confirming`,message:e.message,variant:e.variant})}var Ut={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Wt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return Ke(t)?`${n.map(e=>Ut[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Gt=`http://www.w3.org/2000/svg`,Kt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function qt(e,t){let n=Kt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Gt,`svg`);r.setAttribute(`xmlns`,Gt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Gt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Jt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Yt(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var M=null;function Xt(){return M!==null}function Zt(){M?.(),M=null}function Qt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,M===c&&(M=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=Yt(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!Yt(e.target,i)&&l(null)},f=e=>{s&&!Yt(e.target,i)&&(e.preventDefault(),l(null))},p=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ee=(e,t,n,r,o)=>{p(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?qt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=qt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Wt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,Ke(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=qt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ee(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Jt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{p(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{Jt(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),ee(e,t?.x??0,t?.y??0,0),M&&M(),M=c,requestAnimationFrame(()=>{s=!0})})}var $t=`t3code:client-settings:v1`;function en(){return typeof window<`u`}function tn(){return en()?De($t,ae):null}function nn(e){en()&&fe($t,e,ae)}var rn;function an(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>zt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Qt(e,t),close:async()=>{window.desktopBridge||Zt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():tn(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);nn(e)}}}}function on(){return an()}function sn(){if(typeof window<`u`)return rn||(rn=on(),rn)}function cn(){let e=sn();if(!e)throw Error(`Local API not found`);return e}var N=`t3code:theme`,ln=`(prefers-color-scheme: dark)`,P={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function un(){return F()}function dn(){return typeof window>`u`?{}:fn()}function F(){if(typeof window>`u`)return null;try{return yt(window.localStorage.getItem(S))}catch{return null}}function fn(){try{let e=JSON.parse(window.localStorage.getItem(`t3code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function I(e){return`${e?.light??``}|${e?.dark??``}`}var pn=`theme-color`,mn=`meta[name="${pn}"][data-dynamic-theme-color="true"]`,L=class extends me()(`ThemeStorageError`,{operation:ge([`read`,`write`]),storageKey:Te,theme:l(xt),cause:Ue()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},hn=oe(L),gn=class extends me()(`DesktopThemeSyncError`,{theme:xt,cause:Ue()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},_n=oe(gn),R=[],z=null,vn=!0,B=null,V=null,H=null;function U(){vn=!0;for(let e of R)e()}function yn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(ln).matches}function bn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(St);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function xn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(C);if(xn(e))return e}catch{}return bn(e)?`system`:_t(e)??`light`}function Sn(e){if(typeof window<`u`)try{window.localStorage.setItem(C,e)}catch(e){throw new L({operation:`write`,storageKey:C,cause:e})}}function Cn(){if(typeof window>`u`)return P.theme;let e;try{e=window.localStorage.getItem(N)}catch(e){throw new L({operation:`read`,storageKey:N,cause:e})}return e!==null&&wt(e)?bt(e):P.theme}function wn(e){if(typeof window<`u`)try{window.localStorage.setItem(N,e),H=null}catch(t){throw new L({operation:`write`,storageKey:N,theme:e,cause:t})}}function G(){if(H!==null)return P.theme;try{return Cn()}catch(e){let t=hn(e)?e:new L({operation:`read`,storageKey:N,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),P.theme}}function Tn(){let e=document.querySelector(mn);return e||(e=document.createElement(`meta`),e.name=pn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function En(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function Dn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function On(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?En(e.getPropertyValue(`--app-chrome-background`)):null,n=En(getComputedStyle(Dn()).backgroundColor),r=En(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${pn}"]`);if(a.length===0){Tn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?yn():!1,o=F();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&I(V.themeHalves)===I(o)){An(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=ht(e,a,i,r,o);vt(pt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},On(),An(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function kn(e,t,n,r,i=F()){try{await e.setTheme(mt(t,n,r,i))}catch(e){throw new gn({theme:t,cause:e})}}function An(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=F(),a=mt(e,t,n,i);r&&typeof r.setTheme==`function`&&B!==a&&(B=a,kn(r,e,t,n,i).catch(t=>{let n=_n(t)?t:new gn({theme:e,cause:t});console.error(n.message,{theme:n.theme,...v(n)}),B===a&&(B=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function jn(){if(typeof window>`u`)return P;if(!vn&&z)return z;vn=!1;let e=G(),t=W(e),n=t===`system`,r=n?yn():!1,i=F(),a=ht(e,r,n,t,i);return z&&z.theme===e&&z.resolvedTheme===a&&z.systemDark===r&&z.followSystem===n&&z.appearanceMode===t&&I(z.themeHalves)===I(i)||(z={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),z}function Mn(){return P}function Nn(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function Pn(e){e.key===N?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`t3code:theme-follow-system`||e.key===`t3code:theme-appearance-mode`||e.key===`t3code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`t3code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),ft(),V=null,K(G(),{suppressTransitions:!0}),U())}var Fn=null;function In(e){if(typeof window>`u`)return()=>{};if(R.push(e),!Fn){let e=typeof window.matchMedia==`function`?window.matchMedia(ln):null;e?.addEventListener(`change`,Nn),window.addEventListener(`storage`,Pn),Fn=()=>{e?.removeEventListener(`change`,Nn),window.removeEventListener(`storage`,Pn)}}return()=>{R=R.filter(t=>t!==e),R.length===0&&(Fn?.(),Fn=null)}}function Ln(){let e=(0,w.useSyncExternalStore)(In,jn,Mn),{theme:t,resolvedTheme:n}=e,r=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{Sn(W(G()));let t=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{wn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(S,t)}catch{}throw e}}catch(t){let n=hn(t)?t:new L({operation:`write`,storageKey:N,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...v(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{Sn(e)}catch(e){let t=hn(e)?e:new L({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,w.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?_t(t)??`light`:n;return i(r)},[i,t]),o=(0,w.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...fn()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(S):window.localStorage.setItem(S,JSON.stringify(n))}catch(e){let t=new L({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,w.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(S)}catch(e){let t=new L({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,w.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,w.useEffect)(()=>{K(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Rn=o(te(se)),zn=Ee(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Rn(t).pipe(s(e=>e.issue))}),Bn=new Ae(zn,Ne());Se().pipe(be(Ne({space:2})));var Vn=e=>Te.pipe(ke(e,Bn)),Hn={performance:{profile:`performance`,automaticGitFetchInterval:i(15),providerHealthRefreshInterval:h(1),hostPowerMonitorActiveInterval:i(30),hostPowerMonitorIdleInterval:h(2),idleClientTtl:i(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:a,providerHealthRefreshInterval:f,hostPowerMonitorActiveInterval:i(30),hostPowerMonitorIdleInterval:h(5),idleClientTtl:i(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:i(0),providerHealthRefreshInterval:h(15),hostPowerMonitorActiveInterval:h(1),hostPowerMonitorIdleInterval:h(10),idleClientTtl:i(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return Hn[e]}function Un(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Wn(e){let t=Un(e),n=Hn[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return m(e)===m(t)}function Gn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Kn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Wn(e),n=[Un(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(Gn(t,Hn[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Un(e),i=Hn[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function qn(e){let t={schemaVersion:1,profile:le,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||m(e.automaticGitFetchInterval)!==m(a)||m(e.providerHealthRefreshInterval)!==m(f);return Wn(n&&i?{schemaVersion:1,profile:m(e.automaticGitFetchInterval)===m(q(r).automaticGitFetchInterval)&&m(e.providerHealthRefreshInterval)===m(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...m(e.automaticGitFetchInterval)===m(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...m(e.providerHealthRefreshInterval)===m(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Jn(e){let t=qn(e);return Kn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Yn=Vn(de);re(Yn);function Xn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?Le(t.instanceId):We(n)}var Zn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>d.make(e));function Qn(e,t,n){let i=[...Zn.map(e=>[ie(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Zn.includes(t.driver)?[[p.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(i===void 0)return null;let[a,o]=i,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&r(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:we[o]??Pe[o]??`gpt-6-luna`}}function $n(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Re(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&He(i)&&Oe(i)?r:e.textGenerationModelSelection}function er(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Re(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&He(e)&&Oe(e))return r}return $n(e,t,n)}function tr(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function nr(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var rr=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function ir(e){let t={},n={};for(let[r,i]of Object.entries(e))rr.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function ar(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Xn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Ie(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Ie(e,[`continueThreadsAfterServerUpdate`])}function or(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function sr(e){let t=e.atom(je(Ye.pipe(ne(e=>Me(e.state)))),{initialValue:Qe});return{stateAtom:t,stateValueAtom:c(e=>ve(Fe(e(t)),()=>Qe)).pipe(n(`relay-environment-discovery-value`)),refresh:qe(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>Ye.pipe(he(e=>e.refresh))})}}var cr=sr(nt);function lr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:rt(t.entry),relayManaged:Ze(t.entry)}}function ur(){let e=(0,T.c)(7),t=g(x.catalogValueAtom),n=g(x.networkStatusValueAtom),r=g(E.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(dr),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function dr(e){let[t,n]=e;return lr(t,n)}function fr(){return g(it)}function pr(e){let t=(0,T.c)(3),{presentation:n}=Mt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:lr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function mr(){return pr(fr())}function hr(e){let t=(0,T.c)(2),n=ct(e),r;return t[0]===n?r=t[1]:(r=Ce(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function gr(){return g(cr.stateValueAtom)}function _r(){return g(At.environmentIdsAtom)}function vr(){return g(At.identitiesAtom)}function yr(){return g(At.pullRequestsSupportedAtom)}var br=`[CLIENT_SETTINGS]`,xr=new Set,Sr=new Set,Cr=ue,Y=`pending`,X=null,wr=0,Tr=Promise.resolve(),Er=0;function Dr(){for(let e of xr)e()}function Or(){for(let e of Sr)e()}function Z(){return Cr}function kr(e){Cr=e,Dr()}function Ar(e){Y!==e&&(Y=e,Or())}function jr(e){return xr.add(e),Q().catch(()=>void 0),()=>{xr.delete(e)}}function Mr(){return Y===`ready`}function Nr(){return Y}function Pr(e){return Sr.add(e),Q().catch(()=>void 0),()=>{Sr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=wr;Ar(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await cn().persistence.getClientSettings();if(e!==wr)return;t&&kr({...ue,...t}),Ar(`ready`)}catch(t){throw e===wr&&Ar(`failed`),console.error(`${br} hydrate failed`,{operation:`hydrate`,...v(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Fr=e=>cn().persistence.setClientSettings(e);function Ir(e){let t=Tr.then(e);return Tr=t.then(()=>void 0,()=>void 0),t}function Lr(e,t=Fr){let n=Y!==`ready`||Er>0;return n?Er+=1:kr({...Z(),...e}),Ir(async()=>{if(n)try{Y!==`ready`&&await Q(),kr({...Z(),...e})}finally{--Er}await t(Z())}).catch(e=>{console.error(`${br} persist failed`,{operation:`persist`,...v(e)})})}async function Rr(e,t=Fr){return Ir(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return kr(r),r}})}var zr=new Set(Ge(de.fields));function Br(e){let t={},n={};for(let[r,i]of Object.entries(e))zr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Vr(){return Z()}function Hr(){return Q()}function Ur(){return(0,w.useSyncExternalStore)(Pr,Mr,Wr)}function Wr(){return!1}function Gr(){return(0,w.useSyncExternalStore)(Pr,Nr,Kr)}function Kr(){return`pending`}function $(){return(0,w.useSyncExternalStore)(jr,Z,qr)}function qr(){return ue}function Jr(e,t){return{...t,...e,...tr(e,t)}}var Yr=new Set;function Xr(e,t){let n=(0,T.c)(8),r=$(),i=Ur(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=ut(b.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Yr.has(e))return;let n=nr(t,r);n&&(Yr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Yr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,w.useEffect)(s,c)}function Zr(e,t){let n=(0,T.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=Jr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Qr(e){let t=(0,T.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function $r(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function ei(){let e=(0,T.c)(7),t=Ur(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=Ln(),o=(0,w.useSyncExternalStore)(dt,Tt,ti),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=pt(i,a,r),l=Ct(c);s=$r({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??gt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function ti(){return null}async function ni(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Hr(),{...nr(e,Vr()),...t}}function ri(e){let t=(0,T.c)(6),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):ai,t[0]=e,t[1]=n);let r=g(n),i=ut(b.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await ni(r,t)}catch{y.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function ii(e){let t=(0,w.use)(u),n=(0,w.useRef)(new Map),r=ri(e);return(0,w.useCallback)(async(i,a)=>{if(!e)return;let o=b.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Hr()}catch{y.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=tr(c,Vr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&xe(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var ai=c(null);function oi(e){let t=(0,T.c)(5),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):ai,t[0]=e,t[1]=n);let r=g(n),i=$();Xr(e,r);let a=r??Be,o;return t[2]!==i||t[3]!==a?(o=tr(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function si(e,t){let n=(0,T.c)(2),r;n[0]===e?r=n[1]:(r=b.settingsValueAtom(e),n[0]=e,n[1]=r);let i=g(r);return Xr(e,i),Zr(i??Be,t)}function ci(e){let t=(0,T.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=ut(b.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function li(e){let t=mr(),n=g(at);return Xr(t?.environmentId??null,t?.serverConfig?.settings??null),Zr(n,e)}var ui=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function di(){let e=(0,T.c)(2),t=mr(),n;return e[0]===t?n=e[1]:(n=t!==null||!tt(),e[0]=t,e[1]=n),n}function fi(e){let t=(0,T.c)(3),n=e!==void 0&&e,{environments:r}=ur(),i;return t[0]!==r||t[1]!==n?(i=c(e=>r.filter(or).flatMap(t=>{let r=e(lt.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(Fe(r));return i!==null&&ye(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],g(i)}function pi(e){let t=(0,T.c)(10);ot(e,Ve);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=ut(b.updateSettings,n),{environments:i}=ur(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Je(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Xe(t);y.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=fi(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=Br(t),c=e===null||pe(n).every(t=>st(e,t));if(Object.keys(n).length>0&&!c&&y.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=ir(n),c=vi;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=ar(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);if(Object.keys(s).length!==0){if(ee.get(lt.sessionStateAtom(r))._tag!==`Initial`&&!pe(t).every(e=>st(r,e))){l.push(a?.label??r);continue}o.push({environmentId:r,input:{patch:s}})}}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(mi)}}Object.keys(a).length>0&&Lr(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function mi(e){let t=e.flatMap(_i);if(t.length===0)return;let n=e.filter(gi).map(hi);y.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
2
2
  `)})}function hi(e){let{label:t}=e;return t}function gi(e){let{result:t}=e;return t._tag===`Success`}function _i(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Je(n))return[];let r=Xe(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function vi(e){let t=e===void 0?ui:e;return y.add({type:`warning`,title:`Setting not saved`,description:t})}function yi(e){return pi(e)}function bi(){return pi(mr()?.environmentId??null)}function xi(){return Si}function Si(e){return Lr(e)}export{Rt as $,gr as A,Vn as B,hr as C,mr as D,ur as E,Un as F,On as G,un as H,q as I,sn as J,Ln as K,Kn as L,Qn as M,er as N,fr as O,$n as P,It as Q,Jn as R,pr as S,_r as T,dn as U,W as V,Cn as W,Ht as X,Xt as Y,Bt as Z,ii as _,Lr as a,yi as b,Ur as c,oi as d,zt as et,si as f,di as g,li as h,Jr as i,Mt as it,cr as j,yr as k,Gr as l,ci as m,Hr as n,Lt as nt,Rr as o,Xr as p,cn as q,Vr as r,E as rt,Qr as s,ui as t,Vt as tt,ei as u,xi as v,vr as w,bi as x,ri as y,qn as z};
3
- //# sourceMappingURL=useSettings-B_UiwKX2.js.map
3
+ //# sourceMappingURL=useSettings-DYKTOdxY.js.map
@@ -1,2 +1,2 @@
1
- import{dE as e}from"./utils-BSj_I6H5.js";import{t}from"./env-wK1YYxA8.js";import{i as n}from"./dist-xJXPIdFu.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
2
- //# sourceMappingURL=useT3ConnectAuthPrompt-CgOEppM6.js.map
1
+ import{dE as e}from"./utils-vKlT_s3D.js";import{t}from"./env-wK1YYxA8.js";import{i as n}from"./dist-DOyHkZUI.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
2
+ //# sourceMappingURL=useT3ConnectAuthPrompt-DlW3HUgA.js.map